@layerzerolabs/protocol-stellar-v2 0.2.18 → 0.2.20

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 (213) hide show
  1. package/.turbo/turbo-build.log +303 -253
  2. package/.turbo/turbo-lint.log +66 -65
  3. package/.turbo/turbo-test.log +1312 -1282
  4. package/Cargo.lock +21 -8
  5. package/Cargo.toml +2 -0
  6. package/contracts/ERROR_SPEC.md +9 -2
  7. package/contracts/common-macros/src/contract_ttl.rs +18 -7
  8. package/contracts/common-macros/src/lib.rs +4 -4
  9. package/contracts/common-macros/src/tests/contract_ttl.rs +1 -1
  10. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__contract_ttl__snapshot_generated_contractimpl_code.snap +2 -1
  11. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__upgradeable__snapshot_generated_upgradeable_code.snap +7 -12
  12. package/contracts/common-macros/src/upgradeable.rs +15 -21
  13. package/contracts/message-libs/uln-302/src/events.rs +4 -0
  14. package/contracts/message-libs/uln-302/src/send_uln.rs +23 -7
  15. package/contracts/message-libs/uln-302/src/tests/send_uln302/send.rs +38 -64
  16. package/contracts/oapps/counter/Cargo.toml +1 -0
  17. package/contracts/oapps/counter/integration_tests/setup_uln.rs +1 -1
  18. package/contracts/oapps/oapp/src/oapp_receiver.rs +1 -1
  19. package/contracts/oapps/oapp/src/tests/test_oapp_core.rs +113 -65
  20. package/contracts/oapps/oapp/src/tests/test_oapp_options_type3.rs +111 -82
  21. package/contracts/oapps/oapp/src/tests/test_oapp_receiver.rs +293 -65
  22. package/contracts/oapps/oapp/src/tests/test_oapp_sender.rs +331 -56
  23. package/contracts/oapps/oft/Cargo.toml +10 -7
  24. package/contracts/oapps/{oft-std → oft}/integration-tests/extensions/test_oft_fee.rs +3 -4
  25. package/contracts/oapps/{oft-std → oft}/integration-tests/extensions/test_pausable.rs +2 -3
  26. package/contracts/oapps/{oft-std → oft}/integration-tests/extensions/test_rate_limiter.rs +1 -1
  27. package/contracts/oapps/oft/integration-tests/mod.rs +1 -1
  28. package/contracts/oapps/oft/integration-tests/setup.rs +28 -127
  29. package/contracts/oapps/oft/integration-tests/utils.rs +254 -21
  30. package/contracts/oapps/oft/src/extensions/oft_fee.rs +23 -8
  31. package/contracts/oapps/oft/src/extensions/pausable.rs +19 -4
  32. package/contracts/oapps/oft/src/extensions/rate_limiter.rs +52 -28
  33. package/contracts/oapps/oft/src/lib.rs +10 -14
  34. package/contracts/oapps/oft/src/oft.rs +143 -193
  35. package/contracts/oapps/oft/src/oft_types/lock_unlock.rs +9 -11
  36. package/contracts/oapps/oft/src/oft_types/mint_burn.rs +12 -14
  37. package/contracts/oapps/oft/src/oft_types/mod.rs +13 -0
  38. package/contracts/oapps/{oft-std → oft-core}/Cargo.toml +6 -4
  39. package/contracts/oapps/{oft-std → oft-core}/integration-tests/mod.rs +1 -1
  40. package/contracts/oapps/{oft-std → oft-core}/integration-tests/setup.rs +126 -29
  41. package/contracts/oapps/{oft → oft-core}/integration-tests/test_with_sml.rs +3 -3
  42. package/contracts/oapps/oft-core/integration-tests/utils.rs +201 -0
  43. package/contracts/oapps/oft-core/src/lib.rs +18 -0
  44. package/contracts/oapps/oft-core/src/oft_core.rs +479 -0
  45. package/contracts/oapps/{oft → oft-core}/src/tests/mod.rs +0 -2
  46. package/contracts/oapps/{oft → oft-core}/src/tests/test_lz_receive.rs +7 -7
  47. package/contracts/oapps/{oft → oft-core}/src/tests/test_oft_msg_codec.rs +4 -4
  48. package/contracts/oapps/{oft → oft-core}/src/tests/test_resolve_address.rs +3 -3
  49. package/contracts/oapps/{oft → oft-core}/src/tests/test_utils.rs +46 -27
  50. package/contracts/oapps/{oft → oft-core}/src/utils.rs +1 -1
  51. package/contracts/upgrader/src/lib.rs +30 -57
  52. package/contracts/upgrader/src/tests/test_data/test_upgradeable_contract1.wasm +0 -0
  53. package/contracts/upgrader/src/tests/test_data/test_upgradeable_contract2.wasm +0 -0
  54. package/contracts/upgrader/src/tests/test_upgrader.rs +44 -35
  55. package/contracts/utils/src/buffer_reader.rs +1 -0
  56. package/contracts/utils/src/errors.rs +8 -2
  57. package/contracts/utils/src/ownable.rs +125 -3
  58. package/contracts/utils/src/tests/option_ext.rs +1 -1
  59. package/contracts/utils/src/tests/ownable.rs +445 -7
  60. package/contracts/utils/src/tests/ttl_configurable.rs +2 -2
  61. package/contracts/utils/src/tests/upgradeable.rs +372 -175
  62. package/contracts/utils/src/ttl_configurable.rs +3 -3
  63. package/contracts/utils/src/upgradeable.rs +48 -23
  64. package/contracts/workers/dvn/Cargo.toml +1 -0
  65. package/contracts/workers/dvn/src/auth.rs +12 -42
  66. package/contracts/workers/dvn/src/dvn.rs +16 -31
  67. package/contracts/workers/dvn/src/errors.rs +0 -1
  68. package/contracts/workers/dvn/src/interfaces/dvn.rs +35 -0
  69. package/contracts/workers/dvn/src/lib.rs +4 -3
  70. package/contracts/workers/dvn/src/tests/auth.rs +1 -1
  71. package/contracts/workers/dvn/src/tests/dvn.rs +19 -15
  72. package/contracts/workers/dvn/src/tests/multisig/set_threshold.rs +2 -4
  73. package/contracts/workers/dvn/src/tests/multisig/verify_signatures.rs +1 -3
  74. package/contracts/workers/dvn/src/tests/setup.rs +5 -9
  75. package/contracts/workers/dvn-fee-lib/Cargo.toml +1 -1
  76. package/contracts/workers/dvn-fee-lib/src/dvn_fee_lib.rs +3 -5
  77. package/contracts/workers/dvn-fee-lib/src/tests/dvn_fee_lib.rs +2 -3
  78. package/contracts/workers/executor/Cargo.toml +1 -0
  79. package/contracts/workers/executor/src/executor.rs +15 -26
  80. package/contracts/workers/executor-fee-lib/Cargo.toml +2 -1
  81. package/contracts/workers/executor-fee-lib/src/executor_fee_lib.rs +63 -5
  82. package/contracts/workers/executor-fee-lib/src/executor_option.rs +28 -1
  83. package/contracts/workers/executor-fee-lib/src/lib.rs +3 -0
  84. package/contracts/workers/executor-fee-lib/src/tests/executor_fee_lib.rs +701 -0
  85. package/contracts/workers/executor-fee-lib/src/tests/executor_option.rs +370 -0
  86. package/contracts/workers/executor-fee-lib/src/tests/mod.rs +4 -0
  87. package/contracts/workers/executor-fee-lib/src/tests/setup.rs +60 -0
  88. package/contracts/workers/executor-helper/src/lib.rs +3 -0
  89. package/contracts/workers/executor-helper/src/tests/executor_helper.rs +184 -0
  90. package/contracts/workers/executor-helper/src/tests/mod.rs +2 -0
  91. package/contracts/workers/executor-helper/src/tests/setup.rs +366 -0
  92. package/contracts/workers/fee-lib-interfaces/Cargo.toml +14 -0
  93. package/contracts/workers/{worker/src/interfaces/mod.rs → fee-lib-interfaces/src/lib.rs} +4 -3
  94. package/contracts/workers/price-feed/Cargo.toml +2 -1
  95. package/contracts/workers/price-feed/src/events.rs +1 -1
  96. package/contracts/workers/price-feed/src/lib.rs +3 -0
  97. package/contracts/workers/price-feed/src/price_feed.rs +6 -12
  98. package/contracts/workers/price-feed/src/storage.rs +1 -1
  99. package/contracts/workers/price-feed/src/tests/mod.rs +2 -0
  100. package/contracts/workers/price-feed/src/tests/price_feed.rs +869 -0
  101. package/contracts/workers/price-feed/src/tests/setup.rs +70 -0
  102. package/contracts/workers/price-feed/src/types.rs +1 -1
  103. package/contracts/workers/worker/src/errors.rs +0 -3
  104. package/contracts/workers/worker/src/lib.rs +0 -2
  105. package/contracts/workers/worker/src/storage.rs +32 -29
  106. package/contracts/workers/worker/src/tests/setup.rs +1 -7
  107. package/contracts/workers/worker/src/tests/worker.rs +50 -42
  108. package/contracts/workers/worker/src/worker.rs +49 -58
  109. package/package.json +4 -5
  110. package/sdk/.turbo/turbo-test.log +229 -217
  111. package/sdk/dist/generated/bml.d.ts +39 -1
  112. package/sdk/dist/generated/bml.js +33 -8
  113. package/sdk/dist/generated/counter.d.ts +131 -3
  114. package/sdk/dist/generated/counter.js +41 -10
  115. package/sdk/dist/generated/dvn.d.ts +431 -362
  116. package/sdk/dist/generated/dvn.js +80 -55
  117. package/sdk/dist/generated/dvn_fee_lib.d.ts +327 -251
  118. package/sdk/dist/generated/dvn_fee_lib.js +55 -57
  119. package/sdk/dist/generated/endpoint.d.ts +131 -3
  120. package/sdk/dist/generated/endpoint.js +41 -10
  121. package/sdk/dist/generated/executor.d.ts +503 -339
  122. package/sdk/dist/generated/executor.js +80 -48
  123. package/sdk/dist/generated/executor_fee_lib.d.ts +395 -319
  124. package/sdk/dist/generated/executor_fee_lib.js +54 -56
  125. package/sdk/dist/generated/executor_helper.d.ts +53 -187
  126. package/sdk/dist/generated/executor_helper.js +47 -29
  127. package/sdk/dist/generated/layerzero_view.d.ts +1271 -0
  128. package/sdk/dist/generated/layerzero_view.js +294 -0
  129. package/sdk/dist/generated/oft.d.ts +1851 -0
  130. package/sdk/dist/generated/oft.js +347 -0
  131. package/sdk/dist/generated/price_feed.d.ts +329 -253
  132. package/sdk/dist/generated/price_feed.js +55 -57
  133. package/sdk/dist/generated/sml.d.ts +131 -3
  134. package/sdk/dist/generated/sml.js +41 -10
  135. package/sdk/dist/generated/treasury.d.ts +131 -3
  136. package/sdk/dist/generated/treasury.js +41 -10
  137. package/sdk/dist/generated/uln302.d.ts +131 -3
  138. package/sdk/dist/generated/uln302.js +43 -12
  139. package/sdk/dist/generated/upgrader.d.ts +201 -15
  140. package/sdk/dist/generated/upgrader.js +99 -1
  141. package/sdk/dist/index.d.ts +2 -2
  142. package/sdk/dist/index.js +3 -3
  143. package/sdk/package.json +3 -2
  144. package/sdk/src/index.ts +3 -3
  145. package/sdk/test/oft-sml.test.ts +20 -20
  146. package/sdk/test/upgrader.test.ts +2 -3
  147. package/sdk/turbo.json +8 -0
  148. package/tools/ts-bindings-gen/Cargo.toml +2 -0
  149. package/tools/ts-bindings-gen/src/main.rs +53 -5
  150. package/turbo.json +0 -2
  151. package/contracts/oapps/oft/src/interfaces/mint_burn_token.rs +0 -23
  152. package/contracts/oapps/oft/src/interfaces/mod.rs +0 -3
  153. package/contracts/oapps/oft/src/oft_impl.rs +0 -201
  154. package/contracts/oapps/oft/src/tests/extensions/mod.rs +0 -11
  155. package/contracts/oapps/oft/src/tests/extensions/setup.rs +0 -917
  156. package/contracts/oapps/oft/src/tests/extensions/test_oft_fee.rs +0 -751
  157. package/contracts/oapps/oft/src/tests/extensions/test_pausable.rs +0 -434
  158. package/contracts/oapps/oft/src/tests/extensions/test_rate_limiter.rs +0 -1080
  159. package/contracts/oapps/oft-std/integration-tests/utils.rs +0 -427
  160. package/contracts/oapps/oft-std/src/lib.rs +0 -16
  161. package/contracts/oapps/oft-std/src/oft.rs +0 -174
  162. package/sdk/dist/generated/oft_std.d.ts +0 -1722
  163. package/sdk/dist/generated/oft_std.js +0 -316
  164. package/sdk/dist/wasm/blocked-message-lib.d.ts +0 -1
  165. package/sdk/dist/wasm/blocked-message-lib.js +0 -2
  166. package/sdk/dist/wasm/counter.d.ts +0 -1
  167. package/sdk/dist/wasm/counter.js +0 -2
  168. package/sdk/dist/wasm/dvn-fee-lib.d.ts +0 -1
  169. package/sdk/dist/wasm/dvn-fee-lib.js +0 -2
  170. package/sdk/dist/wasm/dvn.d.ts +0 -1
  171. package/sdk/dist/wasm/dvn.js +0 -2
  172. package/sdk/dist/wasm/endpoint-v2.d.ts +0 -1
  173. package/sdk/dist/wasm/endpoint-v2.js +0 -2
  174. package/sdk/dist/wasm/executor-fee-lib.d.ts +0 -1
  175. package/sdk/dist/wasm/executor-fee-lib.js +0 -2
  176. package/sdk/dist/wasm/executor-helper.d.ts +0 -1
  177. package/sdk/dist/wasm/executor-helper.js +0 -2
  178. package/sdk/dist/wasm/executor.d.ts +0 -1
  179. package/sdk/dist/wasm/executor.js +0 -2
  180. package/sdk/dist/wasm/layerzero-views.d.ts +0 -1
  181. package/sdk/dist/wasm/layerzero-views.js +0 -2
  182. package/sdk/dist/wasm/oft-std.d.ts +0 -1
  183. package/sdk/dist/wasm/oft-std.js +0 -2
  184. package/sdk/dist/wasm/price-feed.d.ts +0 -1
  185. package/sdk/dist/wasm/price-feed.js +0 -2
  186. package/sdk/dist/wasm/simple-message-lib.d.ts +0 -1
  187. package/sdk/dist/wasm/simple-message-lib.js +0 -2
  188. package/sdk/dist/wasm/treasury.d.ts +0 -1
  189. package/sdk/dist/wasm/treasury.js +0 -2
  190. package/sdk/dist/wasm/uln302.d.ts +0 -1
  191. package/sdk/dist/wasm/uln302.js +0 -2
  192. package/sdk/dist/wasm/upgrader.d.ts +0 -1
  193. package/sdk/dist/wasm/upgrader.js +0 -2
  194. package/sdk/dist/wasm.d.ts +0 -15
  195. package/sdk/dist/wasm.js +0 -15
  196. /package/contracts/oapps/{oft-std → oft}/integration-tests/extensions/mod.rs +0 -0
  197. /package/contracts/oapps/{oft → oft-core}/src/codec/mod.rs +0 -0
  198. /package/contracts/oapps/{oft → oft-core}/src/codec/oft_compose_msg_codec.rs +0 -0
  199. /package/contracts/oapps/{oft → oft-core}/src/codec/oft_msg_codec.rs +0 -0
  200. /package/contracts/oapps/{oft → oft-core}/src/errors.rs +0 -0
  201. /package/contracts/oapps/{oft → oft-core}/src/events.rs +0 -0
  202. /package/contracts/oapps/{oft → oft-core}/src/storage.rs +0 -0
  203. /package/contracts/oapps/{oft → oft-core}/src/tests/test_decimals.rs +0 -0
  204. /package/contracts/oapps/{oft → oft-core}/src/tests/test_oft_compose_msg_codec.rs +0 -0
  205. /package/contracts/oapps/{oft → oft-core}/src/tests/test_oft_version.rs +0 -0
  206. /package/contracts/oapps/{oft → oft-core}/src/tests/test_quote_oft.rs +0 -0
  207. /package/contracts/oapps/{oft → oft-core}/src/tests/test_quote_send.rs +0 -0
  208. /package/contracts/oapps/{oft → oft-core}/src/tests/test_send.rs +0 -0
  209. /package/contracts/oapps/{oft → oft-core}/src/tests/test_token.rs +0 -0
  210. /package/contracts/oapps/{oft → oft-core}/src/types.rs +0 -0
  211. /package/contracts/workers/{worker/src/interfaces → fee-lib-interfaces/src}/dvn_fee_lib.rs +0 -0
  212. /package/contracts/workers/{worker/src/interfaces → fee-lib-interfaces/src}/executor_fee_lib.rs +0 -0
  213. /package/contracts/workers/{worker/src/interfaces → fee-lib-interfaces/src}/price_feed.rs +0 -0
