Skip to content

Commit

Permalink
Merge pull request #1141 from near/dev
Browse files Browse the repository at this point in the history
v8.9.11 Release (dev → main)
  • Loading branch information
trechriron authored Jul 24, 2024
2 parents c89b6b1 + 6b84315 commit 7a17b72
Show file tree
Hide file tree
Showing 64 changed files with 6,581 additions and 7,449 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/out-tsc

# dependencies
/node_modules
node_modules

# IDEs and editors
/.idea
Expand Down
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact true
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 \
Expand All @@ -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:
Expand Down Expand Up @@ -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";
Expand All @@ -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",
Expand Down Expand Up @@ -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,
}),
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -80,7 +82,8 @@ export class WalletSelectorExportComponent implements OnInit {
}),
setupRamperWallet(),
setupNearMobileWallet(),
setupMintbaseWallet({ contractId: "guest-book.testnet" }),
setupMintbaseWallet({ contractId: CONTRACT_ID }),
setupBitteWallet({ contractId: CONTRACT_ID }),
],
});
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -94,7 +95,8 @@ export class WalletSelectorComponent implements OnInit {
}),
setupRamperWallet(),
setupNearMobileWallet(),
setupMintbaseWallet({ contractId: "guest-book.testnet" }),
setupMintbaseWallet({ contractId: CONTRACT_ID }),
setupBitteWallet({ contractId: CONTRACT_ID }),
],
});

Expand Down
5 changes: 2 additions & 3 deletions examples/react/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 };
}
Expand Down
4 changes: 3 additions & 1 deletion examples/react/contexts/WalletSelectorContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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, {
Expand Down
5 changes: 4 additions & 1 deletion examples/react/contexts/WalletSelectorExportContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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: {
Expand Down
Loading

0 comments on commit 7a17b72

Please sign in to comment.