wallaby-cash 2.2.1-alpha.3 → 2.2.2

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 CHANGED
@@ -115,18 +115,10 @@ class WallabyError extends Error {
115
115
  this.cause = cause;
116
116
  this.onError = onError;
117
117
  this.data = data;
118
- if (onError) {
119
- onError();
120
- }
121
118
  Error.captureStackTrace(this, WallabyError);
122
119
  }
123
- static isWallabyError(obj) {
124
- return (!!obj &&
125
- typeof obj === 'object' &&
126
- 'statusCode' in obj &&
127
- 'message' in obj &&
128
- typeof obj.statusCode === 'number' &&
129
- (obj.statusCode >= 400 || 'error' in obj));
120
+ static isWallabyError(error) {
121
+ return error instanceof WallabyError;
130
122
  }
131
123
  }
132
124
  exports.UserAssetSource = void 0;
@@ -7201,7 +7193,7 @@ class Base {
7201
7193
  }
7202
7194
  catch (error) {
7203
7195
  if (error === null || error === void 0 ? void 0 : error.error) {
7204
- console.log('SDK::Base::handleApiCall::API Error', { error });
7196
+ logger.error('SDK::Base::handleApiCall::API Error', { error });
7205
7197
  const apiError = error.error;
7206
7198
  throw new WallabyError({
7207
7199
  message: apiError.message || 'API request failed',
@@ -7495,6 +7487,16 @@ const TransactionsRoutes = {
7495
7487
  method: exports.RequestMethod.Get,
7496
7488
  requiresAccessToken: true,
7497
7489
  },
7490
+ getPendingTransactions: {
7491
+ fullPath: '/transactions/pending',
7492
+ method: exports.RequestMethod.Get,
7493
+ requiresAccessToken: true,
7494
+ },
7495
+ confirmPendingTransaction: {
7496
+ fullPath: '/transactions/resolve',
7497
+ method: exports.RequestMethod.Post,
7498
+ requiresAccessToken: true,
7499
+ },
7498
7500
  };
7499
7501
 
7500
7502
  /* eslint-disable no-useless-catch */
@@ -7605,7 +7607,7 @@ class PasskeyService {
7605
7607
  first: prfExtensionEvaluation,
7606
7608
  },
7607
7609
  } }) });
7608
- console.log('SDK::PasskeyService::preparePasskeyRequestOptions::parsedOptions', parsedOptions);
7610
+ logger.log('SDK::PasskeyService::preparePasskeyRequestOptions::parsedOptions', !!parsedOptions);
7609
7611
  // While the authenticator still works with the prf and would return the response (if any),
7610
7612
  // the library `@simplewebauthn/browser` does not support the prf extension in its type intentionally.
7611
7613
  // > "Using the prf extension does not fall under the simple use of webauthn."
@@ -7625,7 +7627,7 @@ class PasskeyService {
7625
7627
  first: prfExtensionEvaluation,
7626
7628
  },
7627
7629
  } }) });
7628
- console.log('SDK::PasskeyService::preparePasskeyRequestOptions::parsedOptions', parsedOptions);
7630
+ logger.log('SDK::PasskeyService::preparePasskeyRequestOptions::parsedOptions', !!parsedOptions);
7629
7631
  return parsedOptions;
7630
7632
  }
7631
7633
  /**
@@ -7636,7 +7638,7 @@ class PasskeyService {
7636
7638
  */
