@dynamic-labs-sdk/client 1.24.1 → 1.26.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/client/core/createCore/createCore.d.ts.map +1 -1
- package/dist/client/core/types/DynamicCore.d.ts +11 -0
- package/dist/client/core/types/DynamicCore.d.ts.map +1 -1
- package/dist/core.cjs +7 -7
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +6 -7
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +6 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/errors/CoinbaseTransferMfaFailedError.d.ts +34 -0
- package/dist/errors/CoinbaseTransferMfaFailedError.d.ts.map +1 -0
- package/dist/errors/CoinbaseTransferMfaRequiredError.d.ts +37 -0
- package/dist/errors/CoinbaseTransferMfaRequiredError.d.ts.map +1 -0
- package/dist/errors/CoinbaseTravelRuleRequiredError.d.ts +55 -0
- package/dist/errors/CoinbaseTravelRuleRequiredError.d.ts.map +1 -0
- package/dist/errors/TransactionBroadcastError.d.ts +44 -0
- package/dist/errors/TransactionBroadcastError.d.ts.map +1 -0
- package/dist/exports/core.d.ts +2 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +9 -1
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/waas.d.ts +3 -1
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/exports/waasCore.d.ts +1 -1
- package/dist/exports/waasCore.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-nLBIQ_5p.native.esm.js → getNetworkProviderFromNetworkId-C5GtE2ef.native.esm.js} +29 -4
- package/dist/getNetworkProviderFromNetworkId-C5GtE2ef.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-CIcatN8-.cjs → getNetworkProviderFromNetworkId-CSxvdrc9.cjs} +32 -2
- package/dist/{getNetworkProviderFromNetworkId-CYONf9-8.esm.js.map → getNetworkProviderFromNetworkId-CSxvdrc9.cjs.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-CYONf9-8.esm.js → getNetworkProviderFromNetworkId-D7lIOS6I.esm.js} +27 -3
- package/dist/getNetworkProviderFromNetworkId-D7lIOS6I.esm.js.map +1 -0
- package/dist/{getSignedSessionId-B2kslh_k.esm.js → getSignedSessionId-B5Dijw-8.native.esm.js} +12 -3
- package/dist/{getSignedSessionId-DV0hK3Tu.native.esm.js.map → getSignedSessionId-B5Dijw-8.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DV0hK3Tu.native.esm.js → getSignedSessionId-BiL9k0nE.esm.js} +3 -3
- package/dist/getSignedSessionId-BiL9k0nE.esm.js.map +1 -0
- package/dist/{getSignedSessionId-NZ8ndqG1.cjs → getSignedSessionId-CpcQiZTF.cjs} +17 -2
- package/dist/getSignedSessionId-CpcQiZTF.cjs.map +1 -0
- package/dist/{getWalletProviderByKey-DzKZXm5S.cjs → getWalletProviderByKey-BMJ9TcjM.cjs} +2 -2
- package/dist/{getWalletProviderByKey-DzKZXm5S.cjs.map → getWalletProviderByKey-BMJ9TcjM.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-DPZP397j.native.esm.js → getWalletProviderByKey-CBIrILYZ.native.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-DPZP397j.native.esm.js.map → getWalletProviderByKey-CBIrILYZ.native.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-Dh3JbMi6.esm.js → getWalletProviderByKey-CU8zmrf2.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-Dh3JbMi6.esm.js.map → getWalletProviderByKey-CU8zmrf2.esm.js.map} +1 -1
- package/dist/index.cjs +405 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +397 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +397 -8
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-BbhbghRE.esm.js → isDynamicWaasEnabled-CBvSRUgG.esm.js} +34 -3
- package/dist/isDynamicWaasEnabled-CBvSRUgG.esm.js.map +1 -0
- package/dist/{isDynamicWaasEnabled-BmB0lQJf.native.esm.js → isDynamicWaasEnabled-d82cX7j9.native.esm.js} +34 -3
- package/dist/isDynamicWaasEnabled-d82cX7j9.native.esm.js.map +1 -0
- package/dist/{isDynamicWaasEnabled-D2U3MRnA.cjs → isDynamicWaasEnabled-idmeju9B.cjs} +39 -2
- package/dist/isDynamicWaasEnabled-idmeju9B.cjs.map +1 -0
- package/dist/{isMfaRequiredForAction-DP0kk0tY.native.esm.js → isMfaRequiredForAction-1O_rFiPN.native.esm.js} +32 -3
- package/dist/isMfaRequiredForAction-1O_rFiPN.native.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-DBlmv1ew.esm.js → isMfaRequiredForAction-D1rhRlDu.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-DBlmv1ew.esm.js.map → isMfaRequiredForAction-D1rhRlDu.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DCyorelQ.cjs → isMfaRequiredForAction-D5o4qznt.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-DCyorelQ.cjs.map → isMfaRequiredForAction-D5o4qznt.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-DygWGu6p.cjs → isUserOnboardingComplete-BfRUVwrT.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-DygWGu6p.cjs.map → isUserOnboardingComplete-BfRUVwrT.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-Ebw4x90F.native.esm.js → isUserOnboardingComplete-bR7jwdjO.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-Ebw4x90F.native.esm.js.map → isUserOnboardingComplete-bR7jwdjO.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-WzXFgdor.esm.js → isUserOnboardingComplete-k3nlisFA.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-WzXFgdor.esm.js.map → isUserOnboardingComplete-k3nlisFA.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-CzPWPaDr.cjs → migrateFromFireblocks-BcYmEZ3_.cjs} +3 -54
- package/dist/migrateFromFireblocks-BcYmEZ3_.cjs.map +1 -0
- package/dist/{migrateFromFireblocks-BkcGdF_B.esm.js → migrateFromFireblocks-Bm7eIfaa.esm.js} +4 -43
- package/dist/migrateFromFireblocks-Bm7eIfaa.esm.js.map +1 -0
- package/dist/migrateFromFireblocks-DVP5tGv_.native.esm.js +65 -0
- package/dist/migrateFromFireblocks-DVP5tGv_.native.esm.js.map +1 -0
- package/dist/modules/apiClient/utils/clientErrorMapper/clientErrorMapper.d.ts.map +1 -1
- package/dist/modules/auth/social/social.types.d.ts +1 -1
- package/dist/modules/auth/social/social.types.d.ts.map +1 -1
- package/dist/modules/funding/coinbase/coinbase.consts.d.ts +74 -0
- package/dist/modules/funding/coinbase/coinbase.consts.d.ts.map +1 -0
- package/dist/modules/funding/coinbase/coinbase.types.d.ts +150 -1
- package/dist/modules/funding/coinbase/coinbase.types.d.ts.map +1 -1
- package/dist/modules/funding/coinbase/createCoinbaseExchangeTransfer/createCoinbaseExchangeTransfer.d.ts +83 -0
- package/dist/modules/funding/coinbase/createCoinbaseExchangeTransfer/createCoinbaseExchangeTransfer.d.ts.map +1 -0
- package/dist/modules/funding/coinbase/createCoinbaseExchangeTransfer/index.d.ts +3 -0
- package/dist/modules/funding/coinbase/createCoinbaseExchangeTransfer/index.d.ts.map +1 -0
- package/dist/modules/funding/coinbase/getCoinbaseAccounts/getCoinbaseAccounts.d.ts +41 -0
- package/dist/modules/funding/coinbase/getCoinbaseAccounts/getCoinbaseAccounts.d.ts.map +1 -0
- package/dist/modules/funding/coinbase/getCoinbaseAccounts/index.d.ts +3 -0
- package/dist/modules/funding/coinbase/getCoinbaseAccounts/index.d.ts.map +1 -0
- package/dist/modules/funding/coinbase/utils/parseCoinbaseTravelRuleMissingFields/index.d.ts +2 -0
- package/dist/modules/funding/coinbase/utils/parseCoinbaseTravelRuleMissingFields/index.d.ts.map +1 -0
- package/dist/modules/funding/coinbase/utils/parseCoinbaseTravelRuleMissingFields/parseCoinbaseTravelRuleMissingFields.d.ts +26 -0
- package/dist/modules/funding/coinbase/utils/parseCoinbaseTravelRuleMissingFields/parseCoinbaseTravelRuleMissingFields.d.ts.map +1 -0
- package/dist/modules/waas/broadcastWaasTransaction/broadcastWaasTransaction.d.ts +18 -0
- package/dist/modules/waas/broadcastWaasTransaction/broadcastWaasTransaction.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.d.ts +13 -1
- package/dist/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/getBusinessAccount/getBusinessAccount.d.ts +2 -1
- package/dist/modules/waas/businessAccounts/getBusinessAccount/getBusinessAccount.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.d.ts +15 -2
- package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts +32 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts.map +1 -1
- package/dist/modules/waas/createWaasClient/createWaasClient.d.ts.map +1 -1
- package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
- package/dist/modules/waas/transactionBroadcastErrorMapper/transactionBroadcastErrorMapper.d.ts +8 -0
- package/dist/modules/waas/transactionBroadcastErrorMapper/transactionBroadcastErrorMapper.d.ts.map +1 -0
- package/dist/modules/waas/waas.types.d.ts +14 -0
- package/dist/modules/waas/waas.types.d.ts.map +1 -1
- package/dist/modules/wallets/walletProviderRegistry/index.d.ts +2 -1
- package/dist/modules/wallets/walletProviderRegistry/index.d.ts.map +1 -1
- package/dist/modules/wallets/walletProviderRegistry/walletProviderRegistry.consts.d.ts +34 -0
- package/dist/modules/wallets/walletProviderRegistry/walletProviderRegistry.consts.d.ts.map +1 -0
- package/dist/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.d.ts +5 -21
- package/dist/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.d.ts.map +1 -1
- package/dist/services/appForeground/appForeground.types.d.ts +36 -0
- package/dist/services/appForeground/appForeground.types.d.ts.map +1 -0
- package/dist/services/appForeground/createAppForegroundSubscriber/createAppForegroundSubscriber.d.ts +12 -0
- package/dist/services/appForeground/createAppForegroundSubscriber/createAppForegroundSubscriber.d.ts.map +1 -0
- package/dist/services/appForeground/createAppForegroundSubscriber/index.d.ts +2 -0
- package/dist/services/appForeground/createAppForegroundSubscriber/index.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{updateAuthFromVerifyResponse-B8tDJdXY.cjs → updateAuthFromVerifyResponse-CPOvKWih.cjs} +20 -26
- package/dist/updateAuthFromVerifyResponse-CPOvKWih.cjs.map +1 -0
- package/dist/{NativeModuleNotLinkedError-dFDBC524.native.esm.js → updateAuthFromVerifyResponse-CTfG6oZa.native.esm.js} +21 -56
- package/dist/updateAuthFromVerifyResponse-CTfG6oZa.native.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-C_yGmd99.esm.js → updateAuthFromVerifyResponse-CfqviWkz.esm.js} +20 -26
- package/dist/updateAuthFromVerifyResponse-CfqviWkz.esm.js.map +1 -0
- package/dist/utils/assertChainName/assertChainName.d.ts +15 -0
- package/dist/utils/assertChainName/assertChainName.d.ts.map +1 -0
- package/dist/utils/assertChainName/index.d.ts +2 -0
- package/dist/utils/assertChainName/index.d.ts.map +1 -0
- package/dist/waas.cjs +75 -35
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +75 -37
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +75 -36
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +138 -12
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +135 -9
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +351 -8
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/NativeModuleNotLinkedError-dFDBC524.native.esm.js.map +0 -1
- package/dist/consumeMfaTokenIfRequiredForAction-DdGzQwQQ.esm.js +0 -12
- package/dist/consumeMfaTokenIfRequiredForAction-DdGzQwQQ.esm.js.map +0 -1
- package/dist/consumeMfaTokenIfRequiredForAction-IsOFRL68.cjs +0 -17
- package/dist/consumeMfaTokenIfRequiredForAction-IsOFRL68.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CIcatN8-.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-nLBIQ_5p.native.esm.js.map +0 -1
- package/dist/getSignedSessionId-B2kslh_k.esm.js.map +0 -1
- package/dist/getSignedSessionId-NZ8ndqG1.cjs.map +0 -1
- package/dist/isDynamicWaasEnabled-BbhbghRE.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BmB0lQJf.native.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-D2U3MRnA.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-DP0kk0tY.native.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-BkcGdF_B.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-C1yQ4dm7.native.esm.js +0 -321
- package/dist/migrateFromFireblocks-C1yQ4dm7.native.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-CzPWPaDr.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-B8tDJdXY.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-C_yGmd99.esm.js.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { $ as UnauthorizedError, A as isSignedIn, B as retryOnFail, C as getWalletProviderFromWalletAccount, Ct as version, D as NoWalletProviderFoundError, F as CHAINS_INFO_MAP, G as createApiClient, H as offEvent, I as formatWalletAccountId, L as normalizeAddress, O as generateSessionKeys, P as getChainFromVerifiedCredentialChain, Q as createStorageKeySchema, R as splitWalletProviderKey, S as extractSessionId, St as name, T as getWalletProviderRegistry, U as onEvent, V as emitEvent, W as onceEvent, X as fetchAndStoreNonces, Y as getNonce, Z as updateNoncePoolStorage, _ as instrumentFunction, _t as getDefaultClient, a as initializeWaasClientsForEagerRecovery, at as APIError, b as getUserAgent, bt as BaseError, ct as SDK_API_CORE_VERSION, dt as assertDefined, et as SandboxMaximumThresholdReachedError, f as getWalletProviders, ft as ValueMustBeDefinedError, g as __logoutWithReason_wrapped, gt as NONCE_POOL_SIZE, ht as getPlatform, i as InvalidParamError, it as InvalidExternalAuthError, j as getWalletAccounts, k as fetchProjectSettings, m as checkAndRaiseWalletAccountsChangedEvent, mt as randomString, n as upsertElevatedAccessToken, nt as MfaInvalidOtpError, p as isUserMissingMfaAuth, pt as getElevatedAccessToken, r as parseElevatedAccessToken, rt as LinkCredentialError, st as DYNAMIC_ICONIC_SPRITE_URL, t as updateAuthFromVerifyResponse, tt as MfaRateLimitedError, ut as isCookieEnabled, v as scrubParameters, vt as setDefaultClient, w as WalletProviderPriority, x as getOperatingSystem, xt as getCore, y as DEFAULT_PII_FIELDS } from "./updateAuthFromVerifyResponse-
|
|
2
|
-
import { A as createCrossTabBroadcast, B as
|
|
3
|
-
import { n as
|
|
4
|
-
import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-
|
|
5
|
-
import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-
|
|
6
|
-
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { $ as UnauthorizedError, A as isSignedIn, B as retryOnFail, C as getWalletProviderFromWalletAccount, Ct as version, D as NoWalletProviderFoundError, F as CHAINS_INFO_MAP, G as createApiClient, H as offEvent, I as formatWalletAccountId, L as normalizeAddress, O as generateSessionKeys, P as getChainFromVerifiedCredentialChain, Q as createStorageKeySchema, R as splitWalletProviderKey, S as extractSessionId, St as name, T as getWalletProviderRegistry, U as onEvent, V as emitEvent, W as onceEvent, X as fetchAndStoreNonces, Y as getNonce, Z as updateNoncePoolStorage, _ as instrumentFunction, _t as getDefaultClient, a as initializeWaasClientsForEagerRecovery, at as APIError, b as getUserAgent, bt as BaseError, ct as SDK_API_CORE_VERSION, dt as assertDefined, et as SandboxMaximumThresholdReachedError, f as getWalletProviders, ft as ValueMustBeDefinedError, g as __logoutWithReason_wrapped, gt as NONCE_POOL_SIZE, ht as getPlatform, i as InvalidParamError, it as InvalidExternalAuthError, j as getWalletAccounts, k as fetchProjectSettings, m as checkAndRaiseWalletAccountsChangedEvent, mt as randomString, n as upsertElevatedAccessToken, nt as MfaInvalidOtpError, p as isUserMissingMfaAuth, pt as getElevatedAccessToken, r as parseElevatedAccessToken, rt as LinkCredentialError, st as DYNAMIC_ICONIC_SPRITE_URL, t as updateAuthFromVerifyResponse, tt as MfaRateLimitedError, ut as isCookieEnabled, v as scrubParameters, vt as setDefaultClient, w as WalletProviderPriority, x as getOperatingSystem, xt as getCore, y as DEFAULT_PII_FIELDS } from "./updateAuthFromVerifyResponse-CfqviWkz.esm.js";
|
|
2
|
+
import { A as createCrossTabBroadcast, B as getBuffer, C as getKeychainIndexedDBName, D as assertSafeNavigationUrl, E as createKeychainService, F as FETCH_PROJECT_SETTINGS_TRACKER_KEY, G as createLocalStorageAdapter, H as isEqualShallow, I as GENERATE_SESSION_KEYS_TRACKER_KEY, K as isServerSideRendering, L as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, M as CannotTrackError, N as createDeferredPromise, P as createAppForegroundSubscriber, R as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, S as MergeAccountsConfirmationError, T as assertSafeDeeplinkUrl, U as createStorage, V as subscribeWithSelector, _ as consumeCaptchaToken, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as updateWalletProviderKeysForVerifiedCredentials, f as setUnverifiedWalletAccounts, g as MethodNotImplementedError, h as __setCaptchaToken_wrapped, i as getNetworksData, k as createLogger, l as getAppMetadata, m as hasExtension, o as removeUnverifiedWalletAccount, p as createVisit, q as UnavailableInServerSideError, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as reconcileWalletAccountsAgainstClient, v as isCaptchaRequired, w as createRealtimeService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY } from "./getNetworkProviderFromNetworkId-D7lIOS6I.esm.js";
|
|
3
|
+
import { i as __refreshAuth_wrapped, n as TransactionBroadcastError, r as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-CBvSRUgG.esm.js";
|
|
4
|
+
import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-k3nlisFA.esm.js";
|
|
5
|
+
import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-CU8zmrf2.esm.js";
|
|
6
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-D1rhRlDu.esm.js";
|
|
7
7
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
8
|
-
import { AuthModeEnum, CaptchaProviderEnum as CaptchaProviderEnum$1, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, JwtVerifiedCredentialFormatEnum as JwtVerifiedCredentialFormatEnum$1, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, ProviderEnum as ProviderEnum$1, TokenScope, TokenScope as TokenScope$1, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
8
|
+
import { AuthModeEnum, CaptchaProviderEnum as CaptchaProviderEnum$1, ChainEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, JwtVerifiedCredentialFormatEnum as JwtVerifiedCredentialFormatEnum$1, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, ProviderEnum as ProviderEnum$1, TokenScope, TokenScope as TokenScope$1, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
9
9
|
import * as z from "zod/mini";
|
|
10
10
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from "eventemitter3";
|
|
11
11
|
import { browserSupportsWebAuthn, startAuthentication, startRegistration } from "@simplewebauthn/browser";
|
|
@@ -976,6 +976,7 @@ const createCore = (config) => {
|
|
|
976
976
|
});
|
|
977
977
|
const fetch = config.coreConfig?.fetch ?? createWebFetch();
|
|
978
978
|
const openDeeplink = config.coreConfig?.openDeeplink ?? createDeeplinkOpener();
|
|
979
|
+
const subscribeToAppForeground = createAppForegroundSubscriber();
|
|
979
980
|
const openAuthSession = config.coreConfig?.openAuthSession;
|
|
980
981
|
const navigate = config.coreConfig?.navigate ?? createNavigationHandler();
|
|
981
982
|
const state = createObservableState(getInitialState);
|
|
@@ -1031,6 +1032,7 @@ const createCore = (config) => {
|
|
|
1031
1032
|
sdkSessionId,
|
|
1032
1033
|
state,
|
|
1033
1034
|
storage,
|
|
1035
|
+
subscribeToAppForeground,
|
|
1034
1036
|
transformers: config.transformers,
|
|
1035
1037
|
version,
|
|
1036
1038
|
waas: config.waas
|
|
@@ -1156,6 +1158,150 @@ var CheckoutSessionTokenMissingError = class extends BaseError {
|
|
|
1156
1158
|
}
|
|
1157
1159
|
};
|
|
1158
1160
|
|
|
1161
|
+
//#endregion
|
|
1162
|
+
//#region src/errors/CoinbaseTransferMfaFailedError.ts
|
|
1163
|
+
/**
|
|
1164
|
+
* Thrown when a {@link createCoinbaseExchangeTransfer} retry supplies an
|
|
1165
|
+
* `mfaCode` that Coinbase rejects -- the two-step verification code was
|
|
1166
|
+
* incorrect, or it expired before the retry was submitted. Coinbase's own
|
|
1167
|
+
* codes are short-lived, so this is expected to happen occasionally even
|
|
1168
|
+
* with correct user input; it does not mean the transfer itself is invalid.
|
|
1169
|
+
*
|
|
1170
|
+
* Coinbase does not automatically send a new code on this failure -- prompt
|
|
1171
|
+
* the user again and retry, which triggers
|
|
1172
|
+
* {@link CoinbaseTransferMfaRequiredError} again and, with it, a fresh code.
|
|
1173
|
+
*
|
|
1174
|
+
* @example
|
|
1175
|
+
* ```ts
|
|
1176
|
+
* const transferParams = { accountId, amount: 0.5, currency: 'USDC', to };
|
|
1177
|
+
* const submitWithMfaCode = (mfaCode: string) =>
|
|
1178
|
+
* createCoinbaseExchangeTransfer({ ...transferParams, mfaCode });
|
|
1179
|
+
*
|
|
1180
|
+
* try {
|
|
1181
|
+
* await submitWithMfaCode(mfaCode);
|
|
1182
|
+
* } catch (error) {
|
|
1183
|
+
* if (error instanceof CoinbaseTransferMfaFailedError) {
|
|
1184
|
+
* // wrong or expired code -- ask the user to try again
|
|
1185
|
+
* await createCoinbaseExchangeTransfer(transferParams);
|
|
1186
|
+
* }
|
|
1187
|
+
* }
|
|
1188
|
+
* ```
|
|
1189
|
+
* @see createCoinbaseExchangeTransfer
|
|
1190
|
+
* @see CoinbaseTransferMfaRequiredError
|
|
1191
|
+
*/
|
|
1192
|
+
var CoinbaseTransferMfaFailedError = class extends BaseError {
|
|
1193
|
+
constructor({ cause }) {
|
|
1194
|
+
super({
|
|
1195
|
+
cause,
|
|
1196
|
+
code: "transfer_mfa_failed",
|
|
1197
|
+
docsUrl: null,
|
|
1198
|
+
name: "CoinbaseTransferMfaFailedError",
|
|
1199
|
+
shortMessage: "The Coinbase two-step verification code was incorrect or has expired. Retry createCoinbaseExchangeTransfer with a fresh 'mfaCode'."
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
//#endregion
|
|
1205
|
+
//#region src/errors/CoinbaseTransferMfaRequiredError.ts
|
|
1206
|
+
/**
|
|
1207
|
+
* Thrown when Coinbase rejects a {@link createCoinbaseExchangeTransfer} call
|
|
1208
|
+
* because the account holder's two-step verification ("2FA") is required to
|
|
1209
|
+
* authorize the transfer. This is unrelated to Dynamic's own step-up auth
|
|
1210
|
+
* (see {@link checkStepUpAuth}) -- it is a security requirement enforced by
|
|
1211
|
+
* Coinbase itself, on the Coinbase account being transferred from.
|
|
1212
|
+
*
|
|
1213
|
+
* The first `createCoinbaseExchangeTransfer` call for a transfer
|
|
1214
|
+
* automatically triggers Coinbase to send the account holder a verification
|
|
1215
|
+
* code (SMS, or push to an authenticator app such as Authy if one is
|
|
1216
|
+
* linked). Retry the *same* transfer with `mfaCode` set to that code before
|
|
1217
|
+
* it expires. If the code is wrong or has expired, the retry throws
|
|
1218
|
+
* {@link CoinbaseTransferMfaFailedError} instead, so a fresh code can be
|
|
1219
|
+
* requested and retried again.
|
|
1220
|
+
*
|
|
1221
|
+
* @example
|
|
1222
|
+
* ```ts
|
|
1223
|
+
* const transferParams = { accountId, amount: 0.5, currency: 'USDC', to };
|
|
1224
|
+
*
|
|
1225
|
+
* try {
|
|
1226
|
+
* await createCoinbaseExchangeTransfer(transferParams);
|
|
1227
|
+
* } catch (error) {
|
|
1228
|
+
* if (error instanceof CoinbaseTransferMfaRequiredError) {
|
|
1229
|
+
* // Coinbase already sent a code to the account holder -- prompt for it
|
|
1230
|
+
* const mfaCode = await promptUserForCoinbase2faCode();
|
|
1231
|
+
* await createCoinbaseExchangeTransfer({ ...transferParams, mfaCode });
|
|
1232
|
+
* }
|
|
1233
|
+
* }
|
|
1234
|
+
* ```
|
|
1235
|
+
* @see createCoinbaseExchangeTransfer
|
|
1236
|
+
* @see CoinbaseTransferMfaFailedError
|
|
1237
|
+
*/
|
|
1238
|
+
var CoinbaseTransferMfaRequiredError = class extends BaseError {
|
|
1239
|
+
constructor({ cause }) {
|
|
1240
|
+
super({
|
|
1241
|
+
cause,
|
|
1242
|
+
code: "transfer_mfa_required",
|
|
1243
|
+
docsUrl: null,
|
|
1244
|
+
name: "CoinbaseTransferMfaRequiredError",
|
|
1245
|
+
shortMessage: "Coinbase requires a two-step verification code to complete this transfer. Coinbase has automatically sent the code to the account holder (SMS or authenticator app) -- retry createCoinbaseExchangeTransfer with 'mfaCode' set to that code before it expires."
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1250
|
+
//#endregion
|
|
1251
|
+
//#region src/errors/CoinbaseTravelRuleRequiredError.ts
|
|
1252
|
+
/**
|
|
1253
|
+
* Thrown when Coinbase rejects a {@link createCoinbaseExchangeTransfer} call
|
|
1254
|
+
* because it's missing "Travel Rule" information about the transfer's
|
|
1255
|
+
* recipient. The Travel Rule is a regulatory requirement on custodial
|
|
1256
|
+
* exchanges (like Coinbase) to collect basic counterparty information above
|
|
1257
|
+
* certain transfer thresholds -- which fields are required depends on the
|
|
1258
|
+
* sender's and recipient's jurisdictions and the transfer amount, so it can't
|
|
1259
|
+
* be predicted client-side; Coinbase reports the exact missing fields on
|
|
1260
|
+
* {@link missingFields}.
|
|
1261
|
+
*
|
|
1262
|
+
* Unlike {@link CoinbaseTransferMfaRequiredError}, retrying does not require
|
|
1263
|
+
* waiting for anything from Coinbase -- collect the listed fields (each has a
|
|
1264
|
+
* user-facing `description`) and retry the same transfer with
|
|
1265
|
+
* `travelRuleData` set.
|
|
1266
|
+
*
|
|
1267
|
+
* @example
|
|
1268
|
+
* ```ts
|
|
1269
|
+
* const transferParams = { accountId, amount: 0.5, currency: 'USDC', to };
|
|
1270
|
+
*
|
|
1271
|
+
* try {
|
|
1272
|
+
* await createCoinbaseExchangeTransfer(transferParams);
|
|
1273
|
+
* } catch (error) {
|
|
1274
|
+
* if (error instanceof CoinbaseTravelRuleRequiredError) {
|
|
1275
|
+
* // e.g. [{ name: 'BENEFICIARY_NAME', description: "The recipient's full legal name." }, ...]
|
|
1276
|
+
* console.log(error.missingFields);
|
|
1277
|
+
*
|
|
1278
|
+
* const travelRuleData = await promptUserForTravelRuleFields(
|
|
1279
|
+
* error.missingFields
|
|
1280
|
+
* );
|
|
1281
|
+
* await createCoinbaseExchangeTransfer({ ...transferParams, travelRuleData });
|
|
1282
|
+
* }
|
|
1283
|
+
* }
|
|
1284
|
+
* ```
|
|
1285
|
+
* @see createCoinbaseExchangeTransfer
|
|
1286
|
+
* @see CoinbaseTravelRuleData
|
|
1287
|
+
* @see CoinbaseTravelRuleFieldName
|
|
1288
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
1289
|
+
*/
|
|
1290
|
+
var CoinbaseTravelRuleRequiredError = class extends BaseError {
|
|
1291
|
+
missingFields;
|
|
1292
|
+
constructor({ cause, missingFields }) {
|
|
1293
|
+
super({
|
|
1294
|
+
cause,
|
|
1295
|
+
code: "coinbase_travel_rule_required",
|
|
1296
|
+
docsUrl: "https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule",
|
|
1297
|
+
metaMessages: missingFields.map(({ name: name$1, description }) => `- ${name$1}: ${description}`),
|
|
1298
|
+
name: "CoinbaseTravelRuleRequiredError",
|
|
1299
|
+
shortMessage: "Coinbase requires additional recipient information (Travel Rule compliance) before this transfer can complete."
|
|
1300
|
+
});
|
|
1301
|
+
this.missingFields = missingFields;
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1159
1305
|
//#endregion
|
|
1160
1306
|
//#region src/errors/DeeplinkConnectAndVerifyUnsupportedError.ts
|
|
1161
1307
|
var DeeplinkConnectAndVerifyUnsupportedError = class extends BaseError {
|
|
@@ -3968,6 +4114,196 @@ const addCoinbaseOnrampOrderEventListener = ({ listener }, client = getDefaultCl
|
|
|
3968
4114
|
};
|
|
3969
4115
|
};
|
|
3970
4116
|
|
|
4117
|
+
//#endregion
|
|
4118
|
+
//#region src/modules/funding/coinbase/coinbase.consts.ts
|
|
4119
|
+
/**
|
|
4120
|
+
* Whether the transfer's destination wallet is self-hosted (controlled
|
|
4121
|
+
* directly by its owner, with no custodial exchange in between) or held at
|
|
4122
|
+
* another exchange -- required by some jurisdictions' Travel Rule rules, see
|
|
4123
|
+
* {@link CoinbaseTravelRuleData}.
|
|
4124
|
+
*
|
|
4125
|
+
* @example
|
|
4126
|
+
* ```typescript
|
|
4127
|
+
* const walletType = CoinbaseBeneficiaryWalletType.SelfHosted;
|
|
4128
|
+
* ```
|
|
4129
|
+
* @see CoinbaseTravelRuleData
|
|
4130
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
4131
|
+
*/
|
|
4132
|
+
const CoinbaseBeneficiaryWalletType = {
|
|
4133
|
+
Exchange: "WALLET_TYPE_EXCHANGE",
|
|
4134
|
+
SelfHosted: "WALLET_TYPE_SELF_HOSTED"
|
|
4135
|
+
};
|
|
4136
|
+
/**
|
|
4137
|
+
* Whether the transfer's destination wallet also belongs to the sender --
|
|
4138
|
+
* required by some jurisdictions' Travel Rule rules, see
|
|
4139
|
+
* {@link CoinbaseTravelRuleData}.
|
|
4140
|
+
*
|
|
4141
|
+
* @example
|
|
4142
|
+
* ```typescript
|
|
4143
|
+
* const isSelfTransfer = CoinbaseIsSelfTransfer.SelfOwned;
|
|
4144
|
+
* ```
|
|
4145
|
+
* @see CoinbaseTravelRuleData
|
|
4146
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
4147
|
+
*/
|
|
4148
|
+
const CoinbaseIsSelfTransfer = {
|
|
4149
|
+
NotSelfOwned: "IS_SELF_FALSE",
|
|
4150
|
+
SelfOwned: "IS_SELF_TRUE"
|
|
4151
|
+
};
|
|
4152
|
+
/**
|
|
4153
|
+
* The individual Travel Rule fields Coinbase can require on a transfer.
|
|
4154
|
+
* Which of these are actually required depends on the sender's and
|
|
4155
|
+
* recipient's jurisdictions and the transfer amount -- Coinbase reports the
|
|
4156
|
+
* exact list that's missing for a given transfer via
|
|
4157
|
+
* {@link CoinbaseTravelRuleRequiredError.missingFields}.
|
|
4158
|
+
*
|
|
4159
|
+
* @example
|
|
4160
|
+
* ```typescript
|
|
4161
|
+
* const fieldName = CoinbaseTravelRuleFieldName.BeneficiaryName;
|
|
4162
|
+
* ```
|
|
4163
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
4164
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
4165
|
+
*/
|
|
4166
|
+
const CoinbaseTravelRuleFieldName = {
|
|
4167
|
+
BeneficiaryAddress: "BENEFICIARY_ADDRESS",
|
|
4168
|
+
BeneficiaryCountry: "BENEFICIARY_COUNTRY",
|
|
4169
|
+
BeneficiaryFinancialInstitution: "BENEFICIARY_FINANCIAL_INSTITUTION",
|
|
4170
|
+
BeneficiaryName: "BENEFICIARY_NAME",
|
|
4171
|
+
BeneficiaryWalletType: "BENEFICIARY_WALLET_TYPE",
|
|
4172
|
+
IsSelf: "IS_SELF",
|
|
4173
|
+
TransferPurpose: "TRANSFER_PURPOSE"
|
|
4174
|
+
};
|
|
4175
|
+
/**
|
|
4176
|
+
* Human-readable description of a {@link CoinbaseTravelRuleFieldName},
|
|
4177
|
+
* written to be shown directly to an end user (for example, as helper text
|
|
4178
|
+
* next to the form field that collects it).
|
|
4179
|
+
*
|
|
4180
|
+
* @example
|
|
4181
|
+
* ```typescript
|
|
4182
|
+
* const description = COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS.IS_SELF;
|
|
4183
|
+
* // "Whether the destination wallet also belongs to you."
|
|
4184
|
+
* ```
|
|
4185
|
+
* @see CoinbaseTravelRuleFieldName
|
|
4186
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
4187
|
+
*/
|
|
4188
|
+
const COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS = {
|
|
4189
|
+
BENEFICIARY_ADDRESS: "The recipient's postal address.",
|
|
4190
|
+
BENEFICIARY_COUNTRY: "The recipient's country, as an ISO 3166-1 alpha-2 code (e.g. \"US\", \"GB\").",
|
|
4191
|
+
BENEFICIARY_FINANCIAL_INSTITUTION: "The identifier (VASP ID) of the recipient exchange, required when the destination wallet is held at another exchange rather than self-hosted.",
|
|
4192
|
+
BENEFICIARY_NAME: "The recipient's full legal name.",
|
|
4193
|
+
BENEFICIARY_WALLET_TYPE: "Whether the destination wallet is self-hosted (the recipient controls it directly) or held at another exchange.",
|
|
4194
|
+
IS_SELF: "Whether the destination wallet also belongs to you.",
|
|
4195
|
+
TRANSFER_PURPOSE: "The reason for this transfer (e.g. \"Rent\", \"Gift\")."
|
|
4196
|
+
};
|
|
4197
|
+
|
|
4198
|
+
//#endregion
|
|
4199
|
+
//#region src/modules/funding/coinbase/utils/parseCoinbaseTravelRuleMissingFields/parseCoinbaseTravelRuleMissingFields.ts
|
|
4200
|
+
/**
|
|
4201
|
+
* Coinbase reports missing Travel Rule fields as a bracketed, comma-separated
|
|
4202
|
+
* list appended to its error message, e.g. `"... Param:
|
|
4203
|
+
* [BENEFICIARY_WALLET_TYPE, BENEFICIARY_NAME]"`.
|
|
4204
|
+
*/
|
|
4205
|
+
const TRAVEL_RULE_PARAM_LIST_REGEX = /Param:\s*\[([^\]]+)\]/;
|
|
4206
|
+
const isCoinbaseTravelRuleFieldName = (name$1) => Object.hasOwn(COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS, name$1);
|
|
4207
|
+
/**
|
|
4208
|
+
* Extracts the list of missing Travel Rule fields from a Coinbase
|
|
4209
|
+
* `unknown_transfer_error` message, pairing each field with its user-facing
|
|
4210
|
+
* description. Returns an empty array if the message doesn't contain a
|
|
4211
|
+
* recognizable Travel Rule field list (i.e. this isn't a Travel Rule error).
|
|
4212
|
+
*
|
|
4213
|
+
* @param params.message - The raw `error` string from Coinbase's response body.
|
|
4214
|
+
* @returns The missing fields, or an empty array if none were found.
|
|
4215
|
+
* @example
|
|
4216
|
+
* ```typescript
|
|
4217
|
+
* const missingFields = parseCoinbaseTravelRuleMissingFields({
|
|
4218
|
+
* message: 'Incomplete travel rules information provided. Param: [BENEFICIARY_NAME, IS_SELF]',
|
|
4219
|
+
* });
|
|
4220
|
+
* // [
|
|
4221
|
+
* // { name: 'BENEFICIARY_NAME', description: "The recipient's full legal name." },
|
|
4222
|
+
* // { name: 'IS_SELF', description: 'Whether the destination wallet also belongs to you.' },
|
|
4223
|
+
* // ]
|
|
4224
|
+
* ```
|
|
4225
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
4226
|
+
* @notInstrumented
|
|
4227
|
+
*/
|
|
4228
|
+
const parseCoinbaseTravelRuleMissingFields = ({ message }) => {
|
|
4229
|
+
const match = TRAVEL_RULE_PARAM_LIST_REGEX.exec(message);
|
|
4230
|
+
if (!match) return [];
|
|
4231
|
+
return match[1].split(",").map((name$1) => name$1.trim()).filter(isCoinbaseTravelRuleFieldName).map((name$1) => ({
|
|
4232
|
+
description: COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS[name$1],
|
|
4233
|
+
name: name$1
|
|
4234
|
+
}));
|
|
4235
|
+
};
|
|
4236
|
+
|
|
4237
|
+
//#endregion
|
|
4238
|
+
//#region src/modules/funding/coinbase/createCoinbaseExchangeTransfer/createCoinbaseExchangeTransfer.ts
|
|
4239
|
+
/**
|
|
4240
|
+
* Creates a Coinbase exchange transfer to send crypto from a Coinbase account to an external address.
|
|
4241
|
+
*
|
|
4242
|
+
* Coinbase may reject the transfer for reasons that require a second attempt
|
|
4243
|
+
* rather than a hard failure:
|
|
4244
|
+
* - {@link CoinbaseTransferMfaRequiredError} / {@link CoinbaseTransferMfaFailedError} --
|
|
4245
|
+
* Coinbase's own two-step verification on the sending account.
|
|
4246
|
+
* - {@link CoinbaseTravelRuleRequiredError} -- missing recipient information
|
|
4247
|
+
* required by regulation for this transfer's jurisdictions/amount.
|
|
4248
|
+
*
|
|
4249
|
+
* @param transferParams - The parameters for the transfer including accountId.
|
|
4250
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4251
|
+
* @returns A promise resolving to the created exchange transfer.
|
|
4252
|
+
* @throws {CoinbaseTransferMfaRequiredError} When the API requires MFA for the transfer.
|
|
4253
|
+
* @throws {CoinbaseTransferMfaFailedError} When the provided MFA code is rejected.
|
|
4254
|
+
* @throws {CoinbaseTravelRuleRequiredError} When Coinbase requires additional recipient information for the transfer.
|
|
4255
|
+
* @throws {APIError} For any other API error returned by the exchange transfer request.
|
|
4256
|
+
* @example
|
|
4257
|
+
* ```typescript
|
|
4258
|
+
* // Include any known recipient info upfront -- see travelRuleData below for why.
|
|
4259
|
+
* const transferParams = {
|
|
4260
|
+
* accountId: accounts[0].id,
|
|
4261
|
+
* amount: 0.5,
|
|
4262
|
+
* currency: 'USDC',
|
|
4263
|
+
* to: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
|
|
4264
|
+
* travelRuleData: { beneficiaryName: 'Jane Doe', beneficiaryCountry: 'US' },
|
|
4265
|
+
* };
|
|
4266
|
+
*
|
|
4267
|
+
* try {
|
|
4268
|
+
* const transfer = await createCoinbaseExchangeTransfer(transferParams);
|
|
4269
|
+
* } catch (error) {
|
|
4270
|
+
* if (error instanceof CoinbaseTravelRuleRequiredError) {
|
|
4271
|
+
* const travelRuleData = await promptUserForTravelRuleFields(error.missingFields);
|
|
4272
|
+
* await createCoinbaseExchangeTransfer({ ...transferParams, travelRuleData });
|
|
4273
|
+
* }
|
|
4274
|
+
* }
|
|
4275
|
+
* ```
|
|
4276
|
+
* @see getCoinbaseAccounts
|
|
4277
|
+
* @see CoinbaseTransferMfaRequiredError
|
|
4278
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
4279
|
+
* @notInstrumented
|
|
4280
|
+
*/
|
|
4281
|
+
const createCoinbaseExchangeTransfer = async (transferParams, client = getDefaultClient()) => {
|
|
4282
|
+
const core = getCore(client);
|
|
4283
|
+
const apiClient = createApiClient({ includeMfaToken: true }, client);
|
|
4284
|
+
const { accountId, ...createExchangeTransferRequest } = transferParams;
|
|
4285
|
+
try {
|
|
4286
|
+
return await apiClient.postExchangeAccountTransfer({
|
|
4287
|
+
accountId,
|
|
4288
|
+
createExchangeTransferRequest,
|
|
4289
|
+
environmentId: core.environmentId,
|
|
4290
|
+
exchangeKey: ExchangeKeyEnum.Coinbase
|
|
4291
|
+
});
|
|
4292
|
+
} catch (error) {
|
|
4293
|
+
if (!(error instanceof APIError)) throw error;
|
|
4294
|
+
if (error.code === "transfer_mfa_required") throw new CoinbaseTransferMfaRequiredError({ cause: error });
|
|
4295
|
+
if (error.code === "transfer_mfa_failed") throw new CoinbaseTransferMfaFailedError({ cause: error });
|
|
4296
|
+
if (error.code === "unknown_transfer_error") {
|
|
4297
|
+
const missingFields = parseCoinbaseTravelRuleMissingFields({ message: error.message });
|
|
4298
|
+
if (missingFields.length > 0) throw new CoinbaseTravelRuleRequiredError({
|
|
4299
|
+
cause: error,
|
|
4300
|
+
missingFields
|
|
4301
|
+
});
|
|
4302
|
+
}
|
|
4303
|
+
throw error;
|
|
4304
|
+
}
|
|
4305
|
+
};
|
|
4306
|
+
|
|
3971
4307
|
//#endregion
|
|
3972
4308
|
//#region src/modules/funding/coinbase/getMissingVerificationForCoinbaseOnrampOrder/getMissingVerificationForCoinbaseOnrampOrder.ts
|
|
3973
4309
|
/**
|
|
@@ -4089,6 +4425,59 @@ const __createCoinbaseOnrampOrder_wrapped = instrumentFunction({
|
|
|
4089
4425
|
}
|
|
4090
4426
|
});
|
|
4091
4427
|
|
|
4428
|
+
//#endregion
|
|
4429
|
+
//#region src/utils/assertChainName/assertChainName.ts
|
|
4430
|
+
const CHAIN_ENUM_VALUES = Object.values(ChainEnum);
|
|
4431
|
+
/**
|
|
4432
|
+
* Validates that a chain name is a recognized ChainEnum value.
|
|
4433
|
+
*
|
|
4434
|
+
* Throws an {@link InvalidParamError} when the value is undefined or is not a
|
|
4435
|
+
* valid chain name.
|
|
4436
|
+
*
|
|
4437
|
+
* @category Extension Development
|
|
4438
|
+
*
|
|
4439
|
+
* @param chainName - The chain name to validate.
|
|
4440
|
+
* @throws {InvalidParamError} When chainName is undefined or not a valid ChainEnum value.
|
|
4441
|
+
* @notInstrumented
|
|
4442
|
+
*/
|
|
4443
|
+
const assertChainName = (chainName) => {
|
|
4444
|
+
if (chainName === void 0) throw new InvalidParamError("chainName is required");
|
|
4445
|
+
if (!CHAIN_ENUM_VALUES.includes(chainName)) throw new InvalidParamError(`Invalid chainName: ${chainName}`);
|
|
4446
|
+
};
|
|
4447
|
+
|
|
4448
|
+
//#endregion
|
|
4449
|
+
//#region src/modules/funding/coinbase/getCoinbaseAccounts/getCoinbaseAccounts.ts
|
|
4450
|
+
/**
|
|
4451
|
+
* Gets the Coinbase accounts (balances) for the authenticated user.
|
|
4452
|
+
*
|
|
4453
|
+
* @param [params] GetCoinbaseAccountsParams - Optional filters for the accounts.
|
|
4454
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4455
|
+
* @returns A promise resolving to an array of Coinbase accounts with balances.
|
|
4456
|
+
* @throws {InvalidParamError} When chainName is not a valid ChainEnum value or networkId is a non-integer or negative number.
|
|
4457
|
+
* @example
|
|
4458
|
+
* ```typescript
|
|
4459
|
+
* const accounts = await getCoinbaseAccounts({ chainName: 'EVM' });
|
|
4460
|
+
* console.log(accounts[0].balances);
|
|
4461
|
+
* ```
|
|
4462
|
+
* @see createCoinbaseExchangeTransfer
|
|
4463
|
+
* @see GetCoinbaseAccountsParams
|
|
4464
|
+
* @notInstrumented
|
|
4465
|
+
*/
|
|
4466
|
+
const getCoinbaseAccounts = async (params, client = getDefaultClient()) => {
|
|
4467
|
+
const core = getCore(client);
|
|
4468
|
+
const apiClient = createApiClient({ includeMfaToken: true }, client);
|
|
4469
|
+
const chainName = params?.chainName;
|
|
4470
|
+
if (chainName !== void 0) assertChainName(chainName);
|
|
4471
|
+
const networkId = params?.networkId;
|
|
4472
|
+
if (networkId !== void 0 && (!Number.isInteger(networkId) || networkId < 0)) throw new InvalidParamError(`Invalid networkId: ${networkId}`);
|
|
4473
|
+
return await apiClient.getUserAccounts({
|
|
4474
|
+
chainName,
|
|
4475
|
+
environmentId: core.environmentId,
|
|
4476
|
+
exchangeKey: ExchangeKeyEnum.Coinbase,
|
|
4477
|
+
networkId
|
|
4478
|
+
});
|
|
4479
|
+
};
|
|
4480
|
+
|
|
4092
4481
|
//#endregion
|
|
4093
4482
|
//#region src/modules/funding/coinbase/getCoinbaseBuyUrl/getCoinbaseBuyUrl.ts
|
|
4094
4483
|
/**
|
|
@@ -9198,5 +9587,5 @@ const parseUserAgent = ({ userAgent }) => {
|
|
|
9198
9587
|
assertPackageVersion(name, version);
|
|
9199
9588
|
|
|
9200
9589
|
//#endregion
|
|
9201
|
-
export { BaseError, CaptchaProviderEnum, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, 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, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, ProviderEnum, SandboxMaximumThresholdReachedError, SimulationFailedError, TokenScope, TokenSwapError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserCancelledSocialPopUpError, UserNotAuthenticatedError, UserRejectedError, WaasLoadFailedError, WaasOnboardingIncompleteError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, 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, 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, __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, detectDeviceRegistrationRedirect, detectOAuthRedirect, detectSocialRedirectUrl, excludeInstalledFromCatalog, __executeSwapTransaction_wrapped as executeSwapTransaction, fetchProjectSettings, findMissingGoogleDriveBackupScopes, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getBalances, getCaptchaSettings, getCheckoutTransaction, getCheckoutTransactionQuote, 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, getPrimaryWalletAccount, getRegisteredDevices, getSelectedWalletAccount, getSwapQuote, getSwapStatus, getTokenBalances, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletOptionsCatalogue, getWalletProviderDataByKey, hasAllGoogleDriveBackupScopes, hasExtension, __initializeClient_wrapped as initializeClient, isAnyWalletAccountConnected, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isHardwareWalletAccount, isInsufficientGoogleDriveScopesError, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, matchWalletProvidersToCatalogGroup, mergeUserAccounts, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __prepareFlowSigning_wrapped as prepareFlowSigning, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __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, __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 };
|
|
9590
|
+
export { 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, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, ProviderEnum, SandboxMaximumThresholdReachedError, SimulationFailedError, TokenScope, TokenSwapError, TransactionBroadcastError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserCancelledSocialPopUpError, UserNotAuthenticatedError, UserRejectedError, WaasLoadFailedError, WaasOnboardingIncompleteError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, 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, 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, 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, getPrimaryWalletAccount, getRegisteredDevices, getSelectedWalletAccount, getSwapQuote, getSwapStatus, getTokenBalances, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletOptionsCatalogue, getWalletProviderDataByKey, hasAllGoogleDriveBackupScopes, hasExtension, __initializeClient_wrapped as initializeClient, isAnyWalletAccountConnected, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isHardwareWalletAccount, isInsufficientGoogleDriveScopesError, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, matchWalletProvidersToCatalogGroup, mergeUserAccounts, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __prepareFlowSigning_wrapped as prepareFlowSigning, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __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, __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 };
|
|
9202
9591
|
//# sourceMappingURL=index.esm.js.map
|