@sentio/sdk 2.5.0 → 2.5.1-rc.2

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 (292) hide show
  1. package/lib/aptos/codegen/codegen.js +3 -3
  2. package/lib/aptos/codegen/codegen.js.map +1 -1
  3. package/lib/aptos/move-coder.js +2 -2
  4. package/lib/aptos/move-coder.js.map +1 -1
  5. package/lib/aptos/move-types.d.ts +5 -5
  6. package/lib/aptos/move-types.js +15 -15
  7. package/lib/aptos/move-types.js.map +1 -1
  8. package/lib/eth/codegen/event-handler.js.map +1 -1
  9. package/lib/eth/codegen/functions-handler.js +4 -9
  10. package/lib/eth/codegen/functions-handler.js.map +1 -1
  11. package/lib/eth/context.js.map +1 -1
  12. package/lib/eth/index.d.ts +0 -1
  13. package/lib/eth/index.js +0 -1
  14. package/lib/eth/index.js.map +1 -1
  15. package/lib/move/abstract-codegen.d.ts +12 -12
  16. package/lib/move/abstract-codegen.js +30 -36
  17. package/lib/move/abstract-codegen.js.map +1 -1
  18. package/lib/move/abstract-move-coder.d.ts +4 -4
  19. package/lib/move/abstract-move-coder.js +3 -3
  20. package/lib/move/abstract-move-coder.js.map +1 -1
  21. package/lib/move/account.d.ts +4 -7
  22. package/lib/move/account.js +2 -14
  23. package/lib/move/account.js.map +1 -1
  24. package/lib/move/internal-models.d.ts +34 -0
  25. package/lib/move/internal-models.js +7 -0
  26. package/lib/move/internal-models.js.map +1 -0
  27. package/lib/move/ts-type.js +1 -3
  28. package/lib/move/ts-type.js.map +1 -1
  29. package/lib/move/types.d.ts +1 -0
  30. package/lib/move/types.js +13 -25
  31. package/lib/move/types.js.map +1 -1
  32. package/lib/sui/codegen/codegen.js +5 -5
  33. package/lib/sui/codegen/codegen.js.map +1 -1
  34. package/lib/sui/move-coder.js +2 -2
  35. package/lib/sui/move-coder.js.map +1 -1
  36. package/lib/sui/move-types.d.ts +7 -7
  37. package/lib/sui/move-types.js +26 -25
  38. package/lib/sui/move-types.js.map +1 -1
  39. package/lib/sui/sui-processor.js.map +1 -1
  40. package/lib/sui/utils.d.ts +2 -2
  41. package/lib/sui/utils.js.map +1 -1
  42. package/lib/utils/dex-price.test.js.map +1 -1
  43. package/lib/utils/erc20.test.js.map +1 -1
  44. package/package.json +10 -13
  45. package/src/aptos/codegen/codegen.ts +7 -7
  46. package/src/aptos/move-coder.ts +2 -3
  47. package/src/aptos/move-types.ts +20 -20
  48. package/src/eth/codegen/event-handler.ts +1 -1
  49. package/src/eth/codegen/functions-handler.ts +4 -10
  50. package/src/eth/context.ts +0 -1
  51. package/src/eth/index.ts +0 -1
  52. package/src/move/abstract-codegen.ts +45 -50
  53. package/src/move/abstract-move-coder.ts +9 -9
  54. package/src/move/account.ts +6 -21
  55. package/src/move/internal-models.ts +40 -0
  56. package/src/move/ts-type.ts +1 -3
  57. package/src/move/types.ts +13 -33
  58. package/src/sui/codegen/codegen.ts +8 -8
  59. package/src/sui/move-coder.ts +2 -2
  60. package/src/sui/move-types.ts +32 -31
  61. package/src/sui/sui-processor.ts +1 -1
  62. package/src/sui/utils.ts +2 -2
  63. package/lib/aptos/tests/aptos.test.d.ts +0 -1
  64. package/lib/aptos/tests/aptos.test.js.map +0 -1
  65. package/lib/aptos/tests/souffl3.d.ts +0 -1
  66. package/lib/aptos/tests/souffl3.js +0 -43
  67. package/lib/aptos/tests/souffl3.js.map +0 -1
  68. package/lib/aptos/tests/types/index.d.ts +0 -3
  69. package/lib/aptos/tests/types/index.js +0 -7
  70. package/lib/aptos/tests/types/index.js.map +0 -1
  71. package/lib/aptos/tests/types/reserved.d.ts +0 -340
  72. package/lib/aptos/tests/types/reserved.js +0 -287
  73. package/lib/aptos/tests/types/reserved.js.map +0 -1
  74. package/lib/aptos/tests/types/soffl3.d.ts +0 -801
  75. package/lib/aptos/tests/types/soffl3.js +0 -514
  76. package/lib/aptos/tests/types/soffl3.js.map +0 -1
  77. package/lib/aptos/tests/types/souffle.d.ts +0 -335
  78. package/lib/aptos/tests/types/souffle.js +0 -281
  79. package/lib/aptos/tests/types/souffle.js.map +0 -1
  80. package/lib/eth/error.d.ts +0 -1
  81. package/lib/eth/error.js +0 -3
  82. package/lib/eth/error.js.map +0 -1
  83. package/lib/eth/tests/account.test.d.ts +0 -1
  84. package/lib/eth/tests/account.test.js.map +0 -1
  85. package/lib/eth/tests/codegen.test.d.ts +0 -1
  86. package/lib/eth/tests/codegen.test.js.map +0 -1
  87. package/lib/eth/tests/erc20-template.test.d.ts +0 -1
  88. package/lib/eth/tests/erc20-template.test.js.map +0 -1
  89. package/lib/eth/tests/erc20.d.ts +0 -1
  90. package/lib/eth/tests/erc20.js +0 -52
  91. package/lib/eth/tests/erc20.js.map +0 -1
  92. package/lib/eth/tests/erc20.test.d.ts +0 -1
  93. package/lib/eth/tests/erc20.test.js.map +0 -1
  94. package/lib/eth/tests/error-capture.test.d.ts +0 -1
  95. package/lib/eth/tests/error-capture.test.js.map +0 -1
  96. package/lib/eth/tests/logger.test.d.ts +0 -1
  97. package/lib/eth/tests/logger.test.js.map +0 -1
  98. package/lib/eth/tests/types/anyswaprouter.d.ts +0 -3
  99. package/lib/eth/tests/types/anyswaprouter.js +0 -7
  100. package/lib/eth/tests/types/anyswaprouter.js.map +0 -1
  101. package/lib/eth/tests/types/commitmentpool.d.ts +0 -3
  102. package/lib/eth/tests/types/commitmentpool.js +0 -7
  103. package/lib/eth/tests/types/commitmentpool.js.map +0 -1
  104. package/lib/eth/tests/types/index.d.ts +0 -12
  105. package/lib/eth/tests/types/index.js +0 -16
  106. package/lib/eth/tests/types/index.js.map +0 -1
  107. package/lib/eth/tests/types/internal/AnyswapRouter.d.ts +0 -122
  108. package/lib/eth/tests/types/internal/AnyswapRouter.js +0 -2
  109. package/lib/eth/tests/types/internal/AnyswapRouter.js.map +0 -1
  110. package/lib/eth/tests/types/internal/CommitmentPool.d.ts +0 -176
  111. package/lib/eth/tests/types/internal/CommitmentPool.js +0 -2
  112. package/lib/eth/tests/types/internal/CommitmentPool.js.map +0 -1
  113. package/lib/eth/tests/types/internal/MembershipStakerV3.d.ts +0 -81
  114. package/lib/eth/tests/types/internal/MembershipStakerV3.js +0 -2
  115. package/lib/eth/tests/types/internal/MembershipStakerV3.js.map +0 -1
  116. package/lib/eth/tests/types/internal/Pyth.d.ts +0 -204
  117. package/lib/eth/tests/types/internal/Pyth.js +0 -2
  118. package/lib/eth/tests/types/internal/Pyth.js.map +0 -1
  119. package/lib/eth/tests/types/internal/Seaport.d.ts +0 -350
  120. package/lib/eth/tests/types/internal/Seaport.js +0 -2
  121. package/lib/eth/tests/types/internal/Seaport.js.map +0 -1
  122. package/lib/eth/tests/types/internal/TokenExchange.d.ts +0 -128
  123. package/lib/eth/tests/types/internal/TokenExchange.js +0 -2
  124. package/lib/eth/tests/types/internal/TokenExchange.js.map +0 -1
  125. package/lib/eth/tests/types/internal/anyswaprouter-processor.d.ts +0 -463
  126. package/lib/eth/tests/types/internal/anyswaprouter-processor.js +0 -425
  127. package/lib/eth/tests/types/internal/anyswaprouter-processor.js.map +0 -1
  128. package/lib/eth/tests/types/internal/anyswaprouter-test-utils.d.ts +0 -9
  129. package/lib/eth/tests/types/internal/anyswaprouter-test-utils.js +0 -124
  130. package/lib/eth/tests/types/internal/anyswaprouter-test-utils.js.map +0 -1
  131. package/lib/eth/tests/types/internal/commitmentpool-processor.d.ts +0 -348
  132. package/lib/eth/tests/types/internal/commitmentpool-processor.js +0 -607
  133. package/lib/eth/tests/types/internal/commitmentpool-processor.js.map +0 -1
  134. package/lib/eth/tests/types/internal/commitmentpool-test-utils.d.ts +0 -9
  135. package/lib/eth/tests/types/internal/commitmentpool-test-utils.js +0 -87
  136. package/lib/eth/tests/types/internal/commitmentpool-test-utils.js.map +0 -1
  137. package/lib/eth/tests/types/internal/common.d.ts +0 -10
  138. package/lib/eth/tests/types/internal/common.js +0 -8
  139. package/lib/eth/tests/types/internal/common.js.map +0 -1
  140. package/lib/eth/tests/types/internal/factories/AnyswapRouter__factory.d.ts +0 -988
  141. package/lib/eth/tests/types/internal/factories/AnyswapRouter__factory.js +0 -1269
  142. package/lib/eth/tests/types/internal/factories/AnyswapRouter__factory.js.map +0 -1
  143. package/lib/eth/tests/types/internal/factories/CommitmentPool__factory.d.ts +0 -792
  144. package/lib/eth/tests/types/internal/factories/CommitmentPool__factory.js +0 -1040
  145. package/lib/eth/tests/types/internal/factories/CommitmentPool__factory.js.map +0 -1
  146. package/lib/eth/tests/types/internal/factories/MembershipStakerV3__factory.d.ts +0 -549
  147. package/lib/eth/tests/types/internal/factories/MembershipStakerV3__factory.js +0 -721
  148. package/lib/eth/tests/types/internal/factories/MembershipStakerV3__factory.js.map +0 -1
  149. package/lib/eth/tests/types/internal/factories/Pyth__factory.d.ts +0 -1130
  150. package/lib/eth/tests/types/internal/factories/Pyth__factory.js +0 -1486
  151. package/lib/eth/tests/types/internal/factories/Pyth__factory.js.map +0 -1
  152. package/lib/eth/tests/types/internal/factories/Seaport__factory.d.ts +0 -2018
  153. package/lib/eth/tests/types/internal/factories/Seaport__factory.js +0 -2610
  154. package/lib/eth/tests/types/internal/factories/Seaport__factory.js.map +0 -1
  155. package/lib/eth/tests/types/internal/factories/TokenExchange__factory.d.ts +0 -651
  156. package/lib/eth/tests/types/internal/factories/TokenExchange__factory.js +0 -853
  157. package/lib/eth/tests/types/internal/factories/TokenExchange__factory.js.map +0 -1
  158. package/lib/eth/tests/types/internal/factories/index.d.ts +0 -6
  159. package/lib/eth/tests/types/internal/factories/index.js +0 -10
  160. package/lib/eth/tests/types/internal/factories/index.js.map +0 -1
  161. package/lib/eth/tests/types/internal/index.d.ts +0 -13
  162. package/lib/eth/tests/types/internal/index.js +0 -8
  163. package/lib/eth/tests/types/internal/index.js.map +0 -1
  164. package/lib/eth/tests/types/internal/membershipstakerv3-processor.d.ts +0 -287
  165. package/lib/eth/tests/types/internal/membershipstakerv3-processor.js +0 -596
  166. package/lib/eth/tests/types/internal/membershipstakerv3-processor.js.map +0 -1
  167. package/lib/eth/tests/types/internal/membershipstakerv3-test-utils.d.ts +0 -11
  168. package/lib/eth/tests/types/internal/membershipstakerv3-test-utils.js +0 -109
  169. package/lib/eth/tests/types/internal/membershipstakerv3-test-utils.js.map +0 -1
  170. package/lib/eth/tests/types/internal/pyth-processor.d.ts +0 -422
  171. package/lib/eth/tests/types/internal/pyth-processor.js +0 -890
  172. package/lib/eth/tests/types/internal/pyth-processor.js.map +0 -1
  173. package/lib/eth/tests/types/internal/pyth-test-utils.d.ts +0 -13
  174. package/lib/eth/tests/types/internal/pyth-test-utils.js +0 -131
  175. package/lib/eth/tests/types/internal/pyth-test-utils.js.map +0 -1
  176. package/lib/eth/tests/types/internal/seaport-processor.d.ts +0 -211
  177. package/lib/eth/tests/types/internal/seaport-processor.js +0 -237
  178. package/lib/eth/tests/types/internal/seaport-processor.js.map +0 -1
  179. package/lib/eth/tests/types/internal/seaport-test-utils.d.ts +0 -6
  180. package/lib/eth/tests/types/internal/seaport-test-utils.js +0 -61
  181. package/lib/eth/tests/types/internal/seaport-test-utils.js.map +0 -1
  182. package/lib/eth/tests/types/internal/tokenexchange-processor.d.ts +0 -334
  183. package/lib/eth/tests/types/internal/tokenexchange-processor.js +0 -667
  184. package/lib/eth/tests/types/internal/tokenexchange-processor.js.map +0 -1
  185. package/lib/eth/tests/types/internal/tokenexchange-test-utils.d.ts +0 -13
  186. package/lib/eth/tests/types/internal/tokenexchange-test-utils.js +0 -149
  187. package/lib/eth/tests/types/internal/tokenexchange-test-utils.js.map +0 -1
  188. package/lib/eth/tests/types/membershipstakerv3.d.ts +0 -3
  189. package/lib/eth/tests/types/membershipstakerv3.js +0 -7
  190. package/lib/eth/tests/types/membershipstakerv3.js.map +0 -1
  191. package/lib/eth/tests/types/pyth.d.ts +0 -3
  192. package/lib/eth/tests/types/pyth.js +0 -7
  193. package/lib/eth/tests/types/pyth.js.map +0 -1
  194. package/lib/eth/tests/types/seaport.d.ts +0 -3
  195. package/lib/eth/tests/types/seaport.js +0 -7
  196. package/lib/eth/tests/types/seaport.js.map +0 -1
  197. package/lib/eth/tests/types/tokenexchange.d.ts +0 -3
  198. package/lib/eth/tests/types/tokenexchange.js +0 -7
  199. package/lib/eth/tests/types/tokenexchange.js.map +0 -1
  200. package/lib/move/neutral-models.d.ts +0 -34
  201. package/lib/move/neutral-models.js +0 -7
  202. package/lib/move/neutral-models.js.map +0 -1
  203. package/lib/solana/tests/solana.test.d.ts +0 -1
  204. package/lib/solana/tests/solana.test.js.map +0 -1
  205. package/lib/solana/tests/types/basic_1.d.ts +0 -26
  206. package/lib/solana/tests/types/basic_1.js +0 -63
  207. package/lib/solana/tests/types/basic_1.js.map +0 -1
  208. package/lib/solana/tests/types/basic_1_processor.d.ts +0 -21
  209. package/lib/solana/tests/types/basic_1_processor.js +0 -35
  210. package/lib/solana/tests/types/basic_1_processor.js.map +0 -1
  211. package/lib/solana/tests/types/token_bridge.d.ts +0 -29
  212. package/lib/solana/tests/types/token_bridge.js +0 -938
  213. package/lib/solana/tests/types/token_bridge.js.map +0 -1
  214. package/lib/solana/tests/types/token_bridge_processor.d.ts +0 -212
  215. package/lib/solana/tests/types/token_bridge_processor.js +0 -134
  216. package/lib/solana/tests/types/token_bridge_processor.js.map +0 -1
  217. package/lib/solana/tests/wormhole-token-bridge.d.ts +0 -15
  218. package/lib/solana/tests/wormhole-token-bridge.js +0 -79
  219. package/lib/solana/tests/wormhole-token-bridge.js.map +0 -1
  220. package/lib/sui/tests/sui.test.d.ts +0 -1
  221. package/lib/sui/tests/sui.test.js.map +0 -1
  222. package/lib/sui/tests/types/index.d.ts +0 -1
  223. package/lib/sui/tests/types/index.js +0 -5
  224. package/lib/sui/tests/types/index.js.map +0 -1
  225. package/lib/sui/tests/types/testnet/index.d.ts +0 -1
  226. package/lib/sui/tests/types/testnet/index.js +0 -5
  227. package/lib/sui/tests/types/testnet/index.js.map +0 -1
  228. package/lib/sui/tests/types/testnet/swap.d.ts +0 -249
  229. package/lib/sui/tests/types/testnet/swap.js +0 -310
  230. package/lib/sui/tests/types/testnet/swap.js.map +0 -1
  231. package/src/aptos/tests/abis/reserved.json +0 -402
  232. package/src/aptos/tests/abis/soffl3.json +0 -1411
  233. package/src/aptos/tests/abis/souffle.json +0 -389
  234. package/src/aptos/tests/souffl3.ts +0 -56
  235. package/src/aptos/tests/types/index.ts +0 -6
  236. package/src/aptos/tests/types/reserved.ts +0 -766
  237. package/src/aptos/tests/types/soffl3.ts +0 -1528
  238. package/src/aptos/tests/types/souffle.ts +0 -765
  239. package/src/eth/error.ts +0 -4
  240. package/src/eth/tests/abis/eth/CommitmentPool.json +0 -1034
  241. package/src/eth/tests/abis/eth/MembershipStakerV3.json +0 -706
  242. package/src/eth/tests/abis/eth/Pyth.json +0 -1471
  243. package/src/eth/tests/abis/eth/Seaport.json +0 -2595
  244. package/src/eth/tests/abis/eth/TokenExchange.json +0 -838
  245. package/src/eth/tests/abis/eth/anyswapRouter.json +0 -490
  246. package/src/eth/tests/erc20.ts +0 -63
  247. package/src/eth/tests/types/anyswaprouter.ts +0 -7
  248. package/src/eth/tests/types/commitmentpool.ts +0 -7
  249. package/src/eth/tests/types/index.ts +0 -33
  250. package/src/eth/tests/types/internal/AnyswapRouter.ts +0 -122
  251. package/src/eth/tests/types/internal/CommitmentPool.ts +0 -208
  252. package/src/eth/tests/types/internal/MembershipStakerV3.ts +0 -108
  253. package/src/eth/tests/types/internal/Pyth.ts +0 -246
  254. package/src/eth/tests/types/internal/Seaport.ts +0 -389
  255. package/src/eth/tests/types/internal/TokenExchange.ts +0 -142
  256. package/src/eth/tests/types/internal/anyswaprouter-processor.ts +0 -1396
  257. package/src/eth/tests/types/internal/anyswaprouter-test-utils.ts +0 -187
  258. package/src/eth/tests/types/internal/commitmentpool-processor.ts +0 -1575
  259. package/src/eth/tests/types/internal/commitmentpool-test-utils.ts +0 -150
  260. package/src/eth/tests/types/internal/common.ts +0 -23
  261. package/src/eth/tests/types/internal/factories/AnyswapRouter__factory.ts +0 -1278
  262. package/src/eth/tests/types/internal/factories/CommitmentPool__factory.ts +0 -1049
  263. package/src/eth/tests/types/internal/factories/MembershipStakerV3__factory.ts +0 -730
  264. package/src/eth/tests/types/internal/factories/Pyth__factory.ts +0 -1492
  265. package/src/eth/tests/types/internal/factories/Seaport__factory.ts +0 -2616
  266. package/src/eth/tests/types/internal/factories/TokenExchange__factory.ts +0 -862
  267. package/src/eth/tests/types/internal/factories/index.ts +0 -9
  268. package/src/eth/tests/types/internal/index.ts +0 -16
  269. package/src/eth/tests/types/internal/membershipstakerv3-processor.ts +0 -1399
  270. package/src/eth/tests/types/internal/membershipstakerv3-test-utils.ts +0 -188
  271. package/src/eth/tests/types/internal/pyth-processor.ts +0 -2043
  272. package/src/eth/tests/types/internal/pyth-test-utils.ts +0 -226
  273. package/src/eth/tests/types/internal/seaport-processor.ts +0 -678
  274. package/src/eth/tests/types/internal/seaport-test-utils.ts +0 -100
  275. package/src/eth/tests/types/internal/tokenexchange-processor.ts +0 -1570
  276. package/src/eth/tests/types/internal/tokenexchange-test-utils.ts +0 -244
  277. package/src/eth/tests/types/membershipstakerv3.ts +0 -7
  278. package/src/eth/tests/types/pyth.ts +0 -7
  279. package/src/eth/tests/types/seaport.ts +0 -7
  280. package/src/eth/tests/types/tokenexchange.ts +0 -7
  281. package/src/move/neutral-models.ts +0 -45
  282. package/src/solana/tests/abis/basic_1.json +0 -62
  283. package/src/solana/tests/abis/token_bridge.json +0 -937
  284. package/src/solana/tests/types/basic_1.ts +0 -62
  285. package/src/solana/tests/types/basic_1_processor.ts +0 -42
  286. package/src/solana/tests/types/token_bridge.ts +0 -937
  287. package/src/solana/tests/types/token_bridge_processor.ts +0 -150
  288. package/src/solana/tests/wormhole-token-bridge.ts +0 -96
  289. package/src/sui/tests/abis/testnet/swap.json +0 -1752
  290. package/src/sui/tests/types/index.ts +0 -3
  291. package/src/sui/tests/types/testnet/index.ts +0 -4
  292. package/src/sui/tests/types/testnet/swap.ts +0 -698
