essential-eth 0.4.9-beta.2 → 0.4.9

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 (116) hide show
  1. package/{dist → lib}/cjs/classes/Contract.d.ts +0 -0
  2. package/{dist → lib}/cjs/classes/Contract.js +3 -8
  3. package/{dist → lib}/cjs/classes/test/Contract/crv-abi.d.ts +0 -0
  4. package/{dist → lib}/cjs/classes/test/Contract/crv-abi.js +0 -0
  5. package/{dist → lib}/cjs/classes/test/Contract/ens-abi.d.ts +0 -0
  6. package/{dist → lib}/cjs/classes/test/Contract/ens-abi.js +0 -0
  7. package/{dist → lib}/cjs/classes/test/Contract/fei-abi.d.ts +0 -0
  8. package/{dist → lib}/cjs/classes/test/Contract/fei-abi.js +0 -0
  9. package/{dist → lib}/cjs/classes/test/Contract/foo-abi.d.ts +0 -0
  10. package/{dist → lib}/cjs/classes/test/Contract/foo-abi.js +0 -0
  11. package/{dist → lib}/cjs/classes/test/Contract/uniswap-abi.d.ts +0 -0
  12. package/{dist → lib}/cjs/classes/test/Contract/uniswap-abi.js +0 -0
  13. package/{dist → lib}/cjs/classes/utils/clean-block.d.ts +0 -0
  14. package/{dist → lib}/cjs/classes/utils/clean-block.js +0 -0
  15. package/{dist → lib}/cjs/classes/utils/clean-transaction.d.ts +0 -0
  16. package/{dist → lib}/cjs/classes/utils/clean-transaction.js +0 -0
  17. package/{dist → lib}/cjs/classes/utils/encode-decode-transaction.d.ts +0 -0
  18. package/{dist → lib}/cjs/classes/utils/encode-decode-transaction.js +0 -0
  19. package/{dist → lib}/cjs/classes/utils/fetchers.d.ts +1 -1
  20. package/lib/cjs/classes/utils/fetchers.js +51 -0
  21. package/{dist → lib}/cjs/classes/utils/hex-to-decimal.d.ts +0 -0
  22. package/{dist → lib}/cjs/classes/utils/hex-to-decimal.js +0 -0
  23. package/{dist → lib}/cjs/index.d.ts +5 -2
  24. package/lib/cjs/index.js +19 -0
  25. package/{dist → lib}/cjs/providers/JsonRpcProvider.d.ts +8 -3
  26. package/{dist → lib}/cjs/providers/JsonRpcProvider.js +18 -23
  27. package/lib/cjs/providers/test/rpc-urls.d.ts +3 -0
  28. package/lib/cjs/providers/test/rpc-urls.js +6 -0
  29. package/{dist → lib}/cjs/providers/utils/chains-info.d.ts +19 -1
  30. package/{dist → lib}/cjs/providers/utils/chains-info.js +57 -3
  31. package/{dist → lib}/cjs/shared/tiny-big/helpers.d.ts +0 -0
  32. package/{dist → lib}/cjs/shared/tiny-big/helpers.js +0 -0
  33. package/{dist → lib}/cjs/shared/tiny-big/tiny-big.d.ts +0 -0
  34. package/{dist → lib}/cjs/shared/tiny-big/tiny-big.js +0 -0
  35. package/{dist → lib}/cjs/shared/validate-type.d.ts +0 -0
  36. package/{dist → lib}/cjs/shared/validate-type.js +0 -0
  37. package/{dist → lib}/cjs/types/Block.types.d.ts +0 -0
  38. package/{dist → lib}/cjs/types/Block.types.js +0 -0
  39. package/{dist → lib}/cjs/types/Contract.types.d.ts +0 -0
  40. package/{dist → lib}/cjs/types/Contract.types.js +0 -0
  41. package/{dist → lib}/cjs/types/Network.types.d.ts +0 -0
  42. package/{dist → lib}/cjs/types/Network.types.js +0 -0
  43. package/{dist → lib}/cjs/types/Transaction.types.d.ts +0 -0
  44. package/{dist → lib}/cjs/types/Transaction.types.js +0 -0
  45. package/{dist → lib}/cjs/utils/ether-to-wei.d.ts +0 -0
  46. package/{dist → lib}/cjs/utils/ether-to-wei.js +0 -0
  47. package/{dist → lib}/cjs/utils/is-address.d.ts +0 -0
  48. package/{dist → lib}/cjs/utils/is-address.js +0 -0
  49. package/{dist → lib}/cjs/utils/to-checksum-address.d.ts +0 -0
  50. package/{dist → lib}/cjs/utils/to-checksum-address.js +0 -0
  51. package/{dist → lib}/cjs/utils/wei-to-ether.d.ts +0 -0
  52. package/{dist → lib}/cjs/utils/wei-to-ether.js +0 -0
  53. package/{dist → lib}/esm/classes/Contract.d.ts +0 -0
  54. package/{dist → lib}/esm/classes/Contract.js +3 -8
  55. package/{dist → lib}/esm/classes/test/Contract/crv-abi.d.ts +0 -0
  56. package/{dist → lib}/esm/classes/test/Contract/crv-abi.js +0 -0
  57. package/{dist → lib}/esm/classes/test/Contract/ens-abi.d.ts +0 -0
  58. package/{dist → lib}/esm/classes/test/Contract/ens-abi.js +0 -0
  59. package/{dist → lib}/esm/classes/test/Contract/fei-abi.d.ts +0 -0
  60. package/{dist → lib}/esm/classes/test/Contract/fei-abi.js +0 -0
  61. package/{dist → lib}/esm/classes/test/Contract/foo-abi.d.ts +0 -0
  62. package/{dist → lib}/esm/classes/test/Contract/foo-abi.js +0 -0
  63. package/{dist → lib}/esm/classes/test/Contract/uniswap-abi.d.ts +0 -0
  64. package/{dist → lib}/esm/classes/test/Contract/uniswap-abi.js +0 -0
  65. package/{dist → lib}/esm/classes/utils/clean-block.d.ts +0 -0
  66. package/{dist → lib}/esm/classes/utils/clean-block.js +0 -0
  67. package/{dist → lib}/esm/classes/utils/clean-transaction.d.ts +0 -0
  68. package/{dist → lib}/esm/classes/utils/clean-transaction.js +0 -0
  69. package/{dist → lib}/esm/classes/utils/encode-decode-transaction.d.ts +0 -0
  70. package/{dist → lib}/esm/classes/utils/encode-decode-transaction.js +0 -0
  71. package/{dist → lib}/esm/classes/utils/fetchers.d.ts +1 -1
  72. package/lib/esm/classes/utils/fetchers.js +43 -0
  73. package/{dist → lib}/esm/classes/utils/hex-to-decimal.d.ts +0 -0
  74. package/{dist → lib}/esm/classes/utils/hex-to-decimal.js +0 -0
  75. package/{dist → lib}/esm/index.d.ts +5 -2
  76. package/lib/esm/index.js +8 -0
  77. package/{dist → lib}/esm/providers/JsonRpcProvider.d.ts +4 -3
  78. package/{dist → lib}/esm/providers/JsonRpcProvider.js +14 -23
  79. package/lib/esm/providers/test/rpc-urls.d.ts +3 -0
  80. package/lib/esm/providers/test/rpc-urls.js +3 -0
  81. package/{dist → lib}/esm/providers/utils/chains-info.d.ts +19 -1
  82. package/{dist → lib}/esm/providers/utils/chains-info.js +57 -3
  83. package/{dist → lib}/esm/shared/tiny-big/helpers.d.ts +0 -0
  84. package/{dist → lib}/esm/shared/tiny-big/helpers.js +0 -0
  85. package/{dist → lib}/esm/shared/tiny-big/tiny-big.d.ts +0 -0
  86. package/{dist → lib}/esm/shared/tiny-big/tiny-big.js +0 -0
  87. package/{dist → lib}/esm/shared/validate-type.d.ts +0 -0
  88. package/{dist → lib}/esm/shared/validate-type.js +0 -0
  89. package/{dist → lib}/esm/types/Block.types.d.ts +0 -0
  90. package/{dist → lib}/esm/types/Block.types.js +0 -0
  91. package/{dist → lib}/esm/types/Contract.types.d.ts +0 -0
  92. package/{dist → lib}/esm/types/Contract.types.js +0 -0
  93. package/{dist → lib}/esm/types/Network.types.d.ts +0 -0
  94. package/{dist → lib}/esm/types/Network.types.js +0 -0
  95. package/{dist → lib}/esm/types/Transaction.types.d.ts +0 -0
  96. package/{dist → lib}/esm/types/Transaction.types.js +0 -0
  97. package/{dist → lib}/esm/utils/ether-to-wei.d.ts +0 -0
  98. package/{dist → lib}/esm/utils/ether-to-wei.js +0 -0
  99. package/{dist → lib}/esm/utils/is-address.d.ts +0 -0
  100. package/{dist → lib}/esm/utils/is-address.js +0 -0
  101. package/{dist → lib}/esm/utils/to-checksum-address.d.ts +0 -0
  102. package/{dist → lib}/esm/utils/to-checksum-address.js +0 -0
  103. package/{dist → lib}/esm/utils/wei-to-ether.d.ts +0 -0
  104. package/{dist → lib}/esm/utils/wei-to-ether.js +0 -0
  105. package/package.json +11 -32
  106. package/readme.md +35 -9
  107. package/dist/cjs/classes/utils/fetchers.js +0 -33
  108. package/dist/cjs/index.js +0 -26
  109. package/dist/cjs/tsconfig-cjs.tsbuildinfo +0 -1
  110. package/dist/cjs/utils/index.d.ts +0 -5
  111. package/dist/cjs/utils/index.js +0 -11
  112. package/dist/esm/classes/utils/fetchers.js +0 -25
  113. package/dist/esm/index.js +0 -5
  114. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  115. package/dist/esm/utils/index.d.ts +0 -5
  116. package/dist/esm/utils/index.js +0 -5
