@sentio/sdk 2.0.0-rc.3 → 2.0.0-rc.4

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 (295) 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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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.js +1 -2
  53. package/lib/builtin/internal/common.js.map +1 -1
  54. package/lib/builtin/internal/eacaggregatorproxy_processor.d.ts +6 -6
  55. package/lib/builtin/internal/eacaggregatorproxy_processor.js +69 -77
  56. package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +1 -1
  57. package/lib/builtin/internal/erc1155_processor.d.ts +6 -6
  58. package/lib/builtin/internal/erc1155_processor.js +30 -38
  59. package/lib/builtin/internal/erc1155_processor.js.map +1 -1
  60. package/lib/builtin/internal/erc20_processor.d.ts +5 -5
  61. package/lib/builtin/internal/erc20_processor.js +39 -47
  62. package/lib/builtin/internal/erc20_processor.js.map +1 -1
  63. package/lib/builtin/internal/erc20bytes_processor.d.ts +4 -4
  64. package/lib/builtin/internal/erc20bytes_processor.js +33 -41
  65. package/lib/builtin/internal/erc20bytes_processor.js.map +1 -1
  66. package/lib/builtin/internal/erc721_processor.d.ts +5 -5
  67. package/lib/builtin/internal/erc721_processor.js +42 -50
  68. package/lib/builtin/internal/erc721_processor.js.map +1 -1
  69. package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js +4 -8
  70. package/lib/builtin/internal/factories/EACAggregatorProxy__factory.js.map +1 -1
  71. package/lib/builtin/internal/factories/ERC1155__factory.js +4 -8
  72. package/lib/builtin/internal/factories/ERC1155__factory.js.map +1 -1
  73. package/lib/builtin/internal/factories/ERC20Bytes__factory.js +4 -8
  74. package/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -1
  75. package/lib/builtin/internal/factories/ERC20__factory.js +4 -8
  76. package/lib/builtin/internal/factories/ERC20__factory.js.map +1 -1
  77. package/lib/builtin/internal/factories/ERC721__factory.js +4 -8
  78. package/lib/builtin/internal/factories/ERC721__factory.js.map +1 -1
  79. package/lib/builtin/internal/factories/WETH9__factory.js +4 -8
  80. package/lib/builtin/internal/factories/WETH9__factory.js.map +1 -1
  81. package/lib/builtin/internal/factories/index.d.ts +6 -6
  82. package/lib/builtin/internal/factories/index.js +6 -15
  83. package/lib/builtin/internal/factories/index.js.map +1 -1
  84. package/lib/builtin/internal/index.d.ts +13 -13
  85. package/lib/builtin/internal/index.js +7 -17
  86. package/lib/builtin/internal/index.js.map +1 -1
  87. package/lib/builtin/internal/weth9_processor.d.ts +6 -6
  88. package/lib/builtin/internal/weth9_processor.js +33 -41
  89. package/lib/builtin/internal/weth9_processor.js.map +1 -1
  90. package/lib/builtin/weth9/index.d.ts +3 -2
  91. package/lib/builtin/weth9/index.js +3 -5
  92. package/lib/builtin/weth9/index.js.map +1 -1
  93. package/lib/builtin/weth9/test-utils.d.ts +1 -1
  94. package/lib/builtin/weth9/test-utils.js +9 -16
  95. package/lib/builtin/weth9/test-utils.js.map +1 -1
  96. package/lib/core/base-context.d.ts +4 -4
  97. package/lib/core/base-context.js +7 -11
  98. package/lib/core/base-context.js.map +1 -1
  99. package/lib/core/big-decimal.js +3 -7
  100. package/lib/core/big-decimal.js.map +1 -1
  101. package/lib/core/bind-options.js +6 -13
  102. package/lib/core/bind-options.js.map +1 -1
  103. package/lib/core/context.d.ts +5 -5
  104. package/lib/core/context.js +14 -23
  105. package/lib/core/context.js.map +1 -1
  106. package/lib/core/core-plugin.js +9 -13
  107. package/lib/core/core-plugin.js.map +1 -1
  108. package/lib/core/event-tracker.d.ts +2 -2
  109. package/lib/core/event-tracker.js +6 -13
  110. package/lib/core/event-tracker.js.map +1 -1
  111. package/lib/core/exporter.d.ts +2 -2
  112. package/lib/core/exporter.js +4 -9
  113. package/lib/core/exporter.js.map +1 -1
  114. package/lib/core/index.d.ts +12 -9
  115. package/lib/core/index.js +12 -32
  116. package/lib/core/index.js.map +1 -1
  117. package/lib/core/logger.d.ts +2 -2
  118. package/lib/core/logger.js +7 -11
  119. package/lib/core/logger.js.map +1 -1
  120. package/lib/core/metadata.d.ts +4 -0
  121. package/lib/core/metadata.js +21 -7
  122. package/lib/core/metadata.js.map +1 -1
  123. package/lib/core/meter.d.ts +3 -7
  124. package/lib/core/meter.js +22 -57
  125. package/lib/core/meter.js.map +1 -1
  126. package/lib/core/meter.test.js.map +1 -1
  127. package/lib/core/numberish.d.ts +1 -1
  128. package/lib/core/numberish.js +12 -18
  129. package/lib/core/numberish.js.map +1 -1
  130. package/lib/core/numberish.test.js.map +1 -1
  131. package/lib/core/sui-plugin.js +12 -16
  132. package/lib/core/sui-plugin.js.map +1 -1
  133. package/lib/core/sui-processor.d.ts +1 -1
  134. package/lib/core/sui-processor.js +6 -12
  135. package/lib/core/sui-processor.js.map +1 -1
  136. package/lib/error.d.ts +1 -1
  137. package/lib/error.js +2 -7
  138. package/lib/error.js.map +1 -1
  139. package/lib/eth/account-processor-state.d.ts +1 -1
  140. package/lib/eth/account-processor-state.js +2 -6
  141. package/lib/eth/account-processor-state.js.map +1 -1
  142. package/lib/eth/account-processor.d.ts +7 -7
  143. package/lib/eth/account-processor.js +23 -27
  144. package/lib/eth/account-processor.js.map +1 -1
  145. package/lib/eth/base-processor-template.d.ts +5 -5
  146. package/lib/eth/base-processor-template.js +8 -14
  147. package/lib/eth/base-processor-template.js.map +1 -1
  148. package/lib/eth/base-processor.d.ts +4 -4
  149. package/lib/eth/base-processor.js +19 -26
  150. package/lib/eth/base-processor.js.map +1 -1
  151. package/lib/eth/binds.d.ts +3 -3
  152. package/lib/eth/binds.js +11 -19
  153. package/lib/eth/binds.js.map +1 -1
  154. package/lib/eth/eth-plugin.js +30 -34
  155. package/lib/eth/eth-plugin.js.map +1 -1
  156. package/lib/eth/generic-processor.d.ts +3 -3
  157. package/lib/eth/generic-processor.js +9 -13
  158. package/lib/eth/generic-processor.js.map +1 -1
  159. package/lib/{core → eth}/generic-processor.test.d.ts +0 -0
  160. package/lib/eth/generic-processor.test.js.map +1 -0
  161. package/lib/eth/index.d.ts +7 -6
  162. package/lib/eth/index.js +6 -14
  163. package/lib/eth/index.js.map +1 -1
  164. package/lib/eth/provider.js +12 -17
  165. package/lib/eth/provider.js.map +1 -1
  166. package/lib/eth/trace.js +1 -2
  167. package/lib/eth/trace.js.map +1 -1
  168. package/lib/index.d.ts +4 -5
  169. package/lib/index.js +5 -16
  170. package/lib/index.js.map +1 -1
  171. package/lib/promise-or-void.js +1 -2
  172. package/lib/target-ethers-sentio/{event-handler.js → event-handler.cjs} +4 -4
  173. package/lib/target-ethers-sentio/event-handler.cjs.map +1 -0
  174. package/lib/target-ethers-sentio/{event-handler.d.ts → event-handler.d.cts} +0 -0
  175. package/lib/target-ethers-sentio/{file.js → file.cjs} +19 -18
  176. package/lib/target-ethers-sentio/file.cjs.map +1 -0
  177. package/lib/target-ethers-sentio/{file.d.ts → file.d.cts} +0 -0
  178. package/lib/target-ethers-sentio/{functions-handler.js → functions-handler.cjs} +6 -7
  179. package/lib/target-ethers-sentio/functions-handler.cjs.map +1 -0
  180. package/lib/target-ethers-sentio/{functions-handler.d.ts → functions-handler.d.cts} +0 -0
  181. package/lib/target-ethers-sentio/{index.js → index.cjs} +8 -5
  182. package/lib/target-ethers-sentio/index.cjs.map +1 -0
  183. package/lib/target-ethers-sentio/{index.d.ts → index.d.cts} +0 -0
  184. package/lib/target-ethers-sentio/{types.js → types.cjs} +1 -1
  185. package/lib/target-ethers-sentio/types.cjs.map +1 -0
  186. package/lib/target-ethers-sentio/{types.d.ts → types.d.cts} +0 -0
  187. package/lib/target-ethers-sentio/{view-function.js → view-function.cjs} +5 -5
  188. package/lib/target-ethers-sentio/view-function.cjs.map +1 -0
  189. package/lib/target-ethers-sentio/{view-function.d.ts → view-function.d.cts} +0 -0
  190. package/lib/testing/index.d.ts +3 -2
  191. package/lib/testing/index.js +3 -10
  192. package/lib/testing/index.js.map +1 -1
  193. package/lib/testing/metric-utils.d.ts +1 -1
  194. package/lib/testing/metric-utils.js +7 -13
  195. package/lib/testing/metric-utils.js.map +1 -1
  196. package/lib/testing/test-processor-server.d.ts +3 -4
  197. package/lib/testing/test-processor-server.js +24 -29
  198. package/lib/testing/test-processor-server.js.map +1 -1
  199. package/lib/testing/test-provider.js +5 -9
  200. package/lib/testing/test-provider.js.map +1 -1
  201. package/lib/tsup.config.ts +23 -0
  202. package/lib/utils/chain.js +7 -12
  203. package/lib/utils/chain.js.map +1 -1
  204. package/lib/utils/conversion.d.ts +2 -2
  205. package/lib/utils/conversion.js +6 -12
  206. package/lib/utils/conversion.js.map +1 -1
  207. package/lib/utils/dex-price.js +14 -19
  208. package/lib/utils/dex-price.js.map +1 -1
  209. package/lib/utils/dex-price.test.js.map +1 -1
  210. package/lib/utils/erc20.test.js.map +1 -1
  211. package/lib/utils/index.d.ts +4 -4
  212. package/lib/utils/index.js +4 -8
  213. package/lib/utils/index.js.map +1 -1
  214. package/lib/utils/price.d.ts +11 -11
  215. package/lib/utils/price.js +10 -16
  216. package/lib/utils/price.js.map +1 -1
  217. package/lib/utils/token.d.ts +1 -1
  218. package/lib/utils/token.js +15 -21
  219. package/lib/utils/token.js.map +1 -1
  220. package/package.json +23 -19
  221. package/src/builtin/eacaggregatorproxy/index.ts +3 -2
  222. package/src/builtin/eacaggregatorproxy/test-utils.ts +1 -1
  223. package/src/builtin/erc1155/index.ts +3 -2
  224. package/src/builtin/erc1155/test-utils.ts +1 -1
  225. package/src/builtin/erc20/index.ts +3 -2
  226. package/src/builtin/erc20/test-utils.ts +1 -1
  227. package/src/builtin/erc20bytes/index.ts +3 -2
  228. package/src/builtin/erc20bytes/test-utils.ts +1 -1
  229. package/src/builtin/erc721/index.ts +3 -2
  230. package/src/builtin/erc721/test-utils.ts +1 -1
  231. package/src/builtin/index.ts +8 -4
  232. package/src/builtin/internal/EACAggregatorProxy.ts +1 -1
  233. package/src/builtin/internal/ERC1155.ts +1 -1
  234. package/src/builtin/internal/ERC20.ts +1 -1
  235. package/src/builtin/internal/ERC20Bytes.ts +1 -1
  236. package/src/builtin/internal/ERC721.ts +1 -1
  237. package/src/builtin/internal/WETH9.ts +1 -1
  238. package/src/builtin/internal/eacaggregatorproxy_processor.ts +2 -2
  239. package/src/builtin/internal/erc1155_processor.ts +2 -2
  240. package/src/builtin/internal/erc20_processor.ts +2 -2
  241. package/src/builtin/internal/erc20bytes_processor.ts +2 -2
  242. package/src/builtin/internal/erc721_processor.ts +2 -2
  243. package/src/builtin/internal/factories/index.ts +6 -6
  244. package/src/builtin/internal/index.ts +13 -13
  245. package/src/builtin/internal/weth9_processor.ts +2 -2
  246. package/src/builtin/weth9/index.ts +3 -2
  247. package/src/builtin/weth9/test-utils.ts +1 -1
  248. package/src/core/base-context.ts +4 -4
  249. package/src/core/context.ts +5 -6
  250. package/src/core/core-plugin.ts +3 -3
  251. package/src/core/event-tracker.ts +2 -2
  252. package/src/core/exporter.ts +3 -3
  253. package/src/core/index.ts +12 -9
  254. package/src/core/logger.ts +2 -2
  255. package/src/core/metadata.ts +23 -2
  256. package/src/core/meter.ts +3 -26
  257. package/src/core/numberish.ts +1 -1
  258. package/src/core/sui-plugin.ts +2 -2
  259. package/src/core/sui-processor.ts +1 -1
  260. package/src/error.ts +1 -1
  261. package/src/eth/account-processor-state.ts +1 -1
  262. package/src/eth/account-processor.ts +11 -11
  263. package/src/eth/base-processor-template.ts +5 -5
  264. package/src/eth/base-processor.ts +4 -4
  265. package/src/eth/binds.ts +3 -3
  266. package/src/eth/eth-plugin.ts +3 -3
  267. package/src/eth/generic-processor.ts +5 -5
  268. package/src/eth/index.ts +8 -6
  269. package/src/index.ts +4 -6
  270. package/src/target-ethers-sentio/{event-handler.ts → event-handler.cts} +1 -1
  271. package/src/target-ethers-sentio/{file.ts → file.cts} +10 -9
  272. package/src/target-ethers-sentio/{functions-handler.ts → functions-handler.cts} +3 -4
  273. package/src/target-ethers-sentio/{index.ts → index.cts} +4 -1
  274. package/src/target-ethers-sentio/tsconfig.json +1 -1
  275. package/src/target-ethers-sentio/{types.ts → types.cts} +0 -0
  276. package/src/target-ethers-sentio/{view-function.ts → view-function.cts} +1 -1
  277. package/src/testing/index.ts +3 -3
  278. package/src/testing/metric-utils.ts +2 -2
  279. package/src/testing/test-processor-server.ts +5 -5
  280. package/src/testing/test-provider.ts +1 -1
  281. package/src/tsup.config.ts +23 -0
  282. package/src/utils/conversion.ts +2 -2
  283. package/src/utils/dex-price.ts +4 -4
  284. package/src/utils/index.ts +4 -4
  285. package/src/utils/price.ts +1 -1
  286. package/src/utils/token.ts +6 -6
  287. package/lib/core/generic-processor.test.js.map +0 -1
  288. package/lib/target-ethers-sentio/event-handler.js.map +0 -1
  289. package/lib/target-ethers-sentio/file.js.map +0 -1
  290. package/lib/target-ethers-sentio/functions-handler.js.map +0 -1
  291. package/lib/target-ethers-sentio/index.js.map +0 -1
  292. package/lib/target-ethers-sentio/types.js.map +0 -1
  293. package/lib/target-ethers-sentio/view-function.js.map +0 -1
  294. package/lib/webpack.config.js +0 -50
  295. package/src/webpack.config.js +0 -50
