From 038f1fc7483cda870ec39c71af0daf2b7ceb12ca Mon Sep 17 00:00:00 2001 From: antoncoding Date: Fri, 26 Dec 2025 01:47:51 +0800 Subject: [PATCH 1/8] misc: cowswap sdk --- package.json | 2 + pnpm-lock.yaml | 758 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 753 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f3650c4b..f00f6050 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { + "@cowprotocol/cow-sdk": "^7.2.9", + "@cowprotocol/sdk-viem-adapter": "^0.3.0", "@heroicons/react": "^2.2.0", "@internationalized/date": "^3.8.2", "@merkl/api": "^1.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 39e6066a..610536f6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,12 @@ importers: .: dependencies: + '@cowprotocol/cow-sdk': + specifier: ^7.2.9 + version: 7.2.9(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) + '@cowprotocol/sdk-viem-adapter': + specifier: ^0.3.0 + version: 0.3.0(viem@2.40.2(bufferutil@4.0.9)(typescript@5.9.3)(utf-8-validate@5.0.10)(zod@3.25.76)) '@heroicons/react': specifier: ^2.2.0 version: 2.2.0(react@18.3.1) @@ -257,6 +263,9 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@assemblyscript/loader@0.9.4': + resolution: {integrity: sha512-HazVq9zwTVwGmqdwYzu7WyQ6FQVZ7SwET0KKQuKm55jD0IfUpZgN0OPIiZG3zV1iSrVYcN0bdwLRXI/VNCYsUA==} + '@babel/code-frame@7.27.1': resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} @@ -877,6 +886,52 @@ packages: '@coinbase/wallet-sdk@4.3.7': resolution: {integrity: sha512-z6e5XDw6EF06RqkeyEa+qD0dZ2ZbLci99vx3zwDY//XO8X7166tqKJrR2XlQnzVmtcUuJtCd5fCvr9Cu6zzX7w==} + '@cowprotocol/cow-sdk@7.2.9': + resolution: {integrity: sha512-rAy7cG2xz+1z/jUU6avKNmViJWNE//JYxUojPz44kzwkMlrfistFHqO3J6CWyzrfoKdLcN1ZI5PiBX+sgxb1og==} + peerDependencies: + '@openzeppelin/merkle-tree': ^1.x + cross-fetch: ^3.x + ipfs-only-hash: ^4.x + multiformats: ^9.x + peerDependenciesMeta: + '@openzeppelin/merkle-tree': + optional: true + ipfs-only-hash: + optional: true + multiformats: + optional: true + + '@cowprotocol/sdk-app-data@4.5.0': + resolution: {integrity: sha512-+MDjZei/Seb724fyU6UgIDkXfAD9DDVMH1PmgQc8W/Z4Cq4k3PPL8abYBMl2IWP8RvdipMxUnDdAx8rlQp0FXw==} + peerDependencies: + ajv: ^8.x + cross-fetch: ^3.x + ipfs-only-hash: ^4.x + multiformats: ^9.x + + '@cowprotocol/sdk-common@0.4.0': + resolution: {integrity: sha512-ciXiHzTzj7LKZqMKssgyNooZp1nS/mvRE9oO/6DlMQcxVA7/4ajPmk/XzseX/rjdRbSbYyXIEF1oY5w0tcbVjQ==} + + '@cowprotocol/sdk-config@0.6.2': + resolution: {integrity: sha512-L6cPT3pQCrHChRUjWffuYielUlw7TXPbI0o3IvimF/DSpPiGuW+A1g7XSLEGUhNcoKNfQf5YUZPaoenAKl9MNg==} + + '@cowprotocol/sdk-contracts-ts@1.0.0': + resolution: {integrity: sha512-i5clnrOZlixHiWUGrSJXlckx5gHXnQu7hcwiL4ut9PpwmqBpFXitS5mYbFr8Py5UAJZ86QHmiXUodL/392QAAA==} + + '@cowprotocol/sdk-order-book@0.5.0': + resolution: {integrity: sha512-teFVH9FILYGPOpj5v539ogeqAk97kxMxeIG93Dj5G7Qfp+V97/gOKcE8/8Rw0quKt2KQYtyUspspQFhYF4g6SQ==} + + '@cowprotocol/sdk-order-signing@0.1.23': + resolution: {integrity: sha512-TnmGElnPlaUvp5GV+aaJrwXY/csyJZWETeIg56AxBj5xKXC555uamOVCTFO4rM9sHfCVLwS71JZR3WrQcOgfkw==} + + '@cowprotocol/sdk-trading@0.8.0': + resolution: {integrity: sha512-aNxnUBkbxXEkcQyCiL+WZQAFptORtOmQFH7cZq+dDNgOzFIy7xErtQ7PVnDZP497We3+EcJVq50Q7D6b6Gc+BA==} + + '@cowprotocol/sdk-viem-adapter@0.3.0': + resolution: {integrity: sha512-IDCrdSBKaLJsgJR8kPFb5wjIt8Hk3dw4hqZg7nIkHAz36N+feHA2DYucgGOC0r1iuAy0EC+F/XXiemqGMb+nXg==} + peerDependencies: + viem: ^2.28.4 + '@csstools/css-parser-algorithms@3.0.5': resolution: {integrity: sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==} engines: {node: '>=18'} @@ -1494,6 +1549,9 @@ packages: resolution: {integrity: sha512-JEW4DEtBzfe8HvUYecLU9e6+XJnKDlUAIve8FvPzF3Kzs6Xo/KuZkZJsDH0wJXl/qEZbeeE7edxDNY3kMs39hQ==} engines: {node: '>= 18'} + '@multiformats/base-x@4.0.1': + resolution: {integrity: sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw==} + '@next/env@15.5.7': resolution: {integrity: sha512-4h6Y2NyEkIEN7Z8YxkA27pq6zTkS09bUSYC0xjd0NpwFxjnIKeZEeH591o5WECSmjpUhLn3H2QLJcDye3Uzcvg==} @@ -1607,6 +1665,36 @@ packages: '@phosphor-icons/webcomponents@2.1.5': resolution: {integrity: sha512-JcvQkZxvcX2jK+QCclm8+e8HXqtdFW9xV4/kk2aL9Y3dJA2oQVt+pzbv1orkumz3rfx4K9mn9fDoMr1He1yr7Q==} + '@protobufjs/aspromise@1.1.2': + resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} + + '@protobufjs/base64@1.1.2': + resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} + + '@protobufjs/codegen@2.0.4': + resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==} + + '@protobufjs/eventemitter@1.1.0': + resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==} + + '@protobufjs/fetch@1.1.0': + resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==} + + '@protobufjs/float@1.0.2': + resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} + + '@protobufjs/inquire@1.1.0': + resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==} + + '@protobufjs/path@1.1.2': + resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} + + '@protobufjs/pool@1.1.0': + resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} + + '@protobufjs/utf8@1.1.0': + resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} + '@radix-ui/number@1.1.1': resolution: {integrity: sha512-MkKCwxlXTgz6CFoJx3pCwn07GKp36+aZyu/u2Ln2VrA5DcdyCZkASEDBTd8x5whTQQL5CiYf4prXKLcgQdv29g==} @@ -2679,6 +2767,12 @@ packages: '@types/lodash@4.17.20': resolution: {integrity: sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==} + '@types/long@4.0.2': + resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} + + '@types/minimist@1.2.5': + resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} + '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} @@ -2688,6 +2782,9 @@ packages: '@types/node@22.17.2': resolution: {integrity: sha512-gL6z5N9Jm9mhY+U2KXZpteb+09zyffliRkZyZOHODGATyC5B1Jt/7TzuuiLkFsSUMLbS1OLmlj/E+/3KF4Q/4w==} + '@types/normalize-package-data@2.4.4': + resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + '@types/prop-types@15.7.15': resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==} @@ -2975,6 +3072,10 @@ packages: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} + arrify@1.0.1: + resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} + engines: {node: '>=0.10.0'} + astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} @@ -3038,6 +3139,9 @@ packages: big.js@6.2.2: resolution: {integrity: sha512-y/ie+Faknx7sZA5MfGA2xKlu0GDv8RWrXGsmlteyJQ2lvoKv9GBK/fpRMc2qlSoBAgNxrixICFCBefIq8WCQpQ==} + bl@5.1.0: + resolution: {integrity: sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==} + blakejs@1.2.1: resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} @@ -3091,6 +3195,10 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + camelcase-keys@6.2.2: + resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} + engines: {node: '>=8'} + camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -3113,6 +3221,11 @@ packages: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} + cids@1.1.9: + resolution: {integrity: sha512-l11hWRfugIcbGuTZwAM5PwpjPPjyb6UZOGwlHSnOBV5o07XhQ4gNpBN67FbODvpjyHtd+0Xs6KNvUcGBiDRsdg==} + engines: {node: '>=4.0.0', npm: '>=3.0.0'} + deprecated: This module has been superseded by the multiformats module + citty@0.1.6: resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} @@ -3333,6 +3446,10 @@ packages: supports-color: optional: true + decamelize-keys@1.1.1: + resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} + engines: {node: '>=0.10.0'} + decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} @@ -3464,6 +3581,9 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} + err-code@3.0.1: + resolution: {integrity: sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==} + error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -3542,6 +3662,9 @@ packages: '@sinclair/typebox': optional: true + exponential-backoff@3.1.3: + resolution: {integrity: sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==} + exsolve@1.0.8: resolution: {integrity: sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==} @@ -3731,6 +3854,14 @@ packages: h3@1.15.4: resolution: {integrity: sha512-z5cFQWDffyOe4vQ9xIqNfCZdV4p//vy6fBnr8Q1AWnVZ0teurKMG66rLj++TKwKPUP3u7iMUvrvKaEUiQw2QWQ==} + hamt-sharding@2.0.1: + resolution: {integrity: sha512-vnjrmdXG9dDs1m/H4iJ6z0JFI2NtgsW5keRkTcM85NGak69Mkf5PHUqBz+Xs0T4sg0ppvj9O5EGAJo40FTxmmA==} + engines: {node: '>=10.0.0', npm: '>=6.0.0'} + + hard-rejection@2.1.0: + resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} + engines: {node: '>=6'} + harmony-reflect@1.6.2: resolution: {integrity: sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g==} @@ -3767,6 +3898,13 @@ packages: hookified@1.11.0: resolution: {integrity: sha512-aDdIN3GyU5I6wextPplYdfmWCo+aLmjjVbntmX6HLD5RCi/xKsivYEBhnRD+d9224zFf008ZpLMPlWF0ZodYZw==} + hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + + hosted-git-info@4.1.0: + resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} + engines: {node: '>=10'} + html-tags@3.3.1: resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==} engines: {node: '>=8'} @@ -3803,12 +3941,20 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + indent-string@4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + interface-ipld-format@1.0.1: + resolution: {integrity: sha512-WV/ar+KQJVoQpqRDYdo7YPGYIUHJxCuOEhdvsRpzLqoOIVCqPKdMMYmsLL1nCRsF3yYNio+PAJbCKiv6drrEAg==} + deprecated: This module has been superseded by the multiformats module + internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} @@ -3820,6 +3966,23 @@ packages: intl-messageformat@10.7.16: resolution: {integrity: sha512-UmdmHUmp5CIKKjSoE10la5yfU+AYJAaiYLsodbjL4lji83JNvgOQUjGaGhGrpFCb0Uh7sl7qfP1IyILa8Z40ug==} + ipfs-only-hash@4.0.0: + resolution: {integrity: sha512-TE1DZCvfw8i3gcsTq3P4TFx3cKFJ3sluu/J3XINkJhIN9OwJgNMqKA+WnKx6ByCb1IoPXsTp1KM7tupElb6SyA==} + hasBin: true + + ipfs-unixfs-importer@7.0.3: + resolution: {integrity: sha512-qeFOlD3AQtGzr90sr5Tq1Bi8pT5Nr2tSI8z310m7R4JDYgZc6J1PEZO3XZQ8l1kuGoqlAppBZuOYmPEqaHcVQQ==} + engines: {node: '>=14.0.0', npm: '>=7.0.0'} + + ipfs-unixfs@4.0.3: + resolution: {integrity: sha512-hzJ3X4vlKT8FQ3Xc4M1szaFVjsc1ZydN+E4VQ91aXxfpjFn9G2wsMo1EFdAXNq/BUnN5dgqIOMP5zRYr3DTsAw==} + engines: {node: '>=14.0.0', npm: '>=7.0.0'} + + ipld-dag-pb@0.22.3: + resolution: {integrity: sha512-dfG5C5OVAR4FEP7Al2CrHWvAyIM7UhAQrjnOYOIxXGQz5NlEj6wGX0XQf6Ru6or1na6upvV3NQfstapQG8X2rg==} + engines: {node: '>=6.0.0', npm: '>=3.0.0'} + deprecated: This module has been superseded by @ipld/dag-pb and multiformats + iron-webcrypto@1.2.1: resolution: {integrity: sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==} @@ -3888,6 +4051,14 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-plain-obj@1.1.0: + resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} + engines: {node: '>=0.10.0'} + + is-plain-obj@2.1.0: + resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} + engines: {node: '>=8'} + is-plain-obj@4.1.0: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} @@ -3960,6 +4131,18 @@ packages: peerDependencies: ws: '*' + it-all@1.0.6: + resolution: {integrity: sha512-3cmCc6Heqe3uWi3CVM/k51fa/XbMFpQVzFoDsV0IZNHSQDyAXl3c4MjHkFX5kF3922OGj7Myv1nSEUgRtcuM1A==} + + it-batch@1.0.9: + resolution: {integrity: sha512-7Q7HXewMhNFltTsAMdSz6luNhyhkhEtGGbYek/8Xb/GiqYMtwUmopE1ocPSiJKKp3rM4Dt045sNFoUu+KZGNyA==} + + it-first@1.0.7: + resolution: {integrity: sha512-nvJKZoBpZD/6Rtde6FXqwDqDZGF1sCADmr2Zoc0hZsIvnE449gRFnGctxDf09Bzc/FWnHXAdaHVIetY6lrE0/g==} + + it-parallel-batch@1.0.11: + resolution: {integrity: sha512-UWsWHv/kqBpMRmyZJzlmZeoAMA0F3SZr08FBdbhtbe+MtoEBgr/ZUAKrnenhXCBrsopy76QjRH2K/V8kNdupbQ==} + jayson@4.2.0: resolution: {integrity: sha512-VfJ9t1YLwacIubLhONk0KFeosUBwstRWQ0IRT1KDjEjnVnSOVHC3uwugyV7L0c7R9lpVyrUGT2XWiBA1UTtpyg==} engines: {node: '>=8'} @@ -3976,6 +4159,9 @@ packages: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} + js-sha3@0.8.0: + resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -3999,6 +4185,10 @@ packages: json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + json-stringify-deterministic@1.0.12: + resolution: {integrity: sha512-q3PN0lbUdv0pmurkBNdJH3pfFvOTL/Zp0lquqpvcjfKzt6Y0j49EPHAmVHCAS4Ceq/Y+PejWTzyiVpoY71+D6g==} + engines: {node: '>= 4'} + json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} @@ -4010,6 +4200,9 @@ packages: jsonc-parser@3.3.1: resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + just-performance@4.3.0: + resolution: {integrity: sha512-L7RjvtJsL0QO8xFs5wEoDDzzJwoiowRw6Rn/GnvldlchS2JQr9wFYPiwZcDfrbbujEKqKN0tvENdbjXdYhDp5Q==} + keyv@5.5.0: resolution: {integrity: sha512-QG7qR2tijh1ftOvClut4YKKg1iW6cx3GZsKoGyJPxHkGWK9oJhG9P3j5deP0QQOGDowBMVQFaP+Vm4NpGYvmIQ==} @@ -4093,6 +4286,12 @@ packages: resolution: {integrity: sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==} engines: {node: '>= 12.0.0'} + limiter@2.1.0: + resolution: {integrity: sha512-361TYz6iay6n+9KvUUImqdLuFigK+K79qrUtBsXhJTLdH4rIt/r1y8r1iozwh8KbZNpujbFTSh74mJ7bwbAMOw==} + + limiter@3.0.0: + resolution: {integrity: sha512-hev7DuXojsTFl2YwyzUJMDnZ/qBDd3yZQLSH3aD4tdL1cqfc3TMnoecEJtWFaQFdErZsKoFMBTxF/FBSkgDbEg==} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -4130,6 +4329,9 @@ packages: lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + long@4.0.0: + resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} + loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -4144,6 +4346,10 @@ packages: lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + lru-cache@6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true @@ -4151,6 +4357,14 @@ packages: magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + map-obj@1.0.1: + resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} + engines: {node: '>=0.10.0'} + + map-obj@4.3.0: + resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} + engines: {node: '>=8'} + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} @@ -4168,6 +4382,14 @@ packages: resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==} engines: {node: '>=18'} + meow@9.0.0: + resolution: {integrity: sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==} + engines: {node: '>=10'} + + merge-options@3.0.4: + resolution: {integrity: sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==} + engines: {node: '>=10'} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -4187,10 +4409,18 @@ packages: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} + min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + minimatch@10.1.1: resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} engines: {node: 20 || >=22} + minimist-options@4.1.0: + resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} + engines: {node: '>= 6'} + minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -4221,9 +4451,30 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + multibase@4.0.6: + resolution: {integrity: sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ==} + engines: {node: '>=12.0.0', npm: '>=6.0.0'} + deprecated: This module has been superseded by the multiformats module + + multicodec@3.2.1: + resolution: {integrity: sha512-+expTPftro8VAW8kfvcuNNNBgb9gPeNYV9dn+z1kJRWF2vih+/S79f2RVeIwmrJBUJ6NT9IUPWnZDQvegEh5pw==} + deprecated: This module has been superseded by the multiformats module + multiformats@9.9.0: resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} + multihashes@4.0.3: + resolution: {integrity: sha512-0AhMH7Iu95XjDLxIeuCOOE4t9+vQZsACyKZ9Fxw2pcsRmlX4iCn1mby0hS0bb+nQOVpdQYWPpnyusw4da5RPhA==} + engines: {node: '>=12.0.0', npm: '>=6.0.0'} + + multihashing-async@2.1.4: + resolution: {integrity: sha512-sB1MiQXPSBTNRVSJc2zM157PXgDtud2nMFUEIvBrsq5Wv96sUclMRK/ecjoP1T/W61UJBqt4tCTwMkUpt2Gbzg==} + engines: {node: '>=12.0.0', npm: '>=6.0.0'} + + murmurhash3js-revisited@3.0.0: + resolution: {integrity: sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==} + engines: {node: '>=8.0.0'} + nanoid@3.3.11: resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -4278,6 +4529,13 @@ packages: node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} + normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + + normalize-package-data@3.0.3: + resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} + engines: {node: '>=10'} + normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -4543,6 +4801,10 @@ packages: prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + protobufjs@6.11.4: + resolution: {integrity: sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==} + hasBin: true + proxy-compare@2.6.0: resolution: {integrity: sha512-8xuCeM3l8yqdmbPoYeLbrAXCBWu19XEYc5/F28f5qOaoAIMyfmBUkl5axiK+x9olUvRlcekvnm98AP9RDngOIw==} @@ -4570,6 +4832,14 @@ packages: quick-format-unescaped@4.0.4: resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} + quick-lru@4.0.1: + resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} + engines: {node: '>=8'} + + rabin-wasm@0.1.5: + resolution: {integrity: sha512-uWgQTo7pim1Rnj5TuWcCewRDTf0PEFTSlaUjWP4eY9EbLV9em08v89oCz/WO+wRxpYuO36XEHp4wgYQnAgOHzA==} + hasBin: true + radix3@1.1.2: resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==} @@ -4668,6 +4938,14 @@ packages: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} + read-pkg-up@7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + + read-pkg@5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} @@ -4701,6 +4979,10 @@ packages: react: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + redent@3.0.0: + resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} + engines: {node: '>=8'} + regenerate-unicode-properties@10.2.0: resolution: {integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==} engines: {node: '>=4'} @@ -4780,6 +5062,10 @@ packages: secure-json-parse@4.1.0: resolution: {integrity: sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA==} + semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -4863,6 +5149,21 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + sparse-array@1.3.2: + resolution: {integrity: sha512-ZT711fePGn3+kQyLuv1fpd3rNSkNF8vd5Kv2D+qnOANeyKs3fx6bUMGWRPvgTTcYV64QMqZKZwcuaQSP3AZ0tg==} + + spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + + spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + + spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + + spdx-license-ids@3.0.22: + resolution: {integrity: sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==} + split-on-first@1.1.0: resolution: {integrity: sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==} engines: {node: '>=6'} @@ -4871,6 +5172,10 @@ packages: resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} engines: {node: '>= 10.x'} + stable@0.1.8: + resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} + deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' + stop-iteration-iterator@1.1.0: resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} @@ -4902,6 +5207,10 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} + strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + strip-json-comments@5.0.3: resolution: {integrity: sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==} engines: {node: '>=14.16'} @@ -5021,6 +5330,10 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + trim-newlines@3.0.1: + resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} + engines: {node: '>=8'} + trough@2.2.0: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} @@ -5060,6 +5373,18 @@ packages: engines: {node: '>=18.0.0'} hasBin: true + type-fest@0.18.1: + resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} + engines: {node: '>=10'} + + type-fest@0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + + type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -5072,6 +5397,9 @@ packages: resolution: {integrity: sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==} engines: {node: '>=18'} + uint8arrays@2.1.10: + resolution: {integrity: sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==} + uint8arrays@3.1.0: resolution: {integrity: sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==} @@ -5226,6 +5554,9 @@ packages: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true + validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + valtio@1.13.2: resolution: {integrity: sha512-Qik0o+DSy741TmkqmRfjq+0xpZBXi/Y6+fXZLn0xNF1z/waFMbE3rkivv5Zcf9RrMUp6zswf2J7sbh2KBlba5A==} engines: {node: '>=12.20.0'} @@ -5250,6 +5581,12 @@ packages: react: optional: true + varint@5.0.2: + resolution: {integrity: sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==} + + varint@6.0.0: + resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} + vfile-message@4.0.3: resolution: {integrity: sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==} @@ -5386,10 +5723,17 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} + yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} engines: {node: '>=8'} @@ -5450,6 +5794,8 @@ snapshots: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.30 + '@assemblyscript/loader@0.9.4': {} + '@babel/code-frame@7.27.1': dependencies: '@babel/helper-validator-identifier': 7.27.1 @@ -6289,6 +6635,84 @@ snapshots: - zod optional: true + '@cowprotocol/cow-sdk@7.2.9(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0)': + dependencies: + '@cowprotocol/sdk-app-data': 4.5.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) + '@cowprotocol/sdk-common': 0.4.0 + '@cowprotocol/sdk-config': 0.6.2 + '@cowprotocol/sdk-contracts-ts': 1.0.0 + '@cowprotocol/sdk-order-book': 0.5.0 + '@cowprotocol/sdk-order-signing': 0.1.23 + '@cowprotocol/sdk-trading': 0.8.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) + cross-fetch: 4.1.0 + optionalDependencies: + ipfs-only-hash: 4.0.0 + multiformats: 9.9.0 + transitivePeerDependencies: + - ajv + - encoding + + '@cowprotocol/sdk-app-data@4.5.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0)': + dependencies: + '@cowprotocol/sdk-common': 0.4.0 + ajv: 8.17.1 + cross-fetch: 4.1.0 + ipfs-only-hash: 4.0.0 + json-stringify-deterministic: 1.0.12 + multiformats: 9.9.0 + + '@cowprotocol/sdk-common@0.4.0': {} + + '@cowprotocol/sdk-config@0.6.2': + dependencies: + exponential-backoff: 3.1.3 + limiter: 2.1.0 + + '@cowprotocol/sdk-contracts-ts@1.0.0': + dependencies: + '@cowprotocol/sdk-common': 0.4.0 + '@cowprotocol/sdk-config': 0.6.2 + + '@cowprotocol/sdk-order-book@0.5.0': + dependencies: + '@cowprotocol/sdk-common': 0.4.0 + '@cowprotocol/sdk-config': 0.6.2 + cross-fetch: 3.2.0 + exponential-backoff: 3.1.3 + limiter: 3.0.0 + transitivePeerDependencies: + - encoding + + '@cowprotocol/sdk-order-signing@0.1.23': + dependencies: + '@cowprotocol/sdk-common': 0.4.0 + '@cowprotocol/sdk-config': 0.6.2 + '@cowprotocol/sdk-contracts-ts': 1.0.0 + '@cowprotocol/sdk-order-book': 0.5.0 + transitivePeerDependencies: + - encoding + + '@cowprotocol/sdk-trading@0.8.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0)': + dependencies: + '@cowprotocol/sdk-app-data': 4.5.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) + '@cowprotocol/sdk-common': 0.4.0 + '@cowprotocol/sdk-config': 0.6.2 + '@cowprotocol/sdk-contracts-ts': 1.0.0 + '@cowprotocol/sdk-order-book': 0.5.0 + '@cowprotocol/sdk-order-signing': 0.1.23 + deepmerge: 4.3.1 + transitivePeerDependencies: + - ajv + - cross-fetch + - encoding + - ipfs-only-hash + - multiformats + + '@cowprotocol/sdk-viem-adapter@0.3.0(viem@2.40.2(bufferutil@4.0.9)(typescript@5.9.3)(utf-8-validate@5.0.10)(zod@3.25.76))': + dependencies: + '@cowprotocol/sdk-common': 0.4.0 + viem: 2.40.2(bufferutil@4.0.9)(typescript@5.9.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4)': dependencies: '@csstools/css-tokenizer': 3.0.4 @@ -6894,6 +7318,8 @@ snapshots: '@msgpack/msgpack@3.1.2': {} + '@multiformats/base-x@4.0.1': {} + '@next/env@15.5.7': {} '@next/swc-darwin-arm64@15.5.7': @@ -6976,6 +7402,29 @@ snapshots: dependencies: lit: 3.3.0 + '@protobufjs/aspromise@1.1.2': {} + + '@protobufjs/base64@1.1.2': {} + + '@protobufjs/codegen@2.0.4': {} + + '@protobufjs/eventemitter@1.1.0': {} + + '@protobufjs/fetch@1.1.0': + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/inquire': 1.1.0 + + '@protobufjs/float@1.0.2': {} + + '@protobufjs/inquire@1.1.0': {} + + '@protobufjs/path@1.1.2': {} + + '@protobufjs/pool@1.1.0': {} + + '@protobufjs/utf8@1.1.0': {} + '@radix-ui/number@1.1.1': {} '@radix-ui/primitive@1.1.3': {} @@ -8836,6 +9285,10 @@ snapshots: '@types/lodash@4.17.20': {} + '@types/long@4.0.2': {} + + '@types/minimist@1.2.5': {} + '@types/ms@2.1.0': optional: true @@ -8846,6 +9299,8 @@ snapshots: dependencies: undici-types: 6.21.0 + '@types/normalize-package-data@2.4.4': {} + '@types/prop-types@15.7.15': {} '@types/react-dom@18.3.7(@types/react@18.3.23)': @@ -9727,6 +10182,8 @@ snapshots: array-union@2.1.0: {} + arrify@1.0.1: {} + astral-regex@2.0.0: {} asynckit@0.4.0: @@ -9802,6 +10259,12 @@ snapshots: big.js@6.2.2: {} + bl@5.1.0: + dependencies: + buffer: 6.0.3 + inherits: 2.0.4 + readable-stream: 3.6.2 + blakejs@1.2.1: {} bn.js@5.2.2: @@ -9871,6 +10334,12 @@ snapshots: callsites@3.1.0: {} + camelcase-keys@6.2.2: + dependencies: + camelcase: 5.3.1 + map-obj: 4.3.0 + quick-lru: 4.0.1 + camelcase@5.3.1: {} caniuse-lite@1.0.30001735: {} @@ -9890,6 +10359,13 @@ snapshots: dependencies: readdirp: 4.1.2 + cids@1.1.9: + dependencies: + multibase: 4.0.6 + multicodec: 3.2.1 + multihashes: 4.0.3 + uint8arrays: 3.1.1 + citty@0.1.6: dependencies: consola: 3.4.2 @@ -9986,7 +10462,6 @@ snapshots: node-fetch: 2.7.0 transitivePeerDependencies: - encoding - optional: true crossws@0.3.5: dependencies: @@ -10075,6 +10550,11 @@ snapshots: dependencies: ms: 2.1.3 + decamelize-keys@1.1.1: + dependencies: + decamelize: 1.2.0 + map-obj: 1.0.1 + decamelize@1.2.0: {} decimal.js-light@2.5.1: {} @@ -10237,6 +10717,8 @@ snapshots: env-paths@2.2.1: {} + err-code@3.0.1: {} + error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -10344,6 +10826,8 @@ snapshots: optionalDependencies: '@sinclair/typebox': 0.34.41 + exponential-backoff@3.1.3: {} + exsolve@1.0.8: {} extend@3.0.2: {} @@ -10544,6 +11028,13 @@ snapshots: ufo: 1.6.1 uncrypto: 0.1.3 + hamt-sharding@2.0.1: + dependencies: + sparse-array: 1.3.2 + uint8arrays: 3.1.1 + + hard-rejection@2.1.0: {} + harmony-reflect@1.6.2: {} has-bigints@1.1.0: {} @@ -10571,6 +11062,12 @@ snapshots: hookified@1.11.0: {} + hosted-git-info@2.8.9: {} + + hosted-git-info@4.1.0: + dependencies: + lru-cache: 6.0.0 + html-tags@3.3.1: {} humanize-ms@1.2.1: @@ -10600,11 +11097,18 @@ snapshots: imurmurhash@0.1.4: {} - inherits@2.0.4: - optional: true + indent-string@4.0.0: {} + + inherits@2.0.4: {} ini@1.3.8: {} + interface-ipld-format@1.0.1: + dependencies: + cids: 1.1.9 + multicodec: 3.2.1 + multihashes: 4.0.3 + internal-slot@1.1.0: dependencies: es-errors: 1.3.0 @@ -10620,6 +11124,49 @@ snapshots: '@formatjs/icu-messageformat-parser': 2.11.2 tslib: 2.8.1 + ipfs-only-hash@4.0.0: + dependencies: + ipfs-unixfs-importer: 7.0.3 + meow: 9.0.0 + transitivePeerDependencies: + - encoding + - supports-color + + ipfs-unixfs-importer@7.0.3: + dependencies: + bl: 5.1.0 + cids: 1.1.9 + err-code: 3.0.1 + hamt-sharding: 2.0.1 + ipfs-unixfs: 4.0.3 + ipld-dag-pb: 0.22.3 + it-all: 1.0.6 + it-batch: 1.0.9 + it-first: 1.0.7 + it-parallel-batch: 1.0.11 + merge-options: 3.0.4 + multihashing-async: 2.1.4 + rabin-wasm: 0.1.5 + uint8arrays: 2.1.10 + transitivePeerDependencies: + - encoding + - supports-color + + ipfs-unixfs@4.0.3: + dependencies: + err-code: 3.0.1 + protobufjs: 6.11.4 + + ipld-dag-pb@0.22.3: + dependencies: + cids: 1.1.9 + interface-ipld-format: 1.0.1 + multicodec: 3.2.1 + multihashing-async: 2.1.4 + protobufjs: 6.11.4 + stable: 0.1.8 + uint8arrays: 2.1.10 + iron-webcrypto@1.2.1: {} is-arguments@1.2.0: @@ -10685,6 +11232,10 @@ snapshots: is-number@7.0.0: {} + is-plain-obj@1.1.0: {} + + is-plain-obj@2.1.0: {} + is-plain-obj@4.1.0: {} is-plain-object@5.0.0: {} @@ -10752,6 +11303,16 @@ snapshots: dependencies: ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) + it-all@1.0.6: {} + + it-batch@1.0.9: {} + + it-first@1.0.7: {} + + it-parallel-batch@1.0.11: + dependencies: + it-batch: 1.0.9 + jayson@4.2.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): dependencies: '@types/connect': 3.4.38 @@ -10778,6 +11339,8 @@ snapshots: joycon@3.1.1: {} + js-sha3@0.8.0: {} + js-tokens@4.0.0: {} js-yaml@4.1.0: @@ -10792,6 +11355,8 @@ snapshots: json-schema-traverse@1.0.0: {} + json-stringify-deterministic@1.0.12: {} + json-stringify-safe@5.0.1: optional: true @@ -10799,6 +11364,8 @@ snapshots: jsonc-parser@3.3.1: {} + just-performance@4.3.0: {} + keyv@5.5.0: dependencies: '@keyv/serialize': 1.1.0 @@ -10858,6 +11425,12 @@ snapshots: lightningcss-win32-arm64-msvc: 1.30.2 lightningcss-win32-x64-msvc: 1.30.2 + limiter@2.1.0: + dependencies: + just-performance: 4.3.0 + + limiter@3.0.0: {} + lines-and-columns@1.2.4: {} lit-element@4.2.1: @@ -10897,6 +11470,8 @@ snapshots: lodash@4.17.21: {} + long@4.0.0: {} + loose-envify@1.4.0: dependencies: js-tokens: 4.0.0 @@ -10909,12 +11484,20 @@ snapshots: dependencies: yallist: 3.1.1 + lru-cache@6.0.0: + dependencies: + yallist: 4.0.0 + lz-string@1.5.0: {} magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 + map-obj@1.0.1: {} + + map-obj@4.3.0: {} + math-intrinsics@1.1.0: {} mathml-tag-names@2.1.3: {} @@ -10930,6 +11513,25 @@ snapshots: meow@13.2.0: {} + meow@9.0.0: + dependencies: + '@types/minimist': 1.2.5 + camelcase-keys: 6.2.2 + decamelize: 1.2.0 + decamelize-keys: 1.1.1 + hard-rejection: 2.1.0 + minimist-options: 4.1.0 + normalize-package-data: 3.0.3 + read-pkg-up: 7.0.1 + redent: 3.0.0 + trim-newlines: 3.0.1 + type-fest: 0.18.1 + yargs-parser: 20.2.9 + + merge-options@3.0.4: + dependencies: + is-plain-obj: 2.1.0 + merge2@1.4.1: {} micro-ftch@0.3.1: @@ -10948,10 +11550,18 @@ snapshots: mime-db: 1.52.0 optional: true + min-indent@1.0.1: {} + minimatch@10.1.1: dependencies: '@isaacs/brace-expansion': 5.0.0 + minimist-options@4.1.0: + dependencies: + arrify: 1.0.1 + is-plain-obj: 1.1.0 + kind-of: 6.0.3 + minimist@1.2.8: {} minipass@7.1.2: {} @@ -10973,8 +11583,34 @@ snapshots: ms@2.1.3: {} + multibase@4.0.6: + dependencies: + '@multiformats/base-x': 4.0.1 + + multicodec@3.2.1: + dependencies: + uint8arrays: 3.1.1 + varint: 6.0.0 + multiformats@9.9.0: {} + multihashes@4.0.3: + dependencies: + multibase: 4.0.6 + uint8arrays: 3.1.1 + varint: 5.0.2 + + multihashing-async@2.1.4: + dependencies: + blakejs: 1.2.1 + err-code: 3.0.1 + js-sha3: 0.8.0 + multihashes: 4.0.3 + murmurhash3js-revisited: 3.0.0 + uint8arrays: 3.1.1 + + murmurhash3js-revisited@3.0.0: {} + nanoid@3.3.11: {} next-themes@0.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): @@ -11018,6 +11654,20 @@ snapshots: node-releases@2.0.19: {} + normalize-package-data@2.5.0: + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.10 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + + normalize-package-data@3.0.3: + dependencies: + hosted-git-info: 4.1.0 + is-core-module: 2.16.1 + semver: 7.7.2 + validate-npm-package-license: 3.0.4 + normalize-path@3.0.0: {} normalize-range@0.1.2: {} @@ -11369,6 +12019,22 @@ snapshots: object-assign: 4.1.1 react-is: 16.13.1 + protobufjs@6.11.4: + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/base64': 1.1.2 + '@protobufjs/codegen': 2.0.4 + '@protobufjs/eventemitter': 1.1.0 + '@protobufjs/fetch': 1.1.0 + '@protobufjs/float': 1.0.2 + '@protobufjs/inquire': 1.1.0 + '@protobufjs/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.0 + '@types/long': 4.0.2 + '@types/node': 22.17.2 + long: 4.0.0 + proxy-compare@2.6.0: optional: true @@ -11401,6 +12067,20 @@ snapshots: quick-format-unescaped@4.0.4: {} + quick-lru@4.0.1: {} + + rabin-wasm@0.1.5: + dependencies: + '@assemblyscript/loader': 0.9.4 + bl: 5.1.0 + debug: 4.4.3 + minimist: 1.2.8 + node-fetch: 2.7.0 + readable-stream: 3.6.2 + transitivePeerDependencies: + - encoding + - supports-color + radix3@1.1.2: {} react-day-picker@9.13.0(react@18.3.1): @@ -11495,6 +12175,19 @@ snapshots: dependencies: loose-envify: 1.4.0 + read-pkg-up@7.0.1: + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + + read-pkg@5.2.0: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + readable-stream@2.3.8: dependencies: core-util-is: 1.0.3 @@ -11511,7 +12204,6 @@ snapshots: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 - optional: true readable-stream@4.7.0: dependencies: @@ -11546,6 +12238,11 @@ snapshots: tiny-invariant: 1.3.3 victory-vendor: 36.9.2 + redent@3.0.0: + dependencies: + indent-string: 4.0.0 + strip-indent: 3.0.0 + regenerate-unicode-properties@10.2.0: dependencies: regenerate: 1.4.2 @@ -11617,8 +12314,7 @@ snapshots: safe-buffer@5.1.2: optional: true - safe-buffer@5.2.1: - optional: true + safe-buffer@5.2.1: {} safe-regex-test@1.1.0: dependencies: @@ -11634,6 +12330,8 @@ snapshots: secure-json-parse@4.1.0: {} + semver@5.7.2: {} + semver@6.3.1: {} semver@7.7.2: {} @@ -11789,11 +12487,29 @@ snapshots: source-map-js@1.2.1: {} + sparse-array@1.3.2: {} + + spdx-correct@3.2.0: + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.22 + + spdx-exceptions@2.5.0: {} + + spdx-expression-parse@3.0.1: + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.22 + + spdx-license-ids@3.0.22: {} + split-on-first@1.1.0: optional: true split2@4.2.0: {} + stable@0.1.8: {} + stop-iteration-iterator@1.1.0: dependencies: es-errors: 1.3.0 @@ -11827,12 +12543,15 @@ snapshots: string_decoder@1.3.0: dependencies: safe-buffer: 5.2.1 - optional: true strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 + strip-indent@3.0.0: + dependencies: + min-indent: 1.0.1 + strip-json-comments@5.0.3: {} strtok3@10.3.4: @@ -11974,6 +12693,8 @@ snapshots: tr46@0.0.3: {} + trim-newlines@3.0.1: {} + trough@2.2.0: {} trpc-cli@0.12.1(@trpc/server@11.7.2(typescript@5.9.3))(zod@4.1.13): @@ -11994,12 +12715,22 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + type-fest@0.18.1: {} + + type-fest@0.6.0: {} + + type-fest@0.8.1: {} + typescript@5.9.3: {} ufo@1.6.1: {} uint8array-extras@1.5.0: {} + uint8arrays@2.1.10: + dependencies: + multiformats: 9.9.0 + uint8arrays@3.1.0: dependencies: multiformats: 9.9.0 @@ -12123,6 +12854,11 @@ snapshots: uuid@9.0.1: optional: true + validate-npm-package-license@3.0.4: + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + valtio@1.13.2(@types/react@18.3.23)(react@18.3.1): dependencies: derive-valtio: 0.1.0(valtio@1.13.2(@types/react@18.3.23)(react@18.3.1)) @@ -12140,6 +12876,10 @@ snapshots: '@types/react': 18.3.23 react: 18.3.1 + varint@5.0.2: {} + + varint@6.0.0: {} + vfile-message@4.0.3: dependencies: '@types/unist': 3.0.3 @@ -12327,11 +13067,15 @@ snapshots: yallist@3.1.1: {} + yallist@4.0.0: {} + yargs-parser@18.1.3: dependencies: camelcase: 5.3.1 decamelize: 1.2.0 + yargs-parser@20.2.9: {} + yargs@15.4.1: dependencies: cliui: 6.0.0 From 660987fe52613ef7370421ea291d33bf492262c5 Mon Sep 17 00:00:00 2001 From: antoncoding Date: Fri, 26 Dec 2025 01:48:06 +0800 Subject: [PATCH 2/8] feat: swap --- .../swap/components/BridgeSwapModal.tsx | 281 ++++++++++++++++++ src/features/swap/components/SwapButton.tsx | 41 +++ .../swap/components/TokenSelector.tsx | 150 ++++++++++ src/features/swap/cowBridgingSdk.ts | 20 ++ src/features/swap/hooks/useCowBridge.ts | 279 +++++++++++++++++ src/features/swap/types.ts | 44 +++ 6 files changed, 815 insertions(+) create mode 100644 src/features/swap/components/BridgeSwapModal.tsx create mode 100644 src/features/swap/components/SwapButton.tsx create mode 100644 src/features/swap/components/TokenSelector.tsx create mode 100644 src/features/swap/cowBridgingSdk.ts create mode 100644 src/features/swap/hooks/useCowBridge.ts create mode 100644 src/features/swap/types.ts diff --git a/src/features/swap/components/BridgeSwapModal.tsx b/src/features/swap/components/BridgeSwapModal.tsx new file mode 100644 index 00000000..3c7a3c93 --- /dev/null +++ b/src/features/swap/components/BridgeSwapModal.tsx @@ -0,0 +1,281 @@ +import { useMemo, useState } from 'react'; +import { ArrowDownIcon, ExternalLinkIcon } from '@radix-ui/react-icons'; +import { formatUnits, parseUnits } from 'viem'; +import { Modal, ModalBody, ModalFooter, ModalHeader } from '@/components/common/Modal'; +import { Button } from '@/components/ui/button'; +import Input from '@/components/Input/Input'; +import { useUserBalances } from '@/hooks/useUserBalances'; +import { TokenIcon } from '@/components/shared/token-icon'; +import { NetworkIcon } from '@/components/shared/network-icon'; +import { getNetworkName } from '@/utils/networks'; +import { useCowBridge } from '../hooks/useCowBridge'; +import { TokenSelector } from './TokenSelector'; +import { COW_BRIDGE_CHAINS, type SwapToken } from '../types'; + +type BridgeSwapModalProps = { + isOpen: boolean; + onClose: () => void; + targetToken: SwapToken; +}; + +export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModalProps) { + const [sourceToken, setSourceToken] = useState(null); + const [amount, setAmount] = useState(BigInt(0)); + const [slippage, setSlippage] = useState(0.5); // 0.5% + const [amountError, setAmountError] = useState(null); + + // Fetch user balances from CoW-supported chains + const { balances, loading: balancesLoading } = useUserBalances({ + networkIds: COW_BRIDGE_CHAINS as unknown as number[], + }); + + // Convert balances to SwapTokens + const availableTokens = useMemo(() => { + return balances + .filter((b) => BigInt(b.balance) > BigInt(0)) // Only show tokens with balance + .map((b) => ({ + address: b.address as `0x${string}`, + symbol: b.symbol, + chainId: b.chainId, + decimals: b.decimals, + balance: BigInt(b.balance), + })) + .sort((a, b) => { + // Sort by balance (descending) + const aValue = Number(formatUnits(a.balance ?? BigInt(0), a.decimals)); + const bValue = Number(formatUnits(b.balance ?? BigInt(0), b.decimals)); + return bValue - aValue; + }); + }, [balances]); + + // CoW Bridge hook + const { + quote, + isQuoting, + isApproving, + isExecuting, + needsApproval, + currentAllowance, + error: swapError, + orderUid, + approveToken, + executeSwap, + reset, + } = useCowBridge({ + sourceToken, + targetToken, + amount, + slippageBps: Math.round(slippage * 100), + }); + + const handleSourceTokenSelect = (token: SwapToken) => { + setSourceToken(token); + setAmount(BigInt(0)); + setAmountError(null); + }; + + const handleMaxClick = () => { + if (sourceToken?.balance) { + setAmount(sourceToken.balance); + } + }; + + const handleClose = () => { + reset(); + setSourceToken(null); + setAmount(BigInt(0)); + setAmountError(null); + onClose(); + }; + + const isLoading = isQuoting || isApproving || isExecuting; + const canExecute = quote && !needsApproval && !isExecuting && amount > BigInt(0); + + return ( + + + + +
+ {/* Source Token Selector */} + + + {/* Amount Input */} + {sourceToken && ( +
+
Amount
+ + {amountError &&

{amountError}

} +
+ )} + + {/* Arrow Indicator */} + {sourceToken && ( +
+ +
+ )} + + {/* Target Token Display */} + {sourceToken && ( +
+
To
+
+ + {targetToken.symbol} +
+ + {getNetworkName(targetToken.chainId)} +
+
+
+ )} + + {/* Quote Display */} + {quote && sourceToken && ( +
+
+ You receive + + {Number(formatUnits(quote.buyAmount, targetToken.decimals)).toFixed(6)} {targetToken.symbol} + +
+ + {quote.type === 'cross-chain' && ( + <> +
+ Type + Cross-chain swap +
+
+ Bridge + {quote.bridgeProvider} +
+ {quote.estimatedTimeSeconds && ( +
+ Estimated time + {Math.ceil(quote.estimatedTimeSeconds / 60)} minutes +
+ )} + {quote.bridgeFee && ( +
+ Bridge fee + + {Number(formatUnits(quote.bridgeFee, sourceToken.decimals)).toFixed(6)}{' '} + {sourceToken.symbol} + +
+ )} + + )} + + {quote.type === 'same-chain' && ( +
+ Type + Same-chain swap +
+ )} +
+ )} + + {/* Slippage Setting */} + {sourceToken && ( +
+ Slippage tolerance: + setSlippage(Number(e.target.value))} + className="bg-hovered w-16 rounded-sm p-1 text-sm focus:border-primary focus:outline-none" + /> + % +
+ )} + + {/* Approval Warning */} + {needsApproval && currentAllowance !== null && sourceToken && ( +
+

⚠️ Approval Required

+

+ You need to approve CoW Protocol to spend your {sourceToken.symbol} +

+ {currentAllowance > BigInt(0) && ( +

+ Current allowance: {Number(formatUnits(currentAllowance, sourceToken.decimals)).toFixed(4)}{' '} + {sourceToken.symbol} +

+ )} +
+ )} + + {/* Success Message */} + {orderUid && ( +
+

✓ Order Submitted Successfully!

+

{orderUid}

+ + View in CoW Explorer + + +
+ )} + + {/* Error Display */} + {swapError &&
{swapError.message}
} + + {/* Empty State */} + {!balancesLoading && availableTokens.length === 0 && ( +
+

No tokens found on supported chains

+

Supported: Ethereum, Base, Polygon, Arbitrum

+
+ )} +
+
+ + + + {needsApproval && !orderUid && ( + + )} + {!orderUid && ( + + )} + +
+ ); +} diff --git a/src/features/swap/components/SwapButton.tsx b/src/features/swap/components/SwapButton.tsx new file mode 100644 index 00000000..00069986 --- /dev/null +++ b/src/features/swap/components/SwapButton.tsx @@ -0,0 +1,41 @@ +import type { ReactNode } from 'react'; +import { useGlobalModal } from '@/contexts/GlobalModalContext'; +import { BridgeSwapModal } from './BridgeSwapModal'; +import type { SwapToken } from '../types'; + +type SwapButtonProps = { + targetToken: SwapToken; + children: ReactNode; + className?: string; +}; + +/** + * Helper component to easily open the swap modal from anywhere + * + * Usage: + * ```tsx + * + * Swap to USDC + * + * ``` + */ +export function SwapButton({ targetToken, children, className }: SwapButtonProps) { + const { openModal, closeModal } = useGlobalModal(); + + const handleClick = () => { + openModal(); + }; + + return ( + + ); +} diff --git a/src/features/swap/components/TokenSelector.tsx b/src/features/swap/components/TokenSelector.tsx new file mode 100644 index 00000000..c9eb2399 --- /dev/null +++ b/src/features/swap/components/TokenSelector.tsx @@ -0,0 +1,150 @@ +import { useEffect, useRef, useState } from 'react'; +import { ChevronDownIcon } from '@radix-ui/react-icons'; +import { formatUnits } from 'viem'; +import { NetworkIcon } from '@/components/shared/network-icon'; +import { TokenIcon } from '@/components/shared/token-icon'; +import { getNetworkName } from '@/utils/networks'; +import type { SwapToken } from '../types'; + +type TokenSelectorProps = { + label: string; + selectedToken: SwapToken | null; + tokens: SwapToken[]; + onSelect: (token: SwapToken) => void; + disabled?: boolean; +}; + +export function TokenSelector({ label, selectedToken, tokens, onSelect, disabled }: TokenSelectorProps) { + const [isOpen, setIsOpen] = useState(false); + const [query, setQuery] = useState(''); + const dropdownRef = useRef(null); + + // Filter tokens by search query + const filteredTokens = tokens.filter((token) => token.symbol.toLowerCase().includes(query.toLowerCase())); + + // Close dropdown when clicking outside + useEffect(() => { + function handleClickOutside(event: MouseEvent) { + if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) { + setIsOpen(false); + setQuery(''); + } + } + document.addEventListener('mousedown', handleClickOutside); + return () => document.removeEventListener('mousedown', handleClickOutside); + }, []); + + return ( +
+
{label}
+ + + {isOpen && ( +
+ {/* Search input */} +
+ setQuery(e.target.value)} + onKeyDown={(e) => { + e.stopPropagation(); + if (e.key === 'Escape') { + setIsOpen(false); + setQuery(''); + } + }} + /> +
+ + {/* Token list */} +
+ {filteredTokens.length === 0 ? ( +
No tokens found
+ ) : ( + filteredTokens.map((token) => ( + + )) + )} +
+
+ )} +
+ ); +} diff --git a/src/features/swap/cowBridgingSdk.ts b/src/features/swap/cowBridgingSdk.ts new file mode 100644 index 00000000..f82e68b3 --- /dev/null +++ b/src/features/swap/cowBridgingSdk.ts @@ -0,0 +1,20 @@ +import { BridgingSdk, BungeeBridgeProvider } from '@cowprotocol/cow-sdk'; + +/** + * Bungee bridge provider configuration + * Supports Across and CCTP bridges for fast, reliable cross-chain swaps + */ +export const bungeeBridgeProvider = new BungeeBridgeProvider({ + apiOptions: { + includeBridges: ['across', 'cctp'], // Fast and reliable bridge providers + }, +}); + +/** + * CoW Protocol BridgingSDK instance + * Handles both same-chain swaps and cross-chain bridging automatically + */ +export const bridgingSdk = new BridgingSdk({ + providers: [bungeeBridgeProvider], + enableLogging: false, // Set to true for debugging +}); diff --git a/src/features/swap/hooks/useCowBridge.ts b/src/features/swap/hooks/useCowBridge.ts new file mode 100644 index 00000000..26d69f39 --- /dev/null +++ b/src/features/swap/hooks/useCowBridge.ts @@ -0,0 +1,279 @@ +import { useCallback, useEffect, useState } from 'react'; +import { useAccount, usePublicClient, useWalletClient } from 'wagmi'; +import { formatUnits, parseUnits } from 'viem'; +import { OrderKind } from '@cowprotocol/contracts'; +import { + isBridgeQuoteAndPost, + NATIVE_CURRENCY_ADDRESS, + setGlobalAdapter, + type BridgeQuoteAndPost, + type CrossChainQuoteAndPost, + type QuoteBridgeRequest, +} from '@cowprotocol/cow-sdk'; +import { ViemAdapter } from '@cowprotocol/sdk-viem-adapter'; +import { bridgingSdk } from '../cowBridgingSdk'; +import type { SwapQuoteDisplay, SwapToken } from '../types'; + +type UseCowBridgeParams = { + sourceToken: SwapToken | null; + targetToken: SwapToken; + amount: bigint; + slippageBps: number; +}; + +type UseCowBridgeReturn = { + quote: SwapQuoteDisplay | null; + rawQuote: CrossChainQuoteAndPost | null; + isQuoting: boolean; + isApproving: boolean; + isExecuting: boolean; + needsApproval: boolean; + currentAllowance: bigint | null; + error: Error | null; + orderUid: string | null; + + getQuote: () => Promise; + approveToken: () => Promise; + executeSwap: () => Promise; + reset: () => void; +}; + +/** + * Hook for managing CoW Protocol swaps and cross-chain bridges + */ +export function useCowBridge({ + sourceToken, + targetToken, + amount, + slippageBps, +}: UseCowBridgeParams): UseCowBridgeReturn { + const { address: account, chainId } = useAccount(); + const { data: walletClient } = useWalletClient(); + const publicClient = usePublicClient(); + + const [quote, setQuote] = useState(null); + const [rawQuote, setRawQuote] = useState(null); + const [isQuoting, setIsQuoting] = useState(false); + const [isApproving, setIsApproving] = useState(false); + const [isExecuting, setIsExecuting] = useState(false); + const [error, setError] = useState(null); + const [currentAllowance, setCurrentAllowance] = useState(null); + const [orderUid, setOrderUid] = useState(null); + + // Bind SDK to wagmi + useEffect(() => { + if (!walletClient || !chainId || !publicClient) return; + + try { + setGlobalAdapter( + new ViemAdapter({ + provider: publicClient, + walletClient, + }), + ); + + bridgingSdk.setTraderParams({ chainId }); + } catch (err) { + console.error('Failed to bind SDK to wagmi:', err); + } + }, [publicClient, walletClient, chainId]); + + // Check if token is native (ETH, MATIC, etc.) + const isNativeToken = sourceToken?.address.toLowerCase() === NATIVE_CURRENCY_ADDRESS.toLowerCase(); + + // Determine if approval is needed + const needsApproval = !isNativeToken && currentAllowance !== null && currentAllowance < amount; + + /** + * Check current allowance for ERC-20 token + */ + const checkAllowance = useCallback(async () => { + if (!sourceToken || !account || isNativeToken) { + setCurrentAllowance(null); + return; + } + + try { + const allowance = await bridgingSdk.getCowProtocolAllowance({ + tokenAddress: sourceToken.address, + owner: account, + chainId: sourceToken.chainId, + }); + + setCurrentAllowance(allowance); + } catch (err) { + console.error('Error checking allowance:', err); + setCurrentAllowance(null); + } + }, [sourceToken, account, isNativeToken]); + + /** + * Approve CoW Protocol to spend source token + */ + const approveToken = useCallback(async () => { + if (!sourceToken || !account) return; + + setIsApproving(true); + setError(null); + + try { + await bridgingSdk.approveCowProtocol({ + tokenAddress: sourceToken.address, + amount, + chainId: sourceToken.chainId, + }); + + // Refresh allowance after approval + await checkAllowance(); + } catch (err) { + setError(err instanceof Error ? err : new Error('Approval failed')); + } finally { + setIsApproving(false); + } + }, [sourceToken, account, amount, checkAllowance]); + + /** + * Get quote for swap/bridge + */ + const getQuote = useCallback(async () => { + if (!sourceToken || !account || amount === BigInt(0)) { + setQuote(null); + setRawQuote(null); + return; + } + + setIsQuoting(true); + setError(null); + + try { + const quoteBridgeRequest: QuoteBridgeRequest = { + sellTokenChainId: sourceToken.chainId, + sellTokenAddress: sourceToken.address, + sellTokenDecimals: sourceToken.decimals, + buyTokenChainId: targetToken.chainId, + buyTokenAddress: targetToken.address, + buyTokenDecimals: targetToken.decimals, + kind: OrderKind.SELL, + amount: amount.toString(), + account, + receiver: account, + }; + + const quoteResult = await bridgingSdk.getQuote(quoteBridgeRequest, { + slippageBps, + }); + + setRawQuote(quoteResult); + + // Parse quote result + if (isBridgeQuoteAndPost(quoteResult)) { + // Cross-chain quote + const bridgeQuote = quoteResult as BridgeQuoteAndPost; + setQuote({ + type: 'cross-chain', + buyAmount: bridgeQuote.quoteResults.amountsAndCosts.afterNetworkCosts.buyAmount, + bridgeProvider: bridgeQuote.bridge.providerInfo.name, + bridgeFee: bridgeQuote.bridge.fees.bridgeFee, + estimatedTimeSeconds: bridgeQuote.bridge.expectedFillTimeSeconds, + destinationGasFee: bridgeQuote.bridge.fees.destinationGasFee, + }); + } else { + // Same-chain quote + setQuote({ + type: 'same-chain', + buyAmount: quoteResult.quoteResults.amountsAndCosts.afterNetworkCosts.buyAmount, + }); + } + } catch (err) { + setError(err instanceof Error ? err : new Error('Failed to get quote')); + setQuote(null); + setRawQuote(null); + } finally { + setIsQuoting(false); + } + }, [sourceToken, targetToken, account, amount, slippageBps]); + + /** + * Execute the swap/bridge + */ + const executeSwap = useCallback(async () => { + if (!rawQuote) return; + + setIsExecuting(true); + setError(null); + + try { + const result = await rawQuote.postSwapOrderFromQuote({ + appData: { + metadata: { + quote: { + slippageBips: slippageBps, + }, + }, + }, + }); + + if (!result) { + throw new Error('No response from order posting'); + } + + setOrderUid(result.orderId); + } catch (err) { + setError(err instanceof Error ? err : new Error('Failed to execute swap')); + } finally { + setIsExecuting(false); + } + }, [rawQuote, slippageBps]); + + /** + * Reset state + */ + const reset = useCallback(() => { + setQuote(null); + setRawQuote(null); + setError(null); + setOrderUid(null); + setCurrentAllowance(null); + }, []); + + // Auto-fetch quote when parameters change + useEffect(() => { + if (!sourceToken || amount === BigInt(0)) { + setQuote(null); + setRawQuote(null); + return; + } + + // Reset state + setOrderUid(null); + setError(null); + + // Check allowance for ERC-20 tokens + if (!isNativeToken) { + void checkAllowance(); + } + + // Debounce quote fetching + const timeoutId = setTimeout(() => { + void getQuote(); + }, 800); + + return () => clearTimeout(timeoutId); + }, [sourceToken, amount, slippageBps, getQuote, checkAllowance, isNativeToken]); + + return { + quote, + rawQuote, + isQuoting, + isApproving, + isExecuting, + needsApproval, + currentAllowance, + error, + orderUid, + getQuote, + approveToken, + executeSwap, + reset, + }; +} diff --git a/src/features/swap/types.ts b/src/features/swap/types.ts new file mode 100644 index 00000000..857df48a --- /dev/null +++ b/src/features/swap/types.ts @@ -0,0 +1,44 @@ +import type { Address } from 'viem'; + +/** + * Token information with optional balance + */ +export type SwapToken = { + address: Address; + symbol: string; + chainId: number; + decimals: number; + balance?: bigint; +}; + +/** + * Quote display information + */ +export type SwapQuoteDisplay = { + type: 'same-chain' | 'cross-chain'; + buyAmount: bigint; + + // Cross-chain specific fields + bridgeProvider?: string; + bridgeFee?: bigint; + estimatedTimeSeconds?: number; + destinationGasFee?: bigint; +}; + +/** + * CoW Protocol supported chains for bridging + * Mainnet (1), Base (8453), Polygon (137), Arbitrum (42161) + */ +export const COW_BRIDGE_CHAINS = [1, 8453, 137, 42_161] as const; + +/** + * Type for CoW bridge supported chain IDs + */ +export type CowBridgeChainId = (typeof COW_BRIDGE_CHAINS)[number]; + +/** + * Check if a chain ID is supported by CoW Bridge + */ +export function isCowBridgeChain(chainId: number): chainId is CowBridgeChainId { + return COW_BRIDGE_CHAINS.includes(chainId as CowBridgeChainId); +} From 5bf3634d5edcc6692fe84715c50751174f872a42 Mon Sep 17 00:00:00 2001 From: antoncoding Date: Fri, 26 Dec 2025 11:17:04 +0800 Subject: [PATCH 3/8] feat: finish swap modal --- package.json | 2 + pnpm-lock.yaml | 556 +++++++++++++++++- src/components/providers/ClientProviders.tsx | 8 +- src/components/ui/dropdown-menu.tsx | 10 +- .../swap/components/BridgeSwapModal.tsx | 369 ++++++------ src/features/swap/components/SwapButton.tsx | 39 +- .../swap/components/SwapProcessModal.tsx | 98 +++ .../swap/components/TokenNetworkDropdown.tsx | 119 ++++ .../swap/components/TokenSelector.tsx | 150 ----- src/features/swap/cowBridgingSdk.ts | 28 +- src/features/swap/hooks/useCowBridge.ts | 123 ++-- src/features/swap/index.ts | 14 + src/features/swap/types.ts | 14 +- src/hooks/useUserBalances.ts | 8 +- src/modals/supply/supply-modal-content.tsx | 27 +- src/utils/tokens.ts | 5 +- 16 files changed, 1105 insertions(+), 465 deletions(-) create mode 100644 src/features/swap/components/SwapProcessModal.tsx create mode 100644 src/features/swap/components/TokenNetworkDropdown.tsx delete mode 100644 src/features/swap/components/TokenSelector.tsx create mode 100644 src/features/swap/index.ts diff --git a/package.json b/package.json index f00f6050..c8a4644d 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,9 @@ "typecheck": "tsc --noEmit" }, "dependencies": { + "@cowprotocol/contracts": "^1.8.0", "@cowprotocol/cow-sdk": "^7.2.9", + "@cowprotocol/sdk-bridging": "^1.2.0", "@cowprotocol/sdk-viem-adapter": "^0.3.0", "@heroicons/react": "^2.2.0", "@internationalized/date": "^3.8.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 610536f6..20e90d65 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,15 @@ importers: .: dependencies: + '@cowprotocol/contracts': + specifier: ^1.8.0 + version: 1.8.0(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@cowprotocol/cow-sdk': specifier: ^7.2.9 version: 7.2.9(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) + '@cowprotocol/sdk-bridging': + specifier: ^1.2.0 + version: 1.2.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) '@cowprotocol/sdk-viem-adapter': specifier: ^0.3.0 version: 0.3.0(viem@2.40.2(bufferutil@4.0.9)(typescript@5.9.3)(utf-8-validate@5.0.10)(zod@3.25.76)) @@ -886,6 +892,11 @@ packages: '@coinbase/wallet-sdk@4.3.7': resolution: {integrity: sha512-z6e5XDw6EF06RqkeyEa+qD0dZ2ZbLci99vx3zwDY//XO8X7166tqKJrR2XlQnzVmtcUuJtCd5fCvr9Cu6zzX7w==} + '@cowprotocol/contracts@1.8.0': + resolution: {integrity: sha512-rMEHo1UBB6k4kRoWejHZNGggg6IBVt7vAd8x0FhEvjxhbq3zlAex61f9HpAcDExJNuvfwwDjsOc/7UGztCzhSw==} + peerDependencies: + ethers: ^5.4.0 + '@cowprotocol/cow-sdk@7.2.9': resolution: {integrity: sha512-rAy7cG2xz+1z/jUU6avKNmViJWNE//JYxUojPz44kzwkMlrfistFHqO3J6CWyzrfoKdLcN1ZI5PiBX+sgxb1og==} peerDependencies: @@ -909,6 +920,9 @@ packages: ipfs-only-hash: ^4.x multiformats: ^9.x + '@cowprotocol/sdk-bridging@1.2.0': + resolution: {integrity: sha512-tt2MOEIO2+Wg/u0vEgAkKpp130yI/vpAkESsp1mWBEndtWsXjrK4/2UloKtM8wW6+47zYZHTRfIrhGIF5YtfRg==} + '@cowprotocol/sdk-common@0.4.0': resolution: {integrity: sha512-ciXiHzTzj7LKZqMKssgyNooZp1nS/mvRE9oO/6DlMQcxVA7/4ajPmk/XzseX/rjdRbSbYyXIEF1oY5w0tcbVjQ==} @@ -918,6 +932,9 @@ packages: '@cowprotocol/sdk-contracts-ts@1.0.0': resolution: {integrity: sha512-i5clnrOZlixHiWUGrSJXlckx5gHXnQu7hcwiL4ut9PpwmqBpFXitS5mYbFr8Py5UAJZ86QHmiXUodL/392QAAA==} + '@cowprotocol/sdk-cow-shed@0.2.9': + resolution: {integrity: sha512-nv+/ALXU0ur3NSKmislq0e+2zl2XCyXqylJil7XfXlbcrzn7AaF1SkTJHgmwZ3P3R4nCYGS/nWfYkgRyBdoaug==} + '@cowprotocol/sdk-order-book@0.5.0': resolution: {integrity: sha512-teFVH9FILYGPOpj5v539ogeqAk97kxMxeIG93Dj5G7Qfp+V97/gOKcE8/8Rw0quKt2KQYtyUspspQFhYF4g6SQ==} @@ -932,6 +949,9 @@ packages: peerDependencies: viem: ^2.28.4 + '@cowprotocol/sdk-weiroll@0.1.11': + resolution: {integrity: sha512-l1lNaN46VnQrPsCqLPiD4yxOSBhRUDT1Am8lWsUN8U6xD8NPdTJWE/UbpkrHxBd0nvpW246zWlLm31FJcz5XXA==} + '@csstools/css-parser-algorithms@3.0.5': resolution: {integrity: sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==} engines: {node: '>=18'} @@ -958,6 +978,10 @@ packages: '@date-fns/tz@1.4.1': resolution: {integrity: sha512-P5LUNhtbj6YfI3iJjw5EL9eUAG6OitD0W3fWQcpQjDRc/QIsL0tRNuO1PcDvPccWL1fSTXXdE1ds+l95DV/OFA==} + '@defuse-protocol/one-click-sdk-typescript@0.1.1-0.2': + resolution: {integrity: sha512-Jgt8uZlB5hQAo3UpyHH9XcXKNT6Vsqd7TTPy/vLEwuOvQ88Pag9qUxpU9Z2jYMD8SqOpxzaJrtgx+FSDb4lQ9A==} + engines: {node: '>=16', pnpm: '>=8'} + '@dual-bundle/import-meta-resolve@4.1.0': resolution: {integrity: sha512-+nxncfwHM5SgAtrVzgpzJOI1ol0PkumhVo469KCf9lUi21IGcY90G98VuHm9VRrUypmAzawAHO9bs6hqeADaVg==} @@ -1147,6 +1171,96 @@ packages: resolution: {integrity: sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==} engines: {node: '>=14'} + '@ethersproject/abi@5.8.0': + resolution: {integrity: sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q==} + + '@ethersproject/abstract-provider@5.8.0': + resolution: {integrity: sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg==} + + '@ethersproject/abstract-signer@5.8.0': + resolution: {integrity: sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA==} + + '@ethersproject/address@5.8.0': + resolution: {integrity: sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA==} + + '@ethersproject/base64@5.8.0': + resolution: {integrity: sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ==} + + '@ethersproject/basex@5.8.0': + resolution: {integrity: sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q==} + + '@ethersproject/bignumber@5.8.0': + resolution: {integrity: sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA==} + + '@ethersproject/bytes@5.8.0': + resolution: {integrity: sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A==} + + '@ethersproject/constants@5.8.0': + resolution: {integrity: sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg==} + + '@ethersproject/contracts@5.8.0': + resolution: {integrity: sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ==} + + '@ethersproject/hash@5.8.0': + resolution: {integrity: sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA==} + + '@ethersproject/hdnode@5.8.0': + resolution: {integrity: sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA==} + + '@ethersproject/json-wallets@5.8.0': + resolution: {integrity: sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w==} + + '@ethersproject/keccak256@5.8.0': + resolution: {integrity: sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng==} + + '@ethersproject/logger@5.8.0': + resolution: {integrity: sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA==} + + '@ethersproject/networks@5.8.0': + resolution: {integrity: sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg==} + + '@ethersproject/pbkdf2@5.8.0': + resolution: {integrity: sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg==} + + '@ethersproject/properties@5.8.0': + resolution: {integrity: sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw==} + + '@ethersproject/providers@5.8.0': + resolution: {integrity: sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw==} + + '@ethersproject/random@5.8.0': + resolution: {integrity: sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A==} + + '@ethersproject/rlp@5.8.0': + resolution: {integrity: sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==} + + '@ethersproject/sha2@5.8.0': + resolution: {integrity: sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A==} + + '@ethersproject/signing-key@5.8.0': + resolution: {integrity: sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==} + + '@ethersproject/solidity@5.8.0': + resolution: {integrity: sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA==} + + '@ethersproject/strings@5.8.0': + resolution: {integrity: sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==} + + '@ethersproject/transactions@5.8.0': + resolution: {integrity: sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==} + + '@ethersproject/units@5.8.0': + resolution: {integrity: sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ==} + + '@ethersproject/wallet@5.8.0': + resolution: {integrity: sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA==} + + '@ethersproject/web@5.8.0': + resolution: {integrity: sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==} + + '@ethersproject/wordlists@5.8.0': + resolution: {integrity: sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg==} + '@floating-ui/core@1.7.3': resolution: {integrity: sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==} @@ -3028,6 +3142,9 @@ packages: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} + aes-js@3.0.0: + resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} + agentkeepalive@4.6.0: resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==} engines: {node: '>= 8.0.0'} @@ -3136,6 +3253,9 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + bech32@1.1.4: + resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} + big.js@6.2.2: resolution: {integrity: sha512-y/ie+Faknx7sZA5MfGA2xKlu0GDv8RWrXGsmlteyJQ2lvoKv9GBK/fpRMc2qlSoBAgNxrixICFCBefIq8WCQpQ==} @@ -3145,6 +3265,9 @@ packages: blakejs@1.2.1: resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} + bn.js@4.12.2: + resolution: {integrity: sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==} + bn.js@5.2.2: resolution: {integrity: sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==} @@ -3158,6 +3281,9 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + brorand@1.1.0: + resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + browserslist@4.25.3: resolution: {integrity: sha512-cDGv1kkDI4/0e5yON9yM5G/0A5u8sf5TnmdX5C9qHzI9PPu++sQ9zjm1k9NiOrf3riY4OkK0zSGqfvJyJsgCBQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -3543,6 +3669,9 @@ packages: electron-to-chromium@1.5.205: resolution: {integrity: sha512-gBtbT7IgOHu7CwdtIiXwbNRD1l6oG6GAyanmwMCLVqaoGy92Jfe1dSHLiSj8xUEZNxOTIVlXuaAalMMD+S4y0w==} + elliptic@6.6.1: + resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} + elysia@1.4.3-beta.0: resolution: {integrity: sha512-UzanGZSqoKKcKgg+I4YB+ZOGeJNA7mlA8JPj7klYi0LDVcj/vtXKGRmsp4jEzZO+LjSpFuYTZcwHi4rCnvJj1w==} peerDependencies: @@ -3637,6 +3766,9 @@ packages: ethereum-cryptography@2.2.1: resolution: {integrity: sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==} + ethers@5.8.0: + resolution: {integrity: sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg==} + event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} @@ -3884,6 +4016,9 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} + hash.js@1.1.7: + resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -3891,6 +4026,9 @@ packages: help-me@5.0.0: resolution: {integrity: sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==} + hmac-drbg@1.0.1: + resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + hono@4.10.7: resolution: {integrity: sha512-icXIITfw/07Q88nLSkB9aiUrd8rYzSweK681Kjo/TSggaGbOX4RRyxxm71v+3PC8C/j+4rlxGeoTRxQDkaJkUw==} engines: {node: '>=16.9.0'} @@ -4185,6 +4323,10 @@ packages: json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + json-stable-stringify@1.3.0: + resolution: {integrity: sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==} + engines: {node: '>= 0.4'} + json-stringify-deterministic@1.0.12: resolution: {integrity: sha512-q3PN0lbUdv0pmurkBNdJH3pfFvOTL/Zp0lquqpvcjfKzt6Y0j49EPHAmVHCAS4Ceq/Y+PejWTzyiVpoY71+D6g==} engines: {node: '>= 4'} @@ -4200,6 +4342,9 @@ packages: jsonc-parser@3.3.1: resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + jsonify@0.0.1: + resolution: {integrity: sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==} + just-performance@4.3.0: resolution: {integrity: sha512-L7RjvtJsL0QO8xFs5wEoDDzzJwoiowRw6Rn/GnvldlchS2JQr9wFYPiwZcDfrbbujEKqKN0tvENdbjXdYhDp5Q==} @@ -4413,6 +4558,12 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} + minimalistic-assert@1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + + minimalistic-crypto-utils@1.0.1: + resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + minimatch@10.1.1: resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} engines: {node: 20 || >=22} @@ -5059,6 +5210,9 @@ packages: scheduler@0.23.2: resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} + scrypt-js@3.0.1: + resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} + secure-json-parse@4.1.0: resolution: {integrity: sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA==} @@ -6635,6 +6789,10 @@ snapshots: - zod optional: true + '@cowprotocol/contracts@1.8.0(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + dependencies: + ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@cowprotocol/cow-sdk@7.2.9(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0)': dependencies: '@cowprotocol/sdk-app-data': 4.5.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) @@ -6661,6 +6819,26 @@ snapshots: json-stringify-deterministic: 1.0.12 multiformats: 9.9.0 + '@cowprotocol/sdk-bridging@1.2.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0)': + dependencies: + '@cowprotocol/sdk-app-data': 4.5.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) + '@cowprotocol/sdk-common': 0.4.0 + '@cowprotocol/sdk-config': 0.6.2 + '@cowprotocol/sdk-contracts-ts': 1.0.0 + '@cowprotocol/sdk-cow-shed': 0.2.9 + '@cowprotocol/sdk-order-book': 0.5.0 + '@cowprotocol/sdk-trading': 0.8.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) + '@cowprotocol/sdk-weiroll': 0.1.11 + '@defuse-protocol/one-click-sdk-typescript': 0.1.1-0.2 + json-stable-stringify: 1.3.0 + transitivePeerDependencies: + - ajv + - cross-fetch + - debug + - encoding + - ipfs-only-hash + - multiformats + '@cowprotocol/sdk-common@0.4.0': {} '@cowprotocol/sdk-config@0.6.2': @@ -6673,6 +6851,12 @@ snapshots: '@cowprotocol/sdk-common': 0.4.0 '@cowprotocol/sdk-config': 0.6.2 + '@cowprotocol/sdk-cow-shed@0.2.9': + dependencies: + '@cowprotocol/sdk-common': 0.4.0 + '@cowprotocol/sdk-config': 0.6.2 + '@cowprotocol/sdk-contracts-ts': 1.0.0 + '@cowprotocol/sdk-order-book@0.5.0': dependencies: '@cowprotocol/sdk-common': 0.4.0 @@ -6713,6 +6897,11 @@ snapshots: '@cowprotocol/sdk-common': 0.4.0 viem: 2.40.2(bufferutil@4.0.9)(typescript@5.9.3)(utf-8-validate@5.0.10)(zod@3.25.76) + '@cowprotocol/sdk-weiroll@0.1.11': + dependencies: + '@cowprotocol/sdk-common': 0.4.0 + '@cowprotocol/sdk-config': 0.6.2 + '@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4)': dependencies: '@csstools/css-tokenizer': 3.0.4 @@ -6730,6 +6919,13 @@ snapshots: '@date-fns/tz@1.4.1': {} + '@defuse-protocol/one-click-sdk-typescript@0.1.1-0.2': + dependencies: + axios: 1.13.2 + form-data: 4.0.4 + transitivePeerDependencies: + - debug + '@dual-bundle/import-meta-resolve@4.1.0': {} '@ecies/ciphers@0.2.4(@noble/ciphers@1.3.0)': @@ -6848,6 +7044,261 @@ snapshots: micro-ftch: 0.3.1 optional: true + '@ethersproject/abi@5.8.0': + dependencies: + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + + '@ethersproject/abstract-provider@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/networks': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/web': 5.8.0 + + '@ethersproject/abstract-signer@5.8.0': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + + '@ethersproject/address@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/rlp': 5.8.0 + + '@ethersproject/base64@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + + '@ethersproject/basex@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/properties': 5.8.0 + + '@ethersproject/bignumber@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + bn.js: 5.2.2 + + '@ethersproject/bytes@5.8.0': + dependencies: + '@ethersproject/logger': 5.8.0 + + '@ethersproject/constants@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + + '@ethersproject/contracts@5.8.0': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/transactions': 5.8.0 + + '@ethersproject/hash@5.8.0': + dependencies: + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/base64': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + + '@ethersproject/hdnode@5.8.0': + dependencies: + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/basex': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/pbkdf2': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/wordlists': 5.8.0 + + '@ethersproject/json-wallets@5.8.0': + dependencies: + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hdnode': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/pbkdf2': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/random': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + aes-js: 3.0.0 + scrypt-js: 3.0.1 + + '@ethersproject/keccak256@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + js-sha3: 0.8.0 + + '@ethersproject/logger@5.8.0': {} + + '@ethersproject/networks@5.8.0': + dependencies: + '@ethersproject/logger': 5.8.0 + + '@ethersproject/pbkdf2@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/sha2': 5.8.0 + + '@ethersproject/properties@5.8.0': + dependencies: + '@ethersproject/logger': 5.8.0 + + '@ethersproject/providers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/base64': 5.8.0 + '@ethersproject/basex': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/networks': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/random': 5.8.0 + '@ethersproject/rlp': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/web': 5.8.0 + bech32: 1.1.4 + ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ethersproject/random@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + + '@ethersproject/rlp@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + + '@ethersproject/sha2@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + hash.js: 1.1.7 + + '@ethersproject/signing-key@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + bn.js: 5.2.2 + elliptic: 6.6.1 + hash.js: 1.1.7 + + '@ethersproject/solidity@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/strings': 5.8.0 + + '@ethersproject/strings@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/logger': 5.8.0 + + '@ethersproject/transactions@5.8.0': + dependencies: + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/rlp': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + + '@ethersproject/units@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/logger': 5.8.0 + + '@ethersproject/wallet@5.8.0': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/hdnode': 5.8.0 + '@ethersproject/json-wallets': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/random': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/wordlists': 5.8.0 + + '@ethersproject/web@5.8.0': + dependencies: + '@ethersproject/base64': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + + '@ethersproject/wordlists@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@floating-ui/core@1.7.3': dependencies: '@floating-ui/utils': 0.2.10 @@ -10138,6 +10589,8 @@ snapshots: event-target-shim: 5.0.1 optional: true + aes-js@3.0.0: {} + agentkeepalive@4.6.0: dependencies: humanize-ms: 1.2.1 @@ -10186,8 +10639,7 @@ snapshots: astral-regex@2.0.0: {} - asynckit@0.4.0: - optional: true + asynckit@0.4.0: {} atomic-sleep@1.0.0: {} @@ -10218,7 +10670,6 @@ snapshots: proxy-from-env: 1.1.0 transitivePeerDependencies: - debug - optional: true babel-plugin-polyfill-corejs2@0.4.14(@babel/core@7.28.3): dependencies: @@ -10257,6 +10708,8 @@ snapshots: base64-js@1.5.1: {} + bech32@1.1.4: {} + big.js@6.2.2: {} bl@5.1.0: @@ -10267,8 +10720,9 @@ snapshots: blakejs@1.2.1: {} - bn.js@5.2.2: - optional: true + bn.js@4.12.2: {} + + bn.js@5.2.2: {} borsh@0.7.0: dependencies: @@ -10284,6 +10738,8 @@ snapshots: dependencies: fill-range: 7.1.1 + brorand@1.1.0: {} + browserslist@4.25.3: dependencies: caniuse-lite: 1.0.30001735 @@ -10410,7 +10866,6 @@ snapshots: combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 - optional: true commander@14.0.0: optional: true @@ -10604,8 +11059,7 @@ snapshots: delay@5.0.0: optional: true - delayed-stream@1.0.0: - optional: true + delayed-stream@1.0.0: {} dequal@2.0.3: {} @@ -10663,6 +11117,16 @@ snapshots: electron-to-chromium@1.5.205: {} + elliptic@6.6.1: + dependencies: + bn.js: 4.12.2 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + elysia@1.4.3-beta.0(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(typescript@5.9.3): dependencies: cookie: 1.1.1 @@ -10749,7 +11213,6 @@ snapshots: get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 hasown: 2.0.2 - optional: true es-toolkit@1.33.0: optional: true @@ -10810,6 +11273,42 @@ snapshots: '@scure/bip39': 1.3.0 optional: true + ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/base64': 5.8.0 + '@ethersproject/basex': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/contracts': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/hdnode': 5.8.0 + '@ethersproject/json-wallets': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/networks': 5.8.0 + '@ethersproject/pbkdf2': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/providers': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/random': 5.8.0 + '@ethersproject/rlp': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + '@ethersproject/solidity': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/units': 5.8.0 + '@ethersproject/wallet': 5.8.0 + '@ethersproject/web': 5.8.0 + '@ethersproject/wordlists': 5.8.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + event-target-shim@5.0.1: optional: true @@ -10909,8 +11408,7 @@ snapshots: flatted@3.3.3: {} - follow-redirects@1.15.11: - optional: true + follow-redirects@1.15.11: {} for-each@0.3.5: dependencies: @@ -10923,7 +11421,6 @@ snapshots: es-set-tostringtag: 2.1.0 hasown: 2.0.2 mime-types: 2.1.35 - optional: true fraction.js@4.3.7: {} @@ -11051,12 +11548,23 @@ snapshots: dependencies: has-symbols: 1.1.0 + hash.js@1.1.7: + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + hasown@2.0.2: dependencies: function-bind: 1.1.2 help-me@5.0.0: {} + hmac-drbg@1.0.1: + dependencies: + hash.js: 1.1.7 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + hono@4.10.7: optional: true @@ -11355,6 +11863,14 @@ snapshots: json-schema-traverse@1.0.0: {} + json-stable-stringify@1.3.0: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + isarray: 2.0.5 + jsonify: 0.0.1 + object-keys: 1.1.1 + json-stringify-deterministic@1.0.12: {} json-stringify-safe@5.0.1: @@ -11364,6 +11880,8 @@ snapshots: jsonc-parser@3.3.1: {} + jsonify@0.0.1: {} + just-performance@4.3.0: {} keyv@5.5.0: @@ -11542,16 +12060,18 @@ snapshots: braces: 3.0.3 picomatch: 2.3.1 - mime-db@1.52.0: - optional: true + mime-db@1.52.0: {} mime-types@2.1.35: dependencies: mime-db: 1.52.0 - optional: true min-indent@1.0.1: {} + minimalistic-assert@1.0.1: {} + + minimalistic-crypto-utils@1.0.1: {} + minimatch@10.1.1: dependencies: '@isaacs/brace-expansion': 5.0.0 @@ -12040,8 +12560,7 @@ snapshots: proxy-compare@3.0.1: {} - proxy-from-env@1.1.0: - optional: true + proxy-from-env@1.1.0: {} pump@3.0.3: dependencies: @@ -12328,6 +12847,8 @@ snapshots: dependencies: loose-envify: 1.4.0 + scrypt-js@3.0.1: {} + secure-json-parse@4.1.0: {} semver@5.7.2: {} @@ -13053,7 +13574,6 @@ snapshots: optionalDependencies: bufferutil: 4.0.9 utf-8-validate: 5.0.10 - optional: true ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10): optionalDependencies: diff --git a/src/components/providers/ClientProviders.tsx b/src/components/providers/ClientProviders.tsx index b982aea3..93305e91 100644 --- a/src/components/providers/ClientProviders.tsx +++ b/src/components/providers/ClientProviders.tsx @@ -15,8 +15,8 @@ type ClientProvidersProps = { export function ClientProviders({ children }: ClientProvidersProps) { return ( - - + + @@ -26,7 +26,7 @@ export function ClientProviders({ children }: ClientProvidersProps) { - - + + ); } diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx index 466432cc..48e35956 100644 --- a/src/components/ui/dropdown-menu.tsx +++ b/src/components/ui/dropdown-menu.tsx @@ -68,7 +68,7 @@ const DropdownMenuContent = React.forwardRef< sideOffset={sideOffset} className={cn( "z-50 min-w-[10rem] max-h-[var(--radix-dropdown-menu-content-available-height)]", - "overflow-y-auto overflow-x-hidden rounded-sm bg-surface p-3 shadow-lg font-zen", + "overflow-y-auto overflow-x-hidden rounded-sm bg-surface p-2 shadow-lg font-zen", "border border-border", "data-[state=open]:[animation:dropdownFadeIn_150ms_ease-out]", "data-[state=closed]:[animation:dropdownFadeOut_150ms_ease-in]", @@ -91,7 +91,7 @@ const DropdownMenuItem = React.forwardRef< svg]:size-4 [&>svg]:shrink-0", @@ -117,7 +117,7 @@ const DropdownMenuCheckboxItem = React.forwardRef< (null); + const [inputAmount, setInputAmount] = useState('0'); const [amount, setAmount] = useState(BigInt(0)); - const [slippage, setSlippage] = useState(0.5); // 0.5% - const [amountError, setAmountError] = useState(null); + const [slippage, _setSlippage] = useState(0.5); // 0.5% + const [showProcessModal, setShowProcessModal] = useState(false); + const [currentStep, setCurrentStep] = useState<'approve' | 'swapping'>('approve'); // Fetch user balances from CoW-supported chains const { balances, loading: balancesLoading } = useUserBalances({ networkIds: COW_BRIDGE_CHAINS as unknown as number[], }); - // Convert balances to SwapTokens + // Handle approval for source token + const { allowance, approveInfinite, approvePending } = useAllowance({ + token: (sourceToken?.address ?? '0x0000000000000000000000000000000000000000') as `0x${string}`, + chainId: sourceToken?.chainId, + user: account, + spender: COW_VAULT_RELAYER, + tokenSymbol: sourceToken?.symbol, + }); + + // Convert balances to SwapTokens (support cross-chain) const availableTokens = useMemo(() => { return balances .filter((b) => BigInt(b.balance) > BigInt(0)) // Only show tokens with balance + .filter( + // Not the same token as target + (b) => !(b.chainId === targetToken.chainId && b.address.toLowerCase() === targetToken.address.toLowerCase()), + ) .map((b) => ({ - address: b.address as `0x${string}`, + address: b.address, symbol: b.symbol, chainId: b.chainId, decimals: b.decimals, @@ -46,37 +63,43 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa const bValue = Number(formatUnits(b.balance ?? BigInt(0), b.decimals)); return bValue - aValue; }); - }, [balances]); + }, [balances, targetToken.chainId, targetToken.address]); // CoW Bridge hook - const { - quote, - isQuoting, - isApproving, - isExecuting, - needsApproval, - currentAllowance, - error: swapError, - orderUid, - approveToken, - executeSwap, - reset, - } = useCowBridge({ + const { quote, isQuoting, isExecuting, errorDescription, orderUid, executeSwap, reset } = useCowBridge({ sourceToken, targetToken, amount, slippageBps: Math.round(slippage * 100), }); + // Check if approval is needed + const needsApproval = allowance < amount && amount > BigInt(0); + const handleSourceTokenSelect = (token: SwapToken) => { setSourceToken(token); setAmount(BigInt(0)); - setAmountError(null); + setInputAmount('0'); + }; + + const handleInputChange = (e: React.ChangeEvent) => { + const value = e.target.value; + setInputAmount(value); + + if (!sourceToken) return; + + try { + const parsed = parseUnits(value, sourceToken.decimals); + setAmount(parsed); + } catch { + // Invalid input, keep previous amount + } }; const handleMaxClick = () => { if (sourceToken?.balance) { setAmount(sourceToken.balance); + setInputAmount(formatBalance(sourceToken.balance, sourceToken.decimals).toString()); } }; @@ -84,157 +107,168 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa reset(); setSourceToken(null); setAmount(BigInt(0)); - setAmountError(null); + setInputAmount('0'); + setShowProcessModal(false); onClose(); }; - const isLoading = isQuoting || isApproving || isExecuting; - const canExecute = quote && !needsApproval && !isExecuting && amount > BigInt(0); + // Unified execution handler - handles approve + swap automatically + const handleSwap = useCallback(async () => { + try { + if (needsApproval) { + // Show process modal when approval needed + setShowProcessModal(true); + setCurrentStep('approve'); + await approveInfinite(); + + setCurrentStep('swapping'); + await executeSwap(); - return ( - - + setShowProcessModal(false); + } else { + // Direct swap without process modal + await executeSwap(); + } + } catch (_err) { + setShowProcessModal(false); + // Error is already handled by hooks + } + }, [needsApproval, approveInfinite, executeSwap]); + + const isLoading = isQuoting || approvePending || isExecuting; + + // Determine output display text + const getOutputDisplay = () => { + if (!sourceToken) return 'Select token above'; + if (amount === BigInt(0)) return '0'; + if (isQuoting) return 'Loading...'; + if (errorDescription) return '—'; + if (quote) return {Number(formatUnits(quote.buyAmount, targetToken.decimals)).toFixed(6)}; + return '0'; + }; + + return showProcessModal && sourceToken ? ( + setShowProcessModal(false)} + needsApproval={needsApproval} + sourceSymbol={sourceToken.symbol} + targetSymbol={targetToken.symbol} + /> + ) : ( + !open && handleClose()} + size="lg" + > +
- {/* Source Token Selector */} - - - {/* Amount Input */} - {sourceToken && ( -
-
Amount
- +
+ From + {sourceToken && ( + + )} +
+
+ + - {amountError &&

{amountError}

}
- )} +
- {/* Arrow Indicator */} - {sourceToken && ( -
- -
- )} + {/* Arrow */} +
+ +
- {/* Target Token Display */} - {sourceToken && ( -
-
To
-
- - {targetToken.symbol} -
- - {getNetworkName(targetToken.chainId)} -
-
+ {/* To Section - Always visible */} +
+
To
+
+
{getOutputDisplay()}
+ {}} + disabled + />
- )} - - {/* Quote Display */} - {quote && sourceToken && ( -
-
- You receive - - {Number(formatUnits(quote.buyAmount, targetToken.decimals)).toFixed(6)} {targetToken.symbol} +
+ {quote && sourceToken && !errorDescription && ( + + 1 {sourceToken.symbol} ≈{' '} + {( + Number(formatUnits(quote.buyAmount, targetToken.decimals)) / Number(formatUnits(quote.sellAmount, sourceToken.decimals)) + ).toFixed(6)}{' '} + {targetToken.symbol} -
- - {quote.type === 'cross-chain' && ( - <> -
- Type - Cross-chain swap -
-
- Bridge - {quote.bridgeProvider} -
- {quote.estimatedTimeSeconds && ( -
- Estimated time - {Math.ceil(quote.estimatedTimeSeconds / 60)} minutes -
- )} - {quote.bridgeFee && ( -
- Bridge fee - - {Number(formatUnits(quote.bridgeFee, sourceToken.decimals)).toFixed(6)}{' '} - {sourceToken.symbol} - -
- )} - - )} - - {quote.type === 'same-chain' && ( -
- Type - Same-chain swap -
)}
- )} +
- {/* Slippage Setting */} - {sourceToken && ( -
- Slippage tolerance: - setSlippage(Number(e.target.value))} - className="bg-hovered w-16 rounded-sm p-1 text-sm focus:border-primary focus:outline-none" - /> - % + {/* Error Display */} + {errorDescription && ( +
+

⚠️ Error

+

{errorDescription}

)} - {/* Approval Warning */} - {needsApproval && currentAllowance !== null && sourceToken && ( -
-

⚠️ Approval Required

-

- You need to approve CoW Protocol to spend your {sourceToken.symbol} -

- {currentAllowance > BigInt(0) && ( -

- Current allowance: {Number(formatUnits(currentAllowance, sourceToken.decimals)).toFixed(4)}{' '} - {sourceToken.symbol} -

+ {/* Quote Details */} + {quote && sourceToken && !errorDescription && quote.type === 'cross-chain' && ( +
+ {quote.bridgeProvider && ( +
+ Bridge + {quote.bridgeProvider} +
+ )} + {quote.estimatedTimeSeconds && ( +
+ Estimated time + ~{Math.ceil(quote.estimatedTimeSeconds / 60)} min +
+ )} + {quote.bridgeFee && ( +
+ Bridge fee + + {Number(formatUnits(quote.bridgeFee, sourceToken.decimals)).toFixed(6)} {sourceToken.symbol} + +
)}
)} {/* Success Message */} {orderUid && ( -
-

✓ Order Submitted Successfully!

+
+

✓ Order Submitted!

{orderUid}

)} - {/* Error Display */} - {swapError &&
{swapError.message}
} - {/* Empty State */} - {!balancesLoading && availableTokens.length === 0 && ( -
+ {!balancesLoading && availableTokens.length === 0 && !sourceToken && ( +

No tokens found on supported chains

-

Supported: Ethereum, Base, Polygon, Arbitrum

+

Supported: Ethereum, Base, Polygon, Arbitrum

)}
- - {needsApproval && !orderUid && ( - - )} {!orderUid && ( - + void handleSwap()} + isLoading={isLoading} + disabled={!quote || amount === BigInt(0) || !!errorDescription} + variant="primary" + > + {needsApproval ? 'Approve & Swap' : 'Swap'} + )} diff --git a/src/features/swap/components/SwapButton.tsx b/src/features/swap/components/SwapButton.tsx index 00069986..3d57ec89 100644 --- a/src/features/swap/components/SwapButton.tsx +++ b/src/features/swap/components/SwapButton.tsx @@ -1,40 +1,43 @@ import type { ReactNode } from 'react'; -import { useGlobalModal } from '@/contexts/GlobalModalContext'; -import { BridgeSwapModal } from './BridgeSwapModal'; import type { SwapToken } from '../types'; type SwapButtonProps = { targetToken: SwapToken; + onOpenSwap: (targetToken: SwapToken) => void; children: ReactNode; className?: string; }; /** - * Helper component to easily open the swap modal from anywhere + * Simple button to trigger swap modal * * Usage: * ```tsx + * const [swapTarget, setSwapTarget] = useState(null); + * * - * Swap to USDC + * Swap to USDC * + * + * {swapTarget && ( + * setSwapTarget(null)} + * targetToken={swapTarget} + * /> + * )} * ``` */ -export function SwapButton({ targetToken, children, className }: SwapButtonProps) { - const { openModal, closeModal } = useGlobalModal(); - - const handleClick = () => { - openModal(); - }; - +export function SwapButton({ targetToken, onOpenSwap, children, className }: SwapButtonProps) { return ( - ); diff --git a/src/features/swap/components/SwapProcessModal.tsx b/src/features/swap/components/SwapProcessModal.tsx new file mode 100644 index 00000000..c29e16be --- /dev/null +++ b/src/features/swap/components/SwapProcessModal.tsx @@ -0,0 +1,98 @@ +import { useMemo } from 'react'; +import { FaCheckCircle, FaCircle } from 'react-icons/fa'; +import { ArrowDownIcon } from '@radix-ui/react-icons'; +import { Modal, ModalBody, ModalHeader } from '@/components/common/Modal'; + +type SwapProcessModalProps = { + currentStep: 'approve' | 'swapping'; + onClose: () => void; + needsApproval: boolean; + sourceSymbol: string; + targetSymbol: string; +}; + +export function SwapProcessModal({ currentStep, onClose, needsApproval, sourceSymbol, targetSymbol }: SwapProcessModalProps): JSX.Element { + const steps = useMemo(() => { + if (!needsApproval) { + return [ + { + key: 'swapping', + label: 'Confirm Swap', + detail: 'Confirm transaction in wallet to complete the swap', + }, + ]; + } + + return [ + { + key: 'approve', + label: 'Approve Token', + detail: `Approve ${sourceSymbol} for spending`, + }, + { + key: 'swapping', + label: 'Confirm Swap', + detail: 'Confirm transaction in wallet to complete the swap', + }, + ]; + }, [needsApproval, sourceSymbol]); + + const getStepStatus = (stepKey: string) => { + const currentIndex = steps.findIndex((step) => step.key === currentStep); + const stepIndex = steps.findIndex((step) => step.key === stepKey); + + if (stepIndex < currentIndex) { + return 'done'; + } + if (stepKey === currentStep) { + return 'current'; + } + return 'undone'; + }; + + return ( + !open && onClose()} + size="lg" + isDismissable={false} + backdrop="blur" + > + } + onClose={onClose} + /> + +
+ {steps.map((step) => { + const status = getStepStatus(step.key); + return ( +
+
+ {status === 'done' ? ( + + ) : status === 'current' ? ( + + ) : ( + + )} +
+
+
{step.label}
+
{step.detail}
+
+
+ ); + })} +
+
+
+ ); +} diff --git a/src/features/swap/components/TokenNetworkDropdown.tsx b/src/features/swap/components/TokenNetworkDropdown.tsx new file mode 100644 index 00000000..76f110e8 --- /dev/null +++ b/src/features/swap/components/TokenNetworkDropdown.tsx @@ -0,0 +1,119 @@ +import { useState } from 'react'; +import { ChevronDownIcon } from '@radix-ui/react-icons'; +import { formatUnits } from 'viem'; +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; +import { TokenIcon } from '@/components/shared/token-icon'; +import { NetworkIcon } from '@/components/shared/network-icon'; +import { getNetworkName } from '@/utils/networks'; +import type { SwapToken } from '../types'; + +type TokenNetworkDropdownProps = { + selectedToken: SwapToken | null; + tokens: SwapToken[]; + onSelect: (token: SwapToken) => void; + placeholder?: string; + disabled?: boolean; +}; + +/** + * Compact inline token + network selector for swap interface + * Displays token icon with small network icon, opens searchable dropdown + */ +export function TokenNetworkDropdown({ selectedToken, tokens, onSelect, placeholder = 'Select', disabled }: TokenNetworkDropdownProps) { + const [query, setQuery] = useState(''); + + // Filter tokens by search query + const filteredTokens = tokens.filter( + (token) => + token.symbol.toLowerCase().includes(query.toLowerCase()) || + (getNetworkName(token.chainId)?.toLowerCase() ?? '').includes(query.toLowerCase()), + ); + + return ( + + + + + + + {/* Search input */} +
+ setQuery(e.target.value)} + className="w-full bg-transparent px-2 py-1 text-sm outline-none placeholder:opacity-50" + onKeyDown={(e) => e.stopPropagation()} + /> +
+ + {/* Token list */} +
+ {filteredTokens.length === 0 ? ( +
No tokens found
+ ) : ( + filteredTokens.map((token) => ( + { + onSelect(token); + setQuery(''); + }} + className="cursor-pointer" + startContent={ + + } + endContent={ + token.balance !== undefined ? ( + {Number(formatUnits(token.balance, token.decimals)).toFixed(4)} + ) : null + } + > +
+ {token.symbol} +
+ + {getNetworkName(token.chainId)} +
+
+
+ )) + )} +
+
+
+ ); +} diff --git a/src/features/swap/components/TokenSelector.tsx b/src/features/swap/components/TokenSelector.tsx deleted file mode 100644 index c9eb2399..00000000 --- a/src/features/swap/components/TokenSelector.tsx +++ /dev/null @@ -1,150 +0,0 @@ -import { useEffect, useRef, useState } from 'react'; -import { ChevronDownIcon } from '@radix-ui/react-icons'; -import { formatUnits } from 'viem'; -import { NetworkIcon } from '@/components/shared/network-icon'; -import { TokenIcon } from '@/components/shared/token-icon'; -import { getNetworkName } from '@/utils/networks'; -import type { SwapToken } from '../types'; - -type TokenSelectorProps = { - label: string; - selectedToken: SwapToken | null; - tokens: SwapToken[]; - onSelect: (token: SwapToken) => void; - disabled?: boolean; -}; - -export function TokenSelector({ label, selectedToken, tokens, onSelect, disabled }: TokenSelectorProps) { - const [isOpen, setIsOpen] = useState(false); - const [query, setQuery] = useState(''); - const dropdownRef = useRef(null); - - // Filter tokens by search query - const filteredTokens = tokens.filter((token) => token.symbol.toLowerCase().includes(query.toLowerCase())); - - // Close dropdown when clicking outside - useEffect(() => { - function handleClickOutside(event: MouseEvent) { - if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) { - setIsOpen(false); - setQuery(''); - } - } - document.addEventListener('mousedown', handleClickOutside); - return () => document.removeEventListener('mousedown', handleClickOutside); - }, []); - - return ( -
-
{label}
- - - {isOpen && ( -
- {/* Search input */} -
- setQuery(e.target.value)} - onKeyDown={(e) => { - e.stopPropagation(); - if (e.key === 'Escape') { - setIsOpen(false); - setQuery(''); - } - }} - /> -
- - {/* Token list */} -
- {filteredTokens.length === 0 ? ( -
No tokens found
- ) : ( - filteredTokens.map((token) => ( - - )) - )} -
-
- )} -
- ); -} diff --git a/src/features/swap/cowBridgingSdk.ts b/src/features/swap/cowBridgingSdk.ts index f82e68b3..7b7053ce 100644 --- a/src/features/swap/cowBridgingSdk.ts +++ b/src/features/swap/cowBridgingSdk.ts @@ -1,4 +1,16 @@ -import { BridgingSdk, BungeeBridgeProvider } from '@cowprotocol/cow-sdk'; +import { TradingSdk } from '@cowprotocol/cow-sdk'; +import { BridgingSdk, BungeeBridgeProvider } from '@cowprotocol/sdk-bridging'; + +/** + * Trading SDK for approvals and allowances + */ +export const tradingSdk = new TradingSdk( + { + chainId: 1, // Default, will be updated by adapter + appCode: 'monarch-swap', + }, + {}, +); /** * Bungee bridge provider configuration @@ -6,7 +18,7 @@ import { BridgingSdk, BungeeBridgeProvider } from '@cowprotocol/cow-sdk'; */ export const bungeeBridgeProvider = new BungeeBridgeProvider({ apiOptions: { - includeBridges: ['across', 'cctp'], // Fast and reliable bridge providers + includeBridges: ['across', 'cctp'], }, }); @@ -14,7 +26,11 @@ export const bungeeBridgeProvider = new BungeeBridgeProvider({ * CoW Protocol BridgingSDK instance * Handles both same-chain swaps and cross-chain bridging automatically */ -export const bridgingSdk = new BridgingSdk({ - providers: [bungeeBridgeProvider], - enableLogging: false, // Set to true for debugging -}); +export const bridgingSdk = new BridgingSdk( + { + providers: [bungeeBridgeProvider], + tradingSdk, // Pass TradingSdk for approvals + enableLogging: false, // Set to true for debugging + }, + undefined, +); diff --git a/src/features/swap/hooks/useCowBridge.ts b/src/features/swap/hooks/useCowBridge.ts index 26d69f39..57bb8f97 100644 --- a/src/features/swap/hooks/useCowBridge.ts +++ b/src/features/swap/hooks/useCowBridge.ts @@ -1,17 +1,14 @@ import { useCallback, useEffect, useState } from 'react'; import { useAccount, usePublicClient, useWalletClient } from 'wagmi'; -import { formatUnits, parseUnits } from 'viem'; -import { OrderKind } from '@cowprotocol/contracts'; +import { OrderKind, setGlobalAdapter } from '@cowprotocol/cow-sdk'; import { isBridgeQuoteAndPost, - NATIVE_CURRENCY_ADDRESS, - setGlobalAdapter, type BridgeQuoteAndPost, type CrossChainQuoteAndPost, type QuoteBridgeRequest, -} from '@cowprotocol/cow-sdk'; +} from '@cowprotocol/sdk-bridging'; import { ViemAdapter } from '@cowprotocol/sdk-viem-adapter'; -import { bridgingSdk } from '../cowBridgingSdk'; +import { bridgingSdk, tradingSdk } from '../cowBridgingSdk'; import type { SwapQuoteDisplay, SwapToken } from '../types'; type UseCowBridgeParams = { @@ -25,15 +22,12 @@ type UseCowBridgeReturn = { quote: SwapQuoteDisplay | null; rawQuote: CrossChainQuoteAndPost | null; isQuoting: boolean; - isApproving: boolean; isExecuting: boolean; - needsApproval: boolean; - currentAllowance: bigint | null; error: Error | null; + errorDescription: string | null; orderUid: string | null; getQuote: () => Promise; - approveToken: () => Promise; executeSwap: () => Promise; reset: () => void; }; @@ -41,12 +35,7 @@ type UseCowBridgeReturn = { /** * Hook for managing CoW Protocol swaps and cross-chain bridges */ -export function useCowBridge({ - sourceToken, - targetToken, - amount, - slippageBps, -}: UseCowBridgeParams): UseCowBridgeReturn { +export function useCowBridge({ sourceToken, targetToken, amount, slippageBps }: UseCowBridgeParams): UseCowBridgeReturn { const { address: account, chainId } = useAccount(); const { data: walletClient } = useWalletClient(); const publicClient = usePublicClient(); @@ -54,10 +43,9 @@ export function useCowBridge({ const [quote, setQuote] = useState(null); const [rawQuote, setRawQuote] = useState(null); const [isQuoting, setIsQuoting] = useState(false); - const [isApproving, setIsApproving] = useState(false); const [isExecuting, setIsExecuting] = useState(false); const [error, setError] = useState(null); - const [currentAllowance, setCurrentAllowance] = useState(null); + const [errorDescription, setErrorDescription] = useState(null); const [orderUid, setOrderUid] = useState(null); // Bind SDK to wagmi @@ -72,65 +60,25 @@ export function useCowBridge({ }), ); - bridgingSdk.setTraderParams({ chainId }); + tradingSdk.setTraderParams({ chainId }); } catch (err) { console.error('Failed to bind SDK to wagmi:', err); } }, [publicClient, walletClient, chainId]); - // Check if token is native (ETH, MATIC, etc.) - const isNativeToken = sourceToken?.address.toLowerCase() === NATIVE_CURRENCY_ADDRESS.toLowerCase(); - - // Determine if approval is needed - const needsApproval = !isNativeToken && currentAllowance !== null && currentAllowance < amount; - /** - * Check current allowance for ERC-20 token + * Parse error to extract description from CoW Protocol API errors + * Format: { errorType: string, description: string } */ - const checkAllowance = useCallback(async () => { - if (!sourceToken || !account || isNativeToken) { - setCurrentAllowance(null); - return; + const parseErrorDescription = (err: unknown): string => { + if (err && typeof err === 'object' && 'description' in err && typeof err.description === 'string') { + return err.description; } - - try { - const allowance = await bridgingSdk.getCowProtocolAllowance({ - tokenAddress: sourceToken.address, - owner: account, - chainId: sourceToken.chainId, - }); - - setCurrentAllowance(allowance); - } catch (err) { - console.error('Error checking allowance:', err); - setCurrentAllowance(null); - } - }, [sourceToken, account, isNativeToken]); - - /** - * Approve CoW Protocol to spend source token - */ - const approveToken = useCallback(async () => { - if (!sourceToken || !account) return; - - setIsApproving(true); - setError(null); - - try { - await bridgingSdk.approveCowProtocol({ - tokenAddress: sourceToken.address, - amount, - chainId: sourceToken.chainId, - }); - - // Refresh allowance after approval - await checkAllowance(); - } catch (err) { - setError(err instanceof Error ? err : new Error('Approval failed')); - } finally { - setIsApproving(false); + if (err instanceof Error) { + return err.message; } - }, [sourceToken, account, amount, checkAllowance]); + return 'An unknown error occurred'; + }; /** * Get quote for swap/bridge @@ -154,14 +102,14 @@ export function useCowBridge({ buyTokenAddress: targetToken.address, buyTokenDecimals: targetToken.decimals, kind: OrderKind.SELL, - amount: amount.toString(), + amount, account, receiver: account, + signer: walletClient as any, // Viem WalletClient as signer + appCode: 'monarch-swap', }; - const quoteResult = await bridgingSdk.getQuote(quoteBridgeRequest, { - slippageBps, - }); + const quoteResult = await bridgingSdk.getQuote(quoteBridgeRequest); setRawQuote(quoteResult); @@ -171,27 +119,31 @@ export function useCowBridge({ const bridgeQuote = quoteResult as BridgeQuoteAndPost; setQuote({ type: 'cross-chain', - buyAmount: bridgeQuote.quoteResults.amountsAndCosts.afterNetworkCosts.buyAmount, + buyAmount: bridgeQuote.swap.amountsAndCosts.afterNetworkCosts.buyAmount, + sellAmount: amount, bridgeProvider: bridgeQuote.bridge.providerInfo.name, bridgeFee: bridgeQuote.bridge.fees.bridgeFee, estimatedTimeSeconds: bridgeQuote.bridge.expectedFillTimeSeconds, destinationGasFee: bridgeQuote.bridge.fees.destinationGasFee, }); } else { - // Same-chain quote + // Same-chain quote (QuoteAndPost) setQuote({ type: 'same-chain', buyAmount: quoteResult.quoteResults.amountsAndCosts.afterNetworkCosts.buyAmount, + sellAmount: amount, }); } } catch (err) { - setError(err instanceof Error ? err : new Error('Failed to get quote')); + const errObj = err instanceof Error ? err : new Error('Failed to get quote'); + setError(errObj); + setErrorDescription(parseErrorDescription(err)); setQuote(null); setRawQuote(null); } finally { setIsQuoting(false); } - }, [sourceToken, targetToken, account, amount, slippageBps]); + }, [sourceToken, targetToken, account, amount, slippageBps, walletClient]); /** * Execute the swap/bridge @@ -219,7 +171,9 @@ export function useCowBridge({ setOrderUid(result.orderId); } catch (err) { - setError(err instanceof Error ? err : new Error('Failed to execute swap')); + const errObj = err instanceof Error ? err : new Error('Failed to execute swap'); + setError(errObj); + setErrorDescription(parseErrorDescription(err)); } finally { setIsExecuting(false); } @@ -232,8 +186,8 @@ export function useCowBridge({ setQuote(null); setRawQuote(null); setError(null); + setErrorDescription(null); setOrderUid(null); - setCurrentAllowance(null); }, []); // Auto-fetch quote when parameters change @@ -247,11 +201,7 @@ export function useCowBridge({ // Reset state setOrderUid(null); setError(null); - - // Check allowance for ERC-20 tokens - if (!isNativeToken) { - void checkAllowance(); - } + setErrorDescription(null); // Debounce quote fetching const timeoutId = setTimeout(() => { @@ -259,20 +209,17 @@ export function useCowBridge({ }, 800); return () => clearTimeout(timeoutId); - }, [sourceToken, amount, slippageBps, getQuote, checkAllowance, isNativeToken]); + }, [sourceToken, amount, slippageBps, getQuote]); return { quote, rawQuote, isQuoting, - isApproving, isExecuting, - needsApproval, - currentAllowance, error, + errorDescription, orderUid, getQuote, - approveToken, executeSwap, reset, }; diff --git a/src/features/swap/index.ts b/src/features/swap/index.ts new file mode 100644 index 00000000..c022939b --- /dev/null +++ b/src/features/swap/index.ts @@ -0,0 +1,14 @@ +/** + * CoW Protocol Swap & Bridge Feature + * + * Provides same-chain and cross-chain token swaps via CoW Protocol + */ + +export { SwapButton } from './components/SwapButton'; +export { BridgeSwapModal } from './components/BridgeSwapModal'; +export { TokenNetworkDropdown } from './components/TokenNetworkDropdown'; +export { SwapProcessModal } from './components/SwapProcessModal'; +export { useCowBridge } from './hooks/useCowBridge'; +export { bridgingSdk, bungeeBridgeProvider } from './cowBridgingSdk'; +export type { SwapToken, SwapQuoteDisplay, CowBridgeChainId } from './types'; +export { COW_BRIDGE_CHAINS, COW_VAULT_RELAYER, isCowBridgeChain } from './types'; diff --git a/src/features/swap/types.ts b/src/features/swap/types.ts index 857df48a..937277ed 100644 --- a/src/features/swap/types.ts +++ b/src/features/swap/types.ts @@ -1,10 +1,8 @@ -import type { Address } from 'viem'; - /** * Token information with optional balance */ export type SwapToken = { - address: Address; + address: string; symbol: string; chainId: number; decimals: number; @@ -17,6 +15,7 @@ export type SwapToken = { export type SwapQuoteDisplay = { type: 'same-chain' | 'cross-chain'; buyAmount: bigint; + sellAmount: bigint; // Cross-chain specific fields bridgeProvider?: string; @@ -27,10 +26,17 @@ export type SwapQuoteDisplay = { /** * CoW Protocol supported chains for bridging - * Mainnet (1), Base (8453), Polygon (137), Arbitrum (42161) + * Only chains supported by our API: Mainnet (1), Base (8453), Polygon (137), Arbitrum (42161) + * Note: Gnosis (100) removed - not supported by balance API */ export const COW_BRIDGE_CHAINS = [1, 8453, 137, 42_161] as const; +/** + * CoW Protocol VaultRelayer address (same across all chains) + * This is the address that needs to be approved to spend tokens + */ +export const COW_VAULT_RELAYER = '0xC92E8bdf79f0507f65a392b0ab4667716BFE0110' as const; + /** * Type for CoW bridge supported chain IDs */ diff --git a/src/hooks/useUserBalances.ts b/src/hooks/useUserBalances.ts index ae3555d5..46535bc3 100644 --- a/src/hooks/useUserBalances.ts +++ b/src/hooks/useUserBalances.ts @@ -50,7 +50,7 @@ export function useUserBalances(options: UseUserBalancesOptions = {}) { const data = (await response.json()) as TokenResponse; return data.tokens; } catch (err) { - console.error(`Error fetching balances for chain ${chainId}:`, err); + console.warn(`Failed to fetch balances for chain ${chainId}:`, err); throw err instanceof Error ? err : new Error('Unknown error occurred'); } }, @@ -121,10 +121,12 @@ export function useUserBalances(options: UseUserBalancesOptions = {}) { } }); + // Always set balances, even if some/all networks failed setBalances(processedBalances); - if (failedChainIds.length > 0) { - const fallbackMessage = `Failed to fetch balances for chains: ${failedChainIds.join(', ')}`; + // Only set error if ALL networks failed + if (failedChainIds.length > 0 && failedChainIds.length === networksToFetch.length) { + const fallbackMessage = 'All networks failed to fetch balances'; const aggregatedMessage = errorMessages.length > 0 ? [...new Set(errorMessages)].join(' | ') : fallbackMessage; setError(new Error(aggregatedMessage)); } diff --git a/src/modals/supply/supply-modal-content.tsx b/src/modals/supply/supply-modal-content.tsx index 34e0e5be..9887685c 100644 --- a/src/modals/supply/supply-modal-content.tsx +++ b/src/modals/supply/supply-modal-content.tsx @@ -1,4 +1,4 @@ -import { useCallback } from 'react'; +import { useCallback, useState } from 'react'; import { IconSwitch } from '@/components/ui/icon-switch'; import { ReloadIcon } from '@radix-ui/react-icons'; import Input from '@/components/Input/Input'; @@ -10,6 +10,9 @@ import { isWrappedNativeToken } from '@/utils/tokens'; import type { Market } from '@/utils/types'; import { ExecuteTransactionButton } from '@/components/ui/ExecuteTransactionButton'; import { SupplyProcessModal } from './supply-process-modal'; +import { SwapButton } from '@/features/swap/components/SwapButton'; +import { BridgeSwapModal } from '@/features/swap/components/BridgeSwapModal'; +import type { SwapToken } from '@/features/swap/types'; type SupplyModalContentProps = { market: Market; @@ -22,6 +25,7 @@ type SupplyModalContentProps = { export function SupplyModalContent({ onClose, market, refetch, onAmountChange }: SupplyModalContentProps): JSX.Element { const [usePermit2Setting] = useLocalStorage('usePermit2', true); + const [swapTarget, setSwapTarget] = useState(null); const onSuccess = useCallback(() => { onClose(); @@ -70,6 +74,13 @@ export function SupplyModalContent({ onClose, market, refetch, onAmountChange }: return ( <> + {swapTarget && ( + setSwapTarget(null)} + targetToken={swapTarget} + /> + )} {showProcessModal && ( + {((useEth && (ethBalance ?? BigInt(0)) === BigInt(0)) || (!useEth && (tokenBalance ?? BigInt(0)) === BigInt(0))) && ( + + Swap to {useEth ? getNativeTokenSymbol(market.morphoBlue.chain.id) : market.loanAsset.symbol} + + )}
diff --git a/src/utils/tokens.ts b/src/utils/tokens.ts index 190dc433..c550a154 100644 --- a/src/utils/tokens.ts +++ b/src/utils/tokens.ts @@ -293,7 +293,10 @@ const supportedTokens = [ symbol: 'DAI', img: require('../imgs/tokens/dai.webp') as string, decimals: 18, - networks: [{ chain: mainnet, address: '0x6B175474E89094C44Da98b954EedeAC495271d0F' }], + networks: [ + { chain: mainnet, address: '0x6B175474E89094C44Da98b954EedeAC495271d0F' }, + { chain: base, address: '0x50c5725949a6f0c72e6c4a641f24049a917db0cb' } + ], peg: TokenPeg.USD, }, { From 8b543dc0118dcf0f16a183952365176e6c6eb828 Mon Sep 17 00:00:00 2001 From: antoncoding Date: Fri, 26 Dec 2025 11:51:20 +0800 Subject: [PATCH 4/8] chore: remove unncessary changes --- src/components/providers/ClientProviders.tsx | 8 +- src/components/ui/dropdown-menu.tsx | 10 +- .../swap/components/BridgeSwapModal.tsx | 49 +++------- src/features/swap/components/SwapButton.tsx | 44 --------- .../swap/components/SwapProcessModal.tsx | 98 ------------------- src/features/swap/hooks/useCowBridge.ts | 21 +--- src/features/swap/index.ts | 2 - src/modals/supply/supply-modal-content.tsx | 21 ++-- 8 files changed, 35 insertions(+), 218 deletions(-) delete mode 100644 src/features/swap/components/SwapButton.tsx delete mode 100644 src/features/swap/components/SwapProcessModal.tsx diff --git a/src/components/providers/ClientProviders.tsx b/src/components/providers/ClientProviders.tsx index 93305e91..b982aea3 100644 --- a/src/components/providers/ClientProviders.tsx +++ b/src/components/providers/ClientProviders.tsx @@ -15,8 +15,8 @@ type ClientProvidersProps = { export function ClientProviders({ children }: ClientProvidersProps) { return ( - - + + @@ -26,7 +26,7 @@ export function ClientProviders({ children }: ClientProvidersProps) { - - + + ); } diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx index 48e35956..466432cc 100644 --- a/src/components/ui/dropdown-menu.tsx +++ b/src/components/ui/dropdown-menu.tsx @@ -68,7 +68,7 @@ const DropdownMenuContent = React.forwardRef< sideOffset={sideOffset} className={cn( "z-50 min-w-[10rem] max-h-[var(--radix-dropdown-menu-content-available-height)]", - "overflow-y-auto overflow-x-hidden rounded-sm bg-surface p-2 shadow-lg font-zen", + "overflow-y-auto overflow-x-hidden rounded-sm bg-surface p-3 shadow-lg font-zen", "border border-border", "data-[state=open]:[animation:dropdownFadeIn_150ms_ease-out]", "data-[state=closed]:[animation:dropdownFadeOut_150ms_ease-in]", @@ -91,7 +91,7 @@ const DropdownMenuItem = React.forwardRef< svg]:size-4 [&>svg]:shrink-0", @@ -117,7 +117,7 @@ const DropdownMenuCheckboxItem = React.forwardRef< ('0'); const [amount, setAmount] = useState(BigInt(0)); const [slippage, _setSlippage] = useState(0.5); // 0.5% - const [showProcessModal, setShowProcessModal] = useState(false); - const [currentStep, setCurrentStep] = useState<'approve' | 'swapping'>('approve'); // Fetch user balances from CoW-supported chains const { balances, loading: balancesLoading } = useUserBalances({ @@ -66,7 +63,7 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa }, [balances, targetToken.chainId, targetToken.address]); // CoW Bridge hook - const { quote, isQuoting, isExecuting, errorDescription, orderUid, executeSwap, reset } = useCowBridge({ + const { quote, isQuoting, isExecuting, error, orderUid, executeSwap, reset } = useCowBridge({ sourceToken, targetToken, amount, @@ -108,31 +105,15 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa setSourceToken(null); setAmount(BigInt(0)); setInputAmount('0'); - setShowProcessModal(false); onClose(); }; // Unified execution handler - handles approve + swap automatically const handleSwap = useCallback(async () => { - try { - if (needsApproval) { - // Show process modal when approval needed - setShowProcessModal(true); - setCurrentStep('approve'); - await approveInfinite(); - - setCurrentStep('swapping'); - await executeSwap(); - - setShowProcessModal(false); - } else { - // Direct swap without process modal - await executeSwap(); - } - } catch (_err) { - setShowProcessModal(false); - // Error is already handled by hooks + if (needsApproval) { + await approveInfinite(); } + await executeSwap(); }, [needsApproval, approveInfinite, executeSwap]); const isLoading = isQuoting || approvePending || isExecuting; @@ -142,20 +123,12 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa if (!sourceToken) return 'Select token above'; if (amount === BigInt(0)) return '0'; if (isQuoting) return 'Loading...'; - if (errorDescription) return '—'; + if (error) return '—'; if (quote) return {Number(formatUnits(quote.buyAmount, targetToken.decimals)).toFixed(6)}; return '0'; }; - return showProcessModal && sourceToken ? ( - setShowProcessModal(false)} - needsApproval={needsApproval} - sourceSymbol={sourceToken.symbol} - targetSymbol={targetToken.symbol} - /> - ) : ( + return ( !open && handleClose()} @@ -219,7 +192,7 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa />
- {quote && sourceToken && !errorDescription && ( + {quote && sourceToken && !error && ( 1 {sourceToken.symbol} ≈{' '} {( @@ -232,15 +205,15 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa
{/* Error Display */} - {errorDescription && ( + {error && (

⚠️ Error

-

{errorDescription}

+

{error}

)} {/* Quote Details */} - {quote && sourceToken && !errorDescription && quote.type === 'cross-chain' && ( + {quote && sourceToken && !error && quote.type === 'cross-chain' && (
{quote.bridgeProvider && (
@@ -304,7 +277,7 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa targetChainId={sourceToken?.chainId ?? 1} onClick={() => void handleSwap()} isLoading={isLoading} - disabled={!quote || amount === BigInt(0) || !!errorDescription} + disabled={!quote || amount === BigInt(0) || !!error} variant="primary" > {needsApproval ? 'Approve & Swap' : 'Swap'} diff --git a/src/features/swap/components/SwapButton.tsx b/src/features/swap/components/SwapButton.tsx deleted file mode 100644 index 3d57ec89..00000000 --- a/src/features/swap/components/SwapButton.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import type { ReactNode } from 'react'; -import type { SwapToken } from '../types'; - -type SwapButtonProps = { - targetToken: SwapToken; - onOpenSwap: (targetToken: SwapToken) => void; - children: ReactNode; - className?: string; -}; - -/** - * Simple button to trigger swap modal - * - * Usage: - * ```tsx - * const [swapTarget, setSwapTarget] = useState(null); - * - * - * Swap to USDC - * - * - * {swapTarget && ( - * setSwapTarget(null)} - * targetToken={swapTarget} - * /> - * )} - * ``` - */ -export function SwapButton({ targetToken, onOpenSwap, children, className }: SwapButtonProps) { - return ( - - ); -} diff --git a/src/features/swap/components/SwapProcessModal.tsx b/src/features/swap/components/SwapProcessModal.tsx deleted file mode 100644 index c29e16be..00000000 --- a/src/features/swap/components/SwapProcessModal.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import { useMemo } from 'react'; -import { FaCheckCircle, FaCircle } from 'react-icons/fa'; -import { ArrowDownIcon } from '@radix-ui/react-icons'; -import { Modal, ModalBody, ModalHeader } from '@/components/common/Modal'; - -type SwapProcessModalProps = { - currentStep: 'approve' | 'swapping'; - onClose: () => void; - needsApproval: boolean; - sourceSymbol: string; - targetSymbol: string; -}; - -export function SwapProcessModal({ currentStep, onClose, needsApproval, sourceSymbol, targetSymbol }: SwapProcessModalProps): JSX.Element { - const steps = useMemo(() => { - if (!needsApproval) { - return [ - { - key: 'swapping', - label: 'Confirm Swap', - detail: 'Confirm transaction in wallet to complete the swap', - }, - ]; - } - - return [ - { - key: 'approve', - label: 'Approve Token', - detail: `Approve ${sourceSymbol} for spending`, - }, - { - key: 'swapping', - label: 'Confirm Swap', - detail: 'Confirm transaction in wallet to complete the swap', - }, - ]; - }, [needsApproval, sourceSymbol]); - - const getStepStatus = (stepKey: string) => { - const currentIndex = steps.findIndex((step) => step.key === currentStep); - const stepIndex = steps.findIndex((step) => step.key === stepKey); - - if (stepIndex < currentIndex) { - return 'done'; - } - if (stepKey === currentStep) { - return 'current'; - } - return 'undone'; - }; - - return ( - !open && onClose()} - size="lg" - isDismissable={false} - backdrop="blur" - > - } - onClose={onClose} - /> - -
- {steps.map((step) => { - const status = getStepStatus(step.key); - return ( -
-
- {status === 'done' ? ( - - ) : status === 'current' ? ( - - ) : ( - - )} -
-
-
{step.label}
-
{step.detail}
-
-
- ); - })} -
-
-
- ); -} diff --git a/src/features/swap/hooks/useCowBridge.ts b/src/features/swap/hooks/useCowBridge.ts index 57bb8f97..408f79d9 100644 --- a/src/features/swap/hooks/useCowBridge.ts +++ b/src/features/swap/hooks/useCowBridge.ts @@ -20,14 +20,11 @@ type UseCowBridgeParams = { type UseCowBridgeReturn = { quote: SwapQuoteDisplay | null; - rawQuote: CrossChainQuoteAndPost | null; isQuoting: boolean; isExecuting: boolean; - error: Error | null; - errorDescription: string | null; + error: string | null; orderUid: string | null; - getQuote: () => Promise; executeSwap: () => Promise; reset: () => void; }; @@ -44,8 +41,7 @@ export function useCowBridge({ sourceToken, targetToken, amount, slippageBps }: const [rawQuote, setRawQuote] = useState(null); const [isQuoting, setIsQuoting] = useState(false); const [isExecuting, setIsExecuting] = useState(false); - const [error, setError] = useState(null); - const [errorDescription, setErrorDescription] = useState(null); + const [error, setError] = useState(null); const [orderUid, setOrderUid] = useState(null); // Bind SDK to wagmi @@ -135,9 +131,7 @@ export function useCowBridge({ sourceToken, targetToken, amount, slippageBps }: }); } } catch (err) { - const errObj = err instanceof Error ? err : new Error('Failed to get quote'); - setError(errObj); - setErrorDescription(parseErrorDescription(err)); + setError(parseErrorDescription(err)); setQuote(null); setRawQuote(null); } finally { @@ -171,9 +165,7 @@ export function useCowBridge({ sourceToken, targetToken, amount, slippageBps }: setOrderUid(result.orderId); } catch (err) { - const errObj = err instanceof Error ? err : new Error('Failed to execute swap'); - setError(errObj); - setErrorDescription(parseErrorDescription(err)); + setError(parseErrorDescription(err)); } finally { setIsExecuting(false); } @@ -186,7 +178,6 @@ export function useCowBridge({ sourceToken, targetToken, amount, slippageBps }: setQuote(null); setRawQuote(null); setError(null); - setErrorDescription(null); setOrderUid(null); }, []); @@ -201,7 +192,6 @@ export function useCowBridge({ sourceToken, targetToken, amount, slippageBps }: // Reset state setOrderUid(null); setError(null); - setErrorDescription(null); // Debounce quote fetching const timeoutId = setTimeout(() => { @@ -213,13 +203,10 @@ export function useCowBridge({ sourceToken, targetToken, amount, slippageBps }: return { quote, - rawQuote, isQuoting, isExecuting, error, - errorDescription, orderUid, - getQuote, executeSwap, reset, }; diff --git a/src/features/swap/index.ts b/src/features/swap/index.ts index c022939b..547613df 100644 --- a/src/features/swap/index.ts +++ b/src/features/swap/index.ts @@ -4,10 +4,8 @@ * Provides same-chain and cross-chain token swaps via CoW Protocol */ -export { SwapButton } from './components/SwapButton'; export { BridgeSwapModal } from './components/BridgeSwapModal'; export { TokenNetworkDropdown } from './components/TokenNetworkDropdown'; -export { SwapProcessModal } from './components/SwapProcessModal'; export { useCowBridge } from './hooks/useCowBridge'; export { bridgingSdk, bungeeBridgeProvider } from './cowBridgingSdk'; export type { SwapToken, SwapQuoteDisplay, CowBridgeChainId } from './types'; diff --git a/src/modals/supply/supply-modal-content.tsx b/src/modals/supply/supply-modal-content.tsx index 9887685c..b5a58023 100644 --- a/src/modals/supply/supply-modal-content.tsx +++ b/src/modals/supply/supply-modal-content.tsx @@ -10,7 +10,6 @@ import { isWrappedNativeToken } from '@/utils/tokens'; import type { Market } from '@/utils/types'; import { ExecuteTransactionButton } from '@/components/ui/ExecuteTransactionButton'; import { SupplyProcessModal } from './supply-process-modal'; -import { SwapButton } from '@/features/swap/components/SwapButton'; import { BridgeSwapModal } from '@/features/swap/components/BridgeSwapModal'; import type { SwapToken } from '@/features/swap/types'; @@ -131,18 +130,20 @@ export function SupplyModalContent({ onClose, market, refetch, onAmountChange }: {((useEth && (ethBalance ?? BigInt(0)) === BigInt(0)) || (!useEth && (tokenBalance ?? BigInt(0)) === BigInt(0))) && ( - + setSwapTarget({ + address: market.loanAsset.address, + symbol: market.loanAsset.symbol, + chainId: market.morphoBlue.chain.id, + decimals: market.loanAsset.decimals, + }) + } className="text-primary flex items-center gap-0.5 text-xs transition hover:opacity-70" > Swap to {useEth ? getNativeTokenSymbol(market.morphoBlue.chain.id) : market.loanAsset.symbol} - + )}
From 43f016581ca5fd345aacf1d33c35b2fff552b96b Mon Sep 17 00:00:00 2001 From: antoncoding Date: Fri, 26 Dec 2025 12:07:14 +0800 Subject: [PATCH 5/8] misc: conifg --- src/features/swap/components/BridgeSwapModal.tsx | 3 ++- src/features/swap/constants.ts | 13 +++++++++++++ src/features/swap/cowBridgingSdk.ts | 3 ++- src/features/swap/hooks/useCowBridge.ts | 3 ++- src/features/swap/index.ts | 1 + 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 src/features/swap/constants.ts diff --git a/src/features/swap/components/BridgeSwapModal.tsx b/src/features/swap/components/BridgeSwapModal.tsx index df5962ed..f131a207 100644 --- a/src/features/swap/components/BridgeSwapModal.tsx +++ b/src/features/swap/components/BridgeSwapModal.tsx @@ -11,6 +11,7 @@ import { formatBalance } from '@/utils/balance'; import { useCowBridge } from '../hooks/useCowBridge'; import { TokenNetworkDropdown } from './TokenNetworkDropdown'; import { COW_BRIDGE_CHAINS, COW_VAULT_RELAYER, type SwapToken } from '../types'; +import { DEFAULT_SLIPPAGE_PERCENT } from '../constants'; type BridgeSwapModalProps = { isOpen: boolean; @@ -23,7 +24,7 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa const [sourceToken, setSourceToken] = useState(null); const [inputAmount, setInputAmount] = useState('0'); const [amount, setAmount] = useState(BigInt(0)); - const [slippage, _setSlippage] = useState(0.5); // 0.5% + const [slippage, _setSlippage] = useState(DEFAULT_SLIPPAGE_PERCENT); // Fetch user balances from CoW-supported chains const { balances, loading: balancesLoading } = useUserBalances({ diff --git a/src/features/swap/constants.ts b/src/features/swap/constants.ts new file mode 100644 index 00000000..6f085496 --- /dev/null +++ b/src/features/swap/constants.ts @@ -0,0 +1,13 @@ +/** + * CoW Protocol swap configuration constants + */ + +/** + * Application identifier for CoW Protocol integration + */ +export const SWAP_APP_CODE = 'monarch-swap'; + +/** + * Default slippage tolerance as a percentage (0.5 = 0.5%) + */ +export const DEFAULT_SLIPPAGE_PERCENT = 0.5; diff --git a/src/features/swap/cowBridgingSdk.ts b/src/features/swap/cowBridgingSdk.ts index 7b7053ce..839a4d11 100644 --- a/src/features/swap/cowBridgingSdk.ts +++ b/src/features/swap/cowBridgingSdk.ts @@ -1,5 +1,6 @@ import { TradingSdk } from '@cowprotocol/cow-sdk'; import { BridgingSdk, BungeeBridgeProvider } from '@cowprotocol/sdk-bridging'; +import { SWAP_APP_CODE } from './constants'; /** * Trading SDK for approvals and allowances @@ -7,7 +8,7 @@ import { BridgingSdk, BungeeBridgeProvider } from '@cowprotocol/sdk-bridging'; export const tradingSdk = new TradingSdk( { chainId: 1, // Default, will be updated by adapter - appCode: 'monarch-swap', + appCode: SWAP_APP_CODE, }, {}, ); diff --git a/src/features/swap/hooks/useCowBridge.ts b/src/features/swap/hooks/useCowBridge.ts index 408f79d9..f0e66ee8 100644 --- a/src/features/swap/hooks/useCowBridge.ts +++ b/src/features/swap/hooks/useCowBridge.ts @@ -10,6 +10,7 @@ import { import { ViemAdapter } from '@cowprotocol/sdk-viem-adapter'; import { bridgingSdk, tradingSdk } from '../cowBridgingSdk'; import type { SwapQuoteDisplay, SwapToken } from '../types'; +import { SWAP_APP_CODE } from '../constants'; type UseCowBridgeParams = { sourceToken: SwapToken | null; @@ -102,7 +103,7 @@ export function useCowBridge({ sourceToken, targetToken, amount, slippageBps }: account, receiver: account, signer: walletClient as any, // Viem WalletClient as signer - appCode: 'monarch-swap', + appCode: SWAP_APP_CODE, }; const quoteResult = await bridgingSdk.getQuote(quoteBridgeRequest); diff --git a/src/features/swap/index.ts b/src/features/swap/index.ts index 547613df..d642cf0e 100644 --- a/src/features/swap/index.ts +++ b/src/features/swap/index.ts @@ -10,3 +10,4 @@ export { useCowBridge } from './hooks/useCowBridge'; export { bridgingSdk, bungeeBridgeProvider } from './cowBridgingSdk'; export type { SwapToken, SwapQuoteDisplay, CowBridgeChainId } from './types'; export { COW_BRIDGE_CHAINS, COW_VAULT_RELAYER, isCowBridgeChain } from './types'; +export { SWAP_APP_CODE, DEFAULT_SLIPPAGE_PERCENT } from './constants'; From bd4dc4d32bf404f0ad12b7f6630e89b32676d29c Mon Sep 17 00:00:00 2001 From: antoncoding Date: Fri, 26 Dec 2025 12:43:35 +0800 Subject: [PATCH 6/8] chore: motion --- .../swap/components/BridgeSwapModal.tsx | 61 +++++++++++++------ src/modals/supply/supply-modal-content.tsx | 6 +- 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/src/features/swap/components/BridgeSwapModal.tsx b/src/features/swap/components/BridgeSwapModal.tsx index f131a207..ed41ff6d 100644 --- a/src/features/swap/components/BridgeSwapModal.tsx +++ b/src/features/swap/components/BridgeSwapModal.tsx @@ -2,6 +2,7 @@ import { useCallback, useMemo, useState } from 'react'; import { ArrowDownIcon, ExternalLinkIcon } from '@radix-ui/react-icons'; import { formatUnits, parseUnits } from 'viem'; import { useAccount } from 'wagmi'; +import { motion } from 'framer-motion'; import { Modal, ModalBody, ModalFooter, ModalHeader } from '@/components/common/Modal'; import { Button } from '@/components/ui/button'; import { ExecuteTransactionButton } from '@/components/ui/ExecuteTransactionButton'; @@ -119,16 +120,30 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa const isLoading = isQuoting || approvePending || isExecuting; + // Format error messages to be user-friendly + const formatErrorMessage = (errorMsg: string): string => { + if (errorMsg.includes('BUILD_TX_ERROR')) return 'Failed to build transaction. Please try again.'; + if (errorMsg.includes('same from and to token')) return 'Cannot swap to the same token. Try selecting a different source token.'; + if (errorMsg.toLowerCase().includes('insufficient')) return errorMsg; + return errorMsg; + }; + // Determine output display text const getOutputDisplay = () => { if (!sourceToken) return 'Select token above'; if (amount === BigInt(0)) return '0'; if (isQuoting) return 'Loading...'; - if (error) return '—'; + if (error) return {formatErrorMessage(error)}; if (quote) return {Number(formatUnits(quote.buyAmount, targetToken.decimals)).toFixed(6)}; return '0'; }; + // Truncate order hash for display (e.g., "0x1234...5678") + const truncateHash = (hash: string) => { + if (hash.length <= 16) return hash; + return `${hash.slice(0, 8)}...${hash.slice(-6)}`; + }; + return ( -

⚠️ Error

-

{error}

-
+ + {formatErrorMessage(error)} + )} {/* Quote Details */} @@ -241,19 +260,25 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa {/* Success Message */} {orderUid && ( - + +
+ Order Created 🎉 + + View in CoW Explorer + + +
+
)} {/* Empty State */} diff --git a/src/modals/supply/supply-modal-content.tsx b/src/modals/supply/supply-modal-content.tsx index b5a58023..2fd8efbb 100644 --- a/src/modals/supply/supply-modal-content.tsx +++ b/src/modals/supply/supply-modal-content.tsx @@ -113,7 +113,7 @@ export function SupplyModalContent({ onClose, market, refetch, onAmountChange }:
Supply amount -
+

Balance:{' '} {useEth @@ -140,9 +140,9 @@ export function SupplyModalContent({ onClose, market, refetch, onAmountChange }: decimals: market.loanAsset.decimals, }) } - className="text-primary flex items-center gap-0.5 text-xs transition hover:opacity-70" + className="text-primary text-xs transition hover:opacity-70" > - Swap to {useEth ? getNativeTokenSymbol(market.morphoBlue.chain.id) : market.loanAsset.symbol} + Swap or Bridge )}

From a6f8f26dfac00f0a0834924502b645078396d355 Mon Sep 17 00:00:00 2001 From: antoncoding Date: Fri, 26 Dec 2025 12:47:51 +0800 Subject: [PATCH 7/8] misc: build --- src/features/swap/components/BridgeSwapModal.tsx | 2 +- src/utils/tokens.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/swap/components/BridgeSwapModal.tsx b/src/features/swap/components/BridgeSwapModal.tsx index ed41ff6d..417a4e9b 100644 --- a/src/features/swap/components/BridgeSwapModal.tsx +++ b/src/features/swap/components/BridgeSwapModal.tsx @@ -139,7 +139,7 @@ export function BridgeSwapModal({ isOpen, onClose, targetToken }: BridgeSwapModa }; // Truncate order hash for display (e.g., "0x1234...5678") - const truncateHash = (hash: string) => { + const _truncateHash = (hash: string) => { if (hash.length <= 16) return hash; return `${hash.slice(0, 8)}...${hash.slice(-6)}`; }; diff --git a/src/utils/tokens.ts b/src/utils/tokens.ts index c550a154..4ba507e9 100644 --- a/src/utils/tokens.ts +++ b/src/utils/tokens.ts @@ -295,7 +295,7 @@ const supportedTokens = [ decimals: 18, networks: [ { chain: mainnet, address: '0x6B175474E89094C44Da98b954EedeAC495271d0F' }, - { chain: base, address: '0x50c5725949a6f0c72e6c4a641f24049a917db0cb' } + { chain: base, address: '0x50c5725949a6f0c72e6c4a641f24049a917db0cb' }, ], peg: TokenPeg.USD, }, From aa1e3e7006620ab260fc5d2842b4764b95159093 Mon Sep 17 00:00:00 2001 From: antoncoding Date: Fri, 26 Dec 2025 12:57:17 +0800 Subject: [PATCH 8/8] misc: remove contract dep --- package.json | 1 - pnpm-lock.yaml | 465 +------------------------------------------------ 2 files changed, 3 insertions(+), 463 deletions(-) diff --git a/package.json b/package.json index c8a4644d..b61209d0 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@cowprotocol/contracts": "^1.8.0", "@cowprotocol/cow-sdk": "^7.2.9", "@cowprotocol/sdk-bridging": "^1.2.0", "@cowprotocol/sdk-viem-adapter": "^0.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 20e90d65..7cceb0d6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,6 @@ importers: .: dependencies: - '@cowprotocol/contracts': - specifier: ^1.8.0 - version: 1.8.0(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@cowprotocol/cow-sdk': specifier: ^7.2.9 version: 7.2.9(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) @@ -892,11 +889,6 @@ packages: '@coinbase/wallet-sdk@4.3.7': resolution: {integrity: sha512-z6e5XDw6EF06RqkeyEa+qD0dZ2ZbLci99vx3zwDY//XO8X7166tqKJrR2XlQnzVmtcUuJtCd5fCvr9Cu6zzX7w==} - '@cowprotocol/contracts@1.8.0': - resolution: {integrity: sha512-rMEHo1UBB6k4kRoWejHZNGggg6IBVt7vAd8x0FhEvjxhbq3zlAex61f9HpAcDExJNuvfwwDjsOc/7UGztCzhSw==} - peerDependencies: - ethers: ^5.4.0 - '@cowprotocol/cow-sdk@7.2.9': resolution: {integrity: sha512-rAy7cG2xz+1z/jUU6avKNmViJWNE//JYxUojPz44kzwkMlrfistFHqO3J6CWyzrfoKdLcN1ZI5PiBX+sgxb1og==} peerDependencies: @@ -1171,96 +1163,6 @@ packages: resolution: {integrity: sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==} engines: {node: '>=14'} - '@ethersproject/abi@5.8.0': - resolution: {integrity: sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q==} - - '@ethersproject/abstract-provider@5.8.0': - resolution: {integrity: sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg==} - - '@ethersproject/abstract-signer@5.8.0': - resolution: {integrity: sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA==} - - '@ethersproject/address@5.8.0': - resolution: {integrity: sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA==} - - '@ethersproject/base64@5.8.0': - resolution: {integrity: sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ==} - - '@ethersproject/basex@5.8.0': - resolution: {integrity: sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q==} - - '@ethersproject/bignumber@5.8.0': - resolution: {integrity: sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA==} - - '@ethersproject/bytes@5.8.0': - resolution: {integrity: sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A==} - - '@ethersproject/constants@5.8.0': - resolution: {integrity: sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg==} - - '@ethersproject/contracts@5.8.0': - resolution: {integrity: sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ==} - - '@ethersproject/hash@5.8.0': - resolution: {integrity: sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA==} - - '@ethersproject/hdnode@5.8.0': - resolution: {integrity: sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA==} - - '@ethersproject/json-wallets@5.8.0': - resolution: {integrity: sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w==} - - '@ethersproject/keccak256@5.8.0': - resolution: {integrity: sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng==} - - '@ethersproject/logger@5.8.0': - resolution: {integrity: sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA==} - - '@ethersproject/networks@5.8.0': - resolution: {integrity: sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg==} - - '@ethersproject/pbkdf2@5.8.0': - resolution: {integrity: sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg==} - - '@ethersproject/properties@5.8.0': - resolution: {integrity: sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw==} - - '@ethersproject/providers@5.8.0': - resolution: {integrity: sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw==} - - '@ethersproject/random@5.8.0': - resolution: {integrity: sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A==} - - '@ethersproject/rlp@5.8.0': - resolution: {integrity: sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==} - - '@ethersproject/sha2@5.8.0': - resolution: {integrity: sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A==} - - '@ethersproject/signing-key@5.8.0': - resolution: {integrity: sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==} - - '@ethersproject/solidity@5.8.0': - resolution: {integrity: sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA==} - - '@ethersproject/strings@5.8.0': - resolution: {integrity: sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==} - - '@ethersproject/transactions@5.8.0': - resolution: {integrity: sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==} - - '@ethersproject/units@5.8.0': - resolution: {integrity: sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ==} - - '@ethersproject/wallet@5.8.0': - resolution: {integrity: sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA==} - - '@ethersproject/web@5.8.0': - resolution: {integrity: sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==} - - '@ethersproject/wordlists@5.8.0': - resolution: {integrity: sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg==} - '@floating-ui/core@1.7.3': resolution: {integrity: sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==} @@ -3142,9 +3044,6 @@ packages: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} - aes-js@3.0.0: - resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} - agentkeepalive@4.6.0: resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==} engines: {node: '>= 8.0.0'} @@ -3253,9 +3152,6 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - bech32@1.1.4: - resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} - big.js@6.2.2: resolution: {integrity: sha512-y/ie+Faknx7sZA5MfGA2xKlu0GDv8RWrXGsmlteyJQ2lvoKv9GBK/fpRMc2qlSoBAgNxrixICFCBefIq8WCQpQ==} @@ -3265,9 +3161,6 @@ packages: blakejs@1.2.1: resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} - bn.js@4.12.2: - resolution: {integrity: sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==} - bn.js@5.2.2: resolution: {integrity: sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==} @@ -3281,9 +3174,6 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - brorand@1.1.0: - resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} - browserslist@4.25.3: resolution: {integrity: sha512-cDGv1kkDI4/0e5yON9yM5G/0A5u8sf5TnmdX5C9qHzI9PPu++sQ9zjm1k9NiOrf3riY4OkK0zSGqfvJyJsgCBQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -3669,9 +3559,6 @@ packages: electron-to-chromium@1.5.205: resolution: {integrity: sha512-gBtbT7IgOHu7CwdtIiXwbNRD1l6oG6GAyanmwMCLVqaoGy92Jfe1dSHLiSj8xUEZNxOTIVlXuaAalMMD+S4y0w==} - elliptic@6.6.1: - resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} - elysia@1.4.3-beta.0: resolution: {integrity: sha512-UzanGZSqoKKcKgg+I4YB+ZOGeJNA7mlA8JPj7klYi0LDVcj/vtXKGRmsp4jEzZO+LjSpFuYTZcwHi4rCnvJj1w==} peerDependencies: @@ -3766,9 +3653,6 @@ packages: ethereum-cryptography@2.2.1: resolution: {integrity: sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==} - ethers@5.8.0: - resolution: {integrity: sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg==} - event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} @@ -4016,9 +3900,6 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} - hash.js@1.1.7: - resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} - hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -4026,9 +3907,6 @@ packages: help-me@5.0.0: resolution: {integrity: sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==} - hmac-drbg@1.0.1: - resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} - hono@4.10.7: resolution: {integrity: sha512-icXIITfw/07Q88nLSkB9aiUrd8rYzSweK681Kjo/TSggaGbOX4RRyxxm71v+3PC8C/j+4rlxGeoTRxQDkaJkUw==} engines: {node: '>=16.9.0'} @@ -4558,12 +4436,6 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - minimalistic-assert@1.0.1: - resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} - - minimalistic-crypto-utils@1.0.1: - resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} - minimatch@10.1.1: resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} engines: {node: 20 || >=22} @@ -5210,9 +5082,6 @@ packages: scheduler@0.23.2: resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - scrypt-js@3.0.1: - resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} - secure-json-parse@4.1.0: resolution: {integrity: sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA==} @@ -6789,10 +6658,6 @@ snapshots: - zod optional: true - '@cowprotocol/contracts@1.8.0(ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': - dependencies: - ethers: 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@cowprotocol/cow-sdk@7.2.9(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0)': dependencies: '@cowprotocol/sdk-app-data': 4.5.0(ajv@8.17.1)(cross-fetch@4.1.0)(ipfs-only-hash@4.0.0)(multiformats@9.9.0) @@ -7044,261 +6909,6 @@ snapshots: micro-ftch: 0.3.1 optional: true - '@ethersproject/abi@5.8.0': - dependencies: - '@ethersproject/address': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/hash': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/strings': 5.8.0 - - '@ethersproject/abstract-provider@5.8.0': - dependencies: - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/networks': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/transactions': 5.8.0 - '@ethersproject/web': 5.8.0 - - '@ethersproject/abstract-signer@5.8.0': - dependencies: - '@ethersproject/abstract-provider': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - - '@ethersproject/address@5.8.0': - dependencies: - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/rlp': 5.8.0 - - '@ethersproject/base64@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - - '@ethersproject/basex@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/properties': 5.8.0 - - '@ethersproject/bignumber@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - bn.js: 5.2.2 - - '@ethersproject/bytes@5.8.0': - dependencies: - '@ethersproject/logger': 5.8.0 - - '@ethersproject/constants@5.8.0': - dependencies: - '@ethersproject/bignumber': 5.8.0 - - '@ethersproject/contracts@5.8.0': - dependencies: - '@ethersproject/abi': 5.8.0 - '@ethersproject/abstract-provider': 5.8.0 - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/transactions': 5.8.0 - - '@ethersproject/hash@5.8.0': - dependencies: - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/base64': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/strings': 5.8.0 - - '@ethersproject/hdnode@5.8.0': - dependencies: - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/basex': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/pbkdf2': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/sha2': 5.8.0 - '@ethersproject/signing-key': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@ethersproject/transactions': 5.8.0 - '@ethersproject/wordlists': 5.8.0 - - '@ethersproject/json-wallets@5.8.0': - dependencies: - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/hdnode': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/pbkdf2': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/random': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@ethersproject/transactions': 5.8.0 - aes-js: 3.0.0 - scrypt-js: 3.0.1 - - '@ethersproject/keccak256@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - js-sha3: 0.8.0 - - '@ethersproject/logger@5.8.0': {} - - '@ethersproject/networks@5.8.0': - dependencies: - '@ethersproject/logger': 5.8.0 - - '@ethersproject/pbkdf2@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/sha2': 5.8.0 - - '@ethersproject/properties@5.8.0': - dependencies: - '@ethersproject/logger': 5.8.0 - - '@ethersproject/providers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': - dependencies: - '@ethersproject/abstract-provider': 5.8.0 - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/base64': 5.8.0 - '@ethersproject/basex': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/hash': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/networks': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/random': 5.8.0 - '@ethersproject/rlp': 5.8.0 - '@ethersproject/sha2': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@ethersproject/transactions': 5.8.0 - '@ethersproject/web': 5.8.0 - bech32: 1.1.4 - ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - '@ethersproject/random@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - - '@ethersproject/rlp@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - - '@ethersproject/sha2@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - hash.js: 1.1.7 - - '@ethersproject/signing-key@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - bn.js: 5.2.2 - elliptic: 6.6.1 - hash.js: 1.1.7 - - '@ethersproject/solidity@5.8.0': - dependencies: - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/sha2': 5.8.0 - '@ethersproject/strings': 5.8.0 - - '@ethersproject/strings@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/logger': 5.8.0 - - '@ethersproject/transactions@5.8.0': - dependencies: - '@ethersproject/address': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/rlp': 5.8.0 - '@ethersproject/signing-key': 5.8.0 - - '@ethersproject/units@5.8.0': - dependencies: - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/logger': 5.8.0 - - '@ethersproject/wallet@5.8.0': - dependencies: - '@ethersproject/abstract-provider': 5.8.0 - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/hash': 5.8.0 - '@ethersproject/hdnode': 5.8.0 - '@ethersproject/json-wallets': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/random': 5.8.0 - '@ethersproject/signing-key': 5.8.0 - '@ethersproject/transactions': 5.8.0 - '@ethersproject/wordlists': 5.8.0 - - '@ethersproject/web@5.8.0': - dependencies: - '@ethersproject/base64': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/strings': 5.8.0 - - '@ethersproject/wordlists@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/hash': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@floating-ui/core@1.7.3': dependencies: '@floating-ui/utils': 0.2.10 @@ -10589,8 +10199,6 @@ snapshots: event-target-shim: 5.0.1 optional: true - aes-js@3.0.0: {} - agentkeepalive@4.6.0: dependencies: humanize-ms: 1.2.1 @@ -10708,8 +10316,6 @@ snapshots: base64-js@1.5.1: {} - bech32@1.1.4: {} - big.js@6.2.2: {} bl@5.1.0: @@ -10720,9 +10326,8 @@ snapshots: blakejs@1.2.1: {} - bn.js@4.12.2: {} - - bn.js@5.2.2: {} + bn.js@5.2.2: + optional: true borsh@0.7.0: dependencies: @@ -10738,8 +10343,6 @@ snapshots: dependencies: fill-range: 7.1.1 - brorand@1.1.0: {} - browserslist@4.25.3: dependencies: caniuse-lite: 1.0.30001735 @@ -11117,16 +10720,6 @@ snapshots: electron-to-chromium@1.5.205: {} - elliptic@6.6.1: - dependencies: - bn.js: 4.12.2 - brorand: 1.1.0 - hash.js: 1.1.7 - hmac-drbg: 1.0.1 - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - elysia@1.4.3-beta.0(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(typescript@5.9.3): dependencies: cookie: 1.1.1 @@ -11273,42 +10866,6 @@ snapshots: '@scure/bip39': 1.3.0 optional: true - ethers@5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): - dependencies: - '@ethersproject/abi': 5.8.0 - '@ethersproject/abstract-provider': 5.8.0 - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/base64': 5.8.0 - '@ethersproject/basex': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/contracts': 5.8.0 - '@ethersproject/hash': 5.8.0 - '@ethersproject/hdnode': 5.8.0 - '@ethersproject/json-wallets': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/networks': 5.8.0 - '@ethersproject/pbkdf2': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/providers': 5.8.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@ethersproject/random': 5.8.0 - '@ethersproject/rlp': 5.8.0 - '@ethersproject/sha2': 5.8.0 - '@ethersproject/signing-key': 5.8.0 - '@ethersproject/solidity': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@ethersproject/transactions': 5.8.0 - '@ethersproject/units': 5.8.0 - '@ethersproject/wallet': 5.8.0 - '@ethersproject/web': 5.8.0 - '@ethersproject/wordlists': 5.8.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - event-target-shim@5.0.1: optional: true @@ -11548,23 +11105,12 @@ snapshots: dependencies: has-symbols: 1.1.0 - hash.js@1.1.7: - dependencies: - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - hasown@2.0.2: dependencies: function-bind: 1.1.2 help-me@5.0.0: {} - hmac-drbg@1.0.1: - dependencies: - hash.js: 1.1.7 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - hono@4.10.7: optional: true @@ -12068,10 +11614,6 @@ snapshots: min-indent@1.0.1: {} - minimalistic-assert@1.0.1: {} - - minimalistic-crypto-utils@1.0.1: {} - minimatch@10.1.1: dependencies: '@isaacs/brace-expansion': 5.0.0 @@ -12847,8 +12389,6 @@ snapshots: dependencies: loose-envify: 1.4.0 - scrypt-js@3.0.1: {} - secure-json-parse@4.1.0: {} semver@5.7.2: {} @@ -13574,6 +13114,7 @@ snapshots: optionalDependencies: bufferutil: 4.0.9 utf-8-validate: 5.0.10 + optional: true ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10): optionalDependencies: