@sentio/sdk 2.40.0-rc.3 → 2.40.0-rc.30

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