@ember-finance/sdk 2.3.1 → 2.5.0-pre.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/AtomicLiquidity.json +4050 -0
- package/dist/src/abis/ERC20Token.json +2 -2
- package/dist/src/abis/EmberETHVault.json +279 -5
- package/dist/src/abis/EmberProtocolConfig.json +137 -2
- package/dist/src/abis/EmberVault.json +2 -2
- package/dist/src/abis/EmberVaultMintBurnOFTAdapter.json +43 -2
- package/dist/src/api/v2/apis/vaults-api.d.ts +16 -4
- package/dist/src/api/v2/apis/vaults-api.js +21 -7
- package/dist/src/api/v2/models/chain-vault-details.d.ts +7 -0
- package/dist/src/api/v2/models/evm-atomic-liquidity-lib.d.ts +48 -0
- package/dist/src/api/v2/models/evm-atomic-liquidity-lib.js +14 -0
- package/dist/src/api/v2/models/evm-atomic-vault.d.ts +102 -0
- package/dist/src/api/v2/models/evm-atomic-vault.js +14 -0
- package/dist/src/api/v2/models/evm-contracts.d.ts +16 -0
- package/dist/src/api/v2/models/fee-multiplier-tier.d.ts +30 -0
- package/dist/src/api/v2/models/fee-multiplier-tier.js +14 -0
- package/dist/src/api/v2/models/index.d.ts +4 -0
- package/dist/src/api/v2/models/index.js +4 -0
- package/dist/src/api/v2/models/instant-withdraw-config.d.ts +67 -0
- package/dist/src/api/v2/models/instant-withdraw-config.js +14 -0
- package/dist/src/api/v2/models/vault-detail.d.ts +11 -0
- package/dist/src/api/v2/models/vault-detail.js +4 -0
- package/dist/src/atomic/instant-withdraw.d.ts +125 -0
- package/dist/src/atomic/instant-withdraw.js +122 -0
- package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.d.ts +98 -0
- package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.js +209 -0
- package/dist/src/evm-vaults/on-chain-calls/index.d.ts +1 -0
- package/dist/src/evm-vaults/on-chain-calls/index.js +1 -0
- package/dist/src/evm-vaults/on-chain-calls/operator.d.ts +10 -0
- package/dist/src/evm-vaults/on-chain-calls/operator.js +28 -0
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.d.ts +103 -0
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.js +273 -0
- package/dist/src/evm-vaults/on-chain-calls/user.d.ts +50 -0
- package/dist/src/evm-vaults/on-chain-calls/user.js +75 -0
- package/dist/src/evm-vaults/on-chain-calls/vault-admin.d.ts +48 -0
- package/dist/src/evm-vaults/on-chain-calls/vault-admin.js +112 -0
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.d.ts +6 -0
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.js +9 -0
- package/dist/src/evm-vaults/utils/deployment-parser.d.ts +8 -0
- package/dist/src/evm-vaults/utils/deployment-parser.js +11 -0
- package/dist/src/sui-vaults/interfaces/index.d.ts +15 -0
- package/dist/src/sui-vaults/on-chain-calls/admin.d.ts +35 -0
- package/dist/src/sui-vaults/on-chain-calls/admin.js +56 -0
- package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.d.ts +62 -0
- package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.js +174 -0
- package/dist/src/sui-vaults/on-chain-calls/index.d.ts +1 -0
- package/dist/src/sui-vaults/on-chain-calls/index.js +1 -0
- package/dist/src/sui-vaults/on-chain-calls/operator.d.ts +127 -0
- package/dist/src/sui-vaults/on-chain-calls/operator.js +210 -0
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +482 -0
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +1430 -0
- package/dist/src/sui-vaults/on-chain-calls/user.d.ts +105 -0
- package/dist/src/sui-vaults/on-chain-calls/user.js +190 -0
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +228 -1
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.js +391 -0
- package/dist/src/sui-vaults/utils/deployment-parser.d.ts +12 -0
- package/dist/src/sui-vaults/utils/deployment-parser.js +24 -0
- package/package.json +3 -2
|
@@ -152,4 +152,395 @@ export class VaultAdminCalls extends OnChainCalls {
|
|
|
152
152
|
});
|
|
153
153
|
return this.execCall(txb, options);
|
|
154
154
|
}
|
|
155
|
+
// ============================================================================
|
|
156
|
+
// Atomic Liquidity Vault (BFE-818) — vault admin methods
|
|
157
|
+
// ============================================================================
|
|
158
|
+
/**
|
|
159
|
+
* Update the name of an atomic vault
|
|
160
|
+
* @param vaultId The id of the atomic vault
|
|
161
|
+
* @param name The new vault name
|
|
162
|
+
* @param options Optional tx execution params
|
|
163
|
+
* @returns OnChainCallResponse
|
|
164
|
+
*/
|
|
165
|
+
async atomicUpdateVaultName(vaultId, name, options) {
|
|
166
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
167
|
+
this.txBuilder.atomicUpdateVaultName(vaultId, name, { ...options, txBlock: txb });
|
|
168
|
+
return this.execCall(txb, options);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Update the max TVL of an atomic vault
|
|
172
|
+
* @param vaultId The id of the atomic vault
|
|
173
|
+
* @param maxTVL The new max TVL
|
|
174
|
+
* @param options Optional tx execution params
|
|
175
|
+
* @returns OnChainCallResponse
|
|
176
|
+
*/
|
|
177
|
+
async atomicUpdateVaultMaxTvl(vaultId, maxTVL, options) {
|
|
178
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
179
|
+
this.txBuilder.atomicUpdateVaultMaxTvl(vaultId, maxTVL, {
|
|
180
|
+
...options,
|
|
181
|
+
txBlock: txb
|
|
182
|
+
});
|
|
183
|
+
return this.execCall(txb, options);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Update the max rate change per update of an atomic vault
|
|
187
|
+
* @param vaultId The id of the atomic vault
|
|
188
|
+
* @param maxRateChangePerUpdate The new max rate change per update
|
|
189
|
+
* @param options Optional tx execution params
|
|
190
|
+
* @returns OnChainCallResponse
|
|
191
|
+
*/
|
|
192
|
+
async atomicUpdateVaultMaxRateChangePerUpdate(vaultId, maxRateChangePerUpdate, options) {
|
|
193
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
194
|
+
this.txBuilder.atomicUpdateVaultMaxRateChangePerUpdate(vaultId, maxRateChangePerUpdate, { ...options, txBlock: txb });
|
|
195
|
+
return this.execCall(txb, options);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Change the rate update interval of an atomic vault
|
|
199
|
+
* @param vaultId The id of the atomic vault
|
|
200
|
+
* @param interval The new rate update interval in ms
|
|
201
|
+
* @param options Optional tx execution params
|
|
202
|
+
* @returns OnChainCallResponse
|
|
203
|
+
*/
|
|
204
|
+
async atomicChangeVaultRateUpdateInterval(vaultId, interval, options) {
|
|
205
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
206
|
+
this.txBuilder.atomicChangeVaultRateUpdateInterval(vaultId, interval, {
|
|
207
|
+
...options,
|
|
208
|
+
txBlock: txb
|
|
209
|
+
});
|
|
210
|
+
return this.execCall(txb, options);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Change the operator of an atomic vault
|
|
214
|
+
* @param vaultId The id of the atomic vault
|
|
215
|
+
* @param newOperator The new operator address
|
|
216
|
+
* @param options Optional tx execution params
|
|
217
|
+
* @returns OnChainCallResponse
|
|
218
|
+
*/
|
|
219
|
+
async atomicChangeVaultOperator(vaultId, newOperator, options) {
|
|
220
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
221
|
+
this.txBuilder.atomicChangeVaultOperator(vaultId, newOperator, {
|
|
222
|
+
...options,
|
|
223
|
+
txBlock: txb
|
|
224
|
+
});
|
|
225
|
+
return this.execCall(txb, options);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Update the rate manager of an atomic vault
|
|
229
|
+
* @param vaultId The id of the atomic vault
|
|
230
|
+
* @param newRateManager The new rate manager address
|
|
231
|
+
* @param options Optional tx execution params
|
|
232
|
+
* @returns OnChainCallResponse
|
|
233
|
+
*/
|
|
234
|
+
async atomicUpdateVaultRateManager(vaultId, newRateManager, options) {
|
|
235
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
236
|
+
this.txBuilder.atomicUpdateVaultRateManager(vaultId, newRateManager, {
|
|
237
|
+
...options,
|
|
238
|
+
txBlock: txb
|
|
239
|
+
});
|
|
240
|
+
return this.execCall(txb, options);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Update the fee percentage of an atomic vault
|
|
244
|
+
* @param vaultId The id of the atomic vault
|
|
245
|
+
* @param feePercentage The new fee percentage
|
|
246
|
+
* @param options Optional tx execution params
|
|
247
|
+
* @returns OnChainCallResponse
|
|
248
|
+
*/
|
|
249
|
+
async atomicUpdateVaultFeePercentage(vaultId, feePercentage, options) {
|
|
250
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
251
|
+
this.txBuilder.atomicUpdateVaultFeePercentage(vaultId, feePercentage, {
|
|
252
|
+
...options,
|
|
253
|
+
txBlock: txb
|
|
254
|
+
});
|
|
255
|
+
return this.execCall(txb, options);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Set the min withdrawal shares of an atomic vault
|
|
259
|
+
* @param vaultId The id of the atomic vault
|
|
260
|
+
* @param minWithdrawalShares The new min withdrawal shares
|
|
261
|
+
* @param options Optional tx execution params
|
|
262
|
+
* @returns OnChainCallResponse
|
|
263
|
+
*/
|
|
264
|
+
async atomicSetMinWithdrawalShares(vaultId, minWithdrawalShares, options) {
|
|
265
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
266
|
+
this.txBuilder.atomicSetMinWithdrawalShares(vaultId, minWithdrawalShares, {
|
|
267
|
+
...options,
|
|
268
|
+
txBlock: txb
|
|
269
|
+
});
|
|
270
|
+
return this.execCall(txb, options);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Set / unset a sub account on an atomic vault
|
|
274
|
+
* @param vaultId The id of the atomic vault
|
|
275
|
+
* @param account The sub account address
|
|
276
|
+
* @param status Whether the account is a sub account
|
|
277
|
+
* @param options Optional tx execution params
|
|
278
|
+
* @returns OnChainCallResponse
|
|
279
|
+
*/
|
|
280
|
+
async atomicSetSubAccount(vaultId, account, status, options) {
|
|
281
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
282
|
+
this.txBuilder.atomicSetSubAccount(vaultId, account, status, {
|
|
283
|
+
...options,
|
|
284
|
+
txBlock: txb
|
|
285
|
+
});
|
|
286
|
+
return this.execCall(txb, options);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Set the pause status of an operation on an atomic vault
|
|
290
|
+
* @param vaultId The id of the atomic vault
|
|
291
|
+
* @param operation The operation identifier bytes (vector<u8>)
|
|
292
|
+
* @param paused The new paused status
|
|
293
|
+
* @param options Optional tx execution params
|
|
294
|
+
* @returns OnChainCallResponse
|
|
295
|
+
*/
|
|
296
|
+
async atomicSetPauseStatus(vaultId, operation, paused, options) {
|
|
297
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
298
|
+
this.txBuilder.atomicSetPauseStatus(vaultId, operation, paused, {
|
|
299
|
+
...options,
|
|
300
|
+
txBlock: txb
|
|
301
|
+
});
|
|
302
|
+
return this.execCall(txb, options);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Set the max instant withdraw shares of an atomic vault
|
|
306
|
+
* @param vaultId The id of the atomic vault
|
|
307
|
+
* @param newMax The new max instant withdraw shares
|
|
308
|
+
* @param options Optional tx execution params
|
|
309
|
+
* @returns OnChainCallResponse
|
|
310
|
+
*/
|
|
311
|
+
async atomicSetMaxInstantWithdrawShares(vaultId, newMax, options) {
|
|
312
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
313
|
+
this.txBuilder.atomicSetMaxInstantWithdrawShares(vaultId, newMax, {
|
|
314
|
+
...options,
|
|
315
|
+
txBlock: txb
|
|
316
|
+
});
|
|
317
|
+
return this.execCall(txb, options);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Set the instant withdraw fee percentage of an atomic vault
|
|
321
|
+
* @param vaultId The id of the atomic vault
|
|
322
|
+
* @param newFeePercentage The new instant withdraw fee percentage
|
|
323
|
+
* @param options Optional tx execution params
|
|
324
|
+
* @returns OnChainCallResponse
|
|
325
|
+
*/
|
|
326
|
+
async atomicSetInstantWithdrawFeePercentage(vaultId, newFeePercentage, options) {
|
|
327
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
328
|
+
this.txBuilder.atomicSetInstantWithdrawFeePercentage(vaultId, newFeePercentage, {
|
|
329
|
+
...options,
|
|
330
|
+
txBlock: txb
|
|
331
|
+
});
|
|
332
|
+
return this.execCall(txb, options);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Whitelist (or update) an ember share source vault for an atomic vault
|
|
336
|
+
* @param vaultId The id of the atomic vault
|
|
337
|
+
* @param shareVaultId Id of the source ember share vault
|
|
338
|
+
* @param whitelisted The whitelist status
|
|
339
|
+
* @param feePercentage The fee percentage
|
|
340
|
+
* @param maxCapacityPercentage The max capacity percentage
|
|
341
|
+
* @param holdbackPercentage The holdback percentage
|
|
342
|
+
* @param maxUtilizationPercentage The max utilization percentage
|
|
343
|
+
* @param options Optional tx execution params
|
|
344
|
+
* @returns OnChainCallResponse
|
|
345
|
+
*/
|
|
346
|
+
async atomicSetEmberShareWhitelist(vaultId, shareVaultId, whitelisted, feePercentage, maxCapacityPercentage, holdbackPercentage, maxUtilizationPercentage, options) {
|
|
347
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
348
|
+
this.txBuilder.atomicSetEmberShareWhitelist(vaultId, shareVaultId, whitelisted, feePercentage, maxCapacityPercentage, holdbackPercentage, maxUtilizationPercentage, { ...options, txBlock: txb });
|
|
349
|
+
return this.execCall(txb, options);
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Set the max utilization percentage of an ember share source vault
|
|
353
|
+
* @param vaultId The id of the atomic vault
|
|
354
|
+
* @param shareVaultId Id of the source ember share vault
|
|
355
|
+
* @param maxUtilizationPercentage The max utilization percentage
|
|
356
|
+
* @param options Optional tx execution params
|
|
357
|
+
* @returns OnChainCallResponse
|
|
358
|
+
*/
|
|
359
|
+
async atomicSetEmberShareMaxUtilization(vaultId, shareVaultId, maxUtilizationPercentage, options) {
|
|
360
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
361
|
+
this.txBuilder.atomicSetEmberShareMaxUtilization(vaultId, shareVaultId, maxUtilizationPercentage, { ...options, txBlock: txb });
|
|
362
|
+
return this.execCall(txb, options);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Set a fee multiplier tier for an ember share source vault
|
|
366
|
+
* @param vaultId The id of the atomic vault
|
|
367
|
+
* @param shareVaultId Id of the source ember share vault
|
|
368
|
+
* @param threshold The tier threshold
|
|
369
|
+
* @param multiplier The tier multiplier
|
|
370
|
+
* @param options Optional tx execution params
|
|
371
|
+
* @returns OnChainCallResponse
|
|
372
|
+
*/
|
|
373
|
+
async atomicSetEmberShareFeeMultiplierTier(vaultId, shareVaultId, threshold, multiplier, options) {
|
|
374
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
375
|
+
this.txBuilder.atomicSetEmberShareFeeMultiplierTier(vaultId, shareVaultId, threshold, multiplier, { ...options, txBlock: txb });
|
|
376
|
+
return this.execCall(txb, options);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Remove a fee multiplier tier for an ember share source vault
|
|
380
|
+
* @param vaultId The id of the atomic vault
|
|
381
|
+
* @param shareVaultId Id of the source ember share vault
|
|
382
|
+
* @param threshold The tier threshold to remove
|
|
383
|
+
* @param options Optional tx execution params
|
|
384
|
+
* @returns OnChainCallResponse
|
|
385
|
+
*/
|
|
386
|
+
async atomicRemoveEmberShareFeeMultiplierTier(vaultId, shareVaultId, threshold, options) {
|
|
387
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
388
|
+
this.txBuilder.atomicRemoveEmberShareFeeMultiplierTier(vaultId, shareVaultId, threshold, { ...options, txBlock: txb });
|
|
389
|
+
return this.execCall(txb, options);
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Set a swap waiver for an account on an atomic vault
|
|
393
|
+
* @param vaultId The id of the atomic vault
|
|
394
|
+
* @param account The account address
|
|
395
|
+
* @param feeWaived Whether the swap fee is waived
|
|
396
|
+
* @param holdbackWaived Whether the holdback is waived
|
|
397
|
+
* @param options Optional tx execution params
|
|
398
|
+
* @returns OnChainCallResponse
|
|
399
|
+
*/
|
|
400
|
+
async atomicSetSwapWaiver(vaultId, account, feeWaived, holdbackWaived, options) {
|
|
401
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
402
|
+
this.txBuilder.atomicSetSwapWaiver(vaultId, account, feeWaived, holdbackWaived, {
|
|
403
|
+
...options,
|
|
404
|
+
txBlock: txb
|
|
405
|
+
});
|
|
406
|
+
return this.execCall(txb, options);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Set the permanent withdrawal fee percentage of an atomic vault
|
|
410
|
+
* @param vaultId The id of the atomic vault
|
|
411
|
+
* @param permanentFeePercentage The new permanent fee percentage
|
|
412
|
+
* @param options Optional tx execution params
|
|
413
|
+
* @returns OnChainCallResponse
|
|
414
|
+
*/
|
|
415
|
+
async atomicSetPermanentFeePercentage(vaultId, permanentFeePercentage, options) {
|
|
416
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
417
|
+
this.txBuilder.atomicSetPermanentFeePercentage(vaultId, permanentFeePercentage, {
|
|
418
|
+
...options,
|
|
419
|
+
txBlock: txb
|
|
420
|
+
});
|
|
421
|
+
return this.execCall(txb, options);
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Set the time based withdrawal fee percentage of an atomic vault
|
|
425
|
+
* @param vaultId The id of the atomic vault
|
|
426
|
+
* @param timeBasedFeePercentage The new time based fee percentage
|
|
427
|
+
* @param options Optional tx execution params
|
|
428
|
+
* @returns OnChainCallResponse
|
|
429
|
+
*/
|
|
430
|
+
async atomicSetTimeBasedFeePercentage(vaultId, timeBasedFeePercentage, options) {
|
|
431
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
432
|
+
this.txBuilder.atomicSetTimeBasedFeePercentage(vaultId, timeBasedFeePercentage, {
|
|
433
|
+
...options,
|
|
434
|
+
txBlock: txb
|
|
435
|
+
});
|
|
436
|
+
return this.execCall(txb, options);
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Set the time based withdrawal fee threshold of an atomic vault
|
|
440
|
+
* @param vaultId The id of the atomic vault
|
|
441
|
+
* @param timeBasedFeeThreshold The new time based fee threshold
|
|
442
|
+
* @param options Optional tx execution params
|
|
443
|
+
* @returns OnChainCallResponse
|
|
444
|
+
*/
|
|
445
|
+
async atomicSetTimeBasedFeeThreshold(vaultId, timeBasedFeeThreshold, options) {
|
|
446
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
447
|
+
this.txBuilder.atomicSetTimeBasedFeeThreshold(vaultId, timeBasedFeeThreshold, {
|
|
448
|
+
...options,
|
|
449
|
+
txBlock: txb
|
|
450
|
+
});
|
|
451
|
+
return this.execCall(txb, options);
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Set / unset a user on the fee exemption list of an atomic vault
|
|
455
|
+
* @param vaultId The id of the atomic vault
|
|
456
|
+
* @param user The user address
|
|
457
|
+
* @param status The status of the user in the fee exemption list
|
|
458
|
+
* @param options Optional tx execution params
|
|
459
|
+
* @returns OnChainCallResponse
|
|
460
|
+
*/
|
|
461
|
+
async atomicSetFeeExemptionList(vaultId, user, status, options) {
|
|
462
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
463
|
+
this.txBuilder.atomicSetFeeExemptionList(vaultId, user, status, {
|
|
464
|
+
...options,
|
|
465
|
+
txBlock: txb
|
|
466
|
+
});
|
|
467
|
+
return this.execCall(txb, options);
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Set / unset a user on the deposit user list of an atomic vault
|
|
471
|
+
* @param vaultId The id of the atomic vault
|
|
472
|
+
* @param user The user address
|
|
473
|
+
* @param status The status of the user in the deposit list
|
|
474
|
+
* @param options Optional tx execution params
|
|
475
|
+
* @returns OnChainCallResponse
|
|
476
|
+
*/
|
|
477
|
+
async atomicSetDepositUserList(vaultId, user, status, options) {
|
|
478
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
479
|
+
this.txBuilder.atomicSetDepositUserList(vaultId, user, status, {
|
|
480
|
+
...options,
|
|
481
|
+
txBlock: txb
|
|
482
|
+
});
|
|
483
|
+
return this.execCall(txb, options);
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Set the Suilend strategy for an atomic vault
|
|
487
|
+
* @param vaultId The id of the atomic vault
|
|
488
|
+
* @param reserveArrayIndex The Suilend reserve array index
|
|
489
|
+
* @param options Optional tx execution params
|
|
490
|
+
* @returns OnChainCallResponse
|
|
491
|
+
*/
|
|
492
|
+
async atomicSetStrategySuilend(vaultId, reserveArrayIndex, options) {
|
|
493
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
494
|
+
this.txBuilder.atomicSetStrategySuilend(vaultId, reserveArrayIndex, {
|
|
495
|
+
...options,
|
|
496
|
+
txBlock: txb
|
|
497
|
+
});
|
|
498
|
+
return this.execCall(txb, options);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Set the AlphaLend strategy for an atomic vault
|
|
502
|
+
* @param vaultId The id of the atomic vault
|
|
503
|
+
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
504
|
+
* @param marketId The AlphaLend market id
|
|
505
|
+
* @param options Optional tx execution params
|
|
506
|
+
* @returns OnChainCallResponse
|
|
507
|
+
*/
|
|
508
|
+
async atomicSetStrategyAlphalend(vaultId, lendingProtocolId, marketId, options) {
|
|
509
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
510
|
+
this.txBuilder.atomicSetStrategyAlphalend(vaultId, lendingProtocolId, marketId, {
|
|
511
|
+
...options,
|
|
512
|
+
txBlock: txb
|
|
513
|
+
});
|
|
514
|
+
return this.execCall(txb, options);
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Switch an atomic vault from the Suilend strategy to STRATEGY_NONE,
|
|
518
|
+
* draining cTokens back into the vault balance
|
|
519
|
+
* @param vaultId The id of the atomic vault
|
|
520
|
+
* @param poolCoinType The Suilend pool coin type (P)
|
|
521
|
+
* @param lendingMarketId Object id of the Suilend LendingMarket<P>
|
|
522
|
+
* @param options Optional tx execution params
|
|
523
|
+
* @returns OnChainCallResponse
|
|
524
|
+
*/
|
|
525
|
+
async atomicSetStrategyNoneFromSuilend(vaultId, poolCoinType, lendingMarketId, options) {
|
|
526
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
527
|
+
this.txBuilder.atomicSetStrategyNoneFromSuilend(vaultId, poolCoinType, lendingMarketId, { ...options, txBlock: txb });
|
|
528
|
+
return this.execCall(txb, options);
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Switch an atomic vault from the AlphaLend strategy to STRATEGY_NONE,
|
|
532
|
+
* draining the full position collateral back into the vault balance
|
|
533
|
+
* @param vaultId The id of the atomic vault
|
|
534
|
+
* @param lendingProtocolId Object id of the AlphaLend LendingProtocol
|
|
535
|
+
* @param options Optional tx execution params
|
|
536
|
+
* @returns OnChainCallResponse
|
|
537
|
+
*/
|
|
538
|
+
async atomicSetStrategyNoneFromAlphalend(vaultId, lendingProtocolId, options) {
|
|
539
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
540
|
+
this.txBuilder.atomicSetStrategyNoneFromAlphalend(vaultId, lendingProtocolId, {
|
|
541
|
+
...options,
|
|
542
|
+
txBlock: txb
|
|
543
|
+
});
|
|
544
|
+
return this.execCall(txb, options);
|
|
545
|
+
}
|
|
155
546
|
}
|
|
@@ -15,4 +15,16 @@ export declare class SuiDeploymentParser {
|
|
|
15
15
|
getDepositCoinType(vaultId: string): string;
|
|
16
16
|
getReceiptCoinType(vaultId: string): string;
|
|
17
17
|
getDepositCoinDecimals(vaultId: string): number;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves the collateral coin type (the `T` type parameter) for an atomic
|
|
20
|
+
* liquidity vault, by looking it up in the deployment's `AtomicVaults` map.
|
|
21
|
+
* Mirrors `getDepositCoinType` for the receipt-based vaults.
|
|
22
|
+
* @param vaultId Object id of the atomic liquidity vault
|
|
23
|
+
*/
|
|
24
|
+
getAtomicCollateralType(vaultId: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Resolves the collateral coin decimals for an atomic liquidity vault.
|
|
27
|
+
* @param vaultId Object id of the atomic liquidity vault
|
|
28
|
+
*/
|
|
29
|
+
getAtomicCollateralDecimals(vaultId: string): number;
|
|
18
30
|
}
|
|
@@ -49,4 +49,28 @@ export class SuiDeploymentParser {
|
|
|
49
49
|
}
|
|
50
50
|
return vault.DepositCoinDecimals;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolves the collateral coin type (the `T` type parameter) for an atomic
|
|
54
|
+
* liquidity vault, by looking it up in the deployment's `AtomicVaults` map.
|
|
55
|
+
* Mirrors `getDepositCoinType` for the receipt-based vaults.
|
|
56
|
+
* @param vaultId Object id of the atomic liquidity vault
|
|
57
|
+
*/
|
|
58
|
+
getAtomicCollateralType(vaultId) {
|
|
59
|
+
const vault = Object.values(this.deployment.AtomicVaults ?? {}).find(vault => vault.ObjectId === vaultId);
|
|
60
|
+
if (!vault) {
|
|
61
|
+
throw new Error(`Atomic vault not found for id: ${vaultId}`);
|
|
62
|
+
}
|
|
63
|
+
return vault.CollateralCoinType;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Resolves the collateral coin decimals for an atomic liquidity vault.
|
|
67
|
+
* @param vaultId Object id of the atomic liquidity vault
|
|
68
|
+
*/
|
|
69
|
+
getAtomicCollateralDecimals(vaultId) {
|
|
70
|
+
const vault = Object.values(this.deployment.AtomicVaults ?? {}).find(vault => vault.ObjectId === vaultId);
|
|
71
|
+
if (!vault) {
|
|
72
|
+
throw new Error(`Atomic vault not found for id: ${vaultId}`);
|
|
73
|
+
}
|
|
74
|
+
return vault.CollateralCoinDecimals;
|
|
75
|
+
}
|
|
52
76
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-finance/sdk",
|
|
3
3
|
"description": "Ember Protocol SDK",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0-pre.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@aws-sdk/client-kms": "^3.1044.0",
|
|
83
|
-
"@firefly-exchange/library-sui": "^3.0.0",
|
|
84
83
|
"@noble/curves": "^2.2.0",
|
|
85
84
|
"asn1.js": "^5.4.1",
|
|
86
85
|
"axios": "1.13.6",
|
|
87
86
|
"yarn": "^1.22.19"
|
|
88
87
|
},
|
|
89
88
|
"devDependencies": {
|
|
89
|
+
"@firefly-exchange/library-sui": "^3.0.0",
|
|
90
90
|
"@mysten/bcs": "^2.0.3",
|
|
91
91
|
"@mysten/sui": "^2.0.0",
|
|
92
92
|
"@openapitools/openapi-generator-cli": "^2.24.0",
|
|
@@ -115,6 +115,7 @@
|
|
|
115
115
|
"widdershins": "^4.0.1"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
|
+
"@firefly-exchange/library-sui": "^3.0.0",
|
|
118
119
|
"@mysten/bcs": "^2.0.3",
|
|
119
120
|
"@mysten/sui": "^2.0.0",
|
|
120
121
|
"ethers": "^6.13.4"
|