@dynamic-labs-sdk/client 1.10.0 → 1.11.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.
Files changed (115) hide show
  1. package/dist/{InvalidParamError-BxBgwLQB.native.esm.js → InvalidParamError-BUpLSb5x.native.esm.js} +4 -2
  2. package/dist/{InvalidParamError-BxBgwLQB.native.esm.js.map → InvalidParamError-BUpLSb5x.native.esm.js.map} +1 -1
  3. package/dist/{InvalidParamError-BmFmxeXx.esm.js → InvalidParamError-BazEwozw.esm.js} +5 -2
  4. package/dist/{InvalidParamError-BmFmxeXx.esm.js.map → InvalidParamError-BazEwozw.esm.js.map} +1 -1
  5. package/dist/{InvalidParamError-CGZRSAOn.cjs → InvalidParamError-CMesesy6.cjs} +6 -3
  6. package/dist/{InvalidParamError-CGZRSAOn.cjs.map → InvalidParamError-CMesesy6.cjs.map} +1 -1
  7. package/dist/{NotWaasWalletAccountError-DO313zza.esm.js → NotWaasWalletAccountError-CIjFmQ_l.esm.js} +2 -2
  8. package/dist/{NotWaasWalletAccountError-DO313zza.esm.js.map → NotWaasWalletAccountError-CIjFmQ_l.esm.js.map} +1 -1
  9. package/dist/{NotWaasWalletAccountError-cIj987D7.cjs → NotWaasWalletAccountError-D-yqOoH6.cjs} +2 -2
  10. package/dist/{NotWaasWalletAccountError-cIj987D7.cjs.map → NotWaasWalletAccountError-D-yqOoH6.cjs.map} +1 -1
  11. package/dist/{NotWaasWalletAccountError-CkH85cm5.native.esm.js → NotWaasWalletAccountError-DWXGDcpr.native.esm.js} +2 -2
  12. package/dist/{NotWaasWalletAccountError-CkH85cm5.native.esm.js.map → NotWaasWalletAccountError-DWXGDcpr.native.esm.js.map} +1 -1
  13. package/dist/client/types/DynamicClient.d.ts +3 -0
  14. package/dist/client/types/DynamicClient.d.ts.map +1 -1
  15. package/dist/core.cjs +5 -5
  16. package/dist/core.esm.js +5 -5
  17. package/dist/core.native.esm.js +5 -5
  18. package/dist/exports/index.d.ts +6 -0
  19. package/dist/exports/index.d.ts.map +1 -1
  20. package/dist/{getNetworkProviderFromNetworkId-CsAg0JU7.esm.js → getNetworkProviderFromNetworkId-BfBE-dei.esm.js} +3 -3
  21. package/dist/{getNetworkProviderFromNetworkId-CsAg0JU7.esm.js.map → getNetworkProviderFromNetworkId-BfBE-dei.esm.js.map} +1 -1
  22. package/dist/{getNetworkProviderFromNetworkId-CxGbMwFL.native.esm.js → getNetworkProviderFromNetworkId-C-1rPWZm.native.esm.js} +5 -4
  23. package/dist/getNetworkProviderFromNetworkId-C-1rPWZm.native.esm.js.map +1 -0
  24. package/dist/{getNetworkProviderFromNetworkId-2wYAIZ6w.cjs → getNetworkProviderFromNetworkId-D4xzWb7w.cjs} +4 -4
  25. package/dist/{getNetworkProviderFromNetworkId-2wYAIZ6w.cjs.map → getNetworkProviderFromNetworkId-D4xzWb7w.cjs.map} +1 -1
  26. package/dist/{getSignedSessionId-E9JM9zum.esm.js → getSignedSessionId-BWxWFaJW.esm.js} +3 -3
  27. package/dist/{getSignedSessionId-E9JM9zum.esm.js.map → getSignedSessionId-BWxWFaJW.esm.js.map} +1 -1
  28. package/dist/{getSignedSessionId-E3o2_FL7.cjs → getSignedSessionId-BimmHQvA.cjs} +3 -3
  29. package/dist/{getSignedSessionId-E3o2_FL7.cjs.map → getSignedSessionId-BimmHQvA.cjs.map} +1 -1
  30. package/dist/{getSignedSessionId-BZHJglv0.native.esm.js → getSignedSessionId-fwHlhBvt.native.esm.js} +3 -3
  31. package/dist/{getSignedSessionId-BZHJglv0.native.esm.js.map → getSignedSessionId-fwHlhBvt.native.esm.js.map} +1 -1
  32. package/dist/{getWaasWalletProviderFromWalletAccount-CeoFLRbo.native.esm.js → getWaasWalletProviderFromWalletAccount-CJdnAlDf.native.esm.js} +3 -3
  33. package/dist/{getWaasWalletProviderFromWalletAccount-CeoFLRbo.native.esm.js.map → getWaasWalletProviderFromWalletAccount-CJdnAlDf.native.esm.js.map} +1 -1
  34. package/dist/{getWaasWalletProviderFromWalletAccount-CXv6xEJZ.esm.js → getWaasWalletProviderFromWalletAccount-OM-BlEFR.esm.js} +3 -3
  35. package/dist/{getWaasWalletProviderFromWalletAccount-CXv6xEJZ.esm.js.map → getWaasWalletProviderFromWalletAccount-OM-BlEFR.esm.js.map} +1 -1
  36. package/dist/{getWaasWalletProviderFromWalletAccount-BaxUhLEp.cjs → getWaasWalletProviderFromWalletAccount-sEzYqoCf.cjs} +3 -3
  37. package/dist/{getWaasWalletProviderFromWalletAccount-BaxUhLEp.cjs.map → getWaasWalletProviderFromWalletAccount-sEzYqoCf.cjs.map} +1 -1
  38. package/dist/{getWalletProviderByKey-DMNpwDEn.cjs → getWalletProviderByKey-1zHjzqbz.cjs} +3 -3
  39. package/dist/{getWalletProviderByKey-DMNpwDEn.cjs.map → getWalletProviderByKey-1zHjzqbz.cjs.map} +1 -1
  40. package/dist/{getWalletProviderByKey-AQmQQpmk.esm.js → getWalletProviderByKey-BXGcVzkf.esm.js} +2 -2
  41. package/dist/{getWalletProviderByKey-AQmQQpmk.esm.js.map → getWalletProviderByKey-BXGcVzkf.esm.js.map} +1 -1
  42. package/dist/{getWalletProviderByKey-C5w8qJ0f.native.esm.js → getWalletProviderByKey-CAQkYCGi.native.esm.js} +3 -2
  43. package/dist/getWalletProviderByKey-CAQkYCGi.native.esm.js.map +1 -0
  44. package/dist/index.cjs +157 -21
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.esm.js +155 -22
  47. package/dist/index.esm.js.map +1 -1
  48. package/dist/index.native.esm.js +155 -22
  49. package/dist/index.native.esm.js.map +1 -1
  50. package/dist/{isMfaRequiredForAction-BmJKVaMQ.native.esm.js → isMfaRequiredForAction-CPadAr7k.native.esm.js} +2 -2
  51. package/dist/{isMfaRequiredForAction-BmJKVaMQ.native.esm.js.map → isMfaRequiredForAction-CPadAr7k.native.esm.js.map} +1 -1
  52. package/dist/{isMfaRequiredForAction-C9Fw0v_g.cjs → isMfaRequiredForAction-CxWuGsmB.cjs} +3 -2
  53. package/dist/isMfaRequiredForAction-CxWuGsmB.cjs.map +1 -0
  54. package/dist/{isMfaRequiredForAction-BNgq1huY.esm.js → isMfaRequiredForAction-DZVNUtPY.esm.js} +3 -2
  55. package/dist/isMfaRequiredForAction-DZVNUtPY.esm.js.map +1 -0
  56. package/dist/modules/auth/social/getUserSocialAccounts/getUserSocialAccounts.d.ts +1 -0
  57. package/dist/modules/auth/social/getUserSocialAccounts/getUserSocialAccounts.d.ts.map +1 -1
  58. package/dist/modules/auth/social/oauth/completeSocialAuthentication/completeSocialAuthentication.d.ts +1 -0
  59. package/dist/modules/auth/social/oauth/completeSocialAuthentication/completeSocialAuthentication.d.ts.map +1 -1
  60. package/dist/modules/auth/social/oauth/detectOAuthRedirect/detectOAuthRedirect.d.ts +1 -0
  61. package/dist/modules/auth/social/oauth/detectOAuthRedirect/detectOAuthRedirect.d.ts.map +1 -1
  62. package/dist/modules/balances/getBalances/getBalances.d.ts +1 -0
  63. package/dist/modules/balances/getBalances/getBalances.d.ts.map +1 -1
  64. package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts +1 -0
  65. package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts.map +1 -1
  66. package/dist/modules/clientEvents/clientEvents.d.ts +2 -0
  67. package/dist/modules/clientEvents/clientEvents.d.ts.map +1 -1
  68. package/dist/modules/flow/broadcastFlow/broadcastFlow.d.ts +24 -0
  69. package/dist/modules/flow/broadcastFlow/broadcastFlow.d.ts.map +1 -0
  70. package/dist/modules/flow/broadcastFlow/index.d.ts +3 -0
  71. package/dist/modules/flow/broadcastFlow/index.d.ts.map +1 -0
  72. package/dist/modules/flow/cancelFlow/cancelFlow.d.ts +14 -0
  73. package/dist/modules/flow/cancelFlow/cancelFlow.d.ts.map +1 -0
  74. package/dist/modules/flow/cancelFlow/index.d.ts +3 -0
  75. package/dist/modules/flow/cancelFlow/index.d.ts.map +1 -0
  76. package/dist/modules/flow/submitFlowTransaction/index.d.ts +3 -0
  77. package/dist/modules/flow/submitFlowTransaction/index.d.ts.map +1 -0
  78. package/dist/modules/flow/submitFlowTransaction/submitFlowTransaction.d.ts +24 -0
  79. package/dist/modules/flow/submitFlowTransaction/submitFlowTransaction.d.ts.map +1 -0
  80. package/dist/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/addCoinbaseOnrampOrderEventListener.d.ts +1 -0
  81. package/dist/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/addCoinbaseOnrampOrderEventListener.d.ts.map +1 -1
  82. package/dist/modules/initializeClient/initializeClient.d.ts +1 -0
  83. package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
  84. package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts +1 -0
  85. package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts.map +1 -1
  86. package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +1 -0
  87. package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
  88. package/dist/modules/user/refreshUser/refreshUser.d.ts +1 -0
  89. package/dist/modules/user/refreshUser/refreshUser.d.ts.map +1 -1
  90. package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts +1 -0
  91. package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts.map +1 -1
  92. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +1 -0
  93. package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
  94. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +1 -0
  95. package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +1 -1
  96. package/dist/modules/wallets/walletProvider/events/onWalletProviderEvent/onWalletProviderEvent.d.ts +1 -0
  97. package/dist/modules/wallets/walletProvider/events/onWalletProviderEvent/onWalletProviderEvent.d.ts.map +1 -1
  98. package/dist/{refreshAuth-DfcR3CWf.cjs → refreshAuth-CKcNynMk.cjs} +3 -3
  99. package/dist/{refreshAuth-DfcR3CWf.cjs.map → refreshAuth-CKcNynMk.cjs.map} +1 -1
  100. package/dist/{refreshAuth-CVUpYNs6.native.esm.js → refreshAuth-Cl3adySI.native.esm.js} +3 -3
  101. package/dist/{refreshAuth-CVUpYNs6.native.esm.js.map → refreshAuth-Cl3adySI.native.esm.js.map} +1 -1
  102. package/dist/{refreshAuth-D8dU3BLP.esm.js → refreshAuth-DlQw3Dky.esm.js} +3 -3
  103. package/dist/{refreshAuth-D8dU3BLP.esm.js.map → refreshAuth-DlQw3Dky.esm.js.map} +1 -1
  104. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  105. package/dist/waas.cjs +5 -5
  106. package/dist/waas.esm.js +4 -4
  107. package/dist/waas.native.esm.js +4 -4
  108. package/dist/waasCore.cjs +4 -4
  109. package/dist/waasCore.esm.js +4 -4
  110. package/dist/waasCore.native.esm.js +4 -4
  111. package/package.json +2 -2
  112. package/dist/getNetworkProviderFromNetworkId-CxGbMwFL.native.esm.js.map +0 -1
  113. package/dist/getWalletProviderByKey-C5w8qJ0f.native.esm.js.map +0 -1
  114. package/dist/isMfaRequiredForAction-BNgq1huY.esm.js.map +0 -1
  115. package/dist/isMfaRequiredForAction-C9Fw0v_g.cjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-C9Fw0v_g.cjs');
