@layerzerolabs/protocol-stellar-v2 0.2.13 → 0.2.15

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 (319) hide show
  1. package/.turbo/turbo-build.log +384 -278
  2. package/.turbo/turbo-lint.log +110 -78
  3. package/.turbo/turbo-test.log +1248 -1014
  4. package/Cargo.lock +130 -3
  5. package/Cargo.toml +2 -1
  6. package/contracts/common-macros/src/contract_impl.rs +6 -1
  7. package/contracts/common-macros/src/lib.rs +47 -8
  8. package/contracts/common-macros/src/ownable.rs +7 -25
  9. package/contracts/common-macros/src/storage.rs +1 -1
  10. package/contracts/common-macros/src/tests/contract_impl.rs +5 -0
  11. package/contracts/common-macros/src/tests/mod.rs +1 -0
  12. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__contract_impl__snapshot_generated_contract_impl_code.snap +23 -7
  13. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ownable__snapshot_generated_ownable_code.snap +5 -25
  14. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__storage__snapshot_generated_storage_code.snap +48 -48
  15. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ttl_configurable__snapshot_generated_ttl_configurable_code.snap +5 -25
  16. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__upgradeable__snapshot_generated_upgradeable_code.snap +21 -0
  17. package/contracts/common-macros/src/tests/upgradeable.rs +31 -0
  18. package/contracts/common-macros/src/ttl_configurable.rs +14 -44
  19. package/contracts/common-macros/src/upgradeable.rs +76 -0
  20. package/contracts/endpoint-v2/src/endpoint_v2.rs +25 -1
  21. package/contracts/endpoint-v2/src/tests/endpoint_setup.rs +175 -8
  22. package/contracts/endpoint-v2/src/tests/endpoint_v2/build_outbound_packet.rs +76 -0
  23. package/contracts/endpoint-v2/src/tests/endpoint_v2/clear.rs +342 -159
  24. package/contracts/endpoint-v2/src/tests/endpoint_v2/delegate.rs +3 -15
  25. package/contracts/endpoint-v2/src/tests/endpoint_v2/initializable.rs +20 -31
  26. package/contracts/endpoint-v2/src/tests/endpoint_v2/lz_receive_alert.rs +126 -164
  27. package/contracts/endpoint-v2/src/tests/endpoint_v2/mod.rs +1 -0
  28. package/contracts/endpoint-v2/src/tests/endpoint_v2/native_token.rs +0 -1
  29. package/contracts/endpoint-v2/src/tests/endpoint_v2/owner.rs +0 -1
  30. package/contracts/endpoint-v2/src/tests/endpoint_v2/pay_messaging_fees.rs +311 -304
  31. package/contracts/endpoint-v2/src/tests/endpoint_v2/quote.rs +423 -96
  32. package/contracts/endpoint-v2/src/tests/endpoint_v2/recover_token.rs +1 -1
  33. package/contracts/endpoint-v2/src/tests/endpoint_v2/require_oapp_auth.rs +47 -20
  34. package/contracts/endpoint-v2/src/tests/endpoint_v2/send.rs +373 -403
  35. package/contracts/endpoint-v2/src/tests/endpoint_v2/set_delegate.rs +96 -22
  36. package/contracts/endpoint-v2/src/tests/endpoint_v2/set_zro.rs +61 -9
  37. package/contracts/endpoint-v2/src/tests/endpoint_v2/transfer_ownership.rs +4 -4
  38. package/contracts/endpoint-v2/src/tests/endpoint_v2/ttl_config.rs +8 -11
  39. package/contracts/endpoint-v2/src/tests/endpoint_v2/verifiable.rs +81 -30
  40. package/contracts/endpoint-v2/src/tests/endpoint_v2/verify.rs +209 -76
  41. package/contracts/endpoint-v2/src/tests/endpoint_v2/zro.rs +0 -1
  42. package/contracts/endpoint-v2/src/tests/message_lib_manager/default_receive_library.rs +24 -0
  43. package/contracts/endpoint-v2/src/tests/message_lib_manager/default_receive_library_timeout.rs +40 -0
  44. package/contracts/endpoint-v2/src/tests/message_lib_manager/default_send_library.rs +24 -0
  45. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_config.rs +108 -0
  46. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_library_index.rs +52 -0
  47. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_receive_library.rs +92 -0
  48. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_registered_libraries.rs +74 -0
  49. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_send_library.rs +83 -0
  50. package/contracts/endpoint-v2/src/tests/message_lib_manager/is_registered_library.rs +32 -0
  51. package/contracts/endpoint-v2/src/tests/message_lib_manager/is_supported_eid.rs +28 -0
  52. package/contracts/endpoint-v2/src/tests/message_lib_manager/is_valid_receive_library.rs +261 -0
  53. package/contracts/endpoint-v2/src/tests/message_lib_manager/mod.rs +16 -0
  54. package/contracts/endpoint-v2/src/tests/message_lib_manager/receive_library_timeout.rs +62 -0
  55. package/contracts/endpoint-v2/src/tests/message_lib_manager/register_library.rs +65 -43
  56. package/contracts/endpoint-v2/src/tests/message_lib_manager/registered_libraries_count.rs +42 -0
  57. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_receive_lib_for_eid.rs +61 -0
  58. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_registered.rs +3 -5
  59. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_send_lib_for_eid.rs +59 -0
  60. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_supported_eid.rs +15 -1
  61. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_config.rs +155 -51
  62. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_receive_lib_timeout.rs +114 -92
  63. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_receive_library.rs +235 -132
  64. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_send_library.rs +93 -87
  65. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_receive_library.rs +346 -245
  66. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_receive_library_timeout.rs +406 -60
  67. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_send_library.rs +252 -78
  68. package/contracts/endpoint-v2/src/tests/message_lib_manager/timeout.rs +102 -0
  69. package/contracts/endpoint-v2/src/tests/messaging_channel/burn.rs +212 -273
  70. package/contracts/endpoint-v2/src/tests/messaging_channel/clear_payload.rs +203 -0
  71. package/contracts/endpoint-v2/src/tests/messaging_channel/inbound.rs +94 -0
  72. package/contracts/endpoint-v2/src/tests/messaging_channel/inbound_nonce.rs +78 -248
  73. package/contracts/endpoint-v2/src/tests/messaging_channel/inbound_payload_hash.rs +7 -282
  74. package/contracts/endpoint-v2/src/tests/messaging_channel/lazy_inbound_nonce.rs +6 -274
  75. package/contracts/endpoint-v2/src/tests/messaging_channel/mod.rs +3 -2
  76. package/contracts/endpoint-v2/src/tests/messaging_channel/next_guid.rs +86 -178
  77. package/contracts/endpoint-v2/src/tests/messaging_channel/nilify.rs +328 -212
  78. package/contracts/endpoint-v2/src/tests/messaging_channel/outbound.rs +68 -0
  79. package/contracts/endpoint-v2/src/tests/messaging_channel/outbound_nonce.rs +6 -209
  80. package/contracts/endpoint-v2/src/tests/messaging_channel/skip.rs +207 -159
  81. package/contracts/endpoint-v2/src/tests/messaging_composer/clear_compose.rs +142 -153
  82. package/contracts/endpoint-v2/src/tests/messaging_composer/compose_queue.rs +6 -179
  83. package/contracts/endpoint-v2/src/tests/messaging_composer/lz_compose_alert.rs +163 -221
  84. package/contracts/endpoint-v2/src/tests/messaging_composer/send_compose.rs +90 -121
  85. package/contracts/endpoint-v2/src/tests/mock.rs +18 -4
  86. package/contracts/endpoint-v2/src/tests/util/build_payload.rs +4 -70
  87. package/contracts/endpoint-v2/src/tests/util/compute_guid.rs +2 -1
  88. package/contracts/endpoint-v2/src/tests/util/keccak256.rs +17 -106
  89. package/contracts/layerzero-views/Cargo.toml +35 -0
  90. package/contracts/layerzero-views/src/errors.rs +10 -0
  91. package/contracts/layerzero-views/src/layerzero_view.rs +229 -0
  92. package/contracts/layerzero-views/src/lib.rs +38 -0
  93. package/contracts/layerzero-views/src/storage.rs +18 -0
  94. package/contracts/layerzero-views/src/tests/layerzero_view_tests.rs +423 -0
  95. package/contracts/layerzero-views/src/tests/mod.rs +4 -0
  96. package/contracts/layerzero-views/src/tests/setup.rs +377 -0
  97. package/contracts/layerzero-views/src/types.rs +50 -0
  98. package/contracts/macro-integration-tests/Cargo.toml +30 -0
  99. package/contracts/macro-integration-tests/src/lib.rs +1 -0
  100. package/contracts/macro-integration-tests/tests/runtime/ownable/initialization.rs +62 -0
  101. package/contracts/macro-integration-tests/tests/runtime/ownable/mod.rs +22 -0
  102. package/contracts/macro-integration-tests/tests/runtime/ownable/only_owner_guard.rs +97 -0
  103. package/contracts/macro-integration-tests/tests/runtime/ownable/ownership_transfer.rs +101 -0
  104. package/contracts/macro-integration-tests/tests/runtime/storage/keyed_roundtrip.rs +225 -0
  105. package/contracts/macro-integration-tests/tests/runtime/storage/mod.rs +4 -0
  106. package/contracts/macro-integration-tests/tests/runtime/storage/name_override_runtime.rs +52 -0
  107. package/contracts/macro-integration-tests/tests/runtime/storage/ttl_extension.rs +261 -0
  108. package/contracts/macro-integration-tests/tests/runtime/storage/unkeyed_roundtrip.rs +137 -0
  109. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/configuration.rs +113 -0
  110. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/extend_instance_ttl.rs +50 -0
  111. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/freeze.rs +139 -0
  112. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/mod.rs +3 -0
  113. package/contracts/macro-integration-tests/tests/runtime.rs +5 -0
  114. package/contracts/macro-integration-tests/tests/ui/error/fail/attr_not_empty.rs +12 -0
  115. package/contracts/macro-integration-tests/tests/ui/error/fail/attr_not_empty.stderr +7 -0
  116. package/contracts/macro-integration-tests/tests/ui/error/fail/decreasing_discriminant.rs +12 -0
  117. package/contracts/macro-integration-tests/tests/ui/error/fail/decreasing_discriminant.stderr +7 -0
  118. package/contracts/macro-integration-tests/tests/ui/error/fail/non_int_discriminant.rs +21 -0
  119. package/contracts/macro-integration-tests/tests/ui/error/fail/non_int_discriminant.stderr +7 -0
  120. package/contracts/macro-integration-tests/tests/ui/error/fail/non_unit_variant.rs +13 -0
  121. package/contracts/macro-integration-tests/tests/ui/error/fail/non_unit_variant.stderr +7 -0
  122. package/contracts/macro-integration-tests/tests/ui/error/pass/attr_on_variant_allowed.rs +20 -0
  123. package/contracts/macro-integration-tests/tests/ui/error/pass/basic_auto_discriminants.rs +15 -0
  124. package/contracts/macro-integration-tests/tests/ui/error/pass/mixed_discriminants.rs +16 -0
  125. package/contracts/macro-integration-tests/tests/ui/ownable/fail/only_owner_missing_env.rs +22 -0
  126. package/contracts/macro-integration-tests/tests/ui/ownable/fail/only_owner_missing_env.stderr +16 -0
  127. package/contracts/macro-integration-tests/tests/ui/ownable/pass/minimal_contract.rs +26 -0
  128. package/contracts/macro-integration-tests/tests/ui/ownable/pass/namespacing_and_imports.rs +22 -0
  129. package/contracts/macro-integration-tests/tests/ui/ownable/pass/only_owner_env_param_variants.rs +46 -0
  130. package/contracts/macro-integration-tests/tests/ui/storage/fail/invalid_storage_type_param.rs +13 -0
  131. package/contracts/macro-integration-tests/tests/ui/storage/fail/invalid_storage_type_param.stderr +7 -0
  132. package/contracts/macro-integration-tests/tests/ui/storage/fail/missing_storage_type_param.rs +13 -0
  133. package/contracts/macro-integration-tests/tests/ui/storage/fail/missing_storage_type_param.stderr +7 -0
  134. package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_storage_kinds.rs +10 -0
  135. package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_storage_kinds.stderr +7 -0
  136. package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_type_params.rs +12 -0
  137. package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_type_params.stderr +7 -0
  138. package/contracts/macro-integration-tests/tests/ui/storage/fail/no_ttl_extension_on_non_persistent.rs +10 -0
  139. package/contracts/macro-integration-tests/tests/ui/storage/fail/no_ttl_extension_on_non_persistent.stderr +7 -0
  140. package/contracts/macro-integration-tests/tests/ui/storage/fail/non_enum_input.rs +10 -0
  141. package/contracts/macro-integration-tests/tests/ui/storage/fail/non_enum_input.stderr +7 -0
  142. package/contracts/macro-integration-tests/tests/ui/storage/fail/storage_attr_rejects_args.rs +12 -0
  143. package/contracts/macro-integration-tests/tests/ui/storage/fail/storage_attr_rejects_args.stderr +7 -0
  144. package/contracts/macro-integration-tests/tests/ui/storage/fail/tuple_variant_rejected.rs +13 -0
  145. package/contracts/macro-integration-tests/tests/ui/storage/fail/tuple_variant_rejected.stderr +7 -0
  146. package/contracts/macro-integration-tests/tests/ui/storage/fail/unknown_variant_attr.rs +13 -0
  147. package/contracts/macro-integration-tests/tests/ui/storage/fail/unknown_variant_attr.stderr +7 -0
  148. package/contracts/macro-integration-tests/tests/ui/storage/pass/default_value_on_variant.rs +14 -0
  149. package/contracts/macro-integration-tests/tests/ui/storage/pass/enum_instance_unit_basic.rs +14 -0
  150. package/contracts/macro-integration-tests/tests/ui/storage/pass/enum_persistent_named_fields_keyed.rs +16 -0
  151. package/contracts/macro-integration-tests/tests/ui/storage/pass/enum_temporary_unit_option.rs +15 -0
  152. package/contracts/macro-integration-tests/tests/ui/storage/pass/name_override.rs +14 -0
  153. package/contracts/macro-integration-tests/tests/ui/storage/pass/no_auto_ttl_extension.rs +19 -0
  154. package/contracts/macro-integration-tests/tests/ui/storage/pass/ttl_provider_basic.rs +15 -0
  155. package/contracts/macro-integration-tests/tests/ui/ttl_configurable/pass/minimal_contract.rs +44 -0
  156. package/contracts/macro-integration-tests/tests/ui_error.rs +11 -0
  157. package/contracts/macro-integration-tests/tests/ui_ownable.rs +11 -0
  158. package/contracts/macro-integration-tests/tests/ui_storage.rs +11 -0
  159. package/contracts/macro-integration-tests/tests/ui_ttl_configurable.rs +12 -0
  160. package/contracts/message-libs/blocked-message-lib/src/lib.rs +17 -17
  161. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/decode_packet_header.rs +64 -0
  162. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/encode_packet.rs +58 -0
  163. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/encode_packet_header.rs +138 -0
  164. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/mod.rs +6 -0
  165. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/payload.rs +30 -0
  166. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/payload_hash.rs +15 -0
  167. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/test_helper.rs +39 -0
  168. package/contracts/message-libs/message-lib-common/src/tests/worker_options/append_dvn_option.rs +57 -0
  169. package/contracts/message-libs/message-lib-common/src/tests/worker_options/append_lz_receive_option.rs +50 -0
  170. package/contracts/message-libs/message-lib-common/src/tests/worker_options/append_native_drop_option.rs +74 -0
  171. package/contracts/message-libs/message-lib-common/src/tests/worker_options/convert_legacy_options.rs +280 -0
  172. package/contracts/message-libs/message-lib-common/src/tests/worker_options/extract_type_3_options.rs +126 -0
  173. package/contracts/message-libs/message-lib-common/src/tests/worker_options/left_pad_to_bytes32.rs +48 -0
  174. package/contracts/message-libs/message-lib-common/src/tests/worker_options/mod.rs +7 -0
  175. package/contracts/message-libs/message-lib-common/src/tests/worker_options/split_worker_options.rs +139 -0
  176. package/contracts/message-libs/message-lib-common/src/worker_options.rs +31 -1
  177. package/contracts/message-libs/simple-message-lib/src/simple_message_lib.rs +2 -2
  178. package/contracts/message-libs/treasury/src/errors.rs +0 -1
  179. package/contracts/message-libs/treasury/src/lib.rs +3 -3
  180. package/contracts/message-libs/treasury/src/storage.rs +2 -0
  181. package/contracts/message-libs/treasury/src/treasury.rs +12 -13
  182. package/contracts/message-libs/uln-302/Cargo.toml +1 -1
  183. package/contracts/message-libs/uln-302/src/errors.rs +0 -5
  184. package/contracts/message-libs/uln-302/src/events.rs +5 -6
  185. package/contracts/message-libs/uln-302/src/receive_uln.rs +24 -54
  186. package/contracts/message-libs/uln-302/src/send_uln.rs +89 -135
  187. package/contracts/message-libs/uln-302/src/storage.rs +5 -5
  188. package/contracts/message-libs/uln-302/src/tests/receive_uln302/effective_receive_uln_config.rs +5 -7
  189. package/contracts/message-libs/uln-302/src/tests/receive_uln302/set_default_receive_uln_configs.rs +3 -3
  190. package/contracts/message-libs/uln-302/src/tests/send_uln302/effective_send_uln_config.rs +6 -9
  191. package/contracts/message-libs/uln-302/src/tests/send_uln302/set_default_executor_configs.rs +2 -2
  192. package/contracts/message-libs/uln-302/src/tests/send_uln302/set_default_send_uln_configs.rs +3 -3
  193. package/contracts/message-libs/uln-302/src/tests/setup.rs +9 -0
  194. package/contracts/message-libs/uln-302/src/tests/testing_utils.rs +5 -0
  195. package/contracts/message-libs/uln-302/src/tests/uln302/get_app_receive_uln_config.rs +1 -2
  196. package/contracts/message-libs/uln-302/src/tests/uln302/get_app_send_uln_config.rs +1 -2
  197. package/contracts/message-libs/uln-302/src/tests/uln302/set_config.rs +37 -55
  198. package/contracts/message-libs/uln-302/src/uln302.rs +8 -5
  199. package/contracts/oapps/counter/src/counter.rs +0 -1
  200. package/contracts/oapps/oapp/src/macro_tests/test_macros.rs +306 -224
  201. package/contracts/oapps/oapp/src/tests/test_oapp_core.rs +0 -1
  202. package/contracts/oapps/oapp/src/tests/test_oapp_options_type3.rs +0 -1
  203. package/contracts/oapps/oapp/src/tests/test_oapp_receiver.rs +0 -1
  204. package/contracts/oapps/oapp/src/tests/test_oapp_sender.rs +0 -1
  205. package/contracts/{oapp-macros → oapps/oapp-macros}/src/oapp_core.rs +1 -0
  206. package/contracts/oapps/oft/integration-tests/setup.rs +10 -3
  207. package/contracts/oapps/oft/integration-tests/utils.rs +1 -1
  208. package/contracts/oapps/oft/src/default_oft_impl.rs +9 -3
  209. package/contracts/oapps/oft/src/extensions/oft_fee.rs +5 -5
  210. package/contracts/oapps/oft/src/extensions/pausable.rs +1 -1
  211. package/contracts/oapps/oft/src/extensions/rate_limiter.rs +18 -18
  212. package/contracts/oapps/oft/src/oft.rs +9 -9
  213. package/contracts/oapps/oft/src/oft_types/lock_unlock.rs +1 -1
  214. package/contracts/oapps/oft/src/tests/extensions/setup.rs +26 -11
  215. package/contracts/oapps/oft/src/tests/extensions/test_rate_limiter.rs +1 -1
  216. package/contracts/oapps/oft/src/tests/test_send.rs +4 -4
  217. package/contracts/oapps/oft/src/tests/test_utils.rs +93 -74
  218. package/contracts/oapps/oft-std/Cargo.toml +6 -0
  219. package/contracts/oapps/oft-std/integration-tests/extensions/mod.rs +3 -0
  220. package/contracts/oapps/oft-std/integration-tests/extensions/test_oft_fee.rs +157 -0
  221. package/contracts/oapps/oft-std/integration-tests/extensions/test_pausable.rs +162 -0
  222. package/contracts/oapps/oft-std/integration-tests/extensions/test_rate_limiter.rs +186 -0
  223. package/contracts/oapps/oft-std/integration-tests/mod.rs +3 -0
  224. package/contracts/oapps/oft-std/integration-tests/setup.rs +245 -0
  225. package/contracts/oapps/oft-std/integration-tests/utils.rs +427 -0
  226. package/contracts/oapps/oft-std/src/lib.rs +12 -1
  227. package/contracts/oapps/oft-std/src/oft.rs +122 -25
  228. package/contracts/upgrader/Cargo.toml +19 -0
  229. package/contracts/upgrader/src/lib.rs +96 -0
  230. package/contracts/upgrader/src/tests/mod.rs +1 -0
  231. package/contracts/upgrader/src/tests/test_data/test_upgradeable_contract1.wasm +0 -0
  232. package/contracts/upgrader/src/tests/test_data/test_upgradeable_contract2.wasm +0 -0
  233. package/contracts/upgrader/src/tests/test_upgrader.rs +120 -0
  234. package/contracts/utils/src/errors.rs +6 -1
  235. package/contracts/utils/src/lib.rs +2 -1
  236. package/contracts/utils/src/ownable.rs +49 -61
  237. package/contracts/utils/src/tests/mod.rs +3 -1
  238. package/contracts/utils/src/tests/option_ext.rs +21 -0
  239. package/contracts/utils/src/tests/ownable.rs +10 -69
  240. package/contracts/utils/src/tests/ttl_configurable.rs +596 -0
  241. package/contracts/utils/src/tests/upgradeable.rs +288 -0
  242. package/contracts/utils/src/{ttl.rs → ttl_configurable.rs} +67 -52
  243. package/contracts/utils/src/upgradeable.rs +54 -0
  244. package/contracts/workers/dvn/Cargo.toml +1 -1
  245. package/contracts/workers/dvn/src/auth.rs +21 -32
  246. package/contracts/workers/dvn/src/dvn.rs +40 -3
  247. package/contracts/workers/dvn/src/errors.rs +1 -0
  248. package/contracts/workers/dvn/src/multisig.rs +10 -6
  249. package/contracts/workers/dvn/src/tests/multisig/set_threshold.rs +2 -2
  250. package/contracts/workers/dvn/src/tests/multisig/verify_signatures.rs +4 -4
  251. package/contracts/workers/dvn-fee-lib/Cargo.toml +1 -2
  252. package/contracts/workers/dvn-fee-lib/src/dvn_fee_lib.rs +46 -14
  253. package/contracts/workers/dvn-fee-lib/src/errors.rs +3 -2
  254. package/contracts/workers/dvn-fee-lib/src/lib.rs +5 -11
  255. package/contracts/workers/dvn-fee-lib/src/tests/dvn_fee_lib.rs +30 -16
  256. package/contracts/workers/executor/src/executor.rs +16 -2
  257. package/contracts/workers/executor-fee-lib/src/errors.rs +9 -7
  258. package/contracts/workers/executor-fee-lib/src/executor_fee_lib.rs +154 -119
  259. package/contracts/workers/executor-helper/Cargo.toml +0 -5
  260. package/contracts/workers/executor-helper/src/lib.rs +1 -7
  261. package/contracts/workers/price-feed/Cargo.toml +0 -1
  262. package/contracts/workers/price-feed/src/errors.rs +3 -2
  263. package/contracts/workers/price-feed/src/lib.rs +5 -6
  264. package/contracts/workers/price-feed/src/price_feed.rs +39 -17
  265. package/contracts/workers/worker/Cargo.toml +4 -0
  266. package/contracts/workers/worker/src/interfaces/price_feed.rs +3 -3
  267. package/contracts/workers/worker/src/lib.rs +2 -2
  268. package/contracts/workers/worker/src/tests/mod.rs +4 -0
  269. package/contracts/workers/worker/src/tests/setup.rs +147 -0
  270. package/contracts/workers/worker/src/tests/worker.rs +501 -0
  271. package/contracts/workers/worker/src/worker.rs +10 -16
  272. package/package.json +3 -3
  273. package/sdk/dist/generated/bml.d.ts +40 -30
  274. package/sdk/dist/generated/bml.js +16 -11
  275. package/sdk/dist/generated/counter.d.ts +168 -134
  276. package/sdk/dist/generated/counter.js +26 -21
  277. package/sdk/dist/generated/dvn.d.ts +1932 -0
  278. package/sdk/dist/generated/dvn.js +288 -0
  279. package/sdk/dist/generated/dvn_fee_lib.d.ts +615 -0
  280. package/sdk/dist/generated/dvn_fee_lib.js +123 -0
  281. package/sdk/dist/generated/endpoint.d.ts +75 -41
  282. package/sdk/dist/generated/endpoint.js +22 -17
  283. package/sdk/dist/generated/executor.d.ts +1809 -0
  284. package/sdk/dist/generated/executor.js +269 -0
  285. package/sdk/dist/generated/executor_fee_lib.d.ts +999 -0
  286. package/sdk/dist/generated/executor_fee_lib.js +208 -0
  287. package/sdk/dist/generated/executor_helper.d.ts +869 -0
  288. package/sdk/dist/generated/executor_helper.js +187 -0
  289. package/sdk/dist/generated/oft_std.d.ts +1544 -0
  290. package/sdk/dist/generated/oft_std.js +271 -0
  291. package/sdk/dist/generated/price_feed.d.ts +1002 -0
  292. package/sdk/dist/generated/price_feed.js +170 -0
  293. package/sdk/dist/generated/sml.d.ts +75 -41
  294. package/sdk/dist/generated/sml.js +22 -17
  295. package/sdk/dist/generated/uln302.d.ts +79 -60
  296. package/sdk/dist/generated/uln302.js +37 -37
  297. package/sdk/dist/generated/upgrader.d.ts +70 -0
  298. package/sdk/dist/generated/upgrader.js +19 -0
  299. package/sdk/dist/index.d.ts +8 -0
  300. package/sdk/dist/index.js +11 -0
  301. package/sdk/package.json +4 -3
  302. package/sdk/src/index.ts +13 -0
  303. package/sdk/test/index.test.ts +0 -1
  304. package/sdk/test/oft.test.ts +12 -23
  305. package/sdk/test/suites/testUpgradeable.ts +169 -0
  306. package/sdk/test/upgrader.test.ts +309 -0
  307. package/tools/ts-bindings-gen/src/main.rs +11 -1
  308. package/contracts/endpoint-v2/src/tests/messaging_channel/clear.rs +0 -316
  309. package/contracts/endpoint-v2/src/tests/messaging_channel/internal.rs +0 -388
  310. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1.rs +0 -162
  311. package/contracts/message-libs/message-lib-common/src/tests/worker_options.rs +0 -319
  312. package/contracts/utils/src/tests/ttl.rs +0 -421
  313. /package/contracts/{oapp-macros → oapps/oapp-macros}/Cargo.toml +0 -0
  314. /package/contracts/{oapp-macros → oapps/oapp-macros}/src/lib.rs +0 -0
  315. /package/contracts/{oapp-macros → oapps/oapp-macros}/src/oapp_full.rs +0 -0
  316. /package/contracts/{oapp-macros → oapps/oapp-macros}/src/oapp_options_type3.rs +0 -0
  317. /package/contracts/{oapp-macros → oapps/oapp-macros}/src/oapp_receiver.rs +0 -0
  318. /package/contracts/{oapp-macros → oapps/oapp-macros}/src/oapp_sender.rs +0 -0
  319. /package/contracts/{oapp-macros → oapps/oapp-macros}/src/util.rs +0 -0
