@layerzerolabs/protocol-stellar-v2 0.2.15 → 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 (257) hide show
  1. package/.turbo/turbo-build.log +350 -309
  2. package/.turbo/turbo-lint.log +146 -108
  3. package/.turbo/turbo-test.log +1423 -1238
  4. package/Cargo.lock +12 -0
  5. package/Cargo.toml +3 -0
  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 +181 -30
  10. package/contracts/common-macros/src/lz_contract.rs +83 -0
  11. package/contracts/common-macros/src/tests/{ownable.rs → auth.rs} +48 -15
  12. package/contracts/common-macros/src/tests/contract_ttl.rs +662 -0
  13. package/contracts/common-macros/src/tests/mod.rs +2 -2
  14. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__auth__snapshot_generated_multisig_code.snap +20 -0
  15. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__auth__snapshot_generated_ownable_code.snap +24 -0
  16. 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
  17. 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} +3 -3
  18. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__contract_ttl__snapshot_generated_contracttrait_code.snap +69 -0
  19. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ttl_configurable__snapshot_generated_ttl_configurable_code.snap +7 -21
  20. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__upgradeable__snapshot_generated_upgradeable_code.snap +2 -2
  21. package/contracts/common-macros/src/ttl_configurable.rs +19 -34
  22. package/contracts/common-macros/src/ttl_extendable.rs +36 -0
  23. package/contracts/common-macros/src/upgradeable.rs +5 -5
  24. package/contracts/common-macros/src/utils.rs +9 -0
  25. package/contracts/endpoint-v2/src/constants.rs +4 -4
  26. package/contracts/endpoint-v2/src/endpoint_v2.rs +38 -40
  27. package/contracts/endpoint-v2/src/errors.rs +4 -3
  28. package/contracts/endpoint-v2/src/events.rs +1 -1
  29. package/contracts/endpoint-v2/src/message_lib_manager.rs +18 -5
  30. package/contracts/endpoint-v2/src/messaging_channel.rs +11 -1
  31. package/contracts/endpoint-v2/src/messaging_composer.rs +11 -1
  32. package/contracts/endpoint-v2/src/storage.rs +1 -1
  33. package/contracts/endpoint-v2/src/tests/endpoint_v2/pay_messaging_fees.rs +3 -3
  34. package/contracts/endpoint-v2/src/tests/endpoint_v2/quote.rs +1 -1
  35. package/contracts/endpoint-v2/src/tests/endpoint_v2/require_oapp_auth.rs +2 -2
  36. package/contracts/endpoint-v2/src/tests/endpoint_v2/send.rs +3 -3
  37. package/contracts/endpoint-v2/src/tests/endpoint_v2/set_zro.rs +4 -4
  38. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_receive_lib_for_eid.rs +3 -3
  39. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_registered.rs +1 -1
  40. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_send_lib_for_eid.rs +3 -3
  41. package/contracts/endpoint-v2/src/tests/message_lib_manager/require_supported_eid.rs +1 -1
  42. package/contracts/endpoint-v2/src/tests/messaging_channel/clear_payload.rs +4 -4
  43. package/contracts/endpoint-v2/src/tests/messaging_channel/inbound.rs +1 -1
  44. package/contracts/layerzero-views/src/layerzero_view.rs +3 -6
  45. package/contracts/macro-integration-tests/tests/runtime/ownable/mod.rs +2 -2
  46. package/contracts/macro-integration-tests/tests/runtime/ownable/{only_owner_guard.rs → only_auth_guard.rs} +1 -1
  47. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/configuration.rs +1 -1
  48. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/freeze.rs +1 -1
  49. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/mod.rs +0 -1
  50. package/contracts/macro-integration-tests/tests/ui/ownable/fail/{only_owner_missing_env.rs → only_auth_missing_env.rs} +3 -3
  51. package/contracts/macro-integration-tests/tests/ui/ownable/fail/{only_owner_missing_env.stderr → only_auth_missing_env.stderr} +4 -4
  52. package/contracts/macro-integration-tests/tests/ui/ownable/pass/namespacing_and_imports.rs +2 -3
  53. package/contracts/macro-integration-tests/tests/ui/ownable/pass/{only_owner_env_param_variants.rs → only_auth_env_param_variants.rs} +9 -9
  54. package/contracts/macro-integration-tests/tests/ui/ttl_configurable/pass/minimal_contract.rs +6 -6
  55. package/contracts/message-libs/message-lib-common/src/errors.rs +7 -2
  56. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1/decode_packet_header.rs +3 -3
  57. package/contracts/message-libs/message-lib-common/src/tests/worker_options/append_lz_receive_option.rs +1 -2
  58. package/contracts/message-libs/message-lib-common/src/tests/worker_options/append_native_drop_option.rs +1 -2
  59. package/contracts/message-libs/message-lib-common/src/tests/worker_options/convert_legacy_options.rs +9 -9
  60. package/contracts/message-libs/message-lib-common/src/tests/worker_options/extract_type_3_options.rs +1 -1
  61. package/contracts/message-libs/message-lib-common/src/tests/worker_options/left_pad_to_bytes32.rs +1 -1
  62. package/contracts/message-libs/message-lib-common/src/tests/worker_options/split_worker_options.rs +2 -2
  63. package/contracts/message-libs/simple-message-lib/src/simple_message_lib.rs +7 -9
  64. package/contracts/message-libs/treasury/src/errors.rs +2 -2
  65. package/contracts/message-libs/treasury/src/events.rs +1 -1
  66. package/contracts/message-libs/treasury/src/interfaces/zro_fee_lib.rs +2 -2
  67. package/contracts/message-libs/treasury/src/storage.rs +1 -1
  68. package/contracts/message-libs/treasury/src/tests/treasury_tests.rs +1 -1
  69. package/contracts/message-libs/treasury/src/treasury.rs +14 -16
  70. package/contracts/message-libs/uln-302/src/receive_uln.rs +13 -2
  71. package/contracts/message-libs/uln-302/src/send_uln.rs +23 -3
  72. package/contracts/message-libs/uln-302/src/uln302.rs +6 -24
  73. package/contracts/oapps/counter/Cargo.toml +14 -1
  74. package/contracts/oapps/counter/integration_tests/mod.rs +4 -1
  75. package/contracts/oapps/counter/integration_tests/{setup.rs → setup_sml.rs} +48 -80
  76. package/contracts/oapps/counter/integration_tests/setup_uln.rs +997 -0
  77. package/contracts/oapps/counter/integration_tests/signing.rs +62 -0
  78. package/contracts/oapps/counter/integration_tests/test_with_sml.rs +24 -55
  79. package/contracts/oapps/counter/integration_tests/test_with_uln.rs +314 -0
  80. package/contracts/oapps/counter/integration_tests/utils.rs +196 -53
  81. package/contracts/oapps/counter/src/counter.rs +67 -43
  82. package/contracts/oapps/counter/src/tests/mod.rs +0 -13
  83. package/contracts/oapps/counter/src/tests/test_counter.rs +5 -7
  84. package/contracts/oapps/oapp/src/errors.rs +5 -1
  85. package/contracts/oapps/oapp/src/macro_tests/test_macros.rs +93 -78
  86. package/contracts/oapps/oapp/src/oapp_core.rs +36 -21
  87. package/contracts/oapps/oapp/src/oapp_options_type3.rs +48 -12
  88. package/contracts/oapps/oapp/src/oapp_receiver.rs +106 -41
  89. package/contracts/oapps/oapp/src/oapp_sender.rs +26 -34
  90. package/contracts/oapps/oapp/src/tests/test_oapp_core.rs +9 -8
  91. package/contracts/oapps/oapp/src/tests/test_oapp_options_type3.rs +25 -17
  92. package/contracts/oapps/oapp/src/tests/test_oapp_receiver.rs +7 -7
  93. package/contracts/oapps/oapp/src/tests/test_oapp_sender.rs +14 -15
  94. package/contracts/oapps/oapp-macros/src/generators.rs +128 -0
  95. package/contracts/oapps/oapp-macros/src/lib.rs +113 -56
  96. package/contracts/oapps/oft/integration-tests/setup.rs +25 -7
  97. package/contracts/oapps/oft/src/errors.rs +6 -1
  98. package/contracts/oapps/oft/src/extensions/oft_fee.rs +8 -8
  99. package/contracts/oapps/oft/src/extensions/pausable.rs +4 -4
  100. package/contracts/oapps/oft/src/extensions/rate_limiter.rs +5 -5
  101. package/contracts/oapps/oft/src/lib.rs +4 -2
  102. package/contracts/oapps/oft/src/oft.rs +24 -64
  103. package/contracts/oapps/oft/src/oft_impl.rs +201 -0
  104. package/contracts/oapps/oft/src/oft_types/lock_unlock.rs +1 -3
  105. package/contracts/oapps/oft/src/oft_types/mint_burn.rs +1 -4
  106. package/contracts/oapps/oft/src/storage.rs +2 -0
  107. package/contracts/oapps/oft/src/tests/extensions/setup.rs +36 -22
  108. package/contracts/oapps/oft/src/tests/extensions/test_oft_fee.rs +5 -3
  109. package/contracts/oapps/oft/src/tests/extensions/test_pausable.rs +5 -3
  110. package/contracts/oapps/oft/src/tests/extensions/test_rate_limiter.rs +5 -3
  111. package/contracts/oapps/oft/src/tests/test_decimals.rs +2 -2
  112. package/contracts/oapps/oft/src/tests/test_oft_msg_codec.rs +1 -2
  113. package/contracts/oapps/oft/src/tests/test_utils.rs +45 -23
  114. package/contracts/oapps/oft/src/types.rs +20 -0
  115. package/contracts/oapps/oft-std/integration-tests/setup.rs +4 -2
  116. package/contracts/oapps/oft-std/src/oft.rs +24 -6
  117. package/contracts/upgrader/src/lib.rs +4 -4
  118. package/contracts/utils/src/auth.rs +44 -0
  119. package/contracts/utils/src/errors.rs +27 -5
  120. package/contracts/utils/src/lib.rs +3 -0
  121. package/contracts/utils/src/multisig.rs +211 -0
  122. package/contracts/utils/src/ownable.rs +12 -10
  123. package/contracts/utils/src/tests/buffer_reader.rs +6 -6
  124. package/contracts/utils/src/tests/buffer_writer.rs +6 -6
  125. package/contracts/utils/src/tests/bytes_ext.rs +2 -4
  126. package/contracts/utils/src/tests/mod.rs +1 -0
  127. package/contracts/utils/src/tests/multisig.rs +731 -0
  128. package/contracts/utils/src/tests/option_ext.rs +2 -5
  129. package/contracts/utils/src/tests/ownable.rs +16 -5
  130. package/contracts/utils/src/tests/ttl_configurable.rs +27 -16
  131. package/contracts/utils/src/tests/upgradeable.rs +4 -2
  132. package/contracts/utils/src/ttl_configurable.rs +23 -8
  133. package/contracts/utils/src/ttl_extendable.rs +27 -0
  134. package/contracts/utils/src/upgradeable.rs +2 -0
  135. package/contracts/workers/dvn/Cargo.toml +1 -1
  136. package/contracts/workers/dvn/src/auth.rs +7 -7
  137. package/contracts/workers/dvn/src/dvn.rs +10 -38
  138. package/contracts/workers/dvn/src/errors.rs +0 -7
  139. package/contracts/workers/dvn/src/events.rs +1 -14
  140. package/contracts/workers/dvn/src/interfaces/dvn.rs +2 -2
  141. package/contracts/workers/dvn/src/interfaces/mod.rs +0 -2
  142. package/contracts/workers/dvn/src/storage.rs +3 -13
  143. package/contracts/workers/dvn/src/tests/auth.rs +4 -4
  144. package/contracts/workers/dvn/src/tests/dvn.rs +1 -2
  145. package/contracts/workers/dvn/src/tests/multisig/set_signer.rs +7 -8
  146. package/contracts/workers/dvn/src/tests/multisig/set_threshold.rs +11 -8
  147. package/contracts/workers/dvn/src/tests/multisig/verify_signatures.rs +11 -12
  148. package/contracts/workers/dvn/src/tests/setup.rs +5 -5
  149. package/contracts/workers/dvn-fee-lib/Cargo.toml +1 -1
  150. package/contracts/workers/dvn-fee-lib/src/dvn_fee_lib.rs +3 -6
  151. package/contracts/workers/executor/src/auth.rs +80 -16
  152. package/contracts/workers/executor/src/executor.rs +5 -31
  153. package/contracts/workers/executor/src/storage.rs +2 -9
  154. package/contracts/workers/executor-fee-lib/Cargo.toml +1 -1
  155. package/contracts/workers/executor-fee-lib/src/executor_fee_lib.rs +3 -6
  156. package/contracts/workers/executor-helper/Cargo.toml +1 -1
  157. package/contracts/workers/executor-helper/src/executor_helper.rs +53 -73
  158. package/contracts/workers/price-feed/Cargo.toml +1 -1
  159. package/contracts/workers/price-feed/src/price_feed.rs +7 -10
  160. package/contracts/workers/worker/src/errors.rs +4 -0
  161. package/contracts/workers/worker/src/tests/worker.rs +7 -6
  162. package/contracts/workers/worker/src/worker.rs +20 -16
  163. package/package.json +8 -5
  164. package/sdk/.turbo/turbo-build.log +1 -0
  165. package/sdk/.turbo/turbo-test.log +1009 -0
  166. package/sdk/dist/generated/bml.d.ts +65 -8
  167. package/sdk/dist/generated/bml.js +70 -34
  168. package/sdk/dist/generated/counter.d.ts +167 -42
  169. package/sdk/dist/generated/counter.js +86 -45
  170. package/sdk/dist/generated/dvn.d.ts +282 -229
  171. package/sdk/dist/generated/dvn.js +119 -81
  172. package/sdk/dist/generated/dvn_fee_lib.d.ts +142 -67
  173. package/sdk/dist/generated/dvn_fee_lib.js +64 -24
  174. package/sdk/dist/generated/endpoint.d.ts +97 -22
  175. package/sdk/dist/generated/endpoint.js +75 -37
  176. package/sdk/dist/generated/executor.d.ts +117 -85
  177. package/sdk/dist/generated/executor.js +102 -59
  178. package/sdk/dist/generated/executor_fee_lib.d.ts +162 -78
  179. package/sdk/dist/generated/executor_fee_lib.js +104 -57
  180. package/sdk/dist/generated/executor_helper.d.ts +133 -21
  181. package/sdk/dist/generated/executor_helper.js +99 -50
  182. package/sdk/dist/generated/oft_std.d.ts +233 -55
  183. package/sdk/dist/generated/oft_std.js +99 -54
  184. package/sdk/dist/generated/price_feed.d.ts +142 -67
  185. package/sdk/dist/generated/price_feed.js +64 -24
  186. package/sdk/dist/generated/sml.d.ts +113 -32
  187. package/sdk/dist/generated/sml.js +93 -49
  188. package/sdk/dist/generated/treasury.d.ts +896 -0
  189. package/sdk/dist/generated/treasury.js +219 -0
  190. package/sdk/dist/generated/uln302.d.ts +113 -32
  191. package/sdk/dist/generated/uln302.js +93 -49
  192. package/sdk/dist/generated/upgrader.d.ts +2 -2
  193. package/sdk/dist/generated/upgrader.js +1 -1
  194. package/sdk/dist/index.d.ts +2 -0
  195. package/sdk/dist/index.js +3 -0
  196. package/sdk/dist/wasm/blocked-message-lib.d.ts +1 -0
  197. package/sdk/dist/wasm/blocked-message-lib.js +2 -0
  198. package/sdk/dist/wasm/counter.d.ts +1 -0
  199. package/sdk/dist/wasm/counter.js +2 -0
  200. package/sdk/dist/wasm/dvn-fee-lib.d.ts +1 -0
  201. package/sdk/dist/wasm/dvn-fee-lib.js +2 -0
  202. package/sdk/dist/wasm/dvn.d.ts +1 -0
  203. package/sdk/dist/wasm/dvn.js +2 -0
  204. package/sdk/dist/wasm/endpoint-v2.d.ts +1 -0
  205. package/sdk/dist/wasm/endpoint-v2.js +2 -0
  206. package/sdk/dist/wasm/executor-fee-lib.d.ts +1 -0
  207. package/sdk/dist/wasm/executor-fee-lib.js +2 -0
  208. package/sdk/dist/wasm/executor-helper.d.ts +1 -0
  209. package/sdk/dist/wasm/executor-helper.js +2 -0
  210. package/sdk/dist/wasm/executor.d.ts +1 -0
  211. package/sdk/dist/wasm/executor.js +2 -0
  212. package/sdk/dist/wasm/layerzero-views.d.ts +1 -0
  213. package/sdk/dist/wasm/layerzero-views.js +2 -0
  214. package/sdk/dist/wasm/oft-std.d.ts +1 -0
  215. package/sdk/dist/wasm/oft-std.js +2 -0
  216. package/sdk/dist/wasm/price-feed.d.ts +1 -0
  217. package/sdk/dist/wasm/price-feed.js +2 -0
  218. package/sdk/dist/wasm/simple-message-lib.d.ts +1 -0
  219. package/sdk/dist/wasm/simple-message-lib.js +2 -0
  220. package/sdk/dist/wasm/treasury.d.ts +1 -0
  221. package/sdk/dist/wasm/treasury.js +2 -0
  222. package/sdk/dist/wasm/uln302.d.ts +1 -0
  223. package/sdk/dist/wasm/uln302.js +2 -0
  224. package/sdk/dist/wasm/upgrader.d.ts +1 -0
  225. package/sdk/dist/wasm/upgrader.js +2 -0
  226. package/sdk/dist/wasm.d.ts +15 -0
  227. package/sdk/dist/wasm.js +15 -0
  228. package/sdk/package.json +4 -2
  229. package/sdk/src/index.ts +4 -0
  230. package/sdk/test/counter-sml.test.ts +376 -0
  231. package/sdk/test/counter-uln.test.ts +493 -0
  232. package/sdk/test/{oft.test.ts → oft-sml.test.ts} +185 -310
  233. package/sdk/test/suites/constants.ts +22 -2
  234. package/sdk/test/suites/globalSetup.ts +450 -0
  235. package/sdk/test/suites/localnet.ts +23 -6
  236. package/sdk/test/upgrader.test.ts +7 -16
  237. package/sdk/test/utils.ts +558 -85
  238. package/sdk/vitest.config.ts +21 -0
  239. package/tools/ts-bindings-gen/src/main.rs +1 -0
  240. package/turbo.json +2 -0
  241. package/contracts/common-macros/src/contract_impl.rs +0 -52
  242. package/contracts/common-macros/src/ownable.rs +0 -41
  243. package/contracts/common-macros/src/tests/contract_impl.rs +0 -386
  244. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ownable__snapshot_generated_ownable_code.snap +0 -12
  245. package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/extend_instance_ttl.rs +0 -50
  246. package/contracts/oapps/oapp-macros/src/oapp_core.rs +0 -41
  247. package/contracts/oapps/oapp-macros/src/oapp_full.rs +0 -21
  248. package/contracts/oapps/oapp-macros/src/oapp_options_type3.rs +0 -31
  249. package/contracts/oapps/oapp-macros/src/oapp_receiver.rs +0 -48
  250. package/contracts/oapps/oapp-macros/src/oapp_sender.rs +0 -21
  251. package/contracts/oapps/oapp-macros/src/util.rs +0 -107
  252. package/contracts/oapps/oft/src/constants.rs +0 -5
  253. package/contracts/oapps/oft/src/default_oft_impl.rs +0 -152
  254. package/contracts/workers/dvn/src/interfaces/multisig.rs +0 -56
  255. package/contracts/workers/dvn/src/multisig.rs +0 -157
  256. package/sdk/test/index.test.ts +0 -375
  257. /package/sdk/test/suites/{testUpgradeable.ts → dummyContractClient.ts} +0 -0
