@ember-finance/sdk 2.21.0-ccip.0 → 2.21.0
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/src/abis/index.d.ts +1 -3
- package/dist/src/abis/index.js +1 -4
- package/dist/src/api/v2/models/account-transaction-transaction-data.d.ts +1 -2
- package/dist/src/api/v2/models/account-transaction.d.ts +0 -2
- package/dist/src/api/v2/models/account-transaction.js +1 -3
- package/dist/src/api/v2/models/chain.d.ts +0 -6
- package/dist/src/api/v2/models/evm-contracts.d.ts +0 -9
- package/dist/src/api/v2/models/evm-oftadapter.d.ts +0 -11
- package/dist/src/api/v2/models/evm-oftadapter.js +1 -4
- package/dist/src/api/v2/models/evm-oftpeer.d.ts +0 -12
- package/dist/src/api/v2/models/index.d.ts +0 -4
- package/dist/src/api/v2/models/index.js +0 -4
- package/dist/src/evm-vaults/interfaces/index.d.ts +0 -39
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.d.ts +1 -15
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.js +0 -36
- package/dist/src/evm-vaults/on-chain-calls/user.d.ts +1 -40
- package/dist/src/evm-vaults/on-chain-calls/user.js +0 -75
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.d.ts +1 -14
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.js +0 -30
- package/dist/src/evm-vaults/utils/deployment-parser.d.ts +1 -46
- package/dist/src/evm-vaults/utils/deployment-parser.js +0 -74
- package/dist/src/evm-vaults/utils/index.d.ts +0 -1
- package/dist/src/evm-vaults/utils/index.js +0 -1
- package/dist/src/sui-vaults/on-chain-calls/operator.d.ts +0 -63
- package/dist/src/sui-vaults/on-chain-calls/operator.js +0 -90
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +0 -120
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +6 -357
- package/dist/src/sui-vaults/on-chain-calls/user.d.ts +0 -58
- package/dist/src/sui-vaults/on-chain-calls/user.js +3 -96
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +0 -21
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.js +0 -32
- package/package.json +1 -1
- package/dist/src/abis/CcipRouter.json +0 -58
- package/dist/src/api/v2/models/bridge-transaction.d.ts +0 -50
- package/dist/src/api/v2/models/bridge-transaction.js +0 -14
- package/dist/src/api/v2/models/evm-ccip-lane.d.ts +0 -73
- package/dist/src/api/v2/models/evm-ccip-lane.js +0 -14
- package/dist/src/api/v2/models/evm-ccip-rate-limits.d.ts +0 -36
- package/dist/src/api/v2/models/evm-ccip-rate-limits.js +0 -14
- package/dist/src/api/v2/models/evm-ccip-token-pool.d.ts +0 -122
- package/dist/src/api/v2/models/evm-ccip-token-pool.js +0 -17
- package/dist/src/evm-vaults/utils/ccip.d.ts +0 -23
- package/dist/src/evm-vaults/utils/ccip.js +0 -32
|
@@ -206,78 +206,4 @@ export class EVMDeploymentParser {
|
|
|
206
206
|
}
|
|
207
207
|
return entry;
|
|
208
208
|
}
|
|
209
|
-
/**
|
|
210
|
-
* Finds the CCIP token pool entry for a given vault address.
|
|
211
|
-
* @param vaultAddress The vault address (receipt token address in EVM deployment data)
|
|
212
|
-
*/
|
|
213
|
-
getCcipTokenPoolByVaultAddress(vaultAddress) {
|
|
214
|
-
return Object.values(this.deployment.contracts?.ccipTokenPools ?? {}).find(pool => pool.vaultAddress?.toLowerCase() === vaultAddress.toLowerCase());
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Reports which bridge a vault uses, or undefined if it has none.
|
|
218
|
-
*
|
|
219
|
-
* A vault has exactly one active bridge, but different vaults use different
|
|
220
|
-
* ones, so call this before choosing between the LayerZero and CCIP send
|
|
221
|
-
* methods rather than assuming either.
|
|
222
|
-
*
|
|
223
|
-
* @param vaultAddress The vault address (receipt token address in EVM deployment data)
|
|
224
|
-
*/
|
|
225
|
-
getBridgeTransportByVaultAddress(vaultAddress) {
|
|
226
|
-
if (this.getCcipTokenPoolByVaultAddress(vaultAddress))
|
|
227
|
-
return "CCIP";
|
|
228
|
-
if (this.getOFTAdapterObjectByVaultAddress(vaultAddress))
|
|
229
|
-
return "LayerZero";
|
|
230
|
-
return undefined;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Lists the networks a vault can bridge to, whichever transport it uses.
|
|
234
|
-
*
|
|
235
|
-
* Returns an empty array for a vault with no bridge, so it is safe to render
|
|
236
|
-
* directly. Names are as the deployment records them, which is what
|
|
237
|
-
* bridgeSendTokenViaCcip takes as its destination.
|
|
238
|
-
*
|
|
239
|
-
* @param vaultAddress The vault address (receipt token address in EVM deployment data)
|
|
240
|
-
*/
|
|
241
|
-
getBridgeDestinationsByVaultAddress(vaultAddress) {
|
|
242
|
-
// Both transports record the far end the same way, under remoteNetwork,
|
|
243
|
-
// but one keys its map by CCIP chain selector and the other by LayerZero
|
|
244
|
-
// endpoint id — neither of which a caller has any way to resolve. Reading
|
|
245
|
-
// the values rather than the keys is what keeps the two symmetric.
|
|
246
|
-
const pool = this.getCcipTokenPoolByVaultAddress(vaultAddress);
|
|
247
|
-
const adapter = this.getOFTAdapterObjectByVaultAddress(vaultAddress);
|
|
248
|
-
const networks = [
|
|
249
|
-
...Object.values(pool?.lanes ?? {}),
|
|
250
|
-
...Object.values(adapter?.peers ?? {})
|
|
251
|
-
]
|
|
252
|
-
.map(entry => entry.remoteNetwork)
|
|
253
|
-
.filter((network) => !!network);
|
|
254
|
-
return [...new Set(networks)];
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Finds the configured CCIP lane from a vault to a destination chain selector.
|
|
258
|
-
*
|
|
259
|
-
* A missing lane means the route is not configured and a send would revert.
|
|
260
|
-
*
|
|
261
|
-
* @param vaultAddress The vault address on the source chain
|
|
262
|
-
* @param remoteChainSelector The destination CCIP chain selector
|
|
263
|
-
*/
|
|
264
|
-
getCcipLaneByVaultAndSelector(vaultAddress, remoteChainSelector) {
|
|
265
|
-
// Lanes are keyed by selector, so this is a direct hit rather than the
|
|
266
|
-
// scan the by-network lookup has to do.
|
|
267
|
-
return this.getCcipTokenPoolByVaultAddress(vaultAddress)?.lanes?.[remoteChainSelector];
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Finds the configured CCIP lane from a vault to a destination network.
|
|
271
|
-
*
|
|
272
|
-
* Lanes are keyed by the destination's CCIP chain selector, which nothing
|
|
273
|
-
* outside CCIP knows, so this looks the lane up by network name instead.
|
|
274
|
-
* A missing lane means the route is not configured — sending would revert.
|
|
275
|
-
*
|
|
276
|
-
* @param vaultAddress The vault address on the source chain
|
|
277
|
-
* @param destinationNetwork The destination network name, e.g. "atlantic"
|
|
278
|
-
*/
|
|
279
|
-
getCcipLaneByVaultAndNetwork(vaultAddress, destinationNetwork) {
|
|
280
|
-
const pool = this.getCcipTokenPoolByVaultAddress(vaultAddress);
|
|
281
|
-
return Object.values(pool?.lanes ?? {}).find(lane => lane.remoteNetwork?.toLowerCase() === destinationNetwork.toLowerCase());
|
|
282
|
-
}
|
|
283
209
|
}
|
|
@@ -197,19 +197,6 @@ export declare class OperatorCalls extends OnChainCalls {
|
|
|
197
197
|
* @returns OnChainCallResponse
|
|
198
198
|
*/
|
|
199
199
|
atomicWithdrawSuilendSecondaryCollateralSui(vaultId: string, poolCoinType: string, lendingMarketId: string, subAccount: string, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
200
|
-
/**
|
|
201
|
-
* Collect accrued AlphaLend rewards into an allowlisted sub-account. Call
|
|
202
|
-
* once per reward type BEFORE exiting the strategy — the exit burns the
|
|
203
|
-
* PositionCap and strands anything uncollected. Requires an AlphaLend Pyth
|
|
204
|
-
* price refresh earlier in the same PTB. `rewardType` must not be SUI.
|
|
205
|
-
* @param vaultId The id of the atomic vault
|
|
206
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
207
|
-
* @param rewardType Coin type of the reward being collected
|
|
208
|
-
* @param subAccount Allowlisted sub-account to receive the reward
|
|
209
|
-
* @param options Optional tx execution params
|
|
210
|
-
* @returns OnChainCallResponse
|
|
211
|
-
*/
|
|
212
|
-
atomicCollectAlphalendStrategyReward(vaultId: string, lendingProtocolId: string, rewardType: string, subAccount: string, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
213
200
|
/**
|
|
214
201
|
* Supply collateral from an atomic vault into the Suilend strategy
|
|
215
202
|
* @param vaultId The id of the atomic vault
|
|
@@ -220,15 +207,6 @@ export declare class OperatorCalls extends OnChainCalls {
|
|
|
220
207
|
* @returns OnChainCallResponse
|
|
221
208
|
*/
|
|
222
209
|
atomicSupplyToSuilendStrategy(vaultId: string, poolCoinType: string, lendingMarketId: string, amount: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
223
|
-
/**
|
|
224
|
-
* Supply collateral from an atomic vault into the AlphaLend strategy
|
|
225
|
-
* @param vaultId The id of the atomic vault
|
|
226
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
227
|
-
* @param amount The amount to supply
|
|
228
|
-
* @param options Optional tx execution params
|
|
229
|
-
* @returns OnChainCallResponse
|
|
230
|
-
*/
|
|
231
|
-
atomicSupplyToAlphalendStrategy(vaultId: string, lendingProtocolId: string, amount: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
232
210
|
/**
|
|
233
211
|
* Withdraw collateral from the Suilend strategy back into an atomic vault
|
|
234
212
|
* @param vaultId The id of the atomic vault
|
|
@@ -239,15 +217,6 @@ export declare class OperatorCalls extends OnChainCalls {
|
|
|
239
217
|
* @returns OnChainCallResponse
|
|
240
218
|
*/
|
|
241
219
|
atomicWithdrawFromSuilendStrategy(vaultId: string, poolCoinType: string, lendingMarketId: string, amount: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
242
|
-
/**
|
|
243
|
-
* Withdraw collateral from the AlphaLend strategy back into an atomic vault
|
|
244
|
-
* @param vaultId The id of the atomic vault
|
|
245
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
246
|
-
* @param amount The amount to withdraw
|
|
247
|
-
* @param options Optional tx execution params
|
|
248
|
-
* @returns OnChainCallResponse
|
|
249
|
-
*/
|
|
250
|
-
atomicWithdrawFromAlphalendStrategy(vaultId: string, lendingProtocolId: string, amount: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
251
220
|
/**
|
|
252
221
|
* Supply collateral from an atomic vault to one of its sub accounts
|
|
253
222
|
* @param vaultId The id of the atomic vault
|
|
@@ -322,16 +291,6 @@ export declare class OperatorCalls extends OnChainCalls {
|
|
|
322
291
|
* @returns OnChainCallResponse
|
|
323
292
|
*/
|
|
324
293
|
atomicSetStrategyNoneFromSuilendSui(vaultId: string, poolCoinType: string, lendingMarketId: string, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
325
|
-
/**
|
|
326
|
-
* Exits the AlphaLend strategy on a SUI-collateral vault
|
|
327
|
-
* @param vaultId Id of the atomic vault (collateral must be SUI)
|
|
328
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
329
|
-
* @param acceptResidual Abandon a dust residual rather than aborting the
|
|
330
|
-
* exit. Only pass true deliberately: the residual is forfeited.
|
|
331
|
-
* @param options Optional tx execution params
|
|
332
|
-
* @returns OnChainCallResponse
|
|
333
|
-
*/
|
|
334
|
-
atomicSetStrategyNoneFromAlphalendSui(vaultId: string, lendingProtocolId: string, acceptResidual: boolean, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
335
294
|
/**
|
|
336
295
|
* Withdraws collateral from the Suilend strategy on a SUI-collateral vault
|
|
337
296
|
* @param vaultId Id of the atomic vault (collateral must be SUI)
|
|
@@ -342,26 +301,4 @@ export declare class OperatorCalls extends OnChainCalls {
|
|
|
342
301
|
* @returns OnChainCallResponse
|
|
343
302
|
*/
|
|
344
303
|
atomicWithdrawFromSuilendStrategySui(vaultId: string, poolCoinType: string, lendingMarketId: string, amount: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
345
|
-
/**
|
|
346
|
-
* Withdraws collateral from the AlphaLend strategy on a SUI-collateral vault
|
|
347
|
-
* @param vaultId Id of the atomic vault (collateral must be SUI)
|
|
348
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
349
|
-
* @param amount Amount of collateral to withdraw, in base units
|
|
350
|
-
* @param options Optional tx execution params
|
|
351
|
-
* @returns OnChainCallResponse
|
|
352
|
-
*/
|
|
353
|
-
atomicWithdrawFromAlphalendStrategySui(vaultId: string, lendingProtocolId: string, amount: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
354
|
-
/**
|
|
355
|
-
* Collects accrued AlphaLend rewards through the SUI system state and
|
|
356
|
-
* forwards them to an allowlisted sub-account.
|
|
357
|
-
*
|
|
358
|
-
* Call before exiting the strategy — the exit burns the `PositionCap` and
|
|
359
|
-
* strands anything uncollected.
|
|
360
|
-
* @param vaultId Id of the atomic vault
|
|
361
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
362
|
-
* @param subAccount Allowlisted sub-account to receive the rewards
|
|
363
|
-
* @param options Optional tx execution params
|
|
364
|
-
* @returns OnChainCallResponse
|
|
365
|
-
*/
|
|
366
|
-
atomicCollectAlphalendStrategyRewardSui(vaultId: string, lendingProtocolId: string, subAccount: string, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
367
304
|
}
|
|
@@ -323,23 +323,6 @@ export class OperatorCalls extends OnChainCalls {
|
|
|
323
323
|
this.txBuilder.atomicWithdrawSuilendSecondaryCollateralSui(vaultId, poolCoinType, lendingMarketId, subAccount, { ...options, txBlock: txb });
|
|
324
324
|
return this.execCall(txb, options);
|
|
325
325
|
}
|
|
326
|
-
/**
|
|
327
|
-
* Collect accrued AlphaLend rewards into an allowlisted sub-account. Call
|
|
328
|
-
* once per reward type BEFORE exiting the strategy — the exit burns the
|
|
329
|
-
* PositionCap and strands anything uncollected. Requires an AlphaLend Pyth
|
|
330
|
-
* price refresh earlier in the same PTB. `rewardType` must not be SUI.
|
|
331
|
-
* @param vaultId The id of the atomic vault
|
|
332
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
333
|
-
* @param rewardType Coin type of the reward being collected
|
|
334
|
-
* @param subAccount Allowlisted sub-account to receive the reward
|
|
335
|
-
* @param options Optional tx execution params
|
|
336
|
-
* @returns OnChainCallResponse
|
|
337
|
-
*/
|
|
338
|
-
async atomicCollectAlphalendStrategyReward(vaultId, lendingProtocolId, rewardType, subAccount, options) {
|
|
339
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
340
|
-
this.txBuilder.atomicCollectAlphalendStrategyReward(vaultId, lendingProtocolId, rewardType, subAccount, { ...options, txBlock: txb });
|
|
341
|
-
return this.execCall(txb, options);
|
|
342
|
-
}
|
|
343
326
|
/**
|
|
344
327
|
* Supply collateral from an atomic vault into the Suilend strategy
|
|
345
328
|
* @param vaultId The id of the atomic vault
|
|
@@ -354,22 +337,6 @@ export class OperatorCalls extends OnChainCalls {
|
|
|
354
337
|
this.txBuilder.atomicSupplyToSuilendStrategy(vaultId, poolCoinType, lendingMarketId, amount, { ...options, txBlock: txb });
|
|
355
338
|
return this.execCall(txb, options);
|
|
356
339
|
}
|
|
357
|
-
/**
|
|
358
|
-
* Supply collateral from an atomic vault into the AlphaLend strategy
|
|
359
|
-
* @param vaultId The id of the atomic vault
|
|
360
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
361
|
-
* @param amount The amount to supply
|
|
362
|
-
* @param options Optional tx execution params
|
|
363
|
-
* @returns OnChainCallResponse
|
|
364
|
-
*/
|
|
365
|
-
async atomicSupplyToAlphalendStrategy(vaultId, lendingProtocolId, amount, options) {
|
|
366
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
367
|
-
this.txBuilder.atomicSupplyToAlphalendStrategy(vaultId, lendingProtocolId, amount, {
|
|
368
|
-
...options,
|
|
369
|
-
txBlock: txb
|
|
370
|
-
});
|
|
371
|
-
return this.execCall(txb, options);
|
|
372
|
-
}
|
|
373
340
|
/**
|
|
374
341
|
* Withdraw collateral from the Suilend strategy back into an atomic vault
|
|
375
342
|
* @param vaultId The id of the atomic vault
|
|
@@ -384,19 +351,6 @@ export class OperatorCalls extends OnChainCalls {
|
|
|
384
351
|
this.txBuilder.atomicWithdrawFromSuilendStrategy(vaultId, poolCoinType, lendingMarketId, amount, { ...options, txBlock: txb });
|
|
385
352
|
return this.execCall(txb, options);
|
|
386
353
|
}
|
|
387
|
-
/**
|
|
388
|
-
* Withdraw collateral from the AlphaLend strategy back into an atomic vault
|
|
389
|
-
* @param vaultId The id of the atomic vault
|
|
390
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
391
|
-
* @param amount The amount to withdraw
|
|
392
|
-
* @param options Optional tx execution params
|
|
393
|
-
* @returns OnChainCallResponse
|
|
394
|
-
*/
|
|
395
|
-
async atomicWithdrawFromAlphalendStrategy(vaultId, lendingProtocolId, amount, options) {
|
|
396
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
397
|
-
this.txBuilder.atomicWithdrawFromAlphalendStrategy(vaultId, lendingProtocolId, amount, { ...options, txBlock: txb });
|
|
398
|
-
return this.execCall(txb, options);
|
|
399
|
-
}
|
|
400
354
|
/**
|
|
401
355
|
* Supply collateral from an atomic vault to one of its sub accounts
|
|
402
356
|
* @param vaultId The id of the atomic vault
|
|
@@ -522,20 +476,6 @@ export class OperatorCalls extends OnChainCalls {
|
|
|
522
476
|
this.txBuilder.atomicSetStrategyNoneFromSuilendSui(vaultId, poolCoinType, lendingMarketId, { ...options, txBlock: txb });
|
|
523
477
|
return this.execCall(txb, options);
|
|
524
478
|
}
|
|
525
|
-
/**
|
|
526
|
-
* Exits the AlphaLend strategy on a SUI-collateral vault
|
|
527
|
-
* @param vaultId Id of the atomic vault (collateral must be SUI)
|
|
528
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
529
|
-
* @param acceptResidual Abandon a dust residual rather than aborting the
|
|
530
|
-
* exit. Only pass true deliberately: the residual is forfeited.
|
|
531
|
-
* @param options Optional tx execution params
|
|
532
|
-
* @returns OnChainCallResponse
|
|
533
|
-
*/
|
|
534
|
-
async atomicSetStrategyNoneFromAlphalendSui(vaultId, lendingProtocolId, acceptResidual, options) {
|
|
535
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
536
|
-
this.txBuilder.atomicSetStrategyNoneFromAlphalendSui(vaultId, lendingProtocolId, acceptResidual, { ...options, txBlock: txb });
|
|
537
|
-
return this.execCall(txb, options);
|
|
538
|
-
}
|
|
539
479
|
/**
|
|
540
480
|
* Withdraws collateral from the Suilend strategy on a SUI-collateral vault
|
|
541
481
|
* @param vaultId Id of the atomic vault (collateral must be SUI)
|
|
@@ -550,34 +490,4 @@ export class OperatorCalls extends OnChainCalls {
|
|
|
550
490
|
this.txBuilder.atomicWithdrawFromSuilendStrategySui(vaultId, poolCoinType, lendingMarketId, amount, { ...options, txBlock: txb });
|
|
551
491
|
return this.execCall(txb, options);
|
|
552
492
|
}
|
|
553
|
-
/**
|
|
554
|
-
* Withdraws collateral from the AlphaLend strategy on a SUI-collateral vault
|
|
555
|
-
* @param vaultId Id of the atomic vault (collateral must be SUI)
|
|
556
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
557
|
-
* @param amount Amount of collateral to withdraw, in base units
|
|
558
|
-
* @param options Optional tx execution params
|
|
559
|
-
* @returns OnChainCallResponse
|
|
560
|
-
*/
|
|
561
|
-
async atomicWithdrawFromAlphalendStrategySui(vaultId, lendingProtocolId, amount, options) {
|
|
562
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
563
|
-
this.txBuilder.atomicWithdrawFromAlphalendStrategySui(vaultId, lendingProtocolId, amount, { ...options, txBlock: txb });
|
|
564
|
-
return this.execCall(txb, options);
|
|
565
|
-
}
|
|
566
|
-
/**
|
|
567
|
-
* Collects accrued AlphaLend rewards through the SUI system state and
|
|
568
|
-
* forwards them to an allowlisted sub-account.
|
|
569
|
-
*
|
|
570
|
-
* Call before exiting the strategy — the exit burns the `PositionCap` and
|
|
571
|
-
* strands anything uncollected.
|
|
572
|
-
* @param vaultId Id of the atomic vault
|
|
573
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
574
|
-
* @param subAccount Allowlisted sub-account to receive the rewards
|
|
575
|
-
* @param options Optional tx execution params
|
|
576
|
-
* @returns OnChainCallResponse
|
|
577
|
-
*/
|
|
578
|
-
async atomicCollectAlphalendStrategyRewardSui(vaultId, lendingProtocolId, subAccount, options) {
|
|
579
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
580
|
-
this.txBuilder.atomicCollectAlphalendStrategyRewardSui(vaultId, lendingProtocolId, subAccount, { ...options, txBlock: txb });
|
|
581
|
-
return this.execCall(txb, options);
|
|
582
|
-
}
|
|
583
493
|
}
|
|
@@ -615,15 +615,6 @@ export declare class TxBuilder {
|
|
|
615
615
|
* @returns TransactionBlock
|
|
616
616
|
*/
|
|
617
617
|
atomicSetStrategyNoneFromSuilend(vaultId: string, poolCoinType: string, lendingMarketId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
618
|
-
/**
|
|
619
|
-
* Switches an atomic vault from the AlphaLend strategy to STRATEGY_NONE,
|
|
620
|
-
* draining the full position collateral back into the vault balance.
|
|
621
|
-
* @param vaultId Id of the atomic vault
|
|
622
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
623
|
-
* @param options Optional tx building params
|
|
624
|
-
* @returns TransactionBlock
|
|
625
|
-
*/
|
|
626
|
-
atomicSetStrategyNoneFromAlphalend(vaultId: string, lendingProtocolId: string, acceptResidual: boolean, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
627
618
|
/**
|
|
628
619
|
* Step 1 of 2 for Suilend activation: commits the reserve index, the market
|
|
629
620
|
* object and the collateral type. Step 2 is `atomicOpenSuilendObligation`,
|
|
@@ -724,34 +715,6 @@ export declare class TxBuilder {
|
|
|
724
715
|
* @returns TransactionBlock
|
|
725
716
|
*/
|
|
726
717
|
atomicWithdrawSuilendSecondaryCollateralSui(vaultId: string, poolCoinType: string, lendingMarketId: string, subAccount: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
727
|
-
/**
|
|
728
|
-
* Collects accrued AlphaLend rewards of coin type `rewardType` and forwards
|
|
729
|
-
* them to an allowlisted sub-account.
|
|
730
|
-
*
|
|
731
|
-
* Call once per reward type BEFORE exiting the strategy — the exit burns
|
|
732
|
-
* the `PositionCap` and strands anything uncollected. `rewardType` must not
|
|
733
|
-
* be SUI; AlphaLend settles SUI through the staking system and needs the
|
|
734
|
-
* monomorphic variant, which this SDK does not yet expose.
|
|
735
|
-
*
|
|
736
|
-
* PTB REQUIREMENT: refresh AlphaLend Pyth prices for the active market
|
|
737
|
-
* earlier in the same transaction.
|
|
738
|
-
* @param vaultId Id of the atomic vault
|
|
739
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
740
|
-
* @param rewardType Coin type of the reward being collected
|
|
741
|
-
* @param subAccount Allowlisted sub-account to receive the reward
|
|
742
|
-
* @param options Optional tx building params
|
|
743
|
-
* @returns TransactionBlock
|
|
744
|
-
*/
|
|
745
|
-
atomicCollectAlphalendStrategyReward(vaultId: string, lendingProtocolId: string, rewardType: string, subAccount: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
746
|
-
/**
|
|
747
|
-
* Sets the AlphaLend strategy for an atomic vault
|
|
748
|
-
* @param vaultId Id of the atomic vault
|
|
749
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
750
|
-
* @param marketId AlphaLend market id
|
|
751
|
-
* @param options Optional tx building params
|
|
752
|
-
* @returns TransactionBlock
|
|
753
|
-
*/
|
|
754
|
-
atomicSetStrategyAlphalend(vaultId: string, lendingProtocolId: string, marketId: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
755
718
|
/**
|
|
756
719
|
* Sets / unsets a blacklisted account on an atomic vault
|
|
757
720
|
* @param vaultId Id of the atomic vault
|
|
@@ -822,15 +785,6 @@ export declare class TxBuilder {
|
|
|
822
785
|
* @returns TransactionBlock
|
|
823
786
|
*/
|
|
824
787
|
atomicSupplyToSuilendStrategy(vaultId: string, poolCoinType: string, lendingMarketId: string, amount: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
825
|
-
/**
|
|
826
|
-
* Supplies collateral from an atomic vault into the AlphaLend strategy
|
|
827
|
-
* @param vaultId Id of the atomic vault
|
|
828
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
829
|
-
* @param amount Amount to supply
|
|
830
|
-
* @param options Optional tx building params
|
|
831
|
-
* @returns TransactionBlock
|
|
832
|
-
*/
|
|
833
|
-
atomicSupplyToAlphalendStrategy(vaultId: string, lendingProtocolId: string, amount: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
834
788
|
/**
|
|
835
789
|
* Withdraws collateral from the Suilend strategy back into an atomic vault
|
|
836
790
|
* @param vaultId Id of the atomic vault
|
|
@@ -841,15 +795,6 @@ export declare class TxBuilder {
|
|
|
841
795
|
* @returns TransactionBlock
|
|
842
796
|
*/
|
|
843
797
|
atomicWithdrawFromSuilendStrategy(vaultId: string, poolCoinType: string, lendingMarketId: string, amount: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
844
|
-
/**
|
|
845
|
-
* Withdraws collateral from the AlphaLend strategy back into an atomic vault
|
|
846
|
-
* @param vaultId Id of the atomic vault
|
|
847
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
848
|
-
* @param amount Amount to withdraw
|
|
849
|
-
* @param options Optional tx building params
|
|
850
|
-
* @returns TransactionBlock
|
|
851
|
-
*/
|
|
852
|
-
atomicWithdrawFromAlphalendStrategy(vaultId: string, lendingProtocolId: string, amount: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
853
798
|
/**
|
|
854
799
|
* Releases users' holdback for an ember share source vault
|
|
855
800
|
* @param vaultId Id of the atomic vault
|
|
@@ -943,16 +888,6 @@ export declare class TxBuilder {
|
|
|
943
888
|
* @returns TransactionBlock
|
|
944
889
|
*/
|
|
945
890
|
atomicInstantWithdrawWithSuilend(vaultId: string, poolCoinType: string, lendingMarketId: string, shares: NumStr, receiver: string | null | undefined, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
946
|
-
/**
|
|
947
|
-
* Performs an instant withdraw from an atomic vault routed through AlphaLend
|
|
948
|
-
* @param vaultId Id of the atomic vault
|
|
949
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
950
|
-
* @param shares Number of shares to withdraw
|
|
951
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
952
|
-
* @param options Optional tx building params
|
|
953
|
-
* @returns TransactionBlock
|
|
954
|
-
*/
|
|
955
|
-
atomicInstantWithdrawWithAlphalend(vaultId: string, lendingProtocolId: string, shares: NumStr, receiver: string | null | undefined, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
956
891
|
/**
|
|
957
892
|
* Swaps ember shares (Coin<R>) into an atomic vault, minting atomic shares
|
|
958
893
|
* @param vaultId Id of the atomic vault
|
|
@@ -990,25 +925,6 @@ export declare class TxBuilder {
|
|
|
990
925
|
* @returns TransactionBlock
|
|
991
926
|
*/
|
|
992
927
|
atomicSwapEmberSharesWithSuilend(vaultId: string, sourceReceiptType: string, poolCoinType: string, sourceVaultId: string, lendingMarketId: string, shareCoinId: string, receiver: string | null | undefined, minNetOut: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
993
|
-
/**
|
|
994
|
-
* Swaps ember shares (Coin<R>) into an atomic vault, routing collateral
|
|
995
|
-
* through the AlphaLend strategy
|
|
996
|
-
* @param vaultId Id of the atomic vault
|
|
997
|
-
* @param sourceReceiptType Receipt coin type of the source vault (R)
|
|
998
|
-
* @param sourceVaultId Object id of the source Vault<T, R>
|
|
999
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
1000
|
-
* @param shareCoinId Object id of the Coin<R> to swap
|
|
1001
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
1002
|
-
* @param minNetOut Minimum collateral to receive, in base units. The swap
|
|
1003
|
-
* aborts below it. This is the A-9 slippage guard: the payout is
|
|
1004
|
-
* gross - fee - holdback, and both the fee multiplier (which moves with
|
|
1005
|
-
* utilization) and the source rate can change between quoting and
|
|
1006
|
-
* landing. Pass the value from `previewSwapInstantWithdraw`; 0 disables
|
|
1007
|
-
* the guard entirely.
|
|
1008
|
-
* @param options Optional tx building params
|
|
1009
|
-
* @returns TransactionBlock
|
|
1010
|
-
*/
|
|
1011
|
-
atomicSwapEmberSharesWithAlphalend(vaultId: string, sourceReceiptType: string, sourceVaultId: string, lendingProtocolId: string, shareCoinId: string, receiver: string | null | undefined, minNetOut: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1012
928
|
/**
|
|
1013
929
|
* Swaps ember shares into a SUI-collateral atomic vault, sourcing payout
|
|
1014
930
|
* liquidity from Suilend.
|
|
@@ -1026,50 +942,14 @@ export declare class TxBuilder {
|
|
|
1026
942
|
* @returns TransactionBlock
|
|
1027
943
|
*/
|
|
1028
944
|
atomicSwapEmberSharesWithSuilendSui(vaultId: string, sourceReceiptType: string, poolCoinType: string, sourceVaultId: string, lendingMarketId: string, shareCoinId: string, receiver: string, minNetOut: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1029
|
-
/**
|
|
1030
|
-
* Swaps ember shares into a SUI-collateral atomic vault, sourcing payout
|
|
1031
|
-
* liquidity from AlphaLend.
|
|
1032
|
-
* @param vaultId Id of the atomic vault (collateral must be SUI)
|
|
1033
|
-
* @param sourceReceiptType Receipt coin type of the source vault (R)
|
|
1034
|
-
* @param sourceVaultId Object id of the source Vault<SUI, R>
|
|
1035
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
1036
|
-
* @param shareCoinId Object id of the Coin<R> to swap
|
|
1037
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
1038
|
-
* @param minNetOut Minimum collateral to receive, in base units (A-9 guard)
|
|
1039
|
-
* @param options Optional tx building params
|
|
1040
|
-
* @returns TransactionBlock
|
|
1041
|
-
*/
|
|
1042
|
-
atomicSwapEmberSharesWithAlphalendSui(vaultId: string, sourceReceiptType: string, sourceVaultId: string, lendingProtocolId: string, shareCoinId: string, receiver: string | null | undefined, minNetOut: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1043
945
|
/**
|
|
1044
946
|
* Instant withdraw from a SUI-collateral atomic vault, pulling liquidity
|
|
1045
947
|
* from Suilend.
|
|
1046
948
|
* @param receiver Payout recipient. REQUIRED — bare address on chain.
|
|
1047
949
|
*/
|
|
1048
950
|
atomicInstantWithdrawWithSuilendSui(vaultId: string, poolCoinType: string, lendingMarketId: string, shares: NumStr, receiver: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1049
|
-
/**
|
|
1050
|
-
* Instant withdraw from a SUI-collateral atomic vault, pulling liquidity
|
|
1051
|
-
* from AlphaLend.
|
|
1052
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
1053
|
-
*/
|
|
1054
|
-
atomicInstantWithdrawWithAlphalendSui(vaultId: string, lendingProtocolId: string, shares: NumStr, receiver: string | null | undefined, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1055
951
|
/** Exits the Suilend strategy on a SUI-collateral vault (operator). */
|
|
1056
952
|
atomicSetStrategyNoneFromSuilendSui(vaultId: string, poolCoinType: string, lendingMarketId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1057
|
-
/**
|
|
1058
|
-
* Exits the AlphaLend strategy on a SUI-collateral vault (operator).
|
|
1059
|
-
* @param acceptResidual Abandon a dust residual rather than aborting the exit
|
|
1060
|
-
*/
|
|
1061
|
-
atomicSetStrategyNoneFromAlphalendSui(vaultId: string, lendingProtocolId: string, acceptResidual: boolean, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1062
953
|
/** Withdraws from the Suilend strategy on a SUI-collateral vault (operator). */
|
|
1063
954
|
atomicWithdrawFromSuilendStrategySui(vaultId: string, poolCoinType: string, lendingMarketId: string, amount: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1064
|
-
/** Withdraws from the AlphaLend strategy on a SUI-collateral vault (operator). */
|
|
1065
|
-
atomicWithdrawFromAlphalendStrategySui(vaultId: string, lendingProtocolId: string, amount: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1066
|
-
/**
|
|
1067
|
-
* Collects AlphaLend rewards through the SUI system state and forwards them
|
|
1068
|
-
* to an allowlisted sub-account (operator).
|
|
1069
|
-
*
|
|
1070
|
-
* Unlike the other `_sui` entrypoints this one is still generic in `T` — it
|
|
1071
|
-
* is the reward path, not the collateral path, so the vault's own collateral
|
|
1072
|
-
* type is still a type argument.
|
|
1073
|
-
*/
|
|
1074
|
-
atomicCollectAlphalendStrategyRewardSui(vaultId: string, lendingProtocolId: string, subAccount: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
1075
955
|
}
|