@layerzerolabs/lz-sui-sdk-v2 3.0.135 → 3.0.137-sui.0

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 (217) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/deployments/sui-mainnet/blocked_message_lib.json +32 -32
  3. package/deployments/sui-mainnet/blocked_msglib_ptb_builder.json +32 -32
  4. package/deployments/sui-mainnet/call.json +20 -21
  5. package/deployments/sui-mainnet/counter.json +47 -47
  6. package/deployments/sui-mainnet/dvn.json +20 -19
  7. package/deployments/sui-mainnet/dvn_call_type.json +24 -24
  8. package/deployments/sui-mainnet/dvn_fee_lib.json +31 -31
  9. package/deployments/sui-mainnet/dvn_layerzero.json +25 -25
  10. package/deployments/sui-mainnet/dvn_ptb_builder.json +19 -19
  11. package/deployments/sui-mainnet/endpoint_ptb_builder.json +34 -34
  12. package/deployments/sui-mainnet/endpoint_v2.json +43 -43
  13. package/deployments/sui-mainnet/executor.json +20 -19
  14. package/deployments/sui-mainnet/executor_call_type.json +24 -24
  15. package/deployments/sui-mainnet/executor_fee_lib.json +25 -25
  16. package/deployments/sui-mainnet/executor_layerzero.json +32 -32
  17. package/deployments/sui-mainnet/executor_ptb_builder.json +19 -19
  18. package/deployments/sui-mainnet/layerzero_views.json +25 -25
  19. package/deployments/sui-mainnet/message_lib_common.json +25 -25
  20. package/deployments/sui-mainnet/msglib_ptb_builder_call_types.json +19 -19
  21. package/deployments/sui-mainnet/multi_call.json +45 -0
  22. package/deployments/sui-mainnet/oapp.json +27 -25
  23. package/deployments/sui-mainnet/object-BlockedMessageLib.json +5 -5
  24. package/deployments/sui-mainnet/object-BlockedMsglibPtbBuilder.json +5 -5
  25. package/deployments/sui-mainnet/object-Counter.json +5 -5
  26. package/deployments/sui-mainnet/object-CounterAdminCap.json +5 -5
  27. package/deployments/sui-mainnet/object-CounterOApp.json +5 -5
  28. package/deployments/sui-mainnet/object-DVN.json +2 -2
  29. package/deployments/sui-mainnet/object-DVNCap.json +5 -5
  30. package/deployments/sui-mainnet/object-DVNFeeLib.json +5 -5
  31. package/deployments/sui-mainnet/object-EndpointPtbBuilder.json +5 -5
  32. package/deployments/sui-mainnet/object-EndpointPtbBuilderAdminCap.json +5 -5
  33. package/deployments/sui-mainnet/object-EndpointV2.json +5 -5
  34. package/deployments/sui-mainnet/object-EndpointV2AdminCap.json +5 -5
  35. package/deployments/sui-mainnet/object-Executor.json +2 -2
  36. package/deployments/sui-mainnet/object-ExecutorCap.json +5 -5
  37. package/deployments/sui-mainnet/object-ExecutorFeeLib.json +5 -5
  38. package/deployments/sui-mainnet/object-ExecutorOwnerCap.json +2 -2
  39. package/deployments/sui-mainnet/object-PackageWhitelistValidator.json +5 -5
  40. package/deployments/sui-mainnet/object-PriceFeed.json +5 -5
  41. package/deployments/sui-mainnet/object-PriceFeedOwnerCap.json +5 -5
  42. package/deployments/sui-mainnet/object-SimpleMessageLib.json +5 -5
  43. package/deployments/sui-mainnet/object-SimpleMessageLibAdminCap.json +5 -5
  44. package/deployments/sui-mainnet/object-SmlPtbBuilder.json +5 -5
  45. package/deployments/sui-mainnet/object-Treasury.json +5 -5
  46. package/deployments/sui-mainnet/object-TreasuryAdminCap.json +5 -5
  47. package/deployments/sui-mainnet/object-ULN302.json +5 -5
  48. package/deployments/sui-mainnet/object-ULN302AdminCap.json +5 -5
  49. package/deployments/sui-mainnet/object-Uln302PtbBuilder.json +5 -5
  50. package/deployments/sui-mainnet/object-Uln302Verification.json +5 -5
  51. package/deployments/sui-mainnet/object-WorkerRegistry.json +9 -0
  52. package/deployments/sui-mainnet/object-ZroCoinMetadata.json +5 -5
  53. package/deployments/sui-mainnet/object-ZroTreasuryCap.json +5 -5
  54. package/deployments/sui-mainnet/package_whitelist_validator.json +54 -54
  55. package/deployments/sui-mainnet/price_feed.json +34 -34
  56. package/deployments/sui-mainnet/price_feed_call_types.json +24 -24
  57. package/deployments/sui-mainnet/ptb_move_call.json +19 -19
  58. package/deployments/sui-mainnet/simple_message_lib.json +39 -39
  59. package/deployments/sui-mainnet/simple_msglib_ptb_builder.json +32 -32
  60. package/deployments/sui-mainnet/treasury.json +40 -40
  61. package/deployments/sui-mainnet/uln_302.json +47 -51
  62. package/deployments/sui-mainnet/uln_302_ptb_builder.json +32 -32
  63. package/deployments/sui-mainnet/uln_common.json +49 -0
  64. package/deployments/sui-mainnet/utils.json +31 -24
  65. package/deployments/sui-mainnet/worker_common.json +21 -20
  66. package/deployments/sui-mainnet/worker_registry.json +58 -0
  67. package/deployments/sui-mainnet/zro.json +37 -37
  68. package/deployments/sui-sandbox-local/blocked_message_lib.json +20 -20
  69. package/deployments/sui-sandbox-local/blocked_msglib_ptb_builder.json +18 -18
  70. package/deployments/sui-sandbox-local/call.json +18 -19
  71. package/deployments/sui-sandbox-local/counter.json +29 -29
  72. package/deployments/sui-sandbox-local/dvn.json +14 -14
  73. package/deployments/sui-sandbox-local/dvn_call_type.json +28 -28
  74. package/deployments/sui-sandbox-local/dvn_fee_lib.json +19 -19
  75. package/deployments/sui-sandbox-local/dvn_layerzero.json +25 -25
  76. package/deployments/sui-sandbox-local/dvn_ptb_builder.json +21 -21
  77. package/deployments/sui-sandbox-local/endpoint_ptb_builder.json +26 -26
  78. package/deployments/sui-sandbox-local/endpoint_v2.json +16 -16
  79. package/deployments/sui-sandbox-local/executor.json +22 -22
  80. package/deployments/sui-sandbox-local/executor_call_type.json +21 -21
  81. package/deployments/sui-sandbox-local/executor_fee_lib.json +27 -27
  82. package/deployments/sui-sandbox-local/executor_layerzero.json +25 -25
  83. package/deployments/sui-sandbox-local/executor_ptb_builder.json +21 -21
  84. package/deployments/sui-sandbox-local/layerzero_views.json +10 -10
  85. package/deployments/sui-sandbox-local/message_lib_common.json +10 -10
  86. package/deployments/sui-sandbox-local/msglib_ptb_builder_call_types.json +10 -10
  87. package/deployments/sui-sandbox-local/{sequential_multi_call.json → multi_call.json} +18 -18
  88. package/deployments/sui-sandbox-local/oapp.json +19 -19
  89. package/deployments/sui-sandbox-local/object-BlockedMessageLib.json +4 -4
  90. package/deployments/sui-sandbox-local/object-BlockedMsglibPtbBuilder.json +4 -4
  91. package/deployments/sui-sandbox-local/object-Counter.json +4 -4
  92. package/deployments/sui-sandbox-local/object-CounterAdminCap.json +4 -4
  93. package/deployments/sui-sandbox-local/object-CounterOApp.json +4 -4
  94. package/deployments/sui-sandbox-local/object-DVN.json +2 -2
  95. package/deployments/sui-sandbox-local/object-DVNCap.json +5 -5
  96. package/deployments/sui-sandbox-local/object-DVNFeeLib.json +5 -5
  97. package/deployments/sui-sandbox-local/object-EndpointPtbBuilder.json +4 -4
  98. package/deployments/sui-sandbox-local/object-EndpointPtbBuilderAdminCap.json +4 -4
  99. package/deployments/sui-sandbox-local/object-EndpointV2.json +4 -4
  100. package/deployments/sui-sandbox-local/object-EndpointV2AdminCap.json +4 -4
  101. package/deployments/sui-sandbox-local/object-Executor.json +2 -2
  102. package/deployments/sui-sandbox-local/object-ExecutorCap.json +5 -5
  103. package/deployments/sui-sandbox-local/object-ExecutorFeeLib.json +5 -5
  104. package/deployments/sui-sandbox-local/object-ExecutorOwnerCap.json +2 -2
  105. package/deployments/sui-sandbox-local/object-PackageWhitelistValidator.json +4 -4
  106. package/deployments/sui-sandbox-local/object-PriceFeed.json +5 -5
  107. package/deployments/sui-sandbox-local/object-PriceFeedOwnerCap.json +5 -5
  108. package/deployments/sui-sandbox-local/object-SimpleMessageLib.json +4 -4
  109. package/deployments/sui-sandbox-local/object-SimpleMessageLibAdminCap.json +4 -4
  110. package/deployments/sui-sandbox-local/object-SmlPtbBuilder.json +4 -4
  111. package/deployments/sui-sandbox-local/object-Treasury.json +5 -5
  112. package/deployments/sui-sandbox-local/object-TreasuryAdminCap.json +5 -5
  113. package/deployments/sui-sandbox-local/object-ULN302.json +4 -4
  114. package/deployments/sui-sandbox-local/object-ULN302AdminCap.json +4 -4
  115. package/deployments/sui-sandbox-local/object-Uln302PtbBuilder.json +4 -4
  116. package/deployments/sui-sandbox-local/object-Uln302Verification.json +4 -4
  117. package/deployments/sui-sandbox-local/object-WorkerRegistry.json +4 -4
  118. package/deployments/sui-sandbox-local/package_whitelist_validator.json +42 -42
  119. package/deployments/sui-sandbox-local/price_feed.json +39 -39
  120. package/deployments/sui-sandbox-local/price_feed_call_types.json +9 -9
  121. package/deployments/sui-sandbox-local/ptb_move_call.json +18 -18
  122. package/deployments/sui-sandbox-local/simple_message_lib.json +24 -24
  123. package/deployments/sui-sandbox-local/simple_msglib_ptb_builder.json +22 -22
  124. package/deployments/sui-sandbox-local/treasury.json +37 -37
  125. package/deployments/sui-sandbox-local/uln_302.json +36 -36
  126. package/deployments/sui-sandbox-local/uln_302_ptb_builder.json +20 -20
  127. package/deployments/sui-sandbox-local/uln_common.json +9 -9
  128. package/deployments/sui-sandbox-local/worker_common.json +18 -18
  129. package/deployments/sui-sandbox-local/worker_registry.json +23 -23
  130. package/deployments/sui-testnet/blocked_message_lib.json +26 -26
  131. package/deployments/sui-testnet/blocked_msglib_ptb_builder.json +22 -22
  132. package/deployments/sui-testnet/call.json +21 -22
  133. package/deployments/sui-testnet/counter.json +46 -39
  134. package/deployments/sui-testnet/dvn.json +13 -13
  135. package/deployments/sui-testnet/dvn_call_type.json +12 -12
  136. package/deployments/sui-testnet/dvn_fee_lib.json +22 -22
  137. package/deployments/sui-testnet/dvn_layerzero.json +17 -17
  138. package/deployments/sui-testnet/dvn_ptb_builder.json +20 -20
  139. package/deployments/sui-testnet/endpoint_ptb_builder.json +33 -33
  140. package/deployments/sui-testnet/endpoint_v2.json +30 -30
  141. package/deployments/sui-testnet/executor.json +21 -21
  142. package/deployments/sui-testnet/executor_call_type.json +19 -19
  143. package/deployments/sui-testnet/executor_fee_lib.json +26 -26
  144. package/deployments/sui-testnet/executor_layerzero.json +17 -17
  145. package/deployments/sui-testnet/executor_ptb_builder.json +20 -20
  146. package/deployments/sui-testnet/layerzero_views.json +13 -13
  147. package/deployments/sui-testnet/message_lib_common.json +13 -13
  148. package/deployments/sui-testnet/msglib_ptb_builder_call_types.json +13 -13
  149. package/deployments/sui-testnet/multi_call.json +45 -0
  150. package/deployments/sui-testnet/oapp.json +21 -21
  151. package/deployments/sui-testnet/object-BlockedMessageLib.json +5 -5
  152. package/deployments/sui-testnet/object-BlockedMsglibPtbBuilder.json +5 -5
  153. package/deployments/sui-testnet/object-Counter.json +5 -5
  154. package/deployments/sui-testnet/object-CounterAdminCap.json +5 -5
  155. package/deployments/sui-testnet/object-CounterOApp.json +5 -5
  156. package/deployments/sui-testnet/object-DVN.json +2 -2
  157. package/deployments/sui-testnet/object-DVNCap.json +5 -5
  158. package/deployments/sui-testnet/object-DVNFeeLib.json +5 -5
  159. package/deployments/sui-testnet/object-EndpointPtbBuilder.json +5 -5
  160. package/deployments/sui-testnet/object-EndpointPtbBuilderAdminCap.json +5 -5
  161. package/deployments/sui-testnet/object-EndpointV2.json +5 -5
  162. package/deployments/sui-testnet/object-EndpointV2AdminCap.json +5 -5
  163. package/deployments/sui-testnet/object-Executor.json +2 -2
  164. package/deployments/sui-testnet/object-ExecutorCap.json +5 -5
  165. package/deployments/sui-testnet/object-ExecutorFeeLib.json +5 -5
  166. package/deployments/sui-testnet/object-ExecutorOwnerCap.json +2 -2
  167. package/deployments/sui-testnet/object-OFT-TokenTwo.json +5 -0
  168. package/deployments/sui-testnet/object-OFTComposerManager.json +9 -0
  169. package/deployments/sui-testnet/object-OFTInitTicket-TokenTwo.json +9 -0
  170. package/deployments/sui-testnet/object-OFTOApp-TokenTwo.json +9 -0
  171. package/deployments/sui-testnet/object-PackageWhitelistValidator.json +5 -5
  172. package/deployments/sui-testnet/object-PriceFeed.json +5 -5
  173. package/deployments/sui-testnet/object-PriceFeedOwnerCap.json +5 -5
  174. package/deployments/sui-testnet/object-SimpleMessageLib.json +5 -5
  175. package/deployments/sui-testnet/object-SimpleMessageLibAdminCap.json +5 -5
  176. package/deployments/sui-testnet/object-SmlPtbBuilder.json +5 -5
  177. package/deployments/sui-testnet/object-TestCoinMetadata.json +9 -0
  178. package/deployments/sui-testnet/object-TestCoinTreasuryCap.json +9 -0
  179. package/deployments/sui-testnet/object-Treasury.json +5 -5
  180. package/deployments/sui-testnet/object-TreasuryAdminCap.json +5 -5
  181. package/deployments/sui-testnet/object-ULN302.json +5 -5
  182. package/deployments/sui-testnet/object-ULN302AdminCap.json +5 -5
  183. package/deployments/sui-testnet/object-Uln302PtbBuilder.json +5 -5
  184. package/deployments/sui-testnet/object-Uln302Verification.json +5 -5
  185. package/deployments/sui-testnet/object-WorkerRegistry.json +5 -5
  186. package/deployments/sui-testnet/object-ZroCoinMetadata.json +5 -5
  187. package/deployments/sui-testnet/object-ZroTreasuryCap.json +5 -5
  188. package/deployments/sui-testnet/oft-TokenTwo.json +82 -0
  189. package/deployments/sui-testnet/oft_common.json +61 -0
  190. package/deployments/sui-testnet/package_whitelist_validator.json +50 -50
  191. package/deployments/sui-testnet/price_feed.json +31 -31
  192. package/deployments/sui-testnet/price_feed_call_types.json +19 -19
  193. package/deployments/sui-testnet/ptb_move_call.json +13 -13
  194. package/deployments/sui-testnet/simple_message_lib.json +22 -22
  195. package/deployments/sui-testnet/simple_msglib_ptb_builder.json +25 -25
  196. package/deployments/sui-testnet/test_coin.json +69 -0
  197. package/deployments/sui-testnet/treasury.json +29 -29
  198. package/deployments/sui-testnet/uln_302.json +46 -46
  199. package/deployments/sui-testnet/uln_302_ptb_builder.json +18 -18
  200. package/deployments/sui-testnet/uln_common.json +21 -21
  201. package/deployments/sui-testnet/utils.json +20 -20
  202. package/deployments/sui-testnet/worker_common.json +13 -13
  203. package/deployments/sui-testnet/worker_registry.json +26 -26
  204. package/deployments/sui-testnet/zro.json +27 -27
  205. package/dist/index.cjs +253 -252
  206. package/dist/index.cjs.map +1 -1
  207. package/dist/index.d.mts +52 -50
  208. package/dist/index.d.ts +52 -50
  209. package/dist/index.mjs +253 -252
  210. package/dist/index.mjs.map +1 -1
  211. package/package.json +7 -7
  212. package/src/generated/addresses.ts +169 -169
  213. package/src/modules/call.ts +2 -2
  214. package/src/modules/endpoint.ts +46 -53
  215. package/src/modules/oapps/counter.ts +5 -8
  216. package/src/modules/oapps/oapp.ts +42 -28
  217. package/deployments/sui-testnet/sequential_multi_call.json +0 -45
