@ember-finance/sdk 2.21.0-ccip.0 → 2.22.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 +10 -64
- package/dist/src/sui-vaults/on-chain-calls/operator.js +22 -92
- package/dist/src/sui-vaults/on-chain-calls/protocol-config-reader.d.ts +8 -0
- package/dist/src/sui-vaults/on-chain-calls/protocol-config-reader.js +10 -0
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +7 -120
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +32 -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
|
@@ -1041,6 +1041,32 @@ export class TxBuilder {
|
|
|
1041
1041
|
txb.setSenderIfNotSet(options.sender);
|
|
1042
1042
|
return txb;
|
|
1043
1043
|
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Collect platform fee (package VERSION 6+, where `collect_platform_fee` aborts)
|
|
1046
|
+
* @param vaultId Id of the vault
|
|
1047
|
+
* @param options Optional tx building params
|
|
1048
|
+
* @returns TransactionBlock
|
|
1049
|
+
*/
|
|
1050
|
+
collectPlatformFeeV2(vaultId, options) {
|
|
1051
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
1052
|
+
txb.moveCall({
|
|
1053
|
+
arguments: [
|
|
1054
|
+
txb.object(vaultId),
|
|
1055
|
+
txb.object(this.parser.getProtocolConfig()),
|
|
1056
|
+
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1057
|
+
],
|
|
1058
|
+
typeArguments: [
|
|
1059
|
+
this.parser.getDepositCoinType(vaultId),
|
|
1060
|
+
this.parser.getReceiptCoinType(vaultId)
|
|
1061
|
+
],
|
|
1062
|
+
target: `${this.targetPackageId(options)}::gateway::collect_platform_fee_v2`
|
|
1063
|
+
});
|
|
1064
|
+
if (options?.gasBudget)
|
|
1065
|
+
txb.setGasBudget(options.gasBudget);
|
|
1066
|
+
if (options?.sender)
|
|
1067
|
+
txb.setSenderIfNotSet(options.sender);
|
|
1068
|
+
return txb;
|
|
1069
|
+
}
|
|
1044
1070
|
/**
|
|
1045
1071
|
* Deposit asset
|
|
1046
1072
|
* @param vaultId Id of the vault
|
|
@@ -1210,8 +1236,8 @@ export class TxBuilder {
|
|
|
1210
1236
|
// being passed explicitly. Functions that also need `R` (the source ember
|
|
1211
1237
|
// vault receipt) or `P` (the Suilend pool coin type) take those type strings
|
|
1212
1238
|
// as explicit method params. External objects (Suilend `LendingMarket<P>`,
|
|
1213
|
-
//
|
|
1214
|
-
//
|
|
1239
|
+
// source `Vault<T, R>`, and `Receiving<Coin>` payment objects) are passed as
|
|
1240
|
+
// object id strings.
|
|
1215
1241
|
//
|
|
1216
1242
|
// JUDGMENT CALLS NEEDING SUI-NODE VALIDATION:
|
|
1217
1243
|
// - `Coin<T>` / `Coin<R>` arguments (atomicDeposit, atomicSwapEmberShares*,
|
|
@@ -1855,33 +1881,6 @@ export class TxBuilder {
|
|
|
1855
1881
|
txb.setSenderIfNotSet(options.sender);
|
|
1856
1882
|
return txb;
|
|
1857
1883
|
}
|
|
1858
|
-
/**
|
|
1859
|
-
* Switches an atomic vault from the AlphaLend strategy to STRATEGY_NONE,
|
|
1860
|
-
* draining the full position collateral back into the vault balance.
|
|
1861
|
-
* @param vaultId Id of the atomic vault
|
|
1862
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
1863
|
-
* @param options Optional tx building params
|
|
1864
|
-
* @returns TransactionBlock
|
|
1865
|
-
*/
|
|
1866
|
-
atomicSetStrategyNoneFromAlphalend(vaultId, lendingProtocolId, acceptResidual, options) {
|
|
1867
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1868
|
-
txb.moveCall({
|
|
1869
|
-
arguments: [
|
|
1870
|
-
txb.object(vaultId),
|
|
1871
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1872
|
-
txb.object(lendingProtocolId),
|
|
1873
|
-
txb.pure.bool(acceptResidual),
|
|
1874
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1875
|
-
],
|
|
1876
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1877
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_strategy_none_from_alphalend`
|
|
1878
|
-
});
|
|
1879
|
-
if (options?.gasBudget)
|
|
1880
|
-
txb.setGasBudget(options.gasBudget);
|
|
1881
|
-
if (options?.sender)
|
|
1882
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1883
|
-
return txb;
|
|
1884
|
-
}
|
|
1885
1884
|
/**
|
|
1886
1885
|
* Step 1 of 2 for Suilend activation: commits the reserve index, the market
|
|
1887
1886
|
* object and the collateral type. Step 2 is `atomicOpenSuilendObligation`,
|
|
@@ -2081,69 +2080,6 @@ export class TxBuilder {
|
|
|
2081
2080
|
txb.setSenderIfNotSet(options.sender);
|
|
2082
2081
|
return txb;
|
|
2083
2082
|
}
|
|
2084
|
-
/**
|
|
2085
|
-
* Collects accrued AlphaLend rewards of coin type `rewardType` and forwards
|
|
2086
|
-
* them to an allowlisted sub-account.
|
|
2087
|
-
*
|
|
2088
|
-
* Call once per reward type BEFORE exiting the strategy — the exit burns
|
|
2089
|
-
* the `PositionCap` and strands anything uncollected. `rewardType` must not
|
|
2090
|
-
* be SUI; AlphaLend settles SUI through the staking system and needs the
|
|
2091
|
-
* monomorphic variant, which this SDK does not yet expose.
|
|
2092
|
-
*
|
|
2093
|
-
* PTB REQUIREMENT: refresh AlphaLend Pyth prices for the active market
|
|
2094
|
-
* earlier in the same transaction.
|
|
2095
|
-
* @param vaultId Id of the atomic vault
|
|
2096
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2097
|
-
* @param rewardType Coin type of the reward being collected
|
|
2098
|
-
* @param subAccount Allowlisted sub-account to receive the reward
|
|
2099
|
-
* @param options Optional tx building params
|
|
2100
|
-
* @returns TransactionBlock
|
|
2101
|
-
*/
|
|
2102
|
-
atomicCollectAlphalendStrategyReward(vaultId, lendingProtocolId, rewardType, subAccount, options) {
|
|
2103
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2104
|
-
txb.moveCall({
|
|
2105
|
-
arguments: [
|
|
2106
|
-
txb.object(vaultId),
|
|
2107
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2108
|
-
txb.object(lendingProtocolId),
|
|
2109
|
-
txb.pure.address(subAccount),
|
|
2110
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2111
|
-
],
|
|
2112
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId), rewardType],
|
|
2113
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_collect_alphalend_strategy_reward`
|
|
2114
|
-
});
|
|
2115
|
-
if (options?.gasBudget)
|
|
2116
|
-
txb.setGasBudget(options.gasBudget);
|
|
2117
|
-
if (options?.sender)
|
|
2118
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2119
|
-
return txb;
|
|
2120
|
-
}
|
|
2121
|
-
/**
|
|
2122
|
-
* Sets the AlphaLend strategy for an atomic vault
|
|
2123
|
-
* @param vaultId Id of the atomic vault
|
|
2124
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2125
|
-
* @param marketId AlphaLend market id
|
|
2126
|
-
* @param options Optional tx building params
|
|
2127
|
-
* @returns TransactionBlock
|
|
2128
|
-
*/
|
|
2129
|
-
atomicSetStrategyAlphalend(vaultId, lendingProtocolId, marketId, options) {
|
|
2130
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2131
|
-
txb.moveCall({
|
|
2132
|
-
arguments: [
|
|
2133
|
-
txb.object(vaultId),
|
|
2134
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2135
|
-
txb.object(lendingProtocolId),
|
|
2136
|
-
txb.pure.u64(marketId)
|
|
2137
|
-
],
|
|
2138
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2139
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_strategy_alphalend`
|
|
2140
|
-
});
|
|
2141
|
-
if (options?.gasBudget)
|
|
2142
|
-
txb.setGasBudget(options.gasBudget);
|
|
2143
|
-
if (options?.sender)
|
|
2144
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2145
|
-
return txb;
|
|
2146
|
-
}
|
|
2147
2083
|
/**
|
|
2148
2084
|
* Sets / unsets a blacklisted account on an atomic vault
|
|
2149
2085
|
* @param vaultId Id of the atomic vault
|
|
@@ -2351,33 +2287,6 @@ export class TxBuilder {
|
|
|
2351
2287
|
txb.setSenderIfNotSet(options.sender);
|
|
2352
2288
|
return txb;
|
|
2353
2289
|
}
|
|
2354
|
-
/**
|
|
2355
|
-
* Supplies collateral from an atomic vault into the AlphaLend strategy
|
|
2356
|
-
* @param vaultId Id of the atomic vault
|
|
2357
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2358
|
-
* @param amount Amount to supply
|
|
2359
|
-
* @param options Optional tx building params
|
|
2360
|
-
* @returns TransactionBlock
|
|
2361
|
-
*/
|
|
2362
|
-
atomicSupplyToAlphalendStrategy(vaultId, lendingProtocolId, amount, options) {
|
|
2363
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2364
|
-
txb.moveCall({
|
|
2365
|
-
arguments: [
|
|
2366
|
-
txb.object(vaultId),
|
|
2367
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2368
|
-
txb.object(lendingProtocolId),
|
|
2369
|
-
txb.pure.u64(amount),
|
|
2370
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2371
|
-
],
|
|
2372
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2373
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_supply_to_alphalend_strategy`
|
|
2374
|
-
});
|
|
2375
|
-
if (options?.gasBudget)
|
|
2376
|
-
txb.setGasBudget(options.gasBudget);
|
|
2377
|
-
if (options?.sender)
|
|
2378
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2379
|
-
return txb;
|
|
2380
|
-
}
|
|
2381
2290
|
/**
|
|
2382
2291
|
* Withdraws collateral from the Suilend strategy back into an atomic vault
|
|
2383
2292
|
* @param vaultId Id of the atomic vault
|
|
@@ -2406,33 +2315,6 @@ export class TxBuilder {
|
|
|
2406
2315
|
txb.setSenderIfNotSet(options.sender);
|
|
2407
2316
|
return txb;
|
|
2408
2317
|
}
|
|
2409
|
-
/**
|
|
2410
|
-
* Withdraws collateral from the AlphaLend strategy back into an atomic vault
|
|
2411
|
-
* @param vaultId Id of the atomic vault
|
|
2412
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2413
|
-
* @param amount Amount to withdraw
|
|
2414
|
-
* @param options Optional tx building params
|
|
2415
|
-
* @returns TransactionBlock
|
|
2416
|
-
*/
|
|
2417
|
-
atomicWithdrawFromAlphalendStrategy(vaultId, lendingProtocolId, amount, options) {
|
|
2418
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2419
|
-
txb.moveCall({
|
|
2420
|
-
arguments: [
|
|
2421
|
-
txb.object(vaultId),
|
|
2422
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2423
|
-
txb.object(lendingProtocolId),
|
|
2424
|
-
txb.pure.u64(amount),
|
|
2425
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2426
|
-
],
|
|
2427
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2428
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_withdraw_from_alphalend_strategy`
|
|
2429
|
-
});
|
|
2430
|
-
if (options?.gasBudget)
|
|
2431
|
-
txb.setGasBudget(options.gasBudget);
|
|
2432
|
-
if (options?.sender)
|
|
2433
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2434
|
-
return txb;
|
|
2435
|
-
}
|
|
2436
2318
|
/**
|
|
2437
2319
|
* Releases users' holdback for an ember share source vault
|
|
2438
2320
|
* @param vaultId Id of the atomic vault
|
|
@@ -2713,35 +2595,6 @@ export class TxBuilder {
|
|
|
2713
2595
|
txb.setSenderIfNotSet(options.sender);
|
|
2714
2596
|
return txb;
|
|
2715
2597
|
}
|
|
2716
|
-
/**
|
|
2717
|
-
* Performs an instant withdraw from an atomic vault routed through AlphaLend
|
|
2718
|
-
* @param vaultId Id of the atomic vault
|
|
2719
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2720
|
-
* @param shares Number of shares to withdraw
|
|
2721
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2722
|
-
* @param options Optional tx building params
|
|
2723
|
-
* @returns TransactionBlock
|
|
2724
|
-
*/
|
|
2725
|
-
atomicInstantWithdrawWithAlphalend(vaultId, lendingProtocolId, shares, receiver, options) {
|
|
2726
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2727
|
-
txb.moveCall({
|
|
2728
|
-
arguments: [
|
|
2729
|
-
txb.object(vaultId),
|
|
2730
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2731
|
-
txb.object(lendingProtocolId),
|
|
2732
|
-
txb.pure.u64(shares),
|
|
2733
|
-
txb.pure.option("address", receiver ?? null),
|
|
2734
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2735
|
-
],
|
|
2736
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2737
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_instant_withdraw_with_alphalend`
|
|
2738
|
-
});
|
|
2739
|
-
if (options?.gasBudget)
|
|
2740
|
-
txb.setGasBudget(options.gasBudget);
|
|
2741
|
-
if (options?.sender)
|
|
2742
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2743
|
-
return txb;
|
|
2744
|
-
}
|
|
2745
2598
|
/**
|
|
2746
2599
|
* Swaps ember shares (Coin<R>) into an atomic vault, minting atomic shares
|
|
2747
2600
|
* @param vaultId Id of the atomic vault
|
|
@@ -2827,49 +2680,6 @@ export class TxBuilder {
|
|
|
2827
2680
|
txb.setSenderIfNotSet(options.sender);
|
|
2828
2681
|
return txb;
|
|
2829
2682
|
}
|
|
2830
|
-
/**
|
|
2831
|
-
* Swaps ember shares (Coin<R>) into an atomic vault, routing collateral
|
|
2832
|
-
* through the AlphaLend strategy
|
|
2833
|
-
* @param vaultId Id of the atomic vault
|
|
2834
|
-
* @param sourceReceiptType Receipt coin type of the source vault (R)
|
|
2835
|
-
* @param sourceVaultId Object id of the source Vault<T, R>
|
|
2836
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2837
|
-
* @param shareCoinId Object id of the Coin<R> to swap
|
|
2838
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2839
|
-
* @param minNetOut Minimum collateral to receive, in base units. The swap
|
|
2840
|
-
* aborts below it. This is the A-9 slippage guard: the payout is
|
|
2841
|
-
* gross - fee - holdback, and both the fee multiplier (which moves with
|
|
2842
|
-
* utilization) and the source rate can change between quoting and
|
|
2843
|
-
* landing. Pass the value from `previewSwapInstantWithdraw`; 0 disables
|
|
2844
|
-
* the guard entirely.
|
|
2845
|
-
* @param options Optional tx building params
|
|
2846
|
-
* @returns TransactionBlock
|
|
2847
|
-
*/
|
|
2848
|
-
atomicSwapEmberSharesWithAlphalend(vaultId, sourceReceiptType, sourceVaultId, lendingProtocolId, shareCoinId, receiver, minNetOut, options) {
|
|
2849
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2850
|
-
txb.moveCall({
|
|
2851
|
-
arguments: [
|
|
2852
|
-
txb.object(vaultId),
|
|
2853
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2854
|
-
txb.object(sourceVaultId),
|
|
2855
|
-
txb.object(lendingProtocolId),
|
|
2856
|
-
txb.object(shareCoinId),
|
|
2857
|
-
txb.pure.option("address", receiver ?? null),
|
|
2858
|
-
txb.pure.u64(minNetOut),
|
|
2859
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2860
|
-
],
|
|
2861
|
-
typeArguments: [
|
|
2862
|
-
this.parser.getAtomicCollateralType(vaultId),
|
|
2863
|
-
sourceReceiptType
|
|
2864
|
-
],
|
|
2865
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_swap_ember_shares_with_alphalend`
|
|
2866
|
-
});
|
|
2867
|
-
if (options?.gasBudget)
|
|
2868
|
-
txb.setGasBudget(options.gasBudget);
|
|
2869
|
-
if (options?.sender)
|
|
2870
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2871
|
-
return txb;
|
|
2872
|
-
}
|
|
2873
2683
|
// === Vault<SUI> variants ===
|
|
2874
2684
|
//
|
|
2875
2685
|
// A SUI-collateral atomic vault cannot use the generic builders above. The
|
|
@@ -2878,10 +2688,10 @@ export class TxBuilder {
|
|
|
2878
2688
|
// `&mut SuiSystemState` as an extra argument. `T` therefore drops out of
|
|
2879
2689
|
// typeArguments — passing it is the easy mistake here.
|
|
2880
2690
|
//
|
|
2881
|
-
// Note the receiver
|
|
2882
|
-
//
|
|
2883
|
-
//
|
|
2884
|
-
//
|
|
2691
|
+
// Note the receiver shape, which is in the contract rather than here: the
|
|
2692
|
+
// SUI variants take a bare `address`, not `Option<address>`. The builders
|
|
2693
|
+
// below therefore require an explicit receiver — there is no on-chain
|
|
2694
|
+
// "default to sender" for them.
|
|
2885
2695
|
/**
|
|
2886
2696
|
* Swaps ember shares into a SUI-collateral atomic vault, sourcing payout
|
|
2887
2697
|
* liquidity from Suilend.
|
|
@@ -2921,42 +2731,6 @@ export class TxBuilder {
|
|
|
2921
2731
|
txb.setSenderIfNotSet(options.sender);
|
|
2922
2732
|
return txb;
|
|
2923
2733
|
}
|
|
2924
|
-
/**
|
|
2925
|
-
* Swaps ember shares into a SUI-collateral atomic vault, sourcing payout
|
|
2926
|
-
* liquidity from AlphaLend.
|
|
2927
|
-
* @param vaultId Id of the atomic vault (collateral must be SUI)
|
|
2928
|
-
* @param sourceReceiptType Receipt coin type of the source vault (R)
|
|
2929
|
-
* @param sourceVaultId Object id of the source Vault<SUI, R>
|
|
2930
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2931
|
-
* @param shareCoinId Object id of the Coin<R> to swap
|
|
2932
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2933
|
-
* @param minNetOut Minimum collateral to receive, in base units (A-9 guard)
|
|
2934
|
-
* @param options Optional tx building params
|
|
2935
|
-
* @returns TransactionBlock
|
|
2936
|
-
*/
|
|
2937
|
-
atomicSwapEmberSharesWithAlphalendSui(vaultId, sourceReceiptType, sourceVaultId, lendingProtocolId, shareCoinId, receiver, minNetOut, options) {
|
|
2938
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2939
|
-
txb.moveCall({
|
|
2940
|
-
arguments: [
|
|
2941
|
-
txb.object(vaultId),
|
|
2942
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2943
|
-
txb.object(sourceVaultId),
|
|
2944
|
-
txb.object(lendingProtocolId),
|
|
2945
|
-
txb.object(SUI_SYSTEM_STATE_OBJECT_ID),
|
|
2946
|
-
txb.object(shareCoinId),
|
|
2947
|
-
txb.pure.option("address", receiver ?? null),
|
|
2948
|
-
txb.pure.u64(minNetOut),
|
|
2949
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2950
|
-
],
|
|
2951
|
-
typeArguments: [sourceReceiptType],
|
|
2952
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_swap_ember_shares_with_alphalend_sui`
|
|
2953
|
-
});
|
|
2954
|
-
if (options?.gasBudget)
|
|
2955
|
-
txb.setGasBudget(options.gasBudget);
|
|
2956
|
-
if (options?.sender)
|
|
2957
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2958
|
-
return txb;
|
|
2959
|
-
}
|
|
2960
2734
|
/**
|
|
2961
2735
|
* Instant withdraw from a SUI-collateral atomic vault, pulling liquidity
|
|
2962
2736
|
* from Suilend.
|
|
@@ -2983,32 +2757,6 @@ export class TxBuilder {
|
|
|
2983
2757
|
txb.setSenderIfNotSet(options.sender);
|
|
2984
2758
|
return txb;
|
|
2985
2759
|
}
|
|
2986
|
-
/**
|
|
2987
|
-
* Instant withdraw from a SUI-collateral atomic vault, pulling liquidity
|
|
2988
|
-
* from AlphaLend.
|
|
2989
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2990
|
-
*/
|
|
2991
|
-
atomicInstantWithdrawWithAlphalendSui(vaultId, lendingProtocolId, shares, receiver, options) {
|
|
2992
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2993
|
-
txb.moveCall({
|
|
2994
|
-
arguments: [
|
|
2995
|
-
txb.object(vaultId),
|
|
2996
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2997
|
-
txb.object(lendingProtocolId),
|
|
2998
|
-
txb.object(SUI_SYSTEM_STATE_OBJECT_ID),
|
|
2999
|
-
txb.pure.u64(shares),
|
|
3000
|
-
txb.pure.option("address", receiver ?? null),
|
|
3001
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
3002
|
-
],
|
|
3003
|
-
typeArguments: [],
|
|
3004
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_instant_withdraw_with_alphalend_sui`
|
|
3005
|
-
});
|
|
3006
|
-
if (options?.gasBudget)
|
|
3007
|
-
txb.setGasBudget(options.gasBudget);
|
|
3008
|
-
if (options?.sender)
|
|
3009
|
-
txb.setSenderIfNotSet(options.sender);
|
|
3010
|
-
return txb;
|
|
3011
|
-
}
|
|
3012
2760
|
/** Exits the Suilend strategy on a SUI-collateral vault (operator). */
|
|
3013
2761
|
atomicSetStrategyNoneFromSuilendSui(vaultId, poolCoinType, lendingMarketId, options) {
|
|
3014
2762
|
const txb = options?.txBlock || new TransactionBlock();
|
|
@@ -3029,30 +2777,6 @@ export class TxBuilder {
|
|
|
3029
2777
|
txb.setSenderIfNotSet(options.sender);
|
|
3030
2778
|
return txb;
|
|
3031
2779
|
}
|
|
3032
|
-
/**
|
|
3033
|
-
* Exits the AlphaLend strategy on a SUI-collateral vault (operator).
|
|
3034
|
-
* @param acceptResidual Abandon a dust residual rather than aborting the exit
|
|
3035
|
-
*/
|
|
3036
|
-
atomicSetStrategyNoneFromAlphalendSui(vaultId, lendingProtocolId, acceptResidual, options) {
|
|
3037
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
3038
|
-
txb.moveCall({
|
|
3039
|
-
arguments: [
|
|
3040
|
-
txb.object(vaultId),
|
|
3041
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
3042
|
-
txb.object(lendingProtocolId),
|
|
3043
|
-
txb.object(SUI_SYSTEM_STATE_OBJECT_ID),
|
|
3044
|
-
txb.pure.bool(acceptResidual),
|
|
3045
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
3046
|
-
],
|
|
3047
|
-
typeArguments: [],
|
|
3048
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_strategy_none_from_alphalend_sui`
|
|
3049
|
-
});
|
|
3050
|
-
if (options?.gasBudget)
|
|
3051
|
-
txb.setGasBudget(options.gasBudget);
|
|
3052
|
-
if (options?.sender)
|
|
3053
|
-
txb.setSenderIfNotSet(options.sender);
|
|
3054
|
-
return txb;
|
|
3055
|
-
}
|
|
3056
2780
|
/** Withdraws from the Suilend strategy on a SUI-collateral vault (operator). */
|
|
3057
2781
|
atomicWithdrawFromSuilendStrategySui(vaultId, poolCoinType, lendingMarketId, amount, options) {
|
|
3058
2782
|
const txb = options?.txBlock || new TransactionBlock();
|
|
@@ -3074,53 +2798,4 @@ export class TxBuilder {
|
|
|
3074
2798
|
txb.setSenderIfNotSet(options.sender);
|
|
3075
2799
|
return txb;
|
|
3076
2800
|
}
|
|
3077
|
-
/** Withdraws from the AlphaLend strategy on a SUI-collateral vault (operator). */
|
|
3078
|
-
atomicWithdrawFromAlphalendStrategySui(vaultId, lendingProtocolId, amount, options) {
|
|
3079
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
3080
|
-
txb.moveCall({
|
|
3081
|
-
arguments: [
|
|
3082
|
-
txb.object(vaultId),
|
|
3083
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
3084
|
-
txb.object(lendingProtocolId),
|
|
3085
|
-
txb.object(SUI_SYSTEM_STATE_OBJECT_ID),
|
|
3086
|
-
txb.pure.u64(amount),
|
|
3087
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
3088
|
-
],
|
|
3089
|
-
typeArguments: [],
|
|
3090
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_withdraw_from_alphalend_strategy_sui`
|
|
3091
|
-
});
|
|
3092
|
-
if (options?.gasBudget)
|
|
3093
|
-
txb.setGasBudget(options.gasBudget);
|
|
3094
|
-
if (options?.sender)
|
|
3095
|
-
txb.setSenderIfNotSet(options.sender);
|
|
3096
|
-
return txb;
|
|
3097
|
-
}
|
|
3098
|
-
/**
|
|
3099
|
-
* Collects AlphaLend rewards through the SUI system state and forwards them
|
|
3100
|
-
* to an allowlisted sub-account (operator).
|
|
3101
|
-
*
|
|
3102
|
-
* Unlike the other `_sui` entrypoints this one is still generic in `T` — it
|
|
3103
|
-
* is the reward path, not the collateral path, so the vault's own collateral
|
|
3104
|
-
* type is still a type argument.
|
|
3105
|
-
*/
|
|
3106
|
-
atomicCollectAlphalendStrategyRewardSui(vaultId, lendingProtocolId, subAccount, options) {
|
|
3107
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
3108
|
-
txb.moveCall({
|
|
3109
|
-
arguments: [
|
|
3110
|
-
txb.object(vaultId),
|
|
3111
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
3112
|
-
txb.object(lendingProtocolId),
|
|
3113
|
-
txb.object(SUI_SYSTEM_STATE_OBJECT_ID),
|
|
3114
|
-
txb.pure.address(subAccount),
|
|
3115
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
3116
|
-
],
|
|
3117
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
3118
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_collect_alphalend_strategy_reward_sui`
|
|
3119
|
-
});
|
|
3120
|
-
if (options?.gasBudget)
|
|
3121
|
-
txb.setGasBudget(options.gasBudget);
|
|
3122
|
-
if (options?.sender)
|
|
3123
|
-
txb.setSenderIfNotSet(options.sender);
|
|
3124
|
-
return txb;
|
|
3125
|
-
}
|
|
3126
2801
|
}
|
|
@@ -108,17 +108,6 @@ export declare class UserCalls extends OnChainCalls {
|
|
|
108
108
|
atomicInstantWithdrawWithSuilend(vaultId: string, poolCoinType: string, lendingMarketId: string, shares: NumStr, options?: IVaultOptionalParams & {
|
|
109
109
|
receiver?: SuiAddress;
|
|
110
110
|
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
111
|
-
/**
|
|
112
|
-
* Instantly withdraw collateral from an atomic vault routed through AlphaLend
|
|
113
|
-
* @param vaultId The id of the atomic vault
|
|
114
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
115
|
-
* @param shares The number of shares to withdraw
|
|
116
|
-
* @param options Optional tx execution params
|
|
117
|
-
* @returns OnChainCallResponse
|
|
118
|
-
*/
|
|
119
|
-
atomicInstantWithdrawWithAlphalend(vaultId: string, lendingProtocolId: string, shares: NumStr, options?: IVaultOptionalParams & {
|
|
120
|
-
receiver?: SuiAddress;
|
|
121
|
-
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
122
111
|
/**
|
|
123
112
|
* Swap ember shares (source vault receipt coin) into an atomic vault
|
|
124
113
|
* @param vaultId The id of the atomic vault
|
|
@@ -159,26 +148,6 @@ export declare class UserCalls extends OnChainCalls {
|
|
|
159
148
|
coinId?: string;
|
|
160
149
|
receiver?: SuiAddress;
|
|
161
150
|
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
162
|
-
/**
|
|
163
|
-
* Swap ember shares into an atomic vault, routing collateral through AlphaLend
|
|
164
|
-
* @param vaultId The id of the atomic vault
|
|
165
|
-
* @param sourceReceiptType The receipt coin type of the source vault (R)
|
|
166
|
-
* @param sourceVaultId Object id of the source Vault<T, R>
|
|
167
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
168
|
-
* @param amount The amount of source shares to swap
|
|
169
|
-
* @param minNetOut Minimum collateral to receive, in base units. The swap
|
|
170
|
-
* aborts below it. This is the A-9 slippage guard: the payout is
|
|
171
|
-
* gross - fee - holdback, and both the fee multiplier (which moves with
|
|
172
|
-
* utilization) and the source rate can change between quoting and
|
|
173
|
-
* landing. Pass the value from `previewSwapInstantWithdraw`; 0 disables
|
|
174
|
-
* the guard entirely.
|
|
175
|
-
* @param options Optional tx execution params
|
|
176
|
-
* @returns OnChainCallResponse
|
|
177
|
-
*/
|
|
178
|
-
atomicSwapEmberSharesWithAlphalend(vaultId: string, sourceReceiptType: string, sourceVaultId: string, lendingProtocolId: string, amount: NumStr, minNetOut: NumStr, options?: IVaultOptionalParams & {
|
|
179
|
-
coinId?: string;
|
|
180
|
-
receiver?: SuiAddress;
|
|
181
|
-
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
182
151
|
/**
|
|
183
152
|
* Swap ember shares into a SUI-collateral atomic vault via Suilend
|
|
184
153
|
* @param vaultId The id of the atomic vault (collateral must be SUI)
|
|
@@ -200,21 +169,6 @@ export declare class UserCalls extends OnChainCalls {
|
|
|
200
169
|
coinId?: string;
|
|
201
170
|
receiver?: SuiAddress;
|
|
202
171
|
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
203
|
-
/**
|
|
204
|
-
* Swap ember shares into a SUI-collateral atomic vault via AlphaLend
|
|
205
|
-
* @param vaultId The id of the atomic vault (collateral must be SUI)
|
|
206
|
-
* @param sourceReceiptType The receipt coin type of the source vault (R)
|
|
207
|
-
* @param sourceVaultId Object id of the source Vault<SUI, R>
|
|
208
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
209
|
-
* @param amount The amount of source shares to swap
|
|
210
|
-
* @param minNetOut Minimum collateral to receive, in base units (A-9 guard)
|
|
211
|
-
* @param options Optional tx execution params
|
|
212
|
-
* @returns OnChainCallResponse
|
|
213
|
-
*/
|
|
214
|
-
atomicSwapEmberSharesWithAlphalendSui(vaultId: string, sourceReceiptType: string, sourceVaultId: string, lendingProtocolId: string, amount: NumStr, minNetOut: NumStr, options?: IVaultOptionalParams & {
|
|
215
|
-
coinId?: string;
|
|
216
|
-
receiver?: SuiAddress;
|
|
217
|
-
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
218
172
|
/**
|
|
219
173
|
* Instant withdraw from a SUI-collateral atomic vault, pulling liquidity
|
|
220
174
|
* from Suilend
|
|
@@ -228,16 +182,4 @@ export declare class UserCalls extends OnChainCalls {
|
|
|
228
182
|
atomicInstantWithdrawWithSuilendSui(vaultId: string, poolCoinType: string, lendingMarketId: string, shares: NumStr, options?: IVaultOptionalParams & {
|
|
229
183
|
receiver?: SuiAddress;
|
|
230
184
|
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
231
|
-
/**
|
|
232
|
-
* Instant withdraw from a SUI-collateral atomic vault, pulling liquidity
|
|
233
|
-
* from AlphaLend
|
|
234
|
-
* @param vaultId The id of the atomic vault (collateral must be SUI)
|
|
235
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
236
|
-
* @param shares The number of atomic shares to burn
|
|
237
|
-
* @param options Optional tx execution params
|
|
238
|
-
* @returns OnChainCallResponse
|
|
239
|
-
*/
|
|
240
|
-
atomicInstantWithdrawWithAlphalendSui(vaultId: string, lendingProtocolId: string, shares: NumStr, options?: IVaultOptionalParams & {
|
|
241
|
-
receiver?: SuiAddress;
|
|
242
|
-
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
243
185
|
}
|