File without changes
@@ -51,17 +51,12 @@ class BaseContract {
51
51
  ? estimateGas(data)
52
52
  : null;
53
53
  const req = () => __awaiter(this, void 0, void 0, function* () {
54
- return yield (0, fetchers_1.post)(this._provider._rpcUrl[this._provider._rpcUrlCounter], (0, fetchers_1.buildRPCPostBody)('eth_call', [
55
- Object.assign({ to: this._address.toLowerCase(), data: data }, (decimalGas
54
+ return yield (0, fetchers_1.post)(this._provider._rpcUrl, (0, fetchers_1.buildRPCPostBody)('eth_call', [
55
+ Object.assign({ to: this._address.toLowerCase(), data }, (decimalGas
56
56
  ? { gas: `0x${decimalGas.toString(16)}` }
57
57
  : {})),
58
58
  'latest',
59
- ])).catch((e) => {
60
- if (e.code === 'ENOTFOUND') {
61
- this._provider._rpcUrlCounter++;
62
- return req();
63
- }
64
- });
59
+ ]));
65
60
  });
66
61
  const nodeResponse = yield req();
67
62
  return (0, encode_decode_transaction_1.decodeRPCResponse)(jsonABIArgument, nodeResponse);
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  export declare function post(url: string, body: Record<string, unknown>): Promise<any>;
2
- declare type RPCMethodName = 'eth_getBlockByNumber' | 'eth_call' | 'eth_chainId';
2
+ declare type RPCMethodName = 'eth_getBlockByNumber' | 'eth_call' | 'eth_chainId' | 'eth_gasPrice';
3
3
  export declare function buildRPCPostBody(method: RPCMethodName, params: any[]): {
4
4
  jsonrpc: string;
5
5
  id: number;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.buildRPCPostBody = exports.post = void 0;
16
+ const isomorphic_unfetch_1 = __importDefault(require("isomorphic-unfetch"));
17
+ function post(url, body) {
18
+ return (0, isomorphic_unfetch_1.default)(url, {
19
+ method: 'POST',
20
+ headers: {
21
+ 'Content-Type': 'application/json',
22
+ },
23
+ body: JSON.stringify(body),
24
+ })
25
+ .then((r) => __awaiter(this, void 0, void 0, function* () {
26
+ const t = yield r.text();
27
+ try {
28
+ return JSON.parse(t);
29
+ }
30
+ catch (_a) {
31
+ throw new Error(`Invalid JSON RPC response: "${t}"`);
32
+ }
33
+ }))
34
+ .then((response) => {
35
+ const result = response === null || response === void 0 ? void 0 : response.result;
36
+ if (!result) {
37
+ throw new Error(`Invalid JSON RPC response: ${JSON.stringify(response)}`);
38
+ }
39
+ return response.result;
40
+ });
41
+ }
42
+ exports.post = post;
43
+ function buildRPCPostBody(method, params) {
44
+ return {
45
+ jsonrpc: '2.0',
46
+ id: 1,
47
+ method,
48
+ params,
49
+ };
50
+ }
51
+ exports.buildRPCPostBody = buildRPCPostBody;
@@ -5,5 +5,8 @@ import { Block } from './types/Block.types';
5
5
  import { ContractTypes, JSONABI, JSONABIArgument } from './types/Contract.types';
6
6
  import { Network } from './types/Network.types';
7
7
  import { Transaction } from './types/Transaction.types';
8
- export * from './utils';
9
- export { jsonRpcProvider, JsonRpcProvider, tinyBig, Contract, TinyBig, Block, ContractTypes, JSONABI, JSONABIArgument, Network, Transaction, };
8
+ import { etherToWei } from './utils/ether-to-wei';
9
+ import { isAddress } from './utils/is-address';
10
+ import { toChecksumAddress } from './utils/to-checksum-address';
11
+ import { weiToEther } from './utils/wei-to-ether';
12
+ export { etherToWei, isAddress, jsonRpcProvider, JsonRpcProvider, tinyBig, toChecksumAddress, weiToEther, Contract, TinyBig, Block, ContractTypes, JSONABI, JSONABIArgument, Network, Transaction, };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TinyBig = exports.Contract = exports.weiToEther = exports.toChecksumAddress = exports.tinyBig = exports.JsonRpcProvider = exports.jsonRpcProvider = exports.isAddress = exports.etherToWei = void 0;
4
+ const Contract_1 = require("./classes/Contract");
5
+ Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return Contract_1.Contract; } });
6
+ const JsonRpcProvider_1 = require("./providers/JsonRpcProvider");
7
+ Object.defineProperty(exports, "JsonRpcProvider", { enumerable: true, get: function () { return JsonRpcProvider_1.JsonRpcProvider; } });
8
+ Object.defineProperty(exports, "jsonRpcProvider", { enumerable: true, get: function () { return JsonRpcProvider_1.jsonRpcProvider; } });
9
+ const tiny_big_1 = require("./shared/tiny-big/tiny-big");
10
+ Object.defineProperty(exports, "tinyBig", { enumerable: true, get: function () { return tiny_big_1.tinyBig; } });
11
+ Object.defineProperty(exports, "TinyBig", { enumerable: true, get: function () { return tiny_big_1.TinyBig; } });
12
+ const ether_to_wei_1 = require("./utils/ether-to-wei");
13
+ Object.defineProperty(exports, "etherToWei", { enumerable: true, get: function () { return ether_to_wei_1.etherToWei; } });
14
+ const is_address_1 = require("./utils/is-address");
15
+ Object.defineProperty(exports, "isAddress", { enumerable: true, get: function () { return is_address_1.isAddress; } });
16
+ const to_checksum_address_1 = require("./utils/to-checksum-address");
17
+ Object.defineProperty(exports, "toChecksumAddress", { enumerable: true, get: function () { return to_checksum_address_1.toChecksumAddress; } });
18
+ const wei_to_ether_1 = require("./utils/wei-to-ether");
19
+ Object.defineProperty(exports, "weiToEther", { enumerable: true, get: function () { return wei_to_ether_1.weiToEther; } });
@@ -1,12 +1,12 @@
1
+ import { TinyBig } from '../shared/tiny-big/tiny-big';
1
2
  import { Block } from '../types/Block.types';
2
3
  import { Network } from '../types/Network.types';
3
4
  export declare class JsonRpcProvider {
4
5
  /**
5
6
  * The URL to your Eth node. Consider POKT or Infura
6
7
  */
7
- readonly _rpcUrl: Array<string>;
8
- _rpcUrlCounter: number;
9
- constructor(rpcUrl?: string | Array<string>);
8
+ readonly _rpcUrl: string;
9
+ constructor(rpcUrl?: string);
10
10
  /**
11
11
  * Returns the block requested
12
12
  * Same as `web3.eth.getBlock`
@@ -16,6 +16,11 @@ export declare class JsonRpcProvider {
16
16
  * Returns the network this provider is connected to
17
17
  */
18
18
  getNetwork(): Promise<Network>;
19
+ /**
20
+ * Returns the current gas price in wei as TinyBig
21
+ * Same as `ethers.provider.getGasPrice`
22
+ */
23
+ getGasPrice(): Promise<TinyBig>;
19
24
  }
20
25
  /**
21
26
  * Helper function to avoid "new"
@@ -16,19 +16,11 @@ exports.jsonRpcProvider = exports.JsonRpcProvider = void 0;
16
16
  const clean_block_1 = require("../classes/utils/clean-block");
17
17
  const fetchers_1 = require("../classes/utils/fetchers");
18
18
  const hex_to_decimal_1 = require("../classes/utils/hex-to-decimal");
19
+ const tiny_big_1 = require("../shared/tiny-big/tiny-big");
19
20
  const chains_info_1 = __importDefault(require("./utils/chains-info"));
20
21
  class JsonRpcProvider {
21
22
  constructor(rpcUrl) {
22
- this._rpcUrl = (() => {
23
- if (!rpcUrl) {
24
- return ['https://free-eth-node.com/api/eth'];
25
- }
26
- else if (!Array.isArray(rpcUrl)) {
27
- return [rpcUrl];
28
- }
29
- return rpcUrl;
30
- })();
31
- this._rpcUrlCounter = 0;
23
+ this._rpcUrl = rpcUrl || 'https://free-eth-node.com/api/eth';
32
24
  }
33
25
  /**
34
26
  * Returns the block requested
@@ -46,15 +38,10 @@ class JsonRpcProvider {
46
38
  rpcTimeFrame = timeFrame;
47
39
  }
48
40
  const req = () => __awaiter(this, void 0, void 0, function* () {
49
- return yield (0, fetchers_1.post)(this._rpcUrl[this._rpcUrlCounter], (0, fetchers_1.buildRPCPostBody)('eth_getBlockByNumber', [
41
+ return yield (0, fetchers_1.post)(this._rpcUrl, (0, fetchers_1.buildRPCPostBody)('eth_getBlockByNumber', [
50
42
  rpcTimeFrame,
51
43
  returnTransactionObjects,
52
- ])).catch((e) => {
53
- if (e.code === 'ENOTFOUND') {
54
- this._rpcUrlCounter++;
55
- return req();
56
- }
57
- });
44
+ ]));
58
45
  });
59
46
  const nodeResponse = (yield req());
60
47
  return (0, clean_block_1.cleanBlock)(nodeResponse, returnTransactionObjects);
@@ -66,12 +53,7 @@ class JsonRpcProvider {
66
53
  getNetwork() {
67
54
  return __awaiter(this, void 0, void 0, function* () {
68
55
  const req = () => __awaiter(this, void 0, void 0, function* () {
69
- return yield (0, fetchers_1.post)(this._rpcUrl[this._rpcUrlCounter], (0, fetchers_1.buildRPCPostBody)('eth_chainId', [])).catch((e) => {
70
- if (e.code === 'ENOTFOUND') {
71
- this._rpcUrlCounter++;
72
- return req();
73
- }
74
- });
56
+ return yield (0, fetchers_1.post)(this._rpcUrl, (0, fetchers_1.buildRPCPostBody)('eth_chainId', []));
75
57
  });
76
58
  const nodeResponse = (yield req());
77
59
  const chainId = (0, hex_to_decimal_1.hexToDecimal)(nodeResponse);
@@ -83,6 +65,19 @@ class JsonRpcProvider {
83
65
  };
84
66
  });
85
67
  }
68
+ /**
69
+ * Returns the current gas price in wei as TinyBig
70
+ * Same as `ethers.provider.getGasPrice`
71
+ */
72
+ getGasPrice() {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const req = () => __awaiter(this, void 0, void 0, function* () {
75
+ return yield (0, fetchers_1.post)(this._rpcUrl, (0, fetchers_1.buildRPCPostBody)('eth_gasPrice', []));
76
+ });
77
+ const nodeResponse = (yield req()); /* '0x153cfb1ad0' */
78
+ return (0, tiny_big_1.tinyBig)((0, hex_to_decimal_1.hexToDecimal)(nodeResponse));
79
+ });
80
+ }
86
81
  }