7637
7639
  async addNewPasskey({ deviceKeyPair, getSignature, }) {
7638
7640
  try {
7639
- console.log('SDK::PasskeyService::addNewPasskey: start adding new passkey');
7641
+ logger.log('SDK::PasskeyService::addNewPasskey: start adding new passkey');
7640
7642
  let passkeyCredential;
7641
7643
  let signInResponse;
7642
7644
  try {
@@ -7648,14 +7650,14 @@ class PasskeyService {
7648
7650
  errorCode: exports.ErrorResponseCodes.sdk_passkey_challenge_unavailable,
7649
7651
  });
7650
7652
  const parsedOptions = this.preparePasskeyCreationOptions(registrationChallengeResponse.registrationOptions);
7651
- console.log('SDK::PasskeyService::addNewPasskey: about to register passkey credential');
7653
+ logger.log('SDK::PasskeyService::addNewPasskey: about to register passkey credential');
7652
7654
  passkeyCredential = await this.authenticator.register({
7653
7655
  optionsJSON: parsedOptions,
7654
7656
  });
7655
- console.log('SDK::PasskeyService::addNewPasskey: finished registering passkey credential');
7657
+ logger.log('SDK::PasskeyService::addNewPasskey: finished registering passkey credential');
7656
7658
  // before we sign the user in, we need to make sure the prf extension is enabled and we have a value.
7657
7659
  const credentialsKeyPair = await this.handleCredentialsCreationFromPrfExtension(passkeyCredential);
7658
- console.log('SDK::PasskeyService::addNewPasskey:: finished deriving credentials key pair', credentialsKeyPair.publicKey);
7660
+ logger.log('SDK::PasskeyService::addNewPasskey:: finished deriving credentials key pair', credentialsKeyPair.publicKey);
7659
7661
  signInResponse = await this.request(AuthRoutes.signIn, {
7660
7662
  payload: {
7661
7663
  externalUserId: this.userId,
@@ -7665,7 +7667,7 @@ class PasskeyService {
7665
7667
  passkeyRegistrationResponse: passkeyCredential,
7666
7668
  },
7667
7669
  });
7668
- console.log('SDK::PasskeyService::addNewPasskey:: signInResponse', signInResponse);
7670
+ logger.log('SDK::PasskeyService::addNewPasskey:: signInResponse', signInResponse);
7669
7671
  const encryptedNewDevicePrivateKey = await this.cipher.encrypt({
7670
7672
  data: deviceKeyPair.privateKey,
7671
7673
  encryptionKey: credentialsKeyPair.publicKey,
@@ -7691,11 +7693,11 @@ class PasskeyService {
7691
7693
  errorCode: exports.ErrorResponseCodes.sdk_passkey_challenge_unavailable,
7692
7694
  });
7693
7695
  const parsedOptions = this.preparePasskeyRequestOptions(authenticationChallengeResponse.authenticationOptions);
7694
- console.log('SDK::PasskeyService::addNewPasskey::catch: about to authenticate with passkey');
7696
+ logger.log('SDK::PasskeyService::addNewPasskey::catch: about to authenticate with passkey');
7695
7697
  passkeyCredential = await this.authenticator.authenticate({
7696
7698
  optionsJSON: parsedOptions,
7697
7699
  });
7698
- console.log('SDK::PasskeyService::addNewPasskey::catch: finished authenticating with passkey');
7700
+ logger.log('SDK::PasskeyService::addNewPasskey::catch: finished authenticating with passkey');
7699
7701
  signInResponse = await this.request(AuthRoutes.signIn, {
7700
7702
  payload: {
7701
7703
  externalUserId: this.userId,
@@ -7705,16 +7707,16 @@ class PasskeyService {
7705
7707
  passkeyAuthenticationResponse: passkeyCredential,
7706
7708
  },
7707
7709
  });
7708
- console.log('SDK::PasskeyService::addNewPasskey::catch: finished signing in with passkey', {
7710
+ logger.log('SDK::PasskeyService::addNewPasskey::catch: finished signing in with passkey', {
7709
7711
  signInResponse,
7710
7712
  });
7711
7713
  const credentialsKeyPair = await this.handleCredentialsCreationFromPrfExtension(passkeyCredential);
7712
- console.log('SDK::PasskeyService::addNewPasskey::catch: finished deriving credentials key pair', credentialsKeyPair.publicKey);
7714
+ logger.log('SDK::PasskeyService::addNewPasskey::catch: finished deriving credentials key pair', credentialsKeyPair.publicKey);
7713
7715
  const encryptedNewDevicePrivateKey = await this.cipher.encrypt({
7714
7716
  data: deviceKeyPair.privateKey,
7715
7717
  encryptionKey: credentialsKeyPair.publicKey,
7716
7718
  });
7717
- console.log('SDK::PasskeyService::addNewPasskey::catch: about to store data');
7719
+ logger.log('SDK::PasskeyService::addNewPasskey::catch: about to store data');
7718
7720
  await this.handleStoringData({
7719
7721
  authenticationResponse: signInResponse,
7720
7722
  deviceKeyPair: {
@@ -7723,7 +7725,7 @@ class PasskeyService {
7723
7725
  },
7724
7726
  passkeyCredential,
7725
7727
  });
7726
- console.log('SDK::PasskeyService::addNewPasskey::catch: finished storing data');
7728
+ logger.log('SDK::PasskeyService::addNewPasskey::catch: finished storing data');
7727
7729
  return Object.assign(Object.assign({}, signInResponse), { signatureMessageResponse: authenticationChallengeResponse, prfValue: credentialsKeyPair.prfValue });
7728
7730
  }
7729
7731
  throw error;
@@ -7857,17 +7859,17 @@ class PasskeyService {
7857
7859
  statusCode: 400,
7858
7860
  errorCode: exports.ErrorResponseCodes.sdk_passkey_challenge_unavailable,
7859
7861
  });
7860
- console.log('SDK::PasskeyService::register:: got challenge', {
7862
+ logger.log('SDK::PasskeyService::register:: got challenge', {
7861
7863
  registrationOptions: challengeResponse.registrationOptions,
7862
7864
  });
7863
7865
  const parsedOptions = this.preparePasskeyCreationOptions(challengeResponse.registrationOptions);
7864
- console.log('SDK::PasskeyService::register:: registering passkey', {
7866
+ logger.log('SDK::PasskeyService::register:: registering passkey', {
7865
7867
  parsedOptions,
7866
7868
  });
7867
7869
  const passkeyCredential = await this.authenticator.register({
7868
7870
  optionsJSON: parsedOptions,
7869
7871
  });
7870
- console.log('SDK::PasskeyService::register:: got passkey credential', {
7872
+ logger.log('SDK::PasskeyService::register:: got passkey credential', {
7871
7873
  id: passkeyCredential.id,
7872
7874
  type: passkeyCredential.type,
7873
7875
  });
@@ -7878,7 +7880,7 @@ class PasskeyService {
7878
7880
  errorCode: exports.ErrorResponseCodes.sdk_passkey_prf_not_available,
7879
7881
  });
7880
7882
  }
7881
- console.log('SDK::PasskeyService::register:: getting signature', {
7883
+ logger.log('SDK::PasskeyService::register:: getting signature', {
7882
7884
  message: challengeResponse.message,
7883
7885
  privateKey: deviceKeyPair.privateKey,
7884
7886
  });
@@ -7911,10 +7913,10 @@ class PasskeyService {
7911
7913
  return Object.freeze(Object.assign(Object.assign({}, signUpResponse), { prfValue: credentialsKeyPair.prfValue, signatureMessageResponse: challengeResponse }));
7912
7914
  }
7913
7915
  catch (error) {
7914
- console.log('SDK::PasskeyService::register::error', { error, errorCode: error.code, errorMessage: error.message });
7916
+ logger.log('SDK::PasskeyService::register::error', { error, errorCode: error.code, errorMessage: error.message });
7915
7917
  // If it's an API error (has statusCode), preserve the original error message
7916
7918
  if (error instanceof WallabyError) {
7917
- console.log('SDK::PasskeyService::register::API error detected', { error });
7919
+ logger.log('SDK::PasskeyService::register::API error detected', { error });
7918
7920
  throw error;
7919
7921
  }
7920
7922
  // we want to skip handling the error and showing the proper error message for this one.
@@ -7922,7 +7924,7 @@ class PasskeyService {
7922
7924
  if ((error && error.code === AuthenticatorPreviouslyRegisteredError.error) ||
7923
7925
  error.code === InvalidStateError.error ||
7924
7926
  error.message === 'The authenticator was previously registered.') {
7925
- console.log('SDK::PasskeyService::register::ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED', true);
7927
+ logger.log('SDK::PasskeyService::register::ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED', true);
7926
7928
  throw error;
7927
7929
  }
7928
7930
  throw this.authenticator.handlePasskeyError(error);
@@ -7939,7 +7941,7 @@ class PasskeyService {
7939
7941
  // Check if we're in a browser environment and getClientCapabilities is available
7940
7942
  if (typeof window !== 'undefined' && typeof ((_a = window.PublicKeyCredential) === null || _a === void 0 ? void 0 : _a.getClientCapabilities) === 'function') {
7941
7943
  const capabilities = await window.PublicKeyCredential.getClientCapabilities();
7942
- console.log('SDK::PasskeyService::isDevicePrfCompatible::capabilities', capabilities);
7944
+ logger.log('SDK::PasskeyService::isDevicePrfCompatible::capabilities', capabilities);
7943
7945
  return capabilities['extension:prf'];
7944
7946
  }
7945
7947
  // Fallback: assume PRF is not supported if the API is not available
@@ -7999,7 +8001,7 @@ class PasskeyService {
7999
8001
  var _a, _b, _c, _d, _e;
8000
8002
  try {
8001
8003
  const extensions = passkeyCredential.clientExtensionResults;
8002
- console.log('SDK::PasskeyService::handleCredentialsCreationFromPrfExtension::extensions', extensions);
8004
+ logger.log('SDK::PasskeyService::handleCredentialsCreationFromPrfExtension::extensions', extensions);
8003
8005
  if (!((_a = extensions.prf) === null || _a === void 0 ? void 0 : _a.enabled) && !((_c = (_b = extensions.prf) === null || _b === void 0 ? void 0 : _b.results) === null || _c === void 0 ? void 0 : _c.first)) {
8004
8006
  throw new WallabyError({
8005
8007
  message: 'Device is not compatible with this feature. Try using a different authentication method.',
@@ -8021,7 +8023,7 @@ class PasskeyService {
8021
8023
  prfValue,
8022
8024
  authType: exports.AuthType.Passkey,
8023
8025
  });
8024
- console.log('SDK::PasskeyService::handleCredentialsCreationFromPrfExtension::credentials key pair was created', !!credentialsKeyPair);
8026
+ logger.log('SDK::PasskeyService::handleCredentialsCreationFromPrfExtension::credentials key pair was created', !!credentialsKeyPair);
8025
8027
  return Object.assign(Object.assign({}, credentialsKeyPair), { prfValue });
8026
8028
  }
8027
8029
  catch (error) {
@@ -8158,23 +8160,18 @@ class AuthService extends Base {
8158
8160
  logger.debug('SDK::AuthService::getSignature::authType', this.deviceAuthType);
8159
8161
  const challengeType = passkeyChallengeType !== null && passkeyChallengeType !== void 0 ? passkeyChallengeType : exports.PasskeyChallengeType.REGISTRATION;
8160
8162
  logger.debug('SDK::AuthService::getSignature::challengeType', challengeType);
8161
- // Using old request method for now because nock doesn't intercept fetch (used by generated API)
8162
- // const response = await this.request<AuthSignatureMessageResponseDto>(AuthRoutes.signatureMessage, {
8163
- // payload: {
8164
- // clientAuthPubKey: deviceAuthKeys.publicKey,
8165
- // passkeyChallengeType: challengeType,
8166
- // },
8167
- // });
8168
- const response = await this.api.auth.generateSignatureMessage({
8169
- clientAuthPubKey: deviceAuthKeys.publicKey,
8170
- passkeyChallengeType: challengeType,
8163
+ const response = await this.request(AuthRoutes.signatureMessage, {
8164
+ payload: {
8165
+ clientAuthPubKey: deviceAuthKeys.publicKey,
8166
+ passkeyChallengeType: challengeType,
8167
+ },
8171
8168
  });
8172
8169
  const { signature, hashedMessage } = await this.cipher.sign({
8173
8170
  message: response.message,
8174
8171
  signingKey: deviceAuthKeys.privateKey,
8175
8172
  });
8176
- return Object.freeze(Object.assign({ signature,
8177
- hashedMessage }, response));
8173
+ return Object.freeze(Object.assign(Object.assign({}, response), { signature,
8174
+ hashedMessage }));
8178
8175
  }
8179
8176
  catch (error) {
8180
8177
  logger.error('SDK::AuthService::getSignatureMessage::error', error);
@@ -8235,7 +8232,6 @@ class AuthService extends Base {
8235
8232
  });
8236
8233
  return authentication;
8237
8234
  }
8238
- // Re-throw the original error (likely WallabyError with proper structure)
8239
8235
  throw error;
8240
8236
  }
8241
8237
  }
@@ -8448,7 +8444,6 @@ class AuthService extends Base {
8448
8444
  clientAuthPubKey: deviceKeyPair.publicKey,
8449
8445
  },
8450
8446
  }).then(async (authResponse) => {
8451
- console.log('SDK::AuthService::handleSignUpWithPassword::authResponse', authResponse);
8452
8447
  const credentialsKeyPair = await this.cipher.getCredentialsKeyPair({
8453
8448
  authType: this.deviceAuthType,
8454
8449
  password: input.password,
@@ -8483,7 +8478,6 @@ class AuthService extends Base {
8483
8478
  async getPasskeyCredentials() {
8484
8479
  try {
8485
8480
  const response = await this.api.auth.getPasskeyCredentials();
8486
- console.log('SDK::AuthService::getPasskeyCredentials::response', response);
8487
8481
  return response;
8488
8482
  }
8489
8483
  catch (error) {
@@ -8608,7 +8602,6 @@ class WalletHandlersService extends Base {
8608
8602
  password: importWalletInput.authenticationOptions.password,
8609
8603
  prfValue: importWalletInput.authenticationOptions.prfValue,
8610
8604
  });
8611
- console.log('importWalletRequest', importWalletRequest);
8612
8605
  if (
8613
8606
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
8614
8607
  importWalletRequest.encryptedSeed &&
@@ -9178,10 +9171,6 @@ class WalletService extends Base {
9178
9171
  });
9179
9172
  }
9180
9173
  const parsedEncryptedDevicePrivateKey = safeJsonParse(encryptedDevicePrivateKey);
9181
- console.log('credentials data', {
9182
- password: input.authenticationOptions.password,
9183
- salt: input.authenticationOptions.user.clientSalt,
9184
- });
9185
9174
  const credentialsKeyPair = await this.cipher.getCredentialsKeyPair({
9186
9175
  authType: this.deviceAuthType,
9187
9176
  password: input.authenticationOptions.password,
@@ -9727,7 +9716,7 @@ class WalletService extends Base {
9727
9716
  // },
9728
9717
  // },
9729
9718
  // });
9730
- const backUpResponse = (await this.api.wallets.addNewDevice({
9719
+ const backUpResponse = await this.api.wallets.addNewDevice({
9731
9720
  walletId: input.walletId,
9732
9721
  message: signatureMessage.message,
9733
9722
  signature: signatureMessage.signature,
@@ -9737,7 +9726,7 @@ class WalletService extends Base {
9737
9726
  wrappingPublicKey: input.authenticationOptions.user.wallabyAuthPubKey,
9738
9727
  type: exports.KeyTypeName.OwnerBackupDeviceShare,
9739
9728
  },
9740
- }));
9729
+ });
9741
9730
  const keyShares = [
9742
9731
  backUpResponse.share, // this is the backup share that is now rewrapped with the new device public key.
9743
9732
  {
@@ -9753,7 +9742,7 @@ class WalletService extends Base {
9753
9742
  devicePrivateKey: decryptedDevicePrivateKey,
9754
9743
  credentialsKeyPair,
9755
9744
  });
9756
- return { success: true, reference: backUpResponse.references };
9745
+ return { success: true, reference: backUpResponse.reference };
9757
9746
  }
9758
9747
  catch (error) {
9759
9748
  logger.error('SDK::Wallet::backupKeyShare::error', error);
@@ -10808,7 +10797,7 @@ class Merchants extends Base {
10808
10797
  const response = await this.request(MerchantsRoutes.getMerchantData, {
10809
10798
  payload: { merchantId },
10810
10799
  });
10811
- return response;
10800
+ return response.merchant;
10812
10801
  }
10813
10802
  catch (error) {
10814
10803
  logger.error('SDK::Merchants::list::error', error);
@@ -10823,7 +10812,6 @@ class Merchants extends Base {
10823
10812
  async getAssets() {
10824
10813
  try {
10825
10814
  const response = await this.request(MerchantsRoutes.getAssets);
10826
- console.log('SDK::Merchants::getAssets::response', response);
10827
10815
  return response.merchantAssets;
10828
10816
  }
10829
10817
  catch (error) {
@@ -11201,7 +11189,11 @@ class Transactions extends Base {
11201
11189
  });
11202
11190
  }
11203
11191
  else {
11204
- throw new Error('No valid seed option found on this device.');
11192
+ throw new WallabyError({
11193
+ message: 'No valid seed option found on this device.',
11194
+ statusCode: 400,
11195
+ errorCode: 'sdk_no_valid_seed_option',
11196
+ });
11205
11197
  }
11206
11198
  return transferResponse;
11207
11199
  }
@@ -11281,16 +11273,82 @@ class Transactions extends Base {
11281
11273
  throw error;
11282
11274
  }
11283
11275
  }
11276
+ /**
11277
+ *
11278
+ * @public
11279
+ * @param {string} walletId
11280
+ * @param {BlockchainName} chainName
11281
+ * @returns {Promise<GetPendingTransactionsResponse>}
11282
+ */
11283
+ async getPendingTransactions({ walletId, chainName }) {
11284
+ try {
11285
+ const response = await this.request(TransactionsRoutes.getPendingTransactions, {
11286
+ queryParams: {
11287
+ walletId,
11288
+ chainName,
11289
+ },
11290
+ });
11291
+ return response;
11292
+ }
11293
+ catch (error) {
11294
+ logger.error('SDK::Transactions::getPendingTransactions::error', error);
11295
+ throw error;
11296
+ }
11297
+ }
11298
+ /**
11299
+ *
11300
+ * @public
11301
+ * @param {string} id
11302
+ * @param {ResolvePendingTransactionDecision} choice
11303
+ * @param {number} symbol
11304
+ * @param {string} chainName
11305
+ * @param {string} walletId
11306
+ * @param {AuthResponse} authenticationOptions
11307
+ * @returns {ResolvePendingTransactionResponse}
11308
+ */
11309
+ async resolvePendingTransaction({ id, choice, symbol, chainName, walletId, authenticationOptions, }) {
11310
+ try {
11311
+ // Only attempt migration if we have password auth and V2 storage might be incomplete
11312
+ if (this.deviceAuthType === exports.AuthType.Password && authenticationOptions.password) {
11313
+ try {
11314
+ await this.walletService.handleUpdateToV2({
11315
+ password: authenticationOptions.password,
11316
+ walletId: walletId,
11317
+ });
11318
+ }
11319
+ catch (error) {
11320
+ // If migration fails, log it but don't block the transaction
11321
+ // The original transaction logic will handle missing storage items appropriately
11322
+ logger.debug('Migration to V2 failed, continuing with original flow:', error);
11323
+ }
11324
+ }
11325
+ const { deviceAuthPublicKey, signatureMessage, readyForTransportSeedPhrase, sharesEncryptedWithWallabyPubKey, hasShares } = await this.prepareTransactionAuth(authenticationOptions, walletId);
11326
+ if (!readyForTransportSeedPhrase && !hasShares) {
11327
+ throw new Error('No valid seed option found on this device.');
11328
+ }
11329
+ const confirmPendingTransactionResponse = await this.request(TransactionsRoutes.confirmPendingTransaction, {
11330
+ payload: Object.assign(Object.assign({}, signatureMessage), { clientAuthPubKey: deviceAuthPublicKey, encryptedShares: sharesEncryptedWithWallabyPubKey, encryptedSeed: readyForTransportSeedPhrase, id,
11331
+ choice,
11332
+ symbol,
11333
+ chainName,
11334
+ walletId }),
11335
+ });
11336
+ return confirmPendingTransactionResponse;
11337
+ }
11338
+ catch (error) {
11339
+ logger.error('SDK::Transactions::transfer::error', error);
11340
+ throw error;
11341
+ }
11342
+ }
11284
11343
  /**
11285
11344
  * Prepares authentication data and encrypted payload for transaction requests
11286
11345
  * @private
11287
11346
  */
11288
11347
  async prepareTransactionAuth(authenticationOptions, walletId) {
11289
- const { password, prfValue, user } = authenticationOptions;
11348
+ const { password, prfValue, user, clientSalt: authClientSalt } = authenticationOptions;
11290
11349
  const encryptedDevicePrivateKey = await this.localStorageService.fetch(exports.LocalStorageItems.EncryptedDevicePrivateKey, {
11291
11350
  walletId,
11292
11351
  });
11293
- console.log('user_in_prepare_tx_auth', user);
11294
11352
  if (!encryptedDevicePrivateKey) {
11295
11353
  throw new WallabyError({
11296
11354
  message: 'No private key was found on this device.',
@@ -11299,11 +11357,12 @@ class Transactions extends Base {
11299
11357
  });
11300
11358
  }
11301
11359
  // Get credentials key pair for device private key decryption
11360
+ const clientSalt = authClientSalt || user.clientSalt;
11302
11361
  const credentialsKeyPair = await this.cipher.getCredentialsKeyPair({
11303
11362
  authType: this.deviceAuthType,
11304
11363
  password,
11305
11364
  prfValue,
11306
- salt: user.clientSalt,
11365
+ salt: clientSalt,
11307
11366
  });
11308
11367
  // Decrypt device private key
11309
11368
  const decryptedDevicePrivateKey = await this.cipher.decrypt({
@@ -11348,7 +11407,7 @@ class Transactions extends Base {
11348
11407
  authType: this.deviceAuthType,
11349
11408
  password,
11350
11409
  prfValue,
11351
- salt: user.clientSalt,
11410
+ salt: clientSalt,
11352
11411
  },
11353
11412
  });
11354
11413
  }
@@ -11363,7 +11422,7 @@ class Transactions extends Base {
11363
11422
  authType: this.deviceAuthType,
11364
11423
  password,
11365
11424
  prfValue,
11366
- salt: user.clientSalt,
11425
+ salt: clientSalt,
11367
11426
  },
11368
11427
  });
11369
11428
  sharesEncryptedWithWallabyPubKey.push(readyForTransportShare);
@@ -11389,6 +11448,12 @@ __decorate([
11389
11448
  __metadata("design:paramtypes", [Object]),
11390
11449
  __metadata("design:returntype", Promise)
11391
11450
  ], Transactions.prototype, "createAllowance", null);
11451
+ __decorate([
11452
+ WithLock('confirmPendingTransaction'),
11453
+ __metadata("design:type", Function),
11454
+ __metadata("design:paramtypes", [Object]),
11455
+ __metadata("design:returntype", Promise)
11456
+ ], Transactions.prototype, "resolvePendingTransaction", null);
11392
11457
 
11393
11458
  /**
11394
11459
  * The Wallaby SDK client. This class is the main entry point into Wallaby's