diff --git a/README.md b/README.md index 03b2c3a48..f96a09a93 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ NEAR Wallet Selector makes it easy for users to interact with your dApp by provi ## Installation and Usage -The easiest way to use NEAR Wallet Selector is to install the [`core`](https://www.npmjs.com/package/@near-wallet-selector/core) package from the NPM registry, some packages may require `near-api-js` v0.44.2 or above check them at [`packages`](./packages) +The easiest way to use NEAR Wallet Selector is to install the [`core`](https://www.npmjs.com/package/@near-wallet-selector/core) package from the NPM registry, some packages may require `near-api-js` v1.0.0 or above check them at [`packages`](./packages) ```bash # Using Yarn diff --git a/examples/react/components/ExportContent.tsx b/examples/react/components/ExportContent.tsx index 4cd5a9f23..3a90eeaa1 100644 --- a/examples/react/components/ExportContent.tsx +++ b/examples/react/components/ExportContent.tsx @@ -3,10 +3,10 @@ import { Fragment } from "react"; import { useExportAccountSelector } from "../contexts/WalletSelectorExportContext"; const ExportContent: NextPage = () => { - const { ExportModal } = useExportAccountSelector(); + const { exportModal } = useExportAccountSelector(); return ( - +

The Export Accounts modal assists users in migrating their accounts to any Wallet Selector wallet supporting account imports. Any sensitive diff --git a/examples/react/contexts/WalletSelectorContext.tsx b/examples/react/contexts/WalletSelectorContext.tsx index 4f150d13f..b690badfd 100644 --- a/examples/react/contexts/WalletSelectorContext.tsx +++ b/examples/react/contexts/WalletSelectorContext.tsx @@ -17,7 +17,13 @@ import { setupNearSnap } from "@near-wallet-selector/near-snap"; import { setupWelldoneWallet } from "@near-wallet-selector/welldone-wallet"; import { setupXDEFI } from "@near-wallet-selector/xdefi"; import type { ReactNode } from "react"; -import React, { useCallback, useContext, useEffect, useState } from "react"; +import React, { + useCallback, + useContext, + useEffect, + useState, + useMemo, +} from "react"; import { distinctUntilChanged, map } from "rxjs"; import { setupNeth } from "@near-wallet-selector/neth"; @@ -51,6 +57,7 @@ export const WalletSelectorContextProvider: React.FC<{ const [selector, setSelector] = useState(null); const [modal, setModal] = useState(null); const [accounts, setAccounts] = useState>([]); + const [loading, setLoading] = useState(true); const init = useCallback(async () => { const _selector = await setupWalletSelector({ @@ -103,11 +110,14 @@ export const WalletSelectorContextProvider: React.FC<{ const state = _selector.store.getState(); setAccounts(state.accounts); + // this is added for debugging purpose only + // for more information (https://github.com/near/wallet-selector/pull/764#issuecomment-1498073367) window.selector = _selector; window.modal = _modal; setSelector(_selector); setModal(_modal); + setLoading(false); }, []); useEffect(() => { @@ -141,24 +151,24 @@ export const WalletSelectorContextProvider: React.FC<{ subscription.unsubscribe(); onHideSubscription.remove(); }; - }, [selector]); + }, [selector, modal]); + + const walletSelectorContextValue = useMemo( + () => ({ + selector: selector!, + modal: modal!, + accounts, + accountId: accounts.find((account) => account.active)?.accountId || null, + }), + [selector, modal, accounts] + ); - if (!selector || !modal) { + if (loading) { return ; } - const accountId = - accounts.find((account) => account.active)?.accountId || null; - return ( - + {children} ); diff --git a/examples/react/contexts/WalletSelectorExportContext.tsx b/examples/react/contexts/WalletSelectorExportContext.tsx index e6479e722..d5fc980b7 100644 --- a/examples/react/contexts/WalletSelectorExportContext.tsx +++ b/examples/react/contexts/WalletSelectorExportContext.tsx @@ -1,5 +1,11 @@ import type { ReactNode } from "react"; -import React, { useCallback, useContext, useEffect, useState } from "react"; +import React, { + useCallback, + useContext, + useEffect, + useState, + useMemo, +} from "react"; import { map, distinctUntilChanged } from "rxjs"; import { setupWalletSelector } from "@near-wallet-selector/core"; import type { WalletSelector, AccountState } from "@near-wallet-selector/core"; @@ -24,13 +30,13 @@ import { setupLedger } from "@near-wallet-selector/ledger"; declare global { interface Window { importSelector: WalletSelector; - ExportModal: WalletSelectorModal; + exportModal: WalletSelectorModal; } } interface ExportAccountSelectorContextValue { importSelector: WalletSelector; - ExportModal: WalletSelectorModal; + exportModal: WalletSelectorModal; accounts: Array; accountId: string | null; } @@ -42,8 +48,9 @@ export const ExportAccountSelectorContextProvider: React.FC<{ children: ReactNode; }> = ({ children }) => { const [importSelector, setSelector] = useState(null); - const [ExportModal, setModal] = useState(null); + const [modal, setModal] = useState(null); const [accounts, setAccounts] = useState>([]); + const [loading, setLoading] = useState(true); const init = useCallback(async () => { const _selector = await setupWalletSelector({ @@ -95,11 +102,14 @@ export const ExportAccountSelectorContextProvider: React.FC<{ const state = _selector.store.getState(); setAccounts(state.accounts); + // this is added for debugging purpose only + // for more information (https://github.com/near/wallet-selector/pull/764#issuecomment-1498073367) window.importSelector = _selector; - window.ExportModal = _modal; + window.exportModal = _modal; setSelector(_selector); setModal(_modal); + setLoading(false); }, []); useEffect(() => { @@ -126,21 +136,25 @@ export const ExportAccountSelectorContextProvider: React.FC<{ return () => subscription.unsubscribe(); }, [importSelector]); - if (!importSelector || !ExportModal) { + const exportWalletSelectorContextValue = + useMemo( + () => ({ + importSelector: importSelector!, + exportModal: modal!, + accounts, + accountId: + accounts.find((account) => account.active)?.accountId || null, + }), + [importSelector, modal, accounts] + ); + + if (loading) { return ; } - const accountId = - accounts.find((account) => account.active)?.accountId || null; - return ( {children} diff --git a/package.json b/package.json index bfd4497da..7bd508969 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "near-wallet-selector", - "version": "7.9.3", + "version": "8.0.0", "description": "NEAR Wallet Selector makes it easy for users to interact with your dApp by providing an abstraction over various wallets within the NEAR ecosystem", "keywords": [ "near", @@ -101,8 +101,9 @@ "core-js": "^3.6.5", "crypto-browserify": "^3.12.0", "ethers": "^5.7.2", + "https-browserify": "^1.0.0", "is-mobile": "^3.1.1", - "near-api-js": "^1.1.0", + "near-api-js": "^2.1.0", "near-seed-phrase": "^0.2.0", "next": "12.2.3", "ngx-deploy-npm": "^4.3.10", @@ -113,9 +114,11 @@ "regenerator-runtime": "0.13.11", "rxjs": "^7.8.0", "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", "tslib": "^2.3.0", "tweetnacl": "^1.0.3", "tweetnacl-util": "^0.15.1", + "url": "^0.11.0", "zone.js": "~0.11.4" }, "devDependencies": { diff --git a/packages/account-export/README.md b/packages/account-export/README.md index f67bba944..0b80f3ca0 100644 --- a/packages/account-export/README.md +++ b/packages/account-export/README.md @@ -43,6 +43,7 @@ modal.show(); - `accounts` (`Array`): List of objects with an account id and its private key to be exported. - `theme` (`Theme?`): Specify light/dark theme for UI. Defaults to the browser configuration when omitted or set to 'auto'. This can be either `light`, `dark` or `auto`. - `description` (`string?`): Define a custom description in the UI. +- `onComplete` (`(accounts: Array) => void`): Triggers when the user completes the flow. By default it is not set. ## Styles & Customizing CSS diff --git a/packages/account-export/package.json b/packages/account-export/package.json index 547fcaeef..d43a496c4 100644 --- a/packages/account-export/package.json +++ b/packages/account-export/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/account-export", - "version": "7.9.3", + "version": "8.0.0", "description": "This is the Export Selector UI package for NEAR Wallet Selector.", "keywords": [ "near", @@ -21,6 +21,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/magin/packages/account-export", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/coin98-wallet/README.md b/packages/coin98-wallet/README.md index df7e13e1f..3fe5c168c 100644 --- a/packages/coin98-wallet/README.md +++ b/packages/coin98-wallet/README.md @@ -4,7 +4,7 @@ Coin98 Wallet [Coin98 Wallet](https://chrome.google.com/webstore/detail/coin98-w ## Installation -This package requires `near-api-js` v0.44.2 or above: +This package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -43,6 +43,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Icon is optional. Default image point to Coin98 Wallet Logo in base64 format. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## License diff --git a/packages/coin98-wallet/package.json b/packages/coin98-wallet/package.json index 9fe250df6..63af8384b 100644 --- a/packages/coin98-wallet/package.json +++ b/packages/coin98-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/coin98-wallet", - "version": "7.9.3", + "version": "8.0.0", "description": "Coin 98 wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/coin98-wallet", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/core/README.md b/packages/core/README.md index 4d1495311..d1bd75b15 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -4,7 +4,7 @@ This is the core package for NEAR Wallet Selector. ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn diff --git a/packages/core/docs/api/selector.md b/packages/core/docs/api/selector.md index cd949211c..b5855ce60 100644 --- a/packages/core/docs/api/selector.md +++ b/packages/core/docs/api/selector.md @@ -12,6 +12,7 @@ - `debug` (`boolean`): Whether internal logging is enabled. - `optimizeWalletOrder` (`boolean`): Whether wallet order optimization is enabled. - `randomizeWalletOrder` (`boolean`): Weather wallet order randomization is enabled. +- `languageCode` (`string?`): ISO 639-1 two-letter language code. **Description** Resolved variation of the options passed to `setupWalletSelector`. diff --git a/packages/core/docs/guides/custom-wallets.md b/packages/core/docs/guides/custom-wallets.md index 10c8bee16..edf980051 100644 --- a/packages/core/docs/guides/custom-wallets.md +++ b/packages/core/docs/guides/custom-wallets.md @@ -22,7 +22,7 @@ const MyWallet: WalletBehaviourFactory = ({ options, provider, }) => { - // Initialise wallet-sepecific client(s) here. + // Initialise wallet-specific client(s) here. return { async signIn({ contractId, methodNames }) { @@ -41,6 +41,16 @@ const MyWallet: WalletBehaviourFactory = ({ return []; }, + async verifyOwner({ message }) { + const signature = provider.signMessage(message); + + return { + ...data, + signature: Buffer.from(signature.signature).toString("base64"), + keyType: signature.publicKey.keyType, + }; // Promise + }, + async signAndSendTransaction({ signerId, receiverId, actions }) { // Sign a list of NEAR Actions before sending via an RPC endpoint. // An RPC provider is injected to make this process easier and configured based on options.network. @@ -92,12 +102,13 @@ export function setupMyWallet({ A variation of `WalletModule` is added to state during setup under `modules` (`ModuleState`) and accessed by the UI to display the available wallets. It's important that `id` is unique to avoid conflicts with other wallets installed by a dApp. The `type` property is coupled to the parameter we pass to `WalletModuleFactory` and `WalletBehaviourFactory`. -Although we've tried to implement a polymorphic approach to wallets, there are some differences between wallet types that means your implementation won't always mirror other wallets such as Sender vs. Ledger. There are currently four types of wallet: +Although we've tried to implement a polymorphic approach to wallets, there are some differences between wallet types that means your implementation won't always mirror other wallets such as Sender vs. Ledger. There are currently five types of wallet: -- `BrowserWallet`: NEAR Wallet -- `InjectedWallet`: Sender & Math Wallet -- `HardwareWallet`: Ledger -- `BridgeWallet`: WalletConnect +- `BrowserWallet` +- `InjectedWallet` +- `HardwareWallet` +- `BridgeWallet` +- `InstantLinkWallet` ## Methods @@ -105,7 +116,7 @@ Although we've tried to implement a polymorphic approach to wallets, there are s This method handles access to accounts via `FunctionCall` access keys. It's important that at least one account is returned to be in a signed in state. -> Note: Hardware wallets require `derivationPaths`. +> Note: Hardware wallets require `accounts`. ### `signOut` @@ -115,6 +126,10 @@ This method handles signing out from accounts and cleanup such as event listener This method returns the current list of accounts we have access to. When no accounts are returned, the wallet is considered to be in a signed out state. +### `verifyOwner` + +Signs the message and verifies the owner. Message is not sent to blockchain. + ### `signAndSendTransaction` This method signs a list of NEAR Actions before sending via an RPC endpoint. The implementation can differ widely based on how much the wallet you're integrating does for you. At a minimum the wallet must be able to sign a message. diff --git a/packages/core/docs/guides/multilanguage-support.md b/packages/core/docs/guides/multilanguage-support.md index f5d6184b7..bb402d417 100644 --- a/packages/core/docs/guides/multilanguage-support.md +++ b/packages/core/docs/guides/multilanguage-support.md @@ -1,7 +1,7 @@ -# Multilanguage support +# Multi-language support - Languages are detected from browser language settings. -- If user preffered language is not supported, english is rendered as default. +- If user preferred language is not supported, english is rendered as default. ## Supported languages diff --git a/packages/core/package.json b/packages/core/package.json index 6a9f7138e..ee4dfa0e3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/core", - "version": "7.9.3", + "version": "8.0.0", "description": "This is the core package for NEAR Wallet Selector.", "keywords": [ "near", @@ -20,6 +20,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/core", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/core/src/lib/services/wallet-modules/wallet-modules.service.ts b/packages/core/src/lib/services/wallet-modules/wallet-modules.service.ts index b16598600..a67958802 100644 --- a/packages/core/src/lib/services/wallet-modules/wallet-modules.service.ts +++ b/packages/core/src/lib/services/wallet-modules/wallet-modules.service.ts @@ -374,19 +374,6 @@ export class WalletModules { this.modules = modules; - for (let i = 0; i < this.modules.length; i++) { - if (this.modules[i].type === "instant-link") { - const wallet = (await this.modules[i].wallet()) as InstantLinkWallet; - if (wallet.metadata.runOnStartup) { - try { - await wallet.signIn({ contractId: wallet.getContractId() }); - } catch (err) { - logger.error("Failed to sign in to wallet. " + err); - } - } - } - } - const { accounts, contract, selectedWalletId, recentlySignedInWallets } = await this.resolveStorageState(); @@ -400,5 +387,22 @@ export class WalletModules { recentlySignedInWallets, }, }); + + for (let i = 0; i < this.modules.length; i++) { + if (this.modules[i].type !== "instant-link") { + continue; + } + + const wallet = (await this.modules[i].wallet()) as InstantLinkWallet; + if (!wallet.metadata.runOnStartup) { + continue; + } + + try { + await wallet.signIn({ contractId: wallet.getContractId() }); + } catch (err) { + logger.error("Failed to sign in to wallet. " + err); + } + } } } diff --git a/packages/default-wallets/README.md b/packages/default-wallets/README.md index bed68ca09..9a599e691 100644 --- a/packages/default-wallets/README.md +++ b/packages/default-wallets/README.md @@ -8,7 +8,7 @@ This is the list of default wallets: ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn diff --git a/packages/default-wallets/package.json b/packages/default-wallets/package.json index fd6b2e8d4..753418eed 100644 --- a/packages/default-wallets/package.json +++ b/packages/default-wallets/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/default-wallets", - "version": "7.9.3", + "version": "8.0.0", "description": "Default wallets package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/finer-wallet/README.md b/packages/finer-wallet/README.md index a0b99d8b6..1d588c83d 100644 --- a/packages/finer-wallet/README.md +++ b/packages/finer-wallet/README.md @@ -36,6 +36,7 @@ const selector = await setupWalletSelector({ - `walletUrl` (`string?`): Wallet URL used to redirect when signing transactions. This parameter is required when using custom network configuration. - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/finer-wallet-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/finer-wallet/package.json b/packages/finer-wallet/package.json index 02970f643..867133fd5 100644 --- a/packages/finer-wallet/package.json +++ b/packages/finer-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/finer-wallet", - "version": "7.9.3", + "version": "8.0.0", "description": "FiNER Wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -23,6 +23,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/finer-wallet", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/here-wallet/README.md b/packages/here-wallet/README.md index 69e51957a..ed976d7f7 100644 --- a/packages/here-wallet/README.md +++ b/packages/here-wallet/README.md @@ -4,7 +4,7 @@ This is the [Here Wallet](https://herewallet.app/) package for NEAR Wallet Selec ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -80,6 +80,13 @@ const hereWallet = setupHereWallet({ ``` +## Options + +- `iconUrl`: (`string?`): Icon is optional. Default image point to Here Wallet Logo in base64 format. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. +- `defaultStrategy`: (`() => HereStrategy?`): DefaultStrategy is optional. Default is `undefined`. +- `defaultProvider`: (`HereProvider`): HereProvider is optional. Default is `undefined`. + ## License This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0). diff --git a/packages/here-wallet/package.json b/packages/here-wallet/package.json index 6ee95469a..789e194ee 100644 --- a/packages/here-wallet/package.json +++ b/packages/here-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/here-wallet", - "version": "7.9.3", + "version": "8.0.0", "description": "Here wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/here-wallet", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/ledger/README.md b/packages/ledger/README.md index c63d87c4a..67c2cd273 100644 --- a/packages/ledger/README.md +++ b/packages/ledger/README.md @@ -4,7 +4,7 @@ This is the [Ledger](https://www.ledger.com/) package for NEAR Wallet Selector. ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -41,6 +41,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/ledger-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/ledger/package.json b/packages/ledger/package.json index f63c94d94..3366400e2 100644 --- a/packages/ledger/package.json +++ b/packages/ledger/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/ledger", - "version": "7.9.3", + "version": "8.0.0", "description": "Ledger package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/ledger", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/math-wallet/README.md b/packages/math-wallet/README.md index 8ce0f89f4..6690b1e5b 100644 --- a/packages/math-wallet/README.md +++ b/packages/math-wallet/README.md @@ -4,7 +4,7 @@ This is the [Math Wallet](https://chrome.google.com/webstore/detail/math-wallet/ ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -42,6 +42,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/math-wallet-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/math-wallet/package.json b/packages/math-wallet/package.json index cdfceee0c..2748e6521 100644 --- a/packages/math-wallet/package.json +++ b/packages/math-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/math-wallet", - "version": "7.9.3", + "version": "8.0.0", "description": "Math wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/math-wallet", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/meteor-wallet/README.md b/packages/meteor-wallet/README.md index ba738377e..4a97d0d2f 100644 --- a/packages/meteor-wallet/README.md +++ b/packages/meteor-wallet/README.md @@ -4,7 +4,7 @@ This is the [Meteor Wallet](https://meteorwallet.app) package for NEAR Wallet Se ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -41,6 +41,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/meteor-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/meteor-wallet/package.json b/packages/meteor-wallet/package.json index 6e2492d65..74128ea3d 100644 --- a/packages/meteor-wallet/package.json +++ b/packages/meteor-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/meteor-wallet", - "version": "7.9.3", + "version": "8.0.0", "description": "Meteor wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/meteor-wallet", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/modal-ui-js/README.md b/packages/modal-ui-js/README.md index 6db179e8c..7e4f94520 100644 --- a/packages/modal-ui-js/README.md +++ b/packages/modal-ui-js/README.md @@ -40,7 +40,6 @@ modal.show(); - `theme` (`Theme?`): Specify light/dark theme for UI. Defaults to the browser configuration when omitted or set to 'auto'. This can be either `light`, `dark` or `auto`. - `description` (`string?`): Define a custom description in the UI. - ## Styles & Customizing CSS Import modal css styles: diff --git a/packages/modal-ui-js/package.json b/packages/modal-ui-js/package.json index 436f4aacf..eca39e3be 100644 --- a/packages/modal-ui-js/package.json +++ b/packages/modal-ui-js/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/modal-ui-js", - "version": "7.9.3", + "version": "8.0.0", "description": "Modal UI package for NEAR wallet Selector", "keywords": [ "near", diff --git a/packages/modal-ui-js/src/lib/modal.types.ts b/packages/modal-ui-js/src/lib/modal.types.ts index 617206ccd..714f4f8e5 100644 --- a/packages/modal-ui-js/src/lib/modal.types.ts +++ b/packages/modal-ui-js/src/lib/modal.types.ts @@ -9,7 +9,6 @@ export interface ModalOptions { methodNames?: Array; theme?: Theme; description?: string; - onHide?: (hideReason: "user-triggered" | "wallet-navigation") => void; } export type ModalHideReason = "user-triggered" | "wallet-navigation"; diff --git a/packages/modal-ui-js/src/lib/render-modal.ts b/packages/modal-ui-js/src/lib/render-modal.ts index 4a8909d01..a302e0b69 100644 --- a/packages/modal-ui-js/src/lib/render-modal.ts +++ b/packages/modal-ui-js/src/lib/render-modal.ts @@ -320,9 +320,7 @@ export function renderModal() { } modalState.container.children[0].classList.remove("open"); - if (modalState.options.onHide) { - modalState.emitter.emit("onHide", { hideReason: "user-triggered" }); - } + modalState.emitter.emit("onHide", { hideReason: "user-triggered" }); }); // TODO: Better handle `click` event listener for close-button. @@ -337,9 +335,7 @@ export function renderModal() { if (target && target.className === "close-button") { modalState.container.children[0].classList.remove("open"); - if (modalState.options.onHide) { - modalState.emitter.emit("onHide", { hideReason: "user-triggered" }); - } + modalState.emitter.emit("onHide", { hideReason: "user-triggered" }); } }); initialRender = false; diff --git a/packages/modal-ui/package.json b/packages/modal-ui/package.json index f18d2f4d6..553bca64d 100644 --- a/packages/modal-ui/package.json +++ b/packages/modal-ui/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/modal-ui", - "version": "7.9.3", + "version": "8.0.0", "description": "Modal UI package for NEAR wallet Selector", "keywords": [ "near", diff --git a/packages/modal-ui/src/lib/modal.types.ts b/packages/modal-ui/src/lib/modal.types.ts index 6167b7dbb..253f81e99 100644 --- a/packages/modal-ui/src/lib/modal.types.ts +++ b/packages/modal-ui/src/lib/modal.types.ts @@ -7,7 +7,6 @@ export interface ModalOptions { methodNames?: Array; theme?: Theme; description?: string; - onHide?: (hideReason: "user-triggered" | "wallet-navigation") => void; } export type ModalHideReason = "user-triggered" | "wallet-navigation"; diff --git a/packages/my-near-wallet/README.md b/packages/my-near-wallet/README.md index f18cc3054..0cf5e5c20 100644 --- a/packages/my-near-wallet/README.md +++ b/packages/my-near-wallet/README.md @@ -4,7 +4,7 @@ This is the [My NEAR Wallet](https://mynearwallet.com/) package for NEAR Wallet ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -43,6 +43,9 @@ const selector = await setupWalletSelector({ - `walletUrl` (`string?`): Wallet URL used to redirect when signing transactions. This parameter is required for custom network configuration. - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/my-near-wallet-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. +- `successUrl`: (`string?`): SuccessUrl is optional. Default is `''` (empty string). +- `failureUrl`: (`string?`): FailureUrl is optional. Default is `''` (empty string). ## Assets diff --git a/packages/my-near-wallet/package.json b/packages/my-near-wallet/package.json index 74c85f366..491fddbdb 100644 --- a/packages/my-near-wallet/package.json +++ b/packages/my-near-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/my-near-wallet", - "version": "7.9.3", + "version": "8.0.0", "description": "My Near Wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/my-near-wallet", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/narwallets/README.md b/packages/narwallets/README.md index aa294b245..7aee29e27 100644 --- a/packages/narwallets/README.md +++ b/packages/narwallets/README.md @@ -34,6 +34,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/narwallets-logo.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/narwallets/package.json b/packages/narwallets/package.json index 57c901a44..0091d440a 100644 --- a/packages/narwallets/package.json +++ b/packages/narwallets/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/narwallets", - "version": "7.9.3", + "version": "8.0.0", "description": "This is the Narwallets package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/near-snap/README.md b/packages/near-snap/README.md index 9daddea25..b1aaea165 100644 --- a/packages/near-snap/README.md +++ b/packages/near-snap/README.md @@ -5,7 +5,7 @@ This package implement NEAR snap for NEAR Wallet Selector. ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -43,6 +43,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/near-snap-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/near-snap/package.json b/packages/near-snap/package.json index 203a43bb6..d83d7be0a 100644 --- a/packages/near-snap/package.json +++ b/packages/near-snap/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/near-snap", - "version": "7.9.3", + "version": "8.0.0", "description": "Metamask snap to interact with Near dapps.", "keywords": [ "near", @@ -24,6 +24,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/near-snap", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/near-wallet/README.md b/packages/near-wallet/README.md index fa5dd06a9..a80c997a0 100644 --- a/packages/near-wallet/README.md +++ b/packages/near-wallet/README.md @@ -36,6 +36,9 @@ const selector = await setupWalletSelector({ - `walletUrl` (`string?`): Wallet URL used to redirect when signing transactions. This parameter is required when using custom network configuration. - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/near-wallet-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. +- `successUrl`: (`string?`): SuccessUrl is optional. Default is `''` (empty string). +- `failureUrl`: (`string?`): FailureUrl is optional. Default is `''` (empty string). ## Assets diff --git a/packages/near-wallet/package.json b/packages/near-wallet/package.json index d74cec904..70b8e05ad 100644 --- a/packages/near-wallet/package.json +++ b/packages/near-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/near-wallet", - "version": "7.9.3", + "version": "8.0.0", "description": "Near Wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/near-wallet", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/nearfi/README.md b/packages/nearfi/README.md index 60ee968df..3361ed43b 100644 --- a/packages/nearfi/README.md +++ b/packages/nearfi/README.md @@ -4,7 +4,7 @@ This is the [NearFi wallet](https://nearfi.finance) package for NEAR Wallet Sele ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires near-api-js v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires near-api-js v1.0.0 or above: ```bash # Using Yarn @@ -45,6 +45,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/nearfi-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/nearfi/package.json b/packages/nearfi/package.json index bc82a4222..e2414acbc 100644 --- a/packages/nearfi/package.json +++ b/packages/nearfi/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/nearfi", - "version": "7.9.3", + "version": "8.0.0", "description": "Nearfi package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/nearfi", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/neth/.eslintrc.json b/packages/neth/.eslintrc.json index 9d9c0db55..481351fd3 100644 --- a/packages/neth/.eslintrc.json +++ b/packages/neth/.eslintrc.json @@ -13,6 +13,14 @@ { "files": ["*.js", "*.jsx"], "rules": {} + }, + { + "files": ["neth-lib.ts"], + "rules": { + "@typescript-eslint/naming-convention": ["off"], + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-explicit-any": ["off"] + } } ] } diff --git a/packages/neth/README.md b/packages/neth/README.md index 0025566bd..d9cc3a2d6 100644 --- a/packages/neth/README.md +++ b/packages/neth/README.md @@ -4,7 +4,7 @@ This is the [NETH](https://neth.app) package for NEAR Wallet Selector. ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn diff --git a/packages/neth/package.json b/packages/neth/package.json index a909d8c7d..8151ffb66 100644 --- a/packages/neth/package.json +++ b/packages/neth/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/neth", - "version": "7.9.3", + "version": "8.0.0", "description": "Control NEAR accounts with ETH accounts", "author": "mattlockyer", "keywords": [ @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/neth", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/neth/src/lib/neth-lib.ts b/packages/neth/src/lib/neth-lib.ts index 7ed9087ec..bfb8f2b86 100644 --- a/packages/neth/src/lib/neth-lib.ts +++ b/packages/neth/src/lib/neth-lib.ts @@ -1,6 +1,3 @@ -/*eslint @typescript-eslint/no-use-before-define: 1*/ -/*eslint @typescript-eslint/no-explicit-any: 1*/ -/*eslint @typescript-eslint/naming-convention: 1*/ // @ts-nocheck import { ethers } from "ethers"; @@ -462,13 +459,13 @@ export const handleCheckAccount = async ({ const account = new Account(connection, newAccountId); logger.log("Checking account address mapping."); - const mapRes = await account.viewFunction( - NETWORK[networkId].MAP_ACCOUNT_ID, - "get_eth", - { + const mapRes = await account.viewFunction({ + contractId: NETWORK[networkId].MAP_ACCOUNT_ID, + methodName: "get_eth", + args: { account_id: newAccountId, - } - ); + }, + }); if (mapRes === null) { return handleMapping(); } @@ -481,7 +478,10 @@ export const handleCheckAccount = async ({ logger.log("Checking contract setup."); try { - const ethRes = await account.viewFunction(newAccountId, "get_address"); + const ethRes = await account.viewFunction({ + contractId: newAccountId, + methodName: "get_address", + }); // any reason the address wasn't set properly if (!ethRes || !ethRes.length) { return handleSetupContract(); @@ -532,7 +532,10 @@ export const handleRefreshAppKey = async (signer, ethAddress) => { // now refresh app key const nonce = parseInt( - await account.viewFunction(accountId, "get_nonce"), + await account.viewFunction({ + contractId: accountId, + methodName: "get_nonce", + }), 16 ).toString(); // new public key based on current nonce which will become the app_key_nonce in contract after this TX @@ -556,7 +559,10 @@ export const handleRefreshAppKey = async (signer, ethAddress) => { if (hasAppKey(accessKeys)) { // old public key based on current app_key_nonce const appKeyNonce = parseInt( - await account.viewFunction(accountId, "get_app_key_nonce"), + await account.viewFunction({ + contractId: accountId, + methodName: "get_app_key_nonce", + }), 16 ).toString(); const { publicKey: oldPublicKey } = await keyPairFromEthSig( @@ -612,7 +618,10 @@ export const handleUpdateContract = async (signer, ethAddress) => { }, ]; const nonce = parseInt( - await account.viewFunction(accountId, "get_nonce"), + await account.viewFunction({ + contractId: accountId, + methodName: "get_nonce", + }), 16 ).toString(); const args = await ethSignJson(signer, { @@ -694,7 +703,10 @@ export const handleDisconnect = async (signer, ethAddress) => { }) ) { const appKeyNonce = parseInt( - await account.viewFunction(accountId, "get_app_key_nonce"), + await account.viewFunction({ + contractId: accountId, + methodName: "get_app_key_nonce", + }), 16 ).toString(); const { publicKey: oldPublicKey } = await keyPairFromEthSig( @@ -710,7 +722,10 @@ export const handleDisconnect = async (signer, ethAddress) => { /// get args for execute call const nonce = parseInt( - await account.viewFunction(accountId, "get_nonce"), + await account.viewFunction({ + contractId: accountId, + methodName: "get_nonce", + }), 16 ).toString(); const args = await ethSignJson(signer, { @@ -1005,19 +1020,24 @@ export const switchEthereum = async () => { /// near export const getNearMap = async (eth_address) => { - return contractAccount.viewFunction( - NETWORK[networkId].MAP_ACCOUNT_ID, - "get_near", - { eth_address } - ); + return contractAccount.viewFunction({ + contractId: NETWORK[networkId].MAP_ACCOUNT_ID, + methodName: "get_near", + args: { + eth_address, + }, + }); }; -export const getNear = async (): { - account: NearAccount; - accountId: string; - keyPair: NearKeyPair; - secretKey: string; -} => { +export const getNear = async (): Promise< + | false + | { + account: NearAccount; + accountId: string; + keyPair: NearKeyPair; + secretKey: string; + } +> => { const secretKey = await storage.getItem(APP_KEY_SECRET); const accountId = await storage.getItem(APP_KEY_ACCOUNT_ID); if (!secretKey || !accountId) { @@ -1050,7 +1070,10 @@ export const signOut = async () => { export const verifyOwner = async ({ message, provider, account }) => { let accountId; if (!account) { - ({ account, accountId } = await getNear()); + const nearAccount = await getNear(); + if (nearAccount) { + ({ account, accountId } = nearAccount); + } } else { ({ accountId } = account); } @@ -1153,7 +1176,10 @@ export const getAppKey = async ({ signer, ethAddress: eth_address }) => { // accountId = account.accountId; } const appKeyNonce = parseInt( - await contractAccount.viewFunction(accountId, "get_app_key_nonce"), + await contractAccount.viewFunction({ + contractId: accountId, + methodName: "get_app_key_nonce", + }), 16 ).toString(); const { publicKey, secretKey } = await keyPairFromEthSig( @@ -1174,7 +1200,12 @@ export const getAppKey = async ({ signer, ethAddress: eth_address }) => { }; const broadcastTXs = async () => { - const { account, accountId } = await getNear(); + const nearAccount = await getNear(); + if (!nearAccount) { + logger.log("NETH: ERROR broadcasting tx. No account found."); + return; + } + const { account, accountId } = nearAccount; const args = await storage.getItem(TX_ARGS_ATTEMPT); if (!args || args.length === 0) { return; @@ -1204,7 +1235,14 @@ const broadcastTXs = async () => { export const signAndSendTransactions = async ({ transactions, bundle }) => { const ethRes: any = await getEthereum(); const { signer } = ethRes; - const { account, accountId } = await getNear(); + const nearAccount = await getNear(); + if (!nearAccount) { + logger.log( + "NETH: ERROR signing and sending transactions. No account found." + ); + return; + } + const { account, accountId } = nearAccount; const receivers = transactions.map(({ receiverId }) => receiverId); const transformedTxs = transactions.map(({ receiverId, actions }) => ({ @@ -1212,7 +1250,10 @@ export const signAndSendTransactions = async ({ transactions, bundle }) => { })); const nonce = parseInt( - await account.viewFunction(accountId, "get_nonce"), + await account.viewFunction({ + contractId: accountId, + methodName: "get_nonce", + }), 16 ); const args: Array = []; diff --git a/packages/neth/src/lib/neth.ts b/packages/neth/src/lib/neth.ts index 47eaac96a..3bcce1445 100644 --- a/packages/neth/src/lib/neth.ts +++ b/packages/neth/src/lib/neth.ts @@ -152,7 +152,12 @@ const Neth: WalletBehaviourFactory = async ({ }, async getAccounts() { - const { accountId, account } = await getNear(); + const near = await getNear(); + if (!near) { + logger.log("NETH:getAccounts"); + return []; + } + const { account, accountId } = near; return [ { accountId, diff --git a/packages/nightly-connect/README.md b/packages/nightly-connect/README.md index 8de5964a5..61f21aa36 100644 --- a/packages/nightly-connect/README.md +++ b/packages/nightly-connect/README.md @@ -4,7 +4,7 @@ This is the [Nightly Connect](https://connect.nightly.app/) package for NEAR Wal ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -45,11 +45,11 @@ const selector = await setupWalletSelector({ ## Options -- `persistent` (`boolean?`): Indication of whether last session id should be persisted in localStorage and used after user refreshes app. Defaults to true. - `appMetadata` (`object`): App metadata used to provide context of the dApp to the connected wallet. - `url` (`string?`): URL address of Nightly Connect proxy. - `timeout` (`number?`): Timeout of requests sent via proxy. - `iconUrl` (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/nightly-connect.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/nightly-connect/package.json b/packages/nightly-connect/package.json index edf6d057c..b85d9e5d1 100644 --- a/packages/nightly-connect/package.json +++ b/packages/nightly-connect/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/nightly-connect", - "version": "7.9.3", + "version": "8.0.0", "description": "Nightly connect package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/nightly-connect", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/nightly/README.md b/packages/nightly/README.md index 16a849554..0208790cf 100644 --- a/packages/nightly/README.md +++ b/packages/nightly/README.md @@ -5,7 +5,7 @@ This is the [Nightly](https://wallet.nightly.app/) package for NEAR Wallet Selec ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -43,6 +43,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/nightly-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/nightly/package.json b/packages/nightly/package.json index 3f09411ab..e9dbccb82 100644 --- a/packages/nightly/package.json +++ b/packages/nightly/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/nightly", - "version": "7.9.3", + "version": "8.0.0", "description": "Nightly wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/nightly", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/opto-wallet/README.md b/packages/opto-wallet/README.md index 2c420b9fa..5dfdbef71 100644 --- a/packages/opto-wallet/README.md +++ b/packages/opto-wallet/README.md @@ -4,7 +4,7 @@ This is the [Opto Wallet](https://optowallet.com/) package for NEAR Wallet Selec ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -43,6 +43,7 @@ const selector = await setupWalletSelector({ - `walletUrl` (`string?`): Wallet URL used to redirect when signing transactions. This parameter is required for custom network configuration. - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/opto-wallet-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/opto-wallet/package.json b/packages/opto-wallet/package.json index e807c0d8a..a99b76d9d 100644 --- a/packages/opto-wallet/package.json +++ b/packages/opto-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/opto-wallet", - "version": "7.9.3", + "version": "8.0.0", "description": "Opto wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/opto-wallet", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/sender/README.md b/packages/sender/README.md index ef9ec8792..ab1a62471 100644 --- a/packages/sender/README.md +++ b/packages/sender/README.md @@ -4,7 +4,7 @@ This is the [Sender](https://chrome.google.com/webstore/detail/sender-wallet/epa ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -41,6 +41,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/sender-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/sender/package.json b/packages/sender/package.json index 53270bd71..f4c273dda 100644 --- a/packages/sender/package.json +++ b/packages/sender/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/sender", - "version": "7.9.3", + "version": "8.0.0", "description": "Sender wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/sender", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/wallet-connect/README.md b/packages/wallet-connect/README.md index cddd71473..e8f56e19a 100644 --- a/packages/wallet-connect/README.md +++ b/packages/wallet-connect/README.md @@ -4,7 +4,7 @@ This is the [WalletConnect](https://walletconnect.com/) package for NEAR Wallet ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -55,7 +55,9 @@ Project ID is required for wallet connect, please obtain it from [walletconnect. - `projectId` (`string`): Project ID is `required` to instantiate the client. More details can be found [here](https://docs.walletconnect.com/2.0/cloud/relay#project-id). - `metadata` (`object`): Metadata used to provide context of the dApp to the connected wallet. More details can be found [here](https://docs.walletconnect.com/2.0/specs/clients/core/pairing/data-structures#metadata). - `chainId` (`string?`): Chain ID for requests. Defaults to `"near:` unless using custom network configuration. +- `relayUrl` (`string?`): Relay URL for requests. Defaults to `"wss://relay.walletconnect.com"`. - `iconUrl` (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/wallet-connect-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/wallet-connect/package.json b/packages/wallet-connect/package.json index 99d7af153..7ccd6c78a 100644 --- a/packages/wallet-connect/package.json +++ b/packages/wallet-connect/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/wallet-connect", - "version": "7.9.3", + "version": "8.0.0", "description": "Wallet Connect package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/wallet-connect", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/wallet-utils/README.md b/packages/wallet-utils/README.md index 6d4f79b10..fe6a9f85d 100644 --- a/packages/wallet-utils/README.md +++ b/packages/wallet-utils/README.md @@ -4,7 +4,7 @@ This is the Wallet Utils package for NEAR Wallet Selector. ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -25,7 +25,7 @@ npm install @near-wallet-selector/wallet-utils Then use it in your custom wallet integration: ```ts -import { createAction } from "@near-wallet-selector/wallet-utils"; +import { createAction, signTransactions } from "@near-wallet-selector/wallet-utils"; const action = createAction({ type: "Transfer", @@ -33,6 +33,12 @@ const action = createAction({ deposit: "10000000000000000000000", }, }); + +const signedTransactions = await signTransactions( + [{ signerId, receiverId, actions }], + signer, + options.network +); ``` ## License diff --git a/packages/wallet-utils/package.json b/packages/wallet-utils/package.json index 96043f6f7..e9bfd7754 100644 --- a/packages/wallet-utils/package.json +++ b/packages/wallet-utils/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/wallet-utils", - "version": "7.9.3", + "version": "8.0.0", "description": "Wallet utils package for NEAR Wallet Selector.", "keywords": [ "near", @@ -20,6 +20,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/wallet-utils", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/welldone-wallet/README.md b/packages/welldone-wallet/README.md index 214de9c65..41d4ff1fb 100644 --- a/packages/welldone-wallet/README.md +++ b/packages/welldone-wallet/README.md @@ -4,7 +4,7 @@ This is the [WELLDONE](https://chrome.google.com/webstore/detail/welldone-wallet ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn @@ -41,6 +41,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/welldone-wallet.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/welldone-wallet/package.json b/packages/welldone-wallet/package.json index 854d5ccae..4cb635aa3 100644 --- a/packages/welldone-wallet/package.json +++ b/packages/welldone-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/welldone-wallet", - "version": "7.9.3", + "version": "8.0.0", "description": "Welldone wallet package for NEAR Wallet Selector.", "keywords": [ "near", @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/welldone-wallet", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/packages/xdefi/README.md b/packages/xdefi/README.md index 7afb51976..59f32493e 100644 --- a/packages/xdefi/README.md +++ b/packages/xdefi/README.md @@ -4,14 +4,14 @@ This is the [XDEFI](https://www.xdefi.io/) package for NEAR Wallet Selector. ## Installation and Usage -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v0.44.2 or above: +The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: ```bash # Using Yarn -yarn add near-api-js@^0.44.2 +yarn add near-api-js@^1.0.0 # Using NPM. -npm install near-api-js@^0.44.2 +npm install near-api-js@^1.0.0 ``` ```bash # Using Yarn @@ -41,6 +41,7 @@ const selector = await setupWalletSelector({ ## Options - `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/xdefi-icon.png`. +- `deprecated`: (`boolean?`): Deprecated is optional. Default is `false`. ## Assets diff --git a/packages/xdefi/package.json b/packages/xdefi/package.json index e6b8b344d..1d99a9bab 100644 --- a/packages/xdefi/package.json +++ b/packages/xdefi/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/xdefi", - "version": "7.9.3", + "version": "8.0.0", "description": "This is the XDEFI package for NEAR Wallet Selector.", "keywords": [ "near", @@ -21,6 +21,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/xdefi", "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" + "near-api-js": "^1.0.0 || ^2.0.0" } } diff --git a/tsconfig.base.json b/tsconfig.base.json index cd6aa7607..2d38d6d09 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -92,9 +92,6 @@ "@near-wallet-selector/xdefi": [ "packages/xdefi/src/index.ts" ], - "@near-wallet-selector/opto-wallet": [ - "packages/opto-wallet/src/index.ts" - ], "@near-wallet-selector/finer-wallet": [ "packages/finer-wallet/src/index.ts" ], @@ -103,6 +100,15 @@ ], "stream": [ "node_modules/stream-browserify" + ], + "https": [ + "node_modules/https-browserify" + ], + "http": [ + "node_modules/stream-http" + ], + "url": [ + "node_modules/url" ] } }, diff --git a/yarn.lock b/yarn.lock index 0b4f09090..e7f7ff083 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2716,6 +2716,126 @@ "@motionone/dom" "^10.15.5" tslib "^2.3.1" +"@near-js/accounts@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@near-js/accounts/-/accounts-0.1.0.tgz#3fd44ec290eed196babe31adeac5aea40ccf01dd" + integrity sha512-2VCo8qJRkzzw2p7Na/ApMqn18JXBdQQU9jQMWgcYA/U8yw39EsmXoMTUFsfI9vKoQOmeRgxR5efwQn48rtuJNw== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/providers" "0.0.3" + "@near-js/signers" "0.0.3" + "@near-js/transactions" "0.1.0" + "@near-js/types" "0.0.3" + "@near-js/utils" "0.0.3" + ajv "^8.11.2" + ajv-formats "^2.1.1" + bn.js "5.2.1" + borsh "^0.7.0" + depd "^2.0.0" + near-abi "0.1.1" + +"@near-js/crypto@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-0.0.3.tgz#4a33e526ab5fa75b703427067985694a279ff8bd" + integrity sha512-3WC2A1a1cH8Cqrx+0iDjp1ASEEhxN/KHEMENYb0KZH6Hp5bXIY7Akt4quC7JlgJS5ESvEiLa40tS5h0zAhBWGw== + dependencies: + "@near-js/types" "0.0.3" + bn.js "5.2.1" + borsh "^0.7.0" + tweetnacl "^1.0.1" + +"@near-js/keystores-browser@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/keystores-browser/-/keystores-browser-0.0.3.tgz#110b847cd9c358076c2401e9462cc1140e12a908" + integrity sha512-Ve/JQ1SBxdNk3B49lElJ8Y54AoBY+yOStLvdnUIpe2FBOczzwDCkcnPcMDV0NMwVlHpEnOWICWHbRbAkI5Vs+A== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/keystores" "0.0.3" + +"@near-js/keystores-node@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/keystores-node/-/keystores-node-0.0.3.tgz#074e0aadb55b2ceda43f4389b253193d7a7d7057" + integrity sha512-8Yry0jARK2R2+V4KjEganrnpXhosArwgpyrbvtvptwLLNNFvo/AY1ekGV1EpQ3BVst1qvf5R5TXnIti9OBmEHw== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/keystores" "0.0.3" + +"@near-js/keystores@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/keystores/-/keystores-0.0.3.tgz#eb1e8e06936da166b5ed8dab3123eaa1bf7a8dab" + integrity sha512-mnwLYUt4Td8u1I4QE1FBx2d9hMt3ofiriE93FfOluJ4XiqRqVFakFYiHg6pExg5iEkej/sXugBUFeQ4QizUnew== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/types" "0.0.3" + +"@near-js/providers@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/providers/-/providers-0.0.3.tgz#95f71f9d81139f9eb54a287f859785d75ed007f3" + integrity sha512-NblqLsPfKIWKwQZh+dLZs0nQ+Dx9/MrP1uagRmxZd+aEN/IgYr7Q0mdT77WHQKrsgXiMnipknRZxeoY5bImCuw== + dependencies: + "@near-js/transactions" "0.1.0" + "@near-js/types" "0.0.3" + "@near-js/utils" "0.0.3" + bn.js "5.2.1" + borsh "^0.7.0" + http-errors "^1.7.2" + optionalDependencies: + node-fetch "^2.6.1" + +"@near-js/signers@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.0.3.tgz#bfc8386613295fc6b51982cf65c79bdc9307aa5e" + integrity sha512-u1R+DDIua5PY1PDFnpVYqdMgQ7c4dyeZsfqMjE7CtgzdqupgTYCXzJjBubqMlAyAx843PoXmLt6CSSKcMm0WUA== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/keystores" "0.0.3" + js-sha256 "^0.9.0" + +"@near-js/transactions@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-0.1.0.tgz#a03f529da6bb2eaf9dd0590093f2d0763b8ae72a" + integrity sha512-OrrDFqhX0rtH+6MV3U3iS+zmzcPQI+L4GJi9na4Uf8FgpaVPF0mtSmVrpUrS5CC3LwWCzcYF833xGYbXOV4Kfg== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/signers" "0.0.3" + "@near-js/types" "0.0.3" + "@near-js/utils" "0.0.3" + bn.js "5.2.1" + borsh "^0.7.0" + js-sha256 "^0.9.0" + +"@near-js/types@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.0.3.tgz#d504222469f4d50a6299c522fb6905ba10905bd6" + integrity sha512-gC3iGUT+r2JjVsE31YharT+voat79ToMUMLCGozHjp/R/UW1M2z4hdpqTUoeWUBGBJuVc810gNTneHGx0jvzwQ== + dependencies: + bn.js "5.2.1" + +"@near-js/utils@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-0.0.3.tgz#5e631f3dbdb7f0c6985bcbef08644db83b519978" + integrity sha512-J72n/EL0VfLRRb4xNUF4rmVrdzMkcmkwJOhBZSTWz3PAZ8LqNeU9ZConPfMvEr6lwdaD33ZuVv70DN6IIjPr1A== + dependencies: + "@near-js/types" "0.0.3" + bn.js "5.2.1" + depd "^2.0.0" + mustache "^4.0.0" + +"@near-js/wallet-account@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/wallet-account/-/wallet-account-0.0.3.tgz#81f6a0fc6d4f4ffcdb2c895186fdd86baf9a7b44" + integrity sha512-FD/v0z9HzXfmEerfhRde9HUOojh9IM7nXxCJZm6UF49aA2ztlaqbGvmXSfD+yvf3WG58pC5eUFvDl1sdco8jhQ== + dependencies: + "@near-js/accounts" "0.1.0" + "@near-js/crypto" "0.0.3" + "@near-js/keystores" "0.0.3" + "@near-js/signers" "0.0.3" + "@near-js/transactions" "0.1.0" + "@near-js/types" "0.0.3" + "@near-js/utils" "0.0.3" + bn.js "5.2.1" + borsh "^0.7.0" + "@next/env@12.2.3": version "12.2.3" resolved "https://registry.yarnpkg.com/@next/env/-/env-12.2.3.tgz#64f210e74c137d3d9feea738795b055a7f8aebe2" @@ -4411,7 +4531,7 @@ "@types/parse5" "*" "@types/tough-cookie" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": +"@types/json-schema@*", "@types/json-schema@^7.0.11", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== @@ -5380,6 +5500,16 @@ ajv@^6.10.0, ajv@^6.12.2, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^8.11.2: + version "8.12.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" + integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + ansi-colors@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -6231,6 +6361,11 @@ builtin-modules@^3.0.0: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== + builtins@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.0.1.tgz#87f6db9ab0458be728564fa81d876d8d74552fa9" @@ -9834,6 +9969,11 @@ http-signature@~1.3.6: jsprim "^2.0.2" sshpk "^1.14.1" +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== + https-proxy-agent@5.0.1, https-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" @@ -12179,6 +12319,13 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== +near-abi@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/near-abi/-/near-abi-0.1.1.tgz#b7ead408ca4ad11de4fe3e595d30a7a8bc5307e0" + integrity sha512-RVDI8O+KVxRpC3KycJ1bpfVj9Zv+xvq9PlW1yIFl46GhrnLw83/72HqHGjGDjQ8DtltkcpSjY9X3YIGZ+1QyzQ== + dependencies: + "@types/json-schema" "^7.0.11" + near-api-js@^0.45.1: version "0.45.1" resolved "https://registry.yarnpkg.com/near-api-js/-/near-api-js-0.45.1.tgz#0f0a4b378758a2f1b32555399d7356da73d0ef27" @@ -12196,21 +12343,31 @@ near-api-js@^0.45.1: text-encoding-utf-8 "^1.0.2" tweetnacl "^1.0.1" -near-api-js@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/near-api-js/-/near-api-js-1.1.0.tgz#907e807f052c1f043c6fbf28f61872de3c02235a" - integrity sha512-qYKv1mYsaDZc2uYndhS+ttDhR9+60qFc+ZjD6lWsAxr3ZskMjRwPffDGQZYhC7BRDQMe1HEbk6d5mf+TVm0Lqg== - dependencies: +near-api-js@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/near-api-js/-/near-api-js-2.1.0.tgz#dbdef65bbfb735de8f891309e198c27254fbe9c5" + integrity sha512-JH+xwBPCo8GZlJoJuStI38nfyBIT21iGXofq/X/ewi2pvMFAgpqCantiGgbm0zujyQLPwQPmA+PMm5VKC8y+nQ== + dependencies: + "@near-js/accounts" "0.1.0" + "@near-js/crypto" "0.0.3" + "@near-js/keystores" "0.0.3" + "@near-js/keystores-browser" "0.0.3" + "@near-js/keystores-node" "0.0.3" + "@near-js/providers" "0.0.3" + "@near-js/signers" "0.0.3" + "@near-js/transactions" "0.1.0" + "@near-js/types" "0.0.3" + "@near-js/utils" "0.0.3" + "@near-js/wallet-account" "0.0.3" + ajv "^8.11.2" + ajv-formats "^2.1.1" bn.js "5.2.1" borsh "^0.7.0" - bs58 "^4.0.0" depd "^2.0.0" error-polyfill "^0.1.3" http-errors "^1.7.2" - js-sha256 "^0.9.0" - mustache "^4.0.0" + near-abi "0.1.1" node-fetch "^2.6.1" - text-encoding-utf-8 "^1.0.2" tweetnacl "^1.0.1" near-hd-key@^1.2.1: @@ -14058,6 +14215,11 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== + punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" @@ -14122,6 +14284,11 @@ query-string@7.1.1, query-string@^7.1.1: split-on-first "^1.0.0" strict-uri-encode "^2.0.0" +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -15356,6 +15523,16 @@ stream-combiner2@~1.1.1: duplexer2 "~0.1.0" readable-stream "^2.0.2" +stream-http@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.2.0.tgz#1872dfcf24cb15752677e40e5c3f9cc1926028b5" + integrity sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A== + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.4" + readable-stream "^3.6.0" + xtend "^4.0.2" + stream-shift@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" @@ -16293,6 +16470,14 @@ url-loader@^4.1.1: mime-types "^2.1.27" schema-utils "^3.0.0" +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ== + dependencies: + punycode "1.3.2" + querystring "0.2.0" + use-sync-external-store@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" @@ -16853,7 +17038,7 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xtend@~4.0.1: +xtend@^4.0.2, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==