@augustdigital/sdk 8.5.0 → 8.6.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/README.md +207 -117
- package/lib/adapters/evm/index.d.ts +4 -4
- package/lib/adapters/evm/index.js +2 -0
- package/lib/adapters/solana/constants.d.ts +1 -1
- package/lib/adapters/solana/getters.d.ts +1 -1
- package/lib/adapters/solana/index.d.ts +4 -4
- package/lib/adapters/solana/index.js +4 -0
- package/lib/adapters/solana/types.d.ts +1 -1
- package/lib/adapters/solana/utils.d.ts +3 -3
- package/lib/adapters/solana/vault.actions.d.ts +4 -4
- package/lib/adapters/stellar/actions.d.ts +1 -1
- package/lib/adapters/stellar/index.d.ts +24 -2
- package/lib/adapters/stellar/index.js +25 -2
- package/lib/adapters/stellar/soroban.d.ts +1 -1
- package/lib/adapters/stellar/soroban.js +1 -1
- package/lib/adapters/stellar/submit.d.ts +20 -3
- package/lib/adapters/stellar/submit.js +74 -8
- package/lib/adapters/sui/getters.d.ts +1 -1
- package/lib/adapters/sui/index.d.ts +1 -1
- package/lib/adapters/sui/index.js +2 -0
- package/lib/adapters/sui/transformer.d.ts +2 -2
- package/lib/adapters/sui/transformer.js +1 -0
- package/lib/adapters/sui/types.d.ts +1 -1
- package/lib/core/analytics/sentry-runtime.js +1 -1
- package/lib/core/analytics/sentry.d.ts +2 -2
- package/lib/core/analytics/types.d.ts +1 -1
- package/lib/core/analytics/user-identity.d.ts +2 -2
- package/lib/core/analytics/user-identity.js +1 -1
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/core/base.class.d.ts +3 -3
- package/lib/core/base.class.js +10 -4
- package/lib/core/constants/adapters.d.ts +1 -1
- package/lib/core/constants/core.d.ts +2 -0
- package/lib/core/constants/core.js +6 -0
- package/lib/core/constants/swap-router.d.ts +37 -1
- package/lib/core/constants/swap-router.js +41 -1
- package/lib/core/constants/vaults.d.ts +1 -1
- package/lib/core/constants/web3.d.ts +1 -1
- package/lib/core/constants/web3.js +0 -3
- package/lib/core/errors/index.d.ts +2 -2
- package/lib/core/errors/index.js +9 -0
- package/lib/core/fetcher.d.ts +39 -39
- package/lib/core/fetcher.js +75 -57
- package/lib/core/helpers/adapters.d.ts +1 -1
- package/lib/core/helpers/core.d.ts +21 -18
- package/lib/core/helpers/core.js +22 -20
- package/lib/core/helpers/explorer-link.d.ts +1 -1
- package/lib/core/helpers/signer.d.ts +1 -1
- package/lib/core/helpers/swap-router.d.ts +1 -1
- package/lib/core/helpers/vault-version.d.ts +1 -1
- package/lib/core/helpers/vaults.d.ts +1 -1
- package/lib/core/helpers/web3.d.ts +2 -2
- package/lib/core/helpers/web3.js +9 -9
- package/lib/core/vault-metadata.d.ts +1 -1
- package/lib/core/version-check.js +1 -1
- package/lib/evm/methods/crossChainVault.js +1 -1
- package/lib/evm/types/crossChain.js +1 -1
- package/lib/main.d.ts +1 -1
- package/lib/main.js +7 -0
- package/lib/modules/sub-accounts/fetcher.d.ts +2 -2
- package/lib/modules/sub-accounts/main.d.ts +2 -2
- package/lib/modules/sub-accounts/main.js +1 -1
- package/lib/modules/sub-accounts/utils.d.ts +1 -1
- package/lib/modules/vaults/adapter.helpers.d.ts +3 -3
- package/lib/modules/vaults/fetcher.d.ts +25 -0
- package/lib/modules/vaults/fetcher.js +51 -1
- package/lib/modules/vaults/getters.d.ts +50 -50
- package/lib/modules/vaults/getters.js +68 -67
- package/lib/modules/vaults/main.js +3 -1
- package/lib/modules/vaults/read.actions.d.ts +2 -2
- package/lib/modules/vaults/utils/call-data-decoder.d.ts +1 -1
- package/lib/modules/vaults/utils.d.ts +19 -3
- package/lib/modules/vaults/utils.js +39 -6
- package/lib/modules/vaults/write.actions.js +35 -1
- package/lib/polyfills.js +3 -3
- package/lib/sdk.d.ts +1339 -1197
- package/lib/services/coingecko/fetcher.d.ts +10 -9
- package/lib/services/coingecko/fetcher.js +22 -18
- package/lib/services/debank/fetcher.d.ts +1 -1
- package/lib/services/debank/utils.d.ts +1 -1
- package/lib/services/debank/utils.js +1 -1
- package/lib/services/layerzero/deposits.d.ts +1 -1
- package/lib/services/layerzero/redeems.d.ts +1 -1
- package/lib/services/octavfi/fetcher.d.ts +1 -1
- package/lib/services/octavfi/types.d.ts +1 -1
- package/lib/services/octavfi/utils.d.ts +2 -2
- package/lib/services/subgraph/fetcher.js +1 -1
- package/lib/services/subgraph/vaults.js +76 -0
- package/lib/services/swap-quotes/index.d.ts +9 -0
- package/lib/services/swap-quotes/index.js +2 -1
- package/lib/services/swap-quotes/paraswap.d.ts +8 -0
- package/lib/services/swap-quotes/paraswap.js +8 -0
- package/lib/types/pools.d.ts +2 -2
- package/lib/types/staking.d.ts +1 -1
- package/lib/types/sub-accounts.d.ts +1 -1
- package/lib/types/subgraph.d.ts +10 -1
- package/lib/types/vaults.d.ts +26 -0
- package/lib/types/web3.d.ts +1 -1
- package/lib/types/webserver.d.ts +2 -2
- package/package.json +1 -1
package/lib/sdk.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Abi } from 'abitype';
|
|
2
2
|
import type { AbiParametersToPrimitiveTypes } from 'abitype';
|
|
3
|
-
import { AnchorProvider } from '@coral-xyz/anchor';
|
|
3
|
+
import type { AnchorProvider } from '@coral-xyz/anchor';
|
|
4
4
|
import type { BaseContract } from 'ethers';
|
|
5
5
|
import { Connection } from '@solana/web3.js';
|
|
6
6
|
import type { ContractTransaction } from 'ethers';
|
|
@@ -21,10 +21,10 @@ import { JsonRpcProvider } from 'ethers';
|
|
|
21
21
|
import { LRUCache } from 'lru-cache';
|
|
22
22
|
import type { Overrides } from 'ethers';
|
|
23
23
|
import { Program } from '@coral-xyz/anchor';
|
|
24
|
-
import { Provider } from 'ethers';
|
|
24
|
+
import type { Provider } from 'ethers';
|
|
25
25
|
import { PublicKey } from '@solana/web3.js';
|
|
26
26
|
import type { Result } from 'ethers';
|
|
27
|
-
import { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
27
|
+
import type { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
28
28
|
import type * as Sentry from '@sentry/browser';
|
|
29
29
|
import { Signer } from 'ethers';
|
|
30
30
|
import { Transaction } from '@solana/web3.js';
|
|
@@ -15219,7 +15219,7 @@ export declare class AugustBase {
|
|
|
15219
15219
|
* ```
|
|
15220
15220
|
*/
|
|
15221
15221
|
/** Stable error codes attached to SDK errors. */
|
|
15222
|
-
export declare type AugustErrorCode = 'AUTH_MISSING_KEY' | 'AUTH_INVALID_KEY' | 'AUTH_FORBIDDEN' | 'AUTH_UNAUTHORIZED' | 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS' | 'NETWORK_ERROR' | 'TIMEOUT' | 'RATE_LIMITED' | 'SERVER_ERROR' | 'UNKNOWN';
|
|
15222
|
+
export declare type AugustErrorCode = 'AUTH_MISSING_KEY' | 'AUTH_INVALID_KEY' | 'AUTH_FORBIDDEN' | 'AUTH_UNAUTHORIZED' | 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS' | 'ACCOUNT_NOT_FUNDED' | 'NETWORK_ERROR' | 'TIMEOUT' | 'RATE_LIMITED' | 'SERVER_ERROR' | 'UNKNOWN';
|
|
15223
15223
|
|
|
15224
15224
|
/** Options accepted by every SDK error constructor. */
|
|
15225
15225
|
export declare interface AugustErrorOptions {
|
|
@@ -15301,7 +15301,7 @@ declare class AugustSDK extends AugustBase {
|
|
|
15301
15301
|
* @param symbol - Token symbol or contract address
|
|
15302
15302
|
* @returns Current price in USD
|
|
15303
15303
|
*/
|
|
15304
|
-
getPrice(symbol: string): Promise<
|
|
15304
|
+
getPrice(symbol: string): Promise<number>;
|
|
15305
15305
|
/**
|
|
15306
15306
|
* Vault Data and Operations
|
|
15307
15307
|
*/
|
|
@@ -15868,7 +15868,7 @@ export declare class AugustTimeoutError extends AugustSDKError {
|
|
|
15868
15868
|
|
|
15869
15869
|
/** Caller-side input failed validation. */
|
|
15870
15870
|
export declare class AugustValidationError extends AugustSDKError {
|
|
15871
|
-
constructor(code: Extract<AugustErrorCode, 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS'>, message: string, options?: AugustErrorOptions);
|
|
15871
|
+
constructor(code: Extract<AugustErrorCode, 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS' | 'ACCOUNT_NOT_FUNDED'>, message: string, options?: AugustErrorOptions);
|
|
15872
15872
|
}
|
|
15873
15873
|
|
|
15874
15874
|
/**
|
|
@@ -16381,21 +16381,23 @@ declare let cacheStats: {
|
|
|
16381
16381
|
};
|
|
16382
16382
|
|
|
16383
16383
|
/**
|
|
16384
|
-
* Calculate weighted average for array of objects
|
|
16385
|
-
* @param
|
|
16386
|
-
* @param
|
|
16387
|
-
* @param
|
|
16388
|
-
* @returns
|
|
16384
|
+
* Calculate weighted average for array of objects.
|
|
16385
|
+
* @param data - Array of objects with values
|
|
16386
|
+
* @param valueProperty - Property name containing the value to average
|
|
16387
|
+
* @param weightProperty - Optional property to base weights on
|
|
16388
|
+
* @returns Weighted average
|
|
16389
16389
|
*/
|
|
16390
|
-
export declare function calculateWeightedAverage(data?:
|
|
16390
|
+
export declare function calculateWeightedAverage<T extends Record<string, unknown>>(data?: T[], valueProperty?: string, weightProperty?: string): number;
|
|
16391
16391
|
|
|
16392
16392
|
/**
|
|
16393
|
-
* Calculate weights based on a specific property in array of objects
|
|
16394
|
-
* @param
|
|
16395
|
-
* @param
|
|
16396
|
-
* @returns
|
|
16393
|
+
* Calculate weights based on a specific property in array of objects.
|
|
16394
|
+
* @param data - Array of objects to calculate weights for
|
|
16395
|
+
* @param weightProperty - Property name to base weights on
|
|
16396
|
+
* @returns Original data with each item's `weight` added
|
|
16397
16397
|
*/
|
|
16398
|
-
export declare function calculateWeights(data?:
|
|
16398
|
+
export declare function calculateWeights<T extends Record<string, unknown>>(data?: T[], weightProperty?: string): Array<T & {
|
|
16399
|
+
weight: number;
|
|
16400
|
+
}>;
|
|
16399
16401
|
|
|
16400
16402
|
/**
|
|
16401
16403
|
* Check if a user can deposit from their current chain.
|
|
@@ -17072,8 +17074,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17072
17074
|
/**
|
|
17073
17075
|
* Make unauthenticated requests to August public API endpoints.
|
|
17074
17076
|
* Used for fetching vault metadata and public market data.
|
|
17075
|
-
* @param relativeUrl Endpoint path relative to public API base URL
|
|
17076
|
-
* @param options Request configuration including method and headers
|
|
17077
|
+
* @param relativeUrl - Endpoint path relative to public API base URL
|
|
17078
|
+
* @param options - Request configuration including method and headers
|
|
17077
17079
|
* @returns Response object if successful
|
|
17078
17080
|
* @throws Error with correlation ID if request fails
|
|
17079
17081
|
*/
|
|
@@ -17082,9 +17084,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17082
17084
|
/**
|
|
17083
17085
|
* Make authenticated requests using Bearer token authentication.
|
|
17084
17086
|
* Typically used for user-specific operations requiring OAuth tokens.
|
|
17085
|
-
* @param bearerToken OAuth bearer token
|
|
17086
|
-
* @param relativeUrl Endpoint path relative to base URL
|
|
17087
|
-
* @param options Request configuration including method and headers
|
|
17087
|
+
* @param bearerToken - OAuth bearer token
|
|
17088
|
+
* @param relativeUrl - Endpoint path relative to base URL
|
|
17089
|
+
* @param options - Request configuration including method and headers
|
|
17088
17090
|
* @returns Response object if successful
|
|
17089
17091
|
* @throws Error with correlation ID if request fails
|
|
17090
17092
|
*/
|
|
@@ -17093,9 +17095,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17093
17095
|
/**
|
|
17094
17096
|
* Make authenticated requests to August backend services using API key.
|
|
17095
17097
|
* Automatically logs errors with correlation IDs for debugging.
|
|
17096
|
-
* @param apiKey August API key for authentication
|
|
17097
|
-
* @param relativeUrl Endpoint path relative to base URL
|
|
17098
|
-
* @param options Request configuration including method and headers
|
|
17098
|
+
* @param apiKey - August API key for authentication
|
|
17099
|
+
* @param relativeUrl - Endpoint path relative to base URL
|
|
17100
|
+
* @param options - Request configuration including method and headers
|
|
17099
17101
|
* @returns Response object if successful
|
|
17100
17102
|
* @throws Error with correlation ID if request fails
|
|
17101
17103
|
*/
|
|
@@ -17117,8 +17119,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17117
17119
|
|
|
17118
17120
|
/**
|
|
17119
17121
|
* Fetch the points leaderboard data.
|
|
17120
|
-
* @param params Optional parameters for pagination and sorting
|
|
17121
|
-
* @param options Request options including headers
|
|
17122
|
+
* @param params - Optional parameters for pagination and sorting
|
|
17123
|
+
* @param options - Request options including headers
|
|
17122
17124
|
* @returns Leaderboard response data
|
|
17123
17125
|
*/
|
|
17124
17126
|
export declare function fetchPointsLeaderboard({ params, options, }: {
|
|
@@ -17188,8 +17190,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17188
17190
|
/**
|
|
17189
17191
|
* Fetch tokenized vault configurations from backend API.
|
|
17190
17192
|
* Results are cached to reduce API calls. Optionally filter by specific vault address.
|
|
17191
|
-
* @param pool Optional vault address to filter results
|
|
17192
|
-
* @param headers Monitoring headers for request tracking
|
|
17193
|
+
* @param pool - Optional vault address to filter results
|
|
17194
|
+
* @param headers - Monitoring headers for request tracking
|
|
17193
17195
|
* @returns Array of tokenized vault configurations
|
|
17194
17196
|
*/
|
|
17195
17197
|
export declare function fetchTokenizedVault(pool: VaultAddress, headers?: IWSMonitorHeaders, loadSubaccounts?: boolean, loadSnapshots?: boolean): Promise<ITokenizedVault[]>;
|
|
@@ -17197,9 +17199,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17197
17199
|
/**
|
|
17198
17200
|
* Fetch active loans for a specific vault from backend API.
|
|
17199
17201
|
* Results are cached per vault and chain to reduce API calls.
|
|
17200
|
-
* @param pool Vault address
|
|
17201
|
-
* @param chainId Network chain ID
|
|
17202
|
-
* @param headers Monitoring headers for request tracking
|
|
17202
|
+
* @param pool - Vault address
|
|
17203
|
+
* @param chainId - Network chain ID
|
|
17204
|
+
* @param headers - Monitoring headers for request tracking
|
|
17203
17205
|
* @returns Array of active loan objects
|
|
17204
17206
|
*/
|
|
17205
17207
|
export declare function fetchTokenizedVaultLoans(pool: VaultAddress, chainId: number, headers?: IWSMonitorHeaders): Promise<IWSVaultLoan[]>;
|
|
@@ -17207,9 +17209,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17207
17209
|
/**
|
|
17208
17210
|
* Fetch tokenized vault configurations from backend API.
|
|
17209
17211
|
* Results are cached to reduce API calls. Optionally filter by specific vault address.
|
|
17210
|
-
* @param pool Optional vault address to filter results
|
|
17211
|
-
* @param headers Monitoring headers for request tracking
|
|
17212
|
-
* @param loadSubaccounts Optional flag to load subaccounts and EOA operators (defaults to true on API)
|
|
17212
|
+
* @param pool - Optional vault address to filter results
|
|
17213
|
+
* @param headers - Monitoring headers for request tracking
|
|
17214
|
+
* @param loadSubaccounts - Optional flag to load subaccounts and EOA operators (defaults to true on API)
|
|
17213
17215
|
* @returns Array of tokenized vault configurations
|
|
17214
17216
|
*/
|
|
17215
17217
|
export declare function fetchTokenizedVaults(pool?: IAddress, headers?: IWSMonitorHeaders, loadSubaccounts?: boolean, loadSnapshots?: boolean): Promise<ITokenizedVault[]>;
|
|
@@ -17217,9 +17219,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17217
17219
|
/**
|
|
17218
17220
|
* Fetch subaccount loans for a specific tokenized vault (lending pool).
|
|
17219
17221
|
* Retrieves all active subaccount loan data from the backend.
|
|
17220
|
-
* @param pool Vault address
|
|
17221
|
-
* @param chainId Network chain ID
|
|
17222
|
-
* @param headers Monitoring headers for request tracking
|
|
17222
|
+
* @param pool - Vault address
|
|
17223
|
+
* @param chainId - Network chain ID
|
|
17224
|
+
* @param headers - Monitoring headers for request tracking
|
|
17223
17225
|
* @returns Array of active subaccount loan objects
|
|
17224
17226
|
*/
|
|
17225
17227
|
export declare function fetchTokenizedVaultSubaccountLoans(pool: VaultAddress, chainId: number, headers?: IWSMonitorHeaders): Promise<IWSVaultLoan[]>;
|
|
@@ -17228,19 +17230,19 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17228
17230
|
* Fetch current USD price for a token symbol or vault LP token.
|
|
17229
17231
|
* For vault LP tokens, calculates share price using totalAssets/totalSupply ratio.
|
|
17230
17232
|
* Falls back to CoinGecko if primary source fails.
|
|
17231
|
-
* @param symbol Token symbol or contract address
|
|
17232
|
-
* @param provider Optional web3 provider for on-chain price calculations
|
|
17233
|
-
* @param coinGeckoKey Optional CoinGecko API key for fallback pricing
|
|
17234
|
-
* @param headers Monitoring headers for request tracking
|
|
17233
|
+
* @param symbol - Token symbol or contract address
|
|
17234
|
+
* @param provider - Optional web3 provider for on-chain price calculations
|
|
17235
|
+
* @param coinGeckoKey - Optional CoinGecko API key for fallback pricing
|
|
17236
|
+
* @param headers - Monitoring headers for request tracking
|
|
17235
17237
|
* @returns Token price in USD
|
|
17236
17238
|
*/
|
|
17237
|
-
export declare function fetchTokenPrice(symbol: string, provider?: IContractRunner, coinGeckoKey?: string, headers?: IWSMonitorHeaders): Promise<
|
|
17239
|
+
export declare function fetchTokenPrice(symbol: string, provider?: IContractRunner, coinGeckoKey?: string, headers?: IWSMonitorHeaders): Promise<number>;
|
|
17238
17240
|
|
|
17239
17241
|
/**
|
|
17240
17242
|
* Fetch token price by contract address and chain ID from August price server.
|
|
17241
|
-
* @param address Token contract address
|
|
17242
|
-
* @param chainId Network chain ID
|
|
17243
|
-
* @param headers Optional monitoring headers for request tracking
|
|
17243
|
+
* @param address - Token contract address
|
|
17244
|
+
* @param chainId - Network chain ID
|
|
17245
|
+
* @param headers - Optional monitoring headers for request tracking
|
|
17244
17246
|
* @returns Token price in USD, or 0 if not found
|
|
17245
17247
|
*/
|
|
17246
17248
|
export declare function fetchTokenPriceByAddress(address: VaultAddress, chainId: number, headers?: IWSMonitorHeaders): Promise<number>;
|
|
@@ -17256,9 +17258,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17256
17258
|
/**
|
|
17257
17259
|
* Fetch historical timeseries data for a specific vault.
|
|
17258
17260
|
* Returns TVL, APY, PnL, and share price data over time.
|
|
17259
|
-
* @param vaultAddress Vault contract address
|
|
17260
|
-
* @param nDays Number of days of historical data to fetch (default 30, min 1)
|
|
17261
|
-
* @param headers Monitoring headers for request tracking
|
|
17261
|
+
* @param vaultAddress - Vault contract address
|
|
17262
|
+
* @param nDays - Number of days of historical data to fetch (default 30, min 1)
|
|
17263
|
+
* @param headers - Monitoring headers for request tracking
|
|
17262
17264
|
* @returns Historical timeseries data with date keys
|
|
17263
17265
|
*/
|
|
17264
17266
|
export declare function fetchVaultHistoricalTimeseries(vaultAddress: IAddress, nDays?: number, headers?: IWSMonitorHeaders): Promise<IHistoricalTimeseriesResponse>;
|
|
@@ -17402,8 +17404,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17402
17404
|
* look up entries without worrying about EIP-55 checksum casing in either the
|
|
17403
17405
|
* backend response or the caller's input.
|
|
17404
17406
|
*
|
|
17405
|
-
* @param options Standard vault options — `rpcUrl` should match `vault`'s chain.
|
|
17406
|
-
* @param vault Optional vault address to scope the fetch to.
|
|
17407
|
+
* @param options - Standard vault options — `rpcUrl` should match `vault`'s chain.
|
|
17408
|
+
* @param vault - Optional vault address to scope the fetch to.
|
|
17407
17409
|
* @returns Map of lowercased vault address → array of borrower-health-factor rows.
|
|
17408
17410
|
*/
|
|
17409
17411
|
export declare function getHealthFactorOfBorrowersByVault({ options, vault, }: {
|
|
@@ -17505,10 +17507,10 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17505
17507
|
|
|
17506
17508
|
/**
|
|
17507
17509
|
* Preview the amount of assets that would be received for redeeming shares (queued redemption).
|
|
17508
|
-
* @param vault Vault contract address
|
|
17509
|
-
* @param sharesAmount Amount of shares to redeem (human-readable, raw bigint, or string)
|
|
17510
|
-
* @param options RPC configuration
|
|
17511
|
-
* @returns The amount of assets as INormalizedNumber
|
|
17510
|
+
* @param vault - Vault contract address
|
|
17511
|
+
* @param sharesAmount - Amount of shares to redeem (human-readable, raw bigint, or string)
|
|
17512
|
+
* @param options - RPC configuration
|
|
17513
|
+
* @returns The amount of assets as an INormalizedNumber with `normalized` and `raw` fields
|
|
17512
17514
|
*/
|
|
17513
17515
|
export declare function getPreviewRedemption({ vault, sharesAmount, options, }: {
|
|
17514
17516
|
vault: IAddress;
|
|
@@ -17686,8 +17688,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17686
17688
|
/**
|
|
17687
17689
|
* Fetch user points from the backend API endpoint.
|
|
17688
17690
|
* This replaces client-side points calculation with server-side processing.
|
|
17689
|
-
* @param userAddress User wallet address (EVM or Solana)
|
|
17690
|
-
* @param options Request options including headers
|
|
17691
|
+
* @param userAddress - User wallet address (EVM or Solana)
|
|
17692
|
+
* @param options - Request options including headers
|
|
17691
17693
|
* @returns Points data from the backend API
|
|
17692
17694
|
*/
|
|
17693
17695
|
export declare function getUserPoints({ userAddress, options, }: {
|
|
@@ -17714,10 +17716,10 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17714
17716
|
* Fetch comprehensive vault data including on-chain state and backend metadata.
|
|
17715
17717
|
* Routes to appropriate chain adapter (EVM v1/v2, Solana, or Stellar) based on vault version.
|
|
17716
17718
|
* Optionally enriches with loan and allocation data.
|
|
17717
|
-
* @param vault Vault contract address (EVM hex, Stellar C-address, or Solana program ID)
|
|
17718
|
-
* @param loans Include active loan data
|
|
17719
|
-
* @param allocations Include DeFi/CeFi allocation breakdowns
|
|
17720
|
-
* @param options RPC and service configuration
|
|
17719
|
+
* @param vault - Vault contract address (EVM hex, Stellar C-address, or Solana program ID)
|
|
17720
|
+
* @param loans - Include active loan data
|
|
17721
|
+
* @param allocations - Include DeFi/CeFi allocation breakdowns
|
|
17722
|
+
* @param options - RPC and service configuration
|
|
17721
17723
|
* @returns Complete vault object with optional enrichments
|
|
17722
17724
|
*/
|
|
17723
17725
|
export declare function getVault({ vault, loans, allocations, options, loadSubaccounts, loadSnapshots, }: {
|
|
@@ -17741,8 +17743,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17741
17743
|
* Fetch comprehensive vault asset allocation breakdown.
|
|
17742
17744
|
* Includes DeFi protocols (via DeBank), CeFi balances, OTC positions, and loans.
|
|
17743
17745
|
* Categorizes exposures by borrowing, supplying, lending, and wallet holdings.
|
|
17744
|
-
* @param vault Vault address
|
|
17745
|
-
* @param options RPC configuration
|
|
17746
|
+
* @param vault - Vault address
|
|
17747
|
+
* @param options - RPC configuration
|
|
17746
17748
|
* @returns Detailed allocation data with exposure categorization
|
|
17747
17749
|
*/
|
|
17748
17750
|
export declare function getVaultAllocations(vault: IAddress, options: IVaultBaseOptions): Promise<IVaultAllocations>;
|
|
@@ -17756,8 +17758,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17756
17758
|
* These fields will be removed on 2026-01-01.
|
|
17757
17759
|
* Use `liquidAPY30Day` and `liquidAPY7Day` fields instead.
|
|
17758
17760
|
*
|
|
17759
|
-
* @param vault Vault contract address
|
|
17760
|
-
* @param options Request options including headers
|
|
17761
|
+
* @param vault - Vault contract address
|
|
17762
|
+
* @param options - Request options including headers
|
|
17761
17763
|
* @returns Annualized APY data including liquidity APY
|
|
17762
17764
|
*/
|
|
17763
17765
|
export declare function getVaultAnnualizedApy({ vault, options, }: {
|
|
@@ -17802,8 +17804,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17802
17804
|
* `health_factor: undefined` so callers can render an explicit empty state
|
|
17803
17805
|
* rather than a perpetual loading skeleton.
|
|
17804
17806
|
*
|
|
17805
|
-
* @param vault Vault address to scope the fetch to.
|
|
17806
|
-
* @param options Standard vault options — `rpcUrl` must point at `vault`'s chain.
|
|
17807
|
+
* @param vault - Vault address to scope the fetch to.
|
|
17808
|
+
* @param options - Standard vault options — `rpcUrl` must point at `vault`'s chain.
|
|
17807
17809
|
* @returns Array of `IVaultBorrowerHealthFactor`, one entry per active loan.
|
|
17808
17810
|
*/
|
|
17809
17811
|
export declare function getVaultBorrowerHealthFactor({ vault, options, }: {
|
|
@@ -17847,10 +17849,10 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17847
17849
|
|
|
17848
17850
|
/**
|
|
17849
17851
|
* Fetch pending redemptions for a vault with liquidity analysis.
|
|
17850
|
-
* @param vault Vault contract address
|
|
17851
|
-
* @param pastDays Number of past days to include (default 7, min 1, max 30)
|
|
17852
|
-
* @param futureDays Number of future days to include (default 14, min 1, max 30)
|
|
17853
|
-
* @param options Request options including headers
|
|
17852
|
+
* @param vault - Vault contract address
|
|
17853
|
+
* @param pastDays - Number of past days to include (default 7, min 1, max 30)
|
|
17854
|
+
* @param futureDays - Number of future days to include (default 14, min 1, max 30)
|
|
17855
|
+
* @param options - Request options including headers
|
|
17854
17856
|
* @returns Pending redemptions grouped by date with liquidity summary
|
|
17855
17857
|
*/
|
|
17856
17858
|
export declare function getVaultPendingRedemptions({ vault, pastDays, futureDays, options, }: {
|
|
@@ -17864,8 +17866,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17864
17866
|
* Calculate PnL for a vault (vault-level, not user-specific).
|
|
17865
17867
|
* Returns the vault's overall profit and loss across all users.
|
|
17866
17868
|
*
|
|
17867
|
-
* @param vault Vault contract address
|
|
17868
|
-
* @param options RPC configuration and service options
|
|
17869
|
+
* @param vault - Vault contract address
|
|
17870
|
+
* @param options - RPC configuration and service options
|
|
17869
17871
|
* @returns Vault PnL in USD and notional value
|
|
17870
17872
|
*/
|
|
17871
17873
|
export declare function getVaultPnl({ vault, options, }: {
|
|
@@ -17892,9 +17894,18 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17892
17894
|
}): Promise<IVaultRedemptionHistoryItem[]>;
|
|
17893
17895
|
|
|
17894
17896
|
/**
|
|
17895
|
-
* Get the rewards for the vault
|
|
17896
|
-
*
|
|
17897
|
-
*
|
|
17897
|
+
* Get the rewards for the vault.
|
|
17898
|
+
*
|
|
17899
|
+
* Builds the display-facing rewards summary from the raw tokenized-vault
|
|
17900
|
+
* rewards array. In addition to the legacy `additionalPoints` string list, it
|
|
17901
|
+
* emits `additionalPointsDetailed`, which pairs each label with its
|
|
17902
|
+
* backend-provided `img_url`. Consumers (e.g. the Upshift app) resolve a
|
|
17903
|
+
* reward's logo from this `imgUrl` first, falling back to a bundled asset only
|
|
17904
|
+
* when it is absent — so a newly-added reward with a backend logo (e.g.
|
|
17905
|
+
* "Cores") renders its icon without any client-side keyword mapping.
|
|
17906
|
+
*
|
|
17907
|
+
* @param tokenizedVault - The tokenized vault.
|
|
17908
|
+
* @returns The rewards summary, including `additionalPointsDetailed`.
|
|
17898
17909
|
*/
|
|
17899
17910
|
export declare function getVaultRewards(tokenizedVault: ITokenizedVault): {
|
|
17900
17911
|
points: string;
|
|
@@ -17904,6 +17915,13 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17904
17915
|
value: number;
|
|
17905
17916
|
}[];
|
|
17906
17917
|
additionalPoints: string[];
|
|
17918
|
+
additionalPointsDetailed: {
|
|
17919
|
+
id: string;
|
|
17920
|
+
label: string;
|
|
17921
|
+
text: string;
|
|
17922
|
+
imgUrl: string;
|
|
17923
|
+
multiplier: number;
|
|
17924
|
+
}[];
|
|
17907
17925
|
};
|
|
17908
17926
|
|
|
17909
17927
|
/**
|
|
@@ -17913,8 +17931,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17913
17931
|
|
|
17914
17932
|
/**
|
|
17915
17933
|
* Fetch summary data for a vault (name, type, chain, recent returns).
|
|
17916
|
-
* @param vault Vault contract address
|
|
17917
|
-
* @param options Request options including headers
|
|
17934
|
+
* @param vault - Vault contract address
|
|
17935
|
+
* @param options - Request options including headers
|
|
17918
17936
|
* @returns Vault summary data
|
|
17919
17937
|
*/
|
|
17920
17938
|
export declare function getVaultSummary({ vault, options, }: {
|
|
@@ -17941,9 +17959,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17941
17959
|
* 2. Fetch user's current assets (balanceOf * sharePrice via convertToAssets)
|
|
17942
17960
|
* 3. Calculate PnL = assets withdrawn + current assets - assets deposited
|
|
17943
17961
|
*
|
|
17944
|
-
* @param vault Vault contract address
|
|
17945
|
-
* @param wallet User wallet address
|
|
17946
|
-
* @param options RPC configuration and service options
|
|
17962
|
+
* @param vault - Vault contract address
|
|
17963
|
+
* @param wallet - User wallet address
|
|
17964
|
+
* @param options - RPC configuration and service options
|
|
17947
17965
|
* @returns Lifetime PnL data in both native token and USD
|
|
17948
17966
|
*/
|
|
17949
17967
|
export declare function getVaultUserLifetimePnl({ vault, wallet, options, }: {
|
|
@@ -17959,9 +17977,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
17959
17977
|
|
|
17960
17978
|
/**
|
|
17961
17979
|
* Fetch withdrawal summary and pending queue for a vault.
|
|
17962
|
-
* @param vault Vault contract address
|
|
17963
|
-
* @param chain Chain identifier (e.g., chain ID as string)
|
|
17964
|
-
* @param options Request options including headers
|
|
17980
|
+
* @param vault - Vault contract address
|
|
17981
|
+
* @param chain - Chain identifier (e.g., chain ID as string)
|
|
17982
|
+
* @param options - Request options including headers
|
|
17965
17983
|
* @returns Withdrawal summary and pending queue
|
|
17966
17984
|
*/
|
|
17967
17985
|
export declare function getVaultWithdrawals({ vault, chain, options, }: {
|
|
@@ -18000,13 +18018,13 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
18000
18018
|
* - `'ready_to_claim'` — Claimable date has passed (within the lookback window) but no processed event found.
|
|
18001
18019
|
* - `'pending'` — Claimable date is still in the future.
|
|
18002
18020
|
*
|
|
18003
|
-
* @param params - Query parameters
|
|
18004
|
-
*
|
|
18005
|
-
*
|
|
18006
|
-
*
|
|
18007
|
-
*
|
|
18008
|
-
*
|
|
18009
|
-
*
|
|
18021
|
+
* @param params - Query parameters:
|
|
18022
|
+
* - `vault` — Vault address to query.
|
|
18023
|
+
* - `receiver` — (Optional) Filter by receiver address.
|
|
18024
|
+
* - `lookbackBlocks` — (Optional) On-chain log lookback window in blocks.
|
|
18025
|
+
* Defaults to a chain-specific value (e.g. 150,000 for Ethereum, 3,456,000 for Monad).
|
|
18026
|
+
* Increasing this scans more history but requires more RPC calls.
|
|
18027
|
+
* - `options` — Standard vault query options (provider, RPC URL, etc.).
|
|
18010
18028
|
* @returns Array of withdrawal requests with status and claimable dates
|
|
18011
18029
|
*
|
|
18012
18030
|
* @example
|
|
@@ -18051,8 +18069,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
18051
18069
|
/**
|
|
18052
18070
|
* Fetch the timestamp when yield was last realized for a vault.
|
|
18053
18071
|
* Returns the assetsUpdatedOn timestamp from the vault contract.
|
|
18054
|
-
* @param vault Vault contract address
|
|
18055
|
-
* @param options RPC configuration
|
|
18072
|
+
* @param vault - Vault contract address
|
|
18073
|
+
* @param options - RPC configuration
|
|
18056
18074
|
* @returns Timestamp (Unix timestamp in seconds) when yield was last realized
|
|
18057
18075
|
*/
|
|
18058
18076
|
export declare function getYieldLastRealizedOn({ vault, options, }: {
|
|
@@ -18822,7 +18840,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
18822
18840
|
export declare type IFetchAugustOptions = {
|
|
18823
18841
|
method?: IFetchAugustMethods;
|
|
18824
18842
|
headers?: Record<string, string>;
|
|
18825
|
-
data?:
|
|
18843
|
+
data?: unknown;
|
|
18826
18844
|
server?: keyof typeof WEBSERVER_URL;
|
|
18827
18845
|
/** Caller-supplied AbortSignal; combined with the default timeout. */
|
|
18828
18846
|
signal?: AbortSignal;
|
|
@@ -19624,6 +19642,15 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
19624
19642
|
type: 'withdraw-request' | 'deposit' | 'withdraw-processed';
|
|
19625
19643
|
decimals?: number;
|
|
19626
19644
|
isInstant?: boolean;
|
|
19645
|
+
/**
|
|
19646
|
+
* Deposit asset token address, when known. Pre-deposit vaults accept
|
|
19647
|
+
* multiple deposit assets with differing decimals (e.g. USDS at 18,
|
|
19648
|
+
* USDC at 6), so `amount` cannot be normalized with the vault's own
|
|
19649
|
+
* decimals alone — consumers (notably lifetime PnL) key off this address
|
|
19650
|
+
* to resolve the correct per-asset decimals and USD price. Absent for
|
|
19651
|
+
* single-asset vaults, where the vault `decimals` is correct.
|
|
19652
|
+
*/
|
|
19653
|
+
assetIn?: IAddress;
|
|
19627
19654
|
}
|
|
19628
19655
|
|
|
19629
19656
|
export declare interface ISubgraphWithdraw extends ISubgraphBase {
|
|
@@ -19726,6 +19753,15 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
19726
19753
|
* in `[0, 10_000)` — 10_000 disables protection entirely and is rejected.
|
|
19727
19754
|
*/
|
|
19728
19755
|
slippageBps?: number;
|
|
19756
|
+
/**
|
|
19757
|
+
* Optional aggregator contract-method filter. When set, the aggregator is
|
|
19758
|
+
* constrained to this single method (ParaSwap's `/prices`
|
|
19759
|
+
* `includeContractMethods`), so the returned calldata's leading 4-byte
|
|
19760
|
+
* selector is deterministic — required when the on-chain SwapRouter only
|
|
19761
|
+
* authorizes one selector per router. When omitted, the aggregator picks the
|
|
19762
|
+
* optimal method freely and the selector may vary between quotes.
|
|
19763
|
+
*/
|
|
19764
|
+
contractMethod?: string;
|
|
19729
19765
|
/** Aggregator partner key. Defaults to `'august'`. */
|
|
19730
19766
|
partner?: string;
|
|
19731
19767
|
/** Aggregator partner-fee receiver. Defaults to the August partner address. */
|
|
@@ -20389,6 +20425,27 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
20389
20425
|
transactionHash?: string;
|
|
20390
20426
|
};
|
|
20391
20427
|
|
|
20428
|
+
/**
|
|
20429
|
+
* A single reward paired with its backend-provided logo.
|
|
20430
|
+
*
|
|
20431
|
+
* `id` is the reward's stable backend identifier ({@link ITokenizedVaultReward.id})
|
|
20432
|
+
* and is the key consumers should join on — it is unique even when two rewards
|
|
20433
|
+
* share a multiplier and text. `label` is display-only: it mirrors the
|
|
20434
|
+
* corresponding {@link IVaultRewards.additionalPoints} string (and so carries a
|
|
20435
|
+
* leading space when `multiplier === 1`, e.g. `" Cores"`), so it is fine to
|
|
20436
|
+
* print but must not be treated as a unique key.
|
|
20437
|
+
*
|
|
20438
|
+
* `imgUrl` is `null` when the backend has no logo for the reward, in which
|
|
20439
|
+
* case consumers fall back to a bundled asset.
|
|
20440
|
+
*/
|
|
20441
|
+
export declare type IVaultRewardDetail = {
|
|
20442
|
+
id: string;
|
|
20443
|
+
label: string;
|
|
20444
|
+
text: string;
|
|
20445
|
+
imgUrl: string | null;
|
|
20446
|
+
multiplier: number;
|
|
20447
|
+
};
|
|
20448
|
+
|
|
20392
20449
|
export declare type IVaultRewards = {
|
|
20393
20450
|
points: string;
|
|
20394
20451
|
multiplier: number;
|
|
@@ -20397,6 +20454,12 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
20397
20454
|
timestamp: number;
|
|
20398
20455
|
}[];
|
|
20399
20456
|
additionalPoints: string[];
|
|
20457
|
+
/**
|
|
20458
|
+
* Optional so this addition is non-breaking for external code that
|
|
20459
|
+
* constructs an {@link IVaultRewards}. `getVaultRewards` always populates it;
|
|
20460
|
+
* readers should treat an absent value as an empty list.
|
|
20461
|
+
*/
|
|
20462
|
+
additionalPointsDetailed?: IVaultRewardDetail[];
|
|
20400
20463
|
};
|
|
20401
20464
|
|
|
20402
20465
|
export declare interface IVaultStrategist {
|
|
@@ -21145,10 +21208,10 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
21145
21208
|
/**
|
|
21146
21209
|
* Arrays
|
|
21147
21210
|
*/
|
|
21148
|
-
export declare function orderObjArrByDate(objectArray:
|
|
21211
|
+
export declare function orderObjArrByDate<T extends Record<string, unknown>>(objectArray: T[], options?: {
|
|
21149
21212
|
key?: string;
|
|
21150
21213
|
order?: 'asc' | 'desc';
|
|
21151
|
-
}):
|
|
21214
|
+
}): T[];
|
|
21152
21215
|
|
|
21153
21216
|
/**
|
|
21154
21217
|
* 32-byte origin codes registered on the `SwapRouter` via `addOrigin`.
|
|
@@ -21276,9 +21339,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
21276
21339
|
* Execute multiple promises with retry logic and allow partial failures.
|
|
21277
21340
|
* Unlike Promise.all, continues execution if some promises fail.
|
|
21278
21341
|
* Failed promises return null to maintain array index alignment.
|
|
21279
|
-
* @param promises Array of promises to execute
|
|
21280
|
-
* @param maxRetries Maximum retry attempts per promise
|
|
21281
|
-
* @param baseDelay Initial delay for exponential backoff
|
|
21342
|
+
* @param promises - Array of promises to execute
|
|
21343
|
+
* @param maxRetries - Maximum retry attempts per promise
|
|
21344
|
+
* @param baseDelay - Initial delay for exponential backoff
|
|
21282
21345
|
* @returns Array of results with null for failed promises
|
|
21283
21346
|
*/
|
|
21284
21347
|
export declare function promiseSettle<T>(promises: Promise<T>[], maxRetries?: number, baseDelay?: number): Promise<T[]>;
|
|
@@ -21330,24 +21393,24 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
21330
21393
|
* expires: {expiry}
|
|
21331
21394
|
* ```
|
|
21332
21395
|
*
|
|
21333
|
-
* @param userAddress EVM wallet address being registered. Must match the
|
|
21396
|
+
* @param userAddress - EVM wallet address being registered. Must match the
|
|
21334
21397
|
* signer that produced `signature`. Lowercased before being embedded in
|
|
21335
21398
|
* the canonical message.
|
|
21336
|
-
* @param referrerAddress Optional EVM address that referred this user.
|
|
21399
|
+
* @param referrerAddress - Optional EVM address that referred this user.
|
|
21337
21400
|
* Lowercased when embedded; the literal string `"none"` is used when
|
|
21338
21401
|
* absent. Tampering with this field after signing produces 401.
|
|
21339
|
-
* @param chainId Chain on which the wallet signed. For smart-contract wallets
|
|
21402
|
+
* @param chainId - Chain on which the wallet signed. For smart-contract wallets
|
|
21340
21403
|
* (Safe etc.) this is the chain whose RPC the backend will use to run the
|
|
21341
21404
|
* EIP-1271 `isValidSignature` check; for EOAs it still pins the signature
|
|
21342
21405
|
* to a chain so it can't be replayed cross-chain. Must be one of the chains
|
|
21343
21406
|
* Upshift supports (see backend `SUPPORTED_REGISTRATION_CHAINS`).
|
|
21344
|
-
* @param signature `0x`-prefixed hex of the personal_sign signature over
|
|
21407
|
+
* @param signature - `0x`-prefixed hex of the personal_sign signature over
|
|
21345
21408
|
* the canonical message. Single-use: replays within ~10 min are rejected.
|
|
21346
|
-
* @param nonce Caller-generated random string (8–128 chars). Pair with
|
|
21409
|
+
* @param nonce - Caller-generated random string (8–128 chars). Pair with
|
|
21347
21410
|
* `userAddress` to form the single-use key in the backend's nonce store.
|
|
21348
|
-
* @param expiry Unix timestamp (seconds). Must be in the future and within
|
|
21411
|
+
* @param expiry - Unix timestamp (seconds). Must be in the future and within
|
|
21349
21412
|
* the backend's TTL window (currently 10 min).
|
|
21350
|
-
* @param options Request options (headers).
|
|
21413
|
+
* @param options - Request options (headers).
|
|
21351
21414
|
* @returns Raw `Response` from the backend. 200 on success, 401 for
|
|
21352
21415
|
* expired / replayed / mismatched-signer / tampered-referrer, 422 for an
|
|
21353
21416
|
* unsupported `chainId`.
|
|
@@ -21417,12 +21480,13 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
21417
21480
|
export declare const REWARD_DISTRIBUTOR_ADDRESS: (chainId: number) => string[];
|
|
21418
21481
|
|
|
21419
21482
|
/**
|
|
21420
|
-
*
|
|
21483
|
+
* Formats any numeric value (number, string, or bigint) to a standardized string.
|
|
21421
21484
|
*
|
|
21422
|
-
* @param value amount to be formatted
|
|
21423
|
-
* @param options
|
|
21424
|
-
*
|
|
21425
|
-
*
|
|
21485
|
+
* @param value - amount to be formatted
|
|
21486
|
+
* @param options - formatting options:
|
|
21487
|
+
* `showing` is the number of decimals to cut off at (or `'all'`);
|
|
21488
|
+
* `usd` toggles USD-value display;
|
|
21489
|
+
* `decimals` is how many decimals to parse to when `value` is a bigint.
|
|
21426
21490
|
*
|
|
21427
21491
|
* @returns standardized string type value
|
|
21428
21492
|
*/
|
|
@@ -22275,7 +22339,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
22275
22339
|
* call with no arguments) to clear the override and fall back to the
|
|
22276
22340
|
* compiled-in `REQUEST_TIMEOUT_MS`.
|
|
22277
22341
|
*
|
|
22278
|
-
* @param ms Positive number of milliseconds to wait before aborting, or
|
|
22342
|
+
* @param ms - Positive number of milliseconds to wait before aborting, or
|
|
22279
22343
|
* `null` to clear.
|
|
22280
22344
|
*/
|
|
22281
22345
|
export declare function setSdkRequestTimeout(ms?: number | null): void;
|
|
@@ -22597,1109 +22661,1187 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
22597
22661
|
*/
|
|
22598
22662
|
vaultRedeem(params: Omit<IStellarRedeemParams, 'network'>): Promise<string>;
|
|
22599
22663
|
/**
|
|
22600
|
-
* Submit a signed Soroban transaction and poll until
|
|
22601
|
-
* @returns Transaction hash on success
|
|
22602
|
-
*/
|
|
22603
|
-
submitTransaction(signedXdr: string): Promise<string>;
|
|
22604
|
-
/**
|
|
22605
|
-
* Get user's vault share balance.
|
|
22664
|
+
* Submit a signed Soroban transaction and poll until the network confirms it.
|
|
22606
22665
|
*
|
|
22607
|
-
*
|
|
22608
|
-
*
|
|
22609
|
-
*
|
|
22610
|
-
*
|
|
22611
|
-
|
|
22612
|
-
|
|
22613
|
-
|
|
22614
|
-
|
|
22615
|
-
|
|
22616
|
-
|
|
22617
|
-
|
|
22618
|
-
|
|
22619
|
-
|
|
22620
|
-
|
|
22621
|
-
|
|
22622
|
-
|
|
22623
|
-
|
|
22624
|
-
|
|
22625
|
-
|
|
22626
|
-
|
|
22627
|
-
|
|
22628
|
-
|
|
22629
|
-
|
|
22630
|
-
|
|
22631
|
-
MAX_FEE_STROOPS,
|
|
22632
|
-
POLL_INTERVAL_MS,
|
|
22633
|
-
POLL_INTERVAL_MAX_MS,
|
|
22634
|
-
POLL_INTERVAL_BACKOFF,
|
|
22635
|
-
MAX_POLL_ATTEMPTS
|
|
22636
|
-
}
|
|
22637
|
-
}
|
|
22638
|
-
|
|
22639
|
-
declare namespace StellarGetters {
|
|
22640
|
-
export {
|
|
22641
|
-
getStellarVault,
|
|
22642
|
-
getStellarUserPosition,
|
|
22643
|
-
convertToShares
|
|
22644
|
-
}
|
|
22645
|
-
}
|
|
22646
|
-
|
|
22647
|
-
declare namespace StellarSubmit {
|
|
22648
|
-
export {
|
|
22649
|
-
submitStellarTransaction
|
|
22650
|
-
}
|
|
22651
|
-
}
|
|
22652
|
-
|
|
22653
|
-
/**
|
|
22654
|
-
* @deprecated
|
|
22655
|
-
* Replaced by SUBGRAPH_VAULT_URLS which are subgraphs deployed on Goldsky.
|
|
22656
|
-
*/
|
|
22657
|
-
export declare const SUBGRAPH_POOL_URLS: (apiKey: string, chainId?: number, pool?: IAddress) => {
|
|
22658
|
-
1: string;
|
|
22659
|
-
8453: string;
|
|
22660
|
-
43114: string;
|
|
22661
|
-
42161: string;
|
|
22662
|
-
56: string;
|
|
22663
|
-
} | {
|
|
22664
|
-
999: string;
|
|
22665
|
-
};
|
|
22666
|
-
|
|
22667
|
-
/**
|
|
22668
|
-
* Subgraph URLs
|
|
22669
|
-
* @deprecated use getVaultMetadata to fetch subgraph URLs from the backend
|
|
22670
|
-
*/
|
|
22671
|
-
export declare const SUBGRAPH_VAULT_URLS: Record<VaultSymbols, string>;
|
|
22672
|
-
|
|
22673
|
-
/**
|
|
22674
|
-
* Submit a signed Soroban transaction and poll until confirmed.
|
|
22675
|
-
*
|
|
22676
|
-
* @param signedXdr Base64-encoded XDR of the signed transaction
|
|
22677
|
-
* @param network Stellar network name
|
|
22678
|
-
* @returns Transaction hash on success
|
|
22679
|
-
*/
|
|
22680
|
-
declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork): Promise<string>;
|
|
22681
|
-
|
|
22682
|
-
/**
|
|
22683
|
-
* Sui Adapter for August SDK
|
|
22684
|
-
*
|
|
22685
|
-
* @example
|
|
22686
|
-
* To access the Sui adapter instance
|
|
22687
|
-
* ```
|
|
22688
|
-
* const sdk = new AugustSDK()
|
|
22689
|
-
* sdk.sui.getEmberVaults()
|
|
22690
|
-
* ```
|
|
22691
|
-
*/
|
|
22692
|
-
declare class SuiAdapter {
|
|
22693
|
-
private _apiBaseUrl;
|
|
22694
|
-
private _chainId;
|
|
22695
|
-
constructor(apiBaseUrl?: string, chainId?: number);
|
|
22696
|
-
get apiBaseUrl(): string;
|
|
22697
|
-
get chainId(): number;
|
|
22698
|
-
getEmberVaults(options?: IFetchEmberVaultsOptions): Promise<IEmberVault[]>;
|
|
22699
|
-
getEmberTVL(limit?: number): Promise<number>;
|
|
22700
|
-
convertFromE9(value: string | number): number;
|
|
22701
|
-
calculateUtilization(current: string | number, maximum: string | number): number;
|
|
22702
|
-
isSuiAddress(address: string): boolean;
|
|
22703
|
-
isSuiVault(chainId: number): boolean;
|
|
22704
|
-
transformEmberVaultToIVault(emberVault: IEmberVault): IVault;
|
|
22705
|
-
transformEmberVaultsToIVaults(emberVaults: IEmberVault[]): IVault[];
|
|
22706
|
-
}
|
|
22707
|
-
|
|
22708
|
-
/**
|
|
22709
|
-
* Address of the `SwapRouter` periphery contract on each supported chain.
|
|
22710
|
-
*
|
|
22711
|
-
* Missing keys mean no SwapRouter is deployed on that chain — callers
|
|
22712
|
-
* should fall back to legacy adapter paths.
|
|
22713
|
-
*
|
|
22714
|
-
* @see {@link getSwapRouterAddress} for the typed lookup helper.
|
|
22715
|
-
*/
|
|
22716
|
-
export declare const SWAP_ROUTER_ADDRESSES: Readonly<Record<number, IAddress>>;
|
|
22717
|
-
|
|
22718
|
-
/**
|
|
22719
|
-
* Maximum number of swap legs the contract accepts in a single
|
|
22720
|
-
* `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading
|
|
22721
|
-
* the on-chain value at call time would add an RPC for no gain.
|
|
22722
|
-
*
|
|
22723
|
-
* Kept here so the SDK can reject oversize inputs at the boundary rather
|
|
22724
|
-
* than wait for the on-chain `TooManySwaps` revert.
|
|
22725
|
-
*/
|
|
22726
|
-
export declare const SWAP_ROUTER_MAX_SWAPS = 9;
|
|
22727
|
-
|
|
22728
|
-
/**
|
|
22729
|
-
* Wrapped-native ERC-20 per chain that has a SwapRouter deployment. Mirrors
|
|
22730
|
-
* the on-chain `wrappedNativeTokenAddress()` view to avoid an extra RPC on
|
|
22731
|
-
* every dispatch. Used to validate that native-token deposits target a
|
|
22732
|
-
* vault whose reference asset is the wrapped native — the only configuration
|
|
22733
|
-
* the contract's `depositNativeToken` / `swapAndDepositNativeToken` accept.
|
|
22734
|
-
*/
|
|
22735
|
-
export declare const SWAP_ROUTER_WRAPPED_NATIVE: Readonly<Record<number, IAddress>>;
|
|
22736
|
-
|
|
22737
|
-
/**
|
|
22738
|
-
* Swap one or more whitelisted ERC-20s into a vault's reference asset via
|
|
22739
|
-
* the on-chain SwapRouter, then deposit the proceeds into the vault.
|
|
22740
|
-
*
|
|
22741
|
-
* Approval is sent automatically when the caller's allowance on each
|
|
22742
|
-
* `swaps[i].tokenIn` against the SwapRouter is below `amountIn`.
|
|
22743
|
-
*
|
|
22744
|
-
* @param signer - ethers `Signer` or `Wallet` with the EOA that holds the input tokens.
|
|
22745
|
-
* @param options - {@link ISwapAndDepositOptions}.
|
|
22746
|
-
* @returns The transaction hash of the `swapAndDeposit` call.
|
|
22747
|
-
*
|
|
22748
|
-
* @throws {@link AugustValidationError} for unsupported chains, invalid
|
|
22749
|
-
* addresses, empty/oversized swap arrays.
|
|
22750
|
-
* @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
|
|
22751
|
-
*
|
|
22752
|
-
* @example
|
|
22753
|
-
* ```ts
|
|
22754
|
-
* const quote = await fetchSwapQuote({
|
|
22755
|
-
* chainId: 1,
|
|
22756
|
-
* srcToken: WBTC,
|
|
22757
|
-
* srcDecimals: 8,
|
|
22758
|
-
* destToken: USDC,
|
|
22759
|
-
* destDecimals: 6,
|
|
22760
|
-
* amount: 100_000_000n,
|
|
22761
|
-
* receiver: SWAP_ROUTER_ADDRESSES[1]!,
|
|
22762
|
-
* });
|
|
22763
|
-
* const hash = await swapAndDeposit(signer, {
|
|
22764
|
-
* chainId: 1,
|
|
22765
|
-
* vault: '0x8AcA0841993ef4C87244d519166e767f49362C21',
|
|
22766
|
-
* receiver: wallet,
|
|
22767
|
-
* swaps: [{
|
|
22768
|
-
* tokenIn: WBTC,
|
|
22769
|
-
* tokenOut: USDC,
|
|
22770
|
-
* amountIn: 100_000_000n,
|
|
22771
|
-
* minAmountOut: quote.minAmountOut,
|
|
22772
|
-
* router: quote.router,
|
|
22773
|
-
* payload: quote.payload,
|
|
22774
|
-
* }],
|
|
22775
|
-
* });
|
|
22776
|
-
* ```
|
|
22777
|
-
*/
|
|
22778
|
-
export declare function swapAndDeposit(signer: Signer | Wallet, options: ISwapAndDepositOptions): Promise<string>;
|
|
22779
|
-
|
|
22780
|
-
/**
|
|
22781
|
-
* Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
|
|
22782
|
-
* the ERC-4626 (`deposit(uint256, address)`) and multi-asset
|
|
22783
|
-
* (`deposit(address, uint256, address)`) deposit interfaces.
|
|
22784
|
-
*
|
|
22785
|
-
* Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
|
|
22786
|
-
* constants exactly. Set by an admin per-vault via `enableVault` and looked
|
|
22787
|
-
* up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
|
|
22788
|
-
* this — the router resolves it internally.
|
|
22789
|
-
*/
|
|
22790
|
-
export declare enum SwapRouterVaultType {
|
|
22791
|
-
ERC4626 = 1,
|
|
22792
|
-
TokenizedVaultV2 = 2
|
|
22793
|
-
}
|
|
22794
|
-
|
|
22795
|
-
/**
|
|
22796
|
-
* Table of Contents
|
|
22797
|
-
* - Formatters
|
|
22798
|
-
* - Datetime
|
|
22799
|
-
* - Arrays
|
|
22800
|
-
* - Caching
|
|
22801
|
-
*/
|
|
22802
|
-
export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
|
|
22803
|
-
|
|
22804
|
-
/**
|
|
22805
|
-
* Formatters
|
|
22806
|
-
*/
|
|
22807
|
-
export declare function toTitleCase(str: string, type?: 'camel'): string;
|
|
22808
|
-
|
|
22809
|
-
/**
|
|
22810
|
-
* Track API response times and status.
|
|
22811
|
-
*
|
|
22812
|
-
* @param endpoint - The API endpoint called
|
|
22813
|
-
* @param method - HTTP method used
|
|
22814
|
-
* @param startTime - Start timestamp from performance.now()
|
|
22815
|
-
* @param status - HTTP response status code (0 for network errors)
|
|
22816
|
-
* @param server - Server identifier (production, staging, etc.)
|
|
22817
|
-
*/
|
|
22818
|
-
export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
|
|
22819
|
-
|
|
22820
|
-
/**
|
|
22821
|
-
* Track chain/network switches for usage distribution analysis.
|
|
22822
|
-
*
|
|
22823
|
-
* @param chainId - The chain ID being switched to
|
|
22824
|
-
*/
|
|
22825
|
-
export declare function trackNetworkSwitch(chainId: number): void;
|
|
22826
|
-
|
|
22827
|
-
export declare function truncate(s: string, amount?: number): string;
|
|
22828
|
-
|
|
22829
|
-
/* Excluded from this release type: tryRecoverTxHash */
|
|
22830
|
-
|
|
22831
|
-
/**
|
|
22832
|
-
* Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
|
|
22833
|
-
* Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
|
|
22834
|
-
* checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
|
|
22835
|
-
* would throw). Add an address here to drop its `latest_reported_tvl` from
|
|
22836
|
-
* the headline number — e.g. closed pre-deposit vaults, test vaults, or
|
|
22837
|
-
* migrated v1 pools that are double-counted by a v2 successor.
|
|
22838
|
-
*/
|
|
22839
|
-
export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
|
|
22840
|
-
|
|
22841
|
-
/**
|
|
22842
|
-
* Validity window for a submitted Soroban invocation (seconds).
|
|
22843
|
-
*
|
|
22844
|
-
* This becomes the transaction's `maxTime`. Validators reject a tx whose
|
|
22845
|
-
* `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
|
|
22846
|
-
* realistic sign-then-submit path: hardware wallets, careful manual review,
|
|
22847
|
-
* and institutional approval flows (e.g. Fordefi) that don't sign instantly.
|
|
22848
|
-
* 10 minutes comfortably covers those while staying well inside the Soroban
|
|
22849
|
-
* footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
|
|
22850
|
-
*
|
|
22851
|
-
* The window is anchored to the *network* clock (see `getNetworkCloseTime` in
|
|
22852
|
-
* soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
|
|
22853
|
-
* make the deadline expire early.
|
|
22854
|
-
*/
|
|
22855
|
-
declare const TX_TIMEOUT_SECONDS = 600;
|
|
22856
|
-
|
|
22857
|
-
export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
|
|
22858
|
-
[Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
|
|
22859
|
-
} & {
|
|
22860
|
-
/**
|
|
22861
|
-
* Return the function for a given name. This is useful when a contract
|
|
22862
|
-
* method name conflicts with a JavaScript name such as ``prototype`` or
|
|
22863
|
-
* when using a Contract programatically.
|
|
22864
|
-
*/
|
|
22865
|
-
getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
|
|
22866
|
-
/**
|
|
22867
|
-
* Return the event for a given name. This is useful when a contract
|
|
22868
|
-
* event name conflicts with a JavaScript name such as ``prototype`` or
|
|
22869
|
-
* when using a Contract programatically.
|
|
22870
|
-
*/
|
|
22871
|
-
getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
|
|
22872
|
-
/**
|
|
22873
|
-
* All the Events available on this contract.
|
|
22874
|
-
*/
|
|
22875
|
-
filters: {
|
|
22876
|
-
[EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
|
|
22877
|
-
};
|
|
22878
|
-
};
|
|
22879
|
-
|
|
22880
|
-
export declare interface TypedContractEvent<TAbi extends Abi, TEventName extends string, TEvent extends ExtractAbiEvents<TAbi> = ExtractAbiEvent<TAbi, TEventName>, TEventArgs extends readonly unknown[] = AsArray<Partial<AbiParametersToPrimitiveTypes<TEvent['inputs']>>>> {
|
|
22881
|
-
(...args: [...TEventArgs]): DeferredTopicFilter;
|
|
22882
|
-
/**
|
|
22883
|
-
* The name of the Contract event.
|
|
22884
|
-
*/
|
|
22885
|
-
name: TEventName;
|
|
22886
|
-
/**
|
|
22887
|
-
* The fragment of the Contract event. This will throw on ambiguous
|
|
22888
|
-
* method names.
|
|
22889
|
-
*/
|
|
22890
|
-
fragment: EventFragment;
|
|
22891
|
-
/**
|
|
22892
|
-
* Returns the fragment constrained by %%args%%. This can be used to
|
|
22893
|
-
* resolve ambiguous event names.
|
|
22894
|
-
*/
|
|
22895
|
-
getFragment(...args: [...TEventArgs]): EventFragment;
|
|
22896
|
-
}
|
|
22897
|
-
|
|
22898
|
-
export declare interface TypedContractFunction<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>, TInputArgs extends readonly unknown[] = AsArray<AbiParametersToPrimitiveTypes<TFunction['inputs']>>, TResult = TypedContractFunctionResult<TAbi, TFunctionName>, TFragment = TypedFragment<TAbi, TFunctionName>> {
|
|
22899
|
-
(...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
|
|
22900
|
-
/**
|
|
22901
|
-
* The name of the Contract method.
|
|
22902
|
-
*/
|
|
22903
|
-
name: TFunctionName;
|
|
22904
|
-
/**
|
|
22905
|
-
* The fragment of the Contract method. This will throw on ambiguous
|
|
22906
|
-
* method names.
|
|
22907
|
-
*/
|
|
22908
|
-
fragment: TFragment;
|
|
22909
|
-
/**
|
|
22910
|
-
* Returns the fragment constrained by %%args%%. This can be used to
|
|
22911
|
-
* resolve ambiguous method names.
|
|
22912
|
-
*/
|
|
22913
|
-
getFragment(...args: [...TInputArgs]): TFragment;
|
|
22914
|
-
/**
|
|
22915
|
-
* Returns a populated transaction that can be used to perform the
|
|
22916
|
-
* contract method with %%args%%.
|
|
22917
|
-
*/
|
|
22918
|
-
populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
|
|
22666
|
+
* Submits on the network this adapter was constructed with, so `signedXdr`
|
|
22667
|
+
* must be signed for that same network.
|
|
22668
|
+
*
|
|
22669
|
+
* @param signedXdr - Base64-encoded XDR of the signed transaction.
|
|
22670
|
+
* @returns The transaction hash once the network confirms it as successful.
|
|
22671
|
+
* @throws {@link AugustTimeoutError} when the transaction is not confirmed
|
|
22672
|
+
* within the poll budget (`MAX_POLL_ATTEMPTS`).
|
|
22673
|
+
* @throws {@link AugustSDKError} when the RPC rejects the submission or the
|
|
22674
|
+
* transaction confirms as failed. Its `context` carries `{ network, status }`
|
|
22675
|
+
* plus, when the result XDR decodes, a `resultCode` string holding the
|
|
22676
|
+
* transaction-level reason (e.g. `"txBadSeq"`, `"txTooLate"`); `resultCode`
|
|
22677
|
+
* is `undefined` when the code cannot be decoded.
|
|
22678
|
+
* @example
|
|
22679
|
+
* ```ts
|
|
22680
|
+
* try {
|
|
22681
|
+
* const hash = await adapter.submitTransaction(signedXdr);
|
|
22682
|
+
* } catch (err) {
|
|
22683
|
+
* if (err instanceof AugustSDKError && err.context?.resultCode === 'txBadSeq') {
|
|
22684
|
+
* // stale sequence number — rebuild the transaction and resubmit
|
|
22685
|
+
* }
|
|
22686
|
+
* }
|
|
22687
|
+
* ```
|
|
22688
|
+
*/
|
|
22689
|
+
submitTransaction(signedXdr: string): Promise<string>;
|
|
22919
22690
|
/**
|
|
22920
|
-
*
|
|
22691
|
+
* Get user's vault share balance.
|
|
22921
22692
|
*
|
|
22922
|
-
*
|
|
22923
|
-
*
|
|
22924
|
-
|
|
22925
|
-
|
|
22926
|
-
/**
|
|
22927
|
-
* Send a transaction for the contract method with %%args%%.
|
|
22928
|
-
*/
|
|
22929
|
-
send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
|
|
22930
|
-
/**
|
|
22931
|
-
* Estimate the gas to send the contract method with %%args%%.
|
|
22693
|
+
* @returns The position `{ shares, decimals, decimalsFromFallback }`, or null
|
|
22694
|
+
* if the balance read fails. When `decimalsFromFallback` is `true` the
|
|
22695
|
+
* `decimals()` read failed and `decimals` is the fallback (7) — callers sizing
|
|
22696
|
+
* a redeem MUST refuse rather than trust it (see AUGUST-6381).
|
|
22932
22697
|
*/
|
|
22933
|
-
|
|
22698
|
+
getUserPosition(vaultAddress: string, walletAddress: string): Promise<IStellarUserPosition | null>;
|
|
22934
22699
|
/**
|
|
22935
|
-
*
|
|
22936
|
-
*
|
|
22700
|
+
* Preview how many vault shares a deposit amount would yield.
|
|
22701
|
+
* @param vaultAddress Stellar contract ID (C… address)
|
|
22702
|
+
* @param rawAmount Deposit amount in the deposit token's smallest unit
|
|
22703
|
+
* @returns Raw share amount as a string, or null if query fails.
|
|
22937
22704
|
*/
|
|
22938
|
-
|
|
22705
|
+
convertToShares(vaultAddress: string, rawAmount: string): Promise<string | null>;
|
|
22939
22706
|
}
|
|
22940
22707
|
|
|
22941
|
-
|
|
22942
|
-
|
|
22943
|
-
|
|
22944
|
-
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
|
|
22948
|
-
|
|
22949
|
-
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
*
|
|
22957
|
-
* @param walletAddress - New wallet address (or undefined to clear)
|
|
22958
|
-
* @param environment - Current environment
|
|
22959
|
-
*/
|
|
22960
|
-
export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
|
|
22961
|
-
|
|
22962
|
-
/* Excluded from this release type: validateAmountPrecision */
|
|
22963
|
-
|
|
22964
|
-
/**
|
|
22965
|
-
* Vault adapter configurations mapping vault addresses to their adapter settings
|
|
22966
|
-
*/
|
|
22967
|
-
export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
|
|
22968
|
-
|
|
22969
|
-
export declare const VAULT_ADDRESSES: Record<"musd" | "predlp" | "sentusd" | "pregrid" | "repouscc" | "earnxrp" | "tivkbtc" | "tivusdt0" | "supermon" | "earnmon" | "k3europ" | "wmon/ausd" | "wbtc/ausd" | "earnausd_monad" | "sausd" | "farmbold" | "sentuscc" | "sentbtc" | "svusdc" | "apusdc" | "testwethtsa" | "tacusr" | "upinjusdt" | "tac-teth" | "upausd" | "taccbbtc" | "xupusdc" | "uptbtc" | "gteth" | "ageth" | "upusdc" | "hgeth" | "upssylva" | "hbbtc" | "hbhype" | "upazt" | "susdt" | "upedge" | "coreusdc" | "upcusdo" | "shifteth" | "upsusde" | "uplbtc" | "upavax" | "tacrseth" | "earnausd" | "alpineusdcflagship" | "alpinecoinshiftusdc" | "upbtc" | "upstrbtc" | "maxiusr" | "upgammausdc" | "xhype" | "wildusd" | "alpinebtc" | "prenusd" | "upyzusd" | "upnusd" | "hlpe" | "nemo eth yield", `0x${string}`>;
|
|
22970
|
-
|
|
22971
|
-
/**
|
|
22972
|
-
* Hardcoded subaccount addresses for specific vaults allocations
|
|
22973
|
-
*/
|
|
22974
|
-
export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
|
|
22975
|
-
AgoraAUSD: {
|
|
22976
|
-
address: IAddress;
|
|
22977
|
-
subaccount: IAddress;
|
|
22978
|
-
useDebank: boolean;
|
|
22979
|
-
};
|
|
22980
|
-
earnAUSD: {
|
|
22981
|
-
address: IAddress;
|
|
22982
|
-
subaccount: IAddress;
|
|
22983
|
-
useDebank: boolean;
|
|
22984
|
-
};
|
|
22985
|
-
};
|
|
22986
|
-
|
|
22987
|
-
/**
|
|
22988
|
-
* The functions to call on the vault contract
|
|
22989
|
-
* @returns The functions to call
|
|
22990
|
-
*/
|
|
22991
|
-
export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
|
|
22992
|
-
|
|
22993
|
-
export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
|
|
22994
|
-
|
|
22995
|
-
export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
|
|
22996
|
-
|
|
22997
|
-
export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
|
|
22998
|
-
|
|
22999
|
-
/**
|
|
23000
|
-
* Vault Symbols Mapping
|
|
23001
|
-
* @deprecated use getVaultMetadata to fetch vault symbols from the backend
|
|
23002
|
-
*/
|
|
23003
|
-
export declare const VAULT_SYMBOLS: Record<IAddress, string>;
|
|
23004
|
-
|
|
23005
|
-
/**
|
|
23006
|
-
* Vault Symbols Reverse Mapping
|
|
23007
|
-
* @deprecated use getVaultMetadata to fetch vault symbols from the backend
|
|
23008
|
-
*/
|
|
23009
|
-
export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
|
|
23010
|
-
|
|
23011
|
-
/**
|
|
23012
|
-
* Address type for vault contracts across all supported chains.
|
|
23013
|
-
* EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
|
|
23014
|
-
* and Stellar vaults use 56-character base32 addresses (G/C prefix).
|
|
23015
|
-
*
|
|
23016
|
-
* Use this instead of `IAddress` when the address may belong to any chain.
|
|
23017
|
-
*/
|
|
23018
|
-
export declare type VaultAddress = string;
|
|
23019
|
-
|
|
23020
|
-
/**
|
|
23021
|
-
* allowance checks user's current allowance per pool
|
|
23022
|
-
* @param signer - signer / provider object
|
|
23023
|
-
* @param options - object including pool contract address, user wallet address
|
|
23024
|
-
* @returns normalized number object of the user's current allowance
|
|
23025
|
-
*/
|
|
23026
|
-
export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
|
|
23027
|
-
|
|
23028
|
-
/**
|
|
23029
|
-
* Approve a vault (or the appropriate adapter wrapper) to spend a token
|
|
23030
|
-
* ahead of a separate deposit call. Spender routing mirrors
|
|
23031
|
-
* {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
|
|
23032
|
-
* vault). Returns `undefined` when the existing allowance already covers
|
|
23033
|
-
* `amount` **or** when the deposit asset is native.
|
|
23034
|
-
*
|
|
23035
|
-
* @returns Transaction hash when an approval was sent, `undefined` when
|
|
23036
|
-
* the existing allowance already covers `amount` or the deposit asset is
|
|
23037
|
-
* native (no ERC-20 allowance applies). Use {@link approve} for a
|
|
23038
|
-
* discriminated `ApproveResult` if you need to tell those two cases apart.
|
|
23039
|
-
* @throws AugustValidationError on invalid wallet/target/amount.
|
|
23040
|
-
*
|
|
23041
|
-
* @example
|
|
23042
|
-
* ```ts
|
|
23043
|
-
* const hash = await augustSdk.evm.vaultApprove({
|
|
23044
|
-
* target: '0x...', // vault contract address
|
|
23045
|
-
* wallet: walletAddress,
|
|
23046
|
-
* amount: '100', // 100 of the deposit token (UI units)
|
|
23047
|
-
* wait: true, // wait for the approval to confirm
|
|
23048
|
-
* });
|
|
23049
|
-
* if (hash) console.log('approve tx', hash);
|
|
23050
|
-
* // hash === undefined means the on-chain allowance already covers the
|
|
23051
|
-
* // amount, or the deposit asset is native (msg.value, no allowance).
|
|
23052
|
-
* ```
|
|
23053
|
-
*/
|
|
23054
|
-
export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
|
|
23055
|
-
|
|
23056
|
-
/**
|
|
23057
|
-
* Deposit underlying token into the specified vault. Auto-routes to the
|
|
23058
|
-
* correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
|
|
23059
|
-
* Paraswap adapter, native-token wrapper, depositWithPermit) based on the
|
|
23060
|
-
* vault version and `depositAsset`.
|
|
23061
|
-
*
|
|
23062
|
-
* Amounts are encoded against the **deposit token's** decimals, not the
|
|
23063
|
-
* vault's share decimals. The SDK reads the appropriate decimals via the
|
|
23064
|
-
* vault metadata and the asset's ERC-20.
|
|
23065
|
-
*
|
|
23066
|
-
* Approval is handled automatically: if the existing allowance doesn't
|
|
23067
|
-
* cover `amount`, an `approve` is sent and **always waited for** (regardless
|
|
23068
|
-
* of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
|
|
23069
|
-
* of the approval on Monad-style RPCs.
|
|
23070
|
-
*
|
|
23071
|
-
* @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
|
|
23072
|
-
* @param options Vault address, wallet, amount, optional `depositAsset` for
|
|
23073
|
-
* adapter routes, optional `wait` to wait for the deposit receipt.
|
|
23074
|
-
* @returns Deposit transaction hash.
|
|
23075
|
-
* @throws AugustValidationError on invalid wallet/target/amount or missing
|
|
23076
|
-
* adapter config when `depositAsset` differs from the vault underlying.
|
|
23077
|
-
* @throws AugustSDKError when the deposit submission or on-chain call fails.
|
|
23078
|
-
*
|
|
23079
|
-
* @example
|
|
23080
|
-
* ```ts
|
|
23081
|
-
* const hash = await augustSdk.evm.vaultDeposit({
|
|
23082
|
-
* target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
|
|
23083
|
-
* wallet: walletAddress,
|
|
23084
|
-
* amount: '100', // 100 USDC (UI units)
|
|
23085
|
-
* wait: true, // wait for the deposit receipt
|
|
23086
|
-
* });
|
|
23087
|
-
* ```
|
|
23088
|
-
*
|
|
23089
|
-
* @example Adapter deposit (different deposit asset than the vault's underlying)
|
|
23090
|
-
* ```ts
|
|
23091
|
-
* await augustSdk.evm.vaultDeposit({
|
|
23092
|
-
* target: vaultAddress,
|
|
23093
|
-
* wallet: walletAddress,
|
|
23094
|
-
* amount: '0.5',
|
|
23095
|
-
* depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
|
|
23096
|
-
* chainId: 1,
|
|
23097
|
-
* });
|
|
23098
|
-
* ```
|
|
23099
|
-
*/
|
|
23100
|
-
export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
|
|
23101
|
-
|
|
23102
|
-
/**
|
|
23103
|
-
* Check if vault has adapter support
|
|
23104
|
-
*/
|
|
23105
|
-
export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
|
|
23106
|
-
|
|
23107
|
-
declare const vaultIdl: {
|
|
23108
|
-
address: string;
|
|
23109
|
-
metadata: {
|
|
23110
|
-
name: string;
|
|
23111
|
-
version: string;
|
|
23112
|
-
spec: string;
|
|
23113
|
-
description: string;
|
|
23114
|
-
};
|
|
23115
|
-
instructions: ({
|
|
23116
|
-
name: string;
|
|
23117
|
-
docs: string[];
|
|
23118
|
-
discriminator: number[];
|
|
23119
|
-
accounts: ({
|
|
23120
|
-
name: string;
|
|
23121
|
-
writable: boolean;
|
|
23122
|
-
pda: {
|
|
23123
|
-
seeds: {
|
|
23124
|
-
kind: string;
|
|
23125
|
-
value: number[];
|
|
23126
|
-
}[];
|
|
23127
|
-
};
|
|
23128
|
-
signer?: undefined;
|
|
23129
|
-
address?: undefined;
|
|
23130
|
-
} | {
|
|
23131
|
-
name: string;
|
|
23132
|
-
signer: boolean;
|
|
23133
|
-
writable?: undefined;
|
|
23134
|
-
pda?: undefined;
|
|
23135
|
-
address?: undefined;
|
|
23136
|
-
} | {
|
|
23137
|
-
name: string;
|
|
23138
|
-
writable: boolean;
|
|
23139
|
-
pda?: undefined;
|
|
23140
|
-
signer?: undefined;
|
|
23141
|
-
address?: undefined;
|
|
23142
|
-
} | {
|
|
23143
|
-
name: string;
|
|
23144
|
-
address: string;
|
|
23145
|
-
writable?: undefined;
|
|
23146
|
-
pda?: undefined;
|
|
23147
|
-
signer?: undefined;
|
|
23148
|
-
})[];
|
|
23149
|
-
args: any[];
|
|
23150
|
-
} | {
|
|
23151
|
-
name: string;
|
|
23152
|
-
docs: string[];
|
|
23153
|
-
discriminator: number[];
|
|
23154
|
-
accounts: ({
|
|
23155
|
-
name: string;
|
|
23156
|
-
writable: boolean;
|
|
23157
|
-
signer: boolean;
|
|
23158
|
-
docs?: undefined;
|
|
23159
|
-
pda?: undefined;
|
|
23160
|
-
address?: undefined;
|
|
23161
|
-
} | {
|
|
23162
|
-
name: string;
|
|
23163
|
-
docs: string[];
|
|
23164
|
-
writable: boolean;
|
|
23165
|
-
signer: boolean;
|
|
23166
|
-
pda?: undefined;
|
|
23167
|
-
address?: undefined;
|
|
23168
|
-
} | {
|
|
23169
|
-
name: string;
|
|
23170
|
-
docs: string[];
|
|
23171
|
-
writable: boolean;
|
|
23172
|
-
pda: {
|
|
23173
|
-
seeds: {
|
|
23174
|
-
kind: string;
|
|
23175
|
-
value: number[];
|
|
23176
|
-
}[];
|
|
23177
|
-
program?: undefined;
|
|
23178
|
-
};
|
|
23179
|
-
signer?: undefined;
|
|
23180
|
-
address?: undefined;
|
|
23181
|
-
} | {
|
|
23182
|
-
name: string;
|
|
23183
|
-
docs: string[];
|
|
23184
|
-
writable: boolean;
|
|
23185
|
-
signer?: undefined;
|
|
23186
|
-
pda?: undefined;
|
|
23187
|
-
address?: undefined;
|
|
23188
|
-
} | {
|
|
23189
|
-
name: string;
|
|
23190
|
-
writable: boolean;
|
|
23191
|
-
pda: {
|
|
23192
|
-
seeds: ({
|
|
23193
|
-
kind: string;
|
|
23194
|
-
value: number[];
|
|
23195
|
-
path?: undefined;
|
|
23196
|
-
} | {
|
|
23197
|
-
kind: string;
|
|
23198
|
-
path: string;
|
|
23199
|
-
value?: undefined;
|
|
23200
|
-
})[];
|
|
23201
|
-
program: {
|
|
23202
|
-
kind: string;
|
|
23203
|
-
value: number[];
|
|
23204
|
-
};
|
|
23205
|
-
};
|
|
23206
|
-
signer?: undefined;
|
|
23207
|
-
docs?: undefined;
|
|
23208
|
-
address?: undefined;
|
|
23209
|
-
} | {
|
|
23210
|
-
name: string;
|
|
23211
|
-
address: string;
|
|
23212
|
-
writable?: undefined;
|
|
23213
|
-
signer?: undefined;
|
|
23214
|
-
docs?: undefined;
|
|
23215
|
-
pda?: undefined;
|
|
23216
|
-
})[];
|
|
23217
|
-
args: {
|
|
23218
|
-
name: string;
|
|
23219
|
-
type: string;
|
|
23220
|
-
}[];
|
|
23221
|
-
} | {
|
|
23222
|
-
name: string;
|
|
23223
|
-
docs: string[];
|
|
23224
|
-
discriminator: number[];
|
|
23225
|
-
accounts: ({
|
|
23226
|
-
name: string;
|
|
23227
|
-
writable: boolean;
|
|
23228
|
-
pda: {
|
|
23229
|
-
seeds: ({
|
|
23230
|
-
kind: string;
|
|
23231
|
-
value: number[];
|
|
23232
|
-
path?: undefined;
|
|
23233
|
-
} | {
|
|
23234
|
-
kind: string;
|
|
23235
|
-
path: string;
|
|
23236
|
-
value?: undefined;
|
|
23237
|
-
})[];
|
|
23238
|
-
};
|
|
23239
|
-
signer?: undefined;
|
|
23240
|
-
} | {
|
|
23241
|
-
name: string;
|
|
23242
|
-
writable: boolean;
|
|
23243
|
-
pda?: undefined;
|
|
23244
|
-
signer?: undefined;
|
|
23245
|
-
} | {
|
|
23246
|
-
name: string;
|
|
23247
|
-
writable: boolean;
|
|
23248
|
-
signer: boolean;
|
|
23249
|
-
pda?: undefined;
|
|
23250
|
-
} | {
|
|
23251
|
-
name: string;
|
|
23252
|
-
writable?: undefined;
|
|
23253
|
-
pda?: undefined;
|
|
23254
|
-
signer?: undefined;
|
|
23255
|
-
})[];
|
|
23256
|
-
args: {
|
|
23257
|
-
name: string;
|
|
23258
|
-
type: string;
|
|
23259
|
-
}[];
|
|
23260
|
-
} | {
|
|
23261
|
-
name: string;
|
|
23262
|
-
docs: string[];
|
|
23263
|
-
discriminator: number[];
|
|
23264
|
-
accounts: ({
|
|
23265
|
-
name: string;
|
|
23266
|
-
writable: boolean;
|
|
23267
|
-
pda: {
|
|
23268
|
-
seeds: ({
|
|
23269
|
-
kind: string;
|
|
23270
|
-
value: number[];
|
|
23271
|
-
path?: undefined;
|
|
23272
|
-
} | {
|
|
23273
|
-
kind: string;
|
|
23274
|
-
path: string;
|
|
23275
|
-
value?: undefined;
|
|
23276
|
-
})[];
|
|
23277
|
-
};
|
|
23278
|
-
signer?: undefined;
|
|
23279
|
-
address?: undefined;
|
|
23280
|
-
} | {
|
|
23281
|
-
name: string;
|
|
23282
|
-
writable?: undefined;
|
|
23283
|
-
pda?: undefined;
|
|
23284
|
-
signer?: undefined;
|
|
23285
|
-
address?: undefined;
|
|
23286
|
-
} | {
|
|
23287
|
-
name: string;
|
|
23288
|
-
writable: boolean;
|
|
23289
|
-
signer: boolean;
|
|
23290
|
-
pda?: undefined;
|
|
23291
|
-
address?: undefined;
|
|
23292
|
-
} | {
|
|
23293
|
-
name: string;
|
|
23294
|
-
address: string;
|
|
23295
|
-
writable?: undefined;
|
|
23296
|
-
pda?: undefined;
|
|
23297
|
-
signer?: undefined;
|
|
23298
|
-
})[];
|
|
23299
|
-
args: {
|
|
23300
|
-
name: string;
|
|
23301
|
-
type: string;
|
|
23302
|
-
}[];
|
|
23303
|
-
} | {
|
|
23304
|
-
name: string;
|
|
23305
|
-
docs: string[];
|
|
23306
|
-
discriminator: number[];
|
|
23307
|
-
accounts: ({
|
|
23308
|
-
name: string;
|
|
23309
|
-
writable: boolean;
|
|
23310
|
-
pda: {
|
|
23311
|
-
seeds: {
|
|
23312
|
-
kind: string;
|
|
23313
|
-
value: number[];
|
|
23314
|
-
}[];
|
|
23315
|
-
};
|
|
23316
|
-
signer?: undefined;
|
|
23317
|
-
address?: undefined;
|
|
23318
|
-
} | {
|
|
23319
|
-
name: string;
|
|
23320
|
-
signer: boolean;
|
|
23321
|
-
writable?: undefined;
|
|
23322
|
-
pda?: undefined;
|
|
23323
|
-
address?: undefined;
|
|
23324
|
-
} | {
|
|
23325
|
-
name: string;
|
|
23326
|
-
writable: boolean;
|
|
23327
|
-
signer: boolean;
|
|
23328
|
-
pda?: undefined;
|
|
23329
|
-
address?: undefined;
|
|
23330
|
-
} | {
|
|
23331
|
-
name: string;
|
|
23332
|
-
address: string;
|
|
23333
|
-
writable?: undefined;
|
|
23334
|
-
pda?: undefined;
|
|
23335
|
-
signer?: undefined;
|
|
23336
|
-
})[];
|
|
23337
|
-
args: {
|
|
23338
|
-
name: string;
|
|
23339
|
-
type: string;
|
|
23340
|
-
}[];
|
|
23341
|
-
} | {
|
|
23342
|
-
name: string;
|
|
23343
|
-
docs: string[];
|
|
23344
|
-
discriminator: number[];
|
|
23345
|
-
accounts: ({
|
|
23346
|
-
name: string;
|
|
23347
|
-
writable: boolean;
|
|
23348
|
-
pda: {
|
|
23349
|
-
seeds: ({
|
|
23350
|
-
kind: string;
|
|
23351
|
-
value: number[];
|
|
23352
|
-
path?: undefined;
|
|
23353
|
-
} | {
|
|
23354
|
-
kind: string;
|
|
23355
|
-
path: string;
|
|
23356
|
-
value?: undefined;
|
|
23357
|
-
})[];
|
|
23358
|
-
program?: undefined;
|
|
23359
|
-
};
|
|
23360
|
-
signer?: undefined;
|
|
23361
|
-
} | {
|
|
23362
|
-
name: string;
|
|
23363
|
-
writable: boolean;
|
|
23364
|
-
pda: {
|
|
23365
|
-
seeds: ({
|
|
23366
|
-
kind: string;
|
|
23367
|
-
path: string;
|
|
23368
|
-
value?: undefined;
|
|
23369
|
-
} | {
|
|
23370
|
-
kind: string;
|
|
23371
|
-
value: number[];
|
|
23372
|
-
path?: undefined;
|
|
23373
|
-
})[];
|
|
23374
|
-
program: {
|
|
23375
|
-
kind: string;
|
|
23376
|
-
value: number[];
|
|
23377
|
-
};
|
|
23378
|
-
};
|
|
23379
|
-
signer?: undefined;
|
|
23380
|
-
} | {
|
|
23381
|
-
name: string;
|
|
23382
|
-
writable: boolean;
|
|
23383
|
-
pda?: undefined;
|
|
23384
|
-
signer?: undefined;
|
|
23385
|
-
} | {
|
|
23386
|
-
name: string;
|
|
23387
|
-
signer: boolean;
|
|
23388
|
-
writable?: undefined;
|
|
23389
|
-
pda?: undefined;
|
|
23390
|
-
} | {
|
|
23391
|
-
name: string;
|
|
23392
|
-
writable?: undefined;
|
|
23393
|
-
pda?: undefined;
|
|
23394
|
-
signer?: undefined;
|
|
23395
|
-
})[];
|
|
23396
|
-
args: {
|
|
23397
|
-
name: string;
|
|
23398
|
-
type: string;
|
|
23399
|
-
}[];
|
|
23400
|
-
})[];
|
|
23401
|
-
accounts: {
|
|
23402
|
-
name: string;
|
|
23403
|
-
discriminator: number[];
|
|
23404
|
-
}[];
|
|
23405
|
-
events: {
|
|
23406
|
-
name: string;
|
|
23407
|
-
discriminator: number[];
|
|
23408
|
-
}[];
|
|
23409
|
-
errors: {
|
|
23410
|
-
code: number;
|
|
23411
|
-
name: string;
|
|
23412
|
-
msg: string;
|
|
23413
|
-
}[];
|
|
23414
|
-
types: ({
|
|
23415
|
-
name: string;
|
|
23416
|
-
serialization: string;
|
|
23417
|
-
repr: {
|
|
23418
|
-
kind: string;
|
|
23419
|
-
};
|
|
23420
|
-
type: {
|
|
23421
|
-
kind: string;
|
|
23422
|
-
fields: {
|
|
23423
|
-
name: string;
|
|
23424
|
-
type: string;
|
|
23425
|
-
}[];
|
|
23426
|
-
};
|
|
23427
|
-
} | {
|
|
23428
|
-
name: string;
|
|
23429
|
-
type: {
|
|
23430
|
-
kind: string;
|
|
23431
|
-
fields: ({
|
|
23432
|
-
name: string;
|
|
23433
|
-
type: string;
|
|
23434
|
-
} | {
|
|
23435
|
-
name: string;
|
|
23436
|
-
type: {
|
|
23437
|
-
array: (string | number)[];
|
|
23438
|
-
};
|
|
23439
|
-
})[];
|
|
23440
|
-
};
|
|
23441
|
-
serialization?: undefined;
|
|
23442
|
-
repr?: undefined;
|
|
23443
|
-
})[];
|
|
23444
|
-
};
|
|
23445
|
-
|
|
23446
|
-
/**
|
|
23447
|
-
* @TODO
|
|
23448
|
-
* @description withdraw funds from the specified pool including accrued rewards
|
|
23449
|
-
* @param signer signer / wallet object
|
|
23450
|
-
* @param options object including pool contract address, user wallet address, and more
|
|
23451
|
-
* @returns claim tx hash
|
|
23452
|
-
*/
|
|
23453
|
-
export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
|
|
23454
|
-
year: string;
|
|
23455
|
-
month: string;
|
|
23456
|
-
day: string;
|
|
23457
|
-
receiverIndex: string;
|
|
23458
|
-
}): Promise<string>;
|
|
23459
|
-
|
|
23460
|
-
export declare enum VaultRedemptionStatus {
|
|
23461
|
-
AWAITING_COOLDOWN = "awaiting_cooldown",
|
|
23462
|
-
READY_TO_CLAIM = "ready_to_claim"
|
|
22708
|
+
declare namespace StellarConstants {
|
|
22709
|
+
export {
|
|
22710
|
+
STELLAR_CHAIN_ID,
|
|
22711
|
+
STELLAR_CHAIN,
|
|
22712
|
+
SOROBAN_RPC_URLS,
|
|
22713
|
+
NETWORK_PASSPHRASES,
|
|
22714
|
+
STELLAR_FALLBACK_DECIMALS,
|
|
22715
|
+
TX_TIMEOUT_SECONDS,
|
|
22716
|
+
QUERY_TIMEOUT_SECONDS,
|
|
22717
|
+
MAX_FEE_STROOPS,
|
|
22718
|
+
POLL_INTERVAL_MS,
|
|
22719
|
+
POLL_INTERVAL_MAX_MS,
|
|
22720
|
+
POLL_INTERVAL_BACKOFF,
|
|
22721
|
+
MAX_POLL_ATTEMPTS
|
|
22722
|
+
}
|
|
23463
22723
|
}
|
|
23464
22724
|
|
|
23465
|
-
|
|
23466
|
-
|
|
23467
|
-
|
|
23468
|
-
|
|
23469
|
-
|
|
23470
|
-
|
|
23471
|
-
|
|
23472
|
-
* redeem call, regardless of the caller's `wait` flag.
|
|
23473
|
-
*
|
|
23474
|
-
* @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
|
|
23475
|
-
* @param options Vault address, wallet, amount, optional `isInstantRedeem`,
|
|
23476
|
-
* optional `wait` to wait for the redeem receipt.
|
|
23477
|
-
* @returns Redeem transaction hash.
|
|
23478
|
-
* @throws AugustValidationError on invalid wallet/target/amount.
|
|
23479
|
-
* @throws AugustSDKError when the redeem submission or on-chain call fails.
|
|
23480
|
-
*
|
|
23481
|
-
* @example
|
|
23482
|
-
* ```ts
|
|
23483
|
-
* const hash = await augustSdk.evm.vaultRequestRedeem({
|
|
23484
|
-
* target: vaultAddress,
|
|
23485
|
-
* wallet: walletAddress,
|
|
23486
|
-
* amount: '10', // 10 shares (UI units)
|
|
23487
|
-
* wait: true,
|
|
23488
|
-
* });
|
|
23489
|
-
* ```
|
|
23490
|
-
*
|
|
23491
|
-
* @example Instant redemption
|
|
23492
|
-
* ```ts
|
|
23493
|
-
* await augustSdk.evm.vaultRequestRedeem({
|
|
23494
|
-
* target: vaultAddress,
|
|
23495
|
-
* wallet: walletAddress,
|
|
23496
|
-
* amount: '10',
|
|
23497
|
-
* isInstantRedeem: true,
|
|
23498
|
-
* });
|
|
23499
|
-
* ```
|
|
23500
|
-
*/
|
|
23501
|
-
export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
|
|
23502
|
-
|
|
23503
|
-
/**
|
|
23504
|
-
* Vault addresses registered on a `SwapRouter` via `enableVault`. The
|
|
23505
|
-
* presence of a vault here is the signal to route its deposits through the
|
|
23506
|
-
* SwapRouter rather than the legacy adapter path.
|
|
23507
|
-
*
|
|
23508
|
-
* Entries mirror the on-chain `vaultInfo[addr].referenceAsset != 0` state of
|
|
23509
|
-
* the `SwapRouter` deployment. Verify against the deployed contract before
|
|
23510
|
-
* adding a new entry — a vault that is not registered on-chain will revert
|
|
23511
|
-
* with `InvalidVault` at deposit time.
|
|
23512
|
-
*
|
|
23513
|
-
* Lowercase comparison is required when checking — use
|
|
23514
|
-
* {@link vaultUsesSwapRouter} rather than reading this set directly.
|
|
23515
|
-
*/
|
|
23516
|
-
export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
|
|
23517
|
-
|
|
23518
|
-
/**
|
|
23519
|
-
* Vault Receipt Symbol Mapping
|
|
23520
|
-
* @deprecated use getVaultMetadata to fetch vault symbols from the backend
|
|
23521
|
-
*/
|
|
23522
|
-
declare type VaultSymbols = 'predlp' | 'sentusd' | 'pregrid' | 'repouscc' | 'earnxrp' | 'tivkbtc' | 'tivusdt0' | 'supermon' | 'earnmon' | 'k3europ' | 'wmon/ausd' | 'wbtc/ausd' | 'earnausd_monad' | 'sausd' | 'farmbold' | 'sentuscc' | 'sentbtc' | 'svusdc' | 'apusdc' | 'testwethtsa' | 'tacusr' | 'upinjusdt' | 'tac-teth' | 'upausd' | 'taccbbtc' | 'xupusdc' | 'uptbtc' | 'gteth' | 'ageth' | 'upusdc' | 'hgeth' | 'upssylva' | 'hbbtc' | 'hbhype' | 'upazt' | 'susdt' | 'upedge' | 'coreusdc' | 'upcusdo' | 'shifteth' | 'upsusde' | 'uplbtc' | 'upavax' | 'tacrseth' | 'musd' | 'earnausd' | 'alpineusdcflagship' | 'alpinecoinshiftusdc' | 'upbtc' | 'upstrbtc' | 'maxiusr' | 'upgammausdc' | 'xhype' | 'wildusd' | 'alpinebtc' | 'prenusd' | 'upyzusd' | 'upnusd' | 'hlpe' | 'nemo eth yield';
|
|
23523
|
-
|
|
23524
|
-
/**
|
|
23525
|
-
* Whether a vault has been registered on a `SwapRouter` and should route
|
|
23526
|
-
* its deposits through it. Address comparison is case-insensitive.
|
|
23527
|
-
*
|
|
23528
|
-
* @param vaultAddress - August vault address.
|
|
23529
|
-
* @returns `true` when the vault is in {@link VAULTS_USING_SWAP_ROUTER}.
|
|
23530
|
-
*/
|
|
23531
|
-
export declare function vaultUsesSwapRouter(vaultAddress: IAddress): boolean;
|
|
23532
|
-
|
|
23533
|
-
export declare function verifyAugustKey(key: string): Promise<boolean>;
|
|
23534
|
-
|
|
23535
|
-
export declare function verifyInfuraKey(key: string): Promise<boolean>;
|
|
23536
|
-
|
|
23537
|
-
/**
|
|
23538
|
-
* Convert a viem WalletClient to an ethers-compatible Signer
|
|
23539
|
-
* Uses the walletClient as a provider and wraps it for ethers compatibility
|
|
23540
|
-
* @param walletClient Viem WalletClient from wagmi or viem
|
|
23541
|
-
* @returns Ethers Signer that can be used with the SDK
|
|
23542
|
-
*/
|
|
23543
|
-
export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
|
|
23544
|
-
|
|
23545
|
-
/**
|
|
23546
|
-
* @param walletClient a wagmi-derived client (from useWalletClient)
|
|
23547
|
-
* @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
|
|
23548
|
-
*/
|
|
23549
|
-
export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
|
|
23550
|
-
|
|
23551
|
-
export declare const WEBSERVER_ENDPOINTS: {
|
|
23552
|
-
default: {
|
|
23553
|
-
hello: string;
|
|
23554
|
-
protected: string;
|
|
23555
|
-
};
|
|
23556
|
-
auth: {
|
|
23557
|
-
verify: string;
|
|
23558
|
-
sign: string;
|
|
23559
|
-
login: string;
|
|
23560
|
-
nonce: string;
|
|
23561
|
-
refresh: string;
|
|
23562
|
-
};
|
|
23563
|
-
subaccount: {
|
|
23564
|
-
rewards: (subaccount: IAddress) => string;
|
|
23565
|
-
tokens: (subaccount: IAddress) => string;
|
|
23566
|
-
twap: {
|
|
23567
|
-
create: (subaccount: IAddress) => string;
|
|
23568
|
-
stop: (subaccount: IAddress, id: string) => string;
|
|
23569
|
-
fills: (subaccount: IAddress, id: string) => string;
|
|
23570
|
-
};
|
|
23571
|
-
debank: (subaccount: IAddress) => string;
|
|
23572
|
-
health_factor: (subaccount: IAddress) => string;
|
|
23573
|
-
summary: (subaccount: IAddress) => string;
|
|
23574
|
-
batch: (subaccount: IAddress) => string;
|
|
23575
|
-
loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
|
|
23576
|
-
cefi: (subaccount: IAddress) => string;
|
|
23577
|
-
otc_positions: (subaccount: IAddress) => string;
|
|
23578
|
-
_: (subaccount: IAddress) => string;
|
|
23579
|
-
};
|
|
23580
|
-
users: {
|
|
23581
|
-
get: string;
|
|
23582
|
-
};
|
|
23583
|
-
prices: (symbol: string) => string;
|
|
23584
|
-
metrics: {
|
|
23585
|
-
pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
|
|
23586
|
-
};
|
|
23587
|
-
public: {
|
|
23588
|
-
integrations: {
|
|
23589
|
-
morpho: {
|
|
23590
|
-
apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
|
|
23591
|
-
};
|
|
23592
|
-
};
|
|
23593
|
-
tokenizedVault: {
|
|
23594
|
-
loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
|
|
23595
|
-
subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
|
|
23596
|
-
list: string;
|
|
23597
|
-
byVaultAddress: (vaultAddress: VaultAddress) => string;
|
|
23598
|
-
historicalApy: (vaultAddress: IAddress) => string;
|
|
23599
|
-
historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
|
|
23600
|
-
annualizedApy: (vaultAddress: IAddress) => string;
|
|
23601
|
-
summary: (vaultAddress: IAddress) => string;
|
|
23602
|
-
withdrawals: (chain: string, vaultAddress: IAddress) => string;
|
|
23603
|
-
debank: (vaultAddress: IAddress) => string;
|
|
23604
|
-
};
|
|
23605
|
-
points: {
|
|
23606
|
-
byUserAddress: (userAddress: IAddress) => string;
|
|
23607
|
-
register: string;
|
|
23608
|
-
leaderboard: string;
|
|
23609
|
-
};
|
|
23610
|
-
vaults: {
|
|
23611
|
-
pendingRedemptions: (vaultAddress: IAddress) => string;
|
|
23612
|
-
};
|
|
23613
|
-
pnl: {
|
|
23614
|
-
unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
|
|
23615
|
-
unrealizedLatest: string;
|
|
23616
|
-
};
|
|
23617
|
-
};
|
|
23618
|
-
upshift: {
|
|
23619
|
-
vaults: {
|
|
23620
|
-
metadata: string;
|
|
23621
|
-
};
|
|
23622
|
-
};
|
|
23623
|
-
};
|
|
23624
|
-
|
|
23625
|
-
export declare const WEBSERVER_URL: {
|
|
23626
|
-
production: string;
|
|
23627
|
-
staging: string;
|
|
23628
|
-
development: string;
|
|
23629
|
-
localhost: string;
|
|
23630
|
-
qa: string;
|
|
23631
|
-
public: string;
|
|
23632
|
-
upshift: string;
|
|
23633
|
-
};
|
|
22725
|
+
declare namespace StellarGetters {
|
|
22726
|
+
export {
|
|
22727
|
+
getStellarVault,
|
|
22728
|
+
getStellarUserPosition,
|
|
22729
|
+
convertToShares
|
|
22730
|
+
}
|
|
22731
|
+
}
|
|
23634
22732
|
|
|
23635
|
-
|
|
23636
|
-
|
|
23637
|
-
|
|
23638
|
-
|
|
23639
|
-
* @interface WithdrawalRequestStatus
|
|
23640
|
-
*/
|
|
23641
|
-
export declare interface WithdrawalRequestStatus {
|
|
23642
|
-
/** Transaction hash of the withdrawal request */
|
|
23643
|
-
transactionHash: string;
|
|
23644
|
-
/** Block timestamp when the withdrawal was requested (seconds, UTC) */
|
|
23645
|
-
requestTimestamp: number;
|
|
23646
|
-
/** Shares amount being redeemed */
|
|
23647
|
-
shares: bigint;
|
|
23648
|
-
/** Receiver address for the withdrawal */
|
|
23649
|
-
receiver: string;
|
|
23650
|
-
/** Computed claimable date in UTC (year, month, day) */
|
|
23651
|
-
claimableDate: {
|
|
23652
|
-
year: number;
|
|
23653
|
-
month: number;
|
|
23654
|
-
day: number;
|
|
23655
|
-
};
|
|
23656
|
-
/** Epoch timestamp when this withdrawal becomes claimable */
|
|
23657
|
-
claimableEpoch: number;
|
|
23658
|
-
/** Current status of the withdrawal */
|
|
23659
|
-
status: 'pending' | 'ready_to_claim' | 'processed';
|
|
23660
|
-
/** Transaction hash of the processing transaction (if processed) */
|
|
23661
|
-
processedTransactionHash?: string;
|
|
23662
|
-
/** Assets received (if processed) */
|
|
23663
|
-
assetsReceived?: bigint;
|
|
22733
|
+
declare namespace StellarSubmit {
|
|
22734
|
+
export {
|
|
22735
|
+
submitStellarTransaction
|
|
22736
|
+
}
|
|
23664
22737
|
}
|
|
23665
22738
|
|
|
23666
22739
|
/**
|
|
23667
|
-
*
|
|
23668
|
-
*
|
|
23669
|
-
*
|
|
23670
|
-
* @param methodName - Name of the method being wrapped
|
|
23671
|
-
* @param method - The original async method
|
|
23672
|
-
* @param getChainId - Function to get current chain ID
|
|
23673
|
-
* @returns Wrapped method with tracking
|
|
22740
|
+
* @deprecated
|
|
22741
|
+
* Replaced by SUBGRAPH_VAULT_URLS which are subgraphs deployed on Goldsky.
|
|
23674
22742
|
*/
|
|
23675
|
-
export declare
|
|
22743
|
+
export declare const SUBGRAPH_POOL_URLS: (apiKey: string, chainId?: number, pool?: IAddress) => {
|
|
22744
|
+
1: string;
|
|
22745
|
+
8453: string;
|
|
22746
|
+
43114: string;
|
|
22747
|
+
42161: string;
|
|
22748
|
+
56: string;
|
|
22749
|
+
} | {
|
|
22750
|
+
999: string;
|
|
22751
|
+
};
|
|
23676
22752
|
|
|
23677
22753
|
/**
|
|
23678
|
-
*
|
|
23679
|
-
*
|
|
23680
|
-
* @param fn Async function to execute with retry logic
|
|
23681
|
-
* @param maxRetries Maximum number of retry attempts
|
|
23682
|
-
* @param baseDelay Initial delay in milliseconds (doubles each retry)
|
|
23683
|
-
* @param shouldRetry Custom function to determine if error is retryable
|
|
23684
|
-
* @returns Result of successful function execution
|
|
23685
|
-
* @throws Last error if all retries exhausted
|
|
22754
|
+
* Subgraph URLs
|
|
22755
|
+
* @deprecated use getVaultMetadata to fetch subgraph URLs from the backend
|
|
23686
22756
|
*/
|
|
23687
|
-
export declare
|
|
22757
|
+
export declare const SUBGRAPH_VAULT_URLS: Record<VaultSymbols, string>;
|
|
23688
22758
|
|
|
23689
22759
|
/**
|
|
23690
|
-
*
|
|
23691
|
-
* Uses breadcrumbs for tracking since spans require async context.
|
|
22760
|
+
* Submit a signed Soroban transaction and poll until confirmed.
|
|
23692
22761
|
*
|
|
23693
|
-
* @param
|
|
23694
|
-
* @param
|
|
23695
|
-
* @
|
|
23696
|
-
* @
|
|
23697
|
-
|
|
23698
|
-
|
|
23699
|
-
|
|
23700
|
-
|
|
23701
|
-
|
|
23702
|
-
|
|
23703
|
-
|
|
23704
|
-
|
|
23705
|
-
|
|
22762
|
+
* @param signedXdr - Base64-encoded XDR of the signed transaction
|
|
22763
|
+
* @param network - Stellar network name
|
|
22764
|
+
* @returns The transaction hash once the network confirms it as successful
|
|
22765
|
+
* @throws {@link AugustTimeoutError} when the transaction is not confirmed
|
|
22766
|
+
* within the poll budget (`MAX_POLL_ATTEMPTS`).
|
|
22767
|
+
* @throws {@link AugustSDKError} when the RPC rejects the submission or the
|
|
22768
|
+
* transaction confirms as failed. Its `context` carries `{ network, status }`
|
|
22769
|
+
* plus, when the result XDR decodes, a `resultCode` string holding the
|
|
22770
|
+
* transaction-level reason (e.g. `"txBadSeq"`, `"txTooLate"`); `resultCode`
|
|
22771
|
+
* is `undefined` when the code cannot be decoded.
|
|
22772
|
+
* @example
|
|
22773
|
+
* ```ts
|
|
22774
|
+
* try {
|
|
22775
|
+
* const hash = await submitStellarTransaction(signedXdr, 'mainnet');
|
|
22776
|
+
* } catch (err) {
|
|
22777
|
+
* if (err instanceof AugustSDKError && err.context?.resultCode === 'txBadSeq') {
|
|
22778
|
+
* // stale sequence number — rebuild the transaction and resubmit
|
|
22779
|
+
* }
|
|
22780
|
+
* }
|
|
22781
|
+
* ```
|
|
22782
|
+
*/
|
|
22783
|
+
declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork): Promise<string>;
|
|
22784
|
+
|
|
22785
|
+
/**
|
|
22786
|
+
* Sui Adapter for August SDK
|
|
22787
|
+
*
|
|
22788
|
+
* @example
|
|
22789
|
+
* To access the Sui adapter instance
|
|
22790
|
+
* ```
|
|
22791
|
+
* const sdk = new AugustSDK()
|
|
22792
|
+
* sdk.sui.getEmberVaults()
|
|
22793
|
+
* ```
|
|
22794
|
+
*/
|
|
22795
|
+
declare class SuiAdapter {
|
|
22796
|
+
private _apiBaseUrl;
|
|
22797
|
+
private _chainId;
|
|
22798
|
+
constructor(apiBaseUrl?: string, chainId?: number);
|
|
22799
|
+
get apiBaseUrl(): string;
|
|
22800
|
+
get chainId(): number;
|
|
22801
|
+
getEmberVaults(options?: IFetchEmberVaultsOptions): Promise<IEmberVault[]>;
|
|
22802
|
+
getEmberTVL(limit?: number): Promise<number>;
|
|
22803
|
+
convertFromE9(value: string | number): number;
|
|
22804
|
+
calculateUtilization(current: string | number, maximum: string | number): number;
|
|
22805
|
+
isSuiAddress(address: string): boolean;
|
|
22806
|
+
isSuiVault(chainId: number): boolean;
|
|
22807
|
+
transformEmberVaultToIVault(emberVault: IEmberVault): IVault;
|
|
22808
|
+
transformEmberVaultsToIVaults(emberVaults: IEmberVault[]): IVault[];
|
|
22809
|
+
}
|
|
22810
|
+
|
|
22811
|
+
/**
|
|
22812
|
+
* Address of the `SwapRouter` periphery contract on each supported chain.
|
|
22813
|
+
*
|
|
22814
|
+
* Missing keys mean no SwapRouter is deployed on that chain — callers
|
|
22815
|
+
* should fall back to legacy adapter paths.
|
|
22816
|
+
*
|
|
22817
|
+
* @see {@link getSwapRouterAddress} for the typed lookup helper.
|
|
22818
|
+
*/
|
|
22819
|
+
export declare const SWAP_ROUTER_ADDRESSES: Readonly<Record<number, IAddress>>;
|
|
22820
|
+
|
|
22821
|
+
/**
|
|
22822
|
+
* The DEX aggregator whitelisted on each chain's `SwapRouter` via
|
|
22823
|
+
* `enableRouter`, plus the single aggregator contract method every swap leg is
|
|
22824
|
+
* pinned to and that method's 4-byte selector.
|
|
22825
|
+
*
|
|
22826
|
+
* This is the single source of truth tying the off-chain swap-leg builder to
|
|
22827
|
+
* the on-chain router whitelist. The two MUST agree or `swapAndDeposit` reverts
|
|
22828
|
+
* with `InvalidRouter()` (router not whitelisted) or `InvalidNotWhitelisted()`
|
|
22829
|
+
* (selector not authorized). It is consumed in three places:
|
|
22830
|
+
*
|
|
22831
|
+
* - `dispatchViaSwapRouter` asks {@link fetchSwapQuote} to pin the aggregator to
|
|
22832
|
+
* `contractMethod`, then asserts the returned quote's `router` and payload
|
|
22833
|
+
* selector match this entry before broadcasting — failing closed rather than
|
|
22834
|
+
* letting the user pay gas for a transaction the contract will reject.
|
|
22835
|
+
* - The CI check `scripts/verify-swap-router-aggregator.mjs` asserts the
|
|
22836
|
+
* deployed `SwapRouter` actually has `tokenTransferProxies[router] != 0` and
|
|
22837
|
+
* `isAuthorizedSelector(router, selector) == true` for every entry here, so
|
|
22838
|
+
* config drift is caught at release time, not by a user's failed deposit.
|
|
22839
|
+
*
|
|
22840
|
+
* Pinning to one generic method matters: the aggregator otherwise picks a route
|
|
22841
|
+
* method per quote (e.g. a direct `swapExactAmountInOnUniswapV3`) that varies
|
|
22842
|
+
* with market conditions, producing a different selector each time. Pinning
|
|
22843
|
+
* collapses that to one stable selector so the on-chain whitelist needs only
|
|
22844
|
+
* that selector and never drifts as routing changes.
|
|
22845
|
+
*
|
|
22846
|
+
* `router` is the address the aggregator's calldata targets (ParaSwap v6.2
|
|
22847
|
+
* pulls tokens to the Augustus contract itself, so the SwapRouter's
|
|
22848
|
+
* `tokenTransferProxies[router]` is the router address). `selector` is
|
|
22849
|
+
* `bytes4(keccak256("<contractMethod>(...)"))`. Verify both against the
|
|
22850
|
+
* deployed router before adding a chain — a wrong value reverts at deposit time.
|
|
22851
|
+
*/
|
|
22852
|
+
export declare const SWAP_ROUTER_DEX_AGGREGATOR: Readonly<Record<number, {
|
|
22853
|
+
router: IAddress;
|
|
22854
|
+
contractMethod: string;
|
|
22855
|
+
selector: `0x${string}`;
|
|
22856
|
+
}>>;
|
|
22857
|
+
|
|
22858
|
+
/**
|
|
22859
|
+
* Maximum number of swap legs the contract accepts in a single
|
|
22860
|
+
* `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading
|
|
22861
|
+
* the on-chain value at call time would add an RPC for no gain.
|
|
22862
|
+
*
|
|
22863
|
+
* Kept here so the SDK can reject oversize inputs at the boundary rather
|
|
22864
|
+
* than wait for the on-chain `TooManySwaps` revert.
|
|
22865
|
+
*/
|
|
22866
|
+
export declare const SWAP_ROUTER_MAX_SWAPS = 9;
|
|
22867
|
+
|
|
22868
|
+
/**
|
|
22869
|
+
* Wrapped-native ERC-20 per chain that has a SwapRouter deployment. Mirrors
|
|
22870
|
+
* the on-chain `wrappedNativeTokenAddress()` view to avoid an extra RPC on
|
|
22871
|
+
* every dispatch. Used to validate that native-token deposits target a
|
|
22872
|
+
* vault whose reference asset is the wrapped native — the only configuration
|
|
22873
|
+
* the contract's `depositNativeToken` / `swapAndDepositNativeToken` accept.
|
|
22874
|
+
*/
|
|
22875
|
+
export declare const SWAP_ROUTER_WRAPPED_NATIVE: Readonly<Record<number, IAddress>>;
|
|
22876
|
+
|
|
22877
|
+
/**
|
|
22878
|
+
* Swap one or more whitelisted ERC-20s into a vault's reference asset via
|
|
22879
|
+
* the on-chain SwapRouter, then deposit the proceeds into the vault.
|
|
22880
|
+
*
|
|
22881
|
+
* Approval is sent automatically when the caller's allowance on each
|
|
22882
|
+
* `swaps[i].tokenIn` against the SwapRouter is below `amountIn`.
|
|
22883
|
+
*
|
|
22884
|
+
* @param signer - ethers `Signer` or `Wallet` with the EOA that holds the input tokens.
|
|
22885
|
+
* @param options - {@link ISwapAndDepositOptions}.
|
|
22886
|
+
* @returns The transaction hash of the `swapAndDeposit` call.
|
|
22887
|
+
*
|
|
22888
|
+
* @throws {@link AugustValidationError} for unsupported chains, invalid
|
|
22889
|
+
* addresses, empty/oversized swap arrays.
|
|
22890
|
+
* @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
|
|
22891
|
+
*
|
|
22892
|
+
* @example
|
|
22893
|
+
* ```ts
|
|
22894
|
+
* const quote = await fetchSwapQuote({
|
|
22895
|
+
* chainId: 1,
|
|
22896
|
+
* srcToken: WBTC,
|
|
22897
|
+
* srcDecimals: 8,
|
|
22898
|
+
* destToken: USDC,
|
|
22899
|
+
* destDecimals: 6,
|
|
22900
|
+
* amount: 100_000_000n,
|
|
22901
|
+
* receiver: SWAP_ROUTER_ADDRESSES[1]!,
|
|
22902
|
+
* });
|
|
22903
|
+
* const hash = await swapAndDeposit(signer, {
|
|
22904
|
+
* chainId: 1,
|
|
22905
|
+
* vault: '0x8AcA0841993ef4C87244d519166e767f49362C21',
|
|
22906
|
+
* receiver: wallet,
|
|
22907
|
+
* swaps: [{
|
|
22908
|
+
* tokenIn: WBTC,
|
|
22909
|
+
* tokenOut: USDC,
|
|
22910
|
+
* amountIn: 100_000_000n,
|
|
22911
|
+
* minAmountOut: quote.minAmountOut,
|
|
22912
|
+
* router: quote.router,
|
|
22913
|
+
* payload: quote.payload,
|
|
22914
|
+
* }],
|
|
22915
|
+
* });
|
|
22916
|
+
* ```
|
|
22917
|
+
*/
|
|
22918
|
+
export declare function swapAndDeposit(signer: Signer | Wallet, options: ISwapAndDepositOptions): Promise<string>;
|
|
22919
|
+
|
|
22920
|
+
/**
|
|
22921
|
+
* Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
|
|
22922
|
+
* the ERC-4626 (`deposit(uint256, address)`) and multi-asset
|
|
22923
|
+
* (`deposit(address, uint256, address)`) deposit interfaces.
|
|
22924
|
+
*
|
|
22925
|
+
* Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
|
|
22926
|
+
* constants exactly. Set by an admin per-vault via `enableVault` and looked
|
|
22927
|
+
* up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
|
|
22928
|
+
* this — the router resolves it internally.
|
|
22929
|
+
*/
|
|
22930
|
+
export declare enum SwapRouterVaultType {
|
|
22931
|
+
ERC4626 = 1,
|
|
22932
|
+
TokenizedVaultV2 = 2
|
|
22933
|
+
}
|
|
22934
|
+
|
|
22935
|
+
/**
|
|
22936
|
+
* Table of Contents
|
|
22937
|
+
* - Formatters
|
|
22938
|
+
* - Datetime
|
|
22939
|
+
* - Arrays
|
|
22940
|
+
* - Caching
|
|
22941
|
+
*/
|
|
22942
|
+
export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
|
|
22943
|
+
|
|
22944
|
+
/**
|
|
22945
|
+
* Formatters
|
|
22946
|
+
*/
|
|
22947
|
+
export declare function toTitleCase(str: string, type?: 'camel'): string;
|
|
22948
|
+
|
|
22949
|
+
/**
|
|
22950
|
+
* Track API response times and status.
|
|
22951
|
+
*
|
|
22952
|
+
* @param endpoint - The API endpoint called
|
|
22953
|
+
* @param method - HTTP method used
|
|
22954
|
+
* @param startTime - Start timestamp from performance.now()
|
|
22955
|
+
* @param status - HTTP response status code (0 for network errors)
|
|
22956
|
+
* @param server - Server identifier (production, staging, etc.)
|
|
22957
|
+
*/
|
|
22958
|
+
export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
|
|
22959
|
+
|
|
22960
|
+
/**
|
|
22961
|
+
* Track chain/network switches for usage distribution analysis.
|
|
22962
|
+
*
|
|
22963
|
+
* @param chainId - The chain ID being switched to
|
|
22964
|
+
*/
|
|
22965
|
+
export declare function trackNetworkSwitch(chainId: number): void;
|
|
22966
|
+
|
|
22967
|
+
export declare function truncate(s: string, amount?: number): string;
|
|
22968
|
+
|
|
22969
|
+
/* Excluded from this release type: tryRecoverTxHash */
|
|
22970
|
+
|
|
22971
|
+
/**
|
|
22972
|
+
* Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
|
|
22973
|
+
* Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
|
|
22974
|
+
* checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
|
|
22975
|
+
* would throw). Add an address here to drop its `latest_reported_tvl` from
|
|
22976
|
+
* the headline number — e.g. closed pre-deposit vaults, test vaults, or
|
|
22977
|
+
* migrated v1 pools that are double-counted by a v2 successor.
|
|
22978
|
+
*/
|
|
22979
|
+
export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
|
|
22980
|
+
|
|
22981
|
+
/**
|
|
22982
|
+
* Validity window for a submitted Soroban invocation (seconds).
|
|
22983
|
+
*
|
|
22984
|
+
* This becomes the transaction's `maxTime`. Validators reject a tx whose
|
|
22985
|
+
* `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
|
|
22986
|
+
* realistic sign-then-submit path: hardware wallets, careful manual review,
|
|
22987
|
+
* and institutional approval flows (e.g. Fordefi) that don't sign instantly.
|
|
22988
|
+
* 10 minutes comfortably covers those while staying well inside the Soroban
|
|
22989
|
+
* footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
|
|
22990
|
+
*
|
|
22991
|
+
* The window is anchored to the *network* clock (see `getNetworkCloseTime` in
|
|
22992
|
+
* soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
|
|
22993
|
+
* make the deadline expire early.
|
|
22994
|
+
*/
|
|
22995
|
+
declare const TX_TIMEOUT_SECONDS = 600;
|
|
22996
|
+
|
|
22997
|
+
export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
|
|
22998
|
+
[Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
|
|
22999
|
+
} & {
|
|
23000
|
+
/**
|
|
23001
|
+
* Return the function for a given name. This is useful when a contract
|
|
23002
|
+
* method name conflicts with a JavaScript name such as ``prototype`` or
|
|
23003
|
+
* when using a Contract programatically.
|
|
23004
|
+
*/
|
|
23005
|
+
getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
|
|
23006
|
+
/**
|
|
23007
|
+
* Return the event for a given name. This is useful when a contract
|
|
23008
|
+
* event name conflicts with a JavaScript name such as ``prototype`` or
|
|
23009
|
+
* when using a Contract programatically.
|
|
23010
|
+
*/
|
|
23011
|
+
getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
|
|
23012
|
+
/**
|
|
23013
|
+
* All the Events available on this contract.
|
|
23014
|
+
*/
|
|
23015
|
+
filters: {
|
|
23016
|
+
[EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
|
|
23017
|
+
};
|
|
23018
|
+
};
|
|
23019
|
+
|
|
23020
|
+
export declare interface TypedContractEvent<TAbi extends Abi, TEventName extends string, TEvent extends ExtractAbiEvents<TAbi> = ExtractAbiEvent<TAbi, TEventName>, TEventArgs extends readonly unknown[] = AsArray<Partial<AbiParametersToPrimitiveTypes<TEvent['inputs']>>>> {
|
|
23021
|
+
(...args: [...TEventArgs]): DeferredTopicFilter;
|
|
23022
|
+
/**
|
|
23023
|
+
* The name of the Contract event.
|
|
23024
|
+
*/
|
|
23025
|
+
name: TEventName;
|
|
23026
|
+
/**
|
|
23027
|
+
* The fragment of the Contract event. This will throw on ambiguous
|
|
23028
|
+
* method names.
|
|
23029
|
+
*/
|
|
23030
|
+
fragment: EventFragment;
|
|
23031
|
+
/**
|
|
23032
|
+
* Returns the fragment constrained by %%args%%. This can be used to
|
|
23033
|
+
* resolve ambiguous event names.
|
|
23034
|
+
*/
|
|
23035
|
+
getFragment(...args: [...TEventArgs]): EventFragment;
|
|
23036
|
+
}
|
|
23037
|
+
|
|
23038
|
+
export declare interface TypedContractFunction<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>, TInputArgs extends readonly unknown[] = AsArray<AbiParametersToPrimitiveTypes<TFunction['inputs']>>, TResult = TypedContractFunctionResult<TAbi, TFunctionName>, TFragment = TypedFragment<TAbi, TFunctionName>> {
|
|
23039
|
+
(...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
|
|
23040
|
+
/**
|
|
23041
|
+
* The name of the Contract method.
|
|
23042
|
+
*/
|
|
23043
|
+
name: TFunctionName;
|
|
23044
|
+
/**
|
|
23045
|
+
* The fragment of the Contract method. This will throw on ambiguous
|
|
23046
|
+
* method names.
|
|
23047
|
+
*/
|
|
23048
|
+
fragment: TFragment;
|
|
23049
|
+
/**
|
|
23050
|
+
* Returns the fragment constrained by %%args%%. This can be used to
|
|
23051
|
+
* resolve ambiguous method names.
|
|
23052
|
+
*/
|
|
23053
|
+
getFragment(...args: [...TInputArgs]): TFragment;
|
|
23054
|
+
/**
|
|
23055
|
+
* Returns a populated transaction that can be used to perform the
|
|
23056
|
+
* contract method with %%args%%.
|
|
23057
|
+
*/
|
|
23058
|
+
populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
|
|
23059
|
+
/**
|
|
23060
|
+
* Call the contract method with %%args%% and return the value.
|
|
23061
|
+
*
|
|
23062
|
+
* If the return value is a single type, it will be dereferenced and
|
|
23063
|
+
* returned directly, otherwise the full Result will be returned.
|
|
23064
|
+
*/
|
|
23065
|
+
staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
|
|
23066
|
+
/**
|
|
23067
|
+
* Send a transaction for the contract method with %%args%%.
|
|
23068
|
+
*/
|
|
23069
|
+
send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
|
|
23070
|
+
/**
|
|
23071
|
+
* Estimate the gas to send the contract method with %%args%%.
|
|
23072
|
+
*/
|
|
23073
|
+
estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
|
|
23074
|
+
/**
|
|
23075
|
+
* Call the contract method with %%args%% and return the Result
|
|
23076
|
+
* without any dereferencing.
|
|
23077
|
+
*/
|
|
23078
|
+
staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
|
|
23079
|
+
}
|
|
23080
|
+
|
|
23081
|
+
export declare type TypedContractFunctionResult<TAbi extends Abi, TFunctionName extends string, TOutputArgs = AbiParametersToPrimitiveTypes<ExtractAbiFunction<TAbi, TFunctionName>['outputs']>> = TOutputArgs extends readonly [] ? void : TOutputArgs extends readonly [infer Arg] ? Arg : TOutputArgs;
|
|
23082
|
+
|
|
23083
|
+
export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
|
|
23084
|
+
name: TFunction['name'];
|
|
23085
|
+
type: TFunction['type'];
|
|
23086
|
+
inputs: TFunction['inputs'];
|
|
23087
|
+
outputs: TFunction['outputs'];
|
|
23088
|
+
stateMutability: TFunction['stateMutability'];
|
|
23089
|
+
};
|
|
23090
|
+
|
|
23091
|
+
export declare function unixToDate(epoch: number): Date;
|
|
23092
|
+
|
|
23093
|
+
/**
|
|
23094
|
+
* Update the current user identity in Sentry.
|
|
23095
|
+
* Called when wallet address changes.
|
|
23096
|
+
*
|
|
23097
|
+
* @param walletAddress - New wallet address (or undefined to clear)
|
|
23098
|
+
* @param environment - Current environment
|
|
23099
|
+
*/
|
|
23100
|
+
export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
|
|
23101
|
+
|
|
23102
|
+
/* Excluded from this release type: validateAmountPrecision */
|
|
23103
|
+
|
|
23104
|
+
/**
|
|
23105
|
+
* Vault adapter configurations mapping vault addresses to their adapter settings
|
|
23106
|
+
*/
|
|
23107
|
+
export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
|
|
23108
|
+
|
|
23109
|
+
export declare const VAULT_ADDRESSES: Record<"musd" | "predlp" | "sentusd" | "pregrid" | "repouscc" | "earnxrp" | "tivkbtc" | "tivusdt0" | "supermon" | "earnmon" | "k3europ" | "wmon/ausd" | "wbtc/ausd" | "earnausd_monad" | "sausd" | "farmbold" | "sentuscc" | "sentbtc" | "svusdc" | "apusdc" | "testwethtsa" | "tacusr" | "upinjusdt" | "tac-teth" | "upausd" | "taccbbtc" | "xupusdc" | "uptbtc" | "gteth" | "ageth" | "upusdc" | "hgeth" | "upssylva" | "hbbtc" | "hbhype" | "upazt" | "susdt" | "upedge" | "coreusdc" | "upcusdo" | "shifteth" | "upsusde" | "uplbtc" | "upavax" | "tacrseth" | "earnausd" | "alpineusdcflagship" | "alpinecoinshiftusdc" | "upbtc" | "upstrbtc" | "maxiusr" | "upgammausdc" | "xhype" | "wildusd" | "alpinebtc" | "prenusd" | "upyzusd" | "upnusd" | "hlpe" | "nemo eth yield", `0x${string}`>;
|
|
23110
|
+
|
|
23111
|
+
/**
|
|
23112
|
+
* Hardcoded subaccount addresses for specific vaults allocations
|
|
23113
|
+
*/
|
|
23114
|
+
export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
|
|
23115
|
+
AgoraAUSD: {
|
|
23116
|
+
address: IAddress;
|
|
23117
|
+
subaccount: IAddress;
|
|
23118
|
+
useDebank: boolean;
|
|
23119
|
+
};
|
|
23120
|
+
earnAUSD: {
|
|
23121
|
+
address: IAddress;
|
|
23122
|
+
subaccount: IAddress;
|
|
23123
|
+
useDebank: boolean;
|
|
23124
|
+
};
|
|
23125
|
+
};
|
|
23126
|
+
|
|
23127
|
+
/**
|
|
23128
|
+
* The functions to call on the vault contract
|
|
23129
|
+
* @returns The functions to call
|
|
23130
|
+
*/
|
|
23131
|
+
export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
|
|
23132
|
+
|
|
23133
|
+
export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
|
|
23134
|
+
|
|
23135
|
+
export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
|
|
23136
|
+
|
|
23137
|
+
export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
|
|
23138
|
+
|
|
23139
|
+
/**
|
|
23140
|
+
* Vault Symbols Mapping
|
|
23141
|
+
* @deprecated use getVaultMetadata to fetch vault symbols from the backend
|
|
23142
|
+
*/
|
|
23143
|
+
export declare const VAULT_SYMBOLS: Record<IAddress, string>;
|
|
23144
|
+
|
|
23145
|
+
/**
|
|
23146
|
+
* Vault Symbols Reverse Mapping
|
|
23147
|
+
* @deprecated use getVaultMetadata to fetch vault symbols from the backend
|
|
23148
|
+
*/
|
|
23149
|
+
export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
|
|
23150
|
+
|
|
23151
|
+
/**
|
|
23152
|
+
* Address type for vault contracts across all supported chains.
|
|
23153
|
+
* EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
|
|
23154
|
+
* and Stellar vaults use 56-character base32 addresses (G/C prefix).
|
|
23155
|
+
*
|
|
23156
|
+
* Use this instead of `IAddress` when the address may belong to any chain.
|
|
23157
|
+
*/
|
|
23158
|
+
export declare type VaultAddress = string;
|
|
23159
|
+
|
|
23160
|
+
/**
|
|
23161
|
+
* allowance checks user's current allowance per pool
|
|
23162
|
+
* @param signer - signer / provider object
|
|
23163
|
+
* @param options - object including pool contract address, user wallet address
|
|
23164
|
+
* @returns normalized number object of the user's current allowance
|
|
23165
|
+
*/
|
|
23166
|
+
export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
|
|
23167
|
+
|
|
23168
|
+
/**
|
|
23169
|
+
* Approve a vault (or the appropriate adapter wrapper) to spend a token
|
|
23170
|
+
* ahead of a separate deposit call. Spender routing mirrors
|
|
23171
|
+
* {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
|
|
23172
|
+
* vault). Returns `undefined` when the existing allowance already covers
|
|
23173
|
+
* `amount` **or** when the deposit asset is native.
|
|
23174
|
+
*
|
|
23175
|
+
* @returns Transaction hash when an approval was sent, `undefined` when
|
|
23176
|
+
* the existing allowance already covers `amount` or the deposit asset is
|
|
23177
|
+
* native (no ERC-20 allowance applies). Use {@link approve} for a
|
|
23178
|
+
* discriminated `ApproveResult` if you need to tell those two cases apart.
|
|
23179
|
+
* @throws AugustValidationError on invalid wallet/target/amount.
|
|
23180
|
+
*
|
|
23181
|
+
* @example
|
|
23182
|
+
* ```ts
|
|
23183
|
+
* const hash = await augustSdk.evm.vaultApprove({
|
|
23184
|
+
* target: '0x...', // vault contract address
|
|
23185
|
+
* wallet: walletAddress,
|
|
23186
|
+
* amount: '100', // 100 of the deposit token (UI units)
|
|
23187
|
+
* wait: true, // wait for the approval to confirm
|
|
23188
|
+
* });
|
|
23189
|
+
* if (hash) console.log('approve tx', hash);
|
|
23190
|
+
* // hash === undefined means the on-chain allowance already covers the
|
|
23191
|
+
* // amount, or the deposit asset is native (msg.value, no allowance).
|
|
23192
|
+
* ```
|
|
23193
|
+
*/
|
|
23194
|
+
export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
|
|
23195
|
+
|
|
23196
|
+
/**
|
|
23197
|
+
* Deposit underlying token into the specified vault. Auto-routes to the
|
|
23198
|
+
* correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
|
|
23199
|
+
* Paraswap adapter, native-token wrapper, depositWithPermit) based on the
|
|
23200
|
+
* vault version and `depositAsset`.
|
|
23201
|
+
*
|
|
23202
|
+
* Amounts are encoded against the **deposit token's** decimals, not the
|
|
23203
|
+
* vault's share decimals. The SDK reads the appropriate decimals via the
|
|
23204
|
+
* vault metadata and the asset's ERC-20.
|
|
23205
|
+
*
|
|
23206
|
+
* Approval is handled automatically: if the existing allowance doesn't
|
|
23207
|
+
* cover `amount`, an `approve` is sent and **always waited for** (regardless
|
|
23208
|
+
* of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
|
|
23209
|
+
* of the approval on Monad-style RPCs.
|
|
23210
|
+
*
|
|
23211
|
+
* @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
|
|
23212
|
+
* @param options Vault address, wallet, amount, optional `depositAsset` for
|
|
23213
|
+
* adapter routes, optional `wait` to wait for the deposit receipt.
|
|
23214
|
+
* @returns Deposit transaction hash.
|
|
23215
|
+
* @throws AugustValidationError on invalid wallet/target/amount or missing
|
|
23216
|
+
* adapter config when `depositAsset` differs from the vault underlying.
|
|
23217
|
+
* @throws AugustSDKError when the deposit submission or on-chain call fails.
|
|
23218
|
+
*
|
|
23219
|
+
* @example
|
|
23220
|
+
* ```ts
|
|
23221
|
+
* const hash = await augustSdk.evm.vaultDeposit({
|
|
23222
|
+
* target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
|
|
23223
|
+
* wallet: walletAddress,
|
|
23224
|
+
* amount: '100', // 100 USDC (UI units)
|
|
23225
|
+
* wait: true, // wait for the deposit receipt
|
|
23226
|
+
* });
|
|
23227
|
+
* ```
|
|
23228
|
+
*
|
|
23229
|
+
* @example Adapter deposit (different deposit asset than the vault's underlying)
|
|
23230
|
+
* ```ts
|
|
23231
|
+
* await augustSdk.evm.vaultDeposit({
|
|
23232
|
+
* target: vaultAddress,
|
|
23233
|
+
* wallet: walletAddress,
|
|
23234
|
+
* amount: '0.5',
|
|
23235
|
+
* depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
|
|
23236
|
+
* chainId: 1,
|
|
23237
|
+
* });
|
|
23238
|
+
* ```
|
|
23239
|
+
*/
|
|
23240
|
+
export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
|
|
23241
|
+
|
|
23242
|
+
/**
|
|
23243
|
+
* Check if vault has adapter support
|
|
23244
|
+
*/
|
|
23245
|
+
export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
|
|
23246
|
+
|
|
23247
|
+
declare const vaultIdl: {
|
|
23248
|
+
address: string;
|
|
23249
|
+
metadata: {
|
|
23250
|
+
name: string;
|
|
23251
|
+
version: string;
|
|
23252
|
+
spec: string;
|
|
23253
|
+
description: string;
|
|
23254
|
+
};
|
|
23255
|
+
instructions: ({
|
|
23256
|
+
name: string;
|
|
23257
|
+
docs: string[];
|
|
23258
|
+
discriminator: number[];
|
|
23259
|
+
accounts: ({
|
|
23260
|
+
name: string;
|
|
23261
|
+
writable: boolean;
|
|
23262
|
+
pda: {
|
|
23263
|
+
seeds: {
|
|
23264
|
+
kind: string;
|
|
23265
|
+
value: number[];
|
|
23266
|
+
}[];
|
|
23267
|
+
};
|
|
23268
|
+
signer?: undefined;
|
|
23269
|
+
address?: undefined;
|
|
23270
|
+
} | {
|
|
23271
|
+
name: string;
|
|
23272
|
+
signer: boolean;
|
|
23273
|
+
writable?: undefined;
|
|
23274
|
+
pda?: undefined;
|
|
23275
|
+
address?: undefined;
|
|
23276
|
+
} | {
|
|
23277
|
+
name: string;
|
|
23278
|
+
writable: boolean;
|
|
23279
|
+
pda?: undefined;
|
|
23280
|
+
signer?: undefined;
|
|
23281
|
+
address?: undefined;
|
|
23282
|
+
} | {
|
|
23283
|
+
name: string;
|
|
23284
|
+
address: string;
|
|
23285
|
+
writable?: undefined;
|
|
23286
|
+
pda?: undefined;
|
|
23287
|
+
signer?: undefined;
|
|
23288
|
+
})[];
|
|
23289
|
+
args: any[];
|
|
23290
|
+
} | {
|
|
23291
|
+
name: string;
|
|
23292
|
+
docs: string[];
|
|
23293
|
+
discriminator: number[];
|
|
23294
|
+
accounts: ({
|
|
23295
|
+
name: string;
|
|
23296
|
+
writable: boolean;
|
|
23297
|
+
signer: boolean;
|
|
23298
|
+
docs?: undefined;
|
|
23299
|
+
pda?: undefined;
|
|
23300
|
+
address?: undefined;
|
|
23301
|
+
} | {
|
|
23302
|
+
name: string;
|
|
23303
|
+
docs: string[];
|
|
23304
|
+
writable: boolean;
|
|
23305
|
+
signer: boolean;
|
|
23306
|
+
pda?: undefined;
|
|
23307
|
+
address?: undefined;
|
|
23308
|
+
} | {
|
|
23309
|
+
name: string;
|
|
23310
|
+
docs: string[];
|
|
23311
|
+
writable: boolean;
|
|
23312
|
+
pda: {
|
|
23313
|
+
seeds: {
|
|
23314
|
+
kind: string;
|
|
23315
|
+
value: number[];
|
|
23316
|
+
}[];
|
|
23317
|
+
program?: undefined;
|
|
23318
|
+
};
|
|
23319
|
+
signer?: undefined;
|
|
23320
|
+
address?: undefined;
|
|
23321
|
+
} | {
|
|
23322
|
+
name: string;
|
|
23323
|
+
docs: string[];
|
|
23324
|
+
writable: boolean;
|
|
23325
|
+
signer?: undefined;
|
|
23326
|
+
pda?: undefined;
|
|
23327
|
+
address?: undefined;
|
|
23328
|
+
} | {
|
|
23329
|
+
name: string;
|
|
23330
|
+
writable: boolean;
|
|
23331
|
+
pda: {
|
|
23332
|
+
seeds: ({
|
|
23333
|
+
kind: string;
|
|
23334
|
+
value: number[];
|
|
23335
|
+
path?: undefined;
|
|
23336
|
+
} | {
|
|
23337
|
+
kind: string;
|
|
23338
|
+
path: string;
|
|
23339
|
+
value?: undefined;
|
|
23340
|
+
})[];
|
|
23341
|
+
program: {
|
|
23342
|
+
kind: string;
|
|
23343
|
+
value: number[];
|
|
23344
|
+
};
|
|
23345
|
+
};
|
|
23346
|
+
signer?: undefined;
|
|
23347
|
+
docs?: undefined;
|
|
23348
|
+
address?: undefined;
|
|
23349
|
+
} | {
|
|
23350
|
+
name: string;
|
|
23351
|
+
address: string;
|
|
23352
|
+
writable?: undefined;
|
|
23353
|
+
signer?: undefined;
|
|
23354
|
+
docs?: undefined;
|
|
23355
|
+
pda?: undefined;
|
|
23356
|
+
})[];
|
|
23357
|
+
args: {
|
|
23358
|
+
name: string;
|
|
23359
|
+
type: string;
|
|
23360
|
+
}[];
|
|
23361
|
+
} | {
|
|
23362
|
+
name: string;
|
|
23363
|
+
docs: string[];
|
|
23364
|
+
discriminator: number[];
|
|
23365
|
+
accounts: ({
|
|
23366
|
+
name: string;
|
|
23367
|
+
writable: boolean;
|
|
23368
|
+
pda: {
|
|
23369
|
+
seeds: ({
|
|
23370
|
+
kind: string;
|
|
23371
|
+
value: number[];
|
|
23372
|
+
path?: undefined;
|
|
23373
|
+
} | {
|
|
23374
|
+
kind: string;
|
|
23375
|
+
path: string;
|
|
23376
|
+
value?: undefined;
|
|
23377
|
+
})[];
|
|
23378
|
+
};
|
|
23379
|
+
signer?: undefined;
|
|
23380
|
+
} | {
|
|
23381
|
+
name: string;
|
|
23382
|
+
writable: boolean;
|
|
23383
|
+
pda?: undefined;
|
|
23384
|
+
signer?: undefined;
|
|
23385
|
+
} | {
|
|
23386
|
+
name: string;
|
|
23387
|
+
writable: boolean;
|
|
23388
|
+
signer: boolean;
|
|
23389
|
+
pda?: undefined;
|
|
23390
|
+
} | {
|
|
23391
|
+
name: string;
|
|
23392
|
+
writable?: undefined;
|
|
23393
|
+
pda?: undefined;
|
|
23394
|
+
signer?: undefined;
|
|
23395
|
+
})[];
|
|
23396
|
+
args: {
|
|
23397
|
+
name: string;
|
|
23398
|
+
type: string;
|
|
23399
|
+
}[];
|
|
23400
|
+
} | {
|
|
23401
|
+
name: string;
|
|
23402
|
+
docs: string[];
|
|
23403
|
+
discriminator: number[];
|
|
23404
|
+
accounts: ({
|
|
23405
|
+
name: string;
|
|
23406
|
+
writable: boolean;
|
|
23407
|
+
pda: {
|
|
23408
|
+
seeds: ({
|
|
23409
|
+
kind: string;
|
|
23410
|
+
value: number[];
|
|
23411
|
+
path?: undefined;
|
|
23412
|
+
} | {
|
|
23413
|
+
kind: string;
|
|
23414
|
+
path: string;
|
|
23415
|
+
value?: undefined;
|
|
23416
|
+
})[];
|
|
23417
|
+
};
|
|
23418
|
+
signer?: undefined;
|
|
23419
|
+
address?: undefined;
|
|
23420
|
+
} | {
|
|
23421
|
+
name: string;
|
|
23422
|
+
writable?: undefined;
|
|
23423
|
+
pda?: undefined;
|
|
23424
|
+
signer?: undefined;
|
|
23425
|
+
address?: undefined;
|
|
23426
|
+
} | {
|
|
23427
|
+
name: string;
|
|
23428
|
+
writable: boolean;
|
|
23429
|
+
signer: boolean;
|
|
23430
|
+
pda?: undefined;
|
|
23431
|
+
address?: undefined;
|
|
23432
|
+
} | {
|
|
23433
|
+
name: string;
|
|
23434
|
+
address: string;
|
|
23435
|
+
writable?: undefined;
|
|
23436
|
+
pda?: undefined;
|
|
23437
|
+
signer?: undefined;
|
|
23438
|
+
})[];
|
|
23439
|
+
args: {
|
|
23440
|
+
name: string;
|
|
23441
|
+
type: string;
|
|
23442
|
+
}[];
|
|
23443
|
+
} | {
|
|
23444
|
+
name: string;
|
|
23445
|
+
docs: string[];
|
|
23446
|
+
discriminator: number[];
|
|
23447
|
+
accounts: ({
|
|
23448
|
+
name: string;
|
|
23449
|
+
writable: boolean;
|
|
23450
|
+
pda: {
|
|
23451
|
+
seeds: {
|
|
23452
|
+
kind: string;
|
|
23453
|
+
value: number[];
|
|
23454
|
+
}[];
|
|
23455
|
+
};
|
|
23456
|
+
signer?: undefined;
|
|
23457
|
+
address?: undefined;
|
|
23458
|
+
} | {
|
|
23459
|
+
name: string;
|
|
23460
|
+
signer: boolean;
|
|
23461
|
+
writable?: undefined;
|
|
23462
|
+
pda?: undefined;
|
|
23463
|
+
address?: undefined;
|
|
23464
|
+
} | {
|
|
23465
|
+
name: string;
|
|
23466
|
+
writable: boolean;
|
|
23467
|
+
signer: boolean;
|
|
23468
|
+
pda?: undefined;
|
|
23469
|
+
address?: undefined;
|
|
23470
|
+
} | {
|
|
23471
|
+
name: string;
|
|
23472
|
+
address: string;
|
|
23473
|
+
writable?: undefined;
|
|
23474
|
+
pda?: undefined;
|
|
23475
|
+
signer?: undefined;
|
|
23476
|
+
})[];
|
|
23477
|
+
args: {
|
|
23478
|
+
name: string;
|
|
23479
|
+
type: string;
|
|
23480
|
+
}[];
|
|
23481
|
+
} | {
|
|
23482
|
+
name: string;
|
|
23483
|
+
docs: string[];
|
|
23484
|
+
discriminator: number[];
|
|
23485
|
+
accounts: ({
|
|
23486
|
+
name: string;
|
|
23487
|
+
writable: boolean;
|
|
23488
|
+
pda: {
|
|
23489
|
+
seeds: ({
|
|
23490
|
+
kind: string;
|
|
23491
|
+
value: number[];
|
|
23492
|
+
path?: undefined;
|
|
23493
|
+
} | {
|
|
23494
|
+
kind: string;
|
|
23495
|
+
path: string;
|
|
23496
|
+
value?: undefined;
|
|
23497
|
+
})[];
|
|
23498
|
+
program?: undefined;
|
|
23499
|
+
};
|
|
23500
|
+
signer?: undefined;
|
|
23501
|
+
} | {
|
|
23502
|
+
name: string;
|
|
23503
|
+
writable: boolean;
|
|
23504
|
+
pda: {
|
|
23505
|
+
seeds: ({
|
|
23506
|
+
kind: string;
|
|
23507
|
+
path: string;
|
|
23508
|
+
value?: undefined;
|
|
23509
|
+
} | {
|
|
23510
|
+
kind: string;
|
|
23511
|
+
value: number[];
|
|
23512
|
+
path?: undefined;
|
|
23513
|
+
})[];
|
|
23514
|
+
program: {
|
|
23515
|
+
kind: string;
|
|
23516
|
+
value: number[];
|
|
23517
|
+
};
|
|
23518
|
+
};
|
|
23519
|
+
signer?: undefined;
|
|
23520
|
+
} | {
|
|
23521
|
+
name: string;
|
|
23522
|
+
writable: boolean;
|
|
23523
|
+
pda?: undefined;
|
|
23524
|
+
signer?: undefined;
|
|
23525
|
+
} | {
|
|
23526
|
+
name: string;
|
|
23527
|
+
signer: boolean;
|
|
23528
|
+
writable?: undefined;
|
|
23529
|
+
pda?: undefined;
|
|
23530
|
+
} | {
|
|
23531
|
+
name: string;
|
|
23532
|
+
writable?: undefined;
|
|
23533
|
+
pda?: undefined;
|
|
23534
|
+
signer?: undefined;
|
|
23535
|
+
})[];
|
|
23536
|
+
args: {
|
|
23537
|
+
name: string;
|
|
23538
|
+
type: string;
|
|
23539
|
+
}[];
|
|
23540
|
+
})[];
|
|
23541
|
+
accounts: {
|
|
23542
|
+
name: string;
|
|
23543
|
+
discriminator: number[];
|
|
23544
|
+
}[];
|
|
23545
|
+
events: {
|
|
23546
|
+
name: string;
|
|
23547
|
+
discriminator: number[];
|
|
23548
|
+
}[];
|
|
23549
|
+
errors: {
|
|
23550
|
+
code: number;
|
|
23551
|
+
name: string;
|
|
23552
|
+
msg: string;
|
|
23553
|
+
}[];
|
|
23554
|
+
types: ({
|
|
23555
|
+
name: string;
|
|
23556
|
+
serialization: string;
|
|
23557
|
+
repr: {
|
|
23558
|
+
kind: string;
|
|
23559
|
+
};
|
|
23560
|
+
type: {
|
|
23561
|
+
kind: string;
|
|
23562
|
+
fields: {
|
|
23563
|
+
name: string;
|
|
23564
|
+
type: string;
|
|
23565
|
+
}[];
|
|
23566
|
+
};
|
|
23567
|
+
} | {
|
|
23568
|
+
name: string;
|
|
23569
|
+
type: {
|
|
23570
|
+
kind: string;
|
|
23571
|
+
fields: ({
|
|
23572
|
+
name: string;
|
|
23573
|
+
type: string;
|
|
23574
|
+
} | {
|
|
23575
|
+
name: string;
|
|
23576
|
+
type: {
|
|
23577
|
+
array: (string | number)[];
|
|
23578
|
+
};
|
|
23579
|
+
})[];
|
|
23580
|
+
};
|
|
23581
|
+
serialization?: undefined;
|
|
23582
|
+
repr?: undefined;
|
|
23583
|
+
})[];
|
|
23584
|
+
};
|
|
23585
|
+
|
|
23586
|
+
/**
|
|
23587
|
+
* @TODO
|
|
23588
|
+
* @description withdraw funds from the specified pool including accrued rewards
|
|
23589
|
+
* @param signer signer / wallet object
|
|
23590
|
+
* @param options object including pool contract address, user wallet address, and more
|
|
23591
|
+
* @returns claim tx hash
|
|
23592
|
+
*/
|
|
23593
|
+
export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
|
|
23594
|
+
year: string;
|
|
23595
|
+
month: string;
|
|
23596
|
+
day: string;
|
|
23597
|
+
receiverIndex: string;
|
|
23598
|
+
}): Promise<string>;
|
|
23599
|
+
|
|
23600
|
+
export declare enum VaultRedemptionStatus {
|
|
23601
|
+
AWAITING_COOLDOWN = "awaiting_cooldown",
|
|
23602
|
+
READY_TO_CLAIM = "ready_to_claim"
|
|
23603
|
+
}
|
|
23604
|
+
|
|
23605
|
+
/**
|
|
23606
|
+
* Request to redeem vault shares. For EVM-1 vaults this queues a standard
|
|
23607
|
+
* redemption (claimable later via `vaultRedeem`); for EVM-2 vaults this
|
|
23608
|
+
* also handles the receipt-token allowance automatically. Pass
|
|
23609
|
+
* `isInstantRedeem: true` for vaults that support instant settlement.
|
|
23610
|
+
*
|
|
23611
|
+
* Approval of the receipt token (EVM-2) is always waited on before the
|
|
23612
|
+
* redeem call, regardless of the caller's `wait` flag.
|
|
23613
|
+
*
|
|
23614
|
+
* @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
|
|
23615
|
+
* @param options Vault address, wallet, amount, optional `isInstantRedeem`,
|
|
23616
|
+
* optional `wait` to wait for the redeem receipt.
|
|
23617
|
+
* @returns Redeem transaction hash.
|
|
23618
|
+
* @throws AugustValidationError on invalid wallet/target/amount.
|
|
23619
|
+
* @throws AugustSDKError when the redeem submission or on-chain call fails.
|
|
23620
|
+
*
|
|
23621
|
+
* @example
|
|
23622
|
+
* ```ts
|
|
23623
|
+
* const hash = await augustSdk.evm.vaultRequestRedeem({
|
|
23624
|
+
* target: vaultAddress,
|
|
23625
|
+
* wallet: walletAddress,
|
|
23626
|
+
* amount: '10', // 10 shares (UI units)
|
|
23627
|
+
* wait: true,
|
|
23628
|
+
* });
|
|
23629
|
+
* ```
|
|
23630
|
+
*
|
|
23631
|
+
* @example Instant redemption
|
|
23632
|
+
* ```ts
|
|
23633
|
+
* await augustSdk.evm.vaultRequestRedeem({
|
|
23634
|
+
* target: vaultAddress,
|
|
23635
|
+
* wallet: walletAddress,
|
|
23636
|
+
* amount: '10',
|
|
23637
|
+
* isInstantRedeem: true,
|
|
23638
|
+
* });
|
|
23639
|
+
* ```
|
|
23640
|
+
*/
|
|
23641
|
+
export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
|
|
23642
|
+
|
|
23643
|
+
/**
|
|
23644
|
+
* Vault addresses registered on a `SwapRouter` via `enableVault`. The
|
|
23645
|
+
* presence of a vault here is the signal to route its deposits through the
|
|
23646
|
+
* SwapRouter rather than the legacy adapter path.
|
|
23647
|
+
*
|
|
23648
|
+
* Entries mirror the on-chain `vaultInfo[addr].referenceAsset != 0` state of
|
|
23649
|
+
* the `SwapRouter` deployment. Verify against the deployed contract before
|
|
23650
|
+
* adding a new entry — a vault that is not registered on-chain will revert
|
|
23651
|
+
* with `InvalidVault` at deposit time.
|
|
23652
|
+
*
|
|
23653
|
+
* Lowercase comparison is required when checking — use
|
|
23654
|
+
* {@link vaultUsesSwapRouter} rather than reading this set directly.
|
|
23655
|
+
*/
|
|
23656
|
+
export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
|
|
23657
|
+
|
|
23658
|
+
/**
|
|
23659
|
+
* Vault Receipt Symbol Mapping
|
|
23660
|
+
* @deprecated use getVaultMetadata to fetch vault symbols from the backend
|
|
23661
|
+
*/
|
|
23662
|
+
declare type VaultSymbols = 'predlp' | 'sentusd' | 'pregrid' | 'repouscc' | 'earnxrp' | 'tivkbtc' | 'tivusdt0' | 'supermon' | 'earnmon' | 'k3europ' | 'wmon/ausd' | 'wbtc/ausd' | 'earnausd_monad' | 'sausd' | 'farmbold' | 'sentuscc' | 'sentbtc' | 'svusdc' | 'apusdc' | 'testwethtsa' | 'tacusr' | 'upinjusdt' | 'tac-teth' | 'upausd' | 'taccbbtc' | 'xupusdc' | 'uptbtc' | 'gteth' | 'ageth' | 'upusdc' | 'hgeth' | 'upssylva' | 'hbbtc' | 'hbhype' | 'upazt' | 'susdt' | 'upedge' | 'coreusdc' | 'upcusdo' | 'shifteth' | 'upsusde' | 'uplbtc' | 'upavax' | 'tacrseth' | 'musd' | 'earnausd' | 'alpineusdcflagship' | 'alpinecoinshiftusdc' | 'upbtc' | 'upstrbtc' | 'maxiusr' | 'upgammausdc' | 'xhype' | 'wildusd' | 'alpinebtc' | 'prenusd' | 'upyzusd' | 'upnusd' | 'hlpe' | 'nemo eth yield';
|
|
23663
|
+
|
|
23664
|
+
/**
|
|
23665
|
+
* Whether a vault has been registered on a `SwapRouter` and should route
|
|
23666
|
+
* its deposits through it. Address comparison is case-insensitive.
|
|
23667
|
+
*
|
|
23668
|
+
* @param vaultAddress - August vault address.
|
|
23669
|
+
* @returns `true` when the vault is in {@link VAULTS_USING_SWAP_ROUTER}.
|
|
23670
|
+
*/
|
|
23671
|
+
export declare function vaultUsesSwapRouter(vaultAddress: IAddress): boolean;
|
|
23672
|
+
|
|
23673
|
+
export declare function verifyAugustKey(key: string): Promise<boolean>;
|
|
23674
|
+
|
|
23675
|
+
export declare function verifyInfuraKey(key: string): Promise<boolean>;
|
|
23676
|
+
|
|
23677
|
+
/**
|
|
23678
|
+
* Convert a viem WalletClient to an ethers-compatible Signer
|
|
23679
|
+
* Uses the walletClient as a provider and wraps it for ethers compatibility
|
|
23680
|
+
* @param walletClient Viem WalletClient from wagmi or viem
|
|
23681
|
+
* @returns Ethers Signer that can be used with the SDK
|
|
23682
|
+
*/
|
|
23683
|
+
export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
|
|
23684
|
+
|
|
23685
|
+
/**
|
|
23686
|
+
* @param walletClient a wagmi-derived client (from useWalletClient)
|
|
23687
|
+
* @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
|
|
23688
|
+
*/
|
|
23689
|
+
export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
|
|
23690
|
+
|
|
23691
|
+
export declare const WEBSERVER_ENDPOINTS: {
|
|
23692
|
+
default: {
|
|
23693
|
+
hello: string;
|
|
23694
|
+
protected: string;
|
|
23695
|
+
};
|
|
23696
|
+
auth: {
|
|
23697
|
+
verify: string;
|
|
23698
|
+
sign: string;
|
|
23699
|
+
login: string;
|
|
23700
|
+
nonce: string;
|
|
23701
|
+
refresh: string;
|
|
23702
|
+
};
|
|
23703
|
+
subaccount: {
|
|
23704
|
+
rewards: (subaccount: IAddress) => string;
|
|
23705
|
+
tokens: (subaccount: IAddress) => string;
|
|
23706
|
+
twap: {
|
|
23707
|
+
create: (subaccount: IAddress) => string;
|
|
23708
|
+
stop: (subaccount: IAddress, id: string) => string;
|
|
23709
|
+
fills: (subaccount: IAddress, id: string) => string;
|
|
23710
|
+
};
|
|
23711
|
+
debank: (subaccount: IAddress) => string;
|
|
23712
|
+
health_factor: (subaccount: IAddress) => string;
|
|
23713
|
+
summary: (subaccount: IAddress) => string;
|
|
23714
|
+
batch: (subaccount: IAddress) => string;
|
|
23715
|
+
loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
|
|
23716
|
+
cefi: (subaccount: IAddress) => string;
|
|
23717
|
+
otc_positions: (subaccount: IAddress) => string;
|
|
23718
|
+
_: (subaccount: IAddress) => string;
|
|
23719
|
+
};
|
|
23720
|
+
users: {
|
|
23721
|
+
get: string;
|
|
23722
|
+
};
|
|
23723
|
+
prices: (symbol: string) => string;
|
|
23724
|
+
metrics: {
|
|
23725
|
+
pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
|
|
23726
|
+
};
|
|
23727
|
+
public: {
|
|
23728
|
+
integrations: {
|
|
23729
|
+
morpho: {
|
|
23730
|
+
apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
|
|
23731
|
+
};
|
|
23732
|
+
};
|
|
23733
|
+
tokenizedVault: {
|
|
23734
|
+
loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
|
|
23735
|
+
subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
|
|
23736
|
+
list: string;
|
|
23737
|
+
byVaultAddress: (vaultAddress: VaultAddress) => string;
|
|
23738
|
+
historicalApy: (vaultAddress: IAddress) => string;
|
|
23739
|
+
historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
|
|
23740
|
+
annualizedApy: (vaultAddress: IAddress) => string;
|
|
23741
|
+
summary: (vaultAddress: IAddress) => string;
|
|
23742
|
+
withdrawals: (chain: string, vaultAddress: IAddress) => string;
|
|
23743
|
+
debank: (vaultAddress: IAddress) => string;
|
|
23744
|
+
userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
|
|
23745
|
+
archivedVaults: string;
|
|
23746
|
+
};
|
|
23747
|
+
points: {
|
|
23748
|
+
byUserAddress: (userAddress: IAddress) => string;
|
|
23749
|
+
register: string;
|
|
23750
|
+
leaderboard: string;
|
|
23751
|
+
};
|
|
23752
|
+
vaults: {
|
|
23753
|
+
pendingRedemptions: (vaultAddress: IAddress) => string;
|
|
23754
|
+
};
|
|
23755
|
+
pnl: {
|
|
23756
|
+
unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
|
|
23757
|
+
unrealizedLatest: string;
|
|
23758
|
+
};
|
|
23759
|
+
};
|
|
23760
|
+
upshift: {
|
|
23761
|
+
vaults: {
|
|
23762
|
+
metadata: string;
|
|
23763
|
+
};
|
|
23764
|
+
};
|
|
23765
|
+
};
|
|
23766
|
+
|
|
23767
|
+
export declare const WEBSERVER_URL: {
|
|
23768
|
+
production: string;
|
|
23769
|
+
staging: string;
|
|
23770
|
+
development: string;
|
|
23771
|
+
localhost: string;
|
|
23772
|
+
qa: string;
|
|
23773
|
+
public: string;
|
|
23774
|
+
upshift: string;
|
|
23775
|
+
};
|
|
23776
|
+
|
|
23777
|
+
/**
|
|
23778
|
+
* Withdrawal request with computed claimable date and current processing status.
|
|
23779
|
+
* The unique identifier is (receiver, claimableDate).
|
|
23780
|
+
*
|
|
23781
|
+
* @interface WithdrawalRequestStatus
|
|
23782
|
+
*/
|
|
23783
|
+
export declare interface WithdrawalRequestStatus {
|
|
23784
|
+
/** Transaction hash of the withdrawal request */
|
|
23785
|
+
transactionHash: string;
|
|
23786
|
+
/** Block timestamp when the withdrawal was requested (seconds, UTC) */
|
|
23787
|
+
requestTimestamp: number;
|
|
23788
|
+
/** Shares amount being redeemed */
|
|
23789
|
+
shares: bigint;
|
|
23790
|
+
/** Receiver address for the withdrawal */
|
|
23791
|
+
receiver: string;
|
|
23792
|
+
/** Computed claimable date in UTC (year, month, day) */
|
|
23793
|
+
claimableDate: {
|
|
23794
|
+
year: number;
|
|
23795
|
+
month: number;
|
|
23796
|
+
day: number;
|
|
23797
|
+
};
|
|
23798
|
+
/** Epoch timestamp when this withdrawal becomes claimable */
|
|
23799
|
+
claimableEpoch: number;
|
|
23800
|
+
/** Current status of the withdrawal */
|
|
23801
|
+
status: 'pending' | 'ready_to_claim' | 'processed';
|
|
23802
|
+
/** Transaction hash of the processing transaction (if processed) */
|
|
23803
|
+
processedTransactionHash?: string;
|
|
23804
|
+
/** Assets received (if processed) */
|
|
23805
|
+
assetsReceived?: bigint;
|
|
23806
|
+
}
|
|
23807
|
+
|
|
23808
|
+
/**
|
|
23809
|
+
* Higher-order function to wrap SDK methods with performance tracking.
|
|
23810
|
+
* Tracks method calls, timing, chain usage, and errors.
|
|
23811
|
+
*
|
|
23812
|
+
* @param methodName - Name of the method being wrapped
|
|
23813
|
+
* @param method - The original async method
|
|
23814
|
+
* @param getChainId - Function to get current chain ID
|
|
23815
|
+
* @returns Wrapped method with tracking
|
|
23816
|
+
*/
|
|
23817
|
+
export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
|
|
23818
|
+
|
|
23819
|
+
/**
|
|
23820
|
+
* Wrap async operations with exponential backoff retry logic.
|
|
23821
|
+
* Retries on network errors with increasing delays between attempts.
|
|
23822
|
+
* @param fn - Async function to execute with retry logic
|
|
23823
|
+
* @param maxRetries - Maximum number of retry attempts
|
|
23824
|
+
* @param baseDelay - Initial delay in milliseconds (doubles each retry)
|
|
23825
|
+
* @param shouldRetry - Custom function to determine if error is retryable
|
|
23826
|
+
* @returns Result of successful function execution
|
|
23827
|
+
* @throws Last error if all retries exhausted
|
|
23828
|
+
*/
|
|
23829
|
+
export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
|
|
23830
|
+
|
|
23831
|
+
/**
|
|
23832
|
+
* Higher-order function to wrap synchronous SDK methods with tracking.
|
|
23833
|
+
* Uses breadcrumbs for tracking since spans require async context.
|
|
23834
|
+
*
|
|
23835
|
+
* @param methodName - Name of the method being wrapped
|
|
23836
|
+
* @param method - The original sync method
|
|
23837
|
+
* @param getChainId - Function to get current chain ID
|
|
23838
|
+
* @returns Wrapped method with tracking
|
|
23839
|
+
*/
|
|
23840
|
+
export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
|
|
23841
|
+
|
|
23842
|
+
export declare const WRAPPER_ADAPTOR: {
|
|
23843
|
+
43114: IAddress;
|
|
23844
|
+
1: IAddress;
|
|
23845
|
+
};
|
|
23846
|
+
|
|
23847
|
+
export { }
|