@@ -0,0 +1,999 @@
1
+ import { Buffer } from "buffer";
2
+ import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/contract';
3
+ import type { u32, u64, u128, i128, Option } from '@stellar/stellar-sdk/contract';
4
+ export * from '@stellar/stellar-sdk';
5
+ export * as contract from '@stellar/stellar-sdk/contract';
6
+ export * as rpc from '@stellar/stellar-sdk/rpc';
7
+ export type MigrationData = void;
8
+ export declare const ExecutorFeeLibError: {
9
+ 1: {
10
+ message: string;
11
+ };
12
+ 2: {
13
+ message: string;
14
+ };
15
+ 3: {
16
+ message: string;
17
+ };
18
+ 4: {
19
+ message: string;
20
+ };
21
+ 5: {
22
+ message: string;
23
+ };
24
+ 6: {
25
+ message: string;
26
+ };
27
+ 7: {
28
+ message: string;
29
+ };
30
+ 8: {
31
+ message: string;
32
+ };
33
+ 9: {
34
+ message: string;
35
+ };
36
+ 10: {
37
+ message: string;
38
+ };
39
+ 11: {
40
+ message: string;
41
+ };
42
+ 12: {
43
+ message: string;
44
+ };
45
+ };
46
+ export declare const EndpointError: {
47
+ 1: {
48
+ message: string;
49
+ };
50
+ 2: {
51
+ message: string;
52
+ };
53
+ 3: {
54
+ message: string;
55
+ };
56
+ 4: {
57
+ message: string;
58
+ };
59
+ 5: {
60
+ message: string;
61
+ };
62
+ 6: {
63
+ message: string;
64
+ };
65
+ 7: {
66
+ message: string;
67
+ };
68
+ 8: {
69
+ message: string;
70
+ };
71
+ 9: {
72
+ message: string;
73
+ };
74
+ 10: {
75
+ message: string;
76
+ };
77
+ 11: {
78
+ message: string;
79
+ };
80
+ 12: {
81
+ message: string;
82
+ };
83
+ 13: {
84
+ message: string;
85
+ };
86
+ 14: {
87
+ message: string;
88
+ };
89
+ 15: {
90
+ message: string;
91
+ };
92
+ 16: {
93
+ message: string;
94
+ };
95
+ 17: {
96
+ message: string;
97
+ };
98
+ 18: {
99
+ message: string;
100
+ };
101
+ 19: {
102
+ message: string;
103
+ };
104
+ 20: {
105
+ message: string;
106
+ };
107
+ 21: {
108
+ message: string;
109
+ };
110
+ 22: {
111
+ message: string;
112
+ };
113
+ 23: {
114
+ message: string;
115
+ };
116
+ 24: {
117
+ message: string;
118
+ };
119
+ };
120
+ /**
121
+ * Parameters for sending a cross-chain message.
122
+ */
123
+ export interface MessagingParams {
124
+ /**
125
+ * Destination endpoint ID (chain identifier).
126
+ */
127
+ dst_eid: u32;
128
+ /**
129
+ * The message payload to send.
130
+ */
131
+ message: Buffer;
132
+ /**
133
+ * Encoded executor and DVN options.
134
+ */
135
+ options: Buffer;
136
+ /**
137
+ * Whether to pay fees in ZRO token instead of native token.
138
+ */
139
+ pay_in_zro: boolean;
140
+ /**
141
+ * Receiver address on the destination chain (32 bytes).
142
+ */
143
+ receiver: Buffer;
144
+ }
145
+ /**
146
+ * Source message information identifying where a cross-chain message came from.
147
+ */
148
+ export interface Origin {
149
+ /**
150
+ * Nonce for this pathway.
151
+ */
152
+ nonce: u64;
153
+ /**
154
+ * Sender address on the source chain (32 bytes).
155
+ */
156
+ sender: Buffer;
157
+ /**
158
+ * Source endpoint ID (chain identifier).
159
+ */
160
+ src_eid: u32;
161
+ }
162
+ /**
163
+ * Fee structure for cross-chain messaging.
164
+ */
165
+ export interface MessagingFee {
166
+ /**
167
+ * Fee paid in native token (XLM).
168
+ */
169
+ native_fee: i128;
170
+ /**
171
+ * Fee paid in ZRO token (LayerZero token).
172
+ */
173
+ zro_fee: i128;
174
+ }
175
+ /**
176
+ * Receipt returned after successfully sending a cross-chain message.
177
+ */
178
+ export interface MessagingReceipt {
179
+ /**
180
+ * The fees charged for sending the message.
181
+ */
182
+ fee: MessagingFee;
183
+ /**
184
+ * Globally unique identifier for the message.
185
+ */
186
+ guid: Buffer;
187
+ /**
188
+ * The outbound nonce for this pathway.
189
+ */
190
+ nonce: u64;
191
+ }
192
+ /**
193
+ * Type of message library indicating supported operations.
194
+ */
195
+ export type MessageLibType = {
196
+ tag: "Send";
197
+ values: void;
198
+ } | {
199
+ tag: "Receive";
200
+ values: void;
201
+ } | {
202
+ tag: "SendAndReceive";
203
+ values: void;
204
+ };
205
+ /**
206
+ * Version information for a message library.
207
+ *
208
+ * Note: `minor` and `endpoint_version` use `u32` instead of `u8` because Stellar does not
209
+ * support `u8` types in contract interface functions.
210
+ */
211
+ export interface MessageLibVersion {
212
+ /**
213
+ * Endpoint version (should not exceed u8::MAX = 255).
214
+ */
215
+ endpoint_version: u32;
216
+ /**
217
+ * Major version number.
218
+ */
219
+ major: u64;
220
+ /**
221
+ * Minor version number (should not exceed u8::MAX = 255).
222
+ */
223
+ minor: u32;
224
+ }
225
+ /**
226
+ * Timeout configuration for receive library transitions.
227
+ */
228
+ export interface Timeout {
229
+ /**
230
+ * Unix timestamp when the timeout expires.
231
+ */
232
+ expiry: u64;
233
+ /**
234
+ * The new library address to transition to.
235
+ */
236
+ lib: string;
237
+ }
238
+ /**
239
+ * Parameters for setting message library configuration.
240
+ */
241
+ export interface SetConfigParam {
242
+ /**
243
+ * XDR-encoded configuration data.
244
+ */
245
+ config: Buffer;
246
+ /**
247
+ * The type of configuration (e.g., executor, ULN).
248
+ */
249
+ config_type: u32;
250
+ /**
251
+ * The endpoint ID this config applies to.
252
+ */
253
+ eid: u32;
254
+ }
255
+ /**
256
+ * Resolved library information with default status.
257
+ */
258
+ export interface ResolvedLibrary {
259
+ /**
260
+ * Whether this is the default library (true) or OApp-specific (false).
261
+ */
262
+ is_default: boolean;
263
+ /**
264
+ * The resolved library address.
265
+ */
266
+ lib: string;
267
+ }
268
+ /**
269
+ * Outbound packet containing all information for cross-chain transmission.
270
+ */
271
+ export interface OutboundPacket {
272
+ /**
273
+ * Destination endpoint ID.
274
+ */
275
+ dst_eid: u32;
276
+ /**
277
+ * Globally unique identifier for this message.
278
+ */
279
+ guid: Buffer;
280
+ /**
281
+ * The message payload.
282
+ */
283
+ message: Buffer;
284
+ /**
285
+ * Outbound nonce for this pathway.
286
+ */
287
+ nonce: u64;
288
+ /**
289
+ * Receiver address on destination chain (32 bytes).
290
+ */
291
+ receiver: Buffer;
292
+ /**
293
+ * Sender address on source chain.
294
+ */
295
+ sender: string;
296
+ /**
297
+ * Source endpoint ID.
298
+ */
299
+ src_eid: u32;
300
+ }
301
+ /**
302
+ * A fee recipient with the amount to be paid.
303
+ */
304
+ export interface FeeRecipient {
305
+ /**
306
+ * Amount of fee to pay.
307
+ */
308
+ amount: i128;
309
+ /**
310
+ * The address to send the fee to.
311
+ */
312
+ to: string;
313
+ }
314
+ /**
315
+ * Result of send operation containing fees and encoded packet.
316
+ */
317
+ export interface FeesAndPacket {
318
+ /**
319
+ * The encoded packet ready for transmission.
320
+ */
321
+ encoded_packet: Buffer;
322
+ /**
323
+ * List of native token fee recipients (executor, DVNs, treasury).
324
+ */
325
+ native_fee_recipients: Array<FeeRecipient>;
326
+ /**
327
+ * List of ZRO token fee recipients (treasury).
328
+ */
329
+ zro_fee_recipients: Array<FeeRecipient>;
330
+ }
331
+ export declare const PacketCodecV1Error: {
332
+ 1001: {
333
+ message: string;
334
+ };
335
+ 1002: {
336
+ message: string;
337
+ };
338
+ };
339
+ export declare const WorkerOptionsError: {
340
+ 1101: {
341
+ message: string;
342
+ };
343
+ 1102: {
344
+ message: string;
345
+ };
346
+ 1103: {
347
+ message: string;
348
+ };
349
+ 1104: {
350
+ message: string;
351
+ };
352
+ 1105: {
353
+ message: string;
354
+ };
355
+ 1106: {
356
+ message: string;
357
+ };
358
+ 1107: {
359
+ message: string;
360
+ };
361
+ 1108: {
362
+ message: string;
363
+ };
364
+ 1109: {
365
+ message: string;
366
+ };
367
+ };
368
+ export declare const BufferReaderError: {
369
+ 1000: {
370
+ message: string;
371
+ };
372
+ 1001: {
373
+ message: string;
374
+ };
375
+ };
376
+ export declare const BufferWriterError: {
377
+ 1100: {
378
+ message: string;
379
+ };
380
+ };
381
+ export declare const TtlConfigurableError: {
382
+ 1200: {
383
+ message: string;
384
+ };
385
+ 1201: {
386
+ message: string;
387
+ };
388
+ 1202: {
389
+ message: string;
390
+ };
391
+ };
392
+ export declare const OwnableError: {
393
+ 1300: {
394
+ message: string;
395
+ };
396
+ 1301: {
397
+ message: string;
398
+ };
399
+ };
400
+ export declare const BytesExtError: {
401
+ 1400: {
402
+ message: string;
403
+ };
404
+ };
405
+ export declare const UpgradeableError: {
406
+ 1500: {
407
+ message: string;
408
+ };
409
+ };
410
+ export type OwnableStorage = {
411
+ tag: "Owner";
412
+ values: void;
413
+ };
414
+ /**
415
+ * TTL configuration: threshold (when to extend) and extend_to (target TTL).
416
+ */
417
+ export interface TtlConfig {
418
+ /**
419
+ * Target TTL after extension (in ledgers).
420
+ */
421
+ extend_to: u32;
422
+ /**
423
+ * TTL threshold that triggers extension (in ledgers).
424
+ */
425
+ threshold: u32;
426
+ }
427
+ export type TtlConfigStorage = {
428
+ tag: "Frozen";
429
+ values: void;
430
+ } | {
431
+ tag: "Instance";
432
+ values: void;
433
+ } | {
434
+ tag: "Persistent";
435
+ values: void;
436
+ };
437
+ export type UpgradeableStorage = {
438
+ tag: "Migrating";
439
+ values: void;
440
+ };
441
+ export declare const WorkerError: {
442
+ 1200: {
443
+ message: string;
444
+ };
445
+ 1201: {
446
+ message: string;
447
+ };
448
+ 1202: {
449
+ message: string;
450
+ };
451
+ 1203: {
452
+ message: string;
453
+ };
454
+ 1204: {
455
+ message: string;
456
+ };
457
+ 1205: {
458
+ message: string;
459
+ };
460
+ 1206: {
461
+ message: string;
462
+ };
463
+ 1207: {
464
+ message: string;
465
+ };
466
+ 1208: {
467
+ message: string;
468
+ };
469
+ 1209: {
470
+ message: string;
471
+ };
472
+ 1210: {
473
+ message: string;
474
+ };
475
+ 1211: {
476
+ message: string;
477
+ };
478
+ 1212: {
479
+ message: string;
480
+ };
481
+ 1213: {
482
+ message: string;
483
+ };
484
+ 1214: {
485
+ message: string;
486
+ };
487
+ 1215: {
488
+ message: string;
489
+ };
490
+ 1216: {
491
+ message: string;
492
+ };
493
+ 1217: {
494
+ message: string;
495
+ };
496
+ 1218: {
497
+ message: string;
498
+ };
499
+ };
500
+ /**
501
+ * Parameters for DVN fee calculation.
502
+ *
503
+ * Contains all inputs needed by the fee library to calculate verification fees
504
+ * for cross-chain messages. Includes message parameters, common configuration,
505
+ * and destination-specific settings.
506
+ */
507
+ export interface DvnFeeParams {
508
+ /**
509
+ * Number of block confirmations required.
510
+ */
511
+ confirmations: u64;
512
+ /**
513
+ * Default fee multiplier in basis points (used if no dst-specific multiplier).
514
+ */
515
+ default_multiplier_bps: u32;
516
+ /**
517
+ * Destination endpoint ID (chain identifier).
518
+ */
519
+ dst_eid: u32;
520
+ /**
521
+ * Minimum fee margin in USD (scaled).
522
+ */
523
+ floor_margin_usd: u128;
524
+ /**
525
+ * ============================================================================================
526
+ * Destination-Specific Configuration
527
+ * ============================================================================================
528
+ * Gas estimate for verification on destination chain.
529
+ */
530
+ gas: u128;
531
+ /**
532
+ * Destination-specific fee multiplier in basis points (0 = use default).
533
+ */
534
+ multiplier_bps: u32;
535
+ /**
536
+ * DVN options
537
+ */
538
+ options: Buffer;
539
+ /**
540
+ * ============================================================================================
541
+ * Common Configuration
542
+ * ============================================================================================
543
+ * Price feed contract address for gas price and exchange rate data.
544
+ */
545
+ price_feed: string;
546
+ /**
547
+ * Number of required signatures (quorum).
548
+ */
549
+ quorum: u32;
550
+ /**
551
+ * ============================================================================================
552
+ * Message Parameters
553
+ * ============================================================================================
554
+ * The OApp sender address.
555
+ */
556
+ sender: string;
557
+ }
558
+ /**
559
+ * Parameters for executor fee calculation.
560
+ *
561
+ * Contains all inputs needed by the fee library to calculate execution fees
562
+ * for cross-chain messages. Includes message parameters, common configuration,
563
+ * and destination-specific settings.
564
+ */
565
+ export interface FeeParams {
566
+ /**
567
+ * Size of the message calldata in bytes.
568
+ */
569
+ calldata_size: u32;
570
+ /**
571
+ * Default fee multiplier in basis points (used if no dst-specific multiplier).
572
+ */
573
+ default_multiplier_bps: u32;
574
+ /**
575
+ * Destination endpoint ID (chain identifier).
576
+ */
577
+ dst_eid: u32;
578
+ /**
579
+ * Minimum fee margin in USD (scaled).
580
+ */
581
+ floor_margin_usd: u128;
582
+ /**
583
+ * Base gas for each lzCompose call on destination chain.
584
+ */
585
+ lz_compose_base_gas: u64;
586
+ /**
587
+ * ============================================================================================
588
+ * Destination-Specific Configuration
589
+ * ============================================================================================
590
+ * Base gas for lzReceive execution on destination chain.
591
+ */
592
+ lz_receive_base_gas: u64;
593
+ /**
594
+ * Destination-specific fee multiplier in basis points (0 = use default).
595
+ */
596
+ multiplier_bps: u32;
597
+ /**
598
+ * Maximum native token value that can be sent.
599
+ */
600
+ native_cap: u128;
601
+ /**
602
+ * Encoded executor options (lzReceive gas, lzCompose, nativeDrop, etc.).
603
+ */
604
+ options: Buffer;
605
+ /**
606
+ * ============================================================================================
607
+ * Common Configuration
608
+ * ============================================================================================
609
+ * Price feed contract address for gas price and exchange rate data.
610
+ */
611
+ price_feed: string;
612
+ /**
613
+ * ============================================================================================
614
+ * Message Parameters
615
+ * ============================================================================================
616
+ * The OApp sender address.
617
+ */
618
+ sender: string;
619
+ }
620
+ /**
621
+ * Gas price information for a destination endpoint.
622
+ *
623
+ * Contains the exchange rate and gas costs needed for cross-chain fee calculations.
624
+ */
625
+ export interface Price {
626
+ /**
627
+ * Gas cost per byte of calldata on the destination chain.
628
+ */
629
+ gas_per_byte: u32;
630
+ /**
631
+ * Gas price in the smallest unit (wei for EVM, stroops for Stellar).
632
+ */
633
+ gas_price_in_unit: u64;
634
+ /**
635
+ * Price ratio = (remote native token price / local native token price) * PRICE_RATIO_DENOMINATOR.
636
+ * Used to convert destination chain gas costs to source chain native token.
637
+ */
638
+ price_ratio: u128;
639
+ }
640
+ /**
641
+ * Fee estimation result with detailed breakdown.
642
+ *
643
+ * Contains the calculated fee and all intermediate values used in the calculation.
644
+ */
645
+ export interface FeeEstimate {
646
+ /**
647
+ * Source chain native token price in USD (scaled).
648
+ */
649
+ native_price_usd: u128;
650
+ /**
651
+ * Price ratio used for the calculation.
652
+ */
653
+ price_ratio: u128;
654
+ /**
655
+ * Denominator for the price ratio (typically 10^20).
656
+ */
657
+ price_ratio_denominator: u128;
658
+ /**
659
+ * Total gas fee in source chain native token units.
660
+ */
661
+ total_gas_fee: i128;
662
+ }
663
+ export type WorkerStorage = {
664
+ tag: "Paused";
665
+ values: void;
666
+ } | {
667
+ tag: "DepositAddress";
668
+ values: void;
669
+ } | {
670
+ tag: "PriceFeed";
671
+ values: void;
672
+ } | {
673
+ tag: "WorkerFeeLib";
674
+ values: void;
675
+ } | {
676
+ tag: "DefaultMultiplierBps";
677
+ values: void;
678
+ } | {
679
+ tag: "SupportedOptionTypes";
680
+ values: readonly [u32];
681
+ } | {
682
+ tag: "MessageLibs";
683
+ values: void;
684
+ } | {
685
+ tag: "Allowlist";
686
+ values: readonly [string];
687
+ } | {
688
+ tag: "Denylist";
689
+ values: readonly [string];
690
+ } | {
691
+ tag: "AllowlistSize";
692
+ values: void;
693
+ } | {
694
+ tag: "Admins";
695
+ values: void;
696
+ };
697
+ export interface Client {
698
+ /**
699
+ * Construct and simulate a upgrade transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
700
+ */
701
+ upgrade: ({ new_wasm_hash }: {
702
+ new_wasm_hash: Buffer;
703
+ }, txnOptions?: {
704
+ /**
705
+ * The fee to pay for the transaction. Default: BASE_FEE
706
+ */
707
+ fee?: number;
708
+ /**
709
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
710
+ */
711
+ timeoutInSeconds?: number;
712
+ /**
713
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
714
+ */
715
+ simulate?: boolean;
716
+ }) => Promise<AssembledTransaction<null>>;
717
+ /**
718
+ * Construct and simulate a migrate transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
719
+ */
720
+ migrate: ({ migration_data }: {
721
+ migration_data: MigrationData;
722
+ }, txnOptions?: {
723
+ /**
724
+ * The fee to pay for the transaction. Default: BASE_FEE
725
+ */
726
+ fee?: number;
727
+ /**
728
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
729
+ */
730
+ timeoutInSeconds?: number;
731
+ /**
732
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
733
+ */
734
+ simulate?: boolean;
735
+ }) => Promise<AssembledTransaction<null>>;
736
+ /**
737
+ * Construct and simulate a extend_instance_ttl transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
738
+ * Extends the instance TTL.
739
+ *
740
+ * # Arguments
741
+ *
742
+ * * `threshold` - The threshold to extend the TTL.
743
+ * * `extend_to` - The TTL to extend to.
744
+ */
745
+ extend_instance_ttl: ({ threshold, extend_to }: {
746
+ threshold: u32;
747
+ extend_to: u32;
748
+ }, txnOptions?: {
749
+ /**
750
+ * The fee to pay for the transaction. Default: BASE_FEE
751
+ */
752
+ fee?: number;
753
+ /**
754
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
755
+ */
756
+ timeoutInSeconds?: number;
757
+ /**
758
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
759
+ */
760
+ simulate?: boolean;
761
+ }) => Promise<AssembledTransaction<null>>;
762
+ /**
763
+ * Construct and simulate a get_fee transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
764
+ * Calculates the total execution fee for a cross-chain message.
765
+ *
766
+ * Decodes executor options, estimates gas fees from the price feed, applies
767
+ * multipliers and margins, and converts native token values. Returns the
768
+ * total fee in native tokens.
769
+ *
770
+ * # Arguments
771
+ * * `executor` - Executor contract address (unused, kept for interface compatibility)
772
+ * * `params` - Fee calculation parameters
773
+ *
774
+ * # Returns
775
+ * Total execution fee in native tokens.
776
+ *
777
+ * # Errors
778
+ * * `EidNotSupported` - If destination endpoint is not supported (lz_receive_base_gas is 0)
779
+ * * Various executor option parsing errors (see `parse_executor_options`)
780
+ */
781
+ get_fee: ({ executor, params }: {
782
+ executor: string;
783
+ params: FeeParams;
784
+ }, txnOptions?: {
785
+ /**
786
+ * The fee to pay for the transaction. Default: BASE_FEE
787
+ */
788
+ fee?: number;
789
+ /**
790
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
791
+ */
792
+ timeoutInSeconds?: number;
793
+ /**
794
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
795
+ */
796
+ simulate?: boolean;
797
+ }) => Promise<AssembledTransaction<i128>>;
798
+ /**
799
+ * Construct and simulate a version transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
800
+ * Returns the version of the fee library.
801
+ *
802
+ * # Returns
803
+ * Tuple of (major_version, minor_version).
804
+ */
805
+ version: (txnOptions?: {
806
+ /**
807
+ * The fee to pay for the transaction. Default: BASE_FEE
808
+ */
809
+ fee?: number;
810
+ /**
811
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
812
+ */
813
+ timeoutInSeconds?: number;
814
+ /**
815
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
816
+ */
817
+ simulate?: boolean;
818
+ }) => Promise<AssembledTransaction<readonly [u64, u32]>>;
819
+ /**
820
+ * Construct and simulate a owner transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
821
+ * Returns the current owner address, or None if no owner is set.
822
+ */
823
+ owner: (txnOptions?: {
824
+ /**
825
+ * The fee to pay for the transaction. Default: BASE_FEE
826
+ */
827
+ fee?: number;
828
+ /**
829
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
830
+ */
831
+ timeoutInSeconds?: number;
832
+ /**
833
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
834
+ */
835
+ simulate?: boolean;
836
+ }) => Promise<AssembledTransaction<Option<string>>>;
837
+ /**
838
+ * Construct and simulate a transfer_ownership transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
839
+ * Transfers ownership to a new address. Requires current owner authorization.
840
+ */
841
+ transfer_ownership: ({ new_owner }: {
842
+ new_owner: string;
843
+ }, txnOptions?: {
844
+ /**
845
+ * The fee to pay for the transaction. Default: BASE_FEE
846
+ */
847
+ fee?: number;
848
+ /**
849
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
850
+ */
851
+ timeoutInSeconds?: number;
852
+ /**
853
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
854
+ */
855
+ simulate?: boolean;
856
+ }) => Promise<AssembledTransaction<null>>;
857
+ /**
858
+ * Construct and simulate a renounce_ownership transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
859
+ * Permanently renounces ownership. Requires current owner authorization.
860
+ */
861
+ renounce_ownership: (txnOptions?: {
862
+ /**
863
+ * The fee to pay for the transaction. Default: BASE_FEE
864
+ */
865
+ fee?: number;
866
+ /**
867
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
868
+ */
869
+ timeoutInSeconds?: number;
870
+ /**
871
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
872
+ */
873
+ simulate?: boolean;
874
+ }) => Promise<AssembledTransaction<null>>;
875
+ /**
876
+ * Construct and simulate a set_ttl_configs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
877
+ * Sets TTL configs for instance and persistent storage.
878
+ *
879
+ * - `None` values remove the corresponding config (disables auto-extension for that type)
880
+ * - Validates that `threshold <= extend_to <= MAX_TTL`
881
+ *
882
+ * # Arguments
883
+ * - `instance` - TTL config for instance storage
884
+ * - `persistent` - TTL config for persistent storage
885
+ *
886
+ * # Panics
887
+ * - `TtlConfigFrozen` if configs are frozen
888
+ * - `InvalidTtlConfig` if validation fails
889
+ */
890
+ set_ttl_configs: ({ instance, persistent }: {
891
+ instance: Option<TtlConfig>;
892
+ persistent: Option<TtlConfig>;
893
+ }, txnOptions?: {
894
+ /**
895
+ * The fee to pay for the transaction. Default: BASE_FEE
896
+ */
897
+ fee?: number;
898
+ /**
899
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
900
+ */
901
+ timeoutInSeconds?: number;
902
+ /**
903
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
904
+ */
905
+ simulate?: boolean;
906
+ }) => Promise<AssembledTransaction<null>>;
907
+ /**
908
+ * Construct and simulate a ttl_configs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
909
+ * Returns the current TTL configs as (instance_config, persistent_config).
910
+ */
911
+ ttl_configs: (txnOptions?: {
912
+ /**
913
+ * The fee to pay for the transaction. Default: BASE_FEE
914
+ */
915
+ fee?: number;
916
+ /**
917
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
918
+ */
919
+ timeoutInSeconds?: number;
920
+ /**
921
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
922
+ */
923
+ simulate?: boolean;
924
+ }) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>>;
925
+ /**
926
+ * Construct and simulate a freeze_ttl_configs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
927
+ * Permanently freezes TTL configs, preventing any future modifications.
928
+ *
929
+ * This is irreversible and provides immutability guarantees to users.
930
+ * Emits `TtlConfigsFrozen` event.
931
+ *
932
+ * # Panics
933
+ * - `TtlConfigAlreadyFrozen` if already frozen
934
+ */
935
+ freeze_ttl_configs: (txnOptions?: {
936
+ /**
937
+ * The fee to pay for the transaction. Default: BASE_FEE
938
+ */
939
+ fee?: number;
940
+ /**
941
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
942
+ */
943
+ timeoutInSeconds?: number;
944
+ /**
945
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
946
+ */
947
+ simulate?: boolean;
948
+ }) => Promise<AssembledTransaction<null>>;
949
+ /**
950
+ * Construct and simulate a is_ttl_configs_frozen transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
951
+ * Returns whether TTL configs are frozen.
952
+ */
953
+ is_ttl_configs_frozen: (txnOptions?: {
954
+ /**
955
+ * The fee to pay for the transaction. Default: BASE_FEE
956
+ */
957
+ fee?: number;
958
+ /**
959
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
960
+ */
961
+ timeoutInSeconds?: number;
962
+ /**
963
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
964
+ */
965
+ simulate?: boolean;
966
+ }) => Promise<AssembledTransaction<boolean>>;
967
+ }
968
+ export declare class Client extends ContractClient {
969
+ readonly options: ContractClientOptions;
970
+ static deploy<T = Client>(
971
+ /** Constructor/Initialization Args for the contract's `__constructor` method */
972
+ { owner }: {
973
+ owner: string;
974
+ },
975
+ /** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
976
+ options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
977
+ /** The hash of the Wasm blob, which must already be installed on-chain. */
978
+ wasmHash: Buffer | string;
979
+ /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
980
+ salt?: Buffer | Uint8Array;
981
+ /** The format used to decode `wasmHash`, if it's provided as a string. */
982
+ format?: "hex" | "base64";
983
+ }): Promise<AssembledTransaction<T>>;
984
+ constructor(options: ContractClientOptions);
985
+ readonly fromJSON: {
986
+ upgrade: (json: string) => AssembledTransaction<null>;
987
+ migrate: (json: string) => AssembledTransaction<null>;
988
+ extend_instance_ttl: (json: string) => AssembledTransaction<null>;
989
+ get_fee: (json: string) => AssembledTransaction<bigint>;
990
+ version: (json: string) => AssembledTransaction<readonly [bigint, number]>;
991
+ owner: (json: string) => AssembledTransaction<Option<string>>;
992
+ transfer_ownership: (json: string) => AssembledTransaction<null>;
993
+ renounce_ownership: (json: string) => AssembledTransaction<null>;
994
+ set_ttl_configs: (json: string) => AssembledTransaction<null>;
995
+ ttl_configs: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>;
996
+ freeze_ttl_configs: (json: string) => AssembledTransaction<null>;
997
+ is_ttl_configs_frozen: (json: string) => AssembledTransaction<boolean>;
998
+ };
999
+ }