@injectivelabs/wallet-core 1.16.19 → 1.16.20
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/cjs/broadcaster/MsgBroadcaster.js +19 -9
- package/dist/cjs/strategy/BaseWalletStrategy.d.ts +3 -1
- package/dist/cjs/strategy/BaseWalletStrategy.js +2 -2
- package/dist/esm/broadcaster/MsgBroadcaster.js +19 -9
- package/dist/esm/strategy/BaseWalletStrategy.d.ts +3 -1
- package/dist/esm/strategy/BaseWalletStrategy.js +2 -2
- package/package.json +8 -8
|
@@ -223,6 +223,8 @@ class MsgBroadcaster {
|
|
|
223
223
|
/** Account Details * */
|
|
224
224
|
const { baseAccount, latestHeight } = await this.fetchAccountAndBlockDetails(tx.injectiveAddress);
|
|
225
225
|
const timeoutHeight = (0, utils_1.toBigNumber)(latestHeight).plus(txTimeoutInBlocks);
|
|
226
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * utils_1.DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
227
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
226
228
|
const gas = (tx.gas?.gas || (0, sdk_ts_1.getGasPriceBasedOnMessage)(msgs)).toString();
|
|
227
229
|
let stdFee = (0, utils_1.getStdFee)({ ...tx.gas, gas });
|
|
228
230
|
/**
|
|
@@ -263,7 +265,7 @@ class MsgBroadcaster {
|
|
|
263
265
|
evmChainId,
|
|
264
266
|
});
|
|
265
267
|
/** Signing on Ethereum */
|
|
266
|
-
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress);
|
|
268
|
+
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
|
267
269
|
const pubKeyOrSignatureDerivedPubKey = await getEthereumWalletPubKey({
|
|
268
270
|
pubKey: baseAccount.pubKey?.key,
|
|
269
271
|
eip712TypedData,
|
|
@@ -294,7 +296,7 @@ class MsgBroadcaster {
|
|
|
294
296
|
address: tx.injectiveAddress,
|
|
295
297
|
});
|
|
296
298
|
walletStrategy.emit(types_js_1.WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
297
|
-
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
299
|
+
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
298
300
|
}
|
|
299
301
|
/**
|
|
300
302
|
* Prepare/sign/broadcast transaction using
|
|
@@ -315,6 +317,8 @@ class MsgBroadcaster {
|
|
|
315
317
|
/** Account Details * */
|
|
316
318
|
const { baseAccount, latestHeight } = await this.fetchAccountAndBlockDetails(tx.injectiveAddress);
|
|
317
319
|
const timeoutHeight = (0, utils_1.toBigNumber)(latestHeight).plus(txTimeoutInBlocks);
|
|
320
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * utils_1.DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
321
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
318
322
|
const gas = (tx.gas?.gas || (0, sdk_ts_1.getGasPriceBasedOnMessage)(msgs)).toString();
|
|
319
323
|
let stdFee = (0, utils_1.getStdFee)({ ...tx.gas, gas });
|
|
320
324
|
/**
|
|
@@ -357,7 +361,7 @@ class MsgBroadcaster {
|
|
|
357
361
|
});
|
|
358
362
|
walletStrategy.emit(types_js_1.WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
359
363
|
/** Signing on Ethereum */
|
|
360
|
-
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress);
|
|
364
|
+
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
|
361
365
|
const pubKeyOrSignatureDerivedPubKey = await getEthereumWalletPubKey({
|
|
362
366
|
pubKey: baseAccount.pubKey?.key,
|
|
363
367
|
eip712TypedData,
|
|
@@ -388,7 +392,7 @@ class MsgBroadcaster {
|
|
|
388
392
|
address: tx.injectiveAddress,
|
|
389
393
|
});
|
|
390
394
|
walletStrategy.emit(types_js_1.WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
391
|
-
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
395
|
+
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
392
396
|
}
|
|
393
397
|
/**
|
|
394
398
|
* Prepare/sign/broadcast transaction using
|
|
@@ -409,6 +413,8 @@ class MsgBroadcaster {
|
|
|
409
413
|
if (httpHeaders) {
|
|
410
414
|
transactionApi.setMetadata(httpHeaders);
|
|
411
415
|
}
|
|
416
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * utils_1.DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
417
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
412
418
|
let timeoutHeight = undefined;
|
|
413
419
|
if (txTimeoutOnFeeDelegation) {
|
|
414
420
|
const latestBlock = await new sdk_ts_1.ChainGrpcTendermintApi(endpoints.grpc).fetchLatestBlock();
|
|
@@ -428,7 +434,7 @@ class MsgBroadcaster {
|
|
|
428
434
|
estimateGas: simulateTx,
|
|
429
435
|
});
|
|
430
436
|
walletStrategy.emit(types_js_1.WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
431
|
-
const signature = await walletStrategy.signEip712TypedData(prepareTxResponse.data, tx.ethereumAddress);
|
|
437
|
+
const signature = await walletStrategy.signEip712TypedData(prepareTxResponse.data, tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
|
432
438
|
const broadcast = async () => await transactionApi.broadcastTxRequest({
|
|
433
439
|
signature,
|
|
434
440
|
message: web3Msgs,
|
|
@@ -439,7 +445,7 @@ class MsgBroadcaster {
|
|
|
439
445
|
walletStrategy.emit(types_js_1.WalletStrategyEmitterEventType.TransactionBroadcastStart);
|
|
440
446
|
const response = await broadcast();
|
|
441
447
|
walletStrategy.emit(types_js_1.WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
442
|
-
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
448
|
+
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
443
449
|
}
|
|
444
450
|
catch (e) {
|
|
445
451
|
const error = e;
|
|
@@ -489,6 +495,8 @@ class MsgBroadcaster {
|
|
|
489
495
|
}
|
|
490
496
|
const { baseAccount, latestHeight } = await this.fetchAccountAndBlockDetails(tx.injectiveAddress);
|
|
491
497
|
const timeoutHeight = (0, utils_1.toBigNumber)(latestHeight).plus(txTimeoutInBlocks);
|
|
498
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * utils_1.DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
499
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
492
500
|
const signMode = (0, wallet_base_1.isCosmosAminoOnlyWallet)(walletStrategy.wallet)
|
|
493
501
|
? sdk_ts_1.SIGN_EIP712
|
|
494
502
|
: sdk_ts_1.SIGN_DIRECT;
|
|
@@ -535,7 +543,7 @@ class MsgBroadcaster {
|
|
|
535
543
|
txTimeout: txTimeoutInBlocks,
|
|
536
544
|
});
|
|
537
545
|
walletStrategy.emit(types_js_1.WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
538
|
-
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
546
|
+
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
539
547
|
}
|
|
540
548
|
const directSignResponse = (await walletStrategy.signCosmosTransaction({
|
|
541
549
|
txRaw,
|
|
@@ -551,7 +559,7 @@ class MsgBroadcaster {
|
|
|
551
559
|
address: tx.injectiveAddress,
|
|
552
560
|
});
|
|
553
561
|
walletStrategy.emit(types_js_1.WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
554
|
-
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
562
|
+
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
555
563
|
}
|
|
556
564
|
/**
|
|
557
565
|
* We use this method only when we want to broadcast a transaction using Ledger on Keplr/Leap for Injective
|
|
@@ -680,6 +688,8 @@ class MsgBroadcaster {
|
|
|
680
688
|
const timeoutHeight = (0, utils_1.toBigNumber)(latestHeight).plus(txTimeoutOnFeeDelegation
|
|
681
689
|
? txTimeoutInBlocks
|
|
682
690
|
: utils_1.DEFAULT_BLOCK_TIMEOUT_HEIGHT);
|
|
691
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * utils_1.DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
692
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
683
693
|
const pubKey = await walletStrategy.getPubKey();
|
|
684
694
|
const gas = (tx.gas?.gas || (0, sdk_ts_1.getGasPriceBasedOnMessage)(msgs)).toString();
|
|
685
695
|
/** Prepare the Transaction * */
|
|
@@ -735,7 +745,7 @@ class MsgBroadcaster {
|
|
|
735
745
|
if (canDisableCosmosGasCheck && cosmosWallet.enableGasCheck) {
|
|
736
746
|
cosmosWallet.enableGasCheck(chainId);
|
|
737
747
|
}
|
|
738
|
-
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
748
|
+
return await new sdk_ts_1.TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
739
749
|
}
|
|
740
750
|
catch (e) {
|
|
741
751
|
const error = e;
|
|
@@ -35,7 +35,9 @@ export default class BaseWalletStrategy implements WalletStrategyInterface {
|
|
|
35
35
|
evmChainId: EvmChainId;
|
|
36
36
|
address: AccountAddress;
|
|
37
37
|
}): Promise<string>;
|
|
38
|
-
signEip712TypedData(eip712TypedData: string, address: AccountAddress
|
|
38
|
+
signEip712TypedData(eip712TypedData: string, address: AccountAddress, options?: {
|
|
39
|
+
txTimeout?: number;
|
|
40
|
+
}): Promise<string>;
|
|
39
41
|
signAminoCosmosTransaction(transaction: {
|
|
40
42
|
signDoc: StdSignDoc;
|
|
41
43
|
address: string;
|
|
@@ -98,7 +98,7 @@ class BaseWalletStrategy {
|
|
|
98
98
|
async sendEvmTransaction(tx /* TODO */, options) {
|
|
99
99
|
return this.getStrategy().sendEvmTransaction(tx, options);
|
|
100
100
|
}
|
|
101
|
-
async signEip712TypedData(eip712TypedData, address) {
|
|
101
|
+
async signEip712TypedData(eip712TypedData, address, options = {}) {
|
|
102
102
|
if ((0, wallet_base_1.isCosmosWallet)(this.wallet)) {
|
|
103
103
|
throw new exceptions_1.WalletException(new Error(`You can't sign Ethereum Transaction using ${this.wallet}`));
|
|
104
104
|
}
|
|
@@ -107,7 +107,7 @@ class BaseWalletStrategy {
|
|
|
107
107
|
await this.enable();
|
|
108
108
|
}
|
|
109
109
|
this.emit(types_js_1.WalletStrategyEmitterEventType.TransactionSignStart);
|
|
110
|
-
const response = await this.getStrategy().signEip712TypedData(eip712TypedData, address);
|
|
110
|
+
const response = await this.getStrategy().signEip712TypedData(eip712TypedData, address, options);
|
|
111
111
|
this.emit(types_js_1.WalletStrategyEmitterEventType.TransactionSigned);
|
|
112
112
|
return response;
|
|
113
113
|
}
|
|
@@ -220,6 +220,8 @@ export class MsgBroadcaster {
|
|
|
220
220
|
/** Account Details * */
|
|
221
221
|
const { baseAccount, latestHeight } = await this.fetchAccountAndBlockDetails(tx.injectiveAddress);
|
|
222
222
|
const timeoutHeight = toBigNumber(latestHeight).plus(txTimeoutInBlocks);
|
|
223
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
224
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
223
225
|
const gas = (tx.gas?.gas || getGasPriceBasedOnMessage(msgs)).toString();
|
|
224
226
|
let stdFee = getStdFee({ ...tx.gas, gas });
|
|
225
227
|
/**
|
|
@@ -260,7 +262,7 @@ export class MsgBroadcaster {
|
|
|
260
262
|
evmChainId,
|
|
261
263
|
});
|
|
262
264
|
/** Signing on Ethereum */
|
|
263
|
-
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress);
|
|
265
|
+
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
|
264
266
|
const pubKeyOrSignatureDerivedPubKey = await getEthereumWalletPubKey({
|
|
265
267
|
pubKey: baseAccount.pubKey?.key,
|
|
266
268
|
eip712TypedData,
|
|
@@ -291,7 +293,7 @@ export class MsgBroadcaster {
|
|
|
291
293
|
address: tx.injectiveAddress,
|
|
292
294
|
});
|
|
293
295
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
294
|
-
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
296
|
+
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
295
297
|
}
|
|
296
298
|
/**
|
|
297
299
|
* Prepare/sign/broadcast transaction using
|
|
@@ -312,6 +314,8 @@ export class MsgBroadcaster {
|
|
|
312
314
|
/** Account Details * */
|
|
313
315
|
const { baseAccount, latestHeight } = await this.fetchAccountAndBlockDetails(tx.injectiveAddress);
|
|
314
316
|
const timeoutHeight = toBigNumber(latestHeight).plus(txTimeoutInBlocks);
|
|
317
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
318
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
315
319
|
const gas = (tx.gas?.gas || getGasPriceBasedOnMessage(msgs)).toString();
|
|
316
320
|
let stdFee = getStdFee({ ...tx.gas, gas });
|
|
317
321
|
/**
|
|
@@ -354,7 +358,7 @@ export class MsgBroadcaster {
|
|
|
354
358
|
});
|
|
355
359
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
356
360
|
/** Signing on Ethereum */
|
|
357
|
-
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress);
|
|
361
|
+
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
|
358
362
|
const pubKeyOrSignatureDerivedPubKey = await getEthereumWalletPubKey({
|
|
359
363
|
pubKey: baseAccount.pubKey?.key,
|
|
360
364
|
eip712TypedData,
|
|
@@ -385,7 +389,7 @@ export class MsgBroadcaster {
|
|
|
385
389
|
address: tx.injectiveAddress,
|
|
386
390
|
});
|
|
387
391
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
388
|
-
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
392
|
+
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
389
393
|
}
|
|
390
394
|
/**
|
|
391
395
|
* Prepare/sign/broadcast transaction using
|
|
@@ -406,6 +410,8 @@ export class MsgBroadcaster {
|
|
|
406
410
|
if (httpHeaders) {
|
|
407
411
|
transactionApi.setMetadata(httpHeaders);
|
|
408
412
|
}
|
|
413
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
414
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
409
415
|
let timeoutHeight = undefined;
|
|
410
416
|
if (txTimeoutOnFeeDelegation) {
|
|
411
417
|
const latestBlock = await new ChainGrpcTendermintApi(endpoints.grpc).fetchLatestBlock();
|
|
@@ -425,7 +431,7 @@ export class MsgBroadcaster {
|
|
|
425
431
|
estimateGas: simulateTx,
|
|
426
432
|
});
|
|
427
433
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
428
|
-
const signature = await walletStrategy.signEip712TypedData(prepareTxResponse.data, tx.ethereumAddress);
|
|
434
|
+
const signature = await walletStrategy.signEip712TypedData(prepareTxResponse.data, tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
|
429
435
|
const broadcast = async () => await transactionApi.broadcastTxRequest({
|
|
430
436
|
signature,
|
|
431
437
|
message: web3Msgs,
|
|
@@ -436,7 +442,7 @@ export class MsgBroadcaster {
|
|
|
436
442
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionBroadcastStart);
|
|
437
443
|
const response = await broadcast();
|
|
438
444
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
439
|
-
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
445
|
+
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
440
446
|
}
|
|
441
447
|
catch (e) {
|
|
442
448
|
const error = e;
|
|
@@ -486,6 +492,8 @@ export class MsgBroadcaster {
|
|
|
486
492
|
}
|
|
487
493
|
const { baseAccount, latestHeight } = await this.fetchAccountAndBlockDetails(tx.injectiveAddress);
|
|
488
494
|
const timeoutHeight = toBigNumber(latestHeight).plus(txTimeoutInBlocks);
|
|
495
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
496
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
489
497
|
const signMode = isCosmosAminoOnlyWallet(walletStrategy.wallet)
|
|
490
498
|
? SIGN_EIP712
|
|
491
499
|
: SIGN_DIRECT;
|
|
@@ -532,7 +540,7 @@ export class MsgBroadcaster {
|
|
|
532
540
|
txTimeout: txTimeoutInBlocks,
|
|
533
541
|
});
|
|
534
542
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
535
|
-
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
543
|
+
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
536
544
|
}
|
|
537
545
|
const directSignResponse = (await walletStrategy.signCosmosTransaction({
|
|
538
546
|
txRaw,
|
|
@@ -548,7 +556,7 @@ export class MsgBroadcaster {
|
|
|
548
556
|
address: tx.injectiveAddress,
|
|
549
557
|
});
|
|
550
558
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionBroadcastEnd);
|
|
551
|
-
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
559
|
+
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
552
560
|
}
|
|
553
561
|
/**
|
|
554
562
|
* We use this method only when we want to broadcast a transaction using Ledger on Keplr/Leap for Injective
|
|
@@ -677,6 +685,8 @@ export class MsgBroadcaster {
|
|
|
677
685
|
const timeoutHeight = toBigNumber(latestHeight).plus(txTimeoutOnFeeDelegation
|
|
678
686
|
? txTimeoutInBlocks
|
|
679
687
|
: DEFAULT_BLOCK_TIMEOUT_HEIGHT);
|
|
688
|
+
const txTimeoutTimeInSeconds = txTimeoutInBlocks * DEFAULT_BLOCK_TIME_IN_SECONDS;
|
|
689
|
+
const txTimeoutTimeInMilliSeconds = txTimeoutTimeInSeconds * 1000;
|
|
680
690
|
const pubKey = await walletStrategy.getPubKey();
|
|
681
691
|
const gas = (tx.gas?.gas || getGasPriceBasedOnMessage(msgs)).toString();
|
|
682
692
|
/** Prepare the Transaction * */
|
|
@@ -732,7 +742,7 @@ export class MsgBroadcaster {
|
|
|
732
742
|
if (canDisableCosmosGasCheck && cosmosWallet.enableGasCheck) {
|
|
733
743
|
cosmosWallet.enableGasCheck(chainId);
|
|
734
744
|
}
|
|
735
|
-
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash,
|
|
745
|
+
return await new TxGrpcApi(endpoints.grpc).fetchTxPoll(response.txHash, txTimeoutTimeInMilliSeconds);
|
|
736
746
|
}
|
|
737
747
|
catch (e) {
|
|
738
748
|
const error = e;
|
|
@@ -35,7 +35,9 @@ export default class BaseWalletStrategy implements WalletStrategyInterface {
|
|
|
35
35
|
evmChainId: EvmChainId;
|
|
36
36
|
address: AccountAddress;
|
|
37
37
|
}): Promise<string>;
|
|
38
|
-
signEip712TypedData(eip712TypedData: string, address: AccountAddress
|
|
38
|
+
signEip712TypedData(eip712TypedData: string, address: AccountAddress, options?: {
|
|
39
|
+
txTimeout?: number;
|
|
40
|
+
}): Promise<string>;
|
|
39
41
|
signAminoCosmosTransaction(transaction: {
|
|
40
42
|
signDoc: StdSignDoc;
|
|
41
43
|
address: string;
|
|
@@ -96,7 +96,7 @@ export default class BaseWalletStrategy {
|
|
|
96
96
|
async sendEvmTransaction(tx /* TODO */, options) {
|
|
97
97
|
return this.getStrategy().sendEvmTransaction(tx, options);
|
|
98
98
|
}
|
|
99
|
-
async signEip712TypedData(eip712TypedData, address) {
|
|
99
|
+
async signEip712TypedData(eip712TypedData, address, options = {}) {
|
|
100
100
|
if (isCosmosWallet(this.wallet)) {
|
|
101
101
|
throw new WalletException(new Error(`You can't sign Ethereum Transaction using ${this.wallet}`));
|
|
102
102
|
}
|
|
@@ -105,7 +105,7 @@ export default class BaseWalletStrategy {
|
|
|
105
105
|
await this.enable();
|
|
106
106
|
}
|
|
107
107
|
this.emit(WalletStrategyEmitterEventType.TransactionSignStart);
|
|
108
|
-
const response = await this.getStrategy().signEip712TypedData(eip712TypedData, address);
|
|
108
|
+
const response = await this.getStrategy().signEip712TypedData(eip712TypedData, address, options);
|
|
109
109
|
this.emit(WalletStrategyEmitterEventType.TransactionSigned);
|
|
110
110
|
return response;
|
|
111
111
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-core",
|
|
3
3
|
"description": "Core wallet strategy",
|
|
4
|
-
"version": "1.16.
|
|
4
|
+
"version": "1.16.20",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": {
|
|
@@ -56,17 +56,17 @@
|
|
|
56
56
|
"start": "node dist/index.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@injectivelabs/exceptions": "1.16.
|
|
60
|
-
"@injectivelabs/networks": "1.16.
|
|
61
|
-
"@injectivelabs/sdk-ts": "1.16.
|
|
62
|
-
"@injectivelabs/ts-types": "1.16.
|
|
63
|
-
"@injectivelabs/utils": "1.16.
|
|
64
|
-
"@injectivelabs/wallet-base": "1.16.
|
|
59
|
+
"@injectivelabs/exceptions": "1.16.20",
|
|
60
|
+
"@injectivelabs/networks": "1.16.20",
|
|
61
|
+
"@injectivelabs/sdk-ts": "1.16.20",
|
|
62
|
+
"@injectivelabs/ts-types": "1.16.20",
|
|
63
|
+
"@injectivelabs/utils": "1.16.20",
|
|
64
|
+
"@injectivelabs/wallet-base": "1.16.20",
|
|
65
65
|
"@keplr-wallet/types": "^0.12.159",
|
|
66
66
|
"eventemitter3": "^5.0.1"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"shx": "^0.3.3"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "8c378352fe865570437048d0d11110eb417bbc78"
|
|
72
72
|
}
|