@dynamic-labs-sdk/client 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{InvalidParamError-BYnLW_9s.native.esm.js → InvalidParamError-9kQBK3sP.native.esm.js} +2 -2
- package/dist/{InvalidParamError-BYnLW_9s.native.esm.js.map → InvalidParamError-9kQBK3sP.native.esm.js.map} +1 -1
- package/dist/{InvalidParamError-CEykJlaG.cjs → InvalidParamError-DQvZQdQ9.cjs} +3 -3
- package/dist/{InvalidParamError-CEykJlaG.cjs.map → InvalidParamError-DQvZQdQ9.cjs.map} +1 -1
- package/dist/{InvalidParamError-uluG140m.esm.js → InvalidParamError-Za4cvW7K.esm.js} +2 -2
- package/dist/{InvalidParamError-uluG140m.esm.js.map → InvalidParamError-Za4cvW7K.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-33QOxTKa.native.esm.js → NotWaasWalletAccountError-BTMvHTA8.native.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-33QOxTKa.native.esm.js.map → NotWaasWalletAccountError-BTMvHTA8.native.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-DmlwWvy0.esm.js → NotWaasWalletAccountError-By3Y4taq.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-DmlwWvy0.esm.js.map → NotWaasWalletAccountError-By3Y4taq.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-BNdbbGX7.cjs → NotWaasWalletAccountError-Ciq7b-Y6.cjs} +3 -3
- package/dist/{NotWaasWalletAccountError-BNdbbGX7.cjs.map → NotWaasWalletAccountError-Ciq7b-Y6.cjs.map} +1 -1
- package/dist/core.cjs +5 -5
- package/dist/core.esm.js +5 -5
- package/dist/core.native.esm.js +5 -5
- package/dist/exports/index.d.ts +3 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BOCwNNMm.cjs → getNetworkProviderFromNetworkId-BA0CHZzu.cjs} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-BOCwNNMm.cjs.map → getNetworkProviderFromNetworkId-BA0CHZzu.cjs.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-a0atbFHU.native.esm.js → getNetworkProviderFromNetworkId-COptFPwJ.native.esm.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-a0atbFHU.native.esm.js.map → getNetworkProviderFromNetworkId-COptFPwJ.native.esm.js.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-CS1GXEp6.esm.js → getNetworkProviderFromNetworkId-RWcIZDgC.esm.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-CS1GXEp6.esm.js.map → getNetworkProviderFromNetworkId-RWcIZDgC.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-B42gT4xk.cjs → getSignedSessionId-BCU987hO.cjs} +3 -3
- package/dist/{getSignedSessionId-B42gT4xk.cjs.map → getSignedSessionId-BCU987hO.cjs.map} +1 -1
- package/dist/{getSignedSessionId-zHtJOVpY.native.esm.js → getSignedSessionId-DzNCj6g_.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-zHtJOVpY.native.esm.js.map → getSignedSessionId-DzNCj6g_.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-D1Oh4604.esm.js → getSignedSessionId-la6RXITX.esm.js} +3 -3
- package/dist/{getSignedSessionId-D1Oh4604.esm.js.map → getSignedSessionId-la6RXITX.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-CEvtJ3xW.native.esm.js → getVerifiedCredentialForWalletAccount-DKJcLLHq.native.esm.js} +3 -2
- package/dist/getVerifiedCredentialForWalletAccount-DKJcLLHq.native.esm.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-B-IhZJuM.cjs → getVerifiedCredentialForWalletAccount-DSSDwOyq.cjs} +4 -3
- package/dist/getVerifiedCredentialForWalletAccount-DSSDwOyq.cjs.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-BkaECPL_.esm.js → getVerifiedCredentialForWalletAccount-Ozctwnyv.esm.js} +3 -2
- package/dist/getVerifiedCredentialForWalletAccount-Ozctwnyv.esm.js.map +1 -0
- package/dist/index.cjs +854 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +854 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +854 -20
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-G7SXCZ5L.esm.js → isMfaRequiredForAction-C1u4Z__n.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-G7SXCZ5L.esm.js.map → isMfaRequiredForAction-C1u4Z__n.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-CJvFP4oN.cjs → isMfaRequiredForAction-CMClgbT0.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-CJvFP4oN.cjs.map → isMfaRequiredForAction-CMClgbT0.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-BfabCDxI.native.esm.js → isMfaRequiredForAction-DSX-TV2z.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-BfabCDxI.native.esm.js.map → isMfaRequiredForAction-DSX-TV2z.native.esm.js.map} +1 -1
- package/dist/modules/balances/getBalances/getBalances.d.ts +22 -10
- package/dist/modules/balances/getBalances/getBalances.d.ts.map +1 -1
- package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts +6 -2
- package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts.map +1 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWalletForWalletConnect/index.d.ts +2 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/{shouldFilterWallet → shouldFilterWalletForWalletConnect}/index.d.ts.map +1 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWalletForWalletConnect/shouldFilterWalletForWalletConnect.d.ts +13 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWalletForWalletConnect/shouldFilterWalletForWalletConnect.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/priorityWalletKeys/priorityWalletKeys.d.ts +10 -0
- package/dist/modules/legacyWalletBook/priorityWalletKeys/priorityWalletKeys.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/shouldFilterWallet/index.d.ts +3 -0
- package/dist/modules/legacyWalletBook/shouldFilterWallet/index.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/shouldFilterWallet/shouldFilterWallet.d.ts +34 -0
- package/dist/modules/legacyWalletBook/shouldFilterWallet/shouldFilterWallet.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.d.ts +22 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/getInAppBrowserUrl.d.ts +18 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/getInAppBrowserUrl.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInstallationUrls/buildInstallationUrls.d.ts +21 -0
- package/dist/modules/walletOptionsCatalogue/buildInstallationUrls/buildInstallationUrls.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.d.ts +27 -0
- package/dist/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +23 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts +39 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.d.ts +54 -0
- package/dist/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/classifyWithWalletProviderSource/classifyWithWalletProviderSource.d.ts +31 -0
- package/dist/modules/walletOptionsCatalogue/classifyWithWalletProviderSource/classifyWithWalletProviderSource.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/compareByRelevance/compareByRelevance.d.ts +18 -0
- package/dist/modules/walletOptionsCatalogue/compareByRelevance/compareByRelevance.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/excludedWalletOptionKeys/excludedWalletOptionKeys.d.ts +15 -0
- package/dist/modules/walletOptionsCatalogue/excludedWalletOptionKeys/excludedWalletOptionKeys.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findByNameMatch/findByNameMatch.d.ts +21 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findByNameMatch/findByNameMatch.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findWalletOptionKeyForProviderKey.d.ts +44 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findWalletOptionKeyForProviderKey.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/resolveWalletOptionKey/resolveWalletOptionKey.d.ts +20 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/resolveWalletOptionKey/resolveWalletOptionKey.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getConnectionOptionPriority/getConnectionOptionPriority.d.ts +15 -0
- package/dist/modules/walletOptionsCatalogue/getConnectionOptionPriority/getConnectionOptionPriority.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getPriorityIndex/getPriorityIndex.d.ts +16 -0
- package/dist/modules/walletOptionsCatalogue/getPriorityIndex/getPriorityIndex.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +24 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.d.ts +49 -0
- package/dist/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/hasAnyConnectionOption/hasAnyConnectionOption.d.ts +18 -0
- package/dist/modules/walletOptionsCatalogue/hasAnyConnectionOption/hasAnyConnectionOption.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts +18 -0
- package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/normalizeWalletDisplayName/normalizeWalletDisplayName.d.ts +23 -0
- package/dist/modules/walletOptionsCatalogue/normalizeWalletDisplayName/normalizeWalletDisplayName.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.d.ts +22 -0
- package/dist/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.d.ts +20 -0
- package/dist/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.d.ts +34 -0
- package/dist/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +164 -0
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -0
- package/dist/modules/wallets/utils/stripChainSuffix/stripChainSuffix.d.ts +20 -0
- package/dist/modules/wallets/utils/stripChainSuffix/stripChainSuffix.d.ts.map +1 -0
- package/dist/modules/wallets/walletProviderRegistry/createWalletProviderRegistry/createWalletProviderRegistry.d.ts.map +1 -1
- package/dist/modules/wallets/walletProviderRegistry/index.d.ts +1 -1
- package/dist/modules/wallets/walletProviderRegistry/index.d.ts.map +1 -1
- package/dist/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.d.ts +19 -0
- package/dist/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.d.ts.map +1 -1
- package/dist/modules/wallets/walletProviderUriConnection.types.d.ts +23 -0
- package/dist/modules/wallets/walletProviderUriConnection.types.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/waas.cjs +6 -5
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +5 -4
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +5 -4
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +4 -4
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.native.esm.js +3 -3
- package/package.json +3 -3
- package/dist/getVerifiedCredentialForWalletAccount-B-IhZJuM.cjs.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-BkaECPL_.esm.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-CEvtJ3xW.native.esm.js.map +0 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWallet/index.d.ts +0 -2
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWallet/shouldFilterWallet.d.ts +0 -21
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWallet/shouldFilterWallet.d.ts.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WalletOption } from '../walletOptionsCatalogue.types';
|
|
2
|
+
type CompareByRelevanceParams = {
|
|
3
|
+
a: WalletOption;
|
|
4
|
+
b: WalletOption;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Compares two wallet options for relevance ordering: priority-list index
|
|
8
|
+
* first, then alphabetical-by-name as the tie-break. Suitable for passing
|
|
9
|
+
* straight to `Array.prototype.sort`.
|
|
10
|
+
*
|
|
11
|
+
* @param params.a - First wallet option.
|
|
12
|
+
* @param params.b - Second wallet option.
|
|
13
|
+
* @returns Negative when `a` ranks first, positive when `b` ranks first.
|
|
14
|
+
* @not-instrumented
|
|
15
|
+
*/
|
|
16
|
+
export declare const compareByRelevance: ({ a, b, }: CompareByRelevanceParams) => number;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=compareByRelevance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareByRelevance.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/compareByRelevance/compareByRelevance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,KAAK,wBAAwB,GAAG;IAC9B,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,YAAY,CAAC;CACjB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,cAG5B,wBAAwB,KAAG,MAS7B,CAAC"}
|
package/dist/modules/walletOptionsCatalogue/excludedWalletOptionKeys/excludedWalletOptionKeys.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet option keys `getWalletOptionsCatalogue` drops before returning.
|
|
3
|
+
* Curated, product-level suppression.
|
|
4
|
+
*
|
|
5
|
+
* Example: Base Account SDK is the recommended entry point for
|
|
6
|
+
* Coinbase-managed users, so the legacy Coinbase Wallet entries are
|
|
7
|
+
* suppressed in favor of the SDK-backed `baseaccount` tile. Both the
|
|
8
|
+
* wallet book group key (`coinbase`) and the normalized display-name
|
|
9
|
+
* key (`coinbasewallet`) are listed so suppression holds regardless of
|
|
10
|
+
* how the resolver lands on a key.
|
|
11
|
+
*
|
|
12
|
+
* Used in: `getWalletOptionsCatalogue`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const EXCLUDED_WALLET_OPTION_KEYS: ReadonlySet<string>;
|
|
15
|
+
//# sourceMappingURL=excludedWalletOptionKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excludedWalletOptionKeys.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/excludedWalletOptionKeys/excludedWalletOptionKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,EAAE,WAAW,CAAC,MAAM,CAG1D,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { WalletBookSchema } from '../../../legacyWalletBook/legacyWalletBook.types';
|
|
2
|
+
type FindByNameMatchParams = {
|
|
3
|
+
candidate: string;
|
|
4
|
+
walletBook: WalletBookSchema;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Looks for a wallet book entry whose `name` or `shortName` normalizes to
|
|
8
|
+
* the same string as `candidate`. Used as a fallback by
|
|
9
|
+
* `findWalletOptionKeyForProviderKey` for providers whose
|
|
10
|
+
* `walletProviderKey` strips down to a value that does not match any
|
|
11
|
+
* `walletBook.wallets` key directly (e.g. an extension whose display name
|
|
12
|
+
* happens to match the wallet's `shortName` instead of its book key).
|
|
13
|
+
*
|
|
14
|
+
* @param params.candidate - The lowercased, chain-suffix-stripped candidate.
|
|
15
|
+
* @param params.walletBook - The fetched wallet book.
|
|
16
|
+
* @returns The matching wallet book wallet key, or `undefined`.
|
|
17
|
+
* @not-instrumented
|
|
18
|
+
*/
|
|
19
|
+
export declare const findByNameMatch: ({ candidate, walletBook, }: FindByNameMatchParams) => string | undefined;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=findByNameMatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findByNameMatch.d.ts","sourceRoot":"","sources":["../../../../../src/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findByNameMatch/findByNameMatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAEzF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AAKF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,+BAGzB,qBAAqB,KAAG,MAAM,GAAG,SAWnC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Chain } from '../../chain';
|
|
2
|
+
import type { WalletBookSchema } from '../../legacyWalletBook/legacyWalletBook.types';
|
|
3
|
+
import type { WalletProvider } from '../../wallets/walletProvider/walletProvider.types';
|
|
4
|
+
type FindWalletOptionKeyForProviderKeyParams = {
|
|
5
|
+
chain: Chain;
|
|
6
|
+
walletBook: WalletBookSchema;
|
|
7
|
+
walletProvider: WalletProvider;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a registered wallet provider to the wallet option key it should
|
|
11
|
+
* be bucketed under. Always returns a key — providers with no wallet book
|
|
12
|
+
* match fall back to their self-announced `metadata.displayName`, so the
|
|
13
|
+
* catalogue surfaces them as self-described tiles instead of silently
|
|
14
|
+
* dropping them.
|
|
15
|
+
*
|
|
16
|
+
* Resolution order (each step short-circuits on first hit):
|
|
17
|
+
*
|
|
18
|
+
* 1. **Direct wallet book lookup with chain suffix** — try
|
|
19
|
+
* `walletBook.wallets[normalizedWalletNameWithChain]` as-is. Wallet
|
|
20
|
+
* book entries are inconsistent about whether they keep the chain
|
|
21
|
+
* suffix (e.g. `metamaskevm`) or strip it (e.g. `metamask`), so try
|
|
22
|
+
* the suffixed form first.
|
|
23
|
+
* 2. **Direct wallet book lookup without chain suffix** — strip the
|
|
24
|
+
* suffix and retry.
|
|
25
|
+
* 3. **Name match heuristic with chain suffix** — scan
|
|
26
|
+
* `walletBook.wallets` for an entry whose normalized `name` or
|
|
27
|
+
* `shortName` equals the suffixed candidate.
|
|
28
|
+
* 4. **Name match heuristic without chain suffix** — same scan on the
|
|
29
|
+
* stripped candidate.
|
|
30
|
+
* 5. **Display-name fallback** — derive a stable key from
|
|
31
|
+
* `walletProvider.metadata.displayName` via
|
|
32
|
+
* {@link normalizeWalletDisplayName}. Multi-chain registrations of the
|
|
33
|
+
* same self-described wallet (e.g. Phantom on EVM and Solana) collapse
|
|
34
|
+
* onto the same tile because each announces the same display name.
|
|
35
|
+
*
|
|
36
|
+
* @param params.chain - The provider's chain (used to strip the suffix).
|
|
37
|
+
* @param params.walletBook - The fetched wallet book.
|
|
38
|
+
* @param params.walletProvider - The registered wallet provider.
|
|
39
|
+
* @returns The wallet option key for this provider.
|
|
40
|
+
* @not-instrumented
|
|
41
|
+
*/
|
|
42
|
+
export declare const findWalletOptionKeyForProviderKey: ({ chain, walletBook, walletProvider, }: FindWalletOptionKeyForProviderKeyParams) => string;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=findWalletOptionKeyForProviderKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findWalletOptionKeyForProviderKey.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findWalletOptionKeyForProviderKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAGtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AAKxF,KAAK,uCAAuC,GAAG;IAC7C,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,gBAAgB,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,iCAAiC,2CAI3C,uCAAuC,KAAG,MAoC5C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WalletBookSchema } from '../../../legacyWalletBook/legacyWalletBook.types';
|
|
2
|
+
type ResolveWalletOptionKeyParams = {
|
|
3
|
+
fallback: string;
|
|
4
|
+
wallet: WalletBookSchema['wallets'][string];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Picks the wallet option (group) key for a wallet book wallet. The wallet
|
|
8
|
+
* book carries the group association under a few different field names
|
|
9
|
+
* (`group`, `chainGroup`, `walletGroup`) depending on the wallet's
|
|
10
|
+
* provenance — this helper centralises the lookup. When none of those
|
|
11
|
+
* fields are set, the wallet key itself acts as its own wallet option key.
|
|
12
|
+
*
|
|
13
|
+
* @param params.fallback - Wallet key to return if no group field is set.
|
|
14
|
+
* @param params.wallet - The wallet book wallet entry.
|
|
15
|
+
* @returns The resolved wallet option key.
|
|
16
|
+
* @not-instrumented
|
|
17
|
+
*/
|
|
18
|
+
export declare const resolveWalletOptionKey: ({ fallback, wallet, }: ResolveWalletOptionKeyParams) => string;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=resolveWalletOptionKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveWalletOptionKey.d.ts","sourceRoot":"","sources":["../../../../../src/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/resolveWalletOptionKey/resolveWalletOptionKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAEzF,KAAK,4BAA4B,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,0BAGhC,4BAA4B,KAAG,MACmC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WalletConnectionOption } from '../walletOptionsCatalogue.types';
|
|
2
|
+
type GetConnectionOptionPriorityParams = {
|
|
3
|
+
option: WalletConnectionOption;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Returns the numeric priority of a `WalletConnectionOption` for sorting.
|
|
7
|
+
* Lower numbers rank first.
|
|
8
|
+
*
|
|
9
|
+
* @param params.option - The connection option to inspect.
|
|
10
|
+
* @returns The numeric priority — lower is better.
|
|
11
|
+
* @not-instrumented
|
|
12
|
+
*/
|
|
13
|
+
export declare const getConnectionOptionPriority: ({ option, }: GetConnectionOptionPriorityParams) => number;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=getConnectionOptionPriority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getConnectionOptionPriority.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/getConnectionOptionPriority/getConnectionOptionPriority.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAiB9E,KAAK,iCAAiC,GAAG;IACvC,MAAM,EAAE,sBAAsB,CAAC;CAChC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,gBAErC,iCAAiC,KAAG,MACE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WalletOption } from '../walletOptionsCatalogue.types';
|
|
2
|
+
type GetPriorityIndexParams = {
|
|
3
|
+
walletOption: WalletOption;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Returns the index of a wallet option in `PRIORITY_WALLET_KEYS`, or
|
|
7
|
+
* `Number.POSITIVE_INFINITY` when the wallet is not in the hand-curated
|
|
8
|
+
* priority list. Lower index = higher priority.
|
|
9
|
+
*
|
|
10
|
+
* @param params.walletOption - The wallet option to inspect.
|
|
11
|
+
* @returns Numeric priority index — lower is better.
|
|
12
|
+
* @not-instrumented
|
|
13
|
+
*/
|
|
14
|
+
export declare const getPriorityIndex: ({ walletOption, }: GetPriorityIndexParams) => number;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=getPriorityIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPriorityIndex.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/getPriorityIndex/getPriorityIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,KAAK,sBAAsB,GAAG;IAC5B,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,sBAE1B,sBAAsB,KAAG,MAI3B,CAAC"}
|
package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GetWalletOptionsCatalogueParams, WalletOptionsCatalogue } from '../walletOptionsCatalogue.types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a catalogue of the external wallet options a user can sign in
|
|
4
|
+
* with through this client. Each wallet option carries an ordered
|
|
5
|
+
* `connectionOptions` array — `withWalletProvider` (direct), `walletConnect`
|
|
6
|
+
* (deeplink/QR), or `inAppBrowser` (mobile webview). Wallet options without
|
|
7
|
+
* any matching connections are omitted.
|
|
8
|
+
*
|
|
9
|
+
* `includeWithWalletProvider` defaults to `true`; all other inclusion flags
|
|
10
|
+
* are opt-in. `walletOptionOrdering` defaults to `'relevance'` (Dynamic's
|
|
11
|
+
* recommended order); pass `'alphabetical'` to sort by wallet option name
|
|
12
|
+
* within each option-priority tier.
|
|
13
|
+
*
|
|
14
|
+
* The wallet book is fetched only when an enabled flag needs it
|
|
15
|
+
* (`includeWalletConnect`, `includeInAppBrowser`). Calls that only need
|
|
16
|
+
* `includeWithWalletProvider` skip the fetch entirely.
|
|
17
|
+
*
|
|
18
|
+
* @param [params] - Inclusion flags + ordering preference.
|
|
19
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
20
|
+
* @returns A promise that resolves to the wallet options catalogue.
|
|
21
|
+
* @not-instrumented
|
|
22
|
+
*/
|
|
23
|
+
export declare const getWalletOptionsCatalogue: (params?: GetWalletOptionsCatalogueParams, client?: import("../../../exports").DynamicClient) => Promise<WalletOptionsCatalogue>;
|
|
24
|
+
//# sourceMappingURL=getWalletOptionsCatalogue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWalletOptionsCatalogue.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,+BAA+B,EAG/B,sBAAsB,EACvB,MAAM,iCAAiC,CAAC;AAIzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB,YAC5B,+BAA+B,wDAEtC,OAAO,CAAC,sBAAsB,CA8EhC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { WithWalletProviderDisplayOverride } from '../buildWithWalletProviderOptions/buildWithWalletProviderOptions';
|
|
2
|
+
import type { WalletConnectionOption } from '../walletOptionsCatalogue.types';
|
|
3
|
+
/**
|
|
4
|
+
* A `connectionOption` tagged with the wallet option key it belongs under.
|
|
5
|
+
* Transformer outputs produce these; the catalogue groups them by
|
|
6
|
+
* `walletOptionKey` before building wallet option shells.
|
|
7
|
+
*
|
|
8
|
+
* `displayOverride` is set only by the `withWalletProvider` transformer,
|
|
9
|
+
* carrying the provider's self-announced `name` + `iconUrl`. The shell
|
|
10
|
+
* builder applies it on top of any wallet book entry — provider
|
|
11
|
+
* metadata wins over book branding.
|
|
12
|
+
*/
|
|
13
|
+
export type ConnectionOptionForWalletOption = {
|
|
14
|
+
displayOverride?: WithWalletProviderDisplayOverride;
|
|
15
|
+
option: WalletConnectionOption;
|
|
16
|
+
walletOptionKey: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Bucket of grouped options for a single wallet option key, plus the
|
|
20
|
+
* first-seen display override (if any). Returned by
|
|
21
|
+
* `groupOptionsByWalletOption` for the catalogue to feed into the shell
|
|
22
|
+
* builder.
|
|
23
|
+
*/
|
|
24
|
+
export type GroupedWalletOption = {
|
|
25
|
+
connectionOptions: WalletConnectionOption[];
|
|
26
|
+
displayOverride?: WithWalletProviderDisplayOverride;
|
|
27
|
+
};
|
|
28
|
+
type GroupOptionsByWalletOptionParams = {
|
|
29
|
+
options: ConnectionOptionForWalletOption[];
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Buckets tagged connection options by their wallet option key. Preserves
|
|
33
|
+
* first-seen order so that the caller's choice of
|
|
34
|
+
* `walletOptionOrdering: 'relevance'` naturally inherits the upstream input
|
|
35
|
+
* order (wallet book order for walletConnect/inAppBrowser/installation,
|
|
36
|
+
* registry order for withWalletProvider).
|
|
37
|
+
*
|
|
38
|
+
* Carries through the first-seen `displayOverride` per wallet option
|
|
39
|
+
* key, so the shell builder can apply provider-announced metadata on
|
|
40
|
+
* top of any wallet book entry.
|
|
41
|
+
*
|
|
42
|
+
* @param params.options - The tagged options to group.
|
|
43
|
+
* @returns A map from wallet option key to its grouped option bucket,
|
|
44
|
+
* iterable in first-seen order.
|
|
45
|
+
* @not-instrumented
|
|
46
|
+
*/
|
|
47
|
+
export declare const groupOptionsByWalletOption: ({ options, }: GroupOptionsByWalletOptionParams) => Map<string, GroupedWalletOption>;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=groupOptionsByWalletOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupOptionsByWalletOption.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,kEAAkE,CAAC;AAC1H,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E;;;;;;;;;GASG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,eAAe,CAAC,EAAE,iCAAiC,CAAC;IACpD,MAAM,EAAE,sBAAsB,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,iBAAiB,EAAE,sBAAsB,EAAE,CAAC;IAC5C,eAAe,CAAC,EAAE,iCAAiC,CAAC;CACrD,CAAC;AAEF,KAAK,gCAAgC,GAAG;IACtC,OAAO,EAAE,+BAA+B,EAAE,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,0BAA0B,iBAEpC,gCAAgC,KAAG,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAoBpE,CAAC"}
|
package/dist/modules/walletOptionsCatalogue/hasAnyConnectionOption/hasAnyConnectionOption.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WalletOption } from '../walletOptionsCatalogue.types';
|
|
2
|
+
type HasAnyConnectionOptionParams = {
|
|
3
|
+
walletOption: WalletOption;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* True when the wallet option has at least one connection — i.e. the user
|
|
7
|
+
* can sign in right now. Install-only wallet options surface in the
|
|
8
|
+
* catalogue too (they carry `installationUrls`) but have an empty
|
|
9
|
+
* `connectionOptions` array; this predicate distinguishes them from
|
|
10
|
+
* actually connectable wallets in the relevance sort.
|
|
11
|
+
*
|
|
12
|
+
* @param params.walletOption - The wallet option to inspect.
|
|
13
|
+
* @returns True when `connectionOptions` is non-empty.
|
|
14
|
+
* @not-instrumented
|
|
15
|
+
*/
|
|
16
|
+
export declare const hasAnyConnectionOption: ({ walletOption, }: HasAnyConnectionOptionParams) => boolean;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=hasAnyConnectionOption.d.ts.map
|
package/dist/modules/walletOptionsCatalogue/hasAnyConnectionOption/hasAnyConnectionOption.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasAnyConnectionOption.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/hasAnyConnectionOption/hasAnyConnectionOption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,KAAK,4BAA4B,GAAG;IAClC,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,sBAEhC,4BAA4B,KAAG,OACS,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WalletOption } from '../walletOptionsCatalogue.types';
|
|
2
|
+
type HasInstalledProviderParams = {
|
|
3
|
+
walletOption: WalletOption;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* True when the wallet option has a `withWalletProvider` connection — i.e.
|
|
7
|
+
* the user already has the wallet available in the page (browser extension,
|
|
8
|
+
* Wallet Standard announcement, window injection, or an SDK-backed provider
|
|
9
|
+
* one of our chain extensions registered). `connectionOptions` is
|
|
10
|
+
* pre-sorted, so a registered provider always sits at index 0 when present.
|
|
11
|
+
*
|
|
12
|
+
* @param params.walletOption - The wallet option to inspect.
|
|
13
|
+
* @returns True when an installed provider is available.
|
|
14
|
+
* @not-instrumented
|
|
15
|
+
*/
|
|
16
|
+
export declare const hasInstalledProvider: ({ walletOption, }: HasInstalledProviderParams) => boolean;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=hasInstalledProvider.d.ts.map
|
package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasInstalledProvider.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,KAAK,0BAA0B,GAAG;IAChC,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,sBAE9B,0BAA0B,KAAG,OACkC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a wallet's self-announced `displayName` into a stable wallet
|
|
3
|
+
* option key. Used by `findWalletOptionKeyForProviderKey` as the off-book
|
|
4
|
+
* fallback — registered providers whose `walletProviderKey` does not
|
|
5
|
+
* resolve to any wallet book entry still surface in the catalogue under a
|
|
6
|
+
* key derived from the name they ship in their metadata.
|
|
7
|
+
*
|
|
8
|
+
* The normalization (lowercase + whitespace-strip) intentionally matches
|
|
9
|
+
* how the legacy wallet book composes its `wallets.<key>` keys, so a
|
|
10
|
+
* self-described provider's option will merge cleanly with its book entry
|
|
11
|
+
* if one ever lands later.
|
|
12
|
+
*
|
|
13
|
+
* Multi-chain registrations of the same wallet (e.g. Phantom announced via
|
|
14
|
+
* EIP-6963 on EVM and via Wallet Standard on Solana) collapse onto the
|
|
15
|
+
* same wallet option through this normalization, since each registration
|
|
16
|
+
* announces the same `displayName`.
|
|
17
|
+
*
|
|
18
|
+
* @param displayName - The provider's `metadata.displayName`.
|
|
19
|
+
* @returns The normalized wallet option key (lowercased, no whitespace).
|
|
20
|
+
* @not-instrumented
|
|
21
|
+
*/
|
|
22
|
+
export declare const normalizeWalletDisplayName: (displayName: string) => string;
|
|
23
|
+
//# sourceMappingURL=normalizeWalletDisplayName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeWalletDisplayName.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/normalizeWalletDisplayName/normalizeWalletDisplayName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,0BAA0B,gBAAiB,MAAM,KAAG,MAClB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WalletSchema } from '../../legacyWalletBook/legacyWalletBook.types';
|
|
2
|
+
type ResolveWalletBookWalletOptionKeyParams = {
|
|
3
|
+
wallet: WalletSchema;
|
|
4
|
+
walletKey: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Resolves which wallet option (group) a wallet book entry belongs to. Used
|
|
8
|
+
* by the catalogue's wallet-book-driven transformers (`walletConnect`,
|
|
9
|
+
* `inAppBrowser`, `installation`) to bucket their emitted options.
|
|
10
|
+
*
|
|
11
|
+
* Wallet book entries inconsistently use `group` / `chainGroup` /
|
|
12
|
+
* `walletGroup` for the same idea. The wallet key itself acts as the wallet
|
|
13
|
+
* option key when no group field is set.
|
|
14
|
+
*
|
|
15
|
+
* @param params.wallet - The wallet entry.
|
|
16
|
+
* @param params.walletKey - The wallet's key in `walletBook.wallets`.
|
|
17
|
+
* @returns The wallet option key.
|
|
18
|
+
* @not-instrumented
|
|
19
|
+
*/
|
|
20
|
+
export declare const resolveWalletBookWalletOptionKey: ({ wallet, walletKey, }: ResolveWalletBookWalletOptionKeyParams) => string;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=resolveWalletBookWalletOptionKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveWalletBookWalletOptionKey.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAElF,KAAK,sCAAsC,GAAG;IAC5C,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC,2BAG1C,sCAAsC,KAAG,MAC0B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WalletConnectionOption } from '../walletOptionsCatalogue.types';
|
|
2
|
+
type SortConnectionOptionsParams = {
|
|
3
|
+
options: WalletConnectionOption[];
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Sorts a wallet option's `connectionOptions` so the most preferred option lands at
|
|
7
|
+
* index 0. Primary sort is by option-type priority
|
|
8
|
+
* (`withWalletProvider` > `walletConnect` > `inAppBrowser`);
|
|
9
|
+
* within a type, ties break alphabetically by `chain` for deterministic
|
|
10
|
+
* output across calls.
|
|
11
|
+
*
|
|
12
|
+
* Returns a new array — the input is not mutated.
|
|
13
|
+
*
|
|
14
|
+
* @param params.options - The options to sort.
|
|
15
|
+
* @returns A new array in priority order.
|
|
16
|
+
* @not-instrumented
|
|
17
|
+
*/
|
|
18
|
+
export declare const sortConnectionOptions: ({ options, }: SortConnectionOptionsParams) => WalletConnectionOption[];
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=sortConnectionOptions.d.ts.map
|
package/dist/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortConnectionOptions.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E,KAAK,2BAA2B,GAAG;IACjC,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,iBAE/B,2BAA2B,KAAG,sBAAsB,EAWnD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { WalletOption, WalletOptionOrdering } from '../walletOptionsCatalogue.types';
|
|
2
|
+
type SortWalletOptionsParams = {
|
|
3
|
+
ordering: WalletOptionOrdering;
|
|
4
|
+
walletOptions: WalletOption[];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Sorts the outer wallet-option list. This is the only ordering controlled
|
|
8
|
+
* by the customer; the inner `connectionOptions` array of each wallet
|
|
9
|
+
* option is ordered separately by `sortConnectionOptions` using a fixed
|
|
10
|
+
* option-type priority.
|
|
11
|
+
*
|
|
12
|
+
* - `'relevance'` (default): bucket wallet options into three tiers, in
|
|
13
|
+
* this order:
|
|
14
|
+
* 1. **Installed provider** — user already has the wallet available
|
|
15
|
+
* (`withWalletProvider` at index 0).
|
|
16
|
+
* 2. **Connectable** — has at least one connection (`walletConnect`
|
|
17
|
+
* or `inAppBrowser`) but no installed provider.
|
|
18
|
+
* 3. **Install-only** — no connection at all; only `installationUrls`.
|
|
19
|
+
* Within each tier, rank by the hand-curated {@link PRIORITY_WALLET_KEYS}
|
|
20
|
+
* list (MetaMask, Coinbase, Phantom, …); unknown wallets fall through to
|
|
21
|
+
* alphabetical-by-name order at the tail of their tier.
|
|
22
|
+
* - `'alphabetical'`: case-insensitive sort by wallet option `name`,
|
|
23
|
+
* without bucketing.
|
|
24
|
+
*
|
|
25
|
+
* Returns a new array — the input is not mutated.
|
|
26
|
+
*
|
|
27
|
+
* @param params.walletOptions - The wallet options to sort.
|
|
28
|
+
* @param params.ordering - The requested ordering.
|
|
29
|
+
* @returns A new array in the requested order.
|
|
30
|
+
* @not-instrumented
|
|
31
|
+
*/
|
|
32
|
+
export declare const sortWalletOptions: ({ walletOptions, ordering, }: SortWalletOptionsParams) => WalletOption[];
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=sortWalletOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortWalletOptions.d.ts","sourceRoot":"","sources":["../../../../src/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAEzC,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,iBAAiB,iCAG3B,uBAAuB,KAAG,YAAY,EA0BxC,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { Chain } from '../chain';
|
|
2
|
+
/**
|
|
3
|
+
* Identifies where a registered wallet provider came from. Used as the
|
|
4
|
+
* `source` discriminator on `WithWalletProviderConnectionOption` so customer
|
|
5
|
+
* UIs can label "browser extension" vs "wallet SDK" without having to inspect
|
|
6
|
+
* the registered provider's metadata.
|
|
7
|
+
*
|
|
8
|
+
* - `selfAnnounced`: announced via an in-page self-announcement standard
|
|
9
|
+
* (EIP-6963 on EVM, Wallet Standard on Solana / Sui / …).
|
|
10
|
+
* - `windowInjected`: legacy `window.*` injection (e.g. `window.ethereum`).
|
|
11
|
+
* - `sdk`: registered by a chain extension that wraps a vendor SDK
|
|
12
|
+
* (Base Account via `@base-org/account`, MetaMask Connect, etc.).
|
|
13
|
+
*/
|
|
14
|
+
export type WithWalletProviderSource = 'selfAnnounced' | 'windowInjected' | 'sdk';
|
|
15
|
+
/**
|
|
16
|
+
* A wallet that the customer can connect to directly through a registered
|
|
17
|
+
* wallet provider. The customer resolves the live provider via
|
|
18
|
+
* `getWalletProviderByKey({ key: walletProviderKey })`, then calls
|
|
19
|
+
* `.connect()` / `.signMessage()` / etc. on it.
|
|
20
|
+
*
|
|
21
|
+
* `walletProviderKey` follows the standard format produced by
|
|
22
|
+
* `formatWalletProviderKey`:
|
|
23
|
+
* `<normalizedWalletNameWithChain>:<walletProviderType>[:<suffix>]`.
|
|
24
|
+
*/
|
|
25
|
+
export type WithWalletProviderConnectionOption = {
|
|
26
|
+
chain: Chain;
|
|
27
|
+
source: WithWalletProviderSource;
|
|
28
|
+
type: 'withWalletProvider';
|
|
29
|
+
walletProviderKey: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A WalletConnect-capable wallet. Carries deeplinks only; the customer drives
|
|
33
|
+
* the WC pairing flow themselves by calling the chain-level
|
|
34
|
+
* `connectWithWalletConnect<Chain>` function, then appending the resulting WC
|
|
35
|
+
* URI onto one of the deeplinks via `appendWalletConnectUriToDeepLink`.
|
|
36
|
+
*
|
|
37
|
+
* The `WalletConnectWalletProvider` is only created after session approval,
|
|
38
|
+
* so there is no provider key to attach to the option at catalogue-build time.
|
|
39
|
+
*/
|
|
40
|
+
export type WalletConnectConnectionOption = {
|
|
41
|
+
chain: Chain;
|
|
42
|
+
deeplinks: {
|
|
43
|
+
/** Native deeplink scheme (e.g. `metamask://`). */
|
|
44
|
+
native?: string;
|
|
45
|
+
/** Universal link (e.g. `https://metamask.app.link`). */
|
|
46
|
+
universal?: string;
|
|
47
|
+
};
|
|
48
|
+
type: 'walletConnect';
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* A mobile wallet that exposes an in-app browser entry URL. The URL is a
|
|
52
|
+
* template (e.g. `https://go.base.app/dapp?cb_url={{encodedDappURI}}`) — the
|
|
53
|
+
* customer substitutes `{{encodedDappURI}}` with the encoded current dapp URL
|
|
54
|
+
* before opening it.
|
|
55
|
+
*/
|
|
56
|
+
export type InAppBrowserConnectionOption = {
|
|
57
|
+
chain: Chain;
|
|
58
|
+
type: 'inAppBrowser';
|
|
59
|
+
url: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Install / download links for a wallet option whose product can be
|
|
63
|
+
* installed by the user on this device. Surfaced on `WalletOption` when
|
|
64
|
+
* `includeInstallation: true` is passed to `getWalletOptionsCatalogue`.
|
|
65
|
+
*
|
|
66
|
+
* Installation is intentionally not a `WalletConnectionOption` — the user
|
|
67
|
+
* cannot "connect" with an install link, and rendering it inline with
|
|
68
|
+
* real connection actions misleads them. Each platform's URL is optional
|
|
69
|
+
* and only present when the wallet book carries the corresponding store
|
|
70
|
+
* ID.
|
|
71
|
+
*/
|
|
72
|
+
export type InstallationUrls = {
|
|
73
|
+
android?: string;
|
|
74
|
+
chrome?: string;
|
|
75
|
+
edge?: string;
|
|
76
|
+
firefox?: string;
|
|
77
|
+
ios?: string;
|
|
78
|
+
native?: string;
|
|
79
|
+
opera?: string;
|
|
80
|
+
safari?: string;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* One option for connecting to a wallet option. Each `WalletOption`
|
|
84
|
+
* carries an ordered array of these; the first element is always "the
|
|
85
|
+
* best available connection" by the priority documented on
|
|
86
|
+
* `getWalletOptionsCatalogue`.
|
|
87
|
+
*/
|
|
88
|
+
export type WalletConnectionOption = WithWalletProviderConnectionOption | WalletConnectConnectionOption | InAppBrowserConnectionOption;
|
|
89
|
+
/**
|
|
90
|
+
* A wallet option surfaced by `getWalletOptionsCatalogue` — one wallet the
|
|
91
|
+
* user can sign in with (MetaMask, Coinbase, Phantom, …). A wallet option
|
|
92
|
+
* surfaces when it has at least one `connectionOption` OR a populated
|
|
93
|
+
* `installationUrls` bag — install-only wallets (no connection available
|
|
94
|
+
* but the user can install the product) are surfaced with empty
|
|
95
|
+
* `connectionOptions` so the customer UI can render the install links
|
|
96
|
+
* distinctly.
|
|
97
|
+
*/
|
|
98
|
+
export type WalletOption = {
|
|
99
|
+
/**
|
|
100
|
+
* Ordered connection options for this wallet. Sorted by option-type
|
|
101
|
+
* priority (`withWalletProvider` > `walletConnect` > `inAppBrowser`),
|
|
102
|
+
* then by chain for stability. May be empty when only
|
|
103
|
+
* `installationUrls` are available.
|
|
104
|
+
*/
|
|
105
|
+
connectionOptions: WalletConnectionOption[];
|
|
106
|
+
/** Full URL to the wallet's icon. */
|
|
107
|
+
iconUrl: string;
|
|
108
|
+
/**
|
|
109
|
+
* Install / download links for this wallet. Present when
|
|
110
|
+
* `includeInstallation: true` is passed to `getWalletOptionsCatalogue`
|
|
111
|
+
* and the wallet book carries at least one store ID / desktop URL for
|
|
112
|
+
* the wallet. The customer UI should render these as install actions,
|
|
113
|
+
* distinct from `connectionOptions`.
|
|
114
|
+
*/
|
|
115
|
+
installationUrls?: InstallationUrls;
|
|
116
|
+
/** Stable key from the wallet book (e.g. `"metamask"`). */
|
|
117
|
+
key: string;
|
|
118
|
+
/** Display name for the wallet. */
|
|
119
|
+
name: string;
|
|
120
|
+
/** Brand color in hex (e.g. `"#f6851b"`). */
|
|
121
|
+
primaryColor?: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Controls how wallet options are ordered in the returned catalogue.
|
|
125
|
+
*
|
|
126
|
+
* - `'relevance'` (default): Dynamic's recommended order.
|
|
127
|
+
* - `'alphabetical'`: case-insensitive by wallet option `name`.
|
|
128
|
+
*/
|
|
129
|
+
export type WalletOptionOrdering = 'relevance' | 'alphabetical';
|
|
130
|
+
/**
|
|
131
|
+
* Parameters for `getWalletOptionsCatalogue`.
|
|
132
|
+
*
|
|
133
|
+
* Only `includeWithWalletProvider` defaults to `true`. The remaining flags
|
|
134
|
+
* are opt-in — call sites that want WalletConnect or in-app-browser options
|
|
135
|
+
* must request them explicitly.
|
|
136
|
+
*/
|
|
137
|
+
export type GetWalletOptionsCatalogueParams = {
|
|
138
|
+
/** Defaults to `false`. Mobile in-app browser launch URL. */
|
|
139
|
+
includeInAppBrowser?: boolean;
|
|
140
|
+
/** Defaults to `false`. Install / download links for wallets the user doesn't have yet. */
|
|
141
|
+
includeInstallation?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Defaults to `false`. Meant to be used alongside our WalletConnect chain
|
|
144
|
+
* extensions (`addWalletConnectEvmExtension`,
|
|
145
|
+
* `addWalletConnectSolanaExtension`, …) so the WC pairing flow has
|
|
146
|
+
* something to connect to once the user picks a wallet from the catalogue.
|
|
147
|
+
*/
|
|
148
|
+
includeWalletConnect?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Defaults to `true`. Use this for users who already have the wallet
|
|
151
|
+
* available in the page — browser extensions discovered via EIP-6963,
|
|
152
|
+
* Wallet Standard, legacy window injection, or one of our SDK-backed
|
|
153
|
+
* providers (Base Account, MetaMask Connect, …).
|
|
154
|
+
*/
|
|
155
|
+
includeWithWalletProvider?: boolean;
|
|
156
|
+
/** Defaults to `'relevance'`. See {@link WalletOptionOrdering}. */
|
|
157
|
+
walletOptionOrdering?: WalletOptionOrdering;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Return type of `getWalletOptionsCatalogue` — an ordered array of wallet
|
|
161
|
+
* options. See {@link WalletOptionOrdering} for ordering details.
|
|
162
|
+
*/
|
|
163
|
+
export type WalletOptionsCatalogue = WalletOption[];
|
|
164
|
+
//# sourceMappingURL=walletOptionsCatalogue.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walletOptionsCatalogue.types.d.ts","sourceRoot":"","sources":["../../../src/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,wBAAwB,GAChC,eAAe,GACf,gBAAgB,GAChB,KAAK,CAAC;AAEV;;;;;;;;;GASG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,wBAAwB,CAAC;IACjC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE;QACT,mDAAmD;QACnD,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,yDAAyD;QACzD,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAC9B,kCAAkC,GAClC,6BAA6B,GAC7B,4BAA4B,CAAC;AAEjC;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;OAKG;IACH,iBAAiB,EAAE,sBAAsB,EAAE,CAAC;IAC5C,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAC;IACZ,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,cAAc,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,2FAA2F;IAC3F,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mEAAmE;IACnE,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Chain } from '../../../chain';
|
|
2
|
+
type StripChainSuffixParams = {
|
|
3
|
+
chain: Chain;
|
|
4
|
+
normalizedName: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Removes the lowercased chain suffix that `normalizeWalletNameWithChain`
|
|
8
|
+
* appends. Used by `findWalletOptionKeyForProviderKey` to recover the wallet
|
|
9
|
+
* book wallet key candidate from a `walletProviderKey`. If the suffix is
|
|
10
|
+
* not present (some chain extensions already bake the chain into the
|
|
11
|
+
* display name), the input is returned unchanged.
|
|
12
|
+
*
|
|
13
|
+
* @param params.chain - The chain whose suffix should be stripped.
|
|
14
|
+
* @param params.normalizedName - The normalized wallet-name-with-chain string.
|
|
15
|
+
* @returns The name with the chain suffix removed, or the input unchanged.
|
|
16
|
+
* @not-instrumented
|
|
17
|
+
*/
|
|
18
|
+
export declare const stripChainSuffix: ({ chain, normalizedName, }: StripChainSuffixParams) => string;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=stripChainSuffix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripChainSuffix.d.ts","sourceRoot":"","sources":["../../../../../src/modules/wallets/utils/stripChainSuffix/stripChainSuffix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,+BAG1B,sBAAsB,KAAG,MAQ3B,CAAC"}
|