From d5fa4515b4592fc416f7d6e7612213a8e25842a7 Mon Sep 17 00:00:00 2001 From: DamirSQA Date: Thu, 11 May 2023 14:13:53 +0200 Subject: [PATCH 1/3] Filter out "instant link" wallet types --- packages/modal-ui-js/src/lib/components/GetAWallet.ts | 6 +++++- packages/modal-ui/src/lib/components/WalletHome.tsx | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/modal-ui-js/src/lib/components/GetAWallet.ts b/packages/modal-ui-js/src/lib/components/GetAWallet.ts index bd7dde27d..9ca69290a 100644 --- a/packages/modal-ui-js/src/lib/components/GetAWallet.ts +++ b/packages/modal-ui-js/src/lib/components/GetAWallet.ts @@ -58,7 +58,11 @@ export async function renderGetAWallet() { `; const filterByType = (item: { type: string }) => { - return item.type !== "bridge" && item.type !== "hardware"; + return ( + item.type !== "bridge" && + item.type !== "hardware" && + item.type !== "instant-link" + ); }; const filteredModules = modalState.modules.filter(filterByType); diff --git a/packages/modal-ui/src/lib/components/WalletHome.tsx b/packages/modal-ui/src/lib/components/WalletHome.tsx index 04a701067..c35cb9834 100644 --- a/packages/modal-ui/src/lib/components/WalletHome.tsx +++ b/packages/modal-ui/src/lib/components/WalletHome.tsx @@ -31,7 +31,11 @@ export const WalletHome: React.FC = ({ useEffect(() => { const subscription = selector.store.observable.subscribe((state) => { const filterByType = (item: { type: string }) => { - return item.type !== "bridge" && item.type !== "hardware"; + return ( + item.type !== "bridge" && + item.type !== "hardware" && + item.type !== "instant-link" + ); }; const filteredModules = state.modules.filter(filterByType); @@ -113,6 +117,7 @@ export const WalletHome: React.FC = ({ })} )} + {route === "WalletInfo" && ( <>
From eac108339f4ecd1fabf4b597d8b501bec671ed7d Mon Sep 17 00:00:00 2001 From: Danny Cho Date: Thu, 18 May 2023 17:48:55 +1200 Subject: [PATCH 2/3] feat: Updated the onComplete props structure on export account --- .../react/contexts/WalletSelectorExportContext.tsx | 6 ++++-- .../src/lib/components/ExportAccount.tsx | 11 +++++++++-- packages/account-export/src/lib/index.types.ts | 7 ++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/examples/react/contexts/WalletSelectorExportContext.tsx b/examples/react/contexts/WalletSelectorExportContext.tsx index d5fc980b7..84465539d 100644 --- a/examples/react/contexts/WalletSelectorExportContext.tsx +++ b/examples/react/contexts/WalletSelectorExportContext.tsx @@ -95,8 +95,10 @@ export const ExportAccountSelectorContextProvider: React.FC<{ */ const _modal = setupExportSelectorModal(_selector, { accounts: [], - onComplete: (completedAccounts) => { - console.log("Transfer Completed: ", completedAccounts); + onComplete: (completeProps) => { + console.log( + `${completeProps.accounts} exported to ${completeProps.walletName}` + ); }, }); const state = _selector.store.getState(); diff --git a/packages/account-export/src/lib/components/ExportAccount.tsx b/packages/account-export/src/lib/components/ExportAccount.tsx index 97c8c3830..19334527a 100644 --- a/packages/account-export/src/lib/components/ExportAccount.tsx +++ b/packages/account-export/src/lib/components/ExportAccount.tsx @@ -24,6 +24,10 @@ import { Complete } from "./Complete"; import { encryptAccountData } from "../helpers"; +type CompleteProps = { + accounts: Array; + walletName: string; +}; interface ExportAccountProps { alertMessage: string | null; module?: ModuleState; @@ -33,7 +37,7 @@ interface ExportAccountProps { accounts: Array; selector: WalletSelector; wallet: ModuleState; - onComplete?: (accounts: Array) => void; + onComplete?: (object: CompleteProps) => void; } const EXPORT_ACCOUNT_STEPS = { @@ -300,7 +304,10 @@ export const ExportAccount: React.FC = ({ const onTransferComplete = () => { if (onComplete) { - onComplete(selectedAccounts); + onComplete({ + accounts: selectedAccounts, + walletName: module?.metadata.name || "Unknown", + }); } }; diff --git a/packages/account-export/src/lib/index.types.ts b/packages/account-export/src/lib/index.types.ts index 0765ad55c..fcb7249cd 100644 --- a/packages/account-export/src/lib/index.types.ts +++ b/packages/account-export/src/lib/index.types.ts @@ -5,11 +5,16 @@ import type { export type Theme = "dark" | "light" | "auto"; +type ExportSelectorOnCompleteParams = { + accounts: Array; + walletName: string; +}; + export interface ExportSelectorOptions { theme?: Theme; description?: string; accounts: Array; - onComplete?: (accounts: Array) => void; + onComplete?: (completeProps: ExportSelectorOnCompleteParams) => void; } export interface WalletSelectorModal { From 06ba21918366bda21b0ba527aba427390bf88606 Mon Sep 17 00:00:00 2001 From: DamirSQA Date: Thu, 18 May 2023 11:23:42 +0200 Subject: [PATCH 3/3] Bump version to 8.1.1 --- package.json | 2 +- packages/account-export/package.json | 2 +- packages/coin98-wallet/package.json | 2 +- packages/core/package.json | 2 +- packages/default-wallets/package.json | 2 +- packages/finer-wallet/package.json | 2 +- packages/here-wallet/package.json | 2 +- packages/ledger/package.json | 2 +- packages/math-wallet/package.json | 2 +- packages/meteor-wallet/package.json | 2 +- packages/modal-ui-js/package.json | 2 +- packages/modal-ui/package.json | 2 +- packages/my-near-wallet/package.json | 2 +- packages/narwallets/package.json | 2 +- packages/near-snap/package.json | 2 +- packages/near-wallet/package.json | 2 +- packages/nearfi/package.json | 2 +- packages/neth/package.json | 2 +- packages/nightly-connect/package.json | 2 +- packages/nightly/package.json | 2 +- packages/opto-wallet/package.json | 2 +- packages/sender/package.json | 2 +- packages/wallet-connect/package.json | 2 +- packages/wallet-utils/package.json | 2 +- packages/welldone-wallet/package.json | 2 +- packages/xdefi/package.json | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index ad267f490..613e49f04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "near-wallet-selector", - "version": "8.1.0", + "version": "8.1.1", "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", diff --git a/packages/account-export/package.json b/packages/account-export/package.json index 94b9630c6..fefbf766c 100644 --- a/packages/account-export/package.json +++ b/packages/account-export/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/account-export", - "version": "8.1.0", + "version": "8.1.1", "description": "This is the Export Selector UI package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/coin98-wallet/package.json b/packages/coin98-wallet/package.json index 16bd47aae..4257d96cb 100644 --- a/packages/coin98-wallet/package.json +++ b/packages/coin98-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/coin98-wallet", - "version": "8.1.0", + "version": "8.1.1", "description": "Coin 98 wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/core/package.json b/packages/core/package.json index 771aac3ad..efc4f2a94 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/core", - "version": "8.1.0", + "version": "8.1.1", "description": "This is the core package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/default-wallets/package.json b/packages/default-wallets/package.json index 5b2833d2c..9b92f19f4 100644 --- a/packages/default-wallets/package.json +++ b/packages/default-wallets/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/default-wallets", - "version": "8.1.0", + "version": "8.1.1", "description": "Default wallets package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/finer-wallet/package.json b/packages/finer-wallet/package.json index 11d4a03a6..0c27c8c31 100644 --- a/packages/finer-wallet/package.json +++ b/packages/finer-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/finer-wallet", - "version": "8.1.0", + "version": "8.1.1", "description": "FiNER Wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/here-wallet/package.json b/packages/here-wallet/package.json index 8ee90c4fa..449cbd675 100644 --- a/packages/here-wallet/package.json +++ b/packages/here-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/here-wallet", - "version": "8.1.0", + "version": "8.1.1", "description": "Here wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/ledger/package.json b/packages/ledger/package.json index 2b3c03f0e..3883dadb4 100644 --- a/packages/ledger/package.json +++ b/packages/ledger/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/ledger", - "version": "8.1.0", + "version": "8.1.1", "description": "Ledger package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/math-wallet/package.json b/packages/math-wallet/package.json index 9fbb89672..6f2482e3c 100644 --- a/packages/math-wallet/package.json +++ b/packages/math-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/math-wallet", - "version": "8.1.0", + "version": "8.1.1", "description": "Math wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/meteor-wallet/package.json b/packages/meteor-wallet/package.json index 75cd6ef0f..fa32dc465 100644 --- a/packages/meteor-wallet/package.json +++ b/packages/meteor-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/meteor-wallet", - "version": "8.1.0", + "version": "8.1.1", "description": "Meteor wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/modal-ui-js/package.json b/packages/modal-ui-js/package.json index 1ba6fb125..3592c9a81 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": "8.1.0", + "version": "8.1.1", "description": "Modal UI package for NEAR wallet Selector", "keywords": [ "near", diff --git a/packages/modal-ui/package.json b/packages/modal-ui/package.json index 7fc5d58bf..94a588597 100644 --- a/packages/modal-ui/package.json +++ b/packages/modal-ui/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/modal-ui", - "version": "8.1.0", + "version": "8.1.1", "description": "Modal UI package for NEAR wallet Selector", "keywords": [ "near", diff --git a/packages/my-near-wallet/package.json b/packages/my-near-wallet/package.json index f68b565bd..f98fa68cc 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": "8.1.0", + "version": "8.1.1", "description": "My Near Wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/narwallets/package.json b/packages/narwallets/package.json index f4fac0bcc..c9a153b52 100644 --- a/packages/narwallets/package.json +++ b/packages/narwallets/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/narwallets", - "version": "8.1.0", + "version": "8.1.1", "description": "This is the Narwallets package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/near-snap/package.json b/packages/near-snap/package.json index 71d8f07e9..b92f3b201 100644 --- a/packages/near-snap/package.json +++ b/packages/near-snap/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/near-snap", - "version": "8.1.0", + "version": "8.1.1", "description": "Metamask snap to interact with Near dapps.", "keywords": [ "near", diff --git a/packages/near-wallet/package.json b/packages/near-wallet/package.json index a3972418b..cb9e8e8ba 100644 --- a/packages/near-wallet/package.json +++ b/packages/near-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/near-wallet", - "version": "8.1.0", + "version": "8.1.1", "description": "Near Wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/nearfi/package.json b/packages/nearfi/package.json index 9e420c1a2..06418b7ed 100644 --- a/packages/nearfi/package.json +++ b/packages/nearfi/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/nearfi", - "version": "8.1.0", + "version": "8.1.1", "description": "Nearfi package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/neth/package.json b/packages/neth/package.json index fe059e116..670cb85f7 100644 --- a/packages/neth/package.json +++ b/packages/neth/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/neth", - "version": "8.1.0", + "version": "8.1.1", "description": "Control NEAR accounts with ETH accounts", "author": "mattlockyer", "keywords": [ diff --git a/packages/nightly-connect/package.json b/packages/nightly-connect/package.json index 1b245003f..9166b3ba1 100644 --- a/packages/nightly-connect/package.json +++ b/packages/nightly-connect/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/nightly-connect", - "version": "8.1.0", + "version": "8.1.1", "description": "Nightly connect package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/nightly/package.json b/packages/nightly/package.json index 31c2176d0..c344995bf 100644 --- a/packages/nightly/package.json +++ b/packages/nightly/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/nightly", - "version": "8.1.0", + "version": "8.1.1", "description": "Nightly wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/opto-wallet/package.json b/packages/opto-wallet/package.json index 90da3ae08..e0819391d 100644 --- a/packages/opto-wallet/package.json +++ b/packages/opto-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/opto-wallet", - "version": "8.1.0", + "version": "8.1.1", "description": "Opto wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/sender/package.json b/packages/sender/package.json index 7fe8e4742..a39ab0b1c 100644 --- a/packages/sender/package.json +++ b/packages/sender/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/sender", - "version": "8.1.0", + "version": "8.1.1", "description": "Sender wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/wallet-connect/package.json b/packages/wallet-connect/package.json index 75fc0cac2..6c23ab7c7 100644 --- a/packages/wallet-connect/package.json +++ b/packages/wallet-connect/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/wallet-connect", - "version": "8.1.0", + "version": "8.1.1", "description": "Wallet Connect package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/wallet-utils/package.json b/packages/wallet-utils/package.json index 650eddbe4..f235ce141 100644 --- a/packages/wallet-utils/package.json +++ b/packages/wallet-utils/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/wallet-utils", - "version": "8.1.0", + "version": "8.1.1", "description": "Wallet utils package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/welldone-wallet/package.json b/packages/welldone-wallet/package.json index effd42c21..cc0f9647c 100644 --- a/packages/welldone-wallet/package.json +++ b/packages/welldone-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/welldone-wallet", - "version": "8.1.0", + "version": "8.1.1", "description": "Welldone wallet package for NEAR Wallet Selector.", "keywords": [ "near", diff --git a/packages/xdefi/package.json b/packages/xdefi/package.json index 27f3323fd..a5d74dfae 100644 --- a/packages/xdefi/package.json +++ b/packages/xdefi/package.json @@ -1,6 +1,6 @@ { "name": "@near-wallet-selector/xdefi", - "version": "8.1.0", + "version": "8.1.1", "description": "This is the XDEFI package for NEAR Wallet Selector.", "keywords": [ "near",