@dynamic-labs-sdk/client 1.33.0 → 1.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{apiClient-4r7VAsLC.native.esm.js → apiClient-B0eCQXEJ.native.esm.js} +3 -3
- package/dist/{apiClient-4r7VAsLC.native.esm.js.map → apiClient-B0eCQXEJ.native.esm.js.map} +1 -1
- package/dist/core.cjs +24 -5
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +9 -8
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +9 -8
- package/dist/core.native.esm.js.map +1 -1
- package/dist/exports/core.d.ts +8 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-D9oRzWA6.esm.js → getNetworkProviderFromNetworkId-CgxCy8qP.esm.js} +9 -8
- package/dist/getNetworkProviderFromNetworkId-CgxCy8qP.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-DOrcvuFv.cjs → getNetworkProviderFromNetworkId-DaxDzIv4.cjs} +9 -2
- package/dist/getNetworkProviderFromNetworkId-DaxDzIv4.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-BV229QF3.native.esm.js → getNetworkProviderFromNetworkId-OXG2gPby.native.esm.js} +10 -9
- package/dist/getNetworkProviderFromNetworkId-OXG2gPby.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-Cd8CCp5d.native.esm.js → getSignedSessionId-B2s2UuwJ.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-Cd8CCp5d.native.esm.js.map → getSignedSessionId-B2s2UuwJ.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DA-MMsJm.esm.js → getSignedSessionId-DdMeCIV-.esm.js} +3 -3
- package/dist/{getSignedSessionId-DA-MMsJm.esm.js.map → getSignedSessionId-DdMeCIV-.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-4qHh_BOh.cjs → getSignedSessionId-KiBgLtda.cjs} +3 -3
- package/dist/{getSignedSessionId-4qHh_BOh.cjs.map → getSignedSessionId-KiBgLtda.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Fr3bEKeU.esm.js → getVerifiedCredentialForWalletAccount-DzZ-0SaQ.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-Fr3bEKeU.esm.js.map → getVerifiedCredentialForWalletAccount-DzZ-0SaQ.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Bw5q7QZn.cjs → getVerifiedCredentialForWalletAccount-y2drOcyb.cjs} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-Bw5q7QZn.cjs.map → getVerifiedCredentialForWalletAccount-y2drOcyb.cjs.map} +1 -1
- package/dist/index.cjs +56 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +50 -63
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +50 -63
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-BdU62usM.esm.js → isMfaRequiredForAction-BLegdReE.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-BdU62usM.esm.js.map → isMfaRequiredForAction-BLegdReE.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-Djd-jkSl.cjs → isMfaRequiredForAction-By7uHgpn.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-Djd-jkSl.cjs.map → isMfaRequiredForAction-By7uHgpn.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-DZfEkyIU.native.esm.js → isMfaRequiredForAction-CXuuO-wy.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-DZfEkyIU.native.esm.js.map → isMfaRequiredForAction-CXuuO-wy.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-BEZOYohA.esm.js → isUserOnboardingComplete-Bvh4NLBz.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-BEZOYohA.esm.js.map → isUserOnboardingComplete-Bvh4NLBz.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-Bwvv6Urs.cjs → isUserOnboardingComplete-DMefkHRY.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-Bwvv6Urs.cjs.map → isUserOnboardingComplete-DMefkHRY.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-CEUkAzCi.native.esm.js → isUserOnboardingComplete-hn1rWlA-.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-CEUkAzCi.native.esm.js.map → isUserOnboardingComplete-hn1rWlA-.native.esm.js.map} +1 -1
- package/dist/{logoutWithReason-I6vShLpA.esm.js → logoutWithReason-B-cf-dUs.esm.js} +62 -50
- package/dist/logoutWithReason-B-cf-dUs.esm.js.map +1 -0
- package/dist/{logoutWithReason-DvnEa2Uv.native.esm.js → logoutWithReason-C4AgSbjv.native.esm.js} +61 -49
- package/dist/logoutWithReason-C4AgSbjv.native.esm.js.map +1 -0
- package/dist/{logoutWithReason-B-ZF0VmN.cjs → logoutWithReason-c1DmyRBx.cjs} +73 -55
- package/dist/logoutWithReason-c1DmyRBx.cjs.map +1 -0
- package/dist/{migrateFromFireblocks-6I7lkraQ.native.esm.js → migrateFromFireblocks-B0pkwAaK.native.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-6I7lkraQ.native.esm.js.map → migrateFromFireblocks-B0pkwAaK.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-Dtk6t8hN.esm.js → migrateFromFireblocks-B76sFd7a.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-Dtk6t8hN.esm.js.map → migrateFromFireblocks-B76sFd7a.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-C23-24bK.cjs → migrateFromFireblocks-RCqy2qOG.cjs} +2 -2
- package/dist/{migrateFromFireblocks-C23-24bK.cjs.map → migrateFromFireblocks-RCqy2qOG.cjs.map} +1 -1
- package/dist/modules/initializeClient/consts.d.ts +1 -0
- package/dist/modules/initializeClient/consts.d.ts.map +1 -1
- package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +4 -5
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +8 -3
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/parseGovernedResponse.d.ts +34 -0
- package/dist/modules/waas/businessAccounts/parseGovernedResponse.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{waas-C0IDCf3u.cjs → waas-7vSYuH3H.cjs} +104 -30
- package/dist/waas-7vSYuH3H.cjs.map +1 -0
- package/dist/{waas-DJeW02-Y.native.esm.js → waas-DIlnOHm6.native.esm.js} +104 -30
- package/dist/waas-DIlnOHm6.native.esm.js.map +1 -0
- package/dist/{waas-D_alZrtb.esm.js → waas-H5xyBfTI.esm.js} +104 -30
- package/dist/waas-H5xyBfTI.esm.js.map +1 -0
- package/dist/waas.cjs +4 -4
- package/dist/waas.esm.js +4 -4
- package/dist/waas.native.esm.js +4 -4
- package/dist/waasCore.cjs +5 -5
- package/dist/waasCore.esm.js +5 -5
- package/dist/waasCore.native.esm.js +5 -5
- package/package.json +3 -3
- package/dist/getNetworkProviderFromNetworkId-BV229QF3.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-D9oRzWA6.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DOrcvuFv.cjs.map +0 -1
- package/dist/logoutWithReason-B-ZF0VmN.cjs.map +0 -1
- package/dist/logoutWithReason-DvnEa2Uv.native.esm.js.map +0 -1
- package/dist/logoutWithReason-I6vShLpA.esm.js.map +0 -1
- package/dist/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.d.ts +0 -5
- package/dist/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.d.ts.map +0 -1
- package/dist/waas-C0IDCf3u.cjs.map +0 -1
- package/dist/waas-DJeW02-Y.native.esm.js.map +0 -1
- package/dist/waas-D_alZrtb.esm.js.map +0 -1
package/dist/{migrateFromFireblocks-C23-24bK.cjs.map → migrateFromFireblocks-RCqy2qOG.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateFromFireblocks-C23-24bK.cjs","names":["BaseError","BaseError","BaseError","getWalletProviderFromWalletAccount","isWaasWalletProvider","getDefaultClient","EmbeddedWalletVersionEnum","getDefaultClient","getWalletProviders","NoWalletProviderFoundError","DYNAMIC_WAAS_METADATA","isWaasWalletProvider","refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/errors/TransactionBroadcastError.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.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 { BaseError } from './base';\n\n/**\n * Error codes that identify why a v3 WaaS transaction broadcast was rejected.\n *\n * @example 'BROADCAST_REJECTED'\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastErrorCode =\n | 'BROADCAST_IDEMPOTENCY_CONFLICT'\n | 'BROADCAST_OUTCOME_UNKNOWN'\n | 'BROADCAST_RATE_LIMITED'\n | 'BROADCAST_REJECTED'\n | 'BROADCAST_REQUIRES_RESIGN'\n | 'BROADCAST_WALLET_INELIGIBLE'\n | 'INVALID_SIGNED_TRANSACTION'\n | 'NETWORK_NOT_ENABLED'\n | 'SIGNED_TRANSACTION_WALLET_MISMATCH'\n | 'UNSUPPORTED_WAAS_CHAIN';\n\n/**\n * States describing whether the signed transaction reached the chain.\n *\n * @example 'not_submitted'\n * @see TransactionBroadcastError\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastSubmissionState =\n | 'not_submitted'\n | 'requires_resign'\n | 'unknown';\n\ntype TransactionBroadcastErrorParams = {\n attempts: number;\n broadcastId: string;\n cause: Error;\n code: TransactionBroadcastErrorCode;\n message: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId?: string;\n};\n\n/**\n * Error raised when Redcoast fails to submit a v3 WaaS transaction after the SDK signed it.\n *\n * @example new TransactionBroadcastError({ attempts: 1, broadcastId: 'broadcast-id', cause, code: 'BROADCAST_REJECTED', message: 'rejected', retryable: false, submissionState: 'not_submitted', transactionId: undefined })\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport class TransactionBroadcastError extends BaseError {\n attempts: number;\n broadcastId: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId: string | undefined;\n\n constructor({\n attempts,\n broadcastId,\n cause,\n code,\n message,\n retryable,\n submissionState,\n transactionId,\n }: TransactionBroadcastErrorParams) {\n super({\n cause,\n code,\n docsUrl: null,\n name: 'TransactionBroadcastError',\n shortMessage: message,\n });\n\n this.attempts = attempts;\n this.broadcastId = broadcastId;\n this.retryable = retryable;\n this.submissionState = submissionState;\n this.transactionId = transactionId;\n }\n}\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\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 { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()): boolean => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\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,mCAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;GACpD,CAAC;;;;;;;;;;;;;ACqCN,IAAa,4BAAb,cAA+CC,mCAAU;CACvD;CACA;CACA;CACA;CACA;CAEA,YAAY,EACV,UACA,aACA,OACA,MACA,SACA,WACA,iBACA,iBACkC;AAClC,QAAM;GACJ;GACA;GACA,SAAS;GACT,MAAM;GACN,cAAc;GACf,CAAC;AAEF,OAAK,WAAW;AAChB,OAAK,cAAc;AACnB,OAAK,YAAY;AACjB,OAAK,kBAAkB;AACvB,OAAK,gBAAgB;;;;;;AC1EzB,IAAa,4BAAb,cAA+CC,mCAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;ACFN,MAAa,0CACX,EAAE,iBACF,WACuB;CACvB,MAAM,iBAAiBC,4DACrB,EAAE,eAAe,EACjB,OACD;AAED,KAAI,CAACC,8CAAqB,eAAe,CACvC,OAAM,IAAI,0BAA0B,EAClC,eAAe,cAAc,SAC9B,CAAC;AAGJ,QAAO;;;;;;;;;;;;;;;ACZT,MAAa,wBAAwB,SAASC,2CAAkB,KAAc;CAC5E,MAAM,kBAAkB,OAAO;AAE/B,wCAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxBC,qDAA0B;;;;;;;;;;;;;;;;;;;;;;;ACmC9B,MAAa,wBAAwB,OACnC,EACE,WACA,UACA,mBACA,KACA,UACA,WAEF,SAASC,2CAAkB,KACgB;CAC3C,MAAM,YAAYC,4CAAmB,OAAO;AAE5C,KAAI,UAAU,WAAW,EACvB,OAAM,IAAIC,oDAA2B,EACnC,mBAAmBC,+CAAsB,aAC1C,CAAC;CAKJ,MAAM,eAAe,UAAU,KAAKC,8CAAqB;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,+CAAY,OAAO;AAEzB,QAAO"}
|
|
1
|
+
{"version":3,"file":"migrateFromFireblocks-RCqy2qOG.cjs","names":["BaseError","BaseError","BaseError","getWalletProviderFromWalletAccount","isWaasWalletProvider","getDefaultClient","EmbeddedWalletVersionEnum","getDefaultClient","getWalletProviders","NoWalletProviderFoundError","DYNAMIC_WAAS_METADATA","isWaasWalletProvider","refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/errors/TransactionBroadcastError.ts","../src/errors/NotWaasWalletAccountError.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.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 { BaseError } from './base';\n\n/**\n * Error codes that identify why a v3 WaaS transaction broadcast was rejected.\n *\n * @example 'BROADCAST_REJECTED'\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastErrorCode =\n | 'BROADCAST_IDEMPOTENCY_CONFLICT'\n | 'BROADCAST_OUTCOME_UNKNOWN'\n | 'BROADCAST_RATE_LIMITED'\n | 'BROADCAST_REJECTED'\n | 'BROADCAST_REQUIRES_RESIGN'\n | 'BROADCAST_WALLET_INELIGIBLE'\n | 'INVALID_SIGNED_TRANSACTION'\n | 'NETWORK_NOT_ENABLED'\n | 'SIGNED_TRANSACTION_WALLET_MISMATCH'\n | 'UNSUPPORTED_WAAS_CHAIN';\n\n/**\n * States describing whether the signed transaction reached the chain.\n *\n * @example 'not_submitted'\n * @see TransactionBroadcastError\n * @see broadcastWaasTransaction\n */\nexport type TransactionBroadcastSubmissionState =\n | 'not_submitted'\n | 'requires_resign'\n | 'unknown';\n\ntype TransactionBroadcastErrorParams = {\n attempts: number;\n broadcastId: string;\n cause: Error;\n code: TransactionBroadcastErrorCode;\n message: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId?: string;\n};\n\n/**\n * Error raised when Redcoast fails to submit a v3 WaaS transaction after the SDK signed it.\n *\n * @example new TransactionBroadcastError({ attempts: 1, broadcastId: 'broadcast-id', cause, code: 'BROADCAST_REJECTED', message: 'rejected', retryable: false, submissionState: 'not_submitted', transactionId: undefined })\n * @see transactionBroadcastErrorMapper\n * @see broadcastWaasTransaction\n */\nexport class TransactionBroadcastError extends BaseError {\n attempts: number;\n broadcastId: string;\n retryable: boolean;\n submissionState: TransactionBroadcastSubmissionState;\n transactionId: string | undefined;\n\n constructor({\n attempts,\n broadcastId,\n cause,\n code,\n message,\n retryable,\n submissionState,\n transactionId,\n }: TransactionBroadcastErrorParams) {\n super({\n cause,\n code,\n docsUrl: null,\n name: 'TransactionBroadcastError',\n shortMessage: message,\n });\n\n this.attempts = attempts;\n this.broadcastId = broadcastId;\n this.retryable = retryable;\n this.submissionState = submissionState;\n this.transactionId = transactionId;\n }\n}\n","import { BaseError } from './base';\n\ntype NotWaasWalletAccountErrorParams = {\n walletAddress: string;\n};\n\nexport class NotWaasWalletAccountError extends BaseError {\n constructor({ walletAddress }: NotWaasWalletAccountErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_account_error',\n docsUrl: null,\n name: 'NotWaasWalletAccountError',\n shortMessage: `Wallet account ${walletAddress} is not a Dynamic WaaS wallet account`,\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 { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.\n *\n * This function examines the project settings to determine if Dynamic WaaS is\n * enabled in the Dynamic Dashboard or not.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if Dynamic WaaS is enabled, false otherwise.\n * @notInstrumented\n */\nexport const isDynamicWaasEnabled = (client = getDefaultClient()): boolean => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;\n\n const dynamicWaasIsEnabled =\n embeddedWalletSettings?.defaultWalletVersion ===\n EmbeddedWalletVersionEnum.V3;\n\n return dynamicWaasIsEnabled;\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,mCAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;GACpD,CAAC;;;;;;;;;;;;;ACqCN,IAAa,4BAAb,cAA+CC,mCAAU;CACvD;CACA;CACA;CACA;CACA;CAEA,YAAY,EACV,UACA,aACA,OACA,MACA,SACA,WACA,iBACA,iBACkC;AAClC,QAAM;GACJ;GACA;GACA,SAAS;GACT,MAAM;GACN,cAAc;GACf,CAAC;AAEF,OAAK,WAAW;AAChB,OAAK,cAAc;AACnB,OAAK,YAAY;AACjB,OAAK,kBAAkB;AACvB,OAAK,gBAAgB;;;;;;AC1EzB,IAAa,4BAAb,cAA+CC,mCAAU;CACvD,YAAY,EAAE,iBAAkD;AAC9D,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,kBAAkB,cAAc;GAC/C,CAAC;;;;;;;ACFN,MAAa,0CACX,EAAE,iBACF,WACuB;CACvB,MAAM,iBAAiBC,4DACrB,EAAE,eAAe,EACjB,OACD;AAED,KAAI,CAACC,8CAAqB,eAAe,CACvC,OAAM,IAAI,0BAA0B,EAClC,eAAe,cAAc,SAC9B,CAAC;AAGJ,QAAO;;;;;;;;;;;;;;;ACZT,MAAa,wBAAwB,SAASC,2CAAkB,KAAc;CAC5E,MAAM,kBAAkB,OAAO;AAE/B,wCAAc,iBAAiB,qCAAqC;AAQpE,QAN+B,gBAAgB,IAAI,iBAGzB,yBACxBC,qDAA0B;;;;;;;;;;;;;;;;;;;;;;;ACmC9B,MAAa,wBAAwB,OACnC,EACE,WACA,UACA,mBACA,KACA,UACA,WAEF,SAASC,2CAAkB,KACgB;CAC3C,MAAM,YAAYC,4CAAmB,OAAO;AAE5C,KAAI,UAAU,WAAW,EACvB,OAAM,IAAIC,oDAA2B,EACnC,mBAAmBC,+CAAsB,aAC1C,CAAC;CAKJ,MAAM,eAAe,UAAU,KAAKC,8CAAqB;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,+CAAY,OAAO;AAEzB,QAAO"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY = "refresh-user-state-from-cookie";
|
|
2
2
|
export declare const INITIALIZE_STORAGE_SYNC_TRACKER_KEY = "initialize-storage-sync";
|
|
3
|
+
export declare const MIGRATE_SESSION_KEY_TRACKER_KEY = "migrate-session-key";
|
|
3
4
|
export declare const FETCH_PROJECT_SETTINGS_TRACKER_KEY = "fetch-project-settings";
|
|
4
5
|
export declare const GENERATE_SESSION_KEYS_TRACKER_KEY = "generate-session-keys";
|
|
5
6
|
export declare const REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY = "refresh-user-state-from-valid-token";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/modules/initializeClient/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0CAA0C,mCACrB,CAAC;AAEnC,eAAO,MAAM,mCAAmC,4BAA4B,CAAC;AAE7E,eAAO,MAAM,kCAAkC,2BAA2B,CAAC;AAE3E,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AAEzE,eAAO,MAAM,+CAA+C,wCACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/modules/initializeClient/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0CAA0C,mCACrB,CAAC;AAEnC,eAAO,MAAM,mCAAmC,4BAA4B,CAAC;AAE7E,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AAErE,eAAO,MAAM,kCAAkC,2BAA2B,CAAC;AAE3E,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AAEzE,eAAO,MAAM,+CAA+C,wCACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeClient.d.ts","sourceRoot":"","sources":["../../../src/modules/initializeClient/initializeClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initializeClient.d.ts","sourceRoot":"","sources":["../../../src/modules/initializeClient/initializeClient.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,gBAAgB,sDAE1B,OAAO,CAAC,IAAI,CAyKd,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { ProjectSettings } from '../projectSettings.types';
|
|
2
|
-
/**
|
|
3
|
-
* Expiration time of the project settings in milliseconds.
|
|
4
|
-
*/
|
|
5
|
-
export declare const PROJECT_SETTINGS_EXPIRATION_TIME: number;
|
|
6
2
|
/**
|
|
7
3
|
* Fetches and updates the project settings from the API.
|
|
8
4
|
*
|
|
9
5
|
* This function retrieves the latest project configuration settings
|
|
10
6
|
* from Dynamic's servers, including authentication options, enabled chains,
|
|
11
|
-
* and security configurations.
|
|
7
|
+
* and security configurations. It always performs a live fetch. If the API
|
|
8
|
+
* call fails, it falls back to the last known-good settings from storage,
|
|
9
|
+
* provided they were saved by a matching SDK API version.
|
|
12
10
|
*
|
|
13
11
|
* @example
|
|
14
12
|
* ```ts
|
|
@@ -18,6 +16,7 @@ export declare const PROJECT_SETTINGS_EXPIRATION_TIME: number;
|
|
|
18
16
|
*
|
|
19
17
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
20
18
|
* @returns A promise that resolves to the updated project settings.
|
|
19
|
+
* @throws {Error} Rethrows the original fetch error when no matching-version cached settings exist.
|
|
21
20
|
* @see createDynamicClient
|
|
22
21
|
* @see initializeClient
|
|
23
22
|
* @notInstrumented
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchProjectSettings.d.ts","sourceRoot":"","sources":["../../../../src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAShE
|
|
1
|
+
{"version":3,"file":"fetchProjectSettings.d.ts","sourceRoot":"","sources":["../../../../src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAShE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,oBAAoB,yDAE9B,OAAO,CAAC,eAAe,GAAG,IAAI,CAiDhC,CAAC"}
|
package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
-
import type { BusinessAccountMember, BusinessAccountMemberRole, TargetIdentity } from '../businessAccounts.types';
|
|
2
|
+
import type { BusinessAccountActionRequired, BusinessAccountMember, BusinessAccountMemberRole, TargetIdentity } from '../businessAccounts.types';
|
|
3
3
|
type AddMemberParams = {
|
|
4
4
|
businessAccountId: string;
|
|
5
5
|
role?: BusinessAccountMemberRole;
|
|
@@ -14,15 +14,20 @@ type AddMemberParams = {
|
|
|
14
14
|
* mutation with no MPC step, so a rejection (e.g. a 422 resource-limit) surfaces
|
|
15
15
|
* as a thrown error rather than stalling in the iframe bridge.
|
|
16
16
|
*
|
|
17
|
+
* When the account governs `addMember`, nothing is written and the 202 body is
|
|
18
|
+
* returned instead — first the intent to sign, then the proposal collecting
|
|
19
|
+
* approvals. Narrow it with `isBusinessAccountActionRequired`.
|
|
20
|
+
*
|
|
17
21
|
* @param params.businessAccountId - The ID of the business account.
|
|
18
22
|
* @param params.targetIdentity - The member to add (userId, or identifier + identifierType).
|
|
19
23
|
* @param [params.role] - The member role: a built-in (`admin`, `viewer`) or a
|
|
20
24
|
* role this account defined. Defaults to `viewer`. `owner` is rejected — use
|
|
21
25
|
* `transferBusinessAccountOwnership`.
|
|
22
26
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
23
|
-
* @returns The created business account member.
|
|
27
|
+
* @returns The created business account member, or the outstanding action required.
|
|
28
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
24
29
|
* @notInstrumented
|
|
25
30
|
*/
|
|
26
|
-
export declare const addBusinessAccountMember: ({ businessAccountId, targetIdentity, role }: AddMemberParams, client?: DynamicClient) => Promise<BusinessAccountMember>;
|
|
31
|
+
export declare const addBusinessAccountMember: ({ businessAccountId, targetIdentity, role }: AddMemberParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountMember>;
|
|
27
32
|
export {};
|
|
28
33
|
//# sourceMappingURL=addBusinessAccountMember.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBusinessAccountMember.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACf,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"addBusinessAccountMember.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACf,MAAM,2BAA2B,CAAC;AAGnC,KAAK,eAAe,GAAG;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,wBAAwB,gDACU,eAAe,WACpD,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,qBAAqB,CAqC/D,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { BusinessAccountActionRequired } from './businessAccounts.types';
|
|
2
|
+
type ParseGovernedResponseParams = {
|
|
3
|
+
fnName: string;
|
|
4
|
+
response: Response;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Reads a governed mutation's 202 body off the raw response, narrowed on
|
|
8
|
+
* `reason` + `intent` rather than cast outright: a malformed or unrecognized
|
|
9
|
+
* body would otherwise pass through as action-required, and the caller would
|
|
10
|
+
* sign or wait on data that does not exist.
|
|
11
|
+
*
|
|
12
|
+
* Shared by every governed business-account mutation, since the generated
|
|
13
|
+
* 200 mapper cannot run over this body — it assumes the ungoverned success
|
|
14
|
+
* shape and throws or returns garbage instead.
|
|
15
|
+
*
|
|
16
|
+
* @param params.fnName - The calling function's name, named in the thrown error.
|
|
17
|
+
* @param params.response - The raw fetch `Response` carrying the 202 body.
|
|
18
|
+
* @returns The governed-pending result: the intent to sign, or the proposal collecting approvals.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* if (response.raw.status === 202) {
|
|
23
|
+
* return parseGovernedResponse({ fnName: 'addBusinessAccountMember', response: response.raw });
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see addBusinessAccountMember
|
|
28
|
+
* @see removeBusinessAccountWallet
|
|
29
|
+
* @throws {UnexpectedConsentResponseError} When the 202 body has no recognized reason or no intent.
|
|
30
|
+
* @notInstrumented
|
|
31
|
+
*/
|
|
32
|
+
export declare const parseGovernedResponse: ({ fnName, response, }: ParseGovernedResponseParams) => Promise<BusinessAccountActionRequired>;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=parseGovernedResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseGovernedResponse.d.ts","sourceRoot":"","sources":["../../../../src/modules/waas/businessAccounts/parseGovernedResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAE9E,KAAK,2BAA2B,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,qBAAqB,0BAG/B,2BAA2B,KAAG,OAAO,CAAC,6BAA6B,CAYrE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
-
import type { BusinessAccountMember } from '../businessAccounts.types';
|
|
2
|
+
import type { BusinessAccountActionRequired, BusinessAccountMember } from '../businessAccounts.types';
|
|
3
3
|
type RemoveMemberParams = {
|
|
4
4
|
businessAccountId: string;
|
|
5
5
|
userId: string;
|
|
@@ -12,7 +12,7 @@ type RemoveMemberParams = {
|
|
|
12
12
|
* @param params.businessAccountId - The business account to remove the member from.
|
|
13
13
|
* @param params.userId - The id of the user to remove.
|
|
14
14
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
15
|
-
* @returns The removed member.
|
|
15
|
+
* @returns The removed member, or the outstanding action required.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```ts
|
|
@@ -26,8 +26,9 @@ type RemoveMemberParams = {
|
|
|
26
26
|
*
|
|
27
27
|
* @see addBusinessAccountMember
|
|
28
28
|
* @see getBusinessAccount
|
|
29
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
29
30
|
* @notInstrumented
|
|
30
31
|
*/
|
|
31
|
-
export declare const removeBusinessAccountMember: ({ businessAccountId, userId }: RemoveMemberParams, client?: DynamicClient) => Promise<BusinessAccountMember>;
|
|
32
|
+
export declare const removeBusinessAccountMember: ({ businessAccountId, userId }: RemoveMemberParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountMember>;
|
|
32
33
|
export {};
|
|
33
34
|
//# sourceMappingURL=removeBusinessAccountMember.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeBusinessAccountMember.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"removeBusinessAccountMember.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AAGnC,KAAK,kBAAkB,GAAG;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,2BAA2B,kCACP,kBAAkB,WACzC,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,qBAAqB,CAyB/D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
-
import type { BusinessAccountSigner } from '../businessAccounts.types';
|
|
2
|
+
import type { BusinessAccountActionRequired, BusinessAccountSigner } from '../businessAccounts.types';
|
|
3
3
|
type RemoveSignerParams = {
|
|
4
4
|
businessAccountId: string;
|
|
5
5
|
signerId: string;
|
|
@@ -15,7 +15,7 @@ type RemoveSignerParams = {
|
|
|
15
15
|
* @param params.walletId - The wallet the signer is attached to.
|
|
16
16
|
* @param params.signerId - The id of the signer to remove (`BusinessAccountSigner.id`).
|
|
17
17
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
18
|
-
* @returns The removed signer.
|
|
18
|
+
* @returns The removed signer, or the outstanding action required.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```ts
|
|
@@ -30,8 +30,9 @@ type RemoveSignerParams = {
|
|
|
30
30
|
*
|
|
31
31
|
* @see addBusinessAccountSigner
|
|
32
32
|
* @see getBusinessAccount
|
|
33
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
33
34
|
* @notInstrumented
|
|
34
35
|
*/
|
|
35
|
-
export declare const removeBusinessAccountSigner: ({ businessAccountId, walletId, signerId }: RemoveSignerParams, client?: DynamicClient) => Promise<BusinessAccountSigner>;
|
|
36
|
+
export declare const removeBusinessAccountSigner: ({ businessAccountId, walletId, signerId }: RemoveSignerParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountSigner>;
|
|
36
37
|
export {};
|
|
37
38
|
//# sourceMappingURL=removeBusinessAccountSigner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeBusinessAccountSigner.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"removeBusinessAccountSigner.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AAGnC,KAAK,kBAAkB,GAAG;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,2BAA2B,8CACK,kBAAkB,WACrD,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,qBAAqB,CA0B/D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
-
import type { BusinessAccountDetail } from '../businessAccounts.types';
|
|
2
|
+
import type { BusinessAccountActionRequired, BusinessAccountDetail } from '../businessAccounts.types';
|
|
3
3
|
type RemoveBusinessAccountWalletParams = {
|
|
4
4
|
businessAccountId: string;
|
|
5
5
|
walletId: string;
|
|
@@ -12,7 +12,7 @@ type RemoveBusinessAccountWalletParams = {
|
|
|
12
12
|
* @param params.businessAccountId - The business account the wallet belongs to.
|
|
13
13
|
* @param params.walletId - The wallet to remove (`BusinessAccountWallet.id`).
|
|
14
14
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
15
|
-
* @returns The updated business account detail.
|
|
15
|
+
* @returns The updated business account detail, or the outstanding action required.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```ts
|
|
@@ -25,8 +25,9 @@ type RemoveBusinessAccountWalletParams = {
|
|
|
25
25
|
*
|
|
26
26
|
* @see addWalletToBusinessAccount
|
|
27
27
|
* @see getBusinessAccount
|
|
28
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
28
29
|
* @notInstrumented
|
|
29
30
|
*/
|
|
30
|
-
export declare const removeBusinessAccountWallet: ({ businessAccountId, walletId }: RemoveBusinessAccountWalletParams, client?: DynamicClient) => Promise<BusinessAccountDetail>;
|
|
31
|
+
export declare const removeBusinessAccountWallet: ({ businessAccountId, walletId }: RemoveBusinessAccountWalletParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountDetail>;
|
|
31
32
|
export {};
|
|
32
33
|
//# sourceMappingURL=removeBusinessAccountWallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeBusinessAccountWallet.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"removeBusinessAccountWallet.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AAGnC,KAAK,iCAAiC,GAAG;IACvC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,2BAA2B,oCACL,iCAAiC,WAC1D,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,qBAAqB,CA+B/D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
-
import type { BusinessAccountDetail } from '../businessAccounts.types';
|
|
2
|
+
import type { BusinessAccountActionRequired, BusinessAccountDetail } from '../businessAccounts.types';
|
|
3
3
|
type TransferBusinessAccountOwnershipParams = {
|
|
4
4
|
businessAccountId: string;
|
|
5
5
|
newOwnerUserId: string;
|
|
@@ -12,7 +12,7 @@ type TransferBusinessAccountOwnershipParams = {
|
|
|
12
12
|
* @param params.businessAccountId - The business account whose ownership moves.
|
|
13
13
|
* @param params.newOwnerUserId - The member to promote to owner.
|
|
14
14
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
15
|
-
* @returns The updated business account detail.
|
|
15
|
+
* @returns The updated business account detail, or the outstanding action required.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```ts
|
|
@@ -25,8 +25,9 @@ type TransferBusinessAccountOwnershipParams = {
|
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
27
|
* @see getBusinessAccount
|
|
28
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
28
29
|
* @notInstrumented
|
|
29
30
|
*/
|
|
30
|
-
export declare const transferBusinessAccountOwnership: ({ businessAccountId, newOwnerUserId }: TransferBusinessAccountOwnershipParams, client?: DynamicClient) => Promise<BusinessAccountDetail>;
|
|
31
|
+
export declare const transferBusinessAccountOwnership: ({ businessAccountId, newOwnerUserId }: TransferBusinessAccountOwnershipParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountDetail>;
|
|
31
32
|
export {};
|
|
32
33
|
//# sourceMappingURL=transferBusinessAccountOwnership.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transferBusinessAccountOwnership.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"transferBusinessAccountOwnership.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AAGnC,KAAK,sCAAsC,GAAG;IAC5C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,gCAAgC,0CACJ,sCAAsC,WACrE,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,qBAAqB,CAmC/D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
-
import type { BuiltInBusinessAccountMemberRole, BusinessAccountMember } from '../businessAccounts.types';
|
|
2
|
+
import type { BuiltInBusinessAccountMemberRole, BusinessAccountActionRequired, BusinessAccountMember } from '../businessAccounts.types';
|
|
3
3
|
/**
|
|
4
4
|
* Roles a member can be reassigned to: a built-in other than owner, or one this
|
|
5
5
|
* account defined. Ownership moves only via transferOwnership, which the API
|
|
@@ -22,7 +22,7 @@ type UpdateBusinessAccountMemberRoleParams = {
|
|
|
22
22
|
* @param params.role - The new role: a built-in (`admin`, `viewer`) or a role
|
|
23
23
|
* this account defined.
|
|
24
24
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
25
|
-
* @returns The updated business account member.
|
|
25
|
+
* @returns The updated business account member, or the outstanding action required.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```ts
|
|
@@ -35,8 +35,9 @@ type UpdateBusinessAccountMemberRoleParams = {
|
|
|
35
35
|
*
|
|
36
36
|
* @see transferBusinessAccountOwnership
|
|
37
37
|
* @see addBusinessAccountMember
|
|
38
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
38
39
|
* @notInstrumented
|
|
39
40
|
*/
|
|
40
|
-
export declare const updateBusinessAccountMemberRole: ({ businessAccountId, userId, role }: UpdateBusinessAccountMemberRoleParams, client?: DynamicClient) => Promise<BusinessAccountMember>;
|
|
41
|
+
export declare const updateBusinessAccountMemberRole: ({ businessAccountId, userId, role }: UpdateBusinessAccountMemberRoleParams, client?: DynamicClient) => Promise<BusinessAccountActionRequired | BusinessAccountMember>;
|
|
41
42
|
export {};
|
|
42
43
|
//# sourceMappingURL=updateBusinessAccountMemberRole.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateBusinessAccountMemberRole.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EACV,gCAAgC,EAChC,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"updateBusinessAccountMemberRole.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AAGnC;;;;GAIG;AACH,KAAK,cAAc,GACf,OAAO,CAAC,gCAAgC,EAAE,OAAO,CAAC,GAClD,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,KAAK,qCAAqC,GAAG;IAC3C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,+BAA+B,wCACL,qCAAqC,WAClE,aAAa,KACpB,OAAO,CAAC,6BAA6B,GAAG,qBAAqB,CA6B/D,CAAC"}
|