@layerzerolabs/protocol-stellar-v2 0.2.13 → 0.2.18

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 (435) hide show
  1. package/.turbo/turbo-build.log +484 -337
  2. package/.turbo/turbo-lint.log +126 -56
  3. package/.turbo/turbo-test.log +1403 -984
  4. package/Cargo.lock +142 -3
  5. package/Cargo.toml +5 -1
  6. package/contracts/ERROR_SPEC.md +44 -0
  7. package/contracts/common-macros/src/auth.rs +113 -0
  8. package/contracts/common-macros/src/contract_ttl.rs +84 -0
  9. package/contracts/common-macros/src/lib.rs +219 -29
  10. package/contracts/common-macros/src/lz_contract.rs +83 -0
  11. package/contracts/common-macros/src/storage.rs +1 -1
  12. package/contracts/common-macros/src/tests/{ownable.rs → auth.rs} +48 -15
  13. package/contracts/common-macros/src/tests/contract_ttl.rs +662 -0
  14. package/contracts/common-macros/src/tests/mod.rs +3 -2
  15. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__auth__snapshot_generated_multisig_code.snap +20 -0
  16. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__auth__snapshot_generated_ownable_code.snap +24 -0
  17. package/contracts/common-macros/src/tests/snapshots/{common_macros__tests__ownable__snapshot_only_owner_preserves_function_signature.snap → common_macros__tests__auth__snapshot_only_auth_preserves_function_signature.snap} +4 -4
  18. package/contracts/common-macros/src/tests/snapshots/{common_macros__tests__contract_impl__snapshot_generated_contract_impl_code.snap → common_macros__tests__contract_ttl__snapshot_generated_contractimpl_code.snap} +26 -10
  19. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__contract_ttl__snapshot_generated_contracttrait_code.snap +69 -0
  20. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__storage__snapshot_generated_storage_code.snap +48 -48
  21. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ttl_configurable__snapshot_generated_ttl_configurable_code.snap +7 -41
  22. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__upgradeable__snapshot_generated_upgradeable_code.snap +21 -0
  23. package/contracts/common-macros/src/tests/upgradeable.rs +31 -0
  24. package/contracts/common-macros/src/ttl_configurable.rs +21 -66
  25. package/contracts/common-macros/src/ttl_extendable.rs +36 -0
  26. package/contracts/common-macros/src/upgradeable.rs +76 -0
  27. package/contracts/common-macros/src/utils.rs +9 -0
  28. package/contracts/endpoint-v2/src/constants.rs +4 -4
  29. package/contracts/endpoint-v2/src/endpoint_v2.rs +58 -36
  30. package/contracts/endpoint-v2/src/errors.rs +4 -3
  31. package/contracts/endpoint-v2/src/events.rs +1 -1
  32. package/contracts/endpoint-v2/src/message_lib_manager.rs +18 -5
  33. package/contracts/endpoint-v2/src/messaging_channel.rs +11 -1
  34. package/contracts/endpoint-v2/src/messaging_composer.rs +11 -1
  35. package/contracts/endpoint-v2/src/storage.rs +1 -1
  36. package/contracts/endpoint-v2/src/tests/endpoint_setup.rs +175 -8
  37. package/contracts/endpoint-v2/src/tests/endpoint_v2/build_outbound_packet.rs +76 -0
  38. package/contracts/endpoint-v2/src/tests/endpoint_v2/clear.rs +342 -159
  39. package/contracts/endpoint-v2/src/tests/endpoint_v2/delegate.rs +3 -15
  40. package/contracts/endpoint-v2/src/tests/endpoint_v2/initializable.rs +20 -31
  41. package/contracts/endpoint-v2/src/tests/endpoint_v2/lz_receive_alert.rs +126 -164
  42. package/contracts/endpoint-v2/src/tests/endpoint_v2/mod.rs +1 -0
  43. package/contracts/endpoint-v2/src/tests/endpoint_v2/native_token.rs +0 -1
  44. package/contracts/endpoint-v2/src/tests/endpoint_v2/owner.rs +0 -1
  45. package/contracts/endpoint-v2/src/tests/endpoint_v2/pay_messaging_fees.rs +311 -304
  46. package/contracts/endpoint-v2/src/tests/endpoint_v2/quote.rs +423 -96
  47. package/contracts/endpoint-v2/src/tests/endpoint_v2/recover_token.rs +1 -1
  48. package/contracts/endpoint-v2/src/tests/endpoint_v2/require_oapp_auth.rs +47 -20
  49. package/contracts/endpoint-v2/src/tests/endpoint_v2/send.rs +373 -403
  50. package/contracts/endpoint-v2/src/tests/endpoint_v2/set_delegate.rs +96 -22
  51. package/contracts/endpoint-v2/src/tests/endpoint_v2/set_zro.rs +62 -10
  52. package/contracts/endpoint-v2/src/tests/endpoint_v2/transfer_ownership.rs +4 -4
  53. package/contracts/endpoint-v2/src/tests/endpoint_v2/ttl_config.rs +8 -11
  54. package/contracts/endpoint-v2/src/tests/endpoint_v2/verifiable.rs +81 -30
  55. package/contracts/endpoint-v2/src/tests/endpoint_v2/verify.rs +209 -76
  56. package/contracts/endpoint-v2/src/tests/endpoint_v2/zro.rs +0 -1
  57. package/contracts/endpoint-v2/src/tests/message_lib_manager/default_receive_library.rs +24 -0
  58. package/contracts/endpoint-v2/src/tests/message_lib_manager/default_receive_library_timeout.rs +40 -0
  59. package/contracts/endpoint-v2/src/tests/message_lib_manager/default_send_library.rs +24 -0
  60. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_config.rs +108 -0
  61. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_library_index.rs +52 -0
  62. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_receive_library.rs +92 -0
  63. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_registered_libraries.rs +74 -0
  64. package/contracts/endpoint-v2/src/tests/message_lib_manager/get_send_library.rs +83 -0
  65. package/contracts/endpoint-v2/src/tests/message_lib_manager/is_registered_library.rs +32 -0
  66. package/contracts/endpoint-v2/src/tests/message_lib_manager/is_supported_eid.rs +28 -0
  67. package/contracts/endpoint-v2/src/tests/message_lib_manager/is_valid_receive_library.rs +261 -0
  68. package/contracts/endpoint-v2/src/tests/message_lib_manager/mod.rs +16 -0
  69. package/contracts/endpoint-v2/src/tests/message_lib_manager/receive_library_timeout.rs +62 -0
  70. package/contracts/endpoint-v2/src/tests/message_lib_manager/register_library.rs +65 -43
  71. package/contracts/endpoint-v2/src/tests/message_lib_manager/registered_libraries_count.rs +42 -0
  72. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_receive_lib_for_eid.rs +61 -0
  73. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_registered.rs +4 -6
  74. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_send_lib_for_eid.rs +59 -0
  75. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_supported_eid.rs +16 -2
  76. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_config.rs +155 -51
  77. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_receive_lib_timeout.rs +114 -92
  78. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_receive_library.rs +235 -132
  79. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_send_library.rs +93 -87
  80. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_receive_library.rs +346 -245
  81. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_receive_library_timeout.rs +406 -60
  82. package/contracts/endpoint-v2/src/tests/message_lib_manager/set_send_library.rs +252 -78
  83. package/contracts/endpoint-v2/src/tests/message_lib_manager/timeout.rs +102 -0
  84. package/contracts/endpoint-v2/src/tests/messaging_channel/burn.rs +212 -273
  85. package/contracts/endpoint-v2/src/tests/messaging_channel/clear_payload.rs +203 -0
  86. package/contracts/endpoint-v2/src/tests/messaging_channel/inbound.rs +94 -0
  87. package/contracts/endpoint-v2/src/tests/messaging_channel/inbound_nonce.rs +78 -248
  88. package/contracts/endpoint-v2/src/tests/messaging_channel/inbound_payload_hash.rs +7 -282
  89. package/contracts/endpoint-v2/src/tests/messaging_channel/lazy_inbound_nonce.rs +6 -274
  90. package/contracts/endpoint-v2/src/tests/messaging_channel/mod.rs +3 -2
  91. package/contracts/endpoint-v2/src/tests/messaging_channel/next_guid.rs +86 -178
  92. package/contracts/endpoint-v2/src/tests/messaging_channel/nilify.rs +328 -212
  93. package/contracts/endpoint-v2/src/tests/messaging_channel/outbound.rs +68 -0
  94. package/contracts/endpoint-v2/src/tests/messaging_channel/outbound_nonce.rs +6 -209
  95. package/contracts/endpoint-v2/src/tests/messaging_channel/skip.rs +207 -159
  96. package/contracts/endpoint-v2/src/tests/messaging_composer/clear_compose.rs +142 -153
  97. package/contracts/endpoint-v2/src/tests/messaging_composer/compose_queue.rs +6 -179
  98. package/contracts/endpoint-v2/src/tests/messaging_composer/lz_compose_alert.rs +163 -221
  99. package/contracts/endpoint-v2/src/tests/messaging_composer/send_compose.rs +90 -121
  100. package/contracts/endpoint-v2/src/tests/mock.rs +18 -4
  101. package/contracts/endpoint-v2/src/tests/util/build_payload.rs +4 -70
  102. package/contracts/endpoint-v2/src/tests/util/compute_guid.rs +2 -1
  103. package/contracts/endpoint-v2/src/tests/util/keccak256.rs +17 -106
  104. package/contracts/layerzero-views/Cargo.toml +35 -0
  105. package/contracts/layerzero-views/src/errors.rs +10 -0
  106. package/contracts/layerzero-views/src/layerzero_view.rs +226 -0
  107. package/contracts/layerzero-views/src/lib.rs +38 -0
  108. package/contracts/layerzero-views/src/storage.rs +18 -0
  109. package/contracts/layerzero-views/src/tests/layerzero_view_tests.rs +423 -0
  110. package/contracts/layerzero-views/src/tests/mod.rs +4 -0
  111. package/contracts/layerzero-views/src/tests/setup.rs +377 -0
  112. package/contracts/layerzero-views/src/types.rs +50 -0
  113. package/contracts/macro-integration-tests/Cargo.toml +30 -0
  114. package/contracts/macro-integration-tests/src/lib.rs +1 -0
  115. package/contracts/macro-integration-tests/tests/runtime/ownable/initialization.rs +62 -0
  116. package/contracts/macro-integration-tests/tests/runtime/ownable/mod.rs +22 -0
  117. package/contracts/macro-integration-tests/tests/runtime/ownable/only_auth_guard.rs +97 -0
  118. package/contracts/macro-integration-tests/tests/runtime/ownable/ownership_transfer.rs +101 -0
  119. package/contracts/macro-integration-tests/tests/runtime/storage/keyed_roundtrip.rs +225 -0
  120. package/contracts/macro-integration-tests/tests/runtime/storage/mod.rs +4 -0
  121. package/contracts/macro-integration-tests/tests/runtime/storage/name_override_runtime.rs +52 -0
  122. package/contracts/macro-integration-tests/tests/runtime/storage/ttl_extension.rs +261 -0
  123. package/contracts/macro-integration-tests/tests/runtime/storage/unkeyed_roundtrip.rs +137 -0
  124. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/configuration.rs +113 -0
  125. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/freeze.rs +139 -0
  126. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/mod.rs +2 -0
  127. package/contracts/macro-integration-tests/tests/runtime.rs +5 -0
  128. package/contracts/macro-integration-tests/tests/ui/error/fail/attr_not_empty.rs +12 -0
  129. package/contracts/macro-integration-tests/tests/ui/error/fail/attr_not_empty.stderr +7 -0
  130. package/contracts/macro-integration-tests/tests/ui/error/fail/decreasing_discriminant.rs +12 -0
  131. package/contracts/macro-integration-tests/tests/ui/error/fail/decreasing_discriminant.stderr +7 -0
  132. package/contracts/macro-integration-tests/tests/ui/error/fail/non_int_discriminant.rs +21 -0
  133. package/contracts/macro-integration-tests/tests/ui/error/fail/non_int_discriminant.stderr +7 -0
  134. package/contracts/macro-integration-tests/tests/ui/error/fail/non_unit_variant.rs +13 -0
  135. package/contracts/macro-integration-tests/tests/ui/error/fail/non_unit_variant.stderr +7 -0
  136. package/contracts/macro-integration-tests/tests/ui/error/pass/attr_on_variant_allowed.rs +20 -0
  137. package/contracts/macro-integration-tests/tests/ui/error/pass/basic_auto_discriminants.rs +15 -0
  138. package/contracts/macro-integration-tests/tests/ui/error/pass/mixed_discriminants.rs +16 -0
  139. package/contracts/macro-integration-tests/tests/ui/ownable/fail/only_auth_missing_env.rs +22 -0
  140. package/contracts/macro-integration-tests/tests/ui/ownable/fail/only_auth_missing_env.stderr +16 -0
  141. package/contracts/macro-integration-tests/tests/ui/ownable/pass/minimal_contract.rs +26 -0
  142. package/contracts/macro-integration-tests/tests/ui/ownable/pass/namespacing_and_imports.rs +21 -0
  143. package/contracts/macro-integration-tests/tests/ui/ownable/pass/only_auth_env_param_variants.rs +46 -0
  144. package/contracts/macro-integration-tests/tests/ui/storage/fail/invalid_storage_type_param.rs +13 -0
  145. package/contracts/macro-integration-tests/tests/ui/storage/fail/invalid_storage_type_param.stderr +7 -0
  146. package/contracts/macro-integration-tests/tests/ui/storage/fail/missing_storage_type_param.rs +13 -0
  147. package/contracts/macro-integration-tests/tests/ui/storage/fail/missing_storage_type_param.stderr +7 -0
  148. package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_storage_kinds.rs +10 -0
  149. package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_storage_kinds.stderr +7 -0
  150. package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_type_params.rs +12 -0
  151. package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_type_params.stderr +7 -0
  152. package/contracts/macro-integration-tests/tests/ui/storage/fail/no_ttl_extension_on_non_persistent.rs +10 -0
  153. package/contracts/macro-integration-tests/tests/ui/storage/fail/no_ttl_extension_on_non_persistent.stderr +7 -0
  154. package/contracts/macro-integration-tests/tests/ui/storage/fail/non_enum_input.rs +10 -0
  155. package/contracts/macro-integration-tests/tests/ui/storage/fail/non_enum_input.stderr +7 -0
  156. package/contracts/macro-integration-tests/tests/ui/storage/fail/storage_attr_rejects_args.rs +12 -0
  157. package/contracts/macro-integration-tests/tests/ui/storage/fail/storage_attr_rejects_args.stderr +7 -0
  158. package/contracts/macro-integration-tests/tests/ui/storage/fail/tuple_variant_rejected.rs +13 -0
  159. package/contracts/macro-integration-tests/tests/ui/storage/fail/tuple_variant_rejected.stderr +7 -0
  160. package/contracts/macro-integration-tests/tests/ui/storage/fail/unknown_variant_attr.rs +13 -0
  161. package/contracts/macro-integration-tests/tests/ui/storage/fail/unknown_variant_attr.stderr +7 -0
  162. package/contracts/macro-integration-tests/tests/ui/storage/pass/default_value_on_variant.rs +14 -0
  163. package/contracts/macro-integration-tests/tests/ui/storage/pass/enum_instance_unit_basic.rs +14 -0
  164. package/contracts/macro-integration-tests/tests/ui/storage/pass/enum_persistent_named_fields_keyed.rs +16 -0
  165. package/contracts/macro-integration-tests/tests/ui/storage/pass/enum_temporary_unit_option.rs +15 -0
  166. package/contracts/macro-integration-tests/tests/ui/storage/pass/name_override.rs +14 -0
  167. package/contracts/macro-integration-tests/tests/ui/storage/pass/no_auto_ttl_extension.rs +19 -0
  168. package/contracts/macro-integration-tests/tests/ui/storage/pass/ttl_provider_basic.rs +15 -0
  169. package/contracts/macro-integration-tests/tests/ui/ttl_configurable/pass/minimal_contract.rs +44 -0
  170. package/contracts/macro-integration-tests/tests/ui_error.rs +11 -0
  171. package/contracts/macro-integration-tests/tests/ui_ownable.rs +11 -0
  172. package/contracts/macro-integration-tests/tests/ui_storage.rs +11 -0
  173. package/contracts/macro-integration-tests/tests/ui_ttl_configurable.rs +12 -0
  174. package/contracts/message-libs/blocked-message-lib/src/lib.rs +17 -17
  175. package/contracts/message-libs/message-lib-common/src/errors.rs +7 -2
  176. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/decode_packet_header.rs +64 -0
  177. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/encode_packet.rs +58 -0
  178. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/encode_packet_header.rs +138 -0
  179. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/mod.rs +6 -0
  180. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/payload.rs +30 -0
  181. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/payload_hash.rs +15 -0
  182. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/test_helper.rs +39 -0
  183. package/contracts/message-libs/message-lib-common/src/tests/worker_options/append_dvn_option.rs +57 -0
  184. package/contracts/message-libs/message-lib-common/src/tests/worker_options/append_lz_receive_option.rs +49 -0
  185. package/contracts/message-libs/message-lib-common/src/tests/worker_options/append_native_drop_option.rs +73 -0
  186. package/contracts/message-libs/message-lib-common/src/tests/worker_options/convert_legacy_options.rs +280 -0
  187. package/contracts/message-libs/message-lib-common/src/tests/worker_options/extract_type_3_options.rs +126 -0
  188. package/contracts/message-libs/message-lib-common/src/tests/worker_options/left_pad_to_bytes32.rs +48 -0
  189. package/contracts/message-libs/message-lib-common/src/tests/worker_options/mod.rs +7 -0
  190. package/contracts/message-libs/message-lib-common/src/tests/worker_options/split_worker_options.rs +139 -0
  191. package/contracts/message-libs/message-lib-common/src/worker_options.rs +31 -1
  192. package/contracts/message-libs/simple-message-lib/src/simple_message_lib.rs +7 -9
  193. package/contracts/message-libs/treasury/src/errors.rs +2 -3
  194. package/contracts/message-libs/treasury/src/events.rs +1 -1
  195. package/contracts/message-libs/treasury/src/interfaces/zro_fee_lib.rs +2 -2
  196. package/contracts/message-libs/treasury/src/lib.rs +3 -3
  197. package/contracts/message-libs/treasury/src/storage.rs +3 -1
  198. package/contracts/message-libs/treasury/src/tests/treasury_tests.rs +1 -1
  199. package/contracts/message-libs/treasury/src/treasury.rs +23 -26
  200. package/contracts/message-libs/uln-302/Cargo.toml +1 -1
  201. package/contracts/message-libs/uln-302/src/errors.rs +0 -5
  202. package/contracts/message-libs/uln-302/src/events.rs +5 -6
  203. package/contracts/message-libs/uln-302/src/receive_uln.rs +37 -56
  204. package/contracts/message-libs/uln-302/src/send_uln.rs +112 -138
  205. package/contracts/message-libs/uln-302/src/storage.rs +5 -5
  206. package/contracts/message-libs/uln-302/src/tests/receive_uln302/effective_receive_uln_config.rs +5 -7
  207. package/contracts/message-libs/uln-302/src/tests/receive_uln302/set_default_receive_uln_configs.rs +3 -3
  208. package/contracts/message-libs/uln-302/src/tests/send_uln302/effective_send_uln_config.rs +6 -9
  209. package/contracts/message-libs/uln-302/src/tests/send_uln302/set_default_executor_configs.rs +2 -2
  210. package/contracts/message-libs/uln-302/src/tests/send_uln302/set_default_send_uln_configs.rs +3 -3
  211. package/contracts/message-libs/uln-302/src/tests/setup.rs +9 -0
  212. package/contracts/message-libs/uln-302/src/tests/testing_utils.rs +5 -0
  213. package/contracts/message-libs/uln-302/src/tests/uln302/get_app_receive_uln_config.rs +1 -2
  214. package/contracts/message-libs/uln-302/src/tests/uln302/get_app_send_uln_config.rs +1 -2
  215. package/contracts/message-libs/uln-302/src/tests/uln302/set_config.rs +37 -55
  216. package/contracts/message-libs/uln-302/src/uln302.rs +10 -25
  217. package/contracts/oapps/counter/Cargo.toml +14 -1
  218. package/contracts/oapps/counter/integration_tests/mod.rs +4 -1
  219. package/contracts/oapps/counter/integration_tests/setup_sml.rs +169 -0
  220. package/contracts/oapps/counter/integration_tests/setup_uln.rs +997 -0
  221. package/contracts/oapps/counter/integration_tests/signing.rs +62 -0
  222. package/contracts/oapps/counter/integration_tests/test_with_sml.rs +24 -55
  223. package/contracts/oapps/counter/integration_tests/test_with_uln.rs +314 -0
  224. package/contracts/oapps/counter/integration_tests/utils.rs +196 -53
  225. package/contracts/oapps/counter/src/counter.rs +67 -44
  226. package/contracts/oapps/counter/src/tests/mod.rs +0 -13
  227. package/contracts/oapps/counter/src/tests/test_counter.rs +5 -7
  228. package/contracts/oapps/oapp/src/errors.rs +5 -1
  229. package/contracts/oapps/oapp/src/macro_tests/test_macros.rs +318 -221
  230. package/contracts/oapps/oapp/src/oapp_core.rs +36 -21
  231. package/contracts/oapps/oapp/src/oapp_options_type3.rs +48 -12
  232. package/contracts/oapps/oapp/src/oapp_receiver.rs +106 -41
  233. package/contracts/oapps/oapp/src/oapp_sender.rs +26 -34
  234. package/contracts/oapps/oapp/src/tests/test_oapp_core.rs +9 -9
  235. package/contracts/oapps/oapp/src/tests/test_oapp_options_type3.rs +25 -18
  236. package/contracts/oapps/oapp/src/tests/test_oapp_receiver.rs +7 -8
  237. package/contracts/oapps/oapp/src/tests/test_oapp_sender.rs +14 -16
  238. package/contracts/oapps/oapp-macros/src/generators.rs +128 -0
  239. package/contracts/oapps/oapp-macros/src/lib.rs +211 -0
  240. package/contracts/oapps/oft/integration-tests/setup.rs +34 -9
  241. package/contracts/oapps/oft/integration-tests/utils.rs +1 -1
  242. package/contracts/oapps/oft/src/errors.rs +6 -1
  243. package/contracts/oapps/oft/src/extensions/oft_fee.rs +13 -13
  244. package/contracts/oapps/oft/src/extensions/pausable.rs +5 -5
  245. package/contracts/oapps/oft/src/extensions/rate_limiter.rs +23 -23
  246. package/contracts/oapps/oft/src/lib.rs +4 -2
  247. package/contracts/oapps/oft/src/oft.rs +31 -71
  248. package/contracts/oapps/oft/src/oft_impl.rs +201 -0
  249. package/contracts/oapps/oft/src/oft_types/lock_unlock.rs +2 -4
  250. package/contracts/oapps/oft/src/oft_types/mint_burn.rs +1 -4
  251. package/contracts/oapps/oft/src/storage.rs +2 -0
  252. package/contracts/oapps/oft/src/tests/extensions/setup.rs +60 -31
  253. package/contracts/oapps/oft/src/tests/extensions/test_oft_fee.rs +5 -3
  254. package/contracts/oapps/oft/src/tests/extensions/test_pausable.rs +5 -3
  255. package/contracts/oapps/oft/src/tests/extensions/test_rate_limiter.rs +6 -4
  256. package/contracts/oapps/oft/src/tests/test_decimals.rs +2 -2
  257. package/contracts/oapps/oft/src/tests/test_oft_msg_codec.rs +1 -2
  258. package/contracts/oapps/oft/src/tests/test_send.rs +4 -4
  259. package/contracts/oapps/oft/src/tests/test_utils.rs +122 -81
  260. package/contracts/oapps/oft/src/types.rs +20 -0
  261. package/contracts/oapps/oft-std/Cargo.toml +6 -0
  262. package/contracts/oapps/oft-std/integration-tests/extensions/mod.rs +3 -0
  263. package/contracts/oapps/oft-std/integration-tests/extensions/test_oft_fee.rs +157 -0
  264. package/contracts/oapps/oft-std/integration-tests/extensions/test_pausable.rs +162 -0
  265. package/contracts/oapps/oft-std/integration-tests/extensions/test_rate_limiter.rs +186 -0
  266. package/contracts/oapps/oft-std/integration-tests/mod.rs +3 -0
  267. package/contracts/oapps/{counter/integration_tests → oft-std/integration-tests}/setup.rs +76 -30
  268. package/contracts/oapps/oft-std/integration-tests/utils.rs +427 -0
  269. package/contracts/oapps/oft-std/src/lib.rs +12 -1
  270. package/contracts/oapps/oft-std/src/oft.rs +141 -26
  271. package/contracts/upgrader/Cargo.toml +19 -0
  272. package/contracts/upgrader/src/lib.rs +96 -0
  273. package/contracts/upgrader/src/tests/mod.rs +1 -0
  274. package/contracts/upgrader/src/tests/test_data/test_upgradeable_contract1.wasm +0 -0
  275. package/contracts/upgrader/src/tests/test_data/test_upgradeable_contract2.wasm +0 -0
  276. package/contracts/upgrader/src/tests/test_upgrader.rs +120 -0
  277. package/contracts/utils/src/auth.rs +44 -0
  278. package/contracts/utils/src/errors.rs +32 -5
  279. package/contracts/utils/src/lib.rs +5 -1
  280. package/contracts/utils/src/multisig.rs +211 -0
  281. package/contracts/utils/src/ownable.rs +50 -60
  282. package/contracts/utils/src/tests/buffer_reader.rs +6 -6
  283. package/contracts/utils/src/tests/buffer_writer.rs +6 -6
  284. package/contracts/utils/src/tests/bytes_ext.rs +2 -4
  285. package/contracts/utils/src/tests/mod.rs +4 -1
  286. package/contracts/utils/src/tests/multisig.rs +731 -0
  287. package/contracts/utils/src/tests/option_ext.rs +18 -0
  288. package/contracts/utils/src/tests/ownable.rs +22 -70
  289. package/contracts/utils/src/tests/ttl_configurable.rs +607 -0
  290. package/contracts/utils/src/tests/upgradeable.rs +290 -0
  291. package/contracts/utils/src/ttl_configurable.rs +153 -0
  292. package/contracts/utils/src/ttl_extendable.rs +27 -0
  293. package/contracts/utils/src/upgradeable.rs +56 -0
  294. package/contracts/workers/dvn/Cargo.toml +2 -2
  295. package/contracts/workers/dvn/src/auth.rs +24 -35
  296. package/contracts/workers/dvn/src/dvn.rs +23 -14
  297. package/contracts/workers/dvn/src/errors.rs +1 -7
  298. package/contracts/workers/dvn/src/events.rs +1 -14
  299. package/contracts/workers/dvn/src/interfaces/dvn.rs +2 -2
  300. package/contracts/workers/dvn/src/interfaces/mod.rs +0 -2
  301. package/contracts/workers/dvn/src/storage.rs +3 -13
  302. package/contracts/workers/dvn/src/tests/auth.rs +4 -4
  303. package/contracts/workers/dvn/src/tests/dvn.rs +1 -2
  304. package/contracts/workers/dvn/src/tests/multisig/set_signer.rs +7 -8
  305. package/contracts/workers/dvn/src/tests/multisig/set_threshold.rs +11 -8
  306. package/contracts/workers/dvn/src/tests/multisig/verify_signatures.rs +11 -12
  307. package/contracts/workers/dvn/src/tests/setup.rs +5 -5
  308. package/contracts/workers/dvn-fee-lib/Cargo.toml +0 -1
  309. package/contracts/workers/dvn-fee-lib/src/dvn_fee_lib.rs +45 -16
  310. package/contracts/workers/dvn-fee-lib/src/errors.rs +3 -2
  311. package/contracts/workers/dvn-fee-lib/src/lib.rs +5 -11
  312. package/contracts/workers/dvn-fee-lib/src/tests/dvn_fee_lib.rs +30 -16
  313. package/contracts/workers/executor/src/auth.rs +80 -16
  314. package/contracts/workers/executor/src/executor.rs +17 -29
  315. package/contracts/workers/executor/src/storage.rs +2 -9
  316. package/contracts/workers/executor-fee-lib/Cargo.toml +1 -1
  317. package/contracts/workers/executor-fee-lib/src/errors.rs +9 -7
  318. package/contracts/workers/executor-fee-lib/src/executor_fee_lib.rs +153 -121
  319. package/contracts/workers/executor-helper/Cargo.toml +1 -6
  320. package/contracts/workers/executor-helper/src/executor_helper.rs +53 -73
  321. package/contracts/workers/executor-helper/src/lib.rs +1 -7
  322. package/contracts/workers/price-feed/Cargo.toml +1 -2
  323. package/contracts/workers/price-feed/src/errors.rs +3 -2
  324. package/contracts/workers/price-feed/src/lib.rs +5 -6
  325. package/contracts/workers/price-feed/src/price_feed.rs +42 -23
  326. package/contracts/workers/worker/Cargo.toml +4 -0
  327. package/contracts/workers/worker/src/errors.rs +4 -0
  328. package/contracts/workers/worker/src/interfaces/price_feed.rs +3 -3
  329. package/contracts/workers/worker/src/lib.rs +2 -2
  330. package/contracts/workers/worker/src/tests/mod.rs +4 -0
  331. package/contracts/workers/worker/src/tests/setup.rs +147 -0
  332. package/contracts/workers/worker/src/tests/worker.rs +502 -0
  333. package/contracts/workers/worker/src/worker.rs +28 -30
  334. package/package.json +8 -5
  335. package/sdk/.turbo/turbo-build.log +1 -0
  336. package/sdk/.turbo/turbo-test.log +1009 -0
  337. package/sdk/dist/generated/bml.d.ts +104 -37
  338. package/sdk/dist/generated/bml.js +83 -42
  339. package/sdk/dist/generated/counter.d.ts +334 -175
  340. package/sdk/dist/generated/counter.js +109 -63
  341. package/sdk/dist/generated/dvn.d.ts +1985 -0
  342. package/sdk/dist/generated/dvn.js +326 -0
  343. package/sdk/dist/generated/dvn_fee_lib.d.ts +690 -0
  344. package/sdk/dist/generated/dvn_fee_lib.js +163 -0
  345. package/sdk/dist/generated/endpoint.d.ts +155 -46
  346. package/sdk/dist/generated/endpoint.js +93 -50
  347. package/sdk/dist/generated/executor.d.ts +1841 -0
  348. package/sdk/dist/generated/executor.js +312 -0
  349. package/sdk/dist/generated/executor_fee_lib.d.ts +1083 -0
  350. package/sdk/dist/generated/executor_fee_lib.js +255 -0
  351. package/sdk/dist/generated/executor_helper.d.ts +981 -0
  352. package/sdk/dist/generated/executor_helper.js +236 -0
  353. package/sdk/dist/generated/oft_std.d.ts +1722 -0
  354. package/sdk/dist/generated/oft_std.js +316 -0
  355. package/sdk/dist/generated/price_feed.d.ts +1077 -0
  356. package/sdk/dist/generated/price_feed.js +210 -0
  357. package/sdk/dist/generated/sml.d.ts +171 -56
  358. package/sdk/dist/generated/sml.js +111 -62
  359. package/sdk/dist/generated/treasury.d.ts +896 -0
  360. package/sdk/dist/generated/treasury.js +219 -0
  361. package/sdk/dist/generated/uln302.d.ts +175 -75
  362. package/sdk/dist/generated/uln302.js +126 -82
  363. package/sdk/dist/generated/upgrader.d.ts +70 -0
  364. package/sdk/dist/generated/upgrader.js +19 -0
  365. package/sdk/dist/index.d.ts +10 -0
  366. package/sdk/dist/index.js +14 -0
  367. package/sdk/dist/wasm/blocked-message-lib.d.ts +1 -0
  368. package/sdk/dist/wasm/blocked-message-lib.js +2 -0
  369. package/sdk/dist/wasm/counter.d.ts +1 -0
  370. package/sdk/dist/wasm/counter.js +2 -0
  371. package/sdk/dist/wasm/dvn-fee-lib.d.ts +1 -0
  372. package/sdk/dist/wasm/dvn-fee-lib.js +2 -0
  373. package/sdk/dist/wasm/dvn.d.ts +1 -0
  374. package/sdk/dist/wasm/dvn.js +2 -0
  375. package/sdk/dist/wasm/endpoint-v2.d.ts +1 -0
  376. package/sdk/dist/wasm/endpoint-v2.js +2 -0
  377. package/sdk/dist/wasm/executor-fee-lib.d.ts +1 -0
  378. package/sdk/dist/wasm/executor-fee-lib.js +2 -0
  379. package/sdk/dist/wasm/executor-helper.d.ts +1 -0
  380. package/sdk/dist/wasm/executor-helper.js +2 -0
  381. package/sdk/dist/wasm/executor.d.ts +1 -0
  382. package/sdk/dist/wasm/executor.js +2 -0
  383. package/sdk/dist/wasm/layerzero-views.d.ts +1 -0
  384. package/sdk/dist/wasm/layerzero-views.js +2 -0
  385. package/sdk/dist/wasm/oft-std.d.ts +1 -0
  386. package/sdk/dist/wasm/oft-std.js +2 -0
  387. package/sdk/dist/wasm/price-feed.d.ts +1 -0
  388. package/sdk/dist/wasm/price-feed.js +2 -0
  389. package/sdk/dist/wasm/simple-message-lib.d.ts +1 -0
  390. package/sdk/dist/wasm/simple-message-lib.js +2 -0
  391. package/sdk/dist/wasm/treasury.d.ts +1 -0
  392. package/sdk/dist/wasm/treasury.js +2 -0
  393. package/sdk/dist/wasm/uln302.d.ts +1 -0
  394. package/sdk/dist/wasm/uln302.js +2 -0
  395. package/sdk/dist/wasm/upgrader.d.ts +1 -0
  396. package/sdk/dist/wasm/upgrader.js +2 -0
  397. package/sdk/dist/wasm.d.ts +15 -0
  398. package/sdk/dist/wasm.js +15 -0
  399. package/sdk/package.json +7 -4
  400. package/sdk/src/index.ts +17 -0
  401. package/sdk/test/counter-sml.test.ts +376 -0
  402. package/sdk/test/counter-uln.test.ts +493 -0
  403. package/sdk/test/{oft.test.ts → oft-sml.test.ts} +187 -323
  404. package/sdk/test/suites/constants.ts +22 -2
  405. package/sdk/test/suites/dummyContractClient.ts +169 -0
  406. package/sdk/test/suites/globalSetup.ts +450 -0
  407. package/sdk/test/suites/localnet.ts +23 -6
  408. package/sdk/test/upgrader.test.ts +300 -0
  409. package/sdk/test/utils.ts +558 -85
  410. package/sdk/vitest.config.ts +21 -0
  411. package/tools/ts-bindings-gen/src/main.rs +12 -1
  412. package/turbo.json +2 -0
  413. package/contracts/common-macros/src/contract_impl.rs +0 -47
  414. package/contracts/common-macros/src/ownable.rs +0 -59
  415. package/contracts/common-macros/src/tests/contract_impl.rs +0 -381
  416. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ownable__snapshot_generated_ownable_code.snap +0 -32
  417. package/contracts/endpoint-v2/src/tests/messaging_channel/clear.rs +0 -316
  418. package/contracts/endpoint-v2/src/tests/messaging_channel/internal.rs +0 -388
  419. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1.rs +0 -162
  420. package/contracts/message-libs/message-lib-common/src/tests/worker_options.rs +0 -319
  421. package/contracts/oapp-macros/src/lib.rs +0 -154
  422. package/contracts/oapp-macros/src/oapp_core.rs +0 -40
  423. package/contracts/oapp-macros/src/oapp_full.rs +0 -21
  424. package/contracts/oapp-macros/src/oapp_options_type3.rs +0 -31
  425. package/contracts/oapp-macros/src/oapp_receiver.rs +0 -48
  426. package/contracts/oapp-macros/src/oapp_sender.rs +0 -21
  427. package/contracts/oapp-macros/src/util.rs +0 -107
  428. package/contracts/oapps/oft/src/constants.rs +0 -5
  429. package/contracts/oapps/oft/src/default_oft_impl.rs +0 -146
  430. package/contracts/utils/src/tests/ttl.rs +0 -421
  431. package/contracts/utils/src/ttl.rs +0 -123
  432. package/contracts/workers/dvn/src/interfaces/multisig.rs +0 -56
  433. package/contracts/workers/dvn/src/multisig.rs +0 -153
  434. package/sdk/test/index.test.ts +0 -376
  435. /package/contracts/{oapp-macros → oapps/oapp-macros}/Cargo.toml +0 -0