@@ -1,1722 +0,0 @@
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, 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
- /**
9
- * The mode of operation for the OFT contract
10
- */
11
- export declare enum OFTMode {
12
- LockUnlock = 0,
13
- MintBurn = 1
14
- }
15
- export declare const EndpointError: {
16
- 1: {
17
- message: string;
18
- };
19
- 2: {
20
- message: string;
21
- };
22
- 3: {
23
- message: string;
24
- };
25
- 4: {
26
- message: string;
27
- };
28
- 5: {
29
- message: string;
30
- };
31
- 6: {
32
- message: string;
33
- };
34
- 7: {
35
- message: string;
36
- };
37
- 8: {
38
- message: string;
39
- };
40
- 9: {
41
- message: string;
42
- };
43
- 10: {
44
- message: string;
45
- };
46
- 11: {
47
- message: string;
48
- };
49
- 12: {
50
- message: string;
51
- };
52
- 13: {
53
- message: string;
54
- };
55
- 14: {
56
- message: string;
57
- };
58
- 15: {
59
- message: string;
60
- };
61
- 16: {
62
- message: string;
63
- };
64
- 17: {
65
- message: string;
66
- };
67
- 18: {
68
- message: string;
69
- };
70
- 19: {
71
- message: string;
72
- };
73
- 20: {
74
- message: string;
75
- };
76
- 21: {
77
- message: string;
78
- };
79
- 22: {
80
- message: string;
81
- };
82
- 23: {
83
- message: string;
84
- };
85
- 24: {
86
- message: string;
87
- };
88
- 25: {
89
- message: string;
90
- };
91
- };
92
- /**
93
- * Parameters for sending a cross-chain message.
94
- */
95
- export interface MessagingParams {
96
- /**
97
- * Destination endpoint ID (chain identifier).
98
- */
99
- dst_eid: u32;
100
- /**
101
- * The message payload to send.
102
- */
103
- message: Buffer;
104
- /**
105
- * Encoded executor and DVN options.
106
- */
107
- options: Buffer;
108
- /**
109
- * Whether to pay fees in ZRO token instead of native token.
110
- */
111
- pay_in_zro: boolean;
112
- /**
113
- * Receiver address on the destination chain (32 bytes).
114
- */
115
- receiver: Buffer;
116
- }
117
- /**
118
- * Source message information identifying where a cross-chain message came from.
119
- */
120
- export interface Origin {
121
- /**
122
- * Nonce for this pathway.
123
- */
124
- nonce: u64;
125
- /**
126
- * Sender address on the source chain (32 bytes).
127
- */
128
- sender: Buffer;
129
- /**
130
- * Source endpoint ID (chain identifier).
131
- */
132
- src_eid: u32;
133
- }
134
- /**
135
- * Fee structure for cross-chain messaging.
136
- */
137
- export interface MessagingFee {
138
- /**
139
- * Fee paid in native token (XLM).
140
- */
141
- native_fee: i128;
142
- /**
143
- * Fee paid in ZRO token (LayerZero token).
144
- */
145
- zro_fee: i128;
146
- }
147
- /**
148
- * Receipt returned after successfully sending a cross-chain message.
149
- */
150
- export interface MessagingReceipt {
151
- /**
152
- * The fees charged for sending the message.
153
- */
154
- fee: MessagingFee;
155
- /**
156
- * Globally unique identifier for the message.
157
- */
158
- guid: Buffer;
159
- /**
160
- * The outbound nonce for this pathway.
161
- */
162
- nonce: u64;
163
- }
164
- /**
165
- * Type of message library indicating supported operations.
166
- */
167
- export type MessageLibType = {
168
- tag: "Send";
169
- values: void;
170
- } | {
171
- tag: "Receive";
172
- values: void;
173
- } | {
174
- tag: "SendAndReceive";
175
- values: void;
176
- };
177
- /**
178
- * Version information for a message library.
179
- *
180
- * Note: `minor` and `endpoint_version` use `u32` instead of `u8` because Stellar does not
181
- * support `u8` types in contract interface functions.
182
- */
183
- export interface MessageLibVersion {
184
- /**
185
- * Endpoint version (should not exceed u8::MAX = 255).
186
- */
187
- endpoint_version: u32;
188
- /**
189
- * Major version number.
190
- */
191
- major: u64;
192
- /**
193
- * Minor version number (should not exceed u8::MAX = 255).
194
- */
195
- minor: u32;
196
- }
197
- /**
198
- * Timeout configuration for receive library transitions.
199
- */
200
- export interface Timeout {
201
- /**
202
- * Unix timestamp when the timeout expires.
203
- */
204
- expiry: u64;
205
- /**
206
- * The new library address to transition to.
207
- */
208
- lib: string;
209
- }
210
- /**
211
- * Parameters for setting message library configuration.
212
- */
213
- export interface SetConfigParam {
214
- /**
215
- * XDR-encoded configuration data.
216
- */
217
- config: Buffer;
218
- /**
219
- * The type of configuration (e.g., executor, ULN).
220
- */
221
- config_type: u32;
222
- /**
223
- * The endpoint ID this config applies to.
224
- */
225
- eid: u32;
226
- }
227
- /**
228
- * Resolved library information with default status.
229
- */
230
- export interface ResolvedLibrary {
231
- /**
232
- * Whether this is the default library (true) or OApp-specific (false).
233
- */
234
- is_default: boolean;
235
- /**
236
- * The resolved library address.
237
- */
238
- lib: string;
239
- }
240
- /**
241
- * Outbound packet containing all information for cross-chain transmission.
242
- */
243
- export interface OutboundPacket {
244
- /**
245
- * Destination endpoint ID.
246
- */
247
- dst_eid: u32;
248
- /**
249
- * Globally unique identifier for this message.
250
- */
251
- guid: Buffer;
252
- /**
253
- * The message payload.
254
- */
255
- message: Buffer;
256
- /**
257
- * Outbound nonce for this pathway.
258
- */
259
- nonce: u64;
260
- /**
261
- * Receiver address on destination chain (32 bytes).
262
- */
263
- receiver: Buffer;
264
- /**
265
- * Sender address on source chain.
266
- */
267
- sender: string;
268
- /**
269
- * Source endpoint ID.
270
- */
271
- src_eid: u32;
272
- }
273
- /**
274
- * A fee recipient with the amount to be paid.
275
- */
276
- export interface FeeRecipient {
277
- /**
278
- * Amount of fee to pay.
279
- */
280
- amount: i128;
281
- /**
282
- * The address to send the fee to.
283
- */
284
- to: string;
285
- }
286
- /**
287
- * Result of send operation containing fees and encoded packet.
288
- */
289
- export interface FeesAndPacket {
290
- /**
291
- * The encoded packet ready for transmission.
292
- */
293
- encoded_packet: Buffer;
294
- /**
295
- * List of native token fee recipients (executor, DVNs, treasury).
296
- */
297
- native_fee_recipients: Array<FeeRecipient>;
298
- /**
299
- * List of ZRO token fee recipients (treasury).
300
- */
301
- zro_fee_recipients: Array<FeeRecipient>;
302
- }
303
- /**
304
- * OAppError: 2000-2099
305
- */
306
- export declare const OAppError: {
307
- 2000: {
308
- message: string;
309
- };
310
- 2001: {
311
- message: string;
312
- };
313
- 2002: {
314
- message: string;
315
- };
316
- 2003: {
317
- message: string;
318
- };
319
- };
320
- export type OAppCoreStorage = {
321
- tag: "Endpoint";
322
- values: void;
323
- } | {
324
- tag: "Peer";
325
- values: readonly [u32];
326
- };
327
- export interface EnforcedOptionParam {
328
- eid: u32;
329
- msg_type: u32;
330
- options: Buffer;
331
- }
332
- export type OAppOptionsType3Storage = {
333
- tag: "EnforcedOptions";
334
- values: readonly [u32, u32];
335
- };
336
- /**
337
- * OFTError: 3000-3099
338
- */
339
- export declare const OFTError: {
340
- 3000: {
341
- message: string;
342
- };
343
- 3001: {
344
- message: string;
345
- };
346
- 3002: {
347
- message: string;
348
- };
349
- 3003: {
350
- message: string;
351
- };
352
- };
353
- export type OFTFeeStorage = {
354
- tag: "DefaultFeeBps";
355
- values: void;
356
- } | {
357
- tag: "FeeBps";
358
- values: readonly [u32];
359
- } | {
360
- tag: "FeeDepositAddress";
361
- values: void;
362
- };
363
- export declare const OFTFeeError: {
364
- 2200: {
365
- message: string;
366
- };
367
- 2201: {
368
- message: string;
369
- };
370
- 2202: {
371
- message: string;
372
- };
373
- 2203: {
374
- message: string;
375
- };
376
- };
377
- export type OFTPausableStorage = {
378
- tag: "Paused";
379
- values: void;
380
- };
381
- export declare const OFTPausableError: {
382
- 2300: {
383
- message: string;
384
- };
385
- 2301: {
386
- message: string;
387
- };
388
- };
389
- export type Direction = {
390
- tag: "Inbound";
391
- values: void;
392
- } | {
393
- tag: "Outbound";
394
- values: void;
395
- };
396
- export interface RateLimit {
397
- in_flight_on_last_update: i128;
398
- last_update: u64;
399
- limit: i128;
400
- window_seconds: u64;
401
- }
402
- export type RateLimitStorage = {
403
- tag: "RateLimit";
404
- values: readonly [Direction, u32];
405
- };
406
- export declare const RateLimitError: {
407
- 2400: {
408
- message: string;
409
- };
410
- 2401: {
411
- message: string;
412
- };
413
- 2402: {
414
- message: string;
415
- };
416
- 2403: {
417
- message: string;
418
- };
419
- 2404: {
420
- message: string;
421
- };
422
- };
423
- export type OFTStorage = {
424
- tag: "DecimalConversionRate";
425
- values: void;
426
- } | {
427
- tag: "Token";
428
- values: void;
429
- };
430
- /**
431
- * Parameters for sending OFT tokens cross-chain
432
- */
433
- export interface SendParam {
434
- /**
435
- * The amount to send in local decimals
436
- */
437
- amount_ld: i128;
438
- /**
439
- * Compose message to execute on the destination (Optional)
440
- */
441
- compose_msg: Buffer;
442
- /**
443
- * The destination endpoint ID
444
- */
445
- dst_eid: u32;
446
- /**
447
- * Additional options for the LayerZero message (Optional)
448
- */
449
- extra_options: Buffer;
450
- /**
451
- * The minimum amount to receive in local decimals (slippage protection)
452
- */
453
- min_amount_ld: i128;
454
- /**
455
- * OFT command for custom behavior (Optional)
456
- */
457
- oft_cmd: Buffer;
458
- /**
459
- * The recipient address on the destination chain (32 bytes)
460
- */
461
- to: Buffer;
462
- }
463
- /**
464
- * Transfer limits for OFT operations
465
- */
466
- export interface OFTLimit {
467
- /**
468
- * The maximum amount to send in local decimals
469
- */
470
- max_amount_ld: i128;
471
- /**
472
- * The minimum amount to send in local decimals
473
- */
474
- min_amount_ld: i128;
475
- }
476
- /**
477
- * Receipt containing amounts sent and received in an OFT transfer
478
- */
479
- export interface OFTReceipt {
480
- /**
481
- * The amount received in local decimals on the remote
482
- */
483
- amount_received_ld: i128;
484
- /**
485
- * The amount sent in local decimals
486
- */
487
- amount_sent_ld: i128;
488
- }
489
- /**
490
- * Details about fees charged in an OFT operation
491
- */
492
- export interface OFTFeeDetail {
493
- /**
494
- * The description of the fee
495
- */
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
- */
501
- fee_amount_ld: i128;
502
- }
503
- /**
504
- * BufferReaderError: 1000-1009
505
- */
506
- export declare const BufferReaderError: {
507
- 1000: {
508
- message: string;
509
- };
510
- 1001: {
511
- message: string;
512
- };
513
- };
514
- /**
515
- * BufferWriterError: 1010-1019
516
- */
517
- export declare const BufferWriterError: {
518
- 1010: {
519
- message: string;
520
- };
521
- };
522
- /**
523
- * TtlConfigurableError: 1020-1029
524
- */
525
- export declare const TtlConfigurableError: {
526
- 1020: {
527
- message: string;
528
- };
529
- 1021: {
530
- message: string;
531
- };
532
- 1022: {
533
- message: string;
534
- };
535
- };
536
- /**
537
- * OwnableError: 1030-1039
538
- */
539
- export declare const OwnableError: {
540
- 1030: {
541
- message: string;
542
- };
543
- 1031: {
544
- message: string;
545
- };
546
- };
547
- /**
548
- * BytesExtError: 1040-1049
549
- */
550
- export declare const BytesExtError: {
551
- 1040: {
552
- message: string;
553
- };
554
- };
555
- /**
556
- * UpgradeableError: 1050-1059
557
- */
558
- export declare const UpgradeableError: {
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: {
580
- message: string;
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;
598
- };
599
- export type OwnableStorage = {
600
- tag: "Owner";
601
- values: void;
602
- };
603
- /**
604
- * TTL configuration: threshold (when to extend) and extend_to (target TTL).
605
- */
606
- export interface TtlConfig {
607
- /**
608
- * Target TTL after extension (in ledgers).
609
- */
610
- extend_to: u32;
611
- /**
612
- * TTL threshold that triggers extension (in ledgers).
613
- */
614
- threshold: u32;
615
- }
616
- export type TtlConfigStorage = {
617
- tag: "Frozen";
618
- values: void;
619
- } | {
620
- tag: "Instance";
621
- values: void;
622
- } | {
623
- tag: "Persistent";
624
- values: void;
625
- };
626
- export type UpgradeableStorage = {
627
- tag: "Migrating";
628
- values: void;
629
- };
630
- export interface Client {
631
- /**
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.
633
- */
634
- authorizer: (txnOptions?: {
635
- /**
636
- * The fee to pay for the transaction. Default: BASE_FEE
637
- */
638
- fee?: number;
639
- /**
640
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
641
- */
642
- timeoutInSeconds?: number;
643
- /**
644
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
645
- */
646
- simulate?: boolean;
647
- }) => Promise<AssembledTransaction<string>>;
648
- /**
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.
650
- * Returns the mode of operation for this OFT (LockUnlock or MintBurn)
651
- */
652
- mode: (txnOptions?: {
653
- /**
654
- * The fee to pay for the transaction. Default: BASE_FEE
655
- */
656
- fee?: number;
657
- /**
658
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
659
- */
660
- timeoutInSeconds?: number;
661
- /**
662
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
663
- */
664
- simulate?: boolean;
665
- }) => Promise<AssembledTransaction<OFTMode>>;
666
- /**
667
- * Construct and simulate a quote_oft transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
668
- */
669
- quote_oft: ({ send_param }: {
670
- send_param: SendParam;
671
- }, txnOptions?: {
672
- /**
673
- * The fee to pay for the transaction. Default: BASE_FEE
674
- */
675
- fee?: number;
676
- /**
677
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
678
- */
679
- timeoutInSeconds?: number;
680
- /**
681
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
682
- */
683
- simulate?: boolean;
684
- }) => Promise<AssembledTransaction<readonly [OFTLimit, Array<OFTFeeDetail>, OFTReceipt]>>;
685
- /**
686
- * Construct and simulate a quote_send 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.
687
- */
688
- quote_send: ({ sender, send_param, pay_in_zro }: {
689
- sender: string;
690
- send_param: SendParam;
691
- pay_in_zro: boolean;
692
- }, txnOptions?: {
693
- /**
694
- * The fee to pay for the transaction. Default: BASE_FEE
695
- */
696
- fee?: number;
697
- /**
698
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
699
- */
700
- timeoutInSeconds?: number;
701
- /**
702
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
703
- */
704
- simulate?: boolean;
705
- }) => Promise<AssembledTransaction<MessagingFee>>;
706
- /**
707
- * Construct and simulate a token 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.
708
- * Retrieves the token address associated with this OFT.
709
- */
710
- token: (txnOptions?: {
711
- /**
712
- * The fee to pay for the transaction. Default: BASE_FEE
713
- */
714
- fee?: number;
715
- /**
716
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
717
- */
718
- timeoutInSeconds?: number;
719
- /**
720
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
721
- */
722
- simulate?: boolean;
723
- }) => Promise<AssembledTransaction<string>>;
724
- /**
725
- * Construct and simulate a oft_version transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
726
- * Returns OFT version as (major, minor).
727
- */
728
- oft_version: (txnOptions?: {
729
- /**
730
- * The fee to pay for the transaction. Default: BASE_FEE
731
- */
732
- fee?: number;
733
- /**
734
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
735
- */
736
- timeoutInSeconds?: number;
737
- /**
738
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
739
- */
740
- simulate?: boolean;
741
- }) => Promise<AssembledTransaction<readonly [u64, u64]>>;
742
- /**
743
- * Construct and simulate a shared_decimals 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.
744
- * Retrieves the shared decimals used for cross-chain normalization.
745
- */
746
- shared_decimals: (txnOptions?: {
747
- /**
748
- * The fee to pay for the transaction. Default: BASE_FEE
749
- */
750
- fee?: number;
751
- /**
752
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
753
- */
754
- timeoutInSeconds?: number;
755
- /**
756
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
757
- */
758
- simulate?: boolean;
759
- }) => Promise<AssembledTransaction<u32>>;
760
- /**
761
- * Construct and simulate a decimal_conversion_rate 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.
762
- * Retrieves the decimal conversion rate used for cross-chain normalization.
763
- */
764
- decimal_conversion_rate: (txnOptions?: {
765
- /**
766
- * The fee to pay for the transaction. Default: BASE_FEE
767
- */
768
- fee?: number;
769
- /**
770
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
771
- */
772
- timeoutInSeconds?: number;
773
- /**
774
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
775
- */
776
- simulate?: boolean;
777
- }) => Promise<AssembledTransaction<i128>>;
778
- /**
779
- * Construct and simulate a approval_required 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.
780
- * Whether a separate token approval is required before sending.
781
- *
782
- * Helps wallet implementers determine integration requirements.
783
- *
784
- * # Returns
785
- * - `true` if a separate token approval step is required
786
- * - `false` if no separate approval is needed
787
- */
788
- approval_required: (txnOptions?: {
789
- /**
790
- * The fee to pay for the transaction. Default: BASE_FEE
791
- */
792
- fee?: number;
793
- /**
794
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
795
- */
796
- timeoutInSeconds?: number;
797
- /**
798
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
799
- */
800
- simulate?: boolean;
801
- }) => Promise<AssembledTransaction<boolean>>;
802
- /**
803
- * Construct and simulate a send 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.
804
- * Sends tokens cross-chain to another endpoint.
805
- *
806
- * Sender must be authenticated.
807
- *
808
- * # Returns
809
- * (MessagingReceipt, OFTReceipt)
810
- */
811
- send: ({ sender, send_param, fee, refund_address }: {
812
- sender: string;
813
- send_param: SendParam;
814
- fee: MessagingFee;
815
- refund_address: string;
816
- }, txnOptions?: {
817
- /**
818
- * The fee to pay for the transaction. Default: BASE_FEE
819
- */
820
- fee?: number;
821
- /**
822
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
823
- */
824
- timeoutInSeconds?: number;
825
- /**
826
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
827
- */
828
- simulate?: boolean;
829
- }) => Promise<AssembledTransaction<readonly [MessagingReceipt, OFTReceipt]>>;
830
- /**
831
- * 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.
832
- */
833
- set_paused: ({ paused }: {
834
- paused: boolean;
835
- }, txnOptions?: {
836
- /**
837
- * The fee to pay for the transaction. Default: BASE_FEE
838
- */
839
- fee?: number;
840
- /**
841
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
842
- */
843
- timeoutInSeconds?: number;
844
- /**
845
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
846
- */
847
- simulate?: boolean;
848
- }) => Promise<AssembledTransaction<null>>;
849
- /**
850
- * Construct and simulate a is_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.
851
- */
852
- is_paused: (txnOptions?: {
853
- /**
854
- * The fee to pay for the transaction. Default: BASE_FEE
855
- */
856
- fee?: number;
857
- /**
858
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
859
- */
860
- timeoutInSeconds?: number;
861
- /**
862
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
863
- */
864
- simulate?: boolean;
865
- }) => Promise<AssembledTransaction<boolean>>;
866
- /**
867
- * Construct and simulate a set_default_fee_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.
868
- */
869
- set_default_fee_bps: ({ default_fee_bps }: {
870
- default_fee_bps: u64;
871
- }, txnOptions?: {
872
- /**
873
- * The fee to pay for the transaction. Default: BASE_FEE
874
- */
875
- fee?: number;
876
- /**
877
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
878
- */
879
- timeoutInSeconds?: number;
880
- /**
881
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
882
- */
883
- simulate?: boolean;
884
- }) => Promise<AssembledTransaction<null>>;
885
- /**
886
- * Construct and simulate a set_fee_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.
887
- */
888
- set_fee_bps: ({ dst_eid, fee_bps }: {
889
- dst_eid: u32;
890
- fee_bps: u64;
891
- }, txnOptions?: {
892
- /**
893
- * The fee to pay for the transaction. Default: BASE_FEE
894
- */
895
- fee?: number;
896
- /**
897
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
898
- */
899
- timeoutInSeconds?: number;
900
- /**
901
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
902
- */
903
- simulate?: boolean;
904
- }) => Promise<AssembledTransaction<null>>;
905
- /**
906
- * Construct and simulate a unset_fee_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.
907
- */
908
- unset_fee_bps: ({ dst_eid }: {
909
- dst_eid: u32;
910
- }, txnOptions?: {
911
- /**
912
- * The fee to pay for the transaction. Default: BASE_FEE
913
- */
914
- fee?: number;
915
- /**
916
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
917
- */
918
- timeoutInSeconds?: number;
919
- /**
920
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
921
- */
922
- simulate?: boolean;
923
- }) => Promise<AssembledTransaction<null>>;
924
- /**
925
- * Construct and simulate a set_fee_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.
926
- */
927
- set_fee_deposit_address: ({ fee_deposit_address }: {
928
- fee_deposit_address: string;
929
- }, txnOptions?: {
930
- /**
931
- * The fee to pay for the transaction. Default: BASE_FEE
932
- */
933
- fee?: number;
934
- /**
935
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
936
- */
937
- timeoutInSeconds?: number;
938
- /**
939
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
940
- */
941
- simulate?: boolean;
942
- }) => Promise<AssembledTransaction<null>>;
943
- /**
944
- * Construct and simulate a has_fee_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.
945
- */
946
- has_fee_bps: ({ dst_eid }: {
947
- dst_eid: u32;
948
- }, txnOptions?: {
949
- /**
950
- * The fee to pay for the transaction. Default: BASE_FEE
951
- */
952
- fee?: number;
953
- /**
954
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
955
- */
956
- timeoutInSeconds?: number;
957
- /**
958
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
959
- */
960
- simulate?: boolean;
961
- }) => Promise<AssembledTransaction<boolean>>;
962
- /**
963
- * Construct and simulate a effective_fee_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.
964
- */
965
- effective_fee_bps: ({ dst_eid }: {
966
- dst_eid: 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<u64>>;
981
- /**
982
- * Construct and simulate a default_fee_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.
983
- */
984
- default_fee_bps: (txnOptions?: {
985
- /**
986
- * The fee to pay for the transaction. Default: BASE_FEE
987
- */
988
- fee?: number;
989
- /**
990
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
991
- */
992
- timeoutInSeconds?: number;
993
- /**
994
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
995
- */
996
- simulate?: boolean;
997
- }) => Promise<AssembledTransaction<u64>>;
998
- /**
999
- * Construct and simulate a fee_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.
1000
- */
1001
- fee_bps: ({ dst_eid }: {
1002
- dst_eid: u32;
1003
- }, txnOptions?: {
1004
- /**
1005
- * The fee to pay for the transaction. Default: BASE_FEE
1006
- */
1007
- fee?: number;
1008
- /**
1009
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1010
- */
1011
- timeoutInSeconds?: number;
1012
- /**
1013
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1014
- */
1015
- simulate?: boolean;
1016
- }) => Promise<AssembledTransaction<Option<u64>>>;
1017
- /**
1018
- * Construct and simulate a fee_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.
1019
- */
1020
- fee_deposit_address: (txnOptions?: {
1021
- /**
1022
- * The fee to pay for the transaction. Default: BASE_FEE
1023
- */
1024
- fee?: number;
1025
- /**
1026
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1027
- */
1028
- timeoutInSeconds?: number;
1029
- /**
1030
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1031
- */
1032
- simulate?: boolean;
1033
- }) => Promise<AssembledTransaction<string>>;
1034
- /**
1035
- * Construct and simulate a set_rate_limit 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.
1036
- */
1037
- set_rate_limit: ({ direction, eid, limit, window_seconds }: {
1038
- direction: Direction;
1039
- eid: u32;
1040
- limit: i128;
1041
- window_seconds: u64;
1042
- }, txnOptions?: {
1043
- /**
1044
- * The fee to pay for the transaction. Default: BASE_FEE
1045
- */
1046
- fee?: number;
1047
- /**
1048
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1049
- */
1050
- timeoutInSeconds?: number;
1051
- /**
1052
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1053
- */
1054
- simulate?: boolean;
1055
- }) => Promise<AssembledTransaction<null>>;
1056
- /**
1057
- * Construct and simulate a unset_rate_limit 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.
1058
- */
1059
- unset_rate_limit: ({ direction, eid }: {
1060
- direction: Direction;
1061
- eid: u32;
1062
- }, txnOptions?: {
1063
- /**
1064
- * The fee to pay for the transaction. Default: BASE_FEE
1065
- */
1066
- fee?: number;
1067
- /**
1068
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1069
- */
1070
- timeoutInSeconds?: number;
1071
- /**
1072
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1073
- */
1074
- simulate?: boolean;
1075
- }) => Promise<AssembledTransaction<null>>;
1076
- /**
1077
- * Construct and simulate a rate_limit_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.
1078
- */
1079
- rate_limit_config: ({ direction, eid }: {
1080
- direction: Direction;
1081
- eid: u32;
1082
- }, txnOptions?: {
1083
- /**
1084
- * The fee to pay for the transaction. Default: BASE_FEE
1085
- */
1086
- fee?: number;
1087
- /**
1088
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1089
- */
1090
- timeoutInSeconds?: number;
1091
- /**
1092
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1093
- */
1094
- simulate?: boolean;
1095
- }) => Promise<AssembledTransaction<readonly [i128, u64]>>;
1096
- /**
1097
- * Construct and simulate a rate_limit_in_flight 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.
1098
- */
1099
- rate_limit_in_flight: ({ direction, eid }: {
1100
- direction: Direction;
1101
- eid: u32;
1102
- }, txnOptions?: {
1103
- /**
1104
- * The fee to pay for the transaction. Default: BASE_FEE
1105
- */
1106
- fee?: number;
1107
- /**
1108
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1109
- */
1110
- timeoutInSeconds?: number;
1111
- /**
1112
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1113
- */
1114
- simulate?: boolean;
1115
- }) => Promise<AssembledTransaction<i128>>;
1116
- /**
1117
- * Construct and simulate a rate_limit_capacity 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.
1118
- */
1119
- rate_limit_capacity: ({ direction, eid }: {
1120
- direction: Direction;
1121
- eid: u32;
1122
- }, txnOptions?: {
1123
- /**
1124
- * The fee to pay for the transaction. Default: BASE_FEE
1125
- */
1126
- fee?: number;
1127
- /**
1128
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1129
- */
1130
- timeoutInSeconds?: number;
1131
- /**
1132
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1133
- */
1134
- simulate?: boolean;
1135
- }) => Promise<AssembledTransaction<i128>>;
1136
- /**
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
1146
- */
1147
- enforced_options: ({ eid, msg_type }: {
1148
- eid: u32;
1149
- msg_type: u32;
1150
- }, txnOptions?: {
1151
- /**
1152
- * The fee to pay for the transaction. Default: BASE_FEE
1153
- */
1154
- fee?: number;
1155
- /**
1156
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1157
- */
1158
- timeoutInSeconds?: number;
1159
- /**
1160
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1161
- */
1162
- simulate?: boolean;
1163
- }) => Promise<AssembledTransaction<Buffer>>;
1164
- /**
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
1176
- */
1177
- set_enforced_options: ({ options }: {
1178
- options: Array<EnforcedOptionParam>;
1179
- }, 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<null>>;
1193
- /**
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
1209
- */
1210
- combine_options: ({ eid, msg_type, extra_options }: {
1211
- eid: u32;
1212
- msg_type: u32;
1213
- extra_options: Buffer;
1214
- }, txnOptions?: {
1215
- /**
1216
- * The fee to pay for the transaction. Default: BASE_FEE
1217
- */
1218
- fee?: number;
1219
- /**
1220
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1221
- */
1222
- timeoutInSeconds?: number;
1223
- /**
1224
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1225
- */
1226
- simulate?: boolean;
1227
- }) => Promise<AssembledTransaction<Buffer>>;
1228
- /**
1229
- * Construct and simulate a allow_initialize_path 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.
1230
- * Checks if a messaging path can be initialized for the given origin.
1231
- *
1232
- * # Arguments
1233
- * * `origin` - The origin of the message
1234
- *
1235
- * # Returns
1236
- * True if the path can be initialized, false otherwise
1237
- */
1238
- allow_initialize_path: ({ origin }: {
1239
- origin: Origin;
1240
- }, txnOptions?: {
1241
- /**
1242
- * The fee to pay for the transaction. Default: BASE_FEE
1243
- */
1244
- fee?: number;
1245
- /**
1246
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1247
- */
1248
- timeoutInSeconds?: number;
1249
- /**
1250
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1251
- */
1252
- simulate?: boolean;
1253
- }) => Promise<AssembledTransaction<boolean>>;
1254
- /**
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.
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.
1262
- *
1263
- * # Arguments
1264
- * * `src_eid` - The source endpoint ID
1265
- * * `sender` - The sender OApp address
1266
- *
1267
- * # Returns
1268
- * The next nonce
1269
- */
1270
- next_nonce: ({ src_eid, sender }: {
1271
- src_eid: u32;
1272
- sender: Buffer;
1273
- }, txnOptions?: {
1274
- /**
1275
- * The fee to pay for the transaction. Default: BASE_FEE
1276
- */
1277
- fee?: number;
1278
- /**
1279
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1280
- */
1281
- timeoutInSeconds?: number;
1282
- /**
1283
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1284
- */
1285
- simulate?: boolean;
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>>;
1326
- /**
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.
1328
- * Indicates whether an address is an approved composeMsg sender to the Endpoint.
1329
- *
1330
- * Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.
1331
- * The default sender IS the OAppReceiver implementer.
1332
- *
1333
- * # Arguments
1334
- * * `origin` - The origin information containing the source endpoint and sender address
1335
- * * `message` - The lzReceive payload
1336
- * * `sender` - The sender address to check
1337
- *
1338
- * # Returns
1339
- * True if the sender is a valid composeMsg sender, false otherwise
1340
- */
1341
- is_compose_msg_sender: ({ origin, message, sender }: {
1342
- origin: Origin;
1343
- message: Buffer;
1344
- sender: string;
1345
- }, txnOptions?: {
1346
- /**
1347
- * The fee to pay for the transaction. Default: BASE_FEE
1348
- */
1349
- fee?: number;
1350
- /**
1351
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1352
- */
1353
- timeoutInSeconds?: number;
1354
- /**
1355
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1356
- */
1357
- simulate?: boolean;
1358
- }) => Promise<AssembledTransaction<boolean>>;
1359
- /**
1360
- * Construct and simulate a oapp_version transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
1361
- * Retrieves the OApp version information.
1362
- *
1363
- * # Returns
1364
- * A tuple containing:
1365
- * - `sender_version`: The version of the OAppSender
1366
- * - `receiver_version`: The version of the OAppReceiver
1367
- */
1368
- oapp_version: (txnOptions?: {
1369
- /**
1370
- * The fee to pay for the transaction. Default: BASE_FEE
1371
- */
1372
- fee?: number;
1373
- /**
1374
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1375
- */
1376
- timeoutInSeconds?: number;
1377
- /**
1378
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1379
- */
1380
- simulate?: boolean;
1381
- }) => Promise<AssembledTransaction<readonly [u64, u64]>>;
1382
- /**
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.
1384
- * Retrieves the LayerZero endpoint address associated with the OApp.
1385
- *
1386
- * # Returns
1387
- * The LayerZero endpoint address
1388
- */
1389
- endpoint: (txnOptions?: {
1390
- /**
1391
- * The fee to pay for the transaction. Default: BASE_FEE
1392
- */
1393
- fee?: number;
1394
- /**
1395
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1396
- */
1397
- timeoutInSeconds?: number;
1398
- /**
1399
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1400
- */
1401
- simulate?: boolean;
1402
- }) => Promise<AssembledTransaction<string>>;
1403
- /**
1404
- * Construct and simulate a peer 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.
1405
- * Retrieves the peer (OApp) associated with a corresponding endpoint.
1406
- *
1407
- * # Arguments
1408
- * * `eid` - The endpoint ID
1409
- *
1410
- * # Returns
1411
- * The peer address (OApp instance) associated with the corresponding endpoint
1412
- */
1413
- peer: ({ eid }: {
1414
- eid: u32;
1415
- }, txnOptions?: {
1416
- /**
1417
- * The fee to pay for the transaction. Default: BASE_FEE
1418
- */
1419
- fee?: number;
1420
- /**
1421
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1422
- */
1423
- timeoutInSeconds?: number;
1424
- /**
1425
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1426
- */
1427
- simulate?: boolean;
1428
- }) => Promise<AssembledTransaction<Option<Buffer>>>;
1429
- /**
1430
- * Construct and simulate a set_peer 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.
1431
- * Sets or removes the peer address (OApp instance) for a corresponding endpoint.
1432
- *
1433
- * # Arguments
1434
- * * `eid` - The endpoint ID
1435
- * * `peer` - The address of the peer to be associated with the corresponding endpoint, or None to remove the peer
1436
- */
1437
- set_peer: ({ eid, peer }: {
1438
- eid: u32;
1439
- peer: Option<Buffer>;
1440
- }, txnOptions?: {
1441
- /**
1442
- * The fee to pay for the transaction. Default: BASE_FEE
1443
- */
1444
- fee?: number;
1445
- /**
1446
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1447
- */
1448
- timeoutInSeconds?: number;
1449
- /**
1450
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1451
- */
1452
- simulate?: boolean;
1453
- }) => Promise<AssembledTransaction<null>>;
1454
- /**
1455
- * Construct and simulate a set_delegate 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.
1456
- * Sets the delegate address for the OApp Core.
1457
- *
1458
- * # Arguments
1459
- * * `delegate` - The address of the delegate to be set, or None to remove the delegate
1460
- */
1461
- set_delegate: ({ delegate }: {
1462
- delegate: Option<string>;
1463
- }, txnOptions?: {
1464
- /**
1465
- * The fee to pay for the transaction. Default: BASE_FEE
1466
- */
1467
- fee?: number;
1468
- /**
1469
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1470
- */
1471
- timeoutInSeconds?: number;
1472
- /**
1473
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1474
- */
1475
- simulate?: boolean;
1476
- }) => Promise<AssembledTransaction<null>>;
1477
- /**
1478
- * 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.
1479
- * Sets TTL configs for instance and persistent storage.
1480
- *
1481
- * - `None` values remove the corresponding config (disables auto-extension for that type)
1482
- * - Validates that `threshold <= extend_to <= MAX_TTL`
1483
- *
1484
- * # Arguments
1485
- * - `instance` - TTL config for instance storage
1486
- * - `persistent` - TTL config for persistent storage
1487
- *
1488
- * # Panics
1489
- * - `TtlConfigFrozen` if configs are frozen
1490
- * - `InvalidTtlConfig` if validation fails
1491
- */
1492
- set_ttl_configs: ({ instance, persistent }: {
1493
- instance: Option<TtlConfig>;
1494
- persistent: Option<TtlConfig>;
1495
- }, txnOptions?: {
1496
- /**
1497
- * The fee to pay for the transaction. Default: BASE_FEE
1498
- */
1499
- fee?: number;
1500
- /**
1501
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1502
- */
1503
- timeoutInSeconds?: number;
1504
- /**
1505
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1506
- */
1507
- simulate?: boolean;
1508
- }) => Promise<AssembledTransaction<null>>;
1509
- /**
1510
- * 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.
1511
- * Returns the current TTL configs as (instance_config, persistent_config).
1512
- */
1513
- ttl_configs: (txnOptions?: {
1514
- /**
1515
- * The fee to pay for the transaction. Default: BASE_FEE
1516
- */
1517
- fee?: number;
1518
- /**
1519
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1520
- */
1521
- timeoutInSeconds?: number;
1522
- /**
1523
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1524
- */
1525
- simulate?: boolean;
1526
- }) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>>;
1527
- /**
1528
- * 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.
1529
- * Permanently freezes TTL configs, preventing any future modifications.
1530
- *
1531
- * This is irreversible and provides immutability guarantees to users.
1532
- * Emits `TtlConfigsFrozen` event.
1533
- *
1534
- * # Panics
1535
- * - `TtlConfigAlreadyFrozen` if already frozen
1536
- */
1537
- freeze_ttl_configs: (txnOptions?: {
1538
- /**
1539
- * The fee to pay for the transaction. Default: BASE_FEE
1540
- */
1541
- fee?: number;
1542
- /**
1543
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1544
- */
1545
- timeoutInSeconds?: number;
1546
- /**
1547
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1548
- */
1549
- simulate?: boolean;
1550
- }) => Promise<AssembledTransaction<null>>;
1551
- /**
1552
- * 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.
1553
- * Returns whether TTL configs are frozen.
1554
- */
1555
- is_ttl_configs_frozen: (txnOptions?: {
1556
- /**
1557
- * The fee to pay for the transaction. Default: BASE_FEE
1558
- */
1559
- fee?: number;
1560
- /**
1561
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1562
- */
1563
- timeoutInSeconds?: number;
1564
- /**
1565
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1566
- */
1567
- simulate?: boolean;
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>>;
1595
- /**
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.
1597
- * Returns the current owner address, or None if no owner is set.
1598
- */
1599
- owner: (txnOptions?: {
1600
- /**
1601
- * The fee to pay for the transaction. Default: BASE_FEE
1602
- */
1603
- fee?: number;
1604
- /**
1605
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1606
- */
1607
- timeoutInSeconds?: number;
1608
- /**
1609
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1610
- */
1611
- simulate?: boolean;
1612
- }) => Promise<AssembledTransaction<Option<string>>>;
1613
- /**
1614
- * Construct and simulate a transfer_ownership transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
1615
- * Transfers ownership to a new address. Requires current owner authorization.
1616
- */
1617
- transfer_ownership: ({ new_owner }: {
1618
- new_owner: string;
1619
- }, txnOptions?: {
1620
- /**
1621
- * The fee to pay for the transaction. Default: BASE_FEE
1622
- */
1623
- fee?: number;
1624
- /**
1625
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1626
- */
1627
- timeoutInSeconds?: number;
1628
- /**
1629
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1630
- */
1631
- simulate?: boolean;
1632
- }) => Promise<AssembledTransaction<null>>;
1633
- /**
1634
- * Construct and simulate a renounce_ownership transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
1635
- * Permanently renounces ownership. Requires current owner authorization.
1636
- */
1637
- renounce_ownership: (txnOptions?: {
1638
- /**
1639
- * The fee to pay for the transaction. Default: BASE_FEE
1640
- */
1641
- fee?: number;
1642
- /**
1643
- * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
1644
- */
1645
- timeoutInSeconds?: number;
1646
- /**
1647
- * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
1648
- */
1649
- simulate?: boolean;
1650
- }) => Promise<AssembledTransaction<null>>;
1651
- }
1652
- export declare class Client extends ContractClient {
1653
- readonly options: ContractClientOptions;
1654
- static deploy<T = Client>(
1655
- /** Constructor/Initialization Args for the contract's `__constructor` method */
1656
- { token, owner, endpoint, delegate, shared_decimals, mode }: {
1657
- token: string;
1658
- owner: string;
1659
- endpoint: string;
1660
- delegate: Option<string>;
1661
- shared_decimals: u32;
1662
- mode: OFTMode;
1663
- },
1664
- /** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
1665
- options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
1666
- /** The hash of the Wasm blob, which must already be installed on-chain. */
1667
- wasmHash: Buffer | string;
1668
- /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
1669
- salt?: Buffer | Uint8Array;
1670
- /** The format used to decode `wasmHash`, if it's provided as a string. */
1671
- format?: "hex" | "base64";
1672
- }): Promise<AssembledTransaction<T>>;
1673
- constructor(options: ContractClientOptions);
1674
- readonly fromJSON: {
1675
- authorizer: (json: string) => AssembledTransaction<string>;
1676
- mode: (json: string) => AssembledTransaction<OFTMode>;
1677
- quote_oft: (json: string) => AssembledTransaction<readonly [OFTLimit, OFTFeeDetail[], OFTReceipt]>;
1678
- quote_send: (json: string) => AssembledTransaction<MessagingFee>;
1679
- token: (json: string) => AssembledTransaction<string>;
1680
- oft_version: (json: string) => AssembledTransaction<readonly [bigint, bigint]>;
1681
- shared_decimals: (json: string) => AssembledTransaction<number>;
1682
- decimal_conversion_rate: (json: string) => AssembledTransaction<bigint>;
1683
- approval_required: (json: string) => AssembledTransaction<boolean>;
1684
- send: (json: string) => AssembledTransaction<readonly [MessagingReceipt, OFTReceipt]>;
1685
- set_paused: (json: string) => AssembledTransaction<null>;
1686
- is_paused: (json: string) => AssembledTransaction<boolean>;
1687
- set_default_fee_bps: (json: string) => AssembledTransaction<null>;
1688
- set_fee_bps: (json: string) => AssembledTransaction<null>;
1689
- unset_fee_bps: (json: string) => AssembledTransaction<null>;
1690
- set_fee_deposit_address: (json: string) => AssembledTransaction<null>;
1691
- has_fee_bps: (json: string) => AssembledTransaction<boolean>;
1692
- effective_fee_bps: (json: string) => AssembledTransaction<bigint>;
1693
- default_fee_bps: (json: string) => AssembledTransaction<bigint>;
1694
- fee_bps: (json: string) => AssembledTransaction<Option<bigint>>;
1695
- fee_deposit_address: (json: string) => AssembledTransaction<string>;
1696
- set_rate_limit: (json: string) => AssembledTransaction<null>;
1697
- unset_rate_limit: (json: string) => AssembledTransaction<null>;
1698
- rate_limit_config: (json: string) => AssembledTransaction<readonly [bigint, bigint]>;
1699
- rate_limit_in_flight: (json: string) => AssembledTransaction<bigint>;
1700
- rate_limit_capacity: (json: string) => AssembledTransaction<bigint>;
1701
- enforced_options: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
1702
- set_enforced_options: (json: string) => AssembledTransaction<null>;
1703
- combine_options: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
1704
- allow_initialize_path: (json: string) => AssembledTransaction<boolean>;
1705
- next_nonce: (json: string) => AssembledTransaction<bigint>;
1706
- lz_receive: (json: string) => AssembledTransaction<null>;
1707
- is_compose_msg_sender: (json: string) => AssembledTransaction<boolean>;
1708
- oapp_version: (json: string) => AssembledTransaction<readonly [bigint, bigint]>;
1709
- endpoint: (json: string) => AssembledTransaction<string>;
1710
- peer: (json: string) => AssembledTransaction<Option<Buffer<ArrayBufferLike>>>;
1711
- set_peer: (json: string) => AssembledTransaction<null>;
1712
- set_delegate: (json: string) => AssembledTransaction<null>;
1713
- set_ttl_configs: (json: string) => AssembledTransaction<null>;
1714
- ttl_configs: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>;
1715
- freeze_ttl_configs: (json: string) => AssembledTransaction<null>;
1716
- is_ttl_configs_frozen: (json: string) => AssembledTransaction<boolean>;
1717
- extend_instance_ttl: (json: string) => AssembledTransaction<null>;
1718
- owner: (json: string) => AssembledTransaction<Option<string>>;
1719
- transfer_ownership: (json: string) => AssembledTransaction<null>;
1720
- renounce_ownership: (json: string) => AssembledTransaction<null>;
1721
- };
1722
- }