@@ -2185,7 +2185,7 @@ export class Wallet implements IWallet {
2185
2185
}
2186
2186
2187
2187
// Doing a sanity check for password here to avoid doing further work if we know it's wrong
2188
- const keychains = await this . getKeychainsAndValidatePassphrase ( {
2188
+ const keychainPromise = this . getKeychainsAndValidatePassphrase ( {
2189
2189
reqId : params . reqId ,
2190
2190
walletPassphrase : params . walletPassphrase ,
2191
2191
customSigningFunction : params . customSigningFunction ,
@@ -2201,9 +2201,24 @@ export class Wallet implements IWallet {
2201
2201
} else {
2202
2202
txPrebuildQuery = params . prebuildTx ? Promise . resolve ( params . prebuildTx ) : this . prebuildTransaction ( params ) ;
2203
2203
}
2204
+ let keychains : Keychain [ ] = [ ] ;
2205
+ let txPrebuild : PrebuildTransactionResult ;
2206
+
2207
+ const results = await Promise . allSettled ( [ keychainPromise , txPrebuildQuery ] ) ;
2204
2208
2205
- // the prebuild can be overridden by providing an explicit tx
2206
- const txPrebuild = ( await txPrebuildQuery ) as PrebuildTransactionResult ;
2209
+ // Handle keychain promise (index 0)
2210
+ if ( results [ 0 ] . status === 'fulfilled' ) {
2211
+ keychains = results [ 0 ] . value as Keychain [ ] ;
2212
+ } else {
2213
+ throw results [ 0 ] . reason ;
2214
+ }
2215
+
2216
+ // Handle txPrebuild promise (index 1)
2217
+ if ( results [ 1 ] . status === 'fulfilled' ) {
2218
+ txPrebuild = results [ 1 ] . value as PrebuildTransactionResult ;
2219
+ } else {
2220
+ throw results [ 1 ] . reason ;
2221
+ }
2207
2222
2208
2223
try {
2209
2224
await this . baseCoin . verifyTransaction ( {
0 commit comments