@@ -1,15 +1,15 @@
1
1
  import { RetryOptions } from 'nice-grpc-client-middleware-retry';
2
- export declare function getPriceClient(address?: string): import("nice-grpc").RawClient<import("nice-grpc/lib/service-definitions/ts-proto").FromTsProtoServiceDefinition<{
2
+ export declare function getPriceClient(address?: string): import("nice-grpc").RawClient<import("nice-grpc/lib/service-definitions/ts-proto.js").FromTsProtoServiceDefinition<{
3
3
  readonly name: "PriceService";
4
4
  readonly fullName: "price_service.PriceService";
5
5
  readonly methods: {
6
6
  readonly getPrice: {
7
7
  readonly name: "GetPrice";
8
8
  readonly requestType: {
9
- encode(message: import("@sentio/protos/lib/service/price/protos/price").GetPriceRequest, writer?: import("protobufjs").Writer | undefined): import("protobufjs").Writer;
10
- decode(input: Uint8Array | import("protobufjs").Reader, length?: number | undefined): import("@sentio/protos/lib/service/price/protos/price").GetPriceRequest;
11
- fromJSON(object: any): import("@sentio/protos/lib/service/price/protos/price").GetPriceRequest;
12
- toJSON(message: import("@sentio/protos/lib/service/price/protos/price").GetPriceRequest): unknown;
9
+ encode(message: import("@sentio/protos/price").GetPriceRequest, writer?: import("protobufjs").Writer | undefined): import("protobufjs").Writer;
10
+ decode(input: Uint8Array | import("protobufjs").Reader, length?: number | undefined): import("@sentio/protos/price").GetPriceRequest;
11
+ fromJSON(object: any): import("@sentio/protos/price").GetPriceRequest;
12
+ toJSON(message: import("@sentio/protos/price").GetPriceRequest): unknown;
13
13
  fromPartial(object: {
14
14
  timestamp?: Date | undefined;
15
15
  coinId?: {
@@ -19,18 +19,18 @@ export declare function getPriceClient(address?: string): import("nice-grpc").Ra
19
19
  chain?: string | undefined;
20
20
  } | undefined;
21
21
  } | undefined;
22
- }): import("@sentio/protos/lib/service/price/protos/price").GetPriceRequest;
22
+ }): import("@sentio/protos/price").GetPriceRequest;
23
23
  };
24
24
  readonly requestStream: false;
25
25
  readonly responseType: {
26
- encode(message: import("@sentio/protos/lib/service/price/protos/price").GetPriceResponse, writer?: import("protobufjs").Writer | undefined): import("protobufjs").Writer;
27
- decode(input: Uint8Array | import("protobufjs").Reader, length?: number | undefined): import("@sentio/protos/lib/service/price/protos/price").GetPriceResponse;
28
- fromJSON(object: any): import("@sentio/protos/lib/service/price/protos/price").GetPriceResponse;
29
- toJSON(message: import("@sentio/protos/lib/service/price/protos/price").GetPriceResponse): unknown;
26
+ encode(message: import("@sentio/protos/price").GetPriceResponse, writer?: import("protobufjs").Writer | undefined): import("protobufjs").Writer;
27
+ decode(input: Uint8Array | import("protobufjs").Reader, length?: number | undefined): import("@sentio/protos/price").GetPriceResponse;
28
+ fromJSON(object: any): import("@sentio/protos/price").GetPriceResponse;
29
+ toJSON(message: import("@sentio/protos/price").GetPriceResponse): unknown;
30
30
  fromPartial(object: {
31
31
  price?: number | undefined;
32
32
  timestamp?: Date | undefined;
33
- }): import("@sentio/protos/lib/service/price/protos/price").GetPriceResponse;
33
+ }): import("@sentio/protos/price").GetPriceResponse;
34
34
  };
