@sentio/sdk 1.7.20 → 1.7.21
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.
- package/lib/builtin/erc20/index.d.ts +1 -1
- package/lib/builtin/erc20/index.js +1 -1
- package/lib/builtin/erc20/index.js.map +1 -1
- package/lib/builtin/erc20/test-utils.d.ts +2 -1
- package/lib/builtin/erc20/test-utils.js +14 -3
- package/lib/builtin/erc20/test-utils.js.map +1 -1
- package/lib/builtin/erc20bytes/index.d.ts +2 -0
- package/lib/builtin/erc20bytes/index.js +22 -0
- package/lib/builtin/erc20bytes/index.js.map +1 -0
- package/lib/builtin/erc20bytes/test-utils.d.ts +4 -0
- package/lib/builtin/erc20bytes/test-utils.js +35 -0
- package/lib/builtin/erc20bytes/test-utils.js.map +1 -0
- package/lib/builtin/internal/ERC20.d.ts +307 -0
- package/lib/builtin/internal/{Weth9.js → ERC20.js} +1 -1
- package/lib/builtin/internal/ERC20.js.map +1 -0
- package/lib/builtin/internal/{Erc20.d.ts → ERC20Bytes.d.ts} +62 -46
- package/lib/builtin/internal/ERC20Bytes.js +3 -0
- package/lib/builtin/internal/ERC20Bytes.js.map +1 -0
- package/lib/builtin/internal/{Weth9.d.ts → WETH9.d.ts} +3 -3
- package/lib/builtin/internal/{Erc20.js → WETH9.js} +1 -1
- package/lib/builtin/internal/{Weth9.js.map → WETH9.js.map} +1 -1
- package/lib/builtin/internal/erc20_processor.d.ts +28 -16
- package/lib/builtin/internal/erc20_processor.js +168 -32
- package/lib/builtin/internal/erc20_processor.js.map +1 -1
- package/lib/builtin/internal/erc20bytes_processor.d.ts +42 -0
- package/lib/builtin/internal/erc20bytes_processor.js +271 -0
- package/lib/builtin/internal/erc20bytes_processor.js.map +1 -0
- package/lib/builtin/internal/factories/ERC20Bytes__factory.d.ts +48 -0
- package/lib/builtin/internal/factories/{Erc20__factory.js → ERC20Bytes__factory.js} +127 -89
- package/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -0
- package/lib/builtin/internal/factories/{Erc20__factory.d.ts → ERC20__factory.d.ts} +12 -5
- package/lib/builtin/internal/factories/ERC20__factory.js +404 -0
- package/lib/builtin/internal/factories/ERC20__factory.js.map +1 -0
- package/lib/builtin/internal/factories/{Weth9__factory.d.ts → WETH9__factory.d.ts} +4 -4
- package/lib/builtin/internal/factories/{Weth9__factory.js → WETH9__factory.js} +4 -4
- package/lib/builtin/internal/factories/{Weth9__factory.js.map → WETH9__factory.js.map} +1 -1
- package/lib/builtin/internal/factories/index.d.ts +3 -2
- package/lib/builtin/internal/factories/index.js +7 -5
- package/lib/builtin/internal/factories/index.js.map +1 -1
- package/lib/builtin/internal/index.d.ts +6 -4
- package/lib/builtin/internal/index.js +7 -5
- package/lib/builtin/internal/index.js.map +1 -1
- package/lib/builtin/internal/weth9_processor.d.ts +20 -20
- package/lib/builtin/internal/weth9_processor.js +36 -36
- package/lib/builtin/internal/weth9_processor.js.map +1 -1
- package/lib/builtin/weth9/index.d.ts +1 -1
- package/lib/builtin/weth9/index.js +1 -1
- package/lib/builtin/weth9/index.js.map +1 -1
- package/lib/builtin/weth9/test-utils.js +4 -4
- package/lib/builtin/weth9/test-utils.js.map +1 -1
- package/lib/test/erc20-template.js +3 -3
- package/lib/test/erc20-template.js.map +1 -1
- package/lib/test/erc20.js +8 -8
- package/lib/test/erc20.js.map +1 -1
- package/lib/test/erc20.test.js +3 -3
- package/lib/test/erc20.test.js.map +1 -1
- package/lib/utils/erc20.d.ts +9 -0
- package/lib/utils/erc20.js +51 -0
- package/lib/utils/erc20.js.map +1 -0
- package/lib/utils/erc20.test.d.ts +1 -0
- package/lib/utils/erc20.test.js +28 -0
- package/lib/utils/erc20.test.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +4 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/abis/ERC20.json +174 -0
- package/src/abis/{erc20.json → ERC20Bytes.json} +124 -86
- package/src/abis/{weth9.json → WETH9.json} +0 -0
- package/src/builtin/erc20/index.ts +1 -1
- package/src/builtin/erc20/test-utils.ts +25 -3
- package/src/builtin/erc20bytes/index.ts +6 -0
- package/src/builtin/erc20bytes/test-utils.ts +53 -0
- package/src/builtin/internal/ERC20.ts +679 -0
- package/src/builtin/internal/{Erc20.ts → ERC20Bytes.ts} +138 -110
- package/src/builtin/internal/{Weth9.ts → WETH9.ts} +3 -3
- package/src/builtin/internal/erc20_processor.ts +188 -44
- package/src/builtin/internal/erc20bytes_processor.ts +362 -0
- package/src/builtin/internal/factories/{Erc20__factory.ts → ERC20Bytes__factory.ts} +132 -91
- package/src/builtin/internal/factories/ERC20__factory.ts +404 -0
- package/src/builtin/internal/factories/{Weth9__factory.ts → WETH9__factory.ts} +6 -6
- package/src/builtin/internal/factories/index.ts +3 -2
- package/src/builtin/internal/index.ts +6 -4
- package/src/builtin/internal/weth9_processor.ts +52 -52
- package/src/builtin/weth9/index.ts +1 -1
- package/src/builtin/weth9/test-utils.ts +5 -5
- package/src/test/erc20-template.ts +4 -4
- package/src/test/erc20.test.ts +3 -3
- package/src/test/erc20.ts +9 -9
- package/src/utils/erc20.test.ts +31 -0
- package/src/utils/erc20.ts +60 -0
- package/src/utils/index.ts +1 -0
- package/lib/builtin/internal/Erc20.js.map +0 -1
- package/lib/builtin/internal/factories/Erc20__factory.js.map +0 -1
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import { Contract, Signer, utils } from "ethers";
|
|
6
|
+
import type { Provider } from "@ethersproject/providers";
|
|
7
|
+
import type { ERC20, ERC20Interface } from "../ERC20";
|
|
8
|
+
|
|
9
|
+
const _abi = [
|
|
10
|
+
{
|
|
11
|
+
inputs: [],
|
|
12
|
+
stateMutability: "nonpayable",
|
|
13
|
+
type: "constructor",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
anonymous: false,
|
|
17
|
+
inputs: [
|
|
18
|
+
{
|
|
19
|
+
indexed: true,
|
|
20
|
+
internalType: "address",
|
|
21
|
+
name: "owner",
|
|
22
|
+
type: "address",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
indexed: true,
|
|
26
|
+
internalType: "address",
|
|
27
|
+
name: "spender",
|
|
28
|
+
type: "address",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
indexed: false,
|
|
32
|
+
internalType: "uint256",
|
|
33
|
+
name: "value",
|
|
34
|
+
type: "uint256",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
name: "Approval",
|
|
38
|
+
type: "event",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
anonymous: false,
|
|
42
|
+
inputs: [
|
|
43
|
+
{
|
|
44
|
+
indexed: true,
|
|
45
|
+
internalType: "address",
|
|
46
|
+
name: "previousOwner",
|
|
47
|
+
type: "address",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
indexed: true,
|
|
51
|
+
internalType: "address",
|
|
52
|
+
name: "newOwner",
|
|
53
|
+
type: "address",
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
name: "OwnershipTransferred",
|
|
57
|
+
type: "event",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
anonymous: false,
|
|
61
|
+
inputs: [
|
|
62
|
+
{
|
|
63
|
+
indexed: true,
|
|
64
|
+
internalType: "address",
|
|
65
|
+
name: "from",
|
|
66
|
+
type: "address",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
indexed: true,
|
|
70
|
+
internalType: "address",
|
|
71
|
+
name: "to",
|
|
72
|
+
type: "address",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
indexed: false,
|
|
76
|
+
internalType: "uint256",
|
|
77
|
+
name: "value",
|
|
78
|
+
type: "uint256",
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
name: "Transfer",
|
|
82
|
+
type: "event",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
inputs: [
|
|
86
|
+
{
|
|
87
|
+
internalType: "address",
|
|
88
|
+
name: "owner",
|
|
89
|
+
type: "address",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
internalType: "address",
|
|
93
|
+
name: "spender",
|
|
94
|
+
type: "address",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
name: "allowance",
|
|
98
|
+
outputs: [
|
|
99
|
+
{
|
|
100
|
+
internalType: "uint256",
|
|
101
|
+
name: "",
|
|
102
|
+
type: "uint256",
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
stateMutability: "view",
|
|
106
|
+
type: "function",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
inputs: [
|
|
110
|
+
{
|
|
111
|
+
internalType: "address",
|
|
112
|
+
name: "spender",
|
|
113
|
+
type: "address",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
internalType: "uint256",
|
|
117
|
+
name: "amount",
|
|
118
|
+
type: "uint256",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
name: "approve",
|
|
122
|
+
outputs: [
|
|
123
|
+
{
|
|
124
|
+
internalType: "bool",
|
|
125
|
+
name: "",
|
|
126
|
+
type: "bool",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
stateMutability: "nonpayable",
|
|
130
|
+
type: "function",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
inputs: [
|
|
134
|
+
{
|
|
135
|
+
internalType: "address",
|
|
136
|
+
name: "account",
|
|
137
|
+
type: "address",
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
name: "balanceOf",
|
|
141
|
+
outputs: [
|
|
142
|
+
{
|
|
143
|
+
internalType: "uint256",
|
|
144
|
+
name: "",
|
|
145
|
+
type: "uint256",
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
stateMutability: "view",
|
|
149
|
+
type: "function",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
inputs: [
|
|
153
|
+
{
|
|
154
|
+
internalType: "uint256",
|
|
155
|
+
name: "amount",
|
|
156
|
+
type: "uint256",
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
name: "burn",
|
|
160
|
+
outputs: [],
|
|
161
|
+
stateMutability: "nonpayable",
|
|
162
|
+
type: "function",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
inputs: [
|
|
166
|
+
{
|
|
167
|
+
internalType: "address",
|
|
168
|
+
name: "account",
|
|
169
|
+
type: "address",
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
internalType: "uint256",
|
|
173
|
+
name: "amount",
|
|
174
|
+
type: "uint256",
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
name: "burnFrom",
|
|
178
|
+
outputs: [],
|
|
179
|
+
stateMutability: "nonpayable",
|
|
180
|
+
type: "function",
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
inputs: [],
|
|
184
|
+
name: "decimals",
|
|
185
|
+
outputs: [
|
|
186
|
+
{
|
|
187
|
+
internalType: "uint8",
|
|
188
|
+
name: "",
|
|
189
|
+
type: "uint8",
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
stateMutability: "view",
|
|
193
|
+
type: "function",
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
inputs: [
|
|
197
|
+
{
|
|
198
|
+
internalType: "address",
|
|
199
|
+
name: "spender",
|
|
200
|
+
type: "address",
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
internalType: "uint256",
|
|
204
|
+
name: "subtractedValue",
|
|
205
|
+
type: "uint256",
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
name: "decreaseAllowance",
|
|
209
|
+
outputs: [
|
|
210
|
+
{
|
|
211
|
+
internalType: "bool",
|
|
212
|
+
name: "",
|
|
213
|
+
type: "bool",
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
stateMutability: "nonpayable",
|
|
217
|
+
type: "function",
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
inputs: [
|
|
221
|
+
{
|
|
222
|
+
internalType: "address",
|
|
223
|
+
name: "spender",
|
|
224
|
+
type: "address",
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
internalType: "uint256",
|
|
228
|
+
name: "addedValue",
|
|
229
|
+
type: "uint256",
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
name: "increaseAllowance",
|
|
233
|
+
outputs: [
|
|
234
|
+
{
|
|
235
|
+
internalType: "bool",
|
|
236
|
+
name: "",
|
|
237
|
+
type: "bool",
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
stateMutability: "nonpayable",
|
|
241
|
+
type: "function",
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
inputs: [],
|
|
245
|
+
name: "locker",
|
|
246
|
+
outputs: [
|
|
247
|
+
{
|
|
248
|
+
internalType: "contract ILocker",
|
|
249
|
+
name: "",
|
|
250
|
+
type: "address",
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
stateMutability: "view",
|
|
254
|
+
type: "function",
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
inputs: [],
|
|
258
|
+
name: "name",
|
|
259
|
+
outputs: [
|
|
260
|
+
{
|
|
261
|
+
internalType: "string",
|
|
262
|
+
name: "",
|
|
263
|
+
type: "string",
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
stateMutability: "view",
|
|
267
|
+
type: "function",
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
inputs: [],
|
|
271
|
+
name: "owner",
|
|
272
|
+
outputs: [
|
|
273
|
+
{
|
|
274
|
+
internalType: "address",
|
|
275
|
+
name: "",
|
|
276
|
+
type: "address",
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
stateMutability: "view",
|
|
280
|
+
type: "function",
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
inputs: [],
|
|
284
|
+
name: "renounceOwnership",
|
|
285
|
+
outputs: [],
|
|
286
|
+
stateMutability: "nonpayable",
|
|
287
|
+
type: "function",
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
inputs: [
|
|
291
|
+
{
|
|
292
|
+
internalType: "address",
|
|
293
|
+
name: "_locker",
|
|
294
|
+
type: "address",
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
name: "setLocker",
|
|
298
|
+
outputs: [],
|
|
299
|
+
stateMutability: "nonpayable",
|
|
300
|
+
type: "function",
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
inputs: [],
|
|
304
|
+
name: "symbol",
|
|
305
|
+
outputs: [
|
|
306
|
+
{
|
|
307
|
+
internalType: "string",
|
|
308
|
+
name: "",
|
|
309
|
+
type: "string",
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
stateMutability: "view",
|
|
313
|
+
type: "function",
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
inputs: [],
|
|
317
|
+
name: "totalSupply",
|
|
318
|
+
outputs: [
|
|
319
|
+
{
|
|
320
|
+
internalType: "uint256",
|
|
321
|
+
name: "",
|
|
322
|
+
type: "uint256",
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
stateMutability: "view",
|
|
326
|
+
type: "function",
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
inputs: [
|
|
330
|
+
{
|
|
331
|
+
internalType: "address",
|
|
332
|
+
name: "recipient",
|
|
333
|
+
type: "address",
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
internalType: "uint256",
|
|
337
|
+
name: "amount",
|
|
338
|
+
type: "uint256",
|
|
339
|
+
},
|
|
340
|
+
],
|
|
341
|
+
name: "transfer",
|
|
342
|
+
outputs: [
|
|
343
|
+
{
|
|
344
|
+
internalType: "bool",
|
|
345
|
+
name: "",
|
|
346
|
+
type: "bool",
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
stateMutability: "nonpayable",
|
|
350
|
+
type: "function",
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
inputs: [
|
|
354
|
+
{
|
|
355
|
+
internalType: "address",
|
|
356
|
+
name: "sender",
|
|
357
|
+
type: "address",
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
internalType: "address",
|
|
361
|
+
name: "recipient",
|
|
362
|
+
type: "address",
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
internalType: "uint256",
|
|
366
|
+
name: "amount",
|
|
367
|
+
type: "uint256",
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
name: "transferFrom",
|
|
371
|
+
outputs: [
|
|
372
|
+
{
|
|
373
|
+
internalType: "bool",
|
|
374
|
+
name: "",
|
|
375
|
+
type: "bool",
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
stateMutability: "nonpayable",
|
|
379
|
+
type: "function",
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
inputs: [
|
|
383
|
+
{
|
|
384
|
+
internalType: "address",
|
|
385
|
+
name: "newOwner",
|
|
386
|
+
type: "address",
|
|
387
|
+
},
|
|
388
|
+
],
|
|
389
|
+
name: "transferOwnership",
|
|
390
|
+
outputs: [],
|
|
391
|
+
stateMutability: "nonpayable",
|
|
392
|
+
type: "function",
|
|
393
|
+
},
|
|
394
|
+
];
|
|
395
|
+
|
|
396
|
+
export class ERC20__factory {
|
|
397
|
+
static readonly abi = _abi;
|
|
398
|
+
static createInterface(): ERC20Interface {
|
|
399
|
+
return new utils.Interface(_abi) as ERC20Interface;
|
|
400
|
+
}
|
|
401
|
+
static connect(address: string, signerOrProvider: Signer | Provider): ERC20 {
|
|
402
|
+
return new Contract(address, _abi, signerOrProvider) as ERC20;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Contract, Signer, utils } from "ethers";
|
|
6
6
|
import type { Provider } from "@ethersproject/providers";
|
|
7
|
-
import type {
|
|
7
|
+
import type { WETH9, WETH9Interface } from "../WETH9";
|
|
8
8
|
|
|
9
9
|
const _abi = [
|
|
10
10
|
{
|
|
@@ -286,12 +286,12 @@ const _abi = [
|
|
|
286
286
|
},
|
|
287
287
|
];
|
|
288
288
|
|
|
289
|
-
export class
|
|
289
|
+
export class WETH9__factory {
|
|
290
290
|
static readonly abi = _abi;
|
|
291
|
-
static createInterface():
|
|
292
|
-
return new utils.Interface(_abi) as
|
|
291
|
+
static createInterface(): WETH9Interface {
|
|
292
|
+
return new utils.Interface(_abi) as WETH9Interface;
|
|
293
293
|
}
|
|
294
|
-
static connect(address: string, signerOrProvider: Signer | Provider):
|
|
295
|
-
return new Contract(address, _abi, signerOrProvider) as
|
|
294
|
+
static connect(address: string, signerOrProvider: Signer | Provider): WETH9 {
|
|
295
|
+
return new Contract(address, _abi, signerOrProvider) as WETH9;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* Autogenerated file. Do not edit manually. */
|
|
2
2
|
/* tslint:disable */
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { ERC20__factory } from "./ERC20__factory";
|
|
5
|
+
export { ERC20Bytes__factory } from "./ERC20Bytes__factory";
|
|
6
|
+
export { WETH9__factory } from "./WETH9__factory";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/* Autogenerated file. Do not edit manually. */
|
|
2
2
|
/* tslint:disable */
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
4
|
+
export type { ERC20 } from "./ERC20";
|
|
5
|
+
export type { ERC20Bytes } from "./ERC20Bytes";
|
|
6
|
+
export type { WETH9 } from "./WETH9";
|
|
6
7
|
export * as factories from "./factories";
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
8
|
+
export { ERC20__factory } from "./factories/ERC20__factory";
|
|
9
|
+
export { ERC20Bytes__factory } from "./factories/ERC20Bytes__factory";
|
|
10
|
+
export { WETH9__factory } from "./factories/WETH9__factory";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getContractName,
|
|
21
21
|
} from "@sentio/sdk";
|
|
22
22
|
import { PromiseOrValue } from "./common";
|
|
23
|
-
import {
|
|
23
|
+
import { WETH9, WETH9__factory } from "./index";
|
|
24
24
|
import {
|
|
25
25
|
ApprovalEvent,
|
|
26
26
|
ApprovalEventFilter,
|
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
DepositEventFilter,
|
|
31
31
|
WithdrawalEvent,
|
|
32
32
|
WithdrawalEventFilter,
|
|
33
|
-
} from "./
|
|
34
|
-
const templateContract =
|
|
33
|
+
} from "./WETH9";
|
|
34
|
+
const templateContract = WETH9__factory.connect("", DummyProvider);
|
|
35
35
|
|
|
36
|
-
export class
|
|
37
|
-
constructor(contract:
|
|
36
|
+
export class WETH9ContractView extends ContractView<WETH9> {
|
|
37
|
+
constructor(contract: WETH9) {
|
|
38
38
|
super(contract);
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -115,11 +115,11 @@ export class Weth9ContractView extends ContractView<Weth9> {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
export class
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
export class WETH9BoundContractView extends BoundContractView<
|
|
119
|
+
WETH9,
|
|
120
|
+
WETH9ContractView
|
|
121
121
|
> {
|
|
122
|
-
// constructor (contract:
|
|
122
|
+
// constructor (contract: WETH9) {
|
|
123
123
|
// super(contract);
|
|
124
124
|
// }
|
|
125
125
|
|
|
@@ -230,34 +230,34 @@ export class Weth9BoundContractView extends BoundContractView<
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
export type
|
|
233
|
+
export type WETH9Context = Context<WETH9, WETH9BoundContractView>;
|
|
234
234
|
|
|
235
|
-
export class
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
export class WETH9ProcessorTemplate extends BaseProcessorTemplate<
|
|
236
|
+
WETH9,
|
|
237
|
+
WETH9BoundContractView
|
|
238
238
|
> {
|
|
239
239
|
bindInternal(options: BindOptions) {
|
|
240
|
-
let processor = getProcessor("
|
|
240
|
+
let processor = getProcessor("WETH9", options) as WETH9Processor;
|
|
241
241
|
if (!processor) {
|
|
242
242
|
const finalOptions = Object.assign({}, options);
|
|
243
243
|
finalOptions.name = getContractName(
|
|
244
|
-
"
|
|
244
|
+
"WETH9",
|
|
245
245
|
options.name,
|
|
246
246
|
options.address,
|
|
247
247
|
options.network
|
|
248
248
|
);
|
|
249
|
-
processor = new
|
|
250
|
-
addProcessor("
|
|
249
|
+
processor = new WETH9Processor(finalOptions);
|
|
250
|
+
addProcessor("WETH9", options, processor);
|
|
251
251
|
}
|
|
252
252
|
return processor;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
onApproval(
|
|
256
|
-
handler: (event: ApprovalEvent, ctx:
|
|
256
|
+
handler: (event: ApprovalEvent, ctx: WETH9Context) => void,
|
|
257
257
|
filter?: ApprovalEventFilter | ApprovalEventFilter[]
|
|
258
258
|
) {
|
|
259
259
|
if (!filter) {
|
|
260
|
-
filter =
|
|
260
|
+
filter = WETH9Processor.filters["Approval(address,address,uint256)"](
|
|
261
261
|
null,
|
|
262
262
|
null,
|
|
263
263
|
null
|
|
@@ -267,11 +267,11 @@ export class Weth9ProcessorTemplate extends BaseProcessorTemplate<
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
onTransfer(
|
|
270
|
-
handler: (event: TransferEvent, ctx:
|
|
270
|
+
handler: (event: TransferEvent, ctx: WETH9Context) => void,
|
|
271
271
|
filter?: TransferEventFilter | TransferEventFilter[]
|
|
272
272
|
) {
|
|
273
273
|
if (!filter) {
|
|
274
|
-
filter =
|
|
274
|
+
filter = WETH9Processor.filters["Transfer(address,address,uint256)"](
|
|
275
275
|
null,
|
|
276
276
|
null,
|
|
277
277
|
null
|
|
@@ -281,21 +281,21 @@ export class Weth9ProcessorTemplate extends BaseProcessorTemplate<
|
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
onDeposit(
|
|
284
|
-
handler: (event: DepositEvent, ctx:
|
|
284
|
+
handler: (event: DepositEvent, ctx: WETH9Context) => void,
|
|
285
285
|
filter?: DepositEventFilter | DepositEventFilter[]
|
|
286
286
|
) {
|
|
287
287
|
if (!filter) {
|
|
288
|
-
filter =
|
|
288
|
+
filter = WETH9Processor.filters["Deposit(address,uint256)"](null, null);
|
|
289
289
|
}
|
|
290
290
|
return super.onEvent(handler, filter);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
onWithdrawal(
|
|
294
|
-
handler: (event: WithdrawalEvent, ctx:
|
|
294
|
+
handler: (event: WithdrawalEvent, ctx: WETH9Context) => void,
|
|
295
295
|
filter?: WithdrawalEventFilter | WithdrawalEventFilter[]
|
|
296
296
|
) {
|
|
297
297
|
if (!filter) {
|
|
298
|
-
filter =
|
|
298
|
+
filter = WETH9Processor.filters["Withdrawal(address,uint256)"](
|
|
299
299
|
null,
|
|
300
300
|
null
|
|
301
301
|
);
|
|
@@ -304,16 +304,16 @@ export class Weth9ProcessorTemplate extends BaseProcessorTemplate<
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
export class
|
|
308
|
-
|
|
309
|
-
|
|
307
|
+
export class WETH9Processor extends BaseProcessor<
|
|
308
|
+
WETH9,
|
|
309
|
+
WETH9BoundContractView
|
|
310
310
|
> {
|
|
311
311
|
onApproval(
|
|
312
|
-
handler: (event: ApprovalEvent, ctx:
|
|
312
|
+
handler: (event: ApprovalEvent, ctx: WETH9Context) => void,
|
|
313
313
|
filter?: ApprovalEventFilter | ApprovalEventFilter[]
|
|
314
314
|
) {
|
|
315
315
|
if (!filter) {
|
|
316
|
-
filter =
|
|
316
|
+
filter = WETH9Processor.filters["Approval(address,address,uint256)"](
|
|
317
317
|
null,
|
|
318
318
|
null,
|
|
319
319
|
null
|
|
@@ -323,11 +323,11 @@ export class Weth9Processor extends BaseProcessor<
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
onTransfer(
|
|
326
|
-
handler: (event: TransferEvent, ctx:
|
|
326
|
+
handler: (event: TransferEvent, ctx: WETH9Context) => void,
|
|
327
327
|
filter?: TransferEventFilter | TransferEventFilter[]
|
|
328
328
|
) {
|
|
329
329
|
if (!filter) {
|
|
330
|
-
filter =
|
|
330
|
+
filter = WETH9Processor.filters["Transfer(address,address,uint256)"](
|
|
331
331
|
null,
|
|
332
332
|
null,
|
|
333
333
|
null
|
|
@@ -337,21 +337,21 @@ export class Weth9Processor extends BaseProcessor<
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
onDeposit(
|
|
340
|
-
handler: (event: DepositEvent, ctx:
|
|
340
|
+
handler: (event: DepositEvent, ctx: WETH9Context) => void,
|
|
341
341
|
filter?: DepositEventFilter | DepositEventFilter[]
|
|
342
342
|
) {
|
|
343
343
|
if (!filter) {
|
|
344
|
-
filter =
|
|
344
|
+
filter = WETH9Processor.filters["Deposit(address,uint256)"](null, null);
|
|
345
345
|
}
|
|
346
346
|
return super.onEvent(handler, filter);
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
onWithdrawal(
|
|
350
|
-
handler: (event: WithdrawalEvent, ctx:
|
|
350
|
+
handler: (event: WithdrawalEvent, ctx: WETH9Context) => void,
|
|
351
351
|
filter?: WithdrawalEventFilter | WithdrawalEventFilter[]
|
|
352
352
|
) {
|
|
353
353
|
if (!filter) {
|
|
354
|
-
filter =
|
|
354
|
+
filter = WETH9Processor.filters["Withdrawal(address,uint256)"](
|
|
355
355
|
null,
|
|
356
356
|
null
|
|
357
357
|
);
|
|
@@ -361,43 +361,43 @@ export class Weth9Processor extends BaseProcessor<
|
|
|
361
361
|
|
|
362
362
|
public static filters = templateContract.filters;
|
|
363
363
|
|
|
364
|
-
protected CreateBoundContractView():
|
|
365
|
-
const view =
|
|
366
|
-
return new
|
|
364
|
+
protected CreateBoundContractView(): WETH9BoundContractView {
|
|
365
|
+
const view = getWETH9Contract(this.config.address, this.config.network);
|
|
366
|
+
return new WETH9BoundContractView(view);
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
public static bind(options: BindOptions):
|
|
370
|
-
let processor = getProcessor("
|
|
369
|
+
public static bind(options: BindOptions): WETH9Processor {
|
|
370
|
+
let processor = getProcessor("WETH9", options) as WETH9Processor;
|
|
371
371
|
if (!processor) {
|
|
372
|
-
// const wrapper =
|
|
372
|
+
// const wrapper = getWETH9Contract(options.address, options.network)
|
|
373
373
|
|
|
374
374
|
const finalOptions = Object.assign({}, options);
|
|
375
375
|
finalOptions.name = getContractName(
|
|
376
|
-
"
|
|
376
|
+
"WETH9",
|
|
377
377
|
options.name,
|
|
378
378
|
options.address,
|
|
379
379
|
options.network
|
|
380
380
|
);
|
|
381
|
-
processor = new
|
|
382
|
-
addProcessor("
|
|
381
|
+
processor = new WETH9Processor(finalOptions);
|
|
382
|
+
addProcessor("WETH9", options, processor);
|
|
383
383
|
}
|
|
384
384
|
return processor;
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
export function
|
|
388
|
+
export function getWETH9Contract(
|
|
389
389
|
address: string,
|
|
390
390
|
network: Networkish = 1
|
|
391
|
-
):
|
|
391
|
+
): WETH9ContractView {
|
|
392
392
|
let contract = getContractByABI(
|
|
393
|
-
"
|
|
393
|
+
"WETH9",
|
|
394
394
|
address,
|
|
395
395
|
network
|
|
396
|
-
) as
|
|
396
|
+
) as WETH9ContractView;
|
|
397
397
|
if (!contract) {
|
|
398
|
-
const rawContract =
|
|
399
|
-
contract = new
|
|
400
|
-
addContractByABI("
|
|
398
|
+
const rawContract = WETH9__factory.connect(address, getProvider(network));
|
|
399
|
+
contract = new WETH9ContractView(rawContract);
|
|
400
|
+
addContractByABI("WETH9", address, network, contract);
|
|
401
401
|
}
|
|
402
402
|
return contract;
|
|
403
403
|
}
|