@@ -1,4 +1,4 @@
1
- import { NeutralMoveFunction, NeutralMoveModule, NeutralMoveStruct } from './neutral-models.js'
1
+ import { InternalMoveFunction, InternalMoveModule, InternalMoveStruct } from './internal-models.js'
2
2
  import path from 'path'
3
3
  import fs from 'fs'
4
4
  import { AccountModulesImportInfo, AccountRegister } from './account.js'
@@ -6,7 +6,7 @@ import chalk from 'chalk'
6
6
  import { format } from 'prettier'
7
7
  import { isFrameworkAccount, moduleQname, normalizeToJSName, SPLITTER } from './utils.js'
8
8
  import { generateTypeForDescriptor } from './ts-type.js'
9
- import { camelCase } from 'lodash-es'
9
+ import { camelCase, upperFirst } from 'lodash-es'
10
10
  import { TypeDescriptor } from './types.js'
11
11
 
12
12
  interface OutputFile {
@@ -28,9 +28,11 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
28
28
  STRUCT_FIELD_NAME: string = 'data'
29
29
 
30
30
  abstract fetchModules(account: string, network: NetworkType): Promise<ModuleTypes>
31
- abstract toNeutral(modules: ModuleTypes): NeutralMoveModule[]
32
- abstract getEventStructs(module: NeutralMoveModule): Map<string, NeutralMoveStruct>
33
-
31
+ abstract toInternalModules(modules: ModuleTypes): InternalMoveModule[]
32
+ // Get the structs that represent Events
33
+ abstract getEventStructs(module: InternalMoveModule): Map<string, InternalMoveStruct>
34
+ // Get the parameters that actually have arguments in runtime
35
+ // Aptos first signer and Sui's last TxContext are no use
34
36
  abstract getMeaningfulFunctionParams(params: TypeDescriptor[]): TypeDescriptor[]
35
37
 
36
38
  readModulesFile(fullPath: string) {
@@ -69,7 +71,7 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
69
71
  }
70
72
  const fullPath = path.resolve(srcDir, file)
71
73
  const abi = this.readModulesFile(fullPath)
72
- const modules = this.toNeutral(abi)
74
+ const modules = this.toInternalModules(abi)
73
75
 
74
76
  for (const module of modules) {
75
77
  loader.register(module, path.basename(file, '.json'))
@@ -89,7 +91,7 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
89
91
 
90
92
  try {
91
93
  const rawModules = await this.fetchModules(account, network)
92
- const modules = this.toNeutral(rawModules)
94
+ const modules = this.toInternalModules(rawModules)
93
95
 
94
96
  fs.writeFileSync(path.resolve(srcDir, account + '.json'), JSON.stringify(rawModules, null, '\t'))
95
97
 
@@ -143,8 +145,8 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
143
145
  return 'MAIN_NET'
144
146
  }
145
147
 
146
- generateModule(module: NeutralMoveModule, network: NetworkType) {
147
- const functions = module.exposed_functions
148
+ generateModule(module: InternalMoveModule, network: NetworkType) {
149
+ const functions = module.exposedFunctions
148
150
  .map((f) => this.generateOnEntryFunctions(module, f))
149
151
  .filter((s) => s !== '')
150
152
 
@@ -154,7 +156,7 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
154
156
  .map((e) => this.generateOnEvents(module, e))
155
157
  .filter((s) => s !== '')
156
158
  const structs = module.structs.map((s) => this.generateStructs(module, s, eventTypes))
157
- const callArgs = module.exposed_functions.map((f) => this.generateCallArgsStructs(module, f))
159
+ const callArgs = module.exposedFunctions.map((f) => this.generateCallArgsStructs(module, f))
158
160
 
159
161
  const moduleName = normalizeToJSName(module.name)
160
162
  let processor = ''
@@ -166,15 +168,15 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
166
168
  }
167
169
  static DEFAULT_OPTIONS: ${this.PREFIX}BindOptions = {
168
170
  address: "${module.address}",
169
- network: ${this.PREFIX}Network.${this.generateNetworkOption(network)}
171
+ network: ${this.PREFIX}Network.${this.generateNetworkOption(network)}
170
172
  }
171
173
 
172
174
  static bind(options: Partial<${this.PREFIX}BindOptions> = {}): ${moduleName} {
173
175
  return new ${moduleName}({ ...${moduleName}.DEFAULT_OPTIONS, ...options })
174
176
  }
175
-
177
+
176
178
  ${functions.join('\n')}
177
-
179
+
178
180
  ${events.join('\n')}
179
181
  }
180
182
  `
@@ -185,13 +187,13 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
185
187
 
186
188
  export namespace ${moduleName} {
187
189
  ${structs.join('\n')}
188
-
190
+
189
191
  ${callArgs.join('\n')}
190
192
  }
191
193
  `
192
194
  }
193
195
 
194
- generateStructs(module: NeutralMoveModule, struct: NeutralMoveStruct, events: Set<string>) {
196
+ generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>) {
195
197
  const genericString = this.generateStructTypeParameters(struct)
196
198
  const genericStringAny = this.generateStructTypeParameters(struct, true)
197
199
 
@@ -205,10 +207,10 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
205
207
  let eventPayload = ''
206
208
  if (events.has(moduleQname(module) + SPLITTER + struct.name)) {
207
209
  eventPayload = `
208
- export interface ${structName}Instance extends
210
+ export interface ${structName}Instance extends
209
211
  TypedEventInstance<${structName}${genericStringAny}> {
210
212
  ${this.STRUCT_FIELD_NAME}_decoded: ${structName}${genericStringAny}
211
- type_arguments: [${struct.generic_type_params.map((_) => 'string').join(', ')}]
213
+ type_arguments: [${struct.typeParams.map((_) => 'string').join(', ')}]
212
214
  }
213
215
  `
214
216
  }
@@ -216,17 +218,17 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
216
218
  return `
217
219
  export class ${structName}${genericString} {
218
220
  static TYPE_QNAME = '${module.address}::${module.name}::${struct.name}'
219
- ${fields.join('\n')}
221
+ ${fields.join('\n')}
220
222
  }
221
-
223
+
222
224
  ${eventPayload}
223
225
  `
224
226
  }
225
227
 
226
- generateFunctionTypeParameters(func: NeutralMoveFunction) {
228
+ generateFunctionTypeParameters(func: InternalMoveFunction) {
227
229
  let genericString = ''
228
- if (func.generic_type_params && func.generic_type_params.length > 0) {
229
- const params = func.generic_type_params
230
+ if (func.typeParams && func.typeParams.length > 0) {
231
+ const params = func.typeParams
230
232
  .map((v, idx) => {
231
233
  return `T${idx}=any`
232
234
  })
@@ -236,11 +238,11 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
236
238
  return genericString
237
239
  }
238
240
 
239
- generateStructTypeParameters(struct: NeutralMoveStruct, useAny = false) {
241
+ generateStructTypeParameters(struct: InternalMoveStruct, useAny = false) {
240
242
  let genericString = ''
241
243
 
242
- if (struct.generic_type_params && struct.generic_type_params.length > 0) {
243
- const params = struct.generic_type_params
244
+ if (struct.typeParams && struct.typeParams.length > 0) {
245
+ const params = struct.typeParams
244
246
  .map((v, idx) => {
245
247
  return useAny ? 'any' : 'T' + idx
246
248
  })
@@ -250,8 +252,8 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
250
252
  return genericString
251
253
  }
252
254
 
253
- generateCallArgsStructs(module: NeutralMoveModule, func: NeutralMoveFunction) {
254
- if (!func.is_entry) {
255
+ generateCallArgsStructs(module: InternalMoveModule, func: InternalMoveFunction) {
256
+ if (!func.isEntry) {
255
257
  return
256
258
  }
257
259
 
@@ -259,27 +261,27 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
259
261
  return generateTypeForDescriptor(param, module.address, this.ADDRESS_TYPE)
260
262
  })
261
263
 
262
- const camelFuncName = capitalizeFirstChar(camelCase(func.name))
264
+ const camelFuncName = upperFirst(camelCase(func.name))
263
265
 
264
266
  const genericString = this.generateFunctionTypeParameters(func)
265
267
  return `
266
268
  export interface ${camelFuncName}Payload${genericString}
267
269
  extends TypedEntryFunctionPayload<[${fields.join(',')}]> {
268
270
  arguments_decoded: [${fields.join(',')}],
269
- type_arguments: [${func.generic_type_params.map((_) => 'string').join(', ')}]
271
+ type_arguments: [${func.typeParams.map((_) => 'string').join(', ')}]
270
272
  }
271
273
  `
272
274
  }
273
275
 
274
- generateOnEntryFunctions(module: NeutralMoveModule, func: NeutralMoveFunction) {
275
- if (!func.is_entry) {
276
+ generateOnEntryFunctions(module: InternalMoveModule, func: InternalMoveFunction) {
277
+ if (!func.isEntry) {
276
278
  return ''
277
279
  }
278
280
 
279
281
  // const genericString = generateFunctionTypeParameters(func)
280
282
  const moduleName = normalizeToJSName(module.name)
281
283
 
282
- const camelFuncName = capitalizeFirstChar(camelCase(func.name))
284
+ const camelFuncName = upperFirst(camelCase(func.name))
283
285
  const source = `
284
286
  onEntry${camelFuncName}(func: (call: ${moduleName}.${camelFuncName}Payload, ctx: ${this.PREFIX}Context) => void, filter?: CallFilter, fetchConfig?: MoveFetchConfig): ${moduleName} {
285
287
  this.onEntryFunctionCall(func, {
@@ -293,7 +295,7 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
293
295
  return source
294
296
  }
295
297
 
296
- generateOnEvents(module: NeutralMoveModule, struct: NeutralMoveStruct): string {
298
+ generateOnEvents(module: InternalMoveModule, struct: InternalMoveStruct): string {
297
299
  // for struct that has drop + store
298
300
  // if (!isEvent(struct, module)) {
299
301
  // return ''
@@ -318,7 +320,7 @@ export abstract class AbstractCodegen<ModuleTypes, NetworkType> {
318
320
  }
319
321
 
320
322
  export class AccountCodegen<ModuleType, NetworkType> {
321
- modules: NeutralMoveModule[]
323
+ modules: InternalMoveModule[]
322
324
  config: Config<NetworkType>
323
325
  abi: ModuleType
324
326
  loader: AccountRegister
@@ -328,7 +330,7 @@ export class AccountCodegen<ModuleType, NetworkType> {
328
330
  moduleGen: AbstractCodegen<ModuleType, NetworkType>,
329
331
  loader: AccountRegister,
330
332
  abi: ModuleType,
331
- modules: NeutralMoveModule[],
333
+ modules: InternalMoveModule[],
332
334
  config: Config<NetworkType>
333
335
  ) {
334
336
  // const json = fs.readFileSync(config.srcFile, 'utf-8')
@@ -355,8 +357,8 @@ export class AccountCodegen<ModuleType, NetworkType> {
355
357
 
356
358
  const imports = `
357
359
  import { CallFilter } from "@sentio/sdk/move"
358
- import {
359
- MoveCoder, defaultMoveCoder, ${this.moduleGen.PREFIX}BindOptions, ${this.moduleGen.PREFIX}BaseProcessor,
360
+ import {
361
+ MoveCoder, defaultMoveCoder, ${this.moduleGen.PREFIX}BindOptions, ${this.moduleGen.PREFIX}BaseProcessor,
360
362
  TypedEventInstance, ${this.moduleGen.PREFIX}Network, TypedEntryFunctionPayload,
361
363
  ${this.moduleGen.PREFIX}Context } from "@sentio/sdk/${this.moduleGen.PREFIX.toLowerCase()}"
362
364
  import { MoveFetchConfig } from "@sentio/protos"
@@ -388,15 +390,15 @@ export class AccountCodegen<ModuleType, NetworkType> {
388
390
  /* Autogenerated file. Do not edit manually. */
389
391
  /* tslint:disable */
390
392
  /* eslint-disable */
391
-
393
+
392
394
  /* Generated modules for account ${address} */
393
-
395
+
394
396
  ${imports}
395
-
397
+
396
398
  ${moduleImports.join('\n')}
397
-
399
+
398
400
  ${this.modules.map((m) => this.moduleGen.generateModule(m, this.config.network)).join('\n')}
399
-
401
+
400
402
  const MODULES = JSON.parse('${JSON.stringify(this.abi)}')
401
403
 
402
404
  export function loadAllTypes(coder: MoveCoder) {
@@ -405,7 +407,7 @@ export class AccountCodegen<ModuleType, NetworkType> {
405
407
  coder.load(m as any)
406
408
  }
407
409
  }
408
-
410
+
409
411
  loadAllTypes(defaultMoveCoder())
410
412
  ` // source
411
413
 
@@ -417,10 +419,3 @@ export class AccountCodegen<ModuleType, NetworkType> {
417
419
  ]
418
420
  }
419
421
  }
420
-
421
- function capitalizeFirstChar(input: string): string {
422
- if (!input) {
423
- return input
424
- }
425
- return input[0].toUpperCase() + (input.length > 1 ? input.substring(1) : '')
426
- }
@@ -1,6 +1,6 @@
1
1
  import { moduleQname, SPLITTER, VECTOR_STR } from './utils.js'
2
2
  import { parseMoveType, TypeDescriptor } from './types.js'
3
- import { NeutralMoveFunction, NeutralMoveModule, NeutralMoveStruct } from './neutral-models.js'
3
+ import { InternalMoveFunction, InternalMoveModule, InternalMoveStruct } from './internal-models.js'
4
4
  import { bytesToBigInt } from '../utils/index.js'
5
5
 
6
6
  type StructWithTag<Base> = Base & {
@@ -14,15 +14,15 @@ type DecodedStructWithTag<B, T> = StructWithTag<B> & {
14
14
  }
15
15
 
16
16
  export abstract class AbstractMoveCoder<StructType> {
17
- private moduleMapping = new Map<string, NeutralMoveModule>()
18
- private typeMapping = new Map<string, NeutralMoveStruct>()
19
- private funcMapping = new Map<string, NeutralMoveFunction>()
17
+ private moduleMapping = new Map<string, InternalMoveModule>()
18
+ private typeMapping = new Map<string, InternalMoveStruct>()
19
+ private funcMapping = new Map<string, InternalMoveFunction>()
20
20
 
21
21
  contains(account: string, name: string) {
22
22
  return this.moduleMapping.has(account + '::' + name)
23
23
  }
24
24
 
25
- loadNeutral(module: NeutralMoveModule) {
25
+ loadInternal(module: InternalMoveModule) {
26
26
  if (this.contains(module.address, module.name)) {
27
27
  return
28
28
  }
@@ -34,8 +34,8 @@ export abstract class AbstractMoveCoder<StructType> {
34
34
  this.typeMapping.set(key, struct)
35
35
  }
36
36
 
37
- for (const func of module.exposed_functions) {
38
- if (!func.is_entry) {
37
+ for (const func of module.exposedFunctions) {
38
+ if (!func.isEntry) {
39
39
  continue
40
40
  }
41
41
  const key = [module.address, module.name, func.name].join(SPLITTER)
@@ -53,7 +53,7 @@ export abstract class AbstractMoveCoder<StructType> {
53
53
  }
54
54
  }
55
55
 
56
- protected getMoveStruct(type: string): NeutralMoveStruct {
56
+ protected getMoveStruct(type: string): InternalMoveStruct {
57
57
  const struct = this.typeMapping.get(type)
58
58
  if (!struct) {
59
59
  throw new Error('Failed to load type' + type + ' type are not imported anywhere')
@@ -61,7 +61,7 @@ export abstract class AbstractMoveCoder<StructType> {
61
61
  return struct
62
62
  }
63
63
 
64
- protected getMoveFunction(type: string): NeutralMoveFunction {
64
+ protected getMoveFunction(type: string): InternalMoveFunction {
65
65
  const func = this.funcMapping.get(type)
66
66
  if (!func) {
67
67
  throw new Error('Failed to load function' + type + ' type are not imported anywhere')
@@ -1,6 +1,5 @@
1
- import { parseMoveType, TypeDescriptor } from './types.js'
2
1
  import { moduleQname, moduleQnameForType } from './utils.js'
3
- import { NeutralMoveModule } from './neutral-models.js'
2
+ import { InternalMoveModule } from './internal-models.js'
4
3
 
5
4
  export class AccountModulesImportInfo {
6
5
  // account to module
@@ -31,21 +30,7 @@ export class AccountRegister {
31
30
  accountImports = new Map<string, AccountModulesImportInfo>()
32
31
  pendingAccounts = new Set<string>()
33
32
 
34
- // loadedAccount = new Set<string>()
35
- typeDescriptors = new Map<string, TypeDescriptor>()
36
-
37
- protected loadTypeDescriptor(type: string) {
38
- let descriptor = this.typeDescriptors.get(type)
39
-
40
- // const descriptparseMoveType(type)
41
- if (!descriptor) {
42
- descriptor = parseMoveType(type)
43
- this.typeDescriptors.set(type, descriptor)
44
- }
45
- return descriptor
46
- }
47
-
48
- register(module: NeutralMoveModule, tsModuleName: string): AccountModulesImportInfo {
33
+ register(module: InternalMoveModule, tsModuleName: string): AccountModulesImportInfo {
49
34
  const currentModuleFqn = moduleQname(module)
50
35
 
51
36
  let accountModuleImports = this.accountImports.get(module.address)
@@ -63,9 +48,9 @@ export class AccountRegister {
63
48
  return accountModuleImports
64
49
  }
65
50
 
66
- registerFunctions(module: NeutralMoveModule, accountModuleImports: AccountModulesImportInfo): void {
67
- for (const func of module.exposed_functions) {
68
- if (!func.is_entry) {
51
+ private registerFunctions(module: InternalMoveModule, accountModuleImports: AccountModulesImportInfo): void {
52
+ for (const func of module.exposedFunctions) {
53
+ if (!func.isEntry) {
69
54
  continue
70
55
  }
71
56
  for (const param of func.params) {
@@ -80,7 +65,7 @@ export class AccountRegister {
80
65
  }
81
66
  }
82
67
 
83
- registerStruct(module: NeutralMoveModule, accountModuleImports: AccountModulesImportInfo): void {
68
+ private registerStruct(module: InternalMoveModule, accountModuleImports: AccountModulesImportInfo): void {
84
69
  for (const struct of module.structs) {
85
70
  for (const field of struct.fields) {
86
71
  for (const type of field.type.dependedTypes()) {
@@ -0,0 +1,40 @@
1
+ import { TypeDescriptor } from './types.js'
2
+
3
+ export interface InternalMoveModule {
4
+ address: string
5
+ name: string
6
+ exposedFunctions: InternalMoveFunction[]
7
+ structs: InternalMoveStruct[]
8
+ }
9
+
10
+ export interface InternalMoveFunction {
11
+ name: string
12
+ visibility: InternalMoveFunctionVisibility
13
+ isEntry: boolean
14
+ typeParams: InternalMoveTypeParam[]
15
+ params: TypeDescriptor[]
16
+ return: TypeDescriptor[]
17
+ }
18
+
19
+ export interface InternalMoveStruct {
20
+ name: string
21
+ isNative: boolean
22
+ abilities: string[]
23
+ typeParams: InternalMoveTypeParam[]
24
+ fields: InternalMoveStructField[]
25
+ }
26
+
27
+ export interface InternalMoveStructField {
28
+ name: string
29
+ type: TypeDescriptor
30
+ }
31
+
32
+ export enum InternalMoveFunctionVisibility {
33
+ PRIVATE = 'private',
34
+ PUBLIC = 'public',
35
+ FRIEND = 'friend',
36
+ }
37
+
38
+ export type InternalMoveTypeParam = {
39
+ constraints: string[]
40
+ }
@@ -2,10 +2,8 @@ import { TypeDescriptor } from './types.js'
2
2
  import { normalizeToJSName, SPLITTER, VECTOR_STR } from './utils.js'
3
3
 
4
4
  export function generateTypeForDescriptor(type: TypeDescriptor, currentAddress: string, addressType: string): string {
5
- // TODO &signer is defintely an address, but what if &OTHER_TYPE?
6
5
  if (type.qname.startsWith('&')) {
7
- console.error('Unexpected &')
8
- return addressType
6
+ throw Error('Unexpected &')
9
7
  }
10
8
  if (type.reference) {
11
9
  return addressType
package/src/move/types.ts CHANGED
@@ -1,20 +1,15 @@
1
1
  import { SPLITTER, VECTOR_STR } from './utils.js'
2
2
 
3
3
  export class TypeDescriptor {
4
- // type: string
5
-
6
- // TODO add reference flag
7
-
8
- // qualified name without type parameters
9
4
  qname: string
10
5
  reference: boolean
11
- // account?: string
12
- // module?: string
13
-
6
+ mutable: boolean
14
7
  typeArgs: TypeDescriptor[]
15
8
 
16
9
  constructor(symbol: string, typeParams?: TypeDescriptor[]) {
17
10
  this.qname = symbol
11
+ this.reference = false
12
+ this.mutable = false
18
13
  this.typeArgs = typeParams || []
19
14
  }
20
15
 
@@ -97,20 +92,15 @@ export class TypeDescriptor {
97
92
  }
98
93
 
99
94
  export function parseMoveType(type: string): TypeDescriptor {
100
- // type = type.replace('&', '')
101
-
102
- type = type.replaceAll('&mut ', '&')
103
- type = type.replaceAll('mut ', '')
104
-
105
- // TODO replace ' ' is not exactly safe, need to double check this
106
- type = type.replaceAll(' ', '')
107
-
108
95
  const stack: TypeDescriptor[] = [new TypeDescriptor('')]
109
96
  let buffer = []
110
97
 
111
98
  // xxx:asdf<g1<a,<c,d>>, b, g2<a,b>, e>
112
99
  for (let i = 0; i < type.length; i++) {
113
100
  const ch = type[i]
101
+ if (ch === ' ') {
102
+ continue
103
+ }
114
104
  if (ch === '<') {
115
105
  // const symbol = type.slice(symbolStart, i)
116
106
  // symbolStart =
@@ -121,7 +111,7 @@ export function parseMoveType(type: string): TypeDescriptor {
121
111
  stack.push(new TypeDescriptor(''))
122
112
  continue
123
113
  }
124
- if (ch === '>') {
114
+ if (ch === '>' || ch === ',') {
125
115
  const typeParam = stack.pop()
126
116
  if (!typeParam) {
127
117
  throw Error('Unexpected stack size')
@@ -132,25 +122,11 @@ export function parseMoveType(type: string): TypeDescriptor {
132
122
  }
133
123
  adjustType(typeParam)
134
124
  stack[stack.length - 1].typeArgs.push(typeParam)
135
- continue
136
- }
137
- if (ch === ',') {
138
- const typeParam = stack.pop()
139
- if (!typeParam) {
140
- throw Error('Unexpected stack size')
141
- }
142
- if (buffer.length > 0) {
143
- typeParam.qname = buffer.join('')
144
- buffer = []
125
+ if (ch === ',') {
126
+ stack.push(new TypeDescriptor(''))
145
127
  }
146
- adjustType(typeParam)
147
-
148
- stack[stack.length - 1].typeArgs.push(typeParam)
149
- // continue parse next param
150
- stack.push(new TypeDescriptor(''))
151
128
  continue
152
129
  }
153
-
154
130
  buffer.push(ch)
155
131
  }
156
132
 
@@ -171,4 +147,8 @@ function adjustType(type: TypeDescriptor) {
171
147
  type.reference = true
172
148
  type.qname = type.qname.slice(1)
173
149
  }
150
+ if (type.qname.startsWith('mut')) {
151
+ type.mutable = true
152
+ type.qname = type.qname.slice(3)
153
+ }
174
154
  }
@@ -1,10 +1,10 @@
1
1
  import { SuiNetwork } from '../network.js'
2
2
  import * as fs from 'fs'
3
3
  import chalk from 'chalk'
4
- import { NeutralMoveModule, NeutralMoveStruct } from '../../move/neutral-models.js'
4
+ import { InternalMoveModule, InternalMoveStruct } from '../../move/internal-models.js'
5
5
  import { AbstractCodegen } from '../../move/abstract-codegen.js'
6
6
  import { JsonRpcProvider, SuiMoveNormalizedModules } from '@mysten/sui.js'
7
- import { toNeutralModule } from '../move-types.js'
7
+ import { toInternalModule } from '../move-types.js'
8
8
  import { moduleQname, SPLITTER, TypeDescriptor } from '../../move/index.js'
9
9
 
10
10
  export async function codegen(abisDir: string, outDir = 'src/types/sui') {
@@ -12,7 +12,7 @@ export async function codegen(abisDir: string, outDir = 'src/types/sui') {
12
12
  return
13
13
  }
14
14
  console.log(chalk.green('Generated Types for Sui'))
15
- const gen = new SuiCodeGen()
15
+ const gen = new SuiCodegen()
16
16
  await gen.generate(abisDir, outDir)
17
17
  }
18
18
 
@@ -28,7 +28,7 @@ function getRpcClient(network: SuiNetwork): JsonRpcProvider {
28
28
  return new JsonRpcProvider(getRpcEndpoint(network))
29
29
  }
30
30
 
31
- class SuiCodeGen extends AbstractCodegen<SuiMoveNormalizedModules, SuiNetwork> {
31
+ class SuiCodegen extends AbstractCodegen<SuiMoveNormalizedModules, SuiNetwork> {
32
32
  ADDRESS_TYPE = 'SuiAddress'
33
33
  MAIN_NET = SuiNetwork.MAIN_NET
34
34
  TEST_NET = SuiNetwork.TEST_NET
@@ -44,13 +44,13 @@ class SuiCodeGen extends AbstractCodegen<SuiMoveNormalizedModules, SuiNetwork> {
44
44
  return params.slice(0, params.length - 1)
45
45
  }
46
46
 
47
- toNeutral(modules: SuiMoveNormalizedModules): NeutralMoveModule[] {
48
- return Object.values(modules).map(toNeutralModule)
47
+ toInternalModules(modules: SuiMoveNormalizedModules): InternalMoveModule[] {
48
+ return Object.values(modules).map(toInternalModule)
49
49
  }
50
50
 
51
- getEventStructs(module: NeutralMoveModule) {
51
+ getEventStructs(module: InternalMoveModule) {
52
52
  const qname = moduleQname(module)
53
- const eventMap = new Map<string, NeutralMoveStruct>()
53
+ const eventMap = new Map<string, InternalMoveStruct>()
54
54
 
55
55
  for (const struct of module.structs) {
56
56
  const abilities = new Set(struct.abilities)
@@ -1,7 +1,7 @@
1
1
  import { TypedEventInstance, TypedEntryFunctionPayload } from './models.js'
2
2
  import { AbstractMoveCoder } from '../move/abstract-move-coder.js'
3
3
  import { MoveCall, MoveEvent, SuiMoveNormalizedModule } from '@mysten/sui.js'
4
- import { toNeutralModule } from './move-types.js'
4
+ import { toInternalModule } from './move-types.js'
5
5
  import { SPLITTER } from '../move/index.js'
6
6
 
7
7
  export class MoveCoder extends AbstractMoveCoder<MoveEvent> {
@@ -9,7 +9,7 @@ export class MoveCoder extends AbstractMoveCoder<MoveEvent> {
9
9
  if (this.contains(module.address, module.name)) {
10
10
  return
11
11
  }
12
- this.loadNeutral(toNeutralModule(module))
12
+ this.loadInternal(toInternalModule(module))
13
13
  }
14
14
 
15
15
  decodeEvent<T>(event: MoveEvent): TypedEventInstance<T> | undefined {