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