@dynamic-labs-sdk/client 0.13.0 → 0.15.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/{InvalidParamError-BZPD1J5U.esm.js → InvalidParamError-Dyk0GfyN.esm.js} +262 -6
- package/dist/InvalidParamError-Dyk0GfyN.esm.js.map +1 -0
- package/dist/{InvalidParamError-CH8qePiW.cjs.js → InvalidParamError-DzSZbHE5.cjs.js} +348 -5
- package/dist/InvalidParamError-DzSZbHE5.cjs.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-Bb8-O3Q9.cjs.js → NotWaasWalletAccountError-DFTloI8C.cjs.js} +3 -3
- package/dist/{NotWaasWalletAccountError-Bb8-O3Q9.cjs.js.map → NotWaasWalletAccountError-DFTloI8C.cjs.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-kP6g-sx9.esm.js → NotWaasWalletAccountError-kNpOqccC.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-kP6g-sx9.esm.js.map → NotWaasWalletAccountError-kNpOqccC.esm.js.map} +1 -1
- package/dist/client/core/createCore/getInitialState.d.ts.map +1 -1
- package/dist/core.cjs.js +33 -65
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.esm.js +24 -60
- package/dist/core.esm.js.map +1 -1
- package/dist/errors/CheckoutSessionTokenMissingError.d.ts +7 -0
- package/dist/errors/CheckoutSessionTokenMissingError.d.ts.map +1 -0
- package/dist/errors/DeeplinkConnectAndVerifyUnsupportedError.d.ts +9 -0
- package/dist/errors/DeeplinkConnectAndVerifyUnsupportedError.d.ts.map +1 -0
- package/dist/errors/UnauthorizedError.d.ts +5 -0
- package/dist/errors/UnauthorizedError.d.ts.map +1 -0
- package/dist/exports/core.d.ts +9 -1
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +30 -3
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-gEnLk01L.cjs.js → getNetworkProviderFromNetworkId-BD1iGcEg.cjs.js} +77 -153
- package/dist/getNetworkProviderFromNetworkId-BD1iGcEg.cjs.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-mlU2KYAn.esm.js → getNetworkProviderFromNetworkId-ySZUpmOr.esm.js} +70 -101
- package/dist/getNetworkProviderFromNetworkId-ySZUpmOr.esm.js.map +1 -0
- package/dist/{getSignedSessionId-B2kd9qrw.esm.js → getSignedSessionId-BxhxGkA4.esm.js} +4 -17
- package/dist/getSignedSessionId-BxhxGkA4.esm.js.map +1 -0
- package/dist/{getSignedSessionId-BYF0o0nI.cjs.js → getSignedSessionId-s45HpP3W.cjs.js} +5 -24
- package/dist/getSignedSessionId-s45HpP3W.cjs.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-DZMPlNXZ.cjs.js → getVerifiedCredentialForWalletAccount-BxrgouFz.cjs.js} +2 -3
- package/dist/{getVerifiedCredentialForWalletAccount-DZMPlNXZ.cjs.js.map → getVerifiedCredentialForWalletAccount-BxrgouFz.cjs.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-DupRN2qF.esm.js → getVerifiedCredentialForWalletAccount-Ch8h_J_W.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-DupRN2qF.esm.js.map → getVerifiedCredentialForWalletAccount-Ch8h_J_W.esm.js.map} +1 -1
- package/dist/index.cjs.js +500 -88
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +475 -80
- package/dist/index.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-CBENhE_c.esm.js → isMfaRequiredForAction-D1sFhYH1.esm.js} +3 -10
- package/dist/isMfaRequiredForAction-D1sFhYH1.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-KnGLJETO.cjs.js → isMfaRequiredForAction-DaJSsq8Z.cjs.js} +2 -15
- package/dist/isMfaRequiredForAction-DaJSsq8Z.cjs.js.map +1 -0
- package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/createDeviceSignatureHeadersMiddleware.d.ts +4 -0
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/createDeviceSignatureHeadersMiddleware.d.ts.map +1 -0
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/index.d.ts +2 -0
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/index.d.ts.map +1 -0
- package/dist/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.d.ts +3 -0
- package/dist/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.d.ts.map +1 -0
- package/dist/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.d.ts +4 -2
- package/dist/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.d.ts.map +1 -1
- package/dist/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.d.ts +15 -0
- package/dist/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.d.ts.map +1 -0
- package/dist/modules/checkout/attachCheckoutTransactionSource/index.d.ts +3 -0
- package/dist/modules/checkout/attachCheckoutTransactionSource/index.d.ts.map +1 -0
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts +15 -0
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/broadcastCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/broadcastCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.d.ts +13 -0
- package/dist/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/cancelCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/cancelCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/checkout.types.d.ts +7 -0
- package/dist/modules/checkout/checkout.types.d.ts.map +1 -0
- package/dist/modules/checkout/createCheckoutTransaction/createCheckoutTransaction.d.ts +18 -0
- package/dist/modules/checkout/createCheckoutTransaction/createCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/createCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/createCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/getCheckoutTransaction/getCheckoutTransaction.d.ts +14 -0
- package/dist/modules/checkout/getCheckoutTransaction/getCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/getCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/getCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts +16 -0
- package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts.map +1 -0
- package/dist/modules/checkout/getCheckoutTransactionQuote/index.d.ts +3 -0
- package/dist/modules/checkout/getCheckoutTransactionQuote/index.d.ts.map +1 -0
- package/dist/modules/checkout/prepareCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/prepareCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/prepareCheckoutTransaction/prepareCheckoutTransaction.d.ts +15 -0
- package/dist/modules/checkout/prepareCheckoutTransaction/prepareCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/submitCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/submitCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/submitCheckoutTransaction/submitCheckoutTransaction.d.ts +22 -0
- package/dist/modules/checkout/submitCheckoutTransaction/submitCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutApiClient/createCheckoutApiClient.d.ts +13 -0
- package/dist/modules/checkout/utils/createCheckoutApiClient/createCheckoutApiClient.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutApiClient/index.d.ts +2 -0
- package/dist/modules/checkout/utils/createCheckoutApiClient/index.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.d.ts +2 -0
- package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/index.d.ts +2 -0
- package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/getDeviceSigner/{getOrCreateUserDeviceSigningKeys/getOrCreateUserDeviceSigningKeys.d.ts → getOrCreateEnvironmentDeviceSigningKeys/getOrCreateEnvironmentDeviceSigningKeys.d.ts} +2 -2
- package/dist/modules/deviceRegistration/getDeviceSigner/getOrCreateEnvironmentDeviceSigningKeys/getOrCreateEnvironmentDeviceSigningKeys.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getDeviceSigner/getOrCreateEnvironmentDeviceSigningKeys/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/getDeviceSigner/getOrCreateEnvironmentDeviceSigningKeys/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/getHeadersForNonceSignedByDeviceSigners.d.ts +3 -0
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/getHeadersForNonceSignedByDeviceSigners.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts +3 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/revokeAllRegisteredDevices/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/revokeAllRegisteredDevices/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/revokeAllRegisteredDevices/revokeAllRegisteredDevices.d.ts +2 -0
- package/dist/modules/deviceRegistration/revokeAllRegisteredDevices/revokeAllRegisteredDevices.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/revokeRegisteredDevice/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/revokeRegisteredDevice/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/revokeRegisteredDevice/revokeRegisteredDevice.d.ts +6 -0
- package/dist/modules/deviceRegistration/revokeRegisteredDevice/revokeRegisteredDevice.d.ts.map +1 -0
- package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
- package/dist/modules/mfa/authenticateMfaRecoveryCode/authenticateMfaRecoveryCode.d.ts +7 -3
- package/dist/modules/mfa/authenticateMfaRecoveryCode/authenticateMfaRecoveryCode.d.ts.map +1 -1
- package/dist/modules/mfa/authenticatePasskeyMFA/authenticatePasskeyMFA.d.ts +6 -3
- package/dist/modules/mfa/authenticatePasskeyMFA/authenticatePasskeyMFA.d.ts.map +1 -1
- package/dist/modules/mfa/authenticateTotpMfaDevice/authenticateTotpMfaDevice.d.ts +6 -3
- package/dist/modules/mfa/authenticateTotpMfaDevice/authenticateTotpMfaDevice.d.ts.map +1 -1
- package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts +10 -0
- package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts.map +1 -1
- package/dist/modules/wallets/constants.d.ts.map +1 -1
- package/dist/modules/wallets/transferAmount/index.d.ts +2 -0
- package/dist/modules/wallets/transferAmount/index.d.ts.map +1 -0
- package/dist/modules/wallets/transferAmount/transferAmount.d.ts +19 -0
- package/dist/modules/wallets/transferAmount/transferAmount.d.ts.map +1 -0
- package/dist/modules/wallets/walletProvider/index.d.ts +1 -1
- package/dist/modules/wallets/walletProvider/index.d.ts.map +1 -1
- package/dist/modules/wallets/walletProvider/isDeeplinkWalletProvider/index.d.ts +2 -0
- package/dist/modules/wallets/walletProvider/isDeeplinkWalletProvider/index.d.ts.map +1 -0
- package/dist/modules/wallets/walletProvider/isDeeplinkWalletProvider/isDeeplinkWalletProvider.d.ts +10 -0
- package/dist/modules/wallets/walletProvider/isDeeplinkWalletProvider/isDeeplinkWalletProvider.d.ts.map +1 -0
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts +32 -0
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts.map +1 -1
- package/dist/services/crossTabBroadcast/createCrossTabBroadcast/createCrossTabBroadcast.d.ts.map +1 -1
- package/dist/services/crossTabBroadcast/crossTabBroadcast.schema.d.ts +1 -0
- package/dist/services/crossTabBroadcast/crossTabBroadcast.schema.d.ts.map +1 -1
- package/dist/services/crossTabBroadcast/crossTabBroadcast.types.d.ts +9 -6
- package/dist/services/crossTabBroadcast/crossTabBroadcast.types.d.ts.map +1 -1
- package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts +11 -1
- package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/getDeviceNameFromUserAgent/getDeviceNameFromUserAgent.d.ts +6 -0
- package/dist/utils/getDeviceNameFromUserAgent/getDeviceNameFromUserAgent.d.ts.map +1 -0
- package/dist/utils/getDeviceNameFromUserAgent/index.d.ts +2 -0
- package/dist/utils/getDeviceNameFromUserAgent/index.d.ts.map +1 -0
- package/dist/utils/getNonce/constants.d.ts +2 -0
- package/dist/utils/getNonce/constants.d.ts.map +1 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts +13 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts.map +1 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/index.d.ts +2 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/index.d.ts.map +1 -0
- package/dist/utils/getNonce/getNonce.d.ts +7 -0
- package/dist/utils/getNonce/getNonce.d.ts.map +1 -1
- package/dist/utils/getNonce/state.d.ts +11 -0
- package/dist/utils/getNonce/state.d.ts.map +1 -0
- package/dist/utils/parseAmountToSmallestUnit/index.d.ts +2 -0
- package/dist/utils/parseAmountToSmallestUnit/index.d.ts.map +1 -0
- package/dist/utils/parseAmountToSmallestUnit/parseAmountToSmallestUnit.d.ts +22 -0
- package/dist/utils/parseAmountToSmallestUnit/parseAmountToSmallestUnit.d.ts.map +1 -0
- package/dist/waas.cjs.js +3 -4
- package/dist/waas.cjs.js.map +1 -1
- package/dist/waas.esm.js +3 -3
- package/dist/waasCore.cjs.js +3 -4
- package/dist/waasCore.cjs.js.map +1 -1
- package/dist/waasCore.esm.js +3 -3
- package/package.json +3 -3
- package/dist/InvalidParamError-BZPD1J5U.esm.js.map +0 -1
- package/dist/InvalidParamError-CH8qePiW.cjs.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-gEnLk01L.cjs.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-mlU2KYAn.esm.js.map +0 -1
- package/dist/getSignedSessionId-B2kd9qrw.esm.js.map +0 -1
- package/dist/getSignedSessionId-BYF0o0nI.cjs.js.map +0 -1
- package/dist/isMfaRequiredForAction-CBENhE_c.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-KnGLJETO.cjs.js.map +0 -1
- package/dist/modules/deviceRegistration/getDeviceSigner/getOrCreateUserDeviceSigningKeys/getOrCreateUserDeviceSigningKeys.d.ts.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
1
|
+
const require_InvalidParamError = require('./InvalidParamError-DzSZbHE5.cjs.js');
|
|
2
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-BD1iGcEg.cjs.js');
|
|
3
|
+
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-BxrgouFz.cjs.js');
|
|
4
|
+
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-DFTloI8C.cjs.js');
|
|
5
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-DaJSsq8Z.cjs.js');
|
|
6
6
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
7
7
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
8
8
|
let zod_mini = require("zod/mini");
|
|
9
|
-
zod_mini =
|
|
9
|
+
zod_mini = require_InvalidParamError.__toESM(zod_mini);
|
|
10
10
|
let eventemitter3 = require("eventemitter3");
|
|
11
|
-
eventemitter3 =
|
|
11
|
+
eventemitter3 = require_InvalidParamError.__toESM(eventemitter3);
|
|
12
12
|
let _simplewebauthn_browser = require("@simplewebauthn/browser");
|
|
13
13
|
|
|
14
14
|
//#region src/modules/state/raiseStateEvents/events.ts
|
|
@@ -79,7 +79,7 @@ const isSignedIn = (client = require_InvalidParamError.getDefaultClient()) => Bo
|
|
|
79
79
|
/**
|
|
80
80
|
* The schema to track the expiration time of the project settings.
|
|
81
81
|
*/
|
|
82
|
-
const projectSettingsExpirationStorageKeySchema =
|
|
82
|
+
const projectSettingsExpirationStorageKeySchema = require_InvalidParamError.createStorageKeySchema({
|
|
83
83
|
key: "projectSettingsExpiration",
|
|
84
84
|
schema: zod_mini.number()
|
|
85
85
|
});
|
|
@@ -119,26 +119,6 @@ const fetchProjectSettings = async (client = require_InvalidParamError.getDefaul
|
|
|
119
119
|
return projectSettings;
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
//#endregion
|
|
123
|
-
//#region src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts
|
|
124
|
-
const generateSessionKeys = async (client) => {
|
|
125
|
-
const { private: privateKey, public: publicKey, privateJwk: privateKeyJwk } = await require_getNetworkProviderFromNetworkId.p256Keygen();
|
|
126
|
-
const core = require_InvalidParamError.getCore(client);
|
|
127
|
-
const stringifiedSessionKeys = JSON.stringify({
|
|
128
|
-
privateKey,
|
|
129
|
-
privateKeyJwk,
|
|
130
|
-
publicKey,
|
|
131
|
-
registered: false
|
|
132
|
-
});
|
|
133
|
-
const encodedSessionKeys = require_InvalidParamError.getBuffer().from(stringifiedSessionKeys).toString("base64");
|
|
134
|
-
core.state.set({ sessionKeys: encodedSessionKeys });
|
|
135
|
-
return {
|
|
136
|
-
privateKey,
|
|
137
|
-
privateKeyJwk,
|
|
138
|
-
publicKey
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
|
|
142
122
|
//#endregion
|
|
143
123
|
//#region src/services/runtimeServices/createRuntimeServices/createRuntimeServices.ts
|
|
144
124
|
/**
|
|
@@ -231,7 +211,7 @@ const logout = async (client = require_InvalidParamError.getDefaultClient()) =>
|
|
|
231
211
|
});
|
|
232
212
|
require_getVerifiedCredentialForWalletAccount.emitEvent({ event: "logout" }, client);
|
|
233
213
|
fetchProjectSettings(client);
|
|
234
|
-
generateSessionKeys(client);
|
|
214
|
+
require_getNetworkProviderFromNetworkId.generateSessionKeys(client);
|
|
235
215
|
};
|
|
236
216
|
|
|
237
217
|
//#endregion
|
|
@@ -347,7 +327,7 @@ const walletProviderKeyMapSchema = zod_mini.record(zod_mini.string(), zod_mini.s
|
|
|
347
327
|
|
|
348
328
|
//#endregion
|
|
349
329
|
//#region src/modules/storageSync/schema.ts
|
|
350
|
-
const stateStorageKeySchema =
|
|
330
|
+
const stateStorageKeySchema = require_InvalidParamError.createStorageKeySchema({
|
|
351
331
|
key: "state",
|
|
352
332
|
schema: zod_mini.object({
|
|
353
333
|
apiVersion: zod_mini.string(),
|
|
@@ -357,7 +337,7 @@ const stateStorageKeySchema = require_getNetworkProviderFromNetworkId.createStor
|
|
|
357
337
|
walletProviderKeyMap: walletProviderKeyMapSchema
|
|
358
338
|
})
|
|
359
339
|
});
|
|
360
|
-
const sessionStorageKeySchema =
|
|
340
|
+
const sessionStorageKeySchema = require_InvalidParamError.createStorageKeySchema({
|
|
361
341
|
key: "session",
|
|
362
342
|
schema: zod_mini.object({
|
|
363
343
|
captchaToken: zod_mini.nullable(zod_mini.string()),
|
|
@@ -486,11 +466,14 @@ const initializeClient = async (client = require_InvalidParamError.getDefaultCli
|
|
|
486
466
|
const fetchProjectSettingsPromise = initializeStorageSyncPromise.then(async () => {
|
|
487
467
|
if (!core.state.get().projectSettings) await fetchProjectSettings(client);
|
|
488
468
|
});
|
|
469
|
+
fetchProjectSettingsPromise.then(() => require_InvalidParamError.fetchAndStoreNonces(client)).catch((error) => {
|
|
470
|
+
core.logger.error("Failed to prefetch nonces:", error);
|
|
471
|
+
});
|
|
489
472
|
/**
|
|
490
473
|
* Generate session keys if they don't exist
|
|
491
474
|
*/
|
|
492
475
|
const generateSessionKeysPromise = fetchProjectSettingsPromise.then(async () => {
|
|
493
|
-
if (!core.state.get().sessionKeys) await generateSessionKeys(client);
|
|
476
|
+
if (!core.state.get().sessionKeys) await require_getNetworkProviderFromNetworkId.generateSessionKeys(client);
|
|
494
477
|
});
|
|
495
478
|
/**
|
|
496
479
|
* Refresh user state on initialization when cookie is enabled.
|
|
@@ -644,12 +627,22 @@ const createNavigationHandler = () => {
|
|
|
644
627
|
//#endregion
|
|
645
628
|
//#region src/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.ts
|
|
646
629
|
/**
|
|
647
|
-
* Creates a deeplink opener that
|
|
630
|
+
* Creates a deeplink opener that navigates the current tab to the deeplink URL.
|
|
631
|
+
*
|
|
632
|
+
* Uses `window.location.assign` instead of `window.open` deliberately.
|
|
633
|
+
* This matters for Phantom redirect specifically, which is the only deep link
|
|
634
|
+
* provider that redirects back to the app in a new tab. With `window.open`,
|
|
635
|
+
* the browser first opens an `about:blank` tab before the native wallet app
|
|
636
|
+
* handles the deep link. When Phantom redirects back, it opens yet another
|
|
637
|
+
* tab. The user ends up with three tabs (original, about:blank, redirect) and
|
|
638
|
+
* the browser focuses the lingering about:blank after the redirect tab closes.
|
|
639
|
+
* `window.location.assign` reuses the current tab, avoiding the extra tab
|
|
640
|
+
* entirely.
|
|
648
641
|
*/
|
|
649
642
|
const createWebDeeplinkOpener = () => {
|
|
650
643
|
if (require_getNetworkProviderFromNetworkId.isServerSideRendering()) return () => Promise.reject(new UnavailableInServerSideError("createWebDeeplinkOpener"));
|
|
651
644
|
return async (url) => {
|
|
652
|
-
window.
|
|
645
|
+
window.location.assign(url);
|
|
653
646
|
};
|
|
654
647
|
};
|
|
655
648
|
|
|
@@ -804,6 +797,7 @@ const getInitialState = () => ({
|
|
|
804
797
|
initStatus: "uninitialized",
|
|
805
798
|
legacyToken: null,
|
|
806
799
|
mfaToken: null,
|
|
800
|
+
prefetchedNonces: [],
|
|
807
801
|
projectSettings: null,
|
|
808
802
|
sessionExpiresAt: null,
|
|
809
803
|
sessionKeys: null,
|
|
@@ -911,6 +905,41 @@ const createDynamicClient = (config) => {
|
|
|
911
905
|
return client;
|
|
912
906
|
};
|
|
913
907
|
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region src/errors/CheckoutSessionTokenMissingError.ts
|
|
910
|
+
var CheckoutSessionTokenMissingError = class extends require_InvalidParamError.BaseError {
|
|
911
|
+
constructor({ transactionId }) {
|
|
912
|
+
super({
|
|
913
|
+
cause: null,
|
|
914
|
+
code: "checkout_session_token_missing",
|
|
915
|
+
docsUrl: null,
|
|
916
|
+
name: "CheckoutSessionTokenMissingError",
|
|
917
|
+
shortMessage: `No session token found for transaction ${transactionId}. Session tokens are issued once at transaction creation and cannot be recovered.`
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region src/errors/DeeplinkConnectAndVerifyUnsupportedError.ts
|
|
924
|
+
var DeeplinkConnectAndVerifyUnsupportedError = class extends require_InvalidParamError.BaseError {
|
|
925
|
+
constructor({ walletProviderKey }) {
|
|
926
|
+
super({
|
|
927
|
+
cause: null,
|
|
928
|
+
code: "deeplink_connect_and_verify_unsupported",
|
|
929
|
+
docsUrl: null,
|
|
930
|
+
metaMessages: [
|
|
931
|
+
`Wallet provider key: ${walletProviderKey}`,
|
|
932
|
+
"On mobile, deep link wallet providers (e.g. Phantom redirect) cannot connect and verify in a single step.",
|
|
933
|
+
"iOS does not allow two sequential deep links — the second one is silently ignored because it is no longer tied to a user gesture.",
|
|
934
|
+
"Android may handle sequential deep links differently, but this guard applies to all mobile platforms to ensure a stable experience and prevent production-only errors.",
|
|
935
|
+
"Use connectWithWalletProvider() first, then call verifyWalletAccount() from a separate user action (e.g. a \"Verify Ownership\" button)."
|
|
936
|
+
],
|
|
937
|
+
name: "DeeplinkConnectAndVerifyUnsupportedError",
|
|
938
|
+
shortMessage: "connectAndVerifyWithWalletProvider is not supported for deep link wallet providers on mobile. Use connectWithWalletProvider and verifyWalletAccount separately."
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
|
|
914
943
|
//#endregion
|
|
915
944
|
//#region src/errors/FeeEstimationFailedError.ts
|
|
916
945
|
var FeeEstimationFailedError = class extends require_InvalidParamError.BaseError {
|
|
@@ -1446,7 +1475,7 @@ const removeDynamicOauthParamsFromUrl = (url) => {
|
|
|
1446
1475
|
//#endregion
|
|
1447
1476
|
//#region src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.ts
|
|
1448
1477
|
/** The schema to track the state of the OAuth flow. */
|
|
1449
|
-
const redirectStateStorageKeySchema =
|
|
1478
|
+
const redirectStateStorageKeySchema = require_InvalidParamError.createStorageKeySchema({
|
|
1450
1479
|
key: "redirectState",
|
|
1451
1480
|
schema: zod_mini.object({
|
|
1452
1481
|
codeVerifier: zod_mini.optional(zod_mini.string()),
|
|
@@ -1723,6 +1752,237 @@ const getMultichainBalances = async ({ balanceRequest }, client = require_Invali
|
|
|
1723
1752
|
})).chainBalances;
|
|
1724
1753
|
};
|
|
1725
1754
|
|
|
1755
|
+
//#endregion
|
|
1756
|
+
//#region src/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.ts
|
|
1757
|
+
const createCheckoutSessionTokenStorageKey = (transactionId) => {
|
|
1758
|
+
return require_InvalidParamError.createStorageKeySchema({
|
|
1759
|
+
key: `checkoutSessionToken:${transactionId}`,
|
|
1760
|
+
schema: zod_mini.string()
|
|
1761
|
+
});
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
//#endregion
|
|
1765
|
+
//#region src/modules/checkout/utils/createCheckoutApiClient/createCheckoutApiClient.ts
|
|
1766
|
+
const createCheckoutApiClient = async ({ transactionId }, client) => {
|
|
1767
|
+
const core = require_InvalidParamError.getCore(client);
|
|
1768
|
+
const apiClient = require_InvalidParamError.createApiClient({}, client);
|
|
1769
|
+
const sessionToken = await core.storage.getItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
1770
|
+
if (!sessionToken) throw new CheckoutSessionTokenMissingError({ transactionId });
|
|
1771
|
+
return {
|
|
1772
|
+
apiClient,
|
|
1773
|
+
environmentId: core.environmentId,
|
|
1774
|
+
sessionToken
|
|
1775
|
+
};
|
|
1776
|
+
};
|
|
1777
|
+
|
|
1778
|
+
//#endregion
|
|
1779
|
+
//#region src/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.ts
|
|
1780
|
+
/**
|
|
1781
|
+
* Attaches a wallet source to a checkout transaction
|
|
1782
|
+
*
|
|
1783
|
+
* @param params AttachCheckoutTransactionSourceParams - The source details to attach.
|
|
1784
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1785
|
+
* @returns The updated checkout transaction
|
|
1786
|
+
*/
|
|
1787
|
+
const attachCheckoutTransactionSource = async ({ fromAddress, fromChainId, transactionId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1788
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1789
|
+
return apiClient.attachSource({
|
|
1790
|
+
attachSourceRequest: {
|
|
1791
|
+
fromAddress,
|
|
1792
|
+
fromChainId,
|
|
1793
|
+
sourceType: "wallet"
|
|
1794
|
+
},
|
|
1795
|
+
environmentId,
|
|
1796
|
+
transactionId,
|
|
1797
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1798
|
+
});
|
|
1799
|
+
};
|
|
1800
|
+
|
|
1801
|
+
//#endregion
|
|
1802
|
+
//#region src/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.ts
|
|
1803
|
+
/**
|
|
1804
|
+
* Records the on-chain broadcast of a checkout transaction
|
|
1805
|
+
*
|
|
1806
|
+
* @param params BroadcastCheckoutTransactionParams - The transaction ID and tx hash.
|
|
1807
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1808
|
+
* @returns The updated checkout transaction
|
|
1809
|
+
*/
|
|
1810
|
+
const broadcastCheckoutTransaction = async ({ transactionId, txHash }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1811
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1812
|
+
return apiClient.recordCheckoutBroadcast({
|
|
1813
|
+
environmentId,
|
|
1814
|
+
recordBroadcastRequest: { txHash },
|
|
1815
|
+
transactionId,
|
|
1816
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1817
|
+
});
|
|
1818
|
+
};
|
|
1819
|
+
|
|
1820
|
+
//#endregion
|
|
1821
|
+
//#region src/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.ts
|
|
1822
|
+
/**
|
|
1823
|
+
* Cancels a checkout transaction before it has been broadcasted
|
|
1824
|
+
*
|
|
1825
|
+
* @param params CancelCheckoutTransactionParams - The transaction to cancel.
|
|
1826
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1827
|
+
* @returns The cancelled checkout transaction
|
|
1828
|
+
*/
|
|
1829
|
+
const cancelCheckoutTransaction = async ({ transactionId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1830
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1831
|
+
const result = await apiClient.cancelCheckoutTransaction({
|
|
1832
|
+
environmentId,
|
|
1833
|
+
transactionId,
|
|
1834
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1835
|
+
});
|
|
1836
|
+
await require_InvalidParamError.getCore(client).storage.removeItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
1837
|
+
return result;
|
|
1838
|
+
};
|
|
1839
|
+
|
|
1840
|
+
//#endregion
|
|
1841
|
+
//#region src/modules/checkout/createCheckoutTransaction/createCheckoutTransaction.ts
|
|
1842
|
+
/**
|
|
1843
|
+
* Creates a new checkout transaction and stores the session token for subsequent calls
|
|
1844
|
+
*
|
|
1845
|
+
* @param params CreateCheckoutTransactionParams - The parameters for the checkout transaction.
|
|
1846
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1847
|
+
* @returns The created transaction with session token
|
|
1848
|
+
*/
|
|
1849
|
+
const createCheckoutTransaction = async (params, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1850
|
+
const core = require_InvalidParamError.getCore(client);
|
|
1851
|
+
const result = await require_InvalidParamError.createApiClient({}, client).createCheckoutTransaction({
|
|
1852
|
+
checkoutId: params.checkoutId,
|
|
1853
|
+
checkoutTransactionCreateRequest: {
|
|
1854
|
+
amount: params.amount,
|
|
1855
|
+
currency: params.currency,
|
|
1856
|
+
expiresIn: params.expiresIn,
|
|
1857
|
+
externalId: params.externalId
|
|
1858
|
+
},
|
|
1859
|
+
environmentId: core.environmentId
|
|
1860
|
+
});
|
|
1861
|
+
await core.storage.setItem(createCheckoutSessionTokenStorageKey(result.transaction.id), result.sessionToken);
|
|
1862
|
+
return result;
|
|
1863
|
+
};
|
|
1864
|
+
|
|
1865
|
+
//#endregion
|
|
1866
|
+
//#region src/modules/checkout/getCheckoutTransaction/getCheckoutTransaction.ts
|
|
1867
|
+
/**
|
|
1868
|
+
* Fetches the current state of a checkout transaction
|
|
1869
|
+
*
|
|
1870
|
+
* @param params GetCheckoutTransactionParams - The parameters for fetching the transaction.
|
|
1871
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1872
|
+
* @returns The checkout transaction
|
|
1873
|
+
*/
|
|
1874
|
+
const getCheckoutTransaction = async ({ transactionId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1875
|
+
const core = require_InvalidParamError.getCore(client);
|
|
1876
|
+
return require_InvalidParamError.createApiClient({}, client).getCheckoutTransaction({
|
|
1877
|
+
environmentId: core.environmentId,
|
|
1878
|
+
transactionId
|
|
1879
|
+
});
|
|
1880
|
+
};
|
|
1881
|
+
|
|
1882
|
+
//#endregion
|
|
1883
|
+
//#region src/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.ts
|
|
1884
|
+
/**
|
|
1885
|
+
* Fetches a quote for a checkout transaction
|
|
1886
|
+
*
|
|
1887
|
+
* @param params GetCheckoutTransactionQuoteParams - The quote parameters.
|
|
1888
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1889
|
+
* @returns The updated checkout transaction with quote data
|
|
1890
|
+
*/
|
|
1891
|
+
const getCheckoutTransactionQuote = async ({ fromTokenAddress, slippage, toTokenAddress, transactionId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1892
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1893
|
+
return apiClient.quoteCheckoutTransaction({
|
|
1894
|
+
environmentId,
|
|
1895
|
+
quoteRequest: {
|
|
1896
|
+
fromTokenAddress,
|
|
1897
|
+
slippage,
|
|
1898
|
+
toTokenAddress
|
|
1899
|
+
},
|
|
1900
|
+
transactionId,
|
|
1901
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1902
|
+
});
|
|
1903
|
+
};
|
|
1904
|
+
|
|
1905
|
+
//#endregion
|
|
1906
|
+
//#region src/modules/checkout/prepareCheckoutTransaction/prepareCheckoutTransaction.ts
|
|
1907
|
+
/**
|
|
1908
|
+
* Prepares a checkout transaction for signing
|
|
1909
|
+
* This should be called immediately before triggering the transaction signing.
|
|
1910
|
+
* It will confirm the quote is still valid, the risk state is cleared, and the transaction is ready to be signed.
|
|
1911
|
+
*
|
|
1912
|
+
* @param params PrepareCheckoutTransactionParams - The transaction to prepare.
|
|
1913
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1914
|
+
* @returns The updated checkout transaction
|
|
1915
|
+
*/
|
|
1916
|
+
const prepareCheckoutTransaction = async ({ transactionId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1917
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1918
|
+
return apiClient.prepareCheckoutTransaction({
|
|
1919
|
+
environmentId,
|
|
1920
|
+
transactionId,
|
|
1921
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1922
|
+
});
|
|
1923
|
+
};
|
|
1924
|
+
|
|
1925
|
+
//#endregion
|
|
1926
|
+
//#region src/modules/wallets/utils/assertWalletProviderMethodDefined/assertWalletProviderMethodDefined.ts
|
|
1927
|
+
/**
|
|
1928
|
+
* Asserts that a specific wallet provider method is defined, throwing an error if it's not.
|
|
1929
|
+
* This function acts as a type guard, narrowing the type to ensure the method exists.
|
|
1930
|
+
*
|
|
1931
|
+
* @template T - The specific wallet provider method key being checked
|
|
1932
|
+
* @param walletProvider - The wallet provider object to check
|
|
1933
|
+
* @param methodName - The name of the method to check for availability
|
|
1934
|
+
* @throws Throws WalletProviderMethodUnavailableError if the method is not defined
|
|
1935
|
+
* @example
|
|
1936
|
+
* ```typescript
|
|
1937
|
+
* const walletProvider: WalletProvider = getWalletProvider();
|
|
1938
|
+
* assertWalletProviderMethodDefined(walletProvider, 'connect');
|
|
1939
|
+
* // walletProvider.connect is now guaranteed to be defined
|
|
1940
|
+
* await walletProvider.connect();
|
|
1941
|
+
* ```
|
|
1942
|
+
*/
|
|
1943
|
+
function assertWalletProviderMethodDefined(walletProvider, methodName) {
|
|
1944
|
+
if (walletProvider[methodName] === void 0) throw new WalletProviderMethodUnavailableError({
|
|
1945
|
+
methodName,
|
|
1946
|
+
walletProviderKey: walletProvider.key
|
|
1947
|
+
});
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
//#endregion
|
|
1951
|
+
//#region src/modules/checkout/submitCheckoutTransaction/submitCheckoutTransaction.ts
|
|
1952
|
+
/**
|
|
1953
|
+
* Prepares, signs, and broadcasts a checkout transaction in one call.
|
|
1954
|
+
*
|
|
1955
|
+
* Orchestrates the full submission flow:
|
|
1956
|
+
* 1. Calls prepareCheckoutTransaction to advance to signing state and lock the quote
|
|
1957
|
+
* 2. Ensures the wallet is on the correct network for the transaction
|
|
1958
|
+
* 3. Delegates on-chain signing to the wallet provider's executeCheckoutTransaction method
|
|
1959
|
+
* 4. Calls broadcastCheckoutTransaction with the resulting txHash
|
|
1960
|
+
*
|
|
1961
|
+
* @param params SubmitCheckoutTransactionParams - The transaction ID, wallet account, and optional step callback.
|
|
1962
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1963
|
+
* @returns The broadcasted checkout transaction
|
|
1964
|
+
*/
|
|
1965
|
+
const submitCheckoutTransaction = async ({ onStepChange, transactionId, walletAccount }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1966
|
+
const prepared = await prepareCheckoutTransaction({ transactionId }, client);
|
|
1967
|
+
require_InvalidParamError.assertDefined(prepared.signingPayload, "No signing payload returned from prepare — quote may be missing transaction data");
|
|
1968
|
+
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
1969
|
+
assertWalletProviderMethodDefined(walletProvider, "executeCheckoutTransaction");
|
|
1970
|
+
const requiredNetworkId = prepared.signingPayload.chainId;
|
|
1971
|
+
if (requiredNetworkId && walletProvider.switchActiveNetwork) {
|
|
1972
|
+
const { networkId: activeNetworkId } = await walletProvider.getActiveNetworkId();
|
|
1973
|
+
if (activeNetworkId !== requiredNetworkId) await walletProvider.switchActiveNetwork({ networkId: requiredNetworkId });
|
|
1974
|
+
}
|
|
1975
|
+
const { transactionHash } = await walletProvider.executeCheckoutTransaction({
|
|
1976
|
+
onStepChange,
|
|
1977
|
+
signingPayload: prepared.signingPayload,
|
|
1978
|
+
walletAccount
|
|
1979
|
+
});
|
|
1980
|
+
return broadcastCheckoutTransaction({
|
|
1981
|
+
transactionId,
|
|
1982
|
+
txHash: transactionHash
|
|
1983
|
+
}, client);
|
|
1984
|
+
};
|
|
1985
|
+
|
|
1726
1986
|
//#endregion
|
|
1727
1987
|
//#region src/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.ts
|
|
1728
1988
|
const DEVICE_REGISTRATION_TOKEN_HEADER = "x-dynamic-device-registration-token";
|
|
@@ -1777,6 +2037,23 @@ const detectDeviceRegistrationRedirect = ({ url }) => {
|
|
|
1777
2037
|
}
|
|
1778
2038
|
};
|
|
1779
2039
|
|
|
2040
|
+
//#endregion
|
|
2041
|
+
//#region src/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.ts
|
|
2042
|
+
const getRegisteredDevices = async (client = require_InvalidParamError.getDefaultClient()) => {
|
|
2043
|
+
const core = require_InvalidParamError.getCore(client);
|
|
2044
|
+
const apiClient = require_InvalidParamError.createApiClient({}, client);
|
|
2045
|
+
try {
|
|
2046
|
+
return (await apiClient.listDeviceRegistrations({ environmentId: core.environmentId })).deviceRegistrations;
|
|
2047
|
+
} catch (error) {
|
|
2048
|
+
/**
|
|
2049
|
+
* The API will return 401 when no devices are registered when there are no
|
|
2050
|
+
* devices registered. We need to handle this case gracefully.
|
|
2051
|
+
*/
|
|
2052
|
+
if (error instanceof require_InvalidParamError.UnauthorizedError) return [];
|
|
2053
|
+
throw error;
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
|
|
1780
2057
|
//#endregion
|
|
1781
2058
|
//#region src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts
|
|
1782
2059
|
/**
|
|
@@ -1793,6 +2070,26 @@ const isDeviceRegistrationRequired = (client = require_InvalidParamError.getDefa
|
|
|
1793
2070
|
return Boolean(user.scope?.includes("device:register"));
|
|
1794
2071
|
};
|
|
1795
2072
|
|
|
2073
|
+
//#endregion
|
|
2074
|
+
//#region src/modules/deviceRegistration/revokeAllRegisteredDevices/revokeAllRegisteredDevices.ts
|
|
2075
|
+
const revokeAllRegisteredDevices = async (client = require_InvalidParamError.getDefaultClient()) => {
|
|
2076
|
+
const core = require_InvalidParamError.getCore(client);
|
|
2077
|
+
await require_InvalidParamError.createApiClient({}, client).deleteAllDeviceRegistrations({ environmentId: core.environmentId });
|
|
2078
|
+
await require_NotWaasWalletAccountError.refreshAuth(client);
|
|
2079
|
+
};
|
|
2080
|
+
|
|
2081
|
+
//#endregion
|
|
2082
|
+
//#region src/modules/deviceRegistration/revokeRegisteredDevice/revokeRegisteredDevice.ts
|
|
2083
|
+
const revokeRegisteredDevice = async ({ deviceRegistrationId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2084
|
+
require_InvalidParamError.assertDefined(deviceRegistrationId, "deviceRegistrationId is required");
|
|
2085
|
+
const core = require_InvalidParamError.getCore(client);
|
|
2086
|
+
await require_InvalidParamError.createApiClient({}, client).deleteDeviceRegistration({
|
|
2087
|
+
deviceRegistrationId,
|
|
2088
|
+
environmentId: core.environmentId
|
|
2089
|
+
});
|
|
2090
|
+
await require_NotWaasWalletAccountError.refreshAuth(client);
|
|
2091
|
+
};
|
|
2092
|
+
|
|
1796
2093
|
//#endregion
|
|
1797
2094
|
//#region src/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/addCoinbaseOnrampOrderEventListener.ts
|
|
1798
2095
|
/**
|
|
@@ -2092,7 +2389,7 @@ const fetchWithTimeout = async (client) => {
|
|
|
2092
2389
|
/**
|
|
2093
2390
|
* The schema to store the cached wallet book data.
|
|
2094
2391
|
*/
|
|
2095
|
-
const walletBookCacheStorageKeySchema =
|
|
2392
|
+
const walletBookCacheStorageKeySchema = require_InvalidParamError.createStorageKeySchema({
|
|
2096
2393
|
key: "legacyWalletBookCache",
|
|
2097
2394
|
schema: zod_mini.object({
|
|
2098
2395
|
groups: zod_mini.record(zod_mini.string(), zod_mini.any()),
|
|
@@ -2507,10 +2804,12 @@ const acknowledgeRecoveryCodes = async (client = require_InvalidParamError.getDe
|
|
|
2507
2804
|
* one of their backup recovery codes when none of the registered MFA methods are available.
|
|
2508
2805
|
*
|
|
2509
2806
|
* @param params.code - The recovery code to authenticate with.
|
|
2807
|
+
* @param [params.createMfaTokenOptions] - @deprecated Use `requestedScopes` instead. Optional configuration for MFA token creation.
|
|
2808
|
+
* @param [params.requestedScopes] - Optional scopes to request an elevated access token instead of an MFA token.
|
|
2510
2809
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2511
|
-
* @returns A promise that resolves to the MFA authentication response
|
|
2810
|
+
* @returns A promise that resolves to the MFA authentication response.
|
|
2512
2811
|
*/
|
|
2513
|
-
const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2812
|
+
const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions, requestedScopes }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2514
2813
|
const core = require_InvalidParamError.getCore(client);
|
|
2515
2814
|
const apiClient = require_InvalidParamError.createApiClient({}, client);
|
|
2516
2815
|
try {
|
|
@@ -2518,7 +2817,8 @@ const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions }, clie
|
|
|
2518
2817
|
environmentId: core.environmentId,
|
|
2519
2818
|
mFAAuthRecoveryDevicePostRequest: {
|
|
2520
2819
|
code,
|
|
2521
|
-
createMfaToken: createMfaTokenOptions
|
|
2820
|
+
createMfaToken: createMfaTokenOptions,
|
|
2821
|
+
requestedScopes
|
|
2522
2822
|
}
|
|
2523
2823
|
});
|
|
2524
2824
|
require_getVerifiedCredentialForWalletAccount.updateAuthFromVerifyResponse({ response }, client);
|
|
@@ -2548,13 +2848,14 @@ const getPasskeyAuthenticationOptions = async ({ relatedOriginRpId } = {}, clien
|
|
|
2548
2848
|
|
|
2549
2849
|
//#endregion
|
|
2550
2850
|
//#region src/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.ts
|
|
2551
|
-
const serverAuthenticatePasskey = async ({ authentication, createMfaToken }, client) => {
|
|
2851
|
+
const serverAuthenticatePasskey = async ({ authentication, createMfaToken, requestedScopes }, client) => {
|
|
2552
2852
|
const core = require_InvalidParamError.getCore(client);
|
|
2553
2853
|
return await require_InvalidParamError.createApiClient({}, client).authenticateMfaPasskeyDevice({
|
|
2554
2854
|
environmentId: core.environmentId,
|
|
2555
2855
|
passkeyAuthRequest: {
|
|
2556
2856
|
...authentication,
|
|
2557
2857
|
createMfaToken,
|
|
2858
|
+
requestedScopes,
|
|
2558
2859
|
response: {
|
|
2559
2860
|
...authentication.response,
|
|
2560
2861
|
clientDataJson: authentication.response.clientDataJSON
|
|
@@ -2571,13 +2872,14 @@ const serverAuthenticatePasskey = async ({ authentication, createMfaToken }, cli
|
|
|
2571
2872
|
* This function prompts the user to authenticate with their registered
|
|
2572
2873
|
* passkey to complete an MFA challenge and obtain an MFA token.
|
|
2573
2874
|
*
|
|
2574
|
-
* @param [params.createMfaToken] - Optional configuration for MFA token creation.
|
|
2875
|
+
* @param [params.createMfaToken] - @deprecated Use `requestedScopes` instead. Optional configuration for MFA token creation.
|
|
2876
|
+
* @param [params.requestedScopes] - Optional scopes to request an elevated access token instead of an MFA token.
|
|
2575
2877
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2576
2878
|
* @returns A promise that resolves to the MFA authentication response.
|
|
2577
2879
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
2578
2880
|
* @throws NoPasskeyCredentialsFoundError If no passkey credentials are found.
|
|
2579
2881
|
*/
|
|
2580
|
-
const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId } = {}, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2882
|
+
const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId, requestedScopes } = {}, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2581
2883
|
const core = require_InvalidParamError.getCore(client);
|
|
2582
2884
|
try {
|
|
2583
2885
|
if (!core.passkey.isSupported()) throw new NoWebAuthNSupportError();
|
|
@@ -2593,7 +2895,8 @@ const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId } = {}
|
|
|
2593
2895
|
};
|
|
2594
2896
|
const response = await serverAuthenticatePasskey({
|
|
2595
2897
|
authentication: await core.passkey.authenticate({ optionsJSON: formattedOptions }),
|
|
2596
|
-
createMfaToken
|
|
2898
|
+
createMfaToken,
|
|
2899
|
+
requestedScopes
|
|
2597
2900
|
}, client);
|
|
2598
2901
|
require_getVerifiedCredentialForWalletAccount.updateAuthFromVerifyResponse({ response }, client);
|
|
2599
2902
|
require_getVerifiedCredentialForWalletAccount.emitEvent({
|
|
@@ -2620,11 +2923,12 @@ const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId } = {}
|
|
|
2620
2923
|
*
|
|
2621
2924
|
* @param params.code - The 6-digit TOTP code from the authenticator app.
|
|
2622
2925
|
* @param [params.deviceId] - The ID of the specific TOTP device to authenticate with.
|
|
2623
|
-
* @param [params.createMfaTokenOptions] - Optional configuration for MFA token creation.
|
|
2926
|
+
* @param [params.createMfaTokenOptions] - @deprecated Use `requestedScopes` instead. Optional configuration for MFA token creation.
|
|
2927
|
+
* @param [params.requestedScopes] - Optional scopes to request an elevated access token instead of an MFA token.
|
|
2624
2928
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2625
2929
|
* @returns A promise that resolves to the MFA authentication response.
|
|
2626
2930
|
*/
|
|
2627
|
-
const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2931
|
+
const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions, requestedScopes }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2628
2932
|
const core = require_InvalidParamError.getCore(client);
|
|
2629
2933
|
const apiClient = require_InvalidParamError.createApiClient({}, client);
|
|
2630
2934
|
try {
|
|
@@ -2633,7 +2937,8 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
2633
2937
|
mFAAuthTotpDevicePostRequest: {
|
|
2634
2938
|
code,
|
|
2635
2939
|
createMfaToken: createMfaTokenOptions,
|
|
2636
|
-
id: deviceId
|
|
2940
|
+
id: deviceId,
|
|
2941
|
+
requestedScopes
|
|
2637
2942
|
}
|
|
2638
2943
|
});
|
|
2639
2944
|
require_getVerifiedCredentialForWalletAccount.updateAuthFromVerifyResponse({ response }, client);
|
|
@@ -3935,29 +4240,27 @@ const assertWalletAccountSigningAvailability = async ({ walletAccount }, client
|
|
|
3935
4240
|
};
|
|
3936
4241
|
|
|
3937
4242
|
//#endregion
|
|
3938
|
-
//#region src/
|
|
4243
|
+
//#region src/utils/isMobile/isMobile.ts
|
|
3939
4244
|
/**
|
|
3940
|
-
*
|
|
3941
|
-
* This function acts as a type guard, narrowing the type to ensure the method exists.
|
|
3942
|
-
*
|
|
3943
|
-
* @template T - The specific wallet provider method key being checked
|
|
3944
|
-
* @param walletProvider - The wallet provider object to check
|
|
3945
|
-
* @param methodName - The name of the method to check for availability
|
|
3946
|
-
* @throws Throws WalletProviderMethodUnavailableError if the method is not defined
|
|
3947
|
-
* @example
|
|
3948
|
-
* ```typescript
|
|
3949
|
-
* const walletProvider: WalletProvider = getWalletProvider();
|
|
3950
|
-
* assertWalletProviderMethodDefined(walletProvider, 'connect');
|
|
3951
|
-
* // walletProvider.connect is now guaranteed to be defined
|
|
3952
|
-
* await walletProvider.connect();
|
|
3953
|
-
* ```
|
|
4245
|
+
* Sourced from http://detectmobilebrowsers.com/
|
|
3954
4246
|
*/
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
}
|
|
4247
|
+
const userAgentRegex1 = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ios|ipad|playbook|silk/i;
|
|
4248
|
+
const userAgentRegex2 = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;
|
|
4249
|
+
const isMobile = (maxTouchPointsOverride) => {
|
|
4250
|
+
if (typeof window === "undefined" || typeof navigator === "undefined") return false;
|
|
4251
|
+
return userAgentRegex1.test(navigator.userAgent) || userAgentRegex2.test(navigator.userAgent.substring(0, 4)) || isIPad(maxTouchPointsOverride) || isIPhone();
|
|
4252
|
+
};
|
|
4253
|
+
const isIPhone = () => typeof window === "undefined" || typeof navigator === "undefined" ? false : /iPhone|ios/.test(navigator.userAgent);
|
|
4254
|
+
/**
|
|
4255
|
+
* @param [optional] maxTouchPointsOverride - this is used for testing since
|
|
4256
|
+
* it seems that JSDOM doesn't support maxTouchPoints, so it was impossible
|
|
4257
|
+
* to mock it
|
|
4258
|
+
*/
|
|
4259
|
+
const isIPad = (maxTouchPointsOverride) => {
|
|
4260
|
+
if (typeof window === "undefined" || typeof navigator === "undefined") return false;
|
|
4261
|
+
const maxTouchPoints = maxTouchPointsOverride || navigator.maxTouchPoints;
|
|
4262
|
+
return /iPad/.test(navigator.userAgent) || /Mac/.test(navigator.userAgent) && maxTouchPoints === 5;
|
|
4263
|
+
};
|
|
3961
4264
|
|
|
3962
4265
|
//#endregion
|
|
3963
4266
|
//#region src/modules/wallets/utils/getAddressesWithTypesFromConnectionResult/getAddressesWithTypesFromConnectionResult.ts
|
|
@@ -4049,7 +4352,7 @@ const getSignInMessage = async ({ walletAccount }, client) => {
|
|
|
4049
4352
|
require_InvalidParamError.assertDefined(universalLink, "Universal link is not set");
|
|
4050
4353
|
const url = new URL(universalLink);
|
|
4051
4354
|
const domain = url.host;
|
|
4052
|
-
const nonce = await
|
|
4355
|
+
const nonce = await require_InvalidParamError.getNonce(client);
|
|
4053
4356
|
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
4054
4357
|
if (walletProvider.chain === "STARK")
|
|
4055
4358
|
/**
|
|
@@ -4167,6 +4470,13 @@ const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client =
|
|
|
4167
4470
|
}, client);
|
|
4168
4471
|
};
|
|
4169
4472
|
|
|
4473
|
+
//#endregion
|
|
4474
|
+
//#region src/modules/wallets/walletProvider/isDeeplinkWalletProvider/isDeeplinkWalletProvider.ts
|
|
4475
|
+
/**
|
|
4476
|
+
* Returns true if the wallet provider uses the deep link protocol (e.g. Phantom redirect on mobile).
|
|
4477
|
+
*/
|
|
4478
|
+
const isDeeplinkWalletProvider = ({ walletProvider }) => walletProvider.walletProviderType === _dynamic_labs_sdk_api_core.WalletProviderEnum.DeepLink;
|
|
4479
|
+
|
|
4170
4480
|
//#endregion
|
|
4171
4481
|
//#region src/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.ts
|
|
4172
4482
|
/**
|
|
@@ -4176,12 +4486,24 @@ const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client =
|
|
|
4176
4486
|
* requiring the user to sign a message to prove wallet ownership before
|
|
4177
4487
|
* the wallet account is added to their profile.
|
|
4178
4488
|
*
|
|
4489
|
+
* @throws {DeeplinkConnectAndVerifyUnsupportedError} On mobile with deep link
|
|
4490
|
+
* wallet providers (e.g. Phantom redirect). This function triggers two sequential
|
|
4491
|
+
* deeplinks — one to connect and another to sign for verification. iOS will not
|
|
4492
|
+
* honor the second deeplink because it is no longer tied to a user gesture.
|
|
4493
|
+
* Android may handle sequential deeplinks differently, but this guard applies to
|
|
4494
|
+
* all mobile platforms to ensure a stable experience and prevent production-only
|
|
4495
|
+
* errors. Use `connectWithWalletProvider` first and then invoke
|
|
4496
|
+
* `verifyWalletAccount` separately from a new user gesture (e.g. a "Verify
|
|
4497
|
+
* Ownership" button).
|
|
4498
|
+
*
|
|
4179
4499
|
* @param params.walletProviderKey - The unique key identifying the wallet provider to connect to.
|
|
4180
4500
|
* @param [params.hardwareWalletVendor] - The hardware wallet vendor, if connecting via a hardware wallet (e.g. 'ledger').
|
|
4181
4501
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4182
4502
|
* @returns A promise that resolves to the connected and verified wallet account.
|
|
4183
4503
|
*/
|
|
4184
4504
|
const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareWalletVendor }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
4505
|
+
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey }, client);
|
|
4506
|
+
if (isMobile() && isDeeplinkWalletProvider({ walletProvider })) throw new DeeplinkConnectAndVerifyUnsupportedError({ walletProviderKey });
|
|
4185
4507
|
const walletAccount = await connectWithWalletProvider({
|
|
4186
4508
|
addToDynamicWalletAccounts: false,
|
|
4187
4509
|
hardwareWalletVendor,
|
|
@@ -4553,6 +4875,34 @@ const signMessage = async ({ walletAccount, message }, client = require_InvalidP
|
|
|
4553
4875
|
return { signature };
|
|
4554
4876
|
};
|
|
4555
4877
|
|
|
4878
|
+
//#endregion
|
|
4879
|
+
//#region src/modules/wallets/transferAmount/transferAmount.ts
|
|
4880
|
+
/**
|
|
4881
|
+
* Transfers an amount of currency from the wallet account to a recipient.
|
|
4882
|
+
*
|
|
4883
|
+
* Supports native token transfers and, where supported by the chain,
|
|
4884
|
+
* fungible/token transfers via the optional `token` parameter.
|
|
4885
|
+
*
|
|
4886
|
+
* @param params.walletAccount - The wallet account to transfer from.
|
|
4887
|
+
* @param params.amount - The amount to transfer as a decimal string (e.g. "1.5").
|
|
4888
|
+
* @param params.recipient - The recipient address.
|
|
4889
|
+
* @param params.token - Optional token info for non-native transfers.
|
|
4890
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4891
|
+
* @returns A promise that resolves to an object containing the transaction hash.
|
|
4892
|
+
* @throws If the wallet provider does not support the transfer amount method.
|
|
4893
|
+
*/
|
|
4894
|
+
const transferAmount = async ({ walletAccount, amount, recipient, token }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
4895
|
+
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
4896
|
+
assertWalletProviderMethodDefined(walletProvider, "transferAmount");
|
|
4897
|
+
const { transactionHash } = await walletProvider.transferAmount({
|
|
4898
|
+
amount,
|
|
4899
|
+
recipient,
|
|
4900
|
+
token,
|
|
4901
|
+
walletAccount
|
|
4902
|
+
});
|
|
4903
|
+
return { transactionHash };
|
|
4904
|
+
};
|
|
4905
|
+
|
|
4556
4906
|
//#endregion
|
|
4557
4907
|
//#region src/modules/wallets/transferWalletAccount/transferWalletAccount.ts
|
|
4558
4908
|
/**
|
|
@@ -4631,26 +4981,71 @@ const onWalletProviderEvent = ({ callback, event, walletProviderKey }, client =
|
|
|
4631
4981
|
};
|
|
4632
4982
|
|
|
4633
4983
|
//#endregion
|
|
4634
|
-
//#region src/utils/
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
}
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4984
|
+
//#region src/utils/getDeviceNameFromUserAgent/getDeviceNameFromUserAgent.ts
|
|
4985
|
+
const browserMatchers = [
|
|
4986
|
+
{
|
|
4987
|
+
name: "Edge",
|
|
4988
|
+
pattern: /Edg(e|A|iOS)?\//
|
|
4989
|
+
},
|
|
4990
|
+
{
|
|
4991
|
+
name: "Opera",
|
|
4992
|
+
pattern: /OPR\/|Opera/
|
|
4993
|
+
},
|
|
4994
|
+
{
|
|
4995
|
+
name: "Samsung Browser",
|
|
4996
|
+
pattern: /SamsungBrowser/
|
|
4997
|
+
},
|
|
4998
|
+
{
|
|
4999
|
+
name: "Firefox",
|
|
5000
|
+
pattern: /Firefox/
|
|
5001
|
+
},
|
|
5002
|
+
{
|
|
5003
|
+
name: "Safari",
|
|
5004
|
+
pattern: /^(?!.*(?:Chrome|Chromium|CriOS)).*Safari/
|
|
5005
|
+
},
|
|
5006
|
+
{
|
|
5007
|
+
name: "Chrome",
|
|
5008
|
+
pattern: /Chrome|CriOS/
|
|
5009
|
+
}
|
|
5010
|
+
];
|
|
5011
|
+
const osMatchers = [
|
|
5012
|
+
{
|
|
5013
|
+
name: "iPhone",
|
|
5014
|
+
pattern: /iPhone/
|
|
5015
|
+
},
|
|
5016
|
+
{
|
|
5017
|
+
name: "iPad",
|
|
5018
|
+
pattern: /iPad/
|
|
5019
|
+
},
|
|
5020
|
+
{
|
|
5021
|
+
name: "Android",
|
|
5022
|
+
pattern: /Android/
|
|
5023
|
+
},
|
|
5024
|
+
{
|
|
5025
|
+
name: "Windows",
|
|
5026
|
+
pattern: /Windows/
|
|
5027
|
+
},
|
|
5028
|
+
{
|
|
5029
|
+
name: "macOS",
|
|
5030
|
+
pattern: /Macintosh|Mac OS X/
|
|
5031
|
+
},
|
|
5032
|
+
{
|
|
5033
|
+
name: "Linux",
|
|
5034
|
+
pattern: /Linux/
|
|
5035
|
+
},
|
|
5036
|
+
{
|
|
5037
|
+
name: "ChromeOS",
|
|
5038
|
+
pattern: /CrOS/
|
|
5039
|
+
}
|
|
5040
|
+
];
|
|
5041
|
+
const getDeviceNameFromUserAgent = ({ userAgent }) => {
|
|
5042
|
+
if (!userAgent) return null;
|
|
5043
|
+
const browser = browserMatchers.find(({ pattern }) => pattern.test(userAgent))?.name;
|
|
5044
|
+
const os = osMatchers.find(({ pattern }) => pattern.test(userAgent))?.name;
|
|
5045
|
+
if (browser && os) return `${browser} on ${os}`;
|
|
5046
|
+
if (browser) return browser;
|
|
5047
|
+
if (os) return os;
|
|
5048
|
+
return null;
|
|
4654
5049
|
};
|
|
4655
5050
|
|
|
4656
5051
|
//#endregion
|
|
@@ -4659,7 +5054,9 @@ const isIPad = (maxTouchPointsOverride) => {
|
|
|
4659
5054
|
|
|
4660
5055
|
//#endregion
|
|
4661
5056
|
exports.BaseError = require_InvalidParamError.BaseError;
|
|
5057
|
+
exports.CheckoutSessionTokenMissingError = CheckoutSessionTokenMissingError;
|
|
4662
5058
|
exports.ClientAlreadyInitializedError = ClientAlreadyInitializedError;
|
|
5059
|
+
exports.DeeplinkConnectAndVerifyUnsupportedError = DeeplinkConnectAndVerifyUnsupportedError;
|
|
4663
5060
|
exports.FeeEstimationFailedError = FeeEstimationFailedError;
|
|
4664
5061
|
exports.InvalidDeviceRegistrationRedirectError = InvalidDeviceRegistrationRedirectError;
|
|
4665
5062
|
exports.InvalidExternalAuthError = require_InvalidParamError.InvalidExternalAuthError;
|
|
@@ -4688,6 +5085,7 @@ exports.NoWebAuthNSupportError = NoWebAuthNSupportError;
|
|
|
4688
5085
|
exports.NotWaasWalletAccountError = require_NotWaasWalletAccountError.NotWaasWalletAccountError;
|
|
4689
5086
|
exports.SandboxMaximumThresholdReachedError = require_InvalidParamError.SandboxMaximumThresholdReachedError;
|
|
4690
5087
|
exports.SimulationFailedError = SimulationFailedError;
|
|
5088
|
+
exports.UnauthorizedError = require_InvalidParamError.UnauthorizedError;
|
|
4691
5089
|
exports.UnavailableInServerSideError = UnavailableInServerSideError;
|
|
4692
5090
|
exports.UnrecognizedNetworkError = UnrecognizedNetworkError;
|
|
4693
5091
|
exports.UserNotAuthenticatedError = UserNotAuthenticatedError;
|
|
@@ -4701,16 +5099,20 @@ exports.addCoinbaseOnrampOrderEventListener = addCoinbaseOnrampOrderEventListene
|
|
|
4701
5099
|
exports.addNetwork = addNetwork;
|
|
4702
5100
|
exports.assertWalletAccountSigningAvailability = assertWalletAccountSigningAvailability;
|
|
4703
5101
|
exports.assertWalletProviderMethodDefined = assertWalletProviderMethodDefined;
|
|
5102
|
+
exports.attachCheckoutTransactionSource = attachCheckoutTransactionSource;
|
|
4704
5103
|
exports.authenticateMfaRecoveryCode = authenticateMfaRecoveryCode;
|
|
4705
5104
|
exports.authenticatePasskeyMFA = authenticatePasskeyMFA;
|
|
4706
5105
|
exports.authenticateTotpMfaDevice = authenticateTotpMfaDevice;
|
|
4707
5106
|
exports.authenticateWithSocial = authenticateWithSocial;
|
|
5107
|
+
exports.broadcastCheckoutTransaction = broadcastCheckoutTransaction;
|
|
4708
5108
|
exports.canConnectWithHardwareWallet = canConnectWithHardwareWallet;
|
|
5109
|
+
exports.cancelCheckoutTransaction = cancelCheckoutTransaction;
|
|
4709
5110
|
exports.completeDeviceRegistration = completeDeviceRegistration;
|
|
4710
5111
|
exports.completeSocialAuthentication = completeSocialAuthentication;
|
|
4711
5112
|
exports.connectAndVerifyWithWalletProvider = connectAndVerifyWithWalletProvider;
|
|
4712
5113
|
exports.connectWithWalletProvider = connectWithWalletProvider;
|
|
4713
5114
|
exports.consumeMfaToken = require_isMfaRequiredForAction.consumeMfaToken;
|
|
5115
|
+
exports.createCheckoutTransaction = createCheckoutTransaction;
|
|
4714
5116
|
exports.createCoinbaseOnrampOrder = createCoinbaseOnrampOrder;
|
|
4715
5117
|
exports.createCryptoDotComPayment = createCryptoDotComPayment;
|
|
4716
5118
|
exports.createDynamicClient = createDynamicClient;
|
|
@@ -4727,9 +5129,12 @@ exports.getActiveNetworkId = getActiveNetworkId;
|
|
|
4727
5129
|
exports.getAvailableWalletProvidersData = getAvailableWalletProvidersData;
|
|
4728
5130
|
exports.getBalance = getBalance;
|
|
4729
5131
|
exports.getBalanceForAddress = getBalanceForAddress;
|
|
5132
|
+
exports.getCheckoutTransaction = getCheckoutTransaction;
|
|
5133
|
+
exports.getCheckoutTransactionQuote = getCheckoutTransactionQuote;
|
|
4730
5134
|
exports.getCoinbaseBuyUrl = getCoinbaseBuyUrl;
|
|
4731
5135
|
exports.getConnectedAddresses = getConnectedAddresses;
|
|
4732
5136
|
exports.getDefaultClient = require_InvalidParamError.getDefaultClient;
|
|
5137
|
+
exports.getDeviceNameFromUserAgent = getDeviceNameFromUserAgent;
|
|
4733
5138
|
exports.getDeviceRegistrationTokenFromUrl = getDeviceRegistrationTokenFromUrl;
|
|
4734
5139
|
exports.getElevatedAccessToken = getElevatedAccessToken;
|
|
4735
5140
|
exports.getKrakenAccounts = getKrakenAccounts;
|
|
@@ -4743,6 +5148,7 @@ exports.getNetworksData = require_getNetworkProviderFromNetworkId.getNetworksDat
|
|
|
4743
5148
|
exports.getOwnerWalletAccountForSmartWalletAccount = getOwnerWalletAccountForSmartWalletAccount;
|
|
4744
5149
|
exports.getPasskeys = getPasskeys;
|
|
4745
5150
|
exports.getPrimaryWalletAccount = getPrimaryWalletAccount;
|
|
5151
|
+
exports.getRegisteredDevices = getRegisteredDevices;
|
|
4746
5152
|
exports.getTransactionHistory = getTransactionHistory;
|
|
4747
5153
|
exports.getUserSocialAccounts = getUserSocialAccounts;
|
|
4748
5154
|
exports.getWalletAccountAddressByType = getWalletAccountAddressByType;
|
|
@@ -4754,6 +5160,7 @@ exports.getWalletProviderDataByKey = getWalletProviderDataByKey;
|
|
|
4754
5160
|
exports.hasExtension = require_getNetworkProviderFromNetworkId.hasExtension;
|
|
4755
5161
|
exports.initializeClient = initializeClient;
|
|
4756
5162
|
exports.isCaptchaRequired = require_getNetworkProviderFromNetworkId.isCaptchaRequired;
|
|
5163
|
+
exports.isDeeplinkWalletProvider = isDeeplinkWalletProvider;
|
|
4757
5164
|
exports.isDeviceRegistrationRequired = isDeviceRegistrationRequired;
|
|
4758
5165
|
exports.isHardwareWalletAccount = isHardwareWalletAccount;
|
|
4759
5166
|
exports.isMfaRequiredForAction = require_isMfaRequiredForAction.isMfaRequiredForAction;
|
|
@@ -4770,12 +5177,15 @@ exports.offWalletProviderEvent = offWalletProviderEvent;
|
|
|
4770
5177
|
exports.onEvent = require_getVerifiedCredentialForWalletAccount.onEvent;
|
|
4771
5178
|
exports.onWalletProviderEvent = onWalletProviderEvent;
|
|
4772
5179
|
exports.onceEvent = require_getVerifiedCredentialForWalletAccount.onceEvent;
|
|
5180
|
+
exports.prepareCheckoutTransaction = prepareCheckoutTransaction;
|
|
4773
5181
|
exports.proveWalletAccountOwnership = proveWalletAccountOwnership;
|
|
4774
5182
|
exports.refreshAuth = require_NotWaasWalletAccountError.refreshAuth;
|
|
4775
5183
|
exports.refreshUser = refreshUser;
|
|
4776
5184
|
exports.registerPasskey = registerPasskey;
|
|
4777
5185
|
exports.registerTotpMfaDevice = registerTotpMfaDevice;
|
|
4778
5186
|
exports.removeWalletAccount = removeWalletAccount;
|
|
5187
|
+
exports.revokeAllRegisteredDevices = revokeAllRegisteredDevices;
|
|
5188
|
+
exports.revokeRegisteredDevice = revokeRegisteredDevice;
|
|
4779
5189
|
exports.selectPrimaryWalletAccount = selectPrimaryWalletAccount;
|
|
4780
5190
|
exports.sendEmailOTP = sendEmailOTP;
|
|
4781
5191
|
exports.sendSmsOTP = sendSmsOTP;
|
|
@@ -4784,8 +5194,10 @@ exports.setDefaultMfaDevice = setDefaultMfaDevice;
|
|
|
4784
5194
|
exports.signInWithExternalJwt = signInWithExternalJwt;
|
|
4785
5195
|
exports.signInWithPasskey = signInWithPasskey;
|
|
4786
5196
|
exports.signMessage = signMessage;
|
|
5197
|
+
exports.submitCheckoutTransaction = submitCheckoutTransaction;
|
|
4787
5198
|
exports.supportedCountries = supportedCountries;
|
|
4788
5199
|
exports.switchActiveNetwork = switchActiveNetwork;
|
|
5200
|
+
exports.transferAmount = transferAmount;
|
|
4789
5201
|
exports.transferWalletAccount = transferWalletAccount;
|
|
4790
5202
|
exports.unlinkSocialAccount = unlinkSocialAccount;
|
|
4791
5203
|
exports.updateUser = updateUser;
|