@injectivelabs/wallet-core 1.20.68 → 1.21.0-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.
@@ -1,5 +1,5 @@
1
- import { AccountAddress, ChainId, EvmChainId } from "@injectivelabs/ts-types";
2
1
  import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
2
+ import { AccountAddress, ChainId, EvmChainId } from "@injectivelabs/ts-types";
3
3
  import { ConcreteStrategiesArg, ConcreteWalletStrategy, CosmosWalletAbstraction, Eip1193Provider, SendTransactionOptions, Wallet, WalletDeviceType, WalletMetadata, WalletStrategy, WalletStrategyArguments, WalletStrategyEmitter, onAccountChangeCallback, onChainIdChangeCallback } from "@injectivelabs/wallet-base/runtime-light";
4
4
  import { StdSignDoc } from "@keplr-wallet/types";
5
5
  import { OfflineSigner } from "@cosmjs/proto-signing";
@@ -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) {
@@ -516,7 +519,8 @@ var MsgBroadcaster = class {
516
519
  address: tx.ethereumAddress,
517
520
  chainId: evmChainId,
518
521
  gasLimit,
519
- estimateGas
522
+ estimateGas,
523
+ eip712Version: (0, __injectivelabs_wallet_base.resolveEip712Version)(walletStrategy.wallet, this.eip712Version)
520
524
  });
521
525
  walletStrategy.emit(__injectivelabs_wallet_base.WalletStrategyEmitterEventType.TransactionPreparationEnd);
522
526
  const signature = await walletStrategy.signEip712TypedData(prepareTxResponse.data, tx.ethereumAddress, { txTimeout: txTimeoutTimeInSeconds });
@@ -1,4 +1,4 @@
1
- const require_broadcaster = require('./broadcaster-CQCw2ltY.cjs');
1
+ const require_broadcaster = require('./broadcaster-pWTHsqV6.cjs');
2
2
  require('./defineProperty-CImP5zIM.cjs');
3
3
 
4
4
  exports.MsgBroadcaster = require_broadcaster.MsgBroadcaster;
@@ -1,3 +1,3 @@
1
- import "./BaseWalletStrategy-CD9sBzZB.cjs";
2
- import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-TB1ybJUD.cjs";
1
+ import "./BaseWalletStrategy-CHc1qrcW.cjs";
2
+ import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-D4kryvxC.cjs";
3
3
  export { MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, Web3Broadcaster };
@@ -1,9 +1,9 @@
1
- import { t as BaseWalletStrategy } from "./BaseWalletStrategy-CD9sBzZB.cjs";
1
+ import { t as BaseWalletStrategy } from "./BaseWalletStrategy-CHc1qrcW.cjs";
2
2
  import { Msgs } from "@injectivelabs/sdk-ts/core/modules";
3
- import { ChainId, EvmChainId } from "@injectivelabs/ts-types";
4
3
  import { Network, NetworkEndpoints } from "@injectivelabs/networks";
5
4
  import { AuthBaseAccount } from "@injectivelabs/sdk-ts/client/chain";
6
5
  import { TxClientInclusionOptions, TxResponse } from "@injectivelabs/sdk-ts/core/tx";
6
+ import { ChainId, EIP712WrapperVersion, EvmChainId } from "@injectivelabs/ts-types";
7
7
 
8
8
  //#region src/broadcaster/types.d.ts
9
9
  interface MsgBroadcasterTxOptions {
@@ -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?: EIP712WrapperVersion;
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: {
@@ -1,4 +1,4 @@
1
- const require_broadcaster = require('./broadcaster-CQCw2ltY.cjs');
1
+ const require_broadcaster = require('./broadcaster-pWTHsqV6.cjs');
2
2
  require('./defineProperty-CImP5zIM.cjs');
3
3
  const require_strategy = require('./strategy-BxKznCI0.cjs');
4
4
 
@@ -1,5 +1,5 @@
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-TB1ybJUD.cjs";
1
+ import { t as BaseWalletStrategy } from "./BaseWalletStrategy-CHc1qrcW.cjs";
2
+ import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-D4kryvxC.cjs";
3
3
  import "./index-DLoAMD9J.cjs";
4
4
 
5
5
  //#region src/utils/tx.d.ts
@@ -1,3 +1,3 @@
1
- import { t as BaseWalletStrategy } from "./BaseWalletStrategy-CD9sBzZB.cjs";
1
+ import { t as BaseWalletStrategy } from "./BaseWalletStrategy-CHc1qrcW.cjs";
2
2
  import "./index-DLoAMD9J.cjs";
3
3
  export { BaseWalletStrategy };
@@ -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, isEvmBrowserWallet, resolveEip712Version } 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) {
@@ -516,7 +519,8 @@ var MsgBroadcaster = class {
516
519
  address: tx.ethereumAddress,
517
520
  chainId: evmChainId,
518
521
  gasLimit,
519
- estimateGas
522
+ estimateGas,
523
+ eip712Version: resolveEip712Version(walletStrategy.wallet, this.eip712Version)
520
524
  });
521
525
  walletStrategy.emit(WalletStrategyEmitterEventType.TransactionPreparationEnd);
522
526
  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-B1XSJ1Zx.js";
2
+ import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-2njF0K6n.js";
3
3
  export { MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, Web3Broadcaster };
@@ -1,4 +1,4 @@
1
- import { n as MsgBroadcaster, t as Web3Broadcaster } from "./broadcaster-DleRmv3_.js";
1
+ import { n as MsgBroadcaster, t as Web3Broadcaster } from "./broadcaster-BCCJcPz_.js";
2
2
  import "./defineProperty-D4YE9KXX.js";
3
3
 
4
4
  export { MsgBroadcaster, Web3Broadcaster };
@@ -1,5 +1,5 @@
1
1
  import { t as BaseWalletStrategy } from "./BaseWalletStrategy-2HVN2oeB.js";
2
- import { ChainId, EvmChainId } from "@injectivelabs/ts-types";
2
+ import { ChainId, EIP712WrapperVersion, EvmChainId } from "@injectivelabs/ts-types";
3
3
  import { Network, NetworkEndpoints } from "@injectivelabs/networks";
4
4
  import { AuthBaseAccount } from "@injectivelabs/sdk-ts/client/chain";
5
5
  import { TxClientInclusionOptions, TxResponse } from "@injectivelabs/sdk-ts/core/tx";
@@ -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?: EIP712WrapperVersion;
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: {
@@ -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-B1XSJ1Zx.js";
2
+ import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-2njF0K6n.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-DleRmv3_.js";
1
+ import { n as MsgBroadcaster, r as checkIfTxRunOutOfGas, t as Web3Broadcaster } from "./broadcaster-BCCJcPz_.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.68",
3
+ "version": "1.21.0-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/networks": "1.20.68",
88
- "@injectivelabs/ts-types": "1.20.68",
89
- "@injectivelabs/utils": "1.20.68",
90
- "@injectivelabs/wallet-base": "1.20.68",
91
- "@injectivelabs/exceptions": "1.20.68",
92
- "@injectivelabs/sdk-ts": "1.20.68"
87
+ "@injectivelabs/networks": "1.21.0-alpha.0",
88
+ "@injectivelabs/exceptions": "1.21.0-alpha.0",
89
+ "@injectivelabs/ts-types": "1.21.0-alpha.0",
90
+ "@injectivelabs/sdk-ts": "1.21.0-alpha.0",
91
+ "@injectivelabs/wallet-base": "1.21.0-alpha.0",
92
+ "@injectivelabs/utils": "1.21.0-alpha.0"
93
93
  },
94
94
  "publishConfig": {
95
95
  "access": "public"