35
35
  readonly responseStream: false;
36
36
  readonly options: {};
@@ -1,18 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPriceBySymbol = exports.getPriceByType = exports.getPriceClient = void 0;
4
- const price_1 = require("@sentio/protos/lib/service/price/protos/price");
5
- const nice_grpc_1 = require("nice-grpc");
6
- const nice_grpc_client_middleware_retry_1 = require("nice-grpc-client-middleware-retry");
7
- const runtime_1 = require("@sentio/runtime");
8
- function getPriceClient(address) {
1
+ import { PriceServiceDefinition } from '@sentio/protos/price';
2
+ import { createChannel, createClientFactory } from 'nice-grpc';
3
+ import { retryMiddleware } from 'nice-grpc-client-middleware-retry';
4
+ import { Endpoints } from '@sentio/runtime';
5
+ export function getPriceClient(address) {
9
6
  if (!address) {
10
- address = runtime_1.Endpoints.INSTANCE.priceFeedAPI;
7
+ address = Endpoints.INSTANCE.priceFeedAPI;
11
8
  }
12
- const channel = (0, nice_grpc_1.createChannel)(address);
13
- return (0, nice_grpc_1.createClientFactory)().use(nice_grpc_client_middleware_retry_1.retryMiddleware).create(price_1.PriceServiceDefinition, channel);
9
+ const channel = createChannel(address);
10
+ return createClientFactory().use(retryMiddleware).create(PriceServiceDefinition, channel);
14
11
  }
15
- exports.getPriceClient = getPriceClient;
16
12
  const priceMap = new Map();
17
13
  let priceClient;
18
14
  async function getPriceByTypeOrSymbol(date, coinId) {
@@ -60,7 +56,7 @@ async function getPriceByTypeOrSymbol(date, coinId) {
60
56
  * @param coinType
61
57
  * @param date
62
58
  */
63
- async function getPriceByType(chainId, coinType, date) {
59
+ export async function getPriceByType(chainId, coinType, date) {
64
60
  return getPriceByTypeOrSymbol(date, {
65
61
  address: {
66
62
  chain: chainId,
@@ -68,16 +64,14 @@ async function getPriceByType(chainId, coinType, date) {
68
64
  },
69
65
  });
70
66
  }
71
- exports.getPriceByType = getPriceByType;
72
67
  /**
73
68
  *
74
69
  * @param symbol token symbol like BTC, etc
75
70
  * @param date
76
71
  */
77
- async function getPriceBySymbol(symbol, date) {
72
+ export async function getPriceBySymbol(symbol, date) {
78
73
  return getPriceByTypeOrSymbol(date, { symbol });
79
74
  }
80
- exports.getPriceBySymbol = getPriceBySymbol;
81
75
  function dateString(date) {
82
76
  return [date.getUTCDate(), date.getUTCMonth() + 1, date.getUTCFullYear()].join('-');
83
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"price.js","sourceRoot":"","sources":["../../src/utils/price.ts"],"names":[],"mappings":";;;AAAA,yEAAkH;AAClH,yCAA8D;AAC9D,yFAAiF;AACjF,6CAA2C;AAE3C,SAAgB,cAAc,CAAC,OAAgB;IAC7C,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,GAAG,mBAAS,CAAC,QAAQ,CAAC,YAAY,CAAA;KAC1C;IACD,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,OAAO,CAAC,CAAA;IAEtC,OAAO,IAAA,+BAAmB,GAAE,CAAC,GAAG,CAAC,mDAAe,CAAC,CAAC,MAAM,CAAC,8BAAsB,EAAE,OAAO,CAAC,CAAA;AAC3F,CAAC;AAPD,wCAOC;AAED,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KAAK,CAAA;IAClB,CAAC,CAAC,CAAA;IACF,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACxB,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,QAAgB,EAAE,IAAU;IAChF,OAAO,sBAAsB,CAAC,IAAI,EAAE;QAClC,OAAO,EAAE;YACP,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,QAAQ;SAClB;KACF,CAAC,CAAA;AACJ,CAAC;AAPD,wCAOC;AAED;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CAAC,MAAc,EAAE,IAAU;IAC/D,OAAO,sBAAsB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;AACjD,CAAC;AAFD,4CAEC;AAED,SAAS,UAAU,CAAC,IAAU;IAC5B,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACrF,CAAC","sourcesContent":["import { CoinID, PriceServiceClient, PriceServiceDefinition } from '@sentio/protos/lib/service/price/protos/price'\nimport { createChannel, createClientFactory } from 'nice-grpc'\nimport { retryMiddleware, RetryOptions } from 'nice-grpc-client-middleware-retry'\nimport { Endpoints } from '@sentio/runtime'\n\nexport function getPriceClient(address?: string) {\n if (!address) {\n address = Endpoints.INSTANCE.priceFeedAPI\n }\n const channel = createChannel(address)\n\n return createClientFactory().use(retryMiddleware).create(PriceServiceDefinition, channel)\n}\n\nconst priceMap = new Map<string, Promise<number>>()\nlet priceClient: PriceServiceClient<RetryOptions>\n\nasync function getPriceByTypeOrSymbol(date: Date, coinId: CoinID): Promise<number> {\n if (!priceClient) {\n priceClient = getPriceClient()\n }\n\n const dateStr = dateString(date)\n const todayDateString = dateString(new Date())\n\n let key: string\n if (coinId.symbol) {\n key = `${coinId.symbol}-${dateStr}`\n } else {\n key = `${coinId.address?.address}-${coinId.address?.chain}-${dateStr}`\n }\n let price = priceMap.get(key)\n if (price) {\n return price\n }\n\n const response = priceClient.getPrice(\n {\n timestamp: date,\n coinId,\n },\n {\n retry: true,\n retryMaxAttempts: 8,\n }\n )\n price = response.then((res) => {\n if (res.timestamp) {\n const responseDateString = dateString(res.timestamp)\n if (responseDateString !== dateStr || responseDateString !== todayDateString) {\n priceMap.delete(key)\n }\n } else {\n priceMap.delete(key)\n }\n return res.price\n })\n priceMap.set(key, price)\n return price\n}\n\n/**\n *\n * @param chainId chain id refers to CHAIN_MAP\n * @param coinType\n * @param date\n */\nexport async function getPriceByType(chainId: string, coinType: string, date: Date): Promise<number> {\n return getPriceByTypeOrSymbol(date, {\n address: {\n chain: chainId,\n address: coinType,\n },\n })\n}\n\n/**\n *\n * @param symbol token symbol like BTC, etc\n * @param date\n */\nexport async function getPriceBySymbol(symbol: string, date: Date): Promise<number> {\n return getPriceByTypeOrSymbol(date, { symbol })\n}\n\nfunction dateString(date: Date) {\n return [date.getUTCDate(), date.getUTCMonth() + 1, date.getUTCFullYear()].join('-')\n}\n"]}
1
+ {"version":3,"file":"price.js","sourceRoot":"","sources":["../../src/utils/price.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AACzF,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAgB,MAAM,mCAAmC,CAAA;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAA;KAC1C;IACD,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IAEtC,OAAO,mBAAmB,EAAE,C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AA;aACrB;SACF;aAAM;YACL,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;SACrB;QACD,OAAO,GAAG,CAAC,KAAK,CAAA;IAClB,CAAC,CAAC,CAAA;IACF,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACxB,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,QAAgB,EAAE,IAAU;IAChF,OAAO,sBAAsB,CAAC,IAAI,EAAE;QAClC,OAAO,EAAE;YACP,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,QAAQ;SAClB;KACF,CAAC,CAAA;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAAc,EAAE,IAAU;IAC/D,OAAO,sBAAsB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;AACjD,CAAC;AAED,SAAS,UAAU,CAAC,IAAU;IAC5B,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACrF,CAAC","sourcesContent":["import { CoinID, PriceServiceClient, PriceServiceDefinition } from '@sentio/protos/price'\nimport { createChannel, createClientFactory } from 'nice-grpc'\nimport { retryMiddleware, RetryOptions } from 'nice-grpc-client-middleware-retry'\nimport { Endpoints } from '@sentio/runtime'\n\nexport function getPriceClient(address?: string) {\n if (!address) {\n address = Endpoints.INSTANCE.priceFeedAPI\n }\n const channel = createChannel(address)\n\n return createClientFactory().use(retryMiddleware).create(PriceServiceDefinition, channel)\n}\n\nconst priceMap = new Map<string, Promise<number>>()\nlet priceClient: PriceServiceClient<RetryOptions>\n\nasync function getPriceByTypeOrSymbol(date: Date, coinId: CoinID): Promise<number> {\n if (!priceClient) {\n priceClient = getPriceClient()\n }\n\n const dateStr = dateString(date)\n const todayDateString = dateString(new Date())\n\n let key: string\n if (coinId.symbol) {\n key = `${coinId.symbol}-${dateStr}`\n } else {\n key = `${coinId.address?.address}-${coinId.address?.chain}-${dateStr}`\n }\n let price = priceMap.get(key)\n if (price) {\n return price\n }\n\n const response = priceClient.getPrice(\n {\n timestamp: date,\n coinId,\n },\n {\n retry: true,\n retryMaxAttempts: 8,\n }\n )\n price = response.then((res) => {\n if (res.timestamp) {\n const responseDateString = dateString(res.timestamp)\n if (responseDateString !== dateStr || responseDateString !== todayDateString) {\n priceMap.delete(key)\n }\n } else {\n priceMap.delete(key)\n }\n return res.price\n })\n priceMap.set(key, price)\n return price\n}\n\n/**\n *\n * @param chainId chain id refers to CHAIN_MAP\n * @param coinType\n * @param date\n */\nexport async function getPriceByType(chainId: string, coinType: string, date: Date): Promise<number> {\n return getPriceByTypeOrSymbol(date, {\n address: {\n chain: chainId,\n address: coinType,\n },\n })\n}\n\n/**\n *\n * @param symbol token symbol like BTC, etc\n * @param date\n */\nexport async function getPriceBySymbol(symbol: string, date: Date): Promise<number> {\n return getPriceByTypeOrSymbol(date, { symbol })\n}\n\nfunction dateString(date: Date) {\n return [date.getUTCDate(), date.getUTCMonth() + 1, date.getUTCFullYear()].join('-')\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { BigDecimal } from '../core/big-decimal';
1
+ import { BigDecimal } from '../core/big-decimal.js';
2
2
  export interface TokenInfo {
3
3
  symbol: string;
4
4
  name: string;
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scaleDown = exports.getER20NormalizedAmount = exports.getERC20TokenInfo = exports.NATIVE_ETH = void 0;
4
- const error_1 = require("../error");
5
- const erc20_1 = require("../builtin/erc20");
6
- const erc20bytes_processor_1 = require("../builtin/internal/erc20bytes_processor");
7
- const big_decimal_1 = require("../core/big-decimal");
8
- const ethers_1 = require("ethers");
9
- exports.NATIVE_ETH = {
1
+ import { transformEtherError } from '../error.js';
2
+ import { getERC20Contract } from '../builtin/erc20/index.js';
3
+ import { getERC20BytesContract } from '../builtin/internal/erc20bytes_processor.js';
4
+ import { BigDecimal } from '../core/big-decimal.js';
5
+ import { decodeBytes32String } from 'ethers';
6
+ export const NATIVE_ETH = {
10
7
  symbol: 'ETH',
11
8
  decimal: 18,
12
9
  name: 'Native ETH',
@@ -19,14 +16,14 @@ async function getTokenInfoPromise(symbol, name, decimal) {
19
16
  decimal: Number(await decimal),
20
17
  };
21
18
  }
22
- async function getERC20TokenInfo(tokenAddress, chainId = 1) {
19
+ export async function getERC20TokenInfo(tokenAddress, chainId = 1) {
23
20
  const key = chainId + tokenAddress;
24
21
  const res = TOKEN_INFOS.get(key);
25
22
  if (res) {
26
23
  return res;
27
24
  }
28
- const contract = (0, erc20_1.getERC20Contract)(tokenAddress, chainId);
29
- const bytesContract = (0, erc20bytes_processor_1.getERC20BytesContract)(tokenAddress, chainId);
25
+ const contract = getERC20Contract(tokenAddress, chainId);
26
+ const bytesContract = getERC20BytesContract(tokenAddress, chainId);
30
27
  try {
31
28
  // TODO maybe not do try catch, just do raw call the parse results
32
29
  let name = '';
@@ -34,14 +31,14 @@ async function getERC20TokenInfo(tokenAddress, chainId = 1) {
34
31
  name = await contract.name();
35
32
  }
36
33
  catch (e) {
37
- name = (0, ethers_1.decodeBytes32String)(await bytesContract.name());
34
+ name = decodeBytes32String(await bytesContract.name());
38
35
  }
39
36
  let symbol = '';
40
37
  try {
41
38
  symbol = await contract.symbol();
42
39
  }
43
40
  catch (e) {
44
- symbol = (0, ethers_1.decodeBytes32String)(await bytesContract.symbol());
41
+ symbol = decodeBytes32String(await bytesContract.symbol());
45
42
  }
46
43
  const decimal = await contract.decimals();
47
44
  const info = getTokenInfoPromise(symbol, name, decimal);
@@ -49,18 +46,15 @@ async function getERC20TokenInfo(tokenAddress, chainId = 1) {
49
46
  return info;
50
47
  }
51
48
  catch (e) {
52
- throw (0, error_1.transformEtherError)(e, undefined);
49
+ throw transformEtherError(e, undefined);
53
50
  }
54
51
  }
55
- exports.getERC20TokenInfo = getERC20TokenInfo;
56
- async function getER20NormalizedAmount(tokenAddress, amount, chainId) {
52
+ export async function getER20NormalizedAmount(tokenAddress, amount, chainId) {
57
53
  const tokenInfo = await getERC20TokenInfo(tokenAddress, chainId);
58
54
  return scaleDown(amount, tokenInfo.decimal);
59
55
  }
60
- exports.getER20NormalizedAmount = getER20NormalizedAmount;
61
- function scaleDown(amount, decimal) {
62
- const divider = new big_decimal_1.BigDecimal(10).pow(Number(decimal));
56
+ export function scaleDown(amount, decimal) {
57
+ const divider = new BigDecimal(10).pow(Number(decimal));
63
58
  return amount.asBigDecimal().dividedBy(divider);
64
59
  }
65
- exports.scaleDown = scaleDown;
66
60
  //# sourceMappingURL=token.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/utils/token.ts"],"names":[],"mappings":";;;AAAA,oCAA8C;AAC9C,4CAAmD;AACnD,mFAAgF;AAChF,qDAAgD;AAIhD,mCAA4C;AAQ/B,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,YAAY;CACnB,CAAA;AAED,MAAM,WAAW,GAAG,IAAI,GAAG,EAA8B,CAAA;AAEzD,KAAK,UAAU,mBAAmB,CAChC,MAAuC,EACvC,IAAqC,EACrC,OAA+B;IAE/B,OAAO;QACL,MAAM,EAAE,MAAM,MAAM;QACpB,IAAI,EAAE,MAAM,IAAI;QAChB,OAAO,EAAE,MAAM,CAAC,MAAM,OAAO,CAAC;KAC/B,CAAA;AACH,CAAC;AAEM,KAAK,UAAU,iBAAiB,CAAC,YAAoB,EAAE,OAAO,GAAG,CAAC;IACvE,MAAM,GAAG,GAAG,OAAO,GAAG,YAAY,CAAA;IAClC,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAChC,IAAI,GAAG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SAAgB,SAAS,CAAC,MAAc,EAAE,OAAwB;IAChE,MAAM,OAAO,GAAG,IAAI,wBAAU,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IACvD,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;AACjD,CAAC;AAHD,8BAGC","sourcesContent":["import { transformEtherError } from '../error'\nimport { getERC20Contract } from '../builtin/erc20'\nimport { getERC20BytesContract } from '../builtin/internal/erc20bytes_processor'\nimport { BigDecimal } from '../core/big-decimal'\nimport { toBigDecimal } from './conversion'\n// import { utils } from 'ethers'\nimport { PromiseOrValue } from '../builtin/internal/common'\nimport { decodeBytes32String } from 'ethers'\n\nexport interface TokenInfo {\n symbol: string\n name: string\n decimal: number\n}\n\nexport const NATIVE_ETH = {\n symbol: 'ETH',\n decimal: 18,\n name: 'Native ETH',\n}\n\nconst TOKEN_INFOS = new Map<string, Promise<TokenInfo>>()\n\nasync function getTokenInfoPromise(\n symbol: PromiseOrValue<string> | string,\n name: PromiseOrValue<string> | string,\n decimal: PromiseOrValue<bigint>\n): Promise<TokenInfo> {\n return {\n symbol: await symbol,\n name: await name,\n decimal: Number(await decimal),\n }\n}\n\nexport async function getERC20TokenInfo(tokenAddress: string, chainId = 1): Promise<TokenInfo> {\n const key = chainId + tokenAddress\n const res = TOKEN_INFOS.get(key)\n if (res) {\n return res\n }\n const contract = getERC20Contract(tokenAddress, chainId)\n const bytesContract = getERC20BytesContract(tokenAddress, chainId)\n\n try {\n // TODO maybe not do try catch, just do raw call the parse results\n let name = ''\n try {\n name = await contract.name()\n } catch (e) {\n name = decodeBytes32String(await bytesContract.name())\n }\n\n let symbol = ''\n try {\n symbol = await contract.symbol()\n } catch (e) {\n symbol = decodeBytes32String(await bytesContract.symbol())\n }\n\n const decimal = await contract.decimals()\n const info = getTokenInfoPromise(symbol, name, decimal)\n\n TOKEN_INFOS.set(key, info)\n return info\n } catch (e) {\n throw transformEtherError(e, undefined)\n }\n}\n\nexport async function getER20NormalizedAmount(\n tokenAddress: string,\n amount: bigint,\n chainId: number\n): Promise<BigDecimal> {\n const tokenInfo = await getERC20TokenInfo(tokenAddress, chainId)\n return scaleDown(amount, tokenInfo.decimal)\n}\n\nexport function scaleDown(amount: bigint, decimal: number | bigint) {\n const divider = new BigDecimal(10).pow(Number(decimal))\n return amount.asBigDecimal().dividedBy(divider)\n}\n"]}
1
+ {"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/utils/token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAInD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAQ5C,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,YAAY;CACnB,CAAA;AAED,MAAM,WAAW,GAAG,IAAI,GAAG,EAA8B,CAAA;AAEzD,KAAK,UAAU,mBAAmB,CAChC,MAAuC,EACvC,IAAqC,EACrC,OAA+B;IAE/B,OAAO;QACL,MAAM,EAAE,MAAM,MAAM;QACpB,IAAI,EAAE,MAAM,IAAI;QAChB,OAAO,EAAE,MAAM,CAAC,MAAM,OAAO,CAAC;KAC/B,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,YAAoB,EAAE,OAAO,GAAG,CAAC;IACvE,MAAM,GAAG,GAAG,OAAO,GAAG,YAAY,CAAA;IAClC,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAChC,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAA;KACX;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C,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IACvD,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;AACjD,CAAC","sourcesContent":["import { transformEtherError } from '../error.js'\nimport { getERC20Contract } from '../builtin/erc20/index.js'\nimport { getERC20BytesContract } from '../builtin/internal/erc20bytes_processor.js'\nimport { BigDecimal } from '../core/big-decimal.js'\n// import { toBigDecimal } from './conversion'\n// import { utils } from 'ethers'\nimport { PromiseOrValue } from '../builtin/internal/common.js'\nimport { decodeBytes32String } from 'ethers'\n\nexport interface TokenInfo {\n symbol: string\n name: string\n decimal: number\n}\n\nexport const NATIVE_ETH = {\n symbol: 'ETH',\n decimal: 18,\n name: 'Native ETH',\n}\n\nconst TOKEN_INFOS = new Map<string, Promise<TokenInfo>>()\n\nasync function getTokenInfoPromise(\n symbol: PromiseOrValue<string> | string,\n name: PromiseOrValue<string> | string,\n decimal: PromiseOrValue<bigint>\n): Promise<TokenInfo> {\n return {\n symbol: await symbol,\n name: await name,\n decimal: Number(await decimal),\n }\n}\n\nexport async function getERC20TokenInfo(tokenAddress: string, chainId = 1): Promise<TokenInfo> {\n const key = chainId + tokenAddress\n const res = TOKEN_INFOS.get(key)\n if (res) {\n return res\n }\n const contract = getERC20Contract(tokenAddress, chainId)\n const bytesContract = getERC20BytesContract(tokenAddress, chainId)\n\n try {\n // TODO maybe not do try catch, just do raw call the parse results\n let name = ''\n try {\n name = await contract.name()\n } catch (e) {\n name = decodeBytes32String(await bytesContract.name())\n }\n\n let symbol = ''\n try {\n symbol = await contract.symbol()\n } catch (e) {\n symbol = decodeBytes32String(await bytesContract.symbol())\n }\n\n const decimal = await contract.decimals()\n const info = getTokenInfoPromise(symbol, name, decimal)\n\n TOKEN_INFOS.set(key, info)\n return info\n } catch (e) {\n throw transformEtherError(e, undefined)\n }\n}\n\nexport async function getER20NormalizedAmount(\n tokenAddress: string,\n amount: bigint,\n chainId: number\n): Promise<BigDecimal> {\n const tokenInfo = await getERC20TokenInfo(tokenAddress, chainId)\n return scaleDown(amount, tokenInfo.decimal)\n}\n\nexport function scaleDown(amount: bigint, decimal: number | bigint) {\n const divider = new BigDecimal(10).pow(Number(decimal))\n return amount.asBigDecimal().dividedBy(divider)\n}\n"]}
package/package.json CHANGED
@@ -1,39 +1,43 @@
1
1
  {
2
2
  "name": "@sentio/sdk",
3
3
  "license": "Apache-2.0",
4
- "version": "2.0.0-rc.3",
4
+ "version": "2.0.0-rc.4",
5
+ "type": "module",
5
6
  "scripts": {
6
7
  "compile_target": "yarn tsc -b src/target-ethers-sentio/tsconfig.json",
7
- "compile": "tsc -p . && cp src/utils/*.csv lib/utils && cp src/webpack.config.js lib",
8
+ "compile": "tsc -p . && cp src/utils/*.csv lib/utils && cp src/tsup.config.ts lib",
8
9
  "build": "yarn gen && yarn compile",
9
10
  "build_all": "yarn lerna run --scope=@sentio/sdk build --include-dependencies",
10
- "start_ts": "ts-node --files ../runtime/src/processor-runner.ts --log-format=json ../../examples/x2y2/src/processor.ts",
11
- "start": "ts-node --files ../runtime/src/processor-runner.ts ../../examples/aptos/dist/lib.js",
12
- "start_js": "node lib/processor-runner.js ../examples/aptos/dist/lib.js",
13
- "ts-start": "ts-node --files ../runtime/src/processor-runner.ts ./src/anyswap/src/processor.ts",
14
- "test": "jest",
15
- "test-nocache": "yarn jest --clearCache && yarn jest",
11
+ "test": "NODE_OPTIONS=--experimental-vm-modules yarn jest",
16
12
  "gen": "yarn compile_target && yarn gen_bultin_evm",
17
- "gen_bultin_evm": "typechain --target lib/target-ethers-sentio --out-dir src/builtin/internal 'src/abis/*.json'"
13
+ "gen_bultin_evm": "typechain --target lib/target-ethers-sentio/index.cjs --out-dir src/builtin/internal 'src/abis/*.json'"
18
14
  },
19
15
  "dependencies": {
20
16
  "@sentio/bigdecimal": "^9.1.1-patch.3",
21
- "@sentio/ethers-v6": "^1.0.15",
22
- "@sentio/protos": "^2.0.0-rc.3",
23
- "@sentio/runtime": "^2.0.0-rc.3",
17
+ "@sentio/ethers-v6": "^1.0.19",
18
+ "@sentio/protos": "^2.0.0-rc.4",
19
+ "@sentio/runtime": "^2.0.0-rc.4",
24
20
  "csv-parse": "^5.3.0",
25
- "ethers": "npm:@sentio/ethers@6.0.0-beta-exports.14",
21
+ "ethers": "6.0.0-beta-exports.16",
26
22
  "google-protobuf": "^3.15.8",
27
23
  "nice-grpc": "^2.0.0",
28
- "typechain": "^8.0.0",
29
- "winston": "^3.8.2"
24
+ "p-queue": "^7.3.0",
25
+ "typechain": "^8.0.0"
30
26
  },
31
27
  "devDependencies": {
32
28
  "@types/google-protobuf": "^3.15.6"
33
29
  },
34
- "main": "./lib/index.js",
35
- "types": "./lib/index.d.ts",
36
- "module": "./lib/index.js",
30
+ "exports": {
31
+ ".": "./lib/index.js",
32
+ "./testing": "./lib/testing/index.js",
33
+ "./builtin": "./lib/builtin/index.js",
34
+ "./builtin/erc20": "./lib/builtin/erc20/index.js",
35
+ "./builtin/erc721": "./lib/builtin/erc721/index.js",
36
+ "./builtin/erc1155": "./lib/builtin/erc1155/index.js",
37
+ "./builtin/eacaggregatorproxy": "./lib/builtin/eacaggregatorproxy/index.js",
38
+ "./builtin/weth9": "./lib/builtin/weth9/index.js",
39
+ "./utils": "./lib/utils/index.js"
40
+ },
37
41
  "files": [
38
42
  "{lib,src}",
39
43
  "!{lib,src}/tests",
@@ -45,5 +49,5 @@
45
49
  "typedoc": {
46
50
  "entryPoint": "./src/index.ts"
47
51
  },
48
- "gitHead": "1680df855b7e9a9736db40d88de97ff1bdae4ab6"
52
+ "gitHead": "6daea963269624d5b40c60dba0c2bf9419537658"
49
53
  }
@@ -2,5 +2,6 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
 
5
- export * from "../internal/eacaggregatorproxy_processor";
6
- export * from "../internal/EACAggregatorProxy";
5
+ export * from "../internal/eacaggregatorproxy_processor.js";
6
+ export * from "../internal/EACAggregatorProxy.js";
7
+ export * from "./test-utils.js";
@@ -8,7 +8,7 @@ import {
8
8
  NewRoundEventObject,
9
9
  OwnershipTransferRequestedEventObject,
10
10
  OwnershipTransferredEventObject,
11
- } from ".";
11
+ } from "./index.js";
12
12
  const mockField = {
13
13
  blockHash:
14
14
  "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -2,5 +2,6 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
 
5
- export * from "../internal/erc1155_processor";
6
- export * from "../internal/ERC1155";
5
+ export * from "../internal/erc1155_processor.js";
6
+ export * from "../internal/ERC1155.js";
7
+ export * from "./test-utils.js";
@@ -8,7 +8,7 @@ import {
8
8
  TransferBatchEventObject,
9
9
  TransferSingleEventObject,
10
10
  URIEventObject,
11
- } from ".";
11
+ } from "./index.js";
12
12
  const mockField = {
13
13
  blockHash:
14
14
  "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -2,5 +2,6 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
 
5
- export * from "../internal/erc20_processor";
6
- export * from "../internal/ERC20";
5
+ export * from "../internal/erc20_processor.js";
6
+ export * from "../internal/ERC20.js";
7
+ export * from "./test-utils.js";
@@ -7,7 +7,7 @@ import {
7
7
  ApprovalEventObject,
8
8
  OwnershipTransferredEventObject,
9
9
  TransferEventObject,
10
- } from ".";
10
+ } from "./index.js";
11
11
  const mockField = {
12
12
  blockHash:
13
13
  "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -2,5 +2,6 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
 
5
- export * from "../internal/erc20bytes_processor";
6
- export * from "../internal/ERC20Bytes";
5
+ export * from "../internal/erc20bytes_processor.js";
6
+ export * from "../internal/ERC20Bytes.js";
7
+ export * from "./test-utils.js";
@@ -6,7 +6,7 @@ import {
6
6
  getERC20BytesContract,
7
7
  ApprovalEventObject,
8
8
  TransferEventObject,
9
- } from ".";
9
+ } from "./index.js";
10
10
  const mockField = {
11
11
  blockHash:
12
12
  "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -2,5 +2,6 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
 
5
- export * from "../internal/erc721_processor";
6
- export * from "../internal/ERC721";
5
+ export * from "../internal/erc721_processor.js";
6
+ export * from "../internal/ERC721.js";
7
+ export * from "./test-utils.js";
@@ -7,7 +7,7 @@ import {
7
7
  ApprovalEventObject,
8
8
  ApprovalForAllEventObject,
9
9
  TransferEventObject,
10
- } from ".";
10
+ } from "./index.js";
11
11
  const mockField = {
12
12
  blockHash:
13
13
  "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -1,4 +1,8 @@
1
- export * as eacaggregatorproxy from './eacaggregatorproxy'
2
- export * as erc20 from './erc20'
3
- export * as erc20bytes from './erc20bytes'
4
- export * as weth9 from './weth9'
1
+ export * as eacaggregatorproxy from './eacaggregatorproxy/index.js'
2
+ export { EACAggregatorProxyProcessor, EACAggregatorProxyProcessorTemplate } from './eacaggregatorproxy/index.js'
3
+ export * as erc20 from './erc20/index.js'
4
+ export { ERC20Processor, ERC20ProcessorTemplate } from './erc20/index.js'
5
+ export * as erc20bytes from './erc20bytes/index.js'
6
+ export { ERC20BytesProcessor, ERC20BytesProcessorTemplate } from './erc20bytes/index.js'
7
+ export * as weth9 from './weth9/index.js'
8
+ export { WETH9Processor, WETH9ProcessorTemplate } from './weth9/index.js'
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  import type { BaseContract, Interface, LogDescription } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
- import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common";
6
+ import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
8
8
  export interface EACAggregatorProxyInterface extends Interface {}
9
9
 
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  import type { BaseContract, Interface, LogDescription } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
- import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common";
6
+ import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
8
8
  export interface ERC1155Interface extends Interface {}
9
9
 
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  import type { BaseContract, Interface, LogDescription } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
- import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common";
6
+ import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
8
8
  export interface ERC20Interface extends Interface {}
9
9
 
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  import type { BaseContract, Interface, LogDescription } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
- import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common";
6
+ import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
8
8
  export interface ERC20BytesInterface extends Interface {}
9
9
 
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  import type { BaseContract, Interface, LogDescription } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
- import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common";
6
+ import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
8
8
  export interface ERC721Interface extends Interface {}
9
9
 
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  import type { BaseContract, Interface, LogDescription } from "ethers";
5
5
  import type { ContractRunner } from "ethers/providers";
6
- import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common";
6
+ import type { TypedEventFilter, TypedEvent, PromiseOrValue } from "./common.js";
7
7
 
8
8
  export interface WETH9Interface extends Interface {}
9
9
 
@@ -23,7 +23,7 @@ import {
23
23
  } from "@sentio/sdk";
24
24
  import { EthFetchConfig } from "@sentio/protos";
25
25
 
26
- import { EACAggregatorProxy, EACAggregatorProxy__factory } from "./index";
26
+ import { EACAggregatorProxy, EACAggregatorProxy__factory } from "./index.js";
27
27
  import {
28
28
  AnswerUpdatedEvent,
29
29
  AnswerUpdatedEventFilter,
@@ -33,7 +33,7 @@ import {
33
33
  OwnershipTransferRequestedEventFilter,
34
34
  OwnershipTransferredEvent,
35
35
  OwnershipTransferredEventFilter,
36
- } from "./EACAggregatorProxy";
36
+ } from "./EACAggregatorProxy.js";
37
37
 
38
38
  export interface AcceptOwnershipCallObject {}
39
39
 
@@ -23,7 +23,7 @@ import {
23
23
  } from "@sentio/sdk";
24
24
  import { EthFetchConfig } from "@sentio/protos";
25
25
 
26
- import { ERC1155, ERC1155__factory } from "./index";
26
+ import { ERC1155, ERC1155__factory } from "./index.js";
27
27
  import {
28
28
  ApprovalForAllEvent,
29
29
  ApprovalForAllEventFilter,
@@ -33,7 +33,7 @@ import {
33
33
  TransferSingleEventFilter,
34
34
  URIEvent,
35
35
  URIEventFilter,
36
- } from "./ERC1155";
36
+ } from "./ERC1155.js";
37
37
 
38
38
  export interface BalanceOfCallObject {
39
39
  account: string;
@@ -23,7 +23,7 @@ import {
23
23
  } from "@sentio/sdk";
24
24
  import { EthFetchConfig } from "@sentio/protos";
25
25
 
26
- import { ERC20, ERC20__factory } from "./index";
26
+ import { ERC20, ERC20__factory } from "./index.js";
27
27
  import {
28
28
  ApprovalEvent,
29
29
  ApprovalEventFilter,
@@ -31,7 +31,7 @@ import {
31
31
  OwnershipTransferredEventFilter,
32
32
  TransferEvent,
33
33
  TransferEventFilter,
34
- } from "./ERC20";
34
+ } from "./ERC20.js";
35
35
 
36
36
  export interface AllowanceCallObject {
37
37
  owner: string;
@@ -23,13 +23,13 @@ import {
23
23
  } from "@sentio/sdk";
24
24
  import { EthFetchConfig } from "@sentio/protos";
25
25
 
26
- import { ERC20Bytes, ERC20Bytes__factory } from "./index";
26
+ import { ERC20Bytes, ERC20Bytes__factory } from "./index.js";
27
27
  import {
28
28
  ApprovalEvent,
29
29
  ApprovalEventFilter,
30
30
  TransferEvent,
31
31
  TransferEventFilter,
32
- } from "./ERC20Bytes";
32
+ } from "./ERC20Bytes.js";
33
33
 
34
34
  export interface NameCallObject {}
35
35
 
@@ -23,7 +23,7 @@ import {
23
23
  } from "@sentio/sdk";
24
24
  import { EthFetchConfig } from "@sentio/protos";
25
25
 
26
- import { ERC721, ERC721__factory } from "./index";
26
+ import { ERC721, ERC721__factory } from "./index.js";
27
27
  import {
28
28
  ApprovalEvent,
29
29
  ApprovalEventFilter,
@@ -31,7 +31,7 @@ import {
31
31
  ApprovalForAllEventFilter,
32
32
  TransferEvent,
33
33
  TransferEventFilter,
34
- } from "./ERC721";
34
+ } from "./ERC721.js";
35
35
 
36
36
  export interface ApproveCallObject {
37
37
  to: string;
@@ -1,9 +1,9 @@
1
1
  /* Autogenerated file. Do not edit manually. */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- export { EACAggregatorProxy__factory } from "./EACAggregatorProxy__factory";
5
- export { ERC1155__factory } from "./ERC1155__factory";
6
- export { ERC20__factory } from "./ERC20__factory";
7
- export { ERC20Bytes__factory } from "./ERC20Bytes__factory";
8
- export { ERC721__factory } from "./ERC721__factory";
9
- export { WETH9__factory } from "./WETH9__factory";
4
+ export { EACAggregatorProxy__factory } from "./EACAggregatorProxy__factory.js";
5
+ export { ERC1155__factory } from "./ERC1155__factory.js";
6
+ export { ERC20__factory } from "./ERC20__factory.js";
7
+ export { ERC20Bytes__factory } from "./ERC20Bytes__factory.js";
8
+ export { ERC721__factory } from "./ERC721__factory.js";
9
+ export { WETH9__factory } from "./WETH9__factory.js";
@@ -1,16 +1,16 @@
1
1
  /* Autogenerated file. Do not edit manually. */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- export type { EACAggregatorProxy } from "./EACAggregatorProxy";
5
- export type { ERC1155 } from "./ERC1155";
6
- export type { ERC20 } from "./ERC20";
7
- export type { ERC20Bytes } from "./ERC20Bytes";
8
- export type { ERC721 } from "./ERC721";
9
- export type { WETH9 } from "./WETH9";
10
- export * as factories from "./factories";
11
- export { EACAggregatorProxy__factory } from "./factories/EACAggregatorProxy__factory";
12
- export { ERC1155__factory } from "./factories/ERC1155__factory";
13
- export { ERC20__factory } from "./factories/ERC20__factory";
14
- export { ERC20Bytes__factory } from "./factories/ERC20Bytes__factory";
15
- export { ERC721__factory } from "./factories/ERC721__factory";
16
- export { WETH9__factory } from "./factories/WETH9__factory";
4
+ export type { EACAggregatorProxy } from "./EACAggregatorProxy.js";
5
+ export type { ERC1155 } from "./ERC1155.js";
6
+ export type { ERC20 } from "./ERC20.js";
7
+ export type { ERC20Bytes } from "./ERC20Bytes.js";
8
+ export type { ERC721 } from "./ERC721.js";
9
+ export type { WETH9 } from "./WETH9.js";
10
+ export * as factories from "./factories/index.js";
11
+ export { EACAggregatorProxy__factory } from "./factories/EACAggregatorProxy__factory.js";
12
+ export { ERC1155__factory } from "./factories/ERC1155__factory.js";
13
+ export { ERC20__factory } from "./factories/ERC20__factory.js";
14
+ export { ERC20Bytes__factory } from "./factories/ERC20Bytes__factory.js";
15
+ export { ERC721__factory } from "./factories/ERC721__factory.js";
16
+ export { WETH9__factory } from "./factories/WETH9__factory.js";