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