@paxoslabs/amplify-sdk 0.5.3 → 1.0.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/LICENSE +1 -1
- package/README.md +113 -91
- package/dist/index.d.mts +3081 -759
- package/dist/index.d.ts +3081 -759
- package/dist/index.js +14775 -186
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14834 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +25 -86
- package/CHANGELOG.md +0 -320
- package/dist/chain-utils-5r2UnCDS.d.mts +0 -380
- package/dist/chain-utils-5r2UnCDS.d.ts +0 -380
- package/dist/chunk-4NQPS3JC.js +0 -2101
- package/dist/chunk-4NQPS3JC.js.map +0 -1
- package/dist/chunk-6CU533DM.mjs +0 -39
- package/dist/chunk-6CU533DM.mjs.map +0 -1
- package/dist/chunk-6JLKHV6O.js +0 -128
- package/dist/chunk-6JLKHV6O.js.map +0 -1
- package/dist/chunk-FHE43NKY.js +0 -1143
- package/dist/chunk-FHE43NKY.js.map +0 -1
- package/dist/chunk-GOJQYEJQ.js +0 -3212
- package/dist/chunk-GOJQYEJQ.js.map +0 -1
- package/dist/chunk-LMNADWTH.mjs +0 -2073
- package/dist/chunk-LMNADWTH.mjs.map +0 -1
- package/dist/chunk-ODXJYXUH.mjs +0 -3168
- package/dist/chunk-ODXJYXUH.mjs.map +0 -1
- package/dist/chunk-QMFYPHX5.mjs +0 -690
- package/dist/chunk-QMFYPHX5.mjs.map +0 -1
- package/dist/chunk-TNL23CO2.js +0 -45
- package/dist/chunk-TNL23CO2.js.map +0 -1
- package/dist/chunk-UY2WD7MF.mjs +0 -1133
- package/dist/chunk-UY2WD7MF.mjs.map +0 -1
- package/dist/chunk-WD6QFSXZ.js +0 -701
- package/dist/chunk-WD6QFSXZ.js.map +0 -1
- package/dist/chunk-Y5LBT2WT.mjs +0 -118
- package/dist/chunk-Y5LBT2WT.mjs.map +0 -1
- package/dist/core.d.mts +0 -195
- package/dist/core.d.ts +0 -195
- package/dist/core.js +0 -1236
- package/dist/core.js.map +0 -1
- package/dist/core.mjs +0 -1194
- package/dist/core.mjs.map +0 -1
- package/dist/display.d.mts +0 -472
- package/dist/display.d.ts +0 -472
- package/dist/display.js +0 -52
- package/dist/display.js.map +0 -1
- package/dist/display.mjs +0 -7
- package/dist/display.mjs.map +0 -1
- package/dist/index-D8RtV9cB.d.mts +0 -5114
- package/dist/index-ev_V5sjt.d.ts +0 -5114
- package/dist/utils.d.mts +0 -112
- package/dist/utils.d.ts +0 -112
- package/dist/utils.js +0 -67
- package/dist/utils.js.map +0 -1
- package/dist/utils.mjs +0 -25
- package/dist/utils.mjs.map +0 -1
- package/dist/vaults.d.mts +0 -4
- package/dist/vaults.d.ts +0 -4
- package/dist/vaults.js +0 -96
- package/dist/vaults.js.map +0 -1
- package/dist/vaults.mjs +0 -7
- package/dist/vaults.mjs.map +0 -1
package/dist/display.d.ts
DELETED
|
@@ -1,472 +0,0 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { C as ChainId } from './chain-utils-5r2UnCDS.js';
|
|
3
|
-
import 'viem/chains';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @file Display module type definitions
|
|
7
|
-
* @module display/types
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/** Status of a withdrawal request */
|
|
11
|
-
type WithdrawalRequestStatus = 'PENDING' | 'COMPLETE' | 'PENDING_REFUND' | 'REFUNDED';
|
|
12
|
-
/** A withdrawal request returned from the backend API */
|
|
13
|
-
interface WithdrawalRequest {
|
|
14
|
-
id: string;
|
|
15
|
-
vaultAddress: Address;
|
|
16
|
-
chainId: number;
|
|
17
|
-
wantAssetAddress: Address;
|
|
18
|
-
status: WithdrawalRequestStatus;
|
|
19
|
-
createdAt: string;
|
|
20
|
-
userAddress: Address;
|
|
21
|
-
receiverAddress: Address;
|
|
22
|
-
refundReceiverAddress: Address;
|
|
23
|
-
orderAmount: string;
|
|
24
|
-
orderIndex: number;
|
|
25
|
-
isSubmittedViaSignature: boolean;
|
|
26
|
-
isForceProcessed: boolean;
|
|
27
|
-
isMarkedForRefund: boolean;
|
|
28
|
-
isMarkedForRefundByUser: boolean;
|
|
29
|
-
didOrderFailTransfer: boolean;
|
|
30
|
-
}
|
|
31
|
-
/** Parameters for getWithdrawalRequests */
|
|
32
|
-
interface GetWithdrawalRequestsParams {
|
|
33
|
-
userAddress: Address;
|
|
34
|
-
chainId?: number;
|
|
35
|
-
vaultAddress?: Address;
|
|
36
|
-
vaultName?: string;
|
|
37
|
-
status?: WithdrawalRequestStatus;
|
|
38
|
-
pageSize?: number;
|
|
39
|
-
pageToken?: string;
|
|
40
|
-
}
|
|
41
|
-
/** Return type for getWithdrawalRequests */
|
|
42
|
-
interface WithdrawalRequestsResult {
|
|
43
|
-
withdrawalRequests: WithdrawalRequest[];
|
|
44
|
-
nextPageToken: string | null;
|
|
45
|
-
}
|
|
46
|
-
/** Parameters for getWithdrawalFee */
|
|
47
|
-
interface GetWithdrawalFeeParams {
|
|
48
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
49
|
-
vaultName: string;
|
|
50
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
51
|
-
chainId: ChainId;
|
|
52
|
-
/** Token contract address used to validate the vault (should match the vault's supported asset) */
|
|
53
|
-
assetAddress: Address;
|
|
54
|
-
amount: string;
|
|
55
|
-
offerAsset: Address;
|
|
56
|
-
wantAsset: Address;
|
|
57
|
-
receiver: Address;
|
|
58
|
-
}
|
|
59
|
-
/** Return type for getWithdrawalFee */
|
|
60
|
-
interface WithdrawalFeeResult {
|
|
61
|
-
feeAmount: bigint;
|
|
62
|
-
feePercentage: bigint;
|
|
63
|
-
}
|
|
64
|
-
/** Parameters for getMinimumWithdrawalOrderSize */
|
|
65
|
-
interface GetMinimumWithdrawalOrderSizeParams {
|
|
66
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
67
|
-
vaultName: string;
|
|
68
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
69
|
-
chainId: ChainId;
|
|
70
|
-
/** Token contract address used to validate the vault (should match the vault's supported asset) */
|
|
71
|
-
assetAddress: Address;
|
|
72
|
-
}
|
|
73
|
-
/** Return type for getMinimumWithdrawalOrderSize */
|
|
74
|
-
interface MinimumWithdrawalOrderSizeResult {
|
|
75
|
-
minimumOrderSize: bigint;
|
|
76
|
-
shareDecimals: number;
|
|
77
|
-
}
|
|
78
|
-
/** Parameters for getMinimumMint */
|
|
79
|
-
interface GetMinimumMintParams {
|
|
80
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
81
|
-
vaultName: string;
|
|
82
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
83
|
-
chainId: ChainId;
|
|
84
|
-
/** Token contract address to deposit. Must match the vault's supported asset. */
|
|
85
|
-
depositAssetAddress: Address;
|
|
86
|
-
depositAmount: string;
|
|
87
|
-
}
|
|
88
|
-
/** Return type for getMinimumMint */
|
|
89
|
-
interface MinimumMintResult {
|
|
90
|
-
expectedShares: bigint;
|
|
91
|
-
exchangeRate: bigint;
|
|
92
|
-
shareDecimals: number;
|
|
93
|
-
assetDecimals: number;
|
|
94
|
-
}
|
|
95
|
-
/** Parameters for getDepositCap */
|
|
96
|
-
interface GetDepositCapParams {
|
|
97
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
98
|
-
vaultName: string;
|
|
99
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
100
|
-
chainId: ChainId;
|
|
101
|
-
/** Token contract address used to validate the vault (should match the vault's supported asset) */
|
|
102
|
-
assetAddress: Address;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Return type for {@link getDepositCap}.
|
|
106
|
-
* Only produced for vaults with both a CommunityCodeDepositor and a deposit fee module.
|
|
107
|
-
*/
|
|
108
|
-
interface DepositCapResult {
|
|
109
|
-
/** Supply cap denominated in base asset units (raw uint256 from DCD contract) */
|
|
110
|
-
supplyCapInBase: bigint;
|
|
111
|
-
/** True when `supplyCapInBase` is neither `0` nor `maxUint256` (unlimited). */
|
|
112
|
-
hasDepositCap: boolean;
|
|
113
|
-
/** Deposit fee module contract address from the DCD (zero address means no fees) */
|
|
114
|
-
depositFeeModuleAddress: Address;
|
|
115
|
-
/** Whether the vault has deposit fees (depositFeeModuleAddress != zero address) */
|
|
116
|
-
hasFees: boolean;
|
|
117
|
-
}
|
|
118
|
-
/** Parameters for calculateDepositFee */
|
|
119
|
-
interface CalculateDepositFeeParams {
|
|
120
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
121
|
-
vaultName: string;
|
|
122
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
123
|
-
chainId: ChainId;
|
|
124
|
-
/** Token contract address of the deposit asset */
|
|
125
|
-
assetAddress: Address;
|
|
126
|
-
/** Human-readable deposit amount (e.g. "1000.0") */
|
|
127
|
-
depositAmount: string;
|
|
128
|
-
}
|
|
129
|
-
/** Return type for calculateDepositFee */
|
|
130
|
-
interface DepositFeeResult {
|
|
131
|
-
/** Whether the vault has a fee module configured */
|
|
132
|
-
hasFees: boolean;
|
|
133
|
-
/** The deposit fee module contract address (zero address if no fees) */
|
|
134
|
-
depositFeeModuleAddress: Address;
|
|
135
|
-
/** Variable fee percentage as raw uint256 from the contract */
|
|
136
|
-
feePercentage: bigint;
|
|
137
|
-
/** ONE_HUNDRED_PERCENT constant from the fee module (denominator for percentage calc) */
|
|
138
|
-
oneHundredPercent: bigint;
|
|
139
|
-
/** Flat fee in deposit-token units (raw uint256) */
|
|
140
|
-
flatFee: bigint;
|
|
141
|
-
/** Computed variable fee amount for the given deposit: depositAmount * feePercentage / oneHundredPercent */
|
|
142
|
-
variableFeeAmount: bigint;
|
|
143
|
-
/** Total fee amount: variableFeeAmount + flatFee */
|
|
144
|
-
totalFeeAmount: bigint;
|
|
145
|
-
/** Deposit amount after total fee deduction */
|
|
146
|
-
depositAmountAfterFees: bigint;
|
|
147
|
-
/** Decimals of the deposit asset (for display formatting) */
|
|
148
|
-
assetDecimals: number;
|
|
149
|
-
}
|
|
150
|
-
/** Parameters for getCurrentSupply */
|
|
151
|
-
interface GetCurrentSupplyParams {
|
|
152
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
153
|
-
vaultName: string;
|
|
154
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
155
|
-
chainId: ChainId;
|
|
156
|
-
/** Token contract address used to validate the vault (should match the vault's supported asset) */
|
|
157
|
-
assetAddress: Address;
|
|
158
|
-
}
|
|
159
|
-
/** Return type for getCurrentSupply */
|
|
160
|
-
interface CurrentSupplyResult {
|
|
161
|
-
/** Total share supply of the boring vault (raw ERC-20 totalSupply) */
|
|
162
|
-
totalShareSupply: bigint;
|
|
163
|
-
/** Exchange rate from the accountant (getRate) */
|
|
164
|
-
exchangeRate: bigint;
|
|
165
|
-
/** Decimals reported by the accountant contract */
|
|
166
|
-
accountantDecimals: number;
|
|
167
|
-
/** Total value in base-asset units: totalShareSupply * exchangeRate / 10^accountantDecimals */
|
|
168
|
-
totalValueInBase: bigint;
|
|
169
|
-
}
|
|
170
|
-
/** Parameters for getShareValue */
|
|
171
|
-
interface GetShareValueParams {
|
|
172
|
-
/** Human-readable vault name (e.g. "Amplify USDC Core") */
|
|
173
|
-
vaultName: string;
|
|
174
|
-
/** Chain ID where the vault is deployed. Must match the vault's chain. */
|
|
175
|
-
chainId: ChainId;
|
|
176
|
-
/** Quote asset address to value shares in (e.g. USDC). Must match the vault's supported asset. */
|
|
177
|
-
quoteAssetAddress: Address;
|
|
178
|
-
/** Wallet address to read share balance for via balanceOf. Optional when shareAmount is provided. */
|
|
179
|
-
userAddress?: Address;
|
|
180
|
-
/** Explicit share amount to value (human-readable, e.g. "100.0"). Overrides on-chain balanceOf when provided. */
|
|
181
|
-
shareAmount?: string;
|
|
182
|
-
}
|
|
183
|
-
/** Return type for getShareValue */
|
|
184
|
-
interface ShareValueResult {
|
|
185
|
-
/** Share balance used for the calculation (read from chain or derived from shareAmount) */
|
|
186
|
-
shareBalance: bigint;
|
|
187
|
-
/** Value of the shares in quote-asset units (raw bigint) */
|
|
188
|
-
value: bigint;
|
|
189
|
-
/** Exchange rate from getRateInQuote — quote-asset units per one full share */
|
|
190
|
-
exchangeRate: bigint;
|
|
191
|
-
/** Decimals of the BoringVault share token */
|
|
192
|
-
shareDecimals: number;
|
|
193
|
-
/** Decimals of the quote asset */
|
|
194
|
-
quoteAssetDecimals: number;
|
|
195
|
-
}
|
|
196
|
-
/** Parameters for getVaultAPY */
|
|
197
|
-
interface GetVaultAPYParams {
|
|
198
|
-
vaultAddress?: Address;
|
|
199
|
-
vaultName?: string;
|
|
200
|
-
chainId?: number;
|
|
201
|
-
}
|
|
202
|
-
/** Return type for getVaultAPY */
|
|
203
|
-
interface VaultAPYResult {
|
|
204
|
-
apy: number;
|
|
205
|
-
apyFormatted: string;
|
|
206
|
-
vaultAddress: Address;
|
|
207
|
-
timestamp: string;
|
|
208
|
-
}
|
|
209
|
-
/** Parameters for getVaultTVL */
|
|
210
|
-
interface GetVaultTVLParams {
|
|
211
|
-
vaultAddress?: Address;
|
|
212
|
-
vaultName?: string;
|
|
213
|
-
chainId?: number;
|
|
214
|
-
}
|
|
215
|
-
/** Return type for getVaultTVL */
|
|
216
|
-
interface VaultTVLResult {
|
|
217
|
-
tvl: string;
|
|
218
|
-
tvlAsset: string;
|
|
219
|
-
vaultAddress: Address;
|
|
220
|
-
chainId: number;
|
|
221
|
-
timestamp: string;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* @file Deposit display helpers
|
|
226
|
-
* @module display/deposit-display
|
|
227
|
-
*/
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Calculates the expected vault shares a user will receive for a deposit
|
|
231
|
-
*
|
|
232
|
-
* Uses the on-chain exchange rate from the Accountant contract to calculate
|
|
233
|
-
* how many vault shares will be minted for a given deposit amount.
|
|
234
|
-
*
|
|
235
|
-
* @param params - Deposit parameters
|
|
236
|
-
* @returns Expected shares, exchange rate, and decimal info
|
|
237
|
-
* @throws {APIError} If vault not found or contract read fails
|
|
238
|
-
*
|
|
239
|
-
* @example
|
|
240
|
-
* ```typescript
|
|
241
|
-
* const result = await getMinimumMint({
|
|
242
|
-
* vaultName: "Amplify USDC Core",
|
|
243
|
-
* chainId: 1,
|
|
244
|
-
* depositAssetAddress: "0xA0b8...", // USDC
|
|
245
|
-
* depositAmount: "1000.0",
|
|
246
|
-
* });
|
|
247
|
-
* console.log(result.expectedShares);
|
|
248
|
-
* ```
|
|
249
|
-
*/
|
|
250
|
-
declare function getMinimumMint(params: GetMinimumMintParams): Promise<MinimumMintResult>;
|
|
251
|
-
/**
|
|
252
|
-
* Reads the deposit cap and fee module info from the DCD contract on-chain
|
|
253
|
-
*
|
|
254
|
-
* Uses the customer's configured RPC to call `supplyCapInBase()` and
|
|
255
|
-
* `feeModule()` on the DistributorCodeDepositor contract.
|
|
256
|
-
*
|
|
257
|
-
* @param params - Vault identification parameters
|
|
258
|
-
* @returns Supply cap, fee module address, and derived boolean flags
|
|
259
|
-
* @throws {APIError} If vault not found or contract read fails
|
|
260
|
-
*
|
|
261
|
-
* @example
|
|
262
|
-
* ```typescript
|
|
263
|
-
* const cap = await getDepositCap({
|
|
264
|
-
* vaultName: "Amplify USDC Core",
|
|
265
|
-
* chainId: 1,
|
|
266
|
-
* assetAddress: "0xA0b8...",
|
|
267
|
-
* });
|
|
268
|
-
* console.log(cap.hasDepositCap); // true if supplyCapInBase != 0 and != maxUint256
|
|
269
|
-
* console.log(cap.hasFees); // true if depositFeeModuleAddress from vault config != zeroAddress
|
|
270
|
-
* ```
|
|
271
|
-
*/
|
|
272
|
-
declare function getDepositCap(params: GetDepositCapParams): Promise<DepositCapResult>;
|
|
273
|
-
/**
|
|
274
|
-
* Reads the current total supply value from the boring vault and accountant
|
|
275
|
-
*
|
|
276
|
-
* Computes `totalValueInBase = totalSupply * accountant.getRate() / 10^accountant.decimals()`,
|
|
277
|
-
* matching the on-chain supply cap enforcement logic in the DCD contract.
|
|
278
|
-
*
|
|
279
|
-
* @param params - Vault identification parameters
|
|
280
|
-
* @returns Total share supply, exchange rate, and computed value in base-asset units
|
|
281
|
-
* @throws {APIError} If vault not found or contract read fails
|
|
282
|
-
*
|
|
283
|
-
* @example
|
|
284
|
-
* ```typescript
|
|
285
|
-
* const supply = await getCurrentSupply({
|
|
286
|
-
* vaultName: "Amplify USDC Core",
|
|
287
|
-
* chainId: 1,
|
|
288
|
-
* assetAddress: "0xA0b8...",
|
|
289
|
-
* });
|
|
290
|
-
* console.log(supply.totalValueInBase); // current TVL in base-asset raw units
|
|
291
|
-
* ```
|
|
292
|
-
*/
|
|
293
|
-
declare function getCurrentSupply(params: GetCurrentSupplyParams): Promise<CurrentSupplyResult>;
|
|
294
|
-
/**
|
|
295
|
-
* Calculates the deposit fee for a given deposit amount by reading the
|
|
296
|
-
* fee module's `depositTokenFeeData` and `ONE_HUNDRED_PERCENT` on-chain.
|
|
297
|
-
*
|
|
298
|
-
* Returns both the fixed (flat) and variable fee components, along with
|
|
299
|
-
* the total fee and the net deposit amount after fees.
|
|
300
|
-
*
|
|
301
|
-
* @param params - Deposit parameters including vault name, chain, asset, and amount
|
|
302
|
-
* @returns Fee breakdown with fixed, variable, total, and net amounts
|
|
303
|
-
* @throws {APIError} If vault not found, no fee module, or contract read fails
|
|
304
|
-
*
|
|
305
|
-
* @example
|
|
306
|
-
* ```typescript
|
|
307
|
-
* const fee = await calculateDepositFee({
|
|
308
|
-
* vaultName: "Amplify USDC Core",
|
|
309
|
-
* chainId: 1,
|
|
310
|
-
* assetAddress: "0xA0b8...",
|
|
311
|
-
* depositAmount: "1000.0",
|
|
312
|
-
* });
|
|
313
|
-
* console.log(fee.variableFeeAmount); // variable portion
|
|
314
|
-
* console.log(fee.flatFee); // fixed portion
|
|
315
|
-
* console.log(fee.totalFeeAmount); // variable + fixed
|
|
316
|
-
* ```
|
|
317
|
-
*/
|
|
318
|
-
declare function calculateDepositFee(params: CalculateDepositFeeParams): Promise<DepositFeeResult>;
|
|
319
|
-
/**
|
|
320
|
-
* Calculates the value of vault shares in a quote asset
|
|
321
|
-
*
|
|
322
|
-
* Reads the on-chain exchange rate from the Accountant contract via
|
|
323
|
-
* `getRateInQuote(quoteAsset)` and computes:
|
|
324
|
-
* value = shareBalance * rateInQuote / 10^shareDecimals
|
|
325
|
-
*
|
|
326
|
-
* The share balance can come from two sources:
|
|
327
|
-
* - `userAddress`: reads `balanceOf(userAddress)` on the BoringVault on-chain
|
|
328
|
-
* - `shareAmount`: uses the provided amount directly (skips balanceOf)
|
|
329
|
-
*
|
|
330
|
-
* When both are provided, `shareAmount` takes precedence. At least one
|
|
331
|
-
* must be specified.
|
|
332
|
-
*
|
|
333
|
-
* @param params - Share value parameters
|
|
334
|
-
* @returns Share balance, value in quote-asset units, exchange rate, and decimal info
|
|
335
|
-
* @throws {APIError} If neither userAddress nor shareAmount provided, vault not found, or contract read fails
|
|
336
|
-
*
|
|
337
|
-
* @example
|
|
338
|
-
* ```typescript
|
|
339
|
-
* // Look up a user's position value by wallet address
|
|
340
|
-
* const result = await getShareValue({
|
|
341
|
-
* vaultName: "pxlUSDCc",
|
|
342
|
-
* chainId: 1,
|
|
343
|
-
* quoteAssetAddress: "0xA0b8...", // USDC
|
|
344
|
-
* userAddress: "0x1234...",
|
|
345
|
-
* });
|
|
346
|
-
* console.log(result.shareBalance); // shares held
|
|
347
|
-
* console.log(result.value); // worth in USDC units
|
|
348
|
-
*
|
|
349
|
-
* // Or value a known share amount directly
|
|
350
|
-
* const preview = await getShareValue({
|
|
351
|
-
* vaultName: "pxlUSDCc",
|
|
352
|
-
* chainId: 1,
|
|
353
|
-
* quoteAssetAddress: "0xA0b8...",
|
|
354
|
-
* shareAmount: "100.0",
|
|
355
|
-
* });
|
|
356
|
-
* ```
|
|
357
|
-
*/
|
|
358
|
-
declare function getShareValue(params: GetShareValueParams): Promise<ShareValueResult>;
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* @file Vault display helpers
|
|
362
|
-
* @module display/vault-display
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Fetches the latest APY for a vault from the backend API
|
|
367
|
-
*
|
|
368
|
-
* Requests the most recent APY data point by using
|
|
369
|
-
* orderByTimestamp=desc with pageSize=1.
|
|
370
|
-
*
|
|
371
|
-
* @param params - Vault identifier parameters (vaultAddress, vaultName, or both)
|
|
372
|
-
* @returns Latest APY value and metadata
|
|
373
|
-
* @throws {APIError} If the API request fails or no data found
|
|
374
|
-
*
|
|
375
|
-
* @example
|
|
376
|
-
* ```typescript
|
|
377
|
-
* const result = await getVaultAPY({
|
|
378
|
-
* vaultAddress: "0x1234...",
|
|
379
|
-
* });
|
|
380
|
-
* console.log(result.apyFormatted); // "4.50%"
|
|
381
|
-
* ```
|
|
382
|
-
*/
|
|
383
|
-
declare function getVaultAPY(params: GetVaultAPYParams): Promise<VaultAPYResult>;
|
|
384
|
-
/**
|
|
385
|
-
* Fetches the current TVL for a vault from the backend API
|
|
386
|
-
*
|
|
387
|
-
* Requests the most recent TVL data point by using
|
|
388
|
-
* includeCurrent=true, orderByTimestamp=desc with pageSize=1.
|
|
389
|
-
*
|
|
390
|
-
* @param params - Vault identifier parameters (vaultAddress, vaultName, or both)
|
|
391
|
-
* @returns Current TVL value and metadata
|
|
392
|
-
* @throws {APIError} If the API request fails or no data found
|
|
393
|
-
*
|
|
394
|
-
* @example
|
|
395
|
-
* ```typescript
|
|
396
|
-
* const result = await getVaultTVL({
|
|
397
|
-
* vaultAddress: "0x1234...",
|
|
398
|
-
* });
|
|
399
|
-
* console.log(result.tvl, result.tvlAsset);
|
|
400
|
-
* ```
|
|
401
|
-
*/
|
|
402
|
-
declare function getVaultTVL(params: GetVaultTVLParams): Promise<VaultTVLResult>;
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* @file Withdrawal display helpers
|
|
406
|
-
* @module display/withdrawal-display
|
|
407
|
-
*/
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Fetches a user's withdrawal requests from the backend API
|
|
411
|
-
*
|
|
412
|
-
* @param params - Filter parameters for withdrawal requests
|
|
413
|
-
* @returns Paginated list of withdrawal requests
|
|
414
|
-
* @throws {APIError} If the API request fails or parameters are invalid
|
|
415
|
-
*
|
|
416
|
-
* @example
|
|
417
|
-
* ```typescript
|
|
418
|
-
* const result = await getWithdrawalRequests({
|
|
419
|
-
* userAddress: "0x1234...",
|
|
420
|
-
* status: "PENDING",
|
|
421
|
-
* chainId: 1,
|
|
422
|
-
* });
|
|
423
|
-
* console.log(result.withdrawalRequests);
|
|
424
|
-
* ```
|
|
425
|
-
*/
|
|
426
|
-
declare function getWithdrawalRequests(params: GetWithdrawalRequestsParams): Promise<WithdrawalRequestsResult>;
|
|
427
|
-
/**
|
|
428
|
-
* Reads the withdrawal fee from the on-chain FeeModule contract
|
|
429
|
-
*
|
|
430
|
-
* Performs two sequential RPC calls:
|
|
431
|
-
* 1. Reads the FeeModule address from WithdrawQueue.feeModule()
|
|
432
|
-
* 2. Multicalls calculateOfferFees + offerFeePercentage on the FeeModule
|
|
433
|
-
*
|
|
434
|
-
* @param params - Parameters for fee calculation
|
|
435
|
-
* @returns Fee amount and fee percentage
|
|
436
|
-
* @throws {APIError} If vault not found or contract read fails
|
|
437
|
-
*
|
|
438
|
-
* @example
|
|
439
|
-
* ```typescript
|
|
440
|
-
* const fee = await getWithdrawalFee({
|
|
441
|
-
* vaultName: "Amplify USDC Core",
|
|
442
|
-
* chainId: 1,
|
|
443
|
-
* assetAddress: "0xA0b8...", // USDC
|
|
444
|
-
* amount: "1.0",
|
|
445
|
-
* offerAsset: "0x1234...", // vault shares
|
|
446
|
-
* wantAsset: "0xA0b8...", // USDC
|
|
447
|
-
* receiver: "0x5678...",
|
|
448
|
-
* });
|
|
449
|
-
* console.log(fee.feeAmount, fee.feePercentage);
|
|
450
|
-
* ```
|
|
451
|
-
*/
|
|
452
|
-
declare function getWithdrawalFee(params: GetWithdrawalFeeParams): Promise<WithdrawalFeeResult>;
|
|
453
|
-
/**
|
|
454
|
-
* Reads the minimum withdrawal order size from the WithdrawQueue contract
|
|
455
|
-
*
|
|
456
|
-
* @param params - Parameters to identify the vault
|
|
457
|
-
* @returns Minimum order size in vault shares and share decimals
|
|
458
|
-
* @throws {APIError} If vault not found or contract read fails
|
|
459
|
-
*
|
|
460
|
-
* @example
|
|
461
|
-
* ```typescript
|
|
462
|
-
* const result = await getMinimumWithdrawalOrderSize({
|
|
463
|
-
* vaultName: "Amplify USDC Core",
|
|
464
|
-
* chainId: 1,
|
|
465
|
-
* assetAddress: "0xA0b8...",
|
|
466
|
-
* });
|
|
467
|
-
* console.log(result.minimumOrderSize, result.shareDecimals);
|
|
468
|
-
* ```
|
|
469
|
-
*/
|
|
470
|
-
declare function getMinimumWithdrawalOrderSize(params: GetMinimumWithdrawalOrderSizeParams): Promise<MinimumWithdrawalOrderSizeResult>;
|
|
471
|
-
|
|
472
|
-
export { type CalculateDepositFeeParams, type CurrentSupplyResult, type DepositCapResult, type DepositFeeResult, type GetCurrentSupplyParams, type GetDepositCapParams, type GetMinimumMintParams, type GetMinimumWithdrawalOrderSizeParams, type GetShareValueParams, type GetVaultAPYParams, type GetVaultTVLParams, type GetWithdrawalFeeParams, type GetWithdrawalRequestsParams, type MinimumMintResult, type MinimumWithdrawalOrderSizeResult, type ShareValueResult, type VaultAPYResult, type VaultTVLResult, type WithdrawalFeeResult, type WithdrawalRequest, type WithdrawalRequestStatus, type WithdrawalRequestsResult, calculateDepositFee, getCurrentSupply, getDepositCap, getMinimumMint, getMinimumWithdrawalOrderSize, getShareValue, getVaultAPY, getVaultTVL, getWithdrawalFee, getWithdrawalRequests };
|
package/dist/display.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkWD6QFSXZ_js = require('./chunk-WD6QFSXZ.js');
|
|
4
|
-
require('./chunk-6JLKHV6O.js');
|
|
5
|
-
require('./chunk-FHE43NKY.js');
|
|
6
|
-
require('./chunk-TNL23CO2.js');
|
|
7
|
-
require('./chunk-GOJQYEJQ.js');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "calculateDepositFee", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkWD6QFSXZ_js.calculateDepositFee; }
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "getCurrentSupply", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return chunkWD6QFSXZ_js.getCurrentSupply; }
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "getDepositCap", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return chunkWD6QFSXZ_js.getDepositCap; }
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports, "getMinimumMint", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () { return chunkWD6QFSXZ_js.getMinimumMint; }
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(exports, "getMinimumWithdrawalOrderSize", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () { return chunkWD6QFSXZ_js.getMinimumWithdrawalOrderSize; }
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "getShareValue", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () { return chunkWD6QFSXZ_js.getShareValue; }
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(exports, "getVaultAPY", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function () { return chunkWD6QFSXZ_js.getVaultAPY; }
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(exports, "getVaultTVL", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function () { return chunkWD6QFSXZ_js.getVaultTVL; }
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(exports, "getWithdrawalFee", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () { return chunkWD6QFSXZ_js.getWithdrawalFee; }
|
|
46
|
-
});
|
|
47
|
-
Object.defineProperty(exports, "getWithdrawalRequests", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function () { return chunkWD6QFSXZ_js.getWithdrawalRequests; }
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=display.js.map
|
|
52
|
-
//# sourceMappingURL=display.js.map
|
package/dist/display.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"display.js"}
|
package/dist/display.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { calculateDepositFee, getCurrentSupply, getDepositCap, getMinimumMint, getMinimumWithdrawalOrderSize, getShareValue, getVaultAPY, getVaultTVL, getWithdrawalFee, getWithdrawalRequests } from './chunk-QMFYPHX5.mjs';
|
|
2
|
-
import './chunk-Y5LBT2WT.mjs';
|
|
3
|
-
import './chunk-UY2WD7MF.mjs';
|
|
4
|
-
import './chunk-6CU533DM.mjs';
|
|
5
|
-
import './chunk-ODXJYXUH.mjs';
|
|
6
|
-
//# sourceMappingURL=display.mjs.map
|
|
7
|
-
//# sourceMappingURL=display.mjs.map
|
package/dist/display.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"display.mjs"}
|