wallaby-cash 3.0.1-alpha.0 → 3.0.1
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/index.cjs.js +19 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +21 -21
- package/dist/index.js.map +1 -1
- package/dist/lib/system/index.d.ts +1 -0
- package/dist/package.json +19 -6
- package/package.json +19 -6
package/dist/index.cjs.js
CHANGED
|
@@ -597,7 +597,7 @@ const MASTER_ENCRYPTION_KEY = '9fa9d3f3c77c20d3a50a08e5299644be29f6e6206ef3479fe
|
|
|
597
597
|
{ type: 'public-key', alg: exports.PublicKeyCredentialAlgorithm.ES256 },
|
|
598
598
|
];
|
|
599
599
|
const isWeb = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
600
|
-
const currentPackageVersion = "3.0.1
|
|
600
|
+
const currentPackageVersion = "3.0.1" ;
|
|
601
601
|
|
|
602
602
|
/**
|
|
603
603
|
* Storage keys adapter for Storage interface across different platforms.
|
|
@@ -8105,7 +8105,8 @@ class AuthService extends Base {
|
|
|
8105
8105
|
async getSignature({ deviceAuthKeys, walletId, passkeyChallengeType, }) {
|
|
8106
8106
|
try {
|
|
8107
8107
|
logger.debug('SDK::AuthService::getSignature::authType', this.deviceAuthType);
|
|
8108
|
-
const
|
|
8108
|
+
const needsPasskeyChallenge = this.deviceAuthType === exports.AuthType.Passkey;
|
|
8109
|
+
const challengeType = needsPasskeyChallenge ? (passkeyChallengeType !== null && passkeyChallengeType !== void 0 ? passkeyChallengeType : exports.PasskeyChallengeType.REGISTRATION) : undefined;
|
|
8109
8110
|
logger.debug('SDK::AuthService::getSignature::challengeType', challengeType);
|
|
8110
8111
|
const response = await this.request(AuthRoutes.signatureMessage, {
|
|
8111
8112
|
payload: {
|
|
@@ -9480,31 +9481,26 @@ class WalletService extends Base {
|
|
|
9480
9481
|
});
|
|
9481
9482
|
}
|
|
9482
9483
|
const devicePublicKey = (_a = (await this.localStorageService.fetch(exports.LocalStorageItems.ClientAuthPublicKey))) !== null && _a !== void 0 ? _a : publicKeyByPrivateKey(decryptedDevicePrivateKey);
|
|
9483
|
-
const
|
|
9484
|
+
const newSignature = await this.authService.getSignature({
|
|
9485
|
+
deviceAuthKeys: { privateKey: decryptedDevicePrivateKey, publicKey: devicePublicKey },
|
|
9484
9486
|
walletId: input.walletId,
|
|
9487
|
+
passkeyChallengeType: this.deviceAuthType === exports.AuthType.Passkey ? exports.PasskeyChallengeType.AUTHENTICATION : undefined,
|
|
9485
9488
|
});
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
decryptionKey: credentialsKeyPair.privateKey,
|
|
9496
|
-
});
|
|
9497
|
-
const encryptedBackupShare = safeJsonParse(encryptedBackupShareString);
|
|
9498
|
-
const backUpResponse = await this.api.wallets.addNewDevice({
|
|
9499
|
-
walletId: input.walletId,
|
|
9500
|
-
clientAuthPubKey: devicePublicKey,
|
|
9501
|
-
encryptedBackupShare: encryptedBackupShare,
|
|
9489
|
+
const backUpResponse = await this.request(WalletRoutes.addNewDevice, {
|
|
9490
|
+
payload: {
|
|
9491
|
+
walletId: input.walletId,
|
|
9492
|
+
clientAuthPubKey: devicePublicKey,
|
|
9493
|
+
signature: newSignature.signature,
|
|
9494
|
+
message: newSignature.message,
|
|
9495
|
+
wallabyAuthPubKey: newSignature.wallabyAuthPubKey,
|
|
9496
|
+
encryptedBackupShare: input.encryptedBackupShare,
|
|
9497
|
+
},
|
|
9502
9498
|
});
|
|
9503
9499
|
await this.handlers.handleKeySharesFromResponse({
|
|
9504
9500
|
walletId: input.walletId,
|
|
9505
9501
|
shares: [backUpResponse.share],
|
|
9506
9502
|
credentialsKeyPair,
|
|
9507
|
-
encryptedBackupShare: encryptedBackupShare,
|
|
9503
|
+
encryptedBackupShare: input.encryptedBackupShare,
|
|
9508
9504
|
});
|
|
9509
9505
|
return { success: true, reference: backUpResponse.reference };
|
|
9510
9506
|
}
|
|
@@ -11256,6 +11252,9 @@ class System extends Base {
|
|
|
11256
11252
|
if ((options === null || options === void 0 ? void 0 : options.chainName) !== undefined) {
|
|
11257
11253
|
queryParams.chainName = options.chainName;
|
|
11258
11254
|
}
|
|
11255
|
+
if ((options === null || options === void 0 ? void 0 : options.contractAddress) !== undefined) {
|
|
11256
|
+
queryParams.contractAddress = options.contractAddress;
|
|
11257
|
+
}
|
|
11259
11258
|
const response = await this.request(SystemRoutes.getSupportedTokens, {
|
|
11260
11259
|
queryParams: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
|
11261
11260
|
});
|