@ember-finance/sdk 2.5.0 → 2.6.0-pre.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.
Files changed (79) hide show
  1. package/dist/src/abis/AtomicLiquidity.json +4050 -0
  2. package/dist/src/abis/ERC20Token.json +2 -2
  3. package/dist/src/abis/EmberETHVault.json +279 -5
  4. package/dist/src/abis/EmberProtocolConfig.json +170 -2
  5. package/dist/src/abis/EmberVault.json +2 -2
  6. package/dist/src/abis/EmberVaultMintBurnOFTAdapter.json +43 -2
  7. package/dist/src/api/v2/apis/accounts-api.d.ts +75 -0
  8. package/dist/src/api/v2/apis/accounts-api.js +134 -1
  9. package/dist/src/api/v2/apis/vaults-api.d.ts +16 -4
  10. package/dist/src/api/v2/apis/vaults-api.js +21 -7
  11. package/dist/src/api/v2/models/account-holdback.d.ts +103 -0
  12. package/dist/src/api/v2/models/account-holdback.js +17 -0
  13. package/dist/src/api/v2/models/account-transaction-transaction-data.d.ts +5 -1
  14. package/dist/src/api/v2/models/account-transaction.d.ts +5 -0
  15. package/dist/src/api/v2/models/account-transaction.js +6 -1
  16. package/dist/src/api/v2/models/chain-vault-details.d.ts +14 -0
  17. package/dist/src/api/v2/models/escrow-claim-transaction.d.ts +56 -0
  18. package/dist/src/api/v2/models/escrow-claim-transaction.js +14 -0
  19. package/dist/src/api/v2/models/evm-atomic-liquidity-lib.d.ts +48 -0
  20. package/dist/src/api/v2/models/evm-atomic-liquidity-lib.js +14 -0
  21. package/dist/src/api/v2/models/evm-atomic-vault.d.ts +102 -0
  22. package/dist/src/api/v2/models/evm-atomic-vault.js +14 -0
  23. package/dist/src/api/v2/models/evm-contracts.d.ts +16 -0
  24. package/dist/src/api/v2/models/fee-multiplier-tier.d.ts +30 -0
  25. package/dist/src/api/v2/models/fee-multiplier-tier.js +14 -0
  26. package/dist/src/api/v2/models/holdback-release-transaction.d.ts +56 -0
  27. package/dist/src/api/v2/models/holdback-release-transaction.js +14 -0
  28. package/dist/src/api/v2/models/index.d.ts +10 -0
  29. package/dist/src/api/v2/models/index.js +10 -0
  30. package/dist/src/api/v2/models/instant-withdraw-config.d.ts +109 -0
  31. package/dist/src/api/v2/models/instant-withdraw-config.js +14 -0
  32. package/dist/src/api/v2/models/instant-withdraw-transaction.d.ts +74 -0
  33. package/dist/src/api/v2/models/instant-withdraw-transaction.js +14 -0
  34. package/dist/src/api/v2/models/instant-withdraw-via-swap-transaction.d.ts +74 -0
  35. package/dist/src/api/v2/models/instant-withdraw-via-swap-transaction.js +14 -0
  36. package/dist/src/api/v2/models/supported-ember-vault.d.ts +42 -0
  37. package/dist/src/api/v2/models/supported-ember-vault.js +14 -0
  38. package/dist/src/api/v2/models/vault-detail.d.ts +11 -0
  39. package/dist/src/api/v2/models/vault-detail.js +4 -0
  40. package/dist/src/atomic/instant-withdraw.d.ts +125 -0
  41. package/dist/src/atomic/instant-withdraw.js +122 -0
  42. package/dist/src/ember-vaults.d.ts +2 -1
  43. package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.d.ts +98 -0
  44. package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.js +212 -0
  45. package/dist/src/evm-vaults/on-chain-calls/index.d.ts +1 -0
  46. package/dist/src/evm-vaults/on-chain-calls/index.js +1 -0
  47. package/dist/src/evm-vaults/on-chain-calls/operator.d.ts +10 -0
  48. package/dist/src/evm-vaults/on-chain-calls/operator.js +28 -0
  49. package/dist/src/evm-vaults/on-chain-calls/tx-builder.d.ts +109 -0
  50. package/dist/src/evm-vaults/on-chain-calls/tx-builder.js +281 -0
  51. package/dist/src/evm-vaults/on-chain-calls/user.d.ts +50 -0
  52. package/dist/src/evm-vaults/on-chain-calls/user.js +75 -0
  53. package/dist/src/evm-vaults/on-chain-calls/vault-admin.d.ts +55 -0
  54. package/dist/src/evm-vaults/on-chain-calls/vault-admin.js +122 -0
  55. package/dist/src/evm-vaults/on-chain-calls/vault-reader.d.ts +6 -0
  56. package/dist/src/evm-vaults/on-chain-calls/vault-reader.js +9 -0
  57. package/dist/src/evm-vaults/utils/deployment-parser.d.ts +8 -0
  58. package/dist/src/evm-vaults/utils/deployment-parser.js +11 -0
  59. package/dist/src/sui-vaults/interfaces/index.d.ts +15 -0
  60. package/dist/src/sui-vaults/on-chain-calls/admin.d.ts +37 -1
  61. package/dist/src/sui-vaults/on-chain-calls/admin.js +56 -0
  62. package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.d.ts +62 -0
  63. package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.js +174 -0
  64. package/dist/src/sui-vaults/on-chain-calls/index.d.ts +1 -0
  65. package/dist/src/sui-vaults/on-chain-calls/index.js +1 -0
  66. package/dist/src/sui-vaults/on-chain-calls/onchain-calls.d.ts +2 -1
  67. package/dist/src/sui-vaults/on-chain-calls/operator.d.ts +129 -1
  68. package/dist/src/sui-vaults/on-chain-calls/operator.js +210 -0
  69. package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +482 -0
  70. package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +1430 -0
  71. package/dist/src/sui-vaults/on-chain-calls/user.d.ts +107 -1
  72. package/dist/src/sui-vaults/on-chain-calls/user.js +190 -0
  73. package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +229 -1
  74. package/dist/src/sui-vaults/on-chain-calls/vault-admin.js +391 -0
  75. package/dist/src/sui-vaults/on-chain-calls/vault.d.ts +2 -1
  76. package/dist/src/sui-vaults/utils/common.d.ts +2 -1
  77. package/dist/src/sui-vaults/utils/deployment-parser.d.ts +12 -0
  78. package/dist/src/sui-vaults/utils/deployment-parser.js +24 -0
  79. package/package.json +3 -2
