@sentio/sdk 2.45.3-rc.1 → 2.45.3-rc.2
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/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +23 -23
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +93 -659
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.d.ts +8 -8
- package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +33 -264
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.d.ts +18 -18
- package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +75 -538
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +9 -9
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +37 -268
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.d.ts +14 -14
- package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +57 -430
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.d.ts +11 -11
- package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +45 -321
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/file.d.ts.map +1 -1
- package/lib/eth/codegen/file.js +3 -6
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/function-calls.d.ts.map +1 -1
- package/lib/eth/codegen/function-calls.js +5 -27
- package/lib/eth/codegen/function-calls.js.map +1 -1
- package/lib/eth/context.d.ts +4 -2
- package/lib/eth/context.d.ts.map +1 -1
- package/lib/eth/context.js +15 -0
- package/lib/eth/context.js.map +1 -1
- package/lib/eth/eth.d.ts +2 -0
- package/lib/eth/eth.d.ts.map +1 -1
- package/lib/eth/eth.js +15 -1
- package/lib/eth/eth.js.map +1 -1
- package/package.json +3 -3
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +189 -662
- package/src/eth/builtin/internal/erc1155-processor.ts +69 -261
- package/src/eth/builtin/internal/erc20-processor.ts +136 -535
- package/src/eth/builtin/internal/erc20bytes-processor.ts +68 -265
- package/src/eth/builtin/internal/erc721-processor.ts +118 -433
- package/src/eth/builtin/internal/weth9-processor.ts +81 -318
- package/src/eth/codegen/file.ts +2 -6
- package/src/eth/codegen/function-calls.ts +7 -29
- package/src/eth/context.ts +19 -2
- package/src/eth/eth.ts +21 -1
@@ -1,26 +1,6 @@
|
|
1
|
-
|
2
|
-
/* tslint:disable */
|
3
|
-
/* eslint-disable */
|
4
|
-
import { Interface } from "ethers";
|
5
|
-
import { addContractByABI, getContractByABI, addProcessor, getProcessor, getProvider, transformEtherError, BaseProcessor, BaseProcessorTemplate, BoundContractView, ContractView, DummyProvider, } from "@sentio/sdk/eth";
|
1
|
+
import { addContractByABI, getContractByABI, addProcessor, getProcessor, getProvider, transformEtherError, BaseProcessor, BaseProcessorTemplate, BoundContractView, ContractView, DummyProvider, encodeCallData, } from "@sentio/sdk/eth";
|
6
2
|
import { ERC721__factory } from "./index.js";
|
7
3
|
const templateContract = ERC721__factory.connect("0x0", DummyProvider);
|
8
|
-
const iface = new Interface([
|
9
|
-
"function approve(address to, uint256 tokenId) returns ()",
|
10
|
-
"function totalSupply() view returns (uint256)",
|
11
|
-
"function balanceOf(address owner) view returns (uint256 balance)",
|
12
|
-
"function getApproved(uint256 tokenId) view returns (address operator)",
|
13
|
-
"function isApprovedForAll(address owner, address operator) view returns (bool)",
|
14
|
-
"function name() view returns (string)",
|
15
|
-
"function ownerOf(uint256 tokenId) view returns (address owner)",
|
16
|
-
"function safeTransferFrom(address from, address to, uint256 tokenId) returns ()",
|
17
|
-
"function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns ()",
|
18
|
-
"function setApprovalForAll(address operator, bool _approved) returns ()",
|
19
|
-
"function supportsInterface(bytes4 interfaceId) view returns (bool)",
|
20
|
-
"function symbol() view returns (string)",
|
21
|
-
"function tokenURI(uint256 tokenId) view returns (string)",
|
22
|
-
"function transferFrom(address from, address to, uint256 tokenId) returns ()",
|
23
|
-
]);
|
24
4
|
export class ERC721ContractView extends ContractView {
|
25
5
|
constructor(contract) {
|
26
6
|
super(contract);
|
@@ -166,591 +146,238 @@ export class ERC721ContractView extends ContractView {
|
|
166
146
|
},
|
167
147
|
};
|
168
148
|
encodeCall = {
|
169
|
-
approve(to, tokenId,
|
170
|
-
|
171
|
-
const iface = new Interface(["function approve(address,uint256)"]);
|
172
|
-
const calldata = iface.encodeFunctionData("approve", [to, tokenId]);
|
173
|
-
return {
|
174
|
-
context: ethCallContext,
|
175
|
-
calldata,
|
176
|
-
};
|
177
|
-
}
|
178
|
-
catch (e) {
|
179
|
-
const stack = new Error().stack;
|
180
|
-
throw transformEtherError(e, undefined, stack);
|
181
|
-
}
|
149
|
+
approve(to, tokenId, callContext) {
|
150
|
+
return encodeCallData(callContext, "approve", "function approve(address,uint256)", [to, tokenId]);
|
182
151
|
},
|
183
|
-
totalSupply(
|
184
|
-
|
185
|
-
const iface = new Interface(["function totalSupply()"]);
|
186
|
-
const calldata = iface.encodeFunctionData("totalSupply", []);
|
187
|
-
return {
|
188
|
-
context: ethCallContext,
|
189
|
-
calldata,
|
190
|
-
};
|
191
|
-
}
|
192
|
-
catch (e) {
|
193
|
-
const stack = new Error().stack;
|
194
|
-
throw transformEtherError(e, undefined, stack);
|
195
|
-
}
|
152
|
+
totalSupply(callContext) {
|
153
|
+
return encodeCallData(callContext, "totalSupply", "function totalSupply()", []);
|
196
154
|
},
|
197
|
-
balanceOf(owner,
|
198
|
-
|
199
|
-
const iface = new Interface(["function balanceOf(address)"]);
|
200
|
-
const calldata = iface.encodeFunctionData("balanceOf", [owner]);
|
201
|
-
return {
|
202
|
-
context: ethCallContext,
|
203
|
-
calldata,
|
204
|
-
};
|
205
|
-
}
|
206
|
-
catch (e) {
|
207
|
-
const stack = new Error().stack;
|
208
|
-
throw transformEtherError(e, undefined, stack);
|
209
|
-
}
|
155
|
+
balanceOf(owner, callContext) {
|
156
|
+
return encodeCallData(callContext, "balanceOf", "function balanceOf(address)", [owner]);
|
210
157
|
},
|
211
|
-
getApproved(tokenId,
|
212
|
-
|
213
|
-
const iface = new Interface(["function getApproved(uint256)"]);
|
214
|
-
const calldata = iface.encodeFunctionData("getApproved", [tokenId]);
|
215
|
-
return {
|
216
|
-
context: ethCallContext,
|
217
|
-
calldata,
|
218
|
-
};
|
219
|
-
}
|
220
|
-
catch (e) {
|
221
|
-
const stack = new Error().stack;
|
222
|
-
throw transformEtherError(e, undefined, stack);
|
223
|
-
}
|
158
|
+
getApproved(tokenId, callContext) {
|
159
|
+
return encodeCallData(callContext, "getApproved", "function getApproved(uint256)", [tokenId]);
|
224
160
|
},
|
225
|
-
isApprovedForAll(owner, operator,
|
226
|
-
|
227
|
-
const iface = new Interface([
|
228
|
-
"function isApprovedForAll(address,address)",
|
229
|
-
]);
|
230
|
-
const calldata = iface.encodeFunctionData("isApprovedForAll", [
|
231
|
-
owner,
|
232
|
-
operator,
|
233
|
-
]);
|
234
|
-
return {
|
235
|
-
context: ethCallContext,
|
236
|
-
calldata,
|
237
|
-
};
|
238
|
-
}
|
239
|
-
catch (e) {
|
240
|
-
const stack = new Error().stack;
|
241
|
-
throw transformEtherError(e, undefined, stack);
|
242
|
-
}
|
161
|
+
isApprovedForAll(owner, operator, callContext) {
|
162
|
+
return encodeCallData(callContext, "isApprovedForAll", "function isApprovedForAll(address,address)", [owner, operator]);
|
243
163
|
},
|
244
|
-
name(
|
245
|
-
|
246
|
-
const iface = new Interface(["function name()"]);
|
247
|
-
const calldata = iface.encodeFunctionData("name", []);
|
248
|
-
return {
|
249
|
-
context: ethCallContext,
|
250
|
-
calldata,
|
251
|
-
};
|
252
|
-
}
|
253
|
-
catch (e) {
|
254
|
-
const stack = new Error().stack;
|
255
|
-
throw transformEtherError(e, undefined, stack);
|
256
|
-
}
|
164
|
+
name(callContext) {
|
165
|
+
return encodeCallData(callContext, "name", "function name()", []);
|
257
166
|
},
|
258
|
-
ownerOf(tokenId,
|
259
|
-
|
260
|
-
const iface = new Interface(["function ownerOf(uint256)"]);
|
261
|
-
const calldata = iface.encodeFunctionData("ownerOf", [tokenId]);
|
262
|
-
return {
|
263
|
-
context: ethCallContext,
|
264
|
-
calldata,
|
265
|
-
};
|
266
|
-
}
|
267
|
-
catch (e) {
|
268
|
-
const stack = new Error().stack;
|
269
|
-
throw transformEtherError(e, undefined, stack);
|
270
|
-
}
|
167
|
+
ownerOf(tokenId, callContext) {
|
168
|
+
return encodeCallData(callContext, "ownerOf", "function ownerOf(uint256)", [tokenId]);
|
271
169
|
},
|
272
|
-
safeTransferFrom_address_address_uint256(from, to, tokenId,
|
273
|
-
|
274
|
-
const iface = new Interface([
|
275
|
-
"function safeTransferFrom(address,address,uint256)",
|
276
|
-
]);
|
277
|
-
const calldata = iface.encodeFunctionData("safeTransferFrom", [
|
278
|
-
from,
|
279
|
-
to,
|
280
|
-
tokenId,
|
281
|
-
]);
|
282
|
-
return {
|
283
|
-
context: ethCallContext,
|
284
|
-
calldata,
|
285
|
-
};
|
286
|
-
}
|
287
|
-
catch (e) {
|
288
|
-
const stack = new Error().stack;
|
289
|
-
throw transformEtherError(e, undefined, stack);
|
290
|
-
}
|
170
|
+
safeTransferFrom_address_address_uint256(from, to, tokenId, callContext) {
|
171
|
+
return encodeCallData(callContext, "safeTransferFrom", "function safeTransferFrom(address,address,uint256)", [from, to, tokenId]);
|
291
172
|
},
|
292
|
-
safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data,
|
293
|
-
|
294
|
-
const iface = new Interface([
|
295
|
-
"function safeTransferFrom(address,address,uint256,bytes)",
|
296
|
-
]);
|
297
|
-
const calldata = iface.encodeFunctionData("safeTransferFrom", [
|
298
|
-
from,
|
299
|
-
to,
|
300
|
-
tokenId,
|
301
|
-
data,
|
302
|
-
]);
|
303
|
-
return {
|
304
|
-
context: ethCallContext,
|
305
|
-
calldata,
|
306
|
-
};
|
307
|
-
}
|
308
|
-
catch (e) {
|
309
|
-
const stack = new Error().stack;
|
310
|
-
throw transformEtherError(e, undefined, stack);
|
311
|
-
}
|
173
|
+
safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, callContext) {
|
174
|
+
return encodeCallData(callContext, "safeTransferFrom", "function safeTransferFrom(address,address,uint256,bytes)", [from, to, tokenId, data]);
|
312
175
|
},
|
313
|
-
setApprovalForAll(operator, _approved,
|
314
|
-
|
315
|
-
const iface = new Interface([
|
316
|
-
"function setApprovalForAll(address,bool)",
|
317
|
-
]);
|
318
|
-
const calldata = iface.encodeFunctionData("setApprovalForAll", [
|
319
|
-
operator,
|
320
|
-
_approved,
|
321
|
-
]);
|
322
|
-
return {
|
323
|
-
context: ethCallContext,
|
324
|
-
calldata,
|
325
|
-
};
|
326
|
-
}
|
327
|
-
catch (e) {
|
328
|
-
const stack = new Error().stack;
|
329
|
-
throw transformEtherError(e, undefined, stack);
|
330
|
-
}
|
176
|
+
setApprovalForAll(operator, _approved, callContext) {
|
177
|
+
return encodeCallData(callContext, "setApprovalForAll", "function setApprovalForAll(address,bool)", [operator, _approved]);
|
331
178
|
},
|
332
|
-
supportsInterface(interfaceId,
|
333
|
-
|
334
|
-
const iface = new Interface(["function supportsInterface(bytes4)"]);
|
335
|
-
const calldata = iface.encodeFunctionData("supportsInterface", [
|
336
|
-
interfaceId,
|
337
|
-
]);
|
338
|
-
return {
|
339
|
-
context: ethCallContext,
|
340
|
-
calldata,
|
341
|
-
};
|
342
|
-
}
|
343
|
-
catch (e) {
|
344
|
-
const stack = new Error().stack;
|
345
|
-
throw transformEtherError(e, undefined, stack);
|
346
|
-
}
|
179
|
+
supportsInterface(interfaceId, callContext) {
|
180
|
+
return encodeCallData(callContext, "supportsInterface", "function supportsInterface(bytes4)", [interfaceId]);
|
347
181
|
},
|
348
|
-
symbol(
|
349
|
-
|
350
|
-
const iface = new Interface(["function symbol()"]);
|
351
|
-
const calldata = iface.encodeFunctionData("symbol", []);
|
352
|
-
return {
|
353
|
-
context: ethCallContext,
|
354
|
-
calldata,
|
355
|
-
};
|
356
|
-
}
|
357
|
-
catch (e) {
|
358
|
-
const stack = new Error().stack;
|
359
|
-
throw transformEtherError(e, undefined, stack);
|
360
|
-
}
|
182
|
+
symbol(callContext) {
|
183
|
+
return encodeCallData(callContext, "symbol", "function symbol()", []);
|
361
184
|
},
|
362
|
-
tokenURI(tokenId,
|
363
|
-
|
364
|
-
const iface = new Interface(["function tokenURI(uint256)"]);
|
365
|
-
const calldata = iface.encodeFunctionData("tokenURI", [tokenId]);
|
366
|
-
return {
|
367
|
-
context: ethCallContext,
|
368
|
-
calldata,
|
369
|
-
};
|
370
|
-
}
|
371
|
-
catch (e) {
|
372
|
-
const stack = new Error().stack;
|
373
|
-
throw transformEtherError(e, undefined, stack);
|
374
|
-
}
|
185
|
+
tokenURI(tokenId, callContext) {
|
186
|
+
return encodeCallData(callContext, "tokenURI", "function tokenURI(uint256)", [tokenId]);
|
375
187
|
},
|
376
|
-
transferFrom(from, to, tokenId,
|
377
|
-
|
378
|
-
const iface = new Interface([
|
379
|
-
"function transferFrom(address,address,uint256)",
|
380
|
-
]);
|
381
|
-
const calldata = iface.encodeFunctionData("transferFrom", [
|
382
|
-
from,
|
383
|
-
to,
|
384
|
-
tokenId,
|
385
|
-
]);
|
386
|
-
return {
|
387
|
-
context: ethCallContext,
|
388
|
-
calldata,
|
389
|
-
};
|
390
|
-
}
|
391
|
-
catch (e) {
|
392
|
-
const stack = new Error().stack;
|
393
|
-
throw transformEtherError(e, undefined, stack);
|
394
|
-
}
|
188
|
+
transferFrom(from, to, tokenId, callContext) {
|
189
|
+
return encodeCallData(callContext, "transferFrom", "function transferFrom(address,address,uint256)", [from, to, tokenId]);
|
395
190
|
},
|
396
191
|
};
|
397
192
|
}
|
398
193
|
export class ERC721BoundContractView extends BoundContractView {
|
399
194
|
async totalSupply(overrides) {
|
400
|
-
const ethCallContext = {
|
401
|
-
chainId: this.context.chainId,
|
402
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
403
|
-
address: this.context.address,
|
404
|
-
};
|
405
195
|
return await this.view.totalSupply({
|
406
196
|
blockTag: this.context.blockNumber,
|
407
197
|
...overrides,
|
408
|
-
}, this.context.preparedData,
|
198
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
409
199
|
}
|
410
200
|
async balanceOf(owner, overrides) {
|
411
|
-
const ethCallContext = {
|
412
|
-
chainId: this.context.chainId,
|
413
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
414
|
-
address: this.context.address,
|
415
|
-
};
|
416
201
|
return await this.view.balanceOf(owner, {
|
417
202
|
blockTag: this.context.blockNumber,
|
418
203
|
...overrides,
|
419
|
-
}, this.context.preparedData,
|
204
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
420
205
|
}
|
421
206
|
async getApproved(tokenId, overrides) {
|
422
|
-
const ethCallContext = {
|
423
|
-
chainId: this.context.chainId,
|
424
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
425
|
-
address: this.context.address,
|
426
|
-
};
|
427
207
|
return await this.view.getApproved(tokenId, {
|
428
208
|
blockTag: this.context.blockNumber,
|
429
209
|
...overrides,
|
430
|
-
}, this.context.preparedData,
|
210
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
431
211
|
}
|
432
212
|
async isApprovedForAll(owner, operator, overrides) {
|
433
|
-
const ethCallContext = {
|
434
|
-
chainId: this.context.chainId,
|
435
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
436
|
-
address: this.context.address,
|
437
|
-
};
|
438
213
|
return await this.view.isApprovedForAll(owner, operator, {
|
439
214
|
blockTag: this.context.blockNumber,
|
440
215
|
...overrides,
|
441
|
-
}, this.context.preparedData,
|
216
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
442
217
|
}
|
443
218
|
async name(overrides) {
|
444
|
-
const ethCallContext = {
|
445
|
-
chainId: this.context.chainId,
|
446
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
447
|
-
address: this.context.address,
|
448
|
-
};
|
449
219
|
return await this.view.name({
|
450
220
|
blockTag: this.context.blockNumber,
|
451
221
|
...overrides,
|
452
|
-
}, this.context.preparedData,
|
222
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
453
223
|
}
|
454
224
|
async ownerOf(tokenId, overrides) {
|
455
|
-
const ethCallContext = {
|
456
|
-
chainId: this.context.chainId,
|
457
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
458
|
-
address: this.context.address,
|
459
|
-
};
|
460
225
|
return await this.view.ownerOf(tokenId, {
|
461
226
|
blockTag: this.context.blockNumber,
|
462
227
|
...overrides,
|
463
|
-
}, this.context.preparedData,
|
228
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
464
229
|
}
|
465
230
|
async supportsInterface(interfaceId, overrides) {
|
466
|
-
const ethCallContext = {
|
467
|
-
chainId: this.context.chainId,
|
468
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
469
|
-
address: this.context.address,
|
470
|
-
};
|
471
231
|
return await this.view.supportsInterface(interfaceId, {
|
472
232
|
blockTag: this.context.blockNumber,
|
473
233
|
...overrides,
|
474
|
-
}, this.context.preparedData,
|
234
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
475
235
|
}
|
476
236
|
async symbol(overrides) {
|
477
|
-
const ethCallContext = {
|
478
|
-
chainId: this.context.chainId,
|
479
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
480
|
-
address: this.context.address,
|
481
|
-
};
|
482
237
|
return await this.view.symbol({
|
483
238
|
blockTag: this.context.blockNumber,
|
484
239
|
...overrides,
|
485
|
-
}, this.context.preparedData,
|
240
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
486
241
|
}
|
487
242
|
async tokenURI(tokenId, overrides) {
|
488
|
-
const ethCallContext = {
|
489
|
-
chainId: this.context.chainId,
|
490
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
491
|
-
address: this.context.address,
|
492
|
-
};
|
493
243
|
return await this.view.tokenURI(tokenId, {
|
494
244
|
blockTag: this.context.blockNumber,
|
495
245
|
...overrides,
|
496
|
-
}, this.context.preparedData,
|
246
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
497
247
|
}
|
498
248
|
callStatic = {
|
499
249
|
view: this.view,
|
500
250
|
context: this.context,
|
501
251
|
async approve(to, tokenId, overrides) {
|
502
|
-
const ethCallContext = {
|
503
|
-
chainId: this.context.chainId,
|
504
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
505
|
-
address: this.context.address,
|
506
|
-
};
|
507
252
|
return await this.view.callStatic.approve(to, tokenId, {
|
508
253
|
blockTag: this.context.blockNumber,
|
509
254
|
...overrides,
|
510
|
-
}, this.context.preparedData,
|
255
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
511
256
|
},
|
512
257
|
async safeTransferFrom_address_address_uint256(from, to, tokenId, overrides) {
|
513
|
-
const ethCallContext = {
|
514
|
-
chainId: this.context.chainId,
|
515
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
516
|
-
address: this.context.address,
|
517
|
-
};
|
518
258
|
return await this.view.callStatic.safeTransferFrom_address_address_uint256(from, to, tokenId, {
|
519
259
|
blockTag: this.context.blockNumber,
|
520
260
|
...overrides,
|
521
|
-
}, this.context.preparedData,
|
261
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
522
262
|
},
|
523
263
|
async safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, overrides) {
|
524
|
-
const ethCallContext = {
|
525
|
-
chainId: this.context.chainId,
|
526
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
527
|
-
address: this.context.address,
|
528
|
-
};
|
529
264
|
return await this.view.callStatic.safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, {
|
530
265
|
blockTag: this.context.blockNumber,
|
531
266
|
...overrides,
|
532
|
-
}, this.context.preparedData,
|
267
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
533
268
|
},
|
534
269
|
async setApprovalForAll(operator, _approved, overrides) {
|
535
|
-
const ethCallContext = {
|
536
|
-
chainId: this.context.chainId,
|
537
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
538
|
-
address: this.context.address,
|
539
|
-
};
|
540
270
|
return await this.view.callStatic.setApprovalForAll(operator, _approved, {
|
541
271
|
blockTag: this.context.blockNumber,
|
542
272
|
...overrides,
|
543
|
-
}, this.context.preparedData,
|
273
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
544
274
|
},
|
545
275
|
async transferFrom(from, to, tokenId, overrides) {
|
546
|
-
const ethCallContext = {
|
547
|
-
chainId: this.context.chainId,
|
548
|
-
blockTag: "0x" + this.context.blockNumber.toString(16),
|
549
|
-
address: this.context.address,
|
550
|
-
};
|
551
276
|
return await this.view.callStatic.transferFrom(from, to, tokenId, {
|
552
277
|
blockTag: this.context.blockNumber,
|
553
278
|
...overrides,
|
554
|
-
}, this.context.preparedData,
|
279
|
+
}, this.context.preparedData, this.context.getEthCallContext());
|
555
280
|
},
|
556
281
|
};
|
557
282
|
encodeCall = {
|
558
283
|
view: this.view,
|
559
284
|
context: this.context,
|
560
285
|
approve(to, tokenId, overrides) {
|
561
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
562
|
-
if (overrides?.blockTag) {
|
563
|
-
blockTagWithOverride =
|
564
|
-
typeof overrides.blockTag == "string"
|
565
|
-
? overrides.blockTag
|
566
|
-
: "0x" + overrides.blockTag.toString(16);
|
567
|
-
}
|
568
286
|
return this.view.encodeCall.approve(to, tokenId, {
|
569
287
|
chainId: this.context.chainId.toString(),
|
570
288
|
address: this.context.address,
|
571
|
-
blockTag:
|
289
|
+
blockTag: this.context.getBlockTag(overrides),
|
572
290
|
});
|
573
291
|
},
|
574
292
|
totalSupply(overrides) {
|
575
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
576
|
-
if (overrides?.blockTag) {
|
577
|
-
blockTagWithOverride =
|
578
|
-
typeof overrides.blockTag == "string"
|
579
|
-
? overrides.blockTag
|
580
|
-
: "0x" + overrides.blockTag.toString(16);
|
581
|
-
}
|
582
293
|
return this.view.encodeCall.totalSupply({
|
583
294
|
chainId: this.context.chainId.toString(),
|
584
295
|
address: this.context.address,
|
585
|
-
blockTag:
|
296
|
+
blockTag: this.context.getBlockTag(overrides),
|
586
297
|
});
|
587
298
|
},
|
588
299
|
balanceOf(owner, overrides) {
|
589
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
590
|
-
if (overrides?.blockTag) {
|
591
|
-
blockTagWithOverride =
|
592
|
-
typeof overrides.blockTag == "string"
|
593
|
-
? overrides.blockTag
|
594
|
-
: "0x" + overrides.blockTag.toString(16);
|
595
|
-
}
|
596
300
|
return this.view.encodeCall.balanceOf(owner, {
|
597
301
|
chainId: this.context.chainId.toString(),
|
598
302
|
address: this.context.address,
|
599
|
-
blockTag:
|
303
|
+
blockTag: this.context.getBlockTag(overrides),
|
600
304
|
});
|
601
305
|
},
|
602
306
|
getApproved(tokenId, overrides) {
|
603
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
604
|
-
if (overrides?.blockTag) {
|
605
|
-
blockTagWithOverride =
|
606
|
-
typeof overrides.blockTag == "string"
|
607
|
-
? overrides.blockTag
|
608
|
-
: "0x" + overrides.blockTag.toString(16);
|
609
|
-
}
|
610
307
|
return this.view.encodeCall.getApproved(tokenId, {
|
611
308
|
chainId: this.context.chainId.toString(),
|
612
309
|
address: this.context.address,
|
613
|
-
blockTag:
|
310
|
+
blockTag: this.context.getBlockTag(overrides),
|
614
311
|
});
|
615
312
|
},
|
616
313
|
isApprovedForAll(owner, operator, overrides) {
|
617
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
618
|
-
if (overrides?.blockTag) {
|
619
|
-
blockTagWithOverride =
|
620
|
-
typeof overrides.blockTag == "string"
|
621
|
-
? overrides.blockTag
|
622
|
-
: "0x" + overrides.blockTag.toString(16);
|
623
|
-
}
|
624
314
|
return this.view.encodeCall.isApprovedForAll(owner, operator, {
|
625
315
|
chainId: this.context.chainId.toString(),
|
626
316
|
address: this.context.address,
|
627
|
-
blockTag:
|
317
|
+
blockTag: this.context.getBlockTag(overrides),
|
628
318
|
});
|
629
319
|
},
|
630
320
|
name(overrides) {
|
631
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
632
|
-
if (overrides?.blockTag) {
|
633
|
-
blockTagWithOverride =
|
634
|
-
typeof overrides.blockTag == "string"
|
635
|
-
? overrides.blockTag
|
636
|
-
: "0x" + overrides.blockTag.toString(16);
|
637
|
-
}
|
638
321
|
return this.view.encodeCall.name({
|
639
322
|
chainId: this.context.chainId.toString(),
|
640
323
|
address: this.context.address,
|
641
|
-
blockTag:
|
324
|
+
blockTag: this.context.getBlockTag(overrides),
|
642
325
|
});
|
643
326
|
},
|
644
327
|
ownerOf(tokenId, overrides) {
|
645
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
646
|
-
if (overrides?.blockTag) {
|
647
|
-
blockTagWithOverride =
|
648
|
-
typeof overrides.blockTag == "string"
|
649
|
-
? overrides.blockTag
|
650
|
-
: "0x" + overrides.blockTag.toString(16);
|
651
|
-
}
|
652
328
|
return this.view.encodeCall.ownerOf(tokenId, {
|
653
329
|
chainId: this.context.chainId.toString(),
|
654
330
|
address: this.context.address,
|
655
|
-
blockTag:
|
331
|
+
blockTag: this.context.getBlockTag(overrides),
|
656
332
|
});
|
657
333
|
},
|
658
334
|
safeTransferFrom_address_address_uint256(from, to, tokenId, overrides) {
|
659
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
660
|
-
if (overrides?.blockTag) {
|
661
|
-
blockTagWithOverride =
|
662
|
-
typeof overrides.blockTag == "string"
|
663
|
-
? overrides.blockTag
|
664
|
-
: "0x" + overrides.blockTag.toString(16);
|
665
|
-
}
|
666
335
|
return this.view.encodeCall.safeTransferFrom_address_address_uint256(from, to, tokenId, {
|
667
336
|
chainId: this.context.chainId.toString(),
|
668
337
|
address: this.context.address,
|
669
|
-
blockTag:
|
338
|
+
blockTag: this.context.getBlockTag(overrides),
|
670
339
|
});
|
671
340
|
},
|
672
341
|
safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, overrides) {
|
673
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
674
|
-
if (overrides?.blockTag) {
|
675
|
-
blockTagWithOverride =
|
676
|
-
typeof overrides.blockTag == "string"
|
677
|
-
? overrides.blockTag
|
678
|
-
: "0x" + overrides.blockTag.toString(16);
|
679
|
-
}
|
680
342
|
return this.view.encodeCall.safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, {
|
681
343
|
chainId: this.context.chainId.toString(),
|
682
344
|
address: this.context.address,
|
683
|
-
blockTag:
|
345
|
+
blockTag: this.context.getBlockTag(overrides),
|
684
346
|
});
|
685
347
|
},
|
686
348
|
setApprovalForAll(operator, _approved, overrides) {
|
687
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
688
|
-
if (overrides?.blockTag) {
|
689
|
-
blockTagWithOverride =
|
690
|
-
typeof overrides.blockTag == "string"
|
691
|
-
? overrides.blockTag
|
692
|
-
: "0x" + overrides.blockTag.toString(16);
|
693
|
-
}
|
694
349
|
return this.view.encodeCall.setApprovalForAll(operator, _approved, {
|
695
350
|
chainId: this.context.chainId.toString(),
|
696
351
|
address: this.context.address,
|
697
|
-
blockTag:
|
352
|
+
blockTag: this.context.getBlockTag(overrides),
|
698
353
|
});
|
699
354
|
},
|
700
355
|
supportsInterface(interfaceId, overrides) {
|
701
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
702
|
-
if (overrides?.blockTag) {
|
703
|
-
blockTagWithOverride =
|
704
|
-
typeof overrides.blockTag == "string"
|
705
|
-
? overrides.blockTag
|
706
|
-
: "0x" + overrides.blockTag.toString(16);
|
707
|
-
}
|
708
356
|
return this.view.encodeCall.supportsInterface(interfaceId, {
|
709
357
|
chainId: this.context.chainId.toString(),
|
710
358
|
address: this.context.address,
|
711
|
-
blockTag:
|
359
|
+
blockTag: this.context.getBlockTag(overrides),
|
712
360
|
});
|
713
361
|
},
|
714
362
|
symbol(overrides) {
|
715
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
716
|
-
if (overrides?.blockTag) {
|
717
|
-
blockTagWithOverride =
|
718
|
-
typeof overrides.blockTag == "string"
|
719
|
-
? overrides.blockTag
|
720
|
-
: "0x" + overrides.blockTag.toString(16);
|
721
|
-
}
|
722
363
|
return this.view.encodeCall.symbol({
|
723
364
|
chainId: this.context.chainId.toString(),
|
724
365
|
address: this.context.address,
|
725
|
-
blockTag:
|
366
|
+
blockTag: this.context.getBlockTag(overrides),
|
726
367
|
});
|
727
368
|
},
|
728
369
|
tokenURI(tokenId, overrides) {
|
729
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
730
|
-
if (overrides?.blockTag) {
|
731
|
-
blockTagWithOverride =
|
732
|
-
typeof overrides.blockTag == "string"
|
733
|
-
? overrides.blockTag
|
734
|
-
: "0x" + overrides.blockTag.toString(16);
|
735
|
-
}
|
736
370
|
return this.view.encodeCall.tokenURI(tokenId, {
|
737
371
|
chainId: this.context.chainId.toString(),
|
738
372
|
address: this.context.address,
|
739
|
-
blockTag:
|
373
|
+
blockTag: this.context.getBlockTag(overrides),
|
740
374
|
});
|
741
375
|
},
|
742
376
|
transferFrom(from, to, tokenId, overrides) {
|
743
|
-
let blockTagWithOverride = "0x" + this.context.blockNumber.toString(16);
|
744
|
-
if (overrides?.blockTag) {
|
745
|
-
blockTagWithOverride =
|
746
|
-
typeof overrides.blockTag == "string"
|
747
|
-
? overrides.blockTag
|
748
|
-
: "0x" + overrides.blockTag.toString(16);
|
749
|
-
}
|
750
377
|
return this.view.encodeCall.transferFrom(from, to, tokenId, {
|
751
378
|
chainId: this.context.chainId.toString(),
|
752
379
|
address: this.context.address,
|
753
|
-
blockTag:
|
380
|
+
blockTag: this.context.getBlockTag(overrides),
|
754
381
|
});
|
755
382
|
},
|
756
383
|
};
|