@woof-software/contracts-tools-sdk-ethers 0.0.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 (103) hide show
  1. package/README.md +8 -0
  2. package/lib/abis/index.d.ts +2 -0
  3. package/lib/abis/index.js +2 -0
  4. package/lib/abis/multicall.abi.json +440 -0
  5. package/lib/config.d.ts +37 -0
  6. package/lib/config.js +38 -0
  7. package/lib/constant.d.ts +12 -0
  8. package/lib/constant.js +12 -0
  9. package/lib/contract/base-contract.d.ts +23 -0
  10. package/lib/contract/base-contract.js +191 -0
  11. package/lib/contract/contract-create-call-name.d.ts +1 -0
  12. package/lib/contract/contract-create-call-name.js +1 -0
  13. package/lib/contract/index.d.ts +1 -0
  14. package/lib/contract/index.js +1 -0
  15. package/lib/errors/contracts-errors.d.ts +9 -0
  16. package/lib/errors/contracts-errors.js +9 -0
  17. package/lib/errors/index.d.ts +2 -0
  18. package/lib/errors/index.js +2 -0
  19. package/lib/errors/multicall-errors.d.ts +8 -0
  20. package/lib/errors/multicall-errors.js +8 -0
  21. package/lib/helpers/index.d.ts +6 -0
  22. package/lib/helpers/index.js +6 -0
  23. package/lib/helpers/is-parsable.d.ts +2 -0
  24. package/lib/helpers/is-parsable.js +1 -0
  25. package/lib/helpers/is-signer.d.ts +2 -0
  26. package/lib/helpers/is-signer.js +3 -0
  27. package/lib/helpers/is-static-array.d.ts +2 -0
  28. package/lib/helpers/is-static-array.js +2 -0
  29. package/lib/helpers/is-static-method.d.ts +2 -0
  30. package/lib/helpers/is-static-method.js +4 -0
  31. package/lib/helpers/priority-call.d.ts +5 -0
  32. package/lib/helpers/priority-call.js +55 -0
  33. package/lib/helpers/wait-for-address-txs.d.ts +2 -0
  34. package/lib/helpers/wait-for-address-txs.js +9 -0
  35. package/lib/index.d.ts +5 -0
  36. package/lib/index.js +5 -0
  37. package/lib/multicall/index.d.ts +5 -0
  38. package/lib/multicall/index.js +5 -0
  39. package/lib/multicall/multicall-error-event-name.d.ts +2 -0
  40. package/lib/multicall/multicall-error-event-name.js +1 -0
  41. package/lib/multicall/multicall-generate-tag.d.ts +1 -0
  42. package/lib/multicall/multicall-generate-tag.js +1 -0
  43. package/lib/multicall/multicall-normalize-tags.d.ts +2 -0
  44. package/lib/multicall/multicall-normalize-tags.js +6 -0
  45. package/lib/multicall/multicall-result-event-name.d.ts +2 -0
  46. package/lib/multicall/multicall-result-event-name.js +1 -0
  47. package/lib/multicall/multicall-split-calls.d.ts +2 -0
  48. package/lib/multicall/multicall-split-calls.js +19 -0
  49. package/lib/multicall/multicall-unit.d.ts +48 -0
  50. package/lib/multicall/multicall-unit.js +367 -0
  51. package/lib/types/call-mutability.d.ts +4 -0
  52. package/lib/types/call-mutability.js +5 -0
  53. package/lib/types/contract/contract-auto-methods.d.ts +13 -0
  54. package/lib/types/contract/contract-auto-methods.js +1 -0
  55. package/lib/types/contract/contract-call-options.d.ts +9 -0
  56. package/lib/types/contract/contract-call-options.js +1 -0
  57. package/lib/types/contract/contract-call.d.ts +10 -0
  58. package/lib/types/contract/contract-call.js +1 -0
  59. package/lib/types/contract/contract-get-logs-options.d.ts +5 -0
  60. package/lib/types/contract/contract-get-logs-options.js +1 -0
  61. package/lib/types/contract/contract-options.d.ts +12 -0
  62. package/lib/types/contract/contract-options.js +1 -0
  63. package/lib/types/contract/dynamic-contract-constructor-args.d.ts +8 -0
  64. package/lib/types/contract/dynamic-contract-constructor-args.js +1 -0
  65. package/lib/types/contract/dynamic-contract-constructor.d.ts +3 -0
  66. package/lib/types/contract/dynamic-contract-constructor.js +1 -0
  67. package/lib/types/contract/dynamic-contract.d.ts +3 -0
  68. package/lib/types/contract/dynamic-contract.js +1 -0
  69. package/lib/types/contract/index.d.ts +6 -0
  70. package/lib/types/contract/index.js +6 -0
  71. package/lib/types/index.d.ts +6 -0
  72. package/lib/types/index.js +6 -0
  73. package/lib/types/multicall/index.d.ts +5 -0
  74. package/lib/types/multicall/index.js +5 -0
  75. package/lib/types/multicall/multicall-decodable-data.d.ts +5 -0
  76. package/lib/types/multicall/multicall-decodable-data.js +1 -0
  77. package/lib/types/multicall/multicall-options.d.ts +15 -0
  78. package/lib/types/multicall/multicall-options.js +1 -0
  79. package/lib/types/multicall/multicall-response.d.ts +5 -0
  80. package/lib/types/multicall/multicall-response.js +1 -0
  81. package/lib/types/multicall/multicall-tags.d.ts +4 -0
  82. package/lib/types/multicall/multicall-tags.js +1 -0
  83. package/lib/types/multicall/multicall-wait-options.d.ts +5 -0
  84. package/lib/types/multicall/multicall-wait-options.js +1 -0
  85. package/lib/types/priority-call-options.d.ts +8 -0
  86. package/lib/types/priority-call-options.js +1 -0
  87. package/lib/types/split-calls.d.ts +9 -0
  88. package/lib/types/split-calls.js +1 -0
  89. package/lib/types/state-mutabiity.d.ts +6 -0
  90. package/lib/types/state-mutabiity.js +7 -0
  91. package/lib/utils/check-signals.d.ts +1 -0
  92. package/lib/utils/check-signals.js +4 -0
  93. package/lib/utils/create-signals-promise.d.ts +1 -0
  94. package/lib/utils/create-signals-promise.js +8 -0
  95. package/lib/utils/create-timeout-signal.d.ts +1 -0
  96. package/lib/utils/create-timeout-signal.js +5 -0
  97. package/lib/utils/index.d.ts +6 -0
  98. package/lib/utils/index.js +6 -0
  99. package/lib/utils/race-with-signals.d.ts +1 -0
  100. package/lib/utils/race-with-signals.js +9 -0
  101. package/lib/utils/wait-with-signals.d.ts +1 -0
  102. package/lib/utils/wait-with-signals.js +18 -0
  103. package/package.json +44 -0
