@dynamic-labs-wallet/core 1.1.66 → 1.1.68

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/index.cjs CHANGED
@@ -1501,7 +1501,7 @@ const getRequiredExternalKeyShareId = (ks)=>{
1501
1501
  * before it is posted and surfaces in Datadog exactly as the recovery path does.
1502
1502
  */ const assertDynamicLocationsHaveExternalKeyShareId = (locations)=>locations.filter((location)=>location.location === BackupLocation.DYNAMIC).forEach((location)=>getRequiredExternalKeyShareId(location));
1503
1503
 
1504
- var version = "1.1.66";
1504
+ var version = "1.1.68";
1505
1505
 
1506
1506
  /**
1507
1507
  * Reads the Authorization header off an axios request config, which stores
@@ -3136,6 +3136,23 @@ const SUPPORTED_IDENTIFIER_TYPES = new Set([
3136
3136
  }
3137
3137
  }
3138
3138
 
3139
+ // crypto.randomUUID is unavailable on older webviews (< Chrome 92) and in
3140
+ // non-secure contexts; fall back to a getRandomValues-based v4 UUID there.
3141
+ const generateUUID = ()=>{
3142
+ const cryptoProvider = globalThis.crypto;
3143
+ if (typeof (cryptoProvider == null ? void 0 : cryptoProvider.randomUUID) === 'function') {
3144
+ return cryptoProvider.randomUUID();
3145
+ }
3146
+ if (typeof (cryptoProvider == null ? void 0 : cryptoProvider.getRandomValues) !== 'function') {
3147
+ throw new TypeError('Secure UUID generation is unavailable');
3148
+ }
3149
+ const bytes = cryptoProvider.getRandomValues(new Uint8Array(16));
3150
+ bytes[6] = bytes[6] & 0x0f | 0x40;
3151
+ bytes[8] = bytes[8] & 0x3f | 0x80;
3152
+ const hex = Array.from(bytes, (b)=>b.toString(16).padStart(2, '0')).join('');
3153
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
3154
+ };
3155
+
3139
3156
  const isPreparedTransaction = (prepared)=>prepared.operation.kind === 'transaction';
3140
3157
  const isPreparedSvmTransaction = (prepared)=>prepared.operation.chainName === 'SVM';
3141
3158
  const validateRequest = (request, prepared, now)=>{
@@ -3162,10 +3179,7 @@ const validateCompleteBy = (completeBy, now)=>{
3162
3179
  }
3163
3180
  };
3164
3181
  const createEnvelope = (request, now, providedIntentId)=>{
3165
- var _cryptoProvider_randomUUID;
3166
- const cryptoProvider = globalThis.crypto;
3167
- const intentId = providedIntentId != null ? providedIntentId : cryptoProvider == null ? void 0 : (_cryptoProvider_randomUUID = cryptoProvider.randomUUID) == null ? void 0 : _cryptoProvider_randomUUID.call(cryptoProvider);
3168
- if (!intentId) throw new Error('Secure UUID generation is unavailable');
3182
+ const intentId = providedIntentId != null ? providedIntentId : generateUUID();
3169
3183
  return _extends({
3170
3184
  actionType: 'waasSigningQuorumApprove',
3171
3185
  accountAddress: request.accountAddress,
@@ -3766,6 +3780,7 @@ exports.extractServerErrorCode = extractServerErrorCode;
3766
3780
  exports.formatNamespacedVersion = formatNamespacedVersion;
3767
3781
  exports.formatRawMessageForSigning = formatRawMessageForSigning;
3768
3782
  exports.forwardMpcMayHaveJoinedRoom = forwardMpcMayHaveJoinedRoom;
3783
+ exports.generateUUID = generateUUID;
3769
3784
  exports.getBitcoinChainConfig = getBitcoinChainConfig;
3770
3785
  exports.getClientThreshold = getClientThreshold;
3771
3786
  exports.getDynamicServerThreshold = getDynamicServerThreshold;
package/index.esm.js CHANGED
@@ -1503,7 +1503,7 @@ const getRequiredExternalKeyShareId = (ks)=>{
1503
1503
  * before it is posted and surfaces in Datadog exactly as the recovery path does.
1504
1504
  */ const assertDynamicLocationsHaveExternalKeyShareId = (locations)=>locations.filter((location)=>location.location === BackupLocation.DYNAMIC).forEach((location)=>getRequiredExternalKeyShareId(location));
1505
1505
 
1506
- var version = "1.1.66";
1506
+ var version = "1.1.68";
1507
1507
 
1508
1508
  /**
1509
1509
  * Reads the Authorization header off an axios request config, which stores
@@ -3138,6 +3138,23 @@ const SUPPORTED_IDENTIFIER_TYPES = new Set([
3138
3138
  }
3139
3139
  }
3140
3140
 
3141
+ // crypto.randomUUID is unavailable on older webviews (< Chrome 92) and in
3142
+ // non-secure contexts; fall back to a getRandomValues-based v4 UUID there.
3143
+ const generateUUID = ()=>{
3144
+ const cryptoProvider = globalThis.crypto;
3145
+ if (typeof (cryptoProvider == null ? void 0 : cryptoProvider.randomUUID) === 'function') {
3146
+ return cryptoProvider.randomUUID();
3147
+ }
3148
+ if (typeof (cryptoProvider == null ? void 0 : cryptoProvider.getRandomValues) !== 'function') {
3149
+ throw new TypeError('Secure UUID generation is unavailable');
3150
+ }
3151
+ const bytes = cryptoProvider.getRandomValues(new Uint8Array(16));
3152
+ bytes[6] = bytes[6] & 0x0f | 0x40;
3153
+ bytes[8] = bytes[8] & 0x3f | 0x80;
3154
+ const hex = Array.from(bytes, (b)=>b.toString(16).padStart(2, '0')).join('');
3155
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
3156
+ };
3157
+
3141
3158
  const isPreparedTransaction = (prepared)=>prepared.operation.kind === 'transaction';
3142
3159
  const isPreparedSvmTransaction = (prepared)=>prepared.operation.chainName === 'SVM';
3143
3160
  const validateRequest = (request, prepared, now)=>{
@@ -3164,10 +3181,7 @@ const validateCompleteBy = (completeBy, now)=>{
3164
3181
  }
3165
3182
  };
3166
3183
  const createEnvelope = (request, now, providedIntentId)=>{
3167
- var _cryptoProvider_randomUUID;
3168
- const cryptoProvider = globalThis.crypto;
3169
- const intentId = providedIntentId != null ? providedIntentId : cryptoProvider == null ? void 0 : (_cryptoProvider_randomUUID = cryptoProvider.randomUUID) == null ? void 0 : _cryptoProvider_randomUUID.call(cryptoProvider);
3170
- if (!intentId) throw new Error('Secure UUID generation is unavailable');
3184
+ const intentId = providedIntentId != null ? providedIntentId : generateUUID();
3171
3185
  return _extends({
3172
3186
  actionType: 'waasSigningQuorumApprove',
3173
3187
  accountAddress: request.accountAddress,
@@ -3651,4 +3665,4 @@ const prepareRawMessageSigningPayload = (chainName, message)=>{
3651
3665
  (_requestId = (_target1 = target).requestId) != null ? _requestId : _target1.requestId = requestId;
3652
3666
  };
3653
3667
 
3654
- export { AuthMode, BITCOIN_ADDRESS_TYPE_CONFIG, BITCOIN_DERIVATION_PATHS, BROWSER_SDK_ROUTE_PREFIX, BackupLocation, BitcoinAddressType, BitcoinNetwork, BusinessAccountClient, BusinessAccountMemberRole, BusinessAccountSignerType, CreateRoomPartiesOptions, DEFAULT_ED25519_VARIANT, DELEGATED_SHARE_COUNT, DYNAMIC_AUTH_BASE_API_URL_MAP, DYNAMIC_AUTH_DEV_BASE_API_URL, DYNAMIC_AUTH_PREPROD_BASE_API_URL, DYNAMIC_AUTH_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_REDCOAST_API_KEY_MAP, DYNAMIC_CLIENT_RELAY_REDCOAST_APP_ID_MAP, DYNAMIC_FORWARD_MPC_DEV_ENCLAVE_URL, DYNAMIC_FORWARD_MPC_ENCLAVE_ATTESTATION_CONFIG_MAP, DYNAMIC_FORWARD_MPC_ENCLAVE_URL_MAP, DYNAMIC_FORWARD_MPC_PREPROD_ENCLAVE_URL, DYNAMIC_FORWARD_MPC_PROD_ENCLAVE_URL, DYNAMIC_KEYSHARES_RELAY_MAP, DYNAMIC_KEYSHARES_RELAY_PREPROD_BASE_API_URL, DYNAMIC_KEYSHARES_RELAY_PROD_BASE_API_URL, DynamicApiClient, DynamicClientSessionSignature, DynamicElevatedAccessTokenHeader, DynamicForwardMPCHeader, DynamicMfaTokenHeader, DynamicRequestIdHeader, DynamicSessionPublicKeyHeader, DynamicTraceElapsedTimeHeader, DynamicTraceIdHeader, ENCRYPTED_SHARES_STORAGE_SUFFIX, ENVIRONMENT_ENUM, EVM_COMPATIBLE_CHAINS, EarnClient, FEATURE_FLAGS, IFRAME_DOMAIN_MAP, Logger, MIDNIGHT_DERIVATION_PATHS, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_DEV_API_URL, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, MPC_RELAY_URL_MAP, NETWORK_ERROR_CODE, NETWORK_ERROR_STATUS, NoopLogger, PREPROD_RELAY_API_KEY, PREPROD_RELAY_APP_ID, PROD_RELAY_API_KEY, PROD_RELAY_APP_ID, RELAY_API_KEY_HEADER, RELAY_APP_ID_HEADER, SDK_NAMESPACE, SERVER_SDK_ROUTE_PREFIX, SOLANA_RPC_URL, SignAndBroadcastRequestTooLargeError, SigningConsentRequiredError, SuccessEventType, ThresholdSignatureScheme, URL_PATTERNS, WAAS_EXPORT_INTENT_ACTION, WAAS_RESHARE_INTENT_ACTION, WalletApiError, WalletOperation, WalletReadyState, assertDynamicLocationsHaveExternalKeyShareId, attachRequestIds, buildForwardMpcEnclaveUrl, chain, chainEnumToVerifiedCredentialName, createExportIntent, createRejectablePromise, createReshareIntent, createSigningIntent, extractServerErrorCode, formatNamespacedVersion, formatRawMessageForSigning, forwardMpcMayHaveJoinedRoom, getBitcoinChainConfig, getClientThreshold, getDynamicServerThreshold, getEnvironmentFromUrl, getMPCChainConfig, getRequiredExternalKeyShareId, getReshareConfig, getServerWalletReshareConfig, getTSSConfig, getVersionNamespace, getVersionWithoutNamespace, handleAxiosError, invokeCeremonyComplete, isBusinessAccountActionRequired, isEvmCompatibleChain, isRecoveredForwardMpcConnectionChurn, isWasmUnavailableErrorMessage, normalizeAndValidatePrivateKey, parseNamespacedVersion, prepareRawMessageSigningPayload, runWithForwardMpcFallback, sanitizeBusinessAccountSignedIntent, serializeError, serializeMessageForForwardMPC, toJsonSafeContext, verifiedCredentialNameToChainEnum, withTraceId };
3668
+ export { AuthMode, BITCOIN_ADDRESS_TYPE_CONFIG, BITCOIN_DERIVATION_PATHS, BROWSER_SDK_ROUTE_PREFIX, BackupLocation, BitcoinAddressType, BitcoinNetwork, BusinessAccountClient, BusinessAccountMemberRole, BusinessAccountSignerType, CreateRoomPartiesOptions, DEFAULT_ED25519_VARIANT, DELEGATED_SHARE_COUNT, DYNAMIC_AUTH_BASE_API_URL_MAP, DYNAMIC_AUTH_DEV_BASE_API_URL, DYNAMIC_AUTH_PREPROD_BASE_API_URL, DYNAMIC_AUTH_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_REDCOAST_API_KEY_MAP, DYNAMIC_CLIENT_RELAY_REDCOAST_APP_ID_MAP, DYNAMIC_FORWARD_MPC_DEV_ENCLAVE_URL, DYNAMIC_FORWARD_MPC_ENCLAVE_ATTESTATION_CONFIG_MAP, DYNAMIC_FORWARD_MPC_ENCLAVE_URL_MAP, DYNAMIC_FORWARD_MPC_PREPROD_ENCLAVE_URL, DYNAMIC_FORWARD_MPC_PROD_ENCLAVE_URL, DYNAMIC_KEYSHARES_RELAY_MAP, DYNAMIC_KEYSHARES_RELAY_PREPROD_BASE_API_URL, DYNAMIC_KEYSHARES_RELAY_PROD_BASE_API_URL, DynamicApiClient, DynamicClientSessionSignature, DynamicElevatedAccessTokenHeader, DynamicForwardMPCHeader, DynamicMfaTokenHeader, DynamicRequestIdHeader, DynamicSessionPublicKeyHeader, DynamicTraceElapsedTimeHeader, DynamicTraceIdHeader, ENCRYPTED_SHARES_STORAGE_SUFFIX, ENVIRONMENT_ENUM, EVM_COMPATIBLE_CHAINS, EarnClient, FEATURE_FLAGS, IFRAME_DOMAIN_MAP, Logger, MIDNIGHT_DERIVATION_PATHS, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_DEV_API_URL, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, MPC_RELAY_URL_MAP, NETWORK_ERROR_CODE, NETWORK_ERROR_STATUS, NoopLogger, PREPROD_RELAY_API_KEY, PREPROD_RELAY_APP_ID, PROD_RELAY_API_KEY, PROD_RELAY_APP_ID, RELAY_API_KEY_HEADER, RELAY_APP_ID_HEADER, SDK_NAMESPACE, SERVER_SDK_ROUTE_PREFIX, SOLANA_RPC_URL, SignAndBroadcastRequestTooLargeError, SigningConsentRequiredError, SuccessEventType, ThresholdSignatureScheme, URL_PATTERNS, WAAS_EXPORT_INTENT_ACTION, WAAS_RESHARE_INTENT_ACTION, WalletApiError, WalletOperation, WalletReadyState, assertDynamicLocationsHaveExternalKeyShareId, attachRequestIds, buildForwardMpcEnclaveUrl, chain, chainEnumToVerifiedCredentialName, createExportIntent, createRejectablePromise, createReshareIntent, createSigningIntent, extractServerErrorCode, formatNamespacedVersion, formatRawMessageForSigning, forwardMpcMayHaveJoinedRoom, generateUUID, getBitcoinChainConfig, getClientThreshold, getDynamicServerThreshold, getEnvironmentFromUrl, getMPCChainConfig, getRequiredExternalKeyShareId, getReshareConfig, getServerWalletReshareConfig, getTSSConfig, getVersionNamespace, getVersionWithoutNamespace, handleAxiosError, invokeCeremonyComplete, isBusinessAccountActionRequired, isEvmCompatibleChain, isRecoveredForwardMpcConnectionChurn, isWasmUnavailableErrorMessage, normalizeAndValidatePrivateKey, parseNamespacedVersion, prepareRawMessageSigningPayload, runWithForwardMpcFallback, sanitizeBusinessAccountSignedIntent, serializeError, serializeMessageForForwardMPC, toJsonSafeContext, verifiedCredentialNameToChainEnum, withTraceId };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/core",
3
- "version": "1.1.66",
3
+ "version": "1.1.68",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@dynamic-labs/sdk-api-core": "0.144.0",
8
- "@dynamic-labs-wallet/primitives": "1.1.66",
8
+ "@dynamic-labs-wallet/primitives": "1.1.68",
9
9
  "axios": "1.20.0",
10
10
  "uuid": "11.1.1"
11
11
  },
@@ -1 +1 @@
1
- {"version":3,"file":"signingIntent.d.ts","sourceRoot":"","sources":["../../packages/src/signingIntent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAGzB,KAAK,gCAAgC,EACrC,KAAK,2BAA2B,EAChC,KAAK,aAAa,EAEnB,MAAM,YAAY,CAAC;AAEpB,KAAK,iBAAiB,GAClB;IAAE,SA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E;IAAE,SAAS,EAAE,oBAAoB,CAAA;CAAE,GACnC,gCAAgC,CAAC;AAkJrC,eAAO,MAAM,mBAAmB,YACrB,2BAA2B,YAC1B,iBAAiB,YAClB;IAAE,GAAG,CAAC,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,KACzC,aAKF,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './sdkVersion.js';
2
+ export { generateUUID } from './uuid.js';
2
3
  export * from './messageSerialization.js';
3
4
  export * from './keyShare.js';
4
5
  export * from './forwardMpcErrorHandling.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACvH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACvH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const generateUUID: () => string;
2
+ //# sourceMappingURL=uuid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/utils/uuid.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,QAAO,MAa/B,CAAC"}