@dynamic-labs-sdk/client 1.31.2 → 1.33.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/{apiClient-d2qJyIvx.native.esm.js → apiClient-4r7VAsLC.native.esm.js} +45 -12
- package/dist/apiClient-4r7VAsLC.native.esm.js.map +1 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/core.cjs +79 -76
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +79 -78
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +77 -76
- package/dist/core.native.esm.js.map +1 -1
- package/dist/errors/AmbiguousWalletChainError.d.ts +7 -9
- package/dist/errors/AmbiguousWalletChainError.d.ts.map +1 -1
- package/dist/errors/ConnectionUriHandlerMissingError.d.ts +10 -12
- package/dist/errors/ConnectionUriHandlerMissingError.d.ts.map +1 -1
- package/dist/errors/NoConnectionOptionAvailableError.d.ts +2 -2
- package/dist/errors/UnexpectedConsentResponseError.d.ts +7 -0
- package/dist/errors/UnexpectedConsentResponseError.d.ts.map +1 -0
- package/dist/errors/WalletBrowserRedirectHandlerMissingError.d.ts +39 -0
- package/dist/errors/WalletBrowserRedirectHandlerMissingError.d.ts.map +1 -0
- package/dist/errors/WalletOptionNotFoundError.d.ts +3 -3
- package/dist/exports/core.d.ts +2 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +7 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/waas.d.ts +2 -1
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-DF9kPibD.native.esm.js → getNetworkProviderFromNetworkId-BV229QF3.native.esm.js} +107 -14
- package/dist/getNetworkProviderFromNetworkId-BV229QF3.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-D9nx6Od5.esm.js → getNetworkProviderFromNetworkId-D9oRzWA6.esm.js} +111 -18
- package/dist/getNetworkProviderFromNetworkId-D9oRzWA6.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-DueBnAl6.cjs → getNetworkProviderFromNetworkId-DOrcvuFv.cjs} +111 -12
- package/dist/getNetworkProviderFromNetworkId-DOrcvuFv.cjs.map +1 -0
- package/dist/{getSignedSessionId-B5oxmSTs.cjs → getSignedSessionId-4qHh_BOh.cjs} +3 -3
- package/dist/{getSignedSessionId-B5oxmSTs.cjs.map → getSignedSessionId-4qHh_BOh.cjs.map} +1 -1
- package/dist/{getSignedSessionId-5q4uyZsv.native.esm.js → getSignedSessionId-Cd8CCp5d.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-5q4uyZsv.native.esm.js.map → getSignedSessionId-Cd8CCp5d.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-BKfQycNo.esm.js → getSignedSessionId-DA-MMsJm.esm.js} +3 -3
- package/dist/{getSignedSessionId-BKfQycNo.esm.js.map → getSignedSessionId-DA-MMsJm.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Bx0HlvfW.cjs → getVerifiedCredentialForWalletAccount-Bw5q7QZn.cjs} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-Bx0HlvfW.cjs.map → getVerifiedCredentialForWalletAccount-Bw5q7QZn.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-_3MExyld.esm.js → getVerifiedCredentialForWalletAccount-Fr3bEKeU.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-_3MExyld.esm.js.map → getVerifiedCredentialForWalletAccount-Fr3bEKeU.esm.js.map} +1 -1
- package/dist/highLevelFunctions/connectWalletOption/connectWalletOption.d.ts +55 -0
- package/dist/highLevelFunctions/connectWalletOption/connectWalletOption.d.ts.map +1 -0
- package/dist/highLevelFunctions/connectWalletOption/connectWalletOption.types.d.ts +46 -0
- package/dist/highLevelFunctions/connectWalletOption/connectWalletOption.types.d.ts.map +1 -0
- package/dist/highLevelFunctions/connectWalletOption/index.d.ts +2 -0
- package/dist/highLevelFunctions/connectWalletOption/index.d.ts.map +1 -0
- package/dist/index.cjs +930 -815
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +925 -814
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +923 -812
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-BDmY2_Sj.esm.js → isMfaRequiredForAction-BdU62usM.esm.js} +3 -9
- package/dist/{isMfaRequiredForAction-BDmY2_Sj.esm.js.map → isMfaRequiredForAction-BdU62usM.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-BrRCSvEX.native.esm.js → isMfaRequiredForAction-DZfEkyIU.native.esm.js} +3 -9
- package/dist/{isMfaRequiredForAction-BrRCSvEX.native.esm.js.map → isMfaRequiredForAction-DZfEkyIU.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DnKzPDZk.cjs → isMfaRequiredForAction-Djd-jkSl.cjs} +3 -9
- package/dist/{isMfaRequiredForAction-DnKzPDZk.cjs.map → isMfaRequiredForAction-Djd-jkSl.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-D1-QluDm.esm.js → isUserOnboardingComplete-BEZOYohA.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-D1-QluDm.esm.js.map → isUserOnboardingComplete-BEZOYohA.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-7GzNYU2g.cjs → isUserOnboardingComplete-Bwvv6Urs.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-7GzNYU2g.cjs.map → isUserOnboardingComplete-Bwvv6Urs.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-BfMMBtkF.native.esm.js → isUserOnboardingComplete-CEUkAzCi.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-BfMMBtkF.native.esm.js.map → isUserOnboardingComplete-CEUkAzCi.native.esm.js.map} +1 -1
- package/dist/{logoutWithReason-C_T7KddM.cjs → logoutWithReason-B-ZF0VmN.cjs} +57 -18
- package/dist/logoutWithReason-B-ZF0VmN.cjs.map +1 -0
- package/dist/{logoutWithReason-3UICYir7.native.esm.js → logoutWithReason-DvnEa2Uv.native.esm.js} +3 -9
- package/dist/{logoutWithReason-3UICYir7.native.esm.js.map → logoutWithReason-DvnEa2Uv.native.esm.js.map} +1 -1
- package/dist/{logoutWithReason-CHyuBHdx.esm.js → logoutWithReason-I6vShLpA.esm.js} +46 -19
- package/dist/logoutWithReason-I6vShLpA.esm.js.map +1 -0
- package/dist/{migrateFromFireblocks-DJt9bktR.native.esm.js → migrateFromFireblocks-6I7lkraQ.native.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-DJt9bktR.native.esm.js.map → migrateFromFireblocks-6I7lkraQ.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-C9Kuke5V.cjs → migrateFromFireblocks-C23-24bK.cjs} +2 -2
- package/dist/{migrateFromFireblocks-C9Kuke5V.cjs.map → migrateFromFireblocks-C23-24bK.cjs.map} +1 -1
- package/dist/{migrateFromFireblocks-BMO3u6rO.esm.js → migrateFromFireblocks-Dtk6t8hN.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-BMO3u6rO.esm.js.map → migrateFromFireblocks-Dtk6t8hN.esm.js.map} +1 -1
- package/dist/modules/funding/coinbase/getCoinbaseAccounts/getCoinbaseAccounts.d.ts +1 -1
- package/dist/modules/funding/coinbase/getCoinbaseBuyUrl/getCoinbaseBuyUrl.d.ts +1 -1
- package/dist/modules/funding/kraken/getKrakenAccounts/getKrakenAccounts.d.ts +1 -1
- package/dist/modules/funding/kraken/getKrakenWhitelistedAddresses/getKrakenWhitelistedAddresses.d.ts +1 -1
- package/dist/modules/sessionKeys/signBusinessAccountIntent/signBusinessAccountIntent.d.ts +95 -0
- package/dist/modules/sessionKeys/signBusinessAccountIntent/signBusinessAccountIntent.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +3 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +15 -6
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +7 -3
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +115 -2
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/isBusinessAccountActionRequired/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/isBusinessAccountActionRequired/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/isBusinessAccountActionRequired/isBusinessAccountActionRequired.d.ts +27 -0
- package/dist/modules/waas/businessAccounts/isBusinessAccountActionRequired/isBusinessAccountActionRequired.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts +13 -6
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts.map +1 -1
- package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
- package/dist/modules/waas/waas.types.d.ts +5 -2
- package/dist/modules/waas/waas.types.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/buildWalletBookConnectionOptions/buildWalletBookConnectionOptions.d.ts +42 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletBookConnectionOptions/buildWalletBookConnectionOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +7 -1
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/deriveSupportedChains/deriveSupportedChains.d.ts +27 -0
- package/dist/modules/walletOptionsCatalogue/deriveSupportedChains/deriveSupportedChains.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +4 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/isWalletExtensionInstalled/index.d.ts +3 -0
- package/dist/modules/walletOptionsCatalogue/isWalletExtensionInstalled/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/isWalletExtensionInstalled/isWalletExtensionInstalled.d.ts +35 -0
- package/dist/modules/walletOptionsCatalogue/isWalletExtensionInstalled/isWalletExtensionInstalled.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.d.ts +1 -1
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +7 -0
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -1
- package/dist/modules/wallets/connectWithUriConnectionOption/connectWithUriConnectionOption.d.ts +6 -5
- package/dist/modules/wallets/connectWithUriConnectionOption/connectWithUriConnectionOption.d.ts.map +1 -1
- package/dist/modules/wallets/redirectToInAppBrowser/redirectToInAppBrowser.d.ts +3 -3
- package/dist/modules/wallets/resolveWalletConnectionOption/resolveWalletConnectionOption.d.ts +2 -2
- package/dist/modules/wallets/resolveWalletConnectionOption/resolveWalletConnectionOption.d.ts.map +1 -1
- package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterChains/getUriConnectionStarterChains.d.ts +27 -0
- package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterChains/getUriConnectionStarterChains.d.ts.map +1 -0
- package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterChains/index.d.ts +2 -0
- package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterChains/index.d.ts.map +1 -0
- package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts.map +1 -1
- package/dist/modules/wallets/walletConnectionHandlers.types.d.ts +62 -0
- package/dist/modules/wallets/walletConnectionHandlers.types.d.ts.map +1 -0
- package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts +6 -5
- package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts.map +1 -1
- package/dist/services/instrumentation/resolveInstrumentationCore/index.d.ts +2 -0
- package/dist/services/instrumentation/resolveInstrumentationCore/index.d.ts.map +1 -0
- package/dist/services/instrumentation/resolveInstrumentationCore/resolveInstrumentationCore.d.ts +19 -0
- package/dist/services/instrumentation/resolveInstrumentationCore/resolveInstrumentationCore.d.ts.map +1 -0
- package/dist/services/instrumentation/transports/createDynamicTransport/createDynamicTransport.d.ts +4 -3
- package/dist/services/instrumentation/transports/createDynamicTransport/createDynamicTransport.d.ts.map +1 -1
- package/dist/services/realtime/createRealtimeService/createRealtimeService.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/getCurrentPageUrl/getCurrentPageUrl.d.ts +15 -0
- package/dist/utils/getCurrentPageUrl/getCurrentPageUrl.d.ts.map +1 -0
- package/dist/utils/getCurrentPageUrl/index.d.ts +2 -0
- package/dist/utils/getCurrentPageUrl/index.d.ts.map +1 -0
- package/dist/utils/isScreeningBlockedError/index.d.ts +2 -0
- package/dist/utils/isScreeningBlockedError/index.d.ts.map +1 -0
- package/dist/utils/isScreeningBlockedError/isScreeningBlockedError.d.ts +24 -0
- package/dist/utils/isScreeningBlockedError/isScreeningBlockedError.d.ts.map +1 -0
- package/dist/{waas-Bxsd0-HG.cjs → waas-C0IDCf3u.cjs} +81 -18
- package/dist/waas-C0IDCf3u.cjs.map +1 -0
- package/dist/{waas-9QajYGeK.native.esm.js → waas-DJeW02-Y.native.esm.js} +77 -20
- package/dist/waas-DJeW02-Y.native.esm.js.map +1 -0
- package/dist/{waas-T_dHXyI9.esm.js → waas-D_alZrtb.esm.js} +77 -20
- package/dist/waas-D_alZrtb.esm.js.map +1 -0
- package/dist/waas.cjs +5 -4
- package/dist/waas.esm.js +5 -5
- package/dist/waas.native.esm.js +5 -5
- package/dist/waasCore.cjs +8 -6
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +8 -6
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +8 -6
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +5 -4
- package/dist/apiClient-d2qJyIvx.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-D9nx6Od5.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DF9kPibD.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DueBnAl6.cjs.map +0 -1
- package/dist/logoutWithReason-CHyuBHdx.esm.js.map +0 -1
- package/dist/logoutWithReason-C_T7KddM.cjs.map +0 -1
- package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts +0 -18
- package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts.map +0 -1
- package/dist/modules/wallets/connectWallet.types.d.ts +0 -35
- package/dist/modules/wallets/connectWallet.types.d.ts.map +0 -1
- package/dist/waas-9QajYGeK.native.esm.js.map +0 -1
- package/dist/waas-Bxsd0-HG.cjs.map +0 -1
- package/dist/waas-T_dHXyI9.esm.js.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { a as TransactionBroadcastError, i as NotWaasWalletAccountError } from "./migrateFromFireblocks-
|
|
3
|
-
import {
|
|
4
|
-
import { A as
|
|
5
|
-
import { n as getWalletProviderByKey, t as getVerifiedCredentialForWalletAccount } from "./getVerifiedCredentialForWalletAccount-
|
|
6
|
-
import { a as WaasRbacStaleRetryUnsafeError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasOnboardingIncompleteError, r as isDeviceRegistrationRequired, s as WaasLoadFailedError, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-
|
|
7
|
-
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { $ as fetchAndStoreNonces, Dt as name, Et as TokenScope, F as offEvent, G as normalizeAddress, H as getChainFromVerifiedCredentialChain, I as onEvent, J as isUserMissingMfaAuth, K as splitWalletProviderKey, L as onceEvent, M as WalletProviderPriority, N as getWalletProviderRegistry, Ot as version, P as emitEvent, Q as getNonce, S as checkAndRaiseWalletAccountsChangedEvent, St as setDefaultClient, Tt as BaseError, U as CHAINS_INFO_MAP, W as formatWalletAccountId, _ as updateAuthFromVerifyResponse, _t as ValueMustBeDefinedError, a as retryOnFail, at as MfaRateLimitedError, b as decodeJwt, bt as getPlatform, c as createApiClient, ct as InvalidExternalAuthError, d as instrumentFunction, dt as DYNAMIC_ICONIC_SPRITE_URL, et as updateNoncePoolStorage, f as scrubParameters, g as extractSessionId, gt as assertDefined, h as getOperatingSystem, ht as isCookieEnabled, i as isSignedIn, it as SandboxMaximumThresholdReachedError, j as getWalletProviders, l as __refreshAuth_wrapped, lt as APIError, m as getUserAgent, n as generateSessionKeys, nt as NONCE_POOL_SIZE, o as getWalletProviderFromWalletAccount, ot as MfaInvalidOtpError, p as DEFAULT_PII_FIELDS, pt as SDK_API_CORE_VERSION, r as fetchProjectSettings, rt as UnauthorizedError, s as NoWalletProviderFoundError, st as LinkCredentialError, t as __logoutWithReason_wrapped, tt as createStorageKeySchema, u as resolveInstrumentationCore, v as upsertElevatedAccessToken, vt as getElevatedAccessToken, w as initializeWaasClientsForEagerRecovery, wt as getCore, x as InvalidParamError, xt as getDefaultClient, y as parseElevatedAccessToken, yt as randomString, z as getWalletAccounts } from "./logoutWithReason-I6vShLpA.esm.js";
|
|
2
|
+
import { a as TransactionBroadcastError, i as NotWaasWalletAccountError } from "./migrateFromFireblocks-Dtk6t8hN.esm.js";
|
|
3
|
+
import { $ as WaasChainEnum } from "./waas-D_alZrtb.esm.js";
|
|
4
|
+
import { A as createLogger, B as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, C as MergeAccountsConfirmationError, D as createKeychainService, E as assertSafeDeeplinkUrl, F as createDeferredPromise, G as createStorage, H as getBuffer, I as createAppForegroundSubscriber, J as isServerSideRendering, L as FETCH_PROJECT_SETTINGS_TRACKER_KEY, M as createCrossTabBroadcast, O as assertSafeNavigationUrl, P as CannotTrackError, R as GENERATE_SESSION_KEYS_TRACKER_KEY, S as NoNetworkProvidersError, T as createRealtimeService, U as subscribeWithSelector, V as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, W as isEqualShallow, Y as UnavailableInServerSideError, _ as MethodNotImplementedError, a as removeUnverifiedWalletAccount, b as WalletScreeningBlockedError, c as getAppMetadata, d as setUnverifiedWalletAccounts, f as createVisit, g as __setCaptchaToken_wrapped, h as hasExtension, i as verifyMessageSignatureOwnership, j as createEventEmitter, l as reconcileWalletAccountsAgainstClient, m as getNetworkProviderBuilderRegistry, o as createSignInMessageStatement, p as getUriConnectionStarterRegistry, q as createLocalStorageAdapter, r as getNetworksData, s as formatSignInMessage, t as getNetworkProviderFromNetworkId, u as updateWalletProviderKeysForVerifiedCredentials, v as consumeCaptchaToken, w as getKeychainIndexedDBName, x as WalletAlreadyLinkedToAnotherUserError, y as isCaptchaRequired, z as INITIALIZE_STORAGE_SYNC_TRACKER_KEY } from "./getNetworkProviderFromNetworkId-D9oRzWA6.esm.js";
|
|
5
|
+
import { n as getWalletProviderByKey, t as getVerifiedCredentialForWalletAccount } from "./getVerifiedCredentialForWalletAccount-Fr3bEKeU.esm.js";
|
|
6
|
+
import { a as WaasRbacStaleRetryUnsafeError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasOnboardingIncompleteError, r as isDeviceRegistrationRequired, s as WaasLoadFailedError, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-BEZOYohA.esm.js";
|
|
7
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-BdU62usM.esm.js";
|
|
8
8
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
9
9
|
import { AuthModeEnum, CaptchaProviderEnum as CaptchaProviderEnum$1, ChainEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum as JwtVerifiedCredentialFormatEnum$1, MFAAction as MFAAction$1, MfaBackupCodeAcknowledgement, ProviderEnum as ProviderEnum$1, TokenScope as TokenScope$1, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
10
10
|
import * as z from "zod/mini";
|
|
11
|
-
import { EventEmitter } from "eventemitter3";
|
|
11
|
+
import { EventEmitter as EventEmitter$1 } from "eventemitter3";
|
|
12
12
|
import { browserSupportsWebAuthn, startAuthentication, startRegistration } from "@simplewebauthn/browser";
|
|
13
13
|
|
|
14
14
|
//#region src/modules/state/raiseStateEvents/events.ts
|
|
@@ -411,13 +411,7 @@ const __refreshUser_impl = refreshUser;
|
|
|
411
411
|
const __refreshUser_wrapped = instrumentFunction({
|
|
412
412
|
fn: __refreshUser_impl,
|
|
413
413
|
functionName: "refreshUser",
|
|
414
|
-
getCore:
|
|
415
|
-
try {
|
|
416
|
-
return getCore(getDefaultClient());
|
|
417
|
-
} catch {
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
}
|
|
414
|
+
getCore: resolveInstrumentationCore
|
|
421
415
|
});
|
|
422
416
|
|
|
423
417
|
//#endregion
|
|
@@ -608,13 +602,7 @@ const __initializeClient_impl = initializeClient;
|
|
|
608
602
|
const __initializeClient_wrapped = instrumentFunction({
|
|
609
603
|
fn: __initializeClient_impl,
|
|
610
604
|
functionName: "initializeClient",
|
|
611
|
-
getCore:
|
|
612
|
-
try {
|
|
613
|
-
return getCore(getDefaultClient());
|
|
614
|
-
} catch {
|
|
615
|
-
return;
|
|
616
|
-
}
|
|
617
|
-
}
|
|
605
|
+
getCore: resolveInstrumentationCore
|
|
618
606
|
});
|
|
619
607
|
|
|
620
608
|
//#endregion
|
|
@@ -631,7 +619,7 @@ const createAsyncTrack = () => {
|
|
|
631
619
|
* This ensures no process is missed (as it would throw when tracked on a different node tick).
|
|
632
620
|
*/
|
|
633
621
|
let isTrackEnabled = true;
|
|
634
|
-
const eventEmitter = new EventEmitter();
|
|
622
|
+
const eventEmitter = new EventEmitter$1();
|
|
635
623
|
const allSettledPromise = createDeferredPromise();
|
|
636
624
|
const tracker = /* @__PURE__ */ new Map();
|
|
637
625
|
/**
|
|
@@ -777,8 +765,9 @@ const LOGS_BASE_URL = "https://logs.dynamicauth.com/api/v1";
|
|
|
777
765
|
* synchronous tick are coalesced into one request, avoiding a round-trip per
|
|
778
766
|
* event.
|
|
779
767
|
*
|
|
780
|
-
* Fetch errors are swallowed to prevent an instrumentation
|
|
781
|
-
* triggering another instrumentation event and causing an
|
|
768
|
+
* Fetch and serialization errors are swallowed to prevent an instrumentation
|
|
769
|
+
* failure from triggering another instrumentation event and causing an
|
|
770
|
+
* infinite loop.
|
|
782
771
|
*
|
|
783
772
|
* Works in both browser and SSR environments — fetch is injected and
|
|
784
773
|
* queueMicrotask is available in Node.js >= 11.
|
|
@@ -792,11 +781,13 @@ const createDynamicTransport = (params) => {
|
|
|
792
781
|
const events = queue.splice(0);
|
|
793
782
|
if (events.length === 0) return;
|
|
794
783
|
const url = `${LOGS_BASE_URL}/${params.environmentId}`;
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
784
|
+
try {
|
|
785
|
+
params.fetch(url, {
|
|
786
|
+
body: JSON.stringify(events),
|
|
787
|
+
headers: { "Content-Type": "application/json" },
|
|
788
|
+
method: "POST"
|
|
789
|
+
}).catch(() => {});
|
|
790
|
+
} catch {}
|
|
800
791
|
};
|
|
801
792
|
return { log: (event) => {
|
|
802
793
|
queue.push(event);
|
|
@@ -1194,20 +1185,14 @@ const __createDynamicClient_impl = createDynamicClient;
|
|
|
1194
1185
|
const __createDynamicClient_wrapped = instrumentFunction({
|
|
1195
1186
|
fn: __createDynamicClient_impl,
|
|
1196
1187
|
functionName: "createDynamicClient",
|
|
1197
|
-
getCore:
|
|
1198
|
-
try {
|
|
1199
|
-
return getCore(getDefaultClient());
|
|
1200
|
-
} catch {
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1188
|
+
getCore: resolveInstrumentationCore
|
|
1204
1189
|
});
|
|
1205
1190
|
|
|
1206
1191
|
//#endregion
|
|
1207
1192
|
//#region src/errors/AmbiguousWalletChainError.ts
|
|
1208
1193
|
/**
|
|
1209
1194
|
* Thrown when a wallet can be connected on more than one of the client's
|
|
1210
|
-
* enabled chains and no chain was passed to `
|
|
1195
|
+
* enabled chains and no chain was passed to `connectWalletOption`.
|
|
1211
1196
|
*
|
|
1212
1197
|
* Multi-chain wallets such as MetaMask or Phantom connect to a different
|
|
1213
1198
|
* account per chain, so the chain has to be an explicit choice rather than one
|
|
@@ -1215,15 +1200,13 @@ const __createDynamicClient_wrapped = instrumentFunction({
|
|
|
1215
1200
|
*
|
|
1216
1201
|
* @example
|
|
1217
1202
|
* ```ts
|
|
1218
|
-
*
|
|
1219
|
-
*
|
|
1220
|
-
*
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1223
|
-
* }
|
|
1224
|
-
* }
|
|
1203
|
+
* // Throws, since Phantom connects on both SOL and EVM
|
|
1204
|
+
* await connectWalletOption({ walletKey: 'phantom' });
|
|
1205
|
+
*
|
|
1206
|
+
* // Connects the wallet's Solana account
|
|
1207
|
+
* await connectWalletOption({ chain: 'SOL', walletKey: 'phantom' });
|
|
1225
1208
|
* ```
|
|
1226
|
-
* @see
|
|
1209
|
+
* @see connectWalletOption
|
|
1227
1210
|
* @see getWalletOptionsCatalogue
|
|
1228
1211
|
*/
|
|
1229
1212
|
var AmbiguousWalletChainError = class extends BaseError {
|
|
@@ -1401,6 +1384,48 @@ var CoinbaseTravelRuleRequiredError = class extends BaseError {
|
|
|
1401
1384
|
}
|
|
1402
1385
|
};
|
|
1403
1386
|
|
|
1387
|
+
//#endregion
|
|
1388
|
+
//#region src/errors/ConnectionUriHandlerMissingError.ts
|
|
1389
|
+
/**
|
|
1390
|
+
* Thrown when the only connection path for a wallet is a URI pairing and no
|
|
1391
|
+
* `onConnectionUri` handler was passed to `connectWalletOption`.
|
|
1392
|
+
*
|
|
1393
|
+
* The pairing URI has to reach the user — as a QR code on desktop, or by opening
|
|
1394
|
+
* the wallet's deeplink on mobile — for the wallet to be able to
|
|
1395
|
+
* approve the connection.
|
|
1396
|
+
*
|
|
1397
|
+
* @example
|
|
1398
|
+
* ```ts
|
|
1399
|
+
* // Throws, since the wallet can only be reached through a URI pairing
|
|
1400
|
+
* await connectWalletOption({ walletKey: 'trust' });
|
|
1401
|
+
*
|
|
1402
|
+
* // Connects, once the user approves the pairing
|
|
1403
|
+
* await connectWalletOption({
|
|
1404
|
+
* onConnectionUri: ({ uri }) => renderQrCode(uri),
|
|
1405
|
+
* walletKey: 'trust',
|
|
1406
|
+
* });
|
|
1407
|
+
* ```
|
|
1408
|
+
* @see connectWalletOption
|
|
1409
|
+
* @see ConnectionUriHandlerParams
|
|
1410
|
+
*/
|
|
1411
|
+
var ConnectionUriHandlerMissingError = class extends BaseError {
|
|
1412
|
+
constructor({ chain, type, walletKey }) {
|
|
1413
|
+
super({
|
|
1414
|
+
cause: null,
|
|
1415
|
+
code: "connection_uri_handler_missing",
|
|
1416
|
+
docsUrl: null,
|
|
1417
|
+
metaMessages: [
|
|
1418
|
+
`Wallet key: ${walletKey}`,
|
|
1419
|
+
`Chain: ${chain}`,
|
|
1420
|
+
`URI connection type: ${type}`,
|
|
1421
|
+
"Pass onConnectionUri to render the pairing URI it hands you as a QR code, or to open it as a link on mobile."
|
|
1422
|
+
],
|
|
1423
|
+
name: "ConnectionUriHandlerMissingError",
|
|
1424
|
+
shortMessage: `Connecting to ${walletKey} requires a URI pairing, so the onConnectionUri param is required.`
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1404
1429
|
//#endregion
|
|
1405
1430
|
//#region src/errors/DeeplinkConnectAndVerifyUnsupportedError.ts
|
|
1406
1431
|
var DeeplinkConnectAndVerifyUnsupportedError = class extends BaseError {
|
|
@@ -1655,14 +1680,14 @@ var NoAddressFoundError = class extends BaseError {
|
|
|
1655
1680
|
* @example
|
|
1656
1681
|
* ```ts
|
|
1657
1682
|
* try {
|
|
1658
|
-
* await
|
|
1683
|
+
* await connectWalletOption({ walletKey: 'rainbow' });
|
|
1659
1684
|
* } catch (error) {
|
|
1660
1685
|
* if (error instanceof NoConnectionOptionAvailableError) {
|
|
1661
1686
|
* promptWalletInstall(error.installationUrls);
|
|
1662
1687
|
* }
|
|
1663
1688
|
* }
|
|
1664
1689
|
* ```
|
|
1665
|
-
* @see
|
|
1690
|
+
* @see connectWalletOption
|
|
1666
1691
|
* @see getWalletOptionsCatalogue
|
|
1667
1692
|
*/
|
|
1668
1693
|
var NoConnectionOptionAvailableError = class extends BaseError {
|
|
@@ -1884,10 +1909,57 @@ var WalletAccountNotSelectedError = class extends BaseError {
|
|
|
1884
1909
|
}
|
|
1885
1910
|
};
|
|
1886
1911
|
|
|
1912
|
+
//#endregion
|
|
1913
|
+
//#region src/errors/WalletBrowserRedirectHandlerMissingError.ts
|
|
1914
|
+
/**
|
|
1915
|
+
* Thrown when the connection option resolved for a wallet is its in-app
|
|
1916
|
+
* browser, no `handleWalletBrowserRedirect` handler was passed to
|
|
1917
|
+
* `connectWalletOption`, and there is no current page URL to redirect into
|
|
1918
|
+
* that browser — as on React Native and during server-side rendering.
|
|
1919
|
+
*
|
|
1920
|
+
* That path connects by reloading your app inside the wallet's own browser,
|
|
1921
|
+
* so it needs the URL of the page to reload.
|
|
1922
|
+
*
|
|
1923
|
+
* @example
|
|
1924
|
+
* ```ts
|
|
1925
|
+
* // Throws on React Native, where there is no page URL to reuse
|
|
1926
|
+
* await connectWalletOption({ walletKey: 'coinbase' });
|
|
1927
|
+
*
|
|
1928
|
+
* // Connects, redirecting into the wallet's browser
|
|
1929
|
+
* await connectWalletOption({
|
|
1930
|
+
* handleWalletBrowserRedirect: ({ chain, walletKey }) =>
|
|
1931
|
+
* redirectToInAppBrowser({
|
|
1932
|
+
* appUrl: 'https://mydapp.xyz/login',
|
|
1933
|
+
* chain,
|
|
1934
|
+
* walletKey,
|
|
1935
|
+
* }),
|
|
1936
|
+
* walletKey: 'coinbase',
|
|
1937
|
+
* });
|
|
1938
|
+
* ```
|
|
1939
|
+
* @see connectWalletOption
|
|
1940
|
+
* @see redirectToInAppBrowser
|
|
1941
|
+
*/
|
|
1942
|
+
var WalletBrowserRedirectHandlerMissingError = class extends BaseError {
|
|
1943
|
+
constructor({ chain, walletKey }) {
|
|
1944
|
+
super({
|
|
1945
|
+
cause: null,
|
|
1946
|
+
code: "wallet_browser_redirect_handler_missing",
|
|
1947
|
+
docsUrl: null,
|
|
1948
|
+
metaMessages: [
|
|
1949
|
+
`Wallet key: ${walletKey}`,
|
|
1950
|
+
`Chain: ${chain}`,
|
|
1951
|
+
"Pass handleWalletBrowserRedirect and call redirectToInAppBrowser from it with the URL of the page to reload inside the wallet's browser."
|
|
1952
|
+
],
|
|
1953
|
+
name: "WalletBrowserRedirectHandlerMissingError",
|
|
1954
|
+
shortMessage: `Connecting to ${walletKey} requires opening its in-app browser, so the handleWalletBrowserRedirect param is required where there is no page URL to redirect.`
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
};
|
|
1958
|
+
|
|
1887
1959
|
//#endregion
|
|
1888
1960
|
//#region src/errors/WalletOptionNotFoundError.ts
|
|
1889
1961
|
/**
|
|
1890
|
-
* Thrown when `
|
|
1962
|
+
* Thrown when `connectWalletOption` is given a wallet key that no wallet option in
|
|
1891
1963
|
* the catalogue matches.
|
|
1892
1964
|
*
|
|
1893
1965
|
* A wallet is only surfaced for the chains this client has an extension for, so
|
|
@@ -1897,14 +1969,14 @@ var WalletAccountNotSelectedError = class extends BaseError {
|
|
|
1897
1969
|
* @example
|
|
1898
1970
|
* ```ts
|
|
1899
1971
|
* try {
|
|
1900
|
-
* await
|
|
1972
|
+
* await connectWalletOption({ walletKey: 'metmask' });
|
|
1901
1973
|
* } catch (error) {
|
|
1902
1974
|
* if (error instanceof WalletOptionNotFoundError) {
|
|
1903
1975
|
* showUnknownWalletMessage();
|
|
1904
1976
|
* }
|
|
1905
1977
|
* }
|
|
1906
1978
|
* ```
|
|
1907
|
-
* @see
|
|
1979
|
+
* @see connectWalletOption
|
|
1908
1980
|
* @see getWalletOptionsCatalogue
|
|
1909
1981
|
*/
|
|
1910
1982
|
var WalletOptionNotFoundError = class extends BaseError {
|
|
@@ -2000,13 +2072,7 @@ const __checkStepUpAuth_impl = checkStepUpAuth;
|
|
|
2000
2072
|
const __checkStepUpAuth_wrapped = instrumentFunction({
|
|
2001
2073
|
fn: __checkStepUpAuth_impl,
|
|
2002
2074
|
functionName: "checkStepUpAuth",
|
|
2003
|
-
getCore:
|
|
2004
|
-
try {
|
|
2005
|
-
return getCore(getDefaultClient());
|
|
2006
|
-
} catch {
|
|
2007
|
-
return;
|
|
2008
|
-
}
|
|
2009
|
-
}
|
|
2075
|
+
getCore: resolveInstrumentationCore
|
|
2010
2076
|
});
|
|
2011
2077
|
|
|
2012
2078
|
//#endregion
|
|
@@ -2046,13 +2112,7 @@ const __requestExternalAuthElevatedToken_impl = requestExternalAuthElevatedToken
|
|
|
2046
2112
|
const __requestExternalAuthElevatedToken_wrapped = instrumentFunction({
|
|
2047
2113
|
fn: __requestExternalAuthElevatedToken_impl,
|
|
2048
2114
|
functionName: "requestExternalAuthElevatedToken",
|
|
2049
|
-
getCore:
|
|
2050
|
-
try {
|
|
2051
|
-
return getCore(getDefaultClient());
|
|
2052
|
-
} catch {
|
|
2053
|
-
return;
|
|
2054
|
-
}
|
|
2055
|
-
}
|
|
2115
|
+
getCore: resolveInstrumentationCore
|
|
2056
2116
|
});
|
|
2057
2117
|
|
|
2058
2118
|
//#endregion
|
|
@@ -2094,13 +2154,7 @@ const __signInWithExternalJwt_impl = signInWithExternalJwt;
|
|
|
2094
2154
|
const __signInWithExternalJwt_wrapped = instrumentFunction({
|
|
2095
2155
|
fn: __signInWithExternalJwt_impl,
|
|
2096
2156
|
functionName: "signInWithExternalJwt",
|
|
2097
|
-
getCore:
|
|
2098
|
-
try {
|
|
2099
|
-
return getCore(getDefaultClient());
|
|
2100
|
-
} catch {
|
|
2101
|
-
return;
|
|
2102
|
-
}
|
|
2103
|
-
}
|
|
2157
|
+
getCore: resolveInstrumentationCore
|
|
2104
2158
|
});
|
|
2105
2159
|
|
|
2106
2160
|
//#endregion
|
|
@@ -2211,13 +2265,7 @@ const __deletePasskey_impl = deletePasskey;
|
|
|
2211
2265
|
const __deletePasskey_wrapped = instrumentFunction({
|
|
2212
2266
|
fn: __deletePasskey_impl,
|
|
2213
2267
|
functionName: "deletePasskey",
|
|
2214
|
-
getCore:
|
|
2215
|
-
try {
|
|
2216
|
-
return getCore(getDefaultClient());
|
|
2217
|
-
} catch {
|
|
2218
|
-
return;
|
|
2219
|
-
}
|
|
2220
|
-
}
|
|
2268
|
+
getCore: resolveInstrumentationCore
|
|
2221
2269
|
});
|
|
2222
2270
|
|
|
2223
2271
|
//#endregion
|
|
@@ -2300,13 +2348,7 @@ const __registerPasskey_impl = registerPasskey;
|
|
|
2300
2348
|
const __registerPasskey_wrapped = instrumentFunction({
|
|
2301
2349
|
fn: __registerPasskey_impl,
|
|
2302
2350
|
functionName: "registerPasskey",
|
|
2303
|
-
getCore:
|
|
2304
|
-
try {
|
|
2305
|
-
return getCore(getDefaultClient());
|
|
2306
|
-
} catch {
|
|
2307
|
-
return;
|
|
2308
|
-
}
|
|
2309
|
-
}
|
|
2351
|
+
getCore: resolveInstrumentationCore
|
|
2310
2352
|
});
|
|
2311
2353
|
|
|
2312
2354
|
//#endregion
|
|
@@ -2373,13 +2415,7 @@ const __signInWithPasskey_impl = signInWithPasskey;
|
|
|
2373
2415
|
const __signInWithPasskey_wrapped = instrumentFunction({
|
|
2374
2416
|
fn: __signInWithPasskey_impl,
|
|
2375
2417
|
functionName: "signInWithPasskey",
|
|
2376
|
-
getCore:
|
|
2377
|
-
try {
|
|
2378
|
-
return getCore(getDefaultClient());
|
|
2379
|
-
} catch {
|
|
2380
|
-
return;
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2418
|
+
getCore: resolveInstrumentationCore
|
|
2383
2419
|
});
|
|
2384
2420
|
|
|
2385
2421
|
//#endregion
|
|
@@ -2594,13 +2630,7 @@ const __signInWithSocialRedirect_impl = signInWithSocialRedirect;
|
|
|
2594
2630
|
const __signInWithSocialRedirect_wrapped = instrumentFunction({
|
|
2595
2631
|
fn: __signInWithSocialRedirect_impl,
|
|
2596
2632
|
functionName: "signInWithSocialRedirect",
|
|
2597
|
-
getCore:
|
|
2598
|
-
try {
|
|
2599
|
-
return getCore(getDefaultClient());
|
|
2600
|
-
} catch {
|
|
2601
|
-
return;
|
|
2602
|
-
}
|
|
2603
|
-
}
|
|
2633
|
+
getCore: resolveInstrumentationCore
|
|
2604
2634
|
});
|
|
2605
2635
|
|
|
2606
2636
|
//#endregion
|
|
@@ -2625,13 +2655,7 @@ const __authenticateWithSocial_impl = authenticateWithSocial;
|
|
|
2625
2655
|
const __authenticateWithSocial_wrapped = instrumentFunction({
|
|
2626
2656
|
fn: __authenticateWithSocial_impl,
|
|
2627
2657
|
functionName: "authenticateWithSocial",
|
|
2628
|
-
getCore:
|
|
2629
|
-
try {
|
|
2630
|
-
return getCore(getDefaultClient());
|
|
2631
|
-
} catch {
|
|
2632
|
-
return;
|
|
2633
|
-
}
|
|
2634
|
-
}
|
|
2658
|
+
getCore: resolveInstrumentationCore
|
|
2635
2659
|
});
|
|
2636
2660
|
|
|
2637
2661
|
//#endregion
|
|
@@ -2743,13 +2767,7 @@ const __processSocialCallback_impl = processSocialCallback;
|
|
|
2743
2767
|
const __processSocialCallback_wrapped = instrumentFunction({
|
|
2744
2768
|
fn: __processSocialCallback_impl,
|
|
2745
2769
|
functionName: "processSocialCallback",
|
|
2746
|
-
getCore:
|
|
2747
|
-
try {
|
|
2748
|
-
return getCore(getDefaultClient());
|
|
2749
|
-
} catch {
|
|
2750
|
-
return;
|
|
2751
|
-
}
|
|
2752
|
-
}
|
|
2770
|
+
getCore: resolveInstrumentationCore
|
|
2753
2771
|
});
|
|
2754
2772
|
|
|
2755
2773
|
//#endregion
|
|
@@ -2810,13 +2828,7 @@ const __completeSocialRedirect_impl = completeSocialRedirect;
|
|
|
2810
2828
|
const __completeSocialRedirect_wrapped = instrumentFunction({
|
|
2811
2829
|
fn: __completeSocialRedirect_impl,
|
|
2812
2830
|
functionName: "completeSocialRedirect",
|
|
2813
|
-
getCore:
|
|
2814
|
-
try {
|
|
2815
|
-
return getCore(getDefaultClient());
|
|
2816
|
-
} catch {
|
|
2817
|
-
return;
|
|
2818
|
-
}
|
|
2819
|
-
}
|
|
2831
|
+
getCore: resolveInstrumentationCore
|
|
2820
2832
|
});
|
|
2821
2833
|
|
|
2822
2834
|
//#endregion
|
|
@@ -2833,13 +2845,7 @@ const __completeSocialAuthentication_impl = completeSocialAuthentication;
|
|
|
2833
2845
|
const __completeSocialAuthentication_wrapped = instrumentFunction({
|
|
2834
2846
|
fn: __completeSocialAuthentication_impl,
|
|
2835
2847
|
functionName: "completeSocialAuthentication",
|
|
2836
|
-
getCore:
|
|
2837
|
-
try {
|
|
2838
|
-
return getCore(getDefaultClient());
|
|
2839
|
-
} catch {
|
|
2840
|
-
return;
|
|
2841
|
-
}
|
|
2842
|
-
}
|
|
2848
|
+
getCore: resolveInstrumentationCore
|
|
2843
2849
|
});
|
|
2844
2850
|
|
|
2845
2851
|
//#endregion
|
|
@@ -2908,13 +2914,7 @@ const __signInWithSocialPopUp_impl = signInWithSocialPopUp;
|
|
|
2908
2914
|
const __signInWithSocialPopUp_wrapped = instrumentFunction({
|
|
2909
2915
|
fn: __signInWithSocialPopUp_impl,
|
|
2910
2916
|
functionName: "signInWithSocialPopUp",
|
|
2911
|
-
getCore:
|
|
2912
|
-
try {
|
|
2913
|
-
return getCore(getDefaultClient());
|
|
2914
|
-
} catch {
|
|
2915
|
-
return;
|
|
2916
|
-
}
|
|
2917
|
-
}
|
|
2917
|
+
getCore: resolveInstrumentationCore
|
|
2918
2918
|
});
|
|
2919
2919
|
|
|
2920
2920
|
//#endregion
|
|
@@ -2989,13 +2989,7 @@ const __unlinkSocialAccount_impl = unlinkSocialAccount;
|
|
|
2989
2989
|
const __unlinkSocialAccount_wrapped = instrumentFunction({
|
|
2990
2990
|
fn: __unlinkSocialAccount_impl,
|
|
2991
2991
|
functionName: "unlinkSocialAccount",
|
|
2992
|
-
getCore:
|
|
2993
|
-
try {
|
|
2994
|
-
return getCore(getDefaultClient());
|
|
2995
|
-
} catch {
|
|
2996
|
-
return;
|
|
2997
|
-
}
|
|
2998
|
-
}
|
|
2992
|
+
getCore: resolveInstrumentationCore
|
|
2999
2993
|
});
|
|
3000
2994
|
|
|
3001
2995
|
//#endregion
|
|
@@ -3252,13 +3246,7 @@ const __attachCheckoutTransactionSource_impl = attachCheckoutTransactionSource;
|
|
|
3252
3246
|
const __attachCheckoutTransactionSource_wrapped = instrumentFunction({
|
|
3253
3247
|
fn: __attachCheckoutTransactionSource_impl,
|
|
3254
3248
|
functionName: "attachCheckoutTransactionSource",
|
|
3255
|
-
getCore:
|
|
3256
|
-
try {
|
|
3257
|
-
return getCore(getDefaultClient());
|
|
3258
|
-
} catch {
|
|
3259
|
-
return;
|
|
3260
|
-
}
|
|
3261
|
-
}
|
|
3249
|
+
getCore: resolveInstrumentationCore
|
|
3262
3250
|
});
|
|
3263
3251
|
|
|
3264
3252
|
//#endregion
|
|
@@ -3294,13 +3282,7 @@ const __broadcastCheckoutTransaction_impl = broadcastCheckoutTransaction;
|
|
|
3294
3282
|
const __broadcastCheckoutTransaction_wrapped = instrumentFunction({
|
|
3295
3283
|
fn: __broadcastCheckoutTransaction_impl,
|
|
3296
3284
|
functionName: "broadcastCheckoutTransaction",
|
|
3297
|
-
getCore:
|
|
3298
|
-
try {
|
|
3299
|
-
return getCore(getDefaultClient());
|
|
3300
|
-
} catch {
|
|
3301
|
-
return;
|
|
3302
|
-
}
|
|
3303
|
-
}
|
|
3285
|
+
getCore: resolveInstrumentationCore
|
|
3304
3286
|
});
|
|
3305
3287
|
|
|
3306
3288
|
//#endregion
|
|
@@ -3333,13 +3315,7 @@ const __cancelCheckoutTransaction_impl = cancelCheckoutTransaction;
|
|
|
3333
3315
|
const __cancelCheckoutTransaction_wrapped = instrumentFunction({
|
|
3334
3316
|
fn: __cancelCheckoutTransaction_impl,
|
|
3335
3317
|
functionName: "cancelCheckoutTransaction",
|
|
3336
|
-
getCore:
|
|
3337
|
-
try {
|
|
3338
|
-
return getCore(getDefaultClient());
|
|
3339
|
-
} catch {
|
|
3340
|
-
return;
|
|
3341
|
-
}
|
|
3342
|
-
}
|
|
3318
|
+
getCore: resolveInstrumentationCore
|
|
3343
3319
|
});
|
|
3344
3320
|
|
|
3345
3321
|
//#endregion
|
|
@@ -3391,13 +3367,7 @@ const __createCheckoutTransaction_impl = createCheckoutTransaction;
|
|
|
3391
3367
|
const __createCheckoutTransaction_wrapped = instrumentFunction({
|
|
3392
3368
|
fn: __createCheckoutTransaction_impl,
|
|
3393
3369
|
functionName: "createCheckoutTransaction",
|
|
3394
|
-
getCore:
|
|
3395
|
-
try {
|
|
3396
|
-
return getCore(getDefaultClient());
|
|
3397
|
-
} catch {
|
|
3398
|
-
return;
|
|
3399
|
-
}
|
|
3400
|
-
}
|
|
3370
|
+
getCore: resolveInstrumentationCore
|
|
3401
3371
|
});
|
|
3402
3372
|
|
|
3403
3373
|
//#endregion
|
|
@@ -3485,13 +3455,7 @@ const __prepareCheckoutTransaction_impl = prepareCheckoutTransaction;
|
|
|
3485
3455
|
const __prepareCheckoutTransaction_wrapped = instrumentFunction({
|
|
3486
3456
|
fn: __prepareCheckoutTransaction_impl,
|
|
3487
3457
|
functionName: "prepareCheckoutTransaction",
|
|
3488
|
-
getCore:
|
|
3489
|
-
try {
|
|
3490
|
-
return getCore(getDefaultClient());
|
|
3491
|
-
} catch {
|
|
3492
|
-
return;
|
|
3493
|
-
}
|
|
3494
|
-
}
|
|
3458
|
+
getCore: resolveInstrumentationCore
|
|
3495
3459
|
});
|
|
3496
3460
|
|
|
3497
3461
|
//#endregion
|
|
@@ -3589,13 +3553,7 @@ const __executeSwapTransaction_impl = executeSwapTransaction;
|
|
|
3589
3553
|
const __executeSwapTransaction_wrapped = instrumentFunction({
|
|
3590
3554
|
fn: __executeSwapTransaction_impl,
|
|
3591
3555
|
functionName: "executeSwapTransaction",
|
|
3592
|
-
getCore:
|
|
3593
|
-
try {
|
|
3594
|
-
return getCore(getDefaultClient());
|
|
3595
|
-
} catch {
|
|
3596
|
-
return;
|
|
3597
|
-
}
|
|
3598
|
-
}
|
|
3556
|
+
getCore: resolveInstrumentationCore
|
|
3599
3557
|
});
|
|
3600
3558
|
|
|
3601
3559
|
//#endregion
|
|
@@ -3638,13 +3596,7 @@ const __submitCheckoutTransaction_impl = submitCheckoutTransaction;
|
|
|
3638
3596
|
const __submitCheckoutTransaction_wrapped = instrumentFunction({
|
|
3639
3597
|
fn: __submitCheckoutTransaction_impl,
|
|
3640
3598
|
functionName: "submitCheckoutTransaction",
|
|
3641
|
-
getCore:
|
|
3642
|
-
try {
|
|
3643
|
-
return getCore(getDefaultClient());
|
|
3644
|
-
} catch {
|
|
3645
|
-
return;
|
|
3646
|
-
}
|
|
3647
|
-
}
|
|
3599
|
+
getCore: resolveInstrumentationCore
|
|
3648
3600
|
});
|
|
3649
3601
|
|
|
3650
3602
|
//#endregion
|
|
@@ -3767,13 +3719,7 @@ const __completeDeviceRegistration_impl = completeDeviceRegistration;
|
|
|
3767
3719
|
const __completeDeviceRegistration_wrapped = instrumentFunction({
|
|
3768
3720
|
fn: __completeDeviceRegistration_impl,
|
|
3769
3721
|
functionName: "completeDeviceRegistration",
|
|
3770
|
-
getCore:
|
|
3771
|
-
try {
|
|
3772
|
-
return getCore(getDefaultClient());
|
|
3773
|
-
} catch {
|
|
3774
|
-
return;
|
|
3775
|
-
}
|
|
3776
|
-
}
|
|
3722
|
+
getCore: resolveInstrumentationCore
|
|
3777
3723
|
});
|
|
3778
3724
|
|
|
3779
3725
|
//#endregion
|
|
@@ -3850,13 +3796,7 @@ const __revokeAllRegisteredDevices_impl = revokeAllRegisteredDevices;
|
|
|
3850
3796
|
const __revokeAllRegisteredDevices_wrapped = instrumentFunction({
|
|
3851
3797
|
fn: __revokeAllRegisteredDevices_impl,
|
|
3852
3798
|
functionName: "revokeAllRegisteredDevices",
|
|
3853
|
-
getCore:
|
|
3854
|
-
try {
|
|
3855
|
-
return getCore(getDefaultClient());
|
|
3856
|
-
} catch {
|
|
3857
|
-
return;
|
|
3858
|
-
}
|
|
3859
|
-
}
|
|
3799
|
+
getCore: resolveInstrumentationCore
|
|
3860
3800
|
});
|
|
3861
3801
|
|
|
3862
3802
|
//#endregion
|
|
@@ -3874,13 +3814,7 @@ const __revokeRegisteredDevice_impl = revokeRegisteredDevice;
|
|
|
3874
3814
|
const __revokeRegisteredDevice_wrapped = instrumentFunction({
|
|
3875
3815
|
fn: __revokeRegisteredDevice_impl,
|
|
3876
3816
|
functionName: "revokeRegisteredDevice",
|
|
3877
|
-
getCore:
|
|
3878
|
-
try {
|
|
3879
|
-
return getCore(getDefaultClient());
|
|
3880
|
-
} catch {
|
|
3881
|
-
return;
|
|
3882
|
-
}
|
|
3883
|
-
}
|
|
3817
|
+
getCore: resolveInstrumentationCore
|
|
3884
3818
|
});
|
|
3885
3819
|
|
|
3886
3820
|
//#endregion
|
|
@@ -4001,13 +3935,7 @@ const __attachFlowSource_impl = attachFlowSource;
|
|
|
4001
3935
|
const __attachFlowSource_wrapped = instrumentFunction({
|
|
4002
3936
|
fn: __attachFlowSource_impl,
|
|
4003
3937
|
functionName: "attachFlowSource",
|
|
4004
|
-
getCore:
|
|
4005
|
-
try {
|
|
4006
|
-
return getCore(getDefaultClient());
|
|
4007
|
-
} catch {
|
|
4008
|
-
return;
|
|
4009
|
-
}
|
|
4010
|
-
},
|
|
3938
|
+
getCore: resolveInstrumentationCore,
|
|
4011
3939
|
selectors: attachFlowSourceInstrumentation
|
|
4012
3940
|
});
|
|
4013
3941
|
|
|
@@ -4072,13 +4000,7 @@ const __broadcastFlow_impl = broadcastFlow;
|
|
|
4072
4000
|
const __broadcastFlow_wrapped = instrumentFunction({
|
|
4073
4001
|
fn: __broadcastFlow_impl,
|
|
4074
4002
|
functionName: "broadcastFlow",
|
|
4075
|
-
getCore:
|
|
4076
|
-
try {
|
|
4077
|
-
return getCore(getDefaultClient());
|
|
4078
|
-
} catch {
|
|
4079
|
-
return;
|
|
4080
|
-
}
|
|
4081
|
-
},
|
|
4003
|
+
getCore: resolveInstrumentationCore,
|
|
4082
4004
|
selectors: broadcastFlowInstrumentation
|
|
4083
4005
|
});
|
|
4084
4006
|
|
|
@@ -4131,13 +4053,7 @@ const __cancelFlow_impl = cancelFlow;
|
|
|
4131
4053
|
const __cancelFlow_wrapped = instrumentFunction({
|
|
4132
4054
|
fn: __cancelFlow_impl,
|
|
4133
4055
|
functionName: "cancelFlow",
|
|
4134
|
-
getCore:
|
|
4135
|
-
try {
|
|
4136
|
-
return getCore(getDefaultClient());
|
|
4137
|
-
} catch {
|
|
4138
|
-
return;
|
|
4139
|
-
}
|
|
4140
|
-
},
|
|
4056
|
+
getCore: resolveInstrumentationCore,
|
|
4141
4057
|
selectors: cancelFlowInstrumentation
|
|
4142
4058
|
});
|
|
4143
4059
|
|
|
@@ -4254,13 +4170,7 @@ const __prepareFlowSigning_impl = prepareFlowSigning;
|
|
|
4254
4170
|
const __prepareFlowSigning_wrapped = instrumentFunction({
|
|
4255
4171
|
fn: __prepareFlowSigning_impl,
|
|
4256
4172
|
functionName: "prepareFlowSigning",
|
|
4257
|
-
getCore:
|
|
4258
|
-
try {
|
|
4259
|
-
return getCore(getDefaultClient());
|
|
4260
|
-
} catch {
|
|
4261
|
-
return;
|
|
4262
|
-
}
|
|
4263
|
-
},
|
|
4173
|
+
getCore: resolveInstrumentationCore,
|
|
4264
4174
|
selectors: prepareFlowSigningInstrumentation
|
|
4265
4175
|
});
|
|
4266
4176
|
|
|
@@ -4319,13 +4229,7 @@ const __submitFlowTransaction_impl = submitFlowTransaction;
|
|
|
4319
4229
|
const __submitFlowTransaction_wrapped = instrumentFunction({
|
|
4320
4230
|
fn: __submitFlowTransaction_impl,
|
|
4321
4231
|
functionName: "submitFlowTransaction",
|
|
4322
|
-
getCore:
|
|
4323
|
-
try {
|
|
4324
|
-
return getCore(getDefaultClient());
|
|
4325
|
-
} catch {
|
|
4326
|
-
return;
|
|
4327
|
-
}
|
|
4328
|
-
},
|
|
4232
|
+
getCore: resolveInstrumentationCore,
|
|
4329
4233
|
selectors: submitFlowTransactionInstrumentation
|
|
4330
4234
|
});
|
|
4331
4235
|
|
|
@@ -4667,13 +4571,7 @@ const __createCoinbaseOnrampOrder_impl = createCoinbaseOnrampOrder;
|
|
|
4667
4571
|
const __createCoinbaseOnrampOrder_wrapped = instrumentFunction({
|
|
4668
4572
|
fn: __createCoinbaseOnrampOrder_impl,
|
|
4669
4573
|
functionName: "createCoinbaseOnrampOrder",
|
|
4670
|
-
getCore:
|
|
4671
|
-
try {
|
|
4672
|
-
return getCore(getDefaultClient());
|
|
4673
|
-
} catch {
|
|
4674
|
-
return;
|
|
4675
|
-
}
|
|
4676
|
-
}
|
|
4574
|
+
getCore: resolveInstrumentationCore
|
|
4677
4575
|
});
|
|
4678
4576
|
|
|
4679
4577
|
//#endregion
|
|
@@ -4712,7 +4610,7 @@ const assertChainName = (chainName) => {
|
|
|
4712
4610
|
* ```
|
|
4713
4611
|
* @see createCoinbaseExchangeTransfer
|
|
4714
4612
|
* @see GetCoinbaseAccountsParams
|
|
4715
|
-
* @
|
|
4613
|
+
* @instrumented
|
|
4716
4614
|
*/
|
|
4717
4615
|
const getCoinbaseAccounts = async (params, client = getDefaultClient()) => {
|
|
4718
4616
|
const core = getCore(client);
|
|
@@ -4728,6 +4626,12 @@ const getCoinbaseAccounts = async (params, client = getDefaultClient()) => {
|
|
|
4728
4626
|
networkId
|
|
4729
4627
|
});
|
|
4730
4628
|
};
|
|
4629
|
+
const __getCoinbaseAccounts_impl = getCoinbaseAccounts;
|
|
4630
|
+
const __getCoinbaseAccounts_wrapped = instrumentFunction({
|
|
4631
|
+
fn: __getCoinbaseAccounts_impl,
|
|
4632
|
+
functionName: "getCoinbaseAccounts",
|
|
4633
|
+
getCore: resolveInstrumentationCore
|
|
4634
|
+
});
|
|
4731
4635
|
|
|
4732
4636
|
//#endregion
|
|
4733
4637
|
//#region src/modules/funding/coinbase/getCoinbaseBuyUrl/getCoinbaseBuyUrl.ts
|
|
@@ -4737,7 +4641,7 @@ const getCoinbaseAccounts = async (params, client = getDefaultClient()) => {
|
|
|
4737
4641
|
* @param buyUrlParams CoinbaseOnrampGetBuyUrlRequest - The parameters for the buy URL.
|
|
4738
4642
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4739
4643
|
* @returns an object containing the buy URL
|
|
4740
|
-
* @
|
|
4644
|
+
* @instrumented
|
|
4741
4645
|
*/
|
|
4742
4646
|
const getCoinbaseBuyUrl = async (buyUrlParams, client = getDefaultClient()) => {
|
|
4743
4647
|
const core = getCore(client);
|
|
@@ -4746,6 +4650,12 @@ const getCoinbaseBuyUrl = async (buyUrlParams, client = getDefaultClient()) => {
|
|
|
4746
4650
|
environmentId: core.environmentId
|
|
4747
4651
|
});
|
|
4748
4652
|
};
|
|
4653
|
+
const __getCoinbaseBuyUrl_impl = getCoinbaseBuyUrl;
|
|
4654
|
+
const __getCoinbaseBuyUrl_wrapped = instrumentFunction({
|
|
4655
|
+
fn: __getCoinbaseBuyUrl_impl,
|
|
4656
|
+
functionName: "getCoinbaseBuyUrl",
|
|
4657
|
+
getCore: resolveInstrumentationCore
|
|
4658
|
+
});
|
|
4749
4659
|
|
|
4750
4660
|
//#endregion
|
|
4751
4661
|
//#region src/modules/funding/cryptoDotCom/createCryptoDotComPayment/createCryptoDotComPayment.ts
|
|
@@ -4771,13 +4681,7 @@ const __createCryptoDotComPayment_impl = createCryptoDotComPayment;
|
|
|
4771
4681
|
const __createCryptoDotComPayment_wrapped = instrumentFunction({
|
|
4772
4682
|
fn: __createCryptoDotComPayment_impl,
|
|
4773
4683
|
functionName: "createCryptoDotComPayment",
|
|
4774
|
-
getCore:
|
|
4775
|
-
try {
|
|
4776
|
-
return getCore(getDefaultClient());
|
|
4777
|
-
} catch {
|
|
4778
|
-
return;
|
|
4779
|
-
}
|
|
4780
|
-
}
|
|
4684
|
+
getCore: resolveInstrumentationCore
|
|
4781
4685
|
});
|
|
4782
4686
|
|
|
4783
4687
|
//#endregion
|
|
@@ -4810,7 +4714,7 @@ const createKrakenExchangeTransfer = async (transferParams, client = getDefaultC
|
|
|
4810
4714
|
* @param [params] GetKrakenAccountsParams - Optional filters for the accounts.
|
|
4811
4715
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4812
4716
|
* @returns Array of Kraken accounts with balances
|
|
4813
|
-
* @
|
|
4717
|
+
* @instrumented
|
|
4814
4718
|
*/
|
|
4815
4719
|
const getKrakenAccounts = async (params, client = getDefaultClient()) => {
|
|
4816
4720
|
const core = getCore(client);
|
|
@@ -4821,6 +4725,12 @@ const getKrakenAccounts = async (params, client = getDefaultClient()) => {
|
|
|
4821
4725
|
networkId: params?.networkId
|
|
4822
4726
|
});
|
|
4823
4727
|
};
|
|
4728
|
+
const __getKrakenAccounts_impl = getKrakenAccounts;
|
|
4729
|
+
const __getKrakenAccounts_wrapped = instrumentFunction({
|
|
4730
|
+
fn: __getKrakenAccounts_impl,
|
|
4731
|
+
functionName: "getKrakenAccounts",
|
|
4732
|
+
getCore: resolveInstrumentationCore
|
|
4733
|
+
});
|
|
4824
4734
|
|
|
4825
4735
|
//#endregion
|
|
4826
4736
|
//#region src/modules/funding/kraken/getKrakenWhitelistedAddresses/getKrakenWhitelistedAddresses.ts
|
|
@@ -4829,7 +4739,7 @@ const getKrakenAccounts = async (params, client = getDefaultClient()) => {
|
|
|
4829
4739
|
*
|
|
4830
4740
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4831
4741
|
* @returns Transfer destinations response with whitelisted addresses
|
|
4832
|
-
* @
|
|
4742
|
+
* @instrumented
|
|
4833
4743
|
*/
|
|
4834
4744
|
const getKrakenWhitelistedAddresses = async (client = getDefaultClient()) => {
|
|
4835
4745
|
const core = getCore(client);
|
|
@@ -4838,6 +4748,12 @@ const getKrakenWhitelistedAddresses = async (client = getDefaultClient()) => {
|
|
|
4838
4748
|
exchangeKey: ExchangeKeyEnum.Kraken
|
|
4839
4749
|
});
|
|
4840
4750
|
};
|
|
4751
|
+
const __getKrakenWhitelistedAddresses_impl = getKrakenWhitelistedAddresses;
|
|
4752
|
+
const __getKrakenWhitelistedAddresses_wrapped = instrumentFunction({
|
|
4753
|
+
fn: __getKrakenWhitelistedAddresses_impl,
|
|
4754
|
+
functionName: "getKrakenWhitelistedAddresses",
|
|
4755
|
+
getCore: resolveInstrumentationCore
|
|
4756
|
+
});
|
|
4841
4757
|
|
|
4842
4758
|
//#endregion
|
|
4843
4759
|
//#region src/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.ts
|
|
@@ -4863,13 +4779,7 @@ const __getMoonPayCurrencies_impl = getMoonPayCurrencies;
|
|
|
4863
4779
|
const __getMoonPayCurrencies_wrapped = instrumentFunction({
|
|
4864
4780
|
fn: __getMoonPayCurrencies_impl,
|
|
4865
4781
|
functionName: "getMoonPayCurrencies",
|
|
4866
|
-
getCore:
|
|
4867
|
-
try {
|
|
4868
|
-
return getCore(getDefaultClient());
|
|
4869
|
-
} catch {
|
|
4870
|
-
return;
|
|
4871
|
-
}
|
|
4872
|
-
}
|
|
4782
|
+
getCore: resolveInstrumentationCore
|
|
4873
4783
|
});
|
|
4874
4784
|
|
|
4875
4785
|
//#endregion
|
|
@@ -4939,13 +4849,7 @@ const __getMoonPayUrl_impl = getMoonPayUrl;
|
|
|
4939
4849
|
const __getMoonPayUrl_wrapped = instrumentFunction({
|
|
4940
4850
|
fn: __getMoonPayUrl_impl,
|
|
4941
4851
|
functionName: "getMoonPayUrl",
|
|
4942
|
-
getCore:
|
|
4943
|
-
try {
|
|
4944
|
-
return getCore(getDefaultClient());
|
|
4945
|
-
} catch {
|
|
4946
|
-
return;
|
|
4947
|
-
}
|
|
4948
|
-
}
|
|
4852
|
+
getCore: resolveInstrumentationCore
|
|
4949
4853
|
});
|
|
4950
4854
|
|
|
4951
4855
|
//#endregion
|
|
@@ -4989,13 +4893,7 @@ const __setInstrumentationEnabled_impl = setInstrumentationEnabled;
|
|
|
4989
4893
|
const __setInstrumentationEnabled_wrapped = instrumentFunction({
|
|
4990
4894
|
fn: __setInstrumentationEnabled_impl,
|
|
4991
4895
|
functionName: "setInstrumentationEnabled",
|
|
4992
|
-
getCore:
|
|
4993
|
-
try {
|
|
4994
|
-
return getCore(getDefaultClient());
|
|
4995
|
-
} catch {
|
|
4996
|
-
return;
|
|
4997
|
-
}
|
|
4998
|
-
}
|
|
4896
|
+
getCore: resolveInstrumentationCore
|
|
4999
4897
|
});
|
|
5000
4898
|
|
|
5001
4899
|
//#endregion
|
|
@@ -5562,13 +5460,7 @@ const __updateUser_impl = updateUser;
|
|
|
5562
5460
|
const __updateUser_wrapped = instrumentFunction({
|
|
5563
5461
|
fn: __updateUser_impl,
|
|
5564
5462
|
functionName: "updateUser",
|
|
5565
|
-
getCore:
|
|
5566
|
-
try {
|
|
5567
|
-
return getCore(getDefaultClient());
|
|
5568
|
-
} catch {
|
|
5569
|
-
return;
|
|
5570
|
-
}
|
|
5571
|
-
}
|
|
5463
|
+
getCore: resolveInstrumentationCore
|
|
5572
5464
|
});
|
|
5573
5465
|
|
|
5574
5466
|
//#endregion
|
|
@@ -5590,13 +5482,7 @@ const __acknowledgeRecoveryCodes_impl = acknowledgeRecoveryCodes;
|
|
|
5590
5482
|
const __acknowledgeRecoveryCodes_wrapped = instrumentFunction({
|
|
5591
5483
|
fn: __acknowledgeRecoveryCodes_impl,
|
|
5592
5484
|
functionName: "acknowledgeRecoveryCodes",
|
|
5593
|
-
getCore:
|
|
5594
|
-
try {
|
|
5595
|
-
return getCore(getDefaultClient());
|
|
5596
|
-
} catch {
|
|
5597
|
-
return;
|
|
5598
|
-
}
|
|
5599
|
-
}
|
|
5485
|
+
getCore: resolveInstrumentationCore
|
|
5600
5486
|
});
|
|
5601
5487
|
|
|
5602
5488
|
//#endregion
|
|
@@ -5791,13 +5677,7 @@ const __createNewMfaRecoveryCodes_impl = createNewMfaRecoveryCodes;
|
|
|
5791
5677
|
const __createNewMfaRecoveryCodes_wrapped = instrumentFunction({
|
|
5792
5678
|
fn: __createNewMfaRecoveryCodes_impl,
|
|
5793
5679
|
functionName: "createNewMfaRecoveryCodes",
|
|
5794
|
-
getCore:
|
|
5795
|
-
try {
|
|
5796
|
-
return getCore(getDefaultClient());
|
|
5797
|
-
} catch {
|
|
5798
|
-
return;
|
|
5799
|
-
}
|
|
5800
|
-
}
|
|
5680
|
+
getCore: resolveInstrumentationCore
|
|
5801
5681
|
});
|
|
5802
5682
|
|
|
5803
5683
|
//#endregion
|
|
@@ -5833,13 +5713,7 @@ const __deleteMfaDevice_impl = deleteMfaDevice;
|
|
|
5833
5713
|
const __deleteMfaDevice_wrapped = instrumentFunction({
|
|
5834
5714
|
fn: __deleteMfaDevice_impl,
|
|
5835
5715
|
functionName: "deleteMfaDevice",
|
|
5836
|
-
getCore:
|
|
5837
|
-
try {
|
|
5838
|
-
return getCore(getDefaultClient());
|
|
5839
|
-
} catch {
|
|
5840
|
-
return;
|
|
5841
|
-
}
|
|
5842
|
-
}
|
|
5716
|
+
getCore: resolveInstrumentationCore
|
|
5843
5717
|
});
|
|
5844
5718
|
|
|
5845
5719
|
//#endregion
|
|
@@ -5900,13 +5774,7 @@ const __registerTotpMfaDevice_impl = registerTotpMfaDevice;
|
|
|
5900
5774
|
const __registerTotpMfaDevice_wrapped = instrumentFunction({
|
|
5901
5775
|
fn: __registerTotpMfaDevice_impl,
|
|
5902
5776
|
functionName: "registerTotpMfaDevice",
|
|
5903
|
-
getCore:
|
|
5904
|
-
try {
|
|
5905
|
-
return getCore(getDefaultClient());
|
|
5906
|
-
} catch {
|
|
5907
|
-
return;
|
|
5908
|
-
}
|
|
5909
|
-
}
|
|
5777
|
+
getCore: resolveInstrumentationCore
|
|
5910
5778
|
});
|
|
5911
5779
|
|
|
5912
5780
|
//#endregion
|
|
@@ -5935,13 +5803,7 @@ const __setDefaultMfaDevice_impl = setDefaultMfaDevice;
|
|
|
5935
5803
|
const __setDefaultMfaDevice_wrapped = instrumentFunction({
|
|
5936
5804
|
fn: __setDefaultMfaDevice_impl,
|
|
5937
5805
|
functionName: "setDefaultMfaDevice",
|
|
5938
|
-
getCore:
|
|
5939
|
-
try {
|
|
5940
|
-
return getCore(getDefaultClient());
|
|
5941
|
-
} catch {
|
|
5942
|
-
return;
|
|
5943
|
-
}
|
|
5944
|
-
}
|
|
5806
|
+
getCore: resolveInstrumentationCore
|
|
5945
5807
|
});
|
|
5946
5808
|
|
|
5947
5809
|
//#endregion
|
|
@@ -5990,13 +5852,7 @@ const __sendEmailOTP_impl = sendEmailOTP;
|
|
|
5990
5852
|
const __sendEmailOTP_wrapped = instrumentFunction({
|
|
5991
5853
|
fn: __sendEmailOTP_impl,
|
|
5992
5854
|
functionName: "sendEmailOTP",
|
|
5993
|
-
getCore:
|
|
5994
|
-
try {
|
|
5995
|
-
return getCore(getDefaultClient());
|
|
5996
|
-
} catch {
|
|
5997
|
-
return;
|
|
5998
|
-
}
|
|
5999
|
-
}
|
|
5855
|
+
getCore: resolveInstrumentationCore
|
|
6000
5856
|
});
|
|
6001
5857
|
|
|
6002
5858
|
//#endregion
|
|
@@ -6968,13 +6824,7 @@ const __sendSmsOTP_impl = sendSmsOTP;
|
|
|
6968
6824
|
const __sendSmsOTP_wrapped = instrumentFunction({
|
|
6969
6825
|
fn: __sendSmsOTP_impl,
|
|
6970
6826
|
functionName: "sendSmsOTP",
|
|
6971
|
-
getCore:
|
|
6972
|
-
try {
|
|
6973
|
-
return getCore(getDefaultClient());
|
|
6974
|
-
} catch {
|
|
6975
|
-
return;
|
|
6976
|
-
}
|
|
6977
|
-
}
|
|
6827
|
+
getCore: resolveInstrumentationCore
|
|
6978
6828
|
});
|
|
6979
6829
|
|
|
6980
6830
|
//#endregion
|
|
@@ -7066,13 +6916,7 @@ const __verifyOTP_impl = verifyOTP;
|
|
|
7066
6916
|
const __verifyOTP_wrapped = instrumentFunction({
|
|
7067
6917
|
fn: __verifyOTP_impl,
|
|
7068
6918
|
functionName: "verifyOTP",
|
|
7069
|
-
getCore:
|
|
7070
|
-
try {
|
|
7071
|
-
return getCore(getDefaultClient());
|
|
7072
|
-
} catch {
|
|
7073
|
-
return;
|
|
7074
|
-
}
|
|
7075
|
-
}
|
|
6919
|
+
getCore: resolveInstrumentationCore
|
|
7076
6920
|
});
|
|
7077
6921
|
|
|
7078
6922
|
//#endregion
|
|
@@ -7210,13 +7054,7 @@ const __deleteUser_impl = deleteUser;
|
|
|
7210
7054
|
const __deleteUser_wrapped = instrumentFunction({
|
|
7211
7055
|
fn: __deleteUser_impl,
|
|
7212
7056
|
functionName: "deleteUser",
|
|
7213
|
-
getCore:
|
|
7214
|
-
try {
|
|
7215
|
-
return getCore(getDefaultClient());
|
|
7216
|
-
} catch {
|
|
7217
|
-
return;
|
|
7218
|
-
}
|
|
7219
|
-
}
|
|
7057
|
+
getCore: resolveInstrumentationCore
|
|
7220
7058
|
});
|
|
7221
7059
|
|
|
7222
7060
|
//#endregion
|
|
@@ -7359,13 +7197,7 @@ const __getGoogleDriveBackupReadiness_impl = getGoogleDriveBackupReadiness;
|
|
|
7359
7197
|
const __getGoogleDriveBackupReadiness_wrapped = instrumentFunction({
|
|
7360
7198
|
fn: __getGoogleDriveBackupReadiness_impl,
|
|
7361
7199
|
functionName: "getGoogleDriveBackupReadiness",
|
|
7362
|
-
getCore:
|
|
7363
|
-
try {
|
|
7364
|
-
return getCore(getDefaultClient());
|
|
7365
|
-
} catch {
|
|
7366
|
-
return;
|
|
7367
|
-
}
|
|
7368
|
-
}
|
|
7200
|
+
getCore: resolveInstrumentationCore
|
|
7369
7201
|
});
|
|
7370
7202
|
|
|
7371
7203
|
//#endregion
|
|
@@ -7617,90 +7449,6 @@ const getChainsFromWalletSchema = ({ wallet, walletKey }) => {
|
|
|
7617
7449
|
return Array.from(chains);
|
|
7618
7450
|
};
|
|
7619
7451
|
|
|
7620
|
-
//#endregion
|
|
7621
|
-
//#region src/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.ts
|
|
7622
|
-
/**
|
|
7623
|
-
* Resolves which wallet option (group) a wallet book entry belongs to. Used
|
|
7624
|
-
* by the catalogue's wallet-book-driven transformers (URI deeplink,
|
|
7625
|
-
* `inAppBrowser`, `installation`) to bucket their emitted options.
|
|
7626
|
-
*
|
|
7627
|
-
* Wallet book entries inconsistently use `group` / `chainGroup` /
|
|
7628
|
-
* `walletGroup` for the same idea. The wallet key itself acts as the wallet
|
|
7629
|
-
* option key when no group field is set.
|
|
7630
|
-
*
|
|
7631
|
-
* @param params.wallet - The wallet entry.
|
|
7632
|
-
* @param params.walletKey - The wallet's key in `walletBook.wallets`.
|
|
7633
|
-
* @returns The wallet option key.
|
|
7634
|
-
* @notInstrumented
|
|
7635
|
-
*/
|
|
7636
|
-
const resolveWalletBookWalletOptionKey = ({ wallet, walletKey }) => wallet.group ?? wallet.chainGroup ?? wallet.walletGroup ?? walletKey;
|
|
7637
|
-
|
|
7638
|
-
//#endregion
|
|
7639
|
-
//#region src/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/getInAppBrowserUrl.ts
|
|
7640
|
-
/**
|
|
7641
|
-
* Returns the wallet's in-app browser URL template, preferring the v2
|
|
7642
|
-
* field. `inAppBrowser` is deprecated but some wallet book entries
|
|
7643
|
-
* still carry only the v1 value, so it acts as a fallback. Trailing
|
|
7644
|
-
* `?? undefined` collapses the schema's `string | null` typing down to
|
|
7645
|
-
* the `string | undefined` return contract.
|
|
7646
|
-
*
|
|
7647
|
-
* @param params.wallet - The wallet book wallet entry.
|
|
7648
|
-
* @returns The in-app browser URL, or `undefined` if neither field is set.
|
|
7649
|
-
* @notInstrumented
|
|
7650
|
-
*/
|
|
7651
|
-
const getInAppBrowserUrl = ({ wallet }) => wallet.mobile?.inAppBrowserV2 ?? wallet.mobile?.inAppBrowser ?? void 0;
|
|
7652
|
-
|
|
7653
|
-
//#endregion
|
|
7654
|
-
//#region src/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.ts
|
|
7655
|
-
/**
|
|
7656
|
-
* Builds the `inAppBrowser` catalogue options from the wallet book. A wallet
|
|
7657
|
-
* qualifies when it exposes a mobile in-app-browser URL — typically a
|
|
7658
|
-
* `cb_url={{encodedDappURI}}`-style template the customer fills in with the
|
|
7659
|
-
* current page URL before opening.
|
|
7660
|
-
*
|
|
7661
|
-
* Reuses the generic `shouldFilterWallet` rules — embedded sign-in methods
|
|
7662
|
-
* and injected-only wallets are dropped — so the catalogue's notion of
|
|
7663
|
-
* "external wallet" stays consistent across option types.
|
|
7664
|
-
*
|
|
7665
|
-
* A wallet's in-app browser opens a single session, so it emits one option
|
|
7666
|
-
* tagged with the first chain it advertises that the client has an
|
|
7667
|
-
* extension for — a multi-chain wallet is still reachable when only one of
|
|
7668
|
-
* its chains is enabled.
|
|
7669
|
-
*
|
|
7670
|
-
* @param params.enabledChains - Chains the client has an extension for.
|
|
7671
|
-
* @param params.walletBook - The fetched wallet book.
|
|
7672
|
-
* @returns Tagged `inAppBrowser` options paired with their wallet option keys.
|
|
7673
|
-
* @notInstrumented
|
|
7674
|
-
*/
|
|
7675
|
-
const buildInAppBrowserOptions = ({ enabledChains, walletBook }) => {
|
|
7676
|
-
const result = [];
|
|
7677
|
-
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
7678
|
-
if (shouldFilterWallet({
|
|
7679
|
-
wallet,
|
|
7680
|
-
walletKey
|
|
7681
|
-
})) continue;
|
|
7682
|
-
const url = getInAppBrowserUrl({ wallet });
|
|
7683
|
-
if (!url) continue;
|
|
7684
|
-
const chain = getChainsFromWalletSchema({
|
|
7685
|
-
wallet,
|
|
7686
|
-
walletKey
|
|
7687
|
-
}).find((advertisedChain) => enabledChains.has(advertisedChain));
|
|
7688
|
-
if (!chain) continue;
|
|
7689
|
-
result.push({
|
|
7690
|
-
option: {
|
|
7691
|
-
chain,
|
|
7692
|
-
type: "inAppBrowser",
|
|
7693
|
-
url
|
|
7694
|
-
},
|
|
7695
|
-
walletOptionKey: resolveWalletBookWalletOptionKey({
|
|
7696
|
-
wallet,
|
|
7697
|
-
walletKey
|
|
7698
|
-
})
|
|
7699
|
-
});
|
|
7700
|
-
}
|
|
7701
|
-
return result;
|
|
7702
|
-
};
|
|
7703
|
-
|
|
7704
7452
|
//#endregion
|
|
7705
7453
|
//#region src/modules/walletOptionsCatalogue/buildInstallationUrls/buildInstallationUrls.ts
|
|
7706
7454
|
const PLAY_STORE_URL_TEMPLATE = "https://play.google.com/store/apps/details?id=";
|
|
@@ -7738,6 +7486,24 @@ const buildInstallationUrls = ({ wallet }) => {
|
|
|
7738
7486
|
};
|
|
7739
7487
|
};
|
|
7740
7488
|
|
|
7489
|
+
//#endregion
|
|
7490
|
+
//#region src/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.ts
|
|
7491
|
+
/**
|
|
7492
|
+
* Resolves which wallet option (group) a wallet book entry belongs to. Used
|
|
7493
|
+
* by the catalogue's wallet-book-driven transformers (URI deeplink,
|
|
7494
|
+
* `inAppBrowser`, `installation`) to bucket their emitted options.
|
|
7495
|
+
*
|
|
7496
|
+
* Wallet book entries inconsistently use `group` / `chainGroup` /
|
|
7497
|
+
* `walletGroup` for the same idea. The wallet key itself acts as the wallet
|
|
7498
|
+
* option key when no group field is set.
|
|
7499
|
+
*
|
|
7500
|
+
* @param params.wallet - The wallet entry.
|
|
7501
|
+
* @param params.walletKey - The wallet's key in `walletBook.wallets`.
|
|
7502
|
+
* @returns The wallet option key.
|
|
7503
|
+
* @notInstrumented
|
|
7504
|
+
*/
|
|
7505
|
+
const resolveWalletBookWalletOptionKey = ({ wallet, walletKey }) => wallet.group ?? wallet.chainGroup ?? wallet.walletGroup ?? walletKey;
|
|
7506
|
+
|
|
7741
7507
|
//#endregion
|
|
7742
7508
|
//#region src/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.ts
|
|
7743
7509
|
/**
|
|
@@ -7791,6 +7557,97 @@ const buildInstallationUrlsByWalletOptionKey = ({ enabledChains, walletBook }) =
|
|
|
7791
7557
|
return map;
|
|
7792
7558
|
};
|
|
7793
7559
|
|
|
7560
|
+
//#endregion
|
|
7561
|
+
//#region src/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterChains/getUriConnectionStarterChains.ts
|
|
7562
|
+
/**
|
|
7563
|
+
* Returns the chains that have a URI connection starter registered for a
|
|
7564
|
+
* given URI protocol. An empty set means no chain extension can mint a
|
|
7565
|
+
* pairing URI for that protocol, so surfaces driven by it are not
|
|
7566
|
+
* reachable on this client.
|
|
7567
|
+
*
|
|
7568
|
+
* @example
|
|
7569
|
+
* ```ts
|
|
7570
|
+
* const chains = getUriConnectionStarterChains({ type: 'walletConnect' }, client);
|
|
7571
|
+
* ```
|
|
7572
|
+
*
|
|
7573
|
+
* @param params.type - The URI protocol to look up starters for.
|
|
7574
|
+
* @param client - The Dynamic client instance.
|
|
7575
|
+
* @returns The chains with a registered starter for the given protocol.
|
|
7576
|
+
* @see getUriConnectionStarterRegistry
|
|
7577
|
+
* @see UriConnectionType
|
|
7578
|
+
* @notInstrumented
|
|
7579
|
+
*/
|
|
7580
|
+
const getUriConnectionStarterChains = ({ type }, client) => {
|
|
7581
|
+
const starters = getUriConnectionStarterRegistry(client).getAll();
|
|
7582
|
+
return new Set(starters.filter((starter) => starter.type === type).map((starter) => starter.chain));
|
|
7583
|
+
};
|
|
7584
|
+
|
|
7585
|
+
//#endregion
|
|
7586
|
+
//#region src/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/getInAppBrowserUrl.ts
|
|
7587
|
+
/**
|
|
7588
|
+
* Returns the wallet's in-app browser URL template, preferring the v2
|
|
7589
|
+
* field. `inAppBrowser` is deprecated but some wallet book entries
|
|
7590
|
+
* still carry only the v1 value, so it acts as a fallback. Trailing
|
|
7591
|
+
* `?? undefined` collapses the schema's `string | null` typing down to
|
|
7592
|
+
* the `string | undefined` return contract.
|
|
7593
|
+
*
|
|
7594
|
+
* @param params.wallet - The wallet book wallet entry.
|
|
7595
|
+
* @returns The in-app browser URL, or `undefined` if neither field is set.
|
|
7596
|
+
* @notInstrumented
|
|
7597
|
+
*/
|
|
7598
|
+
const getInAppBrowserUrl = ({ wallet }) => wallet.mobile?.inAppBrowserV2 ?? wallet.mobile?.inAppBrowser ?? void 0;
|
|
7599
|
+
|
|
7600
|
+
//#endregion
|
|
7601
|
+
//#region src/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.ts
|
|
7602
|
+
/**
|
|
7603
|
+
* Builds the `inAppBrowser` catalogue options from the wallet book. A wallet
|
|
7604
|
+
* qualifies when it exposes a mobile in-app-browser URL — typically a
|
|
7605
|
+
* `cb_url={{encodedDappURI}}`-style template the customer fills in with the
|
|
7606
|
+
* current page URL before opening.
|
|
7607
|
+
*
|
|
7608
|
+
* Reuses the generic `shouldFilterWallet` rules — embedded sign-in methods
|
|
7609
|
+
* and injected-only wallets are dropped — so the catalogue's notion of
|
|
7610
|
+
* "external wallet" stays consistent across option types.
|
|
7611
|
+
*
|
|
7612
|
+
* A wallet's in-app browser opens a single session, so it emits one option
|
|
7613
|
+
* tagged with the first chain it advertises that the client has an
|
|
7614
|
+
* extension for — a multi-chain wallet is still reachable when only one of
|
|
7615
|
+
* its chains is enabled.
|
|
7616
|
+
*
|
|
7617
|
+
* @param params.enabledChains - Chains the client has an extension for.
|
|
7618
|
+
* @param params.walletBook - The fetched wallet book.
|
|
7619
|
+
* @returns Tagged `inAppBrowser` options paired with their wallet option keys.
|
|
7620
|
+
* @notInstrumented
|
|
7621
|
+
*/
|
|
7622
|
+
const buildInAppBrowserOptions = ({ enabledChains, walletBook }) => {
|
|
7623
|
+
const result = [];
|
|
7624
|
+
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
7625
|
+
if (shouldFilterWallet({
|
|
7626
|
+
wallet,
|
|
7627
|
+
walletKey
|
|
7628
|
+
})) continue;
|
|
7629
|
+
const url = getInAppBrowserUrl({ wallet });
|
|
7630
|
+
if (!url) continue;
|
|
7631
|
+
const chain = getChainsFromWalletSchema({
|
|
7632
|
+
wallet,
|
|
7633
|
+
walletKey
|
|
7634
|
+
}).find((advertisedChain) => enabledChains.has(advertisedChain));
|
|
7635
|
+
if (!chain) continue;
|
|
7636
|
+
result.push({
|
|
7637
|
+
option: {
|
|
7638
|
+
chain,
|
|
7639
|
+
type: "inAppBrowser",
|
|
7640
|
+
url
|
|
7641
|
+
},
|
|
7642
|
+
walletOptionKey: resolveWalletBookWalletOptionKey({
|
|
7643
|
+
wallet,
|
|
7644
|
+
walletKey
|
|
7645
|
+
})
|
|
7646
|
+
});
|
|
7647
|
+
}
|
|
7648
|
+
return result;
|
|
7649
|
+
};
|
|
7650
|
+
|
|
7794
7651
|
//#endregion
|
|
7795
7652
|
//#region src/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.ts
|
|
7796
7653
|
/**
|
|
@@ -7874,13 +7731,6 @@ const buildMetaMaskSdkUriOptions = ({ walletBook }) => {
|
|
|
7874
7731
|
//#endregion
|
|
7875
7732
|
//#region src/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.ts
|
|
7876
7733
|
/**
|
|
7877
|
-
* Chains Dynamic ships a WalletConnect extension for. Anything else a
|
|
7878
|
-
* wallet book entry advertises (Cosmos, BTC, …) gets filtered out — the
|
|
7879
|
-
* catalogue should not surface a chain the SDK has no `connectWithWalletConnect<Chain>`
|
|
7880
|
-
* primitive for.
|
|
7881
|
-
*/
|
|
7882
|
-
const WALLETCONNECT_SUPPORTED_CHAINS = new Set(["EVM", "SOL"]);
|
|
7883
|
-
/**
|
|
7884
7734
|
* Builds the `walletConnect`-discriminator catalogue options from a fetched
|
|
7885
7735
|
* wallet book. Applies the WalletConnect-specific eligibility filter
|
|
7886
7736
|
* (`shouldFilterWalletForWalletConnect`) so embedded wallets and entries
|
|
@@ -7894,11 +7744,15 @@ const WALLETCONNECT_SUPPORTED_CHAINS = new Set(["EVM", "SOL"]);
|
|
|
7894
7744
|
* discriminator via `excludedConnectionOptionTypes` doesn't accidentally
|
|
7895
7745
|
* gate the other.
|
|
7896
7746
|
*
|
|
7747
|
+
* Chains a wallet book entry advertises without a registered WalletConnect
|
|
7748
|
+
* starter are filtered out.
|
|
7749
|
+
*
|
|
7897
7750
|
* @param params.walletBook - The fetched wallet book.
|
|
7751
|
+
* @param params.walletConnectChains - Chains with a registered `walletConnect` URI connection starter.
|
|
7898
7752
|
* @returns Tagged `walletConnect` options paired with their wallet option keys.
|
|
7899
7753
|
* @notInstrumented
|
|
7900
7754
|
*/
|
|
7901
|
-
const buildWalletConnectOptions = ({ walletBook }) => {
|
|
7755
|
+
const buildWalletConnectOptions = ({ walletBook, walletConnectChains }) => {
|
|
7902
7756
|
const result = [];
|
|
7903
7757
|
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
7904
7758
|
if (shouldFilterWalletForWalletConnect({
|
|
@@ -7914,7 +7768,7 @@ const buildWalletConnectOptions = ({ walletBook }) => {
|
|
|
7914
7768
|
const chains = getChainsFromWalletSchema({
|
|
7915
7769
|
wallet,
|
|
7916
7770
|
walletKey
|
|
7917
|
-
}).filter((chain) =>
|
|
7771
|
+
}).filter((chain) => walletConnectChains.has(chain));
|
|
7918
7772
|
for (const chain of chains) result.push({
|
|
7919
7773
|
option: {
|
|
7920
7774
|
chain,
|
|
@@ -7930,6 +7784,108 @@ const buildWalletConnectOptions = ({ walletBook }) => {
|
|
|
7930
7784
|
return result;
|
|
7931
7785
|
};
|
|
7932
7786
|
|
|
7787
|
+
//#endregion
|
|
7788
|
+
//#region src/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/filterConnectionOptionsByEnabledChains.ts
|
|
7789
|
+
/**
|
|
7790
|
+
* Drops options whose chain has no extension on this client. The wallet
|
|
7791
|
+
* book advertises every chain a wallet supports, so options derived from
|
|
7792
|
+
* it have to be narrowed to the chains the client can actually connect
|
|
7793
|
+
* on — otherwise the catalogue surfaces a connection the customer has no
|
|
7794
|
+
* primitive to drive.
|
|
7795
|
+
*
|
|
7796
|
+
* @param params.enabledChains - Chains the client has an extension for.
|
|
7797
|
+
* @param params.options - The tagged options to narrow.
|
|
7798
|
+
* @returns The options on enabled chains, in input order.
|
|
7799
|
+
* @example
|
|
7800
|
+
* ```typescript
|
|
7801
|
+
* filterConnectionOptionsByEnabledChains({
|
|
7802
|
+
* enabledChains: new Set(['EVM']),
|
|
7803
|
+
* options: [evmOption, solOption],
|
|
7804
|
+
* }); // [evmOption]
|
|
7805
|
+
* ```
|
|
7806
|
+
* @see {@link getEnabledChains} for how the enabled chains are derived.
|
|
7807
|
+
* @see {@link getWalletOptionsCatalogue} for the catalogue that applies this filter.
|
|
7808
|
+
* @notInstrumented
|
|
7809
|
+
*/
|
|
7810
|
+
const filterConnectionOptionsByEnabledChains = ({ enabledChains, options }) => options.filter(({ option }) => enabledChains.has(option.chain));
|
|
7811
|
+
|
|
7812
|
+
//#endregion
|
|
7813
|
+
//#region src/modules/walletOptionsCatalogue/buildWalletBookConnectionOptions/buildWalletBookConnectionOptions.ts
|
|
7814
|
+
/**
|
|
7815
|
+
* Builds every wallet-book-sourced connection option — WalletConnect,
|
|
7816
|
+
* MetaMask SDK URI and in-app browser — narrowed to the chains this client
|
|
7817
|
+
* has an extension for.
|
|
7818
|
+
*
|
|
7819
|
+
* Each URI-deeplink discriminator has its own builder with its own
|
|
7820
|
+
* eligibility filter (WalletConnect requires `sign_v2`; MetaMask SDK URI
|
|
7821
|
+
* does not), so excluding one discriminator never gates the other.
|
|
7822
|
+
*
|
|
7823
|
+
* WalletConnect options are emitted only on the chains with a registered
|
|
7824
|
+
* `walletConnect` URI connection starter.
|
|
7825
|
+
*
|
|
7826
|
+
* @example
|
|
7827
|
+
* ```ts
|
|
7828
|
+
* const options = buildWalletBookConnectionOptions(
|
|
7829
|
+
* { enabledChains, excludedConnectionOptionTypes: new Set(), walletBook },
|
|
7830
|
+
* client
|
|
7831
|
+
* );
|
|
7832
|
+
* ```
|
|
7833
|
+
*
|
|
7834
|
+
* @param params.enabledChains - Chains the client has an extension for.
|
|
7835
|
+
* @param params.excludedConnectionOptionTypes - Connection types to drop.
|
|
7836
|
+
* @param params.walletBook - The fetched wallet book.
|
|
7837
|
+
* @param client - The Dynamic client instance.
|
|
7838
|
+
* @returns Tagged wallet-book options paired with their wallet option keys.
|
|
7839
|
+
* @see getWalletOptionsCatalogue
|
|
7840
|
+
* @see filterConnectionOptionsByEnabledChains
|
|
7841
|
+
* @notInstrumented
|
|
7842
|
+
*/
|
|
7843
|
+
const buildWalletBookConnectionOptions = ({ enabledChains, excludedConnectionOptionTypes, walletBook }, client) => {
|
|
7844
|
+
const options = [];
|
|
7845
|
+
const walletConnectChains = getUriConnectionStarterChains({ type: "walletConnect" }, client);
|
|
7846
|
+
const hasWalletConnectStarter = walletConnectChains.size > 0;
|
|
7847
|
+
if (!excludedConnectionOptionTypes.has("walletConnect") && hasWalletConnectStarter) options.push(...buildWalletConnectOptions({
|
|
7848
|
+
walletBook,
|
|
7849
|
+
walletConnectChains
|
|
7850
|
+
}));
|
|
7851
|
+
if (!excludedConnectionOptionTypes.has("metamaskSdkUri")) options.push(...buildMetaMaskSdkUriOptions({ walletBook }));
|
|
7852
|
+
if (!excludedConnectionOptionTypes.has("inAppBrowser")) options.push(...buildInAppBrowserOptions({
|
|
7853
|
+
enabledChains,
|
|
7854
|
+
walletBook
|
|
7855
|
+
}));
|
|
7856
|
+
return filterConnectionOptionsByEnabledChains({
|
|
7857
|
+
enabledChains,
|
|
7858
|
+
options
|
|
7859
|
+
});
|
|
7860
|
+
};
|
|
7861
|
+
|
|
7862
|
+
//#endregion
|
|
7863
|
+
//#region src/modules/walletOptionsCatalogue/deriveSupportedChains/deriveSupportedChains.ts
|
|
7864
|
+
/**
|
|
7865
|
+
* Derives the chains a wallet option can be connected on from its connection
|
|
7866
|
+
* options, deduped and sorted alphabetically so the order is stable
|
|
7867
|
+
* regardless of how the connection options rank.
|
|
7868
|
+
*
|
|
7869
|
+
* Install-only wallet options have no connection options, so they support no
|
|
7870
|
+
* chain until the wallet is installed.
|
|
7871
|
+
*
|
|
7872
|
+
* @example
|
|
7873
|
+
* ```ts
|
|
7874
|
+
* const supportedChains = deriveSupportedChains({ connectionOptions });
|
|
7875
|
+
* ```
|
|
7876
|
+
*
|
|
7877
|
+
* @param params.connectionOptions - The wallet option's connection options.
|
|
7878
|
+
* @returns The chains supported by the wallet option.
|
|
7879
|
+
* @see buildWalletOption
|
|
7880
|
+
* @see WalletOption
|
|
7881
|
+
* @notInstrumented
|
|
7882
|
+
*/
|
|
7883
|
+
const deriveSupportedChains = ({ connectionOptions }) => {
|
|
7884
|
+
const chains = /* @__PURE__ */ new Set();
|
|
7885
|
+
for (const connectionOption of connectionOptions) chains.add(connectionOption.chain);
|
|
7886
|
+
return Array.from(chains).sort((a, b) => a.localeCompare(b));
|
|
7887
|
+
};
|
|
7888
|
+
|
|
7933
7889
|
//#endregion
|
|
7934
7890
|
//#region src/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.ts
|
|
7935
7891
|
/**
|
|
@@ -7978,7 +7934,8 @@ const buildWalletOption = ({ connectionOptions, displayOverride, installationUrl
|
|
|
7978
7934
|
installationUrls,
|
|
7979
7935
|
key: walletOptionKey,
|
|
7980
7936
|
name: displayOverride?.name ?? group?.name ?? walletEntry?.name ?? walletOptionKey,
|
|
7981
|
-
primaryColor: group?.brand?.primaryColor ?? walletEntry?.brand?.primaryColor
|
|
7937
|
+
primaryColor: group?.brand?.primaryColor ?? walletEntry?.brand?.primaryColor,
|
|
7938
|
+
supportedChains: deriveSupportedChains({ connectionOptions })
|
|
7982
7939
|
};
|
|
7983
7940
|
};
|
|
7984
7941
|
|
|
@@ -8256,38 +8213,13 @@ const buildWithWalletProviderOptions = ({ entries, walletBook }, client) => {
|
|
|
8256
8213
|
const EXCLUDED_WALLET_OPTION_KEYS = new Set(["coinbase", "coinbasewallet"]);
|
|
8257
8214
|
|
|
8258
8215
|
//#endregion
|
|
8259
|
-
//#region src/modules/walletOptionsCatalogue/
|
|
8216
|
+
//#region src/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.ts
|
|
8260
8217
|
/**
|
|
8261
|
-
*
|
|
8262
|
-
*
|
|
8263
|
-
*
|
|
8264
|
-
*
|
|
8265
|
-
*
|
|
8266
|
-
*
|
|
8267
|
-
* @param params.enabledChains - Chains the client has an extension for.
|
|
8268
|
-
* @param params.options - The tagged options to narrow.
|
|
8269
|
-
* @returns The options on enabled chains, in input order.
|
|
8270
|
-
* @example
|
|
8271
|
-
* ```typescript
|
|
8272
|
-
* filterConnectionOptionsByEnabledChains({
|
|
8273
|
-
* enabledChains: new Set(['EVM']),
|
|
8274
|
-
* options: [evmOption, solOption],
|
|
8275
|
-
* }); // [evmOption]
|
|
8276
|
-
* ```
|
|
8277
|
-
* @see {@link getEnabledChains} for how the enabled chains are derived.
|
|
8278
|
-
* @see {@link getWalletOptionsCatalogue} for the catalogue that applies this filter.
|
|
8279
|
-
* @notInstrumented
|
|
8280
|
-
*/
|
|
8281
|
-
const filterConnectionOptionsByEnabledChains = ({ enabledChains, options }) => options.filter(({ option }) => enabledChains.has(option.chain));
|
|
8282
|
-
|
|
8283
|
-
//#endregion
|
|
8284
|
-
//#region src/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.ts
|
|
8285
|
-
/**
|
|
8286
|
-
* Buckets tagged connection options by their wallet option key. Preserves
|
|
8287
|
-
* first-seen order so that the caller's choice of
|
|
8288
|
-
* `walletOptionOrdering: 'relevance'` naturally inherits the upstream input
|
|
8289
|
-
* order (wallet book order for walletConnect/inAppBrowser/installation,
|
|
8290
|
-
* registry order for withWalletProvider).
|
|
8218
|
+
* Buckets tagged connection options by their wallet option key. Preserves
|
|
8219
|
+
* first-seen order so that the caller's choice of
|
|
8220
|
+
* `walletOptionOrdering: 'relevance'` naturally inherits the upstream input
|
|
8221
|
+
* order (wallet book order for walletConnect/inAppBrowser/installation,
|
|
8222
|
+
* registry order for withWalletProvider).
|
|
8291
8223
|
*
|
|
8292
8224
|
* Carries through the first-seen `displayOverride` per wallet option
|
|
8293
8225
|
* key, so the shell builder can apply provider-announced metadata on
|
|
@@ -8443,19 +8375,26 @@ const compareByRelevance = ({ a, b }) => {
|
|
|
8443
8375
|
const hasAnyConnectionOption = ({ walletOption }) => walletOption.connectionOptions.length > 0;
|
|
8444
8376
|
|
|
8445
8377
|
//#endregion
|
|
8446
|
-
//#region src/modules/walletOptionsCatalogue/
|
|
8378
|
+
//#region src/modules/walletOptionsCatalogue/isWalletExtensionInstalled/isWalletExtensionInstalled.ts
|
|
8447
8379
|
/**
|
|
8448
|
-
*
|
|
8449
|
-
*
|
|
8450
|
-
* Wallet Standard announcement, window injection, or an SDK-backed
|
|
8451
|
-
*
|
|
8452
|
-
* pre-sorted, so a registered provider always sits at index 0 when present.
|
|
8380
|
+
* Returns true when the wallet option has any `withWalletProvider` connection
|
|
8381
|
+
* option, meaning the wallet is available in the page through a browser
|
|
8382
|
+
* extension, Wallet Standard announcement, window injection, or an SDK-backed
|
|
8383
|
+
* provider registered by a chain extension.
|
|
8453
8384
|
*
|
|
8385
|
+
* @description Detects whether a wallet option is available through a provider
|
|
8386
|
+
* registered in the page.
|
|
8454
8387
|
* @param params.walletOption - The wallet option to inspect.
|
|
8455
|
-
* @returns True when
|
|
8388
|
+
* @returns True when the wallet is available in the page.
|
|
8389
|
+
* @example
|
|
8390
|
+
* ```ts
|
|
8391
|
+
* const isInstalled = isWalletExtensionInstalled({ walletOption });
|
|
8392
|
+
* ```
|
|
8393
|
+
* @see getWalletOptionsCatalogue
|
|
8394
|
+
* @see WalletOption
|
|
8456
8395
|
* @notInstrumented
|
|
8457
8396
|
*/
|
|
8458
|
-
const
|
|
8397
|
+
const isWalletExtensionInstalled = ({ walletOption }) => walletOption.connectionOptions.some(({ type }) => type === "withWalletProvider");
|
|
8459
8398
|
|
|
8460
8399
|
//#endregion
|
|
8461
8400
|
//#region src/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.ts
|
|
@@ -8468,7 +8407,7 @@ const hasInstalledProvider = ({ walletOption }) => walletOption.connectionOption
|
|
|
8468
8407
|
* - `'relevance'` (default): bucket wallet options into three tiers, in
|
|
8469
8408
|
* this order:
|
|
8470
8409
|
* 1. **Installed provider** — user already has the wallet available
|
|
8471
|
-
* (`withWalletProvider`
|
|
8410
|
+
* (any `withWalletProvider` connection option).
|
|
8472
8411
|
* 2. **Connectable** — has at least one connection (URI deeplink
|
|
8473
8412
|
* or `inAppBrowser`) but no installed provider.
|
|
8474
8413
|
* 3. **Install-only** — no connection at all; only `installationUrls`.
|
|
@@ -8490,7 +8429,7 @@ const sortWalletOptions = ({ walletOptions, ordering }) => {
|
|
|
8490
8429
|
const installed = [];
|
|
8491
8430
|
const connectable = [];
|
|
8492
8431
|
const installOnly = [];
|
|
8493
|
-
for (const walletOption of walletOptions) if (
|
|
8432
|
+
for (const walletOption of walletOptions) if (isWalletExtensionInstalled({ walletOption })) installed.push(walletOption);
|
|
8494
8433
|
else if (hasAnyConnectionOption({ walletOption })) connectable.push(walletOption);
|
|
8495
8434
|
else installOnly.push(walletOption);
|
|
8496
8435
|
installed.sort((a, b) => compareByRelevance({
|
|
@@ -8528,6 +8467,10 @@ const EMPTY_WALLET_BOOK = {
|
|
|
8528
8467
|
* client has an extension for — a wallet is only surfaced on chains the
|
|
8529
8468
|
* customer can actually connect on.
|
|
8530
8469
|
*
|
|
8470
|
+
* WalletConnect surfaces require a registered `walletConnect` URI
|
|
8471
|
+
* connection starter, so they only appear once a chain extension that can
|
|
8472
|
+
* mint a WalletConnect URI is added to the client.
|
|
8473
|
+
*
|
|
8531
8474
|
* Pass `excludedConnectionOptionTypes` to drop specific connection types
|
|
8532
8475
|
* from the catalogue (e.g. `['inAppBrowser']` on desktop). Wallets whose
|
|
8533
8476
|
* only connection was an excluded type fall through to the install-only
|
|
@@ -8552,19 +8495,11 @@ const getWalletOptionsCatalogue = async (params = {}, client = getDefaultClient(
|
|
|
8552
8495
|
walletBook
|
|
8553
8496
|
}, client));
|
|
8554
8497
|
}
|
|
8555
|
-
if (includeMobileOptions) {
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
enabledChains,
|
|
8561
|
-
walletBook
|
|
8562
|
-
}));
|
|
8563
|
-
allConnectionOptions.push(...filterConnectionOptionsByEnabledChains({
|
|
8564
|
-
enabledChains,
|
|
8565
|
-
options: walletBookOptions
|
|
8566
|
-
}));
|
|
8567
|
-
}
|
|
8498
|
+
if (includeMobileOptions) allConnectionOptions.push(...buildWalletBookConnectionOptions({
|
|
8499
|
+
enabledChains,
|
|
8500
|
+
excludedConnectionOptionTypes,
|
|
8501
|
+
walletBook
|
|
8502
|
+
}, client));
|
|
8568
8503
|
const installationUrlsByKey = includeMobileOptions ? buildInstallationUrlsByWalletOptionKey({
|
|
8569
8504
|
enabledChains,
|
|
8570
8505
|
walletBook
|
|
@@ -8643,13 +8578,7 @@ const __confirmTransaction_impl = confirmTransaction;
|
|
|
8643
8578
|
const __confirmTransaction_wrapped = instrumentFunction({
|
|
8644
8579
|
fn: __confirmTransaction_impl,
|
|
8645
8580
|
functionName: "confirmTransaction",
|
|
8646
|
-
getCore:
|
|
8647
|
-
try {
|
|
8648
|
-
return getCore(getDefaultClient());
|
|
8649
|
-
} catch {
|
|
8650
|
-
return;
|
|
8651
|
-
}
|
|
8652
|
-
}
|
|
8581
|
+
getCore: resolveInstrumentationCore
|
|
8653
8582
|
});
|
|
8654
8583
|
|
|
8655
8584
|
//#endregion
|
|
@@ -8743,13 +8672,7 @@ const __connectWithWalletProvider_impl = connectWithWalletProvider;
|
|
|
8743
8672
|
const __connectWithWalletProvider_wrapped = instrumentFunction({
|
|
8744
8673
|
fn: __connectWithWalletProvider_impl,
|
|
8745
8674
|
functionName: "connectWithWalletProvider",
|
|
8746
|
-
getCore:
|
|
8747
|
-
try {
|
|
8748
|
-
return getCore(getDefaultClient());
|
|
8749
|
-
} catch {
|
|
8750
|
-
return;
|
|
8751
|
-
}
|
|
8752
|
-
}
|
|
8675
|
+
getCore: resolveInstrumentationCore
|
|
8753
8676
|
});
|
|
8754
8677
|
|
|
8755
8678
|
//#endregion
|
|
@@ -8878,13 +8801,7 @@ const __proveWalletAccountOwnership_impl = proveWalletAccountOwnership;
|
|
|
8878
8801
|
const __proveWalletAccountOwnership_wrapped = instrumentFunction({
|
|
8879
8802
|
fn: __proveWalletAccountOwnership_impl,
|
|
8880
8803
|
functionName: "proveWalletAccountOwnership",
|
|
8881
|
-
getCore:
|
|
8882
|
-
try {
|
|
8883
|
-
return getCore(getDefaultClient());
|
|
8884
|
-
} catch {
|
|
8885
|
-
return;
|
|
8886
|
-
}
|
|
8887
|
-
}
|
|
8804
|
+
getCore: resolveInstrumentationCore
|
|
8888
8805
|
});
|
|
8889
8806
|
|
|
8890
8807
|
//#endregion
|
|
@@ -8994,13 +8911,7 @@ const __verifyWalletAccount_impl = verifyWalletAccount;
|
|
|
8994
8911
|
const __verifyWalletAccount_wrapped = instrumentFunction({
|
|
8995
8912
|
fn: __verifyWalletAccount_impl,
|
|
8996
8913
|
functionName: "verifyWalletAccount",
|
|
8997
|
-
getCore:
|
|
8998
|
-
try {
|
|
8999
|
-
return getCore(getDefaultClient());
|
|
9000
|
-
} catch {
|
|
9001
|
-
return;
|
|
9002
|
-
}
|
|
9003
|
-
}
|
|
8914
|
+
getCore: resolveInstrumentationCore
|
|
9004
8915
|
});
|
|
9005
8916
|
|
|
9006
8917
|
//#endregion
|
|
@@ -9032,46 +8943,479 @@ const isDeeplinkWalletProvider = ({ walletProvider }) => walletProvider.walletPr
|
|
|
9032
8943
|
*
|
|
9033
8944
|
* @example
|
|
9034
8945
|
* ```ts
|
|
9035
|
-
* const walletAccount = await connectAndVerifyWithWalletProvider({
|
|
9036
|
-
* walletProviderKey: 'metamaskevm',
|
|
8946
|
+
* const walletAccount = await connectAndVerifyWithWalletProvider({
|
|
8947
|
+
* walletProviderKey: 'metamaskevm',
|
|
8948
|
+
* });
|
|
8949
|
+
* console.log('Verified address:', walletAccount.address);
|
|
8950
|
+
* ```
|
|
8951
|
+
*
|
|
8952
|
+
* @param params.walletProviderKey - The unique key identifying the wallet provider to connect to.
|
|
8953
|
+
* @param [params.hardwareWalletVendor] - The hardware wallet vendor, if connecting via a hardware wallet (e.g. 'ledger').
|
|
8954
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
8955
|
+
* @returns A promise that resolves to the connected and verified wallet account.
|
|
8956
|
+
* @see connectWithWalletProvider
|
|
8957
|
+
* @see verifyWalletAccount
|
|
8958
|
+
* @instrumented
|
|
8959
|
+
*/
|
|
8960
|
+
const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareWalletVendor }, client = getDefaultClient()) => {
|
|
8961
|
+
const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
|
|
8962
|
+
if (isMobile() && isDeeplinkWalletProvider({ walletProvider })) throw new DeeplinkConnectAndVerifyUnsupportedError({ walletProviderKey });
|
|
8963
|
+
const walletAccount = await __connectWithWalletProvider_wrapped({
|
|
8964
|
+
addToDynamicWalletAccounts: false,
|
|
8965
|
+
hardwareWalletVendor,
|
|
8966
|
+
walletProviderKey
|
|
8967
|
+
}, client);
|
|
8968
|
+
await __verifyWalletAccount_wrapped({ walletAccount }, client);
|
|
8969
|
+
createVisit({
|
|
8970
|
+
authMode: AuthModeEnum.AndSign,
|
|
8971
|
+
walletAccount
|
|
8972
|
+
}, client);
|
|
8973
|
+
return walletAccount;
|
|
8974
|
+
};
|
|
8975
|
+
const __connectAndVerifyWithWalletProvider_impl = connectAndVerifyWithWalletProvider;
|
|
8976
|
+
const __connectAndVerifyWithWalletProvider_wrapped = instrumentFunction({
|
|
8977
|
+
fn: __connectAndVerifyWithWalletProvider_impl,
|
|
8978
|
+
functionName: "connectAndVerifyWithWalletProvider",
|
|
8979
|
+
getCore: resolveInstrumentationCore
|
|
8980
|
+
});
|
|
8981
|
+
|
|
8982
|
+
//#endregion
|
|
8983
|
+
//#region src/utils/appendConnectionUriToDeeplink/appendConnectionUriToDeeplink.ts
|
|
8984
|
+
/**
|
|
8985
|
+
* Appends a wallet connection URI to a deeplink URL.
|
|
8986
|
+
*
|
|
8987
|
+
* Generic across URI-deeplink connection options — works for both
|
|
8988
|
+
* WalletConnect pairing URIs and MetaMask SDK URIs. Determines the
|
|
8989
|
+
* appropriate query parameter separator based on whether the deeplink
|
|
8990
|
+
* already contains query parameters.
|
|
8991
|
+
*
|
|
8992
|
+
* @param params.deeplinkUrl - The base deeplink URL (e.g., `walletapp://wc` or `walletapp://wc?param=value`).
|
|
8993
|
+
* @param params.connectionUri - The connection URI to append.
|
|
8994
|
+
* @returns The deeplink URL with the connection URI appended as a query parameter.
|
|
8995
|
+
*
|
|
8996
|
+
* @example
|
|
8997
|
+
* ```ts
|
|
8998
|
+
* appendConnectionUriToDeeplink({ deeplinkUrl: 'walletapp://wc', connectionUri: 'wc:123-456' })
|
|
8999
|
+
* // Returns: 'walletapp://wc?uri=wc%3A123-456'
|
|
9000
|
+
*
|
|
9001
|
+
* appendConnectionUriToDeeplink({ deeplinkUrl: 'walletapp://wc?param=value', connectionUri: 'wc:123-456' })
|
|
9002
|
+
* // Returns: 'walletapp://wc?param=value&uri=wc%3A123-456'
|
|
9003
|
+
* ```
|
|
9004
|
+
* @notInstrumented
|
|
9005
|
+
*/
|
|
9006
|
+
const appendConnectionUriToDeeplink = ({ connectionUri, deeplinkUrl }) => {
|
|
9007
|
+
const url = new URL(deeplinkUrl);
|
|
9008
|
+
url.searchParams.set("uri", connectionUri);
|
|
9009
|
+
return url.href;
|
|
9010
|
+
};
|
|
9011
|
+
|
|
9012
|
+
//#endregion
|
|
9013
|
+
//#region src/utils/getPreferredWalletDeepLink/getPreferredWalletDeepLink.ts
|
|
9014
|
+
/**
|
|
9015
|
+
* Picks the most appropriate deep link variant for the current platform.
|
|
9016
|
+
*
|
|
9017
|
+
* Mobile (Android, iOS, tablets) prefers `native` because the OS treats
|
|
9018
|
+
* custom URL schemes as first-class app links and gives the wallet a faster
|
|
9019
|
+
* round-trip back to the dApp. Desktop prefers `universal` because browsers
|
|
9020
|
+
* cannot resolve mobile-only custom schemes and need an `https://` link
|
|
9021
|
+
* that opens the wallet's web flow.
|
|
9022
|
+
*
|
|
9023
|
+
* In either case, the alternative is used as a fallback when the preferred
|
|
9024
|
+
* variant is missing. Returns `undefined` only when both variants are
|
|
9025
|
+
* absent.
|
|
9026
|
+
*
|
|
9027
|
+
* @example
|
|
9028
|
+
* ```ts
|
|
9029
|
+
* const deepLink = getPreferredWalletDeepLink({
|
|
9030
|
+
* deeplinks: wallet.deeplinks,
|
|
9031
|
+
* });
|
|
9032
|
+
* ```
|
|
9033
|
+
*
|
|
9034
|
+
* @param params.deeplinks - The deep link variants for a wallet (typically `WalletConnectCatalogWallet.deeplinks`).
|
|
9035
|
+
* @returns The preferred deep link URL, or `undefined` if neither variant is available.
|
|
9036
|
+
* @see appendConnectionUriToDeeplink
|
|
9037
|
+
* @see getConnectionUriDeeplink
|
|
9038
|
+
* @notInstrumented
|
|
9039
|
+
*/
|
|
9040
|
+
const getPreferredWalletDeepLink = ({ deeplinks }) => {
|
|
9041
|
+
const { native, universal } = deeplinks;
|
|
9042
|
+
if (isMobile()) return native ?? universal;
|
|
9043
|
+
return universal ?? native;
|
|
9044
|
+
};
|
|
9045
|
+
|
|
9046
|
+
//#endregion
|
|
9047
|
+
//#region src/modules/wallets/connectWithUriConnectionOption/getConnectionUriDeeplink/getConnectionUriDeeplink.ts
|
|
9048
|
+
/**
|
|
9049
|
+
* Builds the single deeplink that hands a pairing URI to the wallet, picking
|
|
9050
|
+
* the shape the URI's protocol expects.
|
|
9051
|
+
*
|
|
9052
|
+
* A WalletConnect URI travels as the `uri` query parameter of the wallet's own
|
|
9053
|
+
* deeplink, whereas the MetaMask SDK mints a launch link that already targets
|
|
9054
|
+
* MetaMask, so it is handed over untouched.
|
|
9055
|
+
*
|
|
9056
|
+
* @example
|
|
9057
|
+
* ```ts
|
|
9058
|
+
* const deeplink = getConnectionUriDeeplink({
|
|
9059
|
+
* deeplinks: connectionOption.deeplinks,
|
|
9060
|
+
* type: connectionOption.type,
|
|
9061
|
+
* uri,
|
|
9062
|
+
* });
|
|
9063
|
+
* ```
|
|
9064
|
+
*
|
|
9065
|
+
* @param params.deeplinks - The wallet's deeplink variants, as carried by the wallet book.
|
|
9066
|
+
* @param params.type - The URI connection type that minted the URI.
|
|
9067
|
+
* @param params.uri - The pairing URI.
|
|
9068
|
+
* @returns The deeplink to open, or `undefined` when the wallet publishes no deeplink to carry the URI.
|
|
9069
|
+
* @see getPreferredWalletDeepLink
|
|
9070
|
+
* @see appendConnectionUriToDeeplink
|
|
9071
|
+
* @notInstrumented
|
|
9072
|
+
*/
|
|
9073
|
+
const getConnectionUriDeeplink = ({ deeplinks, type, uri }) => {
|
|
9074
|
+
if (type === "metamaskSdkUri") return uri;
|
|
9075
|
+
const deeplinkUrl = getPreferredWalletDeepLink({ deeplinks });
|
|
9076
|
+
if (!deeplinkUrl) return;
|
|
9077
|
+
return appendConnectionUriToDeeplink({
|
|
9078
|
+
connectionUri: uri,
|
|
9079
|
+
deeplinkUrl
|
|
9080
|
+
});
|
|
9081
|
+
};
|
|
9082
|
+
|
|
9083
|
+
//#endregion
|
|
9084
|
+
//#region src/modules/wallets/connectWithUriConnectionOption/connectWithUriConnectionOption.ts
|
|
9085
|
+
/**
|
|
9086
|
+
* Connects to a wallet through a URI pairing and returns the connected wallet
|
|
9087
|
+
* account.
|
|
9088
|
+
*
|
|
9089
|
+
* Mints the pairing URI with the starter the chain extension registered for
|
|
9090
|
+
* the option's chain and URI type, hands it to `onConnectionUri` as the
|
|
9091
|
+
* wallet's deeplink carrying the pairing so the customer can render a QR code
|
|
9092
|
+
* or open the wallet app, then waits for the user to approve the pairing on
|
|
9093
|
+
* the wallet side.
|
|
9094
|
+
*
|
|
9095
|
+
* The handler is awaited, so an async handler that fails to open the wallet
|
|
9096
|
+
* rejects the connection rather than letting the pairing resolve into an
|
|
9097
|
+
* account nobody asked for.
|
|
9098
|
+
*
|
|
9099
|
+
* @example
|
|
9100
|
+
* ```ts
|
|
9101
|
+
* const walletAccount = await connectWithUriConnectionOption(
|
|
9102
|
+
* {
|
|
9103
|
+
* addToDynamicWalletAccounts: true,
|
|
9104
|
+
* connectionOption,
|
|
9105
|
+
* onConnectionUri: ({ uri }) => renderQrCode(uri),
|
|
9106
|
+
* walletKey: 'trust',
|
|
9107
|
+
* },
|
|
9108
|
+
* client
|
|
9109
|
+
* );
|
|
9110
|
+
* ```
|
|
9111
|
+
*
|
|
9112
|
+
* @param params.addToDynamicWalletAccounts - Whether the connected wallet account should be added to the client's wallet accounts.
|
|
9113
|
+
* @param params.connectionOption - The URI deeplink connection option to drive.
|
|
9114
|
+
* @param params.onConnectionUri - Called with the pairing URI once it is minted. Awaited before the approval is waited on.
|
|
9115
|
+
* @param params.walletKey - The wallet being connected, keyed as in the wallet options catalogue.
|
|
9116
|
+
* @param client - The Dynamic client instance.
|
|
9117
|
+
* @returns A promise that resolves to the connected wallet account.
|
|
9118
|
+
* @throws ConnectionUriHandlerMissingError If no onConnectionUri handler was passed.
|
|
9119
|
+
* @throws NoConnectionOptionAvailableError If no URI connection starter is registered for the option's chain and type.
|
|
9120
|
+
* @throws NoAddressFoundError If the pairing was approved but no address was shared with your app.
|
|
9121
|
+
* @see getUriConnectionStarterRegistry
|
|
9122
|
+
* @see getWalletOptionsCatalogue
|
|
9123
|
+
* @notInstrumented
|
|
9124
|
+
*/
|
|
9125
|
+
const connectWithUriConnectionOption = async ({ addToDynamicWalletAccounts, connectionOption, onConnectionUri, walletKey }, client) => {
|
|
9126
|
+
const { chain, deeplinks, type } = connectionOption;
|
|
9127
|
+
if (!onConnectionUri) throw new ConnectionUriHandlerMissingError({
|
|
9128
|
+
chain,
|
|
9129
|
+
type,
|
|
9130
|
+
walletKey
|
|
9131
|
+
});
|
|
9132
|
+
const starter = getUriConnectionStarterRegistry(client).get({
|
|
9133
|
+
chain,
|
|
9134
|
+
type
|
|
9135
|
+
});
|
|
9136
|
+
if (!starter) throw new NoConnectionOptionAvailableError({
|
|
9137
|
+
chain,
|
|
9138
|
+
walletKey
|
|
9139
|
+
});
|
|
9140
|
+
const { approval, uri } = await starter.start({ addToDynamicWalletAccounts });
|
|
9141
|
+
const walletAccountsPromise = approval();
|
|
9142
|
+
walletAccountsPromise.catch(() => void 0);
|
|
9143
|
+
await onConnectionUri({ uri: getConnectionUriDeeplink({
|
|
9144
|
+
deeplinks,
|
|
9145
|
+
type,
|
|
9146
|
+
uri
|
|
9147
|
+
}) ?? uri });
|
|
9148
|
+
const { walletAccounts } = await walletAccountsPromise;
|
|
9149
|
+
const [walletAccount] = walletAccounts;
|
|
9150
|
+
if (!walletAccount) throw new NoAddressFoundError();
|
|
9151
|
+
return walletAccount;
|
|
9152
|
+
};
|
|
9153
|
+
|
|
9154
|
+
//#endregion
|
|
9155
|
+
//#region src/utils/buildInAppBrowserUrl/buildInAppBrowserUrl.ts
|
|
9156
|
+
/**
|
|
9157
|
+
* Placeholder the wallet book leaves in in-app-browser URLs for the app URL
|
|
9158
|
+
* the wallet should open.
|
|
9159
|
+
*/
|
|
9160
|
+
const DAPP_URL_PLACEHOLDER = "{{encodedDappURI}}";
|
|
9161
|
+
/**
|
|
9162
|
+
* Fills a wallet's in-app-browser URL template with the app URL to open.
|
|
9163
|
+
*
|
|
9164
|
+
* Wallet book entries carry the entry point as a template (e.g.
|
|
9165
|
+
* `https://go.base.app/dapp?cb_url={{encodedDappURI}}`), so the URL is only
|
|
9166
|
+
* usable once every occurrence of the placeholder is substituted in,
|
|
9167
|
+
* percent-encoded. Templates without the placeholder are returned untouched —
|
|
9168
|
+
* some wallets open a fixed landing page.
|
|
9169
|
+
*
|
|
9170
|
+
* @example
|
|
9171
|
+
* ```ts
|
|
9172
|
+
* buildInAppBrowserUrl({
|
|
9173
|
+
* appUrl: 'https://myapp.xyz/login',
|
|
9174
|
+
* inAppBrowserUrl: 'https://go.base.app/dapp?cb_url={{encodedDappURI}}',
|
|
9175
|
+
* });
|
|
9176
|
+
* // Returns: 'https://go.base.app/dapp?cb_url=https%3A%2F%2Fmyapp.xyz%2Flogin'
|
|
9177
|
+
* ```
|
|
9178
|
+
*
|
|
9179
|
+
* @param params.appUrl - The URL of your app for the wallet's browser to open.
|
|
9180
|
+
* @param params.inAppBrowserUrl - The wallet's in-app-browser URL template.
|
|
9181
|
+
* @returns The in-app-browser URL to open.
|
|
9182
|
+
* @see redirectToInAppBrowser
|
|
9183
|
+
* @see getWalletOptionsCatalogue
|
|
9184
|
+
* @notInstrumented
|
|
9185
|
+
*/
|
|
9186
|
+
const buildInAppBrowserUrl = ({ appUrl, inAppBrowserUrl }) => inAppBrowserUrl.replaceAll(DAPP_URL_PLACEHOLDER, encodeURIComponent(appUrl));
|
|
9187
|
+
|
|
9188
|
+
//#endregion
|
|
9189
|
+
//#region src/modules/wallets/redirectToInAppBrowser/redirectToInAppBrowser.ts
|
|
9190
|
+
/**
|
|
9191
|
+
* Leaves your app for a wallet's in-app browser, which reloads `appUrl`
|
|
9192
|
+
* inside it.
|
|
9193
|
+
*
|
|
9194
|
+
* Call this from `handleWalletBrowserRedirect` with the URL of the page the
|
|
9195
|
+
* wallet should reload. The wallet's in-app-browser entry point is read from
|
|
9196
|
+
* the wallet options catalogue, so you only need the wallet's key. The wallet
|
|
9197
|
+
* is only injected on that reload, so the connection is made on the next page
|
|
9198
|
+
* load rather than in the current one.
|
|
9199
|
+
*
|
|
9200
|
+
* @example
|
|
9201
|
+
* ```ts
|
|
9202
|
+
* await connectWalletOption({
|
|
9203
|
+
* handleWalletBrowserRedirect: ({ chain, walletKey }) =>
|
|
9204
|
+
* redirectToInAppBrowser({ appUrl: window.location.href, chain, walletKey }),
|
|
9205
|
+
* walletKey: 'coinbase',
|
|
9206
|
+
* });
|
|
9207
|
+
* ```
|
|
9208
|
+
*
|
|
9209
|
+
* @param params.appUrl - The URL of your app for the wallet's browser to open.
|
|
9210
|
+
* @param params.walletKey - The wallet to open, keyed as in the wallet options catalogue.
|
|
9211
|
+
* @param [params.chain] - The chain to open the wallet's browser for. Required only when the wallet exposes an in-app browser on more than one enabled chain.
|
|
9212
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
9213
|
+
* @returns A promise that resolves once the redirect is triggered.
|
|
9214
|
+
* @throws WalletOptionNotFoundError If no wallet option matches the key.
|
|
9215
|
+
* @throws NoConnectionOptionAvailableError If the wallet exposes no in-app browser on the requested chain.
|
|
9216
|
+
* @throws AmbiguousWalletChainError If the wallet exposes an in-app browser on more than one chain and no chain was passed.
|
|
9217
|
+
* @throws UnsafeDeeplinkUrlError If the wallet's in-app-browser URL has a scheme that can execute script.
|
|
9218
|
+
* @see connectWalletOption
|
|
9219
|
+
* @see WalletBrowserRedirectHandlerParams
|
|
9220
|
+
* @instrumented
|
|
9221
|
+
*/
|
|
9222
|
+
const redirectToInAppBrowser = async ({ appUrl, chain, walletKey }, client = getDefaultClient()) => {
|
|
9223
|
+
const walletOption = (await getWalletOptionsCatalogue({ includeMobileOptions: true }, client)).find(({ key }) => key === walletKey);
|
|
9224
|
+
if (!walletOption) throw new WalletOptionNotFoundError({ walletKey });
|
|
9225
|
+
const inAppBrowserOptions = walletOption.connectionOptions.filter((option) => option.type === "inAppBrowser" && (!chain || option.chain === chain));
|
|
9226
|
+
if (inAppBrowserOptions.length === 0) throw new NoConnectionOptionAvailableError({
|
|
9227
|
+
chain,
|
|
9228
|
+
installationUrls: walletOption.installationUrls,
|
|
9229
|
+
walletKey
|
|
9230
|
+
});
|
|
9231
|
+
const availableChains = [...new Set(inAppBrowserOptions.map((option) => option.chain))];
|
|
9232
|
+
if (!chain && availableChains.length > 1) throw new AmbiguousWalletChainError({
|
|
9233
|
+
chains: availableChains,
|
|
9234
|
+
walletKey
|
|
9235
|
+
});
|
|
9236
|
+
const [inAppBrowserOption] = inAppBrowserOptions;
|
|
9237
|
+
const urlToOpen = buildInAppBrowserUrl({
|
|
9238
|
+
appUrl,
|
|
9239
|
+
inAppBrowserUrl: inAppBrowserOption.url
|
|
9240
|
+
});
|
|
9241
|
+
assertSafeDeeplinkUrl(urlToOpen);
|
|
9242
|
+
await getCore(client).openDeeplink(urlToOpen);
|
|
9243
|
+
};
|
|
9244
|
+
const __redirectToInAppBrowser_impl = redirectToInAppBrowser;
|
|
9245
|
+
const __redirectToInAppBrowser_wrapped = instrumentFunction({
|
|
9246
|
+
fn: __redirectToInAppBrowser_impl,
|
|
9247
|
+
functionName: "redirectToInAppBrowser",
|
|
9248
|
+
getCore: resolveInstrumentationCore
|
|
9249
|
+
});
|
|
9250
|
+
|
|
9251
|
+
//#endregion
|
|
9252
|
+
//#region src/modules/wallets/resolveWalletConnectionOption/resolveWalletConnectionOption.ts
|
|
9253
|
+
/**
|
|
9254
|
+
* Picks the connection option `connectWalletOption` should drive for a wallet.
|
|
9255
|
+
*
|
|
9256
|
+
* Reads the wallet options catalogue, keeps the options this client can
|
|
9257
|
+
* actually drive — a registered wallet provider, an in-app-browser entry, or
|
|
9258
|
+
* a URI pairing whose starter a chain extension has registered — and returns
|
|
9259
|
+
* the best one by the catalogue's ordering.
|
|
9260
|
+
*
|
|
9261
|
+
* @example
|
|
9262
|
+
* ```ts
|
|
9263
|
+
* const connectionOption = await resolveWalletConnectionOption(
|
|
9264
|
+
* { walletKey: 'metamask' },
|
|
9265
|
+
* client
|
|
9266
|
+
* );
|
|
9267
|
+
* ```
|
|
9268
|
+
*
|
|
9269
|
+
* @param params.walletKey - The wallet to connect, keyed as in the wallet options catalogue.
|
|
9270
|
+
* @param [params.chain] - The chain to connect on. Required only when the wallet resolves on more than one enabled chain.
|
|
9271
|
+
* @param client - The Dynamic client instance.
|
|
9272
|
+
* @returns A promise that resolves to the connection option to drive.
|
|
9273
|
+
* @throws WalletOptionNotFoundError If no wallet option matches the key.
|
|
9274
|
+
* @throws AmbiguousWalletChainError If the wallet resolves on more than one chain and no chain was passed.
|
|
9275
|
+
* @throws NoConnectionOptionAvailableError If the wallet has no connection option this client can drive on the requested chain.
|
|
9276
|
+
* @see connectWalletOption
|
|
9277
|
+
* @see getWalletOptionsCatalogue
|
|
9278
|
+
* @notInstrumented
|
|
9279
|
+
*/
|
|
9280
|
+
const resolveWalletConnectionOption = async ({ walletKey, chain }, client) => {
|
|
9281
|
+
const walletOption = (await getWalletOptionsCatalogue({ includeMobileOptions: true }, client)).find(({ key }) => key === walletKey);
|
|
9282
|
+
if (!walletOption) throw new WalletOptionNotFoundError({ walletKey });
|
|
9283
|
+
const uriConnectionStarterRegistry = getUriConnectionStarterRegistry(client);
|
|
9284
|
+
const availableOptions = walletOption.connectionOptions.filter((option) => !chain || option.chain === chain).filter((option) => {
|
|
9285
|
+
if (option.type !== "walletConnect" && option.type !== "metamaskSdkUri") return true;
|
|
9286
|
+
const starter = uriConnectionStarterRegistry.get({
|
|
9287
|
+
chain: option.chain,
|
|
9288
|
+
type: option.type
|
|
9289
|
+
});
|
|
9290
|
+
return Boolean(starter);
|
|
9291
|
+
});
|
|
9292
|
+
if (availableOptions.length === 0) throw new NoConnectionOptionAvailableError({
|
|
9293
|
+
chain,
|
|
9294
|
+
installationUrls: walletOption.installationUrls,
|
|
9295
|
+
walletKey
|
|
9296
|
+
});
|
|
9297
|
+
const availableChains = [...new Set(availableOptions.map((option) => option.chain))];
|
|
9298
|
+
if (!chain && availableChains.length > 1) throw new AmbiguousWalletChainError({
|
|
9299
|
+
chains: availableChains,
|
|
9300
|
+
walletKey
|
|
9301
|
+
});
|
|
9302
|
+
const [connectionOption] = availableOptions;
|
|
9303
|
+
return connectionOption;
|
|
9304
|
+
};
|
|
9305
|
+
|
|
9306
|
+
//#endregion
|
|
9307
|
+
//#region src/utils/getCurrentPageUrl/getCurrentPageUrl.ts
|
|
9308
|
+
/**
|
|
9309
|
+
* Returns the URL of the page the app is running in.
|
|
9310
|
+
*
|
|
9311
|
+
* @example
|
|
9312
|
+
* ```ts
|
|
9313
|
+
* const appUrl = getCurrentPageUrl() ?? 'https://mydapp.xyz';
|
|
9314
|
+
* ```
|
|
9315
|
+
*
|
|
9316
|
+
* @returns The current page URL, or null where there is no page to read it from, such as on React Native and during server-side rendering.
|
|
9317
|
+
* @see isServerSideRendering
|
|
9318
|
+
* @see redirectToInAppBrowser
|
|
9319
|
+
* @notInstrumented
|
|
9320
|
+
*/
|
|
9321
|
+
const getCurrentPageUrl = () => {
|
|
9322
|
+
if (typeof window === "undefined") return null;
|
|
9323
|
+
const href = window.location?.href;
|
|
9324
|
+
if (typeof href !== "string") return null;
|
|
9325
|
+
return href;
|
|
9326
|
+
};
|
|
9327
|
+
|
|
9328
|
+
//#endregion
|
|
9329
|
+
//#region src/highLevelFunctions/connectWalletOption/connectWalletOption.ts
|
|
9330
|
+
/**
|
|
9331
|
+
* Connects to an external wallet by its wallet options catalogue key and
|
|
9332
|
+
* returns the connected wallet account.
|
|
9333
|
+
*
|
|
9334
|
+
* Picks the connection path for the wallet so the customer does not have to:
|
|
9335
|
+
* a registered wallet provider when the user has the wallet installed,
|
|
9336
|
+
* otherwise a URI pairing (WalletConnect or the MetaMask SDK), with the
|
|
9337
|
+
* pairing URI handed to `onConnectionUri` while the returned promise waits for
|
|
9338
|
+
* the user to approve on the wallet side.
|
|
9339
|
+
*
|
|
9340
|
+
* Wallets that can only be reached through their own in-app browser — no
|
|
9341
|
+
* extension, no URI pairing — resolve to a redirect instead: the wallet and
|
|
9342
|
+
* chain are handed to `handleWalletBrowserRedirect`, which leaves for that
|
|
9343
|
+
* browser with `redirectToInAppBrowser`. Without that handler, the current
|
|
9344
|
+
* page is redirected into the wallet's browser directly, so the handler is
|
|
9345
|
+
* only needed to pick a different page to come back to, or where there is no
|
|
9346
|
+
* page URL to reuse (React Native, server-side rendering). The returned
|
|
9347
|
+
* promise never settles either way, since the connection completes on the
|
|
9348
|
+
* next page load inside the wallet's browser.
|
|
9349
|
+
*
|
|
9350
|
+
* Note: This function does not verify the wallet account — use
|
|
9351
|
+
* `verifyWalletAccount` afterwards to link it to the user.
|
|
9352
|
+
*
|
|
9353
|
+
* @example
|
|
9354
|
+
* ```ts
|
|
9355
|
+
* const walletAccount = await connectWalletOption({
|
|
9356
|
+
* handleWalletBrowserRedirect: ({ chain, walletKey }) =>
|
|
9357
|
+
* redirectToInAppBrowser({ appUrl: 'https://mydapp.xyz', chain, walletKey }),
|
|
9358
|
+
* onConnectionUri: ({ uri }) => renderQrCode(uri),
|
|
9359
|
+
* walletKey: 'metamask',
|
|
9037
9360
|
* });
|
|
9038
|
-
* console.log(
|
|
9361
|
+
* console.log(walletAccount.address);
|
|
9039
9362
|
* ```
|
|
9040
9363
|
*
|
|
9041
|
-
* @param params.
|
|
9042
|
-
* @param [params.
|
|
9364
|
+
* @param params.walletKey - The wallet to connect, keyed as in the wallet options catalogue (e.g. 'metamask', 'phantom').
|
|
9365
|
+
* @param [params.chain] - The chain to connect on. Required only when the wallet resolves on more than one enabled chain.
|
|
9366
|
+
* @param [params.onConnectionUri] - Called with the pairing URI when the connection runs through a URI pairing.
|
|
9367
|
+
* @param [params.handleWalletBrowserRedirect] - Called with the wallet and chain when the wallet can only be connected through its own in-app browser. Defaults to redirecting the current page into that browser.
|
|
9043
9368
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
9044
|
-
* @returns A promise that resolves to the connected
|
|
9045
|
-
* @
|
|
9369
|
+
* @returns A promise that resolves to the connected wallet account, or that never settles on the in-app-browser path.
|
|
9370
|
+
* @throws WalletOptionNotFoundError If no wallet option matches the key.
|
|
9371
|
+
* @throws AmbiguousWalletChainError If the wallet resolves on more than one chain and no chain was passed.
|
|
9372
|
+
* @throws NoConnectionOptionAvailableError If the wallet has no connection option this client can drive on the requested chain.
|
|
9373
|
+
* @throws ConnectionUriHandlerMissingError If the wallet resolves to a URI pairing and no onConnectionUri handler was passed.
|
|
9374
|
+
* @throws WalletBrowserRedirectHandlerMissingError If the wallet resolves to its in-app browser, no handleWalletBrowserRedirect handler was passed, and there is no current page URL to redirect.
|
|
9375
|
+
* @throws UnsafeDeeplinkUrlError If the wallet's in-app-browser URL has a scheme that can execute script.
|
|
9046
9376
|
* @see verifyWalletAccount
|
|
9377
|
+
* @see redirectToInAppBrowser
|
|
9378
|
+
* @see getWalletOptionsCatalogue
|
|
9047
9379
|
* @instrumented
|
|
9048
9380
|
*/
|
|
9049
|
-
const
|
|
9050
|
-
const
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
addToDynamicWalletAccounts: false,
|
|
9054
|
-
hardwareWalletVendor,
|
|
9055
|
-
walletProviderKey
|
|
9056
|
-
}, client);
|
|
9057
|
-
await __verifyWalletAccount_wrapped({ walletAccount }, client);
|
|
9058
|
-
createVisit({
|
|
9059
|
-
authMode: AuthModeEnum.AndSign,
|
|
9060
|
-
walletAccount
|
|
9381
|
+
const connectWalletOption = async ({ walletKey, chain, handleWalletBrowserRedirect, onConnectionUri }, client = getDefaultClient()) => {
|
|
9382
|
+
const connectionOption = await resolveWalletConnectionOption({
|
|
9383
|
+
chain,
|
|
9384
|
+
walletKey
|
|
9061
9385
|
}, client);
|
|
9062
|
-
return
|
|
9063
|
-
|
|
9064
|
-
const
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9386
|
+
if (connectionOption.type === "withWalletProvider") return __connectWithWalletProvider_wrapped({ walletProviderKey: connectionOption.walletProviderKey }, client);
|
|
9387
|
+
if (connectionOption.type === "inAppBrowser") {
|
|
9388
|
+
const { chain: inAppBrowserChain } = connectionOption;
|
|
9389
|
+
if (handleWalletBrowserRedirect) handleWalletBrowserRedirect({
|
|
9390
|
+
chain: inAppBrowserChain,
|
|
9391
|
+
walletKey
|
|
9392
|
+
});
|
|
9393
|
+
else {
|
|
9394
|
+
const currentPageUrl = getCurrentPageUrl();
|
|
9395
|
+
if (!currentPageUrl) throw new WalletBrowserRedirectHandlerMissingError({
|
|
9396
|
+
chain: inAppBrowserChain,
|
|
9397
|
+
walletKey
|
|
9398
|
+
});
|
|
9399
|
+
await __redirectToInAppBrowser_wrapped({
|
|
9400
|
+
appUrl: currentPageUrl,
|
|
9401
|
+
chain: inAppBrowserChain,
|
|
9402
|
+
walletKey
|
|
9403
|
+
}, client);
|
|
9073
9404
|
}
|
|
9405
|
+
return new Promise(() => void 0);
|
|
9074
9406
|
}
|
|
9407
|
+
return connectWithUriConnectionOption({
|
|
9408
|
+
addToDynamicWalletAccounts: true,
|
|
9409
|
+
connectionOption,
|
|
9410
|
+
onConnectionUri,
|
|
9411
|
+
walletKey
|
|
9412
|
+
}, client);
|
|
9413
|
+
};
|
|
9414
|
+
const __connectWalletOption_impl = connectWalletOption;
|
|
9415
|
+
const __connectWalletOption_wrapped = instrumentFunction({
|
|
9416
|
+
fn: __connectWalletOption_impl,
|
|
9417
|
+
functionName: "connectWalletOption",
|
|
9418
|
+
getCore: resolveInstrumentationCore
|
|
9075
9419
|
});
|
|
9076
9420
|
|
|
9077
9421
|
//#endregion
|
|
@@ -9293,13 +9637,7 @@ const __addNetwork_impl = addNetwork;
|
|
|
9293
9637
|
const __addNetwork_wrapped = instrumentFunction({
|
|
9294
9638
|
fn: __addNetwork_impl,
|
|
9295
9639
|
functionName: "addNetwork",
|
|
9296
|
-
getCore:
|
|
9297
|
-
try {
|
|
9298
|
-
return getCore(getDefaultClient());
|
|
9299
|
-
} catch {
|
|
9300
|
-
return;
|
|
9301
|
-
}
|
|
9302
|
-
}
|
|
9640
|
+
getCore: resolveInstrumentationCore
|
|
9303
9641
|
});
|
|
9304
9642
|
|
|
9305
9643
|
//#endregion
|
|
@@ -9501,13 +9839,7 @@ const __switchActiveNetwork_impl = switchActiveNetwork;
|
|
|
9501
9839
|
const __switchActiveNetwork_wrapped = instrumentFunction({
|
|
9502
9840
|
fn: __switchActiveNetwork_impl,
|
|
9503
9841
|
functionName: "switchActiveNetwork",
|
|
9504
|
-
getCore:
|
|
9505
|
-
try {
|
|
9506
|
-
return getCore(getDefaultClient());
|
|
9507
|
-
} catch {
|
|
9508
|
-
return;
|
|
9509
|
-
}
|
|
9510
|
-
}
|
|
9842
|
+
getCore: resolveInstrumentationCore
|
|
9511
9843
|
});
|
|
9512
9844
|
|
|
9513
9845
|
//#endregion
|
|
@@ -9600,13 +9932,7 @@ const __setSelectedWalletAccount_impl = setSelectedWalletAccount;
|
|
|
9600
9932
|
const __setSelectedWalletAccount_wrapped = instrumentFunction({
|
|
9601
9933
|
fn: __setSelectedWalletAccount_impl,
|
|
9602
9934
|
functionName: "setSelectedWalletAccount",
|
|
9603
|
-
getCore:
|
|
9604
|
-
try {
|
|
9605
|
-
return getCore(getDefaultClient());
|
|
9606
|
-
} catch {
|
|
9607
|
-
return;
|
|
9608
|
-
}
|
|
9609
|
-
}
|
|
9935
|
+
getCore: resolveInstrumentationCore
|
|
9610
9936
|
});
|
|
9611
9937
|
|
|
9612
9938
|
//#endregion
|
|
@@ -9662,116 +9988,7 @@ const __selectPrimaryWalletAccount_impl = selectPrimaryWalletAccount;
|
|
|
9662
9988
|
const __selectPrimaryWalletAccount_wrapped = instrumentFunction({
|
|
9663
9989
|
fn: __selectPrimaryWalletAccount_impl,
|
|
9664
9990
|
functionName: "selectPrimaryWalletAccount",
|
|
9665
|
-
getCore:
|
|
9666
|
-
try {
|
|
9667
|
-
return getCore(getDefaultClient());
|
|
9668
|
-
} catch {
|
|
9669
|
-
return;
|
|
9670
|
-
}
|
|
9671
|
-
}
|
|
9672
|
-
});
|
|
9673
|
-
|
|
9674
|
-
//#endregion
|
|
9675
|
-
//#region src/utils/buildInAppBrowserUrl/buildInAppBrowserUrl.ts
|
|
9676
|
-
/**
|
|
9677
|
-
* Placeholder the wallet book leaves in in-app-browser URLs for the app URL
|
|
9678
|
-
* the wallet should open.
|
|
9679
|
-
*/
|
|
9680
|
-
const DAPP_URL_PLACEHOLDER = "{{encodedDappURI}}";
|
|
9681
|
-
/**
|
|
9682
|
-
* Fills a wallet's in-app-browser URL template with the app URL to open.
|
|
9683
|
-
*
|
|
9684
|
-
* Wallet book entries carry the entry point as a template (e.g.
|
|
9685
|
-
* `https://go.base.app/dapp?cb_url={{encodedDappURI}}`), so the URL is only
|
|
9686
|
-
* usable once every occurrence of the placeholder is substituted in,
|
|
9687
|
-
* percent-encoded. Templates without the placeholder are returned untouched —
|
|
9688
|
-
* some wallets open a fixed landing page.
|
|
9689
|
-
*
|
|
9690
|
-
* @example
|
|
9691
|
-
* ```ts
|
|
9692
|
-
* buildInAppBrowserUrl({
|
|
9693
|
-
* appUrl: 'https://myapp.xyz/login',
|
|
9694
|
-
* inAppBrowserUrl: 'https://go.base.app/dapp?cb_url={{encodedDappURI}}',
|
|
9695
|
-
* });
|
|
9696
|
-
* // Returns: 'https://go.base.app/dapp?cb_url=https%3A%2F%2Fmyapp.xyz%2Flogin'
|
|
9697
|
-
* ```
|
|
9698
|
-
*
|
|
9699
|
-
* @param params.appUrl - The URL of your app for the wallet's browser to open.
|
|
9700
|
-
* @param params.inAppBrowserUrl - The wallet's in-app-browser URL template.
|
|
9701
|
-
* @returns The in-app-browser URL to open.
|
|
9702
|
-
* @see redirectToInAppBrowser
|
|
9703
|
-
* @see getWalletOptionsCatalogue
|
|
9704
|
-
* @notInstrumented
|
|
9705
|
-
*/
|
|
9706
|
-
const buildInAppBrowserUrl = ({ appUrl, inAppBrowserUrl }) => inAppBrowserUrl.replaceAll(DAPP_URL_PLACEHOLDER, encodeURIComponent(appUrl));
|
|
9707
|
-
|
|
9708
|
-
//#endregion
|
|
9709
|
-
//#region src/modules/wallets/redirectToInAppBrowser/redirectToInAppBrowser.ts
|
|
9710
|
-
/**
|
|
9711
|
-
* Leaves your app for a wallet's in-app browser, which reloads `appUrl`
|
|
9712
|
-
* inside it.
|
|
9713
|
-
*
|
|
9714
|
-
* Call this from `handleWalletBrowserRedirect` with the URL of the page the
|
|
9715
|
-
* wallet should reload. The wallet's in-app-browser entry point is read from
|
|
9716
|
-
* the wallet options catalogue, so you only need the wallet's key. The wallet
|
|
9717
|
-
* is only injected on that reload, so the connection is made on the next page
|
|
9718
|
-
* load rather than in the current one.
|
|
9719
|
-
*
|
|
9720
|
-
* @example
|
|
9721
|
-
* ```ts
|
|
9722
|
-
* await connectWallet({
|
|
9723
|
-
* handleWalletBrowserRedirect: ({ chain, walletKey }) =>
|
|
9724
|
-
* redirectToInAppBrowser({ appUrl: window.location.href, chain, walletKey }),
|
|
9725
|
-
* walletKey: 'coinbase',
|
|
9726
|
-
* });
|
|
9727
|
-
* ```
|
|
9728
|
-
*
|
|
9729
|
-
* @param params.appUrl - The URL of your app for the wallet's browser to open.
|
|
9730
|
-
* @param params.walletKey - The wallet to open, keyed as in the wallet options catalogue.
|
|
9731
|
-
* @param [params.chain] - The chain to open the wallet's browser for. Required only when the wallet exposes an in-app browser on more than one enabled chain.
|
|
9732
|
-
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
9733
|
-
* @returns A promise that resolves once the redirect is triggered.
|
|
9734
|
-
* @throws WalletOptionNotFoundError If no wallet option matches the key.
|
|
9735
|
-
* @throws NoConnectionOptionAvailableError If the wallet exposes no in-app browser on the requested chain.
|
|
9736
|
-
* @throws AmbiguousWalletChainError If the wallet exposes an in-app browser on more than one chain and no chain was passed.
|
|
9737
|
-
* @throws UnsafeDeeplinkUrlError If the wallet's in-app-browser URL has a scheme that can execute script.
|
|
9738
|
-
* @see connectWallet
|
|
9739
|
-
* @see WalletBrowserRedirectHandlerParams
|
|
9740
|
-
* @instrumented
|
|
9741
|
-
*/
|
|
9742
|
-
const redirectToInAppBrowser = async ({ appUrl, chain, walletKey }, client = getDefaultClient()) => {
|
|
9743
|
-
const walletOption = (await getWalletOptionsCatalogue({ includeMobileOptions: true }, client)).find(({ key }) => key === walletKey);
|
|
9744
|
-
if (!walletOption) throw new WalletOptionNotFoundError({ walletKey });
|
|
9745
|
-
const inAppBrowserOptions = walletOption.connectionOptions.filter((option) => option.type === "inAppBrowser" && (!chain || option.chain === chain));
|
|
9746
|
-
if (inAppBrowserOptions.length === 0) throw new NoConnectionOptionAvailableError({
|
|
9747
|
-
chain,
|
|
9748
|
-
installationUrls: walletOption.installationUrls,
|
|
9749
|
-
walletKey
|
|
9750
|
-
});
|
|
9751
|
-
const availableChains = [...new Set(inAppBrowserOptions.map((option) => option.chain))];
|
|
9752
|
-
if (!chain && availableChains.length > 1) throw new AmbiguousWalletChainError({
|
|
9753
|
-
chains: availableChains,
|
|
9754
|
-
walletKey
|
|
9755
|
-
});
|
|
9756
|
-
const [inAppBrowserOption] = inAppBrowserOptions;
|
|
9757
|
-
const urlToOpen = buildInAppBrowserUrl({
|
|
9758
|
-
appUrl,
|
|
9759
|
-
inAppBrowserUrl: inAppBrowserOption.url
|
|
9760
|
-
});
|
|
9761
|
-
assertSafeDeeplinkUrl(urlToOpen);
|
|
9762
|
-
await getCore(client).openDeeplink(urlToOpen);
|
|
9763
|
-
};
|
|
9764
|
-
const __redirectToInAppBrowser_impl = redirectToInAppBrowser;
|
|
9765
|
-
const __redirectToInAppBrowser_wrapped = instrumentFunction({
|
|
9766
|
-
fn: __redirectToInAppBrowser_impl,
|
|
9767
|
-
functionName: "redirectToInAppBrowser",
|
|
9768
|
-
getCore: () => {
|
|
9769
|
-
try {
|
|
9770
|
-
return getCore(getDefaultClient());
|
|
9771
|
-
} catch {
|
|
9772
|
-
return;
|
|
9773
|
-
}
|
|
9774
|
-
}
|
|
9991
|
+
getCore: resolveInstrumentationCore
|
|
9775
9992
|
});
|
|
9776
9993
|
|
|
9777
9994
|
//#endregion
|
|
@@ -9844,13 +10061,7 @@ const __removeWalletAccount_impl = removeWalletAccount;
|
|
|
9844
10061
|
const __removeWalletAccount_wrapped = instrumentFunction({
|
|
9845
10062
|
fn: __removeWalletAccount_impl,
|
|
9846
10063
|
functionName: "removeWalletAccount",
|
|
9847
|
-
getCore:
|
|
9848
|
-
try {
|
|
9849
|
-
return getCore(getDefaultClient());
|
|
9850
|
-
} catch {
|
|
9851
|
-
return;
|
|
9852
|
-
}
|
|
9853
|
-
}
|
|
10064
|
+
getCore: resolveInstrumentationCore
|
|
9854
10065
|
});
|
|
9855
10066
|
|
|
9856
10067
|
//#endregion
|
|
@@ -9891,13 +10102,7 @@ const __signMessage_impl = signMessage;
|
|
|
9891
10102
|
const __signMessage_wrapped = instrumentFunction({
|
|
9892
10103
|
fn: __signMessage_impl,
|
|
9893
10104
|
functionName: "signMessage",
|
|
9894
|
-
getCore:
|
|
9895
|
-
try {
|
|
9896
|
-
return getCore(getDefaultClient());
|
|
9897
|
-
} catch {
|
|
9898
|
-
return;
|
|
9899
|
-
}
|
|
9900
|
-
}
|
|
10105
|
+
getCore: resolveInstrumentationCore
|
|
9901
10106
|
});
|
|
9902
10107
|
|
|
9903
10108
|
//#endregion
|
|
@@ -9943,13 +10148,7 @@ const __transferAmount_impl = transferAmount;
|
|
|
9943
10148
|
const __transferAmount_wrapped = instrumentFunction({
|
|
9944
10149
|
fn: __transferAmount_impl,
|
|
9945
10150
|
functionName: "transferAmount",
|
|
9946
|
-
getCore:
|
|
9947
|
-
try {
|
|
9948
|
-
return getCore(getDefaultClient());
|
|
9949
|
-
} catch {
|
|
9950
|
-
return;
|
|
9951
|
-
}
|
|
9952
|
-
}
|
|
10151
|
+
getCore: resolveInstrumentationCore
|
|
9953
10152
|
});
|
|
9954
10153
|
|
|
9955
10154
|
//#endregion
|
|
@@ -9987,13 +10186,7 @@ const __transferWalletAccount_impl = transferWalletAccount;
|
|
|
9987
10186
|
const __transferWalletAccount_wrapped = instrumentFunction({
|
|
9988
10187
|
fn: __transferWalletAccount_impl,
|
|
9989
10188
|
functionName: "transferWalletAccount",
|
|
9990
|
-
getCore:
|
|
9991
|
-
try {
|
|
9992
|
-
return getCore(getDefaultClient());
|
|
9993
|
-
} catch {
|
|
9994
|
-
return;
|
|
9995
|
-
}
|
|
9996
|
-
}
|
|
10189
|
+
getCore: resolveInstrumentationCore
|
|
9997
10190
|
});
|
|
9998
10191
|
|
|
9999
10192
|
//#endregion
|
|
@@ -10136,13 +10329,7 @@ const __claimYieldRewards_impl = claimYieldRewards;
|
|
|
10136
10329
|
const __claimYieldRewards_wrapped = instrumentFunction({
|
|
10137
10330
|
fn: __claimYieldRewards_impl,
|
|
10138
10331
|
functionName: "claimYieldRewards",
|
|
10139
|
-
getCore:
|
|
10140
|
-
try {
|
|
10141
|
-
return getCore(getDefaultClient());
|
|
10142
|
-
} catch {
|
|
10143
|
-
return;
|
|
10144
|
-
}
|
|
10145
|
-
}
|
|
10332
|
+
getCore: resolveInstrumentationCore
|
|
10146
10333
|
});
|
|
10147
10334
|
|
|
10148
10335
|
//#endregion
|
|
@@ -10194,13 +10381,7 @@ const __depositToYieldVault_impl = depositToYieldVault;
|
|
|
10194
10381
|
const __depositToYieldVault_wrapped = instrumentFunction({
|
|
10195
10382
|
fn: __depositToYieldVault_impl,
|
|
10196
10383
|
functionName: "depositToYieldVault",
|
|
10197
|
-
getCore:
|
|
10198
|
-
try {
|
|
10199
|
-
return getCore(getDefaultClient());
|
|
10200
|
-
} catch {
|
|
10201
|
-
return;
|
|
10202
|
-
}
|
|
10203
|
-
}
|
|
10384
|
+
getCore: resolveInstrumentationCore
|
|
10204
10385
|
});
|
|
10205
10386
|
|
|
10206
10387
|
//#endregion
|
|
@@ -10366,79 +10547,9 @@ const __withdrawFromYieldVault_impl = withdrawFromYieldVault;
|
|
|
10366
10547
|
const __withdrawFromYieldVault_wrapped = instrumentFunction({
|
|
10367
10548
|
fn: __withdrawFromYieldVault_impl,
|
|
10368
10549
|
functionName: "withdrawFromYieldVault",
|
|
10369
|
-
getCore:
|
|
10370
|
-
try {
|
|
10371
|
-
return getCore(getDefaultClient());
|
|
10372
|
-
} catch {
|
|
10373
|
-
return;
|
|
10374
|
-
}
|
|
10375
|
-
}
|
|
10550
|
+
getCore: resolveInstrumentationCore
|
|
10376
10551
|
});
|
|
10377
10552
|
|
|
10378
|
-
//#endregion
|
|
10379
|
-
//#region src/utils/appendConnectionUriToDeeplink/appendConnectionUriToDeeplink.ts
|
|
10380
|
-
/**
|
|
10381
|
-
* Appends a wallet connection URI to a deeplink URL.
|
|
10382
|
-
*
|
|
10383
|
-
* Generic across URI-deeplink connection options — works for both
|
|
10384
|
-
* WalletConnect pairing URIs and MetaMask SDK URIs. Determines the
|
|
10385
|
-
* appropriate query parameter separator based on whether the deeplink
|
|
10386
|
-
* already contains query parameters.
|
|
10387
|
-
*
|
|
10388
|
-
* @param params.deeplinkUrl - The base deeplink URL (e.g., `walletapp://wc` or `walletapp://wc?param=value`).
|
|
10389
|
-
* @param params.connectionUri - The connection URI to append.
|
|
10390
|
-
* @returns The deeplink URL with the connection URI appended as a query parameter.
|
|
10391
|
-
*
|
|
10392
|
-
* @example
|
|
10393
|
-
* ```ts
|
|
10394
|
-
* appendConnectionUriToDeeplink({ deeplinkUrl: 'walletapp://wc', connectionUri: 'wc:123-456' })
|
|
10395
|
-
* // Returns: 'walletapp://wc?uri=wc%3A123-456'
|
|
10396
|
-
*
|
|
10397
|
-
* appendConnectionUriToDeeplink({ deeplinkUrl: 'walletapp://wc?param=value', connectionUri: 'wc:123-456' })
|
|
10398
|
-
* // Returns: 'walletapp://wc?param=value&uri=wc%3A123-456'
|
|
10399
|
-
* ```
|
|
10400
|
-
* @notInstrumented
|
|
10401
|
-
*/
|
|
10402
|
-
const appendConnectionUriToDeeplink = ({ connectionUri, deeplinkUrl }) => {
|
|
10403
|
-
const url = new URL(deeplinkUrl);
|
|
10404
|
-
url.searchParams.set("uri", connectionUri);
|
|
10405
|
-
return url.href;
|
|
10406
|
-
};
|
|
10407
|
-
|
|
10408
|
-
//#endregion
|
|
10409
|
-
//#region src/utils/getPreferredWalletDeepLink/getPreferredWalletDeepLink.ts
|
|
10410
|
-
/**
|
|
10411
|
-
* Picks the most appropriate deep link variant for the current platform.
|
|
10412
|
-
*
|
|
10413
|
-
* Mobile (Android, iOS, tablets) prefers `native` because the OS treats
|
|
10414
|
-
* custom URL schemes as first-class app links and gives the wallet a faster
|
|
10415
|
-
* round-trip back to the dApp. Desktop prefers `universal` because browsers
|
|
10416
|
-
* cannot resolve mobile-only custom schemes and need an `https://` link
|
|
10417
|
-
* that opens the wallet's web flow.
|
|
10418
|
-
*
|
|
10419
|
-
* In either case, the alternative is used as a fallback when the preferred
|
|
10420
|
-
* variant is missing. Returns `undefined` only when both variants are
|
|
10421
|
-
* absent.
|
|
10422
|
-
*
|
|
10423
|
-
* @example
|
|
10424
|
-
* ```ts
|
|
10425
|
-
* const deepLink = getPreferredWalletDeepLink({
|
|
10426
|
-
* deeplinks: wallet.deeplinks,
|
|
10427
|
-
* });
|
|
10428
|
-
* ```
|
|
10429
|
-
*
|
|
10430
|
-
* @param params.deeplinks - The deep link variants for a wallet (typically `WalletConnectCatalogWallet.deeplinks`).
|
|
10431
|
-
* @returns The preferred deep link URL, or `undefined` if neither variant is available.
|
|
10432
|
-
* @see appendConnectionUriToDeeplink
|
|
10433
|
-
* @see getConnectionUriDeeplink
|
|
10434
|
-
* @notInstrumented
|
|
10435
|
-
*/
|
|
10436
|
-
const getPreferredWalletDeepLink = ({ deeplinks }) => {
|
|
10437
|
-
const { native, universal } = deeplinks;
|
|
10438
|
-
if (isMobile()) return native ?? universal;
|
|
10439
|
-
return universal ?? native;
|
|
10440
|
-
};
|
|
10441
|
-
|
|
10442
10553
|
//#endregion
|
|
10443
10554
|
//#region src/utils/parseUserAgent/parseUserAgent.ts
|
|
10444
10555
|
const browserMatchers = [
|
|
@@ -10520,5 +10631,5 @@ const parseUserAgent = ({ userAgent }) => {
|
|
|
10520
10631
|
assertPackageVersion(name, version);
|
|
10521
10632
|
|
|
10522
10633
|
//#endregion
|
|
10523
|
-
export { AmbiguousWalletChainError, BaseError, COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS, CaptchaProviderEnum, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, CoinbaseBeneficiaryWalletType, CoinbaseIsSelfTransfer, CoinbaseTransferMfaFailedError, CoinbaseTransferMfaRequiredError, CoinbaseTravelRuleFieldName, CoinbaseTravelRuleRequiredError, DeeplinkConnectAndVerifyUnsupportedError, DeviceRegistrationIdentityMismatchError, FeeEstimationFailedError, FlowSessionTokenMissingError, GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, InvalidSocialCallbackOriginError, JwtVerifiedCredentialFormatEnum, LinkCredentialError, MFAAction, MergeAccountsConfirmationError, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoConnectionOptionAvailableError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, ProviderEnum, SandboxMaximumThresholdReachedError, ScreeningNotRequiredError, SimulationFailedError, TokenScope, TokenSwapError, TransactionBroadcastError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserCancelledSocialPopUpError, UserNotAuthenticatedError, UserRejectedError, WaasChainEnum, WaasLoadFailedError, WaasOnboardingIncompleteError, WaasRbacStaleRetryUnsafeError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletOptionNotFoundError, WalletProviderMethodUnavailableError, WalletScreeningBlockedError, __acknowledgeRecoveryCodes_wrapped as acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, __addNetwork_wrapped as addNetwork, appendConnectionUriToDeeplink, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, __attachCheckoutTransactionSource_wrapped as attachCheckoutTransactionSource, __attachFlowSource_wrapped as attachFlowSource, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, __authenticateWithSocial_wrapped as authenticateWithSocial, __broadcastCheckoutTransaction_wrapped as broadcastCheckoutTransaction, __broadcastFlow_wrapped as broadcastFlow, canConnectWithHardwareWallet, __cancelCheckoutTransaction_wrapped as cancelCheckoutTransaction, __cancelFlow_wrapped as cancelFlow, __checkStepUpAuth_wrapped as checkStepUpAuth, checkUserScopes, __claimYieldRewards_wrapped as claimYieldRewards, clearDeviceRegistrationRedirectParams, clearSocialRedirectParams, __completeDeviceRegistration_wrapped as completeDeviceRegistration, __completeSocialAuthentication_wrapped as completeSocialAuthentication, __completeSocialRedirect_wrapped as completeSocialRedirect, __confirmTransaction_wrapped as confirmTransaction, __connectAndVerifyWithWalletProvider_wrapped as connectAndVerifyWithWalletProvider, __connectWithWalletProvider_wrapped as connectWithWalletProvider, __consumeMfaToken_wrapped as consumeMfaToken, __createCheckoutTransaction_wrapped as createCheckoutTransaction, createCoinbaseExchangeTransfer, __createCoinbaseOnrampOrder_wrapped as createCoinbaseOnrampOrder, __createCryptoDotComPayment_wrapped as createCryptoDotComPayment, __createDynamicClient_wrapped as createDynamicClient, createKrakenExchangeTransfer, __createNewMfaRecoveryCodes_wrapped as createNewMfaRecoveryCodes, __deleteMfaDevice_wrapped as deleteMfaDevice, __deletePasskey_wrapped as deletePasskey, __deleteUser_wrapped as deleteUser, __depositToYieldVault_wrapped as depositToYieldVault, detectDeviceRegistrationRedirect, detectOAuthRedirect, detectSocialRedirectUrl, excludeInstalledFromCatalog, __executeSwapTransaction_wrapped as executeSwapTransaction, fetchProjectSettings, findMissingGoogleDriveBackupScopes, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getBalances, getCaptchaSettings, getCheckoutTransaction, getCheckoutTransactionQuote, getCoinbaseAccounts, getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceRegistrationTokenFromUrl, getElevatedAccessToken, getFlow, getFlowQuote, __getGoogleDriveBackupReadiness_wrapped as getGoogleDriveBackupReadiness, getInstallationLinkForCurrentPlatform, getKrakenAccounts, getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, __getMoonPayCurrencies_wrapped as getMoonPayCurrencies, __getMoonPayUrl_wrapped as getMoonPayUrl, getMultichainBalances, getMultichainTokenBalances, getNativeBalance, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPreferredWalletDeepLink, getPrimaryWalletAccount, getRegisteredDevices, getSelectedWalletAccount, getSwapQuote, getSwapStatus, getTokenBalances, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletOptionsCatalogue, getWalletProviderDataByKey, getYieldDetails, getYieldPosition, getYieldRewards, hasAllGoogleDriveBackupScopes, hasExtension, __initializeClient_wrapped as initializeClient, isAnyWalletAccountConnected, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isExternalWalletScreeningEnabled, isHardwareWalletAccount, isInsufficientGoogleDriveScopesError, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, listYieldVaults, logout, matchWalletProvidersToCatalogGroup, mergeUserAccounts, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __prepareFlowSigning_wrapped as prepareFlowSigning, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __redirectToInAppBrowser_wrapped as redirectToInAppBrowser, __refreshAuth_wrapped as refreshAuth, __refreshUser_wrapped as refreshUser, __registerPasskey_wrapped as registerPasskey, __registerTotpMfaDevice_wrapped as registerTotpMfaDevice, __removeWalletAccount_wrapped as removeWalletAccount, __requestExternalAuthElevatedToken_wrapped as requestExternalAuthElevatedToken, requiresConversion, __revokeAllRegisteredDevices_wrapped as revokeAllRegisteredDevices, __revokeRegisteredDevice_wrapped as revokeRegisteredDevice, screenTransaction, __selectPrimaryWalletAccount_wrapped as selectPrimaryWalletAccount, __sendEmailOTP_wrapped as sendEmailOTP, __sendSmsOTP_wrapped as sendSmsOTP, __setCaptchaToken_wrapped as setCaptchaToken, __setDefaultMfaDevice_wrapped as setDefaultMfaDevice, __setInstrumentationEnabled_wrapped as setInstrumentationEnabled, __setSelectedWalletAccount_wrapped as setSelectedWalletAccount, __signInWithExternalJwt_wrapped as signInWithExternalJwt, __signInWithPasskey_wrapped as signInWithPasskey, __signInWithSocialPopUp_wrapped as signInWithSocialPopUp, __signInWithSocialRedirect_wrapped as signInWithSocialRedirect, __signMessage_wrapped as signMessage, __submitCheckoutTransaction_wrapped as submitCheckoutTransaction, __submitFlowTransaction_wrapped as submitFlowTransaction, supportedCountries, __switchActiveNetwork_wrapped as switchActiveNetwork, trackCheckoutTransaction, __transferAmount_wrapped as transferAmount, __transferWalletAccount_wrapped as transferWalletAccount, __unlinkSocialAccount_wrapped as unlinkSocialAccount, __updateUser_wrapped as updateUser, __verifyOTP_wrapped as verifyOTP, __verifyWalletAccount_wrapped as verifyWalletAccount, waitForClientInitialized, __withdrawFromYieldVault_wrapped as withdrawFromYieldVault };
|
|
10634
|
+
export { AmbiguousWalletChainError, BaseError, COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS, CaptchaProviderEnum, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, CoinbaseBeneficiaryWalletType, CoinbaseIsSelfTransfer, CoinbaseTransferMfaFailedError, CoinbaseTransferMfaRequiredError, CoinbaseTravelRuleFieldName, CoinbaseTravelRuleRequiredError, ConnectionUriHandlerMissingError, DeeplinkConnectAndVerifyUnsupportedError, DeviceRegistrationIdentityMismatchError, FeeEstimationFailedError, FlowSessionTokenMissingError, GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, InvalidSocialCallbackOriginError, JwtVerifiedCredentialFormatEnum, LinkCredentialError, MFAAction, MergeAccountsConfirmationError, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoConnectionOptionAvailableError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, ProviderEnum, SandboxMaximumThresholdReachedError, ScreeningNotRequiredError, SimulationFailedError, TokenScope, TokenSwapError, TransactionBroadcastError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserCancelledSocialPopUpError, UserNotAuthenticatedError, UserRejectedError, WaasChainEnum, WaasLoadFailedError, WaasOnboardingIncompleteError, WaasRbacStaleRetryUnsafeError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletBrowserRedirectHandlerMissingError, WalletOptionNotFoundError, WalletProviderMethodUnavailableError, WalletScreeningBlockedError, __acknowledgeRecoveryCodes_wrapped as acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, __addNetwork_wrapped as addNetwork, appendConnectionUriToDeeplink, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, __attachCheckoutTransactionSource_wrapped as attachCheckoutTransactionSource, __attachFlowSource_wrapped as attachFlowSource, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, __authenticateWithSocial_wrapped as authenticateWithSocial, __broadcastCheckoutTransaction_wrapped as broadcastCheckoutTransaction, __broadcastFlow_wrapped as broadcastFlow, canConnectWithHardwareWallet, __cancelCheckoutTransaction_wrapped as cancelCheckoutTransaction, __cancelFlow_wrapped as cancelFlow, __checkStepUpAuth_wrapped as checkStepUpAuth, checkUserScopes, __claimYieldRewards_wrapped as claimYieldRewards, clearDeviceRegistrationRedirectParams, clearSocialRedirectParams, __completeDeviceRegistration_wrapped as completeDeviceRegistration, __completeSocialAuthentication_wrapped as completeSocialAuthentication, __completeSocialRedirect_wrapped as completeSocialRedirect, __confirmTransaction_wrapped as confirmTransaction, __connectAndVerifyWithWalletProvider_wrapped as connectAndVerifyWithWalletProvider, __connectWalletOption_wrapped as connectWalletOption, __connectWithWalletProvider_wrapped as connectWithWalletProvider, __consumeMfaToken_wrapped as consumeMfaToken, __createCheckoutTransaction_wrapped as createCheckoutTransaction, createCoinbaseExchangeTransfer, __createCoinbaseOnrampOrder_wrapped as createCoinbaseOnrampOrder, __createCryptoDotComPayment_wrapped as createCryptoDotComPayment, __createDynamicClient_wrapped as createDynamicClient, createKrakenExchangeTransfer, __createNewMfaRecoveryCodes_wrapped as createNewMfaRecoveryCodes, __deleteMfaDevice_wrapped as deleteMfaDevice, __deletePasskey_wrapped as deletePasskey, __deleteUser_wrapped as deleteUser, __depositToYieldVault_wrapped as depositToYieldVault, detectDeviceRegistrationRedirect, detectOAuthRedirect, detectSocialRedirectUrl, excludeInstalledFromCatalog, __executeSwapTransaction_wrapped as executeSwapTransaction, fetchProjectSettings, findMissingGoogleDriveBackupScopes, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getBalances, getCaptchaSettings, getCheckoutTransaction, getCheckoutTransactionQuote, __getCoinbaseAccounts_wrapped as getCoinbaseAccounts, __getCoinbaseBuyUrl_wrapped as getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceRegistrationTokenFromUrl, getElevatedAccessToken, getFlow, getFlowQuote, __getGoogleDriveBackupReadiness_wrapped as getGoogleDriveBackupReadiness, getInstallationLinkForCurrentPlatform, __getKrakenAccounts_wrapped as getKrakenAccounts, __getKrakenWhitelistedAddresses_wrapped as getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, __getMoonPayCurrencies_wrapped as getMoonPayCurrencies, __getMoonPayUrl_wrapped as getMoonPayUrl, getMultichainBalances, getMultichainTokenBalances, getNativeBalance, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPreferredWalletDeepLink, getPrimaryWalletAccount, getRegisteredDevices, getSelectedWalletAccount, getSwapQuote, getSwapStatus, getTokenBalances, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletOptionsCatalogue, getWalletProviderDataByKey, getYieldDetails, getYieldPosition, getYieldRewards, hasAllGoogleDriveBackupScopes, hasExtension, __initializeClient_wrapped as initializeClient, isAnyWalletAccountConnected, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isExternalWalletScreeningEnabled, isHardwareWalletAccount, isInsufficientGoogleDriveScopesError, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, isWalletExtensionInstalled, listYieldVaults, logout, matchWalletProvidersToCatalogGroup, mergeUserAccounts, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __prepareFlowSigning_wrapped as prepareFlowSigning, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __redirectToInAppBrowser_wrapped as redirectToInAppBrowser, __refreshAuth_wrapped as refreshAuth, __refreshUser_wrapped as refreshUser, __registerPasskey_wrapped as registerPasskey, __registerTotpMfaDevice_wrapped as registerTotpMfaDevice, __removeWalletAccount_wrapped as removeWalletAccount, __requestExternalAuthElevatedToken_wrapped as requestExternalAuthElevatedToken, requiresConversion, __revokeAllRegisteredDevices_wrapped as revokeAllRegisteredDevices, __revokeRegisteredDevice_wrapped as revokeRegisteredDevice, screenTransaction, __selectPrimaryWalletAccount_wrapped as selectPrimaryWalletAccount, __sendEmailOTP_wrapped as sendEmailOTP, __sendSmsOTP_wrapped as sendSmsOTP, __setCaptchaToken_wrapped as setCaptchaToken, __setDefaultMfaDevice_wrapped as setDefaultMfaDevice, __setInstrumentationEnabled_wrapped as setInstrumentationEnabled, __setSelectedWalletAccount_wrapped as setSelectedWalletAccount, __signInWithExternalJwt_wrapped as signInWithExternalJwt, __signInWithPasskey_wrapped as signInWithPasskey, __signInWithSocialPopUp_wrapped as signInWithSocialPopUp, __signInWithSocialRedirect_wrapped as signInWithSocialRedirect, __signMessage_wrapped as signMessage, __submitCheckoutTransaction_wrapped as submitCheckoutTransaction, __submitFlowTransaction_wrapped as submitFlowTransaction, supportedCountries, __switchActiveNetwork_wrapped as switchActiveNetwork, trackCheckoutTransaction, __transferAmount_wrapped as transferAmount, __transferWalletAccount_wrapped as transferWalletAccount, __unlinkSocialAccount_wrapped as unlinkSocialAccount, __updateUser_wrapped as updateUser, __verifyOTP_wrapped as verifyOTP, __verifyWalletAccount_wrapped as verifyWalletAccount, waitForClientInitialized, __withdrawFromYieldVault_wrapped as withdrawFromYieldVault };
|
|
10524
10635
|
//# sourceMappingURL=index.esm.js.map
|