@@ -1,3 +1,4 @@
1
+ export * from "./account-holdback.js";
1
2
  export * from "./account-parking-lot-claimable.js";
2
3
  export * from "./account-pending-deposit.js";
3
4
  export * from "./account-transaction.js";
@@ -18,6 +19,9 @@ export * from "./coin-price.js";
18
19
  export * from "./defi-integration.js";
19
20
  export * from "./deposit-transaction.js";
20
21
  export * from "./ember-position.js";
22
+ export * from "./escrow-claim-transaction.js";
23
+ export * from "./evm-atomic-liquidity-lib.js";
24
+ export * from "./evm-atomic-vault.js";
21
25
  export * from "./evm-contracts.js";
22
26
  export * from "./evm-deposit-parking-lot.js";
23
27
  export * from "./evm-deposit-token.js";
@@ -34,8 +38,13 @@ export * from "./exposure.js";
34
38
  export * from "./exposure-coin.js";
35
39
  export * from "./exposure-protocol.js";
36
40
  export * from "./fee.js";
41
+ export * from "./fee-multiplier-tier.js";
37
42
  export * from "./fees.js";
38
43
  export * from "./history-interval.js";
44
+ export * from "./holdback-release-transaction.js";
45
+ export * from "./instant-withdraw-config.js";
46
+ export * from "./instant-withdraw-transaction.js";
47
+ export * from "./instant-withdraw-via-swap-transaction.js";
39
48
  export * from "./lp.js";
40
49
  export * from "./manager.js";
41
50
  export * from "./min-withdrawal-shares-updated-event.js";
@@ -79,6 +88,7 @@ export * from "./strategy-account.js";
79
88
  export * from "./sub-account.js";
80
89
  export * from "./sui-protocol-info.js";
81
90
  export * from "./supplied.js";
91
+ export * from "./supported-ember-vault.js";
82
92
  export * from "./tag.js";
83
93
  export * from "./transparency-group.js";
84
94
  export * from "./transparency-row.js";
@@ -1,3 +1,4 @@
1
+ export * from "./account-holdback.js";
1
2
  export * from "./account-parking-lot-claimable.js";
2
3
  export * from "./account-pending-deposit.js";
3
4
  export * from "./account-transaction.js";
@@ -18,6 +19,9 @@ export * from "./coin-price.js";
18
19
  export * from "./defi-integration.js";
