@layerzerolabs/lz-sui-oft-sdk-v2 3.0.136 → 3.0.137
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/CHANGELOG.md +9 -0
- package/dist/index.cjs +379 -253
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +112 -53
- package/dist/index.d.ts +112 -53
- package/dist/index.mjs +379 -255
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/bcs/oft.ts +16 -1
- package/src/modules/oft.ts +446 -242
- package/src/types.ts +5 -0
package/dist/index.d.mts
CHANGED
|
@@ -28,6 +28,10 @@ interface OFTReceipt {
|
|
|
28
28
|
amountSentLd: bigint;
|
|
29
29
|
amountReceivedLd: bigint;
|
|
30
30
|
}
|
|
31
|
+
interface OFTInfoV1 {
|
|
32
|
+
oftPackage: string;
|
|
33
|
+
oftObject: string;
|
|
34
|
+
}
|
|
31
35
|
|
|
32
36
|
declare const OFTErrorCode: {
|
|
33
37
|
readonly EComposeMsgNotAllowed: 1;
|
|
@@ -51,12 +55,12 @@ declare const OFTErrorCode: {
|
|
|
51
55
|
* @example
|
|
52
56
|
* ```typescript
|
|
53
57
|
* // Initialize OFT instance
|
|
54
|
-
* const oft = new OFT(protocolSDK,
|
|
58
|
+
* const oft = new OFT(protocolSDK, oftCallCapId);
|
|
55
59
|
*
|
|
56
60
|
* // Send tokens cross-chain
|
|
57
61
|
* const tx = new Transaction();
|
|
58
62
|
* const coin = await oft.splitCoinMoveCall(tx, sender, amount);
|
|
59
|
-
* await oft.sendMoveCall(tx, sender,
|
|
63
|
+
* await oft.sendMoveCall(tx, sender, sendParam, coin, nativeFee, zroFee, refundAddress);
|
|
60
64
|
* tx.transferObjects([coin], sender);
|
|
61
65
|
* ...
|
|
62
66
|
*
|
|
@@ -68,31 +72,35 @@ declare class OFT {
|
|
|
68
72
|
#private;
|
|
69
73
|
/** Sui client for blockchain interactions */
|
|
70
74
|
readonly client: SuiClient;
|
|
75
|
+
/** The OFTCallCap ID */
|
|
76
|
+
readonly oftCallCapId: string;
|
|
71
77
|
/** The package ID of the OFT */
|
|
72
|
-
oftPackageId
|
|
78
|
+
private oftPackageId?;
|
|
73
79
|
/** LayerZero protocol object references (endpoint, messaging channels, etc.) */
|
|
74
80
|
private readonly objects;
|
|
75
81
|
/** The unique object ID of this OFT instance on Sui */
|
|
76
|
-
private
|
|
77
|
-
/** Admin capability object ID for privileged operations (
|
|
78
|
-
private
|
|
82
|
+
private oftObjectId?;
|
|
83
|
+
/** Admin capability object ID for privileged operations (retrieved dynamically when needed) */
|
|
84
|
+
private adminCapId?;
|
|
79
85
|
/** The Sui coin type this OFT represents (e.g., "0x123::mycoin::MYCOIN") */
|
|
80
|
-
private
|
|
86
|
+
private coinType?;
|
|
81
87
|
/** The unique object ID of the associated OApp instance on Sui */
|
|
82
|
-
private oappObjectId
|
|
88
|
+
private oappObjectId?;
|
|
83
89
|
/** Reference to the LayerZero protocol SDK for cross-chain operations */
|
|
84
90
|
private readonly protocolSDK;
|
|
91
|
+
/** The OFTInfoV1 structure */
|
|
92
|
+
private oftInfo?;
|
|
85
93
|
/**
|
|
86
94
|
* Creates a new OFT instance for interacting with an Omnichain Fungible Token
|
|
87
95
|
*
|
|
88
96
|
* @param protocolSDK - The LayerZero protocol SDK instance providing core cross-chain functionality
|
|
89
|
-
* @param
|
|
90
|
-
* @param oftObjectId -
|
|
91
|
-
* @param coinType -
|
|
92
|
-
* @param
|
|
97
|
+
* @param oftCallCapId - The OFT call capability ID used for OFT operations and accessing OFT information
|
|
98
|
+
* @param oftObjectId - Optional OFT object ID on Sui blockchain for direct OFT instance access
|
|
99
|
+
* @param coinType - Optional Sui coin type string (e.g., "0x123::mycoin::MYCOIN") that this OFT represents
|
|
100
|
+
* @param oappObjectId - Optional associated OApp object ID for cross-chain messaging operations
|
|
101
|
+
* @param adminCapId - Optional admin capability object ID for privileged operations
|
|
93
102
|
*/
|
|
94
|
-
constructor(protocolSDK: SDK,
|
|
95
|
-
oftObjectId: string, coinType: string, oappObjectId: string, // the associated oapp object id
|
|
103
|
+
constructor(protocolSDK: SDK, oftCallCapId: string, oftObjectId?: string, coinType?: string, oappObjectId?: string, // the associated oapp object id
|
|
96
104
|
adminCapId?: string);
|
|
97
105
|
/**
|
|
98
106
|
* Updates the associated OApp object ID
|
|
@@ -103,23 +111,27 @@ declare class OFT {
|
|
|
103
111
|
* Initialize an OFT instance with a treasury capability
|
|
104
112
|
* Creates a new OFT that mints its own tokens
|
|
105
113
|
* @param tx - The transaction to add the move call to
|
|
114
|
+
* @param coinType - The Sui coin type string (e.g., "0x123::mycoin::MYCOIN")
|
|
106
115
|
* @param ticket - The OFTCreationTicket object ID or TransactionArgument
|
|
116
|
+
* @param oapp - The OApp object ID or TransactionArgument
|
|
107
117
|
* @param treasury - The TreasuryCap object ID or TransactionArgument for the coin type
|
|
108
118
|
* @param metadata - The CoinMetadata object ID or TransactionArgument for the coin type
|
|
109
119
|
* @param sharedDecimals - Number of decimals to use for cross-chain operations
|
|
110
120
|
* @returns TransactionResult array containing [AdminCap, MigrationCap] - MigrationCap must be transferred or stored
|
|
111
121
|
*/
|
|
112
|
-
initOftMoveCall(tx: Transaction, ticket: string | TransactionArgument, oapp: string | TransactionArgument, treasury: string | TransactionArgument, metadata: string | TransactionArgument, sharedDecimals: number | TransactionArgument): TransactionResult;
|
|
122
|
+
initOftMoveCall(tx: Transaction, coinType: string, ticket: string | TransactionArgument, oapp: string | TransactionArgument, treasury: string | TransactionArgument, metadata: string | TransactionArgument, sharedDecimals: number | TransactionArgument): TransactionResult;
|
|
113
123
|
/**
|
|
114
124
|
* Initialize an OFT adapter instance
|
|
115
125
|
* Creates an OFT adapter that wraps an existing coin type
|
|
116
126
|
* @param tx - The transaction to add the move call to
|
|
127
|
+
* @param coinType - The Sui coin type string (e.g., "0x123::mycoin::MYCOIN")
|
|
117
128
|
* @param ticket - The OFTCreationTicket object ID or TransactionArgument
|
|
129
|
+
* @param oapp - The OApp object ID or TransactionArgument
|
|
118
130
|
* @param metadata - The CoinMetadata object ID or TransactionArgument for the coin type
|
|
119
131
|
* @param sharedDecimals - Number of decimals to use for cross-chain operations
|
|
120
132
|
* @returns TransactionResult array containing [AdminCap, MigrationCap] - MigrationCap must be transferred or stored
|
|
121
133
|
*/
|
|
122
|
-
initOftAdapterMoveCall(tx: Transaction, ticket: string | TransactionArgument, oapp: string | TransactionArgument, metadata: string | TransactionArgument, sharedDecimals: number | TransactionArgument): TransactionResult;
|
|
134
|
+
initOftAdapterMoveCall(tx: Transaction, coinType: string, ticket: string | TransactionArgument, oapp: string | TransactionArgument, metadata: string | TransactionArgument, sharedDecimals: number | TransactionArgument): TransactionResult;
|
|
123
135
|
/**
|
|
124
136
|
* Get LayerZero receive information for OFT registration
|
|
125
137
|
*
|
|
@@ -130,47 +142,55 @@ declare class OFT {
|
|
|
130
142
|
* @param composerManager - The composer manager object ID for routing compose transfers
|
|
131
143
|
* @returns TransactionResult containing serialized execution metadata for endpoint registration
|
|
132
144
|
*/
|
|
133
|
-
lzReceiveInfoMoveCall(tx: Transaction, composerManager: string | TransactionArgument): TransactionResult
|
|
145
|
+
lzReceiveInfoMoveCall(tx: Transaction, composerManager: string | TransactionArgument): Promise<TransactionResult>;
|
|
134
146
|
/**
|
|
135
147
|
* Register OFT as an OApp with LayerZero endpoint
|
|
136
148
|
* @param tx - The transaction to add the move call to
|
|
137
|
-
* @param
|
|
138
|
-
*
|
|
149
|
+
* @param coinType - The Sui coin type string (e.g., "0x123::mycoin::MYCOIN")
|
|
150
|
+
* @param oftObjectId - The OFT object ID
|
|
151
|
+
* @param oappObjectId - The OApp object ID
|
|
152
|
+
* @param composerManager - The composer manager object ID or TransactionArgument
|
|
153
|
+
* @param lzReceiveInfo - Optional LayerZero receive info as Uint8Array or TransactionArgument
|
|
139
154
|
*/
|
|
140
|
-
registerOAppMoveCall(tx: Transaction,
|
|
155
|
+
registerOAppMoveCall(tx: Transaction, coinType: string, oftObjectId: string, oappObjectId: string, composerManager: string | TransactionArgument, lzReceiveInfo?: Uint8Array | TransactionArgument): Promise<void>;
|
|
141
156
|
/**
|
|
142
157
|
* Set pause state for OFT operations
|
|
143
158
|
* @param tx - The transaction to add the move call to
|
|
144
159
|
* @param pause - Whether to pause or unpause operations
|
|
145
160
|
*/
|
|
146
|
-
setPauseMoveCall(tx: Transaction, pause: boolean | TransactionArgument): void
|
|
161
|
+
setPauseMoveCall(tx: Transaction, pause: boolean | TransactionArgument): Promise<void>;
|
|
147
162
|
/**
|
|
148
163
|
* Set fee deposit address for OFT fees
|
|
149
164
|
* @param tx - The transaction to add the move call to
|
|
150
165
|
* @param feeDepositAddress - The new fee deposit address
|
|
151
166
|
*/
|
|
152
|
-
setFeeDepositAddressMoveCall(tx: Transaction, feeDepositAddress: string | TransactionArgument): void
|
|
153
|
-
|
|
167
|
+
setFeeDepositAddressMoveCall(tx: Transaction, feeDepositAddress: string | TransactionArgument): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Set default fee basis points for OFT transfers
|
|
170
|
+
* @param tx - The transaction to add the move call to
|
|
171
|
+
* @param feeBps - Default fee rate in basis points (0-10,000, where 10,000 = 100%)
|
|
172
|
+
*/
|
|
173
|
+
setDefaultFeeBpsMoveCall(tx: Transaction, feeBps: bigint | number | string | TransactionArgument): Promise<void>;
|
|
154
174
|
/**
|
|
155
175
|
* Set fee basis points for a specific destination chain
|
|
156
176
|
* @param tx - The transaction to add the move call to
|
|
157
177
|
* @param dstEid - Destination endpoint ID
|
|
158
178
|
* @param feeBps - Fee rate in basis points (0-10,000, where 10,000 = 100%)
|
|
159
179
|
*/
|
|
160
|
-
setFeeBpsMoveCall(tx: Transaction, dstEid: number | TransactionArgument, feeBps: bigint | number | string | TransactionArgument): void
|
|
180
|
+
setFeeBpsMoveCall(tx: Transaction, dstEid: number | TransactionArgument, feeBps: bigint | number | string | TransactionArgument): Promise<void>;
|
|
161
181
|
/**
|
|
162
182
|
* Removes the fee rate for a specific destination chain
|
|
163
183
|
* @param tx - The transaction to add the move call to
|
|
164
184
|
* @param dstEid - Destination endpoint ID
|
|
165
185
|
*/
|
|
166
|
-
unsetFeeBpsMoveCall(tx: Transaction, dstEid: number | TransactionArgument): void
|
|
186
|
+
unsetFeeBpsMoveCall(tx: Transaction, dstEid: number | TransactionArgument): Promise<void>;
|
|
167
187
|
/**
|
|
168
188
|
* Migrate OFT instance to a new contract
|
|
169
189
|
* @param tx - The transaction to add the move call to
|
|
170
190
|
* @param migrationCap - Migration capability object ID or transaction argument
|
|
171
191
|
* @returns TransactionResult containing the migration ticket
|
|
172
192
|
*/
|
|
173
|
-
migrateMoveCall(tx: Transaction, migrationCap: string | TransactionArgument): TransactionResult
|
|
193
|
+
migrateMoveCall(tx: Transaction, migrationCap: string | TransactionArgument): Promise<TransactionResult>;
|
|
174
194
|
/**
|
|
175
195
|
* Set rate limit for OFT transfers
|
|
176
196
|
* @param tx - The transaction to add the move call to
|
|
@@ -179,14 +199,14 @@ declare class OFT {
|
|
|
179
199
|
* @param rateLimit - Rate limit amount
|
|
180
200
|
* @param windowSeconds - Time window in seconds
|
|
181
201
|
*/
|
|
182
|
-
setRateLimitMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument, rateLimit: bigint | number | string | TransactionArgument, windowSeconds: bigint | number | string | TransactionArgument): void
|
|
202
|
+
setRateLimitMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument, rateLimit: bigint | number | string | TransactionArgument, windowSeconds: bigint | number | string | TransactionArgument): Promise<void>;
|
|
183
203
|
/**
|
|
184
204
|
* Remove rate limit for OFT transfers
|
|
185
205
|
* @param tx - The transaction to add the move call to
|
|
186
206
|
* @param eid - Endpoint ID
|
|
187
207
|
* @param inbound - Whether this is for inbound or outbound transfers
|
|
188
208
|
*/
|
|
189
|
-
unsetRateLimitMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument): void
|
|
209
|
+
unsetRateLimitMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument): Promise<void>;
|
|
190
210
|
/**
|
|
191
211
|
* Splits specified amount of coins from user's wallet
|
|
192
212
|
* @param tx - The transaction to add the move call to
|
|
@@ -207,7 +227,9 @@ declare class OFT {
|
|
|
207
227
|
* @param nativeFee - Native token fee amount
|
|
208
228
|
* @param zroFee - ZRO token fee amount
|
|
209
229
|
* @param refundAddress - Address for fee refunds
|
|
210
|
-
* @
|
|
230
|
+
* @param validators - Optional PTB validators for transaction validation
|
|
231
|
+
* @param maxSimulationTimes - Optional maximum number of simulation attempts
|
|
232
|
+
* @returns Promise<void> - Completes when the send operation is processed
|
|
211
233
|
*/
|
|
212
234
|
sendMoveCall(tx: Transaction, sender: string, sendParam: SendParam | TransactionArgument, coinProvided: string | TransactionArgument, nativeFee: bigint | TransactionArgument, zroFee: bigint | TransactionArgument, refundAddress: string | TransactionArgument, validators?: IPTBValidator[], maxSimulationTimes?: number): Promise<void>;
|
|
213
235
|
/**
|
|
@@ -216,7 +238,7 @@ declare class OFT {
|
|
|
216
238
|
* @param call - LayerZero receive call containing the verified cross-chain message
|
|
217
239
|
* @returns TransactionResult containing the processed transfer
|
|
218
240
|
*/
|
|
219
|
-
lzReceiveMoveCall(tx: Transaction, call: string | TransactionArgument): TransactionResult
|
|
241
|
+
lzReceiveMoveCall(tx: Transaction, call: string | TransactionArgument): Promise<TransactionResult>;
|
|
220
242
|
/**
|
|
221
243
|
* Process inbound cross-chain token transfers with compose functionality
|
|
222
244
|
* @param tx - The transaction to add the move call to
|
|
@@ -225,14 +247,14 @@ declare class OFT {
|
|
|
225
247
|
* @param call - LayerZero receive call containing the verified cross-chain message
|
|
226
248
|
* @returns TransactionResult containing the processed transfer
|
|
227
249
|
*/
|
|
228
|
-
lzReceiveWithComposeMoveCall(tx: Transaction, composeQueue: string | TransactionArgument, composerManager: string | TransactionArgument, call: string | TransactionArgument): TransactionResult
|
|
250
|
+
lzReceiveWithComposeMoveCall(tx: Transaction, composeQueue: string | TransactionArgument, composerManager: string | TransactionArgument, call: string | TransactionArgument): Promise<TransactionResult>;
|
|
229
251
|
/**
|
|
230
252
|
* Confirms and extracts results from a quote operation
|
|
231
253
|
* @param tx - The transaction to add the move call to
|
|
232
254
|
* @param call - Completed Call object from quote_send() execution
|
|
233
255
|
* @returns TransactionResult containing the messaging fee
|
|
234
256
|
*/
|
|
235
|
-
confirmQuoteSendMoveCall(tx: Transaction, call: string | TransactionArgument): TransactionResult
|
|
257
|
+
confirmQuoteSendMoveCall(tx: Transaction, call: string | TransactionArgument): Promise<TransactionResult>;
|
|
236
258
|
/**
|
|
237
259
|
* Quote OFT sending operation with detailed fee breakdown
|
|
238
260
|
* @param sendParam - Send parameters for the OFT operation
|
|
@@ -248,6 +270,8 @@ declare class OFT {
|
|
|
248
270
|
* @param sender - Sender address
|
|
249
271
|
* @param sendParam - Send parameters for the OFT operation
|
|
250
272
|
* @param payInZro - Whether to pay in ZRO tokens
|
|
273
|
+
* @param validators - Optional PTB validators for transaction validation
|
|
274
|
+
* @param maxSimulationTimes - Optional maximum number of simulation attempts
|
|
251
275
|
* @returns Promise<MessagingFee> - The calculated messaging fees
|
|
252
276
|
*/
|
|
253
277
|
quoteSend(sender: string, sendParam: SendParam | TransactionArgument, payInZro: boolean | TransactionArgument, validators?: IPTBValidator[], maxSimulationTimes?: number): Promise<MessagingFee>;
|
|
@@ -256,7 +280,7 @@ declare class OFT {
|
|
|
256
280
|
* @param tx - The transaction to add the move call to
|
|
257
281
|
* @returns Transaction result containing the upgrade version
|
|
258
282
|
*/
|
|
259
|
-
upgradeVersionMoveCall(tx: Transaction): TransactionResult
|
|
283
|
+
upgradeVersionMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
260
284
|
/**
|
|
261
285
|
* Get the upgrade version of this OFT instance
|
|
262
286
|
* @returns Promise<bigint> - The upgrade version
|
|
@@ -267,7 +291,7 @@ declare class OFT {
|
|
|
267
291
|
* @param tx - The transaction to add the move call to
|
|
268
292
|
* @returns Transaction result containing the OApp object address
|
|
269
293
|
*/
|
|
270
|
-
oappObjectMoveCall(tx: Transaction): TransactionResult
|
|
294
|
+
oappObjectMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
271
295
|
/**
|
|
272
296
|
* Get the associated OApp object address
|
|
273
297
|
* @returns Promise<string> - The OApp object address
|
|
@@ -278,7 +302,7 @@ declare class OFT {
|
|
|
278
302
|
* @param tx - The transaction to add the move call to
|
|
279
303
|
* @returns Transaction result containing version information
|
|
280
304
|
*/
|
|
281
|
-
oftVersionMoveCall(tx: Transaction): TransactionResult
|
|
305
|
+
oftVersionMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
282
306
|
/**
|
|
283
307
|
* Get OFT version information
|
|
284
308
|
* @returns Promise<{ major: number; minor: number }> - The OFT version
|
|
@@ -287,14 +311,23 @@ declare class OFT {
|
|
|
287
311
|
major: number;
|
|
288
312
|
minor: number;
|
|
289
313
|
}>;
|
|
290
|
-
|
|
314
|
+
/**
|
|
315
|
+
* Get the OFT capability ID
|
|
316
|
+
* @param tx - The transaction to add the move call to
|
|
317
|
+
* @returns Transaction result containing the OFT capability ID
|
|
318
|
+
*/
|
|
319
|
+
oftCapIdMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
320
|
+
/**
|
|
321
|
+
* Get the OFT capability ID
|
|
322
|
+
* @returns Promise<string> - The OFT capability ID
|
|
323
|
+
*/
|
|
291
324
|
oftCapId(): Promise<string>;
|
|
292
325
|
/**
|
|
293
326
|
* Get the migration capability address for this OFT
|
|
294
327
|
* @param tx - The transaction to add the move call to
|
|
295
328
|
* @returns Transaction result containing the migration capability address
|
|
296
329
|
*/
|
|
297
|
-
migrationCapMoveCall(tx: Transaction): TransactionResult
|
|
330
|
+
migrationCapMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
298
331
|
/**
|
|
299
332
|
* Get the migration capability address for this OFT
|
|
300
333
|
* @returns Promise<string> - The migration capability address
|
|
@@ -306,7 +339,7 @@ declare class OFT {
|
|
|
306
339
|
* @param tx - The transaction to add the move call to
|
|
307
340
|
* @returns Transaction result containing coin metadata address
|
|
308
341
|
*/
|
|
309
|
-
coinMetadataMoveCall(tx: Transaction): TransactionResult
|
|
342
|
+
coinMetadataMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
310
343
|
/**
|
|
311
344
|
* Get coin metadata address
|
|
312
345
|
* @returns Promise<string> - The coin metadata address
|
|
@@ -317,7 +350,7 @@ declare class OFT {
|
|
|
317
350
|
* @param tx - The transaction to add the move call to
|
|
318
351
|
* @returns Transaction result containing the admin capability address
|
|
319
352
|
*/
|
|
320
|
-
adminCapMoveCall(tx: Transaction): TransactionResult
|
|
353
|
+
adminCapMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
321
354
|
/**
|
|
322
355
|
* Get OFT admin capability address
|
|
323
356
|
* @returns Promise<string> - The admin capability address
|
|
@@ -328,7 +361,7 @@ declare class OFT {
|
|
|
328
361
|
* @param tx - The transaction to add the move call to
|
|
329
362
|
* @returns Transaction result containing shared decimals
|
|
330
363
|
*/
|
|
331
|
-
sharedDecimalsMoveCall(tx: Transaction): TransactionResult
|
|
364
|
+
sharedDecimalsMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
332
365
|
/**
|
|
333
366
|
* Get shared decimals for cross-chain compatibility
|
|
334
367
|
* @returns Promise<number> - The shared decimal precision
|
|
@@ -339,7 +372,7 @@ declare class OFT {
|
|
|
339
372
|
* @param tx - The transaction to add the move call to
|
|
340
373
|
* @returns Transaction result containing the decimal conversion rate
|
|
341
374
|
*/
|
|
342
|
-
decimalConversionRateMoveCall(tx: Transaction): TransactionResult
|
|
375
|
+
decimalConversionRateMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
343
376
|
/**
|
|
344
377
|
* Get the decimal conversion rate for this OFT
|
|
345
378
|
* @returns Promise<bigint> - The decimal conversion rate multiplier
|
|
@@ -350,7 +383,7 @@ declare class OFT {
|
|
|
350
383
|
* @param tx - The transaction to add the move call to
|
|
351
384
|
* @returns Transaction result containing the paused status
|
|
352
385
|
*/
|
|
353
|
-
isPausedMoveCall(tx: Transaction): TransactionResult
|
|
386
|
+
isPausedMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
354
387
|
/**
|
|
355
388
|
* Check if OFT is paused
|
|
356
389
|
* @returns Promise<boolean> - True if OFT is paused
|
|
@@ -361,19 +394,32 @@ declare class OFT {
|
|
|
361
394
|
* @param tx - The transaction to add the move call to
|
|
362
395
|
* @returns Transaction result containing the adapter status
|
|
363
396
|
*/
|
|
364
|
-
isAdapterMoveCall(tx: Transaction): TransactionResult
|
|
397
|
+
isAdapterMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
365
398
|
/**
|
|
366
399
|
* Check if this OFT is an adapter (wraps existing token)
|
|
367
400
|
* @returns Promise<boolean> - True if this is an OFT adapter
|
|
368
401
|
*/
|
|
369
402
|
isAdapter(): Promise<boolean>;
|
|
403
|
+
/**
|
|
404
|
+
* Decode OFTInfoV1 from encoded bytes
|
|
405
|
+
* @param tx - The transaction to add the move call to
|
|
406
|
+
* @param encodedBytes - The encoded OFTInfoV1 bytes to decode
|
|
407
|
+
* @returns Transaction result containing the decoded OFTInfoV1
|
|
408
|
+
*/
|
|
409
|
+
decodeOftInfoV1MoveCall(tx: Transaction, encodedBytes: Uint8Array | TransactionArgument): TransactionResult;
|
|
410
|
+
/**
|
|
411
|
+
* Decode OFTInfoV1 from encoded bytes
|
|
412
|
+
* @param encodedBytes - The encoded OFTInfoV1 bytes to decode
|
|
413
|
+
* @returns Promise<OFTInfoV1> - The decoded OFTInfoV1 structure
|
|
414
|
+
*/
|
|
415
|
+
decodeOftInfoV1(encodedBytes: Uint8Array): Promise<OFTInfoV1>;
|
|
370
416
|
/**
|
|
371
417
|
* Check if the OFT has a fee rate greater than 0 for the specified destination
|
|
372
418
|
* @param tx - The transaction to add the move call to
|
|
373
419
|
* @param dstEid - Destination endpoint ID
|
|
374
420
|
* @returns Transaction result containing whether fee exists
|
|
375
421
|
*/
|
|
376
|
-
hasOftFeeMoveCall(tx: Transaction, dstEid: number | TransactionArgument): TransactionResult
|
|
422
|
+
hasOftFeeMoveCall(tx: Transaction, dstEid: number | TransactionArgument): Promise<TransactionResult>;
|
|
377
423
|
/**
|
|
378
424
|
* Check if the OFT has a fee rate greater than 0 for the specified destination
|
|
379
425
|
* @param dstEid - Destination endpoint ID
|
|
@@ -386,7 +432,7 @@ declare class OFT {
|
|
|
386
432
|
* @param dstEid - Destination endpoint ID
|
|
387
433
|
* @returns Transaction result containing the effective fee basis points
|
|
388
434
|
*/
|
|
389
|
-
effectiveFeeBpsMoveCall(tx: Transaction, dstEid: number | TransactionArgument): TransactionResult
|
|
435
|
+
effectiveFeeBpsMoveCall(tx: Transaction, dstEid: number | TransactionArgument): Promise<TransactionResult>;
|
|
390
436
|
/**
|
|
391
437
|
* Get the effective fee rate for a specific destination chain
|
|
392
438
|
* @param dstEid - Destination endpoint ID
|
|
@@ -398,7 +444,7 @@ declare class OFT {
|
|
|
398
444
|
* @param tx - The transaction to add the move call to
|
|
399
445
|
* @returns Transaction result containing the default fee basis points
|
|
400
446
|
*/
|
|
401
|
-
defaultFeeBpsMoveCall(tx: Transaction): TransactionResult
|
|
447
|
+
defaultFeeBpsMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
402
448
|
/**
|
|
403
449
|
* Get the default fee rate
|
|
404
450
|
* @returns Promise<bigint> - The default fee in basis points
|
|
@@ -410,7 +456,7 @@ declare class OFT {
|
|
|
410
456
|
* @param dstEid - Destination endpoint ID
|
|
411
457
|
* @returns Transaction result containing the fee basis points
|
|
412
458
|
*/
|
|
413
|
-
feeBpsMoveCall(tx: Transaction, dstEid: number | TransactionArgument): TransactionResult
|
|
459
|
+
feeBpsMoveCall(tx: Transaction, dstEid: number | TransactionArgument): Promise<TransactionResult>;
|
|
414
460
|
/**
|
|
415
461
|
* Get fee basis points for a specific destination chain
|
|
416
462
|
* @param dstEid - Destination endpoint ID
|
|
@@ -422,7 +468,7 @@ declare class OFT {
|
|
|
422
468
|
* @param tx - The transaction to add the move call to
|
|
423
469
|
* @returns Transaction result containing the fee deposit address
|
|
424
470
|
*/
|
|
425
|
-
feeDepositAddressMoveCall(tx: Transaction): TransactionResult
|
|
471
|
+
feeDepositAddressMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
426
472
|
/**
|
|
427
473
|
* Get fee deposit address for OFT
|
|
428
474
|
* @returns Promise<string> - The fee deposit address
|
|
@@ -435,7 +481,7 @@ declare class OFT {
|
|
|
435
481
|
* @param inbound - Whether this is for inbound or outbound transfers
|
|
436
482
|
* @returns Transaction result containing rate limit configuration
|
|
437
483
|
*/
|
|
438
|
-
rateLimitConfigMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument): TransactionResult
|
|
484
|
+
rateLimitConfigMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument): Promise<TransactionResult>;
|
|
439
485
|
/**
|
|
440
486
|
* Get rate limit configuration for an endpoint
|
|
441
487
|
* @param eid - Endpoint ID
|
|
@@ -453,7 +499,7 @@ declare class OFT {
|
|
|
453
499
|
* @param inbound - Whether this is for inbound or outbound transfers
|
|
454
500
|
* @returns Transaction result containing in-flight amount
|
|
455
501
|
*/
|
|
456
|
-
rateLimitInFlightMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument): TransactionResult
|
|
502
|
+
rateLimitInFlightMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument): Promise<TransactionResult>;
|
|
457
503
|
/**
|
|
458
504
|
* Get current in-flight amount for rate limiting
|
|
459
505
|
* @param eid - Endpoint ID
|
|
@@ -468,7 +514,7 @@ declare class OFT {
|
|
|
468
514
|
* @param inbound - Whether this is for inbound or outbound transfers
|
|
469
515
|
* @returns Transaction result containing rate limit capacity
|
|
470
516
|
*/
|
|
471
|
-
rateLimitCapacityMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument): TransactionResult
|
|
517
|
+
rateLimitCapacityMoveCall(tx: Transaction, eid: number | TransactionArgument, inbound: boolean | TransactionArgument): Promise<TransactionResult>;
|
|
472
518
|
/**
|
|
473
519
|
* Get rate limit capacity (remaining available amount)
|
|
474
520
|
* @param eid - Endpoint ID
|
|
@@ -476,7 +522,12 @@ declare class OFT {
|
|
|
476
522
|
* @returns Promise<bigint> - Remaining rate limit capacity
|
|
477
523
|
*/
|
|
478
524
|
rateLimitCapacity(eid: number, inbound: boolean): Promise<bigint>;
|
|
479
|
-
|
|
525
|
+
/**
|
|
526
|
+
* Create a transaction sender object for OFT operations
|
|
527
|
+
* @param tx - The transaction to add the move call to
|
|
528
|
+
* @returns Transaction result containing the transaction sender object
|
|
529
|
+
*/
|
|
530
|
+
txSenderMoveCall(tx: Transaction): Promise<TransactionResult>;
|
|
480
531
|
}
|
|
481
532
|
|
|
482
533
|
declare const OFTComposerManagerErrorCode: {
|
|
@@ -553,8 +604,16 @@ declare const OFTReceiptBcs: _mysten_sui_dist_cjs_bcs.BcsType<{
|
|
|
553
604
|
amount_sent_ld: string | number | bigint;
|
|
554
605
|
amount_received_ld: string | number | bigint;
|
|
555
606
|
}>;
|
|
607
|
+
declare const OFTInfoV1Bcs: _mysten_sui_dist_cjs_bcs.BcsType<{
|
|
608
|
+
oft_package: string;
|
|
609
|
+
oft_object: string;
|
|
610
|
+
}, {
|
|
611
|
+
oft_package: any;
|
|
612
|
+
oft_object: any;
|
|
613
|
+
}>;
|
|
556
614
|
declare function parseOFTLimit(data: Uint8Array): OFTLimit;
|
|
557
615
|
declare function parseOFTFeeDetails(data: Uint8Array): OFTFeeDetail[];
|
|
558
616
|
declare function parseOFTReceipt(data: Uint8Array): OFTReceipt;
|
|
617
|
+
declare function parseOFTInfoV1(data: Uint8Array): OFTInfoV1;
|
|
559
618
|
|
|
560
|
-
export { OFT, OFTComposerManager, OFTComposerManagerErrorCode, OFTErrorCode, type OFTFeeDetail, OFTFeeDetailBcs, type OFTLimit, OFTLimitBcs, OFTMsgType, type OFTReceipt, OFTReceiptBcs, type SendParam, parseOFTFeeDetails, parseOFTLimit, parseOFTReceipt };
|
|
619
|
+
export { OFT, OFTComposerManager, OFTComposerManagerErrorCode, OFTErrorCode, type OFTFeeDetail, OFTFeeDetailBcs, type OFTInfoV1, OFTInfoV1Bcs, type OFTLimit, OFTLimitBcs, OFTMsgType, type OFTReceipt, OFTReceiptBcs, type SendParam, parseOFTFeeDetails, parseOFTInfoV1, parseOFTLimit, parseOFTReceipt };
|