@injectivelabs/wallet-core 1.16.38 → 1.16.39-alpha.1

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.
Files changed (41) hide show
  1. package/dist/cjs/index.cjs +1016 -0
  2. package/dist/cjs/index.d.cts +288 -0
  3. package/dist/cjs/package.json +2 -2
  4. package/dist/esm/index.d.ts +288 -3
  5. package/dist/esm/index.js +1012 -3
  6. package/dist/esm/package.json +2 -2
  7. package/package.json +46 -47
  8. package/dist/cjs/broadcaster/MsgBroadcaster.d.ts +0 -137
  9. package/dist/cjs/broadcaster/MsgBroadcaster.js +0 -920
  10. package/dist/cjs/broadcaster/Web3Broadcaster.d.ts +0 -30
  11. package/dist/cjs/broadcaster/Web3Broadcaster.js +0 -32
  12. package/dist/cjs/broadcaster/index.d.ts +0 -3
  13. package/dist/cjs/broadcaster/index.js +0 -19
  14. package/dist/cjs/broadcaster/types.d.ts +0 -56
  15. package/dist/cjs/broadcaster/types.js +0 -13
  16. package/dist/cjs/index.d.ts +0 -3
  17. package/dist/cjs/index.js +0 -19
  18. package/dist/cjs/strategy/BaseWalletStrategy.d.ts +0 -58
  19. package/dist/cjs/strategy/BaseWalletStrategy.js +0 -176
  20. package/dist/cjs/strategy/index.d.ts +0 -2
  21. package/dist/cjs/strategy/index.js +0 -8
  22. package/dist/cjs/utils/index.d.ts +0 -1
  23. package/dist/cjs/utils/index.js +0 -17
  24. package/dist/cjs/utils/tx.d.ts +0 -1
  25. package/dist/cjs/utils/tx.js +0 -11
  26. package/dist/esm/broadcaster/MsgBroadcaster.d.ts +0 -137
  27. package/dist/esm/broadcaster/MsgBroadcaster.js +0 -916
  28. package/dist/esm/broadcaster/Web3Broadcaster.d.ts +0 -30
  29. package/dist/esm/broadcaster/Web3Broadcaster.js +0 -28
  30. package/dist/esm/broadcaster/index.d.ts +0 -3
  31. package/dist/esm/broadcaster/index.js +0 -3
  32. package/dist/esm/broadcaster/types.d.ts +0 -56
  33. package/dist/esm/broadcaster/types.js +0 -10
  34. package/dist/esm/strategy/BaseWalletStrategy.d.ts +0 -58
  35. package/dist/esm/strategy/BaseWalletStrategy.js +0 -173
  36. package/dist/esm/strategy/index.d.ts +0 -2
  37. package/dist/esm/strategy/index.js +0 -2
  38. package/dist/esm/utils/index.d.ts +0 -1
  39. package/dist/esm/utils/index.js +0 -1
  40. package/dist/esm/utils/tx.d.ts +0 -1
  41. package/dist/esm/utils/tx.js +0 -7
