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