diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d1178cf8f..4dc648ecf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,7 +14,6 @@ updates: - dependency-name: "@walletconnect/sign-client" - dependency-name: "better-sqlite3" - dependency-name: "big.js" - - dependency-name: "bn.js" - dependency-name: "buffer" - dependency-name: "copy-to-clipboard" - dependency-name: "is-mobile" @@ -26,7 +25,6 @@ updates: - dependency-name: "rxjs" - dependency-name: "tslib" - dependency-name: "@types/big.js" - - dependency-name: "@types/bn.js" - dependency-name: "@types/gh-pages" - dependency-name: "@types/qrcode" - dependency-name: "@types/w3c-web-hid" diff --git a/.gitignore b/.gitignore index f1ef64f43..5a70acc62 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ /out-tsc # dependencies -/node_modules +node_modules # IDEs and editors /.idea diff --git a/.vscode/settings.json b/.vscode/settings.json index a4a8998a1..ab2d991bc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,8 +2,7 @@ "eslint.format.enable": true, "prettier.enable": false, "editor.codeActionsOnSave": { - "source.fixAll.eslint": - true + "source.fixAll.eslint": "explicit" }, "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 000000000..3d567722c --- /dev/null +++ b/.yarnrc @@ -0,0 +1 @@ +save-exact true diff --git a/README.md b/README.md index 3160d2333..b07c27c0e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ NEAR Wallet Selector makes it easy for users to interact with your dApp by provi - [My NEAR Wallet](https://www.npmjs.com/package/@near-wallet-selector/my-near-wallet) - Browser wallet. - [Mintbase Wallet](https://www.npmjs.com/package/@near-wallet-selector/mintbase-wallet) - Browser wallet. +- [Bitte Wallet](https://www.npmjs.com/package/@near-wallet-selector/bitte-wallet) - Browser wallet. - [Ledger](https://www.npmjs.com/package/@near-wallet-selector/ledger) - Hardware wallet. - [Sender](https://www.npmjs.com/package/@near-wallet-selector/sender) - Injected wallet. - [Math Wallet](https://www.npmjs.com/package/@near-wallet-selector/math-wallet) - Injected wallet. @@ -72,10 +73,12 @@ yarn add \ @near-wallet-selector/neth \ @near-wallet-selector/xdefi \ @near-wallet-selector/ramper-wallet \ - @near-wallet-selector/mintbase-wallet \ - @near-wallet-selector/near-mobile-wallet \ + @near-wallet-selector/near-mobile-wallet \ @near-wallet-selector/bitget-wallet \ - @near-wallet-selector/okx-wallet + @near-wallet-selector/okx-wallet \ + @near-wallet-selector/mintbase-wallet \ + @near-wallet-selector/bitte-wallet + # Using NPM. npm install \ @@ -98,9 +101,10 @@ npm install \ @near-wallet-selector/xdefi \ @near-wallet-selector/ramper-wallet \ @near-wallet-selector/near-mobile-wallet \ - @near-wallet-selector/mintbase-wallet \ @near-wallet-selector/bitget-wallet \ - @near-wallet-selector/okx-wallet + @near-wallet-selector/okx-wallet \ + @near-wallet-selector/mintbase-wallet \ + @near-wallet-selector/bitte-wallet ``` Optionally, you can install our [`modal-ui`](https://www.npmjs.com/package/@near-wallet-selector/modal-ui) or [`modal-ui-js`](https://www.npmjs.com/package/@near-wallet-selector/modal-ui-js) package for a pre-built interface that wraps the `core` API and presents the supported wallets: @@ -129,7 +133,6 @@ import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet"; import { setupOkxWallet } from "@near-wallet-selector/okx-wallet"; import { setupNarwallets } from "@near-wallet-selector/narwallets"; import { setupWelldoneWallet } from "@near-wallet-selector/welldone-wallet"; -import { setupNearSnap } from "@near-wallet-selector/near-snap"; import { setupLedger } from "@near-wallet-selector/ledger"; import { setupWalletConnect } from "@near-wallet-selector/wallet-connect"; import { setupNearFi } from "@near-wallet-selector/nearfi"; @@ -139,6 +142,7 @@ import { setupXDEFI } from "@near-wallet-selector/xdefi"; import { setupRamperWallet } from "@near-wallet-selector/ramper-wallet"; import { setupNearMobileWallet } from "@near-wallet-selector/near-mobile-wallet"; import { setupMintbaseWallet } from "@near-wallet-selector/mintbase-wallet"; +import { setupBitteWallet } from "@near-wallet-selector/bitte-wallet"; const selector = await setupWalletSelector({ network: "testnet", @@ -174,7 +178,13 @@ const selector = await setupWalletSelector({ walletUrl: "https://wallet.mintbase.xyz", callbackUrl: "https://www.mywebsite.com", deprecated: false, - }), + }), + setupBitteWallet({ + networkId: "mainnet", + walletUrl: "https://wallet.bitte.ai", + callbackUrl: "https://www.mywebsite.com", + deprecated: false, + }), ], }); diff --git a/examples/angular/src/app/components/content/content.component.ts b/examples/angular/src/app/components/content/content.component.ts index 31b010090..711c95b0f 100644 --- a/examples/angular/src/app/components/content/content.component.ts +++ b/examples/angular/src/app/components/content/content.component.ts @@ -25,7 +25,6 @@ import { WalletSelectorModal } from "@near-wallet-selector/modal-ui-js"; import { CONTRACT_ID } from "../../../constants"; import { WalletSelector } from "@near-wallet-selector/core"; import type { GetAccountBalanceProps } from "../../interfaces/account-balance"; -import BN from "bn.js"; const SUGGESTED_DONATION = "0"; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -67,8 +66,8 @@ export class ContentComponent implements OnInit, OnDestroy { finality: "final", account_id: accountId, }); - const bn = new BN(amount); - return { hasBalance: !bn.isZero() }; + const bn = BigInt(amount); + return { hasBalance: bn !== BigInt(0) }; } catch { return { hasBalance: false }; } diff --git a/examples/angular/src/app/pages/wallet-selector-export/wallet-selector-export.component.ts b/examples/angular/src/app/pages/wallet-selector-export/wallet-selector-export.component.ts index 4eeaf47c3..cf731dbf8 100644 --- a/examples/angular/src/app/pages/wallet-selector-export/wallet-selector-export.component.ts +++ b/examples/angular/src/app/pages/wallet-selector-export/wallet-selector-export.component.ts @@ -22,6 +22,8 @@ import { setupRamperWallet } from "@near-wallet-selector/ramper-wallet"; import { setupNearMobileWallet } from "@near-wallet-selector/near-mobile-wallet"; import { setupLedger } from "@near-wallet-selector/ledger"; import { setupMintbaseWallet } from "@near-wallet-selector/mintbase-wallet"; +import { setupBitteWallet } from "@near-wallet-selector/bitte-wallet"; +import { CONTRACT_ID } from "../../../constants"; declare global { interface Window { @@ -80,7 +82,8 @@ export class WalletSelectorExportComponent implements OnInit { }), setupRamperWallet(), setupNearMobileWallet(), - setupMintbaseWallet({ contractId: "guest-book.testnet" }), + setupMintbaseWallet({ contractId: CONTRACT_ID }), + setupBitteWallet({ contractId: CONTRACT_ID }), ], }); /** diff --git a/examples/angular/src/app/pages/wallet-selector/wallet-selector.component.ts b/examples/angular/src/app/pages/wallet-selector/wallet-selector.component.ts index 24d161a0f..6b963b36b 100644 --- a/examples/angular/src/app/pages/wallet-selector/wallet-selector.component.ts +++ b/examples/angular/src/app/pages/wallet-selector/wallet-selector.component.ts @@ -23,6 +23,7 @@ import { setupRamperWallet } from "@near-wallet-selector/ramper-wallet"; import { setupLedger } from "@near-wallet-selector/ledger"; import { setupNearMobileWallet } from "@near-wallet-selector/near-mobile-wallet"; import { setupMintbaseWallet } from "@near-wallet-selector/mintbase-wallet"; +import { setupBitteWallet } from "@near-wallet-selector/bitte-wallet"; import { setupOKXWallet } from "@near-wallet-selector/okx-wallet"; import { CONTRACT_ID } from "../../../constants"; @@ -94,7 +95,8 @@ export class WalletSelectorComponent implements OnInit { }), setupRamperWallet(), setupNearMobileWallet(), - setupMintbaseWallet({ contractId: "guest-book.testnet" }), + setupMintbaseWallet({ contractId: CONTRACT_ID }), + setupBitteWallet({ contractId: CONTRACT_ID }), ], }); diff --git a/examples/react/components/Content.tsx b/examples/react/components/Content.tsx index 271442fa9..32d40e765 100644 --- a/examples/react/components/Content.tsx +++ b/examples/react/components/Content.tsx @@ -11,7 +11,6 @@ import type { } from "@near-wallet-selector/core"; import { verifyFullKeyBelongsToUser } from "@near-wallet-selector/core"; import { verifySignature } from "@near-wallet-selector/core"; -import BN from "bn.js"; import type { Account, Message } from "../interfaces"; import { useWalletSelector } from "../contexts/WalletSelectorContext"; @@ -42,8 +41,8 @@ const getAccountBalance = async ({ finality: "final", account_id: accountId, }); - const bn = new BN(amount); - return { hasBalance: !bn.isZero() }; + const bn = BigInt(amount); + return { hasBalance: bn !== BigInt(0) }; } catch { return { hasBalance: false }; } diff --git a/examples/react/contexts/WalletSelectorContext.tsx b/examples/react/contexts/WalletSelectorContext.tsx index e2f550d3a..838f6d7fe 100644 --- a/examples/react/contexts/WalletSelectorContext.tsx +++ b/examples/react/contexts/WalletSelectorContext.tsx @@ -21,6 +21,7 @@ import { setupXDEFI } from "@near-wallet-selector/xdefi"; import { setupRamperWallet } from "@near-wallet-selector/ramper-wallet"; import { setupNearMobileWallet } from "@near-wallet-selector/near-mobile-wallet"; import { setupMintbaseWallet } from "@near-wallet-selector/mintbase-wallet"; +import { setupBitteWallet } from "@near-wallet-selector/bitte-wallet"; import { setupOKXWallet } from "@near-wallet-selector/okx-wallet"; import type { ReactNode } from "react"; @@ -96,7 +97,8 @@ export const WalletSelectorContextProvider: React.FC<{ }, }), setupNearMobileWallet(), - setupMintbaseWallet({ contractId: "guest-book.testnet" }), + setupMintbaseWallet({ contractId: CONTRACT_ID }), + setupBitteWallet({ contractId: CONTRACT_ID }), ], }); const _modal = setupModal(_selector, { diff --git a/examples/react/contexts/WalletSelectorExportContext.tsx b/examples/react/contexts/WalletSelectorExportContext.tsx index 9c4b2e39e..ca1598e1f 100644 --- a/examples/react/contexts/WalletSelectorExportContext.tsx +++ b/examples/react/contexts/WalletSelectorExportContext.tsx @@ -27,6 +27,8 @@ import { setupLedger } from "@near-wallet-selector/ledger"; import { setupRamperWallet } from "@near-wallet-selector/ramper-wallet"; import { setupNearMobileWallet } from "@near-wallet-selector/near-mobile-wallet"; import { setupMintbaseWallet } from "@near-wallet-selector/mintbase-wallet"; +import { setupBitteWallet } from "@near-wallet-selector/bitte-wallet"; +import { CONTRACT_ID } from "../constants"; declare global { interface Window { @@ -70,7 +72,8 @@ export const ExportAccountSelectorContextProvider: React.FC<{ setupCoin98Wallet(), setupNearFi(), setupRamperWallet(), - setupMintbaseWallet({ contractId: "guest-book.testnet" }), + setupMintbaseWallet({ contractId: CONTRACT_ID }), + setupBitteWallet({ contractId: CONTRACT_ID }), setupWalletConnect({ projectId: "c4f79cc...", metadata: { diff --git a/examples/vanillajs/index.html b/examples/vanillajs/index.html index de5b172bd..09ae538e8 100644 --- a/examples/vanillajs/index.html +++ b/examples/vanillajs/index.html @@ -7,18 +7,18 @@
- +