@injectivelabs/wallet-core 1.20.63 → 1.20.65-alpha.0
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-B0iDYqb7.cjs → broadcaster-Lug_y4Nm.cjs} +6 -2
- package/dist/cjs/broadcaster.cjs +1 -1
- package/dist/cjs/broadcaster.d.cts +1 -1
- package/dist/cjs/{index-TB1ybJUD.d.cts → index-APoDJvOs.d.cts} +2 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/esm/{broadcaster-DO14o8eB.js → broadcaster-CJr3Nnyk.js} +7 -3
- package/dist/esm/broadcaster.d.ts +1 -1
- package/dist/esm/broadcaster.js +1 -1
- package/dist/esm/{index-B1XSJ1Zx.d.ts → index-9EprSoyp.d.ts} +2 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +7 -7
|
@@ -44,6 +44,7 @@ var MsgBroadcaster = class {
|
|
|
44
44
|
require_defineProperty._defineProperty(this, "useDynamicBaseFee", false);
|
|
45
45
|
require_defineProperty._defineProperty(this, "useFixedGas", false);
|
|
46
46
|
require_defineProperty._defineProperty(this, "txTimeoutOnFeeDelegation", false);
|
|
47
|
+
require_defineProperty._defineProperty(this, "eip712Version", void 0);
|
|
47
48
|
require_defineProperty._defineProperty(this, "evmChainId", void 0);
|
|
48
49
|
require_defineProperty._defineProperty(this, "gasBufferCoefficient", 1.2);
|
|
49
50
|
require_defineProperty._defineProperty(this, "retriesOnError", defaultRetriesConfig());
|
|
@@ -56,6 +57,7 @@ var MsgBroadcaster = class {
|
|
|
56
57
|
this.useFixedGas = options.useFixedGas !== void 0 ? options.useFixedGas : false;
|
|
57
58
|
this.txTimeout = options.txTimeout || __injectivelabs_utils.DEFAULT_BLOCK_TIMEOUT_HEIGHT;
|
|
58
59
|
this.txTimeoutOnFeeDelegation = options.txTimeoutOnFeeDelegation !== void 0 ? options.txTimeoutOnFeeDelegation : true;
|
|
60
|
+
this.eip712Version = options.eip712Version;
|
|
59
61
|
this.gasBufferCoefficient = options.gasBufferCoefficient || 1.2;
|
|
60
62
|
this.chainId = options.chainId || networkInfo.chainId;
|
|
61
63
|
this.evmChainId = options.evmChainId || networkInfo.evmChainId;
|
|
@@ -70,6 +72,7 @@ var MsgBroadcaster = class {
|
|
|
70
72
|
this.useFixedGas = options.useFixedGas !== void 0 ? options.useFixedGas : this.useFixedGas;
|
|
71
73
|
this.txTimeout = options.txTimeout !== void 0 ? options.txTimeout : this.txTimeout;
|
|
72
74
|
this.txTimeoutOnFeeDelegation = options.txTimeoutOnFeeDelegation !== void 0 ? options.txTimeoutOnFeeDelegation : this.txTimeoutOnFeeDelegation;
|
|
75
|
+
this.eip712Version = options.eip712Version !== void 0 ? options.eip712Version : this.eip712Version;
|
|
73
76
|
this.txInclusion = options.txInclusion !== void 0 ? options.txInclusion : this.txInclusion;
|
|
74
77
|
}
|
|
75
78
|
resolveGasOptions(msgs, gas) {
|
|
@@ -482,7 +485,7 @@ var MsgBroadcaster = class {
|
|
|
482
485
|
* @returns transaction hash
|
|
483
486
|
*/
|
|
484
487
|
async broadcastEip712WithFeeDelegation(tx) {
|
|
485
|
-
var _tx$gas3;
|
|
488
|
+
var _tx$gas3, _this$eip712Version;
|
|
486
489
|
const { endpoints, httpHeaders, walletStrategy, txTimeoutOnFeeDelegation } = this;
|
|
487
490
|
const txTimeoutInBlocks = this.resolveTimeoutInBlocks(tx.txTimeoutInBlocks);
|
|
488
491
|
const msgs = Array.isArray(tx.msgs) ? tx.msgs : [tx.msgs];
|
|
@@ -515,7 +518,8 @@ var MsgBroadcaster = class {
|
|
|
515
518
|
address: tx.ethereumAddress,
|
|
516
519
|
chainId: evmChainId,
|
|
517
520
|
gasLimit,
|
|
518
|
-
estimateGas
|
|
521
|
+
estimateGas,
|
|
522
|
+
eip712Version: (_this$eip712Version = this.eip712Version) !== null && _this$eip712Version !== void 0 ? _this$eip712Version : (0, __injectivelabs_wallet_base.isEip712V3Wallet)(walletStrategy.wallet) ? "v3" : "v2"
|
|
519
523
|
});
|
|
520
524
|
walletStrategy.emit(__injectivelabs_wallet_base.WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
521
525
|
const signature = await walletStrategy.signEip712TypedData(prepareTxResponse.data, tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
package/dist/cjs/broadcaster.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "./BaseWalletStrategy-CD9sBzZB.cjs";
|
|
2
|
-
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-
|
|
2
|
+
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-APoDJvOs.cjs";
|
|
3
3
|
export { MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, Web3Broadcaster };
|
|
@@ -41,6 +41,7 @@ interface MsgBroadcasterOptions {
|
|
|
41
41
|
/** Buffers automatic message presets by 1.2 for Cosmos wallet strategies. */
|
|
42
42
|
useFixedGas?: boolean;
|
|
43
43
|
txTimeoutOnFeeDelegation?: boolean;
|
|
44
|
+
eip712Version?: 'v2' | 'v3';
|
|
44
45
|
gasBufferCoefficient?: number;
|
|
45
46
|
httpHeaders?: Record<string, string>;
|
|
46
47
|
}
|
|
@@ -63,6 +64,7 @@ declare class MsgBroadcaster {
|
|
|
63
64
|
useDynamicBaseFee: boolean;
|
|
64
65
|
useFixedGas: boolean;
|
|
65
66
|
txTimeoutOnFeeDelegation: boolean;
|
|
67
|
+
eip712Version?: MsgBroadcasterOptions['eip712Version'];
|
|
66
68
|
evmChainId?: EvmChainId;
|
|
67
69
|
gasBufferCoefficient: number;
|
|
68
70
|
retriesOnError: {
|
package/dist/cjs/index.cjs
CHANGED
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-CD9sBzZB.cjs";
|
|
2
|
-
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-
|
|
2
|
+
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-APoDJvOs.cjs";
|
|
3
3
|
import "./index-DLoAMD9J.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/tx.d.ts
|
|
@@ -7,7 +7,7 @@ import { IndexerGrpcWeb3GwApi } from "@injectivelabs/sdk-ts/client/indexer";
|
|
|
7
7
|
import { getNetworkEndpoints, getNetworkInfo, isMainnet, isTestnet } from "@injectivelabs/networks";
|
|
8
8
|
import { ChainGrpcAuthApi, ChainGrpcTendermintApi, ChainGrpcTxFeesApi } from "@injectivelabs/sdk-ts/client/chain";
|
|
9
9
|
import { DEFAULT_BLOCK_TIMEOUT_HEIGHT, DEFAULT_BLOCK_TIME_IN_SECONDS, DEFAULT_GAS_PRICE, getStdFee, isAbortError, sleep, toBigNumber } from "@injectivelabs/utils";
|
|
10
|
-
import { Wallet, WalletDeviceType, WalletStrategyEmitterEventType, createEip712StdSignDoc, getEthereumSignerAddress, getInjectiveSignerAddress, isCosmosAminoOnlyWallet, isCosmosWallet, isEip712V2OnlyWallet, isEvmBrowserWallet } from "@injectivelabs/wallet-base";
|
|
10
|
+
import { Wallet, WalletDeviceType, WalletStrategyEmitterEventType, createEip712StdSignDoc, getEthereumSignerAddress, getInjectiveSignerAddress, isCosmosAminoOnlyWallet, isCosmosWallet, isEip712V2OnlyWallet, isEip712V3Wallet, isEvmBrowserWallet } from "@injectivelabs/wallet-base";
|
|
11
11
|
import { CosmosTxV1Beta1TxPb, SIGN_DIRECT, SIGN_EIP712, SIGN_EIP712_V2, TxClient, TxGrpcApi, TxObservationAbortError, createTransaction, createTransactionWithSigners, createTxRawEIP712, createTxRawFromSigResponse, createWeb3Extension, getAminoStdSignDoc, getEip712TypedData, getEip712TypedDataV2, getTxObservationSignals, observeTx } from "@injectivelabs/sdk-ts/core/tx";
|
|
12
12
|
|
|
13
13
|
//#region src/utils/tx.ts
|
|
@@ -44,6 +44,7 @@ var MsgBroadcaster = class {
|
|
|
44
44
|
_defineProperty(this, "useDynamicBaseFee", false);
|
|
45
45
|
_defineProperty(this, "useFixedGas", false);
|
|
46
46
|
_defineProperty(this, "txTimeoutOnFeeDelegation", false);
|
|
47
|
+
_defineProperty(this, "eip712Version", void 0);
|
|
47
48
|
_defineProperty(this, "evmChainId", void 0);
|
|
48
49
|
_defineProperty(this, "gasBufferCoefficient", 1.2);
|
|
49
50
|
_defineProperty(this, "retriesOnError", defaultRetriesConfig());
|
|
@@ -56,6 +57,7 @@ var MsgBroadcaster = class {
|
|
|
56
57
|
this.useFixedGas = options.useFixedGas !== void 0 ? options.useFixedGas : false;
|
|
57
58
|
this.txTimeout = options.txTimeout || DEFAULT_BLOCK_TIMEOUT_HEIGHT;
|
|
58
59
|
this.txTimeoutOnFeeDelegation = options.txTimeoutOnFeeDelegation !== void 0 ? options.txTimeoutOnFeeDelegation : true;
|
|
60
|
+
this.eip712Version = options.eip712Version;
|
|
59
61
|
this.gasBufferCoefficient = options.gasBufferCoefficient || 1.2;
|
|
60
62
|
this.chainId = options.chainId || networkInfo.chainId;
|
|
61
63
|
this.evmChainId = options.evmChainId || networkInfo.evmChainId;
|
|
@@ -70,6 +72,7 @@ var MsgBroadcaster = class {
|
|
|
70
72
|
this.useFixedGas = options.useFixedGas !== void 0 ? options.useFixedGas : this.useFixedGas;
|
|
71
73
|
this.txTimeout = options.txTimeout !== void 0 ? options.txTimeout : this.txTimeout;
|
|
72
74
|
this.txTimeoutOnFeeDelegation = options.txTimeoutOnFeeDelegation !== void 0 ? options.txTimeoutOnFeeDelegation : this.txTimeoutOnFeeDelegation;
|
|
75
|
+
this.eip712Version = options.eip712Version !== void 0 ? options.eip712Version : this.eip712Version;
|
|
73
76
|
this.txInclusion = options.txInclusion !== void 0 ? options.txInclusion : this.txInclusion;
|
|
74
77
|
}
|
|
75
78
|
resolveGasOptions(msgs, gas) {
|
|
@@ -482,7 +485,7 @@ var MsgBroadcaster = class {
|
|
|
482
485
|
* @returns transaction hash
|
|
483
486
|
*/
|
|
484
487
|
async broadcastEip712WithFeeDelegation(tx) {
|
|
485
|
-
var _tx$gas3;
|
|
488
|
+
var _tx$gas3, _this$eip712Version;
|
|
486
489
|
const { endpoints, httpHeaders, walletStrategy, txTimeoutOnFeeDelegation } = this;
|
|
487
490
|
const txTimeoutInBlocks = this.resolveTimeoutInBlocks(tx.txTimeoutInBlocks);
|
|
488
491
|
const msgs = Array.isArray(tx.msgs) ? tx.msgs : [tx.msgs];
|
|
@@ -515,7 +518,8 @@ var MsgBroadcaster = class {
|
|
|
515
518
|
address: tx.ethereumAddress,
|
|
516
519
|
chainId: evmChainId,
|
|
517
520
|
gasLimit,
|
|
518
|
-
estimateGas
|
|
521
|
+
estimateGas,
|
|
522
|
+
eip712Version: (_this$eip712Version = this.eip712Version) !== null && _this$eip712Version !== void 0 ? _this$eip712Version : isEip712V3Wallet(walletStrategy.wallet) ? "v3" : "v2"
|
|
519
523
|
});
|
|
520
524
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
521
525
|
const signature = await walletStrategy.signEip712TypedData(prepareTxResponse.data, tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "./BaseWalletStrategy-2HVN2oeB.js";
|
|
2
|
-
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-
|
|
2
|
+
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-9EprSoyp.js";
|
|
3
3
|
export { MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, Web3Broadcaster };
|
package/dist/esm/broadcaster.js
CHANGED
|
@@ -41,6 +41,7 @@ interface MsgBroadcasterOptions {
|
|
|
41
41
|
/** Buffers automatic message presets by 1.2 for Cosmos wallet strategies. */
|
|
42
42
|
useFixedGas?: boolean;
|
|
43
43
|
txTimeoutOnFeeDelegation?: boolean;
|
|
44
|
+
eip712Version?: 'v2' | 'v3';
|
|
44
45
|
gasBufferCoefficient?: number;
|
|
45
46
|
httpHeaders?: Record<string, string>;
|
|
46
47
|
}
|
|
@@ -63,6 +64,7 @@ declare class MsgBroadcaster {
|
|
|
63
64
|
useDynamicBaseFee: boolean;
|
|
64
65
|
useFixedGas: boolean;
|
|
65
66
|
txTimeoutOnFeeDelegation: boolean;
|
|
67
|
+
eip712Version?: MsgBroadcasterOptions['eip712Version'];
|
|
66
68
|
evmChainId?: EvmChainId;
|
|
67
69
|
gasBufferCoefficient: number;
|
|
68
70
|
retriesOnError: {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-2HVN2oeB.js";
|
|
2
|
-
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-
|
|
2
|
+
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-9EprSoyp.js";
|
|
3
3
|
import "./index-DRYular4.js";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/tx.d.ts
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MsgBroadcaster, r as checkIfTxRunOutOfGas, t as Web3Broadcaster } from "./broadcaster-
|
|
1
|
+
import { n as MsgBroadcaster, r as checkIfTxRunOutOfGas, t as Web3Broadcaster } from "./broadcaster-CJr3Nnyk.js";
|
|
2
2
|
import "./defineProperty-D4YE9KXX.js";
|
|
3
3
|
import { t as BaseWalletStrategy } from "./strategy-Co4vD1wN.js";
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-core",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.65-alpha.0",
|
|
4
4
|
"description": "Core wallet strategy",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@keplr-wallet/types": "^0.12.296",
|
|
86
86
|
"eventemitter3": "^5.0.1",
|
|
87
|
-
"@injectivelabs/exceptions": "1.20.
|
|
88
|
-
"@injectivelabs/
|
|
89
|
-
"@injectivelabs/
|
|
90
|
-
"@injectivelabs/
|
|
91
|
-
"@injectivelabs/
|
|
92
|
-
"@injectivelabs/
|
|
87
|
+
"@injectivelabs/exceptions": "1.20.65-alpha.0",
|
|
88
|
+
"@injectivelabs/sdk-ts": "1.20.65-alpha.0",
|
|
89
|
+
"@injectivelabs/ts-types": "1.20.65-alpha.0",
|
|
90
|
+
"@injectivelabs/networks": "1.20.65-alpha.0",
|
|
91
|
+
"@injectivelabs/utils": "1.20.65-alpha.0",
|
|
92
|
+
"@injectivelabs/wallet-base": "1.20.65-alpha.0"
|
|
93
93
|
},
|
|
94
94
|
"publishConfig": {
|
|
95
95
|
"access": "public"
|