@injectivelabs/wallet-core 1.20.65-alpha.0 → 1.20.65
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-Lug_y4Nm.cjs → broadcaster-CQCw2ltY.cjs} +4 -6
- package/dist/cjs/broadcaster.cjs +1 -1
- package/dist/cjs/broadcaster.d.cts +1 -1
- package/dist/cjs/{index-APoDJvOs.d.cts → index-TB1ybJUD.d.cts} +0 -2
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/esm/{broadcaster-CJr3Nnyk.js → broadcaster-DleRmv3_.js} +5 -7
- package/dist/esm/broadcaster.d.ts +1 -1
- package/dist/esm/broadcaster.js +1 -1
- package/dist/esm/{index-9EprSoyp.d.ts → index-B1XSJ1Zx.d.ts} +0 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +7 -7
|
@@ -44,7 +44,6 @@ 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);
|
|
48
47
|
require_defineProperty._defineProperty(this, "evmChainId", void 0);
|
|
49
48
|
require_defineProperty._defineProperty(this, "gasBufferCoefficient", 1.2);
|
|
50
49
|
require_defineProperty._defineProperty(this, "retriesOnError", defaultRetriesConfig());
|
|
@@ -57,7 +56,6 @@ var MsgBroadcaster = class {
|
|
|
57
56
|
this.useFixedGas = options.useFixedGas !== void 0 ? options.useFixedGas : false;
|
|
58
57
|
this.txTimeout = options.txTimeout || __injectivelabs_utils.DEFAULT_BLOCK_TIMEOUT_HEIGHT;
|
|
59
58
|
this.txTimeoutOnFeeDelegation = options.txTimeoutOnFeeDelegation !== void 0 ? options.txTimeoutOnFeeDelegation : true;
|
|
60
|
-
this.eip712Version = options.eip712Version;
|
|
61
59
|
this.gasBufferCoefficient = options.gasBufferCoefficient || 1.2;
|
|
62
60
|
this.chainId = options.chainId || networkInfo.chainId;
|
|
63
61
|
this.evmChainId = options.evmChainId || networkInfo.evmChainId;
|
|
@@ -72,7 +70,6 @@ var MsgBroadcaster = class {
|
|
|
72
70
|
this.useFixedGas = options.useFixedGas !== void 0 ? options.useFixedGas : this.useFixedGas;
|
|
73
71
|
this.txTimeout = options.txTimeout !== void 0 ? options.txTimeout : this.txTimeout;
|
|
74
72
|
this.txTimeoutOnFeeDelegation = options.txTimeoutOnFeeDelegation !== void 0 ? options.txTimeoutOnFeeDelegation : this.txTimeoutOnFeeDelegation;
|
|
75
|
-
this.eip712Version = options.eip712Version !== void 0 ? options.eip712Version : this.eip712Version;
|
|
76
73
|
this.txInclusion = options.txInclusion !== void 0 ? options.txInclusion : this.txInclusion;
|
|
77
74
|
}
|
|
78
75
|
resolveGasOptions(msgs, gas) {
|
|
@@ -209,6 +206,7 @@ var MsgBroadcaster = class {
|
|
|
209
206
|
walletStrategy.emit(__injectivelabs_wallet_base.WalletStrategyEmitterEventType.TransactionBroadcastStart);
|
|
210
207
|
const txInclusionOptions = this.resolveTxInclusionOptions({ txInclusion });
|
|
211
208
|
const txResponse = await new __injectivelabs_sdk_ts_core_tx.TxGrpcApi(endpoints.grpc).broadcast(txRaw, {
|
|
209
|
+
broadcastEndpoint: endpoints.broadcastGrpc,
|
|
212
210
|
txTimeout: txTimeoutInBlocks,
|
|
213
211
|
...txInclusionOptions,
|
|
214
212
|
onBroadcast: () => {
|
|
@@ -485,7 +483,7 @@ var MsgBroadcaster = class {
|
|
|
485
483
|
* @returns transaction hash
|
|
486
484
|
*/
|
|
487
485
|
async broadcastEip712WithFeeDelegation(tx) {
|
|
488
|
-
var _tx$gas3
|
|
486
|
+
var _tx$gas3;
|
|
489
487
|
const { endpoints, httpHeaders, walletStrategy, txTimeoutOnFeeDelegation } = this;
|
|
490
488
|
const txTimeoutInBlocks = this.resolveTimeoutInBlocks(tx.txTimeoutInBlocks);
|
|
491
489
|
const msgs = Array.isArray(tx.msgs) ? tx.msgs : [tx.msgs];
|
|
@@ -518,8 +516,7 @@ var MsgBroadcaster = class {
|
|
|
518
516
|
address: tx.ethereumAddress,
|
|
519
517
|
chainId: evmChainId,
|
|
520
518
|
gasLimit,
|
|
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
|
+
estimateGas
|
|
523
520
|
});
|
|
524
521
|
walletStrategy.emit(__injectivelabs_wallet_base.WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
525
522
|
const signature = await walletStrategy.signEip712TypedData(prepareTxResponse.data, tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
|
@@ -775,6 +772,7 @@ var MsgBroadcaster = class {
|
|
|
775
772
|
txRawEip712.signatures = [(0, __injectivelabs_sdk_ts_utils.base64ToUint8Array)(aminoSignResponse.signature.signature)];
|
|
776
773
|
/** Broadcast the transaction */
|
|
777
774
|
const response = await new __injectivelabs_sdk_ts_core_tx.TxGrpcApi(endpoints.grpc).broadcast(txRawEip712, {
|
|
775
|
+
broadcastEndpoint: endpoints.broadcastGrpc,
|
|
778
776
|
txTimeout: txTimeoutInBlocks,
|
|
779
777
|
...this.resolveTxInclusionOptions(tx),
|
|
780
778
|
onBroadcast: () => {
|
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-TB1ybJUD.cjs";
|
|
3
3
|
export { MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, Web3Broadcaster };
|
|
@@ -41,7 +41,6 @@ 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';
|
|
45
44
|
gasBufferCoefficient?: number;
|
|
46
45
|
httpHeaders?: Record<string, string>;
|
|
47
46
|
}
|
|
@@ -64,7 +63,6 @@ declare class MsgBroadcaster {
|
|
|
64
63
|
useDynamicBaseFee: boolean;
|
|
65
64
|
useFixedGas: boolean;
|
|
66
65
|
txTimeoutOnFeeDelegation: boolean;
|
|
67
|
-
eip712Version?: MsgBroadcasterOptions['eip712Version'];
|
|
68
66
|
evmChainId?: EvmChainId;
|
|
69
67
|
gasBufferCoefficient: number;
|
|
70
68
|
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-TB1ybJUD.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,
|
|
10
|
+
import { Wallet, WalletDeviceType, WalletStrategyEmitterEventType, createEip712StdSignDoc, getEthereumSignerAddress, getInjectiveSignerAddress, isCosmosAminoOnlyWallet, isCosmosWallet, isEip712V2OnlyWallet, 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,7 +44,6 @@ 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);
|
|
48
47
|
_defineProperty(this, "evmChainId", void 0);
|
|
49
48
|
_defineProperty(this, "gasBufferCoefficient", 1.2);
|
|
50
49
|
_defineProperty(this, "retriesOnError", defaultRetriesConfig());
|
|
@@ -57,7 +56,6 @@ var MsgBroadcaster = class {
|
|
|
57
56
|
this.useFixedGas = options.useFixedGas !== void 0 ? options.useFixedGas : false;
|
|
58
57
|
this.txTimeout = options.txTimeout || DEFAULT_BLOCK_TIMEOUT_HEIGHT;
|
|
59
58
|
this.txTimeoutOnFeeDelegation = options.txTimeoutOnFeeDelegation !== void 0 ? options.txTimeoutOnFeeDelegation : true;
|
|
60
|
-
this.eip712Version = options.eip712Version;
|
|
61
59
|
this.gasBufferCoefficient = options.gasBufferCoefficient || 1.2;
|
|
62
60
|
this.chainId = options.chainId || networkInfo.chainId;
|
|
63
61
|
this.evmChainId = options.evmChainId || networkInfo.evmChainId;
|
|
@@ -72,7 +70,6 @@ var MsgBroadcaster = class {
|
|
|
72
70
|
this.useFixedGas = options.useFixedGas !== void 0 ? options.useFixedGas : this.useFixedGas;
|
|
73
71
|
this.txTimeout = options.txTimeout !== void 0 ? options.txTimeout : this.txTimeout;
|
|
74
72
|
this.txTimeoutOnFeeDelegation = options.txTimeoutOnFeeDelegation !== void 0 ? options.txTimeoutOnFeeDelegation : this.txTimeoutOnFeeDelegation;
|
|
75
|
-
this.eip712Version = options.eip712Version !== void 0 ? options.eip712Version : this.eip712Version;
|
|
76
73
|
this.txInclusion = options.txInclusion !== void 0 ? options.txInclusion : this.txInclusion;
|
|
77
74
|
}
|
|
78
75
|
resolveGasOptions(msgs, gas) {
|
|
@@ -209,6 +206,7 @@ var MsgBroadcaster = class {
|
|
|
209
206
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionBroadcastStart);
|
|
210
207
|
const txInclusionOptions = this.resolveTxInclusionOptions({ txInclusion });
|
|
211
208
|
const txResponse = await new TxGrpcApi(endpoints.grpc).broadcast(txRaw, {
|
|
209
|
+
broadcastEndpoint: endpoints.broadcastGrpc,
|
|
212
210
|
txTimeout: txTimeoutInBlocks,
|
|
213
211
|
...txInclusionOptions,
|
|
214
212
|
onBroadcast: () => {
|
|
@@ -485,7 +483,7 @@ var MsgBroadcaster = class {
|
|
|
485
483
|
* @returns transaction hash
|
|
486
484
|
*/
|
|
487
485
|
async broadcastEip712WithFeeDelegation(tx) {
|
|
488
|
-
var _tx$gas3
|
|
486
|
+
var _tx$gas3;
|
|
489
487
|
const { endpoints, httpHeaders, walletStrategy, txTimeoutOnFeeDelegation } = this;
|
|
490
488
|
const txTimeoutInBlocks = this.resolveTimeoutInBlocks(tx.txTimeoutInBlocks);
|
|
491
489
|
const msgs = Array.isArray(tx.msgs) ? tx.msgs : [tx.msgs];
|
|
@@ -518,8 +516,7 @@ var MsgBroadcaster = class {
|
|
|
518
516
|
address: tx.ethereumAddress,
|
|
519
517
|
chainId: evmChainId,
|
|
520
518
|
gasLimit,
|
|
521
|
-
estimateGas
|
|
522
|
-
eip712Version: (_this$eip712Version = this.eip712Version) !== null && _this$eip712Version !== void 0 ? _this$eip712Version : isEip712V3Wallet(walletStrategy.wallet) ? "v3" : "v2"
|
|
519
|
+
estimateGas
|
|
523
520
|
});
|
|
524
521
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
525
522
|
const signature = await walletStrategy.signEip712TypedData(prepareTxResponse.data, tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
|
|
@@ -775,6 +772,7 @@ var MsgBroadcaster = class {
|
|
|
775
772
|
txRawEip712.signatures = [base64ToUint8Array(aminoSignResponse.signature.signature)];
|
|
776
773
|
/** Broadcast the transaction */
|
|
777
774
|
const response = await new TxGrpcApi(endpoints.grpc).broadcast(txRawEip712, {
|
|
775
|
+
broadcastEndpoint: endpoints.broadcastGrpc,
|
|
778
776
|
txTimeout: txTimeoutInBlocks,
|
|
779
777
|
...this.resolveTxInclusionOptions(tx),
|
|
780
778
|
onBroadcast: () => {
|
|
@@ -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-B1XSJ1Zx.js";
|
|
3
3
|
export { MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, Web3Broadcaster };
|
package/dist/esm/broadcaster.js
CHANGED
|
@@ -41,7 +41,6 @@ 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';
|
|
45
44
|
gasBufferCoefficient?: number;
|
|
46
45
|
httpHeaders?: Record<string, string>;
|
|
47
46
|
}
|
|
@@ -64,7 +63,6 @@ declare class MsgBroadcaster {
|
|
|
64
63
|
useDynamicBaseFee: boolean;
|
|
65
64
|
useFixedGas: boolean;
|
|
66
65
|
txTimeoutOnFeeDelegation: boolean;
|
|
67
|
-
eip712Version?: MsgBroadcasterOptions['eip712Version'];
|
|
68
66
|
evmChainId?: EvmChainId;
|
|
69
67
|
gasBufferCoefficient: number;
|
|
70
68
|
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-B1XSJ1Zx.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-DleRmv3_.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.65
|
|
3
|
+
"version": "1.20.65",
|
|
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.65
|
|
88
|
-
"@injectivelabs/
|
|
89
|
-
"@injectivelabs/ts-types": "1.20.65
|
|
90
|
-
"@injectivelabs/
|
|
91
|
-
"@injectivelabs/utils": "1.20.65
|
|
92
|
-
"@injectivelabs/wallet-base": "1.20.65
|
|
87
|
+
"@injectivelabs/exceptions": "1.20.65",
|
|
88
|
+
"@injectivelabs/networks": "1.20.65",
|
|
89
|
+
"@injectivelabs/ts-types": "1.20.65",
|
|
90
|
+
"@injectivelabs/sdk-ts": "1.20.65",
|
|
91
|
+
"@injectivelabs/utils": "1.20.65",
|
|
92
|
+
"@injectivelabs/wallet-base": "1.20.65"
|
|
93
93
|
},
|
|
94
94
|
"publishConfig": {
|
|
95
95
|
"access": "public"
|