@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,1002 @@
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 type PriceFeedStorage = {
9
+ tag: "PriceRatioDenominator";
10
+ values: void;
11
+ } | {
12
+ tag: "PriceUpdater";
13
+ values: readonly [string];
14
+ } | {
15
+ tag: "DefaultModelPrice";
16
+ values: readonly [u32];
17
+ } | {
18
+ tag: "ArbitrumPriceExt";
19
+ values: void;
20
+ } | {
21
+ tag: "NativePriceUSD";
22
+ values: void;
23
+ } | {
24
+ tag: "ArbitrumCompressionPercent";
25
+ values: void;
26
+ } | {
27
+ tag: "EidToModelType";
28
+ values: readonly [u32];
29
+ };
30
+ export declare const PriceFeedError: {
31
+ 1: {
32
+ message: string;
33
+ };
34
+ 2: {
35
+ message: string;
36
+ };
37
+ 3: {
38
+ message: string;
39
+ };
40
+ 4: {
41
+ message: string;
42
+ };
43
+ 5: {
44
+ message: string;
45
+ };
46
+ };
47
+ /**
48
+ * Arbitrum-specific price extension
49
+ */
50
+ export interface ArbitrumPriceExt {
51
+ /**
52
+ * Gas cost per byte of L1 calldata (for Arbitrum's L1 data posting)
53
+ */
54
+ gas_per_l1_calldata_byte: u32;
55
+ /**
56
+ * Gas overhead per L2 transaction
57
+ */
58
+ gas_per_l2_tx: u64;
59
+ }
60
+ /**
61
+ * Parameter for updating a single price
62
+ */
63
+ export interface UpdatePrice {
64
+ /**
65
+ * Destination endpoint ID
66
+ */
67
+ eid: u32;
68
+ /**
69
+ * Price information for the destination
70
+ */
71
+ price: Price;
72
+ }
73
+ /**
74
+ * Parameter for updating Arbitrum price with extension
75
+ */
76
+ export interface UpdatePriceExt {
77
+ /**
78
+ * Destination endpoint ID (should be an Arbitrum endpoint)
79
+ */
80
+ eid: u32;
81
+ /**
82
+ * Arbitrum-specific pricing extension
83
+ */
84
+ extend: ArbitrumPriceExt;
85
+ /**
86
+ * Price information for the destination
87
+ */
88
+ price: Price;
89
+ }
90
+ /**
91
+ * Fee model type for different chain architectures
92
+ */
93
+ export declare enum ModelType {
94
+ Default = 0,
95
+ ArbStack = 1,
96
+ OpStack = 2
97
+ }
98
+ /**
99
+ * Parameter for setting EID to model type mapping
100
+ */
101
+ export interface SetEidToModelTypeParam {
102
+ /**
103
+ * Destination endpoint ID
104
+ */
105
+ dst_eid: u32;
106
+ /**
107
+ * Fee model type for this destination
108
+ */
109
+ model_type: ModelType;
110
+ }
111
+ export declare const BufferReaderError: {
112
+ 1000: {
113
+ message: string;
114
+ };
115
+ 1001: {
116
+ message: string;
117
+ };
118
+ };
119
+ export declare const BufferWriterError: {
120
+ 1100: {
121
+ message: string;
122
+ };
123
+ };
124
+ export declare const TtlConfigurableError: {
125
+ 1200: {
126
+ message: string;
127
+ };
128
+ 1201: {
129
+ message: string;
130
+ };
131
+ 1202: {
132
+ message: string;
133
+ };
134
+ };
135
+ export declare const OwnableError: {
136
+ 1300: {
137
+ message: string;
138
+ };
139
+ 1301: {
140
+ message: string;
141
+ };
142
+ };
143
+ export declare const BytesExtError: {
144
+ 1400: {
145
+ message: string;
146
+ };
147
+ };
148
+ export declare const UpgradeableError: {
149
+ 1500: {
150
+ message: string;
151
+ };
152
+ };
153
+ export type OwnableStorage = {
154
+ tag: "Owner";
155
+ values: void;
156
+ };
157
+ /**
158
+ * TTL configuration: threshold (when to extend) and extend_to (target TTL).
159
+ */
160
+ export interface TtlConfig {
161
+ /**
162
+ * Target TTL after extension (in ledgers).
163
+ */
164
+ extend_to: u32;
165
+ /**
166
+ * TTL threshold that triggers extension (in ledgers).
167
+ */
168
+ threshold: u32;
169
+ }
170
+ export type TtlConfigStorage = {
171
+ tag: "Frozen";
172
+ values: void;
173
+ } | {
174
+ tag: "Instance";
175
+ values: void;
176
+ } | {
177
+ tag: "Persistent";
178
+ values: void;
179
+ };
180
+ export type UpgradeableStorage = {
181
+ tag: "Migrating";
182
+ values: void;
183
+ };
184
+ export declare const WorkerError: {
185
+ 1200: {
186
+ message: string;
187
+ };
188
+ 1201: {
189
+ message: string;
190
+ };
191
+ 1202: {
192
+ message: string;
193
+ };
194
+ 1203: {
195
+ message: string;
196
+ };
197
+ 1204: {
198
+ message: string;
199
+ };
200
+ 1205: {
201
+ message: string;
202
+ };
203
+ 1206: {
204
+ message: string;
205
+ };
206
+ 1207: {
207
+ message: string;
208
+ };
209
+ 1208: {
210
+ message: string;
211
+ };
212
+ 1209: {
213
+ message: string;
214
+ };
215
+ 1210: {
216
+ message: string;
217
+ };
218
+ 1211: {
219
+ message: string;
220
+ };
221
+ 1212: {
222
+ message: string;
223
+ };
224
+ 1213: {
225
+ message: string;
226
+ };
227
+ 1214: {
228
+ message: string;
229
+ };
230
+ 1215: {
231
+ message: string;
232
+ };
233
+ 1216: {
234
+ message: string;
235
+ };
236
+ 1217: {
237
+ message: string;
238
+ };
239
+ 1218: {
240
+ message: string;
241
+ };
242
+ };
243
+ /**
244
+ * Parameters for DVN fee calculation.
245
+ *
246
+ * Contains all inputs needed by the fee library to calculate verification fees
247
+ * for cross-chain messages. Includes message parameters, common configuration,
248
+ * and destination-specific settings.
249
+ */
250
+ export interface DvnFeeParams {
251
+ /**
252
+ * Number of block confirmations required.
253
+ */
254
+ confirmations: u64;
255
+ /**
256
+ * Default fee multiplier in basis points (used if no dst-specific multiplier).
257
+ */
258
+ default_multiplier_bps: u32;
259
+ /**
260
+ * Destination endpoint ID (chain identifier).
261
+ */
262
+ dst_eid: u32;
263
+ /**
264
+ * Minimum fee margin in USD (scaled).
265
+ */
266
+ floor_margin_usd: u128;
267
+ /**
268
+ * ============================================================================================
269
+ * Destination-Specific Configuration
270
+ * ============================================================================================
271
+ * Gas estimate for verification on destination chain.
272
+ */
273
+ gas: u128;
274
+ /**
275
+ * Destination-specific fee multiplier in basis points (0 = use default).
276
+ */
277
+ multiplier_bps: u32;
278
+ /**
279
+ * DVN options
280
+ */
281
+ options: Buffer;
282
+ /**
283
+ * ============================================================================================
284
+ * Common Configuration
285
+ * ============================================================================================
286
+ * Price feed contract address for gas price and exchange rate data.
287
+ */
288
+ price_feed: string;
289
+ /**
290
+ * Number of required signatures (quorum).
291
+ */
292
+ quorum: u32;
293
+ /**
294
+ * ============================================================================================
295
+ * Message Parameters
296
+ * ============================================================================================
297
+ * The OApp sender address.
298
+ */
299
+ sender: string;
300
+ }
301
+ /**
302
+ * Parameters for executor fee calculation.
303
+ *
304
+ * Contains all inputs needed by the fee library to calculate execution fees
305
+ * for cross-chain messages. Includes message parameters, common configuration,
306
+ * and destination-specific settings.
307
+ */
308
+ export interface FeeParams {
309
+ /**
310
+ * Size of the message calldata in bytes.
311
+ */
312
+ calldata_size: u32;
313
+ /**
314
+ * Default fee multiplier in basis points (used if no dst-specific multiplier).
315
+ */
316
+ default_multiplier_bps: u32;
317
+ /**
318
+ * Destination endpoint ID (chain identifier).
319
+ */
320
+ dst_eid: u32;
321
+ /**
322
+ * Minimum fee margin in USD (scaled).
323
+ */
324
+ floor_margin_usd: u128;
325
+ /**
326
+ * Base gas for each lzCompose call on destination chain.
327
+ */
328
+ lz_compose_base_gas: u64;
329
+ /**
330
+ * ============================================================================================
331
+ * Destination-Specific Configuration
332
+ * ============================================================================================
333
+ * Base gas for lzReceive execution on destination chain.
334
+ */
335
+ lz_receive_base_gas: u64;
336
+ /**
337
+ * Destination-specific fee multiplier in basis points (0 = use default).
338
+ */
339
+ multiplier_bps: u32;
340
+ /**
341
+ * Maximum native token value that can be sent.
342
+ */
343
+ native_cap: u128;
344
+ /**
345
+ * Encoded executor options (lzReceive gas, lzCompose, nativeDrop, etc.).
346
+ */
347
+ options: Buffer;
348
+ /**
349
+ * ============================================================================================
350
+ * Common Configuration
351
+ * ============================================================================================
352
+ * Price feed contract address for gas price and exchange rate data.
353
+ */
354
+ price_feed: string;
355
+ /**
356
+ * ============================================================================================
357
+ * Message Parameters
358
+ * ============================================================================================
359
+ * The OApp sender address.
360
+ */
361
+ sender: string;
362
+ }
363
+ /**
364
+ * Gas price information for a destination endpoint.
365
+ *
366
+ * Contains the exchange rate and gas costs needed for cross-chain fee calculations.
367
+ */
368
+ export interface Price {
369
+ /**
370
+ * Gas cost per byte of calldata on the destination chain.
371
+ */
372
+ gas_per_byte: u32;
373
+ /**
374
+ * Gas price in the smallest unit (wei for EVM, stroops for Stellar).
375
+ */
376
+ gas_price_in_unit: u64;
377
+ /**
378
+ * Price ratio = (remote native token price / local native token price) * PRICE_RATIO_DENOMINATOR.
379
+ * Used to convert destination chain gas costs to source chain native token.
380
+ */
381
+ price_ratio: u128;
382
+ }
383
+ /**
384
+ * Fee estimation result with detailed breakdown.
385
+ *
386
+ * Contains the calculated fee and all intermediate values used in the calculation.
387
+ */
388
+ export interface FeeEstimate {
389
+ /**
390
+ * Source chain native token price in USD (scaled).
391
+ */
392
+ native_price_usd: u128;
393
+ /**
394
+ * Price ratio used for the calculation.
395
+ */
396
+ price_ratio: u128;
397
+ /**
398
+ * Denominator for the price ratio (typically 10^20).
399
+ */
400
+ price_ratio_denominator: u128;
401
+ /**
402
+ * Total gas fee in source chain native token units.
403
+ */
404
+ total_gas_fee: i128;
405
+ }
406
+ export type WorkerStorage = {
407
+ tag: "Paused";
408
+ values: void;
409
+ } | {
410
+ tag: "DepositAddress";
411
+ values: void;
412
+ } | {
413
+ tag: "PriceFeed";
414
+ values: void;
415
+ } | {
416
+ tag: "WorkerFeeLib";
417
+ values: void;
418
+ } | {
419
+ tag: "DefaultMultiplierBps";
420
+ values: void;
421
+ } | {
422
+ tag: "SupportedOptionTypes";
423
+ values: readonly [u32];
424
+ } | {
425
+ tag: "MessageLibs";
426
+ values: void;
427
+ } | {
428
+ tag: "Allowlist";
429
+ values: readonly [string];
430
+ } | {
431
+ tag: "Denylist";
432
+ values: readonly [string];
433
+ } | {
434
+ tag: "AllowlistSize";
435
+ values: void;
436
+ } | {
437
+ tag: "Admins";
438
+ values: void;
439
+ };
440
+ export interface Client {
441
+ /**
442
+ * 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.
443
+ */
444
+ upgrade: ({ new_wasm_hash }: {
445
+ new_wasm_hash: Buffer;
446
+ }, txnOptions?: {
447
+ /**
448
+ * The fee to pay for the transaction. Default: BASE_FEE
449
+ */
450
+ fee?: number;
451
+ /**
452
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
453
+ */
454
+ timeoutInSeconds?: number;
455
+ /**
456
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
457
+ */
458
+ simulate?: boolean;
459
+ }) => Promise<AssembledTransaction<null>>;
460
+ /**
461
+ * 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.
462
+ */
463
+ migrate: ({ migration_data }: {
464
+ migration_data: MigrationData;
465
+ }, txnOptions?: {
466
+ /**
467
+ * The fee to pay for the transaction. Default: BASE_FEE
468
+ */
469
+ fee?: number;
470
+ /**
471
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
472
+ */
473
+ timeoutInSeconds?: number;
474
+ /**
475
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
476
+ */
477
+ simulate?: boolean;
478
+ }) => Promise<AssembledTransaction<null>>;
479
+ /**
480
+ * 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.
481
+ * Extends the instance TTL.
482
+ *
483
+ * # Arguments
484
+ *
485
+ * * `threshold` - The threshold to extend the TTL.
486
+ * * `extend_to` - The TTL to extend to.
487
+ */
488
+ extend_instance_ttl: ({ threshold, extend_to }: {
489
+ threshold: u32;
490
+ extend_to: u32;
491
+ }, txnOptions?: {
492
+ /**
493
+ * The fee to pay for the transaction. Default: BASE_FEE
494
+ */
495
+ fee?: number;
496
+ /**
497
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
498
+ */
499
+ timeoutInSeconds?: number;
500
+ /**
501
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
502
+ */
503
+ simulate?: boolean;
504
+ }) => Promise<AssembledTransaction<null>>;
505
+ /**
506
+ * Construct and simulate a estimate_fee_by_eid 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.
507
+ * Estimate fee with detailed breakdown by endpoint ID
508
+ * Corresponds to estimateFeeByEid in PriceFeed.sol
509
+ */
510
+ estimate_fee_by_eid: ({ fee_lib, dst_eid, calldata_size, gas }: {
511
+ fee_lib: string;
512
+ dst_eid: u32;
513
+ calldata_size: u32;
514
+ gas: u128;
515
+ }, txnOptions?: {
516
+ /**
517
+ * The fee to pay for the transaction. Default: BASE_FEE
518
+ */
519
+ fee?: number;
520
+ /**
521
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
522
+ */
523
+ timeoutInSeconds?: number;
524
+ /**
525
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
526
+ */
527
+ simulate?: boolean;
528
+ }) => Promise<AssembledTransaction<FeeEstimate>>;
529
+ /**
530
+ * Construct and simulate a native_token_price_usd 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.
531
+ * Get the native token price in USD
532
+ */
533
+ native_token_price_usd: (txnOptions?: {
534
+ /**
535
+ * The fee to pay for the transaction. Default: BASE_FEE
536
+ */
537
+ fee?: number;
538
+ /**
539
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
540
+ */
541
+ timeoutInSeconds?: number;
542
+ /**
543
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
544
+ */
545
+ simulate?: boolean;
546
+ }) => Promise<AssembledTransaction<u128>>;
547
+ /**
548
+ * Construct and simulate a get_price 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.
549
+ * Get the price for a destination EID.
550
+ */
551
+ get_price: ({ dst_eid }: {
552
+ dst_eid: u32;
553
+ }, txnOptions?: {
554
+ /**
555
+ * The fee to pay for the transaction. Default: BASE_FEE
556
+ */
557
+ fee?: number;
558
+ /**
559
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
560
+ */
561
+ timeoutInSeconds?: number;
562
+ /**
563
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
564
+ */
565
+ simulate?: boolean;
566
+ }) => Promise<AssembledTransaction<Option<Price>>>;
567
+ /**
568
+ * Construct and simulate a get_price_ratio_denominator 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.
569
+ * Get the price ratio denominator.
570
+ */
571
+ get_price_ratio_denominator: (txnOptions?: {
572
+ /**
573
+ * The fee to pay for the transaction. Default: BASE_FEE
574
+ */
575
+ fee?: number;
576
+ /**
577
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
578
+ */
579
+ timeoutInSeconds?: number;
580
+ /**
581
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
582
+ */
583
+ simulate?: boolean;
584
+ }) => Promise<AssembledTransaction<u128>>;
585
+ /**
586
+ * Construct and simulate a set_price_updater 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.
587
+ * Set price updater status (owner only)
588
+ */
589
+ set_price_updater: ({ updater, active }: {
590
+ updater: string;
591
+ active: boolean;
592
+ }, txnOptions?: {
593
+ /**
594
+ * The fee to pay for the transaction. Default: BASE_FEE
595
+ */
596
+ fee?: number;
597
+ /**
598
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
599
+ */
600
+ timeoutInSeconds?: number;
601
+ /**
602
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
603
+ */
604
+ simulate?: boolean;
605
+ }) => Promise<AssembledTransaction<null>>;
606
+ /**
607
+ * Construct and simulate a set_price_ratio_denominator 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.
608
+ * Set the price ratio denominator (owner only)
609
+ */
610
+ set_price_ratio_denominator: ({ denominator }: {
611
+ denominator: u128;
612
+ }, txnOptions?: {
613
+ /**
614
+ * The fee to pay for the transaction. Default: BASE_FEE
615
+ */
616
+ fee?: number;
617
+ /**
618
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
619
+ */
620
+ timeoutInSeconds?: number;
621
+ /**
622
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
623
+ */
624
+ simulate?: boolean;
625
+ }) => Promise<AssembledTransaction<null>>;
626
+ /**
627
+ * Construct and simulate a set_arbitrum_compression_percent 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.
628
+ * Set the Arbitrum compression percentage (owner only)
629
+ */
630
+ set_arbitrum_compression_percent: ({ compression_percent }: {
631
+ compression_percent: u128;
632
+ }, txnOptions?: {
633
+ /**
634
+ * The fee to pay for the transaction. Default: BASE_FEE
635
+ */
636
+ fee?: number;
637
+ /**
638
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
639
+ */
640
+ timeoutInSeconds?: number;
641
+ /**
642
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
643
+ */
644
+ simulate?: boolean;
645
+ }) => Promise<AssembledTransaction<null>>;
646
+ /**
647
+ * Construct and simulate a set_eid_to_model_type 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.
648
+ * Set the fee model type for destination EIDs (owner only)
649
+ */
650
+ set_eid_to_model_type: ({ params }: {
651
+ params: Array<SetEidToModelTypeParam>;
652
+ }, txnOptions?: {
653
+ /**
654
+ * The fee to pay for the transaction. Default: BASE_FEE
655
+ */
656
+ fee?: number;
657
+ /**
658
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
659
+ */
660
+ timeoutInSeconds?: number;
661
+ /**
662
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
663
+ */
664
+ simulate?: boolean;
665
+ }) => Promise<AssembledTransaction<null>>;
666
+ /**
667
+ * Construct and simulate a set_price 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.
668
+ * Set prices for multiple destinations (price updater or owner)
669
+ */
670
+ set_price: ({ price_updater, prices }: {
671
+ price_updater: string;
672
+ prices: Array<UpdatePrice>;
673
+ }, txnOptions?: {
674
+ /**
675
+ * The fee to pay for the transaction. Default: BASE_FEE
676
+ */
677
+ fee?: number;
678
+ /**
679
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
680
+ */
681
+ timeoutInSeconds?: number;
682
+ /**
683
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
684
+ */
685
+ simulate?: boolean;
686
+ }) => Promise<AssembledTransaction<null>>;
687
+ /**
688
+ * Construct and simulate a set_price_for_arbitrum 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.
689
+ * Set price for Arbitrum with extension (price updater or owner)
690
+ * Corresponds to setPriceForArbitrum in PriceFeed.sol
691
+ */
692
+ set_price_for_arbitrum: ({ price_updater, update }: {
693
+ price_updater: string;
694
+ update: UpdatePriceExt;
695
+ }, txnOptions?: {
696
+ /**
697
+ * The fee to pay for the transaction. Default: BASE_FEE
698
+ */
699
+ fee?: number;
700
+ /**
701
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
702
+ */
703
+ timeoutInSeconds?: number;
704
+ /**
705
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
706
+ */
707
+ simulate?: boolean;
708
+ }) => Promise<AssembledTransaction<null>>;
709
+ /**
710
+ * Construct and simulate a set_native_token_price_usd 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.
711
+ * Set the native token price in USD (price updater or owner).
712
+ *
713
+ * Kept as a standalone contract function (not part of the canonical `worker::ILayerZeroPriceFeed` interface).
714
+ */
715
+ set_native_token_price_usd: ({ price_updater, native_token_price_usd }: {
716
+ price_updater: string;
717
+ native_token_price_usd: u128;
718
+ }, txnOptions?: {
719
+ /**
720
+ * The fee to pay for the transaction. Default: BASE_FEE
721
+ */
722
+ fee?: number;
723
+ /**
724
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
725
+ */
726
+ timeoutInSeconds?: number;
727
+ /**
728
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
729
+ */
730
+ simulate?: boolean;
731
+ }) => Promise<AssembledTransaction<null>>;
732
+ /**
733
+ * Construct and simulate a is_price_updater 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.
734
+ * Check if an address is an active price updater
735
+ */
736
+ is_price_updater: ({ updater }: {
737
+ updater: string;
738
+ }, txnOptions?: {
739
+ /**
740
+ * The fee to pay for the transaction. Default: BASE_FEE
741
+ */
742
+ fee?: number;
743
+ /**
744
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
745
+ */
746
+ timeoutInSeconds?: number;
747
+ /**
748
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
749
+ */
750
+ simulate?: boolean;
751
+ }) => Promise<AssembledTransaction<boolean>>;
752
+ /**
753
+ * Construct and simulate a arbitrum_compression_percent 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.
754
+ * Get the Arbitrum compression percent
755
+ */
756
+ arbitrum_compression_percent: (txnOptions?: {
757
+ /**
758
+ * The fee to pay for the transaction. Default: BASE_FEE
759
+ */
760
+ fee?: number;
761
+ /**
762
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
763
+ */
764
+ timeoutInSeconds?: number;
765
+ /**
766
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
767
+ */
768
+ simulate?: boolean;
769
+ }) => Promise<AssembledTransaction<u128>>;
770
+ /**
771
+ * Construct and simulate a arbitrum_price_ext 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.
772
+ * Get the Arbitrum price extension
773
+ */
774
+ arbitrum_price_ext: (txnOptions?: {
775
+ /**
776
+ * The fee to pay for the transaction. Default: BASE_FEE
777
+ */
778
+ fee?: number;
779
+ /**
780
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
781
+ */
782
+ timeoutInSeconds?: number;
783
+ /**
784
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
785
+ */
786
+ simulate?: boolean;
787
+ }) => Promise<AssembledTransaction<ArbitrumPriceExt>>;
788
+ /**
789
+ * Construct and simulate a eid_to_model_type 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.
790
+ * Get the model type for a destination EID
791
+ */
792
+ eid_to_model_type: ({ dst_eid }: {
793
+ dst_eid: u32;
794
+ }, txnOptions?: {
795
+ /**
796
+ * The fee to pay for the transaction. Default: BASE_FEE
797
+ */
798
+ fee?: number;
799
+ /**
800
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
801
+ */
802
+ timeoutInSeconds?: number;
803
+ /**
804
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
805
+ */
806
+ simulate?: boolean;
807
+ }) => Promise<AssembledTransaction<ModelType>>;
808
+ /**
809
+ * 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.
810
+ * Returns the current owner address, or None if no owner is set.
811
+ */
812
+ owner: (txnOptions?: {
813
+ /**
814
+ * The fee to pay for the transaction. Default: BASE_FEE
815
+ */
816
+ fee?: number;
817
+ /**
818
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
819
+ */
820
+ timeoutInSeconds?: number;
821
+ /**
822
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
823
+ */
824
+ simulate?: boolean;
825
+ }) => Promise<AssembledTransaction<Option<string>>>;
826
+ /**
827
+ * 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.
828
+ * Transfers ownership to a new address. Requires current owner authorization.
829
+ */
830
+ transfer_ownership: ({ new_owner }: {
831
+ new_owner: string;
832
+ }, txnOptions?: {
833
+ /**
834
+ * The fee to pay for the transaction. Default: BASE_FEE
835
+ */
836
+ fee?: number;
837
+ /**
838
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
839
+ */
840
+ timeoutInSeconds?: number;
841
+ /**
842
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
843
+ */
844
+ simulate?: boolean;
845
+ }) => Promise<AssembledTransaction<null>>;
846
+ /**
847
+ * 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.
848
+ * Permanently renounces ownership. Requires current owner authorization.
849
+ */
850
+ renounce_ownership: (txnOptions?: {
851
+ /**
852
+ * The fee to pay for the transaction. Default: BASE_FEE
853
+ */
854
+ fee?: number;
855
+ /**
856
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
857
+ */
858
+ timeoutInSeconds?: number;
859
+ /**
860
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
861
+ */
862
+ simulate?: boolean;
863
+ }) => Promise<AssembledTransaction<null>>;
864
+ /**
865
+ * 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.
866
+ * Sets TTL configs for instance and persistent storage.
867
+ *
868
+ * - `None` values remove the corresponding config (disables auto-extension for that type)
869
+ * - Validates that `threshold <= extend_to <= MAX_TTL`
870
+ *
871
+ * # Arguments
872
+ * - `instance` - TTL config for instance storage
873
+ * - `persistent` - TTL config for persistent storage
874
+ *
875
+ * # Panics
876
+ * - `TtlConfigFrozen` if configs are frozen
877
+ * - `InvalidTtlConfig` if validation fails
878
+ */
879
+ set_ttl_configs: ({ instance, persistent }: {
880
+ instance: Option<TtlConfig>;
881
+ persistent: Option<TtlConfig>;
882
+ }, txnOptions?: {
883
+ /**
884
+ * The fee to pay for the transaction. Default: BASE_FEE
885
+ */
886
+ fee?: number;
887
+ /**
888
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
889
+ */
890
+ timeoutInSeconds?: number;
891
+ /**
892
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
893
+ */
894
+ simulate?: boolean;
895
+ }) => Promise<AssembledTransaction<null>>;
896
+ /**
897
+ * 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.
898
+ * Returns the current TTL configs as (instance_config, persistent_config).
899
+ */
900
+ ttl_configs: (txnOptions?: {
901
+ /**
902
+ * The fee to pay for the transaction. Default: BASE_FEE
903
+ */
904
+ fee?: number;
905
+ /**
906
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
907
+ */
908
+ timeoutInSeconds?: number;
909
+ /**
910
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
911
+ */
912
+ simulate?: boolean;
913
+ }) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>>;
914
+ /**
915
+ * 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.
916
+ * Permanently freezes TTL configs, preventing any future modifications.
917
+ *
918
+ * This is irreversible and provides immutability guarantees to users.
919
+ * Emits `TtlConfigsFrozen` event.
920
+ *
921
+ * # Panics
922
+ * - `TtlConfigAlreadyFrozen` if already frozen
923
+ */
924
+ freeze_ttl_configs: (txnOptions?: {
925
+ /**
926
+ * The fee to pay for the transaction. Default: BASE_FEE
927
+ */
928
+ fee?: number;
929
+ /**
930
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
931
+ */
932
+ timeoutInSeconds?: number;
933
+ /**
934
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
935
+ */
936
+ simulate?: boolean;
937
+ }) => Promise<AssembledTransaction<null>>;
938
+ /**
939
+ * 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.
940
+ * Returns whether TTL configs are frozen.
941
+ */
942
+ is_ttl_configs_frozen: (txnOptions?: {
943
+ /**
944
+ * The fee to pay for the transaction. Default: BASE_FEE
945
+ */
946
+ fee?: number;
947
+ /**
948
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
949
+ */
950
+ timeoutInSeconds?: number;
951
+ /**
952
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
953
+ */
954
+ simulate?: boolean;
955
+ }) => Promise<AssembledTransaction<boolean>>;
956
+ }
957
+ export declare class Client extends ContractClient {
958
+ readonly options: ContractClientOptions;
959
+ static deploy<T = Client>(
960
+ /** Constructor/Initialization Args for the contract's `__constructor` method */
961
+ { owner, price_updater }: {
962
+ owner: string;
963
+ price_updater: string;
964
+ },
965
+ /** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
966
+ options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
967
+ /** The hash of the Wasm blob, which must already be installed on-chain. */
968
+ wasmHash: Buffer | string;
969
+ /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
970
+ salt?: Buffer | Uint8Array;
971
+ /** The format used to decode `wasmHash`, if it's provided as a string. */
972
+ format?: "hex" | "base64";
973
+ }): Promise<AssembledTransaction<T>>;
974
+ constructor(options: ContractClientOptions);
975
+ readonly fromJSON: {
976
+ upgrade: (json: string) => AssembledTransaction<null>;
977
+ migrate: (json: string) => AssembledTransaction<null>;
978
+ extend_instance_ttl: (json: string) => AssembledTransaction<null>;
979
+ estimate_fee_by_eid: (json: string) => AssembledTransaction<FeeEstimate>;
980
+ native_token_price_usd: (json: string) => AssembledTransaction<bigint>;
981
+ get_price: (json: string) => AssembledTransaction<Option<Price>>;
982
+ get_price_ratio_denominator: (json: string) => AssembledTransaction<bigint>;
983
+ set_price_updater: (json: string) => AssembledTransaction<null>;
984
+ set_price_ratio_denominator: (json: string) => AssembledTransaction<null>;
985
+ set_arbitrum_compression_percent: (json: string) => AssembledTransaction<null>;
986
+ set_eid_to_model_type: (json: string) => AssembledTransaction<null>;
987
+ set_price: (json: string) => AssembledTransaction<null>;
988
+ set_price_for_arbitrum: (json: string) => AssembledTransaction<null>;
989
+ set_native_token_price_usd: (json: string) => AssembledTransaction<null>;
990
+ is_price_updater: (json: string) => AssembledTransaction<boolean>;
991
+ arbitrum_compression_percent: (json: string) => AssembledTransaction<bigint>;
992
+ arbitrum_price_ext: (json: string) => AssembledTransaction<ArbitrumPriceExt>;
993
+ eid_to_model_type: (json: string) => AssembledTransaction<ModelType>;
994
+ owner: (json: string) => AssembledTransaction<Option<string>>;
995
+ transfer_ownership: (json: string) => AssembledTransaction<null>;
996
+ renounce_ownership: (json: string) => AssembledTransaction<null>;
997
+ set_ttl_configs: (json: string) => AssembledTransaction<null>;
998
+ ttl_configs: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>;
999
+ freeze_ttl_configs: (json: string) => AssembledTransaction<null>;
1000
+ is_ttl_configs_frozen: (json: string) => AssembledTransaction<boolean>;
1001
+ };
1002
+ }