@sentio/sdk 2.40.0-rc.4 → 2.40.0-rc.41
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/aptos/aptos-processor.d.ts +1 -1
- package/lib/aptos/aptos-processor.d.ts.map +1 -1
- package/lib/aptos/aptos-processor.js +1 -1
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/context.d.ts +2 -2
- package/lib/aptos/context.d.ts.map +1 -1
- package/lib/aptos/context.js +1 -1
- package/lib/aptos/ext/aptos-dex.d.ts +1 -1
- package/lib/aptos/ext/aptos-dex.d.ts.map +1 -1
- package/lib/aptos/ext/aptos-dex.js +1 -1
- package/lib/aptos/ext/aptos-dex.js.map +1 -1
- package/lib/aptos/ext/coin-event.d.ts +1 -1
- package/lib/aptos/ext/coin-event.d.ts.map +1 -1
- package/lib/aptos/ext/coin.js +2 -2
- package/lib/aptos/ext/coin.js.map +1 -1
- package/lib/aptos/move-coder.d.ts.map +1 -1
- package/lib/aptos/move-coder.js +6 -5
- package/lib/aptos/move-coder.js.map +1 -1
- package/lib/aptos/network.d.ts +2 -0
- package/lib/aptos/network.d.ts.map +1 -1
- package/lib/aptos/network.js +7 -1
- package/lib/aptos/network.js.map +1 -1
- package/lib/eth/account-processor.d.ts +21 -7
- package/lib/eth/account-processor.d.ts.map +1 -1
- package/lib/eth/account-processor.js +2 -2
- package/lib/eth/account-processor.js.map +1 -1
- package/lib/eth/base-processor-template.d.ts +24 -8
- package/lib/eth/base-processor-template.d.ts.map +1 -1
- package/lib/eth/base-processor-template.js.map +1 -1
- package/lib/eth/base-processor.d.ts +30 -10
- package/lib/eth/base-processor.d.ts.map +1 -1
- package/lib/eth/base-processor.js +6 -6
- package/lib/eth/base-processor.js.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +100 -31
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +1226 -46
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.d.ts +55 -16
- package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +486 -16
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.d.ts +79 -24
- package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +985 -36
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +46 -13
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +485 -18
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.d.ts +67 -20
- package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +784 -28
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.d.ts +64 -19
- package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +574 -22
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/event-handler.js +1 -1
- package/lib/eth/codegen/file.d.ts.map +1 -1
- package/lib/eth/codegen/file.js +21 -3
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/function-calls.d.ts +4 -0
- package/lib/eth/codegen/function-calls.d.ts.map +1 -1
- package/lib/eth/codegen/function-calls.js +80 -5
- package/lib/eth/codegen/function-calls.js.map +1 -1
- package/lib/eth/codegen/types.d.ts +1 -0
- package/lib/eth/codegen/types.d.ts.map +1 -1
- package/lib/eth/codegen/types.js +13 -0
- package/lib/eth/codegen/types.js.map +1 -1
- package/lib/eth/context.d.ts +4 -0
- package/lib/eth/context.d.ts.map +1 -1
- package/lib/eth/context.js +4 -0
- package/lib/eth/context.js.map +1 -1
- package/lib/eth/eth-plugin.d.ts +27 -9
- package/lib/eth/eth-plugin.d.ts.map +1 -1
- package/lib/eth/eth-plugin.js +20 -17
- package/lib/eth/eth-plugin.js.map +1 -1
- package/lib/eth/eth.d.ts.map +1 -1
- package/lib/eth/eth.js +1 -1
- package/lib/eth/eth.js.map +1 -1
- package/lib/eth/generic-processor.js +1 -1
- package/lib/eth/generic-processor.js.map +1 -1
- package/lib/eth/generic-processor.test.js.map +1 -1
- package/lib/eth/index.d.ts +2 -1
- package/lib/eth/index.d.ts.map +1 -1
- package/lib/eth/index.js +2 -1
- package/lib/eth/index.js.map +1 -1
- package/lib/solana/builtin/spl-token-processor.d.ts +1 -1
- package/lib/solana/builtin/spl-token-processor.d.ts.map +1 -1
- package/lib/solana/builtin/spl-token-processor.js +1 -1
- package/lib/solana/builtin/spl-token-processor.js.map +1 -1
- package/lib/solana/solana-context.d.ts +1 -1
- package/lib/solana/solana-context.js +2 -2
- package/lib/stark/codegen/codegen.d.ts +2 -0
- package/lib/stark/codegen/codegen.d.ts.map +1 -0
- package/lib/stark/codegen/codegen.js +109 -0
- package/lib/stark/codegen/codegen.js.map +1 -0
- package/lib/stark/codegen/index.d.ts +2 -0
- package/lib/stark/codegen/index.d.ts.map +1 -0
- package/lib/stark/codegen/index.js +2 -0
- package/lib/stark/codegen/index.js.map +1 -0
- package/lib/stark/codegen/run.d.ts +2 -0
- package/lib/stark/codegen/run.d.ts.map +1 -0
- package/lib/stark/codegen/run.js +11 -0
- package/lib/stark/codegen/run.js.map +1 -0
- package/lib/stark/codegen/utils.d.ts +2 -0
- package/lib/stark/codegen/utils.d.ts.map +1 -0
- package/lib/stark/codegen/utils.js +4 -0
- package/lib/stark/codegen/utils.js.map +1 -0
- package/lib/stark/context.d.ts +28 -0
- package/lib/stark/context.d.ts.map +1 -0
- package/lib/stark/context.js +59 -0
- package/lib/stark/context.js.map +1 -0
- package/lib/stark/contract.d.ts +12 -0
- package/lib/stark/contract.d.ts.map +1 -0
- package/lib/stark/contract.js +43 -0
- package/lib/stark/contract.js.map +1 -0
- package/lib/stark/event.d.ts +7 -0
- package/lib/stark/event.d.ts.map +1 -0
- package/lib/stark/event.js +11 -0
- package/lib/stark/event.js.map +1 -0
- package/lib/stark/index.d.ts +7 -0
- package/lib/stark/index.d.ts.map +1 -0
- package/lib/stark/index.js +7 -0
- package/lib/stark/index.js.map +1 -0
- package/lib/stark/starknet-plugin.d.ts +17 -0
- package/lib/stark/starknet-plugin.d.ts.map +1 -0
- package/lib/stark/starknet-plugin.js +78 -0
- package/lib/stark/starknet-plugin.js.map +1 -0
- package/lib/stark/starknet-processor.d.ts +32 -0
- package/lib/stark/starknet-processor.d.ts.map +1 -0
- package/lib/stark/starknet-processor.js +111 -0
- package/lib/stark/starknet-processor.js.map +1 -0
- package/lib/stark/types.d.ts +11 -0
- package/lib/stark/types.d.ts.map +1 -0
- package/lib/stark/types.js +2 -0
- package/lib/stark/types.js.map +1 -0
- package/lib/store/cache.d.ts +14 -0
- package/lib/store/cache.d.ts.map +1 -0
- package/lib/store/cache.js +35 -0
- package/lib/store/cache.js.map +1 -0
- package/lib/store/store.d.ts +2 -3
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +34 -9
- package/lib/store/store.js.map +1 -1
- package/lib/sui/context.d.ts +1 -1
- package/lib/sui/context.d.ts.map +1 -1
- package/lib/sui/sui-processor.d.ts +1 -1
- package/lib/sui/sui-processor.d.ts.map +1 -1
- package/lib/sui/sui-processor.js +1 -1
- package/lib/sui/sui-processor.js.map +1 -1
- package/lib/testing/aptos-facet.d.ts +1 -1
- package/lib/testing/aptos-facet.js +2 -2
- package/lib/testing/starknet-facet.d.ts +9 -0
- package/lib/testing/starknet-facet.d.ts.map +1 -0
- package/lib/testing/starknet-facet.js +52 -0
- package/lib/testing/starknet-facet.js.map +1 -0
- package/lib/testing/sui-facet.js +1 -1
- package/lib/testing/test-processor-server.d.ts +2 -0
- package/lib/testing/test-processor-server.d.ts.map +1 -1
- package/lib/testing/test-processor-server.js +3 -0
- package/lib/testing/test-processor-server.js.map +1 -1
- package/lib/tsup.config.ts +3 -15
- package/lib/utils/dex-price.d.ts +1 -0
- package/lib/utils/dex-price.d.ts.map +1 -1
- package/lib/utils/dex-price.js +13 -2
- package/lib/utils/dex-price.js.map +1 -1
- package/package.json +21 -10
- package/src/aptos/aptos-processor.ts +1 -1
- package/src/aptos/context.ts +2 -2
- package/src/aptos/ext/aptos-dex.ts +1 -1
- package/src/aptos/ext/coin-event.ts +1 -1
- package/src/aptos/ext/coin.ts +2 -2
- package/src/aptos/move-coder.ts +7 -5
- package/src/aptos/network.ts +7 -1
- package/src/bundle.config.ts +23 -0
- package/src/eth/account-processor.ts +28 -12
- package/src/eth/base-processor-template.ts +16 -8
- package/src/eth/base-processor.ts +25 -16
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +1554 -123
- package/src/eth/builtin/internal/erc1155-processor.ts +659 -42
- package/src/eth/builtin/internal/erc20-processor.ts +1266 -90
- package/src/eth/builtin/internal/erc20bytes-processor.ts +639 -49
- package/src/eth/builtin/internal/erc721-processor.ts +1035 -70
- package/src/eth/builtin/internal/weth9-processor.ts +758 -63
- package/src/eth/codegen/event-handler.ts +1 -1
- package/src/eth/codegen/file.ts +26 -3
- package/src/eth/codegen/function-calls.ts +96 -8
- package/src/eth/codegen/types.ts +22 -1
- package/src/eth/context.ts +7 -0
- package/src/eth/eth-plugin.ts +34 -26
- package/src/eth/eth.ts +1 -2
- package/src/eth/generic-processor.ts +1 -1
- package/src/eth/index.ts +5 -1
- package/src/solana/builtin/spl-token-processor.ts +1 -1
- package/src/solana/solana-context.ts +2 -2
- package/src/stark/codegen/codegen.ts +124 -0
- package/src/stark/codegen/index.ts +1 -0
- package/src/stark/codegen/run.ts +10 -0
- package/src/stark/codegen/utils.ts +3 -0
- package/src/stark/context.ts +78 -0
- package/src/stark/contract.ts +55 -0
- package/src/stark/event.ts +7 -0
- package/src/stark/index.ts +9 -0
- package/src/stark/starknet-plugin.ts +108 -0
- package/src/stark/starknet-processor.ts +140 -0
- package/src/stark/types.ts +11 -0
- package/src/store/cache.ts +46 -0
- package/src/store/store.ts +40 -22
- package/src/sui/context.ts +1 -1
- package/src/sui/sui-processor.ts +1 -1
- package/src/testing/aptos-facet.ts +2 -2
- package/src/testing/starknet-facet.ts +61 -0
- package/src/testing/sui-facet.ts +1 -1
- package/src/testing/test-processor-server.ts +3 -0
- package/src/tsup.config.ts +3 -15
- package/src/utils/dex-price.ts +15 -2
- package/lib/eth/provider.d.ts +0 -5
- package/lib/eth/provider.d.ts.map +0 -1
- package/lib/eth/provider.js +0 -134
- package/lib/eth/provider.js.map +0 -1
- package/lib/utils/chainlink-oracles-sepolia.csv +0 -19
- package/lib/utils/chainlink-oracles.csv +0 -217
- package/src/eth/provider.ts +0 -163
@@ -1,4 +1,8 @@
|
|
1
|
-
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
2
|
+
/* tslint:disable */
|
3
|
+
/* eslint-disable */
|
4
|
+
import { Interface } from "ethers";
|
5
|
+
import { addContractByABI, getContractByABI, addProcessor, getProcessor, getProvider, transformEtherError, BaseProcessor, BaseProcessorTemplate, BoundContractView, ContractView, DummyProvider, makeEthCallKey, } from "@sentio/sdk/eth";
|
2
6
|
import { ERC721__factory } from "./index.js";
|
3
7
|
const templateContract = ERC721__factory.connect("0x0", DummyProvider);
|
4
8
|
export class ERC721ContractView extends ContractView {
|
@@ -6,8 +10,25 @@ export class ERC721ContractView extends ContractView {
|
|
6
10
|
super(contract);
|
7
11
|
this.callStatic.contract = contract;
|
8
12
|
}
|
9
|
-
async totalSupply(overrides) {
|
13
|
+
async totalSupply(overrides, preparedData, ethCallContext) {
|
10
14
|
try {
|
15
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
16
|
+
const iface = new Interface([
|
17
|
+
"function totalSupply() view returns (uint256)",
|
18
|
+
]);
|
19
|
+
const calldata = iface.encodeFunctionData("totalSupply", []);
|
20
|
+
const key = makeEthCallKey({
|
21
|
+
context: ethCallContext,
|
22
|
+
calldata,
|
23
|
+
});
|
24
|
+
const ret = preparedData.ethCallResults[key];
|
25
|
+
if (ret) {
|
26
|
+
const result = iface
|
27
|
+
.decodeFunctionResult("totalSupply", ret)
|
28
|
+
.toArray();
|
29
|
+
return result.length == 1 ? result[0] : result;
|
30
|
+
}
|
31
|
+
}
|
11
32
|
return await this.contract.getFunction("totalSupply()")(overrides || {});
|
12
33
|
}
|
13
34
|
catch (e) {
|
@@ -15,8 +36,23 @@ export class ERC721ContractView extends ContractView {
|
|
15
36
|
throw transformEtherError(e, undefined, stack);
|
16
37
|
}
|
17
38
|
}
|
18
|
-
async balanceOf(owner, overrides) {
|
39
|
+
async balanceOf(owner, overrides, preparedData, ethCallContext) {
|
19
40
|
try {
|
41
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
42
|
+
const iface = new Interface([
|
43
|
+
"function balanceOf(address) view returns (uint256)",
|
44
|
+
]);
|
45
|
+
const calldata = iface.encodeFunctionData("balanceOf", [owner]);
|
46
|
+
const key = makeEthCallKey({
|
47
|
+
context: ethCallContext,
|
48
|
+
calldata,
|
49
|
+
});
|
50
|
+
const ret = preparedData.ethCallResults[key];
|
51
|
+
if (ret) {
|
52
|
+
const result = iface.decodeFunctionResult("balanceOf", ret).toArray();
|
53
|
+
return result.length == 1 ? result[0] : result;
|
54
|
+
}
|
55
|
+
}
|
20
56
|
return await this.contract.getFunction("balanceOf(address)")(owner, overrides || {});
|
21
57
|
}
|
22
58
|
catch (e) {
|
@@ -24,8 +60,25 @@ export class ERC721ContractView extends ContractView {
|
|
24
60
|
throw transformEtherError(e, undefined, stack);
|
25
61
|
}
|
26
62
|
}
|
27
|
-
async getApproved(tokenId, overrides) {
|
63
|
+
async getApproved(tokenId, overrides, preparedData, ethCallContext) {
|
28
64
|
try {
|
65
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
66
|
+
const iface = new Interface([
|
67
|
+
"function getApproved(uint256) view returns (address)",
|
68
|
+
]);
|
69
|
+
const calldata = iface.encodeFunctionData("getApproved", [tokenId]);
|
70
|
+
const key = makeEthCallKey({
|
71
|
+
context: ethCallContext,
|
72
|
+
calldata,
|
73
|
+
});
|
74
|
+
const ret = preparedData.ethCallResults[key];
|
75
|
+
if (ret) {
|
76
|
+
const result = iface
|
77
|
+
.decodeFunctionResult("getApproved", ret)
|
78
|
+
.toArray();
|
79
|
+
return result.length == 1 ? result[0] : result;
|
80
|
+
}
|
81
|
+
}
|
29
82
|
return await this.contract.getFunction("getApproved(uint256)")(tokenId, overrides || {});
|
30
83
|
}
|
31
84
|
catch (e) {
|
@@ -33,8 +86,28 @@ export class ERC721ContractView extends ContractView {
|
|
33
86
|
throw transformEtherError(e, undefined, stack);
|
34
87
|
}
|
35
88
|
}
|
36
|
-
async isApprovedForAll(owner, operator, overrides) {
|
89
|
+
async isApprovedForAll(owner, operator, overrides, preparedData, ethCallContext) {
|
37
90
|
try {
|
91
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
92
|
+
const iface = new Interface([
|
93
|
+
"function isApprovedForAll(address,address) view returns (bool)",
|
94
|
+
]);
|
95
|
+
const calldata = iface.encodeFunctionData("isApprovedForAll", [
|
96
|
+
owner,
|
97
|
+
operator,
|
98
|
+
]);
|
99
|
+
const key = makeEthCallKey({
|
100
|
+
context: ethCallContext,
|
101
|
+
calldata,
|
102
|
+
});
|
103
|
+
const ret = preparedData.ethCallResults[key];
|
104
|
+
if (ret) {
|
105
|
+
const result = iface
|
106
|
+
.decodeFunctionResult("isApprovedForAll", ret)
|
107
|
+
.toArray();
|
108
|
+
return result.length == 1 ? result[0] : result;
|
109
|
+
}
|
110
|
+
}
|
38
111
|
return await this.contract.getFunction("isApprovedForAll(address,address)")(owner, operator, overrides || {});
|
39
112
|
}
|
40
113
|
catch (e) {
|
@@ -42,8 +115,21 @@ export class ERC721ContractView extends ContractView {
|
|
42
115
|
throw transformEtherError(e, undefined, stack);
|
43
116
|
}
|
44
117
|
}
|
45
|
-
async name(overrides) {
|
118
|
+
async name(overrides, preparedData, ethCallContext) {
|
46
119
|
try {
|
120
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
121
|
+
const iface = new Interface(["function name() view returns (string)"]);
|
122
|
+
const calldata = iface.encodeFunctionData("name", []);
|
123
|
+
const key = makeEthCallKey({
|
124
|
+
context: ethCallContext,
|
125
|
+
calldata,
|
126
|
+
});
|
127
|
+
const ret = preparedData.ethCallResults[key];
|
128
|
+
if (ret) {
|
129
|
+
const result = iface.decodeFunctionResult("name", ret).toArray();
|
130
|
+
return result.length == 1 ? result[0] : result;
|
131
|
+
}
|
132
|
+
}
|
47
133
|
return await this.contract.getFunction("name()")(overrides || {});
|
48
134
|
}
|
49
135
|
catch (e) {
|
@@ -51,8 +137,23 @@ export class ERC721ContractView extends ContractView {
|
|
51
137
|
throw transformEtherError(e, undefined, stack);
|
52
138
|
}
|
53
139
|
}
|
54
|
-
async ownerOf(tokenId, overrides) {
|
140
|
+
async ownerOf(tokenId, overrides, preparedData, ethCallContext) {
|
55
141
|
try {
|
142
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
143
|
+
const iface = new Interface([
|
144
|
+
"function ownerOf(uint256) view returns (address)",
|
145
|
+
]);
|
146
|
+
const calldata = iface.encodeFunctionData("ownerOf", [tokenId]);
|
147
|
+
const key = makeEthCallKey({
|
148
|
+
context: ethCallContext,
|
149
|
+
calldata,
|
150
|
+
});
|
151
|
+
const ret = preparedData.ethCallResults[key];
|
152
|
+
if (ret) {
|
153
|
+
const result = iface.decodeFunctionResult("ownerOf", ret).toArray();
|
154
|
+
return result.length == 1 ? result[0] : result;
|
155
|
+
}
|
156
|
+
}
|
56
157
|
return await this.contract.getFunction("ownerOf(uint256)")(tokenId, overrides || {});
|
57
158
|
}
|
58
159
|
catch (e) {
|
@@ -60,8 +161,27 @@ export class ERC721ContractView extends ContractView {
|
|
60
161
|
throw transformEtherError(e, undefined, stack);
|
61
162
|
}
|
62
163
|
}
|
63
|
-
async supportsInterface(interfaceId, overrides) {
|
164
|
+
async supportsInterface(interfaceId, overrides, preparedData, ethCallContext) {
|
64
165
|
try {
|
166
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
167
|
+
const iface = new Interface([
|
168
|
+
"function supportsInterface(bytes4) view returns (bool)",
|
169
|
+
]);
|
170
|
+
const calldata = iface.encodeFunctionData("supportsInterface", [
|
171
|
+
interfaceId,
|
172
|
+
]);
|
173
|
+
const key = makeEthCallKey({
|
174
|
+
context: ethCallContext,
|
175
|
+
calldata,
|
176
|
+
});
|
177
|
+
const ret = preparedData.ethCallResults[key];
|
178
|
+
if (ret) {
|
179
|
+
const result = iface
|
180
|
+
.decodeFunctionResult("supportsInterface", ret)
|
181
|
+
.toArray();
|
182
|
+
return result.length == 1 ? result[0] : result;
|
183
|
+
}
|
184
|
+
}
|
65
185
|
return await this.contract.getFunction("supportsInterface(bytes4)")(interfaceId, overrides || {});
|
66
186
|
}
|
67
187
|
catch (e) {
|
@@ -69,8 +189,23 @@ export class ERC721ContractView extends ContractView {
|
|
69
189
|
throw transformEtherError(e, undefined, stack);
|
70
190
|
}
|
71
191
|
}
|
72
|
-
async symbol(overrides) {
|
192
|
+
async symbol(overrides, preparedData, ethCallContext) {
|
73
193
|
try {
|
194
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
195
|
+
const iface = new Interface([
|
196
|
+
"function symbol() view returns (string)",
|
197
|
+
]);
|
198
|
+
const calldata = iface.encodeFunctionData("symbol", []);
|
199
|
+
const key = makeEthCallKey({
|
200
|
+
context: ethCallContext,
|
201
|
+
calldata,
|
202
|
+
});
|
203
|
+
const ret = preparedData.ethCallResults[key];
|
204
|
+
if (ret) {
|
205
|
+
const result = iface.decodeFunctionResult("symbol", ret).toArray();
|
206
|
+
return result.length == 1 ? result[0] : result;
|
207
|
+
}
|
208
|
+
}
|
74
209
|
return await this.contract.getFunction("symbol()")(overrides || {});
|
75
210
|
}
|
76
211
|
catch (e) {
|
@@ -78,8 +213,23 @@ export class ERC721ContractView extends ContractView {
|
|
78
213
|
throw transformEtherError(e, undefined, stack);
|
79
214
|
}
|
80
215
|
}
|
81
|
-
async tokenURI(tokenId, overrides) {
|
216
|
+
async tokenURI(tokenId, overrides, preparedData, ethCallContext) {
|
82
217
|
try {
|
218
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
219
|
+
const iface = new Interface([
|
220
|
+
"function tokenURI(uint256) view returns (string)",
|
221
|
+
]);
|
222
|
+
const calldata = iface.encodeFunctionData("tokenURI", [tokenId]);
|
223
|
+
const key = makeEthCallKey({
|
224
|
+
context: ethCallContext,
|
225
|
+
calldata,
|
226
|
+
});
|
227
|
+
const ret = preparedData.ethCallResults[key];
|
228
|
+
if (ret) {
|
229
|
+
const result = iface.decodeFunctionResult("tokenURI", ret).toArray();
|
230
|
+
return result.length == 1 ? result[0] : result;
|
231
|
+
}
|
232
|
+
}
|
83
233
|
return await this.contract.getFunction("tokenURI(uint256)")(tokenId, overrides || {});
|
84
234
|
}
|
85
235
|
catch (e) {
|
@@ -89,8 +239,23 @@ export class ERC721ContractView extends ContractView {
|
|
89
239
|
}
|
90
240
|
callStatic = {
|
91
241
|
contract: this.contract,
|
92
|
-
async approve(to, tokenId, overrides) {
|
242
|
+
async approve(to, tokenId, overrides, preparedData, ethCallContext) {
|
93
243
|
try {
|
244
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
245
|
+
const iface = new Interface([
|
246
|
+
"function approve(address,uint256) nonpayable returns ()",
|
247
|
+
]);
|
248
|
+
const calldata = iface.encodeFunctionData("approve", [to, tokenId]);
|
249
|
+
const key = makeEthCallKey({
|
250
|
+
context: ethCallContext,
|
251
|
+
calldata,
|
252
|
+
});
|
253
|
+
const ret = preparedData.ethCallResults[key];
|
254
|
+
if (ret) {
|
255
|
+
const result = iface.decodeFunctionResult("approve", ret).toArray();
|
256
|
+
return result.length == 1 ? result[0] : result;
|
257
|
+
}
|
258
|
+
}
|
94
259
|
return await this.contract
|
95
260
|
.getFunction("approve(address,uint256)")
|
96
261
|
.staticCall(to, tokenId, overrides || {});
|
@@ -100,8 +265,29 @@ export class ERC721ContractView extends ContractView {
|
|
100
265
|
throw transformEtherError(e, undefined, stack);
|
101
266
|
}
|
102
267
|
},
|
103
|
-
async safeTransferFrom_address_address_uint256(from, to, tokenId, overrides) {
|
268
|
+
async safeTransferFrom_address_address_uint256(from, to, tokenId, overrides, preparedData, ethCallContext) {
|
104
269
|
try {
|
270
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
271
|
+
const iface = new Interface([
|
272
|
+
"function safeTransferFrom(address,address,uint256) nonpayable returns ()",
|
273
|
+
]);
|
274
|
+
const calldata = iface.encodeFunctionData("safeTransferFrom", [
|
275
|
+
from,
|
276
|
+
to,
|
277
|
+
tokenId,
|
278
|
+
]);
|
279
|
+
const key = makeEthCallKey({
|
280
|
+
context: ethCallContext,
|
281
|
+
calldata,
|
282
|
+
});
|
283
|
+
const ret = preparedData.ethCallResults[key];
|
284
|
+
if (ret) {
|
285
|
+
const result = iface
|
286
|
+
.decodeFunctionResult("safeTransferFrom", ret)
|
287
|
+
.toArray();
|
288
|
+
return result.length == 1 ? result[0] : result;
|
289
|
+
}
|
290
|
+
}
|
105
291
|
return await this.contract
|
106
292
|
.getFunction("safeTransferFrom(address,address,uint256)")
|
107
293
|
.staticCall(from, to, tokenId, overrides || {});
|
@@ -111,8 +297,30 @@ export class ERC721ContractView extends ContractView {
|
|
111
297
|
throw transformEtherError(e, undefined, stack);
|
112
298
|
}
|
113
299
|
},
|
114
|
-
async safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, overrides) {
|
300
|
+
async safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, overrides, preparedData, ethCallContext) {
|
115
301
|
try {
|
302
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
303
|
+
const iface = new Interface([
|
304
|
+
"function safeTransferFrom(address,address,uint256,bytes) nonpayable returns ()",
|
305
|
+
]);
|
306
|
+
const calldata = iface.encodeFunctionData("safeTransferFrom", [
|
307
|
+
from,
|
308
|
+
to,
|
309
|
+
tokenId,
|
310
|
+
data,
|
311
|
+
]);
|
312
|
+
const key = makeEthCallKey({
|
313
|
+
context: ethCallContext,
|
314
|
+
calldata,
|
315
|
+
});
|
316
|
+
const ret = preparedData.ethCallResults[key];
|
317
|
+
if (ret) {
|
318
|
+
const result = iface
|
319
|
+
.decodeFunctionResult("safeTransferFrom", ret)
|
320
|
+
.toArray();
|
321
|
+
return result.length == 1 ? result[0] : result;
|
322
|
+
}
|
323
|
+
}
|
116
324
|
return await this.contract
|
117
325
|
.getFunction("safeTransferFrom(address,address,uint256,bytes)")
|
118
326
|
.staticCall(from, to, tokenId, data, overrides || {});
|
@@ -122,8 +330,28 @@ export class ERC721ContractView extends ContractView {
|
|
122
330
|
throw transformEtherError(e, undefined, stack);
|
123
331
|
}
|
124
332
|
},
|
125
|
-
async setApprovalForAll(operator, _approved, overrides) {
|
333
|
+
async setApprovalForAll(operator, _approved, overrides, preparedData, ethCallContext) {
|
126
334
|
try {
|
335
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
336
|
+
const iface = new Interface([
|
337
|
+
"function setApprovalForAll(address,bool) nonpayable returns ()",
|
338
|
+
]);
|
339
|
+
const calldata = iface.encodeFunctionData("setApprovalForAll", [
|
340
|
+
operator,
|
341
|
+
_approved,
|
342
|
+
]);
|
343
|
+
const key = makeEthCallKey({
|
344
|
+
context: ethCallContext,
|
345
|
+
calldata,
|
346
|
+
});
|
347
|
+
const ret = preparedData.ethCallResults[key];
|
348
|
+
if (ret) {
|
349
|
+
const result = iface
|
350
|
+
.decodeFunctionResult("setApprovalForAll", ret)
|
351
|
+
.toArray();
|
352
|
+
return result.length == 1 ? result[0] : result;
|
353
|
+
}
|
354
|
+
}
|
127
355
|
return await this.contract
|
128
356
|
.getFunction("setApprovalForAll(address,bool)")
|
129
357
|
.staticCall(operator, _approved, overrides || {});
|
@@ -133,8 +361,29 @@ export class ERC721ContractView extends ContractView {
|
|
133
361
|
throw transformEtherError(e, undefined, stack);
|
134
362
|
}
|
135
363
|
},
|
136
|
-
async transferFrom(from, to, tokenId, overrides) {
|
364
|
+
async transferFrom(from, to, tokenId, overrides, preparedData, ethCallContext) {
|
137
365
|
try {
|
366
|
+
if (preparedData?.ethCallResults && ethCallContext) {
|
367
|
+
const iface = new Interface([
|
368
|
+
"function transferFrom(address,address,uint256) nonpayable returns ()",
|
369
|
+
]);
|
370
|
+
const calldata = iface.encodeFunctionData("transferFrom", [
|
371
|
+
from,
|
372
|
+
to,
|
373
|
+
tokenId,
|
374
|
+
]);
|
375
|
+
const key = makeEthCallKey({
|
376
|
+
context: ethCallContext,
|
377
|
+
calldata,
|
378
|
+
});
|
379
|
+
const ret = preparedData.ethCallResults[key];
|
380
|
+
if (ret) {
|
381
|
+
const result = iface
|
382
|
+
.decodeFunctionResult("transferFrom", ret)
|
383
|
+
.toArray();
|
384
|
+
return result.length == 1 ? result[0] : result;
|
385
|
+
}
|
386
|
+
}
|
138
387
|
return await this.contract
|
139
388
|
.getFunction("transferFrom(address,address,uint256)")
|
140
389
|
.staticCall(from, to, tokenId, overrides || {});
|
@@ -145,93 +394,600 @@ export class ERC721ContractView extends ContractView {
|
|
145
394
|
}
|
146
395
|
},
|
147
396
|
};
|
397
|
+
encodeCall = {
|
398
|
+
approve(to, tokenId, ethCallContext) {
|
399
|
+
try {
|
400
|
+
const iface = new Interface(["function approve(address,uint256)"]);
|
401
|
+
const calldata = iface.encodeFunctionData("approve", [to, tokenId]);
|
402
|
+
return {
|
403
|
+
context: ethCallContext,
|
404
|
+
calldata,
|
405
|
+
};
|
406
|
+
}
|
407
|
+
catch (e) {
|
408
|
+
const stack = new Error().stack;
|
409
|
+
throw transformEtherError(e, undefined, stack);
|
410
|
+
}
|
411
|
+
},
|
412
|
+
totalSupply(ethCallContext) {
|
413
|
+
try {
|
414
|
+
const iface = new Interface(["function totalSupply()"]);
|
415
|
+
const calldata = iface.encodeFunctionData("totalSupply", []);
|
416
|
+
return {
|
417
|
+
context: ethCallContext,
|
418
|
+
calldata,
|
419
|
+
};
|
420
|
+
}
|
421
|
+
catch (e) {
|
422
|
+
const stack = new Error().stack;
|
423
|
+
throw transformEtherError(e, undefined, stack);
|
424
|
+
}
|
425
|
+
},
|
426
|
+
balanceOf(owner, ethCallContext) {
|
427
|
+
try {
|
428
|
+
const iface = new Interface(["function balanceOf(address)"]);
|
429
|
+
const calldata = iface.encodeFunctionData("balanceOf", [owner]);
|
430
|
+
return {
|
431
|
+
context: ethCallContext,
|
432
|
+
calldata,
|
433
|
+
};
|
434
|
+
}
|
435
|
+
catch (e) {
|
436
|
+
const stack = new Error().stack;
|
437
|
+
throw transformEtherError(e, undefined, stack);
|
438
|
+
}
|
439
|
+
},
|
440
|
+
getApproved(tokenId, ethCallContext) {
|
441
|
+
try {
|
442
|
+
const iface = new Interface(["function getApproved(uint256)"]);
|
443
|
+
const calldata = iface.encodeFunctionData("getApproved", [tokenId]);
|
444
|
+
return {
|
445
|
+
context: ethCallContext,
|
446
|
+
calldata,
|
447
|
+
};
|
448
|
+
}
|
449
|
+
catch (e) {
|
450
|
+
const stack = new Error().stack;
|
451
|
+
throw transformEtherError(e, undefined, stack);
|
452
|
+
}
|
453
|
+
},
|
454
|
+
isApprovedForAll(owner, operator, ethCallContext) {
|
455
|
+
try {
|
456
|
+
const iface = new Interface([
|
457
|
+
"function isApprovedForAll(address,address)",
|
458
|
+
]);
|
459
|
+
const calldata = iface.encodeFunctionData("isApprovedForAll", [
|
460
|
+
owner,
|
461
|
+
operator,
|
462
|
+
]);
|
463
|
+
return {
|
464
|
+
context: ethCallContext,
|
465
|
+
calldata,
|
466
|
+
};
|
467
|
+
}
|
468
|
+
catch (e) {
|
469
|
+
const stack = new Error().stack;
|
470
|
+
throw transformEtherError(e, undefined, stack);
|
471
|
+
}
|
472
|
+
},
|
473
|
+
name(ethCallContext) {
|
474
|
+
try {
|
475
|
+
const iface = new Interface(["function name()"]);
|
476
|
+
const calldata = iface.encodeFunctionData("name", []);
|
477
|
+
return {
|
478
|
+
context: ethCallContext,
|
479
|
+
calldata,
|
480
|
+
};
|
481
|
+
}
|
482
|
+
catch (e) {
|
483
|
+
const stack = new Error().stack;
|
484
|
+
throw transformEtherError(e, undefined, stack);
|
485
|
+
}
|
486
|
+
},
|
487
|
+
ownerOf(tokenId, ethCallContext) {
|
488
|
+
try {
|
489
|
+
const iface = new Interface(["function ownerOf(uint256)"]);
|
490
|
+
const calldata = iface.encodeFunctionData("ownerOf", [tokenId]);
|
491
|
+
return {
|
492
|
+
context: ethCallContext,
|
493
|
+
calldata,
|
494
|
+
};
|
495
|
+
}
|
496
|
+
catch (e) {
|
497
|
+
const stack = new Error().stack;
|
498
|
+
throw transformEtherError(e, undefined, stack);
|
499
|
+
}
|
500
|
+
},
|
501
|
+
safeTransferFrom_address_address_uint256(from, to, tokenId, ethCallContext) {
|
502
|
+
try {
|
503
|
+
const iface = new Interface([
|
504
|
+
"function safeTransferFrom(address,address,uint256)",
|
505
|
+
]);
|
506
|
+
const calldata = iface.encodeFunctionData("safeTransferFrom", [
|
507
|
+
from,
|
508
|
+
to,
|
509
|
+
tokenId,
|
510
|
+
]);
|
511
|
+
return {
|
512
|
+
context: ethCallContext,
|
513
|
+
calldata,
|
514
|
+
};
|
515
|
+
}
|
516
|
+
catch (e) {
|
517
|
+
const stack = new Error().stack;
|
518
|
+
throw transformEtherError(e, undefined, stack);
|
519
|
+
}
|
520
|
+
},
|
521
|
+
safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, ethCallContext) {
|
522
|
+
try {
|
523
|
+
const iface = new Interface([
|
524
|
+
"function safeTransferFrom(address,address,uint256,bytes)",
|
525
|
+
]);
|
526
|
+
const calldata = iface.encodeFunctionData("safeTransferFrom", [
|
527
|
+
from,
|
528
|
+
to,
|
529
|
+
tokenId,
|
530
|
+
data,
|
531
|
+
]);
|
532
|
+
return {
|
533
|
+
context: ethCallContext,
|
534
|
+
calldata,
|
535
|
+
};
|
536
|
+
}
|
537
|
+
catch (e) {
|
538
|
+
const stack = new Error().stack;
|
539
|
+
throw transformEtherError(e, undefined, stack);
|
540
|
+
}
|
541
|
+
},
|
542
|
+
setApprovalForAll(operator, _approved, ethCallContext) {
|
543
|
+
try {
|
544
|
+
const iface = new Interface([
|
545
|
+
"function setApprovalForAll(address,bool)",
|
546
|
+
]);
|
547
|
+
const calldata = iface.encodeFunctionData("setApprovalForAll", [
|
548
|
+
operator,
|
549
|
+
_approved,
|
550
|
+
]);
|
551
|
+
return {
|
552
|
+
context: ethCallContext,
|
553
|
+
calldata,
|
554
|
+
};
|
555
|
+
}
|
556
|
+
catch (e) {
|
557
|
+
const stack = new Error().stack;
|
558
|
+
throw transformEtherError(e, undefined, stack);
|
559
|
+
}
|
560
|
+
},
|
561
|
+
supportsInterface(interfaceId, ethCallContext) {
|
562
|
+
try {
|
563
|
+
const iface = new Interface(["function supportsInterface(bytes4)"]);
|
564
|
+
const calldata = iface.encodeFunctionData("supportsInterface", [
|
565
|
+
interfaceId,
|
566
|
+
]);
|
567
|
+
return {
|
568
|
+
context: ethCallContext,
|
569
|
+
calldata,
|
570
|
+
};
|
571
|
+
}
|
572
|
+
catch (e) {
|
573
|
+
const stack = new Error().stack;
|
574
|
+
throw transformEtherError(e, undefined, stack);
|
575
|
+
}
|
576
|
+
},
|
577
|
+
symbol(ethCallContext) {
|
578
|
+
try {
|
579
|
+
const iface = new Interface(["function symbol()"]);
|
580
|
+
const calldata = iface.encodeFunctionData("symbol", []);
|
581
|
+
return {
|
582
|
+
context: ethCallContext,
|
583
|
+
calldata,
|
584
|
+
};
|
585
|
+
}
|
586
|
+
catch (e) {
|
587
|
+
const stack = new Error().stack;
|
588
|
+
throw transformEtherError(e, undefined, stack);
|
589
|
+
}
|
590
|
+
},
|
591
|
+
tokenURI(tokenId, ethCallContext) {
|
592
|
+
try {
|
593
|
+
const iface = new Interface(["function tokenURI(uint256)"]);
|
594
|
+
const calldata = iface.encodeFunctionData("tokenURI", [tokenId]);
|
595
|
+
return {
|
596
|
+
context: ethCallContext,
|
597
|
+
calldata,
|
598
|
+
};
|
599
|
+
}
|
600
|
+
catch (e) {
|
601
|
+
const stack = new Error().stack;
|
602
|
+
throw transformEtherError(e, undefined, stack);
|
603
|
+
}
|
604
|
+
},
|
605
|
+
transferFrom(from, to, tokenId, ethCallContext) {
|
606
|
+
try {
|
607
|
+
const iface = new Interface([
|
608
|
+
"function transferFrom(address,address,uint256)",
|
609
|
+
]);
|
610
|
+
const calldata = iface.encodeFunctionData("transferFrom", [
|
611
|
+
from,
|
612
|
+
to,
|
613
|
+
tokenId,
|
614
|
+
]);
|
615
|
+
return {
|
616
|
+
context: ethCallContext,
|
617
|
+
calldata,
|
618
|
+
};
|
619
|
+
}
|
620
|
+
catch (e) {
|
621
|
+
const stack = new Error().stack;
|
622
|
+
throw transformEtherError(e, undefined, stack);
|
623
|
+
}
|
624
|
+
},
|
625
|
+
};
|
148
626
|
}
|
149
627
|
export class ERC721BoundContractView extends BoundContractView {
|
150
628
|
async totalSupply(overrides) {
|
629
|
+
const ethCallContext = {
|
630
|
+
chainId: this.context.chainId,
|
631
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
632
|
+
address: this.context.address,
|
633
|
+
};
|
151
634
|
return await this.view.totalSupply({
|
152
635
|
blockTag: this.context.blockNumber,
|
153
636
|
...overrides,
|
154
|
-
});
|
637
|
+
}, this.context.preparedData, ethCallContext);
|
155
638
|
}
|
156
639
|
async balanceOf(owner, overrides) {
|
640
|
+
const ethCallContext = {
|
641
|
+
chainId: this.context.chainId,
|
642
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
643
|
+
address: this.context.address,
|
644
|
+
};
|
157
645
|
return await this.view.balanceOf(owner, {
|
158
646
|
blockTag: this.context.blockNumber,
|
159
647
|
...overrides,
|
160
|
-
});
|
648
|
+
}, this.context.preparedData, ethCallContext);
|
161
649
|
}
|
162
650
|
async getApproved(tokenId, overrides) {
|
651
|
+
const ethCallContext = {
|
652
|
+
chainId: this.context.chainId,
|
653
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
654
|
+
address: this.context.address,
|
655
|
+
};
|
163
656
|
return await this.view.getApproved(tokenId, {
|
164
657
|
blockTag: this.context.blockNumber,
|
165
658
|
...overrides,
|
166
|
-
});
|
659
|
+
}, this.context.preparedData, ethCallContext);
|
167
660
|
}
|
168
661
|
async isApprovedForAll(owner, operator, overrides) {
|
662
|
+
const ethCallContext = {
|
663
|
+
chainId: this.context.chainId,
|
664
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
665
|
+
address: this.context.address,
|
666
|
+
};
|
169
667
|
return await this.view.isApprovedForAll(owner, operator, {
|
170
668
|
blockTag: this.context.blockNumber,
|
171
669
|
...overrides,
|
172
|
-
});
|
670
|
+
}, this.context.preparedData, ethCallContext);
|
173
671
|
}
|
174
672
|
async name(overrides) {
|
673
|
+
const ethCallContext = {
|
674
|
+
chainId: this.context.chainId,
|
675
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
676
|
+
address: this.context.address,
|
677
|
+
};
|
175
678
|
return await this.view.name({
|
176
679
|
blockTag: this.context.blockNumber,
|
177
680
|
...overrides,
|
178
|
-
});
|
681
|
+
}, this.context.preparedData, ethCallContext);
|
179
682
|
}
|
180
683
|
async ownerOf(tokenId, overrides) {
|
684
|
+
const ethCallContext = {
|
685
|
+
chainId: this.context.chainId,
|
686
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
687
|
+
address: this.context.address,
|
688
|
+
};
|
181
689
|
return await this.view.ownerOf(tokenId, {
|
182
690
|
blockTag: this.context.blockNumber,
|
183
691
|
...overrides,
|
184
|
-
});
|
692
|
+
}, this.context.preparedData, ethCallContext);
|
185
693
|
}
|
186
694
|
async supportsInterface(interfaceId, overrides) {
|
695
|
+
const ethCallContext = {
|
696
|
+
chainId: this.context.chainId,
|
697
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
698
|
+
address: this.context.address,
|
699
|
+
};
|
187
700
|
return await this.view.supportsInterface(interfaceId, {
|
188
701
|
blockTag: this.context.blockNumber,
|
189
702
|
...overrides,
|
190
|
-
});
|
703
|
+
}, this.context.preparedData, ethCallContext);
|
191
704
|
}
|
192
705
|
async symbol(overrides) {
|
706
|
+
const ethCallContext = {
|
707
|
+
chainId: this.context.chainId,
|
708
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
709
|
+
address: this.context.address,
|
710
|
+
};
|
193
711
|
return await this.view.symbol({
|
194
712
|
blockTag: this.context.blockNumber,
|
195
713
|
...overrides,
|
196
|
-
});
|
714
|
+
}, this.context.preparedData, ethCallContext);
|
197
715
|
}
|
198
716
|
async tokenURI(tokenId, overrides) {
|
717
|
+
const ethCallContext = {
|
718
|
+
chainId: this.context.chainId,
|
719
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
720
|
+
address: this.context.address,
|
721
|
+
};
|
199
722
|
return await this.view.tokenURI(tokenId, {
|
200
723
|
blockTag: this.context.blockNumber,
|
201
724
|
...overrides,
|
202
|
-
});
|
725
|
+
}, this.context.preparedData, ethCallContext);
|
203
726
|
}
|
204
727
|
callStatic = {
|
205
728
|
view: this.view,
|
206
729
|
context: this.context,
|
207
730
|
async approve(to, tokenId, overrides) {
|
731
|
+
const ethCallContext = {
|
732
|
+
chainId: this.context.chainId,
|
733
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
734
|
+
address: this.context.address,
|
735
|
+
};
|
208
736
|
return await this.view.callStatic.approve(to, tokenId, {
|
209
737
|
blockTag: this.context.blockNumber,
|
210
738
|
...overrides,
|
211
|
-
});
|
739
|
+
}, this.context.preparedData, ethCallContext);
|
212
740
|
},
|
213
741
|
async safeTransferFrom_address_address_uint256(from, to, tokenId, overrides) {
|
742
|
+
const ethCallContext = {
|
743
|
+
chainId: this.context.chainId,
|
744
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
745
|
+
address: this.context.address,
|
746
|
+
};
|
214
747
|
return await this.view.callStatic.safeTransferFrom_address_address_uint256(from, to, tokenId, {
|
215
748
|
blockTag: this.context.blockNumber,
|
216
749
|
...overrides,
|
217
|
-
});
|
750
|
+
}, this.context.preparedData, ethCallContext);
|
218
751
|
},
|
219
752
|
async safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, overrides) {
|
753
|
+
const ethCallContext = {
|
754
|
+
chainId: this.context.chainId,
|
755
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
756
|
+
address: this.context.address,
|
757
|
+
};
|
220
758
|
return await this.view.callStatic.safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, {
|
221
759
|
blockTag: this.context.blockNumber,
|
222
760
|
...overrides,
|
223
|
-
});
|
761
|
+
}, this.context.preparedData, ethCallContext);
|
224
762
|
},
|
225
763
|
async setApprovalForAll(operator, _approved, overrides) {
|
764
|
+
const ethCallContext = {
|
765
|
+
chainId: this.context.chainId,
|
766
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
767
|
+
address: this.context.address,
|
768
|
+
};
|
226
769
|
return await this.view.callStatic.setApprovalForAll(operator, _approved, {
|
227
770
|
blockTag: this.context.blockNumber,
|
228
771
|
...overrides,
|
229
|
-
});
|
772
|
+
}, this.context.preparedData, ethCallContext);
|
230
773
|
},
|
231
774
|
async transferFrom(from, to, tokenId, overrides) {
|
775
|
+
const ethCallContext = {
|
776
|
+
chainId: this.context.chainId,
|
777
|
+
blockTag: "0x" + this.context.blockNumber.toString(16),
|
778
|
+
address: this.context.address,
|
779
|
+
};
|
232
780
|
return await this.view.callStatic.transferFrom(from, to, tokenId, {
|
233
781
|
blockTag: this.context.blockNumber,
|
234
782
|
...overrides,
|
783
|
+
}, this.context.preparedData, ethCallContext);
|
784
|
+
},
|
785
|
+
};
|
786
|
+
encodeCall = {
|
787
|
+
view: this.view,
|
788
|
+
context: this.context,
|
789
|
+
approve(to, tokenId, overrides) {
|
790
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
791
|
+
const address = this.context.address;
|
792
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
793
|
+
if (overrides?.blockTag) {
|
794
|
+
blockTag =
|
795
|
+
typeof overrides.blockTag == "string"
|
796
|
+
? overrides.blockTag
|
797
|
+
: "0x" + overrides.blockTag.toString(16);
|
798
|
+
}
|
799
|
+
return this.view.encodeCall.approve(to, tokenId, {
|
800
|
+
chainId,
|
801
|
+
address,
|
802
|
+
blockTag,
|
803
|
+
});
|
804
|
+
},
|
805
|
+
totalSupply(overrides) {
|
806
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
807
|
+
const address = this.context.address;
|
808
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
809
|
+
if (overrides?.blockTag) {
|
810
|
+
blockTag =
|
811
|
+
typeof overrides.blockTag == "string"
|
812
|
+
? overrides.blockTag
|
813
|
+
: "0x" + overrides.blockTag.toString(16);
|
814
|
+
}
|
815
|
+
return this.view.encodeCall.totalSupply({ chainId, address, blockTag });
|
816
|
+
},
|
817
|
+
balanceOf(owner, overrides) {
|
818
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
819
|
+
const address = this.context.address;
|
820
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
821
|
+
if (overrides?.blockTag) {
|
822
|
+
blockTag =
|
823
|
+
typeof overrides.blockTag == "string"
|
824
|
+
? overrides.blockTag
|
825
|
+
: "0x" + overrides.blockTag.toString(16);
|
826
|
+
}
|
827
|
+
return this.view.encodeCall.balanceOf(owner, {
|
828
|
+
chainId,
|
829
|
+
address,
|
830
|
+
blockTag,
|
831
|
+
});
|
832
|
+
},
|
833
|
+
getApproved(tokenId, overrides) {
|
834
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
835
|
+
const address = this.context.address;
|
836
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
837
|
+
if (overrides?.blockTag) {
|
838
|
+
blockTag =
|
839
|
+
typeof overrides.blockTag == "string"
|
840
|
+
? overrides.blockTag
|
841
|
+
: "0x" + overrides.blockTag.toString(16);
|
842
|
+
}
|
843
|
+
return this.view.encodeCall.getApproved(tokenId, {
|
844
|
+
chainId,
|
845
|
+
address,
|
846
|
+
blockTag,
|
847
|
+
});
|
848
|
+
},
|
849
|
+
isApprovedForAll(owner, operator, overrides) {
|
850
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
851
|
+
const address = this.context.address;
|
852
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
853
|
+
if (overrides?.blockTag) {
|
854
|
+
blockTag =
|
855
|
+
typeof overrides.blockTag == "string"
|
856
|
+
? overrides.blockTag
|
857
|
+
: "0x" + overrides.blockTag.toString(16);
|
858
|
+
}
|
859
|
+
return this.view.encodeCall.isApprovedForAll(owner, operator, {
|
860
|
+
chainId,
|
861
|
+
address,
|
862
|
+
blockTag,
|
863
|
+
});
|
864
|
+
},
|
865
|
+
name(overrides) {
|
866
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
867
|
+
const address = this.context.address;
|
868
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
869
|
+
if (overrides?.blockTag) {
|
870
|
+
blockTag =
|
871
|
+
typeof overrides.blockTag == "string"
|
872
|
+
? overrides.blockTag
|
873
|
+
: "0x" + overrides.blockTag.toString(16);
|
874
|
+
}
|
875
|
+
return this.view.encodeCall.name({ chainId, address, blockTag });
|
876
|
+
},
|
877
|
+
ownerOf(tokenId, overrides) {
|
878
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
879
|
+
const address = this.context.address;
|
880
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
881
|
+
if (overrides?.blockTag) {
|
882
|
+
blockTag =
|
883
|
+
typeof overrides.blockTag == "string"
|
884
|
+
? overrides.blockTag
|
885
|
+
: "0x" + overrides.blockTag.toString(16);
|
886
|
+
}
|
887
|
+
return this.view.encodeCall.ownerOf(tokenId, {
|
888
|
+
chainId,
|
889
|
+
address,
|
890
|
+
blockTag,
|
891
|
+
});
|
892
|
+
},
|
893
|
+
safeTransferFrom_address_address_uint256(from, to, tokenId, overrides) {
|
894
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
895
|
+
const address = this.context.address;
|
896
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
897
|
+
if (overrides?.blockTag) {
|
898
|
+
blockTag =
|
899
|
+
typeof overrides.blockTag == "string"
|
900
|
+
? overrides.blockTag
|
901
|
+
: "0x" + overrides.blockTag.toString(16);
|
902
|
+
}
|
903
|
+
return this.view.encodeCall.safeTransferFrom_address_address_uint256(from, to, tokenId, { chainId, address, blockTag });
|
904
|
+
},
|
905
|
+
safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, overrides) {
|
906
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
907
|
+
const address = this.context.address;
|
908
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
909
|
+
if (overrides?.blockTag) {
|
910
|
+
blockTag =
|
911
|
+
typeof overrides.blockTag == "string"
|
912
|
+
? overrides.blockTag
|
913
|
+
: "0x" + overrides.blockTag.toString(16);
|
914
|
+
}
|
915
|
+
return this.view.encodeCall.safeTransferFrom_address_address_uint256_bytes(from, to, tokenId, data, { chainId, address, blockTag });
|
916
|
+
},
|
917
|
+
setApprovalForAll(operator, _approved, overrides) {
|
918
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
919
|
+
const address = this.context.address;
|
920
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
921
|
+
if (overrides?.blockTag) {
|
922
|
+
blockTag =
|
923
|
+
typeof overrides.blockTag == "string"
|
924
|
+
? overrides.blockTag
|
925
|
+
: "0x" + overrides.blockTag.toString(16);
|
926
|
+
}
|
927
|
+
return this.view.encodeCall.setApprovalForAll(operator, _approved, {
|
928
|
+
chainId,
|
929
|
+
address,
|
930
|
+
blockTag,
|
931
|
+
});
|
932
|
+
},
|
933
|
+
supportsInterface(interfaceId, overrides) {
|
934
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
935
|
+
const address = this.context.address;
|
936
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
937
|
+
if (overrides?.blockTag) {
|
938
|
+
blockTag =
|
939
|
+
typeof overrides.blockTag == "string"
|
940
|
+
? overrides.blockTag
|
941
|
+
: "0x" + overrides.blockTag.toString(16);
|
942
|
+
}
|
943
|
+
return this.view.encodeCall.supportsInterface(interfaceId, {
|
944
|
+
chainId,
|
945
|
+
address,
|
946
|
+
blockTag,
|
947
|
+
});
|
948
|
+
},
|
949
|
+
symbol(overrides) {
|
950
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
951
|
+
const address = this.context.address;
|
952
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
953
|
+
if (overrides?.blockTag) {
|
954
|
+
blockTag =
|
955
|
+
typeof overrides.blockTag == "string"
|
956
|
+
? overrides.blockTag
|
957
|
+
: "0x" + overrides.blockTag.toString(16);
|
958
|
+
}
|
959
|
+
return this.view.encodeCall.symbol({ chainId, address, blockTag });
|
960
|
+
},
|
961
|
+
tokenURI(tokenId, overrides) {
|
962
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
963
|
+
const address = this.context.address;
|
964
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
965
|
+
if (overrides?.blockTag) {
|
966
|
+
blockTag =
|
967
|
+
typeof overrides.blockTag == "string"
|
968
|
+
? overrides.blockTag
|
969
|
+
: "0x" + overrides.blockTag.toString(16);
|
970
|
+
}
|
971
|
+
return this.view.encodeCall.tokenURI(tokenId, {
|
972
|
+
chainId,
|
973
|
+
address,
|
974
|
+
blockTag,
|
975
|
+
});
|
976
|
+
},
|
977
|
+
transferFrom(from, to, tokenId, overrides) {
|
978
|
+
const chainId = overrides?.chainId?.toString() ?? this.context.chainId.toString();
|
979
|
+
const address = this.context.address;
|
980
|
+
let blockTag = "0x" + this.context.blockNumber.toString(16);
|
981
|
+
if (overrides?.blockTag) {
|
982
|
+
blockTag =
|
983
|
+
typeof overrides.blockTag == "string"
|
984
|
+
? overrides.blockTag
|
985
|
+
: "0x" + overrides.blockTag.toString(16);
|
986
|
+
}
|
987
|
+
return this.view.encodeCall.transferFrom(from, to, tokenId, {
|
988
|
+
chainId,
|
989
|
+
address,
|
990
|
+
blockTag,
|
235
991
|
});
|
236
992
|
},
|
237
993
|
};
|