From 650758ae3c016b30bdc162c6af2afbd3cb9e5013 Mon Sep 17 00:00:00 2001 From: Saeedeh Torkamani Date: Mon, 9 Dec 2024 08:24:23 +0000 Subject: [PATCH] Fix the missing dependencies in the package.json for various packages --- .changeset/green-boats-sneeze.md | 18 ++ .changeset/warm-wasps-smoke.md | 5 + apps/guard/app/_theme/theme.ts | 3 +- apps/rosen/app/(bridge)/BridgeForm.tsx | 2 +- apps/rosen/app/_theme/theme.tsx | 3 +- apps/rosen/package.json | 8 +- apps/watcher/app/_theme/theme.ts | 3 +- build.sh | 1 - package-lock.json | 228 ++++++++++++------ package.json | 4 +- packages/asset-calculator/package.json | 1 + packages/common-hooks/package.json | 5 +- packages/icons/src/wallets/index.ts | 1 - packages/icons/src/wallets/xdefi.svg | 23 -- packages/ui-kit/package.json | 1 + .../src/components/base/Autocomplete.tsx | 2 + packages/ui-kit/src/components/base/index.ts | 1 + packages/ui-kit/src/index.ts | 1 + packages/utils/package.json | 3 +- wallets/eternl-wallet/package.json | 2 + wallets/flint-wallet/package.json | 2 + wallets/lace-wallet/package.json | 2 + wallets/metamask-wallet/package.json | 3 +- wallets/nami-wallet/package.json | 2 + wallets/nautilus-wallet/package.json | 7 +- wallets/vespr-wallet/package.json | 1 - wallets/xdefi-wallet/CHANGELOG.md | 107 -------- wallets/xdefi-wallet/package.json | 28 --- wallets/xdefi-wallet/src/connectWallet.ts | 20 -- wallets/xdefi-wallet/src/getAddressCreator.ts | 30 --- wallets/xdefi-wallet/src/getBalance.ts | 49 ---- wallets/xdefi-wallet/src/getXdefiWallet.ts | 22 -- wallets/xdefi-wallet/src/global.d.ts | 7 - wallets/xdefi-wallet/src/index.ts | 2 - wallets/xdefi-wallet/src/isXdefiAvailable.ts | 3 - wallets/xdefi-wallet/src/transfer.ts | 94 -------- .../xdefi-wallet/src/xdefiWalletCreator.ts | 16 -- wallets/xdefi-wallet/src/xdefiWalletInfo.ts | 9 - wallets/xdefi-wallet/tsconfig.json | 9 - 39 files changed, 206 insertions(+), 522 deletions(-) create mode 100644 .changeset/green-boats-sneeze.md create mode 100644 .changeset/warm-wasps-smoke.md delete mode 100644 packages/icons/src/wallets/xdefi.svg create mode 100644 packages/ui-kit/src/components/base/Autocomplete.tsx delete mode 100644 wallets/xdefi-wallet/CHANGELOG.md delete mode 100644 wallets/xdefi-wallet/package.json delete mode 100644 wallets/xdefi-wallet/src/connectWallet.ts delete mode 100644 wallets/xdefi-wallet/src/getAddressCreator.ts delete mode 100644 wallets/xdefi-wallet/src/getBalance.ts delete mode 100644 wallets/xdefi-wallet/src/getXdefiWallet.ts delete mode 100644 wallets/xdefi-wallet/src/global.d.ts delete mode 100644 wallets/xdefi-wallet/src/index.ts delete mode 100644 wallets/xdefi-wallet/src/isXdefiAvailable.ts delete mode 100644 wallets/xdefi-wallet/src/transfer.ts delete mode 100644 wallets/xdefi-wallet/src/xdefiWalletCreator.ts delete mode 100644 wallets/xdefi-wallet/src/xdefiWalletInfo.ts delete mode 100644 wallets/xdefi-wallet/tsconfig.json diff --git a/.changeset/green-boats-sneeze.md b/.changeset/green-boats-sneeze.md new file mode 100644 index 00000000..7d3af7ef --- /dev/null +++ b/.changeset/green-boats-sneeze.md @@ -0,0 +1,18 @@ +--- +'@rosen-ui/asset-calculator': patch +'@rosen-ui/metamask-wallet': patch +'@rosen-ui/nautilus-wallet': patch +'@rosen-ui/common-hooks': patch +'@rosen-ui/eternl-wallet': patch +'@rosen-ui/flint-wallet': patch +'@rosen-ui/vespr-wallet': patch +'@rosen-ui/lace-wallet': patch +'@rosen-ui/nami-wallet': patch +'@rosen-bridge/ui-kit': patch +'@rosen-ui/utils': patch +'@rosen-bridge/watcher-app': patch +'@rosen-bridge/guard-app': patch +'@rosen-bridge/rosen-app': patch +--- + +Fix missing dependencies and remove unused packages diff --git a/.changeset/warm-wasps-smoke.md b/.changeset/warm-wasps-smoke.md new file mode 100644 index 00000000..28209f9c --- /dev/null +++ b/.changeset/warm-wasps-smoke.md @@ -0,0 +1,5 @@ +--- +'@rosen-bridge/rosen-app': major +--- + +Discontinue support for the Xdefi wallet extension diff --git a/apps/guard/app/_theme/theme.ts b/apps/guard/app/_theme/theme.ts index 3a8fdcda..137c6fdd 100644 --- a/apps/guard/app/_theme/theme.ts +++ b/apps/guard/app/_theme/theme.ts @@ -1,5 +1,4 @@ -import { Theme } from '@mui/material'; -import { createTheme } from '@rosen-bridge/ui-kit'; +import { createTheme, Theme } from '@rosen-bridge/ui-kit'; declare module '@mui/material/styles' {} diff --git a/apps/rosen/app/(bridge)/BridgeForm.tsx b/apps/rosen/app/(bridge)/BridgeForm.tsx index 0a0a67a3..54e42da4 100644 --- a/apps/rosen/app/(bridge)/BridgeForm.tsx +++ b/apps/rosen/app/(bridge)/BridgeForm.tsx @@ -2,7 +2,6 @@ import { useCallback, ChangeEvent } from 'react'; -import { Autocomplete } from '@mui/material'; import { RosenChainToken } from '@rosen-bridge/tokens'; import { Grid, @@ -14,6 +13,7 @@ import { CircularProgress, SvgIcon, Alert, + Autocomplete, } from '@rosen-bridge/ui-kit'; import { NETWORKS } from '@rosen-ui/constants'; import { getDecimalString } from '@rosen-ui/utils'; diff --git a/apps/rosen/app/_theme/theme.tsx b/apps/rosen/app/_theme/theme.tsx index 4208768a..9e7e165c 100644 --- a/apps/rosen/app/_theme/theme.tsx +++ b/apps/rosen/app/_theme/theme.tsx @@ -1,11 +1,10 @@ -import { Theme } from '@mui/material'; import { CheckCircle, ExclamationCircle, ExclamationTriangle, InfoCircle, } from '@rosen-bridge/icons'; -import { alpha, createTheme, SvgIcon } from '@rosen-bridge/ui-kit'; +import { alpha, createTheme, SvgIcon, Theme } from '@rosen-bridge/ui-kit'; declare module '@mui/material/styles' { interface TypeNeutral { diff --git a/apps/rosen/package.json b/apps/rosen/package.json index dd091c61..5fa1ec61 100644 --- a/apps/rosen/package.json +++ b/apps/rosen/package.json @@ -22,28 +22,34 @@ "@rosen-bridge/cli": "^0.2.0", "@rosen-bridge/ergo-box-selection": "^0.1.0", "@rosen-bridge/extended-typeorm": "^0.0.3", + "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/minimum-fee": "^2.0.1", "@rosen-bridge/observation-extractor": "^5.0.8", "@rosen-bridge/scanner": "^5.0.0", "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/ui-kit": "^1.5.3", "@rosen-bridge/watcher-data-extractor": "^9.0.0", "@rosen-clients/cardano-koios": "^2.0.1", "@rosen-clients/ergo-explorer": "^1.0.2", "@rosen-network/bitcoin": "^1.1.0", "@rosen-network/cardano": "^1.0.1", "@rosen-network/ergo": "^1.0.0", + "@rosen-network/ethereum": "^0.1.1", "@rosen-ui/asset-calculator": "^2.0.0", "@rosen-ui/common-hooks": "^0.1.0", + "@rosen-ui/constants": "^0.0.5", "@rosen-ui/eternl-wallet": "^1.0.2", "@rosen-ui/flint-wallet": "^1.0.2", "@rosen-ui/lace-wallet": "^1.0.2", + "@rosen-ui/metamask-wallet": "^0.1.2", "@rosen-ui/nami-wallet": "^1.0.2", "@rosen-ui/nautilus-wallet": "^1.0.2", "@rosen-ui/okx-wallet": "^0.1.0", + "@rosen-ui/swr-helpers": "^0.2.0", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/vespr-wallet": "^0.0.10", "@rosen-ui/wallet-api": "^1.0.3", - "@rosen-ui/xdefi-wallet": "^1.0.3", "@upstash/ratelimit": "^1.2.1", "@vercel/kv": "^2.0.0", "buffer": "^6.0.3", diff --git a/apps/watcher/app/_theme/theme.ts b/apps/watcher/app/_theme/theme.ts index 3e333e2d..0d444501 100644 --- a/apps/watcher/app/_theme/theme.ts +++ b/apps/watcher/app/_theme/theme.ts @@ -1,5 +1,4 @@ -import { Theme } from '@mui/material'; -import { createTheme } from '@rosen-bridge/ui-kit'; +import { createTheme, Theme } from '@rosen-bridge/ui-kit'; declare module '@mui/material/styles' { interface TypePaletteGradient { diff --git a/build.sh b/build.sh index 4d76752c..7be9b8dd 100755 --- a/build.sh +++ b/build.sh @@ -23,5 +23,4 @@ npm run build --workspace wallets/eternl-wallet npm run build --workspace wallets/flint-wallet npm run build --workspace wallets/vespr-wallet npm run build --workspace wallets/nautilus-wallet -npm run build --workspace wallets/xdefi-wallet npm run build --workspace wallets/okx-wallet diff --git a/package-lock.json b/package-lock.json index 4e749b10..fb901cd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -233,28 +233,34 @@ "@rosen-bridge/cli": "^0.2.0", "@rosen-bridge/ergo-box-selection": "^0.1.0", "@rosen-bridge/extended-typeorm": "^0.0.3", + "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/minimum-fee": "^2.0.1", "@rosen-bridge/observation-extractor": "^5.0.8", "@rosen-bridge/scanner": "^5.0.0", "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/ui-kit": "^1.5.3", "@rosen-bridge/watcher-data-extractor": "^9.0.0", "@rosen-clients/cardano-koios": "^2.0.1", "@rosen-clients/ergo-explorer": "^1.0.2", "@rosen-network/bitcoin": "^1.1.0", "@rosen-network/cardano": "^1.0.1", "@rosen-network/ergo": "^1.0.0", + "@rosen-network/ethereum": "^0.1.1", "@rosen-ui/asset-calculator": "^2.0.0", "@rosen-ui/common-hooks": "^0.1.0", + "@rosen-ui/constants": "^0.0.5", "@rosen-ui/eternl-wallet": "^1.0.2", "@rosen-ui/flint-wallet": "^1.0.2", "@rosen-ui/lace-wallet": "^1.0.2", + "@rosen-ui/metamask-wallet": "^0.1.2", "@rosen-ui/nami-wallet": "^1.0.2", "@rosen-ui/nautilus-wallet": "^1.0.2", "@rosen-ui/okx-wallet": "^0.1.0", + "@rosen-ui/swr-helpers": "^0.2.0", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/vespr-wallet": "^0.0.10", "@rosen-ui/wallet-api": "^1.0.3", - "@rosen-ui/xdefi-wallet": "^1.0.3", "@upstash/ratelimit": "^1.2.1", "@vercel/kv": "^2.0.0", "buffer": "^6.0.3", @@ -3190,17 +3196,78 @@ "bignumber.js": "^9.0.0" } }, + "node_modules/@cbor-extract/cbor-extract-darwin-arm64": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-darwin-arm64/-/cbor-extract-darwin-arm64-2.2.0.tgz", + "integrity": "sha512-P7swiOAdF7aSi0H+tHtHtr6zrpF3aAq/W9FXx5HektRvLTM2O89xCyXF3pk7pLc7QpaY7AoaE8UowVf9QBdh3w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cbor-extract/cbor-extract-darwin-x64": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-darwin-x64/-/cbor-extract-darwin-x64-2.2.0.tgz", + "integrity": "sha512-1liF6fgowph0JxBbYnAS7ZlqNYLf000Qnj4KjqPNW4GViKrEql2MgZnAsExhY9LSy8dnvA4C0qHEBgPrll0z0w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cbor-extract/cbor-extract-linux-arm": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-linux-arm/-/cbor-extract-linux-arm-2.2.0.tgz", + "integrity": "sha512-QeBcBXk964zOytiedMPQNZr7sg0TNavZeuUCD6ON4vEOU/25+pLhNN6EDIKJ9VLTKaZ7K7EaAriyYQ1NQ05s/Q==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cbor-extract/cbor-extract-linux-arm64": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-linux-arm64/-/cbor-extract-linux-arm64-2.2.0.tgz", + "integrity": "sha512-rQvhNmDuhjTVXSPFLolmQ47/ydGOFXtbR7+wgkSY0bdOxCFept1hvg59uiLPT2fVDuJFuEy16EImo5tE2x3RsQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@cbor-extract/cbor-extract-linux-x64": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-linux-x64/-/cbor-extract-linux-x64-2.2.0.tgz", + "integrity": "sha512-cWLAWtT3kNLHSvP4RKDzSTX9o0wvQEEAj4SKvhWuOVZxiDAeQazr9A+PSiRILK1VYMLeDml89ohxCnUNQNQNCw==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, + "node_modules/@cbor-extract/cbor-extract-win32-x64": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-win32-x64/-/cbor-extract-win32-x64-2.2.0.tgz", + "integrity": "sha512-l2M+Z8DO2vbvADOBNLbbh9y5ST1RY5sqkWOg/58GkUPBYou/cuNZ68SGQ644f1CvZ8kcOxyZtw06+dxWHIoN/w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@changesets/apply-release-plan": { "version": "7.0.0", "license": "MIT", @@ -5354,16 +5421,18 @@ } }, "node_modules/@mui/lab": { - "version": "5.0.0-alpha.153", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/base": "5.0.0-beta.24", - "@mui/system": "^5.14.18", - "@mui/types": "^7.2.9", - "@mui/utils": "^5.14.18", - "clsx": "^2.0.0", - "prop-types": "^15.8.1" + "version": "5.0.0-alpha.134", + "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.134.tgz", + "integrity": "sha512-GhvuM2dNOi6hzjbeGEocWVozgyyeUn7RBmZhLFtniROauxmPCZMcTsEU+GAxmpyYppqHuI8flP6tGKgMuEAK/g==", + "dependencies": { + "@babel/runtime": "^7.21.0", + "@mui/base": "5.0.0-beta.4", + "@mui/system": "^5.13.5", + "@mui/types": "^7.2.4", + "@mui/utils": "^5.13.1", + "clsx": "^1.2.1", + "prop-types": "^15.8.1", + "react-is": "^18.2.0" }, "engines": { "node": ">=12.0.0" @@ -5375,7 +5444,7 @@ "peerDependencies": { "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@mui/material": ">=5.10.11", + "@mui/material": "^5.0.0", "@types/react": "^17.0.0 || ^18.0.0", "react": "^17.0.0 || ^18.0.0", "react-dom": "^17.0.0 || ^18.0.0" @@ -5392,6 +5461,46 @@ } } }, + "node_modules/@mui/lab/node_modules/@mui/base": { + "version": "5.0.0-beta.4", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.4.tgz", + "integrity": "sha512-ejhtqYJpjDgHGEljjMBQWZ22yEK0OzIXNa7toJmmXsP4TT3W7xVy8bTJ0TniPDf+JNjrsgfgiFTDGdlEhV1E+g==", + "dependencies": { + "@babel/runtime": "^7.21.0", + "@emotion/is-prop-valid": "^1.2.1", + "@mui/types": "^7.2.4", + "@mui/utils": "^5.13.1", + "@popperjs/core": "^2.11.8", + "clsx": "^1.2.1", + "prop-types": "^15.8.1", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/lab/node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "engines": { + "node": ">=6" + } + }, "node_modules/@mui/material": { "version": "5.14.18", "license": "MIT", @@ -5783,17 +5892,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@noble/secp256k1": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", - "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "license": "MIT", @@ -9573,10 +9671,6 @@ "resolved": "wallets/wallet-api", "link": true }, - "node_modules/@rosen-ui/xdefi-wallet": { - "resolved": "wallets/xdefi-wallet", - "link": true - }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", @@ -12254,6 +12348,8 @@ }, "node_modules/buffer": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -12268,7 +12364,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -12581,8 +12676,9 @@ }, "node_modules/cbor-extract": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cbor-extract/-/cbor-extract-2.2.0.tgz", + "integrity": "sha512-Ig1zM66BjLfTXpNgKpvBePq271BPOvu8MR0Jl080yG7Jsl+wAZunfrwiwA+9ruzm/WEdIV5QF/bjDZTqyAIVHA==", "hasInstallScript": true, - "license": "MIT", "optional": true, "dependencies": { "node-gyp-build-optional-packages": "5.1.1" @@ -18040,16 +18136,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/jsontokens": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsontokens/-/jsontokens-4.0.1.tgz", - "integrity": "sha512-+MO415LEN6M+3FGsRz4wU20g7N2JA+2j9d9+pGaNJHviG4L8N0qzavGyENw6fJqsq9CcrHOIL6iWX5yeTZ86+Q==", - "dependencies": { - "@noble/hashes": "^1.1.2", - "@noble/secp256k1": "^1.6.3", - "base64-js": "^1.5.1" - } - }, "node_modules/jsonwebtoken": { "version": "9.0.2", "license": "MIT", @@ -19813,7 +19899,8 @@ }, "node_modules/node-gyp-build-optional-packages": { "version": "5.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.1.1.tgz", + "integrity": "sha512-+P72GAjVAbTxjjwUmwjVrqrdZROD4nf8KgpBoDxqXXTiYZZt/ud60dE5yvCSr9lRO8e8yv6kgJIC0K0PfZFVQw==", "optional": true, "dependencies": { "detect-libc": "^2.0.1" @@ -21064,7 +21151,8 @@ }, "node_modules/qrcode.react": { "version": "3.1.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-3.1.0.tgz", + "integrity": "sha512-oyF+Urr3oAMUG/OiOuONL3HXM+53wvuH3mtIWQrYmsXoAq0DkvZp2RYUWFSMFtbdOpuS++9v+WAkzNVkMlNW6Q==", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } @@ -22037,16 +22125,6 @@ "version": "2.1.2", "license": "MIT" }, - "node_modules/sats-connect": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sats-connect/-/sats-connect-1.4.1.tgz", - "integrity": "sha512-IDGbgZS+NmURyQ01pUBnDgTuHx7uF9lUrDqKU7+M2YpDLe5NDIkc7oyXh3r+lDWnwfAGCyO31L1tK1+xgT9ThQ==", - "dependencies": { - "jsontokens": "^4.0.1", - "process": "^0.11.10", - "util": "^0.12.4" - } - }, "node_modules/scheduler": { "version": "0.23.0", "license": "MIT", @@ -26219,6 +26297,7 @@ "@rosen-bridge/tokens": "^1.2.1", "@rosen-clients/cardano-koios": "^2.0.3", "@rosen-clients/ergo-explorer": "^1.1.2", + "@rosen-ui/constants": "^0.0.5", "@rosen-ui/types": "^0.3.0", "axios": "^1.7.0", "ethers": "^6.13.2", @@ -26251,12 +26330,9 @@ "name": "@rosen-ui/common-hooks", "version": "0.1.0", "dependencies": { - "@rosen-bridge/json-bigint": "^0.1.0", - "buffer": "^6.0.3", - "lodash-es": "^4.17.21" + "@rosen-bridge/json-bigint": "^0.1.0" }, "devDependencies": { - "@types/lodash-es": "^4.17.9", "typescript": "^5.0.0" } }, @@ -26338,6 +26414,7 @@ "@mui/lab": "^5.0.0-alpha.134", "@mui/material": "^5.13.4", "@rosen-bridge/icons": "^0.7.0", + "@rosen-bridge/shared-contexts": "^0.0.2", "@rosen-ui/common-hooks": "^0.1.0", "@rosen-ui/constants": "^0.0.5", "@rosen-ui/swr-helpers": "^0.2.0", @@ -26362,7 +26439,8 @@ "name": "@rosen-ui/utils", "version": "0.4.1", "dependencies": { - "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "buffer": "^6.0.3", "cbor-x": "^1.5.9", "lodash-es": "^4.17.21" @@ -26379,6 +26457,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/cardano": "^1.0.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" }, @@ -26393,6 +26473,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/cardano": "^1.0.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" }, @@ -26407,6 +26489,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/cardano": "^1.0.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" }, @@ -26422,7 +26506,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/ethereum": "^0.1.1", - "@rosen-ui/utils": "^0.4.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/wallet-api": "^1.0.3" }, "devDependencies": { @@ -26436,6 +26521,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/cardano": "^1.0.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" }, @@ -26449,15 +26536,14 @@ "dependencies": { "@rosen-bridge/icons": "^0.7.0", "@rosen-network/ergo": "^1.0.0", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", + "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" }, "devDependencies": { "@rosen-bridge/tokens": "^1.2.1", - "@rosen-ui/utils": "^0.4.1", "typescript": "^5.0.0" - }, - "peerDependencies": { - "react": "18.2.0" } }, "wallets/okx-wallet": { @@ -26484,7 +26570,6 @@ "@rosen-ui/wallet-api": "^1.0.3" }, "devDependencies": { - "@rosen-bridge/tokens": "^1.2.1", "typescript": "^5.0.0" } }, @@ -26502,23 +26587,6 @@ "peerDependencies": { "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0" } - }, - "wallets/xdefi-wallet": { - "name": "@rosen-ui/xdefi-wallet", - "version": "1.0.3", - "dependencies": { - "@rosen-bridge/bitcoin-utxo-selection": "^0.2.0", - "@rosen-bridge/icons": "^0.7.0", - "@rosen-bridge/tokens": "^1.2.1", - "@rosen-network/bitcoin": "^1.1.0", - "@rosen-ui/constants": "^0.0.5", - "@rosen-ui/utils": "^0.4.1", - "@rosen-ui/wallet-api": "^1.0.3", - "sats-connect": "^1.4.1" - }, - "devDependencies": { - "typescript": "^5.0.0" - } } } } diff --git a/package.json b/package.json index c7ad4fd3..da1406f5 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "coverage": "npm run test -- --coverage", "version": "npx changeset version && npm i && npx changeset --empty", "version:rosen": "npx changeset version --ignore @rosen-bridge/watcher-app --ignore @rosen-bridge/guard-app && npm i && npx changeset --empty", - "version:watcher": "npx changeset version --ignore=@rosen-bridge/rosen-service --ignore @rosen-bridge/rosen-app --ignore @rosen-bridge/guard-app --ignore @rosen-network/ergo --ignore @rosen-network/cardano --ignore @rosen-network/bitcoin --ignore @rosen-ui/eternl-wallet --ignore @rosen-ui/flint-wallet --ignore @rosen-ui/lace-wallet --ignore @rosen-ui/nami-wallet --ignore @rosen-ui/nautilus-wallet --ignore @rosen-ui/xdefi-wallet --ignore @rosen-ui/vespr-wallet --ignore @rosen-ui/asset-calculator --ignore @rosen-ui/wallet-api && npm i && npx changeset --empty", - "version:guard": "npx changeset version --ignore=@rosen-bridge/rosen-service --ignore @rosen-bridge/watcher-app --ignore @rosen-bridge/rosen-app --ignore @rosen-network/ergo --ignore @rosen-network/cardano --ignore @rosen-network/bitcoin --ignore @rosen-ui/eternl-wallet --ignore @rosen-ui/flint-wallet --ignore @rosen-ui/lace-wallet --ignore @rosen-ui/nami-wallet --ignore @rosen-ui/nautilus-wallet --ignore @rosen-ui/xdefi-wallet --ignore @rosen-ui/vespr-wallet --ignore @rosen-ui/asset-calculator --ignore @rosen-ui/wallet-api && npm i && npx changeset --empty" + "version:watcher": "npx changeset version --ignore=@rosen-bridge/rosen-service --ignore @rosen-bridge/rosen-app --ignore @rosen-bridge/guard-app --ignore @rosen-network/ergo --ignore @rosen-network/cardano --ignore @rosen-network/bitcoin --ignore @rosen-ui/eternl-wallet --ignore @rosen-ui/flint-wallet --ignore @rosen-ui/lace-wallet --ignore @rosen-ui/nami-wallet --ignore @rosen-ui/nautilus-wallet --ignore @rosen-ui/okx-wallet --ignore @rosen-ui/vespr-wallet --ignore @rosen-ui/asset-calculator --ignore @rosen-ui/wallet-api && npm i && npx changeset --empty", + "version:guard": "npx changeset version --ignore=@rosen-bridge/rosen-service --ignore @rosen-bridge/watcher-app --ignore @rosen-bridge/rosen-app --ignore @rosen-network/ergo --ignore @rosen-network/cardano --ignore @rosen-network/bitcoin --ignore @rosen-ui/eternl-wallet --ignore @rosen-ui/flint-wallet --ignore @rosen-ui/lace-wallet --ignore @rosen-ui/nami-wallet --ignore @rosen-ui/nautilus-wallet --ignore @rosen-ui/okx-wallet --ignore @rosen-ui/vespr-wallet --ignore @rosen-ui/asset-calculator --ignore @rosen-ui/wallet-api && npm i && npx changeset --empty" }, "dependencies": { "@changesets/cli": "^2.27.1" diff --git a/packages/asset-calculator/package.json b/packages/asset-calculator/package.json index 7c820175..01990564 100644 --- a/packages/asset-calculator/package.json +++ b/packages/asset-calculator/package.json @@ -32,6 +32,7 @@ "@rosen-bridge/tokens": "^1.2.1", "@rosen-clients/cardano-koios": "^2.0.3", "@rosen-clients/ergo-explorer": "^1.1.2", + "@rosen-ui/constants": "^0.0.5", "@rosen-ui/types": "^0.3.0", "axios": "^1.7.0", "ethers": "^6.13.2", diff --git a/packages/common-hooks/package.json b/packages/common-hooks/package.json index a1a184e9..be1d74bb 100644 --- a/packages/common-hooks/package.json +++ b/packages/common-hooks/package.json @@ -13,12 +13,9 @@ "type-check": "tsc --noEmit" }, "devDependencies": { - "@types/lodash-es": "^4.17.9", "typescript": "^5.0.0" }, "dependencies": { - "@rosen-bridge/json-bigint": "^0.1.0", - "buffer": "^6.0.3", - "lodash-es": "^4.17.21" + "@rosen-bridge/json-bigint": "^0.1.0" } } diff --git a/packages/icons/src/wallets/index.ts b/packages/icons/src/wallets/index.ts index 07bf4f4b..a0aea3d5 100644 --- a/packages/icons/src/wallets/index.ts +++ b/packages/icons/src/wallets/index.ts @@ -6,4 +6,3 @@ export { ReactComponent as MetaMaskIcon } from './metamask.svg'; export { ReactComponent as NautilusIcon } from './nautilus.svg'; export { ReactComponent as OKXIcon } from './okx.svg'; export { ReactComponent as VesprIcon } from './vespr.svg'; -export { ReactComponent as XdefiIcon } from './xdefi.svg'; diff --git a/packages/icons/src/wallets/xdefi.svg b/packages/icons/src/wallets/xdefi.svg deleted file mode 100644 index bce61cf5..00000000 --- a/packages/icons/src/wallets/xdefi.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/ui-kit/package.json b/packages/ui-kit/package.json index cd498163..1da93b84 100644 --- a/packages/ui-kit/package.json +++ b/packages/ui-kit/package.json @@ -40,6 +40,7 @@ "@mui/lab": "^5.0.0-alpha.134", "@mui/material": "^5.13.4", "@rosen-bridge/icons": "^0.7.0", + "@rosen-bridge/shared-contexts": "^0.0.2", "@rosen-ui/common-hooks": "^0.1.0", "@rosen-ui/constants": "^0.0.5", "@rosen-ui/swr-helpers": "^0.2.0", diff --git a/packages/ui-kit/src/components/base/Autocomplete.tsx b/packages/ui-kit/src/components/base/Autocomplete.tsx new file mode 100644 index 00000000..29165edb --- /dev/null +++ b/packages/ui-kit/src/components/base/Autocomplete.tsx @@ -0,0 +1,2 @@ +export { Autocomplete } from '@mui/material'; +export type { AutocompleteProps } from '@mui/material'; diff --git a/packages/ui-kit/src/components/base/index.ts b/packages/ui-kit/src/components/base/index.ts index 735206b9..82f7339d 100644 --- a/packages/ui-kit/src/components/base/index.ts +++ b/packages/ui-kit/src/components/base/index.ts @@ -3,6 +3,7 @@ export * from './AccordionDetails'; export * from './AccordionSummary'; export * from './Alert'; export * from './Avatar'; +export * from './Autocomplete'; export * from './Badge'; export * from './Box'; export * from './Button'; diff --git a/packages/ui-kit/src/index.ts b/packages/ui-kit/src/index.ts index 5e646a01..8bf1e05d 100644 --- a/packages/ui-kit/src/index.ts +++ b/packages/ui-kit/src/index.ts @@ -31,3 +31,4 @@ export * from './styling'; export * from './utils'; export * from './contexts'; +export type { Theme } from '@mui/material'; diff --git a/packages/utils/package.json b/packages/utils/package.json index 9f41df89..f474fcdf 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -17,7 +17,8 @@ "typescript": "^5.0.0" }, "dependencies": { - "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "buffer": "^6.0.3", "cbor-x": "^1.5.9", "lodash-es": "^4.17.21" diff --git a/wallets/eternl-wallet/package.json b/wallets/eternl-wallet/package.json index e7aee928..901c7821 100644 --- a/wallets/eternl-wallet/package.json +++ b/wallets/eternl-wallet/package.json @@ -19,6 +19,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/cardano": "^1.0.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" } diff --git a/wallets/flint-wallet/package.json b/wallets/flint-wallet/package.json index 2b7ade46..4d24dc32 100644 --- a/wallets/flint-wallet/package.json +++ b/wallets/flint-wallet/package.json @@ -19,6 +19,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/cardano": "^1.0.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" } diff --git a/wallets/lace-wallet/package.json b/wallets/lace-wallet/package.json index 227ae449..9b8fb547 100644 --- a/wallets/lace-wallet/package.json +++ b/wallets/lace-wallet/package.json @@ -19,6 +19,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/cardano": "^1.0.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" } diff --git a/wallets/metamask-wallet/package.json b/wallets/metamask-wallet/package.json index 0831c70e..dda6da88 100644 --- a/wallets/metamask-wallet/package.json +++ b/wallets/metamask-wallet/package.json @@ -20,7 +20,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/ethereum": "^0.1.1", - "@rosen-ui/utils": "^0.4.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/wallet-api": "^1.0.3" } } diff --git a/wallets/nami-wallet/package.json b/wallets/nami-wallet/package.json index fb603ed0..e6389a4b 100644 --- a/wallets/nami-wallet/package.json +++ b/wallets/nami-wallet/package.json @@ -19,6 +19,8 @@ "@rosen-bridge/icons": "^0.7.0", "@rosen-bridge/tokens": "^1.2.1", "@rosen-network/cardano": "^1.0.1", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" } diff --git a/wallets/nautilus-wallet/package.json b/wallets/nautilus-wallet/package.json index 49f4e318..a3e5ef3e 100644 --- a/wallets/nautilus-wallet/package.json +++ b/wallets/nautilus-wallet/package.json @@ -14,15 +14,14 @@ }, "devDependencies": { "@rosen-bridge/tokens": "^1.2.1", - "@rosen-ui/utils": "^0.4.1", "typescript": "^5.0.0" }, "dependencies": { "@rosen-bridge/icons": "^0.7.0", "@rosen-network/ergo": "^1.0.0", + "@rosen-ui/constants": "^0.0.5", + "@rosen-ui/types": "^0.3.1", + "@rosen-ui/utils": "^0.4.1", "@rosen-ui/wallet-api": "^1.0.3" - }, - "peerDependencies": { - "react": "18.2.0" } } diff --git a/wallets/vespr-wallet/package.json b/wallets/vespr-wallet/package.json index fa0ef90a..91cffbd3 100644 --- a/wallets/vespr-wallet/package.json +++ b/wallets/vespr-wallet/package.json @@ -13,7 +13,6 @@ "type-check": "tsc --noEmit" }, "devDependencies": { - "@rosen-bridge/tokens": "^1.2.1", "typescript": "^5.0.0" }, "dependencies": { diff --git a/wallets/xdefi-wallet/CHANGELOG.md b/wallets/xdefi-wallet/CHANGELOG.md deleted file mode 100644 index 800d6a00..00000000 --- a/wallets/xdefi-wallet/CHANGELOG.md +++ /dev/null @@ -1,107 +0,0 @@ -# @rosen-ui/xdefi-wallet - -## 1.0.3 - -### Patch Changes - -- Update the source code to address the issues identified by the new ESLint rules configuration -- Updated dependencies - - @rosen-bridge/icons@0.7.0 - - @rosen-network/bitcoin@1.1.0 - -## 1.0.2 - -### Patch Changes - -- Updated dependencies - - @rosen-ui/constants@0.0.5 - - @rosen-network/bitcoin@1.0.1 - -## 1.0.1 - -### Patch Changes - -- Updated the @rosen-bridge/icons@0.6.0 dependency - -## 1.0.0 - -### Major Changes - -- Modify the `transferCreator` function parameter to accept `WRAPPED-VALUE`. -- Change the output type of the `getBalance` function from an `UNWRAPPED-VALUE` to a `WRAPPED-VALUE`. - -### Patch Changes - -- Revise the wallet creation logic and update the access type for each API. -- Remove redundant package dependency -- Strengthen type safety and enforce robust typing for Chain and Network types - -## 0.4.0 - -### Minor Changes - -- Include the specific global type declaration. - -### Patch Changes - -- Updated dependencies - - @rosen-ui/utils@0.3.0 - - @rosen-network/bitcoin@0.2.0 - - @rosen-ui/constants@0.0.3 - - @rosen-ui/wallet-api@1.0.2 - -## 0.3.2 - -### Patch Changes - -- Package the Bitcoin/Ergo logic as a standalone module to ensure its independence and maintainability. -- Updated dependencies - - @rosen-network/bitcoin@0.1.1 - -## 0.3.1 - -### Patch Changes - -- Updated dependencies - - @rosen-ui/utils@0.2.0 - - @rosen-ui/wallet-api@1.0.1 - -## 0.3.0 - -### Minor Changes - -- Add `getAddress` public API for accessing current wallet address - -### Patch Changes - -- Updated dependencies - - @rosen-ui/wallet-api@1.0.0 - -## 0.2.1 - -### Patch Changes - -- Refactor the xdefi-wallet package to encapsulate the logic in its package -- Updated dependencies - - @rosen-ui/constants@0.0.2 - - @rosen-ui/utils@0.1.2 - -## 0.2.0 - -### Minor Changes - -- Export some types from sats-connect - -### Patch Changes - -- Export AddressType from sats-connect lib -- Updated dependencies - - @rosen-bridge/icons@0.4.0 - - @rosen-ui/utils@0.1.1 - -## 0.1.1 - -### Patch Changes - -- Updated dependencies - - @rosen-bridge/icons@0.3.0 diff --git a/wallets/xdefi-wallet/package.json b/wallets/xdefi-wallet/package.json deleted file mode 100644 index 0743705b..00000000 --- a/wallets/xdefi-wallet/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@rosen-ui/xdefi-wallet", - "version": "1.0.3", - "private": true, - "description": "This is a private package utilized within Rosen Bridge UI app", - "main": "dist/src/index.js", - "types": "dist/src/index.d.ts", - "type": "module", - "scripts": { - "prettify": "prettier --write . --ignore-path ../../.gitignore", - "lint": "eslint --fix . && npm run prettify", - "build": "tsc --build", - "type-check": "tsc --noEmit" - }, - "devDependencies": { - "typescript": "^5.0.0" - }, - "dependencies": { - "@rosen-bridge/bitcoin-utxo-selection": "^0.2.0", - "@rosen-bridge/icons": "^0.7.0", - "@rosen-bridge/tokens": "^1.2.1", - "@rosen-network/bitcoin": "^1.1.0", - "@rosen-ui/constants": "^0.0.5", - "@rosen-ui/utils": "^0.4.1", - "@rosen-ui/wallet-api": "^1.0.3", - "sats-connect": "^1.4.1" - } -} diff --git a/wallets/xdefi-wallet/src/connectWallet.ts b/wallets/xdefi-wallet/src/connectWallet.ts deleted file mode 100644 index dbb1f285..00000000 --- a/wallets/xdefi-wallet/src/connectWallet.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AddressPurpose, BitcoinNetworkType, getAddress } from 'sats-connect'; - -export const connectWallet = async (): Promise => { - try { - await getAddress({ - payload: { - network: { - type: BitcoinNetworkType.Mainnet, - }, - message: '', - purposes: [AddressPurpose.Payment], - }, - onFinish: () => {}, - onCancel: () => {}, - }); - return true; - } catch { - return false; - } -}; diff --git a/wallets/xdefi-wallet/src/getAddressCreator.ts b/wallets/xdefi-wallet/src/getAddressCreator.ts deleted file mode 100644 index 4ba9567e..00000000 --- a/wallets/xdefi-wallet/src/getAddressCreator.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { AddressPurpose, BitcoinNetworkType } from 'sats-connect'; - -import { getXdefiWallet } from './getXdefiWallet'; - -export const getAddressCreator = () => (): Promise => { - return new Promise((resolve, reject) => { - getXdefiWallet() - .getApi() - .getAddress({ - payload: { - message: 'Allow Xdefi to expose wallet address', - network: { - type: BitcoinNetworkType.Mainnet, - }, - purposes: [AddressPurpose.Payment], - }, - onFinish: ({ addresses }) => { - const segwitPaymentAddresses = addresses.filter( - (address) => address.purpose === AddressPurpose.Payment, - ); - if (segwitPaymentAddresses.length > 0) { - resolve(segwitPaymentAddresses[0].address); - } else reject(); - }, - onCancel: () => { - reject(); - }, - }); - }); -}; diff --git a/wallets/xdefi-wallet/src/getBalance.ts b/wallets/xdefi-wallet/src/getBalance.ts deleted file mode 100644 index 727b188a..00000000 --- a/wallets/xdefi-wallet/src/getBalance.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { RosenChainToken } from '@rosen-bridge/tokens'; -import { WalletCreatorConfig } from '@rosen-network/bitcoin'; -import { NETWORKS } from '@rosen-ui/constants'; -import { RosenAmountValue } from '@rosen-ui/types'; -import { AddressPurpose, BitcoinNetworkType } from 'sats-connect'; - -import { getXdefiWallet } from './getXdefiWallet'; - -export const getBalanceCreator = - (config: WalletCreatorConfig) => - (token: RosenChainToken): Promise => { - return new Promise((resolve, reject) => { - getXdefiWallet() - .getApi() - .getAddress({ - payload: { - message: '', - network: { - type: BitcoinNetworkType.Mainnet, - }, - purposes: [AddressPurpose.Payment], - }, - onFinish: ({ addresses }) => { - const segwitPaymentAddresses = addresses.filter( - (address) => address.purpose === AddressPurpose.Payment, - ); - if (segwitPaymentAddresses.length > 0) { - const address = segwitPaymentAddresses[0].address; - config - .getAddressBalance(address) - .then((balance) => - config.getTokenMap().then((tokenMap) => { - const wrappedAmount = tokenMap.wrapAmount( - token[tokenMap.getIdKey(NETWORKS.BITCOIN)], - balance, - NETWORKS.BITCOIN, - ).amount; - resolve(wrappedAmount); - }), - ) - .catch((e) => reject(e)); - } else reject(); - }, - onCancel: () => { - reject(); - }, - }); - }); - }; diff --git a/wallets/xdefi-wallet/src/getXdefiWallet.ts b/wallets/xdefi-wallet/src/getXdefiWallet.ts deleted file mode 100644 index 6de02e35..00000000 --- a/wallets/xdefi-wallet/src/getXdefiWallet.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { createRawWallet } from '@rosen-ui/wallet-api'; -import { getAddress, signTransaction } from 'sats-connect'; - -import { connectWallet } from './connectWallet'; -import { xdefiWalletInfo } from './xdefiWalletInfo'; - -/** - * Xdefi implementation of the Wallet - * interface to be able to interact with Xdefi wallet - */ -export const getXdefiWallet = () => { - return createRawWallet( - { - ...xdefiWalletInfo, - connectWallet, - }, - () => ({ - getAddress, - signTransaction, - }), - ); -}; diff --git a/wallets/xdefi-wallet/src/global.d.ts b/wallets/xdefi-wallet/src/global.d.ts deleted file mode 100644 index a804d974..00000000 --- a/wallets/xdefi-wallet/src/global.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare global { - interface Window { - xfi: { bitcoin: unknown }; - } -} - -export {}; diff --git a/wallets/xdefi-wallet/src/index.ts b/wallets/xdefi-wallet/src/index.ts deleted file mode 100644 index 08207d49..00000000 --- a/wallets/xdefi-wallet/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './xdefiWalletCreator'; -export * from './xdefiWalletInfo'; diff --git a/wallets/xdefi-wallet/src/isXdefiAvailable.ts b/wallets/xdefi-wallet/src/isXdefiAvailable.ts deleted file mode 100644 index 958b7db8..00000000 --- a/wallets/xdefi-wallet/src/isXdefiAvailable.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const isXdefiAvailable = (): boolean => { - return typeof window.xfi !== 'undefined' && !!window.xfi.bitcoin; -}; diff --git a/wallets/xdefi-wallet/src/transfer.ts b/wallets/xdefi-wallet/src/transfer.ts deleted file mode 100644 index 31265075..00000000 --- a/wallets/xdefi-wallet/src/transfer.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { RosenChainToken } from '@rosen-bridge/tokens'; -import { - SigHash, - WalletCreatorConfig, -} from '@rosen-network/bitcoin/dist/src/types'; -import { Network, RosenAmountValue } from '@rosen-ui/types'; -import { AddressPurpose, BitcoinNetworkType } from 'sats-connect'; - -import { getXdefiWallet } from './getXdefiWallet'; - -export const transferCreator = - (config: WalletCreatorConfig) => - async ( - token: RosenChainToken, - amount: RosenAmountValue, - toChain: Network, - toAddress: string, - bridgeFee: RosenAmountValue, - networkFee: RosenAmountValue, - lockAddress: string, - ): Promise => { - const userAddress: string = await new Promise((resolve, reject) => { - getXdefiWallet() - .getApi() - .getAddress({ - payload: { - message: '', - network: { - type: BitcoinNetworkType.Mainnet, - }, - purposes: [AddressPurpose.Payment], - }, - onFinish: ({ addresses }) => { - const segwitPaymentAddresses = addresses.filter( - (address) => address.purpose === AddressPurpose.Payment, - ); - if (segwitPaymentAddresses.length > 0) - resolve(segwitPaymentAddresses[0].address); - else reject(); - }, - onCancel: () => { - reject(); - }, - }); - }); - - const opReturnData = await config.generateOpReturnData( - toChain, - toAddress, - networkFee.toString(), - bridgeFee.toString(), - ); - - const psbtData = await config.generateUnsignedTx( - lockAddress, - userAddress, - amount, - opReturnData, - token, - ); - - const result: string = await new Promise((resolve, reject) => { - getXdefiWallet() - .getApi() - .signTransaction({ - payload: { - network: { - type: BitcoinNetworkType.Mainnet, - }, - message: 'Sign Transaction', - psbtBase64: psbtData.psbt.base64, - broadcast: false, - inputsToSign: [ - { - address: userAddress, - signingIndexes: Array.from(Array(psbtData.inputSize).keys()), - sigHash: SigHash.SINGLE | SigHash.DEFAULT_ANYONECANPAY, - }, - ], - }, - onFinish: (response) => { - const signedPsbtBase64 = response.psbtBase64; - config - .submitTransaction(signedPsbtBase64, 'base64') - .then((result) => resolve(result)) - .catch((e) => reject(e)); - }, - onCancel: () => { - reject(); - }, - }); - }); - return result; - }; diff --git a/wallets/xdefi-wallet/src/xdefiWalletCreator.ts b/wallets/xdefi-wallet/src/xdefiWalletCreator.ts deleted file mode 100644 index b97ab9f0..00000000 --- a/wallets/xdefi-wallet/src/xdefiWalletCreator.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { WalletCreator } from '@rosen-network/bitcoin'; - -import { getAddressCreator } from './getAddressCreator'; -import { getBalanceCreator } from './getBalance'; -import { getXdefiWallet } from './getXdefiWallet'; -import { isXdefiAvailable } from './isXdefiAvailable'; -import { transferCreator } from './transfer'; - -export const xdefiWalletCreator: WalletCreator = (config) => { - return Object.assign({}, getXdefiWallet(), { - isAvailable: isXdefiAvailable, - getBalance: getBalanceCreator(config), - transfer: transferCreator(config), - getAddress: getAddressCreator(), - }); -}; diff --git a/wallets/xdefi-wallet/src/xdefiWalletInfo.ts b/wallets/xdefi-wallet/src/xdefiWalletInfo.ts deleted file mode 100644 index 39b8d46c..00000000 --- a/wallets/xdefi-wallet/src/xdefiWalletInfo.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { XdefiIcon } from '@rosen-bridge/icons'; -import { WalletInfo } from '@rosen-ui/wallet-api'; - -export const xdefiWalletInfo: WalletInfo = { - icon: XdefiIcon, - name: 'Xdefi', - label: 'Xdefi', - link: 'https://www.xdefi.io/', -}; diff --git a/wallets/xdefi-wallet/tsconfig.json b/wallets/xdefi-wallet/tsconfig.json deleted file mode 100644 index 96ece334..00000000 --- a/wallets/xdefi-wallet/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.novite.json", - "compilerOptions": { - "jsx": "react-jsx", - "outDir": "dist", - "rootDir": "./" - }, - "include": ["src"] -}