@layerzerolabs/lz-v2-stellar-sdk 0.2.13 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -0
- package/.turbo/turbo-test.log +1009 -0
- package/dist/generated/bml.d.ts +104 -37
- package/dist/generated/bml.js +83 -42
- package/dist/generated/counter.d.ts +334 -175
- package/dist/generated/counter.js +109 -63
- package/dist/generated/dvn.d.ts +1985 -0
- package/dist/generated/dvn.js +326 -0
- package/dist/generated/dvn_fee_lib.d.ts +690 -0
- package/dist/generated/dvn_fee_lib.js +163 -0
- package/dist/generated/endpoint.d.ts +155 -46
- package/dist/generated/endpoint.js +93 -50
- package/dist/generated/executor.d.ts +1841 -0
- package/dist/generated/executor.js +312 -0
- package/dist/generated/executor_fee_lib.d.ts +1083 -0
- package/dist/generated/executor_fee_lib.js +255 -0
- package/dist/generated/executor_helper.d.ts +981 -0
- package/dist/generated/executor_helper.js +236 -0
- package/dist/generated/oft_std.d.ts +1722 -0
- package/dist/generated/oft_std.js +316 -0
- package/dist/generated/price_feed.d.ts +1077 -0
- package/dist/generated/price_feed.js +210 -0
- package/dist/generated/sml.d.ts +171 -56
- package/dist/generated/sml.js +111 -62
- package/dist/generated/treasury.d.ts +896 -0
- package/dist/generated/treasury.js +219 -0
- package/dist/generated/uln302.d.ts +175 -75
- package/dist/generated/uln302.js +126 -82
- package/dist/generated/upgrader.d.ts +70 -0
- package/dist/generated/upgrader.js +19 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +14 -0
- package/dist/wasm/blocked-message-lib.d.ts +1 -0
- package/dist/wasm/blocked-message-lib.js +2 -0
- package/dist/wasm/counter.d.ts +1 -0
- package/dist/wasm/counter.js +2 -0
- package/dist/wasm/dvn-fee-lib.d.ts +1 -0
- package/dist/wasm/dvn-fee-lib.js +2 -0
- package/dist/wasm/dvn.d.ts +1 -0
- package/dist/wasm/dvn.js +2 -0
- package/dist/wasm/endpoint-v2.d.ts +1 -0
- package/dist/wasm/endpoint-v2.js +2 -0
- package/dist/wasm/executor-fee-lib.d.ts +1 -0
- package/dist/wasm/executor-fee-lib.js +2 -0
- package/dist/wasm/executor-helper.d.ts +1 -0
- package/dist/wasm/executor-helper.js +2 -0
- package/dist/wasm/executor.d.ts +1 -0
- package/dist/wasm/executor.js +2 -0
- package/dist/wasm/layerzero-views.d.ts +1 -0
- package/dist/wasm/layerzero-views.js +2 -0
- package/dist/wasm/oft-std.d.ts +1 -0
- package/dist/wasm/oft-std.js +2 -0
- package/dist/wasm/price-feed.d.ts +1 -0
- package/dist/wasm/price-feed.js +2 -0
- package/dist/wasm/simple-message-lib.d.ts +1 -0
- package/dist/wasm/simple-message-lib.js +2 -0
- package/dist/wasm/treasury.d.ts +1 -0
- package/dist/wasm/treasury.js +2 -0
- package/dist/wasm/uln302.d.ts +1 -0
- package/dist/wasm/uln302.js +2 -0
- package/dist/wasm/upgrader.d.ts +1 -0
- package/dist/wasm/upgrader.js +2 -0
- package/dist/wasm.d.ts +15 -0
- package/dist/wasm.js +15 -0
- package/package.json +12 -9
- package/src/generated/bml.ts +117 -66
- package/src/generated/counter.ts +338 -191
- package/src/generated/dvn.ts +2036 -0
- package/src/generated/dvn_fee_lib.ts +693 -0
- package/src/generated/endpoint.ts +177 -80
- package/src/generated/executor.ts +228 -127
- package/src/generated/executor_fee_lib.ts +1072 -0
- package/src/generated/executor_helper.ts +163 -57
- package/src/generated/oft_std.ts +800 -246
- package/src/generated/price_feed.ts +1108 -0
- package/src/generated/sml.ts +194 -91
- package/src/generated/treasury.ts +943 -0
- package/src/generated/uln302.ts +211 -113
- package/src/generated/upgrader.ts +102 -0
- package/src/index.ts +17 -0
- package/src/wasm/blocked-message-lib.ts +2 -0
- package/src/wasm/counter.ts +2 -0
- package/src/wasm/dvn-fee-lib.ts +2 -0
- package/src/wasm/dvn.ts +2 -0
- package/src/wasm/endpoint-v2.ts +2 -0
- package/src/wasm/executor-fee-lib.ts +2 -0
- package/src/wasm/executor-helper.ts +2 -0
- package/src/wasm/executor.ts +2 -0
- package/src/wasm/layerzero-views.ts +2 -0
- package/src/wasm/oft-std.ts +2 -0
- package/src/wasm/price-feed.ts +2 -0
- package/src/wasm/simple-message-lib.ts +2 -0
- package/src/wasm/treasury.ts +2 -0
- package/src/wasm/uln302.ts +2 -0
- package/src/wasm/upgrader.ts +2 -0
- package/src/wasm.ts +15 -0
- package/test/counter-sml.test.ts +376 -0
- package/test/counter-uln.test.ts +493 -0
- package/test/{oft.test.ts → oft-sml.test.ts} +187 -323
- package/test/suites/constants.ts +22 -2
- package/test/suites/dummyContractClient.ts +169 -0
- package/test/suites/globalSetup.ts +450 -0
- package/test/suites/localnet.ts +23 -6
- package/test/upgrader.test.ts +300 -0
- package/test/utils.ts +558 -85
- package/vitest.config.ts +21 -0
- package/test/index.test.ts +0 -376
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/contract';
|
|
3
|
+
import type { u32, u64, u128, i128, Option } from '@stellar/stellar-sdk/contract';
|
|
4
|
+
export * from '@stellar/stellar-sdk';
|
|
5
|
+
export * as contract from '@stellar/stellar-sdk/contract';
|
|
6
|
+
export * as rpc from '@stellar/stellar-sdk/rpc';
|
|
7
|
+
export type MigrationData = void;
|
|
8
|
+
export declare const DvnFeeLibError: {
|
|
9
|
+
1: {
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
2: {
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
3: {
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
4: {
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* BufferReaderError: 1000-1009
|
|
24
|
+
*/
|
|
25
|
+
export declare const BufferReaderError: {
|
|
26
|
+
1000: {
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
1001: {
|
|
30
|
+
message: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* BufferWriterError: 1010-1019
|
|
35
|
+
*/
|
|
36
|
+
export declare const BufferWriterError: {
|
|
37
|
+
1010: {
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* TtlConfigurableError: 1020-1029
|
|
43
|
+
*/
|
|
44
|
+
export declare const TtlConfigurableError: {
|
|
45
|
+
1020: {
|
|
46
|
+
message: string;
|
|
47
|
+
};
|
|
48
|
+
1021: {
|
|
49
|
+
message: string;
|
|
50
|
+
};
|
|
51
|
+
1022: {
|
|
52
|
+
message: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* OwnableError: 1030-1039
|
|
57
|
+
*/
|
|
58
|
+
export declare const OwnableError: {
|
|
59
|
+
1030: {
|
|
60
|
+
message: string;
|
|
61
|
+
};
|
|
62
|
+
1031: {
|
|
63
|
+
message: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* BytesExtError: 1040-1049
|
|
68
|
+
*/
|
|
69
|
+
export declare const BytesExtError: {
|
|
70
|
+
1040: {
|
|
71
|
+
message: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* UpgradeableError: 1050-1059
|
|
76
|
+
*/
|
|
77
|
+
export declare const UpgradeableError: {
|
|
78
|
+
1050: {
|
|
79
|
+
message: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* MultisigError: 1060-1069
|
|
84
|
+
*/
|
|
85
|
+
export declare const MultisigError: {
|
|
86
|
+
1060: {
|
|
87
|
+
message: string;
|
|
88
|
+
};
|
|
89
|
+
1061: {
|
|
90
|
+
message: string;
|
|
91
|
+
};
|
|
92
|
+
1062: {
|
|
93
|
+
message: string;
|
|
94
|
+
};
|
|
95
|
+
1063: {
|
|
96
|
+
message: string;
|
|
97
|
+
};
|
|
98
|
+
1064: {
|
|
99
|
+
message: string;
|
|
100
|
+
};
|
|
101
|
+
1065: {
|
|
102
|
+
message: string;
|
|
103
|
+
};
|
|
104
|
+
1066: {
|
|
105
|
+
message: string;
|
|
106
|
+
};
|
|
107
|
+
1067: {
|
|
108
|
+
message: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export type MultisigStorage = {
|
|
112
|
+
tag: "Signers";
|
|
113
|
+
values: void;
|
|
114
|
+
} | {
|
|
115
|
+
tag: "Threshold";
|
|
116
|
+
values: void;
|
|
117
|
+
};
|
|
118
|
+
export type OwnableStorage = {
|
|
119
|
+
tag: "Owner";
|
|
120
|
+
values: void;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* TTL configuration: threshold (when to extend) and extend_to (target TTL).
|
|
124
|
+
*/
|
|
125
|
+
export interface TtlConfig {
|
|
126
|
+
/**
|
|
127
|
+
* Target TTL after extension (in ledgers).
|
|
128
|
+
*/
|
|
129
|
+
extend_to: u32;
|
|
130
|
+
/**
|
|
131
|
+
* TTL threshold that triggers extension (in ledgers).
|
|
132
|
+
*/
|
|
133
|
+
threshold: u32;
|
|
134
|
+
}
|
|
135
|
+
export type TtlConfigStorage = {
|
|
136
|
+
tag: "Frozen";
|
|
137
|
+
values: void;
|
|
138
|
+
} | {
|
|
139
|
+
tag: "Instance";
|
|
140
|
+
values: void;
|
|
141
|
+
} | {
|
|
142
|
+
tag: "Persistent";
|
|
143
|
+
values: void;
|
|
144
|
+
};
|
|
145
|
+
export type UpgradeableStorage = {
|
|
146
|
+
tag: "Migrating";
|
|
147
|
+
values: void;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* WorkerError: 1200-1299
|
|
151
|
+
*/
|
|
152
|
+
export declare const WorkerError: {
|
|
153
|
+
1200: {
|
|
154
|
+
message: string;
|
|
155
|
+
};
|
|
156
|
+
1201: {
|
|
157
|
+
message: string;
|
|
158
|
+
};
|
|
159
|
+
1202: {
|
|
160
|
+
message: string;
|
|
161
|
+
};
|
|
162
|
+
1203: {
|
|
163
|
+
message: string;
|
|
164
|
+
};
|
|
165
|
+
1204: {
|
|
166
|
+
message: string;
|
|
167
|
+
};
|
|
168
|
+
1205: {
|
|
169
|
+
message: string;
|
|
170
|
+
};
|
|
171
|
+
1206: {
|
|
172
|
+
message: string;
|
|
173
|
+
};
|
|
174
|
+
1207: {
|
|
175
|
+
message: string;
|
|
176
|
+
};
|
|
177
|
+
1208: {
|
|
178
|
+
message: string;
|
|
179
|
+
};
|
|
180
|
+
1209: {
|
|
181
|
+
message: string;
|
|
182
|
+
};
|
|
183
|
+
1210: {
|
|
184
|
+
message: string;
|
|
185
|
+
};
|
|
186
|
+
1211: {
|
|
187
|
+
message: string;
|
|
188
|
+
};
|
|
189
|
+
1212: {
|
|
190
|
+
message: string;
|
|
191
|
+
};
|
|
192
|
+
1213: {
|
|
193
|
+
message: string;
|
|
194
|
+
};
|
|
195
|
+
1214: {
|
|
196
|
+
message: string;
|
|
197
|
+
};
|
|
198
|
+
1215: {
|
|
199
|
+
message: string;
|
|
200
|
+
};
|
|
201
|
+
1216: {
|
|
202
|
+
message: string;
|
|
203
|
+
};
|
|
204
|
+
1217: {
|
|
205
|
+
message: string;
|
|
206
|
+
};
|
|
207
|
+
1218: {
|
|
208
|
+
message: string;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Parameters for DVN fee calculation.
|
|
213
|
+
*
|
|
214
|
+
* Contains all inputs needed by the fee library to calculate verification fees
|
|
215
|
+
* for cross-chain messages. Includes message parameters, common configuration,
|
|
216
|
+
* and destination-specific settings.
|
|
217
|
+
*/
|
|
218
|
+
export interface DvnFeeParams {
|
|
219
|
+
/**
|
|
220
|
+
* Number of block confirmations required.
|
|
221
|
+
*/
|
|
222
|
+
confirmations: u64;
|
|
223
|
+
/**
|
|
224
|
+
* Default fee multiplier in basis points (used if no dst-specific multiplier).
|
|
225
|
+
*/
|
|
226
|
+
default_multiplier_bps: u32;
|
|
227
|
+
/**
|
|
228
|
+
* Destination endpoint ID (chain identifier).
|
|
229
|
+
*/
|
|
230
|
+
dst_eid: u32;
|
|
231
|
+
/**
|
|
232
|
+
* Minimum fee margin in USD (scaled).
|
|
233
|
+
*/
|
|
234
|
+
floor_margin_usd: u128;
|
|
235
|
+
/**
|
|
236
|
+
* ============================================================================================
|
|
237
|
+
* Destination-Specific Configuration
|
|
238
|
+
* ============================================================================================
|
|
239
|
+
* Gas estimate for verification on destination chain.
|
|
240
|
+
*/
|
|
241
|
+
gas: u128;
|
|
242
|
+
/**
|
|
243
|
+
* Destination-specific fee multiplier in basis points (0 = use default).
|
|
244
|
+
*/
|
|
245
|
+
multiplier_bps: u32;
|
|
246
|
+
/**
|
|
247
|
+
* DVN options
|
|
248
|
+
*/
|
|
249
|
+
options: Buffer;
|
|
250
|
+
/**
|
|
251
|
+
* ============================================================================================
|
|
252
|
+
* Common Configuration
|
|
253
|
+
* ============================================================================================
|
|
254
|
+
* Price feed contract address for gas price and exchange rate data.
|
|
255
|
+
*/
|
|
256
|
+
price_feed: string;
|
|
257
|
+
/**
|
|
258
|
+
* Number of required signatures (quorum).
|
|
259
|
+
*/
|
|
260
|
+
quorum: u32;
|
|
261
|
+
/**
|
|
262
|
+
* ============================================================================================
|
|
263
|
+
* Message Parameters
|
|
264
|
+
* ============================================================================================
|
|
265
|
+
* The OApp sender address.
|
|
266
|
+
*/
|
|
267
|
+
sender: string;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Parameters for executor fee calculation.
|
|
271
|
+
*
|
|
272
|
+
* Contains all inputs needed by the fee library to calculate execution fees
|
|
273
|
+
* for cross-chain messages. Includes message parameters, common configuration,
|
|
274
|
+
* and destination-specific settings.
|
|
275
|
+
*/
|
|
276
|
+
export interface FeeParams {
|
|
277
|
+
/**
|
|
278
|
+
* Size of the message calldata in bytes.
|
|
279
|
+
*/
|
|
280
|
+
calldata_size: u32;
|
|
281
|
+
/**
|
|
282
|
+
* Default fee multiplier in basis points (used if no dst-specific multiplier).
|
|
283
|
+
*/
|
|
284
|
+
default_multiplier_bps: u32;
|
|
285
|
+
/**
|
|
286
|
+
* Destination endpoint ID (chain identifier).
|
|
287
|
+
*/
|
|
288
|
+
dst_eid: u32;
|
|
289
|
+
/**
|
|
290
|
+
* Minimum fee margin in USD (scaled).
|
|
291
|
+
*/
|
|
292
|
+
floor_margin_usd: u128;
|
|
293
|
+
/**
|
|
294
|
+
* Base gas for each lzCompose call on destination chain.
|
|
295
|
+
*/
|
|
296
|
+
lz_compose_base_gas: u64;
|
|
297
|
+
/**
|
|
298
|
+
* ============================================================================================
|
|
299
|
+
* Destination-Specific Configuration
|
|
300
|
+
* ============================================================================================
|
|
301
|
+
* Base gas for lzReceive execution on destination chain.
|
|
302
|
+
*/
|
|
303
|
+
lz_receive_base_gas: u64;
|
|
304
|
+
/**
|
|
305
|
+
* Destination-specific fee multiplier in basis points (0 = use default).
|
|
306
|
+
*/
|
|
307
|
+
multiplier_bps: u32;
|
|
308
|
+
/**
|
|
309
|
+
* Maximum native token value that can be sent.
|
|
310
|
+
*/
|
|
311
|
+
native_cap: u128;
|
|
312
|
+
/**
|
|
313
|
+
* Encoded executor options (lzReceive gas, lzCompose, nativeDrop, etc.).
|
|
314
|
+
*/
|
|
315
|
+
options: Buffer;
|
|
316
|
+
/**
|
|
317
|
+
* ============================================================================================
|
|
318
|
+
* Common Configuration
|
|
319
|
+
* ============================================================================================
|
|
320
|
+
* Price feed contract address for gas price and exchange rate data.
|
|
321
|
+
*/
|
|
322
|
+
price_feed: string;
|
|
323
|
+
/**
|
|
324
|
+
* ============================================================================================
|
|
325
|
+
* Message Parameters
|
|
326
|
+
* ============================================================================================
|
|
327
|
+
* The OApp sender address.
|
|
328
|
+
*/
|
|
329
|
+
sender: string;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Gas price information for a destination endpoint.
|
|
333
|
+
*
|
|
334
|
+
* Contains the exchange rate and gas costs needed for cross-chain fee calculations.
|
|
335
|
+
*/
|
|
336
|
+
export interface Price {
|
|
337
|
+
/**
|
|
338
|
+
* Gas cost per byte of calldata on the destination chain.
|
|
339
|
+
*/
|
|
340
|
+
gas_per_byte: u32;
|
|
341
|
+
/**
|
|
342
|
+
* Gas price in the smallest unit (wei for EVM, stroops for Stellar).
|
|
343
|
+
*/
|
|
344
|
+
gas_price_in_unit: u64;
|
|
345
|
+
/**
|
|
346
|
+
* Price ratio = (remote native token price / local native token price) * PRICE_RATIO_DENOMINATOR.
|
|
347
|
+
* Used to convert destination chain gas costs to source chain native token.
|
|
348
|
+
*/
|
|
349
|
+
price_ratio: u128;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Fee estimation result with detailed breakdown.
|
|
353
|
+
*
|
|
354
|
+
* Contains the calculated fee and all intermediate values used in the calculation.
|
|
355
|
+
*/
|
|
356
|
+
export interface FeeEstimate {
|
|
357
|
+
/**
|
|
358
|
+
* Source chain native token price in USD (scaled).
|
|
359
|
+
*/
|
|
360
|
+
native_price_usd: u128;
|
|
361
|
+
/**
|
|
362
|
+
* Price ratio used for the calculation.
|
|
363
|
+
*/
|
|
364
|
+
price_ratio: u128;
|
|
365
|
+
/**
|
|
366
|
+
* Denominator for the price ratio (typically 10^20).
|
|
367
|
+
*/
|
|
368
|
+
price_ratio_denominator: u128;
|
|
369
|
+
/**
|
|
370
|
+
* Total gas fee in source chain native token units.
|
|
371
|
+
*/
|
|
372
|
+
total_gas_fee: i128;
|
|
373
|
+
}
|
|
374
|
+
export type WorkerStorage = {
|
|
375
|
+
tag: "Paused";
|
|
376
|
+
values: void;
|
|
377
|
+
} | {
|
|
378
|
+
tag: "DepositAddress";
|
|
379
|
+
values: void;
|
|
380
|
+
} | {
|
|
381
|
+
tag: "PriceFeed";
|
|
382
|
+
values: void;
|
|
383
|
+
} | {
|
|
384
|
+
tag: "WorkerFeeLib";
|
|
385
|
+
values: void;
|
|
386
|
+
} | {
|
|
387
|
+
tag: "DefaultMultiplierBps";
|
|
388
|
+
values: void;
|
|
389
|
+
} | {
|
|
390
|
+
tag: "SupportedOptionTypes";
|
|
391
|
+
values: readonly [u32];
|
|
392
|
+
} | {
|
|
393
|
+
tag: "MessageLibs";
|
|
394
|
+
values: void;
|
|
395
|
+
} | {
|
|
396
|
+
tag: "Allowlist";
|
|
397
|
+
values: readonly [string];
|
|
398
|
+
} | {
|
|
399
|
+
tag: "Denylist";
|
|
400
|
+
values: readonly [string];
|
|
401
|
+
} | {
|
|
402
|
+
tag: "AllowlistSize";
|
|
403
|
+
values: void;
|
|
404
|
+
} | {
|
|
405
|
+
tag: "Admins";
|
|
406
|
+
values: void;
|
|
407
|
+
};
|
|
408
|
+
export interface Client {
|
|
409
|
+
/**
|
|
410
|
+
* Construct and simulate a upgrade transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
411
|
+
*/
|
|
412
|
+
upgrade: ({ new_wasm_hash }: {
|
|
413
|
+
new_wasm_hash: Buffer;
|
|
414
|
+
}, txnOptions?: {
|
|
415
|
+
/**
|
|
416
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
417
|
+
*/
|
|
418
|
+
fee?: number;
|
|
419
|
+
/**
|
|
420
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
421
|
+
*/
|
|
422
|
+
timeoutInSeconds?: number;
|
|
423
|
+
/**
|
|
424
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
425
|
+
*/
|
|
426
|
+
simulate?: boolean;
|
|
427
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
428
|
+
/**
|
|
429
|
+
* Construct and simulate a migrate transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
430
|
+
*/
|
|
431
|
+
migrate: ({ migration_data }: {
|
|
432
|
+
migration_data: MigrationData;
|
|
433
|
+
}, txnOptions?: {
|
|
434
|
+
/**
|
|
435
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
436
|
+
*/
|
|
437
|
+
fee?: number;
|
|
438
|
+
/**
|
|
439
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
440
|
+
*/
|
|
441
|
+
timeoutInSeconds?: number;
|
|
442
|
+
/**
|
|
443
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
444
|
+
*/
|
|
445
|
+
simulate?: boolean;
|
|
446
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
447
|
+
/**
|
|
448
|
+
* 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.
|
|
449
|
+
*/
|
|
450
|
+
authorizer: (txnOptions?: {
|
|
451
|
+
/**
|
|
452
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
453
|
+
*/
|
|
454
|
+
fee?: number;
|
|
455
|
+
/**
|
|
456
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
457
|
+
*/
|
|
458
|
+
timeoutInSeconds?: number;
|
|
459
|
+
/**
|
|
460
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
461
|
+
*/
|
|
462
|
+
simulate?: boolean;
|
|
463
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
464
|
+
/**
|
|
465
|
+
* Construct and simulate a get_fee transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
466
|
+
*/
|
|
467
|
+
get_fee: ({ dvn, params }: {
|
|
468
|
+
dvn: string;
|
|
469
|
+
params: DvnFeeParams;
|
|
470
|
+
}, txnOptions?: {
|
|
471
|
+
/**
|
|
472
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
473
|
+
*/
|
|
474
|
+
fee?: number;
|
|
475
|
+
/**
|
|
476
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
477
|
+
*/
|
|
478
|
+
timeoutInSeconds?: number;
|
|
479
|
+
/**
|
|
480
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
481
|
+
*/
|
|
482
|
+
simulate?: boolean;
|
|
483
|
+
}) => Promise<AssembledTransaction<i128>>;
|
|
484
|
+
/**
|
|
485
|
+
* 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.
|
|
486
|
+
* Sets TTL configs for instance and persistent storage.
|
|
487
|
+
*
|
|
488
|
+
* - `None` values remove the corresponding config (disables auto-extension for that type)
|
|
489
|
+
* - Validates that `threshold <= extend_to <= MAX_TTL`
|
|
490
|
+
*
|
|
491
|
+
* # Arguments
|
|
492
|
+
* - `instance` - TTL config for instance storage
|
|
493
|
+
* - `persistent` - TTL config for persistent storage
|
|
494
|
+
*
|
|
495
|
+
* # Panics
|
|
496
|
+
* - `TtlConfigFrozen` if configs are frozen
|
|
497
|
+
* - `InvalidTtlConfig` if validation fails
|
|
498
|
+
*/
|
|
499
|
+
set_ttl_configs: ({ instance, persistent }: {
|
|
500
|
+
instance: Option<TtlConfig>;
|
|
501
|
+
persistent: Option<TtlConfig>;
|
|
502
|
+
}, txnOptions?: {
|
|
503
|
+
/**
|
|
504
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
505
|
+
*/
|
|
506
|
+
fee?: number;
|
|
507
|
+
/**
|
|
508
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
509
|
+
*/
|
|
510
|
+
timeoutInSeconds?: number;
|
|
511
|
+
/**
|
|
512
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
513
|
+
*/
|
|
514
|
+
simulate?: boolean;
|
|
515
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
516
|
+
/**
|
|
517
|
+
* 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.
|
|
518
|
+
* Returns the current TTL configs as (instance_config, persistent_config).
|
|
519
|
+
*/
|
|
520
|
+
ttl_configs: (txnOptions?: {
|
|
521
|
+
/**
|
|
522
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
523
|
+
*/
|
|
524
|
+
fee?: number;
|
|
525
|
+
/**
|
|
526
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
527
|
+
*/
|
|
528
|
+
timeoutInSeconds?: number;
|
|
529
|
+
/**
|
|
530
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
531
|
+
*/
|
|
532
|
+
simulate?: boolean;
|
|
533
|
+
}) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>>;
|
|
534
|
+
/**
|
|
535
|
+
* 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.
|
|
536
|
+
* Permanently freezes TTL configs, preventing any future modifications.
|
|
537
|
+
*
|
|
538
|
+
* This is irreversible and provides immutability guarantees to users.
|
|
539
|
+
* Emits `TtlConfigsFrozen` event.
|
|
540
|
+
*
|
|
541
|
+
* # Panics
|
|
542
|
+
* - `TtlConfigAlreadyFrozen` if already frozen
|
|
543
|
+
*/
|
|
544
|
+
freeze_ttl_configs: (txnOptions?: {
|
|
545
|
+
/**
|
|
546
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
547
|
+
*/
|
|
548
|
+
fee?: number;
|
|
549
|
+
/**
|
|
550
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
551
|
+
*/
|
|
552
|
+
timeoutInSeconds?: number;
|
|
553
|
+
/**
|
|
554
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
555
|
+
*/
|
|
556
|
+
simulate?: boolean;
|
|
557
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
558
|
+
/**
|
|
559
|
+
* 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.
|
|
560
|
+
* Returns whether TTL configs are frozen.
|
|
561
|
+
*/
|
|
562
|
+
is_ttl_configs_frozen: (txnOptions?: {
|
|
563
|
+
/**
|
|
564
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
565
|
+
*/
|
|
566
|
+
fee?: number;
|
|
567
|
+
/**
|
|
568
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
569
|
+
*/
|
|
570
|
+
timeoutInSeconds?: number;
|
|
571
|
+
/**
|
|
572
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
573
|
+
*/
|
|
574
|
+
simulate?: boolean;
|
|
575
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
576
|
+
/**
|
|
577
|
+
* 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.
|
|
578
|
+
* Extends the instance TTL.
|
|
579
|
+
*
|
|
580
|
+
* # Arguments
|
|
581
|
+
*
|
|
582
|
+
* * `threshold` - The threshold to extend the TTL (if current TTL is below this, extend).
|
|
583
|
+
* * `extend_to` - The TTL to extend to.
|
|
584
|
+
*/
|
|
585
|
+
extend_instance_ttl: ({ threshold, extend_to }: {
|
|
586
|
+
threshold: u32;
|
|
587
|
+
extend_to: u32;
|
|
588
|
+
}, txnOptions?: {
|
|
589
|
+
/**
|
|
590
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
591
|
+
*/
|
|
592
|
+
fee?: number;
|
|
593
|
+
/**
|
|
594
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
595
|
+
*/
|
|
596
|
+
timeoutInSeconds?: number;
|
|
597
|
+
/**
|
|
598
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
599
|
+
*/
|
|
600
|
+
simulate?: boolean;
|
|
601
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
602
|
+
/**
|
|
603
|
+
* 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.
|
|
604
|
+
* Returns the current owner address, or None if no owner is set.
|
|
605
|
+
*/
|
|
606
|
+
owner: (txnOptions?: {
|
|
607
|
+
/**
|
|
608
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
609
|
+
*/
|
|
610
|
+
fee?: number;
|
|
611
|
+
/**
|
|
612
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
613
|
+
*/
|
|
614
|
+
timeoutInSeconds?: number;
|
|
615
|
+
/**
|
|
616
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
617
|
+
*/
|
|
618
|
+
simulate?: boolean;
|
|
619
|
+
}) => Promise<AssembledTransaction<Option<string>>>;
|
|
620
|
+
/**
|
|
621
|
+
* 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.
|
|
622
|
+
* Transfers ownership to a new address. Requires current owner authorization.
|
|
623
|
+
*/
|
|
624
|
+
transfer_ownership: ({ new_owner }: {
|
|
625
|
+
new_owner: string;
|
|
626
|
+
}, txnOptions?: {
|
|
627
|
+
/**
|
|
628
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
629
|
+
*/
|
|
630
|
+
fee?: number;
|
|
631
|
+
/**
|
|
632
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
633
|
+
*/
|
|
634
|
+
timeoutInSeconds?: number;
|
|
635
|
+
/**
|
|
636
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
637
|
+
*/
|
|
638
|
+
simulate?: boolean;
|
|
639
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
640
|
+
/**
|
|
641
|
+
* 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.
|
|
642
|
+
* Permanently renounces ownership. Requires current owner authorization.
|
|
643
|
+
*/
|
|
644
|
+
renounce_ownership: (txnOptions?: {
|
|
645
|
+
/**
|
|
646
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
647
|
+
*/
|
|
648
|
+
fee?: number;
|
|
649
|
+
/**
|
|
650
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
651
|
+
*/
|
|
652
|
+
timeoutInSeconds?: number;
|
|
653
|
+
/**
|
|
654
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
655
|
+
*/
|
|
656
|
+
simulate?: boolean;
|
|
657
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
658
|
+
}
|
|
659
|
+
export declare class Client extends ContractClient {
|
|
660
|
+
readonly options: ContractClientOptions;
|
|
661
|
+
static deploy<T = Client>(
|
|
662
|
+
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
663
|
+
{ owner }: {
|
|
664
|
+
owner: string;
|
|
665
|
+
},
|
|
666
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
667
|
+
options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
|
|
668
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
669
|
+
wasmHash: Buffer | string;
|
|
670
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
671
|
+
salt?: Buffer | Uint8Array;
|
|
672
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
673
|
+
format?: "hex" | "base64";
|
|
674
|
+
}): Promise<AssembledTransaction<T>>;
|
|
675
|
+
constructor(options: ContractClientOptions);
|
|
676
|
+
readonly fromJSON: {
|
|
677
|
+
upgrade: (json: string) => AssembledTransaction<null>;
|
|
678
|
+
migrate: (json: string) => AssembledTransaction<null>;
|
|
679
|
+
authorizer: (json: string) => AssembledTransaction<string>;
|
|
680
|
+
get_fee: (json: string) => AssembledTransaction<bigint>;
|
|
681
|
+
set_ttl_configs: (json: string) => AssembledTransaction<null>;
|
|
682
|
+
ttl_configs: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>;
|
|
683
|
+
freeze_ttl_configs: (json: string) => AssembledTransaction<null>;
|
|
684
|
+
is_ttl_configs_frozen: (json: string) => AssembledTransaction<boolean>;
|
|
685
|
+
extend_instance_ttl: (json: string) => AssembledTransaction<null>;
|
|
686
|
+
owner: (json: string) => AssembledTransaction<Option<string>>;
|
|
687
|
+
transfer_ownership: (json: string) => AssembledTransaction<null>;
|
|
688
|
+
renounce_ownership: (json: string) => AssembledTransaction<null>;
|
|
689
|
+
};
|
|
690
|
+
}
|