2
- const require_InvalidParamError = require('./InvalidParamError-CGZRSAOn.cjs');
3
- const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-2wYAIZ6w.cjs');
4
- const require_getWalletProviderByKey = require('./getWalletProviderByKey-DMNpwDEn.cjs');
5
- const require_refreshAuth = require('./refreshAuth-DfcR3CWf.cjs');
6
- const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-cIj987D7.cjs');
1
+ const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-CxWuGsmB.cjs');
2
+ const require_InvalidParamError = require('./InvalidParamError-CMesesy6.cjs');
3
+ const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-D4xzWb7w.cjs');
4
+ const require_getWalletProviderByKey = require('./getWalletProviderByKey-1zHjzqbz.cjs');
5
+ const require_refreshAuth = require('./refreshAuth-CKcNynMk.cjs');
6
+ const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-D-yqOoH6.cjs');
7
7
  let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
8
8
  let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
9
9
  let zod_mini = require("zod/mini");
@@ -363,6 +363,7 @@ const initializeStorageSync = async (client) => {
363
363
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
364
364
  * @returns A promise that resolves to the authenticated user.
365
365
  * @instrumented
366
+ * @noHook Low-level refresh primitive that is not exposed as a React hook.
366
367
  */
367
368
  const refreshUser = async (client = require_InvalidParamError.getDefaultClient()) => {
368
369
  const core = require_InvalidParamError.getCore(client);
@@ -415,6 +416,7 @@ var ClientAlreadyInitializedError = class extends require_InvalidParamError.Base
415
416
  * @returns A promise that resolves when initialization is complete.
416
417
  * @throws ClientAlreadyInitializedError If the client is already initialized.
417
418
  * @instrumented
419
+ * @noHook Client lifecycle management is not exposed as a React hook.
418
420
  */
419
421
  const initializeClient = async (client = require_InvalidParamError.getDefaultClient()) => {
420
422
  const core = require_InvalidParamError.getCore(client);
@@ -1857,6 +1859,7 @@ const __signInWithPasskey_wrapped = require_InvalidParamError.instrumentFunction
1857
1859
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1858
1860
  * @returns An array of `SocialAccount` objects associated with the user.
1859
1861
  * @not-instrumented
1862
+ * @hook Exposed as a hook so consumers get the reactive list of social accounts, updated when the user changes.
1860
1863
  */
1861
1864
  const getUserSocialAccounts = (client = require_InvalidParamError.getDefaultClient()) => {
1862
1865
  const { user } = client;
@@ -2186,6 +2189,7 @@ const __completeSocialRedirect_wrapped = require_InvalidParamError.instrumentFun
2186
2189
  * removed in a future major version.
2187
2190
  *
2188
2191
  * @instrumented
2192
+ * @noHook Deprecated alias; the replacement is exposed via its own hook.
2189
2193
  */
2190
2194
  const completeSocialAuthentication = (params, client = require_InvalidParamError.getDefaultClient()) => __completeSocialRedirect_wrapped(params, client);
2191
2195
  const __completeSocialAuthentication_impl = completeSocialAuthentication;
@@ -2231,6 +2235,7 @@ const detectSocialRedirectUrl = async ({ url }, client = require_InvalidParamErr
2231
2235
  * removed in a future major version.
2232
2236
  *
2233
2237
  * @not-instrumented
2238
+ * @noHook Deprecated alias; the replacement is exposed via its own hook.
2234
2239
  */
2235
2240
  const detectOAuthRedirect = (params, client = require_InvalidParamError.getDefaultClient()) => detectSocialRedirectUrl(params, client);
2236
2241
 
@@ -2375,6 +2380,7 @@ const getTokenBalances = async ({ walletAccount, networkId, networkIds, includeP
2375
2380
  * multi-chain `getMultichainTokenBalances`.
2376
2381
  *
2377
2382
  * @not-instrumented
2383
+ * @noHook Deprecated; the replacement is exposed via its own hook.
2378
2384
  */
2379
2385
  const getBalances = (params, client = require_InvalidParamError.getDefaultClient()) => getTokenBalances(params, client);
2380
2386
 
@@ -2410,6 +2416,7 @@ const getMultichainTokenBalances = async ({ balanceRequest }, client = require_I
2410
2416
  * token balances (not native-only) across multiple chains.
2411
2417
  *
2412
2418
  * @not-instrumented
2419
+ * @noHook Deprecated; the replacement is exposed via its own hook.
2413
2420
  */
2414
2421
  const getMultichainBalances = (params, client = require_InvalidParamError.getDefaultClient()) => getMultichainTokenBalances(params, client);
2415
2422
 
@@ -3193,6 +3200,96 @@ const __attachFlowSource_wrapped = require_InvalidParamError.instrumentFunction(
3193
3200
  }
3194
3201
  });
3195
3202
 
3203
+ //#endregion
3204
+ //#region src/modules/flow/utils/createFlowApiClient/createFlowApiClient.ts
3205
+ /** @not-instrumented */
3206
+ const createFlowApiClient = async ({ flowId }, client) => {
3207
+ const core = require_InvalidParamError.getCore(client);
3208
+ const apiClient = require_InvalidParamError.createApiClient({}, client);
3209
+ const sessionToken = await core.storage.getItem(createFlowSessionTokenStorageKey(flowId));
3210
+ if (!sessionToken) throw new FlowSessionTokenMissingError({ flowId });
3211
+ return {
3212
+ apiClient,
3213
+ environmentId: core.environmentId,
3214
+ sessionToken
3215
+ };
3216
+ };
3217
+
3218
+ //#endregion
3219
+ //#region src/modules/flow/broadcastFlow/broadcastFlow.ts
3220
+ /**
3221
+ * Records that a flow transaction has been broadcasted.
3222
+ *
3223
+ * For wallet sources, pass the `txHash` from the on-chain transaction.
3224
+ * For exchange sources, `txHash` can be omitted — the user confirms
3225
+ * they completed the payment and the flow moves to `broadcasted`.
3226
+ *
3227
+ * @param params BroadcastFlowParams - The flow ID and optional tx hash.
3228
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
3229
+ * @returns The updated flow
3230
+ * @instrumented
3231
+ */
3232
+ const broadcastFlow = async ({ flowId, txHash }, client = require_InvalidParamError.getDefaultClient()) => {
3233
+ const { apiClient, environmentId, sessionToken } = await createFlowApiClient({ flowId }, client);
3234
+ return withFlowSessionTokenCleanupOn401({
3235
+ call: () => apiClient.broadcastFlow({
3236
+ environmentId,
3237
+ flowId,
3238
+ flowRecordBroadcastRequest: { txHash },
3239
+ xDynamicFlowSessionToken: sessionToken
3240
+ }),
3241
+ flowId
3242
+ }, client);
3243
+ };
3244
+ const __broadcastFlow_impl = broadcastFlow;
3245
+ const __broadcastFlow_wrapped = require_InvalidParamError.instrumentFunction({
3246
+ fn: __broadcastFlow_impl,
3247
+ functionName: "broadcastFlow",
3248
+ getCore: () => {
3249
+ try {
3250
+ return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
3251
+ } catch {
3252
+ return;
3253
+ }
3254
+ }
3255
+ });
3256
+
3257
+ //#endregion
3258
+ //#region src/modules/flow/cancelFlow/cancelFlow.ts
3259
+ /**
3260
+ * Cancels a flow before it has been broadcasted
3261
+ *
3262
+ * @param params CancelFlowParams - The flow to cancel.
3263
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
3264
+ * @returns The cancelled flow
3265
+ * @instrumented
3266
+ */
3267
+ const cancelFlow = async ({ flowId }, client = require_InvalidParamError.getDefaultClient()) => {
3268
+ const { apiClient, environmentId, sessionToken } = await createFlowApiClient({ flowId }, client);
3269
+ const result = await withFlowSessionTokenCleanupOn401({
3270
+ call: () => apiClient.cancelFlow({
3271
+ environmentId,
3272
+ flowId,
3273
+ xDynamicFlowSessionToken: sessionToken
3274
+ }),
3275
+ flowId
3276
+ }, client);
3277
+ await clearFlowSessionToken({ flowId }, client);
3278
+ return result;
3279
+ };
3280
+ const __cancelFlow_impl = cancelFlow;
3281
+ const __cancelFlow_wrapped = require_InvalidParamError.instrumentFunction({
3282
+ fn: __cancelFlow_impl,
3283
+ functionName: "cancelFlow",
3284
+ getCore: () => {
3285
+ try {
3286
+ return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
3287
+ } catch {
3288
+ return;
3289
+ }
3290
+ }
3291
+ });
3292
+
3196
3293
  //#endregion
3197
3294
  //#region src/modules/flow/getFlow/getFlow.ts
3198
3295
  /**
@@ -3211,21 +3308,6 @@ const getFlow = async ({ flowId }, client = require_InvalidParamError.getDefault
3211
3308
  });
3212
3309
  };
3213
3310
 
3214
- //#endregion
3215
- //#region src/modules/flow/utils/createFlowApiClient/createFlowApiClient.ts
3216
- /** @not-instrumented */
3217
- const createFlowApiClient = async ({ flowId }, client) => {
3218
- const core = require_InvalidParamError.getCore(client);
3219
- const apiClient = require_InvalidParamError.createApiClient({}, client);
3220
- const sessionToken = await core.storage.getItem(createFlowSessionTokenStorageKey(flowId));
3221
- if (!sessionToken) throw new FlowSessionTokenMissingError({ flowId });
3222
- return {
3223
- apiClient,
3224
- environmentId: core.environmentId,
3225
- sessionToken
3226
- };
3227
- };
3228
-
3229
3311
  //#endregion
3230
3312
  //#region src/modules/flow/getFlowQuote/getFlowQuote.ts
3231
3313
  /**
@@ -3293,6 +3375,52 @@ const __prepareFlowSigning_wrapped = require_InvalidParamError.instrumentFunctio
3293
3375
  }
3294
3376
  });
3295
3377
 
3378
+ //#endregion
3379
+ //#region src/modules/flow/submitFlowTransaction/submitFlowTransaction.ts
3380
+ /**
3381
+ * Prepares, signs, and broadcasts a flow transaction in one call.
3382
+ *
3383
+ * Orchestrates the full submission flow:
3384
+ * 1. Calls prepareFlowSigning to advance to signing state and lock the quote
3385
+ * 2. Ensures the wallet is on the correct network for the transaction
3386
+ * 3. Delegates on-chain signing to the wallet provider's executeSwapTransaction method
3387
+ * 4. Calls broadcastFlow with the resulting txHash
3388
+ *
3389
+ * @param params SubmitFlowTransactionParams - The flow ID, wallet account, and optional step callback.
3390
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
3391
+ * @returns The broadcasted flow
3392
+ * @instrumented
3393
+ */
3394
+ const submitFlowTransaction = async ({ onStepChange, flowId, walletAccount, assertBalanceForGasCost, assertBalanceForTransferAmount }, client = require_InvalidParamError.getDefaultClient()) => {
3395
+ const signingPayload = (await __prepareFlowSigning_wrapped({
3396
+ assertBalanceForGasCost,
3397
+ assertBalanceForTransferAmount,
3398
+ flowId
3399
+ }, client)).quote?.signingPayload;
3400
+ require_InvalidParamError.assertDefined(signingPayload, "No signing payload returned from prepare — quote may be missing transaction data");
3401
+ const { transactionHash } = await __executeSwapTransaction_wrapped({
3402
+ onStepChange,
3403
+ signingPayload,
3404
+ walletAccount
3405
+ }, client);
3406
+ return __broadcastFlow_wrapped({
3407
+ flowId,
3408
+ txHash: transactionHash
3409
+ }, client);
3410
+ };
3411
+ const __submitFlowTransaction_impl = submitFlowTransaction;
3412
+ const __submitFlowTransaction_wrapped = require_InvalidParamError.instrumentFunction({
3413
+ fn: __submitFlowTransaction_impl,
3414
+ functionName: "submitFlowTransaction",
3415
+ getCore: () => {
3416
+ try {
3417
+ return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
3418
+ } catch {
3419
+ return;
3420
+ }
3421
+ }
3422
+ });
3423
+
3296
3424
  //#endregion
3297
3425
  //#region src/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/addCoinbaseOnrampOrderEventListener.ts
3298
3426
  /**
@@ -3304,6 +3432,7 @@ const __prepareFlowSigning_wrapped = require_InvalidParamError.instrumentFunctio
3304
3432
  * @throws {ValueMustBeDefinedError} If the window is not available.
3305
3433
  * @docs https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/apple-pay-onramp-api#events-names
3306
3434
  * @not-instrumented
3435
+ * @hook Event listeners are error-prone to wire up by hand with useEffect.
3307
3436
  */
3308
3437
  const addCoinbaseOnrampOrderEventListener = ({ listener }, client = require_InvalidParamError.getDefaultClient()) => {
3309
3438
  const core = require_InvalidParamError.getCore(client);
@@ -3688,6 +3817,7 @@ const __getMoonPayUrl_wrapped = require_InvalidParamError.instrumentFunction({
3688
3817
  *
3689
3818
  * @returns a promise that resolves once the client is fully initialized.
3690
3819
  * @not-instrumented
3820
+ * @noHook Client lifecycle management is not exposed as a hook; use useInitStatus.
3691
3821
  */
3692
3822
  const waitForClientInitialized = async (client = require_InvalidParamError.getDefaultClient()) => {
3693
3823
  await require_InvalidParamError.getCore(client).initTrack.waitForAll();
@@ -7774,6 +7904,7 @@ const getNativeBalance = async ({ walletAccount }, client = require_InvalidParam
7774
7904
  * `getMultichainTokenBalances`).
7775
7905
  *
7776
7906
  * @not-instrumented
7907
+ * @noHook Deprecated; the replacement is exposed via its own hook.
7777
7908
  */
7778
7909
  const getBalance = (params, client = require_InvalidParamError.getDefaultClient()) => getNativeBalance(params, client);
7779
7910
 
@@ -7891,6 +8022,7 @@ const __switchActiveNetwork_wrapped = require_InvalidParamError.instrumentFuncti
7891
8022
  /**
7892
8023
  * Make the wallet account provided as the primary wallet account.
7893
8024
  * @instrumented
8025
+ * @noHook The primary-wallet concept is discouraged and not exposed as a hook.
7894
8026
  */
7895
8027
  const selectPrimaryWalletAccount = async ({ walletAccount }, client = require_InvalidParamError.getDefaultClient()) => {
7896
8028
  const core = require_InvalidParamError.getCore(client);
@@ -8135,6 +8267,7 @@ const offWalletProviderEvent = ({ callback, event, walletProviderKey }, client =
8135
8267
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8136
8268
  * @returns A function that can be called to remove the listener.
8137
8269
  * @not-instrumented
8270
+ * @hook Event listeners are error-prone to wire up by hand with useEffect.
8138
8271
  */
8139
8272
  const onWalletProviderEvent = ({ callback, event, walletProviderKey }, client = require_InvalidParamError.getDefaultClient()) => {
8140
8273
  const walletProvider = require_getWalletProviderByKey.getWalletProviderByKey({ walletProviderKey }, client);
@@ -8315,8 +8448,10 @@ exports.authenticatePasskeyMFA = authenticatePasskeyMFA;
8315
8448
  exports.authenticateTotpMfaDevice = authenticateTotpMfaDevice;
8316
8449
  exports.authenticateWithSocial = __authenticateWithSocial_wrapped;
8317
8450
  exports.broadcastCheckoutTransaction = __broadcastCheckoutTransaction_wrapped;
8451
+ exports.broadcastFlow = __broadcastFlow_wrapped;
8318
8452
  exports.canConnectWithHardwareWallet = canConnectWithHardwareWallet;
8319
8453
  exports.cancelCheckoutTransaction = __cancelCheckoutTransaction_wrapped;
8454
+ exports.cancelFlow = __cancelFlow_wrapped;
8320
8455
  exports.checkStepUpAuth = __checkStepUpAuth_wrapped;
8321
8456
  exports.completeDeviceRegistration = __completeDeviceRegistration_wrapped;
8322
8457
  exports.completeSocialAuthentication = __completeSocialAuthentication_wrapped;
@@ -8435,6 +8570,7 @@ exports.signInWithSocialPopUp = __signInWithSocialPopUp_wrapped;
8435
8570
  exports.signInWithSocialRedirect = __signInWithSocialRedirect_wrapped;
8436
8571
  exports.signMessage = __signMessage_wrapped;
8437
8572
  exports.submitCheckoutTransaction = __submitCheckoutTransaction_wrapped;
8573
+ exports.submitFlowTransaction = __submitFlowTransaction_wrapped;
8438
8574
  exports.supportedCountries = supportedCountries;
8439
8575
  exports.switchActiveNetwork = __switchActiveNetwork_wrapped;
8440
8576
  exports.trackCheckoutTransaction = trackCheckoutTransaction;