@dynamic-labs-sdk/client 1.25.0 → 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 +6 -5
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +6 -6
- 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 +2 -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-CN0fhJMJ.native.esm.js → getNetworkProviderFromNetworkId-C5GtE2ef.native.esm.js} +29 -5
- package/dist/getNetworkProviderFromNetworkId-C5GtE2ef.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-CtXKqsri.cjs → getNetworkProviderFromNetworkId-CSxvdrc9.cjs} +32 -2
- package/dist/{getNetworkProviderFromNetworkId-DCvqxwoP.esm.js.map → getNetworkProviderFromNetworkId-CSxvdrc9.cjs.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-DCvqxwoP.esm.js → getNetworkProviderFromNetworkId-D7lIOS6I.esm.js} +27 -3
- package/dist/getNetworkProviderFromNetworkId-D7lIOS6I.esm.js.map +1 -0
- package/dist/{getSignedSessionId-B3aCjPhf.native.esm.js → getSignedSessionId-B5Dijw-8.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-B3aCjPhf.native.esm.js.map → getSignedSessionId-B5Dijw-8.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-BmL1vPnC.esm.js → getSignedSessionId-BiL9k0nE.esm.js} +3 -3
- package/dist/{getSignedSessionId-BmL1vPnC.esm.js.map → getSignedSessionId-BiL9k0nE.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DIn697B6.cjs → getSignedSessionId-CpcQiZTF.cjs} +3 -3
- package/dist/{getSignedSessionId-DIn697B6.cjs.map → getSignedSessionId-CpcQiZTF.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-DtcD_nPD.cjs → getWalletProviderByKey-BMJ9TcjM.cjs} +2 -2
- package/dist/{getWalletProviderByKey-DtcD_nPD.cjs.map → getWalletProviderByKey-BMJ9TcjM.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-Pg1oNi-G.native.esm.js → getWalletProviderByKey-CBIrILYZ.native.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-Pg1oNi-G.native.esm.js.map → getWalletProviderByKey-CBIrILYZ.native.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-Dm7Ey9SI.esm.js → getWalletProviderByKey-CU8zmrf2.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-Dm7Ey9SI.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-BC2gR0R1.esm.js → isDynamicWaasEnabled-CBvSRUgG.esm.js} +34 -3
- package/dist/isDynamicWaasEnabled-CBvSRUgG.esm.js.map +1 -0
- package/dist/{isDynamicWaasEnabled-B75AeGiP.native.esm.js → isDynamicWaasEnabled-d82cX7j9.native.esm.js} +34 -3
- package/dist/isDynamicWaasEnabled-d82cX7j9.native.esm.js.map +1 -0
- package/dist/{isDynamicWaasEnabled-BWvSMhAP.cjs → isDynamicWaasEnabled-idmeju9B.cjs} +39 -2
- package/dist/isDynamicWaasEnabled-idmeju9B.cjs.map +1 -0
- package/dist/{isMfaRequiredForAction-WmEokgKF.native.esm.js → isMfaRequiredForAction-1O_rFiPN.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-WmEokgKF.native.esm.js.map → isMfaRequiredForAction-1O_rFiPN.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-ncRFYLGn.esm.js → isMfaRequiredForAction-D1rhRlDu.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-ncRFYLGn.esm.js.map → isMfaRequiredForAction-D1rhRlDu.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-Dr44C3-l.cjs → isMfaRequiredForAction-D5o4qznt.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-Dr44C3-l.cjs.map → isMfaRequiredForAction-D5o4qznt.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-B9vzjs71.cjs → isUserOnboardingComplete-BfRUVwrT.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-B9vzjs71.cjs.map → isUserOnboardingComplete-BfRUVwrT.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-G6Hf8p_v.native.esm.js → isUserOnboardingComplete-bR7jwdjO.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-G6Hf8p_v.native.esm.js.map → isUserOnboardingComplete-bR7jwdjO.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-B-J8O4KB.esm.js → isUserOnboardingComplete-k3nlisFA.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-B-J8O4KB.esm.js.map → isUserOnboardingComplete-k3nlisFA.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-MbP1ajwI.cjs → migrateFromFireblocks-BcYmEZ3_.cjs} +3 -3
- package/dist/{migrateFromFireblocks-MbP1ajwI.cjs.map → migrateFromFireblocks-BcYmEZ3_.cjs.map} +1 -1
- package/dist/{migrateFromFireblocks-fY2IrQgU.esm.js → migrateFromFireblocks-Bm7eIfaa.esm.js} +3 -3
- package/dist/{migrateFromFireblocks-fY2IrQgU.esm.js.map → migrateFromFireblocks-Bm7eIfaa.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-kFz_kyA5.native.esm.js → migrateFromFireblocks-DVP5tGv_.native.esm.js} +3 -3
- package/dist/{migrateFromFireblocks-kFz_kyA5.native.esm.js.map → migrateFromFireblocks-DVP5tGv_.native.esm.js.map} +1 -1
- 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/createBusinessAccount/createBusinessAccount.d.ts +11 -0
- package/dist/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.d.ts +14 -2
- package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.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-D9kFrAkK.cjs → updateAuthFromVerifyResponse-CPOvKWih.cjs} +20 -26
- package/dist/updateAuthFromVerifyResponse-CPOvKWih.cjs.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-WlGmt2v0.native.esm.js → updateAuthFromVerifyResponse-CTfG6oZa.native.esm.js} +20 -26
- package/dist/updateAuthFromVerifyResponse-CTfG6oZa.native.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-ZzU46s0t.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 +21 -8
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +21 -9
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +21 -9
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +89 -6
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +90 -7
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +90 -7
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/getNetworkProviderFromNetworkId-CN0fhJMJ.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CtXKqsri.cjs.map +0 -1
- package/dist/isDynamicWaasEnabled-B75AeGiP.native.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BC2gR0R1.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BWvSMhAP.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-D9kFrAkK.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-WlGmt2v0.native.esm.js.map +0 -1
- package/dist/updateAuthFromVerifyResponse-ZzU46s0t.esm.js.map +0 -1
package/dist/{migrateFromFireblocks-MbP1ajwI.cjs.map → migrateFromFireblocks-BcYmEZ3_.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateFromFireblocks-
|
|
1
|
+
{"version":3,"file":"migrateFromFireblocks-BcYmEZ3_.cjs","names":["BaseError","getWalletProviderFromWalletAccount","isWaasWalletProvider","NotWaasWalletAccountError","getDefaultClient","getWalletProviders","NoWalletProviderFoundError","DYNAMIC_WAAS_METADATA","isWaasWalletProvider","refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/migrateFromFireblocks/migrateFromFireblocks.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NotWaasWalletProviderErrorParams = {\n walletProviderKey: string;\n};\n\nexport class NotWaasWalletProviderError extends BaseError {\n constructor({ walletProviderKey }: NotWaasWalletProviderErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_provider_error',\n docsUrl: null,\n name: 'NotWaasWalletProviderError',\n shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`,\n });\n }\n}\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { NotWaasWalletAccountError } from '../../../errors/NotWaasWalletAccountError';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport type { WalletAccount } from '../../wallets/walletAccount';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\nimport type { WaasWalletProvider } from '../waas.types';\n\ntype GetWalletProviderFromWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getWaasWalletProviderFromWalletAccount = (\n { walletAccount }: GetWalletProviderFromWalletAccountParams,\n client: DynamicClient\n): WaasWalletProvider => {\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n if (!isWaasWalletProvider(walletProvider)) {\n throw new NotWaasWalletAccountError({\n walletAddress: walletAccount.address,\n });\n }\n\n return walletProvider;\n};\n","import type { MigrateFromFireblocksResponse } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { NotWaasWalletProviderError } from '../../../errors/NotWaasWalletProviderError';\nimport { refreshAuth } from '../../user/refreshAuth';\nimport { getWalletProviders } from '../../wallets/getWalletProviders';\nimport { DYNAMIC_WAAS_METADATA } from '../constants';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\n\ntype MigrateFromFireblocksParams = {\n /**\n * Optional SLIP-0044 coin types per chain name for BIP44 derivation off the\n * Fireblocks takeover xprv (e.g. `{ EVM: 1 }` for Sepolia).\n */\n coinTypes?: Record<string, number>;\n /**\n * The Fireblocks NCW device id whose key material is being migrated.\n */\n deviceId: string;\n /**\n * Required per-chain expected wallet address (the address Fireblocks held). Its\n * keys are the chains migration runs on, and the migration iframe verifies each\n * imported Dynamic address matches the value, so a wrong derivation fails loudly\n * instead of producing an unusable wallet.\n */\n expectedAddresses: Record<string, string>;\n /**\n * The Fireblocks-issued JWT authorizing the takeover.\n */\n jwt: string;\n /**\n * The password that encrypted the legacy Fireblocks NCW device storage.\n */\n password: string;\n /**\n * The serialized Fireblocks NCW device storage (the local key share backup).\n */\n storage: Record<string, string>;\n};\n\n/**\n * Migrates an existing Fireblocks NCW wallet into Dynamic's WaaS infrastructure.\n *\n * Migration is a single cross-chain operation: one call takes over the Fireblocks\n * key material and provisions Dynamic WaaS wallet accounts for every supported\n * chain. Because it is not per-chain, this resolves a single WaaS wallet provider\n * (any registered chain) and delegates the takeover to it.\n *\n * @param params.deviceId - The Fireblocks NCW device id being migrated.\n * @param params.jwt - The Fireblocks-issued JWT authorizing the takeover.\n * @param params.storage - The serialized Fireblocks NCW device storage.\n * @param params.password - The password that encrypted the legacy device storage.\n * @param params.expectedAddresses - Required per-chain expected address; its keys are the chains migration runs on, and each imported address is verified against it.\n * @param [params.coinTypes] - Optional SLIP-0044 coin types per chain name.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise resolving to the per-chain migration results.\n * @notInstrumented\n */\nexport const migrateFromFireblocks = async (\n {\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n }: MigrateFromFireblocksParams,\n client = getDefaultClient()\n): Promise<MigrateFromFireblocksResponse> => {\n const providers = getWalletProviders(client);\n\n if (providers.length === 0) {\n throw new NoWalletProviderFoundError({\n walletProviderKey: DYNAMIC_WAAS_METADATA.displayName,\n });\n }\n\n // Migration is cross-chain, so any registered WaaS provider can drive the\n // takeover. Resolve the first one rather than iterating per chain.\n const waasProvider = providers.find(isWaasWalletProvider);\n\n if (!waasProvider) {\n throw new NotWaasWalletProviderError({\n walletProviderKey: providers[0].key,\n });\n }\n\n const result = await waasProvider.migrateFromFireblocks({\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n });\n\n await refreshAuth(client);\n\n return result;\n};\n"],"mappings":";;;;AAMA,IAAa,6BAAb,cAAgDA,+CAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;GACpD,CAAC;;;;;;;ACFN,MAAa,0CACX,EAAE,iBACF,WACuB;CACvB,MAAM,iBAAiBC,wEACrB,EAAE,eAAe,EACjB,OACD;AAED,KAAI,CAACC,0DAAqB,eAAe,CACvC,OAAM,IAAIC,uDAA0B,EAClC,eAAe,cAAc,SAC9B,CAAC;AAGJ,QAAO;;;;;;;;;;;;;;;;;;;;;;;ACgCT,MAAa,wBAAwB,OACnC,EACE,WACA,UACA,mBACA,KACA,UACA,WAEF,SAASC,uDAAkB,KACgB;CAC3C,MAAM,YAAYC,wDAAmB,OAAO;AAE5C,KAAI,UAAU,WAAW,EACvB,OAAM,IAAIC,gEAA2B,EACnC,mBAAmBC,2DAAsB,aAC1C,CAAC;CAKJ,MAAM,eAAe,UAAU,KAAKC,0DAAqB;AAEzD,KAAI,CAAC,aACH,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,UAAU,GAAG,KACjC,CAAC;CAGJ,MAAM,SAAS,MAAM,aAAa,sBAAsB;EACtD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,OAAMC,mDAAY,OAAO;AAEzB,QAAO"}
|
package/dist/{migrateFromFireblocks-fY2IrQgU.esm.js → migrateFromFireblocks-Bm7eIfaa.esm.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as getWalletProviderFromWalletAccount, D as NoWalletProviderFoundError, _t as getDefaultClient, bt as BaseError, c as isWaasWalletProvider, d as DYNAMIC_WAAS_METADATA, f as getWalletProviders } from "./updateAuthFromVerifyResponse-
|
|
2
|
-
import {
|
|
1
|
+
import { C as getWalletProviderFromWalletAccount, D as NoWalletProviderFoundError, _t as getDefaultClient, bt as BaseError, c as isWaasWalletProvider, d as DYNAMIC_WAAS_METADATA, f as getWalletProviders } from "./updateAuthFromVerifyResponse-CfqviWkz.esm.js";
|
|
2
|
+
import { i as __refreshAuth_wrapped, r as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-CBvSRUgG.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/errors/NotWaasWalletProviderError.ts
|
|
5
5
|
var NotWaasWalletProviderError = class extends BaseError {
|
|
@@ -62,4 +62,4 @@ const migrateFromFireblocks = async ({ coinTypes, deviceId, expectedAddresses, j
|
|
|
62
62
|
|
|
63
63
|
//#endregion
|
|
64
64
|
export { getWaasWalletProviderFromWalletAccount as n, NotWaasWalletProviderError as r, migrateFromFireblocks as t };
|
|
65
|
-
//# sourceMappingURL=migrateFromFireblocks-
|
|
65
|
+
//# sourceMappingURL=migrateFromFireblocks-Bm7eIfaa.esm.js.map
|
package/dist/{migrateFromFireblocks-fY2IrQgU.esm.js.map → migrateFromFireblocks-Bm7eIfaa.esm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateFromFireblocks-
|
|
1
|
+
{"version":3,"file":"migrateFromFireblocks-Bm7eIfaa.esm.js","names":["refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/migrateFromFireblocks/migrateFromFireblocks.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NotWaasWalletProviderErrorParams = {\n walletProviderKey: string;\n};\n\nexport class NotWaasWalletProviderError extends BaseError {\n constructor({ walletProviderKey }: NotWaasWalletProviderErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_provider_error',\n docsUrl: null,\n name: 'NotWaasWalletProviderError',\n shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`,\n });\n }\n}\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { NotWaasWalletAccountError } from '../../../errors/NotWaasWalletAccountError';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport type { WalletAccount } from '../../wallets/walletAccount';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\nimport type { WaasWalletProvider } from '../waas.types';\n\ntype GetWalletProviderFromWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getWaasWalletProviderFromWalletAccount = (\n { walletAccount }: GetWalletProviderFromWalletAccountParams,\n client: DynamicClient\n): WaasWalletProvider => {\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n if (!isWaasWalletProvider(walletProvider)) {\n throw new NotWaasWalletAccountError({\n walletAddress: walletAccount.address,\n });\n }\n\n return walletProvider;\n};\n","import type { MigrateFromFireblocksResponse } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { NotWaasWalletProviderError } from '../../../errors/NotWaasWalletProviderError';\nimport { refreshAuth } from '../../user/refreshAuth';\nimport { getWalletProviders } from '../../wallets/getWalletProviders';\nimport { DYNAMIC_WAAS_METADATA } from '../constants';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\n\ntype MigrateFromFireblocksParams = {\n /**\n * Optional SLIP-0044 coin types per chain name for BIP44 derivation off the\n * Fireblocks takeover xprv (e.g. `{ EVM: 1 }` for Sepolia).\n */\n coinTypes?: Record<string, number>;\n /**\n * The Fireblocks NCW device id whose key material is being migrated.\n */\n deviceId: string;\n /**\n * Required per-chain expected wallet address (the address Fireblocks held). Its\n * keys are the chains migration runs on, and the migration iframe verifies each\n * imported Dynamic address matches the value, so a wrong derivation fails loudly\n * instead of producing an unusable wallet.\n */\n expectedAddresses: Record<string, string>;\n /**\n * The Fireblocks-issued JWT authorizing the takeover.\n */\n jwt: string;\n /**\n * The password that encrypted the legacy Fireblocks NCW device storage.\n */\n password: string;\n /**\n * The serialized Fireblocks NCW device storage (the local key share backup).\n */\n storage: Record<string, string>;\n};\n\n/**\n * Migrates an existing Fireblocks NCW wallet into Dynamic's WaaS infrastructure.\n *\n * Migration is a single cross-chain operation: one call takes over the Fireblocks\n * key material and provisions Dynamic WaaS wallet accounts for every supported\n * chain. Because it is not per-chain, this resolves a single WaaS wallet provider\n * (any registered chain) and delegates the takeover to it.\n *\n * @param params.deviceId - The Fireblocks NCW device id being migrated.\n * @param params.jwt - The Fireblocks-issued JWT authorizing the takeover.\n * @param params.storage - The serialized Fireblocks NCW device storage.\n * @param params.password - The password that encrypted the legacy device storage.\n * @param params.expectedAddresses - Required per-chain expected address; its keys are the chains migration runs on, and each imported address is verified against it.\n * @param [params.coinTypes] - Optional SLIP-0044 coin types per chain name.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise resolving to the per-chain migration results.\n * @notInstrumented\n */\nexport const migrateFromFireblocks = async (\n {\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n }: MigrateFromFireblocksParams,\n client = getDefaultClient()\n): Promise<MigrateFromFireblocksResponse> => {\n const providers = getWalletProviders(client);\n\n if (providers.length === 0) {\n throw new NoWalletProviderFoundError({\n walletProviderKey: DYNAMIC_WAAS_METADATA.displayName,\n });\n }\n\n // Migration is cross-chain, so any registered WaaS provider can drive the\n // takeover. Resolve the first one rather than iterating per chain.\n const waasProvider = providers.find(isWaasWalletProvider);\n\n if (!waasProvider) {\n throw new NotWaasWalletProviderError({\n walletProviderKey: providers[0].key,\n });\n }\n\n const result = await waasProvider.migrateFromFireblocks({\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n });\n\n await refreshAuth(client);\n\n return result;\n};\n"],"mappings":";;;;AAMA,IAAa,6BAAb,cAAgD,UAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;GACpD,CAAC;;;;;;;ACFN,MAAa,0CACX,EAAE,iBACF,WACuB;CACvB,MAAM,iBAAiB,mCACrB,EAAE,eAAe,EACjB,OACD;AAED,KAAI,CAAC,qBAAqB,eAAe,CACvC,OAAM,IAAI,0BAA0B,EAClC,eAAe,cAAc,SAC9B,CAAC;AAGJ,QAAO;;;;;;;;;;;;;;;;;;;;;;;ACgCT,MAAa,wBAAwB,OACnC,EACE,WACA,UACA,mBACA,KACA,UACA,WAEF,SAAS,kBAAkB,KACgB;CAC3C,MAAM,YAAY,mBAAmB,OAAO;AAE5C,KAAI,UAAU,WAAW,EACvB,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,sBAAsB,aAC1C,CAAC;CAKJ,MAAM,eAAe,UAAU,KAAK,qBAAqB;AAEzD,KAAI,CAAC,aACH,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,UAAU,GAAG,KACjC,CAAC;CAGJ,MAAM,SAAS,MAAM,aAAa,sBAAsB;EACtD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,OAAMA,sBAAY,OAAO;AAEzB,QAAO"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as getWalletProviderFromWalletAccount, D as NoWalletProviderFoundError, _t as getDefaultClient, bt as BaseError, c as isWaasWalletProvider, d as DYNAMIC_WAAS_METADATA, f as getWalletProviders } from "./updateAuthFromVerifyResponse-
|
|
2
|
-
import {
|
|
1
|
+
import { C as getWalletProviderFromWalletAccount, D as NoWalletProviderFoundError, _t as getDefaultClient, bt as BaseError, c as isWaasWalletProvider, d as DYNAMIC_WAAS_METADATA, f as getWalletProviders } from "./updateAuthFromVerifyResponse-CTfG6oZa.native.esm.js";
|
|
2
|
+
import { i as __refreshAuth_wrapped, r as NotWaasWalletAccountError } from "./isDynamicWaasEnabled-d82cX7j9.native.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/errors/NotWaasWalletProviderError.ts
|
|
5
5
|
var NotWaasWalletProviderError = class extends BaseError {
|
|
@@ -62,4 +62,4 @@ const migrateFromFireblocks = async ({ coinTypes, deviceId, expectedAddresses, j
|
|
|
62
62
|
|
|
63
63
|
//#endregion
|
|
64
64
|
export { getWaasWalletProviderFromWalletAccount as n, NotWaasWalletProviderError as r, migrateFromFireblocks as t };
|
|
65
|
-
//# sourceMappingURL=migrateFromFireblocks-
|
|
65
|
+
//# sourceMappingURL=migrateFromFireblocks-DVP5tGv_.native.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateFromFireblocks-
|
|
1
|
+
{"version":3,"file":"migrateFromFireblocks-DVP5tGv_.native.esm.js","names":["refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/migrateFromFireblocks/migrateFromFireblocks.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NotWaasWalletProviderErrorParams = {\n walletProviderKey: string;\n};\n\nexport class NotWaasWalletProviderError extends BaseError {\n constructor({ walletProviderKey }: NotWaasWalletProviderErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_provider_error',\n docsUrl: null,\n name: 'NotWaasWalletProviderError',\n shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`,\n });\n }\n}\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { NotWaasWalletAccountError } from '../../../errors/NotWaasWalletAccountError';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport type { WalletAccount } from '../../wallets/walletAccount';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\nimport type { WaasWalletProvider } from '../waas.types';\n\ntype GetWalletProviderFromWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getWaasWalletProviderFromWalletAccount = (\n { walletAccount }: GetWalletProviderFromWalletAccountParams,\n client: DynamicClient\n): WaasWalletProvider => {\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n if (!isWaasWalletProvider(walletProvider)) {\n throw new NotWaasWalletAccountError({\n walletAddress: walletAccount.address,\n });\n }\n\n return walletProvider;\n};\n","import type { MigrateFromFireblocksResponse } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { NotWaasWalletProviderError } from '../../../errors/NotWaasWalletProviderError';\nimport { refreshAuth } from '../../user/refreshAuth';\nimport { getWalletProviders } from '../../wallets/getWalletProviders';\nimport { DYNAMIC_WAAS_METADATA } from '../constants';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\n\ntype MigrateFromFireblocksParams = {\n /**\n * Optional SLIP-0044 coin types per chain name for BIP44 derivation off the\n * Fireblocks takeover xprv (e.g. `{ EVM: 1 }` for Sepolia).\n */\n coinTypes?: Record<string, number>;\n /**\n * The Fireblocks NCW device id whose key material is being migrated.\n */\n deviceId: string;\n /**\n * Required per-chain expected wallet address (the address Fireblocks held). Its\n * keys are the chains migration runs on, and the migration iframe verifies each\n * imported Dynamic address matches the value, so a wrong derivation fails loudly\n * instead of producing an unusable wallet.\n */\n expectedAddresses: Record<string, string>;\n /**\n * The Fireblocks-issued JWT authorizing the takeover.\n */\n jwt: string;\n /**\n * The password that encrypted the legacy Fireblocks NCW device storage.\n */\n password: string;\n /**\n * The serialized Fireblocks NCW device storage (the local key share backup).\n */\n storage: Record<string, string>;\n};\n\n/**\n * Migrates an existing Fireblocks NCW wallet into Dynamic's WaaS infrastructure.\n *\n * Migration is a single cross-chain operation: one call takes over the Fireblocks\n * key material and provisions Dynamic WaaS wallet accounts for every supported\n * chain. Because it is not per-chain, this resolves a single WaaS wallet provider\n * (any registered chain) and delegates the takeover to it.\n *\n * @param params.deviceId - The Fireblocks NCW device id being migrated.\n * @param params.jwt - The Fireblocks-issued JWT authorizing the takeover.\n * @param params.storage - The serialized Fireblocks NCW device storage.\n * @param params.password - The password that encrypted the legacy device storage.\n * @param params.expectedAddresses - Required per-chain expected address; its keys are the chains migration runs on, and each imported address is verified against it.\n * @param [params.coinTypes] - Optional SLIP-0044 coin types per chain name.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise resolving to the per-chain migration results.\n * @notInstrumented\n */\nexport const migrateFromFireblocks = async (\n {\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n }: MigrateFromFireblocksParams,\n client = getDefaultClient()\n): Promise<MigrateFromFireblocksResponse> => {\n const providers = getWalletProviders(client);\n\n if (providers.length === 0) {\n throw new NoWalletProviderFoundError({\n walletProviderKey: DYNAMIC_WAAS_METADATA.displayName,\n });\n }\n\n // Migration is cross-chain, so any registered WaaS provider can drive the\n // takeover. Resolve the first one rather than iterating per chain.\n const waasProvider = providers.find(isWaasWalletProvider);\n\n if (!waasProvider) {\n throw new NotWaasWalletProviderError({\n walletProviderKey: providers[0].key,\n });\n }\n\n const result = await waasProvider.migrateFromFireblocks({\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n });\n\n await refreshAuth(client);\n\n return result;\n};\n"],"mappings":";;;;AAMA,IAAa,6BAAb,cAAgD,UAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;GACpD,CAAC;;;;;;;ACFN,MAAa,0CACX,EAAE,iBACF,WACuB;CACvB,MAAM,iBAAiB,mCACrB,EAAE,eAAe,EACjB,OACD;AAED,KAAI,CAAC,qBAAqB,eAAe,CACvC,OAAM,IAAI,0BAA0B,EAClC,eAAe,cAAc,SAC9B,CAAC;AAGJ,QAAO;;;;;;;;;;;;;;;;;;;;;;;ACgCT,MAAa,wBAAwB,OACnC,EACE,WACA,UACA,mBACA,KACA,UACA,WAEF,SAAS,kBAAkB,KACgB;CAC3C,MAAM,YAAY,mBAAmB,OAAO;AAE5C,KAAI,UAAU,WAAW,EACvB,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,sBAAsB,aAC1C,CAAC;CAKJ,MAAM,eAAe,UAAU,KAAK,qBAAqB;AAEzD,KAAI,CAAC,aACH,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,UAAU,GAAG,KACjC,CAAC;CAGJ,MAAM,SAAS,MAAM,aAAa,sBAAsB;EACtD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,OAAMA,sBAAY,OAAO;AAEzB,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientErrorMapper.d.ts","sourceRoot":"","sources":["../../../../../src/modules/apiClient/utils/clientErrorMapper/clientErrorMapper.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"clientErrorMapper.d.ts","sourceRoot":"","sources":["../../../../../src/modules/apiClient/utils/clientErrorMapper/clientErrorMapper.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,EAAE,WA4B/B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
2
|
-
export type SocialProvider = `${Extract<ProviderEnum, ProviderEnum.Apple | ProviderEnum.Discord | ProviderEnum.Facebook | ProviderEnum.Github | ProviderEnum.Google | ProviderEnum.Kraken | ProviderEnum.Linkedin | ProviderEnum.Microsoft | ProviderEnum.Epicgames | ProviderEnum.Steam | ProviderEnum.Tiktok | ProviderEnum.Twitch | ProviderEnum.Twitter>}`;
|
|
2
|
+
export type SocialProvider = `${Extract<ProviderEnum, ProviderEnum.Apple | ProviderEnum.Discord | ProviderEnum.Facebook | ProviderEnum.Github | ProviderEnum.Google | ProviderEnum.Kraken | ProviderEnum.Linkedin | ProviderEnum.Coinbasesocial | ProviderEnum.Microsoft | ProviderEnum.Epicgames | ProviderEnum.Steam | ProviderEnum.Tiktok | ProviderEnum.Twitch | ProviderEnum.Twitter>}`;
|
|
3
3
|
export type SocialAccount = {
|
|
4
4
|
accountId?: string;
|
|
5
5
|
displayName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/social/social.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,GAAG,OAAO,CACrC,YAAY,EACV,YAAY,CAAC,KAAK,GAClB,YAAY,CAAC,OAAO,GACpB,YAAY,CAAC,QAAQ,GACrB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,QAAQ,GACrB,YAAY,CAAC,SAAS,GACtB,YAAY,CAAC,SAAS,GACtB,YAAY,CAAC,KAAK,GAClB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,OAAO,CACvB,EAAE,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC"}
|
|
1
|
+
{"version":3,"file":"social.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/social/social.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,GAAG,OAAO,CACrC,YAAY,EACV,YAAY,CAAC,KAAK,GAClB,YAAY,CAAC,OAAO,GACpB,YAAY,CAAC,QAAQ,GACrB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,QAAQ,GACrB,YAAY,CAAC,cAAc,GAC3B,YAAY,CAAC,SAAS,GACtB,YAAY,CAAC,SAAS,GACtB,YAAY,CAAC,KAAK,GAClB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,MAAM,GACnB,YAAY,CAAC,OAAO,CACvB,EAAE,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the transfer's destination wallet is self-hosted (controlled
|
|
3
|
+
* directly by its owner, with no custodial exchange in between) or held at
|
|
4
|
+
* another exchange -- required by some jurisdictions' Travel Rule rules, see
|
|
5
|
+
* {@link CoinbaseTravelRuleData}.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const walletType = CoinbaseBeneficiaryWalletType.SelfHosted;
|
|
10
|
+
* ```
|
|
11
|
+
* @see CoinbaseTravelRuleData
|
|
12
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
13
|
+
*/
|
|
14
|
+
export declare const CoinbaseBeneficiaryWalletType: {
|
|
15
|
+
readonly Exchange: "WALLET_TYPE_EXCHANGE";
|
|
16
|
+
readonly SelfHosted: "WALLET_TYPE_SELF_HOSTED";
|
|
17
|
+
};
|
|
18
|
+
export type CoinbaseBeneficiaryWalletType = (typeof CoinbaseBeneficiaryWalletType)[keyof typeof CoinbaseBeneficiaryWalletType];
|
|
19
|
+
/**
|
|
20
|
+
* Whether the transfer's destination wallet also belongs to the sender --
|
|
21
|
+
* required by some jurisdictions' Travel Rule rules, see
|
|
22
|
+
* {@link CoinbaseTravelRuleData}.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const isSelfTransfer = CoinbaseIsSelfTransfer.SelfOwned;
|
|
27
|
+
* ```
|
|
28
|
+
* @see CoinbaseTravelRuleData
|
|
29
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
30
|
+
*/
|
|
31
|
+
export declare const CoinbaseIsSelfTransfer: {
|
|
32
|
+
readonly NotSelfOwned: "IS_SELF_FALSE";
|
|
33
|
+
readonly SelfOwned: "IS_SELF_TRUE";
|
|
34
|
+
};
|
|
35
|
+
export type CoinbaseIsSelfTransfer = (typeof CoinbaseIsSelfTransfer)[keyof typeof CoinbaseIsSelfTransfer];
|
|
36
|
+
/**
|
|
37
|
+
* The individual Travel Rule fields Coinbase can require on a transfer.
|
|
38
|
+
* Which of these are actually required depends on the sender's and
|
|
39
|
+
* recipient's jurisdictions and the transfer amount -- Coinbase reports the
|
|
40
|
+
* exact list that's missing for a given transfer via
|
|
41
|
+
* {@link CoinbaseTravelRuleRequiredError.missingFields}.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const fieldName = CoinbaseTravelRuleFieldName.BeneficiaryName;
|
|
46
|
+
* ```
|
|
47
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
48
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
49
|
+
*/
|
|
50
|
+
export declare const CoinbaseTravelRuleFieldName: {
|
|
51
|
+
readonly BeneficiaryAddress: "BENEFICIARY_ADDRESS";
|
|
52
|
+
readonly BeneficiaryCountry: "BENEFICIARY_COUNTRY";
|
|
53
|
+
readonly BeneficiaryFinancialInstitution: "BENEFICIARY_FINANCIAL_INSTITUTION";
|
|
54
|
+
readonly BeneficiaryName: "BENEFICIARY_NAME";
|
|
55
|
+
readonly BeneficiaryWalletType: "BENEFICIARY_WALLET_TYPE";
|
|
56
|
+
readonly IsSelf: "IS_SELF";
|
|
57
|
+
readonly TransferPurpose: "TRANSFER_PURPOSE";
|
|
58
|
+
};
|
|
59
|
+
export type CoinbaseTravelRuleFieldName = (typeof CoinbaseTravelRuleFieldName)[keyof typeof CoinbaseTravelRuleFieldName];
|
|
60
|
+
/**
|
|
61
|
+
* Human-readable description of a {@link CoinbaseTravelRuleFieldName},
|
|
62
|
+
* written to be shown directly to an end user (for example, as helper text
|
|
63
|
+
* next to the form field that collects it).
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const description = COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS.IS_SELF;
|
|
68
|
+
* // "Whether the destination wallet also belongs to you."
|
|
69
|
+
* ```
|
|
70
|
+
* @see CoinbaseTravelRuleFieldName
|
|
71
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
72
|
+
*/
|
|
73
|
+
export declare const COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS: Record<(typeof CoinbaseTravelRuleFieldName)[keyof typeof CoinbaseTravelRuleFieldName], string>;
|
|
74
|
+
//# sourceMappingURL=coinbase.consts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coinbase.consts.d.ts","sourceRoot":"","sources":["../../../../src/modules/funding/coinbase/coinbase.consts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,6BAA6B;;;CAGhC,CAAC;AACX,MAAM,MAAM,6BAA6B,GACvC,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,OAAO,6BAA6B,CAAC,CAAC;AAErF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;;;CAGzB,CAAC;AACX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC;AAEvE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;CAQ9B,CAAC;AACX,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,CAAC;AAEjF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uCAAuC,EAAE,MAAM,CAC1D,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,EAC9E,MAAM,CAYP,CAAC"}
|
|
@@ -1,5 +1,154 @@
|
|
|
1
|
-
import type { CoinbaseOnrampFeeType as CoinbaseOnrampFeeTypeEnum, CoinbaseOnrampOrderPaymentLinkType as CoinbaseOnrampOrderPaymentLinkTypeEnum, CoinbaseOnrampOrderPaymentMethod as CoinbaseOnrampOrderPaymentMethodEnum, CoinbaseOnrampOrderStatus as CoinbaseOnrampOrderStatusEnum, UserFields } from '@dynamic-labs/sdk-api-core';
|
|
1
|
+
import type { Account, CoinbaseOnrampFeeType as CoinbaseOnrampFeeTypeEnum, CoinbaseOnrampOrderPaymentLinkType as CoinbaseOnrampOrderPaymentLinkTypeEnum, CoinbaseOnrampOrderPaymentMethod as CoinbaseOnrampOrderPaymentMethodEnum, CoinbaseOnrampOrderStatus as CoinbaseOnrampOrderStatusEnum, UserFields } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import type { CoinbaseBeneficiaryWalletType, CoinbaseIsSelfTransfer, CoinbaseTravelRuleFieldName } from './coinbase.consts';
|
|
2
3
|
export type { CoinbaseOnrampGetBuyUrlRequest, CoinbaseOnrampGetBuyUrlResponse, } from '@dynamic-labs/sdk-api-core';
|
|
4
|
+
export type { ExchangeTransferResponse } from '@dynamic-labs/sdk-api-core';
|
|
5
|
+
/**
|
|
6
|
+
* Postal address of a transfer's beneficiary (recipient), required by some
|
|
7
|
+
* jurisdictions' Travel Rule rules -- see {@link CoinbaseTravelRuleData}.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const address: CoinbaseBeneficiaryAddress = {
|
|
12
|
+
* address1: '1 Dr Carlton B Goodlett Pl',
|
|
13
|
+
* city: 'San Francisco',
|
|
14
|
+
* country: 'US',
|
|
15
|
+
* postalCode: '94102',
|
|
16
|
+
* state: 'CA',
|
|
17
|
+
* };
|
|
18
|
+
* ```
|
|
19
|
+
* @see CoinbaseTravelRuleData
|
|
20
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
21
|
+
*/
|
|
22
|
+
export type CoinbaseBeneficiaryAddress = {
|
|
23
|
+
address1?: string;
|
|
24
|
+
address2?: string;
|
|
25
|
+
address3?: string;
|
|
26
|
+
city?: string;
|
|
27
|
+
/**
|
|
28
|
+
* ISO 3166-1 alpha-2 country code (e.g. `"US"`, `"GB"`).
|
|
29
|
+
*/
|
|
30
|
+
country?: string;
|
|
31
|
+
postalCode?: string;
|
|
32
|
+
state?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Whether the transfer's destination wallet is self-hosted (controlled
|
|
36
|
+
* directly by its owner, with no custodial exchange in between) or held at
|
|
37
|
+
* another exchange -- required by some jurisdictions' Travel Rule rules, see
|
|
38
|
+
* {@link CoinbaseTravelRuleData}.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const walletType = CoinbaseBeneficiaryWalletType.SelfHosted;
|
|
43
|
+
* ```
|
|
44
|
+
* @see CoinbaseTravelRuleData
|
|
45
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
46
|
+
*/
|
|
47
|
+
export type { CoinbaseBeneficiaryWalletType };
|
|
48
|
+
/**
|
|
49
|
+
* Whether the transfer's destination wallet also belongs to the sender --
|
|
50
|
+
* required by some jurisdictions' Travel Rule rules, see
|
|
51
|
+
* {@link CoinbaseTravelRuleData}.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const isSelfTransfer = CoinbaseIsSelfTransfer.SelfOwned;
|
|
56
|
+
* ```
|
|
57
|
+
* @see CoinbaseTravelRuleData
|
|
58
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
59
|
+
*/
|
|
60
|
+
export type { CoinbaseIsSelfTransfer };
|
|
61
|
+
/**
|
|
62
|
+
* The individual Travel Rule fields Coinbase can require on a transfer.
|
|
63
|
+
* Which of these are actually required depends on the sender's and
|
|
64
|
+
* recipient's jurisdictions and the transfer amount -- Coinbase reports the
|
|
65
|
+
* exact list that's missing for a given transfer via
|
|
66
|
+
* {@link CoinbaseTravelRuleRequiredError.missingFields}.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const fieldName = CoinbaseTravelRuleFieldName.BeneficiaryName;
|
|
71
|
+
* ```
|
|
72
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
73
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
74
|
+
*/
|
|
75
|
+
export type { CoinbaseTravelRuleFieldName };
|
|
76
|
+
/**
|
|
77
|
+
* One Travel Rule field Coinbase is missing for a transfer, paired with a
|
|
78
|
+
* user-facing description of what it is.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const missingField: CoinbaseTravelRuleMissingField = {
|
|
83
|
+
* description: "The recipient's full legal name.",
|
|
84
|
+
* name: CoinbaseTravelRuleFieldName.BeneficiaryName,
|
|
85
|
+
* };
|
|
86
|
+
* ```
|
|
87
|
+
* @see CoinbaseTravelRuleFieldName
|
|
88
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
89
|
+
*/
|
|
90
|
+
export type CoinbaseTravelRuleMissingField = {
|
|
91
|
+
description: string;
|
|
92
|
+
name: CoinbaseTravelRuleFieldName;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Beneficiary (recipient) information some jurisdictions require Coinbase to
|
|
96
|
+
* collect before completing a transfer -- the "Travel Rule", a regulatory
|
|
97
|
+
* requirement on custodial exchanges to share basic counterparty information
|
|
98
|
+
* above certain transfer thresholds. Which fields are actually required
|
|
99
|
+
* depends on the sender's and recipient's jurisdictions and the transfer
|
|
100
|
+
* amount; omitting a required field throws
|
|
101
|
+
* {@link CoinbaseTravelRuleRequiredError} listing exactly which ones.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const travelRuleData: CoinbaseTravelRuleData = {
|
|
106
|
+
* beneficiaryCountry: 'US',
|
|
107
|
+
* beneficiaryName: 'Jane Doe',
|
|
108
|
+
* beneficiaryWalletType: 'WALLET_TYPE_SELF_HOSTED',
|
|
109
|
+
* isSelfTransfer: 'IS_SELF_FALSE',
|
|
110
|
+
* };
|
|
111
|
+
* ```
|
|
112
|
+
* @see createCoinbaseExchangeTransfer
|
|
113
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
114
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
115
|
+
*/
|
|
116
|
+
export type CoinbaseTravelRuleData = {
|
|
117
|
+
beneficiaryAddress?: CoinbaseBeneficiaryAddress;
|
|
118
|
+
beneficiaryCountry?: string;
|
|
119
|
+
/**
|
|
120
|
+
* The VASP identifier of the recipient exchange. Only required when
|
|
121
|
+
* `beneficiaryWalletType` is `'WALLET_TYPE_EXCHANGE'`.
|
|
122
|
+
*
|
|
123
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
124
|
+
*/
|
|
125
|
+
beneficiaryFinancialInstitution?: string;
|
|
126
|
+
beneficiaryName?: string;
|
|
127
|
+
beneficiaryWalletType?: CoinbaseBeneficiaryWalletType;
|
|
128
|
+
isSelfTransfer?: CoinbaseIsSelfTransfer;
|
|
129
|
+
/**
|
|
130
|
+
* Free-text reason for the transfer (e.g. `"Rent"`). Like the other
|
|
131
|
+
* fields, some jurisdictions/amounts require this -- Coinbase reports it
|
|
132
|
+
* missing the same way, via `Param: [TRANSFER_PURPOSE]`.
|
|
133
|
+
*/
|
|
134
|
+
transferPurpose?: string;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* A Coinbase exchange account with per-currency balances.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const account: CoinbaseAccount = {
|
|
142
|
+
* balances: [{ currency: 'USDC', balance: 1000.0 }],
|
|
143
|
+
* exchange: 'coinbase',
|
|
144
|
+
* id: 'coinbase-account-123',
|
|
145
|
+
* type: 'wallet',
|
|
146
|
+
* };
|
|
147
|
+
* ```
|
|
148
|
+
* @see getCoinbaseAccounts
|
|
149
|
+
* @see createCoinbaseExchangeTransfer
|
|
150
|
+
*/
|
|
151
|
+
export type CoinbaseAccount = Account;
|
|
3
152
|
export type CoinbaseOnrampFeeType = `${CoinbaseOnrampFeeTypeEnum}`;
|
|
4
153
|
export type CoinbaseOnrampOrderPaymentLinkType = `${CoinbaseOnrampOrderPaymentLinkTypeEnum}`;
|
|
5
154
|
export type CoinbaseOnrampOrderPaymentMethod = `${CoinbaseOnrampOrderPaymentMethodEnum}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coinbase.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/funding/coinbase/coinbase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,IAAI,yBAAyB,EAClD,kCAAkC,IAAI,sCAAsC,EAC5E,gCAAgC,IAAI,oCAAoC,EACxE,yBAAyB,IAAI,6BAA6B,EAC1D,UAAU,EACX,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"coinbase.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/funding/coinbase/coinbase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,qBAAqB,IAAI,yBAAyB,EAClD,kCAAkC,IAAI,sCAAsC,EAC5E,gCAAgC,IAAI,oCAAoC,EACxE,yBAAyB,IAAI,6BAA6B,EAC1D,UAAU,EACX,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EACV,6BAA6B,EAC7B,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AAGpC,YAAY,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAW3E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,YAAY,EAAE,6BAA6B,EAAE,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAEvC;;;;;;;;;;;;;GAaG;AACH,YAAY,EAAE,2BAA2B,EAAE,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,2BAA2B,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,6BAA6B,CAAC;IACtD,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC;AAEtC,MAAM,MAAM,qBAAqB,GAAG,GAAG,yBAAyB,EAAE,CAAC;AAEnE,MAAM,MAAM,kCAAkC,GAC5C,GAAG,sCAAsC,EAAE,CAAC;AAE9C,MAAM,MAAM,gCAAgC,GAC1C,GAAG,oCAAoC,EAAE,CAAC;AAE5C,MAAM,MAAM,yBAAyB,GAAG,GAAG,6BAA6B,EAAE,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,EAAE,qBAAqB,CAAC;CAC7B,CAAC;AAGF,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,EAAE;QACL;;;;WAIG;QACH,SAAS,EAAE,IAAI,CAAC;QAChB;;;;WAIG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAC3B;;;;WAIG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAC3B;;;;WAIG;QACH,YAAY,EAAE,MAAM,CAAC;QACrB;;;;;;;;;;;;;;;;WAgBG;QACH,IAAI,EAAE,iBAAiB,EAAE,CAAC;QAC1B;;;;WAIG;QACH,OAAO,EAAE,MAAM,CAAC;QAChB;;;;WAIG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB;;;;WAIG;QACH,eAAe,EAAE,MAAM,CAAC;QACxB;;;;WAIG;QACH,aAAa,EAAE,gCAAgC,CAAC;QAChD;;;;WAIG;QACH,eAAe,EAAE,MAAM,CAAC;QACxB;;;;WAIG;QACH,YAAY,EAAE,MAAM,CAAC;QACrB;;;;WAIG;QACH,cAAc,EAAE,MAAM,CAAC;QACvB;;;;WAIG;QACH,gBAAgB,EAAE,MAAM,CAAC;QACzB;;;;WAIG;QACH,MAAM,EAAE,yBAAyB,CAAC;QAClC;;;;WAIG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;;;WAIG;QACH,SAAS,EAAE,IAAI,CAAC;KACjB,CAAC;IACF,WAAW,CAAC,EAAE;QACZ;;;;WAIG;QACH,eAAe,EAAE,kCAAkC,CAAC;QACpD;;;;;;WAMG;QACH,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC;AAGF,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;;;;;OAMG;IACH,mBAAmB,EAAE,IAAI,CAAC;IAC1B;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;;OAMG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,aAAa,EAAE,gCAAgC,CAAC;IAChD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,0CAA0C,GAClD,qBAAqB,GACrB,sBAAsB,GACtB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,yCAAyC,GAAG;IACtD,KAAK,EAAE,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC;CAC3D,GAAG,CACA;IACE,SAAS,EAAE,qBAAqB,CAAC;CAClC,GACD;IACE;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAChB,0CAA0C,EAC1C,qBAAqB,CACtB,CAAC;CACH,CACJ,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { CreateExchangeTransferRequest } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import type { CoinbaseTravelRuleData, ExchangeTransferResponse } from '../coinbase.types';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for {@link createCoinbaseExchangeTransfer}, extending the core exchange transfer
|
|
5
|
+
* request with the Coinbase `accountId` to debit.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const request: CoinbaseTransferRequest = {
|
|
10
|
+
* accountId: 'coinbase-account-123',
|
|
11
|
+
* amount: 0.5,
|
|
12
|
+
* currency: 'USDC',
|
|
13
|
+
* to: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
|
|
14
|
+
* };
|
|
15
|
+
* ```
|
|
16
|
+
* @see createCoinbaseExchangeTransfer
|
|
17
|
+
* @see getCoinbaseAccounts
|
|
18
|
+
*/
|
|
19
|
+
export type CoinbaseTransferRequest = CreateExchangeTransferRequest & {
|
|
20
|
+
/**
|
|
21
|
+
* The Coinbase account ID to transfer from (get from getCoinbaseAccounts)
|
|
22
|
+
* @instrumented
|
|
23
|
+
*/
|
|
24
|
+
accountId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Recipient information required by some jurisdictions' "Travel Rule"
|
|
27
|
+
* regulations. Optional, but send it whenever you already have it (e.g. a
|
|
28
|
+
* saved recipient) rather than waiting for {@link CoinbaseTravelRuleRequiredError} --
|
|
29
|
+
* MFA is checked before Travel Rule, so a transfer needing both makes you
|
|
30
|
+
* re-enter a fresh MFA code if this arrives on a retry instead of the
|
|
31
|
+
* first attempt. Which fields are required can't be predicted up front;
|
|
32
|
+
* if unset and needed, the call throws {@link CoinbaseTravelRuleRequiredError}
|
|
33
|
+
* listing exactly which ones, to retry with.
|
|
34
|
+
*
|
|
35
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
36
|
+
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
37
|
+
*/
|
|
38
|
+
travelRuleData?: CoinbaseTravelRuleData;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Creates a Coinbase exchange transfer to send crypto from a Coinbase account to an external address.
|
|
42
|
+
*
|
|
43
|
+
* Coinbase may reject the transfer for reasons that require a second attempt
|
|
44
|
+
* rather than a hard failure:
|
|
45
|
+
* - {@link CoinbaseTransferMfaRequiredError} / {@link CoinbaseTransferMfaFailedError} --
|
|
46
|
+
* Coinbase's own two-step verification on the sending account.
|
|
47
|
+
* - {@link CoinbaseTravelRuleRequiredError} -- missing recipient information
|
|
48
|
+
* required by regulation for this transfer's jurisdictions/amount.
|
|
49
|
+
*
|
|
50
|
+
* @param transferParams - The parameters for the transfer including accountId.
|
|
51
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
52
|
+
* @returns A promise resolving to the created exchange transfer.
|
|
53
|
+
* @throws {CoinbaseTransferMfaRequiredError} When the API requires MFA for the transfer.
|
|
54
|
+
* @throws {CoinbaseTransferMfaFailedError} When the provided MFA code is rejected.
|
|
55
|
+
* @throws {CoinbaseTravelRuleRequiredError} When Coinbase requires additional recipient information for the transfer.
|
|
56
|
+
* @throws {APIError} For any other API error returned by the exchange transfer request.
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* // Include any known recipient info upfront -- see travelRuleData below for why.
|
|
60
|
+
* const transferParams = {
|
|
61
|
+
* accountId: accounts[0].id,
|
|
62
|
+
* amount: 0.5,
|
|
63
|
+
* currency: 'USDC',
|
|
64
|
+
* to: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
|
|
65
|
+
* travelRuleData: { beneficiaryName: 'Jane Doe', beneficiaryCountry: 'US' },
|
|
66
|
+
* };
|
|
67
|
+
*
|
|
68
|
+
* try {
|
|
69
|
+
* const transfer = await createCoinbaseExchangeTransfer(transferParams);
|
|
70
|
+
* } catch (error) {
|
|
71
|
+
* if (error instanceof CoinbaseTravelRuleRequiredError) {
|
|
72
|
+
* const travelRuleData = await promptUserForTravelRuleFields(error.missingFields);
|
|
73
|
+
* await createCoinbaseExchangeTransfer({ ...transferParams, travelRuleData });
|
|
74
|
+
* }
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
* @see getCoinbaseAccounts
|
|
78
|
+
* @see CoinbaseTransferMfaRequiredError
|
|
79
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
80
|
+
* @notInstrumented
|
|
81
|
+
*/
|
|
82
|
+
export declare const createCoinbaseExchangeTransfer: (transferParams: CoinbaseTransferRequest, client?: import("../../../../exports").DynamicClient) => Promise<ExchangeTransferResponse>;
|
|
83
|
+
//# sourceMappingURL=createCoinbaseExchangeTransfer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCoinbaseExchangeTransfer.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/coinbase/createCoinbaseExchangeTransfer/createCoinbaseExchangeTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAUhF,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAG3B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,uBAAuB,GAAG,6BAA6B,GAAG;IACpE;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,8BAA8B,mBACzB,uBAAuB,2DAEtC,OAAO,CAAC,wBAAwB,CAyClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/coinbase/createCoinbaseExchangeTransfer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Chain } from '../../../chain';
|
|
2
|
+
import type { CoinbaseAccount } from '../coinbase.types';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for {@link getCoinbaseAccounts}: optional filters for the Coinbase accounts returned.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const params: GetCoinbaseAccountsParams = { chainName: 'EVM', networkId: 1 };
|
|
9
|
+
* ```
|
|
10
|
+
* @see getCoinbaseAccounts
|
|
11
|
+
* @see CoinbaseAccount
|
|
12
|
+
*/
|
|
13
|
+
export type GetCoinbaseAccountsParams = {
|
|
14
|
+
/**
|
|
15
|
+
* Optional chain filter
|
|
16
|
+
* @notInstrumented
|
|
17
|
+
*/
|
|
18
|
+
chainName?: Chain;
|
|
19
|
+
/**
|
|
20
|
+
* Optional network ID filter
|
|
21
|
+
*/
|
|
22
|
+
networkId?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Gets the Coinbase accounts (balances) for the authenticated user.
|
|
26
|
+
*
|
|
27
|
+
* @param [params] GetCoinbaseAccountsParams - Optional filters for the accounts.
|
|
28
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
29
|
+
* @returns A promise resolving to an array of Coinbase accounts with balances.
|
|
30
|
+
* @throws {InvalidParamError} When chainName is not a valid ChainEnum value or networkId is a non-integer or negative number.
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const accounts = await getCoinbaseAccounts({ chainName: 'EVM' });
|
|
34
|
+
* console.log(accounts[0].balances);
|
|
35
|
+
* ```
|
|
36
|
+
* @see createCoinbaseExchangeTransfer
|
|
37
|
+
* @see GetCoinbaseAccountsParams
|
|
38
|
+
* @notInstrumented
|
|
39
|
+
*/
|
|
40
|
+
export declare const getCoinbaseAccounts: (params?: GetCoinbaseAccountsParams, client?: import("../../../../exports").DynamicClient) => Promise<CoinbaseAccount[]>;
|
|
41
|
+
//# sourceMappingURL=getCoinbaseAccounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCoinbaseAccounts.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/coinbase/getCoinbaseAccounts/getCoinbaseAccounts.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,YACrB,yBAAyB,2DAEjC,OAAO,CAAC,eAAe,EAAE,CAyB3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/funding/coinbase/getCoinbaseAccounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/modules/funding/coinbase/utils/parseCoinbaseTravelRuleMissingFields/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/funding/coinbase/utils/parseCoinbaseTravelRuleMissingFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CoinbaseTravelRuleMissingField } from '../../coinbase.types';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts the list of missing Travel Rule fields from a Coinbase
|
|
4
|
+
* `unknown_transfer_error` message, pairing each field with its user-facing
|
|
5
|
+
* description. Returns an empty array if the message doesn't contain a
|
|
6
|
+
* recognizable Travel Rule field list (i.e. this isn't a Travel Rule error).
|
|
7
|
+
*
|
|
8
|
+
* @param params.message - The raw `error` string from Coinbase's response body.
|
|
9
|
+
* @returns The missing fields, or an empty array if none were found.
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const missingFields = parseCoinbaseTravelRuleMissingFields({
|
|
13
|
+
* message: 'Incomplete travel rules information provided. Param: [BENEFICIARY_NAME, IS_SELF]',
|
|
14
|
+
* });
|
|
15
|
+
* // [
|
|
16
|
+
* // { name: 'BENEFICIARY_NAME', description: "The recipient's full legal name." },
|
|
17
|
+
* // { name: 'IS_SELF', description: 'Whether the destination wallet also belongs to you.' },
|
|
18
|
+
* // ]
|
|
19
|
+
* ```
|
|
20
|
+
* @see CoinbaseTravelRuleRequiredError
|
|
21
|
+
* @notInstrumented
|
|
22
|
+
*/
|
|
23
|
+
export declare const parseCoinbaseTravelRuleMissingFields: ({ message, }: {
|
|
24
|
+
message: string;
|
|
25
|
+
}) => CoinbaseTravelRuleMissingField[];
|
|
26
|
+
//# sourceMappingURL=parseCoinbaseTravelRuleMissingFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseCoinbaseTravelRuleMissingFields.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/funding/coinbase/utils/parseCoinbaseTravelRuleMissingFields/parseCoinbaseTravelRuleMissingFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,8BAA8B,EAC/B,MAAM,sBAAsB,CAAC;AAc9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oCAAoC,iBAE9C;IACD,OAAO,EAAE,MAAM,CAAC;CACjB,KAAG,8BAA8B,EAejC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../client/types/DynamicClient';
|
|
2
|
+
import type { WalletAccount } from '../../wallets/walletAccount';
|
|
3
|
+
import type { WaasTransactionBroadcastEncoding, WaasTransactionBroadcastResult } from '../waas.types';
|
|
4
|
+
type BroadcastWaasTransactionParams = {
|
|
5
|
+
encoding: WaasTransactionBroadcastEncoding;
|
|
6
|
+
networkId: string;
|
|
7
|
+
signedTransaction: string;
|
|
8
|
+
skipPreflight?: boolean;
|
|
9
|
+
walletAccount: WalletAccount;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Broadcasts an already-signed v3 WaaS transaction through the Dynamic API.
|
|
13
|
+
*
|
|
14
|
+
* @notInstrumented
|
|
15
|
+
*/
|
|
16
|
+
export declare const broadcastWaasTransaction: ({ encoding, networkId, signedTransaction, skipPreflight, walletAccount, }: BroadcastWaasTransactionParams, client: DynamicClient) => Promise<WaasTransactionBroadcastResult>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=broadcastWaasTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadcastWaasTransaction.d.ts","sourceRoot":"","sources":["../../../../src/modules/waas/broadcastWaasTransaction/broadcastWaasTransaction.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,KAAK,EACV,gCAAgC,EAChC,8BAA8B,EAC/B,MAAM,eAAe,CAAC;AAEvB,KAAK,8BAA8B,GAAG;IACpC,QAAQ,EAAE,gCAAgC,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,8EAOhC,8BAA8B,UACzB,aAAa,KACpB,OAAO,CAAC,8BAA8B,CA8CxC,CAAC"}
|