@ember-finance/sdk 2.5.0-pre.9 → 2.5.1
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/ERC20Token.json +2 -2
- package/dist/src/abis/EmberETHVault.json +5 -279
- package/dist/src/abis/EmberProtocolConfig.json +2 -170
- package/dist/src/abis/EmberVault.json +2 -2
- package/dist/src/abis/EmberVaultMintBurnOFTAdapter.json +2 -43
- package/dist/src/api/models/poc-report-asset.d.ts +6 -0
- package/dist/src/api/models/poc-report-protocol.d.ts +30 -0
- package/dist/src/api/models/poc-report-token.d.ts +36 -0
- package/dist/src/api/models/poc-report-wallet.d.ts +10 -4
- package/dist/src/api/v2/apis/accounts-api.d.ts +0 -5
- package/dist/src/api/v2/apis/accounts-api.js +1 -6
- package/dist/src/api/v2/apis/vaults-api.d.ts +43 -16
- package/dist/src/api/v2/apis/vaults-api.js +84 -21
- package/dist/src/api/v2/models/account-transaction-transaction-data.d.ts +1 -5
- package/dist/src/api/v2/models/account-transaction.d.ts +0 -5
- package/dist/src/api/v2/models/account-transaction.js +1 -6
- package/dist/src/api/v2/models/chain-vault-details.d.ts +13 -14
- package/dist/src/api/v2/models/chain-vault-details.js +6 -1
- package/dist/src/api/v2/models/evm-contracts.d.ts +0 -16
- package/dist/src/api/v2/models/index.d.ts +4 -9
- package/dist/src/api/v2/models/index.js +4 -9
- package/dist/src/api/v2/models/poc-report-asset.d.ts +6 -0
- package/dist/src/api/v2/models/poc-report-protocol.d.ts +30 -0
- package/dist/src/api/v2/models/poc-report-token.d.ts +36 -0
- package/dist/src/api/v2/models/poc-report-wallet.d.ts +10 -4
- package/dist/src/api/v2/models/transparency-group.d.ts +67 -0
- package/dist/src/api/v2/models/transparency-row.d.ts +138 -0
- package/dist/src/api/v2/models/{fee-multiplier-tier.js → transparency-row.js} +10 -1
- package/dist/src/api/v2/models/transparency-view.d.ts +22 -0
- package/dist/src/api/v2/models/{evm-atomic-vault.js → transparency-view.js} +10 -1
- package/dist/src/api/v2/models/vault-detail.d.ts +0 -11
- package/dist/src/api/v2/models/vault-detail.js +0 -4
- package/dist/src/api/v2/models/vault-transparency-report.d.ts +82 -0
- package/dist/src/ember-vaults.d.ts +1 -2
- package/dist/src/evm-vaults/on-chain-calls/index.d.ts +0 -1
- package/dist/src/evm-vaults/on-chain-calls/index.js +0 -1
- package/dist/src/evm-vaults/on-chain-calls/operator.d.ts +0 -10
- package/dist/src/evm-vaults/on-chain-calls/operator.js +0 -28
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.d.ts +0 -109
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.js +0 -281
- package/dist/src/evm-vaults/on-chain-calls/user.d.ts +0 -50
- package/dist/src/evm-vaults/on-chain-calls/user.js +0 -75
- package/dist/src/evm-vaults/on-chain-calls/vault-admin.d.ts +0 -55
- package/dist/src/evm-vaults/on-chain-calls/vault-admin.js +0 -122
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.d.ts +0 -6
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.js +0 -9
- package/dist/src/evm-vaults/utils/deployment-parser.d.ts +0 -8
- package/dist/src/evm-vaults/utils/deployment-parser.js +0 -11
- package/dist/src/sui-vaults/interfaces/index.d.ts +0 -15
- package/dist/src/sui-vaults/on-chain-calls/admin.d.ts +1 -37
- package/dist/src/sui-vaults/on-chain-calls/admin.js +0 -56
- package/dist/src/sui-vaults/on-chain-calls/index.d.ts +0 -1
- package/dist/src/sui-vaults/on-chain-calls/index.js +0 -1
- package/dist/src/sui-vaults/on-chain-calls/onchain-calls.d.ts +1 -2
- package/dist/src/sui-vaults/on-chain-calls/operator.d.ts +1 -129
- package/dist/src/sui-vaults/on-chain-calls/operator.js +0 -210
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +0 -482
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +0 -1430
- package/dist/src/sui-vaults/on-chain-calls/user.d.ts +1 -107
- package/dist/src/sui-vaults/on-chain-calls/user.js +0 -190
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +1 -229
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.js +0 -391
- package/dist/src/sui-vaults/on-chain-calls/vault.d.ts +1 -2
- package/dist/src/sui-vaults/utils/common.d.ts +1 -2
- package/dist/src/sui-vaults/utils/deployment-parser.d.ts +0 -12
- package/dist/src/sui-vaults/utils/deployment-parser.js +0 -24
- package/package.json +2 -3
- package/dist/src/abis/AtomicLiquidity.json +0 -4050
- package/dist/src/api/v2/models/escrow-claim-transaction.d.ts +0 -56
- package/dist/src/api/v2/models/evm-atomic-liquidity-lib.d.ts +0 -48
- package/dist/src/api/v2/models/evm-atomic-vault.d.ts +0 -102
- package/dist/src/api/v2/models/fee-multiplier-tier.d.ts +0 -30
- package/dist/src/api/v2/models/holdback-release-transaction.d.ts +0 -56
- package/dist/src/api/v2/models/holdback-release-transaction.js +0 -14
- package/dist/src/api/v2/models/instant-withdraw-config.d.ts +0 -109
- package/dist/src/api/v2/models/instant-withdraw-config.js +0 -14
- package/dist/src/api/v2/models/instant-withdraw-transaction.d.ts +0 -74
- package/dist/src/api/v2/models/instant-withdraw-transaction.js +0 -14
- package/dist/src/api/v2/models/instant-withdraw-via-swap-transaction.d.ts +0 -74
- package/dist/src/api/v2/models/instant-withdraw-via-swap-transaction.js +0 -14
- package/dist/src/api/v2/models/supported-ember-vault.d.ts +0 -42
- package/dist/src/api/v2/models/supported-ember-vault.js +0 -14
- package/dist/src/atomic/instant-withdraw.d.ts +0 -125
- package/dist/src/atomic/instant-withdraw.js +0 -122
- package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.d.ts +0 -98
- package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.js +0 -212
- package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.d.ts +0 -62
- package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.js +0 -174
- /package/dist/src/api/v2/models/{escrow-claim-transaction.js → transparency-group.js} +0 -0
- /package/dist/src/api/v2/models/{evm-atomic-liquidity-lib.js → vault-transparency-report.js} +0 -0
|
@@ -1018,1434 +1018,4 @@ export class TxBuilder {
|
|
|
1018
1018
|
txb.setSenderIfNotSet(options.sender);
|
|
1019
1019
|
return txb;
|
|
1020
1020
|
}
|
|
1021
|
-
// ============================================================================
|
|
1022
|
-
// Atomic Liquidity Vault (BFE-818)
|
|
1023
|
-
//
|
|
1024
|
-
// All entrypoints below target `gateway::atomic_*` (+ `create_atomic_vault`).
|
|
1025
|
-
// The atomic vault type is `AtomicLiquidityVault<T>` where `T` is the
|
|
1026
|
-
// collateral coin type and there is NO receipt token. `T` is resolved from
|
|
1027
|
-
// the deployment via `parser.getAtomicCollateralType(vaultId)` rather than
|
|
1028
|
-
// being passed explicitly. Functions that also need `R` (the source ember
|
|
1029
|
-
// vault receipt) or `P` (the Suilend pool coin type) take those type strings
|
|
1030
|
-
// as explicit method params. External objects (Suilend `LendingMarket<P>`,
|
|
1031
|
-
// AlphaLend `LendingProtocol`, source `Vault<T, R>`, and `Receiving<Coin>`
|
|
1032
|
-
// payment objects) are passed as object id strings.
|
|
1033
|
-
//
|
|
1034
|
-
// JUDGMENT CALLS NEEDING SUI-NODE VALIDATION:
|
|
1035
|
-
// - `Coin<T>` / `Coin<R>` arguments (atomicDeposit, atomicSwapEmberShares*,
|
|
1036
|
-
// atomicDepositFromSubAccount payments) are passed via `txb.object(coinId)`.
|
|
1037
|
-
// Callers are expected to pre-split/merge to an exact coin, mirroring the
|
|
1038
|
-
// existing receipt-vault `deposit`/`redeemShares` flow which does the
|
|
1039
|
-
// split in the role class before calling the builder.
|
|
1040
|
-
// - `Receiving<Coin<T>>` / `Receiving<Coin<R>>` arguments
|
|
1041
|
-
// (atomicDepositFromSubAccount, atomicClaimReceivedCollateral,
|
|
1042
|
-
// atomicClaimReturnedEmberShares) are passed via `txb.object(receivingId)`.
|
|
1043
|
-
// The Sui PTB builder resolves an owned/received object reference from a
|
|
1044
|
-
// plain object id; this should be validated against a live node.
|
|
1045
|
-
// - `Option<address>` receiver args use `txb.pure.option("address", x ?? null)`.
|
|
1046
|
-
// ============================================================================
|
|
1047
|
-
/**
|
|
1048
|
-
* Creates a new atomic liquidity vault
|
|
1049
|
-
* @param collateralCoinType Type of the collateral coin (T)
|
|
1050
|
-
* @param name Name of the vault
|
|
1051
|
-
* @param admin Admin of the vault
|
|
1052
|
-
* @param operator Operator of the vault
|
|
1053
|
-
* @param rateManager Rate manager of the vault
|
|
1054
|
-
* @param maxRateChangePerUpdate Max rate change per update
|
|
1055
|
-
* @param feePercentage Fee percentage
|
|
1056
|
-
* @param minWithdrawalShares Min withdrawal shares
|
|
1057
|
-
* @param rateUpdateInterval Rate update interval
|
|
1058
|
-
* @param maxTVL Max TVL
|
|
1059
|
-
* @param subAccounts Sub accounts
|
|
1060
|
-
* @param options Optional tx building params
|
|
1061
|
-
* @returns TransactionBlock
|
|
1062
|
-
*/
|
|
1063
|
-
createAtomicVault(collateralCoinType, name, admin, operator, rateManager, maxRateChangePerUpdate, feePercentage, minWithdrawalShares, rateUpdateInterval, maxTVL, subAccounts, options) {
|
|
1064
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1065
|
-
txb.moveCall({
|
|
1066
|
-
arguments: [
|
|
1067
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1068
|
-
txb.object(this.parser.getAdminCap()),
|
|
1069
|
-
txb.pure.string(name),
|
|
1070
|
-
txb.pure.address(admin),
|
|
1071
|
-
txb.pure.address(operator),
|
|
1072
|
-
txb.pure.address(rateManager),
|
|
1073
|
-
txb.pure.u64(maxRateChangePerUpdate),
|
|
1074
|
-
txb.pure.u64(feePercentage),
|
|
1075
|
-
txb.pure.u64(minWithdrawalShares),
|
|
1076
|
-
txb.pure.u64(rateUpdateInterval),
|
|
1077
|
-
txb.pure.u64(maxTVL),
|
|
1078
|
-
txb.pure.vector("address", subAccounts)
|
|
1079
|
-
],
|
|
1080
|
-
typeArguments: [collateralCoinType],
|
|
1081
|
-
target: `${this.parser.getPackageId()}::gateway::create_atomic_vault`
|
|
1082
|
-
});
|
|
1083
|
-
if (options?.gasBudget)
|
|
1084
|
-
txb.setGasBudget(options.gasBudget);
|
|
1085
|
-
if (options?.sender)
|
|
1086
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1087
|
-
return txb;
|
|
1088
|
-
}
|
|
1089
|
-
/**
|
|
1090
|
-
* Changes the admin of an atomic vault (protocol admin)
|
|
1091
|
-
* @param vaultId Id of the atomic vault
|
|
1092
|
-
* @param newAdmin New admin address
|
|
1093
|
-
* @param options Optional tx building params
|
|
1094
|
-
* @returns TransactionBlock
|
|
1095
|
-
*/
|
|
1096
|
-
atomicChangeVaultAdmin(vaultId, newAdmin, options) {
|
|
1097
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1098
|
-
txb.moveCall({
|
|
1099
|
-
arguments: [
|
|
1100
|
-
txb.object(vaultId),
|
|
1101
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1102
|
-
txb.object(this.parser.getAdminCap()),
|
|
1103
|
-
txb.pure.address(newAdmin)
|
|
1104
|
-
],
|
|
1105
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1106
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_change_vault_admin`
|
|
1107
|
-
});
|
|
1108
|
-
if (options?.gasBudget)
|
|
1109
|
-
txb.setGasBudget(options.gasBudget);
|
|
1110
|
-
if (options?.sender)
|
|
1111
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1112
|
-
return txb;
|
|
1113
|
-
}
|
|
1114
|
-
/**
|
|
1115
|
-
* Updates the name of an atomic vault
|
|
1116
|
-
* @param vaultId Id of the atomic vault
|
|
1117
|
-
* @param name New vault name
|
|
1118
|
-
* @param options Optional tx building params
|
|
1119
|
-
* @returns TransactionBlock
|
|
1120
|
-
*/
|
|
1121
|
-
atomicUpdateVaultName(vaultId, name, options) {
|
|
1122
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1123
|
-
txb.moveCall({
|
|
1124
|
-
arguments: [
|
|
1125
|
-
txb.object(vaultId),
|
|
1126
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1127
|
-
txb.pure.string(name)
|
|
1128
|
-
],
|
|
1129
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1130
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_update_vault_name`
|
|
1131
|
-
});
|
|
1132
|
-
if (options?.gasBudget)
|
|
1133
|
-
txb.setGasBudget(options.gasBudget);
|
|
1134
|
-
if (options?.sender)
|
|
1135
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1136
|
-
return txb;
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* Updates the max TVL of an atomic vault
|
|
1140
|
-
* @param vaultId Id of the atomic vault
|
|
1141
|
-
* @param maxTVL Max TVL
|
|
1142
|
-
* @param options Optional tx building params
|
|
1143
|
-
* @returns TransactionBlock
|
|
1144
|
-
*/
|
|
1145
|
-
atomicUpdateVaultMaxTvl(vaultId, maxTVL, options) {
|
|
1146
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1147
|
-
txb.moveCall({
|
|
1148
|
-
arguments: [
|
|
1149
|
-
txb.object(vaultId),
|
|
1150
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1151
|
-
txb.pure.u64(maxTVL)
|
|
1152
|
-
],
|
|
1153
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1154
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_update_vault_max_tvl`
|
|
1155
|
-
});
|
|
1156
|
-
if (options?.gasBudget)
|
|
1157
|
-
txb.setGasBudget(options.gasBudget);
|
|
1158
|
-
if (options?.sender)
|
|
1159
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1160
|
-
return txb;
|
|
1161
|
-
}
|
|
1162
|
-
/**
|
|
1163
|
-
* Updates the max rate change per update of an atomic vault
|
|
1164
|
-
* @param vaultId Id of the atomic vault
|
|
1165
|
-
* @param maxRateChangePerUpdate Max rate change per update
|
|
1166
|
-
* @param options Optional tx building params
|
|
1167
|
-
* @returns TransactionBlock
|
|
1168
|
-
*/
|
|
1169
|
-
atomicUpdateVaultMaxRateChangePerUpdate(vaultId, maxRateChangePerUpdate, options) {
|
|
1170
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1171
|
-
txb.moveCall({
|
|
1172
|
-
arguments: [
|
|
1173
|
-
txb.object(vaultId),
|
|
1174
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1175
|
-
txb.pure.u64(maxRateChangePerUpdate)
|
|
1176
|
-
],
|
|
1177
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1178
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_update_vault_max_rate_change_per_update`
|
|
1179
|
-
});
|
|
1180
|
-
if (options?.gasBudget)
|
|
1181
|
-
txb.setGasBudget(options.gasBudget);
|
|
1182
|
-
if (options?.sender)
|
|
1183
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1184
|
-
return txb;
|
|
1185
|
-
}
|
|
1186
|
-
/**
|
|
1187
|
-
* Changes the rate update interval of an atomic vault
|
|
1188
|
-
* @param vaultId Id of the atomic vault
|
|
1189
|
-
* @param interval Rate update interval in ms
|
|
1190
|
-
* @param options Optional tx building params
|
|
1191
|
-
* @returns TransactionBlock
|
|
1192
|
-
*/
|
|
1193
|
-
atomicChangeVaultRateUpdateInterval(vaultId, interval, options) {
|
|
1194
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1195
|
-
txb.moveCall({
|
|
1196
|
-
arguments: [
|
|
1197
|
-
txb.object(vaultId),
|
|
1198
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1199
|
-
txb.pure.u64(interval)
|
|
1200
|
-
],
|
|
1201
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1202
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_change_vault_rate_update_interval`
|
|
1203
|
-
});
|
|
1204
|
-
if (options?.gasBudget)
|
|
1205
|
-
txb.setGasBudget(options.gasBudget);
|
|
1206
|
-
if (options?.sender)
|
|
1207
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1208
|
-
return txb;
|
|
1209
|
-
}
|
|
1210
|
-
/**
|
|
1211
|
-
* Changes the operator of an atomic vault
|
|
1212
|
-
* @param vaultId Id of the atomic vault
|
|
1213
|
-
* @param newOperator New operator address
|
|
1214
|
-
* @param options Optional tx building params
|
|
1215
|
-
* @returns TransactionBlock
|
|
1216
|
-
*/
|
|
1217
|
-
atomicChangeVaultOperator(vaultId, newOperator, options) {
|
|
1218
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1219
|
-
txb.moveCall({
|
|
1220
|
-
arguments: [
|
|
1221
|
-
txb.object(vaultId),
|
|
1222
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1223
|
-
txb.pure.address(newOperator)
|
|
1224
|
-
],
|
|
1225
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1226
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_change_vault_operator`
|
|
1227
|
-
});
|
|
1228
|
-
if (options?.gasBudget)
|
|
1229
|
-
txb.setGasBudget(options.gasBudget);
|
|
1230
|
-
if (options?.sender)
|
|
1231
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1232
|
-
return txb;
|
|
1233
|
-
}
|
|
1234
|
-
/**
|
|
1235
|
-
* Updates the rate manager of an atomic vault
|
|
1236
|
-
* @param vaultId Id of the atomic vault
|
|
1237
|
-
* @param newRateManager New rate manager address
|
|
1238
|
-
* @param options Optional tx building params
|
|
1239
|
-
* @returns TransactionBlock
|
|
1240
|
-
*/
|
|
1241
|
-
atomicUpdateVaultRateManager(vaultId, newRateManager, options) {
|
|
1242
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1243
|
-
txb.moveCall({
|
|
1244
|
-
arguments: [
|
|
1245
|
-
txb.object(vaultId),
|
|
1246
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1247
|
-
txb.pure.address(newRateManager)
|
|
1248
|
-
],
|
|
1249
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1250
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_update_vault_rate_manager`
|
|
1251
|
-
});
|
|
1252
|
-
if (options?.gasBudget)
|
|
1253
|
-
txb.setGasBudget(options.gasBudget);
|
|
1254
|
-
if (options?.sender)
|
|
1255
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1256
|
-
return txb;
|
|
1257
|
-
}
|
|
1258
|
-
/**
|
|
1259
|
-
* Updates the fee percentage of an atomic vault
|
|
1260
|
-
* @param vaultId Id of the atomic vault
|
|
1261
|
-
* @param feePercentage Fee percentage
|
|
1262
|
-
* @param options Optional tx building params
|
|
1263
|
-
* @returns TransactionBlock
|
|
1264
|
-
*/
|
|
1265
|
-
atomicUpdateVaultFeePercentage(vaultId, feePercentage, options) {
|
|
1266
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1267
|
-
txb.moveCall({
|
|
1268
|
-
arguments: [
|
|
1269
|
-
txb.object(vaultId),
|
|
1270
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1271
|
-
txb.pure.u64(feePercentage),
|
|
1272
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1273
|
-
],
|
|
1274
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1275
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_update_vault_fee_percentage`
|
|
1276
|
-
});
|
|
1277
|
-
if (options?.gasBudget)
|
|
1278
|
-
txb.setGasBudget(options.gasBudget);
|
|
1279
|
-
if (options?.sender)
|
|
1280
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1281
|
-
return txb;
|
|
1282
|
-
}
|
|
1283
|
-
/**
|
|
1284
|
-
* Sets the min withdrawal shares of an atomic vault
|
|
1285
|
-
* @param vaultId Id of the atomic vault
|
|
1286
|
-
* @param minWithdrawalShares Min withdrawal shares
|
|
1287
|
-
* @param options Optional tx building params
|
|
1288
|
-
* @returns TransactionBlock
|
|
1289
|
-
*/
|
|
1290
|
-
atomicSetMinWithdrawalShares(vaultId, minWithdrawalShares, options) {
|
|
1291
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1292
|
-
txb.moveCall({
|
|
1293
|
-
arguments: [
|
|
1294
|
-
txb.object(vaultId),
|
|
1295
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1296
|
-
txb.pure.u64(minWithdrawalShares)
|
|
1297
|
-
],
|
|
1298
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1299
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_min_withdrawal_shares`
|
|
1300
|
-
});
|
|
1301
|
-
if (options?.gasBudget)
|
|
1302
|
-
txb.setGasBudget(options.gasBudget);
|
|
1303
|
-
if (options?.sender)
|
|
1304
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1305
|
-
return txb;
|
|
1306
|
-
}
|
|
1307
|
-
/**
|
|
1308
|
-
* Sets / unsets a sub account on an atomic vault
|
|
1309
|
-
* @param vaultId Id of the atomic vault
|
|
1310
|
-
* @param account Sub account address
|
|
1311
|
-
* @param status Status of the sub account
|
|
1312
|
-
* @param options Optional tx building params
|
|
1313
|
-
* @returns TransactionBlock
|
|
1314
|
-
*/
|
|
1315
|
-
atomicSetSubAccount(vaultId, account, status, options) {
|
|
1316
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1317
|
-
txb.moveCall({
|
|
1318
|
-
arguments: [
|
|
1319
|
-
txb.object(vaultId),
|
|
1320
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1321
|
-
txb.pure.address(account),
|
|
1322
|
-
txb.pure.bool(status)
|
|
1323
|
-
],
|
|
1324
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1325
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_sub_account`
|
|
1326
|
-
});
|
|
1327
|
-
if (options?.gasBudget)
|
|
1328
|
-
txb.setGasBudget(options.gasBudget);
|
|
1329
|
-
if (options?.sender)
|
|
1330
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1331
|
-
return txb;
|
|
1332
|
-
}
|
|
1333
|
-
/**
|
|
1334
|
-
* Sets the pause status of an operation on an atomic vault
|
|
1335
|
-
* @param vaultId Id of the atomic vault
|
|
1336
|
-
* @param operation Operation identifier bytes (vector<u8>)
|
|
1337
|
-
* @param paused Paused status
|
|
1338
|
-
* @param options Optional tx building params
|
|
1339
|
-
* @returns TransactionBlock
|
|
1340
|
-
*/
|
|
1341
|
-
atomicSetPauseStatus(vaultId, operation, paused, options) {
|
|
1342
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1343
|
-
txb.moveCall({
|
|
1344
|
-
arguments: [
|
|
1345
|
-
txb.object(vaultId),
|
|
1346
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1347
|
-
txb.pure.vector("u8", operation),
|
|
1348
|
-
txb.pure.bool(paused)
|
|
1349
|
-
],
|
|
1350
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1351
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_pause_status`
|
|
1352
|
-
});
|
|
1353
|
-
if (options?.gasBudget)
|
|
1354
|
-
txb.setGasBudget(options.gasBudget);
|
|
1355
|
-
if (options?.sender)
|
|
1356
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1357
|
-
return txb;
|
|
1358
|
-
}
|
|
1359
|
-
/**
|
|
1360
|
-
* Sets the max instant withdraw shares of an atomic vault
|
|
1361
|
-
* @param vaultId Id of the atomic vault
|
|
1362
|
-
* @param newMax New max instant withdraw shares
|
|
1363
|
-
* @param options Optional tx building params
|
|
1364
|
-
* @returns TransactionBlock
|
|
1365
|
-
*/
|
|
1366
|
-
atomicSetMaxInstantWithdrawShares(vaultId, newMax, options) {
|
|
1367
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1368
|
-
txb.moveCall({
|
|
1369
|
-
arguments: [
|
|
1370
|
-
txb.object(vaultId),
|
|
1371
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1372
|
-
txb.pure.u64(newMax)
|
|
1373
|
-
],
|
|
1374
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1375
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_max_instant_withdraw_shares`
|
|
1376
|
-
});
|
|
1377
|
-
if (options?.gasBudget)
|
|
1378
|
-
txb.setGasBudget(options.gasBudget);
|
|
1379
|
-
if (options?.sender)
|
|
1380
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1381
|
-
return txb;
|
|
1382
|
-
}
|
|
1383
|
-
/**
|
|
1384
|
-
* Sets the instant withdraw fee percentage of an atomic vault
|
|
1385
|
-
* @param vaultId Id of the atomic vault
|
|
1386
|
-
* @param newFeePercentage New instant withdraw fee percentage
|
|
1387
|
-
* @param options Optional tx building params
|
|
1388
|
-
* @returns TransactionBlock
|
|
1389
|
-
*/
|
|
1390
|
-
atomicSetInstantWithdrawFeePercentage(vaultId, newFeePercentage, options) {
|
|
1391
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1392
|
-
txb.moveCall({
|
|
1393
|
-
arguments: [
|
|
1394
|
-
txb.object(vaultId),
|
|
1395
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1396
|
-
txb.pure.u64(newFeePercentage)
|
|
1397
|
-
],
|
|
1398
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1399
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_instant_withdraw_fee_percentage`
|
|
1400
|
-
});
|
|
1401
|
-
if (options?.gasBudget)
|
|
1402
|
-
txb.setGasBudget(options.gasBudget);
|
|
1403
|
-
if (options?.sender)
|
|
1404
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1405
|
-
return txb;
|
|
1406
|
-
}
|
|
1407
|
-
/**
|
|
1408
|
-
* Whitelists (or updates) an ember share source vault for an atomic vault
|
|
1409
|
-
* @param vaultId Id of the atomic vault
|
|
1410
|
-
* @param shareVaultId Id of the source ember share vault
|
|
1411
|
-
* @param whitelisted Whitelist status
|
|
1412
|
-
* @param feePercentage Fee percentage
|
|
1413
|
-
* @param maxCapacityPercentage Max capacity percentage
|
|
1414
|
-
* @param holdbackPercentage Holdback percentage
|
|
1415
|
-
* @param maxUtilizationPercentage Max utilization percentage
|
|
1416
|
-
* @param options Optional tx building params
|
|
1417
|
-
* @returns TransactionBlock
|
|
1418
|
-
*/
|
|
1419
|
-
atomicSetEmberShareWhitelist(vaultId, shareVaultId, whitelisted, feePercentage, maxCapacityPercentage, holdbackPercentage, maxUtilizationPercentage, options) {
|
|
1420
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1421
|
-
txb.moveCall({
|
|
1422
|
-
arguments: [
|
|
1423
|
-
txb.object(vaultId),
|
|
1424
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1425
|
-
txb.pure.id(shareVaultId),
|
|
1426
|
-
txb.pure.bool(whitelisted),
|
|
1427
|
-
txb.pure.u64(feePercentage),
|
|
1428
|
-
txb.pure.u64(maxCapacityPercentage),
|
|
1429
|
-
txb.pure.u64(holdbackPercentage),
|
|
1430
|
-
txb.pure.u64(maxUtilizationPercentage)
|
|
1431
|
-
],
|
|
1432
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1433
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_ember_share_whitelist`
|
|
1434
|
-
});
|
|
1435
|
-
if (options?.gasBudget)
|
|
1436
|
-
txb.setGasBudget(options.gasBudget);
|
|
1437
|
-
if (options?.sender)
|
|
1438
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1439
|
-
return txb;
|
|
1440
|
-
}
|
|
1441
|
-
/**
|
|
1442
|
-
* Sets the max utilization percentage of an ember share source vault
|
|
1443
|
-
* @param vaultId Id of the atomic vault
|
|
1444
|
-
* @param shareVaultId Id of the source ember share vault
|
|
1445
|
-
* @param maxUtilizationPercentage Max utilization percentage
|
|
1446
|
-
* @param options Optional tx building params
|
|
1447
|
-
* @returns TransactionBlock
|
|
1448
|
-
*/
|
|
1449
|
-
atomicSetEmberShareMaxUtilization(vaultId, shareVaultId, maxUtilizationPercentage, options) {
|
|
1450
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1451
|
-
txb.moveCall({
|
|
1452
|
-
arguments: [
|
|
1453
|
-
txb.object(vaultId),
|
|
1454
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1455
|
-
txb.pure.id(shareVaultId),
|
|
1456
|
-
txb.pure.u64(maxUtilizationPercentage)
|
|
1457
|
-
],
|
|
1458
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1459
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_ember_share_max_utilization`
|
|
1460
|
-
});
|
|
1461
|
-
if (options?.gasBudget)
|
|
1462
|
-
txb.setGasBudget(options.gasBudget);
|
|
1463
|
-
if (options?.sender)
|
|
1464
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1465
|
-
return txb;
|
|
1466
|
-
}
|
|
1467
|
-
/**
|
|
1468
|
-
* Sets a fee multiplier tier for an ember share source vault
|
|
1469
|
-
* @param vaultId Id of the atomic vault
|
|
1470
|
-
* @param shareVaultId Id of the source ember share vault
|
|
1471
|
-
* @param threshold Tier threshold
|
|
1472
|
-
* @param multiplier Tier multiplier
|
|
1473
|
-
* @param options Optional tx building params
|
|
1474
|
-
* @returns TransactionBlock
|
|
1475
|
-
*/
|
|
1476
|
-
atomicSetEmberShareFeeMultiplierTier(vaultId, shareVaultId, threshold, multiplier, options) {
|
|
1477
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1478
|
-
txb.moveCall({
|
|
1479
|
-
arguments: [
|
|
1480
|
-
txb.object(vaultId),
|
|
1481
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1482
|
-
txb.pure.id(shareVaultId),
|
|
1483
|
-
txb.pure.u64(threshold),
|
|
1484
|
-
txb.pure.u64(multiplier)
|
|
1485
|
-
],
|
|
1486
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1487
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_ember_share_fee_multiplier_tier`
|
|
1488
|
-
});
|
|
1489
|
-
if (options?.gasBudget)
|
|
1490
|
-
txb.setGasBudget(options.gasBudget);
|
|
1491
|
-
if (options?.sender)
|
|
1492
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1493
|
-
return txb;
|
|
1494
|
-
}
|
|
1495
|
-
/**
|
|
1496
|
-
* Removes a fee multiplier tier for an ember share source vault
|
|
1497
|
-
* @param vaultId Id of the atomic vault
|
|
1498
|
-
* @param shareVaultId Id of the source ember share vault
|
|
1499
|
-
* @param threshold Tier threshold to remove
|
|
1500
|
-
* @param options Optional tx building params
|
|
1501
|
-
* @returns TransactionBlock
|
|
1502
|
-
*/
|
|
1503
|
-
atomicRemoveEmberShareFeeMultiplierTier(vaultId, shareVaultId, threshold, options) {
|
|
1504
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1505
|
-
txb.moveCall({
|
|
1506
|
-
arguments: [
|
|
1507
|
-
txb.object(vaultId),
|
|
1508
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1509
|
-
txb.pure.id(shareVaultId),
|
|
1510
|
-
txb.pure.u64(threshold)
|
|
1511
|
-
],
|
|
1512
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1513
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_remove_ember_share_fee_multiplier_tier`
|
|
1514
|
-
});
|
|
1515
|
-
if (options?.gasBudget)
|
|
1516
|
-
txb.setGasBudget(options.gasBudget);
|
|
1517
|
-
if (options?.sender)
|
|
1518
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1519
|
-
return txb;
|
|
1520
|
-
}
|
|
1521
|
-
/**
|
|
1522
|
-
* Sets a swap waiver for an account on an atomic vault
|
|
1523
|
-
* @param vaultId Id of the atomic vault
|
|
1524
|
-
* @param account Account address
|
|
1525
|
-
* @param feeWaived Whether the swap fee is waived
|
|
1526
|
-
* @param holdbackWaived Whether the holdback is waived
|
|
1527
|
-
* @param options Optional tx building params
|
|
1528
|
-
* @returns TransactionBlock
|
|
1529
|
-
*/
|
|
1530
|
-
atomicSetSwapWaiver(vaultId, account, feeWaived, holdbackWaived, options) {
|
|
1531
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1532
|
-
txb.moveCall({
|
|
1533
|
-
arguments: [
|
|
1534
|
-
txb.object(vaultId),
|
|
1535
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1536
|
-
txb.pure.address(account),
|
|
1537
|
-
txb.pure.bool(feeWaived),
|
|
1538
|
-
txb.pure.bool(holdbackWaived)
|
|
1539
|
-
],
|
|
1540
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1541
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_swap_waiver`
|
|
1542
|
-
});
|
|
1543
|
-
if (options?.gasBudget)
|
|
1544
|
-
txb.setGasBudget(options.gasBudget);
|
|
1545
|
-
if (options?.sender)
|
|
1546
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1547
|
-
return txb;
|
|
1548
|
-
}
|
|
1549
|
-
/**
|
|
1550
|
-
* Sets the permanent withdrawal fee percentage of an atomic vault
|
|
1551
|
-
* @param vaultId Id of the atomic vault
|
|
1552
|
-
* @param permanentFeePercentage Permanent fee percentage
|
|
1553
|
-
* @param options Optional tx building params
|
|
1554
|
-
* @returns TransactionBlock
|
|
1555
|
-
*/
|
|
1556
|
-
atomicSetPermanentFeePercentage(vaultId, permanentFeePercentage, options) {
|
|
1557
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1558
|
-
txb.moveCall({
|
|
1559
|
-
arguments: [
|
|
1560
|
-
txb.object(vaultId),
|
|
1561
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1562
|
-
txb.pure.u64(permanentFeePercentage)
|
|
1563
|
-
],
|
|
1564
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1565
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_permanent_fee_percentage`
|
|
1566
|
-
});
|
|
1567
|
-
if (options?.gasBudget)
|
|
1568
|
-
txb.setGasBudget(options.gasBudget);
|
|
1569
|
-
if (options?.sender)
|
|
1570
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1571
|
-
return txb;
|
|
1572
|
-
}
|
|
1573
|
-
/**
|
|
1574
|
-
* Sets the time based withdrawal fee percentage of an atomic vault
|
|
1575
|
-
* @param vaultId Id of the atomic vault
|
|
1576
|
-
* @param timeBasedFeePercentage Time based fee percentage
|
|
1577
|
-
* @param options Optional tx building params
|
|
1578
|
-
* @returns TransactionBlock
|
|
1579
|
-
*/
|
|
1580
|
-
atomicSetTimeBasedFeePercentage(vaultId, timeBasedFeePercentage, options) {
|
|
1581
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1582
|
-
txb.moveCall({
|
|
1583
|
-
arguments: [
|
|
1584
|
-
txb.object(vaultId),
|
|
1585
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1586
|
-
txb.pure.u64(timeBasedFeePercentage)
|
|
1587
|
-
],
|
|
1588
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1589
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_time_based_fee_percentage`
|
|
1590
|
-
});
|
|
1591
|
-
if (options?.gasBudget)
|
|
1592
|
-
txb.setGasBudget(options.gasBudget);
|
|
1593
|
-
if (options?.sender)
|
|
1594
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1595
|
-
return txb;
|
|
1596
|
-
}
|
|
1597
|
-
/**
|
|
1598
|
-
* Sets the time based withdrawal fee threshold of an atomic vault
|
|
1599
|
-
* @param vaultId Id of the atomic vault
|
|
1600
|
-
* @param timeBasedFeeThreshold Time based fee threshold
|
|
1601
|
-
* @param options Optional tx building params
|
|
1602
|
-
* @returns TransactionBlock
|
|
1603
|
-
*/
|
|
1604
|
-
atomicSetTimeBasedFeeThreshold(vaultId, timeBasedFeeThreshold, options) {
|
|
1605
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1606
|
-
txb.moveCall({
|
|
1607
|
-
arguments: [
|
|
1608
|
-
txb.object(vaultId),
|
|
1609
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1610
|
-
txb.pure.u64(timeBasedFeeThreshold)
|
|
1611
|
-
],
|
|
1612
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1613
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_time_based_fee_threshold`
|
|
1614
|
-
});
|
|
1615
|
-
if (options?.gasBudget)
|
|
1616
|
-
txb.setGasBudget(options.gasBudget);
|
|
1617
|
-
if (options?.sender)
|
|
1618
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1619
|
-
return txb;
|
|
1620
|
-
}
|
|
1621
|
-
/**
|
|
1622
|
-
* Sets / unsets a user on the fee exemption list of an atomic vault
|
|
1623
|
-
* @param vaultId Id of the atomic vault
|
|
1624
|
-
* @param user User address
|
|
1625
|
-
* @param status Status of the user in the fee exemption list
|
|
1626
|
-
* @param options Optional tx building params
|
|
1627
|
-
* @returns TransactionBlock
|
|
1628
|
-
*/
|
|
1629
|
-
atomicSetFeeExemptionList(vaultId, user, status, options) {
|
|
1630
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1631
|
-
txb.moveCall({
|
|
1632
|
-
arguments: [
|
|
1633
|
-
txb.object(vaultId),
|
|
1634
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1635
|
-
txb.pure.address(user),
|
|
1636
|
-
txb.pure.bool(status)
|
|
1637
|
-
],
|
|
1638
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1639
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_fee_exemption_list`
|
|
1640
|
-
});
|
|
1641
|
-
if (options?.gasBudget)
|
|
1642
|
-
txb.setGasBudget(options.gasBudget);
|
|
1643
|
-
if (options?.sender)
|
|
1644
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1645
|
-
return txb;
|
|
1646
|
-
}
|
|
1647
|
-
/**
|
|
1648
|
-
* Switches an atomic vault from the Suilend strategy to STRATEGY_NONE,
|
|
1649
|
-
* draining cTokens back into the vault balance.
|
|
1650
|
-
* @param vaultId Id of the atomic vault
|
|
1651
|
-
* @param poolCoinType Suilend pool coin type (P)
|
|
1652
|
-
* @param lendingMarketId Object id of the Suilend LendingMarket<P>
|
|
1653
|
-
* @param options Optional tx building params
|
|
1654
|
-
* @returns TransactionBlock
|
|
1655
|
-
*/
|
|
1656
|
-
atomicSetStrategyNoneFromSuilend(vaultId, poolCoinType, lendingMarketId, options) {
|
|
1657
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1658
|
-
txb.moveCall({
|
|
1659
|
-
arguments: [
|
|
1660
|
-
txb.object(vaultId),
|
|
1661
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1662
|
-
txb.object(lendingMarketId),
|
|
1663
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1664
|
-
],
|
|
1665
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId), poolCoinType],
|
|
1666
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_strategy_none_from_suilend`
|
|
1667
|
-
});
|
|
1668
|
-
if (options?.gasBudget)
|
|
1669
|
-
txb.setGasBudget(options.gasBudget);
|
|
1670
|
-
if (options?.sender)
|
|
1671
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1672
|
-
return txb;
|
|
1673
|
-
}
|
|
1674
|
-
/**
|
|
1675
|
-
* Switches an atomic vault from the AlphaLend strategy to STRATEGY_NONE,
|
|
1676
|
-
* draining the full position collateral back into the vault balance.
|
|
1677
|
-
* @param vaultId Id of the atomic vault
|
|
1678
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
1679
|
-
* @param options Optional tx building params
|
|
1680
|
-
* @returns TransactionBlock
|
|
1681
|
-
*/
|
|
1682
|
-
atomicSetStrategyNoneFromAlphalend(vaultId, lendingProtocolId, options) {
|
|
1683
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1684
|
-
txb.moveCall({
|
|
1685
|
-
arguments: [
|
|
1686
|
-
txb.object(vaultId),
|
|
1687
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1688
|
-
txb.object(lendingProtocolId),
|
|
1689
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1690
|
-
],
|
|
1691
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1692
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_strategy_none_from_alphalend`
|
|
1693
|
-
});
|
|
1694
|
-
if (options?.gasBudget)
|
|
1695
|
-
txb.setGasBudget(options.gasBudget);
|
|
1696
|
-
if (options?.sender)
|
|
1697
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1698
|
-
return txb;
|
|
1699
|
-
}
|
|
1700
|
-
/**
|
|
1701
|
-
* Sets the Suilend strategy for an atomic vault
|
|
1702
|
-
* @param vaultId Id of the atomic vault
|
|
1703
|
-
* @param reserveArrayIndex Suilend reserve array index
|
|
1704
|
-
* @param options Optional tx building params
|
|
1705
|
-
* @returns TransactionBlock
|
|
1706
|
-
*/
|
|
1707
|
-
atomicSetStrategySuilend(vaultId, reserveArrayIndex, options) {
|
|
1708
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1709
|
-
txb.moveCall({
|
|
1710
|
-
arguments: [
|
|
1711
|
-
txb.object(vaultId),
|
|
1712
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1713
|
-
txb.pure.u64(reserveArrayIndex)
|
|
1714
|
-
],
|
|
1715
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1716
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_strategy_suilend`
|
|
1717
|
-
});
|
|
1718
|
-
if (options?.gasBudget)
|
|
1719
|
-
txb.setGasBudget(options.gasBudget);
|
|
1720
|
-
if (options?.sender)
|
|
1721
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1722
|
-
return txb;
|
|
1723
|
-
}
|
|
1724
|
-
/**
|
|
1725
|
-
* Sets the AlphaLend strategy for an atomic vault
|
|
1726
|
-
* @param vaultId Id of the atomic vault
|
|
1727
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
1728
|
-
* @param marketId AlphaLend market id
|
|
1729
|
-
* @param options Optional tx building params
|
|
1730
|
-
* @returns TransactionBlock
|
|
1731
|
-
*/
|
|
1732
|
-
atomicSetStrategyAlphalend(vaultId, lendingProtocolId, marketId, options) {
|
|
1733
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1734
|
-
txb.moveCall({
|
|
1735
|
-
arguments: [
|
|
1736
|
-
txb.object(vaultId),
|
|
1737
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1738
|
-
txb.object(lendingProtocolId),
|
|
1739
|
-
txb.pure.u64(marketId)
|
|
1740
|
-
],
|
|
1741
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1742
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_strategy_alphalend`
|
|
1743
|
-
});
|
|
1744
|
-
if (options?.gasBudget)
|
|
1745
|
-
txb.setGasBudget(options.gasBudget);
|
|
1746
|
-
if (options?.sender)
|
|
1747
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1748
|
-
return txb;
|
|
1749
|
-
}
|
|
1750
|
-
/**
|
|
1751
|
-
* Sets / unsets a blacklisted account on an atomic vault
|
|
1752
|
-
* @param vaultId Id of the atomic vault
|
|
1753
|
-
* @param account Account address
|
|
1754
|
-
* @param status Blacklist status
|
|
1755
|
-
* @param options Optional tx building params
|
|
1756
|
-
* @returns TransactionBlock
|
|
1757
|
-
*/
|
|
1758
|
-
atomicSetBlacklistedAccount(vaultId, account, status, options) {
|
|
1759
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1760
|
-
txb.moveCall({
|
|
1761
|
-
arguments: [
|
|
1762
|
-
txb.object(vaultId),
|
|
1763
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1764
|
-
txb.pure.address(account),
|
|
1765
|
-
txb.pure.bool(status)
|
|
1766
|
-
],
|
|
1767
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1768
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_blacklisted_account`
|
|
1769
|
-
});
|
|
1770
|
-
if (options?.gasBudget)
|
|
1771
|
-
txb.setGasBudget(options.gasBudget);
|
|
1772
|
-
if (options?.sender)
|
|
1773
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1774
|
-
return txb;
|
|
1775
|
-
}
|
|
1776
|
-
/**
|
|
1777
|
-
* Sets / unsets a user on the deposit user list of an atomic vault
|
|
1778
|
-
* @param vaultId Id of the atomic vault
|
|
1779
|
-
* @param user User address
|
|
1780
|
-
* @param status Status of the user in the deposit list
|
|
1781
|
-
* @param options Optional tx building params
|
|
1782
|
-
* @returns TransactionBlock
|
|
1783
|
-
*/
|
|
1784
|
-
atomicSetDepositUserList(vaultId, user, status, options) {
|
|
1785
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1786
|
-
txb.moveCall({
|
|
1787
|
-
arguments: [
|
|
1788
|
-
txb.object(vaultId),
|
|
1789
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1790
|
-
txb.pure.address(user),
|
|
1791
|
-
txb.pure.bool(status)
|
|
1792
|
-
],
|
|
1793
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1794
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_set_deposit_user_list`
|
|
1795
|
-
});
|
|
1796
|
-
if (options?.gasBudget)
|
|
1797
|
-
txb.setGasBudget(options.gasBudget);
|
|
1798
|
-
if (options?.sender)
|
|
1799
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1800
|
-
return txb;
|
|
1801
|
-
}
|
|
1802
|
-
/**
|
|
1803
|
-
* Supplies collateral from an atomic vault to one of its sub accounts
|
|
1804
|
-
* @param vaultId Id of the atomic vault
|
|
1805
|
-
* @param subAccount Sub account address
|
|
1806
|
-
* @param amount Amount to supply
|
|
1807
|
-
* @param options Optional tx building params
|
|
1808
|
-
* @returns TransactionBlock
|
|
1809
|
-
*/
|
|
1810
|
-
atomicSupplyToSubAccount(vaultId, subAccount, amount, options) {
|
|
1811
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1812
|
-
txb.moveCall({
|
|
1813
|
-
arguments: [
|
|
1814
|
-
txb.object(vaultId),
|
|
1815
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1816
|
-
txb.pure.address(subAccount),
|
|
1817
|
-
txb.pure.u64(amount)
|
|
1818
|
-
],
|
|
1819
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1820
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_supply_to_sub_account`
|
|
1821
|
-
});
|
|
1822
|
-
if (options?.gasBudget)
|
|
1823
|
-
txb.setGasBudget(options.gasBudget);
|
|
1824
|
-
if (options?.sender)
|
|
1825
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1826
|
-
return txb;
|
|
1827
|
-
}
|
|
1828
|
-
/**
|
|
1829
|
-
* Deposits collateral back into an atomic vault from a sub account
|
|
1830
|
-
* @param vaultId Id of the atomic vault
|
|
1831
|
-
* @param tokenId Object id of the Receiving<Coin<T>> payment to claim
|
|
1832
|
-
* @param subAccount Sub account address
|
|
1833
|
-
* @param options Optional tx building params
|
|
1834
|
-
* @returns TransactionBlock
|
|
1835
|
-
*/
|
|
1836
|
-
atomicDepositFromSubAccount(vaultId, tokenId, subAccount, options) {
|
|
1837
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1838
|
-
txb.moveCall({
|
|
1839
|
-
arguments: [
|
|
1840
|
-
txb.object(vaultId),
|
|
1841
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1842
|
-
txb.object(tokenId),
|
|
1843
|
-
txb.pure.address(subAccount)
|
|
1844
|
-
],
|
|
1845
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1846
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_deposit_from_sub_account`
|
|
1847
|
-
});
|
|
1848
|
-
if (options?.gasBudget)
|
|
1849
|
-
txb.setGasBudget(options.gasBudget);
|
|
1850
|
-
if (options?.sender)
|
|
1851
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1852
|
-
return txb;
|
|
1853
|
-
}
|
|
1854
|
-
/**
|
|
1855
|
-
* Collects the platform fee of an atomic vault
|
|
1856
|
-
* @param vaultId Id of the atomic vault
|
|
1857
|
-
* @param loss Reported loss amount
|
|
1858
|
-
* @param options Optional tx building params
|
|
1859
|
-
* @returns TransactionBlock
|
|
1860
|
-
*/
|
|
1861
|
-
atomicCollectPlatformFee(vaultId, loss, options) {
|
|
1862
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1863
|
-
txb.moveCall({
|
|
1864
|
-
arguments: [
|
|
1865
|
-
txb.object(vaultId),
|
|
1866
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1867
|
-
txb.pure.u64(loss),
|
|
1868
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1869
|
-
],
|
|
1870
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1871
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_collect_platform_fee`
|
|
1872
|
-
});
|
|
1873
|
-
if (options?.gasBudget)
|
|
1874
|
-
txb.setGasBudget(options.gasBudget);
|
|
1875
|
-
if (options?.sender)
|
|
1876
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1877
|
-
return txb;
|
|
1878
|
-
}
|
|
1879
|
-
/**
|
|
1880
|
-
* Processes pending withdrawal requests of an atomic vault
|
|
1881
|
-
* @param vaultId Id of the atomic vault
|
|
1882
|
-
* @param maxRequests Max number of requests to process
|
|
1883
|
-
* @param options Optional tx building params
|
|
1884
|
-
* @returns TransactionBlock
|
|
1885
|
-
*/
|
|
1886
|
-
atomicProcessWithdrawalRequests(vaultId, maxRequests, options) {
|
|
1887
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1888
|
-
txb.moveCall({
|
|
1889
|
-
arguments: [
|
|
1890
|
-
txb.object(vaultId),
|
|
1891
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1892
|
-
txb.pure.u64(maxRequests),
|
|
1893
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1894
|
-
],
|
|
1895
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1896
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_process_withdrawal_requests`
|
|
1897
|
-
});
|
|
1898
|
-
if (options?.gasBudget)
|
|
1899
|
-
txb.setGasBudget(options.gasBudget);
|
|
1900
|
-
if (options?.sender)
|
|
1901
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1902
|
-
return txb;
|
|
1903
|
-
}
|
|
1904
|
-
/**
|
|
1905
|
-
* Processes pending withdrawal requests of an atomic vault up to a timestamp
|
|
1906
|
-
* @param vaultId Id of the atomic vault
|
|
1907
|
-
* @param timestamp Timestamp to process up to
|
|
1908
|
-
* @param options Optional tx building params
|
|
1909
|
-
* @returns TransactionBlock
|
|
1910
|
-
*/
|
|
1911
|
-
atomicProcessWithdrawalRequestsUpToTimestamp(vaultId, timestamp, options) {
|
|
1912
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1913
|
-
txb.moveCall({
|
|
1914
|
-
arguments: [
|
|
1915
|
-
txb.object(vaultId),
|
|
1916
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1917
|
-
txb.pure.u64(timestamp),
|
|
1918
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1919
|
-
],
|
|
1920
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1921
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_process_withdrawal_requests_up_to_timestamp`
|
|
1922
|
-
});
|
|
1923
|
-
if (options?.gasBudget)
|
|
1924
|
-
txb.setGasBudget(options.gasBudget);
|
|
1925
|
-
if (options?.sender)
|
|
1926
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1927
|
-
return txb;
|
|
1928
|
-
}
|
|
1929
|
-
/**
|
|
1930
|
-
* Supplies collateral from an atomic vault into the Suilend strategy
|
|
1931
|
-
* @param vaultId Id of the atomic vault
|
|
1932
|
-
* @param poolCoinType Suilend pool coin type (P)
|
|
1933
|
-
* @param lendingMarketId Object id of the Suilend LendingMarket<P>
|
|
1934
|
-
* @param amount Amount to supply
|
|
1935
|
-
* @param options Optional tx building params
|
|
1936
|
-
* @returns TransactionBlock
|
|
1937
|
-
*/
|
|
1938
|
-
atomicSupplyToSuilendStrategy(vaultId, poolCoinType, lendingMarketId, amount, options) {
|
|
1939
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1940
|
-
txb.moveCall({
|
|
1941
|
-
arguments: [
|
|
1942
|
-
txb.object(vaultId),
|
|
1943
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1944
|
-
txb.object(lendingMarketId),
|
|
1945
|
-
txb.pure.u64(amount),
|
|
1946
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1947
|
-
],
|
|
1948
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId), poolCoinType],
|
|
1949
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_supply_to_suilend_strategy`
|
|
1950
|
-
});
|
|
1951
|
-
if (options?.gasBudget)
|
|
1952
|
-
txb.setGasBudget(options.gasBudget);
|
|
1953
|
-
if (options?.sender)
|
|
1954
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1955
|
-
return txb;
|
|
1956
|
-
}
|
|
1957
|
-
/**
|
|
1958
|
-
* Supplies collateral from an atomic vault into the AlphaLend strategy
|
|
1959
|
-
* @param vaultId Id of the atomic vault
|
|
1960
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
1961
|
-
* @param amount Amount to supply
|
|
1962
|
-
* @param options Optional tx building params
|
|
1963
|
-
* @returns TransactionBlock
|
|
1964
|
-
*/
|
|
1965
|
-
atomicSupplyToAlphalendStrategy(vaultId, lendingProtocolId, amount, options) {
|
|
1966
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1967
|
-
txb.moveCall({
|
|
1968
|
-
arguments: [
|
|
1969
|
-
txb.object(vaultId),
|
|
1970
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1971
|
-
txb.object(lendingProtocolId),
|
|
1972
|
-
txb.pure.u64(amount),
|
|
1973
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
1974
|
-
],
|
|
1975
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
1976
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_supply_to_alphalend_strategy`
|
|
1977
|
-
});
|
|
1978
|
-
if (options?.gasBudget)
|
|
1979
|
-
txb.setGasBudget(options.gasBudget);
|
|
1980
|
-
if (options?.sender)
|
|
1981
|
-
txb.setSenderIfNotSet(options.sender);
|
|
1982
|
-
return txb;
|
|
1983
|
-
}
|
|
1984
|
-
/**
|
|
1985
|
-
* Withdraws collateral from the Suilend strategy back into an atomic vault
|
|
1986
|
-
* @param vaultId Id of the atomic vault
|
|
1987
|
-
* @param poolCoinType Suilend pool coin type (P)
|
|
1988
|
-
* @param lendingMarketId Object id of the Suilend LendingMarket<P>
|
|
1989
|
-
* @param amount Amount to withdraw
|
|
1990
|
-
* @param options Optional tx building params
|
|
1991
|
-
* @returns TransactionBlock
|
|
1992
|
-
*/
|
|
1993
|
-
atomicWithdrawFromSuilendStrategy(vaultId, poolCoinType, lendingMarketId, amount, options) {
|
|
1994
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
1995
|
-
txb.moveCall({
|
|
1996
|
-
arguments: [
|
|
1997
|
-
txb.object(vaultId),
|
|
1998
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
1999
|
-
txb.object(lendingMarketId),
|
|
2000
|
-
txb.pure.u64(amount),
|
|
2001
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2002
|
-
],
|
|
2003
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId), poolCoinType],
|
|
2004
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_withdraw_from_suilend_strategy`
|
|
2005
|
-
});
|
|
2006
|
-
if (options?.gasBudget)
|
|
2007
|
-
txb.setGasBudget(options.gasBudget);
|
|
2008
|
-
if (options?.sender)
|
|
2009
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2010
|
-
return txb;
|
|
2011
|
-
}
|
|
2012
|
-
/**
|
|
2013
|
-
* Withdraws collateral from the AlphaLend strategy back into an atomic vault
|
|
2014
|
-
* @param vaultId Id of the atomic vault
|
|
2015
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2016
|
-
* @param amount Amount to withdraw
|
|
2017
|
-
* @param options Optional tx building params
|
|
2018
|
-
* @returns TransactionBlock
|
|
2019
|
-
*/
|
|
2020
|
-
atomicWithdrawFromAlphalendStrategy(vaultId, lendingProtocolId, amount, options) {
|
|
2021
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2022
|
-
txb.moveCall({
|
|
2023
|
-
arguments: [
|
|
2024
|
-
txb.object(vaultId),
|
|
2025
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2026
|
-
txb.object(lendingProtocolId),
|
|
2027
|
-
txb.pure.u64(amount),
|
|
2028
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2029
|
-
],
|
|
2030
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2031
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_withdraw_from_alphalend_strategy`
|
|
2032
|
-
});
|
|
2033
|
-
if (options?.gasBudget)
|
|
2034
|
-
txb.setGasBudget(options.gasBudget);
|
|
2035
|
-
if (options?.sender)
|
|
2036
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2037
|
-
return txb;
|
|
2038
|
-
}
|
|
2039
|
-
/**
|
|
2040
|
-
* Releases users' holdback for an ember share source vault
|
|
2041
|
-
* @param vaultId Id of the atomic vault
|
|
2042
|
-
* @param shareVaultId Id of the source ember share vault
|
|
2043
|
-
* @param unwindingPercentage Unwinding percentage
|
|
2044
|
-
* @param maxEntries Max entries to process
|
|
2045
|
-
* @param options Optional tx building params
|
|
2046
|
-
* @returns TransactionBlock
|
|
2047
|
-
*/
|
|
2048
|
-
atomicReleaseUsersHoldback(vaultId, shareVaultId, unwindingPercentage, maxEntries, options) {
|
|
2049
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2050
|
-
txb.moveCall({
|
|
2051
|
-
arguments: [
|
|
2052
|
-
txb.object(vaultId),
|
|
2053
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2054
|
-
txb.pure.id(shareVaultId),
|
|
2055
|
-
txb.pure.u64(unwindingPercentage),
|
|
2056
|
-
txb.pure.u64(maxEntries),
|
|
2057
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2058
|
-
],
|
|
2059
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2060
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_release_users_holdback`
|
|
2061
|
-
});
|
|
2062
|
-
if (options?.gasBudget)
|
|
2063
|
-
txb.setGasBudget(options.gasBudget);
|
|
2064
|
-
if (options?.sender)
|
|
2065
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2066
|
-
return txb;
|
|
2067
|
-
}
|
|
2068
|
-
/**
|
|
2069
|
-
* Redeems collected ember shares from an atomic vault against a source vault
|
|
2070
|
-
* @param vaultId Id of the atomic vault
|
|
2071
|
-
* @param sourceReceiptType Receipt coin type of the source vault (R)
|
|
2072
|
-
* @param sourceVaultId Object id of the source Vault<T, R>
|
|
2073
|
-
* @param amount Amount of shares to redeem
|
|
2074
|
-
* @param options Optional tx building params
|
|
2075
|
-
* @returns TransactionBlock
|
|
2076
|
-
*/
|
|
2077
|
-
atomicRedeemCollectedEmberShares(vaultId, sourceReceiptType, sourceVaultId, amount, options) {
|
|
2078
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2079
|
-
txb.moveCall({
|
|
2080
|
-
arguments: [
|
|
2081
|
-
txb.object(vaultId),
|
|
2082
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2083
|
-
txb.object(sourceVaultId),
|
|
2084
|
-
txb.pure.u64(amount),
|
|
2085
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2086
|
-
],
|
|
2087
|
-
typeArguments: [
|
|
2088
|
-
this.parser.getAtomicCollateralType(vaultId),
|
|
2089
|
-
sourceReceiptType
|
|
2090
|
-
],
|
|
2091
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_redeem_collected_ember_shares`
|
|
2092
|
-
});
|
|
2093
|
-
if (options?.gasBudget)
|
|
2094
|
-
txb.setGasBudget(options.gasBudget);
|
|
2095
|
-
if (options?.sender)
|
|
2096
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2097
|
-
return txb;
|
|
2098
|
-
}
|
|
2099
|
-
/**
|
|
2100
|
-
* Claims received collateral (a Receiving<Coin<T>>) for an atomic vault
|
|
2101
|
-
* @param vaultId Id of the atomic vault
|
|
2102
|
-
* @param tokenId Object id of the Receiving<Coin<T>> payment to claim
|
|
2103
|
-
* @param options Optional tx building params
|
|
2104
|
-
* @returns TransactionBlock
|
|
2105
|
-
*/
|
|
2106
|
-
atomicClaimReceivedCollateral(vaultId, tokenId, options) {
|
|
2107
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2108
|
-
txb.moveCall({
|
|
2109
|
-
arguments: [
|
|
2110
|
-
txb.object(vaultId),
|
|
2111
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2112
|
-
txb.object(tokenId)
|
|
2113
|
-
],
|
|
2114
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2115
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_claim_received_collateral`
|
|
2116
|
-
});
|
|
2117
|
-
if (options?.gasBudget)
|
|
2118
|
-
txb.setGasBudget(options.gasBudget);
|
|
2119
|
-
if (options?.sender)
|
|
2120
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2121
|
-
return txb;
|
|
2122
|
-
}
|
|
2123
|
-
/**
|
|
2124
|
-
* Claims returned ember shares (a Receiving<Coin<R>>) for an atomic vault
|
|
2125
|
-
* @param vaultId Id of the atomic vault
|
|
2126
|
-
* @param sourceReceiptType Receipt coin type of the source vault (R)
|
|
2127
|
-
* @param sourceVaultId Id of the source vault the shares belong to
|
|
2128
|
-
* @param tokenId Object id of the Receiving<Coin<R>> payment to claim
|
|
2129
|
-
* @param options Optional tx building params
|
|
2130
|
-
* @returns TransactionBlock
|
|
2131
|
-
*/
|
|
2132
|
-
atomicClaimReturnedEmberShares(vaultId, sourceReceiptType, sourceVaultId, tokenId, options) {
|
|
2133
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2134
|
-
txb.moveCall({
|
|
2135
|
-
arguments: [
|
|
2136
|
-
txb.object(vaultId),
|
|
2137
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2138
|
-
txb.pure.id(sourceVaultId),
|
|
2139
|
-
txb.object(tokenId)
|
|
2140
|
-
],
|
|
2141
|
-
typeArguments: [
|
|
2142
|
-
this.parser.getAtomicCollateralType(vaultId),
|
|
2143
|
-
sourceReceiptType
|
|
2144
|
-
],
|
|
2145
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_claim_returned_ember_shares`
|
|
2146
|
-
});
|
|
2147
|
-
if (options?.gasBudget)
|
|
2148
|
-
txb.setGasBudget(options.gasBudget);
|
|
2149
|
-
if (options?.sender)
|
|
2150
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2151
|
-
return txb;
|
|
2152
|
-
}
|
|
2153
|
-
/**
|
|
2154
|
-
* Updates the rate of an atomic vault (rate manager)
|
|
2155
|
-
* @param vaultId Id of the atomic vault
|
|
2156
|
-
* @param newRate New rate
|
|
2157
|
-
* @param options Optional tx building params
|
|
2158
|
-
* @returns TransactionBlock
|
|
2159
|
-
*/
|
|
2160
|
-
atomicUpdateVaultRate(vaultId, newRate, options) {
|
|
2161
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2162
|
-
txb.moveCall({
|
|
2163
|
-
arguments: [
|
|
2164
|
-
txb.object(vaultId),
|
|
2165
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2166
|
-
txb.pure.u64(newRate),
|
|
2167
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2168
|
-
],
|
|
2169
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2170
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_update_vault_rate`
|
|
2171
|
-
});
|
|
2172
|
-
if (options?.gasBudget)
|
|
2173
|
-
txb.setGasBudget(options.gasBudget);
|
|
2174
|
-
if (options?.sender)
|
|
2175
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2176
|
-
return txb;
|
|
2177
|
-
}
|
|
2178
|
-
/**
|
|
2179
|
-
* Deposits collateral into an atomic vault, minting shares
|
|
2180
|
-
* @param vaultId Id of the atomic vault
|
|
2181
|
-
* @param coinId Object id of the Coin<T> to deposit
|
|
2182
|
-
* @param minShares Minimum number of shares to mint
|
|
2183
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2184
|
-
* @param options Optional tx building params
|
|
2185
|
-
* @returns TransactionBlock
|
|
2186
|
-
*/
|
|
2187
|
-
atomicDeposit(vaultId, coinId, minShares, receiver, options) {
|
|
2188
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2189
|
-
txb.moveCall({
|
|
2190
|
-
arguments: [
|
|
2191
|
-
txb.object(vaultId),
|
|
2192
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2193
|
-
txb.object(coinId),
|
|
2194
|
-
txb.pure.u64(minShares),
|
|
2195
|
-
txb.pure.option("address", receiver ?? null),
|
|
2196
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2197
|
-
],
|
|
2198
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2199
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_deposit`
|
|
2200
|
-
});
|
|
2201
|
-
if (options?.gasBudget)
|
|
2202
|
-
txb.setGasBudget(options.gasBudget);
|
|
2203
|
-
if (options?.sender)
|
|
2204
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2205
|
-
return txb;
|
|
2206
|
-
}
|
|
2207
|
-
/**
|
|
2208
|
-
* Redeems shares from an atomic vault (queued withdrawal)
|
|
2209
|
-
* @param vaultId Id of the atomic vault
|
|
2210
|
-
* @param shares Number of shares to redeem
|
|
2211
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2212
|
-
* @param options Optional tx building params
|
|
2213
|
-
* @returns TransactionBlock
|
|
2214
|
-
*/
|
|
2215
|
-
atomicRedeemShares(vaultId, shares, receiver, options) {
|
|
2216
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2217
|
-
txb.moveCall({
|
|
2218
|
-
arguments: [
|
|
2219
|
-
txb.object(vaultId),
|
|
2220
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2221
|
-
txb.pure.u64(shares),
|
|
2222
|
-
txb.pure.option("address", receiver ?? null),
|
|
2223
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2224
|
-
],
|
|
2225
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2226
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_redeem_shares`
|
|
2227
|
-
});
|
|
2228
|
-
if (options?.gasBudget)
|
|
2229
|
-
txb.setGasBudget(options.gasBudget);
|
|
2230
|
-
if (options?.sender)
|
|
2231
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2232
|
-
return txb;
|
|
2233
|
-
}
|
|
2234
|
-
/**
|
|
2235
|
-
* Cancels a pending withdrawal request on an atomic vault
|
|
2236
|
-
* @param vaultId Id of the atomic vault
|
|
2237
|
-
* @param sequenceNumber Sequence number of the request
|
|
2238
|
-
* @param options Optional tx building params
|
|
2239
|
-
* @returns TransactionBlock
|
|
2240
|
-
*/
|
|
2241
|
-
atomicCancelPendingWithdrawalRequest(vaultId, sequenceNumber, options) {
|
|
2242
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2243
|
-
txb.moveCall({
|
|
2244
|
-
arguments: [
|
|
2245
|
-
txb.object(vaultId),
|
|
2246
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2247
|
-
txb.pure.u128(sequenceNumber)
|
|
2248
|
-
],
|
|
2249
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2250
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_cancel_pending_withdrawal_request`
|
|
2251
|
-
});
|
|
2252
|
-
if (options?.gasBudget)
|
|
2253
|
-
txb.setGasBudget(options.gasBudget);
|
|
2254
|
-
if (options?.sender)
|
|
2255
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2256
|
-
return txb;
|
|
2257
|
-
}
|
|
2258
|
-
/**
|
|
2259
|
-
* Performs an instant withdraw from an atomic vault (no strategy)
|
|
2260
|
-
* @param vaultId Id of the atomic vault
|
|
2261
|
-
* @param shares Number of shares to withdraw
|
|
2262
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2263
|
-
* @param options Optional tx building params
|
|
2264
|
-
* @returns TransactionBlock
|
|
2265
|
-
*/
|
|
2266
|
-
atomicInstantWithdraw(vaultId, shares, receiver, options) {
|
|
2267
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2268
|
-
txb.moveCall({
|
|
2269
|
-
arguments: [
|
|
2270
|
-
txb.object(vaultId),
|
|
2271
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2272
|
-
txb.pure.u64(shares),
|
|
2273
|
-
txb.pure.option("address", receiver ?? null),
|
|
2274
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2275
|
-
],
|
|
2276
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2277
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_instant_withdraw`
|
|
2278
|
-
});
|
|
2279
|
-
if (options?.gasBudget)
|
|
2280
|
-
txb.setGasBudget(options.gasBudget);
|
|
2281
|
-
if (options?.sender)
|
|
2282
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2283
|
-
return txb;
|
|
2284
|
-
}
|
|
2285
|
-
/**
|
|
2286
|
-
* Performs an instant withdraw from an atomic vault routed through Suilend
|
|
2287
|
-
* @param vaultId Id of the atomic vault
|
|
2288
|
-
* @param poolCoinType Suilend pool coin type (P)
|
|
2289
|
-
* @param lendingMarketId Object id of the Suilend LendingMarket<P>
|
|
2290
|
-
* @param shares Number of shares to withdraw
|
|
2291
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2292
|
-
* @param options Optional tx building params
|
|
2293
|
-
* @returns TransactionBlock
|
|
2294
|
-
*/
|
|
2295
|
-
atomicInstantWithdrawWithSuilend(vaultId, poolCoinType, lendingMarketId, shares, receiver, options) {
|
|
2296
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2297
|
-
txb.moveCall({
|
|
2298
|
-
arguments: [
|
|
2299
|
-
txb.object(vaultId),
|
|
2300
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2301
|
-
txb.object(lendingMarketId),
|
|
2302
|
-
txb.pure.u64(shares),
|
|
2303
|
-
txb.pure.option("address", receiver ?? null),
|
|
2304
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2305
|
-
],
|
|
2306
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId), poolCoinType],
|
|
2307
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_instant_withdraw_with_suilend`
|
|
2308
|
-
});
|
|
2309
|
-
if (options?.gasBudget)
|
|
2310
|
-
txb.setGasBudget(options.gasBudget);
|
|
2311
|
-
if (options?.sender)
|
|
2312
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2313
|
-
return txb;
|
|
2314
|
-
}
|
|
2315
|
-
/**
|
|
2316
|
-
* Performs an instant withdraw from an atomic vault routed through AlphaLend
|
|
2317
|
-
* @param vaultId Id of the atomic vault
|
|
2318
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2319
|
-
* @param shares Number of shares to withdraw
|
|
2320
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2321
|
-
* @param options Optional tx building params
|
|
2322
|
-
* @returns TransactionBlock
|
|
2323
|
-
*/
|
|
2324
|
-
atomicInstantWithdrawWithAlphalend(vaultId, lendingProtocolId, shares, receiver, options) {
|
|
2325
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2326
|
-
txb.moveCall({
|
|
2327
|
-
arguments: [
|
|
2328
|
-
txb.object(vaultId),
|
|
2329
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2330
|
-
txb.object(lendingProtocolId),
|
|
2331
|
-
txb.pure.u64(shares),
|
|
2332
|
-
txb.pure.option("address", receiver ?? null),
|
|
2333
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2334
|
-
],
|
|
2335
|
-
typeArguments: [this.parser.getAtomicCollateralType(vaultId)],
|
|
2336
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_instant_withdraw_with_alphalend`
|
|
2337
|
-
});
|
|
2338
|
-
if (options?.gasBudget)
|
|
2339
|
-
txb.setGasBudget(options.gasBudget);
|
|
2340
|
-
if (options?.sender)
|
|
2341
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2342
|
-
return txb;
|
|
2343
|
-
}
|
|
2344
|
-
/**
|
|
2345
|
-
* Swaps ember shares (Coin<R>) into an atomic vault, minting atomic shares
|
|
2346
|
-
* @param vaultId Id of the atomic vault
|
|
2347
|
-
* @param sourceReceiptType Receipt coin type of the source vault (R)
|
|
2348
|
-
* @param sourceVaultId Object id of the source Vault<T, R>
|
|
2349
|
-
* @param shareCoinId Object id of the Coin<R> to swap
|
|
2350
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2351
|
-
* @param options Optional tx building params
|
|
2352
|
-
* @returns TransactionBlock
|
|
2353
|
-
*/
|
|
2354
|
-
atomicSwapEmberShares(vaultId, sourceReceiptType, sourceVaultId, shareCoinId, receiver, options) {
|
|
2355
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2356
|
-
txb.moveCall({
|
|
2357
|
-
arguments: [
|
|
2358
|
-
txb.object(vaultId),
|
|
2359
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2360
|
-
txb.object(sourceVaultId),
|
|
2361
|
-
txb.object(shareCoinId),
|
|
2362
|
-
txb.pure.option("address", receiver ?? null),
|
|
2363
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2364
|
-
],
|
|
2365
|
-
typeArguments: [
|
|
2366
|
-
this.parser.getAtomicCollateralType(vaultId),
|
|
2367
|
-
sourceReceiptType
|
|
2368
|
-
],
|
|
2369
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_swap_ember_shares`
|
|
2370
|
-
});
|
|
2371
|
-
if (options?.gasBudget)
|
|
2372
|
-
txb.setGasBudget(options.gasBudget);
|
|
2373
|
-
if (options?.sender)
|
|
2374
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2375
|
-
return txb;
|
|
2376
|
-
}
|
|
2377
|
-
/**
|
|
2378
|
-
* Swaps ember shares (Coin<R>) into an atomic vault, routing collateral
|
|
2379
|
-
* through the Suilend strategy
|
|
2380
|
-
* @param vaultId Id of the atomic vault
|
|
2381
|
-
* @param sourceReceiptType Receipt coin type of the source vault (R)
|
|
2382
|
-
* @param poolCoinType Suilend pool coin type (P)
|
|
2383
|
-
* @param sourceVaultId Object id of the source Vault<T, R>
|
|
2384
|
-
* @param lendingMarketId Object id of the Suilend LendingMarket<P>
|
|
2385
|
-
* @param shareCoinId Object id of the Coin<R> to swap
|
|
2386
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2387
|
-
* @param options Optional tx building params
|
|
2388
|
-
* @returns TransactionBlock
|
|
2389
|
-
*/
|
|
2390
|
-
atomicSwapEmberSharesWithSuilend(vaultId, sourceReceiptType, poolCoinType, sourceVaultId, lendingMarketId, shareCoinId, receiver, options) {
|
|
2391
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2392
|
-
txb.moveCall({
|
|
2393
|
-
arguments: [
|
|
2394
|
-
txb.object(vaultId),
|
|
2395
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2396
|
-
txb.object(sourceVaultId),
|
|
2397
|
-
txb.object(lendingMarketId),
|
|
2398
|
-
txb.object(shareCoinId),
|
|
2399
|
-
txb.pure.option("address", receiver ?? null),
|
|
2400
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2401
|
-
],
|
|
2402
|
-
typeArguments: [
|
|
2403
|
-
this.parser.getAtomicCollateralType(vaultId),
|
|
2404
|
-
sourceReceiptType,
|
|
2405
|
-
poolCoinType
|
|
2406
|
-
],
|
|
2407
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_swap_ember_shares_with_suilend`
|
|
2408
|
-
});
|
|
2409
|
-
if (options?.gasBudget)
|
|
2410
|
-
txb.setGasBudget(options.gasBudget);
|
|
2411
|
-
if (options?.sender)
|
|
2412
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2413
|
-
return txb;
|
|
2414
|
-
}
|
|
2415
|
-
/**
|
|
2416
|
-
* Swaps ember shares (Coin<R>) into an atomic vault, routing collateral
|
|
2417
|
-
* through the AlphaLend strategy
|
|
2418
|
-
* @param vaultId Id of the atomic vault
|
|
2419
|
-
* @param sourceReceiptType Receipt coin type of the source vault (R)
|
|
2420
|
-
* @param sourceVaultId Object id of the source Vault<T, R>
|
|
2421
|
-
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
2422
|
-
* @param shareCoinId Object id of the Coin<R> to swap
|
|
2423
|
-
* @param receiver Optional receiver address (defaults on-chain to the sender)
|
|
2424
|
-
* @param options Optional tx building params
|
|
2425
|
-
* @returns TransactionBlock
|
|
2426
|
-
*/
|
|
2427
|
-
atomicSwapEmberSharesWithAlphalend(vaultId, sourceReceiptType, sourceVaultId, lendingProtocolId, shareCoinId, receiver, options) {
|
|
2428
|
-
const txb = options?.txBlock || new TransactionBlock();
|
|
2429
|
-
txb.moveCall({
|
|
2430
|
-
arguments: [
|
|
2431
|
-
txb.object(vaultId),
|
|
2432
|
-
txb.object(this.parser.getProtocolConfig()),
|
|
2433
|
-
txb.object(sourceVaultId),
|
|
2434
|
-
txb.object(lendingProtocolId),
|
|
2435
|
-
txb.object(shareCoinId),
|
|
2436
|
-
txb.pure.option("address", receiver ?? null),
|
|
2437
|
-
txb.object(SUI_CLOCK_OBJECT_ID)
|
|
2438
|
-
],
|
|
2439
|
-
typeArguments: [
|
|
2440
|
-
this.parser.getAtomicCollateralType(vaultId),
|
|
2441
|
-
sourceReceiptType
|
|
2442
|
-
],
|
|
2443
|
-
target: `${this.parser.getPackageId()}::gateway::atomic_swap_ember_shares_with_alphalend`
|
|
2444
|
-
});
|
|
2445
|
-
if (options?.gasBudget)
|
|
2446
|
-
txb.setGasBudget(options.gasBudget);
|
|
2447
|
-
if (options?.sender)
|
|
2448
|
-
txb.setSenderIfNotSet(options.sender);
|
|
2449
|
-
return txb;
|
|
2450
|
-
}
|
|
2451
1021
|
}
|