19
20
  export * from "./deposit-transaction.js";
20
21
  export * from "./ember-position.js";
22
+ export * from "./escrow-claim-transaction.js";
23
+ export * from "./evm-atomic-liquidity-lib.js";
24
+ export * from "./evm-atomic-vault.js";
21
25
  export * from "./evm-contracts.js";
22
26
  export * from "./evm-deposit-parking-lot.js";
23
27
  export * from "./evm-deposit-token.js";
@@ -34,8 +38,13 @@ export * from "./exposure.js";
34
38
  export * from "./exposure-coin.js";
35
39
  export * from "./exposure-protocol.js";
36
40
  export * from "./fee.js";
41
+ export * from "./fee-multiplier-tier.js";
37
42
  export * from "./fees.js";
38
43
  export * from "./history-interval.js";
44
+ export * from "./holdback-release-transaction.js";
45
+ export * from "./instant-withdraw-config.js";
46
+ export * from "./instant-withdraw-transaction.js";
47
+ export * from "./instant-withdraw-via-swap-transaction.js";
39
48
  export * from "./lp.js";
40
49
  export * from "./manager.js";
41
50
  export * from "./min-withdrawal-shares-updated-event.js";
@@ -79,6 +88,7 @@ export * from "./strategy-account.js";
79
88
  export * from "./sub-account.js";
80
89
  export * from "./sui-protocol-info.js";
81
90
  export * from "./supplied.js";
91
+ export * from "./supported-ember-vault.js";
82
92
  export * from "./tag.js";
83
93
  export * from "./transparency-group.js";
84
94
  export * from "./transparency-row.js";