package/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # @woof-software/contracts-tools-sdk-ethers
2
+
3
+ Provides logic for ethers interactions.
4
+
5
+ ---
6
+
7
+
8
+ ### See original [README](https://github.com/neuroborus/ethers-tools/blob/main/README.md)
@@ -0,0 +1,2 @@
1
+ import type { InterfaceAbi } from "ethers";
2
+ export declare const MulticallAbi: InterfaceAbi;
@@ -0,0 +1,2 @@
1
+ import MulticallABI from "./multicall.abi.json";
2
+ export const MulticallAbi = MulticallABI;
@@ -0,0 +1,440 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "components": [
6
+ {
7
+ "internalType": "address",
8
+ "name": "target",
9
+ "type": "address"
10
+ },
11
+ {
12
+ "internalType": "bytes",
13
+ "name": "callData",
14
+ "type": "bytes"
15
+ }
16
+ ],
17
+ "internalType": "struct Multicall3.Call[]",
18
+ "name": "calls",
19
+ "type": "tuple[]"
20
+ }
21
+ ],
22
+ "name": "aggregate",
23
+ "outputs": [
24
+ {
25
+ "internalType": "uint256",
26
+ "name": "blockNumber",
27
+ "type": "uint256"
28
+ },
29
+ {
30
+ "internalType": "bytes[]",
31
+ "name": "returnData",
32
+ "type": "bytes[]"
33
+ }
34
+ ],
35
+ "stateMutability": "payable",
36
+ "type": "function"
37
+ },
38
+ {
39
+ "inputs": [
40
+ {
41
+ "components": [
42
+ {
43
+ "internalType": "address",
44
+ "name": "target",
45
+ "type": "address"
46
+ },
47
+ {
48
+ "internalType": "bool",
49
+ "name": "allowFailure",
50
+ "type": "bool"
51
+ },
52
+ {
53
+ "internalType": "bytes",
54
+ "name": "callData",
55
+ "type": "bytes"
56
+ }
57
+ ],
58
+ "internalType": "struct Multicall3.Call3[]",
59
+ "name": "calls",
60
+ "type": "tuple[]"
61
+ }
62
+ ],
63
+ "name": "aggregate3",
64
+ "outputs": [
65
+ {
66
+ "components": [
67
+ {
68
+ "internalType": "bool",
69
+ "name": "success",
70
+ "type": "bool"
71
+ },
72
+ {
73
+ "internalType": "bytes",
74
+ "name": "returnData",
75
+ "type": "bytes"
76
+ }
77
+ ],
78
+ "internalType": "struct Multicall3.Result[]",
79
+ "name": "returnData",
80
+ "type": "tuple[]"
81
+ }
82
+ ],
83
+ "stateMutability": "payable",
84
+ "type": "function"
85
+ },
86
+ {
87
+ "inputs": [
88
+ {
89
+ "components": [
90
+ {
91
+ "internalType": "address",
92
+ "name": "target",
93
+ "type": "address"
94
+ },
95
+ {
96
+ "internalType": "bool",
97
+ "name": "allowFailure",
98
+ "type": "bool"
99
+ },
100
+ {
101
+ "internalType": "uint256",
102
+ "name": "value",
103
+ "type": "uint256"
104
+ },
105
+ {
106
+ "internalType": "bytes",
107
+ "name": "callData",
108
+ "type": "bytes"
109
+ }
110
+ ],
111
+ "internalType": "struct Multicall3.Call3Value[]",
112
+ "name": "calls",
113
+ "type": "tuple[]"
114
+ }
115
+ ],
116
+ "name": "aggregate3Value",
117
+ "outputs": [
118
+ {
119
+ "components": [
120
+ {
121
+ "internalType": "bool",
122
+ "name": "success",
123
+ "type": "bool"
124
+ },
125
+ {
126
+ "internalType": "bytes",
127
+ "name": "returnData",
128
+ "type": "bytes"
129
+ }
130
+ ],
131
+ "internalType": "struct Multicall3.Result[]",
132
+ "name": "returnData",
133
+ "type": "tuple[]"
134
+ }
135
+ ],
136
+ "stateMutability": "payable",
137
+ "type": "function"
138
+ },
139
+ {
140
+ "inputs": [
141
+ {
142
+ "components": [
143
+ {
144
+ "internalType": "address",
145
+ "name": "target",
146
+ "type": "address"
147
+ },
148
+ {
149
+ "internalType": "bytes",
150
+ "name": "callData",
151
+ "type": "bytes"
152
+ }
153
+ ],
154
+ "internalType": "struct Multicall3.Call[]",
155
+ "name": "calls",
156
+ "type": "tuple[]"
157
+ }
158
+ ],
159
+ "name": "blockAndAggregate",
160
+ "outputs": [
161
+ {
162
+ "internalType": "uint256",
163
+ "name": "blockNumber",
164
+ "type": "uint256"
165
+ },
166
+ {
167
+ "internalType": "bytes32",
168
+ "name": "blockHash",
169
+ "type": "bytes32"
170
+ },
171
+ {
172
+ "components": [
173
+ {
174
+ "internalType": "bool",
175
+ "name": "success",
176
+ "type": "bool"
177
+ },
178
+ {
179
+ "internalType": "bytes",
180
+ "name": "returnData",
181
+ "type": "bytes"
182
+ }
183
+ ],
184
+ "internalType": "struct Multicall3.Result[]",
185
+ "name": "returnData",
186
+ "type": "tuple[]"
187
+ }
188
+ ],
189
+ "stateMutability": "payable",
190
+ "type": "function"
191
+ },
192
+ {
193
+ "inputs": [],
194
+ "name": "getBasefee",
195
+ "outputs": [
196
+ {
197
+ "internalType": "uint256",
198
+ "name": "basefee",
199
+ "type": "uint256"
200
+ }
201
+ ],
202
+ "stateMutability": "view",
203
+ "type": "function"
204
+ },
205
+ {
206
+ "inputs": [
207
+ {
208
+ "internalType": "uint256",
209
+ "name": "blockNumber",
210
+ "type": "uint256"
211
+ }
212
+ ],
213
+ "name": "getBlockHash",
214
+ "outputs": [
215
+ {
216
+ "internalType": "bytes32",
217
+ "name": "blockHash",
218
+ "type": "bytes32"
219
+ }
220
+ ],
221
+ "stateMutability": "view",
222
+ "type": "function"
223
+ },
224
+ {
225
+ "inputs": [],
226
+ "name": "getBlockNumber",
227
+ "outputs": [
228
+ {
229
+ "internalType": "uint256",
230
+ "name": "blockNumber",
231
+ "type": "uint256"
232
+ }
233
+ ],
234
+ "stateMutability": "view",
235
+ "type": "function"
236
+ },
237
+ {
238
+ "inputs": [],
239
+ "name": "getChainId",
240
+ "outputs": [
241
+ {
242
+ "internalType": "uint256",
243
+ "name": "chainid",
244
+ "type": "uint256"
245
+ }
246
+ ],
247
+ "stateMutability": "view",
248
+ "type": "function"
249
+ },
250
+ {
251
+ "inputs": [],
252
+ "name": "getCurrentBlockCoinbase",
253
+ "outputs": [
254
+ {
255
+ "internalType": "address",
256
+ "name": "coinbase",
257
+ "type": "address"
258
+ }
259
+ ],
260
+ "stateMutability": "view",
261
+ "type": "function"
262
+ },
263
+ {
264
+ "inputs": [],
265
+ "name": "getCurrentBlockDifficulty",
266
+ "outputs": [
267
+ {
268
+ "internalType": "uint256",
269
+ "name": "difficulty",
270
+ "type": "uint256"
271
+ }
272
+ ],
273
+ "stateMutability": "view",
274
+ "type": "function"
275
+ },
276
+ {
277
+ "inputs": [],
278
+ "name": "getCurrentBlockGasLimit",
279
+ "outputs": [
280
+ {
281
+ "internalType": "uint256",
282
+ "name": "gaslimit",
283
+ "type": "uint256"
284
+ }
285
+ ],
286
+ "stateMutability": "view",
287
+ "type": "function"
288
+ },
289
+ {
290
+ "inputs": [],
291
+ "name": "getCurrentBlockTimestamp",
292
+ "outputs": [
293
+ {
294
+ "internalType": "uint256",
295
+ "name": "timestamp",
296
+ "type": "uint256"
297
+ }
298
+ ],
299
+ "stateMutability": "view",
300
+ "type": "function"
301
+ },
302
+ {
303
+ "inputs": [
304
+ {
305
+ "internalType": "address",
306
+ "name": "addr",
307
+ "type": "address"
308
+ }
309
+ ],
310
+ "name": "getEthBalance",
311
+ "outputs": [
312
+ {
313
+ "internalType": "uint256",
314
+ "name": "balance",
315
+ "type": "uint256"
316
+ }
317
+ ],
318
+ "stateMutability": "view",
319
+ "type": "function"
320
+ },
321
+ {
322
+ "inputs": [],
323
+ "name": "getLastBlockHash",
324
+ "outputs": [
325
+ {
326
+ "internalType": "bytes32",
327
+ "name": "blockHash",
328
+ "type": "bytes32"
329
+ }
330
+ ],
331
+ "stateMutability": "view",
332
+ "type": "function"
333
+ },
334
+ {
335
+ "inputs": [
336
+ {
337
+ "internalType": "bool",
338
+ "name": "requireSuccess",
339
+ "type": "bool"
340
+ },
341
+ {
342
+ "components": [
343
+ {
344
+ "internalType": "address",
345
+ "name": "target",
346
+ "type": "address"
347
+ },
348
+ {
349
+ "internalType": "bytes",
350
+ "name": "callData",
351
+ "type": "bytes"
352
+ }
353
+ ],
354
+ "internalType": "struct Multicall3.Call[]",
355
+ "name": "calls",
356
+ "type": "tuple[]"
357
+ }
358
+ ],
359
+ "name": "tryAggregate",
360
+ "outputs": [
361
+ {
362
+ "components": [
363
+ {
364
+ "internalType": "bool",
365
+ "name": "success",
366
+ "type": "bool"
367
+ },
368
+ {
369
+ "internalType": "bytes",
370
+ "name": "returnData",
371
+ "type": "bytes"
372
+ }
373
+ ],
374
+ "internalType": "struct Multicall3.Result[]",
375
+ "name": "returnData",
376
+ "type": "tuple[]"
377
+ }
378
+ ],
379
+ "stateMutability": "payable",
380
+ "type": "function"
381
+ },
382
+ {
383
+ "inputs": [
384
+ {
385
+ "internalType": "bool",
386
+ "name": "requireSuccess",
387
+ "type": "bool"
388
+ },
389
+ {
390
+ "components": [
391
+ {
392
+ "internalType": "address",
393
+ "name": "target",
394
+ "type": "address"
395
+ },
396
+ {
397
+ "internalType": "bytes",
398
+ "name": "callData",
399
+ "type": "bytes"
400
+ }
401
+ ],
402
+ "internalType": "struct Multicall3.Call[]",
403
+ "name": "calls",
404
+ "type": "tuple[]"
405
+ }
406
+ ],
407
+ "name": "tryBlockAndAggregate",
408
+ "outputs": [
409
+ {
410
+ "internalType": "uint256",
411
+ "name": "blockNumber",
412
+ "type": "uint256"
413
+ },
414
+ {
415
+ "internalType": "bytes32",
416
+ "name": "blockHash",
417
+ "type": "bytes32"
418
+ },
419
+ {
420
+ "components": [
421
+ {
422
+ "internalType": "bool",
423
+ "name": "success",
424
+ "type": "bool"
425
+ },
426
+ {
427
+ "internalType": "bytes",
428
+ "name": "returnData",
429
+ "type": "bytes"
430
+ }
431
+ ],
432
+ "internalType": "struct Multicall3.Result[]",
433
+ "name": "returnData",
434
+ "type": "tuple[]"
435
+ }
436
+ ],
437
+ "stateMutability": "payable",
438
+ "type": "function"
439
+ }
440
+ ]
@@ -0,0 +1,37 @@
1
+ export declare const config: {
2
+ multicallUnit: {
3
+ address: string;
4
+ allowFailure: boolean;
5
+ waitForTxs: boolean;
6
+ staticCalls: {
7
+ batchLimit: number;
8
+ timeoutMs: number;
9
+ };
10
+ mutableCalls: {
11
+ batchLimit: number;
12
+ timeoutMs: number;
13
+ };
14
+ waitCalls: {
15
+ timeoutMs: number;
16
+ };
17
+ priorityCalls: {
18
+ multiplier: number;
19
+ };
20
+ batchDelayMs: number;
21
+ };
22
+ contract: {
23
+ staticCalls: {
24
+ timeoutMs: number;
25
+ };
26
+ mutableCalls: {
27
+ timeoutMs: number;
28
+ };
29
+ logsGathering: {
30
+ blocksStep: number;
31
+ delayMs: number;
32
+ };
33
+ };
34
+ priorityCalls: {
35
+ multiplier: number;
36
+ };
37
+ };
package/lib/config.js ADDED
@@ -0,0 +1,38 @@
1
+ import { DEFAULT_LOGS_BLOCKS_STEP, DEFAULT_LOGS_DELAY_MS, DEFAULT_MULTICALL_ALLOW_FAILURE, DEFAULT_MULTICALL_BATCH_DELAY_MS, DEFAULT_MULTICALL_MUTABLE_CALLS_BATCH_LIMIT, DEFAULT_MULTICALL_STATIC_CALLS_BATCH_LIMIT, DEFAULT_MULTICALL_WAIT_FOR_TXS, DEFAULT_MUTABLE_CALLS_TIMEOUT_MS, DEFAULT_PRIORITY_CALL_MULTIPLIER, DEFAULT_STATIC_CALLS_TIMEOUT_MS, DEFAULT_WAIT_CALLS_TIMEOUT_MS, MULTICALL_ADDRESS, } from "./constant";
2
+ export const config = {
3
+ multicallUnit: {
4
+ address: MULTICALL_ADDRESS,
5
+ allowFailure: DEFAULT_MULTICALL_ALLOW_FAILURE,
6
+ waitForTxs: DEFAULT_MULTICALL_WAIT_FOR_TXS,
7
+ staticCalls: {
8
+ batchLimit: DEFAULT_MULTICALL_STATIC_CALLS_BATCH_LIMIT,
9
+ timeoutMs: DEFAULT_STATIC_CALLS_TIMEOUT_MS,
10
+ },
11
+ mutableCalls: {
12
+ batchLimit: DEFAULT_MULTICALL_MUTABLE_CALLS_BATCH_LIMIT,
13
+ timeoutMs: DEFAULT_MUTABLE_CALLS_TIMEOUT_MS,
14
+ },
15
+ waitCalls: {
16
+ timeoutMs: DEFAULT_WAIT_CALLS_TIMEOUT_MS,
17
+ },
18
+ priorityCalls: {
19
+ multiplier: DEFAULT_PRIORITY_CALL_MULTIPLIER,
20
+ },
21
+ batchDelayMs: DEFAULT_MULTICALL_BATCH_DELAY_MS,
22
+ },
23
+ contract: {
24
+ staticCalls: {
25
+ timeoutMs: DEFAULT_STATIC_CALLS_TIMEOUT_MS,
26
+ },
27
+ mutableCalls: {
28
+ timeoutMs: DEFAULT_MUTABLE_CALLS_TIMEOUT_MS,
29
+ },
30
+ logsGathering: {
31
+ blocksStep: DEFAULT_LOGS_BLOCKS_STEP,
32
+ delayMs: DEFAULT_LOGS_DELAY_MS,
33
+ },
34
+ },
35
+ priorityCalls: {
36
+ multiplier: DEFAULT_PRIORITY_CALL_MULTIPLIER,
37
+ },
38
+ };
@@ -0,0 +1,12 @@
1
+ export declare const MULTICALL_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
2
+ export declare const DEFAULT_MULTICALL_WAIT_FOR_TXS = true;
3
+ export declare const DEFAULT_MULTICALL_ALLOW_FAILURE = false;
4
+ export declare const DEFAULT_MULTICALL_STATIC_CALLS_BATCH_LIMIT = 50;
5
+ export declare const DEFAULT_MULTICALL_MUTABLE_CALLS_BATCH_LIMIT = 10;
6
+ export declare const DEFAULT_MULTICALL_BATCH_DELAY_MS = 0;
7
+ export declare const DEFAULT_PRIORITY_CALL_MULTIPLIER = 1.3;
8
+ export declare const DEFAULT_LOGS_BLOCKS_STEP = 5000;
9
+ export declare const DEFAULT_LOGS_DELAY_MS = 1000;
10
+ export declare const DEFAULT_STATIC_CALLS_TIMEOUT_MS = 10000;
11
+ export declare const DEFAULT_MUTABLE_CALLS_TIMEOUT_MS = 20000;
12
+ export declare const DEFAULT_WAIT_CALLS_TIMEOUT_MS = 30000;
@@ -0,0 +1,12 @@
1
+ export const MULTICALL_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
2
+ export const DEFAULT_MULTICALL_WAIT_FOR_TXS = true; // The safest way to handle nonce in transactions
3
+ export const DEFAULT_MULTICALL_ALLOW_FAILURE = false;
4
+ export const DEFAULT_MULTICALL_STATIC_CALLS_BATCH_LIMIT = 50;
5
+ export const DEFAULT_MULTICALL_MUTABLE_CALLS_BATCH_LIMIT = 10;
6
+ export const DEFAULT_MULTICALL_BATCH_DELAY_MS = 0;
7
+ export const DEFAULT_PRIORITY_CALL_MULTIPLIER = 1.3;
8
+ export const DEFAULT_LOGS_BLOCKS_STEP = 5000;
9
+ export const DEFAULT_LOGS_DELAY_MS = 1000;
10
+ export const DEFAULT_STATIC_CALLS_TIMEOUT_MS = 10000;
11
+ export const DEFAULT_MUTABLE_CALLS_TIMEOUT_MS = 20000;
12
+ export const DEFAULT_WAIT_CALLS_TIMEOUT_MS = 30000;
@@ -0,0 +1,23 @@
1
+ import { Contract as EthersContract, type Interface, type InterfaceAbi, type Listener, type LogDescription, type Provider, type Signer } from "ethers";
2
+ import { type ContractCall, type ContractCallOptions, type ContractGetLogsOptions, type ContractOptions, type DynamicContractConstructor } from "../types";
3
+ export declare class BaseContract {
4
+ readonly address: string;
5
+ readonly driver?: Signer | Provider;
6
+ readonly isCallable: boolean;
7
+ readonly isReadonly: boolean;
8
+ readonly contract: EthersContract;
9
+ readonly contractOptions: ContractOptions;
10
+ static createAutoClass(abi: Interface | InterfaceAbi, address?: string, driver?: Provider | Signer, options?: ContractOptions): DynamicContractConstructor;
11
+ static createAutoInstance(abi: Interface | InterfaceAbi, address?: string, driver?: Provider | Signer, options?: ContractOptions): import("../types").DynamicContract;
12
+ constructor(abi: Interface | InterfaceAbi, address: string | undefined, driver: Signer | Provider, options?: ContractOptions);
13
+ get provider(): Provider | null;
14
+ get signer(): Signer | null;
15
+ get interface(): Interface;
16
+ call<T>(method: string, args?: any[], options?: ContractCallOptions): Promise<Awaited<T>>;
17
+ getCall(methodName: string, args?: any[], callData?: {}): ContractCall;
18
+ listenEvent(eventName: string, listener: Listener): Promise<EthersContract>;
19
+ getLogs(fromBlock: number, eventsNames?: string[], toBlock?: number, options?: ContractGetLogsOptions): Promise<LogDescription[]>;
20
+ getLogsStream(fromBlock: number, eventsNames?: string[], toBlock?: number, // Latest by default
21
+ options?: ContractGetLogsOptions): AsyncGenerator<LogDescription, void>;
22
+ private getTimeoutSignal;
23
+ }