@@ -0,0 +1,1985 @@
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 DvnError: {
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
+ };
31
+ /**
32
+ * Configuration for a destination chain.
33
+ *
34
+ * Contains fee calculation parameters specific to each destination endpoint.
35
+ */
36
+ export interface DstConfig {
37
+ /**
38
+ * Minimum fee margin in USD (scaled by native decimals rate).
39
+ */
40
+ floor_margin_usd: u128;
41
+ /**
42
+ * Gas for verification on the destination chain.
43
+ */
44
+ gas: u128;
45
+ /**
46
+ * Fee multiplier in basis points (10000 = 100%).
47
+ * If 0, the default multiplier from worker config is used.
48
+ */
49
+ multiplier_bps: u32;
50
+ }
51
+ /**
52
+ * Parameter for setting destination chain configuration.
53
+ */
54
+ export interface DstConfigParam {
55
+ /**
56
+ * The configuration for this destination.
57
+ */
58
+ config: DstConfig;
59
+ /**
60
+ * The destination endpoint ID.
61
+ */
62
+ dst_eid: u32;
63
+ }
64
+ /**
65
+ * Represents a single contract invocation for multisig authorization.
66
+ *
67
+ * Used in `hash_call_data` to compute the hash that signers sign over.
68
+ */
69
+ export interface Call {
70
+ /**
71
+ * Function arguments.
72
+ */
73
+ args: Array<any>;
74
+ /**
75
+ * Function name to invoke.
76
+ */
77
+ func: string;
78
+ /**
79
+ * Target contract address.
80
+ */
81
+ to: string;
82
+ }
83
+ /**
84
+ * Authentication data for DVN contract transactions.
85
+ *
86
+ * This struct is used with Soroban's custom account interface to authorize
87
+ * transactions through a combination of admin signature and multisig quorum.
88
+ */
89
+ export interface TransactionAuthData {
90
+ /**
91
+ * Expiration timestamp (ledger time) after which this auth is invalid.
92
+ */
93
+ expiration: u64;
94
+ /**
95
+ * Entity submitting the transaction (admin, or permissionless).
96
+ */
97
+ sender: Sender;
98
+ /**
99
+ * Signatures from multisig signers (secp256k1, 65 bytes each).
100
+ */
101
+ signatures: Array<Buffer>;
102
+ /**
103
+ * Verifier ID - must match the DVN's configured VID.
104
+ */
105
+ vid: u32;
106
+ }
107
+ export type Sender = {
108
+ tag: "None";
109
+ values: void;
110
+ } | {
111
+ tag: "Admin";
112
+ values: readonly [Buffer, Buffer];
113
+ };
114
+ export type DvnStorage = {
115
+ tag: "Vid";
116
+ values: void;
117
+ } | {
118
+ tag: "DstConfig";
119
+ values: readonly [u32];
120
+ } | {
121
+ tag: "UsedHash";
122
+ values: readonly [Buffer];
123
+ };
124
+ export declare const EndpointError: {
125
+ 1: {
126
+ message: string;
127
+ };
128
+ 2: {
129
+ message: string;
130
+ };
131
+ 3: {
132
+ message: string;
133
+ };
134
+ 4: {
135
+ message: string;
136
+ };
137
+ 5: {
138
+ message: string;
139
+ };
140
+ 6: {
141
+ message: string;
142
+ };
143
+ 7: {
144
+ message: string;
145
+ };
146
+ 8: {
147
+ message: string;
148
+ };
149
+ 9: {
150
+ message: string;
151
+ };
152
+ 10: {
153
+ message: string;
154
+ };
155
+ 11: {
156
+ message: string;
157
+ };
158
+ 12: {
159
+ message: string;
160
+ };
161
+ 13: {
162
+ message: string;
163
+ };
164
+ 14: {
165
+ message: string;
166
+ };
167
+ 15: {
168
+ message: string;
169
+ };
170
+ 16: {
171
+ message: string;
172
+ };
173
+ 17: {
174
+ message: string;
175
+ };
176
+ 18: {
177
+ message: string;
178
+ };
179
+ 19: {
180
+ message: string;
181
+ };
182
+ 20: {
183
+ message: string;
184
+ };
185
+ 21: {
186
+ message: string;
187
+ };
188
+ 22: {
189
+ message: string;
190
+ };
191
+ 23: {
192
+ message: string;
193
+ };
194
+ 24: {
195
+ message: string;
196
+ };
197
+ 25: {
198
+ message: string;
199
+ };
200
+ };
201
+ /**
202
+ * Parameters for sending a cross-chain message.
203
+ */
204
+ export interface MessagingParams {
205
+ /**
206
+ * Destination endpoint ID (chain identifier).
207
+ */
208
+ dst_eid: u32;
209
+ /**
210
+ * The message payload to send.
211
+ */
212
+ message: Buffer;
213
+ /**
214
+ * Encoded executor and DVN options.
215
+ */
216
+ options: Buffer;
217
+ /**
218
+ * Whether to pay fees in ZRO token instead of native token.
219
+ */
220
+ pay_in_zro: boolean;
221
+ /**
222
+ * Receiver address on the destination chain (32 bytes).
223
+ */
224
+ receiver: Buffer;
225
+ }
226
+ /**
227
+ * Source message information identifying where a cross-chain message came from.
228
+ */
229
+ export interface Origin {
230
+ /**
231
+ * Nonce for this pathway.
232
+ */
233
+ nonce: u64;
234
+ /**
235
+ * Sender address on the source chain (32 bytes).
236
+ */
237
+ sender: Buffer;
238
+ /**
239
+ * Source endpoint ID (chain identifier).
240
+ */
241
+ src_eid: u32;
242
+ }
243
+ /**
244
+ * Fee structure for cross-chain messaging.
245
+ */
246
+ export interface MessagingFee {
247
+ /**
248
+ * Fee paid in native token (XLM).
249
+ */
250
+ native_fee: i128;
251
+ /**
252
+ * Fee paid in ZRO token (LayerZero token).
253
+ */
254
+ zro_fee: i128;
255
+ }
256
+ /**
257
+ * Receipt returned after successfully sending a cross-chain message.
258
+ */
259
+ export interface MessagingReceipt {
260
+ /**
261
+ * The fees charged for sending the message.
262
+ */
263
+ fee: MessagingFee;
264
+ /**
265
+ * Globally unique identifier for the message.
266
+ */
267
+ guid: Buffer;
268
+ /**
269
+ * The outbound nonce for this pathway.
270
+ */
271
+ nonce: u64;
272
+ }
273
+ /**
274
+ * Type of message library indicating supported operations.
275
+ */
276
+ export type MessageLibType = {
277
+ tag: "Send";
278
+ values: void;
279
+ } | {
280
+ tag: "Receive";
281
+ values: void;
282
+ } | {
283
+ tag: "SendAndReceive";
284
+ values: void;
285
+ };
286
+ /**
287
+ * Version information for a message library.
288
+ *
289
+ * Note: `minor` and `endpoint_version` use `u32` instead of `u8` because Stellar does not
290
+ * support `u8` types in contract interface functions.
291
+ */
292
+ export interface MessageLibVersion {
293
+ /**
294
+ * Endpoint version (should not exceed u8::MAX = 255).
295
+ */
296
+ endpoint_version: u32;
297
+ /**
298
+ * Major version number.
299
+ */
300
+ major: u64;
301
+ /**
302
+ * Minor version number (should not exceed u8::MAX = 255).
303
+ */
304
+ minor: u32;
305
+ }
306
+ /**
307
+ * Timeout configuration for receive library transitions.
308
+ */
309
+ export interface Timeout {
310
+ /**
311
+ * Unix timestamp when the timeout expires.
312
+ */
313
+ expiry: u64;
314
+ /**
315
+ * The new library address to transition to.
316
+ */
317
+ lib: string;
318
+ }
319
+ /**
320
+ * Parameters for setting message library configuration.
321
+ */
322
+ export interface SetConfigParam {
323
+ /**
324
+ * XDR-encoded configuration data.
325
+ */
326
+ config: Buffer;
327
+ /**
328
+ * The type of configuration (e.g., executor, ULN).
329
+ */
330
+ config_type: u32;
331
+ /**
332
+ * The endpoint ID this config applies to.
333
+ */
334
+ eid: u32;
335
+ }
336
+ /**
337
+ * Resolved library information with default status.
338
+ */
339
+ export interface ResolvedLibrary {
340
+ /**
341
+ * Whether this is the default library (true) or OApp-specific (false).
342
+ */
343
+ is_default: boolean;
344
+ /**
345
+ * The resolved library address.
346
+ */
347
+ lib: string;
348
+ }
349
+ /**
350
+ * Outbound packet containing all information for cross-chain transmission.
351
+ */
352
+ export interface OutboundPacket {
353
+ /**
354
+ * Destination endpoint ID.
355
+ */
356
+ dst_eid: u32;
357
+ /**
358
+ * Globally unique identifier for this message.
359
+ */
360
+ guid: Buffer;
361
+ /**
362
+ * The message payload.
363
+ */
364
+ message: Buffer;
365
+ /**
366
+ * Outbound nonce for this pathway.
367
+ */
368
+ nonce: u64;
369
+ /**
370
+ * Receiver address on destination chain (32 bytes).
371
+ */
372
+ receiver: Buffer;
373
+ /**
374
+ * Sender address on source chain.
375
+ */
376
+ sender: string;
377
+ /**
378
+ * Source endpoint ID.
379
+ */
380
+ src_eid: u32;
381
+ }
382
+ /**
383
+ * A fee recipient with the amount to be paid.
384
+ */
385
+ export interface FeeRecipient {
386
+ /**
387
+ * Amount of fee to pay.
388
+ */
389
+ amount: i128;
390
+ /**
391
+ * The address to send the fee to.
392
+ */
393
+ to: string;
394
+ }
395
+ /**
396
+ * Result of send operation containing fees and encoded packet.
397
+ */
398
+ export interface FeesAndPacket {
399
+ /**
400
+ * The encoded packet ready for transmission.
401
+ */
402
+ encoded_packet: Buffer;
403
+ /**
404
+ * List of native token fee recipients (executor, DVNs, treasury).
405
+ */
406
+ native_fee_recipients: Array<FeeRecipient>;
407
+ /**
408
+ * List of ZRO token fee recipients (treasury).
409
+ */
410
+ zro_fee_recipients: Array<FeeRecipient>;
411
+ }
412
+ /**
413
+ * PacketCodecV1Error: 1100-1109
414
+ */
415
+ export declare const PacketCodecV1Error: {
416
+ 1100: {
417
+ message: string;
418
+ };
419
+ 1101: {
420
+ message: string;
421
+ };
422
+ };
423
+ /**
424
+ * WorkerOptionsError: 1110-1119
425
+ */
426
+ export declare const WorkerOptionsError: {
427
+ 1110: {
428
+ message: string;
429
+ };
430
+ 1111: {
431
+ message: string;
432
+ };
433
+ 1112: {
434
+ message: string;
435
+ };
436
+ 1113: {
437
+ message: string;
438
+ };
439
+ 1114: {
440
+ message: string;
441
+ };
442
+ 1115: {
443
+ message: string;
444
+ };
445
+ 1116: {
446
+ message: string;
447
+ };
448
+ 1117: {
449
+ message: string;
450
+ };
451
+ 1118: {
452
+ message: string;
453
+ };
454
+ };
455
+ /**
456
+ * BufferReaderError: 1000-1009
457
+ */
458
+ export declare const BufferReaderError: {
459
+ 1000: {
460
+ message: string;
461
+ };
462
+ 1001: {
463
+ message: string;
464
+ };
465
+ };
466
+ /**
467
+ * BufferWriterError: 1010-1019
468
+ */
469
+ export declare const BufferWriterError: {
470
+ 1010: {
471
+ message: string;
472
+ };
473
+ };
474
+ /**
475
+ * TtlConfigurableError: 1020-1029
476
+ */
477
+ export declare const TtlConfigurableError: {
478
+ 1020: {
479
+ message: string;
480
+ };
481
+ 1021: {
482
+ message: string;
483
+ };
484
+ 1022: {
485
+ message: string;
486
+ };
487
+ };
488
+ /**
489
+ * OwnableError: 1030-1039
490
+ */
491
+ export declare const OwnableError: {
492
+ 1030: {
493
+ message: string;
494
+ };
495
+ 1031: {
496
+ message: string;
497
+ };
498
+ };
499
+ /**
500
+ * BytesExtError: 1040-1049
501
+ */
502
+ export declare const BytesExtError: {
503
+ 1040: {
504
+ message: string;
505
+ };
506
+ };
507
+ /**
508
+ * UpgradeableError: 1050-1059
509
+ */
510
+ export declare const UpgradeableError: {
511
+ 1050: {
512
+ message: string;
513
+ };
514
+ };
515
+ /**
516
+ * MultisigError: 1060-1069
517
+ */
518
+ export declare const MultisigError: {
519
+ 1060: {
520
+ message: string;
521
+ };
522
+ 1061: {
523
+ message: string;
524
+ };
525
+ 1062: {
526
+ message: string;
527
+ };
528
+ 1063: {
529
+ message: string;
530
+ };
531
+ 1064: {
532
+ message: string;
533
+ };
534
+ 1065: {
535
+ message: string;
536
+ };
537
+ 1066: {
538
+ message: string;
539
+ };
540
+ 1067: {
541
+ message: string;
542
+ };
543
+ };
544
+ export type MultisigStorage = {
545
+ tag: "Signers";
546
+ values: void;
547
+ } | {
548
+ tag: "Threshold";
549
+ values: void;
550
+ };
551
+ export type OwnableStorage = {
552
+ tag: "Owner";
553
+ values: void;
554
+ };
555
+ /**
556
+ * TTL configuration: threshold (when to extend) and extend_to (target TTL).
557
+ */
558
+ export interface TtlConfig {
559
+ /**
560
+ * Target TTL after extension (in ledgers).
561
+ */
562
+ extend_to: u32;
563
+ /**
564
+ * TTL threshold that triggers extension (in ledgers).
565
+ */
566
+ threshold: u32;
567
+ }
568
+ export type TtlConfigStorage = {
569
+ tag: "Frozen";
570
+ values: void;
571
+ } | {
572
+ tag: "Instance";
573
+ values: void;
574
+ } | {
575
+ tag: "Persistent";
576
+ values: void;
577
+ };
578
+ export type UpgradeableStorage = {
579
+ tag: "Migrating";
580
+ values: void;
581
+ };
582
+ /**
583
+ * WorkerError: 1200-1299
584
+ */
585
+ export declare const WorkerError: {
586
+ 1200: {
587
+ message: string;
588
+ };
589
+ 1201: {
590
+ message: string;
591
+ };
592
+ 1202: {
593
+ message: string;
594
+ };
595
+ 1203: {
596
+ message: string;
597
+ };
598
+ 1204: {
599
+ message: string;
600
+ };
601
+ 1205: {
602
+ message: string;
603
+ };
604
+ 1206: {
605
+ message: string;
606
+ };
607
+ 1207: {
608
+ message: string;
609
+ };
610
+ 1208: {
611
+ message: string;
612
+ };
613
+ 1209: {
614
+ message: string;
615
+ };
616
+ 1210: {
617
+ message: string;
618
+ };
619
+ 1211: {
620
+ message: string;
621
+ };
622
+ 1212: {
623
+ message: string;
624
+ };
625
+ 1213: {
626
+ message: string;
627
+ };
628
+ 1214: {
629
+ message: string;
630
+ };
631
+ 1215: {
632
+ message: string;
633
+ };
634
+ 1216: {
635
+ message: string;
636
+ };
637
+ 1217: {
638
+ message: string;
639
+ };
640
+ 1218: {
641
+ message: string;
642
+ };
643
+ };
644
+ /**
645
+ * Parameters for DVN fee calculation.
646
+ *
647
+ * Contains all inputs needed by the fee library to calculate verification fees
648
+ * for cross-chain messages. Includes message parameters, common configuration,
649
+ * and destination-specific settings.
650
+ */
651
+ export interface DvnFeeParams {
652
+ /**
653
+ * Number of block confirmations required.
654
+ */
655
+ confirmations: u64;
656
+ /**
657
+ * Default fee multiplier in basis points (used if no dst-specific multiplier).
658
+ */
659
+ default_multiplier_bps: u32;
660
+ /**
661
+ * Destination endpoint ID (chain identifier).
662
+ */
663
+ dst_eid: u32;
664
+ /**
665
+ * Minimum fee margin in USD (scaled).
666
+ */
667
+ floor_margin_usd: u128;
668
+ /**
669
+ * ============================================================================================
670
+ * Destination-Specific Configuration
671
+ * ============================================================================================
672
+ * Gas estimate for verification on destination chain.
673
+ */
674
+ gas: u128;
675
+ /**
676
+ * Destination-specific fee multiplier in basis points (0 = use default).
677
+ */
678
+ multiplier_bps: u32;
679
+ /**
680
+ * DVN options
681
+ */
682
+ options: Buffer;
683
+ /**
684
+ * ============================================================================================
685
+ * Common Configuration
686
+ * ============================================================================================
687
+ * Price feed contract address for gas price and exchange rate data.
688
+ */
689
+ price_feed: string;
690
+ /**
691
+ * Number of required signatures (quorum).
692
+ */
693
+ quorum: u32;
694
+ /**
695
+ * ============================================================================================
696
+ * Message Parameters
697
+ * ============================================================================================
698
+ * The OApp sender address.
699
+ */
700
+ sender: string;
701
+ }
702
+ /**
703
+ * Parameters for executor fee calculation.
704
+ *
705
+ * Contains all inputs needed by the fee library to calculate execution fees
706
+ * for cross-chain messages. Includes message parameters, common configuration,
707
+ * and destination-specific settings.
708
+ */
709
+ export interface FeeParams {
710
+ /**
711
+ * Size of the message calldata in bytes.
712
+ */
713
+ calldata_size: u32;
714
+ /**
715
+ * Default fee multiplier in basis points (used if no dst-specific multiplier).
716
+ */
717
+ default_multiplier_bps: u32;
718
+ /**
719
+ * Destination endpoint ID (chain identifier).
720
+ */
721
+ dst_eid: u32;
722
+ /**
723
+ * Minimum fee margin in USD (scaled).
724
+ */
725
+ floor_margin_usd: u128;
726
+ /**
727
+ * Base gas for each lzCompose call on destination chain.
728
+ */
729
+ lz_compose_base_gas: u64;
730
+ /**
731
+ * ============================================================================================
732
+ * Destination-Specific Configuration
733
+ * ============================================================================================
734
+ * Base gas for lzReceive execution on destination chain.
735
+ */
736
+ lz_receive_base_gas: u64;
737
+ /**
738
+ * Destination-specific fee multiplier in basis points (0 = use default).
739
+ */
740
+ multiplier_bps: u32;
741
+ /**
742
+ * Maximum native token value that can be sent.
743
+ */
744
+ native_cap: u128;
745
+ /**
746
+ * Encoded executor options (lzReceive gas, lzCompose, nativeDrop, etc.).
747
+ */
748
+ options: Buffer;
749
+ /**
750
+ * ============================================================================================
751
+ * Common Configuration
752
+ * ============================================================================================
753
+ * Price feed contract address for gas price and exchange rate data.
754
+ */
755
+ price_feed: string;
756
+ /**
757
+ * ============================================================================================
758
+ * Message Parameters
759
+ * ============================================================================================
760
+ * The OApp sender address.
761
+ */
762
+ sender: string;
763
+ }
764
+ /**
765
+ * Gas price information for a destination endpoint.
766
+ *
767
+ * Contains the exchange rate and gas costs needed for cross-chain fee calculations.
768
+ */
769
+ export interface Price {
770
+ /**
771
+ * Gas cost per byte of calldata on the destination chain.
772
+ */
773
+ gas_per_byte: u32;
774
+ /**
775
+ * Gas price in the smallest unit (wei for EVM, stroops for Stellar).
776
+ */
777
+ gas_price_in_unit: u64;
778
+ /**
779
+ * Price ratio = (remote native token price / local native token price) * PRICE_RATIO_DENOMINATOR.
780
+ * Used to convert destination chain gas costs to source chain native token.
781
+ */
782
+ price_ratio: u128;
783
+ }
784
+ /**
785
+ * Fee estimation result with detailed breakdown.
786
+ *
787
+ * Contains the calculated fee and all intermediate values used in the calculation.
788
+ */
789
+ export interface FeeEstimate {
790
+ /**
791
+ * Source chain native token price in USD (scaled).
792
+ */
793
+ native_price_usd: u128;
794
+ /**
795
+ * Price ratio used for the calculation.
796
+ */
797
+ price_ratio: u128;
798
+ /**
799
+ * Denominator for the price ratio (typically 10^20).
800
+ */
801
+ price_ratio_denominator: u128;
802
+ /**
803
+ * Total gas fee in source chain native token units.
804
+ */
805
+ total_gas_fee: i128;
806
+ }
807
+ export type WorkerStorage = {
808
+ tag: "Paused";
809
+ values: void;
810
+ } | {
811
+ tag: "DepositAddress";
812
+ values: void;
813
+ } | {
814
+ tag: "PriceFeed";
815
+ values: void;
816
+ } | {
817
+ tag: "WorkerFeeLib";
818
+ values: void;
819
+ } | {
820
+ tag: "DefaultMultiplierBps";
821
+ values: void;
822
+ } | {
823
+ tag: "SupportedOptionTypes";
824
+ values: readonly [u32];
825
+ } | {
826
+ tag: "MessageLibs";
827
+ values: void;
828
+ } | {
829
+ tag: "Allowlist";
830
+ values: readonly [string];
831
+ } | {
832
+ tag: "Denylist";
833
+ values: readonly [string];
834
+ } | {
835
+ tag: "AllowlistSize";
836
+ values: void;
837
+ } | {
838
+ tag: "Admins";
839
+ values: void;
840
+ };
841
+ export interface Client {
842
+ /**
843
+ * Construct and simulate a set_paused 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.
844
+ * Sets the paused state of the worker.
845
+ *
846
+ * When paused, the worker will reject new job assignments (e.g., assign_job, get_fee).
847
+ * Existing jobs in progress are not affected.
848
+ *
849
+ * # Arguments
850
+ * * `paused` - `true` to pause, `false` to unpause
851
+ */
852
+ set_paused: ({ paused }: {
853
+ paused: boolean;
854
+ }, txnOptions?: {
855
+ /**
856
+ * The fee to pay for the transaction. Default: BASE_FEE
857
+ */
858
+ fee?: number;
859
+ /**
860
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
861
+ */
862
+ timeoutInSeconds?: number;
863
+ /**
864
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
865
+ */
866
+ simulate?: boolean;
867
+ }) => Promise<AssembledTransaction<null>>;
868
+ /**
869
+ * Construct and simulate a set_supported_message_lib 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.
870
+ * Sets whether a message library is supported by this worker.
871
+ *
872
+ * Message libraries (e.g., ULN302) call workers to assign jobs. Only supported
873
+ * libraries can interact with this worker.
874
+ *
875
+ * # Arguments
876
+ * * `message_lib` - The message library contract address
877
+ * * `supported` - `true` to add support, `false` to remove support
878
+ */
879
+ set_supported_message_lib: ({ message_lib, supported }: {
880
+ message_lib: string;
881
+ supported: boolean;
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 set_allowlist 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
+ * Sets allowlist status for an OApp address.
899
+ *
900
+ * When the allowlist is empty, all OApps are allowed (unless on denylist).
901
+ * When the allowlist is not empty, only allowlisted OApps are allowed.
902
+ * Denylist always takes precedence over allowlist.
903
+ *
904
+ * # Arguments
905
+ * * `oapp` - The OApp contract address
906
+ * * `allowed` - `true` to add to allowlist, `false` to remove
907
+ */
908
+ set_allowlist: ({ oapp, allowed }: {
909
+ oapp: string;
910
+ allowed: boolean;
911
+ }, 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<null>>;
925
+ /**
926
+ * Construct and simulate a set_denylist 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
+ * Sets denylist status for an OApp address.
928
+ *
929
+ * Denylisted OApps are blocked from using this worker, even if they're on
930
+ * the allowlist (denylist takes precedence).
931
+ *
932
+ * # Arguments
933
+ * * `oapp` - The OApp contract address
934
+ * * `denied` - `true` to add to denylist, `false` to remove
935
+ */
936
+ set_denylist: ({ oapp, denied }: {
937
+ oapp: string;
938
+ denied: boolean;
939
+ }, txnOptions?: {
940
+ /**
941
+ * The fee to pay for the transaction. Default: BASE_FEE
942
+ */
943
+ fee?: number;
944
+ /**
945
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
946
+ */
947
+ timeoutInSeconds?: number;
948
+ /**
949
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
950
+ */
951
+ simulate?: boolean;
952
+ }) => Promise<AssembledTransaction<null>>;
953
+ /**
954
+ * Construct and simulate a set_default_multiplier_bps 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.
955
+ * Sets the default fee multiplier in basis points.
956
+ *
957
+ * The multiplier is applied to base fees during fee calculation. Used when
958
+ * no destination-specific multiplier is configured.
959
+ *
960
+ * # Arguments
961
+ * * `admin` - Admin address (must provide authorization)
962
+ * * `multiplier_bps` - Multiplier in basis points (10000 = 1x, 12000 = 1.2x)
963
+ */
964
+ set_default_multiplier_bps: ({ admin, multiplier_bps }: {
965
+ admin: string;
966
+ multiplier_bps: u32;
967
+ }, txnOptions?: {
968
+ /**
969
+ * The fee to pay for the transaction. Default: BASE_FEE
970
+ */
971
+ fee?: number;
972
+ /**
973
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
974
+ */
975
+ timeoutInSeconds?: number;
976
+ /**
977
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
978
+ */
979
+ simulate?: boolean;
980
+ }) => Promise<AssembledTransaction<null>>;
981
+ /**
982
+ * Construct and simulate a set_deposit_address 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.
983
+ * Sets the deposit address where worker fees are collected.
984
+ *
985
+ * When jobs are assigned, fees are directed to this address.
986
+ *
987
+ * # Arguments
988
+ * * `admin` - Admin address (must provide authorization)
989
+ * * `deposit_address` - Address to receive collected fees
990
+ */
991
+ set_deposit_address: ({ admin, deposit_address }: {
992
+ admin: string;
993
+ deposit_address: string;
994
+ }, txnOptions?: {
995
+ /**
996
+ * The fee to pay for the transaction. Default: BASE_FEE
997
+ */
998
+ fee?: number;
999
+ /**
1000
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1001
+ */
1002
+ timeoutInSeconds?: number;
1003
+ /**
1004
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1005
+ */
1006
+ simulate?: boolean;
1007
+ }) => Promise<AssembledTransaction<null>>;
1008
+ /**
1009
+ * Construct and simulate a set_supported_option_types 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.
1010
+ * Sets supported executor option types for a destination endpoint.
1011
+ *
1012
+ * # Arguments
1013
+ * * `admin` - Admin address (must provide authorization)
1014
+ * * `eid` - Destination endpoint ID (chain identifier)
1015
+ * * `option_types` - Encoded supported option types
1016
+ */
1017
+ set_supported_option_types: ({ admin, eid, option_types }: {
1018
+ admin: string;
1019
+ eid: u32;
1020
+ option_types: Buffer;
1021
+ }, txnOptions?: {
1022
+ /**
1023
+ * The fee to pay for the transaction. Default: BASE_FEE
1024
+ */
1025
+ fee?: number;
1026
+ /**
1027
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1028
+ */
1029
+ timeoutInSeconds?: number;
1030
+ /**
1031
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1032
+ */
1033
+ simulate?: boolean;
1034
+ }) => Promise<AssembledTransaction<null>>;
1035
+ /**
1036
+ * Construct and simulate a set_worker_fee_lib 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.
1037
+ * Sets the worker fee library contract address.
1038
+ *
1039
+ * The fee library calculates fees based on executor options and price feed data.
1040
+ *
1041
+ * # Arguments
1042
+ * * `admin` - Admin address (must provide authorization)
1043
+ * * `worker_fee_lib` - Fee library contract address implementing `IExecutorFeeLib`
1044
+ */
1045
+ set_worker_fee_lib: ({ admin, worker_fee_lib }: {
1046
+ admin: string;
1047
+ worker_fee_lib: string;
1048
+ }, txnOptions?: {
1049
+ /**
1050
+ * The fee to pay for the transaction. Default: BASE_FEE
1051
+ */
1052
+ fee?: number;
1053
+ /**
1054
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1055
+ */
1056
+ timeoutInSeconds?: number;
1057
+ /**
1058
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1059
+ */
1060
+ simulate?: boolean;
1061
+ }) => Promise<AssembledTransaction<null>>;
1062
+ /**
1063
+ * Construct and simulate a set_price_feed 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.
1064
+ * Sets the price feed contract address.
1065
+ *
1066
+ * The price feed provides gas prices and exchange rates for cross-chain
1067
+ * fee calculations.
1068
+ *
1069
+ * # Arguments
1070
+ * * `admin` - Admin address (must provide authorization)
1071
+ * * `price_feed` - Price feed contract address implementing `ILayerZeroPriceFeed`
1072
+ */
1073
+ set_price_feed: ({ admin, price_feed }: {
1074
+ admin: string;
1075
+ price_feed: string;
1076
+ }, txnOptions?: {
1077
+ /**
1078
+ * The fee to pay for the transaction. Default: BASE_FEE
1079
+ */
1080
+ fee?: number;
1081
+ /**
1082
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1083
+ */
1084
+ timeoutInSeconds?: number;
1085
+ /**
1086
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1087
+ */
1088
+ simulate?: boolean;
1089
+ }) => Promise<AssembledTransaction<null>>;
1090
+ /**
1091
+ * Construct and simulate a is_admin 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.
1092
+ * Returns whether an address is an admin.
1093
+ *
1094
+ * # Arguments
1095
+ * * `admin` - The address to check
1096
+ */
1097
+ is_admin: ({ admin }: {
1098
+ admin: string;
1099
+ }, txnOptions?: {
1100
+ /**
1101
+ * The fee to pay for the transaction. Default: BASE_FEE
1102
+ */
1103
+ fee?: number;
1104
+ /**
1105
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1106
+ */
1107
+ timeoutInSeconds?: number;
1108
+ /**
1109
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1110
+ */
1111
+ simulate?: boolean;
1112
+ }) => Promise<AssembledTransaction<boolean>>;
1113
+ /**
1114
+ * Construct and simulate a admins 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.
1115
+ * Returns all admin addresses.
1116
+ */
1117
+ admins: (txnOptions?: {
1118
+ /**
1119
+ * The fee to pay for the transaction. Default: BASE_FEE
1120
+ */
1121
+ fee?: number;
1122
+ /**
1123
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1124
+ */
1125
+ timeoutInSeconds?: number;
1126
+ /**
1127
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1128
+ */
1129
+ simulate?: boolean;
1130
+ }) => Promise<AssembledTransaction<Array<string>>>;
1131
+ /**
1132
+ * Construct and simulate a paused 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.
1133
+ * Returns whether the worker is paused.
1134
+ */
1135
+ paused: (txnOptions?: {
1136
+ /**
1137
+ * The fee to pay for the transaction. Default: BASE_FEE
1138
+ */
1139
+ fee?: number;
1140
+ /**
1141
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1142
+ */
1143
+ timeoutInSeconds?: number;
1144
+ /**
1145
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1146
+ */
1147
+ simulate?: boolean;
1148
+ }) => Promise<AssembledTransaction<boolean>>;
1149
+ /**
1150
+ * Construct and simulate a is_supported_message_lib 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.
1151
+ * Returns whether a message library is supported.
1152
+ *
1153
+ * # Arguments
1154
+ * * `message_lib` - Message library contract address
1155
+ */
1156
+ is_supported_message_lib: ({ message_lib }: {
1157
+ message_lib: string;
1158
+ }, txnOptions?: {
1159
+ /**
1160
+ * The fee to pay for the transaction. Default: BASE_FEE
1161
+ */
1162
+ fee?: number;
1163
+ /**
1164
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1165
+ */
1166
+ timeoutInSeconds?: number;
1167
+ /**
1168
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1169
+ */
1170
+ simulate?: boolean;
1171
+ }) => Promise<AssembledTransaction<boolean>>;
1172
+ /**
1173
+ * Construct and simulate a message_libs 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.
1174
+ * Returns all supported message library addresses.
1175
+ *
1176
+ * # Returns
1177
+ * Vector of supported message library contract addresses.
1178
+ */
1179
+ message_libs: (txnOptions?: {
1180
+ /**
1181
+ * The fee to pay for the transaction. Default: BASE_FEE
1182
+ */
1183
+ fee?: number;
1184
+ /**
1185
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1186
+ */
1187
+ timeoutInSeconds?: number;
1188
+ /**
1189
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1190
+ */
1191
+ simulate?: boolean;
1192
+ }) => Promise<AssembledTransaction<Array<string>>>;
1193
+ /**
1194
+ * Construct and simulate a is_on_allowlist 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.
1195
+ * Returns whether an OApp is on the allowlist.
1196
+ *
1197
+ * # Arguments
1198
+ * * `oapp` - OApp contract address
1199
+ */
1200
+ is_on_allowlist: ({ oapp }: {
1201
+ oapp: string;
1202
+ }, txnOptions?: {
1203
+ /**
1204
+ * The fee to pay for the transaction. Default: BASE_FEE
1205
+ */
1206
+ fee?: number;
1207
+ /**
1208
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1209
+ */
1210
+ timeoutInSeconds?: number;
1211
+ /**
1212
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1213
+ */
1214
+ simulate?: boolean;
1215
+ }) => Promise<AssembledTransaction<boolean>>;
1216
+ /**
1217
+ * Construct and simulate a is_on_denylist 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.
1218
+ * Returns whether an OApp is on the denylist.
1219
+ *
1220
+ * # Arguments
1221
+ * * `oapp` - OApp contract address
1222
+ */
1223
+ is_on_denylist: ({ oapp }: {
1224
+ oapp: string;
1225
+ }, txnOptions?: {
1226
+ /**
1227
+ * The fee to pay for the transaction. Default: BASE_FEE
1228
+ */
1229
+ fee?: number;
1230
+ /**
1231
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1232
+ */
1233
+ timeoutInSeconds?: number;
1234
+ /**
1235
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1236
+ */
1237
+ simulate?: boolean;
1238
+ }) => Promise<AssembledTransaction<boolean>>;
1239
+ /**
1240
+ * Construct and simulate a has_acl 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.
1241
+ * Returns whether an OApp has access control list (ACL) permission.
1242
+ *
1243
+ * ACL evaluation order:
1244
+ * 1. If on denylist → denied
1245
+ * 2. If allowlist is empty OR on allowlist → allowed
1246
+ * 3. Otherwise → denied
1247
+ *
1248
+ * # Arguments
1249
+ * * `sender` - OApp contract address to check
1250
+ */
1251
+ has_acl: ({ sender }: {
1252
+ sender: string;
1253
+ }, txnOptions?: {
1254
+ /**
1255
+ * The fee to pay for the transaction. Default: BASE_FEE
1256
+ */
1257
+ fee?: number;
1258
+ /**
1259
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1260
+ */
1261
+ timeoutInSeconds?: number;
1262
+ /**
1263
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1264
+ */
1265
+ simulate?: boolean;
1266
+ }) => Promise<AssembledTransaction<boolean>>;
1267
+ /**
1268
+ * Construct and simulate a allowlist_size 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.
1269
+ * Returns the number of addresses on the allowlist.
1270
+ */
1271
+ allowlist_size: (txnOptions?: {
1272
+ /**
1273
+ * The fee to pay for the transaction. Default: BASE_FEE
1274
+ */
1275
+ fee?: number;
1276
+ /**
1277
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1278
+ */
1279
+ timeoutInSeconds?: number;
1280
+ /**
1281
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1282
+ */
1283
+ simulate?: boolean;
1284
+ }) => Promise<AssembledTransaction<u32>>;
1285
+ /**
1286
+ * Construct and simulate a default_multiplier_bps 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.
1287
+ * Returns the default fee multiplier in basis points.
1288
+ */
1289
+ default_multiplier_bps: (txnOptions?: {
1290
+ /**
1291
+ * The fee to pay for the transaction. Default: BASE_FEE
1292
+ */
1293
+ fee?: number;
1294
+ /**
1295
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1296
+ */
1297
+ timeoutInSeconds?: number;
1298
+ /**
1299
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1300
+ */
1301
+ simulate?: boolean;
1302
+ }) => Promise<AssembledTransaction<u32>>;
1303
+ /**
1304
+ * Construct and simulate a deposit_address 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.
1305
+ * Returns the deposit address where fees are collected.
1306
+ */
1307
+ deposit_address: (txnOptions?: {
1308
+ /**
1309
+ * The fee to pay for the transaction. Default: BASE_FEE
1310
+ */
1311
+ fee?: number;
1312
+ /**
1313
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1314
+ */
1315
+ timeoutInSeconds?: number;
1316
+ /**
1317
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1318
+ */
1319
+ simulate?: boolean;
1320
+ }) => Promise<AssembledTransaction<string>>;
1321
+ /**
1322
+ * Construct and simulate a price_feed 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.
1323
+ * Returns the price feed contract address.
1324
+ */
1325
+ price_feed: (txnOptions?: {
1326
+ /**
1327
+ * The fee to pay for the transaction. Default: BASE_FEE
1328
+ */
1329
+ fee?: number;
1330
+ /**
1331
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1332
+ */
1333
+ timeoutInSeconds?: number;
1334
+ /**
1335
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1336
+ */
1337
+ simulate?: boolean;
1338
+ }) => Promise<AssembledTransaction<string>>;
1339
+ /**
1340
+ * Construct and simulate a get_supported_option_types 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.
1341
+ * Returns supported option types for a destination endpoint.
1342
+ *
1343
+ * # Arguments
1344
+ * * `eid` - Destination endpoint ID (chain identifier)
1345
+ */
1346
+ get_supported_option_types: ({ eid }: {
1347
+ eid: u32;
1348
+ }, txnOptions?: {
1349
+ /**
1350
+ * The fee to pay for the transaction. Default: BASE_FEE
1351
+ */
1352
+ fee?: number;
1353
+ /**
1354
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1355
+ */
1356
+ timeoutInSeconds?: number;
1357
+ /**
1358
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1359
+ */
1360
+ simulate?: boolean;
1361
+ }) => Promise<AssembledTransaction<Option<Buffer>>>;
1362
+ /**
1363
+ * Construct and simulate a worker_fee_lib 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.
1364
+ * Returns the worker fee library contract address.
1365
+ */
1366
+ worker_fee_lib: (txnOptions?: {
1367
+ /**
1368
+ * The fee to pay for the transaction. Default: BASE_FEE
1369
+ */
1370
+ fee?: number;
1371
+ /**
1372
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1373
+ */
1374
+ timeoutInSeconds?: number;
1375
+ /**
1376
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1377
+ */
1378
+ simulate?: boolean;
1379
+ }) => Promise<AssembledTransaction<string>>;
1380
+ /**
1381
+ * 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.
1382
+ * Calculates the verification fee for a cross-chain message.
1383
+ *
1384
+ * Called by the send library to quote DVN fees before sending.
1385
+ */
1386
+ get_fee: ({ send_lib, sender, dst_eid, packet_header, payload_hash, confirmations, options }: {
1387
+ send_lib: string;
1388
+ sender: string;
1389
+ dst_eid: u32;
1390
+ packet_header: Buffer;
1391
+ payload_hash: Buffer;
1392
+ confirmations: u64;
1393
+ options: Buffer;
1394
+ }, txnOptions?: {
1395
+ /**
1396
+ * The fee to pay for the transaction. Default: BASE_FEE
1397
+ */
1398
+ fee?: number;
1399
+ /**
1400
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1401
+ */
1402
+ timeoutInSeconds?: number;
1403
+ /**
1404
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1405
+ */
1406
+ simulate?: boolean;
1407
+ }) => Promise<AssembledTransaction<i128>>;
1408
+ /**
1409
+ * Construct and simulate a assign_job 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.
1410
+ * Assigns a verification job to this DVN and returns fee payment info.
1411
+ *
1412
+ * Called by the send library when a message is sent. The DVN will later
1413
+ * verify the message on the destination chain.
1414
+ */
1415
+ assign_job: ({ send_lib, sender, dst_eid, packet_header, payload_hash, confirmations, options }: {
1416
+ send_lib: string;
1417
+ sender: string;
1418
+ dst_eid: u32;
1419
+ packet_header: Buffer;
1420
+ payload_hash: Buffer;
1421
+ confirmations: u64;
1422
+ options: Buffer;
1423
+ }, txnOptions?: {
1424
+ /**
1425
+ * The fee to pay for the transaction. Default: BASE_FEE
1426
+ */
1427
+ fee?: number;
1428
+ /**
1429
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1430
+ */
1431
+ timeoutInSeconds?: number;
1432
+ /**
1433
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1434
+ */
1435
+ simulate?: boolean;
1436
+ }) => Promise<AssembledTransaction<FeeRecipient>>;
1437
+ /**
1438
+ * Construct and simulate a set_dst_config 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.
1439
+ * Sets destination chain configurations. Requires admin authorization.
1440
+ */
1441
+ set_dst_config: ({ admin, params }: {
1442
+ admin: string;
1443
+ params: Array<DstConfigParam>;
1444
+ }, txnOptions?: {
1445
+ /**
1446
+ * The fee to pay for the transaction. Default: BASE_FEE
1447
+ */
1448
+ fee?: number;
1449
+ /**
1450
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1451
+ */
1452
+ timeoutInSeconds?: number;
1453
+ /**
1454
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1455
+ */
1456
+ simulate?: boolean;
1457
+ }) => Promise<AssembledTransaction<null>>;
1458
+ /**
1459
+ * Construct and simulate a dst_config 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.
1460
+ * Returns the destination configuration for a specific endpoint ID.
1461
+ */
1462
+ dst_config: ({ dst_eid }: {
1463
+ dst_eid: u32;
1464
+ }, txnOptions?: {
1465
+ /**
1466
+ * The fee to pay for the transaction. Default: BASE_FEE
1467
+ */
1468
+ fee?: number;
1469
+ /**
1470
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1471
+ */
1472
+ timeoutInSeconds?: number;
1473
+ /**
1474
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1475
+ */
1476
+ simulate?: boolean;
1477
+ }) => Promise<AssembledTransaction<Option<DstConfig>>>;
1478
+ /**
1479
+ * Construct and simulate a vid 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.
1480
+ * Returns the Verifier ID for this DVN.
1481
+ */
1482
+ vid: (txnOptions?: {
1483
+ /**
1484
+ * The fee to pay for the transaction. Default: BASE_FEE
1485
+ */
1486
+ fee?: number;
1487
+ /**
1488
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1489
+ */
1490
+ timeoutInSeconds?: number;
1491
+ /**
1492
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1493
+ */
1494
+ simulate?: boolean;
1495
+ }) => Promise<AssembledTransaction<u32>>;
1496
+ /**
1497
+ * Construct and simulate a hash_call_data 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.
1498
+ * Computes the hash of call data for multisig signing.
1499
+ *
1500
+ * Off-chain signers use this to compute the hash they need to sign.
1501
+ */
1502
+ hash_call_data: ({ vid, expiration, calls }: {
1503
+ vid: u32;
1504
+ expiration: u64;
1505
+ calls: Array<Call>;
1506
+ }, txnOptions?: {
1507
+ /**
1508
+ * The fee to pay for the transaction. Default: BASE_FEE
1509
+ */
1510
+ fee?: number;
1511
+ /**
1512
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1513
+ */
1514
+ timeoutInSeconds?: number;
1515
+ /**
1516
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1517
+ */
1518
+ simulate?: boolean;
1519
+ }) => Promise<AssembledTransaction<Buffer>>;
1520
+ /**
1521
+ * Construct and simulate a set_admin 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.
1522
+ * Sets admin status for an address. Can be called by an existing admin.
1523
+ *
1524
+ * This allows existing admins to add or remove other admins without going through
1525
+ * the owner/multisig path.
1526
+ *
1527
+ * # Arguments
1528
+ * * `caller` - The admin calling this function (must provide authorization)
1529
+ * * `admin` - The address to set admin status for
1530
+ * * `active` - `true` to add admin, `false` to remove
1531
+ */
1532
+ set_admin: ({ caller, admin, active }: {
1533
+ caller: string;
1534
+ admin: string;
1535
+ active: boolean;
1536
+ }, txnOptions?: {
1537
+ /**
1538
+ * The fee to pay for the transaction. Default: BASE_FEE
1539
+ */
1540
+ fee?: number;
1541
+ /**
1542
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1543
+ */
1544
+ timeoutInSeconds?: number;
1545
+ /**
1546
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1547
+ */
1548
+ simulate?: boolean;
1549
+ }) => Promise<AssembledTransaction<null>>;
1550
+ /**
1551
+ * Construct and simulate a quorum_change_admin 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.
1552
+ * Allows the quorum to add/remove admins without requiring an admin signature.
1553
+ *
1554
+ * This function bypasses the normal admin verification in `__check_auth`,
1555
+ * requiring only multisig quorum signatures. Must be called as a single
1556
+ * operation (cannot be bundled with other calls).
1557
+ *
1558
+ * # Arguments
1559
+ * * `admin` - The address to set admin status for
1560
+ * * `active` - `true` to add admin, `false` to remove
1561
+ */
1562
+ quorum_change_admin: ({ admin, active }: {
1563
+ admin: string;
1564
+ active: boolean;
1565
+ }, txnOptions?: {
1566
+ /**
1567
+ * The fee to pay for the transaction. Default: BASE_FEE
1568
+ */
1569
+ fee?: number;
1570
+ /**
1571
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1572
+ */
1573
+ timeoutInSeconds?: number;
1574
+ /**
1575
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1576
+ */
1577
+ simulate?: boolean;
1578
+ }) => Promise<AssembledTransaction<null>>;
1579
+ /**
1580
+ * 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.
1581
+ */
1582
+ upgrade: ({ new_wasm_hash }: {
1583
+ new_wasm_hash: Buffer;
1584
+ }, txnOptions?: {
1585
+ /**
1586
+ * The fee to pay for the transaction. Default: BASE_FEE
1587
+ */
1588
+ fee?: number;
1589
+ /**
1590
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1591
+ */
1592
+ timeoutInSeconds?: number;
1593
+ /**
1594
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1595
+ */
1596
+ simulate?: boolean;
1597
+ }) => Promise<AssembledTransaction<null>>;
1598
+ /**
1599
+ * 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.
1600
+ */
1601
+ migrate: ({ migration_data }: {
1602
+ migration_data: MigrationData;
1603
+ }, txnOptions?: {
1604
+ /**
1605
+ * The fee to pay for the transaction. Default: BASE_FEE
1606
+ */
1607
+ fee?: number;
1608
+ /**
1609
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1610
+ */
1611
+ timeoutInSeconds?: number;
1612
+ /**
1613
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1614
+ */
1615
+ simulate?: boolean;
1616
+ }) => Promise<AssembledTransaction<null>>;
1617
+ /**
1618
+ * Construct and simulate a authorizer 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.
1619
+ */
1620
+ authorizer: (txnOptions?: {
1621
+ /**
1622
+ * The fee to pay for the transaction. Default: BASE_FEE
1623
+ */
1624
+ fee?: number;
1625
+ /**
1626
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1627
+ */
1628
+ timeoutInSeconds?: number;
1629
+ /**
1630
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1631
+ */
1632
+ simulate?: boolean;
1633
+ }) => Promise<AssembledTransaction<string>>;
1634
+ /**
1635
+ * 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.
1636
+ * Sets TTL configs for instance and persistent storage.
1637
+ *
1638
+ * - `None` values remove the corresponding config (disables auto-extension for that type)
1639
+ * - Validates that `threshold <= extend_to <= MAX_TTL`
1640
+ *
1641
+ * # Arguments
1642
+ * - `instance` - TTL config for instance storage
1643
+ * - `persistent` - TTL config for persistent storage
1644
+ *
1645
+ * # Panics
1646
+ * - `TtlConfigFrozen` if configs are frozen
1647
+ * - `InvalidTtlConfig` if validation fails
1648
+ */
1649
+ set_ttl_configs: ({ instance, persistent }: {
1650
+ instance: Option<TtlConfig>;
1651
+ persistent: Option<TtlConfig>;
1652
+ }, txnOptions?: {
1653
+ /**
1654
+ * The fee to pay for the transaction. Default: BASE_FEE
1655
+ */
1656
+ fee?: number;
1657
+ /**
1658
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1659
+ */
1660
+ timeoutInSeconds?: number;
1661
+ /**
1662
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1663
+ */
1664
+ simulate?: boolean;
1665
+ }) => Promise<AssembledTransaction<null>>;
1666
+ /**
1667
+ * 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.
1668
+ * Returns the current TTL configs as (instance_config, persistent_config).
1669
+ */
1670
+ ttl_configs: (txnOptions?: {
1671
+ /**
1672
+ * The fee to pay for the transaction. Default: BASE_FEE
1673
+ */
1674
+ fee?: number;
1675
+ /**
1676
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1677
+ */
1678
+ timeoutInSeconds?: number;
1679
+ /**
1680
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1681
+ */
1682
+ simulate?: boolean;
1683
+ }) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>>;
1684
+ /**
1685
+ * 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.
1686
+ * Permanently freezes TTL configs, preventing any future modifications.
1687
+ *
1688
+ * This is irreversible and provides immutability guarantees to users.
1689
+ * Emits `TtlConfigsFrozen` event.
1690
+ *
1691
+ * # Panics
1692
+ * - `TtlConfigAlreadyFrozen` if already frozen
1693
+ */
1694
+ freeze_ttl_configs: (txnOptions?: {
1695
+ /**
1696
+ * The fee to pay for the transaction. Default: BASE_FEE
1697
+ */
1698
+ fee?: number;
1699
+ /**
1700
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1701
+ */
1702
+ timeoutInSeconds?: number;
1703
+ /**
1704
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1705
+ */
1706
+ simulate?: boolean;
1707
+ }) => Promise<AssembledTransaction<null>>;
1708
+ /**
1709
+ * 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.
1710
+ * Returns whether TTL configs are frozen.
1711
+ */
1712
+ is_ttl_configs_frozen: (txnOptions?: {
1713
+ /**
1714
+ * The fee to pay for the transaction. Default: BASE_FEE
1715
+ */
1716
+ fee?: number;
1717
+ /**
1718
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1719
+ */
1720
+ timeoutInSeconds?: number;
1721
+ /**
1722
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1723
+ */
1724
+ simulate?: boolean;
1725
+ }) => Promise<AssembledTransaction<boolean>>;
1726
+ /**
1727
+ * 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.
1728
+ * Extends the instance TTL.
1729
+ *
1730
+ * # Arguments
1731
+ *
1732
+ * * `threshold` - The threshold to extend the TTL (if current TTL is below this, extend).
1733
+ * * `extend_to` - The TTL to extend to.
1734
+ */
1735
+ extend_instance_ttl: ({ threshold, extend_to }: {
1736
+ threshold: u32;
1737
+ extend_to: u32;
1738
+ }, txnOptions?: {
1739
+ /**
1740
+ * The fee to pay for the transaction. Default: BASE_FEE
1741
+ */
1742
+ fee?: number;
1743
+ /**
1744
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1745
+ */
1746
+ timeoutInSeconds?: number;
1747
+ /**
1748
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1749
+ */
1750
+ simulate?: boolean;
1751
+ }) => Promise<AssembledTransaction<null>>;
1752
+ /**
1753
+ * Construct and simulate a set_signer 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.
1754
+ * Adds or removes a signer from the multisig. Requires owner authorization.
1755
+ */
1756
+ set_signer: ({ signer, active }: {
1757
+ signer: Buffer;
1758
+ active: boolean;
1759
+ }, txnOptions?: {
1760
+ /**
1761
+ * The fee to pay for the transaction. Default: BASE_FEE
1762
+ */
1763
+ fee?: number;
1764
+ /**
1765
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1766
+ */
1767
+ timeoutInSeconds?: number;
1768
+ /**
1769
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1770
+ */
1771
+ simulate?: boolean;
1772
+ }) => Promise<AssembledTransaction<null>>;
1773
+ /**
1774
+ * Construct and simulate a set_threshold 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.
1775
+ * Sets the signature threshold (quorum). Requires owner authorization.
1776
+ */
1777
+ set_threshold: ({ threshold }: {
1778
+ threshold: u32;
1779
+ }, txnOptions?: {
1780
+ /**
1781
+ * The fee to pay for the transaction. Default: BASE_FEE
1782
+ */
1783
+ fee?: number;
1784
+ /**
1785
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1786
+ */
1787
+ timeoutInSeconds?: number;
1788
+ /**
1789
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1790
+ */
1791
+ simulate?: boolean;
1792
+ }) => Promise<AssembledTransaction<null>>;
1793
+ /**
1794
+ * Construct and simulate a get_signers 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.
1795
+ * Returns all registered signers.
1796
+ */
1797
+ get_signers: (txnOptions?: {
1798
+ /**
1799
+ * The fee to pay for the transaction. Default: BASE_FEE
1800
+ */
1801
+ fee?: number;
1802
+ /**
1803
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1804
+ */
1805
+ timeoutInSeconds?: number;
1806
+ /**
1807
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1808
+ */
1809
+ simulate?: boolean;
1810
+ }) => Promise<AssembledTransaction<Array<Buffer>>>;
1811
+ /**
1812
+ * Construct and simulate a total_signers 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.
1813
+ * Returns the total number of registered signers.
1814
+ */
1815
+ total_signers: (txnOptions?: {
1816
+ /**
1817
+ * The fee to pay for the transaction. Default: BASE_FEE
1818
+ */
1819
+ fee?: number;
1820
+ /**
1821
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1822
+ */
1823
+ timeoutInSeconds?: number;
1824
+ /**
1825
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1826
+ */
1827
+ simulate?: boolean;
1828
+ }) => Promise<AssembledTransaction<u32>>;
1829
+ /**
1830
+ * Construct and simulate a is_signer 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.
1831
+ * Checks if an address is a registered signer.
1832
+ */
1833
+ is_signer: ({ signer }: {
1834
+ signer: Buffer;
1835
+ }, txnOptions?: {
1836
+ /**
1837
+ * The fee to pay for the transaction. Default: BASE_FEE
1838
+ */
1839
+ fee?: number;
1840
+ /**
1841
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1842
+ */
1843
+ timeoutInSeconds?: number;
1844
+ /**
1845
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1846
+ */
1847
+ simulate?: boolean;
1848
+ }) => Promise<AssembledTransaction<boolean>>;
1849
+ /**
1850
+ * Construct and simulate a threshold 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.
1851
+ * Returns the current signature threshold (quorum).
1852
+ */
1853
+ threshold: (txnOptions?: {
1854
+ /**
1855
+ * The fee to pay for the transaction. Default: BASE_FEE
1856
+ */
1857
+ fee?: number;
1858
+ /**
1859
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1860
+ */
1861
+ timeoutInSeconds?: number;
1862
+ /**
1863
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1864
+ */
1865
+ simulate?: boolean;
1866
+ }) => Promise<AssembledTransaction<u32>>;
1867
+ /**
1868
+ * Construct and simulate a verify_signatures 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.
1869
+ * Verifies signatures against the configured threshold.
1870
+ */
1871
+ verify_signatures: ({ digest, signatures }: {
1872
+ digest: Buffer;
1873
+ signatures: Array<Buffer>;
1874
+ }, txnOptions?: {
1875
+ /**
1876
+ * The fee to pay for the transaction. Default: BASE_FEE
1877
+ */
1878
+ fee?: number;
1879
+ /**
1880
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1881
+ */
1882
+ timeoutInSeconds?: number;
1883
+ /**
1884
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1885
+ */
1886
+ simulate?: boolean;
1887
+ }) => Promise<AssembledTransaction<null>>;
1888
+ /**
1889
+ * Construct and simulate a verify_n_signatures 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.
1890
+ * Verifies signatures against a custom threshold.
1891
+ */
1892
+ verify_n_signatures: ({ digest, signatures, threshold }: {
1893
+ digest: Buffer;
1894
+ signatures: Array<Buffer>;
1895
+ threshold: u32;
1896
+ }, txnOptions?: {
1897
+ /**
1898
+ * The fee to pay for the transaction. Default: BASE_FEE
1899
+ */
1900
+ fee?: number;
1901
+ /**
1902
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1903
+ */
1904
+ timeoutInSeconds?: number;
1905
+ /**
1906
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1907
+ */
1908
+ simulate?: boolean;
1909
+ }) => Promise<AssembledTransaction<null>>;
1910
+ }
1911
+ export declare class Client extends ContractClient {
1912
+ readonly options: ContractClientOptions;
1913
+ static deploy<T = Client>(
1914
+ /** Constructor/Initialization Args for the contract's `__constructor` method */
1915
+ { vid, signers, threshold, admins, supported_msglibs, price_feed, default_multiplier_bps, worker_fee_lib, deposit_address }: {
1916
+ vid: u32;
1917
+ signers: Array<Buffer>;
1918
+ threshold: u32;
1919
+ admins: Array<string>;
1920
+ supported_msglibs: Array<string>;
1921
+ price_feed: string;
1922
+ default_multiplier_bps: u32;
1923
+ worker_fee_lib: string;
1924
+ deposit_address: string;
1925
+ },
1926
+ /** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
1927
+ options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
1928
+ /** The hash of the Wasm blob, which must already be installed on-chain. */
1929
+ wasmHash: Buffer | string;
1930
+ /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
1931
+ salt?: Buffer | Uint8Array;
1932
+ /** The format used to decode `wasmHash`, if it's provided as a string. */
1933
+ format?: "hex" | "base64";
1934
+ }): Promise<AssembledTransaction<T>>;
1935
+ constructor(options: ContractClientOptions);
1936
+ readonly fromJSON: {
1937
+ set_paused: (json: string) => AssembledTransaction<null>;
1938
+ set_supported_message_lib: (json: string) => AssembledTransaction<null>;
1939
+ set_allowlist: (json: string) => AssembledTransaction<null>;
1940
+ set_denylist: (json: string) => AssembledTransaction<null>;
1941
+ set_default_multiplier_bps: (json: string) => AssembledTransaction<null>;
1942
+ set_deposit_address: (json: string) => AssembledTransaction<null>;
1943
+ set_supported_option_types: (json: string) => AssembledTransaction<null>;
1944
+ set_worker_fee_lib: (json: string) => AssembledTransaction<null>;
1945
+ set_price_feed: (json: string) => AssembledTransaction<null>;
1946
+ is_admin: (json: string) => AssembledTransaction<boolean>;
1947
+ admins: (json: string) => AssembledTransaction<string[]>;
1948
+ paused: (json: string) => AssembledTransaction<boolean>;
1949
+ is_supported_message_lib: (json: string) => AssembledTransaction<boolean>;
1950
+ message_libs: (json: string) => AssembledTransaction<string[]>;
1951
+ is_on_allowlist: (json: string) => AssembledTransaction<boolean>;
1952
+ is_on_denylist: (json: string) => AssembledTransaction<boolean>;
1953
+ has_acl: (json: string) => AssembledTransaction<boolean>;
1954
+ allowlist_size: (json: string) => AssembledTransaction<number>;
1955
+ default_multiplier_bps: (json: string) => AssembledTransaction<number>;
1956
+ deposit_address: (json: string) => AssembledTransaction<string>;
1957
+ price_feed: (json: string) => AssembledTransaction<string>;
1958
+ get_supported_option_types: (json: string) => AssembledTransaction<Option<Buffer<ArrayBufferLike>>>;
1959
+ worker_fee_lib: (json: string) => AssembledTransaction<string>;
1960
+ get_fee: (json: string) => AssembledTransaction<bigint>;
1961
+ assign_job: (json: string) => AssembledTransaction<FeeRecipient>;
1962
+ set_dst_config: (json: string) => AssembledTransaction<null>;
1963
+ dst_config: (json: string) => AssembledTransaction<Option<DstConfig>>;
1964
+ vid: (json: string) => AssembledTransaction<number>;
1965
+ hash_call_data: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
1966
+ set_admin: (json: string) => AssembledTransaction<null>;
1967
+ quorum_change_admin: (json: string) => AssembledTransaction<null>;
1968
+ upgrade: (json: string) => AssembledTransaction<null>;
1969
+ migrate: (json: string) => AssembledTransaction<null>;
1970
+ authorizer: (json: string) => AssembledTransaction<string>;
1971
+ set_ttl_configs: (json: string) => AssembledTransaction<null>;
1972
+ ttl_configs: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>;
1973
+ freeze_ttl_configs: (json: string) => AssembledTransaction<null>;
1974
+ is_ttl_configs_frozen: (json: string) => AssembledTransaction<boolean>;
1975
+ extend_instance_ttl: (json: string) => AssembledTransaction<null>;
1976
+ set_signer: (json: string) => AssembledTransaction<null>;
1977
+ set_threshold: (json: string) => AssembledTransaction<null>;
1978
+ get_signers: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>[]>;
1979
+ total_signers: (json: string) => AssembledTransaction<number>;
1980
+ is_signer: (json: string) => AssembledTransaction<boolean>;
1981
+ threshold: (json: string) => AssembledTransaction<number>;
1982
+ verify_signatures: (json: string) => AssembledTransaction<null>;
1983
+ verify_n_signatures: (json: string) => AssembledTransaction<null>;
1984
+ };
1985
+ }