@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.
@@ -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, _this$eip712Version;
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: () => {
@@ -1,4 +1,4 @@
1
- const require_broadcaster = require('./broadcaster-Lug_y4Nm.cjs');
1
+ const require_broadcaster = require('./broadcaster-CQCw2ltY.cjs');
2
2
  require('./defineProperty-CImP5zIM.cjs');
3
3
 
4
4
  exports.MsgBroadcaster = require_broadcaster.MsgBroadcaster;
@@ -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-APoDJvOs.cjs";
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: {
@@ -1,4 +1,4 @@
1
- const require_broadcaster = require('./broadcaster-Lug_y4Nm.cjs');
1
+ const require_broadcaster = require('./broadcaster-CQCw2ltY.cjs');
2
2
  require('./defineProperty-CImP5zIM.cjs');
3
3
  const require_strategy = require('./strategy-BxKznCI0.cjs');
4
4
 
@@ -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-APoDJvOs.cjs";
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, isEip712V3Wallet, isEvmBrowserWallet } from "@injectivelabs/wallet-base";
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, _this$eip712Version;
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-9EprSoyp.js";
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 };
@@ -1,4 +1,4 @@
1
- import { n as MsgBroadcaster, t as Web3Broadcaster } from "./broadcaster-CJr3Nnyk.js";
1
+ import { n as MsgBroadcaster, t as Web3Broadcaster } from "./broadcaster-DleRmv3_.js";
2
2
  import "./defineProperty-D4YE9KXX.js";
3
3
 
4
4
  export { MsgBroadcaster, 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: {
@@ -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-9EprSoyp.js";
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-CJr3Nnyk.js";
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-alpha.0",
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-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"
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"