@augustdigital/sdk 8.6.1 → 8.7.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/lib/adapters/evm/index.d.ts +24 -1
- package/lib/adapters/evm/index.js +26 -0
- package/lib/adapters/solana/vault.actions.d.ts +18 -0
- package/lib/adapters/solana/vault.actions.js +43 -2
- package/lib/core/analytics/method-taxonomy.js +2 -0
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/core/constants/swap-router.d.ts +26 -8
- package/lib/core/constants/swap-router.js +31 -15
- package/lib/core/helpers/swap-router.d.ts +16 -4
- package/lib/core/helpers/swap-router.js +19 -6
- package/lib/main.d.ts +26 -0
- package/lib/main.js +22 -0
- package/lib/modules/vaults/main.d.ts +46 -0
- package/lib/modules/vaults/main.js +71 -0
- package/lib/modules/vaults/write.actions.d.ts +51 -2
- package/lib/modules/vaults/write.actions.js +149 -44
- package/lib/sdk.d.ts +1158 -922
- package/lib/services/subgraph/vaults.d.ts +3 -1
- package/lib/services/subgraph/vaults.js +57 -11
- package/lib/types/vaults.d.ts +37 -0
- package/package.json +1 -1
package/lib/sdk.d.ts
CHANGED
|
@@ -15485,6 +15485,32 @@ declare class AugustSDK extends AugustBase {
|
|
|
15485
15485
|
timestamp: number;
|
|
15486
15486
|
transactionHash: string;
|
|
15487
15487
|
}[]>;
|
|
15488
|
+
/**
|
|
15489
|
+
* Get a vault's deposit/withdrawal activity across every participant.
|
|
15490
|
+
*
|
|
15491
|
+
* The vault-wide counterpart to {@link AugustSDK.getVaultUserHistory} — use
|
|
15492
|
+
* it to answer flow questions ("how many deposits in the last 7 days", "net
|
|
15493
|
+
* flow this week") that point-in-time TVL cannot. Reads from the Goldsky
|
|
15494
|
+
* subgraph, paginated so busy vaults are not truncated; a `sinceTs` window
|
|
15495
|
+
* keeps short lookbacks cheap.
|
|
15496
|
+
* @param props - Vault address, optional chain id, optional `sinceTs`/`untilTs`
|
|
15497
|
+
* Unix-second bounds, and an optional `types` filter.
|
|
15498
|
+
* @returns Array of activity items (oldest-first) with normalized amounts,
|
|
15499
|
+
* actor addresses, event type, and transaction hashes.
|
|
15500
|
+
* @throws If `vault` is not a valid address or no chain id can be resolved.
|
|
15501
|
+
* @example
|
|
15502
|
+
* ```ts
|
|
15503
|
+
* const weekAgo = Math.floor(Date.now() / 1000) - 7 * 86_400;
|
|
15504
|
+
* const items = await sdk.getVaultActivity({ vault, chainId: 143, sinceTs: weekAgo });
|
|
15505
|
+
* ```
|
|
15506
|
+
*/
|
|
15507
|
+
getVaultActivity(props: {
|
|
15508
|
+
vault: IAddress;
|
|
15509
|
+
chainId?: IChainId;
|
|
15510
|
+
sinceTs?: number;
|
|
15511
|
+
untilTs?: number;
|
|
15512
|
+
types?: ('withdraw-request' | 'deposit' | 'withdraw-processed' | 'redeem')[];
|
|
15513
|
+
}): Promise<IVaultUserHistoryItem[]>;
|
|
15488
15514
|
/**
|
|
15489
15515
|
* Get lifetime PnL for a user in a specific vault.
|
|
15490
15516
|
* Calculates realized and unrealized PnL based on deposit/withdrawal history and current position.
|
|
@@ -16110,6 +16136,52 @@ export declare class AugustVaults extends AugustBase {
|
|
|
16110
16136
|
timestamp: number;
|
|
16111
16137
|
transactionHash: string;
|
|
16112
16138
|
}[]>;
|
|
16139
|
+
/**
|
|
16140
|
+
* Fetch a vault's deposit/withdrawal activity across every participant.
|
|
16141
|
+
*
|
|
16142
|
+
* This is the vault-wide counterpart to {@link getUserHistory}: instead of
|
|
16143
|
+
* filtering the subgraph to one wallet, it returns every deposit,
|
|
16144
|
+
* withdrawal-request, and processed-withdrawal event for the pool. Use it to
|
|
16145
|
+
* answer flow questions ("how many deposits in the last 7 days", "net flow
|
|
16146
|
+
* this week") that point-in-time TVL cannot.
|
|
16147
|
+
*
|
|
16148
|
+
* Rows are read from the Goldsky subgraph, paginated internally so busy
|
|
16149
|
+
* vaults are not truncated at the 1000-row page cap. When `sinceTs` is
|
|
16150
|
+
* supplied the reader stops paging once it passes the window boundary, so a
|
|
16151
|
+
* short lookback stays cheap even on high-volume vaults.
|
|
16152
|
+
*
|
|
16153
|
+
* @param params - Query parameters.
|
|
16154
|
+
* @param params.vault - Vault (pool) address to read activity for.
|
|
16155
|
+
* @param params.chainId - Chain id of the vault; falls back to the active
|
|
16156
|
+
* network when omitted. Required for the subgraph lookup.
|
|
16157
|
+
* @param params.sinceTs - Lower bound (inclusive) as a Unix timestamp in
|
|
16158
|
+
* seconds. Events at or after this time are returned.
|
|
16159
|
+
* @param params.untilTs - Upper bound (inclusive) as a Unix timestamp in
|
|
16160
|
+
* seconds. Events at or before this time are returned.
|
|
16161
|
+
* @param params.types - Restrict to a subset of event types (e.g.
|
|
16162
|
+
* `['deposit']`). Returns all types when omitted.
|
|
16163
|
+
* @returns Activity items sorted oldest-first, each with a normalized
|
|
16164
|
+
* `amount`, actor `address`, `type`, and `transactionHash`.
|
|
16165
|
+
* @throws If `vault` is not a valid address, or no chain id can be resolved.
|
|
16166
|
+
* @example
|
|
16167
|
+
* ```ts
|
|
16168
|
+
* const weekAgo = Math.floor(Date.now() / 1000) - 7 * 86_400;
|
|
16169
|
+
* const deposits = await sdk.getVaultActivity({
|
|
16170
|
+
* vault: '0x36eDbF0C834591BFdfCaC0Ef9605528c75c406aA',
|
|
16171
|
+
* chainId: 143,
|
|
16172
|
+
* sinceTs: weekAgo,
|
|
16173
|
+
* types: ['deposit'],
|
|
16174
|
+
* });
|
|
16175
|
+
* console.log(`${deposits.length} deposits in the last 7 days`);
|
|
16176
|
+
* ```
|
|
16177
|
+
*/
|
|
16178
|
+
getVaultActivity({ vault, chainId, sinceTs, untilTs, types, }: {
|
|
16179
|
+
vault: IAddress;
|
|
16180
|
+
chainId?: IChainId;
|
|
16181
|
+
sinceTs?: number;
|
|
16182
|
+
untilTs?: number;
|
|
16183
|
+
types?: IVaultUserHistoryItem['type'][];
|
|
16184
|
+
}): Promise<IVaultUserHistoryItem[]>;
|
|
16113
16185
|
/**
|
|
16114
16186
|
* @function getStakingPositions gets all available reward staking positions
|
|
16115
16187
|
* @param wallet optionally passed user wallet address
|
|
@@ -16692,6 +16764,25 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
16692
16764
|
*/
|
|
16693
16765
|
export declare function depositViaSwapRouter(signer: Signer | Wallet, options: ISwapRouterDirectDepositOptions): Promise<string>;
|
|
16694
16766
|
|
|
16767
|
+
/**
|
|
16768
|
+
* Extract a human- and machine-readable reason from a thrown Solana/Anchor
|
|
16769
|
+
* error.
|
|
16770
|
+
*
|
|
16771
|
+
* Anchor's {@link https://github.com/coral-xyz/anchor `ProgramError`} calls
|
|
16772
|
+
* `super()` with no argument, so its `.message` is the empty string by
|
|
16773
|
+
* construction — the real reason lives on `.msg`/`.code` (and `.toString()`).
|
|
16774
|
+
* `AnchorError` puts it on `.error.errorMessage` / `.error.errorCode.number`.
|
|
16775
|
+
* Reading `.message` directly (as this file used to) therefore rendered
|
|
16776
|
+
* `"Solana deposit failed: "` for every recognized on-chain revert — dropping
|
|
16777
|
+
* the numeric code the team needs to tell "Vault is paused" from
|
|
16778
|
+
* "Insufficient amount" from an account-constraint violation.
|
|
16779
|
+
*
|
|
16780
|
+
* When no reason can be extracted, returns an actionable, user-facing fallback
|
|
16781
|
+
* rather than an "unknown error" admission — the raw throwable is still
|
|
16782
|
+
* preserved on the wrapped error's `cause` and in telemetry for diagnosis.
|
|
16783
|
+
*/
|
|
16784
|
+
declare function describeSolanaError(e: unknown): string;
|
|
16785
|
+
|
|
16695
16786
|
/**
|
|
16696
16787
|
* Get maximum block range for historical queries per chain.
|
|
16697
16788
|
* Prevents RPC timeouts by limiting lookback window.
|
|
@@ -16914,6 +17005,29 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
16914
17005
|
* @returns The transaction hash of the `depositNativeToken` call.
|
|
16915
17006
|
*/
|
|
16916
17007
|
depositNativeViaSwapRouter(options: ISwapRouterNativeDepositOptions): Promise<string>;
|
|
17008
|
+
/**
|
|
17009
|
+
* Deposit into a vault through the on-chain `SwapRouter`, choosing the router
|
|
17010
|
+
* path from `depositAsset` (direct deposit, native wrap, or a swap to the
|
|
17011
|
+
* reference asset). The high-level, explicit counterpart to the SwapRouter
|
|
17012
|
+
* branch inside {@link vaultDeposit} — the caller opts into the router
|
|
17013
|
+
* deliberately, so a native-deposit vault is never accidentally swapped.
|
|
17014
|
+
*
|
|
17015
|
+
* Reads the vault's reference asset + decimals on-chain, resolves the swap
|
|
17016
|
+
* quote and fail-closes on aggregator/whitelist drift, and sends the ERC-20
|
|
17017
|
+
* approval to the SwapRouter when allowance is short.
|
|
17018
|
+
*
|
|
17019
|
+
* @param options - {@link ISwapRouterDepositOptions}.
|
|
17020
|
+
* @returns The transaction hash of the router deposit call.
|
|
17021
|
+
* @throws AugustValidationError on unsupported chain, invalid address, zero
|
|
17022
|
+
* amount, a native deposit into a non-wrapped-native vault, or quote drift.
|
|
17023
|
+
* @example
|
|
17024
|
+
* ```ts
|
|
17025
|
+
* const hash = await augustSdk.evm.swapRouterDeposit({
|
|
17026
|
+
* chainId: 1, vault, depositAsset: USDT, amount: '100', slippageBps: 50,
|
|
17027
|
+
* });
|
|
17028
|
+
* ```
|
|
17029
|
+
*/
|
|
17030
|
+
swapRouterDeposit(options: ISwapRouterDepositOptions): Promise<string>;
|
|
16917
17031
|
/**
|
|
16918
17032
|
* Claim assets from a matured redemption request on a dated-redemption
|
|
16919
17033
|
* (RWA-style) vault. The `year`, `month`, `day`, and `receiverIndex` tuple
|
|
@@ -19555,6 +19669,20 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
19555
19669
|
*/
|
|
19556
19670
|
declare function isStellarAddress(address: string): boolean;
|
|
19557
19671
|
|
|
19672
|
+
/**
|
|
19673
|
+
* Whether a vault is eligible for the any-token `SwapRouter` deposit surface
|
|
19674
|
+
* (the SwapRouter is `enableVault`-ed for it on-chain). Address comparison is
|
|
19675
|
+
* case-insensitive.
|
|
19676
|
+
*
|
|
19677
|
+
* This gates the (flag-controlled) swap-router deposit UI and can fail-fast a
|
|
19678
|
+
* {@link swapRouterDeposit} call. It does **not** affect {@link vaultDeposit},
|
|
19679
|
+
* which is always the native/multiasset/adapter path.
|
|
19680
|
+
*
|
|
19681
|
+
* @param vaultAddress - August vault address.
|
|
19682
|
+
* @returns `true` when the vault is in {@link SWAP_ROUTER_ELIGIBLE_VAULTS}.
|
|
19683
|
+
*/
|
|
19684
|
+
export declare function isSwapRouterEligible(vaultAddress: IAddress): boolean;
|
|
19685
|
+
|
|
19558
19686
|
/** Parameters for building an unsigned Stellar vault deposit transaction. */
|
|
19559
19687
|
declare interface IStellarDepositParams {
|
|
19560
19688
|
contractId: string;
|
|
@@ -19872,6 +20000,44 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
19872
20000
|
wait?: boolean;
|
|
19873
20001
|
}
|
|
19874
20002
|
|
|
20003
|
+
/**
|
|
20004
|
+
* Options for {@link swapRouterDeposit} — the high-level, explicit SwapRouter
|
|
20005
|
+
* deposit entry point. It reads the vault's reference asset and decimals
|
|
20006
|
+
* on-chain, then picks the correct router path from `depositAsset`, so callers
|
|
20007
|
+
* do not hand-build swap legs or pre-resolve decimals themselves.
|
|
20008
|
+
*
|
|
20009
|
+
* Prefer this over relying on the implicit routing inside `vaultDeposit`: here
|
|
20010
|
+
* the caller opts into the SwapRouter deliberately, so a vault is never
|
|
20011
|
+
* silently routed through a swap it does not need — the failure mode that broke
|
|
20012
|
+
* native multi-asset deposits when a multi-asset vault was added to
|
|
20013
|
+
* `VAULTS_USING_SWAP_ROUTER`.
|
|
20014
|
+
*
|
|
20015
|
+
* Unlike {@link ISwapRouterBaseOptions}, `receiver` is optional here and
|
|
20016
|
+
* defaults to the signer's resolved EOA.
|
|
20017
|
+
*/
|
|
20018
|
+
export declare interface ISwapRouterDepositOptions extends Omit<ISwapRouterBaseOptions, 'receiver'> {
|
|
20019
|
+
/**
|
|
20020
|
+
* Token being deposited, held by the signer. Its relationship to the vault's
|
|
20021
|
+
* reference asset selects the router path:
|
|
20022
|
+
* - equals the reference asset → direct router deposit (no swap);
|
|
20023
|
+
* - the zero address → native-token deposit (only when the reference asset
|
|
20024
|
+
* is the chain's wrapped-native token);
|
|
20025
|
+
* - any other ERC-20 → a swap to the reference asset via the chain's
|
|
20026
|
+
* whitelisted DEX aggregator, bundled into the deposit.
|
|
20027
|
+
*/
|
|
20028
|
+
depositAsset: IAddress;
|
|
20029
|
+
/** Amount in `depositAsset`'s smallest unit (decimal string or bigint). */
|
|
20030
|
+
amount: string | bigint;
|
|
20031
|
+
/** Address that receives the minted shares. Defaults to the signer's EOA. */
|
|
20032
|
+
receiver?: IAddress;
|
|
20033
|
+
/**
|
|
20034
|
+
* Max slippage in basis points for the swap leg. Only used when `depositAsset`
|
|
20035
|
+
* differs from the reference asset; passed through to the swap quote, whose
|
|
20036
|
+
* own default applies when omitted.
|
|
20037
|
+
*/
|
|
20038
|
+
slippageBps?: number;
|
|
20039
|
+
}
|
|
20040
|
+
|
|
19875
20041
|
/**
|
|
19876
20042
|
* Options for `depositViaSwapRouter` — direct deposit (no swap) of an
|
|
19877
20043
|
* already-held asset, routed through the SwapRouter so origin/swap-fee
|
|
@@ -22545,6 +22711,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
22545
22711
|
|
|
22546
22712
|
declare namespace SolanaActions {
|
|
22547
22713
|
export {
|
|
22714
|
+
describeSolanaError,
|
|
22548
22715
|
handleSolanaDeposit,
|
|
22549
22716
|
handleSolanaRedeem
|
|
22550
22717
|
}
|
|
@@ -22924,6 +23091,32 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
22924
23091
|
selector: `0x${string}`;
|
|
22925
23092
|
}>>;
|
|
22926
23093
|
|
|
23094
|
+
/**
|
|
23095
|
+
* Vaults whose UI **may offer the any-token SwapRouter deposit surface** —
|
|
23096
|
+
* i.e. the SwapRouter is `enableVault`-ed for them on-chain.
|
|
23097
|
+
*
|
|
23098
|
+
* This is *eligibility metadata only*. It is consumed by:
|
|
23099
|
+
* - the app UI, to decide whether to render the (flag-gated) swap-router
|
|
23100
|
+
* deposit surface for a vault; and
|
|
23101
|
+
* - {@link swapRouterDeposit}, optionally, as a fail-fast eligibility check.
|
|
23102
|
+
*
|
|
23103
|
+
* It is deliberately **NOT** read by {@link vaultDeposit}: `vaultDeposit` is the
|
|
23104
|
+
* native/multiasset/adapter path and never routes through the SwapRouter. That
|
|
23105
|
+
* separation is what stops a natively-accepted asset from being silently
|
|
23106
|
+
* swapped — the regression that implicit auto-routing caused. Any-token swap
|
|
23107
|
+
* deposits are the explicit, opt-in job of {@link swapRouterDeposit}.
|
|
23108
|
+
*
|
|
23109
|
+
* Membership requires the vault to be registered on-chain
|
|
23110
|
+
* (`vaultInfo[addr].referenceAsset != 0`) — an unregistered vault reverts with
|
|
23111
|
+
* `InvalidVault` at deposit time. A listed vault's natively-accepted assets
|
|
23112
|
+
* (for a multi-asset vault, its whole deposit-asset set) still deposit via
|
|
23113
|
+
* `vaultDeposit`; only tokens OUTSIDE that set go through `swapRouterDeposit`.
|
|
23114
|
+
*
|
|
23115
|
+
* Lowercase comparison is required when checking — use
|
|
23116
|
+
* {@link isSwapRouterEligible} rather than reading this set directly.
|
|
23117
|
+
*/
|
|
23118
|
+
export declare const SWAP_ROUTER_ELIGIBLE_VAULTS: ReadonlySet<string>;
|
|
23119
|
+
|
|
22927
23120
|
/**
|
|
22928
23121
|
* Maximum number of swap legs the contract accepts in a single
|
|
22929
23122
|
* `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading
|
|
@@ -22987,930 +23180,973 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
22987
23180
|
export declare function swapAndDeposit(signer: Signer | Wallet, options: ISwapAndDepositOptions): Promise<string>;
|
|
22988
23181
|
|
|
22989
23182
|
/**
|
|
22990
|
-
*
|
|
22991
|
-
* the
|
|
22992
|
-
*
|
|
22993
|
-
*
|
|
22994
|
-
* Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
|
|
22995
|
-
* constants exactly. Set by an admin per-vault via `enableVault` and looked
|
|
22996
|
-
* up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
|
|
22997
|
-
* this — the router resolves it internally.
|
|
22998
|
-
*/
|
|
22999
|
-
export declare enum SwapRouterVaultType {
|
|
23000
|
-
ERC4626 = 1,
|
|
23001
|
-
TokenizedVaultV2 = 2
|
|
23002
|
-
}
|
|
23003
|
-
|
|
23004
|
-
/**
|
|
23005
|
-
* Table of Contents
|
|
23006
|
-
* - Formatters
|
|
23007
|
-
* - Datetime
|
|
23008
|
-
* - Arrays
|
|
23009
|
-
* - Caching
|
|
23010
|
-
*/
|
|
23011
|
-
export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
|
|
23012
|
-
|
|
23013
|
-
/**
|
|
23014
|
-
* Formatters
|
|
23015
|
-
*/
|
|
23016
|
-
export declare function toTitleCase(str: string, type?: 'camel'): string;
|
|
23017
|
-
|
|
23018
|
-
/**
|
|
23019
|
-
* Track API response times and status.
|
|
23183
|
+
* Deposit into an August vault through the on-chain `SwapRouter`, selecting the
|
|
23184
|
+
* correct router path from the deposit asset. This is the high-level, explicit
|
|
23185
|
+
* counterpart to the SwapRouter branch inside {@link vaultDeposit}.
|
|
23020
23186
|
*
|
|
23021
|
-
*
|
|
23022
|
-
*
|
|
23023
|
-
*
|
|
23024
|
-
*
|
|
23025
|
-
*
|
|
23026
|
-
|
|
23027
|
-
|
|
23028
|
-
|
|
23029
|
-
/**
|
|
23030
|
-
* Track chain/network switches for usage distribution analysis.
|
|
23187
|
+
* Where `vaultDeposit` decides whether to use the SwapRouter from the
|
|
23188
|
+
* `VAULTS_USING_SWAP_ROUTER` allowlist, this function always routes through the
|
|
23189
|
+
* SwapRouter because the caller asked it to. Making the intent explicit is the
|
|
23190
|
+
* point: a native-deposit vault (e.g. a multi-asset Tokenized Vault V2 whose
|
|
23191
|
+
* non-reference assets are accepted directly) is never accidentally swapped —
|
|
23192
|
+
* the regression that implicit, allowlist-driven routing caused. Use
|
|
23193
|
+
* `vaultDeposit` for native / adapter deposits and this for SwapRouter deposits.
|
|
23031
23194
|
*
|
|
23032
|
-
*
|
|
23033
|
-
|
|
23034
|
-
|
|
23035
|
-
|
|
23036
|
-
|
|
23037
|
-
|
|
23038
|
-
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
*
|
|
23042
|
-
* Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
|
|
23043
|
-
* checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
|
|
23044
|
-
* would throw). Add an address here to drop its `latest_reported_tvl` from
|
|
23045
|
-
* the headline number — e.g. closed pre-deposit vaults, test vaults, or
|
|
23046
|
-
* migrated v1 pools that are double-counted by a v2 successor.
|
|
23047
|
-
*/
|
|
23048
|
-
export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
|
|
23049
|
-
|
|
23050
|
-
/**
|
|
23051
|
-
* Validity window for a submitted Soroban invocation (seconds).
|
|
23195
|
+
* The vault's reference asset and its decimals are read on-chain (never trusted
|
|
23196
|
+
* from the caller — a wrong reference asset would mis-route the swap). The path
|
|
23197
|
+
* is then chosen from `depositAsset`:
|
|
23198
|
+
* - equals the reference asset → direct router deposit, no swap
|
|
23199
|
+
* ({@link depositViaSwapRouter});
|
|
23200
|
+
* - the zero address → native-token deposit ({@link depositNativeViaSwapRouter}),
|
|
23201
|
+
* valid only when the reference asset is the chain's wrapped-native token;
|
|
23202
|
+
* - any other ERC-20 → a swap to the reference asset (Paraswap quote pinned to
|
|
23203
|
+
* the chain's whitelisted aggregator, fail-closed on router/selector drift)
|
|
23204
|
+
* bundled into {@link swapAndDeposit}.
|
|
23052
23205
|
*
|
|
23053
|
-
*
|
|
23054
|
-
*
|
|
23055
|
-
*
|
|
23056
|
-
* and institutional approval flows (e.g. Fordefi) that don't sign instantly.
|
|
23057
|
-
* 10 minutes comfortably covers those while staying well inside the Soroban
|
|
23058
|
-
* footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
|
|
23206
|
+
* Side effects: reads tokenized-vault metadata, the vault's reference asset and
|
|
23207
|
+
* decimals, and (on the swap path) one Paraswap quote; sends one ERC-20
|
|
23208
|
+
* `approve` to the SwapRouter when allowance is short, then the deposit tx.
|
|
23059
23209
|
*
|
|
23060
|
-
*
|
|
23061
|
-
*
|
|
23062
|
-
*
|
|
23063
|
-
|
|
23064
|
-
|
|
23065
|
-
|
|
23066
|
-
|
|
23067
|
-
|
|
23068
|
-
|
|
23069
|
-
|
|
23070
|
-
*
|
|
23071
|
-
*
|
|
23072
|
-
*
|
|
23073
|
-
|
|
23074
|
-
|
|
23075
|
-
|
|
23076
|
-
*
|
|
23077
|
-
*
|
|
23078
|
-
*
|
|
23079
|
-
|
|
23080
|
-
getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
|
|
23081
|
-
/**
|
|
23082
|
-
* All the Events available on this contract.
|
|
23083
|
-
*/
|
|
23084
|
-
filters: {
|
|
23085
|
-
[EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
|
|
23086
|
-
};
|
|
23087
|
-
};
|
|
23088
|
-
|
|
23089
|
-
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']>>>> {
|
|
23090
|
-
(...args: [...TEventArgs]): DeferredTopicFilter;
|
|
23091
|
-
/**
|
|
23092
|
-
* The name of the Contract event.
|
|
23093
|
-
*/
|
|
23094
|
-
name: TEventName;
|
|
23095
|
-
/**
|
|
23096
|
-
* The fragment of the Contract event. This will throw on ambiguous
|
|
23097
|
-
* method names.
|
|
23098
|
-
*/
|
|
23099
|
-
fragment: EventFragment;
|
|
23100
|
-
/**
|
|
23101
|
-
* Returns the fragment constrained by %%args%%. This can be used to
|
|
23102
|
-
* resolve ambiguous event names.
|
|
23103
|
-
*/
|
|
23104
|
-
getFragment(...args: [...TEventArgs]): EventFragment;
|
|
23105
|
-
}
|
|
23106
|
-
|
|
23107
|
-
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>> {
|
|
23108
|
-
(...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
|
|
23109
|
-
/**
|
|
23110
|
-
* The name of the Contract method.
|
|
23210
|
+
* @param signer - ethers `Signer` or `Wallet` that signs the approval + deposit.
|
|
23211
|
+
* @param options - {@link ISwapRouterDepositOptions}.
|
|
23212
|
+
* @returns The transaction hash of the router deposit call.
|
|
23213
|
+
* @throws {@link AugustValidationError} for an unsupported chain (no SwapRouter
|
|
23214
|
+
* deployment), an invalid vault or deposit-asset address, a missing or zero
|
|
23215
|
+
* amount, a native deposit into a non-wrapped-native vault, or drift between
|
|
23216
|
+
* the aggregator quote and the on-chain router whitelist.
|
|
23217
|
+
* @worstCaseRpcCalls 5 on the swap path — tokenized-vault metadata, reference
|
|
23218
|
+
* asset + decimals, deposit-token decimals, the quote, and the allowance read.
|
|
23219
|
+
* @example
|
|
23220
|
+
* ```ts
|
|
23221
|
+
* // USDT deposited into a USDC-reference vault → swapped to USDC en route.
|
|
23222
|
+
* const hash = await augustSdk.evm.swapRouterDeposit({
|
|
23223
|
+
* chainId: 1,
|
|
23224
|
+
* vault: '0xe9b725010a9e419412ed67d0fa5f3a5f40159d32',
|
|
23225
|
+
* depositAsset: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
|
|
23226
|
+
* amount: '100',
|
|
23227
|
+
* slippageBps: 50,
|
|
23228
|
+
* });
|
|
23229
|
+
* ```
|
|
23111
23230
|
*/
|
|
23112
|
-
|
|
23113
|
-
|
|
23114
|
-
|
|
23115
|
-
|
|
23116
|
-
|
|
23117
|
-
|
|
23118
|
-
|
|
23119
|
-
|
|
23120
|
-
|
|
23121
|
-
|
|
23122
|
-
|
|
23123
|
-
|
|
23124
|
-
|
|
23125
|
-
|
|
23126
|
-
|
|
23127
|
-
|
|
23128
|
-
|
|
23129
|
-
|
|
23130
|
-
|
|
23131
|
-
|
|
23132
|
-
|
|
23133
|
-
|
|
23134
|
-
|
|
23135
|
-
|
|
23136
|
-
|
|
23137
|
-
|
|
23138
|
-
|
|
23139
|
-
|
|
23140
|
-
|
|
23141
|
-
|
|
23142
|
-
|
|
23143
|
-
|
|
23144
|
-
|
|
23145
|
-
|
|
23146
|
-
|
|
23147
|
-
|
|
23148
|
-
|
|
23149
|
-
|
|
23150
|
-
|
|
23151
|
-
|
|
23152
|
-
|
|
23153
|
-
|
|
23154
|
-
|
|
23155
|
-
|
|
23156
|
-
|
|
23157
|
-
|
|
23158
|
-
|
|
23159
|
-
|
|
23160
|
-
|
|
23161
|
-
|
|
23162
|
-
|
|
23163
|
-
|
|
23164
|
-
|
|
23165
|
-
|
|
23166
|
-
|
|
23167
|
-
|
|
23168
|
-
|
|
23169
|
-
|
|
23170
|
-
|
|
23171
|
-
|
|
23172
|
-
|
|
23173
|
-
|
|
23174
|
-
|
|
23175
|
-
|
|
23176
|
-
|
|
23177
|
-
|
|
23178
|
-
|
|
23179
|
-
|
|
23180
|
-
|
|
23181
|
-
|
|
23182
|
-
|
|
23183
|
-
|
|
23184
|
-
|
|
23185
|
-
|
|
23186
|
-
|
|
23187
|
-
|
|
23188
|
-
|
|
23189
|
-
|
|
23190
|
-
|
|
23191
|
-
|
|
23192
|
-
|
|
23193
|
-
|
|
23194
|
-
|
|
23195
|
-
|
|
23196
|
-
|
|
23197
|
-
|
|
23198
|
-
|
|
23199
|
-
|
|
23200
|
-
|
|
23201
|
-
|
|
23202
|
-
|
|
23203
|
-
|
|
23204
|
-
|
|
23205
|
-
|
|
23206
|
-
|
|
23207
|
-
|
|
23208
|
-
|
|
23209
|
-
|
|
23210
|
-
|
|
23211
|
-
|
|
23212
|
-
|
|
23213
|
-
|
|
23214
|
-
|
|
23215
|
-
|
|
23216
|
-
|
|
23217
|
-
|
|
23218
|
-
|
|
23219
|
-
|
|
23220
|
-
|
|
23221
|
-
|
|
23222
|
-
|
|
23223
|
-
|
|
23224
|
-
|
|
23225
|
-
|
|
23226
|
-
|
|
23227
|
-
|
|
23228
|
-
|
|
23229
|
-
|
|
23230
|
-
|
|
23231
|
-
|
|
23232
|
-
|
|
23233
|
-
|
|
23234
|
-
|
|
23235
|
-
|
|
23236
|
-
|
|
23237
|
-
|
|
23238
|
-
|
|
23239
|
-
|
|
23240
|
-
|
|
23241
|
-
|
|
23242
|
-
|
|
23243
|
-
|
|
23244
|
-
|
|
23245
|
-
|
|
23246
|
-
|
|
23247
|
-
|
|
23248
|
-
|
|
23249
|
-
|
|
23250
|
-
|
|
23251
|
-
|
|
23252
|
-
|
|
23253
|
-
|
|
23254
|
-
|
|
23255
|
-
|
|
23256
|
-
|
|
23257
|
-
|
|
23258
|
-
|
|
23259
|
-
|
|
23260
|
-
|
|
23261
|
-
|
|
23262
|
-
|
|
23263
|
-
|
|
23264
|
-
|
|
23265
|
-
|
|
23266
|
-
|
|
23267
|
-
|
|
23268
|
-
|
|
23269
|
-
|
|
23270
|
-
|
|
23271
|
-
|
|
23272
|
-
|
|
23273
|
-
|
|
23274
|
-
|
|
23275
|
-
|
|
23276
|
-
|
|
23277
|
-
|
|
23278
|
-
|
|
23279
|
-
|
|
23280
|
-
|
|
23281
|
-
|
|
23282
|
-
|
|
23283
|
-
|
|
23284
|
-
|
|
23285
|
-
|
|
23286
|
-
|
|
23287
|
-
|
|
23288
|
-
|
|
23289
|
-
|
|
23290
|
-
|
|
23291
|
-
|
|
23292
|
-
|
|
23293
|
-
|
|
23294
|
-
|
|
23295
|
-
|
|
23296
|
-
|
|
23297
|
-
|
|
23298
|
-
|
|
23299
|
-
|
|
23300
|
-
|
|
23301
|
-
|
|
23302
|
-
|
|
23303
|
-
|
|
23304
|
-
|
|
23305
|
-
|
|
23306
|
-
|
|
23307
|
-
|
|
23308
|
-
|
|
23309
|
-
|
|
23310
|
-
|
|
23311
|
-
|
|
23312
|
-
|
|
23313
|
-
|
|
23314
|
-
|
|
23315
|
-
|
|
23316
|
-
|
|
23317
|
-
|
|
23318
|
-
|
|
23319
|
-
|
|
23320
|
-
|
|
23321
|
-
|
|
23322
|
-
|
|
23323
|
-
|
|
23324
|
-
|
|
23325
|
-
|
|
23326
|
-
|
|
23327
|
-
|
|
23328
|
-
|
|
23329
|
-
|
|
23330
|
-
|
|
23331
|
-
|
|
23332
|
-
|
|
23333
|
-
|
|
23334
|
-
|
|
23335
|
-
|
|
23336
|
-
|
|
23337
|
-
|
|
23338
|
-
|
|
23339
|
-
|
|
23340
|
-
|
|
23341
|
-
|
|
23342
|
-
|
|
23343
|
-
|
|
23344
|
-
|
|
23345
|
-
|
|
23346
|
-
|
|
23347
|
-
|
|
23348
|
-
|
|
23349
|
-
|
|
23350
|
-
|
|
23351
|
-
|
|
23352
|
-
|
|
23353
|
-
|
|
23354
|
-
|
|
23355
|
-
|
|
23356
|
-
|
|
23357
|
-
|
|
23358
|
-
|
|
23359
|
-
|
|
23360
|
-
|
|
23361
|
-
|
|
23362
|
-
|
|
23363
|
-
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
|
|
23371
|
-
|
|
23372
|
-
|
|
23373
|
-
|
|
23374
|
-
|
|
23375
|
-
|
|
23376
|
-
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
|
|
23380
|
-
|
|
23381
|
-
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
23386
|
-
|
|
23387
|
-
|
|
23388
|
-
|
|
23389
|
-
|
|
23390
|
-
|
|
23391
|
-
|
|
23392
|
-
|
|
23393
|
-
|
|
23394
|
-
|
|
23395
|
-
|
|
23396
|
-
|
|
23397
|
-
|
|
23398
|
-
|
|
23399
|
-
|
|
23400
|
-
|
|
23401
|
-
|
|
23402
|
-
|
|
23403
|
-
|
|
23404
|
-
|
|
23405
|
-
|
|
23406
|
-
|
|
23407
|
-
|
|
23408
|
-
|
|
23409
|
-
|
|
23410
|
-
|
|
23411
|
-
|
|
23412
|
-
|
|
23413
|
-
|
|
23414
|
-
|
|
23415
|
-
|
|
23416
|
-
|
|
23417
|
-
|
|
23418
|
-
|
|
23419
|
-
|
|
23420
|
-
|
|
23421
|
-
|
|
23422
|
-
|
|
23423
|
-
|
|
23424
|
-
|
|
23425
|
-
|
|
23426
|
-
|
|
23427
|
-
|
|
23428
|
-
|
|
23429
|
-
|
|
23430
|
-
|
|
23431
|
-
|
|
23432
|
-
|
|
23433
|
-
|
|
23434
|
-
|
|
23435
|
-
|
|
23436
|
-
|
|
23437
|
-
|
|
23438
|
-
|
|
23439
|
-
|
|
23440
|
-
|
|
23441
|
-
|
|
23442
|
-
|
|
23443
|
-
|
|
23444
|
-
|
|
23445
|
-
|
|
23446
|
-
|
|
23447
|
-
|
|
23448
|
-
|
|
23449
|
-
|
|
23450
|
-
|
|
23451
|
-
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
|
|
23455
|
-
|
|
23456
|
-
|
|
23457
|
-
|
|
23458
|
-
|
|
23459
|
-
|
|
23460
|
-
|
|
23461
|
-
|
|
23462
|
-
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
|
|
23466
|
-
|
|
23467
|
-
|
|
23468
|
-
|
|
23469
|
-
|
|
23470
|
-
|
|
23471
|
-
|
|
23472
|
-
|
|
23473
|
-
|
|
23474
|
-
|
|
23475
|
-
|
|
23476
|
-
|
|
23477
|
-
|
|
23478
|
-
|
|
23479
|
-
|
|
23480
|
-
|
|
23481
|
-
|
|
23482
|
-
|
|
23483
|
-
|
|
23484
|
-
|
|
23485
|
-
|
|
23486
|
-
|
|
23487
|
-
|
|
23488
|
-
|
|
23489
|
-
|
|
23490
|
-
|
|
23491
|
-
|
|
23492
|
-
|
|
23493
|
-
|
|
23494
|
-
|
|
23495
|
-
|
|
23496
|
-
|
|
23497
|
-
|
|
23498
|
-
|
|
23499
|
-
|
|
23500
|
-
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
|
|
23511
|
-
|
|
23512
|
-
|
|
23513
|
-
|
|
23514
|
-
|
|
23515
|
-
|
|
23516
|
-
|
|
23517
|
-
|
|
23518
|
-
|
|
23519
|
-
|
|
23520
|
-
|
|
23521
|
-
|
|
23522
|
-
|
|
23523
|
-
|
|
23524
|
-
|
|
23525
|
-
|
|
23526
|
-
|
|
23527
|
-
|
|
23528
|
-
|
|
23529
|
-
|
|
23530
|
-
|
|
23531
|
-
|
|
23532
|
-
|
|
23533
|
-
|
|
23534
|
-
|
|
23535
|
-
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
|
|
23539
|
-
|
|
23540
|
-
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
|
|
23544
|
-
|
|
23545
|
-
|
|
23546
|
-
|
|
23547
|
-
|
|
23548
|
-
|
|
23549
|
-
|
|
23550
|
-
|
|
23551
|
-
|
|
23552
|
-
|
|
23553
|
-
|
|
23554
|
-
|
|
23555
|
-
|
|
23556
|
-
|
|
23557
|
-
|
|
23558
|
-
|
|
23559
|
-
|
|
23560
|
-
|
|
23561
|
-
|
|
23562
|
-
|
|
23563
|
-
|
|
23564
|
-
|
|
23565
|
-
|
|
23566
|
-
|
|
23567
|
-
|
|
23568
|
-
|
|
23569
|
-
|
|
23570
|
-
|
|
23571
|
-
|
|
23572
|
-
|
|
23573
|
-
|
|
23574
|
-
|
|
23575
|
-
|
|
23576
|
-
|
|
23577
|
-
|
|
23578
|
-
|
|
23579
|
-
|
|
23580
|
-
|
|
23581
|
-
|
|
23582
|
-
|
|
23583
|
-
|
|
23584
|
-
|
|
23585
|
-
|
|
23586
|
-
|
|
23587
|
-
|
|
23588
|
-
|
|
23589
|
-
|
|
23590
|
-
|
|
23591
|
-
|
|
23592
|
-
|
|
23593
|
-
|
|
23594
|
-
|
|
23595
|
-
|
|
23596
|
-
|
|
23597
|
-
|
|
23598
|
-
|
|
23599
|
-
|
|
23600
|
-
|
|
23601
|
-
|
|
23602
|
-
|
|
23603
|
-
|
|
23604
|
-
|
|
23605
|
-
|
|
23606
|
-
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
|
|
23610
|
-
|
|
23611
|
-
|
|
23612
|
-
|
|
23613
|
-
|
|
23614
|
-
|
|
23615
|
-
|
|
23616
|
-
|
|
23617
|
-
|
|
23618
|
-
|
|
23619
|
-
|
|
23620
|
-
|
|
23621
|
-
|
|
23622
|
-
|
|
23623
|
-
|
|
23624
|
-
|
|
23625
|
-
|
|
23626
|
-
|
|
23627
|
-
|
|
23628
|
-
|
|
23629
|
-
|
|
23630
|
-
|
|
23631
|
-
|
|
23632
|
-
|
|
23633
|
-
|
|
23634
|
-
|
|
23635
|
-
|
|
23636
|
-
|
|
23637
|
-
|
|
23638
|
-
|
|
23639
|
-
|
|
23640
|
-
|
|
23641
|
-
|
|
23642
|
-
|
|
23643
|
-
|
|
23644
|
-
|
|
23645
|
-
|
|
23646
|
-
|
|
23647
|
-
|
|
23648
|
-
|
|
23649
|
-
|
|
23650
|
-
|
|
23651
|
-
|
|
23652
|
-
|
|
23653
|
-
|
|
23654
|
-
|
|
23655
|
-
|
|
23656
|
-
|
|
23657
|
-
|
|
23658
|
-
|
|
23659
|
-
|
|
23660
|
-
|
|
23661
|
-
|
|
23662
|
-
|
|
23663
|
-
|
|
23664
|
-
|
|
23665
|
-
|
|
23666
|
-
|
|
23667
|
-
|
|
23668
|
-
|
|
23669
|
-
|
|
23670
|
-
|
|
23671
|
-
|
|
23672
|
-
|
|
23673
|
-
|
|
23674
|
-
|
|
23675
|
-
|
|
23676
|
-
|
|
23677
|
-
|
|
23678
|
-
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
|
|
23683
|
-
|
|
23684
|
-
|
|
23685
|
-
|
|
23686
|
-
|
|
23687
|
-
|
|
23688
|
-
|
|
23689
|
-
|
|
23690
|
-
|
|
23691
|
-
|
|
23692
|
-
|
|
23693
|
-
|
|
23694
|
-
|
|
23695
|
-
|
|
23696
|
-
|
|
23697
|
-
|
|
23698
|
-
|
|
23699
|
-
|
|
23700
|
-
|
|
23701
|
-
|
|
23702
|
-
|
|
23703
|
-
|
|
23704
|
-
|
|
23705
|
-
|
|
23706
|
-
|
|
23707
|
-
|
|
23708
|
-
|
|
23709
|
-
|
|
23710
|
-
|
|
23711
|
-
|
|
23712
|
-
|
|
23713
|
-
|
|
23714
|
-
|
|
23715
|
-
|
|
23716
|
-
|
|
23717
|
-
|
|
23718
|
-
|
|
23719
|
-
|
|
23720
|
-
|
|
23721
|
-
|
|
23722
|
-
|
|
23723
|
-
|
|
23724
|
-
|
|
23725
|
-
|
|
23726
|
-
|
|
23727
|
-
|
|
23728
|
-
|
|
23729
|
-
|
|
23730
|
-
|
|
23731
|
-
|
|
23732
|
-
|
|
23733
|
-
|
|
23734
|
-
|
|
23735
|
-
|
|
23736
|
-
|
|
23737
|
-
|
|
23738
|
-
|
|
23739
|
-
|
|
23740
|
-
|
|
23741
|
-
|
|
23742
|
-
|
|
23743
|
-
|
|
23744
|
-
|
|
23745
|
-
|
|
23746
|
-
|
|
23747
|
-
|
|
23748
|
-
|
|
23749
|
-
|
|
23750
|
-
|
|
23751
|
-
|
|
23752
|
-
|
|
23753
|
-
|
|
23754
|
-
|
|
23755
|
-
|
|
23756
|
-
|
|
23757
|
-
|
|
23758
|
-
|
|
23759
|
-
|
|
23760
|
-
|
|
23761
|
-
|
|
23762
|
-
|
|
23763
|
-
|
|
23764
|
-
|
|
23765
|
-
|
|
23766
|
-
|
|
23767
|
-
|
|
23768
|
-
|
|
23769
|
-
|
|
23770
|
-
|
|
23771
|
-
|
|
23772
|
-
|
|
23773
|
-
|
|
23774
|
-
|
|
23775
|
-
|
|
23776
|
-
|
|
23777
|
-
|
|
23778
|
-
|
|
23779
|
-
|
|
23780
|
-
|
|
23781
|
-
|
|
23782
|
-
|
|
23783
|
-
|
|
23784
|
-
|
|
23785
|
-
|
|
23786
|
-
|
|
23787
|
-
|
|
23788
|
-
|
|
23789
|
-
|
|
23790
|
-
|
|
23791
|
-
|
|
23792
|
-
|
|
23793
|
-
|
|
23794
|
-
|
|
23795
|
-
|
|
23796
|
-
|
|
23797
|
-
|
|
23798
|
-
|
|
23799
|
-
|
|
23800
|
-
|
|
23801
|
-
|
|
23802
|
-
|
|
23803
|
-
|
|
23804
|
-
|
|
23805
|
-
|
|
23806
|
-
|
|
23807
|
-
|
|
23808
|
-
|
|
23809
|
-
|
|
23810
|
-
|
|
23811
|
-
|
|
23812
|
-
|
|
23813
|
-
|
|
23814
|
-
|
|
23815
|
-
|
|
23816
|
-
|
|
23817
|
-
|
|
23818
|
-
|
|
23819
|
-
|
|
23820
|
-
|
|
23821
|
-
|
|
23822
|
-
|
|
23823
|
-
|
|
23824
|
-
|
|
23825
|
-
|
|
23826
|
-
|
|
23827
|
-
|
|
23828
|
-
|
|
23829
|
-
|
|
23830
|
-
|
|
23831
|
-
|
|
23832
|
-
|
|
23833
|
-
|
|
23834
|
-
|
|
23835
|
-
|
|
23836
|
-
|
|
23837
|
-
|
|
23838
|
-
|
|
23839
|
-
|
|
23840
|
-
|
|
23841
|
-
|
|
23842
|
-
|
|
23843
|
-
|
|
23844
|
-
|
|
23845
|
-
|
|
23846
|
-
|
|
23847
|
-
|
|
23848
|
-
|
|
23849
|
-
|
|
23850
|
-
|
|
23851
|
-
|
|
23852
|
-
|
|
23853
|
-
|
|
23854
|
-
|
|
23855
|
-
|
|
23856
|
-
|
|
23857
|
-
|
|
23858
|
-
|
|
23859
|
-
|
|
23860
|
-
|
|
23861
|
-
|
|
23862
|
-
|
|
23863
|
-
|
|
23864
|
-
|
|
23865
|
-
|
|
23866
|
-
|
|
23867
|
-
|
|
23868
|
-
|
|
23869
|
-
|
|
23870
|
-
|
|
23871
|
-
|
|
23872
|
-
|
|
23873
|
-
|
|
23874
|
-
|
|
23875
|
-
|
|
23876
|
-
|
|
23877
|
-
|
|
23878
|
-
|
|
23879
|
-
|
|
23880
|
-
|
|
23881
|
-
|
|
23882
|
-
|
|
23883
|
-
|
|
23884
|
-
|
|
23885
|
-
|
|
23886
|
-
|
|
23887
|
-
|
|
23888
|
-
|
|
23889
|
-
|
|
23890
|
-
|
|
23891
|
-
|
|
23892
|
-
|
|
23893
|
-
|
|
23894
|
-
|
|
23895
|
-
|
|
23896
|
-
|
|
23897
|
-
|
|
23898
|
-
|
|
23899
|
-
|
|
23900
|
-
|
|
23901
|
-
|
|
23902
|
-
|
|
23903
|
-
|
|
23904
|
-
|
|
23905
|
-
|
|
23906
|
-
|
|
23907
|
-
|
|
23908
|
-
|
|
23909
|
-
|
|
23910
|
-
|
|
23911
|
-
|
|
23912
|
-
|
|
23913
|
-
|
|
23914
|
-
|
|
23915
|
-
|
|
23916
|
-
|
|
23231
|
+
export declare function swapRouterDeposit(signer: Signer | Wallet, options: ISwapRouterDepositOptions): Promise<string>;
|
|
23232
|
+
|
|
23233
|
+
/**
|
|
23234
|
+
* Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
|
|
23235
|
+
* the ERC-4626 (`deposit(uint256, address)`) and multi-asset
|
|
23236
|
+
* (`deposit(address, uint256, address)`) deposit interfaces.
|
|
23237
|
+
*
|
|
23238
|
+
* Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
|
|
23239
|
+
* constants exactly. Set by an admin per-vault via `enableVault` and looked
|
|
23240
|
+
* up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
|
|
23241
|
+
* this — the router resolves it internally.
|
|
23242
|
+
*/
|
|
23243
|
+
export declare enum SwapRouterVaultType {
|
|
23244
|
+
ERC4626 = 1,
|
|
23245
|
+
TokenizedVaultV2 = 2
|
|
23246
|
+
}
|
|
23247
|
+
|
|
23248
|
+
/**
|
|
23249
|
+
* Table of Contents
|
|
23250
|
+
* - Formatters
|
|
23251
|
+
* - Datetime
|
|
23252
|
+
* - Arrays
|
|
23253
|
+
* - Caching
|
|
23254
|
+
*/
|
|
23255
|
+
export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
|
|
23256
|
+
|
|
23257
|
+
/**
|
|
23258
|
+
* Formatters
|
|
23259
|
+
*/
|
|
23260
|
+
export declare function toTitleCase(str: string, type?: 'camel'): string;
|
|
23261
|
+
|
|
23262
|
+
/**
|
|
23263
|
+
* Track API response times and status.
|
|
23264
|
+
*
|
|
23265
|
+
* @param endpoint - The API endpoint called
|
|
23266
|
+
* @param method - HTTP method used
|
|
23267
|
+
* @param startTime - Start timestamp from performance.now()
|
|
23268
|
+
* @param status - HTTP response status code (0 for network errors)
|
|
23269
|
+
* @param server - Server identifier (production, staging, etc.)
|
|
23270
|
+
*/
|
|
23271
|
+
export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
|
|
23272
|
+
|
|
23273
|
+
/**
|
|
23274
|
+
* Track chain/network switches for usage distribution analysis.
|
|
23275
|
+
*
|
|
23276
|
+
* @param chainId - The chain ID being switched to
|
|
23277
|
+
*/
|
|
23278
|
+
export declare function trackNetworkSwitch(chainId: number): void;
|
|
23279
|
+
|
|
23280
|
+
export declare function truncate(s: string, amount?: number): string;
|
|
23281
|
+
|
|
23282
|
+
/* Excluded from this release type: tryRecoverTxHash */
|
|
23283
|
+
|
|
23284
|
+
/**
|
|
23285
|
+
* Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
|
|
23286
|
+
* Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
|
|
23287
|
+
* checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
|
|
23288
|
+
* would throw). Add an address here to drop its `latest_reported_tvl` from
|
|
23289
|
+
* the headline number — e.g. closed pre-deposit vaults, test vaults, or
|
|
23290
|
+
* migrated v1 pools that are double-counted by a v2 successor.
|
|
23291
|
+
*/
|
|
23292
|
+
export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
|
|
23293
|
+
|
|
23294
|
+
/**
|
|
23295
|
+
* Validity window for a submitted Soroban invocation (seconds).
|
|
23296
|
+
*
|
|
23297
|
+
* This becomes the transaction's `maxTime`. Validators reject a tx whose
|
|
23298
|
+
* `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
|
|
23299
|
+
* realistic sign-then-submit path: hardware wallets, careful manual review,
|
|
23300
|
+
* and institutional approval flows (e.g. Fordefi) that don't sign instantly.
|
|
23301
|
+
* 10 minutes comfortably covers those while staying well inside the Soroban
|
|
23302
|
+
* footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
|
|
23303
|
+
*
|
|
23304
|
+
* The window is anchored to the *network* clock (see `getNetworkCloseTime` in
|
|
23305
|
+
* soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
|
|
23306
|
+
* make the deadline expire early.
|
|
23307
|
+
*/
|
|
23308
|
+
declare const TX_TIMEOUT_SECONDS = 600;
|
|
23309
|
+
|
|
23310
|
+
export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
|
|
23311
|
+
[Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
|
|
23312
|
+
} & {
|
|
23313
|
+
/**
|
|
23314
|
+
* Return the function for a given name. This is useful when a contract
|
|
23315
|
+
* method name conflicts with a JavaScript name such as ``prototype`` or
|
|
23316
|
+
* when using a Contract programatically.
|
|
23317
|
+
*/
|
|
23318
|
+
getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
|
|
23319
|
+
/**
|
|
23320
|
+
* Return the event for a given name. This is useful when a contract
|
|
23321
|
+
* event name conflicts with a JavaScript name such as ``prototype`` or
|
|
23322
|
+
* when using a Contract programatically.
|
|
23323
|
+
*/
|
|
23324
|
+
getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
|
|
23325
|
+
/**
|
|
23326
|
+
* All the Events available on this contract.
|
|
23327
|
+
*/
|
|
23328
|
+
filters: {
|
|
23329
|
+
[EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
|
|
23330
|
+
};
|
|
23331
|
+
};
|
|
23332
|
+
|
|
23333
|
+
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']>>>> {
|
|
23334
|
+
(...args: [...TEventArgs]): DeferredTopicFilter;
|
|
23335
|
+
/**
|
|
23336
|
+
* The name of the Contract event.
|
|
23337
|
+
*/
|
|
23338
|
+
name: TEventName;
|
|
23339
|
+
/**
|
|
23340
|
+
* The fragment of the Contract event. This will throw on ambiguous
|
|
23341
|
+
* method names.
|
|
23342
|
+
*/
|
|
23343
|
+
fragment: EventFragment;
|
|
23344
|
+
/**
|
|
23345
|
+
* Returns the fragment constrained by %%args%%. This can be used to
|
|
23346
|
+
* resolve ambiguous event names.
|
|
23347
|
+
*/
|
|
23348
|
+
getFragment(...args: [...TEventArgs]): EventFragment;
|
|
23349
|
+
}
|
|
23350
|
+
|
|
23351
|
+
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>> {
|
|
23352
|
+
(...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
|
|
23353
|
+
/**
|
|
23354
|
+
* The name of the Contract method.
|
|
23355
|
+
*/
|
|
23356
|
+
name: TFunctionName;
|
|
23357
|
+
/**
|
|
23358
|
+
* The fragment of the Contract method. This will throw on ambiguous
|
|
23359
|
+
* method names.
|
|
23360
|
+
*/
|
|
23361
|
+
fragment: TFragment;
|
|
23362
|
+
/**
|
|
23363
|
+
* Returns the fragment constrained by %%args%%. This can be used to
|
|
23364
|
+
* resolve ambiguous method names.
|
|
23365
|
+
*/
|
|
23366
|
+
getFragment(...args: [...TInputArgs]): TFragment;
|
|
23367
|
+
/**
|
|
23368
|
+
* Returns a populated transaction that can be used to perform the
|
|
23369
|
+
* contract method with %%args%%.
|
|
23370
|
+
*/
|
|
23371
|
+
populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
|
|
23372
|
+
/**
|
|
23373
|
+
* Call the contract method with %%args%% and return the value.
|
|
23374
|
+
*
|
|
23375
|
+
* If the return value is a single type, it will be dereferenced and
|
|
23376
|
+
* returned directly, otherwise the full Result will be returned.
|
|
23377
|
+
*/
|
|
23378
|
+
staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
|
|
23379
|
+
/**
|
|
23380
|
+
* Send a transaction for the contract method with %%args%%.
|
|
23381
|
+
*/
|
|
23382
|
+
send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
|
|
23383
|
+
/**
|
|
23384
|
+
* Estimate the gas to send the contract method with %%args%%.
|
|
23385
|
+
*/
|
|
23386
|
+
estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
|
|
23387
|
+
/**
|
|
23388
|
+
* Call the contract method with %%args%% and return the Result
|
|
23389
|
+
* without any dereferencing.
|
|
23390
|
+
*/
|
|
23391
|
+
staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
|
|
23392
|
+
}
|
|
23393
|
+
|
|
23394
|
+
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;
|
|
23395
|
+
|
|
23396
|
+
export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
|
|
23397
|
+
name: TFunction['name'];
|
|
23398
|
+
type: TFunction['type'];
|
|
23399
|
+
inputs: TFunction['inputs'];
|
|
23400
|
+
outputs: TFunction['outputs'];
|
|
23401
|
+
stateMutability: TFunction['stateMutability'];
|
|
23402
|
+
};
|
|
23403
|
+
|
|
23404
|
+
export declare function unixToDate(epoch: number): Date;
|
|
23405
|
+
|
|
23406
|
+
/**
|
|
23407
|
+
* Update the current user identity in Sentry.
|
|
23408
|
+
* Called when wallet address changes.
|
|
23409
|
+
*
|
|
23410
|
+
* @param walletAddress - New wallet address (or undefined to clear)
|
|
23411
|
+
* @param environment - Current environment
|
|
23412
|
+
*/
|
|
23413
|
+
export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
|
|
23414
|
+
|
|
23415
|
+
/* Excluded from this release type: validateAmountPrecision */
|
|
23416
|
+
|
|
23417
|
+
/**
|
|
23418
|
+
* Vault adapter configurations mapping vault addresses to their adapter settings
|
|
23419
|
+
*/
|
|
23420
|
+
export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
|
|
23421
|
+
|
|
23422
|
+
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}`>;
|
|
23423
|
+
|
|
23424
|
+
/**
|
|
23425
|
+
* Hardcoded subaccount addresses for specific vaults allocations
|
|
23426
|
+
*/
|
|
23427
|
+
export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
|
|
23428
|
+
AgoraAUSD: {
|
|
23429
|
+
address: IAddress;
|
|
23430
|
+
subaccount: IAddress;
|
|
23431
|
+
useDebank: boolean;
|
|
23432
|
+
};
|
|
23433
|
+
earnAUSD: {
|
|
23434
|
+
address: IAddress;
|
|
23435
|
+
subaccount: IAddress;
|
|
23436
|
+
useDebank: boolean;
|
|
23437
|
+
};
|
|
23438
|
+
};
|
|
23439
|
+
|
|
23440
|
+
/**
|
|
23441
|
+
* The functions to call on the vault contract
|
|
23442
|
+
* @returns The functions to call
|
|
23443
|
+
*/
|
|
23444
|
+
export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
|
|
23445
|
+
|
|
23446
|
+
export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
|
|
23447
|
+
|
|
23448
|
+
export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
|
|
23449
|
+
|
|
23450
|
+
export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
|
|
23451
|
+
|
|
23452
|
+
/**
|
|
23453
|
+
* Vault Symbols Mapping
|
|
23454
|
+
* @deprecated use getVaultMetadata to fetch vault symbols from the backend
|
|
23455
|
+
*/
|
|
23456
|
+
export declare const VAULT_SYMBOLS: Record<IAddress, string>;
|
|
23457
|
+
|
|
23458
|
+
/**
|
|
23459
|
+
* Vault Symbols Reverse Mapping
|
|
23460
|
+
* @deprecated use getVaultMetadata to fetch vault symbols from the backend
|
|
23461
|
+
*/
|
|
23462
|
+
export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
|
|
23463
|
+
|
|
23464
|
+
/**
|
|
23465
|
+
* Address type for vault contracts across all supported chains.
|
|
23466
|
+
* EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
|
|
23467
|
+
* and Stellar vaults use 56-character base32 addresses (G/C prefix).
|
|
23468
|
+
*
|
|
23469
|
+
* Use this instead of `IAddress` when the address may belong to any chain.
|
|
23470
|
+
*/
|
|
23471
|
+
export declare type VaultAddress = string;
|
|
23472
|
+
|
|
23473
|
+
/**
|
|
23474
|
+
* allowance checks user's current allowance per pool
|
|
23475
|
+
* @param signer - signer / provider object
|
|
23476
|
+
* @param options - object including pool contract address, user wallet address
|
|
23477
|
+
* @returns normalized number object of the user's current allowance
|
|
23478
|
+
*/
|
|
23479
|
+
export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
|
|
23480
|
+
|
|
23481
|
+
/**
|
|
23482
|
+
* Approve a vault (or the appropriate adapter wrapper) to spend a token
|
|
23483
|
+
* ahead of a separate deposit call. Spender routing mirrors
|
|
23484
|
+
* {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
|
|
23485
|
+
* vault). Returns `undefined` when the existing allowance already covers
|
|
23486
|
+
* `amount` **or** when the deposit asset is native.
|
|
23487
|
+
*
|
|
23488
|
+
* @returns Transaction hash when an approval was sent, `undefined` when
|
|
23489
|
+
* the existing allowance already covers `amount` or the deposit asset is
|
|
23490
|
+
* native (no ERC-20 allowance applies). Use {@link approve} for a
|
|
23491
|
+
* discriminated `ApproveResult` if you need to tell those two cases apart.
|
|
23492
|
+
* @throws AugustValidationError on invalid wallet/target/amount.
|
|
23493
|
+
*
|
|
23494
|
+
* @example
|
|
23495
|
+
* ```ts
|
|
23496
|
+
* const hash = await augustSdk.evm.vaultApprove({
|
|
23497
|
+
* target: '0x...', // vault contract address
|
|
23498
|
+
* wallet: walletAddress,
|
|
23499
|
+
* amount: '100', // 100 of the deposit token (UI units)
|
|
23500
|
+
* wait: true, // wait for the approval to confirm
|
|
23501
|
+
* });
|
|
23502
|
+
* if (hash) console.log('approve tx', hash);
|
|
23503
|
+
* // hash === undefined means the on-chain allowance already covers the
|
|
23504
|
+
* // amount, or the deposit asset is native (msg.value, no allowance).
|
|
23505
|
+
* ```
|
|
23506
|
+
*/
|
|
23507
|
+
export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
|
|
23508
|
+
|
|
23509
|
+
/**
|
|
23510
|
+
* Deposit underlying token into the specified vault. Auto-routes to the
|
|
23511
|
+
* correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
|
|
23512
|
+
* Paraswap adapter, native-token wrapper, depositWithPermit) based on the
|
|
23513
|
+
* vault version and `depositAsset`.
|
|
23514
|
+
*
|
|
23515
|
+
* Amounts are encoded against the **deposit token's** decimals, not the
|
|
23516
|
+
* vault's share decimals. The SDK reads the appropriate decimals via the
|
|
23517
|
+
* vault metadata and the asset's ERC-20.
|
|
23518
|
+
*
|
|
23519
|
+
* Approval is handled automatically: if the existing allowance doesn't
|
|
23520
|
+
* cover `amount`, an `approve` is sent and **always waited for** (regardless
|
|
23521
|
+
* of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
|
|
23522
|
+
* of the approval on Monad-style RPCs.
|
|
23523
|
+
*
|
|
23524
|
+
* @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
|
|
23525
|
+
* @param options Vault address, wallet, amount, optional `depositAsset` for
|
|
23526
|
+
* adapter routes, optional `wait` to wait for the deposit receipt.
|
|
23527
|
+
* @returns Deposit transaction hash.
|
|
23528
|
+
* @throws AugustValidationError on invalid wallet/target/amount or missing
|
|
23529
|
+
* adapter config when `depositAsset` differs from the vault underlying.
|
|
23530
|
+
* @throws AugustSDKError when the deposit submission or on-chain call fails.
|
|
23531
|
+
*
|
|
23532
|
+
* @example
|
|
23533
|
+
* ```ts
|
|
23534
|
+
* const hash = await augustSdk.evm.vaultDeposit({
|
|
23535
|
+
* target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
|
|
23536
|
+
* wallet: walletAddress,
|
|
23537
|
+
* amount: '100', // 100 USDC (UI units)
|
|
23538
|
+
* wait: true, // wait for the deposit receipt
|
|
23539
|
+
* });
|
|
23540
|
+
* ```
|
|
23541
|
+
*
|
|
23542
|
+
* @example Adapter deposit (different deposit asset than the vault's underlying)
|
|
23543
|
+
* ```ts
|
|
23544
|
+
* await augustSdk.evm.vaultDeposit({
|
|
23545
|
+
* target: vaultAddress,
|
|
23546
|
+
* wallet: walletAddress,
|
|
23547
|
+
* amount: '0.5',
|
|
23548
|
+
* depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
|
|
23549
|
+
* chainId: 1,
|
|
23550
|
+
* });
|
|
23551
|
+
* ```
|
|
23552
|
+
*/
|
|
23553
|
+
export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
|
|
23554
|
+
|
|
23555
|
+
/**
|
|
23556
|
+
* Check if vault has adapter support
|
|
23557
|
+
*/
|
|
23558
|
+
export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
|
|
23559
|
+
|
|
23560
|
+
declare const vaultIdl: {
|
|
23561
|
+
address: string;
|
|
23562
|
+
metadata: {
|
|
23563
|
+
name: string;
|
|
23564
|
+
version: string;
|
|
23565
|
+
spec: string;
|
|
23566
|
+
description: string;
|
|
23567
|
+
};
|
|
23568
|
+
instructions: ({
|
|
23569
|
+
name: string;
|
|
23570
|
+
docs: string[];
|
|
23571
|
+
discriminator: number[];
|
|
23572
|
+
accounts: ({
|
|
23573
|
+
name: string;
|
|
23574
|
+
writable: boolean;
|
|
23575
|
+
pda: {
|
|
23576
|
+
seeds: {
|
|
23577
|
+
kind: string;
|
|
23578
|
+
value: number[];
|
|
23579
|
+
}[];
|
|
23580
|
+
};
|
|
23581
|
+
signer?: undefined;
|
|
23582
|
+
address?: undefined;
|
|
23583
|
+
} | {
|
|
23584
|
+
name: string;
|
|
23585
|
+
signer: boolean;
|
|
23586
|
+
writable?: undefined;
|
|
23587
|
+
pda?: undefined;
|
|
23588
|
+
address?: undefined;
|
|
23589
|
+
} | {
|
|
23590
|
+
name: string;
|
|
23591
|
+
writable: boolean;
|
|
23592
|
+
pda?: undefined;
|
|
23593
|
+
signer?: undefined;
|
|
23594
|
+
address?: undefined;
|
|
23595
|
+
} | {
|
|
23596
|
+
name: string;
|
|
23597
|
+
address: string;
|
|
23598
|
+
writable?: undefined;
|
|
23599
|
+
pda?: undefined;
|
|
23600
|
+
signer?: undefined;
|
|
23601
|
+
})[];
|
|
23602
|
+
args: any[];
|
|
23603
|
+
} | {
|
|
23604
|
+
name: string;
|
|
23605
|
+
docs: string[];
|
|
23606
|
+
discriminator: number[];
|
|
23607
|
+
accounts: ({
|
|
23608
|
+
name: string;
|
|
23609
|
+
writable: boolean;
|
|
23610
|
+
signer: boolean;
|
|
23611
|
+
docs?: undefined;
|
|
23612
|
+
pda?: undefined;
|
|
23613
|
+
address?: undefined;
|
|
23614
|
+
} | {
|
|
23615
|
+
name: string;
|
|
23616
|
+
docs: string[];
|
|
23617
|
+
writable: boolean;
|
|
23618
|
+
signer: boolean;
|
|
23619
|
+
pda?: undefined;
|
|
23620
|
+
address?: undefined;
|
|
23621
|
+
} | {
|
|
23622
|
+
name: string;
|
|
23623
|
+
docs: string[];
|
|
23624
|
+
writable: boolean;
|
|
23625
|
+
pda: {
|
|
23626
|
+
seeds: {
|
|
23627
|
+
kind: string;
|
|
23628
|
+
value: number[];
|
|
23629
|
+
}[];
|
|
23630
|
+
program?: undefined;
|
|
23631
|
+
};
|
|
23632
|
+
signer?: undefined;
|
|
23633
|
+
address?: undefined;
|
|
23634
|
+
} | {
|
|
23635
|
+
name: string;
|
|
23636
|
+
docs: string[];
|
|
23637
|
+
writable: boolean;
|
|
23638
|
+
signer?: undefined;
|
|
23639
|
+
pda?: undefined;
|
|
23640
|
+
address?: undefined;
|
|
23641
|
+
} | {
|
|
23642
|
+
name: string;
|
|
23643
|
+
writable: boolean;
|
|
23644
|
+
pda: {
|
|
23645
|
+
seeds: ({
|
|
23646
|
+
kind: string;
|
|
23647
|
+
value: number[];
|
|
23648
|
+
path?: undefined;
|
|
23649
|
+
} | {
|
|
23650
|
+
kind: string;
|
|
23651
|
+
path: string;
|
|
23652
|
+
value?: undefined;
|
|
23653
|
+
})[];
|
|
23654
|
+
program: {
|
|
23655
|
+
kind: string;
|
|
23656
|
+
value: number[];
|
|
23657
|
+
};
|
|
23658
|
+
};
|
|
23659
|
+
signer?: undefined;
|
|
23660
|
+
docs?: undefined;
|
|
23661
|
+
address?: undefined;
|
|
23662
|
+
} | {
|
|
23663
|
+
name: string;
|
|
23664
|
+
address: string;
|
|
23665
|
+
writable?: undefined;
|
|
23666
|
+
signer?: undefined;
|
|
23667
|
+
docs?: undefined;
|
|
23668
|
+
pda?: undefined;
|
|
23669
|
+
})[];
|
|
23670
|
+
args: {
|
|
23671
|
+
name: string;
|
|
23672
|
+
type: string;
|
|
23673
|
+
}[];
|
|
23674
|
+
} | {
|
|
23675
|
+
name: string;
|
|
23676
|
+
docs: string[];
|
|
23677
|
+
discriminator: number[];
|
|
23678
|
+
accounts: ({
|
|
23679
|
+
name: string;
|
|
23680
|
+
writable: boolean;
|
|
23681
|
+
pda: {
|
|
23682
|
+
seeds: ({
|
|
23683
|
+
kind: string;
|
|
23684
|
+
value: number[];
|
|
23685
|
+
path?: undefined;
|
|
23686
|
+
} | {
|
|
23687
|
+
kind: string;
|
|
23688
|
+
path: string;
|
|
23689
|
+
value?: undefined;
|
|
23690
|
+
})[];
|
|
23691
|
+
};
|
|
23692
|
+
signer?: undefined;
|
|
23693
|
+
} | {
|
|
23694
|
+
name: string;
|
|
23695
|
+
writable: boolean;
|
|
23696
|
+
pda?: undefined;
|
|
23697
|
+
signer?: undefined;
|
|
23698
|
+
} | {
|
|
23699
|
+
name: string;
|
|
23700
|
+
writable: boolean;
|
|
23701
|
+
signer: boolean;
|
|
23702
|
+
pda?: undefined;
|
|
23703
|
+
} | {
|
|
23704
|
+
name: string;
|
|
23705
|
+
writable?: undefined;
|
|
23706
|
+
pda?: undefined;
|
|
23707
|
+
signer?: undefined;
|
|
23708
|
+
})[];
|
|
23709
|
+
args: {
|
|
23710
|
+
name: string;
|
|
23711
|
+
type: string;
|
|
23712
|
+
}[];
|
|
23713
|
+
} | {
|
|
23714
|
+
name: string;
|
|
23715
|
+
docs: string[];
|
|
23716
|
+
discriminator: number[];
|
|
23717
|
+
accounts: ({
|
|
23718
|
+
name: string;
|
|
23719
|
+
writable: boolean;
|
|
23720
|
+
pda: {
|
|
23721
|
+
seeds: ({
|
|
23722
|
+
kind: string;
|
|
23723
|
+
value: number[];
|
|
23724
|
+
path?: undefined;
|
|
23725
|
+
} | {
|
|
23726
|
+
kind: string;
|
|
23727
|
+
path: string;
|
|
23728
|
+
value?: undefined;
|
|
23729
|
+
})[];
|
|
23730
|
+
};
|
|
23731
|
+
signer?: undefined;
|
|
23732
|
+
address?: undefined;
|
|
23733
|
+
} | {
|
|
23734
|
+
name: string;
|
|
23735
|
+
writable?: undefined;
|
|
23736
|
+
pda?: undefined;
|
|
23737
|
+
signer?: undefined;
|
|
23738
|
+
address?: undefined;
|
|
23739
|
+
} | {
|
|
23740
|
+
name: string;
|
|
23741
|
+
writable: boolean;
|
|
23742
|
+
signer: boolean;
|
|
23743
|
+
pda?: undefined;
|
|
23744
|
+
address?: undefined;
|
|
23745
|
+
} | {
|
|
23746
|
+
name: string;
|
|
23747
|
+
address: string;
|
|
23748
|
+
writable?: undefined;
|
|
23749
|
+
pda?: undefined;
|
|
23750
|
+
signer?: undefined;
|
|
23751
|
+
})[];
|
|
23752
|
+
args: {
|
|
23753
|
+
name: string;
|
|
23754
|
+
type: string;
|
|
23755
|
+
}[];
|
|
23756
|
+
} | {
|
|
23757
|
+
name: string;
|
|
23758
|
+
docs: string[];
|
|
23759
|
+
discriminator: number[];
|
|
23760
|
+
accounts: ({
|
|
23761
|
+
name: string;
|
|
23762
|
+
writable: boolean;
|
|
23763
|
+
pda: {
|
|
23764
|
+
seeds: {
|
|
23765
|
+
kind: string;
|
|
23766
|
+
value: number[];
|
|
23767
|
+
}[];
|
|
23768
|
+
};
|
|
23769
|
+
signer?: undefined;
|
|
23770
|
+
address?: undefined;
|
|
23771
|
+
} | {
|
|
23772
|
+
name: string;
|
|
23773
|
+
signer: boolean;
|
|
23774
|
+
writable?: undefined;
|
|
23775
|
+
pda?: undefined;
|
|
23776
|
+
address?: undefined;
|
|
23777
|
+
} | {
|
|
23778
|
+
name: string;
|
|
23779
|
+
writable: boolean;
|
|
23780
|
+
signer: boolean;
|
|
23781
|
+
pda?: undefined;
|
|
23782
|
+
address?: undefined;
|
|
23783
|
+
} | {
|
|
23784
|
+
name: string;
|
|
23785
|
+
address: string;
|
|
23786
|
+
writable?: undefined;
|
|
23787
|
+
pda?: undefined;
|
|
23788
|
+
signer?: undefined;
|
|
23789
|
+
})[];
|
|
23790
|
+
args: {
|
|
23791
|
+
name: string;
|
|
23792
|
+
type: string;
|
|
23793
|
+
}[];
|
|
23794
|
+
} | {
|
|
23795
|
+
name: string;
|
|
23796
|
+
docs: string[];
|
|
23797
|
+
discriminator: number[];
|
|
23798
|
+
accounts: ({
|
|
23799
|
+
name: string;
|
|
23800
|
+
writable: boolean;
|
|
23801
|
+
pda: {
|
|
23802
|
+
seeds: ({
|
|
23803
|
+
kind: string;
|
|
23804
|
+
value: number[];
|
|
23805
|
+
path?: undefined;
|
|
23806
|
+
} | {
|
|
23807
|
+
kind: string;
|
|
23808
|
+
path: string;
|
|
23809
|
+
value?: undefined;
|
|
23810
|
+
})[];
|
|
23811
|
+
program?: undefined;
|
|
23812
|
+
};
|
|
23813
|
+
signer?: undefined;
|
|
23814
|
+
} | {
|
|
23815
|
+
name: string;
|
|
23816
|
+
writable: boolean;
|
|
23817
|
+
pda: {
|
|
23818
|
+
seeds: ({
|
|
23819
|
+
kind: string;
|
|
23820
|
+
path: string;
|
|
23821
|
+
value?: undefined;
|
|
23822
|
+
} | {
|
|
23823
|
+
kind: string;
|
|
23824
|
+
value: number[];
|
|
23825
|
+
path?: undefined;
|
|
23826
|
+
})[];
|
|
23827
|
+
program: {
|
|
23828
|
+
kind: string;
|
|
23829
|
+
value: number[];
|
|
23830
|
+
};
|
|
23831
|
+
};
|
|
23832
|
+
signer?: undefined;
|
|
23833
|
+
} | {
|
|
23834
|
+
name: string;
|
|
23835
|
+
writable: boolean;
|
|
23836
|
+
pda?: undefined;
|
|
23837
|
+
signer?: undefined;
|
|
23838
|
+
} | {
|
|
23839
|
+
name: string;
|
|
23840
|
+
signer: boolean;
|
|
23841
|
+
writable?: undefined;
|
|
23842
|
+
pda?: undefined;
|
|
23843
|
+
} | {
|
|
23844
|
+
name: string;
|
|
23845
|
+
writable?: undefined;
|
|
23846
|
+
pda?: undefined;
|
|
23847
|
+
signer?: undefined;
|
|
23848
|
+
})[];
|
|
23849
|
+
args: {
|
|
23850
|
+
name: string;
|
|
23851
|
+
type: string;
|
|
23852
|
+
}[];
|
|
23853
|
+
})[];
|
|
23854
|
+
accounts: {
|
|
23855
|
+
name: string;
|
|
23856
|
+
discriminator: number[];
|
|
23857
|
+
}[];
|
|
23858
|
+
events: {
|
|
23859
|
+
name: string;
|
|
23860
|
+
discriminator: number[];
|
|
23861
|
+
}[];
|
|
23862
|
+
errors: {
|
|
23863
|
+
code: number;
|
|
23864
|
+
name: string;
|
|
23865
|
+
msg: string;
|
|
23866
|
+
}[];
|
|
23867
|
+
types: ({
|
|
23868
|
+
name: string;
|
|
23869
|
+
serialization: string;
|
|
23870
|
+
repr: {
|
|
23871
|
+
kind: string;
|
|
23872
|
+
};
|
|
23873
|
+
type: {
|
|
23874
|
+
kind: string;
|
|
23875
|
+
fields: {
|
|
23876
|
+
name: string;
|
|
23877
|
+
type: string;
|
|
23878
|
+
}[];
|
|
23879
|
+
};
|
|
23880
|
+
} | {
|
|
23881
|
+
name: string;
|
|
23882
|
+
type: {
|
|
23883
|
+
kind: string;
|
|
23884
|
+
fields: ({
|
|
23885
|
+
name: string;
|
|
23886
|
+
type: string;
|
|
23887
|
+
} | {
|
|
23888
|
+
name: string;
|
|
23889
|
+
type: {
|
|
23890
|
+
array: (string | number)[];
|
|
23891
|
+
};
|
|
23892
|
+
})[];
|
|
23893
|
+
};
|
|
23894
|
+
serialization?: undefined;
|
|
23895
|
+
repr?: undefined;
|
|
23896
|
+
})[];
|
|
23897
|
+
};
|
|
23898
|
+
|
|
23899
|
+
/**
|
|
23900
|
+
* @TODO
|
|
23901
|
+
* @description withdraw funds from the specified pool including accrued rewards
|
|
23902
|
+
* @param signer signer / wallet object
|
|
23903
|
+
* @param options object including pool contract address, user wallet address, and more
|
|
23904
|
+
* @returns claim tx hash
|
|
23905
|
+
*/
|
|
23906
|
+
export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
|
|
23907
|
+
year: string;
|
|
23908
|
+
month: string;
|
|
23909
|
+
day: string;
|
|
23910
|
+
receiverIndex: string;
|
|
23911
|
+
}): Promise<string>;
|
|
23912
|
+
|
|
23913
|
+
export declare enum VaultRedemptionStatus {
|
|
23914
|
+
AWAITING_COOLDOWN = "awaiting_cooldown",
|
|
23915
|
+
READY_TO_CLAIM = "ready_to_claim"
|
|
23916
|
+
}
|
|
23917
|
+
|
|
23918
|
+
/**
|
|
23919
|
+
* Request to redeem vault shares. For EVM-1 vaults this queues a standard
|
|
23920
|
+
* redemption (claimable later via `vaultRedeem`); for EVM-2 vaults this
|
|
23921
|
+
* also handles the receipt-token allowance automatically. Pass
|
|
23922
|
+
* `isInstantRedeem: true` for vaults that support instant settlement.
|
|
23923
|
+
*
|
|
23924
|
+
* Approval of the receipt token (EVM-2) is always waited on before the
|
|
23925
|
+
* redeem call, regardless of the caller's `wait` flag.
|
|
23926
|
+
*
|
|
23927
|
+
* @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
|
|
23928
|
+
* @param options Vault address, wallet, amount, optional `isInstantRedeem`,
|
|
23929
|
+
* optional `wait` to wait for the redeem receipt.
|
|
23930
|
+
* @returns Redeem transaction hash.
|
|
23931
|
+
* @throws AugustValidationError on invalid wallet/target/amount.
|
|
23932
|
+
* @throws AugustSDKError when the redeem submission or on-chain call fails.
|
|
23933
|
+
*
|
|
23934
|
+
* @example
|
|
23935
|
+
* ```ts
|
|
23936
|
+
* const hash = await augustSdk.evm.vaultRequestRedeem({
|
|
23937
|
+
* target: vaultAddress,
|
|
23938
|
+
* wallet: walletAddress,
|
|
23939
|
+
* amount: '10', // 10 shares (UI units)
|
|
23940
|
+
* wait: true,
|
|
23941
|
+
* });
|
|
23942
|
+
* ```
|
|
23943
|
+
*
|
|
23944
|
+
* @example Instant redemption
|
|
23945
|
+
* ```ts
|
|
23946
|
+
* await augustSdk.evm.vaultRequestRedeem({
|
|
23947
|
+
* target: vaultAddress,
|
|
23948
|
+
* wallet: walletAddress,
|
|
23949
|
+
* amount: '10',
|
|
23950
|
+
* isInstantRedeem: true,
|
|
23951
|
+
* });
|
|
23952
|
+
* ```
|
|
23953
|
+
*/
|
|
23954
|
+
export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
|
|
23955
|
+
|
|
23956
|
+
/**
|
|
23957
|
+
* @deprecated Renamed to {@link SWAP_ROUTER_ELIGIBLE_VAULTS}, and the semantics
|
|
23958
|
+
* changed: this set no longer drives `vaultDeposit` auto-routing (that branch
|
|
23959
|
+
* was removed) — it now only marks vaults whose UI may offer the swap-router
|
|
23960
|
+
* deposit surface. Kept as an alias for one release; migrate to the new name.
|
|
23961
|
+
*/
|
|
23962
|
+
export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
|
|
23963
|
+
|
|
23964
|
+
/**
|
|
23965
|
+
* Vault Receipt Symbol Mapping
|
|
23966
|
+
* @deprecated use getVaultMetadata to fetch vault symbols from the backend
|
|
23967
|
+
*/
|
|
23968
|
+
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';
|
|
23969
|
+
|
|
23970
|
+
/**
|
|
23971
|
+
* @deprecated Renamed to {@link isSwapRouterEligible}. The meaning also changed:
|
|
23972
|
+
* it no longer implies `vaultDeposit` routes the vault through the SwapRouter
|
|
23973
|
+
* (that behavior was removed) — it only reports swap-router *eligibility* for
|
|
23974
|
+
* the opt-in deposit surface. Kept as an alias for one release.
|
|
23975
|
+
*/
|
|
23976
|
+
export declare const vaultUsesSwapRouter: typeof isSwapRouterEligible;
|
|
23977
|
+
|
|
23978
|
+
export declare function verifyAugustKey(key: string): Promise<boolean>;
|
|
23979
|
+
|
|
23980
|
+
export declare function verifyInfuraKey(key: string): Promise<boolean>;
|
|
23981
|
+
|
|
23982
|
+
/**
|
|
23983
|
+
* Convert a viem WalletClient to an ethers-compatible Signer
|
|
23984
|
+
* Uses the walletClient as a provider and wraps it for ethers compatibility
|
|
23985
|
+
* @param walletClient Viem WalletClient from wagmi or viem
|
|
23986
|
+
* @returns Ethers Signer that can be used with the SDK
|
|
23987
|
+
*/
|
|
23988
|
+
export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
|
|
23989
|
+
|
|
23990
|
+
/**
|
|
23991
|
+
* @param walletClient a wagmi-derived client (from useWalletClient)
|
|
23992
|
+
* @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
|
|
23993
|
+
*/
|
|
23994
|
+
export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
|
|
23995
|
+
|
|
23996
|
+
export declare const WEBSERVER_ENDPOINTS: {
|
|
23997
|
+
default: {
|
|
23998
|
+
hello: string;
|
|
23999
|
+
protected: string;
|
|
24000
|
+
};
|
|
24001
|
+
auth: {
|
|
24002
|
+
verify: string;
|
|
24003
|
+
sign: string;
|
|
24004
|
+
login: string;
|
|
24005
|
+
nonce: string;
|
|
24006
|
+
refresh: string;
|
|
24007
|
+
};
|
|
24008
|
+
subaccount: {
|
|
24009
|
+
rewards: (subaccount: IAddress) => string;
|
|
24010
|
+
tokens: (subaccount: IAddress) => string;
|
|
24011
|
+
twap: {
|
|
24012
|
+
create: (subaccount: IAddress) => string;
|
|
24013
|
+
stop: (subaccount: IAddress, id: string) => string;
|
|
24014
|
+
fills: (subaccount: IAddress, id: string) => string;
|
|
24015
|
+
};
|
|
24016
|
+
debank: (subaccount: IAddress) => string;
|
|
24017
|
+
health_factor: (subaccount: IAddress) => string;
|
|
24018
|
+
summary: (subaccount: IAddress) => string;
|
|
24019
|
+
batch: (subaccount: IAddress) => string;
|
|
24020
|
+
loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
|
|
24021
|
+
cefi: (subaccount: IAddress) => string;
|
|
24022
|
+
otc_positions: (subaccount: IAddress) => string;
|
|
24023
|
+
_: (subaccount: IAddress) => string;
|
|
24024
|
+
};
|
|
24025
|
+
users: {
|
|
24026
|
+
get: string;
|
|
24027
|
+
};
|
|
24028
|
+
prices: (symbol: string) => string;
|
|
24029
|
+
metrics: {
|
|
24030
|
+
pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
|
|
24031
|
+
};
|
|
24032
|
+
public: {
|
|
24033
|
+
integrations: {
|
|
24034
|
+
morpho: {
|
|
24035
|
+
apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
|
|
24036
|
+
};
|
|
24037
|
+
};
|
|
24038
|
+
tokenizedVault: {
|
|
24039
|
+
loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
|
|
24040
|
+
subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
|
|
24041
|
+
list: string;
|
|
24042
|
+
byVaultAddress: (vaultAddress: VaultAddress) => string;
|
|
24043
|
+
historicalApy: (vaultAddress: IAddress) => string;
|
|
24044
|
+
historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
|
|
24045
|
+
annualizedApy: (vaultAddress: IAddress) => string;
|
|
24046
|
+
summary: (vaultAddress: IAddress) => string;
|
|
24047
|
+
withdrawals: (chain: string, vaultAddress: IAddress) => string;
|
|
24048
|
+
debank: (vaultAddress: IAddress) => string;
|
|
24049
|
+
userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
|
|
24050
|
+
archivedVaults: string;
|
|
24051
|
+
};
|
|
24052
|
+
points: {
|
|
24053
|
+
byUserAddress: (userAddress: IAddress) => string;
|
|
24054
|
+
register: string;
|
|
24055
|
+
leaderboard: string;
|
|
24056
|
+
};
|
|
24057
|
+
vaults: {
|
|
24058
|
+
pendingRedemptions: (vaultAddress: IAddress) => string;
|
|
24059
|
+
};
|
|
24060
|
+
pnl: {
|
|
24061
|
+
unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
|
|
24062
|
+
unrealizedLatest: string;
|
|
24063
|
+
};
|
|
24064
|
+
};
|
|
24065
|
+
upshift: {
|
|
24066
|
+
vaults: {
|
|
24067
|
+
metadata: string;
|
|
24068
|
+
};
|
|
24069
|
+
};
|
|
24070
|
+
};
|
|
24071
|
+
|
|
24072
|
+
export declare const WEBSERVER_URL: {
|
|
24073
|
+
production: string;
|
|
24074
|
+
staging: string;
|
|
24075
|
+
development: string;
|
|
24076
|
+
localhost: string;
|
|
24077
|
+
qa: string;
|
|
24078
|
+
public: string;
|
|
24079
|
+
upshift: string;
|
|
24080
|
+
};
|
|
24081
|
+
|
|
24082
|
+
/**
|
|
24083
|
+
* Withdrawal request with computed claimable date and current processing status.
|
|
24084
|
+
* The unique identifier is (receiver, claimableDate).
|
|
24085
|
+
*
|
|
24086
|
+
* @interface WithdrawalRequestStatus
|
|
24087
|
+
*/
|
|
24088
|
+
export declare interface WithdrawalRequestStatus {
|
|
24089
|
+
/** Transaction hash of the withdrawal request */
|
|
24090
|
+
transactionHash: string;
|
|
24091
|
+
/** Block timestamp when the withdrawal was requested (seconds, UTC) */
|
|
24092
|
+
requestTimestamp: number;
|
|
24093
|
+
/** Shares amount being redeemed */
|
|
24094
|
+
shares: bigint;
|
|
24095
|
+
/** Receiver address for the withdrawal */
|
|
24096
|
+
receiver: string;
|
|
24097
|
+
/** Computed claimable date in UTC (year, month, day) */
|
|
24098
|
+
claimableDate: {
|
|
24099
|
+
year: number;
|
|
24100
|
+
month: number;
|
|
24101
|
+
day: number;
|
|
24102
|
+
};
|
|
24103
|
+
/** Epoch timestamp when this withdrawal becomes claimable */
|
|
24104
|
+
claimableEpoch: number;
|
|
24105
|
+
/** Current status of the withdrawal */
|
|
24106
|
+
status: 'pending' | 'ready_to_claim' | 'processed';
|
|
24107
|
+
/** Transaction hash of the processing transaction (if processed) */
|
|
24108
|
+
processedTransactionHash?: string;
|
|
24109
|
+
/** Assets received (if processed) */
|
|
24110
|
+
assetsReceived?: bigint;
|
|
24111
|
+
}
|
|
24112
|
+
|
|
24113
|
+
/**
|
|
24114
|
+
* Higher-order function to wrap SDK methods with performance tracking.
|
|
24115
|
+
* Tracks method calls, timing, chain usage, and errors.
|
|
24116
|
+
*
|
|
24117
|
+
* @param methodName - Name of the method being wrapped
|
|
24118
|
+
* @param method - The original async method
|
|
24119
|
+
* @param getChainId - Function to get current chain ID
|
|
24120
|
+
* @returns Wrapped method with tracking
|
|
24121
|
+
*/
|
|
24122
|
+
export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
|
|
24123
|
+
|
|
24124
|
+
/**
|
|
24125
|
+
* Wrap async operations with exponential backoff retry logic.
|
|
24126
|
+
* Retries on network errors with increasing delays between attempts.
|
|
24127
|
+
* @param fn - Async function to execute with retry logic
|
|
24128
|
+
* @param maxRetries - Maximum number of retry attempts
|
|
24129
|
+
* @param baseDelay - Initial delay in milliseconds (doubles each retry)
|
|
24130
|
+
* @param shouldRetry - Custom function to determine if error is retryable
|
|
24131
|
+
* @returns Result of successful function execution
|
|
24132
|
+
* @throws Last error if all retries exhausted
|
|
24133
|
+
*/
|
|
24134
|
+
export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
|
|
24135
|
+
|
|
24136
|
+
/**
|
|
24137
|
+
* Higher-order function to wrap synchronous SDK methods with tracking.
|
|
24138
|
+
* Uses breadcrumbs for tracking since spans require async context.
|
|
24139
|
+
*
|
|
24140
|
+
* @param methodName - Name of the method being wrapped
|
|
24141
|
+
* @param method - The original sync method
|
|
24142
|
+
* @param getChainId - Function to get current chain ID
|
|
24143
|
+
* @returns Wrapped method with tracking
|
|
24144
|
+
*/
|
|
24145
|
+
export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
|
|
24146
|
+
|
|
24147
|
+
export declare const WRAPPER_ADAPTOR: {
|
|
24148
|
+
43114: IAddress;
|
|
24149
|
+
1: IAddress;
|
|
24150
|
+
};
|
|
24151
|
+
|
|
24152
|
+
export { }
|