@layerzerolabs/lz-v2-stellar-sdk 0.2.13 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/bml.d.ts +40 -30
- package/dist/generated/bml.js +16 -11
- package/dist/generated/counter.d.ts +168 -134
- package/dist/generated/counter.js +26 -21
- package/dist/generated/dvn.d.ts +1932 -0
- package/dist/generated/dvn.js +288 -0
- package/dist/generated/dvn_fee_lib.d.ts +615 -0
- package/dist/generated/dvn_fee_lib.js +123 -0
- package/dist/generated/endpoint.d.ts +75 -41
- package/dist/generated/endpoint.js +22 -17
- package/dist/generated/executor.d.ts +1809 -0
- package/dist/generated/executor.js +269 -0
- package/dist/generated/executor_fee_lib.d.ts +999 -0
- package/dist/generated/executor_fee_lib.js +208 -0
- package/dist/generated/executor_helper.d.ts +869 -0
- package/dist/generated/executor_helper.js +187 -0
- package/dist/generated/oft_std.d.ts +1544 -0
- package/dist/generated/oft_std.js +271 -0
- package/dist/generated/price_feed.d.ts +1002 -0
- package/dist/generated/price_feed.js +170 -0
- package/dist/generated/sml.d.ts +75 -41
- package/dist/generated/sml.js +22 -17
- package/dist/generated/uln302.d.ts +79 -60
- package/dist/generated/uln302.js +37 -37
- package/dist/generated/upgrader.d.ts +70 -0
- package/dist/generated/upgrader.js +19 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +11 -0
- package/package.json +8 -7
- package/src/generated/bml.ts +45 -35
- package/src/generated/counter.ts +186 -152
- package/src/generated/dvn.ts +1979 -0
- package/src/generated/dvn_fee_lib.ts +628 -0
- package/src/generated/endpoint.ts +81 -47
- package/src/generated/executor.ts +112 -34
- package/src/generated/executor_fee_lib.ts +1000 -0
- package/src/generated/executor_helper.ts +18 -8
- package/src/generated/oft_std.ts +500 -110
- package/src/generated/price_feed.ts +1043 -0
- package/src/generated/sml.ts +81 -47
- package/src/generated/uln302.ts +98 -69
- package/src/generated/upgrader.ts +102 -0
- package/src/index.ts +13 -0
- package/test/index.test.ts +0 -1
- package/test/oft.test.ts +12 -23
- package/test/suites/testUpgradeable.ts +169 -0
- package/test/upgrader.test.ts +309 -0
|
@@ -0,0 +1,1544 @@
|
|
|
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
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Parameters for sending a cross-chain message.
|
|
91
|
+
*/
|
|
92
|
+
export interface MessagingParams {
|
|
93
|
+
/**
|
|
94
|
+
* Destination endpoint ID (chain identifier).
|
|
95
|
+
*/
|
|
96
|
+
dst_eid: u32;
|
|
97
|
+
/**
|
|
98
|
+
* The message payload to send.
|
|
99
|
+
*/
|
|
100
|
+
message: Buffer;
|
|
101
|
+
/**
|
|
102
|
+
* Encoded executor and DVN options.
|
|
103
|
+
*/
|
|
104
|
+
options: Buffer;
|
|
105
|
+
/**
|
|
106
|
+
* Whether to pay fees in ZRO token instead of native token.
|
|
107
|
+
*/
|
|
108
|
+
pay_in_zro: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Receiver address on the destination chain (32 bytes).
|
|
111
|
+
*/
|
|
112
|
+
receiver: Buffer;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Source message information identifying where a cross-chain message came from.
|
|
116
|
+
*/
|
|
117
|
+
export interface Origin {
|
|
118
|
+
/**
|
|
119
|
+
* Nonce for this pathway.
|
|
120
|
+
*/
|
|
121
|
+
nonce: u64;
|
|
122
|
+
/**
|
|
123
|
+
* Sender address on the source chain (32 bytes).
|
|
124
|
+
*/
|
|
125
|
+
sender: Buffer;
|
|
126
|
+
/**
|
|
127
|
+
* Source endpoint ID (chain identifier).
|
|
128
|
+
*/
|
|
129
|
+
src_eid: u32;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Fee structure for cross-chain messaging.
|
|
133
|
+
*/
|
|
134
|
+
export interface MessagingFee {
|
|
135
|
+
/**
|
|
136
|
+
* Fee paid in native token (XLM).
|
|
137
|
+
*/
|
|
138
|
+
native_fee: i128;
|
|
139
|
+
/**
|
|
140
|
+
* Fee paid in ZRO token (LayerZero token).
|
|
141
|
+
*/
|
|
142
|
+
zro_fee: i128;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Receipt returned after successfully sending a cross-chain message.
|
|
146
|
+
*/
|
|
147
|
+
export interface MessagingReceipt {
|
|
148
|
+
/**
|
|
149
|
+
* The fees charged for sending the message.
|
|
150
|
+
*/
|
|
151
|
+
fee: MessagingFee;
|
|
152
|
+
/**
|
|
153
|
+
* Globally unique identifier for the message.
|
|
154
|
+
*/
|
|
155
|
+
guid: Buffer;
|
|
156
|
+
/**
|
|
157
|
+
* The outbound nonce for this pathway.
|
|
158
|
+
*/
|
|
159
|
+
nonce: u64;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Type of message library indicating supported operations.
|
|
163
|
+
*/
|
|
164
|
+
export type MessageLibType = {
|
|
165
|
+
tag: "Send";
|
|
166
|
+
values: void;
|
|
167
|
+
} | {
|
|
168
|
+
tag: "Receive";
|
|
169
|
+
values: void;
|
|
170
|
+
} | {
|
|
171
|
+
tag: "SendAndReceive";
|
|
172
|
+
values: void;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Version information for a message library.
|
|
176
|
+
*
|
|
177
|
+
* Note: `minor` and `endpoint_version` use `u32` instead of `u8` because Stellar does not
|
|
178
|
+
* support `u8` types in contract interface functions.
|
|
179
|
+
*/
|
|
180
|
+
export interface MessageLibVersion {
|
|
181
|
+
/**
|
|
182
|
+
* Endpoint version (should not exceed u8::MAX = 255).
|
|
183
|
+
*/
|
|
184
|
+
endpoint_version: u32;
|
|
185
|
+
/**
|
|
186
|
+
* Major version number.
|
|
187
|
+
*/
|
|
188
|
+
major: u64;
|
|
189
|
+
/**
|
|
190
|
+
* Minor version number (should not exceed u8::MAX = 255).
|
|
191
|
+
*/
|
|
192
|
+
minor: u32;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Timeout configuration for receive library transitions.
|
|
196
|
+
*/
|
|
197
|
+
export interface Timeout {
|
|
198
|
+
/**
|
|
199
|
+
* Unix timestamp when the timeout expires.
|
|
200
|
+
*/
|
|
201
|
+
expiry: u64;
|
|
202
|
+
/**
|
|
203
|
+
* The new library address to transition to.
|
|
204
|
+
*/
|
|
205
|
+
lib: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Parameters for setting message library configuration.
|
|
209
|
+
*/
|
|
210
|
+
export interface SetConfigParam {
|
|
211
|
+
/**
|
|
212
|
+
* XDR-encoded configuration data.
|
|
213
|
+
*/
|
|
214
|
+
config: Buffer;
|
|
215
|
+
/**
|
|
216
|
+
* The type of configuration (e.g., executor, ULN).
|
|
217
|
+
*/
|
|
218
|
+
config_type: u32;
|
|
219
|
+
/**
|
|
220
|
+
* The endpoint ID this config applies to.
|
|
221
|
+
*/
|
|
222
|
+
eid: u32;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Resolved library information with default status.
|
|
226
|
+
*/
|
|
227
|
+
export interface ResolvedLibrary {
|
|
228
|
+
/**
|
|
229
|
+
* Whether this is the default library (true) or OApp-specific (false).
|
|
230
|
+
*/
|
|
231
|
+
is_default: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* The resolved library address.
|
|
234
|
+
*/
|
|
235
|
+
lib: string;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Outbound packet containing all information for cross-chain transmission.
|
|
239
|
+
*/
|
|
240
|
+
export interface OutboundPacket {
|
|
241
|
+
/**
|
|
242
|
+
* Destination endpoint ID.
|
|
243
|
+
*/
|
|
244
|
+
dst_eid: u32;
|
|
245
|
+
/**
|
|
246
|
+
* Globally unique identifier for this message.
|
|
247
|
+
*/
|
|
248
|
+
guid: Buffer;
|
|
249
|
+
/**
|
|
250
|
+
* The message payload.
|
|
251
|
+
*/
|
|
252
|
+
message: Buffer;
|
|
253
|
+
/**
|
|
254
|
+
* Outbound nonce for this pathway.
|
|
255
|
+
*/
|
|
256
|
+
nonce: u64;
|
|
257
|
+
/**
|
|
258
|
+
* Receiver address on destination chain (32 bytes).
|
|
259
|
+
*/
|
|
260
|
+
receiver: Buffer;
|
|
261
|
+
/**
|
|
262
|
+
* Sender address on source chain.
|
|
263
|
+
*/
|
|
264
|
+
sender: string;
|
|
265
|
+
/**
|
|
266
|
+
* Source endpoint ID.
|
|
267
|
+
*/
|
|
268
|
+
src_eid: u32;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* A fee recipient with the amount to be paid.
|
|
272
|
+
*/
|
|
273
|
+
export interface FeeRecipient {
|
|
274
|
+
/**
|
|
275
|
+
* Amount of fee to pay.
|
|
276
|
+
*/
|
|
277
|
+
amount: i128;
|
|
278
|
+
/**
|
|
279
|
+
* The address to send the fee to.
|
|
280
|
+
*/
|
|
281
|
+
to: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Result of send operation containing fees and encoded packet.
|
|
285
|
+
*/
|
|
286
|
+
export interface FeesAndPacket {
|
|
287
|
+
/**
|
|
288
|
+
* The encoded packet ready for transmission.
|
|
289
|
+
*/
|
|
290
|
+
encoded_packet: Buffer;
|
|
291
|
+
/**
|
|
292
|
+
* List of native token fee recipients (executor, DVNs, treasury).
|
|
293
|
+
*/
|
|
294
|
+
native_fee_recipients: Array<FeeRecipient>;
|
|
295
|
+
/**
|
|
296
|
+
* List of ZRO token fee recipients (treasury).
|
|
297
|
+
*/
|
|
298
|
+
zro_fee_recipients: Array<FeeRecipient>;
|
|
299
|
+
}
|
|
300
|
+
export declare const OAppError: {
|
|
301
|
+
2000: {
|
|
302
|
+
message: string;
|
|
303
|
+
};
|
|
304
|
+
2001: {
|
|
305
|
+
message: string;
|
|
306
|
+
};
|
|
307
|
+
2002: {
|
|
308
|
+
message: string;
|
|
309
|
+
};
|
|
310
|
+
2003: {
|
|
311
|
+
message: string;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
export type OAppCoreStorage = {
|
|
315
|
+
tag: "Endpoint";
|
|
316
|
+
values: void;
|
|
317
|
+
} | {
|
|
318
|
+
tag: "Peer";
|
|
319
|
+
values: readonly [u32];
|
|
320
|
+
};
|
|
321
|
+
export interface EnforcedOptionParam {
|
|
322
|
+
eid: u32;
|
|
323
|
+
msg_type: u32;
|
|
324
|
+
options: Buffer;
|
|
325
|
+
}
|
|
326
|
+
export type OAppOptionsType3Storage = {
|
|
327
|
+
tag: "EnforcedOptions";
|
|
328
|
+
values: readonly [u32, u32];
|
|
329
|
+
};
|
|
330
|
+
export declare const OFTError: {
|
|
331
|
+
2100: {
|
|
332
|
+
message: string;
|
|
333
|
+
};
|
|
334
|
+
2101: {
|
|
335
|
+
message: string;
|
|
336
|
+
};
|
|
337
|
+
2102: {
|
|
338
|
+
message: string;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
export type OFTFeeStorage = {
|
|
342
|
+
tag: "DefaultFeeBps";
|
|
343
|
+
values: void;
|
|
344
|
+
} | {
|
|
345
|
+
tag: "FeeBps";
|
|
346
|
+
values: readonly [u32];
|
|
347
|
+
} | {
|
|
348
|
+
tag: "FeeDepositAddress";
|
|
349
|
+
values: void;
|
|
350
|
+
};
|
|
351
|
+
export declare const OFTFeeError: {
|
|
352
|
+
2200: {
|
|
353
|
+
message: string;
|
|
354
|
+
};
|
|
355
|
+
2201: {
|
|
356
|
+
message: string;
|
|
357
|
+
};
|
|
358
|
+
2202: {
|
|
359
|
+
message: string;
|
|
360
|
+
};
|
|
361
|
+
2203: {
|
|
362
|
+
message: string;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
export type OFTPausableStorage = {
|
|
366
|
+
tag: "Paused";
|
|
367
|
+
values: void;
|
|
368
|
+
};
|
|
369
|
+
export declare const OFTPausableError: {
|
|
370
|
+
2300: {
|
|
371
|
+
message: string;
|
|
372
|
+
};
|
|
373
|
+
2301: {
|
|
374
|
+
message: string;
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
export type Direction = {
|
|
378
|
+
tag: "Inbound";
|
|
379
|
+
values: void;
|
|
380
|
+
} | {
|
|
381
|
+
tag: "Outbound";
|
|
382
|
+
values: void;
|
|
383
|
+
};
|
|
384
|
+
export interface RateLimit {
|
|
385
|
+
in_flight_on_last_update: i128;
|
|
386
|
+
last_update: u64;
|
|
387
|
+
limit: i128;
|
|
388
|
+
window_seconds: u64;
|
|
389
|
+
}
|
|
390
|
+
export type RateLimitStorage = {
|
|
391
|
+
tag: "RateLimit";
|
|
392
|
+
values: readonly [Direction, u32];
|
|
393
|
+
};
|
|
394
|
+
export declare const RateLimitError: {
|
|
395
|
+
2400: {
|
|
396
|
+
message: string;
|
|
397
|
+
};
|
|
398
|
+
2401: {
|
|
399
|
+
message: string;
|
|
400
|
+
};
|
|
401
|
+
2402: {
|
|
402
|
+
message: string;
|
|
403
|
+
};
|
|
404
|
+
2403: {
|
|
405
|
+
message: string;
|
|
406
|
+
};
|
|
407
|
+
2404: {
|
|
408
|
+
message: string;
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
export type OFTStorage = {
|
|
412
|
+
tag: "DecimalConversionRate";
|
|
413
|
+
values: void;
|
|
414
|
+
} | {
|
|
415
|
+
tag: "Token";
|
|
416
|
+
values: void;
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* Parameters for sending OFT tokens cross-chain
|
|
420
|
+
*/
|
|
421
|
+
export interface SendParam {
|
|
422
|
+
amount_ld: i128;
|
|
423
|
+
compose_msg: Buffer;
|
|
424
|
+
dst_eid: u32;
|
|
425
|
+
extra_options: Buffer;
|
|
426
|
+
min_amount_ld: i128;
|
|
427
|
+
oft_cmd: Buffer;
|
|
428
|
+
to: Buffer;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Transfer limits for OFT operations
|
|
432
|
+
*/
|
|
433
|
+
export interface OFTLimit {
|
|
434
|
+
max_amount_ld: i128;
|
|
435
|
+
min_amount_ld: i128;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Receipt containing amounts sent and received in an OFT transfer
|
|
439
|
+
*/
|
|
440
|
+
export interface OFTReceipt {
|
|
441
|
+
amount_received_ld: i128;
|
|
442
|
+
amount_sent_ld: i128;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Details about fees charged in an OFT operation
|
|
446
|
+
*/
|
|
447
|
+
export interface OFTFeeDetail {
|
|
448
|
+
description: Buffer;
|
|
449
|
+
fee_amount_ld: i128;
|
|
450
|
+
}
|
|
451
|
+
export declare const BufferReaderError: {
|
|
452
|
+
1000: {
|
|
453
|
+
message: string;
|
|
454
|
+
};
|
|
455
|
+
1001: {
|
|
456
|
+
message: string;
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
export declare const BufferWriterError: {
|
|
460
|
+
1100: {
|
|
461
|
+
message: string;
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
export declare const TtlConfigurableError: {
|
|
465
|
+
1200: {
|
|
466
|
+
message: string;
|
|
467
|
+
};
|
|
468
|
+
1201: {
|
|
469
|
+
message: string;
|
|
470
|
+
};
|
|
471
|
+
1202: {
|
|
472
|
+
message: string;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
export declare const OwnableError: {
|
|
476
|
+
1300: {
|
|
477
|
+
message: string;
|
|
478
|
+
};
|
|
479
|
+
1301: {
|
|
480
|
+
message: string;
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
export declare const BytesExtError: {
|
|
484
|
+
1400: {
|
|
485
|
+
message: string;
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
export declare const UpgradeableError: {
|
|
489
|
+
1500: {
|
|
490
|
+
message: string;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
export type OwnableStorage = {
|
|
494
|
+
tag: "Owner";
|
|
495
|
+
values: void;
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* TTL configuration: threshold (when to extend) and extend_to (target TTL).
|
|
499
|
+
*/
|
|
500
|
+
export interface TtlConfig {
|
|
501
|
+
/**
|
|
502
|
+
* Target TTL after extension (in ledgers).
|
|
503
|
+
*/
|
|
504
|
+
extend_to: u32;
|
|
505
|
+
/**
|
|
506
|
+
* TTL threshold that triggers extension (in ledgers).
|
|
507
|
+
*/
|
|
508
|
+
threshold: u32;
|
|
509
|
+
}
|
|
510
|
+
export type TtlConfigStorage = {
|
|
511
|
+
tag: "Frozen";
|
|
512
|
+
values: void;
|
|
513
|
+
} | {
|
|
514
|
+
tag: "Instance";
|
|
515
|
+
values: void;
|
|
516
|
+
} | {
|
|
517
|
+
tag: "Persistent";
|
|
518
|
+
values: void;
|
|
519
|
+
};
|
|
520
|
+
export type UpgradeableStorage = {
|
|
521
|
+
tag: "Migrating";
|
|
522
|
+
values: void;
|
|
523
|
+
};
|
|
524
|
+
export interface Client {
|
|
525
|
+
/**
|
|
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.
|
|
553
|
+
*/
|
|
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?: {
|
|
562
|
+
/**
|
|
563
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
564
|
+
*/
|
|
565
|
+
fee?: number;
|
|
566
|
+
/**
|
|
567
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
568
|
+
*/
|
|
569
|
+
timeoutInSeconds?: number;
|
|
570
|
+
/**
|
|
571
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
572
|
+
*/
|
|
573
|
+
simulate?: boolean;
|
|
574
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
575
|
+
/**
|
|
576
|
+
* 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
|
+
* Returns the mode of operation for this OFT (LockUnlock or MintBurn)
|
|
578
|
+
*/
|
|
579
|
+
mode: (txnOptions?: {
|
|
580
|
+
/**
|
|
581
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
582
|
+
*/
|
|
583
|
+
fee?: number;
|
|
584
|
+
/**
|
|
585
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
586
|
+
*/
|
|
587
|
+
timeoutInSeconds?: number;
|
|
588
|
+
/**
|
|
589
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
590
|
+
*/
|
|
591
|
+
simulate?: boolean;
|
|
592
|
+
}) => Promise<AssembledTransaction<OFTMode>>;
|
|
593
|
+
/**
|
|
594
|
+
* 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.
|
|
595
|
+
*/
|
|
596
|
+
quote_oft: ({ send_param }: {
|
|
597
|
+
send_param: SendParam;
|
|
598
|
+
}, txnOptions?: {
|
|
599
|
+
/**
|
|
600
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
601
|
+
*/
|
|
602
|
+
fee?: number;
|
|
603
|
+
/**
|
|
604
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
605
|
+
*/
|
|
606
|
+
timeoutInSeconds?: number;
|
|
607
|
+
/**
|
|
608
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
609
|
+
*/
|
|
610
|
+
simulate?: boolean;
|
|
611
|
+
}) => Promise<AssembledTransaction<readonly [OFTLimit, Array<OFTFeeDetail>, OFTReceipt]>>;
|
|
612
|
+
/**
|
|
613
|
+
* 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.
|
|
614
|
+
*/
|
|
615
|
+
quote_send: ({ sender, send_param, pay_in_zro }: {
|
|
616
|
+
sender: string;
|
|
617
|
+
send_param: SendParam;
|
|
618
|
+
pay_in_zro: boolean;
|
|
619
|
+
}, txnOptions?: {
|
|
620
|
+
/**
|
|
621
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
622
|
+
*/
|
|
623
|
+
fee?: number;
|
|
624
|
+
/**
|
|
625
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
626
|
+
*/
|
|
627
|
+
timeoutInSeconds?: number;
|
|
628
|
+
/**
|
|
629
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
630
|
+
*/
|
|
631
|
+
simulate?: boolean;
|
|
632
|
+
}) => Promise<AssembledTransaction<MessagingFee>>;
|
|
633
|
+
/**
|
|
634
|
+
* 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.
|
|
635
|
+
* Retrieves the token address associated with this OFT.
|
|
636
|
+
*/
|
|
637
|
+
token: (txnOptions?: {
|
|
638
|
+
/**
|
|
639
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
640
|
+
*/
|
|
641
|
+
fee?: number;
|
|
642
|
+
/**
|
|
643
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
644
|
+
*/
|
|
645
|
+
timeoutInSeconds?: number;
|
|
646
|
+
/**
|
|
647
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
648
|
+
*/
|
|
649
|
+
simulate?: boolean;
|
|
650
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
651
|
+
/**
|
|
652
|
+
* 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.
|
|
653
|
+
* Returns OFT version as (major, minor).
|
|
654
|
+
*/
|
|
655
|
+
oft_version: (txnOptions?: {
|
|
656
|
+
/**
|
|
657
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
658
|
+
*/
|
|
659
|
+
fee?: number;
|
|
660
|
+
/**
|
|
661
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
662
|
+
*/
|
|
663
|
+
timeoutInSeconds?: number;
|
|
664
|
+
/**
|
|
665
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
666
|
+
*/
|
|
667
|
+
simulate?: boolean;
|
|
668
|
+
}) => Promise<AssembledTransaction<readonly [u64, u64]>>;
|
|
669
|
+
/**
|
|
670
|
+
* 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.
|
|
671
|
+
* Retrieves the shared decimals used for cross-chain normalization.
|
|
672
|
+
*/
|
|
673
|
+
shared_decimals: (txnOptions?: {
|
|
674
|
+
/**
|
|
675
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
676
|
+
*/
|
|
677
|
+
fee?: number;
|
|
678
|
+
/**
|
|
679
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
680
|
+
*/
|
|
681
|
+
timeoutInSeconds?: number;
|
|
682
|
+
/**
|
|
683
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
684
|
+
*/
|
|
685
|
+
simulate?: boolean;
|
|
686
|
+
}) => Promise<AssembledTransaction<u32>>;
|
|
687
|
+
/**
|
|
688
|
+
* 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.
|
|
689
|
+
* Retrieves the decimal conversion rate used for cross-chain normalization.
|
|
690
|
+
*/
|
|
691
|
+
decimal_conversion_rate: (txnOptions?: {
|
|
692
|
+
/**
|
|
693
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
694
|
+
*/
|
|
695
|
+
fee?: number;
|
|
696
|
+
/**
|
|
697
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
698
|
+
*/
|
|
699
|
+
timeoutInSeconds?: number;
|
|
700
|
+
/**
|
|
701
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
702
|
+
*/
|
|
703
|
+
simulate?: boolean;
|
|
704
|
+
}) => Promise<AssembledTransaction<i128>>;
|
|
705
|
+
/**
|
|
706
|
+
* 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.
|
|
707
|
+
* Whether a separate token approval is required before sending.
|
|
708
|
+
*
|
|
709
|
+
* Helps wallet implementers determine integration requirements.
|
|
710
|
+
*
|
|
711
|
+
* # Returns
|
|
712
|
+
* - `true` if a separate token approval step is required
|
|
713
|
+
* - `false` if no separate approval is needed
|
|
714
|
+
*/
|
|
715
|
+
approval_required: (txnOptions?: {
|
|
716
|
+
/**
|
|
717
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
718
|
+
*/
|
|
719
|
+
fee?: number;
|
|
720
|
+
/**
|
|
721
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
722
|
+
*/
|
|
723
|
+
timeoutInSeconds?: number;
|
|
724
|
+
/**
|
|
725
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
726
|
+
*/
|
|
727
|
+
simulate?: boolean;
|
|
728
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
729
|
+
/**
|
|
730
|
+
* 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.
|
|
731
|
+
* Sends tokens cross-chain to another endpoint.
|
|
732
|
+
*
|
|
733
|
+
* Sender must be authenticated.
|
|
734
|
+
*
|
|
735
|
+
* # Returns
|
|
736
|
+
* (MessagingReceipt, OFTReceipt)
|
|
737
|
+
*/
|
|
738
|
+
send: ({ sender, send_param, fee, refund_address }: {
|
|
739
|
+
sender: string;
|
|
740
|
+
send_param: SendParam;
|
|
741
|
+
fee: MessagingFee;
|
|
742
|
+
refund_address: string;
|
|
743
|
+
}, txnOptions?: {
|
|
744
|
+
/**
|
|
745
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
746
|
+
*/
|
|
747
|
+
fee?: number;
|
|
748
|
+
/**
|
|
749
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
750
|
+
*/
|
|
751
|
+
timeoutInSeconds?: number;
|
|
752
|
+
/**
|
|
753
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
754
|
+
*/
|
|
755
|
+
simulate?: boolean;
|
|
756
|
+
}) => Promise<AssembledTransaction<readonly [MessagingReceipt, OFTReceipt]>>;
|
|
757
|
+
/**
|
|
758
|
+
* 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.
|
|
759
|
+
*/
|
|
760
|
+
set_paused: ({ paused }: {
|
|
761
|
+
paused: boolean;
|
|
762
|
+
}, txnOptions?: {
|
|
763
|
+
/**
|
|
764
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
765
|
+
*/
|
|
766
|
+
fee?: number;
|
|
767
|
+
/**
|
|
768
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
769
|
+
*/
|
|
770
|
+
timeoutInSeconds?: number;
|
|
771
|
+
/**
|
|
772
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
773
|
+
*/
|
|
774
|
+
simulate?: boolean;
|
|
775
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
776
|
+
/**
|
|
777
|
+
* 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.
|
|
778
|
+
*/
|
|
779
|
+
is_paused: (txnOptions?: {
|
|
780
|
+
/**
|
|
781
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
782
|
+
*/
|
|
783
|
+
fee?: number;
|
|
784
|
+
/**
|
|
785
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
786
|
+
*/
|
|
787
|
+
timeoutInSeconds?: number;
|
|
788
|
+
/**
|
|
789
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
790
|
+
*/
|
|
791
|
+
simulate?: boolean;
|
|
792
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
793
|
+
/**
|
|
794
|
+
* 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.
|
|
795
|
+
*/
|
|
796
|
+
set_default_fee_bps: ({ default_fee_bps }: {
|
|
797
|
+
default_fee_bps: u64;
|
|
798
|
+
}, txnOptions?: {
|
|
799
|
+
/**
|
|
800
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
801
|
+
*/
|
|
802
|
+
fee?: number;
|
|
803
|
+
/**
|
|
804
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
805
|
+
*/
|
|
806
|
+
timeoutInSeconds?: number;
|
|
807
|
+
/**
|
|
808
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
809
|
+
*/
|
|
810
|
+
simulate?: boolean;
|
|
811
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
812
|
+
/**
|
|
813
|
+
* 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.
|
|
814
|
+
*/
|
|
815
|
+
set_fee_bps: ({ dst_eid, fee_bps }: {
|
|
816
|
+
dst_eid: u32;
|
|
817
|
+
fee_bps: u64;
|
|
818
|
+
}, txnOptions?: {
|
|
819
|
+
/**
|
|
820
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
821
|
+
*/
|
|
822
|
+
fee?: number;
|
|
823
|
+
/**
|
|
824
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
825
|
+
*/
|
|
826
|
+
timeoutInSeconds?: number;
|
|
827
|
+
/**
|
|
828
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
829
|
+
*/
|
|
830
|
+
simulate?: boolean;
|
|
831
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
832
|
+
/**
|
|
833
|
+
* 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.
|
|
834
|
+
*/
|
|
835
|
+
unset_fee_bps: ({ dst_eid }: {
|
|
836
|
+
dst_eid: u32;
|
|
837
|
+
}, txnOptions?: {
|
|
838
|
+
/**
|
|
839
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
840
|
+
*/
|
|
841
|
+
fee?: number;
|
|
842
|
+
/**
|
|
843
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
844
|
+
*/
|
|
845
|
+
timeoutInSeconds?: number;
|
|
846
|
+
/**
|
|
847
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
848
|
+
*/
|
|
849
|
+
simulate?: boolean;
|
|
850
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
851
|
+
/**
|
|
852
|
+
* 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.
|
|
853
|
+
*/
|
|
854
|
+
set_fee_deposit_address: ({ fee_deposit_address }: {
|
|
855
|
+
fee_deposit_address: string;
|
|
856
|
+
}, txnOptions?: {
|
|
857
|
+
/**
|
|
858
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
859
|
+
*/
|
|
860
|
+
fee?: number;
|
|
861
|
+
/**
|
|
862
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
863
|
+
*/
|
|
864
|
+
timeoutInSeconds?: number;
|
|
865
|
+
/**
|
|
866
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
867
|
+
*/
|
|
868
|
+
simulate?: boolean;
|
|
869
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
870
|
+
/**
|
|
871
|
+
* 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.
|
|
872
|
+
*/
|
|
873
|
+
has_fee_bps: ({ dst_eid }: {
|
|
874
|
+
dst_eid: u32;
|
|
875
|
+
}, txnOptions?: {
|
|
876
|
+
/**
|
|
877
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
878
|
+
*/
|
|
879
|
+
fee?: number;
|
|
880
|
+
/**
|
|
881
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
882
|
+
*/
|
|
883
|
+
timeoutInSeconds?: number;
|
|
884
|
+
/**
|
|
885
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
886
|
+
*/
|
|
887
|
+
simulate?: boolean;
|
|
888
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
889
|
+
/**
|
|
890
|
+
* 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.
|
|
891
|
+
*/
|
|
892
|
+
effective_fee_bps: ({ dst_eid }: {
|
|
893
|
+
dst_eid: u32;
|
|
894
|
+
}, txnOptions?: {
|
|
895
|
+
/**
|
|
896
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
897
|
+
*/
|
|
898
|
+
fee?: number;
|
|
899
|
+
/**
|
|
900
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
901
|
+
*/
|
|
902
|
+
timeoutInSeconds?: number;
|
|
903
|
+
/**
|
|
904
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
905
|
+
*/
|
|
906
|
+
simulate?: boolean;
|
|
907
|
+
}) => Promise<AssembledTransaction<u64>>;
|
|
908
|
+
/**
|
|
909
|
+
* 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.
|
|
910
|
+
*/
|
|
911
|
+
default_fee_bps: (txnOptions?: {
|
|
912
|
+
/**
|
|
913
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
914
|
+
*/
|
|
915
|
+
fee?: number;
|
|
916
|
+
/**
|
|
917
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
918
|
+
*/
|
|
919
|
+
timeoutInSeconds?: number;
|
|
920
|
+
/**
|
|
921
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
922
|
+
*/
|
|
923
|
+
simulate?: boolean;
|
|
924
|
+
}) => Promise<AssembledTransaction<u64>>;
|
|
925
|
+
/**
|
|
926
|
+
* 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.
|
|
927
|
+
*/
|
|
928
|
+
fee_bps: ({ dst_eid }: {
|
|
929
|
+
dst_eid: u32;
|
|
930
|
+
}, txnOptions?: {
|
|
931
|
+
/**
|
|
932
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
933
|
+
*/
|
|
934
|
+
fee?: number;
|
|
935
|
+
/**
|
|
936
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
937
|
+
*/
|
|
938
|
+
timeoutInSeconds?: number;
|
|
939
|
+
/**
|
|
940
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
941
|
+
*/
|
|
942
|
+
simulate?: boolean;
|
|
943
|
+
}) => Promise<AssembledTransaction<Option<u64>>>;
|
|
944
|
+
/**
|
|
945
|
+
* 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.
|
|
946
|
+
*/
|
|
947
|
+
fee_deposit_address: (txnOptions?: {
|
|
948
|
+
/**
|
|
949
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
950
|
+
*/
|
|
951
|
+
fee?: number;
|
|
952
|
+
/**
|
|
953
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
954
|
+
*/
|
|
955
|
+
timeoutInSeconds?: number;
|
|
956
|
+
/**
|
|
957
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
958
|
+
*/
|
|
959
|
+
simulate?: boolean;
|
|
960
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
961
|
+
/**
|
|
962
|
+
* 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.
|
|
963
|
+
*/
|
|
964
|
+
set_rate_limit: ({ direction, eid, limit, window_seconds }: {
|
|
965
|
+
direction: Direction;
|
|
966
|
+
eid: u32;
|
|
967
|
+
limit: i128;
|
|
968
|
+
window_seconds: u64;
|
|
969
|
+
}, txnOptions?: {
|
|
970
|
+
/**
|
|
971
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
972
|
+
*/
|
|
973
|
+
fee?: number;
|
|
974
|
+
/**
|
|
975
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
976
|
+
*/
|
|
977
|
+
timeoutInSeconds?: number;
|
|
978
|
+
/**
|
|
979
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
980
|
+
*/
|
|
981
|
+
simulate?: boolean;
|
|
982
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
983
|
+
/**
|
|
984
|
+
* 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.
|
|
985
|
+
*/
|
|
986
|
+
unset_rate_limit: ({ direction, eid }: {
|
|
987
|
+
direction: Direction;
|
|
988
|
+
eid: u32;
|
|
989
|
+
}, txnOptions?: {
|
|
990
|
+
/**
|
|
991
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
992
|
+
*/
|
|
993
|
+
fee?: number;
|
|
994
|
+
/**
|
|
995
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
996
|
+
*/
|
|
997
|
+
timeoutInSeconds?: number;
|
|
998
|
+
/**
|
|
999
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1000
|
+
*/
|
|
1001
|
+
simulate?: boolean;
|
|
1002
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1003
|
+
/**
|
|
1004
|
+
* 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.
|
|
1005
|
+
*/
|
|
1006
|
+
rate_limit_config: ({ direction, eid }: {
|
|
1007
|
+
direction: Direction;
|
|
1008
|
+
eid: u32;
|
|
1009
|
+
}, txnOptions?: {
|
|
1010
|
+
/**
|
|
1011
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1012
|
+
*/
|
|
1013
|
+
fee?: number;
|
|
1014
|
+
/**
|
|
1015
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1016
|
+
*/
|
|
1017
|
+
timeoutInSeconds?: number;
|
|
1018
|
+
/**
|
|
1019
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1020
|
+
*/
|
|
1021
|
+
simulate?: boolean;
|
|
1022
|
+
}) => Promise<AssembledTransaction<readonly [i128, u64]>>;
|
|
1023
|
+
/**
|
|
1024
|
+
* 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.
|
|
1025
|
+
*/
|
|
1026
|
+
rate_limit_in_flight: ({ direction, eid }: {
|
|
1027
|
+
direction: Direction;
|
|
1028
|
+
eid: u32;
|
|
1029
|
+
}, txnOptions?: {
|
|
1030
|
+
/**
|
|
1031
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1032
|
+
*/
|
|
1033
|
+
fee?: number;
|
|
1034
|
+
/**
|
|
1035
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1036
|
+
*/
|
|
1037
|
+
timeoutInSeconds?: number;
|
|
1038
|
+
/**
|
|
1039
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1040
|
+
*/
|
|
1041
|
+
simulate?: boolean;
|
|
1042
|
+
}) => Promise<AssembledTransaction<i128>>;
|
|
1043
|
+
/**
|
|
1044
|
+
* 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.
|
|
1045
|
+
*/
|
|
1046
|
+
rate_limit_capacity: ({ direction, eid }: {
|
|
1047
|
+
direction: Direction;
|
|
1048
|
+
eid: u32;
|
|
1049
|
+
}, txnOptions?: {
|
|
1050
|
+
/**
|
|
1051
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1052
|
+
*/
|
|
1053
|
+
fee?: number;
|
|
1054
|
+
/**
|
|
1055
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1056
|
+
*/
|
|
1057
|
+
timeoutInSeconds?: number;
|
|
1058
|
+
/**
|
|
1059
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1060
|
+
*/
|
|
1061
|
+
simulate?: boolean;
|
|
1062
|
+
}) => Promise<AssembledTransaction<i128>>;
|
|
1063
|
+
/**
|
|
1064
|
+
* 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.
|
|
1065
|
+
*/
|
|
1066
|
+
enforced_options: ({ eid, msg_type }: {
|
|
1067
|
+
eid: u32;
|
|
1068
|
+
msg_type: u32;
|
|
1069
|
+
}, txnOptions?: {
|
|
1070
|
+
/**
|
|
1071
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1072
|
+
*/
|
|
1073
|
+
fee?: number;
|
|
1074
|
+
/**
|
|
1075
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1076
|
+
*/
|
|
1077
|
+
timeoutInSeconds?: number;
|
|
1078
|
+
/**
|
|
1079
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1080
|
+
*/
|
|
1081
|
+
simulate?: boolean;
|
|
1082
|
+
}) => Promise<AssembledTransaction<Buffer>>;
|
|
1083
|
+
/**
|
|
1084
|
+
* 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.
|
|
1085
|
+
*/
|
|
1086
|
+
set_enforced_options: ({ options }: {
|
|
1087
|
+
options: Array<EnforcedOptionParam>;
|
|
1088
|
+
}, txnOptions?: {
|
|
1089
|
+
/**
|
|
1090
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1091
|
+
*/
|
|
1092
|
+
fee?: number;
|
|
1093
|
+
/**
|
|
1094
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1095
|
+
*/
|
|
1096
|
+
timeoutInSeconds?: number;
|
|
1097
|
+
/**
|
|
1098
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1099
|
+
*/
|
|
1100
|
+
simulate?: boolean;
|
|
1101
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1102
|
+
/**
|
|
1103
|
+
* 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.
|
|
1104
|
+
*/
|
|
1105
|
+
combine_options: ({ eid, msg_type, extra_options }: {
|
|
1106
|
+
eid: u32;
|
|
1107
|
+
msg_type: u32;
|
|
1108
|
+
extra_options: Buffer;
|
|
1109
|
+
}, txnOptions?: {
|
|
1110
|
+
/**
|
|
1111
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1112
|
+
*/
|
|
1113
|
+
fee?: number;
|
|
1114
|
+
/**
|
|
1115
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1116
|
+
*/
|
|
1117
|
+
timeoutInSeconds?: number;
|
|
1118
|
+
/**
|
|
1119
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1120
|
+
*/
|
|
1121
|
+
simulate?: boolean;
|
|
1122
|
+
}) => Promise<AssembledTransaction<Buffer>>;
|
|
1123
|
+
/**
|
|
1124
|
+
* 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.
|
|
1125
|
+
* Checks if a messaging path can be initialized for the given origin.
|
|
1126
|
+
*
|
|
1127
|
+
* # Arguments
|
|
1128
|
+
* * `origin` - The origin of the message
|
|
1129
|
+
*
|
|
1130
|
+
* # Returns
|
|
1131
|
+
* True if the path can be initialized, false otherwise
|
|
1132
|
+
*/
|
|
1133
|
+
allow_initialize_path: ({ origin }: {
|
|
1134
|
+
origin: Origin;
|
|
1135
|
+
}, txnOptions?: {
|
|
1136
|
+
/**
|
|
1137
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1138
|
+
*/
|
|
1139
|
+
fee?: number;
|
|
1140
|
+
/**
|
|
1141
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1142
|
+
*/
|
|
1143
|
+
timeoutInSeconds?: number;
|
|
1144
|
+
/**
|
|
1145
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1146
|
+
*/
|
|
1147
|
+
simulate?: boolean;
|
|
1148
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
1149
|
+
/**
|
|
1150
|
+
* Construct and simulate a 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.
|
|
1153
|
+
*
|
|
1154
|
+
* # Arguments
|
|
1155
|
+
* * `src_eid` - The source endpoint ID
|
|
1156
|
+
* * `sender` - The sender OApp address
|
|
1157
|
+
*/
|
|
1158
|
+
next_nonce: ({ src_eid, sender }: {
|
|
1159
|
+
src_eid: u32;
|
|
1160
|
+
sender: Buffer;
|
|
1161
|
+
}, txnOptions?: {
|
|
1162
|
+
/**
|
|
1163
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1164
|
+
*/
|
|
1165
|
+
fee?: number;
|
|
1166
|
+
/**
|
|
1167
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1168
|
+
*/
|
|
1169
|
+
timeoutInSeconds?: number;
|
|
1170
|
+
/**
|
|
1171
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1172
|
+
*/
|
|
1173
|
+
simulate?: boolean;
|
|
1174
|
+
}) => Promise<AssembledTransaction<u64>>;
|
|
1175
|
+
/**
|
|
1176
|
+
* 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
|
+
* Indicates whether an address is an approved composeMsg sender to the Endpoint.
|
|
1178
|
+
*
|
|
1179
|
+
* Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.
|
|
1180
|
+
* The default sender IS the OAppReceiver implementer.
|
|
1181
|
+
*
|
|
1182
|
+
* # Arguments
|
|
1183
|
+
* * `origin` - The origin information containing the source endpoint and sender address
|
|
1184
|
+
* * `message` - The lzReceive payload
|
|
1185
|
+
* * `sender` - The sender address to check
|
|
1186
|
+
*
|
|
1187
|
+
* # Returns
|
|
1188
|
+
* True if the sender is a valid composeMsg sender, false otherwise
|
|
1189
|
+
*/
|
|
1190
|
+
is_compose_msg_sender: ({ origin, message, sender }: {
|
|
1191
|
+
origin: Origin;
|
|
1192
|
+
message: Buffer;
|
|
1193
|
+
sender: string;
|
|
1194
|
+
}, txnOptions?: {
|
|
1195
|
+
/**
|
|
1196
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1197
|
+
*/
|
|
1198
|
+
fee?: number;
|
|
1199
|
+
/**
|
|
1200
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1201
|
+
*/
|
|
1202
|
+
timeoutInSeconds?: number;
|
|
1203
|
+
/**
|
|
1204
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1205
|
+
*/
|
|
1206
|
+
simulate?: boolean;
|
|
1207
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
1208
|
+
/**
|
|
1209
|
+
* 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.
|
|
1210
|
+
* Retrieves the OApp version information.
|
|
1211
|
+
*
|
|
1212
|
+
* # Returns
|
|
1213
|
+
* A tuple containing:
|
|
1214
|
+
* - `sender_version`: The version of the OAppSender implementation
|
|
1215
|
+
* - `receiver_version`: The version of the OAppReceiver implementation
|
|
1216
|
+
*/
|
|
1217
|
+
oapp_version: (txnOptions?: {
|
|
1218
|
+
/**
|
|
1219
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1220
|
+
*/
|
|
1221
|
+
fee?: number;
|
|
1222
|
+
/**
|
|
1223
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1224
|
+
*/
|
|
1225
|
+
timeoutInSeconds?: number;
|
|
1226
|
+
/**
|
|
1227
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1228
|
+
*/
|
|
1229
|
+
simulate?: boolean;
|
|
1230
|
+
}) => Promise<AssembledTransaction<readonly [u64, u64]>>;
|
|
1231
|
+
/**
|
|
1232
|
+
* 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.
|
|
1234
|
+
*
|
|
1235
|
+
* # Returns
|
|
1236
|
+
* The LayerZero endpoint client
|
|
1237
|
+
*/
|
|
1238
|
+
endpoint: (txnOptions?: {
|
|
1239
|
+
/**
|
|
1240
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1241
|
+
*/
|
|
1242
|
+
fee?: number;
|
|
1243
|
+
/**
|
|
1244
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1245
|
+
*/
|
|
1246
|
+
timeoutInSeconds?: number;
|
|
1247
|
+
/**
|
|
1248
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1249
|
+
*/
|
|
1250
|
+
simulate?: boolean;
|
|
1251
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
1252
|
+
/**
|
|
1253
|
+
* 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.
|
|
1254
|
+
* Retrieves the peer (OApp) associated with a corresponding endpoint.
|
|
1255
|
+
*
|
|
1256
|
+
* # Arguments
|
|
1257
|
+
* * `eid` - The endpoint ID
|
|
1258
|
+
*
|
|
1259
|
+
* # Returns
|
|
1260
|
+
* The peer address (OApp instance) associated with the corresponding endpoint
|
|
1261
|
+
*/
|
|
1262
|
+
peer: ({ eid }: {
|
|
1263
|
+
eid: u32;
|
|
1264
|
+
}, txnOptions?: {
|
|
1265
|
+
/**
|
|
1266
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1267
|
+
*/
|
|
1268
|
+
fee?: number;
|
|
1269
|
+
/**
|
|
1270
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1271
|
+
*/
|
|
1272
|
+
timeoutInSeconds?: number;
|
|
1273
|
+
/**
|
|
1274
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1275
|
+
*/
|
|
1276
|
+
simulate?: boolean;
|
|
1277
|
+
}) => Promise<AssembledTransaction<Option<Buffer>>>;
|
|
1278
|
+
/**
|
|
1279
|
+
* 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.
|
|
1280
|
+
* Sets or removes the peer address (OApp instance) for a corresponding endpoint.
|
|
1281
|
+
*
|
|
1282
|
+
* # Arguments
|
|
1283
|
+
* * `eid` - The endpoint ID
|
|
1284
|
+
* * `peer` - The address of the peer to be associated with the corresponding endpoint, or None to remove the peer
|
|
1285
|
+
*/
|
|
1286
|
+
set_peer: ({ eid, peer }: {
|
|
1287
|
+
eid: u32;
|
|
1288
|
+
peer: Option<Buffer>;
|
|
1289
|
+
}, txnOptions?: {
|
|
1290
|
+
/**
|
|
1291
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1292
|
+
*/
|
|
1293
|
+
fee?: number;
|
|
1294
|
+
/**
|
|
1295
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1296
|
+
*/
|
|
1297
|
+
timeoutInSeconds?: number;
|
|
1298
|
+
/**
|
|
1299
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1300
|
+
*/
|
|
1301
|
+
simulate?: boolean;
|
|
1302
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1303
|
+
/**
|
|
1304
|
+
* 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.
|
|
1305
|
+
* Sets the delegate address for the OApp Core.
|
|
1306
|
+
*
|
|
1307
|
+
* # Arguments
|
|
1308
|
+
* * `delegate` - The address of the delegate to be set, or None to remove the delegate
|
|
1309
|
+
*/
|
|
1310
|
+
set_delegate: ({ delegate }: {
|
|
1311
|
+
delegate: Option<string>;
|
|
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 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.
|
|
1328
|
+
* Sets TTL configs for instance and persistent storage.
|
|
1329
|
+
*
|
|
1330
|
+
* - `None` values remove the corresponding config (disables auto-extension for that type)
|
|
1331
|
+
* - Validates that `threshold <= extend_to <= MAX_TTL`
|
|
1332
|
+
*
|
|
1333
|
+
* # Arguments
|
|
1334
|
+
* - `instance` - TTL config for instance storage
|
|
1335
|
+
* - `persistent` - TTL config for persistent storage
|
|
1336
|
+
*
|
|
1337
|
+
* # Panics
|
|
1338
|
+
* - `TtlConfigFrozen` if configs are frozen
|
|
1339
|
+
* - `InvalidTtlConfig` if validation fails
|
|
1340
|
+
*/
|
|
1341
|
+
set_ttl_configs: ({ instance, persistent }: {
|
|
1342
|
+
instance: Option<TtlConfig>;
|
|
1343
|
+
persistent: Option<TtlConfig>;
|
|
1344
|
+
}, txnOptions?: {
|
|
1345
|
+
/**
|
|
1346
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1347
|
+
*/
|
|
1348
|
+
fee?: number;
|
|
1349
|
+
/**
|
|
1350
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1351
|
+
*/
|
|
1352
|
+
timeoutInSeconds?: number;
|
|
1353
|
+
/**
|
|
1354
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1355
|
+
*/
|
|
1356
|
+
simulate?: boolean;
|
|
1357
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1358
|
+
/**
|
|
1359
|
+
* 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.
|
|
1360
|
+
* Returns the current TTL configs as (instance_config, persistent_config).
|
|
1361
|
+
*/
|
|
1362
|
+
ttl_configs: (txnOptions?: {
|
|
1363
|
+
/**
|
|
1364
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1365
|
+
*/
|
|
1366
|
+
fee?: number;
|
|
1367
|
+
/**
|
|
1368
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1369
|
+
*/
|
|
1370
|
+
timeoutInSeconds?: number;
|
|
1371
|
+
/**
|
|
1372
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1373
|
+
*/
|
|
1374
|
+
simulate?: boolean;
|
|
1375
|
+
}) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>>;
|
|
1376
|
+
/**
|
|
1377
|
+
* 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.
|
|
1378
|
+
* Permanently freezes TTL configs, preventing any future modifications.
|
|
1379
|
+
*
|
|
1380
|
+
* This is irreversible and provides immutability guarantees to users.
|
|
1381
|
+
* Emits `TtlConfigsFrozen` event.
|
|
1382
|
+
*
|
|
1383
|
+
* # Panics
|
|
1384
|
+
* - `TtlConfigAlreadyFrozen` if already frozen
|
|
1385
|
+
*/
|
|
1386
|
+
freeze_ttl_configs: (txnOptions?: {
|
|
1387
|
+
/**
|
|
1388
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1389
|
+
*/
|
|
1390
|
+
fee?: number;
|
|
1391
|
+
/**
|
|
1392
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1393
|
+
*/
|
|
1394
|
+
timeoutInSeconds?: number;
|
|
1395
|
+
/**
|
|
1396
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1397
|
+
*/
|
|
1398
|
+
simulate?: boolean;
|
|
1399
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1400
|
+
/**
|
|
1401
|
+
* 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.
|
|
1402
|
+
* Returns whether TTL configs are frozen.
|
|
1403
|
+
*/
|
|
1404
|
+
is_ttl_configs_frozen: (txnOptions?: {
|
|
1405
|
+
/**
|
|
1406
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1407
|
+
*/
|
|
1408
|
+
fee?: number;
|
|
1409
|
+
/**
|
|
1410
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1411
|
+
*/
|
|
1412
|
+
timeoutInSeconds?: number;
|
|
1413
|
+
/**
|
|
1414
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1415
|
+
*/
|
|
1416
|
+
simulate?: boolean;
|
|
1417
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
1418
|
+
/**
|
|
1419
|
+
* 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
|
+
* Returns the current owner address, or None if no owner is set.
|
|
1421
|
+
*/
|
|
1422
|
+
owner: (txnOptions?: {
|
|
1423
|
+
/**
|
|
1424
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1425
|
+
*/
|
|
1426
|
+
fee?: number;
|
|
1427
|
+
/**
|
|
1428
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1429
|
+
*/
|
|
1430
|
+
timeoutInSeconds?: number;
|
|
1431
|
+
/**
|
|
1432
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1433
|
+
*/
|
|
1434
|
+
simulate?: boolean;
|
|
1435
|
+
}) => Promise<AssembledTransaction<Option<string>>>;
|
|
1436
|
+
/**
|
|
1437
|
+
* 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.
|
|
1438
|
+
* Transfers ownership to a new address. Requires current owner authorization.
|
|
1439
|
+
*/
|
|
1440
|
+
transfer_ownership: ({ new_owner }: {
|
|
1441
|
+
new_owner: string;
|
|
1442
|
+
}, txnOptions?: {
|
|
1443
|
+
/**
|
|
1444
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1445
|
+
*/
|
|
1446
|
+
fee?: number;
|
|
1447
|
+
/**
|
|
1448
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1449
|
+
*/
|
|
1450
|
+
timeoutInSeconds?: number;
|
|
1451
|
+
/**
|
|
1452
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1453
|
+
*/
|
|
1454
|
+
simulate?: boolean;
|
|
1455
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1456
|
+
/**
|
|
1457
|
+
* 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.
|
|
1458
|
+
* Permanently renounces ownership. Requires current owner authorization.
|
|
1459
|
+
*/
|
|
1460
|
+
renounce_ownership: (txnOptions?: {
|
|
1461
|
+
/**
|
|
1462
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
1463
|
+
*/
|
|
1464
|
+
fee?: number;
|
|
1465
|
+
/**
|
|
1466
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
1467
|
+
*/
|
|
1468
|
+
timeoutInSeconds?: number;
|
|
1469
|
+
/**
|
|
1470
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
1471
|
+
*/
|
|
1472
|
+
simulate?: boolean;
|
|
1473
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
1474
|
+
}
|
|
1475
|
+
export declare class Client extends ContractClient {
|
|
1476
|
+
readonly options: ContractClientOptions;
|
|
1477
|
+
static deploy<T = Client>(
|
|
1478
|
+
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
1479
|
+
{ token, owner, endpoint, delegate, shared_decimals, mode }: {
|
|
1480
|
+
token: string;
|
|
1481
|
+
owner: string;
|
|
1482
|
+
endpoint: string;
|
|
1483
|
+
delegate: Option<string>;
|
|
1484
|
+
shared_decimals: u32;
|
|
1485
|
+
mode: OFTMode;
|
|
1486
|
+
},
|
|
1487
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
1488
|
+
options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
|
|
1489
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
1490
|
+
wasmHash: Buffer | string;
|
|
1491
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
1492
|
+
salt?: Buffer | Uint8Array;
|
|
1493
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
1494
|
+
format?: "hex" | "base64";
|
|
1495
|
+
}): Promise<AssembledTransaction<T>>;
|
|
1496
|
+
constructor(options: ContractClientOptions);
|
|
1497
|
+
readonly fromJSON: {
|
|
1498
|
+
extend_instance_ttl: (json: string) => AssembledTransaction<null>;
|
|
1499
|
+
lz_receive: (json: string) => AssembledTransaction<null>;
|
|
1500
|
+
mode: (json: string) => AssembledTransaction<OFTMode>;
|
|
1501
|
+
quote_oft: (json: string) => AssembledTransaction<readonly [OFTLimit, OFTFeeDetail[], OFTReceipt]>;
|
|
1502
|
+
quote_send: (json: string) => AssembledTransaction<MessagingFee>;
|
|
1503
|
+
token: (json: string) => AssembledTransaction<string>;
|
|
1504
|
+
oft_version: (json: string) => AssembledTransaction<readonly [bigint, bigint]>;
|
|
1505
|
+
shared_decimals: (json: string) => AssembledTransaction<number>;
|
|
1506
|
+
decimal_conversion_rate: (json: string) => AssembledTransaction<bigint>;
|
|
1507
|
+
approval_required: (json: string) => AssembledTransaction<boolean>;
|
|
1508
|
+
send: (json: string) => AssembledTransaction<readonly [MessagingReceipt, OFTReceipt]>;
|
|
1509
|
+
set_paused: (json: string) => AssembledTransaction<null>;
|
|
1510
|
+
is_paused: (json: string) => AssembledTransaction<boolean>;
|
|
1511
|
+
set_default_fee_bps: (json: string) => AssembledTransaction<null>;
|
|
1512
|
+
set_fee_bps: (json: string) => AssembledTransaction<null>;
|
|
1513
|
+
unset_fee_bps: (json: string) => AssembledTransaction<null>;
|
|
1514
|
+
set_fee_deposit_address: (json: string) => AssembledTransaction<null>;
|
|
1515
|
+
has_fee_bps: (json: string) => AssembledTransaction<boolean>;
|
|
1516
|
+
effective_fee_bps: (json: string) => AssembledTransaction<bigint>;
|
|
1517
|
+
default_fee_bps: (json: string) => AssembledTransaction<bigint>;
|
|
1518
|
+
fee_bps: (json: string) => AssembledTransaction<Option<bigint>>;
|
|
1519
|
+
fee_deposit_address: (json: string) => AssembledTransaction<string>;
|
|
1520
|
+
set_rate_limit: (json: string) => AssembledTransaction<null>;
|
|
1521
|
+
unset_rate_limit: (json: string) => AssembledTransaction<null>;
|
|
1522
|
+
rate_limit_config: (json: string) => AssembledTransaction<readonly [bigint, bigint]>;
|
|
1523
|
+
rate_limit_in_flight: (json: string) => AssembledTransaction<bigint>;
|
|
1524
|
+
rate_limit_capacity: (json: string) => AssembledTransaction<bigint>;
|
|
1525
|
+
enforced_options: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
|
|
1526
|
+
set_enforced_options: (json: string) => AssembledTransaction<null>;
|
|
1527
|
+
combine_options: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
|
|
1528
|
+
allow_initialize_path: (json: string) => AssembledTransaction<boolean>;
|
|
1529
|
+
next_nonce: (json: string) => AssembledTransaction<bigint>;
|
|
1530
|
+
is_compose_msg_sender: (json: string) => AssembledTransaction<boolean>;
|
|
1531
|
+
oapp_version: (json: string) => AssembledTransaction<readonly [bigint, bigint]>;
|
|
1532
|
+
endpoint: (json: string) => AssembledTransaction<string>;
|
|
1533
|
+
peer: (json: string) => AssembledTransaction<Option<Buffer<ArrayBufferLike>>>;
|
|
1534
|
+
set_peer: (json: string) => AssembledTransaction<null>;
|
|
1535
|
+
set_delegate: (json: string) => AssembledTransaction<null>;
|
|
1536
|
+
set_ttl_configs: (json: string) => AssembledTransaction<null>;
|
|
1537
|
+
ttl_configs: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>;
|
|
1538
|
+
freeze_ttl_configs: (json: string) => AssembledTransaction<null>;
|
|
1539
|
+
is_ttl_configs_frozen: (json: string) => AssembledTransaction<boolean>;
|
|
1540
|
+
owner: (json: string) => AssembledTransaction<Option<string>>;
|
|
1541
|
+
transfer_ownership: (json: string) => AssembledTransaction<null>;
|
|
1542
|
+
renounce_ownership: (json: string) => AssembledTransaction<null>;
|
|
1543
|
+
};
|
|
1544
|
+
}
|