@sentio/sdk 1.41.0-rc.1 → 2.0.0-rc.10

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 (301) hide show
  1. package/lib/builtin/eacaggregatorproxy/index.d.ts +3 -2
  2. package/lib/builtin/eacaggregatorproxy/index.js +3 -5
  3. package/lib/builtin/eacaggregatorproxy/index.js.map +1 -1
  4. package/lib/builtin/eacaggregatorproxy/test-utils.d.ts +1 -1
  5. package/lib/builtin/eacaggregatorproxy/test-utils.js +9 -16
  6. package/lib/builtin/eacaggregatorproxy/test-utils.js.map +1 -1
  7. package/lib/builtin/erc1155/index.d.ts +3 -2
  8. package/lib/builtin/erc1155/index.js +3 -5
  9. package/lib/builtin/erc1155/index.js.map +1 -1
  10. package/lib/builtin/erc1155/test-utils.d.ts +1 -1
  11. package/lib/builtin/erc1155/test-utils.js +9 -16
  12. package/lib/builtin/erc1155/test-utils.js.map +1 -1
  13. package/lib/builtin/erc20/index.d.ts +3 -2
  14. package/lib/builtin/erc20/index.js +3 -5
  15. package/lib/builtin/erc20/index.js.map +1 -1
  16. package/lib/builtin/erc20/test-utils.d.ts +1 -1
  17. package/lib/builtin/erc20/test-utils.js +7 -13
  18. package/lib/builtin/erc20/test-utils.js.map +1 -1
  19. package/lib/builtin/erc20bytes/index.d.ts +3 -2
  20. package/lib/builtin/erc20bytes/index.js +3 -5
  21. package/lib/builtin/erc20bytes/index.js.map +1 -1
  22. package/lib/builtin/erc20bytes/test-utils.d.ts +1 -1
  23. package/lib/builtin/erc20bytes/test-utils.js +5 -10
  24. package/lib/builtin/erc20bytes/test-utils.js.map +1 -1
  25. package/lib/builtin/erc721/index.d.ts +3 -2
  26. package/lib/builtin/erc721/index.js +3 -5
  27. package/lib/builtin/erc721/index.js.map +1 -1
  28. package/lib/builtin/erc721/test-utils.d.ts +1 -1
  29. package/lib/builtin/erc721/test-utils.js +7 -13
  30. package/lib/builtin/erc721/test-utils.js.map +1 -1
  31. package/lib/builtin/index.d.ts +8 -4
  32. package/lib/builtin/index.js +8 -8
  33. package/lib/builtin/index.js.map +1 -1
  34. package/lib/builtin/internal/EACAggregatorProxy.d.ts +6 -6
  35. package/lib/builtin/internal/EACAggregatorProxy.js +1 -2
  36. package/lib/builtin/internal/EACAggregatorProxy.js.map +1 -1
  37. package/lib/builtin/internal/ERC1155.d.ts +6 -6
  38. package/lib/builtin/internal/ERC1155.js +1 -2
  39. package/lib/builtin/internal/ERC1155.js.map +1 -1
  40. package/lib/builtin/internal/ERC20.d.ts +5 -5
  41. package/lib/builtin/internal/ERC20.js +1 -2
  42. package/lib/builtin/internal/ERC20.js.map +1 -1
  43. package/lib/builtin/internal/ERC20Bytes.d.ts +4 -4
  44. package/lib/builtin/internal/ERC20Bytes.js +1 -2
  45. package/lib/builtin/internal/ERC20Bytes.js.map +1 -1
  46. package/lib/builtin/internal/ERC721.d.ts +5 -5
  47. package/lib/builtin/internal/ERC721.js +1 -2
  48. package/lib/builtin/internal/ERC721.js.map +1 -1
  49. package/lib/builtin/internal/WETH9.d.ts +6 -6
  50. package/lib/builtin/internal/WETH9.js +1 -2
  51. package/lib/builtin/internal/WETH9.js.map +1 -1
  52. package/lib/builtin/internal/common.d.ts +4 -2
  53. package/lib/builtin/internal/common.js +1 -2
  54. package/lib/builtin/internal/common.js.map +1 -1
  55. package/lib/builtin/internal/eacaggregatorproxy_processor.d.ts +6 -6
  56. package/lib/builtin/internal/eacaggregatorproxy_processor.js +69 -77
  57. package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +1 -1
  58. package/lib/builtin/internal/erc1155_processor.d.ts +6 -6
  59. package/lib/builtin/internal/erc1155_processor.js +30 -38
  60. package/lib/builtin/internal/erc1155_processor.js.map +1 -1
  61. package/lib/builtin/internal/erc20_processor.d.ts +5 -5
  62. package/lib/builtin/internal/erc20_processor.js +39 -47
  63. package/lib/builtin/internal/erc20_processor.js.map +1 -1
  64. package/lib/builtin/internal/erc20bytes_processor.d.ts +4 -4
  65. package/lib/builtin/internal/erc20bytes_processor.js +33 -41
  66. package/lib/builtin/internal/erc20bytes_processor.js.map +1 -1
  67. package/lib/builtin/internal/erc721_processor.d.ts +5 -5
  68. package/lib/builtin/internal/erc721_processor.js +42 -50
  69. package/lib/builtin/internal/erc721_processor.js.map +1 -1
  70. package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js +4 -8
  71. package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js.map +1 -1
  72. package/lib/builtin/internal/factories/ERC1155__factory.js +4 -8
  73. package/lib/builtin/internal/factories/ERC1155__factory.js.map +1 -1
  74. package/lib/builtin/internal/factories/ERC20Bytes__factory.js +4 -8
  75. package/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -1
  76. package/lib/builtin/internal/factories/ERC20__factory.js +4 -8
  77. package/lib/builtin/internal/factories/ERC20__factory.js.map +1 -1
  78. package/lib/builtin/internal/factories/ERC721__factory.js +4 -8
  79. package/lib/builtin/internal/factories/ERC721__factory.js.map +1 -1
  80. package/lib/builtin/internal/factories/WETH9__factory.js +4 -8
  81. package/lib/builtin/internal/factories/WETH9__factory.js.map +1 -1
  82. package/lib/builtin/internal/factories/index.d.ts +6 -6
  83. package/lib/builtin/internal/factories/index.js +6 -15
  84. package/lib/builtin/internal/factories/index.js.map +1 -1
  85. package/lib/builtin/internal/index.d.ts +13 -13
  86. package/lib/builtin/internal/index.js +7 -17
  87. package/lib/builtin/internal/index.js.map +1 -1
  88. package/lib/builtin/internal/weth9_processor.d.ts +6 -6
  89. package/lib/builtin/internal/weth9_processor.js +33 -41
  90. package/lib/builtin/internal/weth9_processor.js.map +1 -1
  91. package/lib/builtin/weth9/index.d.ts +3 -2
  92. package/lib/builtin/weth9/index.js +3 -5
  93. package/lib/builtin/weth9/index.js.map +1 -1
  94. package/lib/builtin/weth9/test-utils.d.ts +1 -1
  95. package/lib/builtin/weth9/test-utils.js +9 -16
  96. package/lib/builtin/weth9/test-utils.js.map +1 -1
  97. package/lib/core/base-context.d.ts +4 -4
  98. package/lib/core/base-context.js +7 -11
  99. package/lib/core/base-context.js.map +1 -1
  100. package/lib/core/big-decimal.js +3 -7
  101. package/lib/core/big-decimal.js.map +1 -1
  102. package/lib/core/bind-options.js +6 -13
  103. package/lib/core/bind-options.js.map +1 -1
  104. package/lib/core/context.d.ts +5 -5
  105. package/lib/core/context.js +14 -23
  106. package/lib/core/context.js.map +1 -1
  107. package/lib/core/core-plugin.js +9 -13
  108. package/lib/core/core-plugin.js.map +1 -1
  109. package/lib/core/event-tracker.d.ts +2 -2
  110. package/lib/core/event-tracker.js +6 -13
  111. package/lib/core/event-tracker.js.map +1 -1
  112. package/lib/core/exporter.d.ts +2 -2
  113. package/lib/core/exporter.js +4 -9
  114. package/lib/core/exporter.js.map +1 -1
  115. package/lib/core/index.d.ts +12 -9
  116. package/lib/core/index.js +12 -32
  117. package/lib/core/index.js.map +1 -1
  118. package/lib/core/logger.d.ts +2 -2
  119. package/lib/core/logger.js +7 -11
  120. package/lib/core/logger.js.map +1 -1
  121. package/lib/core/metadata.d.ts +4 -0
  122. package/lib/core/metadata.js +21 -7
  123. package/lib/core/metadata.js.map +1 -1
  124. package/lib/core/meter.d.ts +3 -7
  125. package/lib/core/meter.js +22 -57
  126. package/lib/core/meter.js.map +1 -1
  127. package/lib/core/meter.test.js.map +1 -1
  128. package/lib/core/numberish.d.ts +1 -1
  129. package/lib/core/numberish.js +12 -18
  130. package/lib/core/numberish.js.map +1 -1
  131. package/lib/core/numberish.test.js.map +1 -1
  132. package/lib/core/sui-plugin.js +12 -16
  133. package/lib/core/sui-plugin.js.map +1 -1
  134. package/lib/core/sui-processor.d.ts +1 -1
  135. package/lib/core/sui-processor.js +6 -12
  136. package/lib/core/sui-processor.js.map +1 -1
  137. package/lib/error.d.ts +1 -1
  138. package/lib/error.js +2 -7
  139. package/lib/error.js.map +1 -1
  140. package/lib/eth/account-processor-state.d.ts +1 -1
  141. package/lib/eth/account-processor-state.js +2 -6
  142. package/lib/eth/account-processor-state.js.map +1 -1
  143. package/lib/eth/account-processor.d.ts +7 -7
  144. package/lib/eth/account-processor.js +23 -27
  145. package/lib/eth/account-processor.js.map +1 -1
  146. package/lib/eth/base-processor-template.d.ts +9 -9
  147. package/lib/eth/base-processor-template.js +8 -17
  148. package/lib/eth/base-processor-template.js.map +1 -1
  149. package/lib/eth/base-processor.d.ts +8 -8
  150. package/lib/eth/base-processor.js +22 -31
  151. package/lib/eth/base-processor.js.map +1 -1
  152. package/lib/eth/binds.d.ts +3 -3
  153. package/lib/eth/binds.js +11 -19
  154. package/lib/eth/binds.js.map +1 -1
  155. package/lib/eth/eth-event.d.ts +5 -0
  156. package/lib/eth/eth-event.js +2 -0
  157. package/lib/eth/eth-event.js.map +1 -0
  158. package/lib/eth/eth-plugin.js +30 -34
  159. package/lib/eth/eth-plugin.js.map +1 -1
  160. package/lib/eth/generic-processor.d.ts +3 -3
  161. package/lib/eth/generic-processor.js +9 -13
  162. package/lib/eth/generic-processor.js.map +1 -1
  163. package/lib/{core → eth}/generic-processor.test.d.ts +0 -0
  164. package/lib/eth/generic-processor.test.js.map +1 -0
  165. package/lib/eth/index.d.ts +7 -6
  166. package/lib/eth/index.js +6 -14
  167. package/lib/eth/index.js.map +1 -1
  168. package/lib/eth/provider.js +12 -17
  169. package/lib/eth/provider.js.map +1 -1
  170. package/lib/eth/trace.js +1 -2
  171. package/lib/eth/trace.js.map +1 -1
  172. package/lib/index.d.ts +4 -5
  173. package/lib/index.js +5 -16
  174. package/lib/index.js.map +1 -1
  175. package/lib/promise-or-void.js +1 -2
  176. package/lib/target-ethers-sentio/{event-handler.js → event-handler.cjs} +4 -4
  177. package/lib/target-ethers-sentio/event-handler.cjs.map +1 -0
  178. package/lib/target-ethers-sentio/{event-handler.d.ts → event-handler.d.cts} +0 -0
  179. package/lib/target-ethers-sentio/{file.js → file.cjs} +19 -18
  180. package/lib/target-ethers-sentio/file.cjs.map +1 -0
  181. package/lib/target-ethers-sentio/{file.d.ts → file.d.cts} +0 -0
  182. package/lib/target-ethers-sentio/{functions-handler.js → functions-handler.cjs} +6 -7
  183. package/lib/target-ethers-sentio/functions-handler.cjs.map +1 -0
  184. package/lib/target-ethers-sentio/{functions-handler.d.ts → functions-handler.d.cts} +0 -0
  185. package/lib/target-ethers-sentio/{index.js → index.cjs} +8 -5
  186. package/lib/target-ethers-sentio/index.cjs.map +1 -0
  187. package/lib/target-ethers-sentio/{index.d.ts → index.d.cts} +0 -0
  188. package/lib/target-ethers-sentio/{types.js → types.cjs} +1 -1
  189. package/lib/target-ethers-sentio/types.cjs.map +1 -0
  190. package/lib/target-ethers-sentio/{types.d.ts → types.d.cts} +0 -0
  191. package/lib/target-ethers-sentio/{view-function.js → view-function.cjs} +5 -5
  192. package/lib/target-ethers-sentio/view-function.cjs.map +1 -0
  193. package/lib/target-ethers-sentio/{view-function.d.ts → view-function.d.cts} +0 -0
  194. package/lib/testing/index.d.ts +3 -2
  195. package/lib/testing/index.js +3 -10
  196. package/lib/testing/index.js.map +1 -1
  197. package/lib/testing/metric-utils.d.ts +1 -1
  198. package/lib/testing/metric-utils.js +7 -13
  199. package/lib/testing/metric-utils.js.map +1 -1
  200. package/lib/testing/test-processor-server.d.ts +3 -4
  201. package/lib/testing/test-processor-server.js +24 -29
  202. package/lib/testing/test-processor-server.js.map +1 -1
  203. package/lib/testing/test-provider.js +5 -9
  204. package/lib/testing/test-provider.js.map +1 -1
  205. package/lib/tsup.config.ts +28 -0
  206. package/lib/utils/chain.js +7 -12
  207. package/lib/utils/chain.js.map +1 -1
  208. package/lib/utils/conversion.d.ts +0 -5
  209. package/lib/utils/conversion.js +22 -27
  210. package/lib/utils/conversion.js.map +1 -1
  211. package/lib/utils/dex-price.js +14 -19
  212. package/lib/utils/dex-price.js.map +1 -1
  213. package/lib/utils/dex-price.test.js.map +1 -1
  214. package/lib/utils/erc20.test.js.map +1 -1
  215. package/lib/utils/index.d.ts +4 -4
  216. package/lib/utils/index.js +4 -8
  217. package/lib/utils/index.js.map +1 -1
  218. package/lib/utils/price.d.ts +11 -11
  219. package/lib/utils/price.js +10 -16
  220. package/lib/utils/price.js.map +1 -1
  221. package/lib/utils/token.d.ts +1 -1
  222. package/lib/utils/token.js +15 -21
  223. package/lib/utils/token.js.map +1 -1
  224. package/package.json +23 -19
  225. package/src/builtin/eacaggregatorproxy/index.ts +3 -2
  226. package/src/builtin/eacaggregatorproxy/test-utils.ts +1 -1
  227. package/src/builtin/erc1155/index.ts +3 -2
  228. package/src/builtin/erc1155/test-utils.ts +1 -1
  229. package/src/builtin/erc20/index.ts +3 -2
  230. package/src/builtin/erc20/test-utils.ts +1 -1
  231. package/src/builtin/erc20bytes/index.ts +3 -2
  232. package/src/builtin/erc20bytes/test-utils.ts +1 -1
  233. package/src/builtin/erc721/index.ts +3 -2
  234. package/src/builtin/erc721/test-utils.ts +1 -1
  235. package/src/builtin/index.ts +8 -4
  236. package/src/builtin/internal/EACAggregatorProxy.ts +6 -10
  237. package/src/builtin/internal/ERC1155.ts +6 -10
  238. package/src/builtin/internal/ERC20.ts +5 -8
  239. package/src/builtin/internal/ERC20Bytes.ts +4 -6
  240. package/src/builtin/internal/ERC721.ts +5 -8
  241. package/src/builtin/internal/WETH9.ts +6 -10
  242. package/src/builtin/internal/common.ts +5 -3
  243. package/src/builtin/internal/eacaggregatorproxy_processor.ts +2 -2
  244. package/src/builtin/internal/erc1155_processor.ts +2 -2
  245. package/src/builtin/internal/erc20_processor.ts +2 -2
  246. package/src/builtin/internal/erc20bytes_processor.ts +2 -2
  247. package/src/builtin/internal/erc721_processor.ts +2 -2
  248. package/src/builtin/internal/factories/index.ts +6 -6
  249. package/src/builtin/internal/index.ts +13 -13
  250. package/src/builtin/internal/weth9_processor.ts +2 -2
  251. package/src/builtin/weth9/index.ts +3 -2
  252. package/src/builtin/weth9/test-utils.ts +1 -1
  253. package/src/core/base-context.ts +4 -4
  254. package/src/core/context.ts +5 -6
  255. package/src/core/core-plugin.ts +3 -3
  256. package/src/core/event-tracker.ts +2 -2
  257. package/src/core/exporter.ts +3 -3
  258. package/src/core/index.ts +12 -9
  259. package/src/core/logger.ts +2 -2
  260. package/src/core/metadata.ts +23 -2
  261. package/src/core/meter.ts +3 -26
  262. package/src/core/numberish.ts +1 -1
  263. package/src/core/sui-plugin.ts +2 -2
  264. package/src/core/sui-processor.ts +1 -1
  265. package/src/error.ts +1 -1
  266. package/src/eth/account-processor-state.ts +1 -1
  267. package/src/eth/account-processor.ts +11 -11
  268. package/src/eth/base-processor-template.ts +8 -11
  269. package/src/eth/base-processor.ts +14 -28
  270. package/src/eth/binds.ts +3 -3
  271. package/src/eth/eth-event.ts +6 -0
  272. package/src/eth/eth-plugin.ts +3 -3
  273. package/src/eth/generic-processor.ts +5 -5
  274. package/src/eth/index.ts +8 -6
  275. package/src/index.ts +4 -6
  276. package/src/target-ethers-sentio/{event-handler.ts → event-handler.cts} +1 -1
  277. package/src/target-ethers-sentio/{file.ts → file.cts} +10 -9
  278. package/src/target-ethers-sentio/{functions-handler.ts → functions-handler.cts} +3 -4
  279. package/src/target-ethers-sentio/{index.ts → index.cts} +4 -1
  280. package/src/target-ethers-sentio/tsconfig.json +1 -1
  281. package/src/target-ethers-sentio/{types.ts → types.cts} +0 -0
  282. package/src/target-ethers-sentio/{view-function.ts → view-function.cts} +1 -1
  283. package/src/testing/index.ts +3 -3
  284. package/src/testing/metric-utils.ts +2 -2
  285. package/src/testing/test-processor-server.ts +5 -5
  286. package/src/testing/test-provider.ts +1 -1
  287. package/src/tsup.config.ts +28 -0
  288. package/src/utils/conversion.ts +21 -25
  289. package/src/utils/dex-price.ts +4 -5
  290. package/src/utils/index.ts +4 -4
  291. package/src/utils/price.ts +1 -1
  292. package/src/utils/token.ts +6 -6
  293. package/lib/core/generic-processor.test.js.map +0 -1
  294. package/lib/target-ethers-sentio/event-handler.js.map +0 -1
  295. package/lib/target-ethers-sentio/file.js.map +0 -1
  296. package/lib/target-ethers-sentio/functions-handler.js.map +0 -1
  297. package/lib/target-ethers-sentio/index.js.map +0 -1
  298. package/lib/target-ethers-sentio/types.js.map +0 -1
  299. package/lib/target-ethers-sentio/view-function.js.map +0 -1
  300. package/lib/webpack.config.js +0 -50
  301. package/src/webpack.config.js +0 -50
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getERC20Contract = exports.ERC20ProcessorTemplate = exports.ERC20Processor = exports.ERC20BoundContractView = exports.ERC20ContractView = void 0;
4
- const sdk_1 = require("@sentio/sdk");
5
- const index_1 = require("./index");
6
- const templateContract = index_1.ERC20__factory.connect("0x0", sdk_1.DummyProvider);
7
- class ERC20ContractView extends sdk_1.ContractView {
1
+ import { addContractByABI, getContractByABI, addProcessor, getProcessor, getProvider, transformEtherError, BaseProcessor, BaseProcessorTemplate, BoundContractView, ContractView, DummyProvider, toBlockTag, } from "@sentio/sdk";
2
+ import { ERC20__factory } from "./index.js";
3
+ const templateContract = ERC20__factory.connect("0x0", DummyProvider);
4
+ export class ERC20ContractView extends ContractView {
8
5
  constructor(contract) {
9
6
  super(contract);
10
7
  }
@@ -13,7 +10,7 @@ class ERC20ContractView extends sdk_1.ContractView {
13
10
  return await this.contract.getFunction("allowance(address,address)")(owner, spender, overrides || {});
14
11
  }
15
12
  catch (e) {
16
- throw (0, sdk_1.transformEtherError)(e, undefined);
13
+ throw transformEtherError(e, undefined);
17
14
  }
18
15
  }
19
16
  async balanceOf(account, overrides) {
@@ -21,7 +18,7 @@ class ERC20ContractView extends sdk_1.ContractView {
21
18
  return await this.contract.getFunction("balanceOf(address)")(account, overrides || {});
22
19
  }
23
20
  catch (e) {
24
- throw (0, sdk_1.transformEtherError)(e, undefined);
21
+ throw transformEtherError(e, undefined);
25
22
  }
26
23
  }
27
24
  async decimals(overrides) {
@@ -29,7 +26,7 @@ class ERC20ContractView extends sdk_1.ContractView {
29
26
  return await this.contract.getFunction("decimals()")(overrides || {});
30
27
  }
31
28
  catch (e) {
32
- throw (0, sdk_1.transformEtherError)(e, undefined);
29
+ throw transformEtherError(e, undefined);
33
30
  }
34
31
  }
35
32
  async locker(overrides) {
@@ -37,7 +34,7 @@ class ERC20ContractView extends sdk_1.ContractView {
37
34
  return await this.contract.getFunction("locker()")(overrides || {});
38
35
  }
39
36
  catch (e) {
40
- throw (0, sdk_1.transformEtherError)(e, undefined);
37
+ throw transformEtherError(e, undefined);
41
38
  }
42
39
  }
43
40
  async name(overrides) {
@@ -45,7 +42,7 @@ class ERC20ContractView extends sdk_1.ContractView {
45
42
  return await this.contract.getFunction("name()")(overrides || {});
46
43
  }
47
44
  catch (e) {
48
- throw (0, sdk_1.transformEtherError)(e, undefined);
45
+ throw transformEtherError(e, undefined);
49
46
  }
50
47
  }
51
48
  async owner(overrides) {
@@ -53,7 +50,7 @@ class ERC20ContractView extends sdk_1.ContractView {
53
50
  return await this.contract.getFunction("owner()")(overrides || {});
54
51
  }
55
52
  catch (e) {
56
- throw (0, sdk_1.transformEtherError)(e, undefined);
53
+ throw transformEtherError(e, undefined);
57
54
  }
58
55
  }
59
56
  async symbol(overrides) {
@@ -61,7 +58,7 @@ class ERC20ContractView extends sdk_1.ContractView {
61
58
  return await this.contract.getFunction("symbol()")(overrides || {});
62
59
  }
63
60
  catch (e) {
64
- throw (0, sdk_1.transformEtherError)(e, undefined);
61
+ throw transformEtherError(e, undefined);
65
62
  }
66
63
  }
67
64
  async totalSupply(overrides) {
@@ -69,119 +66,117 @@ class ERC20ContractView extends sdk_1.ContractView {
69
66
  return await this.contract.getFunction("totalSupply()")(overrides || {});
70
67
  }
71
68
  catch (e) {
72
- throw (0, sdk_1.transformEtherError)(e, undefined);
69
+ throw transformEtherError(e, undefined);
73
70
  }
74
71
  }
75
72
  }