87
82
  exports.JsonRpcProvider = JsonRpcProvider;
88
83
  /**
@@ -0,0 +1,3 @@
1
+ export declare const fakeUrls: {
2
+ readonly notRPCButRealHttp: "https://httpstat.us/200";
3
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fakeUrls = void 0;
4
+ exports.fakeUrls = {
5
+ notRPCButRealHttp: 'https://httpstat.us/200',
6
+ };
@@ -45,6 +45,7 @@ declare const _default: {
45
45
  "51": string[];
46
46
  "52": string[];
47
47
  "53": string[];
48
+ "54": string[];
48
49
  "55": string[];
49
50
  "56": string[];
50
51
  "57": string[];
@@ -98,9 +99,11 @@ declare const _default: {
98
99
  "127": string[];
99
100
  "128": string[];
100
101
  "137": string[];
102
+ "141": string[];
101
103
  "142": string[];
102
104
  "162": string[];
103
105
  "163": string[];
106
+ "168": string[];
104
107
  "170": string[];
105
108
  "172": string[];
106
109
  "186": string[];
@@ -109,7 +112,10 @@ declare const _default: {
109
112
  "199": string[];
110
113
  "200": string[];
111
114
  "211": string[];
115
+ "218": string[];
112
116
  "222": string[];
117
+ "225": string[];
118
+ "226": string[];
113
119
  "246": string[];
114
120
  "250": string[];
115
121
  "256": string[];
@@ -145,6 +151,7 @@ declare const _default: {
145
151
  "721": string[];
146
152
  "777": string[];
147
153
  "787": string[];
154
+ "788": string[];
148
155
  "803": string[];
149
156
  "820": string[];
150
157
  "821": string[];
@@ -180,14 +187,18 @@ declare const _default: {
180
187
  "1280": string[];
181
188
  "1284": string[];
182
189
  "1285": string[];
190
+ "1286": string[];
183
191
  "1287": string[];
184
192
  "1288": string[];
193
+ "1337": string[];
185
194
  "1618": string[];
186
195
  "1620": string[];
187
196
  "1657": string[];
197
+ "1688": string[];
188
198
  "1856": string[];
189
199
  "1898": string[];
190
200
  "1987": string[];
201
+ "2001": string[];
191
202
  "2020": string[];
192
203
  "2021": string[];
193
204
  "2022": string[];
@@ -195,7 +206,10 @@ declare const _default: {
195
206
  "2100": string[];
196
207
  "2101": string[];
197
208
  "2213": string[];
209
+ "2221": string[];
198
210
  "2559": string[];
211
+ "3000": string[];
212
+ "3001": string[];
199
213
  "3331": string[];
200
214
  "3333": string[];
201
215
  "3334": string[];
@@ -205,12 +219,14 @@ declare const _default: {
205
219
  "3966": string[];
206
220
  "3967": string[];
207
221
  "4002": string[];
222
+ "4102": string[];
208
223
  "4689": string[];
209
224
  "4690": string[];
210
225
  "4918": string[];
211
226
  "5197": string[];
212
227
  "5315": string[];
213
228
  "5700": string[];
229
+ "5777": string[];
214
230
  "5851": string[];
215
231
  "5869": string[];
216
232
  "6626": string[];
@@ -259,6 +275,7 @@ declare const _default: {
259
275
  "43113": string[];
260
276
  "43114": string[];
261
277
  "44787": string[];
278
+ "45000": string[];
262
279
  "47805": string[];
263
280
  "49797": string[];
264
281
  "53935": string[];
@@ -300,10 +317,10 @@ declare const _default: {
300
317
  "110006": string[];
301
318
  "110007": string[];
302
319
  "110008": string[];
320
+ "200101": string[];
303
321
  "200625": string[];
304
322
  "201018": string[];
305
323
  "201030": string[];
306
- "210309": string[];
307
324
  "210425": string[];
308
325
  "234666": string[];
309
326
  "246529": string[];
@@ -319,6 +336,7 @@ declare const _default: {
319
336
  "1313114": string[];
320
337
  "1313500": string[];
321
338
  "1337702": string[];
339
+ "2203181": string[];
322
340
  "7762959": string[];
323
341
  "11155111": string[];
324
342
  "13371337": string[];
@@ -145,6 +145,9 @@ exports.default = {
145
145
  "53": [
146
146
  "tcet"
147
147
  ],
148
+ "54": [
149
+ "OP"
150
+ ],
148
151
  "55": [
149
152
  "ZYX"
150
153
  ],
@@ -304,6 +307,9 @@ exports.default = {
304
307
  "137": [
305
308
  "MATIC"
306
309
  ],
310
+ "141": [
311
+ "OPtest"
312
+ ],
307
313
  "142": [
308
314
  "dax"
309
315
  ],
@@ -313,6 +319,9 @@ exports.default = {
313
319
  "163": [
314
320
  "pht"
315
321
  ],
322
+ "168": [
323
+ "aioz"
324
+ ],
316
325
  "170": [
317
326
  "hoosmartchain"
318
327
  ],
@@ -337,9 +346,18 @@ exports.default = {
337
346
  "211": [
338
347
  "EDI"
339
348
  ],
349
+ "218": [
350
+ "SO1-old"
351
+ ],
340
352
  "222": [
341
353
  "ASK"
342
354
  ],
355
+ "225": [
356
+ "LA"
357
+ ],
358
+ "226": [
359
+ "TLA"
360
+ ],
343
361
  "246": [
344
362
  "ewt"
345
363
  ],
@@ -445,6 +463,9 @@ exports.default = {
445
463
  "787": [
446
464
  "aca"
447
465
  ],
466
+ "788": [
467
+ "taero"
468
+ ],
448
469
  "803": [
449
470
  "haic"
450
471
  ],
@@ -550,12 +571,18 @@ exports.default = {
550
571
  "1285": [
551
572
  "mriver"
552
573
  ],
574
+ "1286": [
575
+ "mrock-old"
576
+ ],
553
577
  "1287": [
554
578
  "mbase"
555
579
  ],
556
580
  "1288": [
557
581
  "mrock"
558
582
  ],
583
+ "1337": [
584
+ "cennz-a"
585
+ ],
559
586
  "1618": [
560
587
  "cate"
561
588
  ],
@@ -565,6 +592,9 @@ exports.default = {
565
592
  "1657": [
566
593
  "bta"
567
594
  ],
595
+ "1688": [
596
+ "LUDAN"
597
+ ],
568
598
  "1856": [
569
599
  "tsf"
570
600
  ],
@@ -574,6 +604,9 @@ exports.default = {
574
604
  "1987": [
575
605
  "egem"
576
606
  ],
607
+ "2001": [
608
+ "milkAda"
609
+ ],
577
610
  "2020": [
578
611
  "420"
579
612
  ],
@@ -595,9 +628,18 @@ exports.default = {
595
628
  "2213": [
596
629
  "evanesco"
597
630
  ],
631
+ "2221": [
632
+ "kava"
633
+ ],
598
634
  "2559": [
599
635
  "ktoc"
600
636
  ],
637
+ "3000": [
638
+ "cennz-r"
639
+ ],
640
+ "3001": [
641
+ "cennz-n"
642
+ ],
601
643
  "3331": [
602
644
  "zcrbeach"
603
645
  ],
@@ -625,6 +667,9 @@ exports.default = {
625
667
  "4002": [
626
668
  "tftm"
627
669
  ],
670
+ "4102": [
671
+ "aioz-testnet"
672
+ ],
628
673
  "4689": [
629
674
  "iotex-mainnet"
630
675
  ],
@@ -643,6 +688,9 @@ exports.default = {
643
688
  "5700": [
644
689
  "tsys"
645
690
  ],
691
+ "5777": [
692
+ "dgcc"
693
+ ],
646
694
  "5851": [
647
695
  "Ontology Testnet"
648
696
  ],
@@ -787,6 +835,9 @@ exports.default = {
787
835
  "44787": [
788
836
  "ALFA"
789
837
  ],
838
+ "45000": [
839
+ "autobahn"
840
+ ],
790
841
  "47805": [
791
842
  "REI"
792
843
  ],
@@ -910,6 +961,9 @@ exports.default = {
910
961
  "110008": [
911
962
  "qkc-d-s7"
912
963
  ],
964
+ "200101": [
965
+ "milkTAda"
966
+ ],
913
967
  "200625": [
914
968
  "aka"
915
969
  ],
@@ -919,9 +973,6 @@ exports.default = {
919
973
  "201030": [
920
974
  "alayadev"
921
975
  ],
922
- "210309": [
923
- "platondev"
924
- ],
925
976
  "210425": [
926
977
  "platon"
927
978
  ],
@@ -967,6 +1018,9 @@ exports.default = {
967
1018
  "1337702": [
968
1019
  "kintsugi"
969
1020
  ],
1021
+ "2203181": [
1022
+ "platondev"
1023
+ ],
970
1024
  "7762959": [
971
1025
  "music"
972
1026
  ],
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -40,17 +40,12 @@ export class BaseContract {
40
40
  ? estimateGas(data)
41
41
  : null;
42
42
  const req = () => __awaiter(this, void 0, void 0, function* () {
43
- return yield post(this._provider._rpcUrl[this._provider._rpcUrlCounter], buildRPCPostBody('eth_call', [
44
- Object.assign({ to: this._address.toLowerCase(), data: data }, (decimalGas
43
+ return yield post(this._provider._rpcUrl, buildRPCPostBody('eth_call', [
44
+ Object.assign({ to: this._address.toLowerCase(), data }, (decimalGas
45
45
  ? { gas: `0x${decimalGas.toString(16)}` }
46
46
  : {})),
47
47
  'latest',
48
- ])).catch((e) => {
49
- if (e.code === 'ENOTFOUND') {
50
- this._provider._rpcUrlCounter++;
51
- return req();
52
- }
53
- });
48
+ ]));
54
49
  });
55
50
  const nodeResponse = yield req();
56
51
  return decodeRPCResponse(jsonABIArgument, nodeResponse);