@@ -0,0 +1,288 @@
1
+ import { ConcreteStrategiesArg, ConcreteWalletStrategy, CosmosWalletAbstraction, Eip1193Provider, SendTransactionOptions, Wallet, WalletDeviceType, WalletMetadata, WalletStrategy, WalletStrategyArguments, onAccountChangeCallback, onChainIdChangeCallback } from "@injectivelabs/wallet-base";
2
+ import { StdSignDoc } from "@keplr-wallet/types";
3
+ import { OfflineSigner } from "@cosmjs/proto-signing";
4
+ import { AccountAddress, ChainId, EvmChainId } from "@injectivelabs/ts-types";
5
+ import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
6
+ import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
7
+ import { EventEmitter } from "eventemitter3";
8
+ import { Msgs } from "@injectivelabs/sdk-ts/core/modules";
9
+ import { Network, NetworkEndpoints } from "@injectivelabs/networks";
10
+
11
+ //#region src/utils/tx.d.ts
12
+ declare const checkIfTxRunOutOfGas: (e: unknown) => boolean;
13
+ //#endregion
14
+ //#region src/broadcaster/types.d.ts
15
+ interface MsgBroadcasterTxOptions {
16
+ memo?: string;
17
+ ethereumAddress?: string;
18
+ injectiveAddress?: string;
19
+ msgs: Msgs | Msgs[];
20
+ gas?: {
21
+ gasPrice?: string;
22
+ gas?: number; /** gas limit */
23
+ feePayer?: string;
24
+ granter?: string;
25
+ };
26
+ }
27
+ interface MsgBroadcasterTxOptionsWithAddresses extends MsgBroadcasterTxOptions {
28
+ ethereumAddress: string;
29
+ injectiveAddress: string;
30
+ }
31
+ interface MsgBroadcasterOptions {
32
+ network: Network;
33
+ endpoints?: NetworkEndpoints;
34
+ chainId?: ChainId;
35
+ evmChainId?: EvmChainId;
36
+ feePayerPubKey?: string;
37
+ simulateTx?: boolean;
38
+ txTimeoutOnFeeDelegation?: boolean;
39
+ txTimeout?: number;
40
+ walletStrategy: BaseWalletStrategy;
41
+ gasBufferCoefficient?: number;
42
+ httpHeaders?: Record<string, string>;
43
+ }
44
+ declare const WalletStrategyEmitterEventType: {
45
+ readonly TransactionFail: "transaction-fail";
46
+ readonly TransactionSigned: "transaction-signed";
47
+ readonly TransactionSignStart: "transaction-sign-start";
48
+ readonly TransactionBroadcastEnd: "transaction-broadcast-end";
49
+ readonly WalletStrategyDisconnect: "wallet-strategy-disconnect";
50
+ readonly TransactionBroadcastStart: "transaction-broadcast-start";
51
+ readonly TransactionPreparationEnd: "transaction-preparation-end";
52
+ readonly TransactionPreparationStart: "transaction-preparation-start";
53
+ };
54
+ type WalletStrategyEmitterEventType = (typeof WalletStrategyEmitterEventType)[keyof typeof WalletStrategyEmitterEventType];
55
+ type WalletStrategyEmitterEvents = {
56
+ [WalletStrategyEmitterEventType.TransactionFail]: Record<string, any>;
57
+ [WalletStrategyEmitterEventType.TransactionSigned]: Record<string, any>;
58
+ [WalletStrategyEmitterEventType.TransactionSignStart]: Record<string, any>;
59
+ [WalletStrategyEmitterEventType.TransactionBroadcastEnd]: Record<string, any>;
60
+ [WalletStrategyEmitterEventType.WalletStrategyDisconnect]: Record<string, any>;
61
+ [WalletStrategyEmitterEventType.TransactionBroadcastStart]: Record<string, any>;
62
+ [WalletStrategyEmitterEventType.TransactionPreparationEnd]: Record<string, any>;
63
+ [WalletStrategyEmitterEventType.TransactionPreparationStart]: Record<string, any>;
64
+ };
65
+ type WalletStrategyEmitter = EventEmitter<WalletStrategyEmitterEvents>;
66
+ //#endregion
67
+ //#region src/strategy/BaseWalletStrategy.d.ts
68
+ declare class BaseWalletStrategy implements WalletStrategy {
69
+ strategies: ConcreteStrategiesArg;
70
+ wallet: Wallet;
71
+ args: WalletStrategyArguments;
72
+ metadata?: WalletMetadata;
73
+ wallets?: Wallet[];
74
+ private emitter;
75
+ on: WalletStrategyEmitter['on'];
76
+ off: WalletStrategyEmitter['off'];
77
+ emit: WalletStrategyEmitter['emit'];
78
+ constructor(args: WalletStrategyArguments);
79
+ getWallet(): Wallet;
80
+ setWallet(wallet: Wallet): Promise<void>;
81
+ setMetadata(metadata?: WalletMetadata): void;
82
+ getStrategy(): ConcreteWalletStrategy;
83
+ getAddresses(args?: unknown): Promise<AccountAddress[]>;
84
+ getAddressesInfo(args?: unknown): Promise<{
85
+ address: string;
86
+ derivationPath: string;
87
+ baseDerivationPath: string;
88
+ }[]>;
89
+ getWalletDeviceType(): Promise<WalletDeviceType>;
90
+ getPubKey(address?: string): Promise<string>;
91
+ enable(args?: unknown): Promise<boolean>;
92
+ enableAndGetAddresses(args?: unknown): Promise<AccountAddress[]>;
93
+ getEthereumChainId(): Promise<string>;
94
+ getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): Promise<void>;
95
+ getSessionOrConfirm(address?: AccountAddress): Promise<string>;
96
+ getWalletClient<T>(): Promise<T>;
97
+ sendTransaction(tx: DirectSignResponse | TxRaw, options: SendTransactionOptions): Promise<TxResponse>;
98
+ sendEvmTransaction(tx: any, options: {
99
+ evmChainId: EvmChainId;
100
+ address: AccountAddress;
101
+ }): Promise<string>;
102
+ signEip712TypedData(eip712TypedData: string, address: AccountAddress, options?: {
103
+ txTimeout?: number;
104
+ }): Promise<string>;
105
+ signAminoCosmosTransaction(transaction: {
106
+ signDoc: StdSignDoc;
107
+ address: string;
108
+ }): Promise<AminoSignResponse>;
109
+ signCosmosTransaction(transaction: {
110
+ txRaw: TxRaw;
111
+ accountNumber: number;
112
+ chainId: string;
113
+ address: string;
114
+ }): Promise<DirectSignResponse>;
115
+ signArbitrary(signer: string, data: string | Uint8Array): Promise<string | void>;
116
+ onAccountChange(callback: onAccountChangeCallback): Promise<void>;
117
+ onChainIdChange(callback: onChainIdChangeCallback): Promise<void>;
118
+ disconnect(): Promise<void>;
119
+ getCosmosWallet(chainId: ChainId): CosmosWalletAbstraction;
120
+ getEip1193Provider(): Promise<Eip1193Provider>;
121
+ getOfflineSigner(chainId: string): Promise<OfflineSigner>;
122
+ }
123
+ //#endregion
124
+ //#region src/broadcaster/MsgBroadcaster.d.ts
125
+ /**
126
+ * This class is used to broadcast transactions
127
+ * using the WalletStrategy as a handler
128
+ * for the sign/broadcast flow of the transactions
129
+ *
130
+ * Mainly used for building UI products
131
+ */
132
+ declare class MsgBroadcaster {
133
+ options: MsgBroadcasterOptions;
134
+ walletStrategy: BaseWalletStrategy;
135
+ endpoints: NetworkEndpoints;
136
+ chainId: ChainId;
137
+ txTimeout: number;
138
+ simulateTx: boolean;
139
+ txTimeoutOnFeeDelegation: boolean;
140
+ evmChainId?: EvmChainId;
141
+ gasBufferCoefficient: number;
142
+ retriesOnError: {
143
+ [x: string]: {
144
+ retries: number;
145
+ maxRetries: number;
146
+ timeout: number;
147
+ };
148
+ };
149
+ httpHeaders?: Record<string, string>;
150
+ constructor(options: MsgBroadcasterOptions);
151
+ setOptions(options: Partial<MsgBroadcasterOptions>): void;
152
+ getEvmChainId(): Promise<EvmChainId | undefined>;
153
+ /**
154
+ * Broadcasting the transaction using the client
155
+ * side approach for both cosmos and ethereum native wallets
156
+ *
157
+ * @param tx
158
+ * @returns {string} transaction hash
159
+ */
160
+ broadcast(tx: MsgBroadcasterTxOptions): Promise<TxResponse>;
161
+ /**
162
+ * Broadcasting the transaction using the client
163
+ * side approach for both cosmos and ethereum native wallets
164
+ * Note: using EIP712_V2 for Ethereum wallets
165
+ *
166
+ * @param tx
167
+ * @returns {string} transaction hash
168
+ */
169
+ broadcastV2(tx: MsgBroadcasterTxOptions): Promise<TxResponse>;
170
+ /**
171
+ * Broadcasting the transaction using the feeDelegation
172
+ * support approach for both cosmos and ethereum native wallets
173
+ *
174
+ * @param tx
175
+ * @returns {string} transaction hash
176
+ */
177
+ broadcastWithFeeDelegation(tx: MsgBroadcasterTxOptions): Promise<TxResponse>;
178
+ /**
179
+ * Prepare/sign/broadcast transaction using
180
+ * Ethereum native wallets on the client side.
181
+ *
182
+ * Note: Gas estimation not available
183
+ *
184
+ * @param tx The transaction that needs to be broadcasted
185
+ * @returns transaction hash
186
+ */
187
+ private broadcastEip712;
188
+ /**
189
+ * Prepare/sign/broadcast transaction using
190
+ * Ethereum native wallets on the client side.
191
+ *
192
+ * Note: Gas estimation not available
193
+ *
194
+ * @param tx The transaction that needs to be broadcasted
195
+ * @returns transaction hash
196
+ */
197
+ private broadcastEip712V2;
198
+ /**
199
+ * Prepare/sign/broadcast transaction using
200
+ * Ethereum native wallets using the Web3Gateway.
201
+ *
202
+ * @param tx The transaction that needs to be broadcasted
203
+ * @returns transaction hash
204
+ */
205
+ private broadcastEip712WithFeeDelegation;
206
+ /**
207
+ * Prepare/sign/broadcast transaction using
208
+ * Cosmos native wallets on the client side.
209
+ *
210
+ * @param tx The transaction that needs to be broadcasted
211
+ * @returns transaction hash
212
+ */
213
+ private broadcastDirectSign;
214
+ /**
215
+ * We use this method only when we want to broadcast a transaction using Ledger on Keplr/Leap for Injective
216
+ *
217
+ * Note: Gas estimation not available
218
+ * @param tx the transaction that needs to be broadcasted
219
+ */
220
+ private experimentalBroadcastWalletThroughLedger;
221
+ /**
222
+ * Prepare/sign/broadcast transaction using
223
+ * Cosmos native wallets using the Web3Gateway.
224
+ *
225
+ * @param tx The transaction that needs to be broadcasted
226
+ * @returns transaction hash
227
+ */
228
+ private broadcastDirectSignWithFeeDelegation;
229
+ /**
230
+ * Fetch the fee payer's pub key from the web3 gateway
231
+ *
232
+ * Returns a base64 version of it
233
+ */
234
+ private fetchFeePayerPubKey;
235
+ private getStdFeeWithDynamicBaseFee;
236
+ /**
237
+ * In case we don't want to simulate the transaction
238
+ * we get the gas limit based on the message type.
239
+ *
240
+ * If we want to simulate the transaction we set the
241
+ * gas limit based on the simulation and add a small multiplier
242
+ * to be safe (factor of 1.2 as default)
243
+ */
244
+ private getTxWithSignersAndStdFee;
245
+ /**
246
+ * Create TxRaw and simulate it
247
+ */
248
+ private simulateTxRaw;
249
+ /**
250
+ * Create TxRaw and simulate it
251
+ */
252
+ private simulateTxWithSigners;
253
+ private retryOnException;
254
+ private fetchAccountAndBlockDetails;
255
+ }
256
+ //#endregion
257
+ //#region src/broadcaster/Web3Broadcaster.d.ts
258
+ interface SendTransactionOptions$1 {
259
+ tx: {
260
+ from: string;
261
+ to: string;
262
+ gas: string;
263
+ maxFeePerGas: string;
264
+ maxPriorityFeePerGas: string | null;
265
+ data: any;
266
+ };
267
+ address: string;
268
+ evmChainId?: EvmChainId;
269
+ }
270
+ /**
271
+ * Preparing and broadcasting
272
+ * Ethereum transactions
273
+ */
274
+ declare class Web3Broadcaster {
275
+ private walletStrategy;
276
+ private evmChainId;
277
+ constructor({
278
+ walletStrategy,
279
+ evmChainId
280
+ }: {
281
+ walletStrategy: BaseWalletStrategy;
282
+ evmChainId: EvmChainId;
283
+ network: Network;
284
+ });
285
+ sendTransaction(args: SendTransactionOptions$1): Promise<string>;
286
+ }
287
+ //#endregion
288
+ export { BaseWalletStrategy, MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, WalletStrategyEmitter, WalletStrategyEmitterEventType, WalletStrategyEmitterEvents, Web3Broadcaster, checkIfTxRunOutOfGas };
@@ -1,3 +1,3 @@
1
1
  {
2
- "type": "commonjs"
3
- }
2
+ "type": "commonjs"
3
+ }
@@ -1,3 +1,288 @@
1
- export * from './broadcaster/index.js';
2
- export * from './strategy/index.js';
3
- export * from './utils/index.js';
1
+ import { EventEmitter } from "eventemitter3";
2
+ import { ConcreteStrategiesArg, ConcreteWalletStrategy, CosmosWalletAbstraction, Eip1193Provider, SendTransactionOptions, Wallet, WalletDeviceType, WalletMetadata, WalletStrategy, WalletStrategyArguments, onAccountChangeCallback, onChainIdChangeCallback } from "@injectivelabs/wallet-base";
3
+ import { AccountAddress, ChainId, EvmChainId } from "@injectivelabs/ts-types";
4
+ import { Network, NetworkEndpoints } from "@injectivelabs/networks";
5
+ import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
6
+ import { StdSignDoc } from "@keplr-wallet/types";
7
+ import { OfflineSigner } from "@cosmjs/proto-signing";
8
+ import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
9
+ import { Msgs } from "@injectivelabs/sdk-ts/core/modules";
10
+
11
+ //#region src/utils/tx.d.ts
12
+ declare const checkIfTxRunOutOfGas: (e: unknown) => boolean;
13
+ //#endregion
14
+ //#region src/broadcaster/types.d.ts
15
+ interface MsgBroadcasterTxOptions {
16
+ memo?: string;
17
+ ethereumAddress?: string;
18
+ injectiveAddress?: string;
19
+ msgs: Msgs | Msgs[];
20
+ gas?: {
21
+ gasPrice?: string;
22
+ gas?: number; /** gas limit */
23
+ feePayer?: string;
24
+ granter?: string;
25
+ };
26
+ }
27
+ interface MsgBroadcasterTxOptionsWithAddresses extends MsgBroadcasterTxOptions {
28
+ ethereumAddress: string;
29
+ injectiveAddress: string;
30
+ }
31
+ interface MsgBroadcasterOptions {
32
+ network: Network;
33
+ endpoints?: NetworkEndpoints;
34
+ chainId?: ChainId;
35
+ evmChainId?: EvmChainId;
36
+ feePayerPubKey?: string;
37
+ simulateTx?: boolean;
38
+ txTimeoutOnFeeDelegation?: boolean;
39
+ txTimeout?: number;
40
+ walletStrategy: BaseWalletStrategy;
41
+ gasBufferCoefficient?: number;
42
+ httpHeaders?: Record<string, string>;
43
+ }
44
+ declare const WalletStrategyEmitterEventType: {
45
+ readonly TransactionFail: "transaction-fail";
46
+ readonly TransactionSigned: "transaction-signed";
47
+ readonly TransactionSignStart: "transaction-sign-start";
48
+ readonly TransactionBroadcastEnd: "transaction-broadcast-end";
49
+ readonly WalletStrategyDisconnect: "wallet-strategy-disconnect";
50
+ readonly TransactionBroadcastStart: "transaction-broadcast-start";
51
+ readonly TransactionPreparationEnd: "transaction-preparation-end";
52
+ readonly TransactionPreparationStart: "transaction-preparation-start";
53
+ };
54
+ type WalletStrategyEmitterEventType = (typeof WalletStrategyEmitterEventType)[keyof typeof WalletStrategyEmitterEventType];
55
+ type WalletStrategyEmitterEvents = {
56
+ [WalletStrategyEmitterEventType.TransactionFail]: Record<string, any>;
57
+ [WalletStrategyEmitterEventType.TransactionSigned]: Record<string, any>;
58
+ [WalletStrategyEmitterEventType.TransactionSignStart]: Record<string, any>;
59
+ [WalletStrategyEmitterEventType.TransactionBroadcastEnd]: Record<string, any>;
60
+ [WalletStrategyEmitterEventType.WalletStrategyDisconnect]: Record<string, any>;
61
+ [WalletStrategyEmitterEventType.TransactionBroadcastStart]: Record<string, any>;
62
+ [WalletStrategyEmitterEventType.TransactionPreparationEnd]: Record<string, any>;
63
+ [WalletStrategyEmitterEventType.TransactionPreparationStart]: Record<string, any>;
64
+ };
65
+ type WalletStrategyEmitter = EventEmitter<WalletStrategyEmitterEvents>;
66
+ //#endregion
67
+ //#region src/strategy/BaseWalletStrategy.d.ts
68
+ declare class BaseWalletStrategy implements WalletStrategy {
69
+ strategies: ConcreteStrategiesArg;
70
+ wallet: Wallet;
71
+ args: WalletStrategyArguments;
72
+ metadata?: WalletMetadata;
73
+ wallets?: Wallet[];
74
+ private emitter;
75
+ on: WalletStrategyEmitter['on'];
76
+ off: WalletStrategyEmitter['off'];
77
+ emit: WalletStrategyEmitter['emit'];
78
+ constructor(args: WalletStrategyArguments);
79
+ getWallet(): Wallet;
80
+ setWallet(wallet: Wallet): Promise<void>;
81
+ setMetadata(metadata?: WalletMetadata): void;
82
+ getStrategy(): ConcreteWalletStrategy;
83
+ getAddresses(args?: unknown): Promise<AccountAddress[]>;
84
+ getAddressesInfo(args?: unknown): Promise<{
85
+ address: string;
86
+ derivationPath: string;
87
+ baseDerivationPath: string;
88
+ }[]>;
89
+ getWalletDeviceType(): Promise<WalletDeviceType>;
90
+ getPubKey(address?: string): Promise<string>;
91
+ enable(args?: unknown): Promise<boolean>;
92
+ enableAndGetAddresses(args?: unknown): Promise<AccountAddress[]>;
93
+ getEthereumChainId(): Promise<string>;
94
+ getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): Promise<void>;
95
+ getSessionOrConfirm(address?: AccountAddress): Promise<string>;
96
+ getWalletClient<T>(): Promise<T>;
97
+ sendTransaction(tx: DirectSignResponse | TxRaw, options: SendTransactionOptions): Promise<TxResponse>;
98
+ sendEvmTransaction(tx: any, options: {
99
+ evmChainId: EvmChainId;
100
+ address: AccountAddress;
101
+ }): Promise<string>;
102
+ signEip712TypedData(eip712TypedData: string, address: AccountAddress, options?: {
103
+ txTimeout?: number;
104
+ }): Promise<string>;
105
+ signAminoCosmosTransaction(transaction: {
106
+ signDoc: StdSignDoc;
107
+ address: string;
108
+ }): Promise<AminoSignResponse>;
109
+ signCosmosTransaction(transaction: {
110
+ txRaw: TxRaw;
111
+ accountNumber: number;
112
+ chainId: string;
113
+ address: string;
114
+ }): Promise<DirectSignResponse>;
115
+ signArbitrary(signer: string, data: string | Uint8Array): Promise<string | void>;
116
+ onAccountChange(callback: onAccountChangeCallback): Promise<void>;
117
+ onChainIdChange(callback: onChainIdChangeCallback): Promise<void>;
118
+ disconnect(): Promise<void>;
119
+ getCosmosWallet(chainId: ChainId): CosmosWalletAbstraction;
120
+ getEip1193Provider(): Promise<Eip1193Provider>;
121
+ getOfflineSigner(chainId: string): Promise<OfflineSigner>;
122
+ }
123
+ //#endregion
124
+ //#region src/broadcaster/MsgBroadcaster.d.ts
125
+ /**
126
+ * This class is used to broadcast transactions
127
+ * using the WalletStrategy as a handler
128
+ * for the sign/broadcast flow of the transactions
129
+ *
130
+ * Mainly used for building UI products
131
+ */
132
+ declare class MsgBroadcaster {
133
+ options: MsgBroadcasterOptions;
134
+ walletStrategy: BaseWalletStrategy;
135
+ endpoints: NetworkEndpoints;
136
+ chainId: ChainId;
137
+ txTimeout: number;
138
+ simulateTx: boolean;
139
+ txTimeoutOnFeeDelegation: boolean;
140
+ evmChainId?: EvmChainId;
141
+ gasBufferCoefficient: number;
142
+ retriesOnError: {
143
+ [x: string]: {
144
+ retries: number;
145
+ maxRetries: number;
146
+ timeout: number;
147
+ };
148
+ };
149
+ httpHeaders?: Record<string, string>;
150
+ constructor(options: MsgBroadcasterOptions);
151
+ setOptions(options: Partial<MsgBroadcasterOptions>): void;
152
+ getEvmChainId(): Promise<EvmChainId | undefined>;
153
+ /**
154
+ * Broadcasting the transaction using the client
155
+ * side approach for both cosmos and ethereum native wallets
156
+ *
157
+ * @param tx
158
+ * @returns {string} transaction hash
159
+ */
160
+ broadcast(tx: MsgBroadcasterTxOptions): Promise<TxResponse>;
161
+ /**
162
+ * Broadcasting the transaction using the client
163
+ * side approach for both cosmos and ethereum native wallets
164
+ * Note: using EIP712_V2 for Ethereum wallets
165
+ *
166
+ * @param tx
167
+ * @returns {string} transaction hash
168
+ */
169
+ broadcastV2(tx: MsgBroadcasterTxOptions): Promise<TxResponse>;
170
+ /**
171
+ * Broadcasting the transaction using the feeDelegation
172
+ * support approach for both cosmos and ethereum native wallets
173
+ *
174
+ * @param tx
175
+ * @returns {string} transaction hash
176
+ */
177
+ broadcastWithFeeDelegation(tx: MsgBroadcasterTxOptions): Promise<TxResponse>;
178
+ /**
179
+ * Prepare/sign/broadcast transaction using
180
+ * Ethereum native wallets on the client side.
181
+ *
182
+ * Note: Gas estimation not available
183
+ *
184
+ * @param tx The transaction that needs to be broadcasted
185
+ * @returns transaction hash
186
+ */
187
+ private broadcastEip712;
188
+ /**
189
+ * Prepare/sign/broadcast transaction using
190
+ * Ethereum native wallets on the client side.
191
+ *
192
+ * Note: Gas estimation not available
193
+ *
194
+ * @param tx The transaction that needs to be broadcasted
195
+ * @returns transaction hash
196
+ */
197
+ private broadcastEip712V2;
198
+ /**
199
+ * Prepare/sign/broadcast transaction using
200
+ * Ethereum native wallets using the Web3Gateway.
201
+ *
202
+ * @param tx The transaction that needs to be broadcasted
203
+ * @returns transaction hash
204
+ */
205
+ private broadcastEip712WithFeeDelegation;
206
+ /**
207
+ * Prepare/sign/broadcast transaction using
208
+ * Cosmos native wallets on the client side.
209
+ *
210
+ * @param tx The transaction that needs to be broadcasted
211
+ * @returns transaction hash
212
+ */
213
+ private broadcastDirectSign;
214
+ /**
215
+ * We use this method only when we want to broadcast a transaction using Ledger on Keplr/Leap for Injective
216
+ *
217
+ * Note: Gas estimation not available
218
+ * @param tx the transaction that needs to be broadcasted
219
+ */
220
+ private experimentalBroadcastWalletThroughLedger;
221
+ /**
222
+ * Prepare/sign/broadcast transaction using
223
+ * Cosmos native wallets using the Web3Gateway.
224
+ *
225
+ * @param tx The transaction that needs to be broadcasted
226
+ * @returns transaction hash
227
+ */
228
+ private broadcastDirectSignWithFeeDelegation;
229
+ /**
230
+ * Fetch the fee payer's pub key from the web3 gateway
231
+ *
232
+ * Returns a base64 version of it
233
+ */
234
+ private fetchFeePayerPubKey;
235
+ private getStdFeeWithDynamicBaseFee;
236
+ /**
237
+ * In case we don't want to simulate the transaction
238
+ * we get the gas limit based on the message type.
239
+ *
240
+ * If we want to simulate the transaction we set the
241
+ * gas limit based on the simulation and add a small multiplier
242
+ * to be safe (factor of 1.2 as default)
243
+ */
244
+ private getTxWithSignersAndStdFee;
245
+ /**
246
+ * Create TxRaw and simulate it
247
+ */
248
+ private simulateTxRaw;
249
+ /**
250
+ * Create TxRaw and simulate it
251
+ */
252
+ private simulateTxWithSigners;
253
+ private retryOnException;
254
+ private fetchAccountAndBlockDetails;
255
+ }
256
+ //#endregion
257
+ //#region src/broadcaster/Web3Broadcaster.d.ts
258
+ interface SendTransactionOptions$1 {
259
+ tx: {
260
+ from: string;
261
+ to: string;
262
+ gas: string;
263
+ maxFeePerGas: string;
264
+ maxPriorityFeePerGas: string | null;
265
+ data: any;
266
+ };
267
+ address: string;
268
+ evmChainId?: EvmChainId;
269
+ }
270
+ /**
271
+ * Preparing and broadcasting
272
+ * Ethereum transactions
273
+ */
274
+ declare class Web3Broadcaster {
275
+ private walletStrategy;
276
+ private evmChainId;
277
+ constructor({
278
+ walletStrategy,
279
+ evmChainId
280
+ }: {
281
+ walletStrategy: BaseWalletStrategy;
282
+ evmChainId: EvmChainId;
283
+ network: Network;
284
+ });
285
+ sendTransaction(args: SendTransactionOptions$1): Promise<string>;
286
+ }
287
+ //#endregion
288
+ export { BaseWalletStrategy, MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, WalletStrategyEmitter, WalletStrategyEmitterEventType, WalletStrategyEmitterEvents, Web3Broadcaster, checkIfTxRunOutOfGas };