76
- exports.ERC20ContractView = ERC20ContractView;
77
- class ERC20BoundContractView extends sdk_1.BoundContractView {
73
+ export class ERC20BoundContractView extends BoundContractView {
78
74
  async allowance(owner, spender, overrides) {
79
75
  try {
80
76
  if (!overrides && this.context) {
81
77
  overrides = {
82
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
78
+ blockTag: toBlockTag(this.context.blockNumber),
83
79
  };
84
80
  }
85
81
  return await this.view.allowance(owner, spender, overrides || {});
86
82
  }
87
83
  catch (e) {
88
- throw (0, sdk_1.transformEtherError)(e, this.context);
84
+ throw transformEtherError(e, this.context);
89
85
  }
90
86
  }
91
87
  async balanceOf(account, overrides) {
92
88
  try {
93
89
  if (!overrides && this.context) {
94
90
  overrides = {
95
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
91
+ blockTag: toBlockTag(this.context.blockNumber),
96
92
  };
97
93
  }
98
94
  return await this.view.balanceOf(account, overrides || {});
99
95
  }
100
96
  catch (e) {
101
- throw (0, sdk_1.transformEtherError)(e, this.context);
97
+ throw transformEtherError(e, this.context);
102
98
  }
103
99
  }
104
100
  async decimals(overrides) {
105
101
  try {
106
102
  if (!overrides && this.context) {
107
103
  overrides = {
108
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
104
+ blockTag: toBlockTag(this.context.blockNumber),
109
105
  };
110
106
  }
111
107
  return await this.view.decimals(overrides || {});
112
108
  }
113
109
  catch (e) {
114
- throw (0, sdk_1.transformEtherError)(e, this.context);
110
+ throw transformEtherError(e, this.context);
115
111
  }
116
112
  }
117
113
  async locker(overrides) {
118
114
  try {
119
115
  if (!overrides && this.context) {
120
116
  overrides = {
121
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
117
+ blockTag: toBlockTag(this.context.blockNumber),
122
118
  };
123
119
  }
124
120
  return await this.view.locker(overrides || {});
125
121
  }
126
122
  catch (e) {
127
- throw (0, sdk_1.transformEtherError)(e, this.context);
123
+ throw transformEtherError(e, this.context);
128
124
  }
129
125
  }
130
126
  async name(overrides) {
131
127
  try {
132
128
  if (!overrides && this.context) {
133
129
  overrides = {
134
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
130
+ blockTag: toBlockTag(this.context.blockNumber),
135
131
  };
136
132
  }
137
133
  return await this.view.name(overrides || {});
138
134
  }
139
135
  catch (e) {
140
- throw (0, sdk_1.transformEtherError)(e, this.context);
136
+ throw transformEtherError(e, this.context);
141
137
  }
142
138
  }
143
139
  async owner(overrides) {
144
140
  try {
145
141
  if (!overrides && this.context) {
146
142
  overrides = {
147
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
143
+ blockTag: toBlockTag(this.context.blockNumber),
148
144
  };
149
145
  }
150
146
  return await this.view.owner(overrides || {});
151
147
  }
152
148
  catch (e) {
153
- throw (0, sdk_1.transformEtherError)(e, this.context);
149
+ throw transformEtherError(e, this.context);
154
150
  }
155
151
  }
156
152
  async symbol(overrides) {
157
153
  try {
158
154
  if (!overrides && this.context) {
159
155
  overrides = {
160
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
156
+ blockTag: toBlockTag(this.context.blockNumber),
161
157
  };
162
158
  }
163
159
  return await this.view.symbol(overrides || {});
164
160
  }
165
161
  catch (e) {
166
- throw (0, sdk_1.transformEtherError)(e, this.context);
162
+ throw transformEtherError(e, this.context);
167
163
  }
168
164
  }
169
165
  async totalSupply(overrides) {
170
166
  try {
171
167
  if (!overrides && this.context) {
172
168
  overrides = {
173
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
169
+ blockTag: toBlockTag(this.context.blockNumber),
174
170
  };
175
171
  }
176
172
  return await this.view.totalSupply(overrides || {});
177
173
  }
178
174
  catch (e) {
179
- throw (0, sdk_1.transformEtherError)(e, this.context);
175
+ throw transformEtherError(e, this.context);
180
176
  }
181
177
  }
182
178
  }
183
- exports.ERC20BoundContractView = ERC20BoundContractView;
184
- class ERC20Processor extends sdk_1.BaseProcessor {
179
+ export class ERC20Processor extends BaseProcessor {
185
180
  onEventApproval(handler, filter, fetchConfig) {
186
181
  if (!filter) {
187
182
  filter = templateContract.filters["Approval(address,address,uint256)"](null, null, null);
@@ -273,24 +268,23 @@ class ERC20Processor extends sdk_1.BaseProcessor {
273
268
  if (!options.name) {
274
269
  options.name = "ERC20";
275
270
  }
276
- let processor = (0, sdk_1.getProcessor)(options);
271
+ let processor = getProcessor(options);
277
272
  if (!processor) {
278
273
  processor = new ERC20Processor(options);
279
- (0, sdk_1.addProcessor)(options, processor);
274
+ addProcessor(options, processor);
280
275
  }
281
276
  return processor;
282
277
  }
283
278
  }
284
- exports.ERC20Processor = ERC20Processor;
285
- class ERC20ProcessorTemplate extends sdk_1.BaseProcessorTemplate {
279
+ export class ERC20ProcessorTemplate extends BaseProcessorTemplate {
286
280
  bindInternal(options) {
287
281
  if (!options.name) {
288
282
  options.name = "ERC20";
289
283
  }
290
- let processor = (0, sdk_1.getProcessor)(options);
284
+ let processor = getProcessor(options);
291
285
  if (!processor) {
292
286
  processor = new ERC20Processor(options);
293
- (0, sdk_1.addProcessor)(options, processor);
287
+ addProcessor(options, processor);
294
288
  }
295
289
  return processor;
296
290
  }
@@ -313,15 +307,13 @@ class ERC20ProcessorTemplate extends sdk_1.BaseProcessorTemplate {
313
307
  return super.onEvent(handler, filter, fetchConfig);
314
308
  }
315
309
  }
316
- exports.ERC20ProcessorTemplate = ERC20ProcessorTemplate;
317
- function getERC20Contract(address, network = 1) {
318
- let contract = (0, sdk_1.getContractByABI)("ERC20", address, network);
310
+ export function getERC20Contract(address, network = 1) {
311
+ let contract = getContractByABI("ERC20", address, network);
319
312
  if (!contract) {
320
- const rawContract = index_1.ERC20__factory.connect(address, (0, sdk_1.getProvider)(network));
313
+ const rawContract = ERC20__factory.connect(address, getProvider(network));
321
314
  contract = new ERC20ContractView(rawContract);
322
- (0, sdk_1.addContractByABI)("ERC20", address, network, contract);
315
+ addContractByABI("ERC20", address, network, contract);
323
316
  }
324
317
  return contract;
325
318
  }
326
- exports.getERC20Contract = getERC20Contract;
327
319
  //# sourceMappingURL=erc20_processor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"erc20_processor.js","sourceRoot":"","sources":["../../../src/builtin/internal/erc20_processor.ts"],"names":[],"mappings":";;;AAKA,qCAiB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AAW,CAAC,CAAC;IACtD,CAAC;IAED,eAAe,CACb,OAA0D,EAC1D,MAAoD,EACpD,WAA4B;QAE5B,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,mCAAmC,CAAC,CACpE,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;SACH;QACD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,MAAO,EAAE,WAAW,CAAC,CAAC;IACtD,CAAC;CACF;AA5DD,wDA4DC;AAED,SAAgB,gBAAgB,CAC9B,OAAe,EACf,UAAsB,CAAC;IAEvB,IAAI,QAAQ,GAAG,IAAA,sBAAgB,EAC7B,OAAO,EACP,OAAO,EACP,OAAO,CACa,CAAC;IACvB,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,WAAW,GAAG,sBAAc,CAAC,OAAO,CAAC,OAAO,EAAE,IAAA,iBAAW,EAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,QAAQ,GAAG,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAA,sBAAgB,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;KACvD;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAfD,4CAeC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Overrides } from \"ethers\";\nimport { Networkish } from \"ethers/providers\";\nimport {\n addContractByABI,\n getContractByABI,\n addProcessor,\n getProcessor,\n getProvider,\n transformEtherError,\n Trace,\n BindOptions,\n BaseProcessor,\n BaseProcessorTemplate,\n BoundContractView,\n ContractContext,\n ContractView,\n DummyProvider,\n TypedCallTrace,\n toBlockTag,\n} from \"@sentio/sdk\";\nimport { EthFetchConfig } from \"@sentio/protos\";\n\nimport { ERC20, ERC20__factory } from \"./index\";\nimport {\n ApprovalEvent,\n ApprovalEventFilter,\n OwnershipTransferredEvent,\n OwnershipTransferredEventFilter,\n TransferEvent,\n TransferEventFilter,\n} from \"./ERC20\";\n\nexport interface AllowanceCallObject {\n owner: string;\n spender: string;\n}\n\nexport type AllowanceCallTrace = TypedCallTrace<\n [string, string],\n AllowanceCallObject\n> &\n Trace;\n\nexport interface ApproveCallObject {\n spender: string;\n amount: bigint;\n}\n\nexport type ApproveCallTrace = TypedCallTrace<\n [string, bigint],\n ApproveCallObject\n> &\n Trace;\n\nexport interface BalanceOfCallObject {\n account: string;\n}\n\nexport type BalanceOfCallTrace = TypedCallTrace<[string], BalanceOfCallObject> &\n Trace;\n\nexport interface BurnCallObject {\n amount: bigint;\n}\n\nexport type BurnCallTrace = TypedCallTrace<[bigint], BurnCallObject> & Trace;\n\nexport interface BurnFromCallObject {\n account: string;\n amount: bigint;\n}\n\nexport type BurnFromCallTrace = TypedCallTrace<\n [string, bigint],\n BurnFromCallObject\n> &\n Trace;\n\nexport interface DecimalsCallObject {}\n\nexport type DecimalsCallTrace = TypedCallTrace<[], DecimalsCallObject> & Trace;\n\nexport interface DecreaseAllowanceCallObject {\n spender: string;\n subtractedValue: bigint;\n}\n\nexport type DecreaseAllowanceCallTrace = TypedCallTrace<\n [string, bigint],\n DecreaseAllowanceCallObject\n> &\n Trace;\n\nexport interface IncreaseAllowanceCallObject {\n spender: string;\n addedValue: bigint;\n}\n\nexport type IncreaseAllowanceCallTrace = TypedCallTrace<\n [string, bigint],\n IncreaseAllowanceCallObject\n> &\n Trace;\n\nexport interface LockerCallObject {}\n\nexport type LockerCallTrace = TypedCallTrace<[], LockerCallObject> & Trace;\n\nexport interface NameCallObject {}\n\nexport type NameCallTrace = TypedCallTrace<[], NameCallObject> & Trace;\n\nexport interface OwnerCallObject {}\n\nexport type OwnerCallTrace = TypedCallTrace<[], OwnerCallObject> & Trace;\n\nexport interface RenounceOwnershipCallObject {}\n\nexport type RenounceOwnershipCallTrace = TypedCallTrace<\n [],\n RenounceOwnershipCallObject\n> &\n Trace;\n\nexport interface SetLockerCallObject {\n _locker: string;\n}\n\nexport type SetLockerCallTrace = TypedCallTrace<[string], SetLockerCallObject> &\n Trace;\n\nexport interface SymbolCallObject {}\n\nexport type SymbolCallTrace = TypedCallTrace<[], SymbolCallObject> & Trace;\n\nexport interface TotalSupplyCallObject {}\n\nexport type TotalSupplyCallTrace = TypedCallTrace<[], TotalSupplyCallObject> &\n Trace;\n\nexport interface TransferCallObject {\n recipient: string;\n amount: bigint;\n}\n\nexport type TransferCallTrace = TypedCallTrace<\n [string, bigint],\n TransferCallObject\n> &\n Trace;\n\nexport interface TransferFromCallObject {\n sender: string;\n recipient: string;\n amount: bigint;\n}\n\nexport type TransferFromCallTrace = TypedCallTrace<\n [string, string, bigint],\n TransferFromCallObject\n> &\n Trace;\n\nexport interface TransferOwnershipCallObject {\n newOwner: string;\n}\n\nexport type TransferOwnershipCallTrace = TypedCallTrace<\n [string],\n TransferOwnershipCallObject\n> &\n Trace;\n\nconst templateContract = ERC20__factory.connect(\"0x0\", DummyProvider);\n\nexport class ERC20ContractView extends ContractView<ERC20> {\n constructor(contract: ERC20) {\n super(contract);\n }\n\n async allowance(\n owner: string,\n spender: string,\n overrides?: Overrides\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"allowance(address,address)\")(\n owner,\n spender,\n overrides || {}\n );\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"balanceOf(address)\")(\n account,\n overrides || {}\n );\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async decimals(overrides?: Overrides): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"decimals()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async locker(overrides?: Overrides): Promise<string> {\n try {\n return await this.contract.getFunction(\"locker()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async name(overrides?: Overrides): Promise<string> {\n try {\n return await this.contract.getFunction(\"name()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async owner(overrides?: Overrides): Promise<string> {\n try {\n return await this.contract.getFunction(\"owner()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async symbol(overrides?: Overrides): Promise<string> {\n try {\n return await this.contract.getFunction(\"symbol()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async totalSupply(overrides?: Overrides): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"totalSupply()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n}\n\nexport class ERC20BoundContractView extends BoundContractView<\n ERC20,\n ERC20ContractView\n> {\n async allowance(\n owner: string,\n spender: string,\n overrides?: Overrides\n ): Promise<bigint> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.allowance(owner, spender, overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.balanceOf(account, overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async decimals(overrides?: Overrides): Promise<bigint> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.decimals(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async locker(overrides?: Overrides): Promise<string> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.locker(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async name(overrides?: Overrides): Promise<string> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.name(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async owner(overrides?: Overrides): Promise<string> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.owner(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async symbol(overrides?: Overrides): Promise<string> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.symbol(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async totalSupply(overrides?: Overrides): Promise<bigint> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.totalSupply(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n}\n\nexport type ERC20Context = ContractContext<ERC20, ERC20BoundContractView>;\n\nexport class ERC20Processor extends BaseProcessor<\n ERC20,\n ERC20BoundContractView\n> {\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC20Context) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null\n );\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onEventOwnershipTransferred(\n handler: (event: OwnershipTransferredEvent, ctx: ERC20Context) => void,\n filter?:\n | OwnershipTransferredEventFilter\n | OwnershipTransferredEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferred(address,address)\"\n ](null, null);\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC20Context) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null\n );\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onCallAllowance(\n handler: (call: AllowanceCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xdd62ed3e\", handler, fetchConfig);\n }\n\n onCallApprove(\n handler: (call: ApproveCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x095ea7b3\", handler, fetchConfig);\n }\n\n onCallBalanceOf(\n handler: (call: BalanceOfCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x70a08231\", handler, fetchConfig);\n }\n\n onCallBurn(\n handler: (call: BurnCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x42966c68\", handler, fetchConfig);\n }\n\n onCallBurnFrom(\n handler: (call: BurnFromCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x79cc6790\", handler, fetchConfig);\n }\n\n onCallDecimals(\n handler: (call: DecimalsCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x313ce567\", handler, fetchConfig);\n }\n\n onCallDecreaseAllowance(\n handler: (call: DecreaseAllowanceCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xa457c2d7\", handler, fetchConfig);\n }\n\n onCallIncreaseAllowance(\n handler: (call: IncreaseAllowanceCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x39509351\", handler, fetchConfig);\n }\n\n onCallLocker(\n handler: (call: LockerCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xd7b96d4e\", handler, fetchConfig);\n }\n\n onCallName(\n handler: (call: NameCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x06fdde03\", handler, fetchConfig);\n }\n\n onCallOwner(\n handler: (call: OwnerCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x8da5cb5b\", handler, fetchConfig);\n }\n\n onCallRenounceOwnership(\n handler: (call: RenounceOwnershipCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x715018a6\", handler, fetchConfig);\n }\n\n onCallSetLocker(\n handler: (call: SetLockerCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x171060ec\", handler, fetchConfig);\n }\n\n onCallSymbol(\n handler: (call: SymbolCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x95d89b41\", handler, fetchConfig);\n }\n\n onCallTotalSupply(\n handler: (call: TotalSupplyCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x18160ddd\", handler, fetchConfig);\n }\n\n onCallTransfer(\n handler: (call: TransferCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xa9059cbb\", handler, fetchConfig);\n }\n\n onCallTransferFrom(\n handler: (call: TransferFromCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x23b872dd\", handler, fetchConfig);\n }\n\n onCallTransferOwnership(\n handler: (call: TransferOwnershipCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xf2fde38b\", handler, fetchConfig);\n }\n\n public static filters = {\n Approval(owner?: string | null, spender?: string | null, value?: null) {\n return templateContract.filters[\"Approval(address,address,uint256)\"](\n owner,\n spender,\n value\n );\n },\n OwnershipTransferred(\n previousOwner?: string | null,\n newOwner?: string | null\n ) {\n return templateContract.filters[\"OwnershipTransferred(address,address)\"](\n previousOwner,\n newOwner\n );\n },\n Transfer(from?: string | null, to?: string | null, value?: null) {\n return templateContract.filters[\"Transfer(address,address,uint256)\"](\n from,\n to,\n value\n );\n },\n };\n\n protected CreateBoundContractView(): ERC20BoundContractView {\n const view = getERC20Contract(this.config.address, this.config.network);\n return new ERC20BoundContractView(view);\n }\n\n public static bind(options: BindOptions): ERC20Processor {\n if (!options.name) {\n options.name = \"ERC20\";\n }\n let processor = getProcessor(options) as ERC20Processor;\n if (!processor) {\n processor = new ERC20Processor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n}\n\nexport class ERC20ProcessorTemplate extends BaseProcessorTemplate<\n ERC20,\n ERC20BoundContractView\n> {\n bindInternal(options: BindOptions) {\n if (!options.name) {\n options.name = \"ERC20\";\n }\n let processor = getProcessor(options) as ERC20Processor;\n if (!processor) {\n processor = new ERC20Processor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC20Context) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null\n );\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onEventOwnershipTransferred(\n handler: (event: OwnershipTransferredEvent, ctx: ERC20Context) => void,\n filter?:\n | OwnershipTransferredEventFilter\n | OwnershipTransferredEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferred(address,address)\"\n ](null, null);\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC20Context) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null\n );\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n}\n\nexport function getERC20Contract(\n address: string,\n network: Networkish = 1\n): ERC20ContractView {\n let contract = getContractByABI(\n \"ERC20\",\n address,\n network\n ) as ERC20ContractView;\n if (!contract) {\n const rawContract = ERC20__factory.connect(address, getProvider(network));\n contract = new ERC20ContractView(rawContract);\n addContractByABI(\"ERC20\", address, network, contract);\n }\n return contract;\n}\n"]}
1
+ {"version":3,"file":"erc20_processor.js","sourceRoot":"","sources":["../../../src/builtin/internal/erc20_processor.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,mBAAmB,EAGnB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EAEjB,YAAY,EACZ,aAAa,EAEb,UAAU,GACX,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAS,cAAc,EAAE,MAAM,YAAY,CAAC;AAuJnD,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAEtE,MAAM,OAAO,iBAAkB,SAAQ,YAAmB;IACxD,YAAY,QAAe;QACzB,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,SAAS,CACb,KAAa,EACb,OAAe,EACf,SAAqB;QAErB,IAAI;YACF,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAClE,KAAK,EACL,OAAO,EACP,SAAS,IAAI,EAAE,CAChB,CAAC;SACH;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,mBAAmB,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;SACzC;IACH,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAe,EAAE,SAAqB;QACpD,IAAI;YACF,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAC1D,OAAO,EACP,SAAS,IAAI,EAAE,CAChB,CAAC;SAC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H;QACD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,MAAO,EAAE,WAAW,CAAC,CAAC;IACtD,CAAC;IAED,2BAA2B,CACzB,OAAsE,EACtE,MAEqC,EACrC,WAA4B;QAE5B,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAC/B,uCAAuC,CACxC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SACf;QACD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,MAAO,EAAE,WAAW,CAAC,CAAC;IACtD,CAAC;IAED,eAAe,CACb,OAA0D,EAC1D,MAAoD,EACpD,WAA4B;QAE5B,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,mCAAmC,CAAC,CACpE,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;SACH;QACD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,MAAO,EAAE,WAAW,CAAC,CAAC;IACtD,CAAC;CACF;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,UAAsB,CAAC;IAEvB,IAAI,QAAQ,GAAG,gBAAgB,CAC7B,OAAO,EACP,OAAO,EACP,OAAO,CACa,CAAC;IACvB,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,QAAQ,GAAG,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC9C,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;KACvD;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Overrides } from \"ethers\";\nimport { Networkish } from \"ethers/providers\";\nimport {\n addContractByABI,\n getContractByABI,\n addProcessor,\n getProcessor,\n getProvider,\n transformEtherError,\n Trace,\n BindOptions,\n BaseProcessor,\n BaseProcessorTemplate,\n BoundContractView,\n ContractContext,\n ContractView,\n DummyProvider,\n TypedCallTrace,\n toBlockTag,\n} from \"@sentio/sdk\";\nimport { EthFetchConfig } from \"@sentio/protos\";\n\nimport { ERC20, ERC20__factory } from \"./index.js\";\nimport {\n ApprovalEvent,\n ApprovalEventFilter,\n OwnershipTransferredEvent,\n OwnershipTransferredEventFilter,\n TransferEvent,\n TransferEventFilter,\n} from \"./ERC20.js\";\n\nexport interface AllowanceCallObject {\n owner: string;\n spender: string;\n}\n\nexport type AllowanceCallTrace = TypedCallTrace<\n [string, string],\n AllowanceCallObject\n> &\n Trace;\n\nexport interface ApproveCallObject {\n spender: string;\n amount: bigint;\n}\n\nexport type ApproveCallTrace = TypedCallTrace<\n [string, bigint],\n ApproveCallObject\n> &\n Trace;\n\nexport interface BalanceOfCallObject {\n account: string;\n}\n\nexport type BalanceOfCallTrace = TypedCallTrace<[string], BalanceOfCallObject> &\n Trace;\n\nexport interface BurnCallObject {\n amount: bigint;\n}\n\nexport type BurnCallTrace = TypedCallTrace<[bigint], BurnCallObject> & Trace;\n\nexport interface BurnFromCallObject {\n account: string;\n amount: bigint;\n}\n\nexport type BurnFromCallTrace = TypedCallTrace<\n [string, bigint],\n BurnFromCallObject\n> &\n Trace;\n\nexport interface DecimalsCallObject {}\n\nexport type DecimalsCallTrace = TypedCallTrace<[], DecimalsCallObject> & Trace;\n\nexport interface DecreaseAllowanceCallObject {\n spender: string;\n subtractedValue: bigint;\n}\n\nexport type DecreaseAllowanceCallTrace = TypedCallTrace<\n [string, bigint],\n DecreaseAllowanceCallObject\n> &\n Trace;\n\nexport interface IncreaseAllowanceCallObject {\n spender: string;\n addedValue: bigint;\n}\n\nexport type IncreaseAllowanceCallTrace = TypedCallTrace<\n [string, bigint],\n IncreaseAllowanceCallObject\n> &\n Trace;\n\nexport interface LockerCallObject {}\n\nexport type LockerCallTrace = TypedCallTrace<[], LockerCallObject> & Trace;\n\nexport interface NameCallObject {}\n\nexport type NameCallTrace = TypedCallTrace<[], NameCallObject> & Trace;\n\nexport interface OwnerCallObject {}\n\nexport type OwnerCallTrace = TypedCallTrace<[], OwnerCallObject> & Trace;\n\nexport interface RenounceOwnershipCallObject {}\n\nexport type RenounceOwnershipCallTrace = TypedCallTrace<\n [],\n RenounceOwnershipCallObject\n> &\n Trace;\n\nexport interface SetLockerCallObject {\n _locker: string;\n}\n\nexport type SetLockerCallTrace = TypedCallTrace<[string], SetLockerCallObject> &\n Trace;\n\nexport interface SymbolCallObject {}\n\nexport type SymbolCallTrace = TypedCallTrace<[], SymbolCallObject> & Trace;\n\nexport interface TotalSupplyCallObject {}\n\nexport type TotalSupplyCallTrace = TypedCallTrace<[], TotalSupplyCallObject> &\n Trace;\n\nexport interface TransferCallObject {\n recipient: string;\n amount: bigint;\n}\n\nexport type TransferCallTrace = TypedCallTrace<\n [string, bigint],\n TransferCallObject\n> &\n Trace;\n\nexport interface TransferFromCallObject {\n sender: string;\n recipient: string;\n amount: bigint;\n}\n\nexport type TransferFromCallTrace = TypedCallTrace<\n [string, string, bigint],\n TransferFromCallObject\n> &\n Trace;\n\nexport interface TransferOwnershipCallObject {\n newOwner: string;\n}\n\nexport type TransferOwnershipCallTrace = TypedCallTrace<\n [string],\n TransferOwnershipCallObject\n> &\n Trace;\n\nconst templateContract = ERC20__factory.connect(\"0x0\", DummyProvider);\n\nexport class ERC20ContractView extends ContractView<ERC20> {\n constructor(contract: ERC20) {\n super(contract);\n }\n\n async allowance(\n owner: string,\n spender: string,\n overrides?: Overrides\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"allowance(address,address)\")(\n owner,\n spender,\n overrides || {}\n );\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"balanceOf(address)\")(\n account,\n overrides || {}\n );\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async decimals(overrides?: Overrides): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"decimals()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async locker(overrides?: Overrides): Promise<string> {\n try {\n return await this.contract.getFunction(\"locker()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async name(overrides?: Overrides): Promise<string> {\n try {\n return await this.contract.getFunction(\"name()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async owner(overrides?: Overrides): Promise<string> {\n try {\n return await this.contract.getFunction(\"owner()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async symbol(overrides?: Overrides): Promise<string> {\n try {\n return await this.contract.getFunction(\"symbol()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n\n async totalSupply(overrides?: Overrides): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"totalSupply()\")(overrides || {});\n } catch (e) {\n throw transformEtherError(e, undefined);\n }\n }\n}\n\nexport class ERC20BoundContractView extends BoundContractView<\n ERC20,\n ERC20ContractView\n> {\n async allowance(\n owner: string,\n spender: string,\n overrides?: Overrides\n ): Promise<bigint> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.allowance(owner, spender, overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.balanceOf(account, overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async decimals(overrides?: Overrides): Promise<bigint> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.decimals(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async locker(overrides?: Overrides): Promise<string> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.locker(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async name(overrides?: Overrides): Promise<string> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.name(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async owner(overrides?: Overrides): Promise<string> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.owner(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async symbol(overrides?: Overrides): Promise<string> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.symbol(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n\n async totalSupply(overrides?: Overrides): Promise<bigint> {\n try {\n if (!overrides && this.context) {\n overrides = {\n blockTag: toBlockTag(this.context.blockNumber),\n };\n }\n return await this.view.totalSupply(overrides || {});\n } catch (e) {\n throw transformEtherError(e, this.context);\n }\n }\n}\n\nexport type ERC20Context = ContractContext<ERC20, ERC20BoundContractView>;\n\nexport class ERC20Processor extends BaseProcessor<\n ERC20,\n ERC20BoundContractView\n> {\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC20Context) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null\n );\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onEventOwnershipTransferred(\n handler: (event: OwnershipTransferredEvent, ctx: ERC20Context) => void,\n filter?:\n | OwnershipTransferredEventFilter\n | OwnershipTransferredEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferred(address,address)\"\n ](null, null);\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC20Context) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null\n );\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onCallAllowance(\n handler: (call: AllowanceCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xdd62ed3e\", handler, fetchConfig);\n }\n\n onCallApprove(\n handler: (call: ApproveCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x095ea7b3\", handler, fetchConfig);\n }\n\n onCallBalanceOf(\n handler: (call: BalanceOfCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x70a08231\", handler, fetchConfig);\n }\n\n onCallBurn(\n handler: (call: BurnCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x42966c68\", handler, fetchConfig);\n }\n\n onCallBurnFrom(\n handler: (call: BurnFromCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x79cc6790\", handler, fetchConfig);\n }\n\n onCallDecimals(\n handler: (call: DecimalsCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x313ce567\", handler, fetchConfig);\n }\n\n onCallDecreaseAllowance(\n handler: (call: DecreaseAllowanceCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xa457c2d7\", handler, fetchConfig);\n }\n\n onCallIncreaseAllowance(\n handler: (call: IncreaseAllowanceCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x39509351\", handler, fetchConfig);\n }\n\n onCallLocker(\n handler: (call: LockerCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xd7b96d4e\", handler, fetchConfig);\n }\n\n onCallName(\n handler: (call: NameCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x06fdde03\", handler, fetchConfig);\n }\n\n onCallOwner(\n handler: (call: OwnerCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x8da5cb5b\", handler, fetchConfig);\n }\n\n onCallRenounceOwnership(\n handler: (call: RenounceOwnershipCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x715018a6\", handler, fetchConfig);\n }\n\n onCallSetLocker(\n handler: (call: SetLockerCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x171060ec\", handler, fetchConfig);\n }\n\n onCallSymbol(\n handler: (call: SymbolCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x95d89b41\", handler, fetchConfig);\n }\n\n onCallTotalSupply(\n handler: (call: TotalSupplyCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x18160ddd\", handler, fetchConfig);\n }\n\n onCallTransfer(\n handler: (call: TransferCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xa9059cbb\", handler, fetchConfig);\n }\n\n onCallTransferFrom(\n handler: (call: TransferFromCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0x23b872dd\", handler, fetchConfig);\n }\n\n onCallTransferOwnership(\n handler: (call: TransferOwnershipCallTrace, ctx: ERC20Context) => void,\n fetchConfig?: EthFetchConfig\n ) {\n return super.onTrace(\"0xf2fde38b\", handler, fetchConfig);\n }\n\n public static filters = {\n Approval(owner?: string | null, spender?: string | null, value?: null) {\n return templateContract.filters[\"Approval(address,address,uint256)\"](\n owner,\n spender,\n value\n );\n },\n OwnershipTransferred(\n previousOwner?: string | null,\n newOwner?: string | null\n ) {\n return templateContract.filters[\"OwnershipTransferred(address,address)\"](\n previousOwner,\n newOwner\n );\n },\n Transfer(from?: string | null, to?: string | null, value?: null) {\n return templateContract.filters[\"Transfer(address,address,uint256)\"](\n from,\n to,\n value\n );\n },\n };\n\n protected CreateBoundContractView(): ERC20BoundContractView {\n const view = getERC20Contract(this.config.address, this.config.network);\n return new ERC20BoundContractView(view);\n }\n\n public static bind(options: BindOptions): ERC20Processor {\n if (!options.name) {\n options.name = \"ERC20\";\n }\n let processor = getProcessor(options) as ERC20Processor;\n if (!processor) {\n processor = new ERC20Processor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n}\n\nexport class ERC20ProcessorTemplate extends BaseProcessorTemplate<\n ERC20,\n ERC20BoundContractView\n> {\n bindInternal(options: BindOptions) {\n if (!options.name) {\n options.name = \"ERC20\";\n }\n let processor = getProcessor(options) as ERC20Processor;\n if (!processor) {\n processor = new ERC20Processor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC20Context) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null\n );\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onEventOwnershipTransferred(\n handler: (event: OwnershipTransferredEvent, ctx: ERC20Context) => void,\n filter?:\n | OwnershipTransferredEventFilter\n | OwnershipTransferredEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferred(address,address)\"\n ](null, null);\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC20Context) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n fetchConfig?: EthFetchConfig\n ) {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null\n );\n }\n return super.onEvent(handler, filter!, fetchConfig);\n }\n}\n\nexport function getERC20Contract(\n address: string,\n network: Networkish = 1\n): ERC20ContractView {\n let contract = getContractByABI(\n \"ERC20\",\n address,\n network\n ) as ERC20ContractView;\n if (!contract) {\n const rawContract = ERC20__factory.connect(address, getProvider(network));\n contract = new ERC20ContractView(rawContract);\n addContractByABI(\"ERC20\", address, network, contract);\n }\n return contract;\n}\n"]}
@@ -2,8 +2,8 @@ import { Overrides } from "ethers";
2
2
  import { Networkish } from "ethers/providers";
3
3
  import { Trace, BindOptions, BaseProcessor, BaseProcessorTemplate, BoundContractView, ContractContext, ContractView, TypedCallTrace } from "@sentio/sdk";
4
4
  import { EthFetchConfig } from "@sentio/protos";
5
- import { ERC20Bytes } from "./index";
6
- import { ApprovalEvent, ApprovalEventFilter, TransferEvent, TransferEventFilter } from "./ERC20Bytes";
5
+ import { ERC20Bytes } from "./index.js";
6
+ import { ApprovalEvent, ApprovalEventFilter, TransferEvent, TransferEventFilter } from "./ERC20Bytes.js";
7
7
  export interface NameCallObject {
8
8
  }
9
9
  export type NameCallTrace = TypedCallTrace<[], NameCallObject> & Trace;
@@ -85,8 +85,8 @@ export declare class ERC20BytesProcessor extends BaseProcessor<ERC20Bytes, ERC20
85
85
  onCallTransfer(handler: (call: TransferCallTrace, ctx: ERC20BytesContext) => void, fetchConfig?: EthFetchConfig): this;
86
86
  onCallAllowance(handler: (call: AllowanceCallTrace, ctx: ERC20BytesContext) => void, fetchConfig?: EthFetchConfig): this;
87
87
  static filters: {
88
- Approval(owner?: string | null, spender?: string | null, value?: null): import("ethers").DeferredTopicFilter;
89
- Transfer(from?: string | null, to?: string | null, value?: null): import("ethers").DeferredTopicFilter;
88
+ Approval(owner?: string | null, spender?: string | null, value?: null): any;
89
+ Transfer(from?: string | null, to?: string | null, value?: null): any;
90
90
  };
91
91
  protected CreateBoundContractView(): ERC20BytesBoundContractView;
92
92
  static bind(options: BindOptions): ERC20BytesProcessor;
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getERC20BytesContract = exports.ERC20BytesProcessorTemplate = exports.ERC20BytesProcessor = exports.ERC20BytesBoundContractView = exports.ERC20BytesContractView = void 0;
4
- const sdk_1 = require("@sentio/sdk");
5
- const index_1 = require("./index");
6
- const templateContract = index_1.ERC20Bytes__factory.connect("0x0", sdk_1.DummyProvider);
7
- class ERC20BytesContractView extends sdk_1.ContractView {
1
+ import { addContractByABI, getContractByABI, addProcessor, getProcessor, getProvider, transformEtherError, BaseProcessor, BaseProcessorTemplate, BoundContractView, ContractView, DummyProvider, toBlockTag, } from "@sentio/sdk";
2
+ import { ERC20Bytes__factory } from "./index.js";
3
+ const templateContract = ERC20Bytes__factory.connect("0x0", DummyProvider);
4
+ export class ERC20BytesContractView extends ContractView {
8
5
  constructor(contract) {
9
6
  super(contract);
10
7
  }
@@ -13,7 +10,7 @@ class ERC20BytesContractView extends sdk_1.ContractView {
13
10
  return await this.contract.getFunction("name()")(overrides || {});
14
11
  }
15
12
  catch (e) {
16
- throw (0, sdk_1.transformEtherError)(e, undefined);
13
+ throw transformEtherError(e, undefined);
17
14
  }
18
15
  }
19
16
  async totalSupply(overrides) {
@@ -21,7 +18,7 @@ class ERC20BytesContractView extends sdk_1.ContractView {
21
18
  return await this.contract.getFunction("totalSupply()")(overrides || {});
22
19
  }
23
20
  catch (e) {
24
- throw (0, sdk_1.transformEtherError)(e, undefined);
21
+ throw transformEtherError(e, undefined);
25
22
  }
26
23
  }
27
24
  async decimals(overrides) {
@@ -29,7 +26,7 @@ class ERC20BytesContractView extends sdk_1.ContractView {
29
26
  return await this.contract.getFunction("decimals()")(overrides || {});
30
27
  }
31
28
  catch (e) {
32
- throw (0, sdk_1.transformEtherError)(e, undefined);
29
+ throw transformEtherError(e, undefined);
33
30
  }
34
31
  }
35
32
  async balanceOf(who, overrides) {
@@ -37,7 +34,7 @@ class ERC20BytesContractView extends sdk_1.ContractView {
37
34
  return await this.contract.getFunction("balanceOf(address)")(who, overrides || {});
38
35
  }
39
36
  catch (e) {
40
- throw (0, sdk_1.transformEtherError)(e, undefined);
37
+ throw transformEtherError(e, undefined);
41
38
  }
42
39
  }
43
40
  async symbol(overrides) {
@@ -45,7 +42,7 @@ class ERC20BytesContractView extends sdk_1.ContractView {
45
42
  return await this.contract.getFunction("symbol()")(overrides || {});
46
43
  }
47
44
  catch (e) {
48
- throw (0, sdk_1.transformEtherError)(e, undefined);
45
+ throw transformEtherError(e, undefined);
49
46
  }
50
47
  }
51
48
  async allowance(owner, spender, overrides) {
@@ -53,93 +50,91 @@ class ERC20BytesContractView extends sdk_1.ContractView {
53
50
  return await this.contract.getFunction("allowance(address,address)")(owner, spender, overrides || {});
54
51
  }
55
52
  catch (e) {
56
- throw (0, sdk_1.transformEtherError)(e, undefined);
53
+ throw transformEtherError(e, undefined);
57
54
  }
58
55
  }
59
56
  }
60
- exports.ERC20BytesContractView = ERC20BytesContractView;
61
- class ERC20BytesBoundContractView extends sdk_1.BoundContractView {
57
+ export class ERC20BytesBoundContractView extends BoundContractView {
62
58
  async name(overrides) {
63
59
  try {
64
60
  if (!overrides && this.context) {
65
61
  overrides = {
66
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
62
+ blockTag: toBlockTag(this.context.blockNumber),
67
63
  };
68
64
  }
69
65
  return await this.view.name(overrides || {});
70
66
  }
71
67
  catch (e) {
72
- throw (0, sdk_1.transformEtherError)(e, this.context);
68
+ throw transformEtherError(e, this.context);
73
69
  }
74
70
  }
75
71
  async totalSupply(overrides) {
76
72
  try {
77
73
  if (!overrides && this.context) {
78
74
  overrides = {
79
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
75
+ blockTag: toBlockTag(this.context.blockNumber),
80
76
  };
81
77
  }
82
78
  return await this.view.totalSupply(overrides || {});
83
79
  }
84
80
  catch (e) {
85
- throw (0, sdk_1.transformEtherError)(e, this.context);
81
+ throw transformEtherError(e, this.context);
86
82
  }
87
83
  }
88
84
  async decimals(overrides) {
89
85
  try {
90
86
  if (!overrides && this.context) {
91
87
  overrides = {
92
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
88
+ blockTag: toBlockTag(this.context.blockNumber),
93
89
  };
94
90
  }
95
91
  return await this.view.decimals(overrides || {});
96
92
  }
97
93
  catch (e) {
98
- throw (0, sdk_1.transformEtherError)(e, this.context);
94
+ throw transformEtherError(e, this.context);
99
95
  }
100
96
  }
101
97
  async balanceOf(who, overrides) {
102
98
  try {
103
99
  if (!overrides && this.context) {
104
100
  overrides = {
105
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
101
+ blockTag: toBlockTag(this.context.blockNumber),
106
102
  };
107
103
  }
108
104
  return await this.view.balanceOf(who, overrides || {});
109
105
  }
110
106
  catch (e) {
111
- throw (0, sdk_1.transformEtherError)(e, this.context);
107
+ throw transformEtherError(e, this.context);
112
108
  }
113
109
  }
114
110
  async symbol(overrides) {
115
111
  try {
116
112
  if (!overrides && this.context) {
117
113
  overrides = {
118
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
114
+ blockTag: toBlockTag(this.context.blockNumber),
119
115
  };
120
116
  }
121
117
  return await this.view.symbol(overrides || {});
122
118
  }
123
119
  catch (e) {
124
- throw (0, sdk_1.transformEtherError)(e, this.context);
120
+ throw transformEtherError(e, this.context);
125
121
  }
126
122
  }
127
123
  async allowance(owner, spender, overrides) {
128
124
  try {
129
125
  if (!overrides && this.context) {
130
126
  overrides = {
131
- blockTag: (0, sdk_1.toBlockTag)(this.context.blockNumber),
127
+ blockTag: toBlockTag(this.context.blockNumber),
132
128
  };
133
129
  }
134
130
  return await this.view.allowance(owner, spender, overrides || {});
135
131
  }
136
132
  catch (e) {
137
- throw (0, sdk_1.transformEtherError)(e, this.context);
133
+ throw transformEtherError(e, this.context);
138
134
  }
139
135
  }
140
136
  }
141
- exports.ERC20BytesBoundContractView = ERC20BytesBoundContractView;
142
- class ERC20BytesProcessor extends sdk_1.BaseProcessor {
137
+ export class ERC20BytesProcessor extends BaseProcessor {
143
138
  onEventApproval(handler, filter, fetchConfig) {
144
139
  if (!filter) {
145
140
  filter = templateContract.filters["Approval(address,address,uint256)"](null, null, null);
@@ -195,24 +190,23 @@ class ERC20BytesProcessor extends sdk_1.BaseProcessor {
195
190
  if (!options.name) {
196
191
  options.name = "ERC20Bytes";
197
192
  }
198
- let processor = (0, sdk_1.getProcessor)(options);
193
+ let processor = getProcessor(options);
199
194
  if (!processor) {
200
195
  processor = new ERC20BytesProcessor(options);
201
- (0, sdk_1.addProcessor)(options, processor);
196
+ addProcessor(options, processor);
202
197
  }
203
198
  return processor;
204
199
  }
205
200
  }
206
- exports.ERC20BytesProcessor = ERC20BytesProcessor;
207
- class ERC20BytesProcessorTemplate extends sdk_1.BaseProcessorTemplate {
201
+ export class ERC20BytesProcessorTemplate extends BaseProcessorTemplate {
208
202
  bindInternal(options) {
209
203
  if (!options.name) {
210
204
  options.name = "ERC20Bytes";
211
205
  }
212
- let processor = (0, sdk_1.getProcessor)(options);
206
+ let processor = getProcessor(options);
213
207
  if (!processor) {
214
208
  processor = new ERC20BytesProcessor(options);
215
- (0, sdk_1.addProcessor)(options, processor);
209
+ addProcessor(options, processor);
216
210
  }
217
211
  return processor;
218
212
  }
@@ -229,15 +223,13 @@ class ERC20BytesProcessorTemplate extends sdk_1.BaseProcessorTemplate {
229
223
  return super.onEvent(handler, filter, fetchConfig);
230
224
  }
231
225
  }
232
- exports.ERC20BytesProcessorTemplate = ERC20BytesProcessorTemplate;
233
- function getERC20BytesContract(address, network = 1) {
234
- let contract = (0, sdk_1.getContractByABI)("ERC20Bytes", address, network);
226
+ export function getERC20BytesContract(address, network = 1) {
227
+ let contract = getContractByABI("ERC20Bytes", address, network);
235
228
  if (!contract) {
236
- const rawContract = index_1.ERC20Bytes__factory.connect(address, (0, sdk_1.getProvider)(network));
229
+ const rawContract = ERC20Bytes__factory.connect(address, getProvider(network));
237
230
  contract = new ERC20BytesContractView(rawContract);
238
- (0, sdk_1.addContractByABI)("ERC20Bytes", address, network, contract);
231
+ addContractByABI("ERC20Bytes", address, network, contract);
239
232
  }
240
233
  return contract;
241
234
  }
242
- exports.getERC20BytesContract = getERC20BytesContract;
243
235
  //# sourceMappingURL=erc20bytes_processor.js.map