@@ -0,0 +1,109 @@
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
+ import type { FeeMultiplierTier } from "./fee-multiplier-tier.js";
13
+ /**
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
+ * @export
16
+ * @interface InstantWithdrawConfig
17
+ */
18
+ export interface InstantWithdrawConfig {
19
+ /**
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.
33
+ * @type {string}
34
+ * @memberof InstantWithdrawConfig
35
+ */
36
+ atomicVaultParentId?: string | null;
37
+ /**
38
+ * Off-chain id of the atomic vault\'s chain-level record (matches a vault\'s detailsByChain[*].id). Null when not indexed by us.
39
+ * @type {string}
40
+ * @memberof InstantWithdrawConfig
41
+ */
42
+ atomicVaultOffchainId?: string | null;
43
+ /**
44
+ *
45
+ * @type {boolean}
46
+ * @memberof InstantWithdrawConfig
47
+ */
48
+ whitelisted: boolean;
49
+ /**
50
+ * Base instant-withdraw fee (1e18 fixed-point)
51
+ * @type {string}
52
+ * @memberof InstantWithdrawConfig
53
+ */
54
+ feePercentageE18: string;
55
+ /**
56
+ * Portion held back and released later (1e18 fixed-point)
57
+ * @type {string}
58
+ * @memberof InstantWithdrawConfig
59
+ */
60
+ holdbackPercentageE18: string;
61
+ /**
62
+ * Max swap capacity per epoch as a % of source vault TVL (1e18 fixed-point)
63
+ * @type {string}
64
+ * @memberof InstantWithdrawConfig
65
+ */
66
+ maxCapacityPercentageE18: string;
67
+ /**
68
+ * Post-swap concentration cap (1e18 fixed-point)
69
+ * @type {string}
70
+ * @memberof InstantWithdrawConfig
71
+ */
72
+ maxUtilizationPercentageE18: string;
73
+ /**
74
+ *
75
+ * @type {Array<FeeMultiplierTier>}
76
+ * @memberof InstantWithdrawConfig
77
+ */
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;
109
+ }
@@ -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 {};
@@ -0,0 +1,74 @@
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
+ import type { Asset } from "./asset.js";
13
+ import type { VaultSlice } from "./vault-slice.js";
14
+ /**
15
+ * Atomic Liquidity Vault instant withdraw: shares burned on the atomic vault for a net collateral payout (fee excluded from amount).
16
+ * @export
17
+ * @interface InstantWithdrawTransaction
18
+ */
19
+ export interface InstantWithdrawTransaction {
20
+ /**
21
+ * The timestamp of the event
22
+ * @type {number}
23
+ * @memberof InstantWithdrawTransaction
24
+ */
25
+ timestamp?: number;
26
+ /**
27
+ * The amount of shares burned
28
+ * @type {string}
29
+ * @memberof InstantWithdrawTransaction
30
+ */
31
+ sharesAmount?: string;
32
+ /**
33
+ *
34
+ * @type {Asset}
35
+ * @memberof InstantWithdrawTransaction
36
+ */
37
+ sharesCoin?: Asset;
38
+ /**
39
+ * The net collateral amount delivered (fee excluded)
40
+ * @type {string}
41
+ * @memberof InstantWithdrawTransaction
42
+ */
43
+ amount?: string;
44
+ /**
45
+ *
46
+ * @type {Asset}
47
+ * @memberof InstantWithdrawTransaction
48
+ */
49
+ coin?: Asset;
50
+ /**
51
+ * The platform/withdraw fee charged, excluded from amount
52
+ * @type {string}
53
+ * @memberof InstantWithdrawTransaction
54
+ */
55
+ fees?: string;
56
+ /**
57
+ *
58
+ * @type {VaultSlice}
59
+ * @memberof InstantWithdrawTransaction
60
+ */
61
+ vault?: VaultSlice;
62
+ /**
63
+ * The tx digest of the transaction
64
+ * @type {string}
65
+ * @memberof InstantWithdrawTransaction
66
+ */
67
+ txDigest?: string;
68
+ /**
69
+ * The sequence number of the transaction
70
+ * @type {string}
71
+ * @memberof InstantWithdrawTransaction
72
+ */
73
+ sequenceNumber?: string;
74
+ }
@@ -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 {};
@@ -0,0 +1,74 @@
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
+ import type { Asset } from "./asset.js";
13
+ import type { VaultSlice } from "./vault-slice.js";
14
+ /**
15
+ * Instant withdraw settled through an ember-share swap, mirrored on the source vault. amount is the full collateral realized now (net + holdback); holdbackAmount is the portion held back for later release.
16
+ * @export
17
+ * @interface InstantWithdrawViaSwapTransaction
18
+ */
19
+ export interface InstantWithdrawViaSwapTransaction {
20
+ /**
21
+ * The timestamp of the event
22
+ * @type {number}
23
+ * @memberof InstantWithdrawViaSwapTransaction
24
+ */
25
+ timestamp?: number;
26
+ /**
27
+ * The amount of source-vault shares withdrawn
28
+ * @type {string}
29
+ * @memberof InstantWithdrawViaSwapTransaction
30
+ */
31
+ sharesAmount?: string;
32
+ /**
33
+ *
34
+ * @type {Asset}
35
+ * @memberof InstantWithdrawViaSwapTransaction
36
+ */
37
+ sharesCoin?: Asset;
38
+ /**
39
+ * The full collateral realized now (net + holdback)
40
+ * @type {string}
41
+ * @memberof InstantWithdrawViaSwapTransaction
42
+ */
43
+ amount?: string;
44
+ /**
45
+ *
46
+ * @type {Asset}
47
+ * @memberof InstantWithdrawViaSwapTransaction
48
+ */
49
+ coin?: Asset;
50
+ /**
51
+ * The platform/withdraw fee charged, excluded from amount
52
+ * @type {string}
53
+ * @memberof InstantWithdrawViaSwapTransaction
54
+ */
55
+ fees?: string;
56
+ /**
57
+ * The collateral held back at swap time for later release
58
+ * @type {string}
59
+ * @memberof InstantWithdrawViaSwapTransaction
60
+ */
61
+ holdbackAmount?: string;
62
+ /**
63
+ *
64
+ * @type {VaultSlice}
65
+ * @memberof InstantWithdrawViaSwapTransaction
66
+ */
67
+ vault?: VaultSlice;
68
+ /**
69
+ * The tx digest of the transaction
70
+ * @type {string}
71
+ * @memberof InstantWithdrawViaSwapTransaction
72
+ */
73
+ txDigest?: string;
74
+ }
@@ -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 {};
@@ -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 {};
@@ -30,6 +30,12 @@ export interface VaultDetail {
30
30
  * @memberof VaultDetail
31
31
  */
32
32
  id: string;
33
+ /**
34
+ * Vault flavor at the parent (root) level. TOKENIZED vaults mint a transferable receipt token. ATOMIC (atomic-liquidity) vaults use non-transferable internal shares and have no real receipt token. Defaults to TOKENIZED for backward compatibility.
35
+ * @type {string}
36
+ * @memberof VaultDetail
37
+ */
38
+ vaultType?: VaultDetailVaultTypeEnum;
33
39
  /**
34
40
  * Short name/symbol of the vault
35
41
  * @type {string}
@@ -237,6 +243,11 @@ export interface VaultDetail {
237
243
  */
238
244
  defiIntegrations: Array<DefiIntegration>;
239
245
  }
