@ember-finance/sdk 2.5.0-pre.3 → 2.5.0-pre.8
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/api/v2/models/chain-vault-details.d.ts +8 -1
- package/dist/src/api/v2/models/index.d.ts +1 -0
- package/dist/src/api/v2/models/index.js +1 -0
- package/dist/src/api/v2/models/instant-withdraw-config.d.ts +47 -5
- package/dist/src/api/v2/models/reward-token.d.ts +6 -0
- package/dist/src/api/v2/models/supported-ember-vault.d.ts +42 -0
- package/dist/src/api/v2/models/supported-ember-vault.js +14 -0
- package/dist/src/ember-vaults.d.ts +1 -1
- package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.js +5 -2
- package/dist/src/sui-vaults/on-chain-calls/admin.d.ts +1 -1
- package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.d.ts +1 -1
- package/dist/src/sui-vaults/on-chain-calls/onchain-calls.d.ts +1 -1
- package/dist/src/sui-vaults/on-chain-calls/operator.d.ts +1 -1
- package/dist/src/sui-vaults/on-chain-calls/user.d.ts +1 -1
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +1 -1
- package/dist/src/sui-vaults/utils/common.d.ts +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import type { Asset } from "./asset.js";
|
|
13
13
|
import type { InstantWithdrawConfig } from "./instant-withdraw-config.js";
|
|
14
14
|
import type { SubAccount } from "./sub-account.js";
|
|
15
|
+
import type { SupportedEmberVault } from "./supported-ember-vault.js";
|
|
15
16
|
import type { VaultParkingLotInfo } from "./vault-parking-lot-info.js";
|
|
16
17
|
/**
|
|
17
18
|
*
|
|
@@ -44,11 +45,17 @@ export interface ChainVaultDetails {
|
|
|
44
45
|
*/
|
|
45
46
|
baseDepositCoin: Asset;
|
|
46
47
|
/**
|
|
47
|
-
* For
|
|
48
|
+
* For EMBER/source vaults that an atomic facility supports: the instant-withdraw (swap-with-holdback) terms offered for this vault\'s shares, one entry per atomic facility. Omitted for vaults with no instant-withdraw offering (incl. atomic vaults themselves).
|
|
48
49
|
* @type {Array<InstantWithdrawConfig>}
|
|
49
50
|
* @memberof ChainVaultDetails
|
|
50
51
|
*/
|
|
51
52
|
instantWithdrawConfig?: Array<InstantWithdrawConfig>;
|
|
53
|
+
/**
|
|
54
|
+
* For ATOMIC vaults: the ember/source vaults this facility supports for instant withdrawal (minimal refs; the terms live on each ember vault\'s instantWithdrawConfig). Omitted for non-atomic vaults.
|
|
55
|
+
* @type {Array<SupportedEmberVault>}
|
|
56
|
+
* @memberof ChainVaultDetails
|
|
57
|
+
*/
|
|
58
|
+
supportedEmberVaults?: Array<SupportedEmberVault>;
|
|
52
59
|
/**
|
|
53
60
|
*
|
|
54
61
|
* @type {Asset}
|
|
@@ -87,6 +87,7 @@ export * from "./strategy-account.js";
|
|
|
87
87
|
export * from "./sub-account.js";
|
|
88
88
|
export * from "./sui-protocol-info.js";
|
|
89
89
|
export * from "./supplied.js";
|
|
90
|
+
export * from "./supported-ember-vault.js";
|
|
90
91
|
export * from "./tag.js";
|
|
91
92
|
export * from "./tvl-by-chain.js";
|
|
92
93
|
export * from "./tvl-history.js";
|
|
@@ -87,6 +87,7 @@ export * from "./strategy-account.js";
|
|
|
87
87
|
export * from "./sub-account.js";
|
|
88
88
|
export * from "./sui-protocol-info.js";
|
|
89
89
|
export * from "./supplied.js";
|
|
90
|
+
export * from "./supported-ember-vault.js";
|
|
90
91
|
export * from "./tag.js";
|
|
91
92
|
export * from "./tvl-by-chain.js";
|
|
92
93
|
export * from "./tvl-history.js";
|
|
@@ -11,23 +11,35 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { FeeMultiplierTier } from "./fee-multiplier-tier.js";
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Instant-withdraw (swap-with-holdback) terms offered for THIS (ember/source) vault\'s shares through an Atomic Liquidity Vault facility. Present on the ember/source vault; each entry names the atomic vault providing it. An ember vault may be offered by more than one atomic facility, hence an array. The asset and settlement (withdrawalPeriodDays) are this vault\'s own root fields.
|
|
15
15
|
* @export
|
|
16
16
|
* @interface InstantWithdrawConfig
|
|
17
17
|
*/
|
|
18
18
|
export interface InstantWithdrawConfig {
|
|
19
19
|
/**
|
|
20
|
-
* On-chain id of the
|
|
20
|
+
* On-chain id of the atomic vault providing this facility
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof InstantWithdrawConfig
|
|
23
|
+
*/
|
|
24
|
+
atomicVaultId: string;
|
|
25
|
+
/**
|
|
26
|
+
* On-chain address of the atomic vault on this chain
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof InstantWithdrawConfig
|
|
29
|
+
*/
|
|
30
|
+
atomicVaultAddress?: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Off-chain id of the atomic vault\'s PARENT (matches a vault\'s root `id`) — use to resolve the atomic vault for name/logo and navigation. Null when not indexed by us.
|
|
21
33
|
* @type {string}
|
|
22
34
|
* @memberof InstantWithdrawConfig
|
|
23
35
|
*/
|
|
24
|
-
|
|
36
|
+
atomicVaultParentId?: string | null;
|
|
25
37
|
/**
|
|
26
|
-
*
|
|
38
|
+
* Off-chain id of the atomic vault\'s chain-level record (matches a vault\'s detailsByChain[*].id). Null when not indexed by us.
|
|
27
39
|
* @type {string}
|
|
28
40
|
* @memberof InstantWithdrawConfig
|
|
29
41
|
*/
|
|
30
|
-
|
|
42
|
+
atomicVaultOffchainId?: string | null;
|
|
31
43
|
/**
|
|
32
44
|
*
|
|
33
45
|
* @type {boolean}
|
|
@@ -64,4 +76,34 @@ export interface InstantWithdrawConfig {
|
|
|
64
76
|
* @memberof InstantWithdrawConfig
|
|
65
77
|
*/
|
|
66
78
|
feeMultiplierCurve: Array<FeeMultiplierTier>;
|
|
79
|
+
/**
|
|
80
|
+
* Current effective instant-withdraw fee = base feePercentage × fee-multiplier at the current utilization (1e18 fixed-point). Refreshed out-of-band from chain state; null until the first refresh.
|
|
81
|
+
* @type {string}
|
|
82
|
+
* @memberof InstantWithdrawConfig
|
|
83
|
+
*/
|
|
84
|
+
effectiveFeePercentageE18?: string | null;
|
|
85
|
+
/**
|
|
86
|
+
* Current swap utilization (held share value / ALV total assets), 1e18 fixed-point. Drives the fee multiplier. Null until the first refresh.
|
|
87
|
+
* @type {string}
|
|
88
|
+
* @memberof InstantWithdrawConfig
|
|
89
|
+
*/
|
|
90
|
+
currentUtilizationE18?: string | null;
|
|
91
|
+
/**
|
|
92
|
+
* Currently swappable capacity in USD (1e9 fixed-point) — min(epoch remaining capacity, ALV available liquidity). Null until the first refresh.
|
|
93
|
+
* @type {string}
|
|
94
|
+
* @memberof InstantWithdrawConfig
|
|
95
|
+
*/
|
|
96
|
+
availableCapacityE9?: string | null;
|
|
97
|
+
/**
|
|
98
|
+
* Currently swappable capacity in collateral units — min(epoch remaining capacity, ALV available liquidity). Null until the first refresh.
|
|
99
|
+
* @type {string}
|
|
100
|
+
* @memberof InstantWithdrawConfig
|
|
101
|
+
*/
|
|
102
|
+
availableCapacity?: string | null;
|
|
103
|
+
/**
|
|
104
|
+
* Timestamp (ms) the dynamic fields (effectiveFee/utilization/capacity) were last refreshed from chain state. Null until the first refresh.
|
|
105
|
+
* @type {number}
|
|
106
|
+
* @memberof InstantWithdrawConfig
|
|
107
|
+
*/
|
|
108
|
+
dynamicStatsComputedAt?: number | null;
|
|
67
109
|
}
|
|
@@ -45,4 +45,10 @@ export interface RewardToken {
|
|
|
45
45
|
* @memberof RewardToken
|
|
46
46
|
*/
|
|
47
47
|
decimals: number;
|
|
48
|
+
/**
|
|
49
|
+
* Optional remark describing how this reward is disbursed (e.g. \"Distributed via Merkl\"). Rendered by the frontend as a tooltip in the vault rewards table. Absent when there is no remark.
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof RewardToken
|
|
52
|
+
*/
|
|
53
|
+
disbursementRemarks?: string;
|
|
48
54
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ember Protocol Vaults API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 2.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A minimal reference from an atomic vault to an ember/source vault it supports for instant withdrawal. The full terms live on the referenced ember vault\'s instantWithdrawConfig; resolve it via sourceVaultParentId (root id).
|
|
14
|
+
* @export
|
|
15
|
+
* @interface SupportedEmberVault
|
|
16
|
+
*/
|
|
17
|
+
export interface SupportedEmberVault {
|
|
18
|
+
/**
|
|
19
|
+
* On-chain address of the supported ember/source vault (on this chain)
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof SupportedEmberVault
|
|
22
|
+
*/
|
|
23
|
+
sourceVaultId: string;
|
|
24
|
+
/**
|
|
25
|
+
* Off-chain id of the ember vault\'s PARENT (matches a vault\'s root `id`) — use to resolve the ember vault for its instantWithdrawConfig, name/logo, and settlement (withdrawalPeriodDays). Null when not indexed by us.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof SupportedEmberVault
|
|
28
|
+
*/
|
|
29
|
+
sourceVaultParentId?: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Off-chain id of the ember vault\'s chain-level record (matches a vault\'s detailsByChain[*].id). Null when not indexed by us.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof SupportedEmberVault
|
|
34
|
+
*/
|
|
35
|
+
sourceVaultOffchainId?: string | null;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {boolean}
|
|
39
|
+
* @memberof SupportedEmberVault
|
|
40
|
+
*/
|
|
41
|
+
whitelisted: boolean;
|
|
42
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Ember Protocol Vaults API
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Signer as SuiSigner } from "@firefly-exchange/library-sui";
|
|
2
|
-
import {
|
|
2
|
+
import { BaseClient as SuiClient } from "@mysten/sui/client";
|
|
3
3
|
import { Signer as EvmSigner, Provider as EvmProvider } from "ethers";
|
|
4
4
|
import { ISuiDeployment } from "./sui-vaults/interfaces/index.js";
|
|
5
5
|
import { TxBuilder as SuiTxBuilder } from "./sui-vaults/on-chain-calls/index.js";
|
|
@@ -158,8 +158,11 @@ export class EVMAtomicLiquidityReader {
|
|
|
158
158
|
// source vault's convertToAssets.
|
|
159
159
|
let heldShares = custodied;
|
|
160
160
|
if (hasRedemption) {
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
// EmberVault.accounts(address) has a single uint256 output
|
|
162
|
+
// (totalPendingWithdrawalShares); ethers v6 returns the bare bigint for
|
|
163
|
+
// single-output calls, not a named struct.
|
|
164
|
+
const pendingWithdrawalShares = (await src.accounts(vaultAddress));
|
|
165
|
+
heldShares += pendingWithdrawalShares;
|
|
163
166
|
}
|
|
164
167
|
const currentHeldValue = heldShares === 0n ? 0n : (await src.convertToAssets(heldShares));
|
|
165
168
|
return computeSwapQuote({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseClient as SuiClient } from "@mysten/sui/client";
|
|
2
2
|
import { OnChainCalls } from "./onchain-calls.js";
|
|
3
3
|
import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
|
|
4
4
|
import { OnChainCallResponse, Signer, SuiAddress, SuiTransactionBlockResponseOptions } from "@firefly-exchange/library-sui";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseClient as SuiClient } from "@mysten/sui/client";
|
|
2
2
|
import { FeeMultiplierTier, InstantWithdrawQuote } from "../../atomic/instant-withdraw.js";
|
|
3
3
|
/**
|
|
4
4
|
* Read-only views + instant-withdraw quotes for the Sui Atomic Liquidity Vault (BET-4111).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseClient as SuiClient } from "@mysten/sui/client";
|
|
2
2
|
import { DryRunTransactionBlockResponse, OnChainCallResponse, Signer, SuiTransactionBlockResponse, SuiTransactionBlockResponseOptions, TransactionBlock } from "@firefly-exchange/library-sui";
|
|
3
3
|
import { Address } from "@firefly-exchange/library-sui";
|
|
4
4
|
import { SuiDeploymentParser } from "../utils/deployment-parser.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseClient as SuiClient } from "@mysten/sui/client";
|
|
2
2
|
import { OnChainCalls } from "./onchain-calls.js";
|
|
3
3
|
import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
|
|
4
4
|
import { OnChainCallResponse, Signer, SuiAddress, SuiTransactionBlockResponseOptions } from "@firefly-exchange/library-sui";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseClient as SuiClient } from "@mysten/sui/client";
|
|
2
2
|
import { OnChainCalls } from "./onchain-calls.js";
|
|
3
3
|
import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
|
|
4
4
|
import { OnChainCallResponse, Signer, SuiAddress, SuiTransactionBlockResponseOptions, NumStr } from "@firefly-exchange/library-sui";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseClient as SuiClient } from "@mysten/sui/client";
|
|
2
2
|
import { OnChainCalls } from "./onchain-calls.js";
|
|
3
3
|
import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
|
|
4
4
|
import { NumStr } from "@firefly-exchange/library-sui";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseClient as SuiClient } from "@mysten/sui/client";
|
|
2
2
|
import { TransactionBlock } from "@firefly-exchange/library-sui";
|
|
3
3
|
export declare const getTxBytes: (tx: TransactionBlock, client: SuiClient) => Promise<string>;
|