@@ -68,12 +68,9 @@ export const EndpointErrorCode = {
68
68
  MessagingComposer_EComposeNotFound: 3,
69
69
  MessagingComposer_EComposerNotRegistered: 4,
70
70
  MessagingComposer_EComposerRegistered: 5,
71
- MessagingComposer_EInvalidLZComposeInfo: 6,
72
-
73
71
  // OAppRegistry related errors (with OAppRegistry_ prefix)
74
- OAppRegistry_EInvalidLZReceiveInfo: 1,
75
- OAppRegistry_EOAppNotRegistered: 2,
76
- OAppRegistry_EOAppRegistered: 3,
72
+ OAppRegistry_EOAppNotRegistered: 1,
73
+ OAppRegistry_EOAppRegistered: 2,
77
74
 
78
75
  // Endpoint related errors (with Endpoint_ prefix)
79
76
  Endpoint_EAlreadyInitialized: 1,
@@ -120,16 +117,17 @@ export class Endpoint {
120
117
  * Register an OApp with the endpoint
121
118
  * @param tx - The transaction to add the move call to
122
119
  * @param oappCap - The OApp capability object ID or transaction argument
123
- * @param lzReceiveInfo - Transaction result containing LayerZero receive information
120
+ * @param oappInfo - OApp information including lz_receive execution information
121
+ * @returns Transaction result containing the messaging channel address
124
122
  */
125
123
  registerOAppMoveCall(
126
124
  tx: Transaction,
127
125
  oappCap: string | TransactionArgument,
128
- lzReceiveInfo: Uint8Array | TransactionArgument
129
- ): void {
130
- tx.moveCall({
126
+ oappInfo: Uint8Array | TransactionArgument
127
+ ): TransactionResult {
128
+ return tx.moveCall({
131
129
  target: this.#target('register_oapp'),
132
- arguments: [tx.object(this.objects.endpointV2), asObject(tx, oappCap), asBytes(tx, lzReceiveInfo)],
130
+ arguments: [tx.object(this.objects.endpointV2), asObject(tx, oappCap), asBytes(tx, oappInfo)],
133
131
  })
134
132
  }
135
133
 
@@ -151,25 +149,25 @@ export class Endpoint {
151
149
  }
152
150
 
153
151
  /**
154
- * Set LayerZero receive information for an OApp
152
+ * Set OApp information for an OApp
155
153
  * @param tx - The transaction to add the move call to
156
154
  * @param callerCap - The caller capability object ID or transaction argument
157
155
  * @param oapp - The OApp address or transaction argument
158
- * @param lzReceiveInfo - The LayerZero receive information as bytes or transaction argument
156
+ * @param oappInfo - The OApp information including lz_receive execution information as bytes or transaction argument
159
157
  */
160
- setLzReceiveInfoMoveCall(
158
+ setOappInfoMoveCall(
161
159
  tx: Transaction,
162
160
  callerCap: string | TransactionArgument,
163
161
  oapp: string | TransactionArgument,
164
- lzReceiveInfo: Uint8Array | TransactionArgument
162
+ oappInfo: Uint8Array | TransactionArgument
165
163
  ): void {
166
164
  tx.moveCall({
167
- target: this.#target('set_lz_receive_info'),
165
+ target: this.#target('set_oapp_info'),
168
166
  arguments: [
169
167
  tx.object(this.objects.endpointV2),
170
168
  asObject(tx, callerCap),
171
169
  asAddress(tx, oapp),
172
- asBytes(tx, lzReceiveInfo),
170
+ asBytes(tx, oappInfo),
173
171
  ],
174
172
  })
175
173
  }
@@ -555,33 +553,34 @@ export class Endpoint {
555
553
  * Register a composer with the endpoint
556
554
  * @param tx - The transaction to add the move call to
557
555
  * @param composerCap - The composer capability object ID or transaction argument
558
- * @param lzComposeInfo - LayerZero compose information as bytes
556
+ * @param composerInfo - Composer information including lz_compose execution information as bytes
557
+ * @returns Transaction result containing the compose queue address
559
558
  */
560
559
  registerComposerMoveCall(
561
560
  tx: Transaction,
562
561
  composerCap: string | TransactionArgument,
563
- lzComposeInfo: Uint8Array | TransactionArgument
564
- ): void {
565
- tx.moveCall({
562
+ composerInfo: Uint8Array | TransactionArgument
563
+ ): TransactionResult {
564
+ return tx.moveCall({
566
565
  target: this.#target('register_composer'),
567
- arguments: [tx.object(this.objects.endpointV2), asObject(tx, composerCap), asBytes(tx, lzComposeInfo)],
566
+ arguments: [tx.object(this.objects.endpointV2), asObject(tx, composerCap), asBytes(tx, composerInfo)],
568
567
  })
569
568
  }
570
569
 
571
570
  /**
572
- * Set LayerZero compose information for a composer
571
+ * Set composer information for a composer
573
572
  * @param tx - The transaction to add the move call to
574
573
  * @param composerCap - The composer capability object ID or transaction argument
575
- * @param lzComposeInfo - LayerZero compose information as bytes or transaction argument
574
+ * @param composerInfo - Composer information including lz_compose execution information as bytes or transaction argument
576
575
  */
577
- setLzComposeInfoMoveCall(
576
+ setComposerInfoMoveCall(
578
577
  tx: Transaction,
579
578
  composerCap: string | TransactionArgument,
580
- lzComposeInfo: Uint8Array | TransactionArgument
579
+ composerInfo: Uint8Array | TransactionArgument
581
580
  ): void {
582
581
  tx.moveCall({
583
- target: this.#target('set_lz_compose_info'),
584
- arguments: [tx.object(this.objects.endpointV2), asObject(tx, composerCap), asBytes(tx, lzComposeInfo)],
582
+ target: this.#target('set_composer_info'),
583
+ arguments: [tx.object(this.objects.endpointV2), asObject(tx, composerCap), asBytes(tx, composerInfo)],
585
584
  })
586
585
  }
587
586
 
@@ -1032,28 +1031,28 @@ export class Endpoint {
1032
1031
  }
1033
1032
 
1034
1033
  /**
1035
- * Get LayerZero receive information for an OApp
1034
+ * Get OApp information for an OApp
1036
1035
  * @param tx - The transaction to add the move call to
1037
1036
  * @param oapp - The OApp address or transaction argument
1038
- * @returns Transaction result containing the receive information
1037
+ * @returns Transaction result containing the OApp information including lz_receive execution information
1039
1038
  */
1040
- getLzReceiveInfoMoveCall(tx: Transaction, oapp: string | TransactionArgument): TransactionResult {
1039
+ getOappInfoMoveCall(tx: Transaction, oapp: string | TransactionArgument): TransactionResult {
1041
1040
  return tx.moveCall({
1042
- target: this.#target('get_lz_receive_info'),
1041
+ target: this.#target('get_oapp_info'),
1043
1042
  arguments: [tx.object(this.objects.endpointV2), asAddress(tx, oapp)],
1044
1043
  })
1045
1044
  }
1046
1045
 
1047
1046
  /**
1048
- * Get LayerZero receive information for an OApp
1047
+ * Get OApp information for an OApp
1049
1048
  * @param oapp - The OApp address
1050
- * @returns Promise<Uint8Array> - The receive information as bytes
1049
+ * @returns Promise<Uint8Array> - The OApp information including lz_receive execution information as bytes
1051
1050
  */
1052
- async getLzReceiveInfo(oapp: string): Promise<Uint8Array> {
1051
+ async getOappInfo(oapp: string): Promise<Uint8Array> {
1053
1052
  return executeSimulate(
1054
1053
  this.client,
1055
1054
  (tx) => {
1056
- return this.getLzReceiveInfoMoveCall(tx, oapp)
1055
+ return this.getOappInfoMoveCall(tx, oapp)
1057
1056
  },
1058
1057
  (result) => {
1059
1058
  const parsed = bcs.vector(bcs.u8()).parse(result[0].value)
@@ -1147,28 +1146,28 @@ export class Endpoint {
1147
1146
  }
1148
1147
 
1149
1148
  /**
1150
- * Get LayerZero compose information for a composer
1149
+ * Get composer information for a registered composer
1151
1150
  * @param tx - The transaction to add the move call to
1152
1151
  * @param composer - The composer address or transaction argument
1153
- * @returns Transaction result containing the compose information
1152
+ * @returns Transaction result containing the composer information
1154
1153
  */
1155
- getLzComposeInfoMoveCall(tx: Transaction, composer: string | TransactionArgument): TransactionResult {
1154
+ getComposerInfoMoveCall(tx: Transaction, composer: string | TransactionArgument): TransactionResult {
1156
1155
  return tx.moveCall({
1157
- target: this.#target('get_lz_compose_info'),
1156
+ target: this.#target('get_composer_info'),
1158
1157
  arguments: [tx.object(this.objects.endpointV2), asAddress(tx, composer)],
1159
1158
  })
1160
1159
  }
1161
1160
 
1162
1161
  /**
1163
- * Get LayerZero compose information for a composer
1162
+ * Get composer information for a registered composer
1164
1163
  * @param composer - The composer address
1165
- * @returns Promise<Uint8Array> - The compose information as bytes
1164
+ * @returns Promise<Uint8Array> - The composer information as bytes
1166
1165
  */
1167
- async getLzComposeInfo(composer: string): Promise<Uint8Array> {
1166
+ async getComposerInfo(composer: string): Promise<Uint8Array> {
1168
1167
  return executeSimulate(
1169
1168
  this.client,
1170
1169
  (tx) => {
1171
- this.getLzComposeInfoMoveCall(tx, composer)
1170
+ this.getComposerInfoMoveCall(tx, composer)
1172
1171
  },
1173
1172
  (result) => {
1174
1173
  const parsed = bcs.vector(bcs.u8()).parse(result[0].value)
@@ -2317,16 +2316,13 @@ export class Endpoint {
2317
2316
  async populateLzReceiveTransaction(
2318
2317
  tx: Transaction,
2319
2318
  lzReceiveCall: TransactionResult,
2320
- oapp: string, // receiver oapp
2319
+ oapp: string | TransactionArgument, // receiver oapp
2321
2320
  sender: string | undefined = undefined,
2322
2321
  validators: IPTBValidator[] = [],
2323
2322
  maxSimulationTimes = DEFAULT_SIMULATION_TIMES
2324
2323
  ): Promise<MoveCall[]> {
2325
2324
  const simulateTx = Transaction.from(tx)
2326
- simulateTx.moveCall({
2327
- target: this.#target('get_lz_receive_info'),
2328
- arguments: [simulateTx.object(this.objects.endpointV2), simulateTx.pure.address(oapp)],
2329
- })
2325
+ this.getOappInfoMoveCall(simulateTx, oapp)
2330
2326
  const moveCalls = await this.moduleManager.getPtbBuilder().simulateLzReceivePtb(simulateTx, sender)
2331
2327
 
2332
2328
  const [_, finalMoveCalls] = await this.moduleManager
@@ -2361,16 +2357,13 @@ export class Endpoint {
2361
2357
  async populateLzComposeTransaction(
2362
2358
  tx: Transaction,
2363
2359
  endpointLzComposeCall: TransactionResult,
2364
- composer: string,
2360
+ composer: string | TransactionArgument,
2365
2361
  sender: string | undefined = undefined,
2366
2362
  validators: IPTBValidator[] = [],
2367
2363
  maxSimulationTimes = DEFAULT_SIMULATION_TIMES
2368
2364
  ): Promise<MoveCall[]> {
2369
2365
  const simulateTx = Transaction.from(tx)
2370
- simulateTx.moveCall({
2371
- target: this.#target('get_lz_compose_info'),
2372
- arguments: [simulateTx.object(this.objects.endpointV2), simulateTx.pure.address(composer)],
2373
- })
2366
+ this.getComposerInfoMoveCall(simulateTx, composer)
2374
2367
  const moveCalls = await this.moduleManager.getPtbBuilder().simulateLzComposePtb(simulateTx, sender)
2375
2368
 
2376
2369
  const [_, finalMoveCalls] = await this.moduleManager
@@ -109,7 +109,6 @@ export class Counter {
109
109
  * @param dstEid - Destination endpoint ID
110
110
  * @param msgType - Message type (SEND or SEND_AND_CALL)
111
111
  * @param options - Execution options as bytes
112
- * @param sendValue - Value to send with the message
113
112
  * @param nativeFee - Native token fee amount
114
113
  * @param zroFee - ZRO token fee amount
115
114
  * @param refundAddress - Address for fee refunds
@@ -120,7 +119,6 @@ export class Counter {
120
119
  dstEid: EndpointId | TransactionArgument,
121
120
  msgType: number | TransactionArgument,
122
121
  options: Uint8Array | TransactionArgument,
123
- sendValue: bigint | TransactionArgument,
124
122
  nativeFee: bigint | TransactionArgument,
125
123
  zroFee: bigint | TransactionArgument,
126
124
  refundAddress: string | TransactionArgument,
@@ -138,7 +136,6 @@ export class Counter {
138
136
  asU32(tx, dstEid),
139
137
  asU8(tx, msgType),
140
138
  asBytes(tx, options),
141
- asU64(tx, sendValue),
142
139
  nativeToken,
143
140
  zroToken,
144
141
  asAddress(tx, refundAddress),
@@ -148,19 +145,19 @@ export class Counter {
148
145
  }
149
146
 
150
147
  /**
151
- * Set LayerZero compose information for counter
148
+ * Set composer information for counter
152
149
  * @param tx - The transaction to add the move call to
153
- * @param lzComposeInfo - LayerZero compose information as bytes
150
+ * @param composerInfo - Composer information including lz_compose execution information as bytes
154
151
  */
155
- setLzComposeInfoMoveCall(tx: Transaction, lzComposeInfo: Uint8Array | TransactionArgument): void {
152
+ setComposerInfoMoveCall(tx: Transaction, composerInfo: Uint8Array | TransactionArgument): void {
156
153
  tx.moveCall({
157
- target: this.#target('set_lz_compose_info'),
154
+ target: this.#target('set_composer_info'),
158
155
  arguments: [
159
156
  tx.object(this.objects.counter),
160
157
  tx.object(this.objects.counterOapp),
161
158
  tx.object(this.objects.counterAdminCap),
162
159
  tx.object(this.objects.endpointV2),
163
- asBytes(tx, lzComposeInfo),
160
+ asBytes(tx, composerInfo),
164
161
  ],
165
162
  })
166
163
  }
@@ -64,17 +64,11 @@ export class OApp {
64
64
  this.objects = objects
65
65
  }
66
66
 
67
- // setOAppInfo(oappInfo: OAppInfoV1): void {
68
- // this.oappInfo = oappInfo
69
- // }
70
-
71
67
  // === Set Functions ===
72
68
 
73
69
  /**
74
70
  * Set enforced options for OApp messaging
75
71
  * @param tx - The transaction to add the move call to
76
- * @param oapp - The OApp object ID or transaction argument
77
- * @param adminCap - The admin capability object ID or transaction argument
78
72
  * @param eid - Endpoint ID or transaction argument
79
73
  * @param msgType - Message type or transaction argument
80
74
  * @param options - Enforced options as bytes or transaction argument
@@ -102,8 +96,6 @@ export class OApp {
102
96
  /**
103
97
  * Set peer OApp on another chain
104
98
  * @param tx - The transaction to add the move call to
105
- * @param oapp - The OApp object ID or transaction argument
106
- * @param adminCap - The admin capability object ID or transaction argument
107
99
  * @param eid - Peer endpoint ID or transaction argument
108
100
  * @param peer - Peer OApp address as bytes or transaction argument
109
101
  */
@@ -161,7 +153,6 @@ export class OApp {
161
153
  /**
162
154
  * Get OApp CallCap identifier
163
155
  * @param tx - The transaction to add the move call to
164
- * @param oapp - The OApp object ID or transaction argument
165
156
  * @returns Transaction result containing the OApp CallCap identifier
166
157
  */
167
158
  async getOAppCapIdMoveCall(tx: Transaction): Promise<TransactionResult> {
@@ -174,7 +165,6 @@ export class OApp {
174
165
 
175
166
  /**
176
167
  * Get OApp CallCap identifier
177
- * @param oapp - The OApp object ID (optional, uses configured oapp if not provided)
178
168
  * @returns Promise<string> - The OApp CallCap identifier
179
169
  */
180
170
  async getOAppCapId(): Promise<string> {
@@ -190,7 +180,6 @@ export class OApp {
190
180
  /**
191
181
  * Combine enforced options with extra options for message execution
192
182
  * @param tx - The transaction to add the move call to
193
- * @param oapp - The OApp object ID or transaction argument
194
183
  * @param eid - Destination endpoint ID or transaction argument
195
184
  * @param msgType - Message type or transaction argument
196
185
  * @param extraOptions - Extra options to combine with enforced options or transaction argument
@@ -216,7 +205,6 @@ export class OApp {
216
205
 
217
206
  /**
218
207
  * Combine enforced options with extra options for message execution
219
- * @param oapp - The OApp object ID
220
208
  * @param eid - Destination endpoint ID
221
209
  * @param msgType - Message type
222
210
  * @param extraOptions - Extra options to combine with enforced options
@@ -235,7 +223,6 @@ export class OApp {
235
223
  /**
236
224
  * Get enforced options for a specific destination and message type
237
225
  * @param tx - The transaction to add the move call to
238
- * @param oapp - The OApp object ID or transaction argument
239
226
  * @param eid - Destination endpoint ID or transaction argument
240
227
  * @param msgType - Message type or transaction argument
241
228
  * @returns Transaction result containing enforced options
@@ -254,7 +241,6 @@ export class OApp {
254
241
 
255
242
  /**
256
243
  * Get enforced options for a specific destination and message type
257
- * @param oapp - The OApp object ID
258
244
  * @param eid - Destination endpoint ID
259
245
  * @param msgType - Message type
260
246
  * @returns Promise<Uint8Array> - Enforced options as bytes
@@ -272,7 +258,6 @@ export class OApp {
272
258
  /**
273
259
  * Check if a peer is configured for a specific destination chain
274
260
  * @param tx - The transaction to add the move call to
275
- * @param oapp - The OApp object ID or transaction argument
276
261
  * @param dstEid - Destination endpoint ID or transaction argument
277
262
  * @returns Transaction result containing boolean result
278
263
  */
@@ -286,7 +271,6 @@ export class OApp {
286
271
 
287
272
  /**
288
273
  * Check if a peer is configured for a specific destination chain
289
- * @param oapp - The OApp object ID
290
274
  * @param dstEid - Destination endpoint ID
291
275
  * @returns Promise<boolean> - True if peer is configured, false otherwise
292
276
  */
@@ -303,7 +287,6 @@ export class OApp {
303
287
  /**
304
288
  * Get the configured peer address for a specific destination chain
305
289
  * @param tx - The transaction to add the move call to
306
- * @param oapp - The OApp object ID or transaction argument
307
290
  * @param dstEid - Destination endpoint ID or transaction argument
308
291
  * @returns Transaction result containing peer address
309
292
  */
@@ -317,7 +300,6 @@ export class OApp {
317
300
 
318
301
  /**
319
302
  * Get the configured peer address for a specific destination chain
320
- * @param oapp - The OApp object ID
321
303
  * @param dstEid - Destination endpoint ID
322
304
  * @returns Promise<Uint8Array> - Peer address as bytes32
323
305
  */
@@ -333,15 +315,24 @@ export class OApp {
333
315
  )
334
316
  }
335
317
 
318
+ /**
319
+ * Get OApp information V1 structure
320
+ * @param tx - The transaction to add the move call to
321
+ * @returns Transaction result containing the OApp information V1
322
+ */
336
323
  getOAppInfoV1MoveCall(tx: Transaction): TransactionResult {
337
324
  const endpoint = this.moduleManager.getEndpoint()
338
- const oappInfoRaw = endpoint.getLzReceiveInfoMoveCall(tx, this.oappCallCapId) // the new OAppInfo used to be named as lz_receive_info
325
+ const oappInfoRaw = endpoint.getOappInfoMoveCall(tx, this.oappCallCapId) // the new OAppInfo used to be named as lz_receive_info
339
326
  return tx.moveCall({
340
- target: `${this.packageId}::oapp_info_v1::decode`,
327
+ target: this.#target('decode', 'oapp_info_v1'),
341
328
  arguments: [oappInfoRaw],
342
329
  })
343
330
  }
344
331
 
332
+ /**
333
+ * Get OApp information V1 structure
334
+ * @returns Promise<OAppInfoV1> - The OApp information V1
335
+ */
345
336
  async getOAppInfoV1(): Promise<OAppInfoV1> {
346
337
  return executeSimulate(
347
338
  this.client,
@@ -354,16 +345,25 @@ export class OApp {
354
345
  )
355
346
  }
356
347
 
348
+ getOAppInfoV1ExtraInfoMoveCall(tx: Transaction, oappInfo: string | TransactionArgument): TransactionResult {
349
+ return tx.moveCall({
350
+ target: this.#target('extra_info', 'oapp_info_v1'),
351
+ arguments: [asObject(tx, oappInfo)],
352
+ })
353
+ }
354
+
357
355
  // === Endpoint Call Functions ===
358
356
 
359
357
  /**
360
358
  * Register OApp with the endpoint
361
359
  * @param tx - The transaction to add the move call to
360
+ * @param oappObjectId - The OApp object ID
362
361
  * @param oappInfo - OApp information as bytes (optional)
363
362
  * @returns Transaction result containing the messaging channel address
364
363
  */
365
364
  async registerOAppMoveCall(
366
365
  tx: Transaction,
366
+ oappObjectId: string,
367
367
  oappInfo?: Uint8Array | TransactionArgument
368
368
  ): Promise<TransactionResult> {
369
369
  let oappInfoArg: TransactionArgument
@@ -376,13 +376,11 @@ export class OApp {
376
376
  // For None
377
377
  oappInfoArg = tx.pure.option('vector<u8>', null)
378
378
  }
379
-
380
- const oappInfoObj = await this.#oappInfo()
381
- const adminCap = await this.getAdminCap(oappInfoObj.oapp_object)
379
+ const adminCap = await this.getAdminCap(oappObjectId)
382
380
  return tx.moveCall({
383
381
  target: this.#target('register_oapp', 'endpoint_calls'),
384
382
  arguments: [
385
- asObject(tx, oappInfoObj.oapp_object),
383
+ asObject(tx, oappObjectId),
386
384
  asObject(tx, adminCap),
387
385
  asObject(tx, this.objects.endpointV2),
388
386
  oappInfoArg,
@@ -413,14 +411,22 @@ export class OApp {
413
411
  * Set OApp information in the endpoint
414
412
  * @param tx - The transaction to add the move call to
415
413
  * @param oappInfo - OApp information as bytes
414
+ * @param oappObjectId - Optional OApp object ID (uses configured oapp if not provided)
416
415
  */
417
- async setOAppInfoMoveCall(tx: Transaction, oappInfo: Uint8Array | TransactionArgument): Promise<void> {
418
- const oappInfoObj = await this.#oappInfo()
419
- const adminCap = await this.getAdminCap(oappInfoObj.oapp_object)
416
+ async setOAppInfoMoveCall(
417
+ tx: Transaction,
418
+ oappInfo: Uint8Array | TransactionArgument,
419
+ oappObjectId?: string
420
+ ): Promise<void> {
421
+ if (oappObjectId === undefined) {
422
+ const oappInfoObj = await this.#oappInfo()
423
+ oappObjectId = oappInfoObj.oapp_object
424
+ }
425
+ const adminCap = await this.getAdminCap(oappObjectId)
420
426
  tx.moveCall({
421
427
  target: this.#target('set_oapp_info', 'endpoint_calls'),
422
428
  arguments: [
423
- asObject(tx, oappInfoObj.oapp_object),
429
+ asObject(tx, oappObjectId),
424
430
  asObject(tx, adminCap),
425
431
  asObject(tx, this.objects.endpointV2),
426
432
  asBytes(tx, oappInfo),
@@ -703,6 +709,14 @@ export class OApp {
703
709
  })
704
710
  }
705
711
 
712
+ /**
713
+ * Refresh the cached OApp information by fetching the latest data
714
+ * @returns Promise<void> - Completes when the OApp info is refreshed
715
+ */
716
+ async refreshOAppInfo(): Promise<void> {
717
+ this.oappInfo = await this.getOAppInfoV1()
718
+ }
719
+
706
720
  // === Private Functions ===
707
721
 
708
722
  /**
@@ -1,45 +0,0 @@
1
- {
2
- "name": "sequential_multi_call",
3
- "address": "0xd047c658acf4c7233f39f50f1de333e42604f30c2f78f823ed3f329cb8b439f9",
4
- "originalAddress": "0xd047c658acf4c7233f39f50f1de333e42604f30c2f78f823ed3f329cb8b439f9",
5
- "publishedVersion": "1",
6
- "network": "sui-testnet",
7
- "digest": "6d5dc218b057ca033f1066b6c02d6541d76e497b986bb06b8ee5a59759aae397",
8
- "transactionHash": "HKfzq9GBKo3rcuWx56e2YJPqy6N1DRu5Tjhi9tsqH9wb",
9
- "upgradeCapId": "0x6b31bfdfdbc9f035e5fd27426173c947fb6e58e738d56aed4ade5172f18f0308",
10
- "deployer": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a",
11
- "objectChanges": [
12
- {
13
- "type": "mutated",
14
- "sender": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a",
15
- "owner": {
16
- "AddressOwner": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a"
17
- },
18
- "objectType": "0x2::coin::Coin<0x2::sui::SUI>",
19
- "objectId": "0x83b783a49bdf7efbc2e18987fc7c45cd069f3452fd37c51549fdf8490374b2ae",
20
- "version": "577853062",
21
- "previousVersion": "577853061",
22
- "digest": "6Rk7B8xdJJ2tFy1mwudE46jMeZxJvDMnDFsvjWf7JttQ"
23
- },
24
- {
25
- "type": "created",
26
- "sender": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a",
27
- "owner": {
28
- "AddressOwner": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a"
29
- },
30
- "objectType": "0x2::package::UpgradeCap",
31
- "objectId": "0x6b31bfdfdbc9f035e5fd27426173c947fb6e58e738d56aed4ade5172f18f0308",
32
- "version": "577853062",
33
- "digest": "Fsuhz4apoMegERostJkrBemqX1Sd9cTVYn2E58o7XhZF"
34
- },
35
- {
36
- "type": "published",
37
- "packageId": "0xd047c658acf4c7233f39f50f1de333e42604f30c2f78f823ed3f329cb8b439f9",
38
- "version": "1",
39
- "digest": "CsRcHBi7mKv8NEJQYyTYZUD9TRcBXbizTVkx9Y9oqQ8v",
40
- "modules": [
41
- "sequential_multi_call"
42
- ]
43
- }
44
- ]
45
- }