@sentio/sdk 2.0.0-rc.2 → 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
@@ -23,7 +23,7 @@ import {
23
23
  } from "@sentio/sdk";
24
24
  import { EthFetchConfig } from "@sentio/protos";
25
25
 
26
- import { WETH9, WETH9__factory } from "./index";
26
+ import { WETH9, WETH9__factory } from "./index.js";
27
27
  import {
28
28
  ApprovalEvent,
29
29
  ApprovalEventFilter,
@@ -33,7 +33,7 @@ import {
33
33
  DepositEventFilter,
34
34
  WithdrawalEvent,
35
35
  WithdrawalEventFilter,
36
- } from "./WETH9";
36
+ } from "./WETH9.js";
37
37
 
38
38
  export interface NameCallObject {}
39
39
 
@@ -2,5 +2,6 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
 
5
- export * from "../internal/weth9_processor";
6
- export * from "../internal/WETH9";
5
+ export * from "../internal/weth9_processor.js";
6
+ export * from "../internal/WETH9.js";
7
+ export * from "./test-utils.js";
@@ -8,7 +8,7 @@ import {
8
8
  TransferEventObject,
9
9
  DepositEventObject,
10
10
  WithdrawalEventObject,
11
- } from ".";
11
+ } from "./index.js";
12
12
  const mockField = {
13
13
  blockHash:
14
14
  "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -1,8 +1,8 @@
1
1
  import { ProcessResult, RecordMetaData } from '@sentio/protos'
2
- import { Logger } from './logger'
3
- import { Labels } from './metadata'
4
- import { Meter } from './meter'
5
- import { BoundedEventTracker } from './event-tracker'
2
+ import { Logger } from './logger.js'
3
+ import { Labels } from './metadata.js'
4
+ import { Meter } from './meter.js'
5
+ import { BoundedEventTracker } from './event-tracker.js'
6
6
 
7
7
  export abstract class BaseContext {
8
8
  meter: Meter
@@ -1,12 +1,11 @@
1
- import { BaseContract, Transaction, TransactionReceipt, Block, ContractEvent } from 'ethers'
1
+ import { BaseContract, Transaction, TransactionReceipt, Block } from 'ethers'
2
2
  import { LogParams } from 'ethers/providers'
3
3
 
4
4
  import { RecordMetaData } from '@sentio/protos'
5
- import { normalizeLabels } from './meter'
6
- import { Trace } from '../eth/trace'
7
- import { Labels } from './metadata'
8
- import { CHAIN_IDS } from '../utils/chain'
9
- import { BaseContext } from './base-context'
5
+ import { Trace } from '../eth/trace.js'
6
+ import { Labels, normalizeLabels } from './metadata.js'
7
+ import { CHAIN_IDS } from '../utils/chain.js'
8
+ import { BaseContext } from './base-context.js'
10
9
 
11
10
  export abstract class EthContext extends BaseContext {
12
11
  chainId: number
@@ -1,9 +1,9 @@
1
1
  import { Plugin, PluginManager } from '@sentio/runtime'
2
2
  import { ProcessConfigResponse } from '@sentio/protos'
3
3
 
4
- import { MetricState } from './meter'
5
- import { EventTrackerState } from './event-tracker'
6
- import { ExporterState } from './exporter'
4
+ import { MetricState } from './meter.js'
5
+ import { EventTrackerState } from './event-tracker.js'
6
+ import { ExporterState } from './exporter.js'
7
7
 
8
8
  export class CorePlugin extends Plugin {
9
9
  name: string = 'CorePlugin'
@@ -1,6 +1,6 @@
1
- import { BaseContext } from './base-context'
1
+ import { BaseContext } from './base-context.js'
2
2
  import { EventTrackingResult } from '@sentio/protos'
3
- import { NamedResultDescriptor } from './metadata'
3
+ import { NamedResultDescriptor } from './metadata.js'
4
4
  import { MapStateStorage } from '@sentio/runtime'
5
5
 
6
6
  export interface Event {
@@ -1,6 +1,6 @@
1
- import { BaseContext } from './base-context'
2
- import { ExportResult } from '@sentio/sdk'
3
- import { NamedResultDescriptor } from './metadata'
1
+ import { BaseContext } from './base-context.js'
2
+ import { ExportResult } from '@sentio/protos'
3
+ import { NamedResultDescriptor } from './metadata.js'
4
4
  import { MapStateStorage } from '@sentio/runtime'
5
5
 
6
6
  export type Export = Record<string, any>
package/src/core/index.ts CHANGED
@@ -1,12 +1,15 @@
1
- export { BigDecimal } from './big-decimal'
2
- export { ContractContext, ContractView, BoundContractView } from './context'
3
- export { CounterBinding, Meter, GaugeBinding, Counter, Gauge, MetricOptions } from './meter'
4
- export { EventTracker, AccountEventTracker } from './event-tracker'
5
- export { type Numberish, toBigInteger, toMetricValue, toBlockTag } from './numberish'
1
+ export { BigDecimal } from './big-decimal.js'
2
+ export { BaseContext } from './base-context.js'
3
+ export { type Labels, normalizeLabels } from './metadata.js'
4
+ export { ContractContext, ContractView, BoundContractView } from './context.js'
5
+ export { CounterBinding, Meter, GaugeBinding, Counter, Gauge, MetricOptions } from './meter.js'
6
+ export { EventTracker, AccountEventTracker } from './event-tracker.js'
7
+ export { Exporter } from './exporter.js'
8
+ export { type Numberish, toBigInteger, toMetricValue, toBlockTag } from './numberish.js'
6
9
 
7
- export { BindOptions } from './bind-options'
10
+ export { BindOptions } from './bind-options.js'
8
11
 
9
- export { SuiBaseProcessor, SuiBindOptions } from './sui-processor'
12
+ export { SuiBaseProcessor, SuiBindOptions } from './sui-processor.js'
10
13
 
11
- export { SuiPlugin } from './sui-plugin'
12
- export { CorePlugin } from './core-plugin'
14
+ export { SuiPlugin } from './sui-plugin.js'
15
+ export { CorePlugin } from './core-plugin.js'
@@ -1,6 +1,6 @@
1
- import { BaseContext } from './base-context'
1
+ import { BaseContext } from './base-context.js'
2
2
  import { LogLevel } from '@sentio/protos'
3
- import { NamedResultDescriptor } from './metadata'
3
+ import { NamedResultDescriptor } from './metadata.js'
4
4
 
5
5
  export type Attributes = Record<string, any>
6
6
 
@@ -1,7 +1,28 @@
1
- import { normalizeName } from './meter'
2
-
3
1
  export type Labels = { [key: string]: string }
4
2
 
3
+ export function normalizeName(name: string): string {
4
+ return name.slice(0, 100).replace(/[^_\-a-zA-Z0-9]/g, '_')
5
+ }
6
+
7
+ export function normalizeKey(name: string): string {
8
+ if (name === 'labels') {
9
+ return 'labels_'
10
+ }
11
+ return normalizeName(name)
12
+ }
13
+
14
+ export function normalizeValue(name: string): string {
15
+ return name.slice(0, 100)
16
+ }
17
+
18
+ export function normalizeLabels(labels: Labels): Labels {
19
+ const normLabels: Labels = {}
20
+ for (const key in labels) {
21
+ normLabels[normalizeKey(key)] = normalizeValue(labels[key])
22
+ }
23
+ return normLabels
24
+ }
25
+
5
26
  export class NamedResultDescriptor {
6
27
  name: string
7
28
 
package/src/core/meter.ts CHANGED
@@ -1,32 +1,9 @@
1
- import { BaseContext } from './base-context'
2
- import { Numberish, toMetricValue } from './numberish'
3
- import { Labels, NamedResultDescriptor } from './metadata'
1
+ import { BaseContext } from './base-context.js'
2
+ import { Numberish, toMetricValue } from './numberish.js'
3
+ import { Labels, NamedResultDescriptor, normalizeKey } from './metadata.js'
4
4
  import { AggregationConfig, AggregationType, MetricConfig, MetricType } from '@sentio/protos'
5
5
  import { MapStateStorage } from '@sentio/runtime'
6
6
 
7
- export function normalizeName(name: string): string {
8
- return name.slice(0, 100).replace(/[^_\-a-zA-Z0-9]/g, '_')
9
- }
10
-
11
- export function normalizeKey(name: string): string {
12
- if (name === 'labels') {
13
- return 'labels_'
14
- }
15
- return normalizeName(name)
16
- }
17
-
18
- export function normalizeValue(name: string): string {
19
- return name.slice(0, 100)
20
- }
21
-
22
- export function normalizeLabels(labels: Labels): Labels {
23
- const normLabels: Labels = {}
24
- for (const key in labels) {
25
- normLabels[normalizeKey(key)] = normalizeValue(labels[key])
26
- }
27
- return normLabels
28
- }
29
-
30
7
  export class MetricOptions {
31
8
  unit?: string
32
9
  description?: string
@@ -1,5 +1,5 @@
1
1
  import { BigInteger, MetricValue } from '@sentio/protos'
2
- import { BigDecimal } from '.'
2
+ import { BigDecimal } from './big-decimal.js'
3
3
  import { BlockTag } from 'ethers/providers'
4
4
 
5
5
  export type Numberish = number | bigint | BigDecimal | string
@@ -3,8 +3,8 @@ import { ContractConfig, DataBinding, HandlerType, ProcessConfigResponse, Proces
3
3
 
4
4
  import { ServerError, Status } from 'nice-grpc'
5
5
 
6
- import { CHAIN_IDS } from '../utils/chain'
7
- import { SuiProcessorState } from './sui-processor'
6
+ import { CHAIN_IDS } from '../utils/chain.js'
7
+ import { SuiProcessorState } from './sui-processor.js'
8
8
 
9
9
  export class SuiPlugin extends Plugin {
10
10
  name: string = 'SuiPlugin'
@@ -1,4 +1,4 @@
1
- import { SuiContext } from './context'
1
+ import { SuiContext } from './context.js'
2
2
  import { ProcessResult } from '@sentio/protos'
3
3
  import { ListStateStorage } from '@sentio/runtime'
4
4
 
package/src/error.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Transform error in more readable format
2
- import { ContractContext } from './core/context'
2
+ import { ContractContext } from './core/context.js'
3
3
  // import { errors } from 'ethers/providers'
4
4
 
5
5
  export class EthersError extends Error {
@@ -1,5 +1,5 @@
1
1
  import { ListStateStorage } from '@sentio/runtime'
2
- import { AccountProcessor } from './account-processor'
2
+ import { AccountProcessor } from './account-processor.js'
3
3
 
4
4
  export class AccountProcessorState extends ListStateStorage<AccountProcessor> {
5
5
  static INSTANCE = new AccountProcessorState()
@@ -1,20 +1,20 @@
1
- import { ERC20__factory, ERC721__factory } from '../builtin/internal'
2
- import { AddressType, DummyProvider, EthFetchConfig, ProcessResult } from '@sentio/sdk'
3
- import { AccountBindOptions } from '../core/bind-options'
1
+ import { ERC20__factory, ERC721__factory } from '../builtin/internal/index.js'
2
+ import { AddressType, EthFetchConfig, ProcessResult } from '@sentio/protos'
3
+ import { AccountBindOptions } from '../core/bind-options.js'
4
4
 
5
5
  import { Network, LogParams } from 'ethers/providers'
6
6
 
7
- import { TransferEvent as ERC20TransferEvent } from '../builtin/internal/ERC20'
8
- import { TransferEvent as ERC721TransferEvent } from '../builtin/internal/ERC721'
7
+ import { TransferEvent as ERC20TransferEvent } from '../builtin/internal/ERC20.js'
8
+ import { TransferEvent as ERC721TransferEvent } from '../builtin/internal/ERC721.js'
9
9
 
10
- import { ERC20Processor } from '../builtin/internal/erc20_processor'
11
- import { ERC721Processor } from '../builtin/internal/erc721_processor'
10
+ import { ERC20Processor } from '../builtin/internal/erc20_processor.js'
11
+ import { ERC721Processor } from '../builtin/internal/erc721_processor.js'
12
12
 
13
- import { AccountContext } from '../core/context'
14
- import { PromiseOrVoid } from '../promise-or-void'
15
- import { AddressOrTypeEventFilter, EventsHandler } from './base-processor'
13
+ import { AccountContext } from '../core/context.js'
14
+ import { PromiseOrVoid } from '../promise-or-void.js'
15
+ import { AddressOrTypeEventFilter, EventsHandler } from './base-processor.js'
16
16
  import { Transaction, Block, TransactionReceipt, LogDescription } from 'ethers'
17
- import { AccountProcessorState } from './account-processor-state'
17
+ import { AccountProcessorState } from './account-processor-state.js'
18
18
 
19
19
  const ERC20_INTERFACE = ERC20__factory.createInterface()
20
20
  const ERC721_INTERFACE = ERC721__factory.createInterface()
@@ -1,10 +1,10 @@
1
- import { BoundContractView, ContractContext, ContractView } from '../core/context'
1
+ import { BoundContractView, ContractContext, ContractView } from '../core/context.js'
2
2
  import { BaseContract, ContractEvent, Block, LogDescription } from 'ethers'
3
- import { AddressOrTypeEventFilter, BaseProcessor } from './base-processor'
4
- import { BindOptions, getOptionsSignature } from '../core/bind-options'
3
+ import { AddressOrTypeEventFilter, BaseProcessor } from './base-processor.js'
4
+ import { BindOptions, getOptionsSignature } from '../core/bind-options.js'
5
5
  import { EthFetchConfig, HandleInterval, TemplateInstance } from '@sentio/protos'
6
- import { PromiseOrVoid } from '../promise-or-void'
7
- import { Trace } from './trace'
6
+ import { PromiseOrVoid } from '../promise-or-void.js'
7
+ import { Trace } from './trace.js'
8
8
  import { ListStateStorage } from '@sentio/runtime'
9
9
  import { EventFilter, LogParams, Network } from 'ethers/providers'
10
10
  import { DeferredTopicFilter } from 'ethers/contract'
@@ -12,7 +12,7 @@ import {
12
12
  } from 'ethers'
13
13
  import { EventFilter, LogParams, Network } from 'ethers/providers'
14
14
 
15
- import { BoundContractView, ContractContext, ContractView } from '../core/context'
15
+ import { BoundContractView, ContractContext, ContractView } from '../core/context.js'
16
16
  import {
17
17
  AddressType,
18
18
  Data_EthBlock,
@@ -22,9 +22,9 @@ import {
22
22
  HandleInterval,
23
23
  ProcessResult,
24
24
  } from '@sentio/protos'
25
- import { BindInternalOptions, BindOptions } from '../core/bind-options'
26
- import { PromiseOrVoid } from '../promise-or-void'
27
- import { Trace } from './trace'
25
+ import { BindInternalOptions, BindOptions } from '../core/bind-options.js'
26
+ import { PromiseOrVoid } from '../promise-or-void.js'
27
+ import { Trace } from './trace.js'
28
28
  import { ServerError, Status } from 'nice-grpc'
29
29
 
30
30
  export interface AddressOrTypeEventFilter extends DeferredTopicFilter {
package/src/eth/binds.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { BindOptions, getOptionsSignature } from '../core/bind-options'
2
- import { ContractView } from '../core'
3
- import { BaseProcessor } from './base-processor'
1
+ import { BindOptions, getOptionsSignature } from '../core/bind-options.js'
2
+ import { ContractView } from '../core/index.js'
3
+ import { BaseProcessor } from './base-processor.js'
4
4
  import { Networkish, Network } from 'ethers/providers'
5
5
 
6
6
  import { BaseContract } from 'ethers'
@@ -15,9 +15,9 @@ import {
15
15
  } from '@sentio/protos'
16
16
 
17
17
  import { ServerError, Status } from 'nice-grpc'
18
- import { ProcessorState } from './binds'
19
- import { AccountProcessorState } from './account-processor-state'
20
- import { ProcessorTemplateProcessorState, TemplateInstanceState } from './base-processor-template'
18
+ import { ProcessorState } from './binds.js'
19
+ import { AccountProcessorState } from './account-processor-state.js'
20
+ import { ProcessorTemplateProcessorState, TemplateInstanceState } from './base-processor-template.js'
21
21
 
22
22
  export class EthPlugin extends Plugin {
23
23
  name: string = 'EthPlugin'
@@ -1,9 +1,9 @@
1
1
  import { BaseContract } from 'ethers'
2
- import { BoundContractView, ContractView } from '../core/context'
3
- import { BindOptions } from '../core/bind-options'
4
- import { BaseProcessor } from './base-processor'
5
- import { getProvider } from './provider'
6
- import { addProcessor } from './binds'
2
+ import { BoundContractView, ContractView } from '../core/context.js'
3
+ import { BindOptions } from '../core/bind-options.js'
4
+ import { BaseProcessor } from './base-processor.js'
5
+ import { getProvider } from './provider.js'
6
+ import { addProcessor } from './binds.js'
7
7
 
8
8
  export class GenericProcessor extends BaseProcessor<
9
9
  BaseContract,
package/src/eth/index.ts CHANGED
@@ -1,6 +1,8 @@
1
- export { BaseProcessor } from './base-processor'
2
- export { GenericProcessor } from './generic-processor'
3
- export { BaseProcessorTemplate } from './base-processor-template'
4
- export { getProvider, DummyProvider } from './provider'
5
- export type { TypedCallTrace, Trace } from './trace'
6
- export { EthPlugin } from './eth-plugin'
1
+ export { BaseProcessor } from './base-processor.js'
2
+ export { GenericProcessor } from './generic-processor.js'
3
+ export { BaseProcessorTemplate } from './base-processor-template.js'
4
+ export { getProvider, DummyProvider } from './provider.js'
5
+ export type { TypedCallTrace, Trace } from './trace.js'
6
+ export { EthPlugin } from './eth-plugin.js'
7
+
8
+ export { getProcessor, addProcessor, getContractByABI, addContractByABI } from './binds.js'
package/src/index.ts CHANGED
@@ -1,12 +1,10 @@
1
- export { transformEtherError, EthersError } from './error'
2
-
3
- export { getProcessor, addProcessor, getContractByABI, addContractByABI } from './eth/binds'
1
+ export { transformEtherError, EthersError } from './error.js'
4
2
 
5
3
  // TODO maybe remove this
6
4
  export * from '@sentio/protos'
7
5
 
8
- export * from './core'
9
- export * from './eth'
6
+ export * from './core/index.js'
7
+ export * from './eth/index.js'
10
8
 
11
- export * from './utils/chain'
9
+ export * from './utils/chain.js'
12
10
  // export * from './api'
@@ -1,5 +1,5 @@
1
1
  import { EventDeclaration, Contract, getFullSignatureAsSymbolForEvent } from 'typechain'
2
- import { getFullSignatureForEventPatched } from './types'
2
+ import { getFullSignatureForEventPatched } from './types.cjs'
3
3
  import { generateEventInputs } from '@sentio/ethers-v6/dist/codegen/events'
4
4
 
5
5
  export function generateEventHandler(event: EventDeclaration, contractName: string, includeArgTypes: boolean): string {
@@ -7,14 +7,15 @@ import {
7
7
 
8
8
  import { reservedKeywords } from '@sentio/ethers-v6/dist/codegen/reserved-keywords'
9
9
  import { getFullSignatureForEvent } from 'typechain/dist/utils/signatures'
10
- import { codegenCallTraceTypes, generateCallHandlers } from './functions-handler'
11
- import { generateEventFilters, generateEventHandlers } from './event-handler'
12
- import { generateBoundViewFunctions, generateViewFunctions } from './view-function'
10
+ import { codegenCallTraceTypes, generateCallHandlers } from './functions-handler.cjs'
11
+ import { generateEventFilters, generateEventHandlers } from './event-handler.cjs'
12
+ import { generateBoundViewFunctions, generateViewFunctions } from './view-function.cjs'
13
13
 
14
14
  export function codeGenIndex(contract: Contract): string {
15
15
  return `
16
- export * from '../internal/${contract.name.toLowerCase()}_processor'
17
- export * from '../internal/${contract.name}'
16
+ export * from '../internal/${contract.name.toLowerCase()}_processor.js'
17
+ export * from '../internal/${contract.name}.js'
18
+ export * from './test-utils.js'
18
19
  `
19
20
  }
20
21
 
@@ -164,9 +165,9 @@ export class ${contract.name}ProcessorTemplate extends BaseProcessorTemplate<${c
164
165
  'toBlockTag',
165
166
  ],
166
167
  '@sentio/protos': ['EthFetchConfig'],
167
- './common': ['PromiseOrValue'],
168
- './index': [`${contract.name}`, `${contract.name}__factory`],
169
- [`./${contract.name}`]: eventsImports.concat(uniqueStructImports),
168
+ './common.js': ['PromiseOrValue'],
169
+ './index.js': [`${contract.name}`, `${contract.name}__factory`],
170
+ [`./${contract.name}.js`]: eventsImports.concat(uniqueStructImports),
170
171
  },
171
172
  source
172
173
  )
@@ -200,7 +201,7 @@ export function codeGenTestUtilsFile(contract: Contract): string {
200
201
  const imports = createImportsForUsedIdentifiers(
201
202
  {
202
203
  'ethers/providers': ['LogParams'],
203
- '.': [
204
+ './index.js': [
204
205
  `get${contract.name}Contract`,
205
206
  ...Object.values(contract.events).flatMap((events) => {
206
207
  if (events.length === 1) {
@@ -2,10 +2,9 @@ import {
2
2
  generateOutputComplexTypeAsArray,
3
3
  generateOutputComplexTypesAsObject,
4
4
  } from '@sentio/ethers-v6/dist/codegen/types'
5
- import { keccak256 } from 'ethers'
5
+ import { keccak_256 } from 'js-sha3'
6
6
  import { FunctionDeclaration, getSignatureForFn } from 'typechain'
7
- // import { utils } from 'ethers'
8
- import { getFullSignatureAsSymbolForFunction } from './types'
7
+ import { getFullSignatureAsSymbolForFunction } from './types.cjs'
9
8
 
10
9
  export function generateCallHandlers(fns: FunctionDeclaration[], contractName: string): string {
11
10
  if (fns.length === 1) {
@@ -42,7 +41,7 @@ function generateCallHandler(fn: FunctionDeclaration, contractName: string, over
42
41
  // utils.toUtf8Bytes(signature))
43
42
 
44
43
  const test = new TextEncoder().encode(signature)
45
- const sighash = keccak256(test).substring(0, 10)
44
+ const sighash = "0x" + keccak_256(test).substring(0, 8)
46
45
 
47
46
  return `
48
47
  onCall${capitalizeFirstChar(overloadedName ?? fn.name)}(
@@ -1,7 +1,7 @@
1
1
  import Ethers from '@sentio/ethers-v6'
2
2
  import { Config, extractAbi, extractDocumentation, FileDescription, parse, shortenFullJsonFilePath } from 'typechain'
3
3
  import { dirname, join, relative } from 'path'
4
- import { codeGenIndex, codeGenSentioFile, codeGenTestUtilsFile } from './file'
4
+ import { codeGenIndex, codeGenSentioFile, codeGenTestUtilsFile } from './file.cjs'
5
5
 
6
6
  export default class EthersSentio extends Ethers {
7
7
  constructor(config: Config) {
@@ -54,6 +54,9 @@ export default class EthersSentio extends Ethers {
54
54
  if (file.path.endsWith('__factory.ts')) {
55
55
  file.contents = '// @ts-nocheck\n' + file.contents
56
56
  }
57
+ if (file.path.endsWith('factories/index.ts')) {
58
+ file.contents = file.contents.replaceAll("__factory'", "__factory.js'")
59
+ }
57
60
  }
58
61
  return files
59
62
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../../../tsconfig.json",
2
+ "extends": "../../../../tsconfig.cjs.json",
3
3
  "compilerOptions": {
4
4
  "rootDir": "..",
5
5
  "outDir": "../../lib"
File without changes
@@ -1,7 +1,7 @@
1
1
  // https://github.com/dethcrypto/TypeChain/blob/015abb28bd22826611051f27e0ec96a00f9a0b61/packages/target-ethers-v5/src/codegen/functions.ts#L54
2
2
  import { FunctionDeclaration } from 'typechain'
3
3
  import { generateInputTypes, generateOutputTypes } from '@sentio/ethers-v6/dist/codegen/types'
4
- import { getFullSignatureAsSymbolForFunction, getFullSignatureForFunction } from './types'
4
+ import { getFullSignatureAsSymbolForFunction, getFullSignatureForFunction } from './types.cjs'
5
5
 
6
6
  function generateReturnTypes(fn: FunctionDeclaration) {
7
7
  // sounds like returnResultObject should be true but we need to set false to make it work
@@ -1,4 +1,4 @@
1
- export { TestProcessorServer } from './test-processor-server'
2
- export { MetricValueToNumber, firstCounterValue, firstGaugeValue } from './metric-utils'
1
+ export { TestProcessorServer } from './test-processor-server.js'
2
+ export { MetricValueToNumber, firstCounterValue, firstGaugeValue } from './metric-utils.js'
3
3
 
4
- // export { loadTestProvidersFromEnv } from './test-provider' // TODO make the interface more standard and then export
4
+ export { loadTestProvidersFromEnv } from './test-provider.js' // TODO make the interface more standard and then export
@@ -1,6 +1,6 @@
1
1
  import { MetricValue, ProcessResult } from '@sentio/protos'
2
- import { Numberish, BigDecimal } from '../core'
3
- import { bytesToBigInt } from '../utils/conversion'
2
+ import { Numberish, BigDecimal } from '../core/index.js'
3
+ import { bytesToBigInt } from '../utils/conversion.js'
4
4
 
5
5
  export function MetricValueToNumber(v: Partial<MetricValue> | undefined): Numberish | undefined {
6
6
  if (v === undefined) {
@@ -10,13 +10,13 @@ import {
10
10
  ProcessConfigResponse,
11
11
  ProcessorServiceImplementation,
12
12
  StartRequest,
13
+ Empty,
13
14
  } from '@sentio/protos'
14
15
  import { CallContext } from 'nice-grpc-common'
15
- import { Empty } from '@sentio/protos/lib/google/protobuf/empty'
16
- import { ChainConfig, ProcessorServiceImpl, Endpoints, State } from '@sentio/runtime'
17
- import { CHAIN_MAP } from '../utils/chain'
16
+ import { ProcessorServiceImpl, Endpoints, State } from '@sentio/runtime'
17
+ import { CHAIN_MAP } from '../utils/chain.js'
18
18
 
19
- import { Trace } from '../eth/trace'
19
+ import { Trace } from '../eth/trace.js'
20
20
  import { LogParams, Networkish, BlockParams, Network } from 'ethers/providers'
21
21
 
22
22
  import { Block, Log } from 'ethers'
@@ -33,7 +33,7 @@ export class TestProcessorServer implements ProcessorServiceImplementation {
33
33
  contractConfigs: ContractConfig[]
34
34
  accountConfigs: AccountConfig[]
35
35
 
36
- constructor(loader: () => void, httpEndpoints: Record<string, string> = {}) {
36
+ constructor(loader: () => Promise<any>, httpEndpoints: Record<string, string> = {}) {
37
37
  cleanTest()
38
38
 
39
39
  this.service = new ProcessorServiceImpl(loader)
@@ -1,5 +1,5 @@
1
1
  import { Endpoints } from '@sentio/runtime'
2
- import { CHAIN_MAP } from '../utils/chain'
2
+ import { CHAIN_MAP } from '../utils/chain.js'
3
3
 
4
4
  export function loadTestProvidersFromEnv(requiredChainIds: string[] | string): boolean {
5
5
  const found: string[] = []
@@ -0,0 +1,23 @@
1
+ import { defineConfig } from 'tsup'
2
+
3
+ export default defineConfig({
4
+ entry: {
5
+ lib: 'src/processor.ts',
6
+ },
7
+ minify: true,
8
+ sourcemap: 'inline',
9
+ clean: true,
10
+ format: 'esm',
11
+ external: [
12
+ 'protobufjs',
13
+ 'aptos-sdk',
14
+ 'aptos',
15
+ 'ethers',
16
+ 'bs58',
17
+ 'bn.js',
18
+ 'csv-parse',
19
+ /^nice-grpc.*$/,
20
+ /^@(ethersproject|solana|project-serum).*$/,
21
+ /^@sentio\/(sdk|runtime|protos|bigdecimal|ethers).*$/,
22
+ ],
23
+ })
@@ -1,5 +1,5 @@
1
- import { BigDecimal } from '../core/big-decimal'
2
- import { Numberish } from '../core'
1
+ import { BigDecimal } from '../core/big-decimal.js'
2
+ import { Numberish } from '../core/index.js'
3
3
  import { MetricValue } from '@sentio/protos'
4
4
 
5
5
  export function toBigDecimal(n: bigint) {
@@ -1,10 +1,10 @@
1
- import { getEACAggregatorProxyContract } from '../builtin/internal/eacaggregatorproxy_processor'
1
+ import { getEACAggregatorProxyContract } from '../builtin/internal/eacaggregatorproxy_processor.js'
2
2
  import path from 'path'
3
3
  import fs from 'fs'
4
- // @ts-ignore type def not provided
5
4
  import { parse } from 'csv-parse/sync'
6
5
  import { BlockTag } from 'ethers/providers'
7
- import { scaleDown } from './token'
6
+ import { scaleDown } from './token.js'
7
+ import url from 'url'
8
8
 
9
9
  type OralceRecord = {
10
10
  Pair: string
@@ -36,7 +36,7 @@ class DexPrice {
36
36
 
37
37
  constructor(csvFileName: string, chainId: number) {
38
38
  this.chainId = chainId
39
- const csvFilePath = path.resolve(__dirname, csvFileName)
39
+ const csvFilePath = url.fileURLToPath(new URL('./' + csvFileName, import.meta.url))
40
40
  const fileContent = fs.readFileSync(csvFilePath, { encoding: 'utf-8' })
41
41
  const headers = ['Pair', 'Asset', 'Type', 'Address']
42
42