@dynamic-labs-sdk/client 0.24.1 → 0.25.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-B5NwKSKU.native.esm.js +1177 -0
- package/dist/InvalidParamError-B5NwKSKU.native.esm.js.map +1 -0
- package/dist/{InvalidParamError-Bq5zAFj4.esm.js → InvalidParamError-BiVmL7nM.esm.js} +4 -4
- package/dist/InvalidParamError-BiVmL7nM.esm.js.map +1 -0
- package/dist/{InvalidParamError-9IR2C0up.cjs.js → InvalidParamError-D-d-UfBL.cjs.js} +5 -5
- package/dist/InvalidParamError-D-d-UfBL.cjs.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-DpRIY6Pd.cjs.js → NotWaasWalletAccountError-BJaemI4V.cjs.js} +3 -3
- package/dist/{NotWaasWalletAccountError-DpRIY6Pd.cjs.js.map → NotWaasWalletAccountError-BJaemI4V.cjs.js.map} +1 -1
- package/dist/NotWaasWalletAccountError-BX5lUnKT.native.esm.js +50 -0
- package/dist/NotWaasWalletAccountError-BX5lUnKT.native.esm.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-CIJRq-EG.esm.js → NotWaasWalletAccountError-Bo4VhW4n.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-CIJRq-EG.esm.js.map → NotWaasWalletAccountError-Bo4VhW4n.esm.js.map} +1 -1
- package/dist/client/core/createCore/createCore.d.ts.map +1 -1
- package/dist/client/core/types/DynamicCore.d.ts +4 -0
- package/dist/client/core/types/DynamicCore.d.ts.map +1 -1
- package/dist/client/types/DynamicClientConfig.d.ts +10 -0
- package/dist/client/types/DynamicClientConfig.d.ts.map +1 -1
- package/dist/core.cjs.js +5 -5
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.esm.js +5 -5
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +377 -0
- package/dist/core.native.esm.js.map +1 -0
- package/dist/errors/APIError/APIError.d.ts.map +1 -1
- package/dist/errors/InvalidParamError.d.ts.map +1 -1
- package/dist/errors/InvalidStorageValue.d.ts.map +1 -1
- package/dist/errors/InvalidWalletProviderKeyError.d.ts.map +1 -1
- package/dist/errors/MethodNotImplementedError.d.ts.map +1 -1
- package/dist/errors/MissingSocialUrlParamError.d.ts.map +1 -1
- package/dist/errors/NoSmartWalletAccountSignerFoundError.d.ts.map +1 -1
- package/dist/errors/UnavailableInServerSideError.d.ts.map +1 -1
- package/dist/errors/ValueMustBeDefinedError.d.ts.map +1 -1
- package/dist/errors/WalletAccountAlreadyVerifiedError.d.ts.map +1 -1
- package/dist/exports/index.d.ts +4 -4
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-C4aba1hS.esm.js → getNetworkProviderFromNetworkId-5dK99mQR.esm.js} +5 -5
- package/dist/getNetworkProviderFromNetworkId-5dK99mQR.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-COxYamJy.cjs.js → getNetworkProviderFromNetworkId-Cl2XDWo9.cjs.js} +5 -5
- package/dist/getNetworkProviderFromNetworkId-Cl2XDWo9.cjs.js.map +1 -0
- package/dist/getNetworkProviderFromNetworkId-DWOYr3uv.native.esm.js +1302 -0
- package/dist/getNetworkProviderFromNetworkId-DWOYr3uv.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-D7uV3dw0.cjs.js → getSignedSessionId-BbhZjeRt.cjs.js} +3 -3
- package/dist/{getSignedSessionId-D7uV3dw0.cjs.js.map → getSignedSessionId-BbhZjeRt.cjs.js.map} +1 -1
- package/dist/{getSignedSessionId-_vjv5TNw.esm.js → getSignedSessionId-DakTrfSz.esm.js} +3 -3
- package/dist/{getSignedSessionId-_vjv5TNw.esm.js.map → getSignedSessionId-DakTrfSz.esm.js.map} +1 -1
- package/dist/getSignedSessionId-Dk3_TQLq.native.esm.js +67 -0
- package/dist/getSignedSessionId-Dk3_TQLq.native.esm.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-Df_wN20i.cjs.js → getVerifiedCredentialForWalletAccount-BDvkZbtb.cjs.js} +3 -3
- package/dist/getVerifiedCredentialForWalletAccount-BDvkZbtb.cjs.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-Y-aJ2rY7.esm.js → getVerifiedCredentialForWalletAccount-ByUSFAHs.esm.js} +2 -2
- package/dist/getVerifiedCredentialForWalletAccount-ByUSFAHs.esm.js.map +1 -0
- package/dist/getVerifiedCredentialForWalletAccount-Dhqf6Tdl.native.esm.js +783 -0
- package/dist/getVerifiedCredentialForWalletAccount-Dhqf6Tdl.native.esm.js.map +1 -0
- package/dist/index.cjs.js +73 -49
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +73 -49
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +7000 -0
- package/dist/index.native.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-cfGmMd_g.cjs.js → isMfaRequiredForAction-CYrluCK-.cjs.js} +2 -2
- package/dist/{isMfaRequiredForAction-cfGmMd_g.cjs.js.map → isMfaRequiredForAction-CYrluCK-.cjs.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-Cc6jkbY5.esm.js → isMfaRequiredForAction-SFbQW5j5.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-Cc6jkbY5.esm.js.map → isMfaRequiredForAction-SFbQW5j5.esm.js.map} +1 -1
- package/dist/isMfaRequiredForAction-y15A_lhP.native.esm.js +89 -0
- package/dist/isMfaRequiredForAction-y15A_lhP.native.esm.js.map +1 -0
- package/dist/modules/auth/decodeJwt/decodeJwt.d.ts.map +1 -1
- package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts +0 -1
- package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts.map +1 -1
- package/dist/modules/auth/extractSessionId/extractSessionId.d.ts.map +1 -1
- package/dist/modules/auth/initializeAuth/setLongTimeout/setLongTimeout.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/addOAuthUrlParams/addOAuthUrlParams.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/buildOAuthUrl.d.ts.map +1 -1
- package/dist/modules/auth/social/removeDynamicOauthParamsFromUrl/removeDynamicOauthParamsFromUrl.d.ts.map +1 -1
- package/dist/modules/auth/updateAuthFromVerifyResponse/elevatedAccessTokens/normalizeScopes/normalizeScopes.d.ts.map +1 -1
- package/dist/modules/auth/updateAuthFromVerifyResponse/elevatedAccessTokens/parseElevatedAccessToken/parseElevatedAccessToken.d.ts.map +1 -1
- package/dist/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.d.ts +34 -6
- package/dist/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.d.ts.map +1 -1
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts +11 -3
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/checkout.types.d.ts +1 -0
- package/dist/modules/checkout/checkout.types.d.ts.map +1 -1
- package/dist/modules/checkout/trackCheckoutTransaction/trackCheckoutTransaction.d.ts +7 -3
- package/dist/modules/checkout/trackCheckoutTransaction/trackCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.d.ts.map +1 -1
- package/dist/modules/checkout/utils/subscribeToCheckoutTransaction/subscribeToCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/instrumentation/setInstrumentationEnabled/setInstrumentationEnabled.d.ts.map +1 -1
- package/dist/modules/keychainMigration/migrateSessionKeyToKeychain/KeyMigrationError.d.ts.map +1 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWallet/shouldFilterWallet.d.ts.map +1 -1
- package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts +0 -1
- package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts.map +1 -1
- package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts +0 -1
- package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts.map +1 -1
- package/dist/modules/user/updateUser/updateUser.d.ts +0 -1
- package/dist/modules/user/updateUser/updateUser.d.ts.map +1 -1
- package/dist/modules/waas/createWaasClient/createWaasClient.d.ts.map +1 -1
- package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
- package/dist/modules/waas/getWaasChainNameFromChain/getWaasChainNameFromChain.d.ts.map +1 -1
- package/dist/modules/wallets/networks/createBaseNetworkProvider/createBaseNetworkProvider.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getSdkChainFromApiChainName/getSdkChainFromApiChainName.d.ts.map +1 -1
- package/dist/modules/wallets/utils/assertWalletProviderMethodDefined/assertWalletProviderMethodDefined.d.ts.map +1 -1
- package/dist/modules/wallets/utils/getAllProvidersFromWindow/getAllProvidersFromWindow.d.ts.map +1 -1
- package/dist/modules/wallets/utils/getInjectedProviderFromWindow/getInjectedProviderFromWindow.d.ts.map +1 -1
- package/dist/modules/wallets/utils/isSameAddress/isSameAddress.d.ts.map +1 -1
- package/dist/modules/wallets/utils/normalizeAddress/normalizeAddress.d.ts.map +1 -1
- package/dist/modules/wallets/walletProvider/splitWalletProviderKey/splitWalletProviderKey.d.ts.map +1 -1
- package/dist/services/instrumentation/createInstrumentation/createInstrumentation.d.ts.map +1 -1
- package/dist/services/instrumentation/instrumentFunction/extractParams/extractParams.d.ts.map +1 -1
- package/dist/services/keychain/createIndexedDBKeychainService/KeyNotFoundError.d.ts.map +1 -1
- package/dist/services/keychain/createIndexedDBKeychainService/createIndexedDBKeychainService.d.ts.map +1 -1
- package/dist/services/keychain/createIndexedDBKeychainService/utils/deleteIndexedDBItem.d.ts.map +1 -1
- package/dist/services/keychain/createIndexedDBKeychainService/utils/getIndexedDBItem.d.ts.map +1 -1
- package/dist/services/keychain/createIndexedDBKeychainService/utils/setIndexedDBItem.d.ts.map +1 -1
- package/dist/services/logger/createLogger/createLogger.d.ts.map +1 -1
- package/dist/services/realtime/createRealtimeService/createRealtimeService.d.ts.map +1 -1
- package/dist/services/realtime/realtime.types.d.ts +1 -0
- package/dist/services/realtime/realtime.types.d.ts.map +1 -1
- package/dist/services/runtimeServices/createRuntimeServiceAccessKey/createRuntimeServiceAccessKey.d.ts.map +1 -1
- package/dist/services/runtimeServices/createRuntimeServices/createRuntimeServices.d.ts.map +1 -1
- package/dist/services/storage/createStorage/formatForStorage/isValidDateISOString/isValidDateISOString.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/assertDefined/assertDefined.d.ts.map +1 -1
- package/dist/utils/base64UrlDecode/base64UrlDecode.d.ts.map +1 -1
- package/dist/utils/digestSHA256/digestSHA256.d.ts.map +1 -1
- package/dist/utils/getChainFromVerifiedCredentialChain/getChainFromVerifiedCredentialChain.d.ts.map +1 -1
- package/dist/utils/isEqualShallow/isEqualShallow.d.ts.map +1 -1
- package/dist/utils/isErrorWithCode/isErrorWithCode.d.ts.map +1 -1
- package/dist/utils/isMobile/isMobile.d.ts.map +1 -1
- package/dist/utils/observable/createObservableState/createObservableState.d.ts.map +1 -1
- package/dist/utils/observable/subscribeWithSelector/subscribeWithSelector.d.ts.map +1 -1
- package/dist/utils/retryOnFail/InvalidRetryOnFailCallError.d.ts.map +1 -1
- package/dist/utils/setCookie/setCookie.d.ts.map +1 -1
- package/dist/waas.cjs.js +4 -4
- package/dist/waas.esm.js +3 -3
- package/dist/waas.native.esm.js +506 -0
- package/dist/waas.native.esm.js.map +1 -0
- package/dist/waasCore.cjs.js +7 -5
- package/dist/waasCore.cjs.js.map +1 -1
- package/dist/waasCore.esm.js +6 -4
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +253 -0
- package/dist/waasCore.native.esm.js.map +1 -0
- package/package.json +8 -4
- package/dist/InvalidParamError-9IR2C0up.cjs.js.map +0 -1
- package/dist/InvalidParamError-Bq5zAFj4.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-C4aba1hS.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-COxYamJy.cjs.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-Df_wN20i.cjs.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-Y-aJ2rY7.esm.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertDefined.d.ts","sourceRoot":"","sources":["../../../src/utils/assertDefined/assertDefined.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"assertDefined.d.ts","sourceRoot":"","sources":["../../../src/utils/assertDefined/assertDefined.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAIhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base64UrlDecode.d.ts","sourceRoot":"","sources":["../../../src/utils/base64UrlDecode/base64UrlDecode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"base64UrlDecode.d.ts","sourceRoot":"","sources":["../../../src/utils/base64UrlDecode/base64UrlDecode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,eAAe,OAAQ,MAAM,4BAKzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"digestSHA256.d.ts","sourceRoot":"","sources":["../../../src/utils/digestSHA256/digestSHA256.ts"],"names":[],"mappings":"AAAA,wBAAwB;
|
|
1
|
+
{"version":3,"file":"digestSHA256.d.ts","sourceRoot":"","sources":["../../../src/utils/digestSHA256/digestSHA256.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,eAAO,MAAM,YAAY,QAAS,MAAM,yBAIvC,CAAC"}
|
package/dist/utils/getChainFromVerifiedCredentialChain/getChainFromVerifiedCredentialChain.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getChainFromVerifiedCredentialChain.d.ts","sourceRoot":"","sources":["../../../src/utils/getChainFromVerifiedCredentialChain/getChainFromVerifiedCredentialChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAIjD,oBAAoB;
|
|
1
|
+
{"version":3,"file":"getChainFromVerifiedCredentialChain.d.ts","sourceRoot":"","sources":["../../../src/utils/getChainFromVerifiedCredentialChain/getChainFromVerifiedCredentialChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAIjD,oBAAoB;AAEpB,eAAO,MAAM,mCAAmC,4BACrB,MAAM,KAC9B,KAYF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEqualShallow.d.ts","sourceRoot":"","sources":["../../../src/utils/isEqualShallow/isEqualShallow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"isEqualShallow.d.ts","sourceRoot":"","sources":["../../../src/utils/isEqualShallow/isEqualShallow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,cAAc,GAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,YA+CjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isErrorWithCode.d.ts","sourceRoot":"","sources":["../../../src/utils/isErrorWithCode/isErrorWithCode.ts"],"names":[],"mappings":"AAEA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"isErrorWithCode.d.ts","sourceRoot":"","sources":["../../../src/utils/isErrorWithCode/isErrorWithCode.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,MAAM,SACvC,OAAO,QACR,CAAC,KACN,KAAK,IAAI,KAAK,GAAG;IAAE,IAAI,EAAE,CAAC,CAAA;CAI5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMobile.d.ts","sourceRoot":"","sources":["../../../src/utils/isMobile/isMobile.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAQH,wBAAwB;
|
|
1
|
+
{"version":3,"file":"isMobile.d.ts","sourceRoot":"","sources":["../../../src/utils/isMobile/isMobile.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAQH,wBAAwB;AAExB,eAAO,MAAM,QAAQ,4BAA6B,MAAM,YAWvD,CAAC;AAEF,wBAAwB;AAExB,eAAO,MAAM,QAAQ,eAGuB,CAAC;AAE7C,wBAAwB;AAExB,eAAO,MAAM,kBAAkB,eAG6C,CAAC;AAE7E;;;;;GAKG;AAEH,eAAO,MAAM,MAAM,4BAA6B,MAAM,YAWrD,CAAC;AAEF,wBAAwB;AAExB,eAAO,MAAM,KAAK,4BAA6B,MAAM,YAMpD,CAAC;AAEF,wBAAwB;AAExB,eAAO,MAAM,SAAS,eAA+B,CAAC;AAEtD,wBAAwB;AAExB,eAAO,MAAM,cAAc,eAiB1B,CAAC;AAEF,wBAAwB;AAExB,eAAO,MAAM,gBAAgB,eAM5B,CAAC;AAEF,wBAAwB;AAExB,eAAO,MAAM,eAAe,eAa3B,CAAC;AAEF,wBAAwB;AAExB,eAAO,MAAM,SAAS,eAMrB,CAAC;AAsDF,wBAAwB;AAExB,eAAO,MAAM,iBAAiB,0BAgB7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createObservableState.d.ts","sourceRoot":"","sources":["../../../../src/utils/observable/createObservableState/createObservableState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;
|
|
1
|
+
{"version":3,"file":"createObservableState.d.ts","sourceRoot":"","sources":["../../../../src/utils/observable/createObservableState/createObservableState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,mBACpD,MAAM,CAAC,KACvB,eAAe,CAAC,CAAC,CAwDnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribeWithSelector.d.ts","sourceRoot":"","sources":["../../../../src/utils/observable/subscribeWithSelector/subscribeWithSelector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"subscribeWithSelector.d.ts","sourceRoot":"","sources":["../../../../src/utils/observable/subscribeWithSelector/subscribeWithSelector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAE/B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,cAC3B,eAAe,CAAC,CAAC,CAAC,YACpB,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,gBAGpB,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,iBAYhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidRetryOnFailCallError.d.ts","sourceRoot":"","sources":["../../../src/utils/retryOnFail/InvalidRetryOnFailCallError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"InvalidRetryOnFailCallError.d.ts","sourceRoot":"","sources":["../../../src/utils/retryOnFail/InvalidRetryOnFailCallError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,SAAS;gBAE5C,UAAU,EAAE,MAAM;CAS/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setCookie.d.ts","sourceRoot":"","sources":["../../../src/utils/setCookie/setCookie.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"setCookie.d.ts","sourceRoot":"","sources":["../../../src/utils/setCookie/setCookie.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,SAAS,WAAY,MAAM,SAGvC,CAAC"}
|
package/dist/waas.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-
|
|
2
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
3
|
-
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-
|
|
4
|
-
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-
|
|
1
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-Cl2XDWo9.cjs.js');
|
|
2
|
+
const require_InvalidParamError = require('./InvalidParamError-D-d-UfBL.cjs.js');
|
|
3
|
+
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-BDvkZbtb.cjs.js');
|
|
4
|
+
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-BJaemI4V.cjs.js');
|
|
5
5
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
6
6
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
7
7
|
|
package/dist/waas.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as name, F as getDefaultClient, R as BaseError, V as version, i as DYNAMIC_WAAS_METADATA, k as assertDefined, s as __getChainFromVerifiedCredentialChain_wrapped } from "./InvalidParamError-
|
|
2
|
-
import { b as formatWalletProviderKey, c as findWaasWalletProviderByChain, l as isWaasWalletProvider, m as __getWalletProviderFromWalletAccount_wrapped, n as getWalletProviderByKey, s as isWaasWalletAccount, t as __getVerifiedCredentialForWalletAccount_wrapped, v as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-
|
|
3
|
-
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-
|
|
1
|
+
import { B as name, F as getDefaultClient, R as BaseError, V as version, i as DYNAMIC_WAAS_METADATA, k as assertDefined, s as __getChainFromVerifiedCredentialChain_wrapped } from "./InvalidParamError-BiVmL7nM.esm.js";
|
|
2
|
+
import { b as formatWalletProviderKey, c as findWaasWalletProviderByChain, l as isWaasWalletProvider, m as __getWalletProviderFromWalletAccount_wrapped, n as getWalletProviderByKey, s as isWaasWalletAccount, t as __getVerifiedCredentialForWalletAccount_wrapped, v as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-ByUSFAHs.esm.js";
|
|
3
|
+
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-Bo4VhW4n.esm.js";
|
|
4
4
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
5
5
|
import { EmbeddedWalletVersionEnum, JwtVerifiedCredentialFormatEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
6
6
|
|
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import { B as name, F as getDefaultClient, R as BaseError, V as version, i as DYNAMIC_WAAS_METADATA, k as assertDefined, s as __getChainFromVerifiedCredentialChain_wrapped } from "./InvalidParamError-B5NwKSKU.native.esm.js";
|
|
2
|
+
import { b as formatWalletProviderKey, c as findWaasWalletProviderByChain, l as isWaasWalletProvider, m as __getWalletProviderFromWalletAccount_wrapped, n as getWalletProviderByKey, s as isWaasWalletAccount, t as __getVerifiedCredentialForWalletAccount_wrapped, v as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-Dhqf6Tdl.native.esm.js";
|
|
3
|
+
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-BX5lUnKT.native.esm.js";
|
|
4
|
+
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
5
|
+
import { EmbeddedWalletVersionEnum, JwtVerifiedCredentialFormatEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
6
|
+
|
|
7
|
+
//#region src/errors/NotWaasWalletProviderError.ts
|
|
8
|
+
var NotWaasWalletProviderError = class extends BaseError {
|
|
9
|
+
constructor({ walletProviderKey }) {
|
|
10
|
+
super({
|
|
11
|
+
cause: null,
|
|
12
|
+
code: "not_waas_wallet_provider_error",
|
|
13
|
+
docsUrl: null,
|
|
14
|
+
name: "NotWaasWalletProviderError",
|
|
15
|
+
shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts
|
|
22
|
+
/** @not-instrumented */
|
|
23
|
+
const getWaasWalletProviderFromWalletAccount = ({ walletAccount }, client) => {
|
|
24
|
+
const walletProvider = __getWalletProviderFromWalletAccount_wrapped({ walletAccount }, client);
|
|
25
|
+
if (!isWaasWalletProvider(walletProvider)) throw new NotWaasWalletAccountError({ walletAddress: walletAccount.address });
|
|
26
|
+
return walletProvider;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/modules/waas/backupWaasKeySharesToGoogleDrive/backupWaasKeySharesToGoogleDrive.ts
|
|
31
|
+
/**
|
|
32
|
+
* Backs up WaaS wallet key shares to Google Drive for secure recovery.
|
|
33
|
+
*
|
|
34
|
+
* This function creates a backup of the wallet's cryptographic key shares
|
|
35
|
+
* to Google Drive, allowing users to recover their wallet later.
|
|
36
|
+
*
|
|
37
|
+
* @param params.walletAccount - The WaaS wallet account to backup.
|
|
38
|
+
* @param [params.password] - Optional password to encrypt the backup.
|
|
39
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
40
|
+
* @returns A promise that resolves when the backup process is complete.
|
|
41
|
+
* @not-instrumented
|
|
42
|
+
*/
|
|
43
|
+
const backupWaasKeySharesToGoogleDrive = async ({ password, walletAccount }, client = getDefaultClient()) => {
|
|
44
|
+
return getWaasWalletProviderFromWalletAccount({ walletAccount }, client).backupKeySharesToGoogleDrive({
|
|
45
|
+
password,
|
|
46
|
+
walletAccount
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/modules/waas/isWalletCreationRequirement/isWalletCreationRequirement.ts
|
|
52
|
+
/**
|
|
53
|
+
* Type guard to check if an item is a WalletCreationRequirement object.
|
|
54
|
+
* Chain values are strings, so we can distinguish by checking if it's an object with a 'chain' property.
|
|
55
|
+
*
|
|
56
|
+
* @param item - The item to check, either a WalletCreationRequirement or Chain string
|
|
57
|
+
* @returns True if the item is a WalletCreationRequirement object
|
|
58
|
+
* @not-instrumented
|
|
59
|
+
*/
|
|
60
|
+
const isWalletCreationRequirement = (item) => typeof item === "object" && item !== null && "chain" in item;
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/modules/waas/normalizeWalletRequirements/normalizeWalletRequirements.ts
|
|
64
|
+
const DEFAULT_BITCOIN_ADDRESS_TYPE = "native_segwit";
|
|
65
|
+
/**
|
|
66
|
+
* Normalizes wallet creation input from either legacy Chain[] format
|
|
67
|
+
* or new WalletCreationRequirement[] format to WalletCreationRequirement[].
|
|
68
|
+
*
|
|
69
|
+
* For BTC chains without explicit bitcoinConfig, defaults to native_segwit.
|
|
70
|
+
*
|
|
71
|
+
* @param params.input - Either an array of Chain strings or WalletCreationRequirement objects
|
|
72
|
+
* @param params.defaultBitcoinConfig - Optional default bitcoin config to use for BTC chains when converting from legacy format
|
|
73
|
+
* @returns Array of WalletCreationRequirement objects
|
|
74
|
+
* @not-instrumented
|
|
75
|
+
*/
|
|
76
|
+
const normalizeWalletRequirements = ({ defaultBitcoinConfig, input }) => {
|
|
77
|
+
if (input.length === 0) return [];
|
|
78
|
+
const [firstItem] = input;
|
|
79
|
+
if (isWalletCreationRequirement(firstItem)) return input.map((requirement) => {
|
|
80
|
+
if (requirement.chain === "BTC" && !requirement.bitcoinConfig) return {
|
|
81
|
+
...requirement,
|
|
82
|
+
bitcoinConfig: { addressType: DEFAULT_BITCOIN_ADDRESS_TYPE }
|
|
83
|
+
};
|
|
84
|
+
return requirement;
|
|
85
|
+
});
|
|
86
|
+
return input.map((chain) => {
|
|
87
|
+
const requirement = { chain };
|
|
88
|
+
if (chain === "BTC") requirement.bitcoinConfig = defaultBitcoinConfig ?? { addressType: DEFAULT_BITCOIN_ADDRESS_TYPE };
|
|
89
|
+
return requirement;
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/modules/waas/createWaasWalletAccounts/createWaasWalletAccounts.ts
|
|
95
|
+
/**
|
|
96
|
+
* Creates wallet accounts for the specified chains.
|
|
97
|
+
*
|
|
98
|
+
* This function creates wallet accounts for the specified chains.
|
|
99
|
+
* If the same chain is passed multiple times, just as many wallet accounts will be created
|
|
100
|
+
* for that chain.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* // Legacy format - will create wallet accounts for EVM and SOL, BTC defaults to native_segwit
|
|
105
|
+
* await createWaasWalletAccounts({ chains: ['EVM', 'SOL', 'BTC'] });
|
|
106
|
+
*
|
|
107
|
+
* // New format with chain-specific config
|
|
108
|
+
* await createWaasWalletAccounts({
|
|
109
|
+
* chains: [
|
|
110
|
+
* { chain: 'BTC', bitcoinConfig: { addressType: 'taproot' } },
|
|
111
|
+
* { chain: 'EVM' },
|
|
112
|
+
* ]
|
|
113
|
+
* });
|
|
114
|
+
*
|
|
115
|
+
* // Create both BTC address types
|
|
116
|
+
* await createWaasWalletAccounts({
|
|
117
|
+
* chains: [
|
|
118
|
+
* { chain: 'BTC', bitcoinConfig: { addressType: 'native_segwit' } },
|
|
119
|
+
* { chain: 'BTC', bitcoinConfig: { addressType: 'taproot' } },
|
|
120
|
+
* ]
|
|
121
|
+
* });
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* @param params.chains - The chains to create wallet accounts for.
|
|
125
|
+
* @param params.password - The optional password to use for the wallet accounts.
|
|
126
|
+
* @param params.thresholdSignatureScheme - The threshold signature scheme to use for the wallet accounts. (Default: TWO_OF_TWO)
|
|
127
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
128
|
+
* @returns A promise that resolves when all wallet accounts are created.
|
|
129
|
+
* @not-instrumented
|
|
130
|
+
*/
|
|
131
|
+
const createWaasWalletAccounts = async ({ chains, password, thresholdSignatureScheme }, client = getDefaultClient()) => {
|
|
132
|
+
const normalizedRequirements = normalizeWalletRequirements({ input: chains });
|
|
133
|
+
const supportedChains = [
|
|
134
|
+
"BTC",
|
|
135
|
+
"EVM",
|
|
136
|
+
"SOL",
|
|
137
|
+
"SUI",
|
|
138
|
+
"TON"
|
|
139
|
+
];
|
|
140
|
+
const filteredRequirements = normalizedRequirements.filter((requirement) => supportedChains.includes(requirement.chain));
|
|
141
|
+
if (filteredRequirements.length === 0) return;
|
|
142
|
+
const walletProviderMap = /* @__PURE__ */ new Map();
|
|
143
|
+
for (const requirement of filteredRequirements) {
|
|
144
|
+
const walletProviderKey = formatWalletProviderKey({
|
|
145
|
+
chain: requirement.chain,
|
|
146
|
+
displayName: DYNAMIC_WAAS_METADATA.displayName,
|
|
147
|
+
walletProviderType: WalletProviderEnum.EmbeddedWallet
|
|
148
|
+
});
|
|
149
|
+
if (!walletProviderMap.has(walletProviderKey)) {
|
|
150
|
+
const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
|
|
151
|
+
if (!walletProvider) throw new NoWalletProviderFoundError({ walletProviderKey });
|
|
152
|
+
if (!isWaasWalletProvider(walletProvider)) throw new NotWaasWalletProviderError({ walletProviderKey });
|
|
153
|
+
walletProviderMap.set(walletProviderKey, walletProvider);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
await Promise.all(filteredRequirements.map((requirement) => {
|
|
157
|
+
const walletProviderKey = formatWalletProviderKey({
|
|
158
|
+
chain: requirement.chain,
|
|
159
|
+
displayName: DYNAMIC_WAAS_METADATA.displayName,
|
|
160
|
+
walletProviderType: WalletProviderEnum.EmbeddedWallet
|
|
161
|
+
});
|
|
162
|
+
const walletProvider = walletProviderMap.get(walletProviderKey);
|
|
163
|
+
if (!walletProvider || !isWaasWalletProvider(walletProvider)) return Promise.resolve();
|
|
164
|
+
return walletProvider.createWalletAccount({
|
|
165
|
+
bitcoinConfig: requirement.bitcoinConfig,
|
|
166
|
+
password,
|
|
167
|
+
thresholdSignatureScheme
|
|
168
|
+
});
|
|
169
|
+
}));
|
|
170
|
+
await __refreshAuth_wrapped(client);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/modules/waas/delegateWaasKeyShares/delegateWaasKeyShares.ts
|
|
175
|
+
/**
|
|
176
|
+
* Delegates cryptographic key shares for a WaaS wallet account.
|
|
177
|
+
*
|
|
178
|
+
* This function allows the delegation of key management responsibilities,
|
|
179
|
+
* enabling distributed key management for enhanced security.
|
|
180
|
+
*
|
|
181
|
+
* @param params.walletAccount - The WaaS wallet account to delegate shares for.
|
|
182
|
+
* @param [params.password] - Optional password for key share operations.
|
|
183
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
184
|
+
* @returns A promise that resolves when the key delegation is complete.
|
|
185
|
+
* @not-instrumented
|
|
186
|
+
*/
|
|
187
|
+
const delegateWaasKeyShares = async ({ password, walletAccount }, client = getDefaultClient()) => {
|
|
188
|
+
await getWaasWalletProviderFromWalletAccount({ walletAccount }, client).delegateKeyShares({
|
|
189
|
+
password,
|
|
190
|
+
walletAccount
|
|
191
|
+
});
|
|
192
|
+
await __refreshAuth_wrapped(client);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/modules/waas/exportWaasClientKeyshares/exportWaasClientKeyshares.ts
|
|
197
|
+
/**
|
|
198
|
+
* Exports the client-side key shares for a WaaS wallet account.
|
|
199
|
+
*
|
|
200
|
+
* This function retrieves the cryptographic key shares that are stored
|
|
201
|
+
* on the client side for backup or migration purposes.
|
|
202
|
+
*
|
|
203
|
+
* @param params.walletAccount - The WaaS wallet account to export shares from.
|
|
204
|
+
* @param [params.password] - Optional password to encrypt the exported shares.
|
|
205
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
206
|
+
* @returns A promise that resolves to the exported key shares.
|
|
207
|
+
* @not-instrumented
|
|
208
|
+
*/
|
|
209
|
+
const exportWaasClientKeyshares = async ({ password, walletAccount }, client = getDefaultClient()) => {
|
|
210
|
+
return getWaasWalletProviderFromWalletAccount({ walletAccount }, client).exportClientKeyshares({
|
|
211
|
+
password,
|
|
212
|
+
walletAccount
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/modules/waas/exportWaasPrivateKey/exportWaasPrivateKey.ts
|
|
218
|
+
/**
|
|
219
|
+
* Exports the private key for a WaaS wallet account with secure display.
|
|
220
|
+
*
|
|
221
|
+
* This function reveals the private key for a WaaS wallet and displays it
|
|
222
|
+
* securely within an iframe dynamically inserted into the specified HTML container element.
|
|
223
|
+
*
|
|
224
|
+
* @param params.walletAccount - The WaaS wallet account to export the private key from.
|
|
225
|
+
* @param params.displayContainer - The HTML element where the iframe will be injected.
|
|
226
|
+
* @param [params.password] - Optional password to decrypt the private key.
|
|
227
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
228
|
+
* @returns A promise that resolves when the private key export is complete.
|
|
229
|
+
* @not-instrumented
|
|
230
|
+
*/
|
|
231
|
+
const exportWaasPrivateKey = async ({ displayContainer, password, walletAccount }, client = getDefaultClient()) => {
|
|
232
|
+
return getWaasWalletProviderFromWalletAccount({ walletAccount }, client).exportPrivateKey({
|
|
233
|
+
displayContainer,
|
|
234
|
+
password,
|
|
235
|
+
walletAccount
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/modules/wallets/userHasEmbeddedWalletForChain/userHasEmbeddedWalletForChain.ts
|
|
241
|
+
/** @not-instrumented */
|
|
242
|
+
const userHasEmbeddedWalletForChain = ({ user, chain }) => {
|
|
243
|
+
return user.verifiedCredentials.some((vc) => vc.walletProvider === WalletProviderEnum.EmbeddedWallet && vc.chain && __getChainFromVerifiedCredentialChain_wrapped(vc.chain) === chain);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/modules/waas/isDynamicWaasEnabled/isDynamicWaasEnabled.ts
|
|
248
|
+
/**
|
|
249
|
+
* Checks if Dynamic WaaS (Wallet as a Service) is enabled for the current project.
|
|
250
|
+
*
|
|
251
|
+
* This function examines the project settings to determine if Dynamic WaaS is
|
|
252
|
+
* enabled in the Dynamic Dashboard or not.
|
|
253
|
+
*
|
|
254
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
255
|
+
* @returns True if Dynamic WaaS is enabled, false otherwise.
|
|
256
|
+
* @not-instrumented
|
|
257
|
+
*/
|
|
258
|
+
const isDynamicWaasEnabled = (client = getDefaultClient()) => {
|
|
259
|
+
const projectSettings = client.projectSettings;
|
|
260
|
+
assertDefined(projectSettings, "Project settings are not available");
|
|
261
|
+
return projectSettings.sdk.embeddedWallets?.defaultWalletVersion === EmbeddedWalletVersionEnum.V3;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/modules/waas/getChainsMissingWaasWalletAccounts/getChainsMissingWaasWalletAccounts.ts
|
|
266
|
+
/**
|
|
267
|
+
* Gets all chains missing a waas wallet account for the current user.
|
|
268
|
+
*
|
|
269
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
270
|
+
* @returns An array of all chains that have waas wallet accounts enabled
|
|
271
|
+
* but for which the current user does not yet have an embedded wallet account.
|
|
272
|
+
* @not-instrumented
|
|
273
|
+
*/
|
|
274
|
+
const getChainsMissingWaasWalletAccounts = (client = getDefaultClient()) => {
|
|
275
|
+
const projectSettings = client.projectSettings;
|
|
276
|
+
assertDefined(projectSettings, "Project settings are not available");
|
|
277
|
+
const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;
|
|
278
|
+
const isWaasEnabled = isDynamicWaasEnabled(client);
|
|
279
|
+
const user = client.user;
|
|
280
|
+
if (!user || !isWaasEnabled) return [];
|
|
281
|
+
return (embeddedWalletSettings?.chainConfigurations?.filter((chain) => chain.enabled) ?? []).map((chain) => chain.name).filter((chain) => !userHasEmbeddedWalletForChain({
|
|
282
|
+
chain,
|
|
283
|
+
user
|
|
284
|
+
}));
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/modules/waas/getWalletRecoveryState/getWalletRecoveryState.ts
|
|
289
|
+
/**
|
|
290
|
+
* Retrieves the recovery state of a WaaS wallet account.
|
|
291
|
+
*
|
|
292
|
+
* @param params.walletAccount - The WaaS wallet account to get the recovery state for.
|
|
293
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
294
|
+
* @returns A promise that resolves with the wallet recovery state.
|
|
295
|
+
* @not-instrumented
|
|
296
|
+
*/
|
|
297
|
+
const getWalletRecoveryState = async ({ walletAccount }, client = getDefaultClient()) => {
|
|
298
|
+
return getWaasWalletProviderFromWalletAccount({ walletAccount }, client).getWalletRecoveryState({ walletAccount });
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/modules/waas/hasDelegatedAccess/hasDelegatedAccess.ts
|
|
303
|
+
/**
|
|
304
|
+
* Checks if a WaaS wallet account has delegated access.
|
|
305
|
+
*
|
|
306
|
+
* @param params.walletAccount - The WaaS wallet account to check for delegated access.
|
|
307
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
308
|
+
* @returns True if the wallet account has delegated access, false otherwise.
|
|
309
|
+
* @not-instrumented
|
|
310
|
+
*/
|
|
311
|
+
const hasDelegatedAccess = ({ walletAccount }, client = getDefaultClient()) => {
|
|
312
|
+
const verifiedCredential = __getVerifiedCredentialForWalletAccount_wrapped({ walletAccount }, client);
|
|
313
|
+
assertDefined(verifiedCredential, "Verified credential not found for Waas wallet account");
|
|
314
|
+
return !!verifiedCredential.walletProperties?.keyShares?.some((keyShare) => keyShare.backupLocation === "delegated");
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/modules/waas/getWaasWalletProviderByChain/getWaasWalletProviderByChain.ts
|
|
319
|
+
/** @not-instrumented */
|
|
320
|
+
const getWaasWalletProviderByChain = ({ chain }, client) => {
|
|
321
|
+
const waasProvider = findWaasWalletProviderByChain({ chain }, client);
|
|
322
|
+
if (!waasProvider) throw new NoWalletProviderFoundError({ walletProviderKey: formatWalletProviderKey({
|
|
323
|
+
chain,
|
|
324
|
+
displayName: DYNAMIC_WAAS_METADATA.displayName,
|
|
325
|
+
walletProviderType: WalletProviderEnum.EmbeddedWallet
|
|
326
|
+
}) });
|
|
327
|
+
return waasProvider;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region src/modules/waas/importWaasPrivateKey/importWaasPrivateKey.ts
|
|
332
|
+
/**
|
|
333
|
+
* Imports an existing private key to create a new WaaS wallet account.
|
|
334
|
+
*
|
|
335
|
+
* This function allows users to import their existing private key into
|
|
336
|
+
* Dynamic's WaaS infrastructure for secure management.
|
|
337
|
+
*
|
|
338
|
+
* @param params.chain - The chain for the imported wallet.
|
|
339
|
+
* @param params.privateKey - The private key to import.
|
|
340
|
+
* @param [params.thresholdSignatureScheme] - Optional threshold signature scheme configuration. Default is TWO_OF_TWO.
|
|
341
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
342
|
+
* @returns A promise that resolves when the private key is successfully imported.
|
|
343
|
+
* @not-instrumented
|
|
344
|
+
*/
|
|
345
|
+
const importWaasPrivateKey = async ({ chain, privateKey, thresholdSignatureScheme }, client = getDefaultClient()) => {
|
|
346
|
+
return getWaasWalletProviderByChain({ chain }, client).importPrivateKey({
|
|
347
|
+
privateKey,
|
|
348
|
+
thresholdSignatureScheme
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/modules/waas/isPasswordRequiredForWaasWallets/isPasswordRequiredForWaasWallets.ts
|
|
354
|
+
/**
|
|
355
|
+
* Checks if the user Waas wallets are password protected.
|
|
356
|
+
*
|
|
357
|
+
* If the user's Waas wallets are password protected, it means that user's will have to be prompted for a
|
|
358
|
+
* password for the first wallet action that happens on each session.
|
|
359
|
+
* The password is also required for creating any new Waas wallets.
|
|
360
|
+
*
|
|
361
|
+
* @param client - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
362
|
+
* @returns True if the user has any password protected Waas wallets, false otherwise
|
|
363
|
+
* @not-instrumented
|
|
364
|
+
*/
|
|
365
|
+
const isPasswordRequiredForWaasWallets = (client = getDefaultClient()) => {
|
|
366
|
+
const { user } = client;
|
|
367
|
+
assertDefined(user, "User is not authenticated");
|
|
368
|
+
return user.verifiedCredentials.some((credential) => credential.walletProperties?.keyShares?.some((keyShare) => keyShare.passwordEncrypted));
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/modules/waas/refreshWaasWalletAccountShares/refreshWaasWalletAccountShares.ts
|
|
373
|
+
/**
|
|
374
|
+
* Refreshes the cryptographic key shares for a WaaS wallet account.
|
|
375
|
+
*
|
|
376
|
+
* This function generates new key shares for the wallet while maintaining
|
|
377
|
+
* the same threshold signature scheme.
|
|
378
|
+
*
|
|
379
|
+
* @param params.walletAccount - The WaaS wallet account to refresh shares for.
|
|
380
|
+
* @param [params.password] - Optional password for key share operations.
|
|
381
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
382
|
+
* @returns A promise that resolves when the key shares are refreshed.
|
|
383
|
+
* @not-instrumented
|
|
384
|
+
*/
|
|
385
|
+
const refreshWaasWalletAccountShares = async ({ walletAccount, password }, client = getDefaultClient()) => {
|
|
386
|
+
return getWaasWalletProviderFromWalletAccount({ walletAccount }, client).refreshWalletAccountShares({
|
|
387
|
+
password,
|
|
388
|
+
walletAccount
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region src/modules/waas/revokeWaasDelegation/revokeWaasDelegation.ts
|
|
394
|
+
/**
|
|
395
|
+
* Revokes the delegation of a WaaS wallet account.
|
|
396
|
+
*
|
|
397
|
+
* @param params.walletAccount - The WaaS wallet account to revoke delegation for.
|
|
398
|
+
* @param [params.password] - Optional password for delegation operations.
|
|
399
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
400
|
+
* @returns A promise that resolves when the delegation is revoked.
|
|
401
|
+
* @not-instrumented
|
|
402
|
+
*/
|
|
403
|
+
const revokeWaasDelegation = async ({ password, walletAccount }, client = getDefaultClient()) => {
|
|
404
|
+
await getWaasWalletProviderFromWalletAccount({ walletAccount }, client).revokeDelegation({
|
|
405
|
+
password,
|
|
406
|
+
walletAccount
|
|
407
|
+
});
|
|
408
|
+
await __refreshAuth_wrapped(client);
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region src/modules/waas/setWaasWalletAccountPassword/setWaasWalletAccountPassword.ts
|
|
413
|
+
/**
|
|
414
|
+
* Sets a password for a WaaS wallet account.
|
|
415
|
+
*
|
|
416
|
+
* @param params.walletAccount - The WaaS wallet account to set the password for.
|
|
417
|
+
* @param params.password - The password to set for the wallet.
|
|
418
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
419
|
+
* @returns A promise that resolves when the password is successfully set.
|
|
420
|
+
* @not-instrumented
|
|
421
|
+
*/
|
|
422
|
+
const setWaasWalletAccountPassword = async ({ password, walletAccount }, client = getDefaultClient()) => {
|
|
423
|
+
return getWaasWalletProviderFromWalletAccount({ walletAccount }, client).setWaasWalletAccountPassword({
|
|
424
|
+
password,
|
|
425
|
+
walletAccount
|
|
426
|
+
});
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region src/modules/wallets/userHasExternalWallet/userHasExternalWallet.ts
|
|
431
|
+
/** @not-instrumented */
|
|
432
|
+
const userHasExternalWallet = (user) => {
|
|
433
|
+
return user?.verifiedCredentials.some((vc) => vc.format === JwtVerifiedCredentialFormatEnum.Blockchain && vc.walletProvider !== WalletProviderEnum.EmbeddedWallet);
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/modules/waas/shouldAutoCreateWalletForChain/shouldAutoCreateWalletForChain.ts
|
|
438
|
+
/**
|
|
439
|
+
* Checks if a WaaS wallet should be automatically created for the specified blockchain.
|
|
440
|
+
*
|
|
441
|
+
* This function determines whether the current user configuration and project
|
|
442
|
+
* settings require automatic wallet creation for the given chain, considering
|
|
443
|
+
* whether the user already has an embedded wallet for the enabled chains or an external wallet.
|
|
444
|
+
*
|
|
445
|
+
* @param params.chain - The blockchain network to check.
|
|
446
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
447
|
+
* @returns True if a wallet should be auto-created for the chain, false otherwise.
|
|
448
|
+
* @not-instrumented
|
|
449
|
+
*/
|
|
450
|
+
const shouldAutoCreateWalletForChain = ({ chain }, client = getDefaultClient()) => {
|
|
451
|
+
assertDefined(client.projectSettings, "Project settings are not available");
|
|
452
|
+
const embeddedWalletSettings = client.projectSettings.sdk.embeddedWallets;
|
|
453
|
+
if (!embeddedWalletSettings?.automaticEmbeddedWalletCreation || !client.user) return false;
|
|
454
|
+
const automaticEmbeddedWalletCreationForExternalEnabled = embeddedWalletSettings?.automaticEmbeddedWalletCreationForExternal;
|
|
455
|
+
if (!(!userHasExternalWallet(client.user) || automaticEmbeddedWalletCreationForExternalEnabled)) return false;
|
|
456
|
+
return getChainsMissingWaasWalletAccounts(client).includes(chain);
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region src/modules/waas/unlockWallet/unlockWallet.ts
|
|
461
|
+
/**
|
|
462
|
+
* Unlocks a WaaS wallet account.
|
|
463
|
+
*
|
|
464
|
+
* @param params.walletAccount - The WaaS wallet account to unlock.
|
|
465
|
+
* @param params.password - The password to unlock the wallet.
|
|
466
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
467
|
+
* @returns A promise that resolves with the wallet information.
|
|
468
|
+
* @not-instrumented
|
|
469
|
+
*/
|
|
470
|
+
const unlockWallet = async ({ password, walletAccount }, client = getDefaultClient()) => {
|
|
471
|
+
return getWaasWalletProviderFromWalletAccount({ walletAccount }, client).unlockWallet({
|
|
472
|
+
password,
|
|
473
|
+
walletAccount
|
|
474
|
+
});
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/modules/waas/updateWaasPassword/updateWaasPassword.ts
|
|
479
|
+
/**
|
|
480
|
+
* Updates the password for a WaaS wallet account.
|
|
481
|
+
*
|
|
482
|
+
* This function changes the password used to encrypt and protect the
|
|
483
|
+
* cryptographic key shares for the specified wallet account.
|
|
484
|
+
*
|
|
485
|
+
* @param params.walletAccount - The WaaS wallet account to update the password for.
|
|
486
|
+
* @param params.currentPassword - The current password for the wallet.
|
|
487
|
+
* @param params.newPassword - The new password to set for the wallet.
|
|
488
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
489
|
+
* @returns A promise that resolves when the password is successfully updated.
|
|
490
|
+
* @not-instrumented
|
|
491
|
+
*/
|
|
492
|
+
const updateWaasPassword = async ({ currentPassword, newPassword, walletAccount }, client = getDefaultClient()) => {
|
|
493
|
+
return getWaasWalletProviderFromWalletAccount({ walletAccount }, client).updatePassword({
|
|
494
|
+
currentPassword,
|
|
495
|
+
newPassword,
|
|
496
|
+
walletAccount
|
|
497
|
+
});
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/exports/waas.ts
|
|
502
|
+
assertPackageVersion(name, version);
|
|
503
|
+
|
|
504
|
+
//#endregion
|
|
505
|
+
export { NotWaasWalletProviderError, backupWaasKeySharesToGoogleDrive, createWaasWalletAccounts, delegateWaasKeyShares, exportWaasClientKeyshares, exportWaasPrivateKey, getChainsMissingWaasWalletAccounts, getWalletRecoveryState, hasDelegatedAccess, importWaasPrivateKey, isDynamicWaasEnabled, isPasswordRequiredForWaasWallets, isWaasWalletAccount, isWalletCreationRequirement, normalizeWalletRequirements, refreshWaasWalletAccountShares, revokeWaasDelegation, setWaasWalletAccountPassword, shouldAutoCreateWalletForChain, unlockWallet, updateWaasPassword };
|
|
506
|
+
//# sourceMappingURL=waas.native.esm.js.map
|