246
+ export declare const VaultDetailVaultTypeEnum: {
247
+ readonly Tokenized: "TOKENIZED";
248
+ readonly Atomic: "ATOMIC";
249
+ };
250
+ export type VaultDetailVaultTypeEnum = (typeof VaultDetailVaultTypeEnum)[keyof typeof VaultDetailVaultTypeEnum];
240
251
  export declare const VaultDetailStatusEnum: {
241
252
  readonly Active: "active";
242
253
  readonly Paused: "paused";
@@ -11,6 +11,10 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
+ export const VaultDetailVaultTypeEnum = {
15
+ Tokenized: "TOKENIZED",
16
+ Atomic: "ATOMIC"
17
+ };
14
18
  export const VaultDetailStatusEnum = {
15
19
  Active: "active",
16
20
  Paused: "paused",
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Chain-agnostic Atomic Liquidity Vault (ALV) instant-withdraw quote core (BET-4111).
3
+ *
4
+ * There is NO on-chain preview/quote function on the ALV, so the SDK computes the
5
+ * quote client-side by mirroring the exact contract math. Both chains use the same
6
+ * formulas with a different fixed-point scale, so this module is parameterised by
7
+ * `scale` (EVM = 1e18, Sui = 1e9) and consumed by both the EVM and Sui readers, which
8
+ * supply the live on-chain inputs (rate/TVL/held-value/config) via RPC.
9
+ *
10
+ * Mirrors:
11
+ * - swap-with-holdback: EVM `AtomicLiquidityLib.swapEmberShares`,
12
+ * Sui `atomic_liquidity_vault::swap_ember_shares`
13
+ * - plain instant withdraw: EVM `AtomicLiquidity.instantWithdraw`,
14
+ * Sui `do_instant_withdraw_core`
15
+ * - fixed point: `Math.mul = (a*b)/scale`, `Math.div = (a*scale)/b` (floor)
16
+ * - fee curve: `_lookupFeeMultiplier` (ascending tiers; highest threshold <= utilization wins; 1x default)
17
+ */
18
+ /** Fixed-point multiply: `(a * b) / scale`, floor (matches Solidity/Move `Math.mul`). */
19
+ export declare function mulFp(a: bigint, b: bigint, scale: bigint): bigint;
20
+ /** Fixed-point divide: `(a * scale) / b`, floor (matches Solidity/Move `Math.div`). */
21
+ export declare function divFp(a: bigint, b: bigint, scale: bigint): bigint;
22
+ /** A single (threshold, multiplier) tier of the fee-multiplier curve (fixed-point at `scale`). */
23
+ export interface FeeMultiplierTier {
24
+ threshold: bigint;
25
+ multiplier: bigint;
26
+ }
27
+ /**
28
+ * Resolve the fee multiplier from an ascending curve at a given utilization.
29
+ * Returns the multiplier of the highest tier whose `threshold <= utilization`, or `scale`
30
+ * (1x) when the curve is empty / no tier matches. Mirrors `_lookupFeeMultiplier`.
31
+ */
32
+ export declare function lookupFeeMultiplier(curve: FeeMultiplierTier[], utilization: bigint, scale: bigint): bigint;
33
+ /** Per-source-share EmberShare swap config (fixed-point percentages at `scale`). */
34
+ export interface EmberShareSwapConfig {
35
+ feePercentage: bigint;
36
+ holdbackPercentage: bigint;
37
+ maxUtilizationPercentage: bigint;
38
+ feeMultiplierCurve: FeeMultiplierTier[];
39
+ /**
40
+ * Minimum gross collateral value per swap (collateral units). A swap with
41
+ * `gross < minSwapGross` reverts `SwapAmountTooSmall`. 0/undefined disables the floor.
42
+ * EVM-only (no Sui equivalent yet) — omit on Sui.
43
+ */
44
+ minSwapGross?: bigint;
45
+ /**
46
+ * TVL-independent absolute ceiling on this source share's post-swap held value
47
+ * (collateral units). A swap pushing `currentHeldValue + gross` above it reverts
48
+ * `EmberShareHeldValueCapExceeded`. 0/undefined disables it. EVM-only — omit on Sui.
49
+ */
50
+ maxHeldValueAbsolute?: bigint;
51
+ }
52
+ export interface SwapQuoteInputs {
53
+ /** Fixed-point scale: 1e18 (EVM) / 1e9 (Sui). */
54
+ scale: bigint;
55
+ /** Gross collateral value of the source shares: `source.convertToAssets(shareAmount)`. */
56
+ grossAmount: bigint;
57
+ /** Source shares being swapped (for `resultingShares`). */
58
+ shareAmount: bigint;
59
+ /** Caller's current source-share balance (for `resultingShares`). */
60
+ userShareBalance: bigint;
61
+ /** Collateral value the ALV already holds for this source share (pre-swap). */
62
+ currentHeldValue: bigint;
63
+ /** ALV `totalAssets()`. */
64
+ vaultTotalAssets: bigint;
65
+ /** Remaining epoch capacity for this source share: `availableEmberShareCapacity(share)`. */
66
+ availableCapacity: bigint;
67
+ config: EmberShareSwapConfig;
68
+ feeWaived?: boolean;
69
+ holdbackWaived?: boolean;
70
+ }
71
+ export interface InstantWithdrawQuote {
72
+ /** Gross collateral value of the redeemed shares. */
73
+ grossAmount: bigint;
74
+ /** Paid to the receiver immediately (`gross - fee - holdback`). */
75
+ instantlyReceive: bigint;
76
+ /** Held back, released later by the operator (0 for the plain path). */
77
+ lockedAmount: bigint;
78
+ /** Fee charged (collateral units). */
79
+ feeAmount: bigint;
80
+ /** Effective fee % applied (base * curve multiplier), fixed-point at `scale`. */
81
+ effectiveFeePercentage: bigint;
82
+ /** Holdback % applied, fixed-point at `scale` (0 for the plain path). */
83
+ holdbackPercentage: bigint;
84
+ /** Post-swap utilization used for the cap + fee-multiplier (0 for the plain path). */
85
+ utilizationAtSwap: bigint;
86
+ /** Caller's source-share balance after the withdraw. */
87
+ resultingShares: bigint;
88
+ /** True if the swap/withdraw would succeed against ALL caps (utilization, epoch capacity,
89
+ * absolute held-value, min-swap floor). Use the granular flags below to explain a `false`. */
90
+ withinCapacity: boolean;
91
+ /** True if `gross < minSwapGross` — the swap would revert `SwapAmountTooSmall`.
92
+ * Always false for the plain path and when no floor is configured. */
93
+ belowMinSwap: boolean;
94
+ /** True if the post-swap held value is within `maxHeldValueAbsolute` (or the cap is disabled).
95
+ * Always true for the plain path. */
96
+ withinHeldValueCap: boolean;
97
+ }
98
+ /**
99
+ * Quote the EmberShare swap-with-holdback path (source tokenized vault -> ALV).
100
+ * Mirrors `swapEmberShares` exactly: post-swap utilization drives the fee multiplier,
101
+ * `net = gross - fee - holdback` is paid now, the holdback is queued for later release.
102
+ */
103
+ export declare function computeSwapQuote(inputs: SwapQuoteInputs): InstantWithdrawQuote;
104
+ export interface PlainInstantQuoteInputs {
105
+ /** Fixed-point scale: 1e18 (EVM) / 1e9 (Sui). */
106
+ scale: bigint;
107
+ /** Gross collateral value of the shares: ALV `convertToAssets(shareAmount)`. */
108
+ grossAmount: bigint;
109
+ /** ALV shares being instantly withdrawn. */
110
+ shareAmount: bigint;
111
+ /** Caller's current ALV share balance (for `resultingShares`). */
112
+ userShareBalance: bigint;
113
+ /** `instantWithdrawFeePercentage`, fixed-point at `scale`. */
114
+ instantWithdrawFeePercentage: bigint;
115
+ /** `cumulativeInstantWithdrawShares`. */
116
+ cumulativeInstantWithdrawShares: bigint;
117
+ /** `maxInstantWithdrawShares` (cumulative cap). */
118
+ maxInstantWithdrawShares: bigint;
119
+ }
120
+ /**
121
+ * Quote the ALV's own plain `instantWithdraw` path (atomic-share holders).
122
+ * Mirrors the contract: `net = gross - fee`, no holdback; capped by
123
+ * `cumulative + shares <= maxInstantWithdrawShares`.
124
+ */
125
+ export declare function computePlainInstantQuote(inputs: PlainInstantQuoteInputs): InstantWithdrawQuote;