@@ -85,6 +85,9 @@ export declare const EndpointError: {
85
85
  24: {
86
86
  message: string;
87
87
  };
88
+ 25: {
89
+ message: string;
90
+ };
88
91
  };
89
92
  /**
90
93
  * Parameters for sending a cross-chain message.
@@ -297,6 +300,9 @@ export interface FeesAndPacket {
297
300
  */
298
301
  zro_fee_recipients: Array<FeeRecipient>;
299
302
  }
303
+ /**
304
+ * OAppError: 2000-2099
305
+ */
300
306
  export declare const OAppError: {
301
307
  2000: {
302
308
  message: string;
@@ -327,14 +333,20 @@ export type OAppOptionsType3Storage = {
327
333
  tag: "EnforcedOptions";
328
334
  values: readonly [u32, u32];
329
335
  };
336
+ /**
337
+ * OFTError: 3000-3099
338
+ */
330
339
  export declare const OFTError: {
331
- 2100: {
340
+ 3000: {
332
341
  message: string;
333
342
  };
334
- 2101: {
343
+ 3001: {
335
344
  message: string;
336
345
  };
337
- 2102: {
346
+ 3002: {
347
+ message: string;
348
+ };
349
+ 3003: {
338
350
  message: string;
339
351
  };
340
352
  };
@@ -419,35 +431,78 @@ export type OFTStorage = {
419
431
  * Parameters for sending OFT tokens cross-chain
420
432
  */
421
433
  export interface SendParam {
434
+ /**
435
+ * The amount to send in local decimals
436
+ */
422
437
  amount_ld: i128;
438
+ /**
439
+ * Compose message to execute on the destination (Optional)
440
+ */
423
441
  compose_msg: Buffer;
442
+ /**
443
+ * The destination endpoint ID
444
+ */
424
445
  dst_eid: u32;
446
+ /**
447
+ * Additional options for the LayerZero message (Optional)
448
+ */
425
449
  extra_options: Buffer;
450
+ /**
451
+ * The minimum amount to receive in local decimals (slippage protection)
452
+ */
426
453
  min_amount_ld: i128;
454
+ /**
455
+ * OFT command for custom behavior (Optional)
456
+ */
427
457
  oft_cmd: Buffer;
458
+ /**
459
+ * The recipient address on the destination chain (32 bytes)
460
+ */
428
461
  to: Buffer;
429
462
  }
430
463
  /**
431
464
  * Transfer limits for OFT operations
432
465
  */
433
466
  export interface OFTLimit {
467
+ /**
468
+ * The maximum amount to send in local decimals
469
+ */
434
470
  max_amount_ld: i128;
471
+ /**
472
+ * The minimum amount to send in local decimals
473
+ */
435
474
  min_amount_ld: i128;
436
475
  }
437
476
  /**
438
477
  * Receipt containing amounts sent and received in an OFT transfer
439
478
  */
440
479
  export interface OFTReceipt {
480
+ /**
481
+ * The amount received in local decimals on the remote
482
+ */
441
483
  amount_received_ld: i128;
484
+ /**
485
+ * The amount sent in local decimals
486
+ */
442
487
  amount_sent_ld: i128;
443
488
  }
444
489
  /**
445
490
  * Details about fees charged in an OFT operation
446
491
  */
447
492
  export interface OFTFeeDetail {
493
+ /**
494
+ * The description of the fee
495
+ */
448
496
  description: Buffer;
497
+ /**
498
+ * The amount of the fee in local decimals. Positive values represent fees charged,
499
+ * while negative values represent rewards given.
500
+ */
449
501
  fee_amount_ld: i128;
450
502
  }
503
+ /**
504
+ * BufferReaderError: 1000-1009
505
+ */
451
506
  export declare const BufferReaderError: {
452
507
  1000: {
453
508
  message: string;
@@ -456,39 +511,90 @@ export declare const BufferReaderError: {
456
511
  message: string;
457
512
  };
458
513
  };
514
+ /**
515
+ * BufferWriterError: 1010-1019
516
+ */
459
517
  export declare const BufferWriterError: {
460
- 1100: {
518
+ 1010: {
461
519
  message: string;
462
520
  };
463
521
  };
522
+ /**
523
+ * TtlConfigurableError: 1020-1029
524
+ */
464
525
  export declare const TtlConfigurableError: {
465
- 1200: {
526
+ 1020: {
466
527
  message: string;
467
528
  };
468
- 1201: {
529
+ 1021: {
469
530
  message: string;
470
531
  };
471
- 1202: {
532
+ 1022: {
472
533
  message: string;
473
534
  };
474
535
  };
536
+ /**
537
+ * OwnableError: 1030-1039
538
+ */
475
539
  export declare const OwnableError: {
476
- 1300: {
540
+ 1030: {
477
541
  message: string;
478
542
  };
479
- 1301: {
543
+ 1031: {
480
544
  message: string;
481
545
  };
482
546
  };
547
+ /**
548
+ * BytesExtError: 1040-1049
549
+ */
483
550
  export declare const BytesExtError: {
484
- 1400: {
551
+ 1040: {
485
552
  message: string;
486
553
  };
487
554
  };
555
+ /**
556
+ * UpgradeableError: 1050-1059
557
+ */
488
558
  export declare const UpgradeableError: {
489
- 1500: {
559
+ 1050: {
560
+ message: string;
561
+ };
562
+ };
563
+ /**
564
+ * MultisigError: 1060-1069
565
+ */
566
+ export declare const MultisigError: {
567
+ 1060: {
568
+ message: string;
569
+ };
570
+ 1061: {
571
+ message: string;
572
+ };
573
+ 1062: {
574
+ message: string;
575
+ };
576
+ 1063: {
577
+ message: string;
578
+ };
579
+ 1064: {
490
580
  message: string;
491
581
  };
582
+ 1065: {
583
+ message: string;
584
+ };
585
+ 1066: {
586
+ message: string;
587
+ };
588
+ 1067: {
589
+ message: string;
590
+ };
591
+ };
592
+ export type MultisigStorage = {
593
+ tag: "Signers";
594
+ values: void;
595
+ } | {
596
+ tag: "Threshold";
597
+ values: void;
492
598
  };
493
599
  export type OwnableStorage = {
494
600
  tag: "Owner";
@@ -523,42 +629,9 @@ export type UpgradeableStorage = {
523
629
  };
524
630
  export interface Client {
525
631
  /**
526
- * 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.
527
- * Extends the instance TTL.
528
- *
529
- * # Arguments
530
- *
531
- * * `threshold` - The threshold to extend the TTL.
532
- * * `extend_to` - The TTL to extend to.
533
- */
534
- extend_instance_ttl: ({ threshold, extend_to }: {
535
- threshold: u32;
536
- extend_to: u32;
537
- }, txnOptions?: {
538
- /**
539
- * The fee to pay for the transaction. Default: BASE_FEE
540
- */
541
- fee?: number;
542
- /**
543
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
544
- */
545
- timeoutInSeconds?: number;
546
- /**
547
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
548
- */
549
- simulate?: boolean;
550
- }) => Promise<AssembledTransaction<null>>;
551
- /**
552
- * Construct and simulate a lz_receive 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.
632
+ * 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.
553
633
  */
554
- lz_receive: ({ executor, origin, guid, message, extra_data, value }: {
555
- executor: string;
556
- origin: Origin;
557
- guid: Buffer;
558
- message: Buffer;
559
- extra_data: Buffer;
560
- value: i128;
561
- }, txnOptions?: {
634
+ authorizer: (txnOptions?: {
562
635
  /**
563
636
  * The fee to pay for the transaction. Default: BASE_FEE
564
637
  */
@@ -571,7 +644,7 @@ export interface Client {
571
644
  * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
572
645
  */
573
646
  simulate?: boolean;
574
- }) => Promise<AssembledTransaction<null>>;
647
+ }) => Promise<AssembledTransaction<string>>;
575
648
  /**
576
649
  * Construct and simulate a mode 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.
577
650
  * Returns the mode of operation for this OFT (LockUnlock or MintBurn)
@@ -1062,6 +1135,14 @@ export interface Client {
1062
1135
  }) => Promise<AssembledTransaction<i128>>;
1063
1136
  /**
1064
1137
  * Construct and simulate a enforced_options 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.
1138
+ * Retrieves the enforced options for a given endpoint and message type.
1139
+ *
1140
+ * # Arguments
1141
+ * * `eid` - The endpoint ID
1142
+ * * `msg_type` - The OApp message type
1143
+ *
1144
+ * # Returns
1145
+ * The enforced options for the given endpoint and message type
1065
1146
  */
1066
1147
  enforced_options: ({ eid, msg_type }: {
1067
1148
  eid: u32;
@@ -1082,6 +1163,16 @@ export interface Client {
1082
1163
  }) => Promise<AssembledTransaction<Buffer>>;
1083
1164
  /**
1084
1165
  * Construct and simulate a set_enforced_options 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.
1166
+ * Sets the enforced options for specific endpoint and message type combinations.
1167
+ *
1168
+ * Only the `authorizer` of the OApp can call this function.
1169
+ * Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.
1170
+ * These enforced options can vary as the potential options/execution on the remote may differ as per the msg_type.
1171
+ * e.g. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you don't want to pay
1172
+ * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().
1173
+ *
1174
+ * # Arguments
1175
+ * * `options` - A vector of EnforcedOptionParam structures specifying enforced options
1085
1176
  */
1086
1177
  set_enforced_options: ({ options }: {
1087
1178
  options: Array<EnforcedOptionParam>;
@@ -1101,6 +1192,20 @@ export interface Client {
1101
1192
  }) => Promise<AssembledTransaction<null>>;
1102
1193
  /**
1103
1194
  * Construct and simulate a combine_options 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
+ * Combines options for a given endpoint and message type.
1196
+ *
1197
+ * If there is an enforced lzReceive option:
1198
+ * - {gas_limit: 200k, value: 1 XLM} AND a caller supplies a lzReceive option: {gas_limit: 100k, value: 0.5 XLM}
1199
+ * - The resulting options will be {gas_limit: 300k, value: 1.5 XLM} when the message is executed on the remote lz_receive() function.
1200
+ * The presence of duplicated options is handled off-chain in the verifier/executor.
1201
+ *
1202
+ * # Arguments
1203
+ * * `eid` - The endpoint ID
1204
+ * * `msg_type` - The OApp message type
1205
+ * * `extra_options` - Additional options passed by the caller
1206
+ *
1207
+ * # Returns
1208
+ * The combination of caller specified options AND enforced options
1104
1209
  */
1105
1210
  combine_options: ({ eid, msg_type, extra_options }: {
1106
1211
  eid: u32;
@@ -1148,12 +1253,19 @@ export interface Client {
1148
1253
  }) => Promise<AssembledTransaction<boolean>>;
1149
1254
  /**
1150
1255
  * Construct and simulate a next_nonce 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 the next expected nonce for ordered message delivery.
1152
- * 0 means there is NO nonce ordered enforcement.
1256
+ * Retrieves the next nonce for a given source endpoint and sender address.
1257
+ *
1258
+ * The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.
1259
+ * This is required by the off-chain executor to determine if the OApp expects message execution to be ordered.
1260
+ * This is also enforced by the OApp.
1261
+ * By default this is NOT enabled, i.e. next_nonce is hardcoded to return 0.
1153
1262
  *
1154
1263
  * # Arguments
1155
1264
  * * `src_eid` - The source endpoint ID
1156
1265
  * * `sender` - The sender OApp address
1266
+ *
1267
+ * # Returns
1268
+ * The next nonce
1157
1269
  */
1158
1270
  next_nonce: ({ src_eid, sender }: {
1159
1271
  src_eid: u32;
@@ -1172,6 +1284,45 @@ export interface Client {
1172
1284
  */
1173
1285
  simulate?: boolean;
1174
1286
  }) => Promise<AssembledTransaction<u64>>;
1287
+ /**
1288
+ * Construct and simulate a lz_receive 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.
1289
+ * Entry point for receiving messages or packets from the LayerZero endpoint.
1290
+ *
1291
+ * The default implementation calls `clear_payload_and_transfer` to validate the message
1292
+ * and clear it from the endpoint, then delegates to `__lz_receive` for application logic.
1293
+ *
1294
+ * # Arguments
1295
+ * * `executor` - The address of the executor for the received message
1296
+ * * `origin` - The origin information containing the source endpoint and sender address:
1297
+ * - `src_eid`: The source chain endpoint ID
1298
+ * - `sender`: The sender address on the source chain
1299
+ * - `nonce`: The nonce of the message
1300
+ * * `guid` - The unique identifier for the received LayerZero message
1301
+ * * `message` - The payload of the received message
1302
+ * * `extra_data` - Additional arbitrary data provided by the corresponding executor
1303
+ * * `value` - The native token value sent with the message
1304
+ */
1305
+ lz_receive: ({ executor, origin, guid, message, extra_data, value }: {
1306
+ executor: string;
1307
+ origin: Origin;
1308
+ guid: Buffer;
1309
+ message: Buffer;
1310
+ extra_data: Buffer;
1311
+ value: i128;
1312
+ }, txnOptions?: {
1313
+ /**
1314
+ * The fee to pay for the transaction. Default: BASE_FEE
1315
+ */
1316
+ fee?: number;
1317
+ /**
1318
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1319
+ */
1320
+ timeoutInSeconds?: number;
1321
+ /**
1322
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1323
+ */
1324
+ simulate?: boolean;
1325
+ }) => Promise<AssembledTransaction<null>>;
1175
1326
  /**
1176
1327
  * Construct and simulate a is_compose_msg_sender 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.
1177
1328
  * Indicates whether an address is an approved composeMsg sender to the Endpoint.
@@ -1211,8 +1362,8 @@ export interface Client {
1211
1362
  *
1212
1363
  * # Returns
1213
1364
  * A tuple containing:
1214
- * - `sender_version`: The version of the OAppSender implementation
1215
- * - `receiver_version`: The version of the OAppReceiver implementation
1365
+ * - `sender_version`: The version of the OAppSender
1366
+ * - `receiver_version`: The version of the OAppReceiver
1216
1367
  */
1217
1368
  oapp_version: (txnOptions?: {
1218
1369
  /**
@@ -1230,10 +1381,10 @@ export interface Client {
1230
1381
  }) => Promise<AssembledTransaction<readonly [u64, u64]>>;
1231
1382
  /**
1232
1383
  * Construct and simulate a endpoint 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.
1233
- * Retrieves the LayerZero endpoint associated with the OApp.
1384
+ * Retrieves the LayerZero endpoint address associated with the OApp.
1234
1385
  *
1235
1386
  * # Returns
1236
- * The LayerZero endpoint client
1387
+ * The LayerZero endpoint address
1237
1388
  */
1238
1389
  endpoint: (txnOptions?: {
1239
1390
  /**
@@ -1415,6 +1566,32 @@ export interface Client {
1415
1566
  */
1416
1567
  simulate?: boolean;
1417
1568
  }) => Promise<AssembledTransaction<boolean>>;
1569
+ /**
1570
+ * 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.
1571
+ * Extends the instance TTL.
1572
+ *
1573
+ * # Arguments
1574
+ *
1575
+ * * `threshold` - The threshold to extend the TTL (if current TTL is below this, extend).
1576
+ * * `extend_to` - The TTL to extend to.
1577
+ */
1578
+ extend_instance_ttl: ({ threshold, extend_to }: {
1579
+ threshold: u32;
1580
+ extend_to: u32;
1581
+ }, txnOptions?: {
1582
+ /**
1583
+ * The fee to pay for the transaction. Default: BASE_FEE
1584
+ */
1585
+ fee?: number;
1586
+ /**
1587
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1588
+ */
1589
+ timeoutInSeconds?: number;
1590
+ /**
1591
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1592
+ */
1593
+ simulate?: boolean;
1594
+ }) => Promise<AssembledTransaction<null>>;
1418
1595
  /**
1419
1596
  * Construct and simulate a owner transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
1420
1597
  * Returns the current owner address, or None if no owner is set.
@@ -1495,8 +1672,7 @@ export declare class Client extends ContractClient {
1495
1672
  }): Promise<AssembledTransaction<T>>;
1496
1673
  constructor(options: ContractClientOptions);
1497
1674
  readonly fromJSON: {
1498
- extend_instance_ttl: (json: string) => AssembledTransaction<null>;
1499
- lz_receive: (json: string) => AssembledTransaction<null>;
1675
+ authorizer: (json: string) => AssembledTransaction<string>;
1500
1676
  mode: (json: string) => AssembledTransaction<OFTMode>;
1501
1677
  quote_oft: (json: string) => AssembledTransaction<readonly [OFTLimit, OFTFeeDetail[], OFTReceipt]>;
1502
1678
  quote_send: (json: string) => AssembledTransaction<MessagingFee>;
@@ -1527,6 +1703,7 @@ export declare class Client extends ContractClient {
1527
1703
  combine_options: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
1528
1704
  allow_initialize_path: (json: string) => AssembledTransaction<boolean>;
1529
1705
  next_nonce: (json: string) => AssembledTransaction<bigint>;
1706
+ lz_receive: (json: string) => AssembledTransaction<null>;
1530
1707
  is_compose_msg_sender: (json: string) => AssembledTransaction<boolean>;
1531
1708
  oapp_version: (json: string) => AssembledTransaction<readonly [bigint, bigint]>;
1532
1709
  endpoint: (json: string) => AssembledTransaction<string>;
@@ -1537,6 +1714,7 @@ export declare class Client extends ContractClient {
1537
1714
  ttl_configs: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>;
1538
1715
  freeze_ttl_configs: (json: string) => AssembledTransaction<null>;
1539
1716
  is_ttl_configs_frozen: (json: string) => AssembledTransaction<boolean>;
1717
+ extend_instance_ttl: (json: string) => AssembledTransaction<null>;
1540
1718
  owner: (json: string) => AssembledTransaction<Option<string>>;
1541
1719
  transfer_ownership: (json: string) => AssembledTransaction<null>;
1542
1720
  renounce_ownership: (json: string) => AssembledTransaction<null>;