@injectivelabs/wallet-evm 1.16.13-alpha.4 → 1.16.13-alpha.6

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.
@@ -202,28 +202,24 @@ class EvmWallet extends wallet_base_2.BaseConcreteStrategy {
202
202
  }
203
203
  async getEvmTransactionReceipt(txHash) {
204
204
  const ethereum = await this.getEthereum();
205
- const interval = 1000;
206
- const transactionReceiptRetry = async () => {
207
- const receipt = (await ethereum.request({
208
- method: 'eth_getTransactionReceipt',
209
- params: [txHash],
210
- }));
211
- if (!receipt) {
212
- await (0, utils_1.sleep)(interval);
213
- await transactionReceiptRetry();
205
+ const interval = 3000;
206
+ const maxAttempts = 10;
207
+ let attempts = 0;
208
+ while (attempts < maxAttempts) {
209
+ attempts++;
210
+ await (0, utils_1.sleep)(interval);
211
+ try {
212
+ const receipt = await ethereum.request({
213
+ method: 'eth_getTransactionReceipt',
214
+ params: [txHash],
215
+ });
216
+ if (receipt) {
217
+ return txHash;
218
+ }
214
219
  }
215
- return receipt;
216
- };
217
- try {
218
- return await transactionReceiptRetry();
219
- }
220
- catch (e) {
221
- throw this.EvmWalletException(new Error(e.message), {
222
- code: exceptions_1.UnspecifiedErrorCode,
223
- type: exceptions_1.ErrorType.WalletError,
224
- contextModule: wallet_base_2.WalletAction.GetEvmTransactionReceipt,
225
- });
220
+ catch { }
226
221
  }
222
+ throw new Error(`Failed to retrieve transaction receipt for txHash: ${txHash}`);
227
223
  }
228
224
  async getPubKey() {
229
225
  throw new exceptions_1.WalletException(new Error('You can only fetch PubKey from Cosmos native wallets'));
@@ -199,28 +199,24 @@ export class EvmWallet extends BaseConcreteStrategy {
199
199
  }
200
200
  async getEvmTransactionReceipt(txHash) {
201
201
  const ethereum = await this.getEthereum();
202
- const interval = 1000;
203
- const transactionReceiptRetry = async () => {
204
- const receipt = (await ethereum.request({
205
- method: 'eth_getTransactionReceipt',
206
- params: [txHash],
207
- }));
208
- if (!receipt) {
209
- await sleep(interval);
210
- await transactionReceiptRetry();
202
+ const interval = 3000;
203
+ const maxAttempts = 10;
204
+ let attempts = 0;
205
+ while (attempts < maxAttempts) {
206
+ attempts++;
207
+ await sleep(interval);
208
+ try {
209
+ const receipt = await ethereum.request({
210
+ method: 'eth_getTransactionReceipt',
211
+ params: [txHash],
212
+ });
213
+ if (receipt) {
214
+ return txHash;
215
+ }
211
216
  }
212
- return receipt;
213
- };
214
- try {
215
- return await transactionReceiptRetry();
216
- }
217
- catch (e) {
218
- throw this.EvmWalletException(new Error(e.message), {
219
- code: UnspecifiedErrorCode,
220
- type: ErrorType.WalletError,
221
- contextModule: WalletAction.GetEvmTransactionReceipt,
222
- });
217
+ catch { }
223
218
  }
219
+ throw new Error(`Failed to retrieve transaction receipt for txHash: ${txHash}`);
224
220
  }
225
221
  async getPubKey() {
226
222
  throw new WalletException(new Error('You can only fetch PubKey from Cosmos native wallets'));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-evm",
3
3
  "description": "EVM wallet strategies for use with @injectivelabs/wallet-core.",
4
- "version": "1.16.13-alpha.4",
4
+ "version": "1.16.13-alpha.6",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "author": {
@@ -56,17 +56,17 @@
56
56
  "start": "node dist/index.js"
57
57
  },
58
58
  "dependencies": {
59
- "@injectivelabs/exceptions": "1.16.13-alpha.4",
60
- "@injectivelabs/networks": "1.16.13-alpha.4",
61
- "@injectivelabs/sdk-ts": "1.16.13-alpha.4",
62
- "@injectivelabs/ts-types": "1.16.13-alpha.4",
63
- "@injectivelabs/utils": "1.16.13-alpha.4",
64
- "@injectivelabs/wallet-base": "1.16.13-alpha.4"
59
+ "@injectivelabs/exceptions": "1.16.13-alpha.6",
60
+ "@injectivelabs/networks": "1.16.13-alpha.6",
61
+ "@injectivelabs/sdk-ts": "1.16.13-alpha.6",
62
+ "@injectivelabs/ts-types": "1.16.13-alpha.6",
63
+ "@injectivelabs/utils": "1.16.13-alpha.6",
64
+ "@injectivelabs/wallet-base": "1.16.13-alpha.6"
65
65
  },
66
66
  "devDependencies": {
67
67
  "shx": "^0.3.3"
68
68
  },
69
- "gitHead": "38872f985bdce134a3e6f9f7b7e0e3e5c5cd36b1",
69
+ "gitHead": "4239109ab41807561f8ed8fcb98339387bfc8547",
70
70
  "typedoc": {
71
71
  "entryPoint": "./src/index.ts",
72
72
  "readmeFile": "./README.md",