@augustdigital/sdk 8.6.1 → 8.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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
@@ -17360,7 +17474,29 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17360
17474
  */
17361
17475
  export declare const getDecimals: (provider: IContractRunner, address: IAddress, isVault?: boolean) => Promise<number>;
17362
17476
 
17363
- export declare const getDefaultSubgraphUrl: (network: string, symbol: string) => string;
17477
+ /**
17478
+ * Previously fabricated a Goldsky subgraph URL from the chain name and vault
17479
+ * symbol. That guess is unreliable and produced dead endpoints:
17480
+ * - The path segment `/v1/subgraphs/name/goldsky/` is legacy hosted-service
17481
+ * syntax, not Goldsky's current scheme (cf. {@link SUBGRAPH_VAULT_URLS}).
17482
+ * - The chain name isn't the subgraph slug — ethers reports Citrea's network as
17483
+ * `unknown`, and mainnet as `mainnet` where the subgraph uses `eth`.
17484
+ * - A vault's symbol isn't its subgraph name — e.g. on-chain `EctUSD` vs the
17485
+ * deployed `earn-ctusd`.
17486
+ *
17487
+ * A fabricated URL 404s silently, so a missing subgraph reads as "no data"
17488
+ * rather than an error (this masked the Citrea Earn ctUSD outage). Subgraph URLs
17489
+ * must now come from backend vault metadata (`fetchVaultMetadata → subgraph`).
17490
+ * This returns `undefined` so callers hit their existing "Missing Subgraph"
17491
+ * branch (warn + Slack alert) instead of querying a dead endpoint.
17492
+ *
17493
+ * @param _network - Unused. Kept for call-site compatibility.
17494
+ * @param _symbol - Unused. Kept for call-site compatibility.
17495
+ * @returns `undefined` — the SDK no longer guesses subgraph URLs.
17496
+ * @deprecated Resolve subgraph URLs from `fetchVaultMetadata`; do not rely on a
17497
+ * generated fallback.
17498
+ */
17499
+ export declare const getDefaultSubgraphUrl: (_network: string, _symbol: string) => string | undefined;
17364
17500
 
17365
17501
  /**
17366
17502
  * Fetches the total amount deposited by an address on a whitelist contract
@@ -19555,6 +19691,20 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19555
19691
  */
19556
19692
  declare function isStellarAddress(address: string): boolean;
19557
19693
 
19694
+ /**
19695
+ * Whether a vault is eligible for the any-token `SwapRouter` deposit surface
19696
+ * (the SwapRouter is `enableVault`-ed for it on-chain). Address comparison is
19697
+ * case-insensitive.
19698
+ *
19699
+ * This gates the (flag-controlled) swap-router deposit UI and can fail-fast a
19700
+ * {@link swapRouterDeposit} call. It does **not** affect {@link vaultDeposit},
19701
+ * which is always the native/multiasset/adapter path.
19702
+ *
19703
+ * @param vaultAddress - August vault address.
19704
+ * @returns `true` when the vault is in {@link SWAP_ROUTER_ELIGIBLE_VAULTS}.
19705
+ */
19706
+ export declare function isSwapRouterEligible(vaultAddress: IAddress): boolean;
19707
+
19558
19708
  /** Parameters for building an unsigned Stellar vault deposit transaction. */
19559
19709
  declare interface IStellarDepositParams {
19560
19710
  contractId: string;
@@ -19872,6 +20022,44 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19872
20022
  wait?: boolean;
19873
20023
  }
19874
20024
 
20025
+ /**
20026
+ * Options for {@link swapRouterDeposit} — the high-level, explicit SwapRouter
20027
+ * deposit entry point. It reads the vault's reference asset and decimals
20028
+ * on-chain, then picks the correct router path from `depositAsset`, so callers
20029
+ * do not hand-build swap legs or pre-resolve decimals themselves.
20030
+ *
20031
+ * Prefer this over relying on the implicit routing inside `vaultDeposit`: here
20032
+ * the caller opts into the SwapRouter deliberately, so a vault is never
20033
+ * silently routed through a swap it does not need — the failure mode that broke
20034
+ * native multi-asset deposits when a multi-asset vault was added to
20035
+ * `VAULTS_USING_SWAP_ROUTER`.
20036
+ *
20037
+ * Unlike {@link ISwapRouterBaseOptions}, `receiver` is optional here and
20038
+ * defaults to the signer's resolved EOA.
20039
+ */
20040
+ export declare interface ISwapRouterDepositOptions extends Omit<ISwapRouterBaseOptions, 'receiver'> {
20041
+ /**
20042
+ * Token being deposited, held by the signer. Its relationship to the vault's
20043
+ * reference asset selects the router path:
20044
+ * - equals the reference asset → direct router deposit (no swap);
20045
+ * - the zero address → native-token deposit (only when the reference asset
20046
+ * is the chain's wrapped-native token);
20047
+ * - any other ERC-20 → a swap to the reference asset via the chain's
20048
+ * whitelisted DEX aggregator, bundled into the deposit.
20049
+ */
20050
+ depositAsset: IAddress;
20051
+ /** Amount in `depositAsset`'s smallest unit (decimal string or bigint). */
20052
+ amount: string | bigint;
20053
+ /** Address that receives the minted shares. Defaults to the signer's EOA. */
20054
+ receiver?: IAddress;
20055
+ /**
20056
+ * Max slippage in basis points for the swap leg. Only used when `depositAsset`
20057
+ * differs from the reference asset; passed through to the swap quote, whose
20058
+ * own default applies when omitted.
20059
+ */
20060
+ slippageBps?: number;
20061
+ }
20062
+
19875
20063
  /**
19876
20064
  * Options for `depositViaSwapRouter` — direct deposit (no swap) of an
19877
20065
  * already-held asset, routed through the SwapRouter so origin/swap-fee
@@ -22545,6 +22733,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
22545
22733
 
22546
22734
  declare namespace SolanaActions {
22547
22735
  export {
22736
+ describeSolanaError,
22548
22737
  handleSolanaDeposit,
22549
22738
  handleSolanaRedeem
22550
22739
  }
@@ -22924,6 +23113,32 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
22924
23113
  selector: `0x${string}`;
22925
23114
  }>>;
22926
23115
 
23116
+ /**
23117
+ * Vaults whose UI **may offer the any-token SwapRouter deposit surface** —
23118
+ * i.e. the SwapRouter is `enableVault`-ed for them on-chain.
23119
+ *
23120
+ * This is *eligibility metadata only*. It is consumed by:
23121
+ * - the app UI, to decide whether to render the (flag-gated) swap-router
23122
+ * deposit surface for a vault; and
23123
+ * - {@link swapRouterDeposit}, optionally, as a fail-fast eligibility check.
23124
+ *
23125
+ * It is deliberately **NOT** read by {@link vaultDeposit}: `vaultDeposit` is the
23126
+ * native/multiasset/adapter path and never routes through the SwapRouter. That
23127
+ * separation is what stops a natively-accepted asset from being silently
23128
+ * swapped — the regression that implicit auto-routing caused. Any-token swap
23129
+ * deposits are the explicit, opt-in job of {@link swapRouterDeposit}.
23130
+ *
23131
+ * Membership requires the vault to be registered on-chain
23132
+ * (`vaultInfo[addr].referenceAsset != 0`) — an unregistered vault reverts with
23133
+ * `InvalidVault` at deposit time. A listed vault's natively-accepted assets
23134
+ * (for a multi-asset vault, its whole deposit-asset set) still deposit via
23135
+ * `vaultDeposit`; only tokens OUTSIDE that set go through `swapRouterDeposit`.
23136
+ *
23137
+ * Lowercase comparison is required when checking — use
23138
+ * {@link isSwapRouterEligible} rather than reading this set directly.
23139
+ */
23140
+ export declare const SWAP_ROUTER_ELIGIBLE_VAULTS: ReadonlySet<string>;
23141
+
22927
23142
  /**
22928
23143
  * Maximum number of swap legs the contract accepts in a single
22929
23144
  * `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading
@@ -22987,930 +23202,973 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
22987
23202
  export declare function swapAndDeposit(signer: Signer | Wallet, options: ISwapAndDepositOptions): Promise<string>;
22988
23203
 
22989
23204
  /**
22990
- * Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
22991
- * the ERC-4626 (`deposit(uint256, address)`) and multi-asset
22992
- * (`deposit(address, uint256, address)`) deposit interfaces.
23205
+ * Deposit into an August vault through the on-chain `SwapRouter`, selecting the
23206
+ * correct router path from the deposit asset. This is the high-level, explicit
23207
+ * counterpart to the SwapRouter branch inside {@link vaultDeposit}.
22993
23208
  *
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.
23209
+ * Where `vaultDeposit` decides whether to use the SwapRouter from the
23210
+ * `VAULTS_USING_SWAP_ROUTER` allowlist, this function always routes through the
23211
+ * SwapRouter because the caller asked it to. Making the intent explicit is the
23212
+ * point: a native-deposit vault (e.g. a multi-asset Tokenized Vault V2 whose
23213
+ * non-reference assets are accepted directly) is never accidentally swapped —
23214
+ * the regression that implicit, allowlist-driven routing caused. Use
23215
+ * `vaultDeposit` for native / adapter deposits and this for SwapRouter deposits.
23020
23216
  *
23021
- * @param endpoint - The API endpoint called
23022
- * @param method - HTTP method used
23023
- * @param startTime - Start timestamp from performance.now()
23024
- * @param status - HTTP response status code (0 for network errors)
23025
- * @param server - Server identifier (production, staging, etc.)
23026
- */
23027
- export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
23028
-
23029
- /**
23030
- * Track chain/network switches for usage distribution analysis.
23031
- *
23032
- * @param chainId - The chain ID being switched to
23033
- */
23034
- export declare function trackNetworkSwitch(chainId: number): void;
23035
-
23036
- export declare function truncate(s: string, amount?: number): string;
23037
-
23038
- /* Excluded from this release type: tryRecoverTxHash */
23039
-
23040
- /**
23041
- * Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
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).
23217
+ * The vault's reference asset and its decimals are read on-chain (never trusted
23218
+ * from the caller — a wrong reference asset would mis-route the swap). The path
23219
+ * is then chosen from `depositAsset`:
23220
+ * - equals the reference asset direct router deposit, no swap
23221
+ * ({@link depositViaSwapRouter});
23222
+ * - the zero address → native-token deposit ({@link depositNativeViaSwapRouter}),
23223
+ * valid only when the reference asset is the chain's wrapped-native token;
23224
+ * - any other ERC-20 → a swap to the reference asset (Paraswap quote pinned to
23225
+ * the chain's whitelisted aggregator, fail-closed on router/selector drift)
23226
+ * bundled into {@link swapAndDeposit}.
23052
23227
  *
23053
- * This becomes the transaction's `maxTime`. Validators reject a tx whose
23054
- * `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
23055
- * realistic sign-then-submit path: hardware wallets, careful manual review,
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.
23228
+ * Side effects: reads tokenized-vault metadata, the vault's reference asset and
23229
+ * decimals, and (on the swap path) one Paraswap quote; sends one ERC-20
23230
+ * `approve` to the SwapRouter when allowance is short, then the deposit tx.
23059
23231
  *
23060
- * The window is anchored to the *network* clock (see `getNetworkCloseTime` in
23061
- * soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
23062
- * make the deadline expire early.
23063
- */
23064
- declare const TX_TIMEOUT_SECONDS = 600;
23065
-
23066
- export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
23067
- [Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
23068
- } & {
23069
- /**
23070
- * Return the function for a given name. This is useful when a contract
23071
- * method name conflicts with a JavaScript name such as ``prototype`` or
23072
- * when using a Contract programatically.
23073
- */
23074
- getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
23075
- /**
23076
- * Return the event for a given name. This is useful when a contract
23077
- * event name conflicts with a JavaScript name such as ``prototype`` or
23078
- * when using a Contract programatically.
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.
23232
+ * @param signer - ethers `Signer` or `Wallet` that signs the approval + deposit.
23233
+ * @param options - {@link ISwapRouterDepositOptions}.
23234
+ * @returns The transaction hash of the router deposit call.
23235
+ * @throws {@link AugustValidationError} for an unsupported chain (no SwapRouter
23236
+ * deployment), an invalid vault or deposit-asset address, a missing or zero
23237
+ * amount, a native deposit into a non-wrapped-native vault, or drift between
23238
+ * the aggregator quote and the on-chain router whitelist.
23239
+ * @worstCaseRpcCalls 5 on the swap path — tokenized-vault metadata, reference
23240
+ * asset + decimals, deposit-token decimals, the quote, and the allowance read.
23241
+ * @example
23242
+ * ```ts
23243
+ * // USDT deposited into a USDC-reference vault swapped to USDC en route.
23244
+ * const hash = await augustSdk.evm.swapRouterDeposit({
23245
+ * chainId: 1,
23246
+ * vault: '0xe9b725010a9e419412ed67d0fa5f3a5f40159d32',
23247
+ * depositAsset: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
23248
+ * amount: '100',
23249
+ * slippageBps: 50,
23250
+ * });
23251
+ * ```
23103
23252
  */
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.
23111
- */
23112
- name: TFunctionName;
23113
- /**
23114
- * The fragment of the Contract method. This will throw on ambiguous
23115
- * method names.
23116
- */
23117
- fragment: TFragment;
23118
- /**
23119
- * Returns the fragment constrained by %%args%%. This can be used to
23120
- * resolve ambiguous method names.
23121
- */
23122
- getFragment(...args: [...TInputArgs]): TFragment;
23123
- /**
23124
- * Returns a populated transaction that can be used to perform the
23125
- * contract method with %%args%%.
23126
- */
23127
- populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
23128
- /**
23129
- * Call the contract method with %%args%% and return the value.
23130
- *
23131
- * If the return value is a single type, it will be dereferenced and
23132
- * returned directly, otherwise the full Result will be returned.
23133
- */
23134
- staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
23135
- /**
23136
- * Send a transaction for the contract method with %%args%%.
23137
- */
23138
- send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
23139
- /**
23140
- * Estimate the gas to send the contract method with %%args%%.
23141
- */
23142
- estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
23143
- /**
23144
- * Call the contract method with %%args%% and return the Result
23145
- * without any dereferencing.
23146
- */
23147
- staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
23148
- }
23149
-
23150
- 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;
23151
-
23152
- export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
23153
- name: TFunction['name'];
23154
- type: TFunction['type'];
23155
- inputs: TFunction['inputs'];
23156
- outputs: TFunction['outputs'];
23157
- stateMutability: TFunction['stateMutability'];
23158
- };
23159
-
23160
- export declare function unixToDate(epoch: number): Date;
23161
-
23162
- /**
23163
- * Update the current user identity in Sentry.
23164
- * Called when wallet address changes.
23165
- *
23166
- * @param walletAddress - New wallet address (or undefined to clear)
23167
- * @param environment - Current environment
23168
- */
23169
- export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
23170
-
23171
- /* Excluded from this release type: validateAmountPrecision */
23172
-
23173
- /**
23174
- * Vault adapter configurations mapping vault addresses to their adapter settings
23175
- */
23176
- export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
23177
-
23178
- 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}`>;
23179
-
23180
- /**
23181
- * Hardcoded subaccount addresses for specific vaults allocations
23182
- */
23183
- export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
23184
- AgoraAUSD: {
23185
- address: IAddress;
23186
- subaccount: IAddress;
23187
- useDebank: boolean;
23188
- };
23189
- earnAUSD: {
23190
- address: IAddress;
23191
- subaccount: IAddress;
23192
- useDebank: boolean;
23193
- };
23194
- };
23195
-
23196
- /**
23197
- * The functions to call on the vault contract
23198
- * @returns The functions to call
23199
- */
23200
- export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
23201
-
23202
- export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
23203
-
23204
- export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
23205
-
23206
- export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
23207
-
23208
- /**
23209
- * Vault Symbols Mapping
23210
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23211
- */
23212
- export declare const VAULT_SYMBOLS: Record<IAddress, string>;
23213
-
23214
- /**
23215
- * Vault Symbols Reverse Mapping
23216
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23217
- */
23218
- export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
23219
-
23220
- /**
23221
- * Address type for vault contracts across all supported chains.
23222
- * EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
23223
- * and Stellar vaults use 56-character base32 addresses (G/C prefix).
23224
- *
23225
- * Use this instead of `IAddress` when the address may belong to any chain.
23226
- */
23227
- export declare type VaultAddress = string;
23228
-
23229
- /**
23230
- * allowance checks user's current allowance per pool
23231
- * @param signer - signer / provider object
23232
- * @param options - object including pool contract address, user wallet address
23233
- * @returns normalized number object of the user's current allowance
23234
- */
23235
- export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
23236
-
23237
- /**
23238
- * Approve a vault (or the appropriate adapter wrapper) to spend a token
23239
- * ahead of a separate deposit call. Spender routing mirrors
23240
- * {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
23241
- * vault). Returns `undefined` when the existing allowance already covers
23242
- * `amount` **or** when the deposit asset is native.
23243
- *
23244
- * @returns Transaction hash when an approval was sent, `undefined` when
23245
- * the existing allowance already covers `amount` or the deposit asset is
23246
- * native (no ERC-20 allowance applies). Use {@link approve} for a
23247
- * discriminated `ApproveResult` if you need to tell those two cases apart.
23248
- * @throws AugustValidationError on invalid wallet/target/amount.
23249
- *
23250
- * @example
23251
- * ```ts
23252
- * const hash = await augustSdk.evm.vaultApprove({
23253
- * target: '0x...', // vault contract address
23254
- * wallet: walletAddress,
23255
- * amount: '100', // 100 of the deposit token (UI units)
23256
- * wait: true, // wait for the approval to confirm
23257
- * });
23258
- * if (hash) console.log('approve tx', hash);
23259
- * // hash === undefined means the on-chain allowance already covers the
23260
- * // amount, or the deposit asset is native (msg.value, no allowance).
23261
- * ```
23262
- */
23263
- export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
23264
-
23265
- /**
23266
- * Deposit underlying token into the specified vault. Auto-routes to the
23267
- * correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
23268
- * Paraswap adapter, native-token wrapper, depositWithPermit) based on the
23269
- * vault version and `depositAsset`.
23270
- *
23271
- * Amounts are encoded against the **deposit token's** decimals, not the
23272
- * vault's share decimals. The SDK reads the appropriate decimals via the
23273
- * vault metadata and the asset's ERC-20.
23274
- *
23275
- * Approval is handled automatically: if the existing allowance doesn't
23276
- * cover `amount`, an `approve` is sent and **always waited for** (regardless
23277
- * of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
23278
- * of the approval on Monad-style RPCs.
23279
- *
23280
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23281
- * @param options Vault address, wallet, amount, optional `depositAsset` for
23282
- * adapter routes, optional `wait` to wait for the deposit receipt.
23283
- * @returns Deposit transaction hash.
23284
- * @throws AugustValidationError on invalid wallet/target/amount or missing
23285
- * adapter config when `depositAsset` differs from the vault underlying.
23286
- * @throws AugustSDKError when the deposit submission or on-chain call fails.
23287
- *
23288
- * @example
23289
- * ```ts
23290
- * const hash = await augustSdk.evm.vaultDeposit({
23291
- * target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
23292
- * wallet: walletAddress,
23293
- * amount: '100', // 100 USDC (UI units)
23294
- * wait: true, // wait for the deposit receipt
23295
- * });
23296
- * ```
23297
- *
23298
- * @example Adapter deposit (different deposit asset than the vault's underlying)
23299
- * ```ts
23300
- * await augustSdk.evm.vaultDeposit({
23301
- * target: vaultAddress,
23302
- * wallet: walletAddress,
23303
- * amount: '0.5',
23304
- * depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
23305
- * chainId: 1,
23306
- * });
23307
- * ```
23308
- */
23309
- export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23310
-
23311
- /**
23312
- * Check if vault has adapter support
23313
- */
23314
- export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
23315
-
23316
- declare const vaultIdl: {
23317
- address: string;
23318
- metadata: {
23319
- name: string;
23320
- version: string;
23321
- spec: string;
23322
- description: string;
23323
- };
23324
- instructions: ({
23325
- name: string;
23326
- docs: string[];
23327
- discriminator: number[];
23328
- accounts: ({
23329
- name: string;
23330
- writable: boolean;
23331
- pda: {
23332
- seeds: {
23333
- kind: string;
23334
- value: number[];
23335
- }[];
23336
- };
23337
- signer?: undefined;
23338
- address?: undefined;
23339
- } | {
23340
- name: string;
23341
- signer: boolean;
23342
- writable?: undefined;
23343
- pda?: undefined;
23344
- address?: undefined;
23345
- } | {
23346
- name: string;
23347
- writable: boolean;
23348
- pda?: undefined;
23349
- signer?: undefined;
23350
- address?: undefined;
23351
- } | {
23352
- name: string;
23353
- address: string;
23354
- writable?: undefined;
23355
- pda?: undefined;
23356
- signer?: undefined;
23357
- })[];
23358
- args: any[];
23359
- } | {
23360
- name: string;
23361
- docs: string[];
23362
- discriminator: number[];
23363
- accounts: ({
23364
- name: string;
23365
- writable: boolean;
23366
- signer: boolean;
23367
- docs?: undefined;
23368
- pda?: undefined;
23369
- address?: undefined;
23370
- } | {
23371
- name: string;
23372
- docs: string[];
23373
- writable: boolean;
23374
- signer: boolean;
23375
- pda?: undefined;
23376
- address?: undefined;
23377
- } | {
23378
- name: string;
23379
- docs: string[];
23380
- writable: boolean;
23381
- pda: {
23382
- seeds: {
23383
- kind: string;
23384
- value: number[];
23385
- }[];
23386
- program?: undefined;
23387
- };
23388
- signer?: undefined;
23389
- address?: undefined;
23390
- } | {
23391
- name: string;
23392
- docs: string[];
23393
- writable: boolean;
23394
- signer?: undefined;
23395
- pda?: undefined;
23396
- address?: undefined;
23397
- } | {
23398
- name: string;
23399
- writable: boolean;
23400
- pda: {
23401
- seeds: ({
23402
- kind: string;
23403
- value: number[];
23404
- path?: undefined;
23405
- } | {
23406
- kind: string;
23407
- path: string;
23408
- value?: undefined;
23409
- })[];
23410
- program: {
23411
- kind: string;
23412
- value: number[];
23413
- };
23414
- };
23415
- signer?: undefined;
23416
- docs?: undefined;
23417
- address?: undefined;
23418
- } | {
23419
- name: string;
23420
- address: string;
23421
- writable?: undefined;
23422
- signer?: undefined;
23423
- docs?: undefined;
23424
- pda?: undefined;
23425
- })[];
23426
- args: {
23427
- name: string;
23428
- type: string;
23429
- }[];
23430
- } | {
23431
- name: string;
23432
- docs: string[];
23433
- discriminator: number[];
23434
- accounts: ({
23435
- name: string;
23436
- writable: boolean;
23437
- pda: {
23438
- seeds: ({
23439
- kind: string;
23440
- value: number[];
23441
- path?: undefined;
23442
- } | {
23443
- kind: string;
23444
- path: string;
23445
- value?: undefined;
23446
- })[];
23447
- };
23448
- signer?: undefined;
23449
- } | {
23450
- name: string;
23451
- writable: boolean;
23452
- pda?: undefined;
23453
- signer?: undefined;
23454
- } | {
23455
- name: string;
23456
- writable: boolean;
23457
- signer: boolean;
23458
- pda?: undefined;
23459
- } | {
23460
- name: string;
23461
- writable?: undefined;
23462
- pda?: undefined;
23463
- signer?: undefined;
23464
- })[];
23465
- args: {
23466
- name: string;
23467
- type: string;
23468
- }[];
23469
- } | {
23470
- name: string;
23471
- docs: string[];
23472
- discriminator: number[];
23473
- accounts: ({
23474
- name: string;
23475
- writable: boolean;
23476
- pda: {
23477
- seeds: ({
23478
- kind: string;
23479
- value: number[];
23480
- path?: undefined;
23481
- } | {
23482
- kind: string;
23483
- path: string;
23484
- value?: undefined;
23485
- })[];
23486
- };
23487
- signer?: undefined;
23488
- address?: undefined;
23489
- } | {
23490
- name: string;
23491
- writable?: undefined;
23492
- pda?: undefined;
23493
- signer?: undefined;
23494
- address?: undefined;
23495
- } | {
23496
- name: string;
23497
- writable: boolean;
23498
- signer: boolean;
23499
- pda?: undefined;
23500
- address?: undefined;
23501
- } | {
23502
- name: string;
23503
- address: string;
23504
- writable?: undefined;
23505
- pda?: undefined;
23506
- signer?: undefined;
23507
- })[];
23508
- args: {
23509
- name: string;
23510
- type: string;
23511
- }[];
23512
- } | {
23513
- name: string;
23514
- docs: string[];
23515
- discriminator: number[];
23516
- accounts: ({
23517
- name: string;
23518
- writable: boolean;
23519
- pda: {
23520
- seeds: {
23521
- kind: string;
23522
- value: number[];
23523
- }[];
23524
- };
23525
- signer?: undefined;
23526
- address?: undefined;
23527
- } | {
23528
- name: string;
23529
- signer: boolean;
23530
- writable?: undefined;
23531
- pda?: undefined;
23532
- address?: undefined;
23533
- } | {
23534
- name: string;
23535
- writable: boolean;
23536
- signer: boolean;
23537
- pda?: undefined;
23538
- address?: undefined;
23539
- } | {
23540
- name: string;
23541
- address: string;
23542
- writable?: undefined;
23543
- pda?: undefined;
23544
- signer?: undefined;
23545
- })[];
23546
- args: {
23547
- name: string;
23548
- type: string;
23549
- }[];
23550
- } | {
23551
- name: string;
23552
- docs: string[];
23553
- discriminator: number[];
23554
- accounts: ({
23555
- name: string;
23556
- writable: boolean;
23557
- pda: {
23558
- seeds: ({
23559
- kind: string;
23560
- value: number[];
23561
- path?: undefined;
23562
- } | {
23563
- kind: string;
23564
- path: string;
23565
- value?: undefined;
23566
- })[];
23567
- program?: undefined;
23568
- };
23569
- signer?: undefined;
23570
- } | {
23571
- name: string;
23572
- writable: boolean;
23573
- pda: {
23574
- seeds: ({
23575
- kind: string;
23576
- path: string;
23577
- value?: undefined;
23578
- } | {
23579
- kind: string;
23580
- value: number[];
23581
- path?: undefined;
23582
- })[];
23583
- program: {
23584
- kind: string;
23585
- value: number[];
23586
- };
23587
- };
23588
- signer?: undefined;
23589
- } | {
23590
- name: string;
23591
- writable: boolean;
23592
- pda?: undefined;
23593
- signer?: undefined;
23594
- } | {
23595
- name: string;
23596
- signer: boolean;
23597
- writable?: undefined;
23598
- pda?: undefined;
23599
- } | {
23600
- name: string;
23601
- writable?: undefined;
23602
- pda?: undefined;
23603
- signer?: undefined;
23604
- })[];
23605
- args: {
23606
- name: string;
23607
- type: string;
23608
- }[];
23609
- })[];
23610
- accounts: {
23611
- name: string;
23612
- discriminator: number[];
23613
- }[];
23614
- events: {
23615
- name: string;
23616
- discriminator: number[];
23617
- }[];
23618
- errors: {
23619
- code: number;
23620
- name: string;
23621
- msg: string;
23622
- }[];
23623
- types: ({
23624
- name: string;
23625
- serialization: string;
23626
- repr: {
23627
- kind: string;
23628
- };
23629
- type: {
23630
- kind: string;
23631
- fields: {
23632
- name: string;
23633
- type: string;
23634
- }[];
23635
- };
23636
- } | {
23637
- name: string;
23638
- type: {
23639
- kind: string;
23640
- fields: ({
23641
- name: string;
23642
- type: string;
23643
- } | {
23644
- name: string;
23645
- type: {
23646
- array: (string | number)[];
23647
- };
23648
- })[];
23649
- };
23650
- serialization?: undefined;
23651
- repr?: undefined;
23652
- })[];
23653
- };
23654
-
23655
- /**
23656
- * @TODO
23657
- * @description withdraw funds from the specified pool including accrued rewards
23658
- * @param signer signer / wallet object
23659
- * @param options object including pool contract address, user wallet address, and more
23660
- * @returns claim tx hash
23661
- */
23662
- export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
23663
- year: string;
23664
- month: string;
23665
- day: string;
23666
- receiverIndex: string;
23667
- }): Promise<string>;
23668
-
23669
- export declare enum VaultRedemptionStatus {
23670
- AWAITING_COOLDOWN = "awaiting_cooldown",
23671
- READY_TO_CLAIM = "ready_to_claim"
23672
- }
23673
-
23674
- /**
23675
- * Request to redeem vault shares. For EVM-1 vaults this queues a standard
23676
- * redemption (claimable later via `vaultRedeem`); for EVM-2 vaults this
23677
- * also handles the receipt-token allowance automatically. Pass
23678
- * `isInstantRedeem: true` for vaults that support instant settlement.
23679
- *
23680
- * Approval of the receipt token (EVM-2) is always waited on before the
23681
- * redeem call, regardless of the caller's `wait` flag.
23682
- *
23683
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23684
- * @param options Vault address, wallet, amount, optional `isInstantRedeem`,
23685
- * optional `wait` to wait for the redeem receipt.
23686
- * @returns Redeem transaction hash.
23687
- * @throws AugustValidationError on invalid wallet/target/amount.
23688
- * @throws AugustSDKError when the redeem submission or on-chain call fails.
23689
- *
23690
- * @example
23691
- * ```ts
23692
- * const hash = await augustSdk.evm.vaultRequestRedeem({
23693
- * target: vaultAddress,
23694
- * wallet: walletAddress,
23695
- * amount: '10', // 10 shares (UI units)
23696
- * wait: true,
23697
- * });
23698
- * ```
23699
- *
23700
- * @example Instant redemption
23701
- * ```ts
23702
- * await augustSdk.evm.vaultRequestRedeem({
23703
- * target: vaultAddress,
23704
- * wallet: walletAddress,
23705
- * amount: '10',
23706
- * isInstantRedeem: true,
23707
- * });
23708
- * ```
23709
- */
23710
- export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23711
-
23712
- /**
23713
- * Vault addresses registered on a `SwapRouter` via `enableVault`. The
23714
- * presence of a vault here is the signal to route its deposits through the
23715
- * SwapRouter rather than the legacy adapter path.
23716
- *
23717
- * Entries mirror the on-chain `vaultInfo[addr].referenceAsset != 0` state of
23718
- * the `SwapRouter` deployment. Verify against the deployed contract before
23719
- * adding a new entry — a vault that is not registered on-chain will revert
23720
- * with `InvalidVault` at deposit time.
23721
- *
23722
- * Lowercase comparison is required when checking — use
23723
- * {@link vaultUsesSwapRouter} rather than reading this set directly.
23724
- */
23725
- export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
23726
-
23727
- /**
23728
- * Vault Receipt Symbol Mapping
23729
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23730
- */
23731
- 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';
23732
-
23733
- /**
23734
- * Whether a vault has been registered on a `SwapRouter` and should route
23735
- * its deposits through it. Address comparison is case-insensitive.
23736
- *
23737
- * @param vaultAddress - August vault address.
23738
- * @returns `true` when the vault is in {@link VAULTS_USING_SWAP_ROUTER}.
23739
- */
23740
- export declare function vaultUsesSwapRouter(vaultAddress: IAddress): boolean;
23741
-
23742
- export declare function verifyAugustKey(key: string): Promise<boolean>;
23743
-
23744
- export declare function verifyInfuraKey(key: string): Promise<boolean>;
23745
-
23746
- /**
23747
- * Convert a viem WalletClient to an ethers-compatible Signer
23748
- * Uses the walletClient as a provider and wraps it for ethers compatibility
23749
- * @param walletClient Viem WalletClient from wagmi or viem
23750
- * @returns Ethers Signer that can be used with the SDK
23751
- */
23752
- export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
23753
-
23754
- /**
23755
- * @param walletClient a wagmi-derived client (from useWalletClient)
23756
- * @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
23757
- */
23758
- export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
23759
-
23760
- export declare const WEBSERVER_ENDPOINTS: {
23761
- default: {
23762
- hello: string;
23763
- protected: string;
23764
- };
23765
- auth: {
23766
- verify: string;
23767
- sign: string;
23768
- login: string;
23769
- nonce: string;
23770
- refresh: string;
23771
- };
23772
- subaccount: {
23773
- rewards: (subaccount: IAddress) => string;
23774
- tokens: (subaccount: IAddress) => string;
23775
- twap: {
23776
- create: (subaccount: IAddress) => string;
23777
- stop: (subaccount: IAddress, id: string) => string;
23778
- fills: (subaccount: IAddress, id: string) => string;
23779
- };
23780
- debank: (subaccount: IAddress) => string;
23781
- health_factor: (subaccount: IAddress) => string;
23782
- summary: (subaccount: IAddress) => string;
23783
- batch: (subaccount: IAddress) => string;
23784
- loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
23785
- cefi: (subaccount: IAddress) => string;
23786
- otc_positions: (subaccount: IAddress) => string;
23787
- _: (subaccount: IAddress) => string;
23788
- };
23789
- users: {
23790
- get: string;
23791
- };
23792
- prices: (symbol: string) => string;
23793
- metrics: {
23794
- pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
23795
- };
23796
- public: {
23797
- integrations: {
23798
- morpho: {
23799
- apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
23800
- };
23801
- };
23802
- tokenizedVault: {
23803
- loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
23804
- subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
23805
- list: string;
23806
- byVaultAddress: (vaultAddress: VaultAddress) => string;
23807
- historicalApy: (vaultAddress: IAddress) => string;
23808
- historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
23809
- annualizedApy: (vaultAddress: IAddress) => string;
23810
- summary: (vaultAddress: IAddress) => string;
23811
- withdrawals: (chain: string, vaultAddress: IAddress) => string;
23812
- debank: (vaultAddress: IAddress) => string;
23813
- userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
23814
- archivedVaults: string;
23815
- };
23816
- points: {
23817
- byUserAddress: (userAddress: IAddress) => string;
23818
- register: string;
23819
- leaderboard: string;
23820
- };
23821
- vaults: {
23822
- pendingRedemptions: (vaultAddress: IAddress) => string;
23823
- };
23824
- pnl: {
23825
- unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
23826
- unrealizedLatest: string;
23827
- };
23828
- };
23829
- upshift: {
23830
- vaults: {
23831
- metadata: string;
23832
- };
23833
- };
23834
- };
23835
-
23836
- export declare const WEBSERVER_URL: {
23837
- production: string;
23838
- staging: string;
23839
- development: string;
23840
- localhost: string;
23841
- qa: string;
23842
- public: string;
23843
- upshift: string;
23844
- };
23845
-
23846
- /**
23847
- * Withdrawal request with computed claimable date and current processing status.
23848
- * The unique identifier is (receiver, claimableDate).
23849
- *
23850
- * @interface WithdrawalRequestStatus
23851
- */
23852
- export declare interface WithdrawalRequestStatus {
23853
- /** Transaction hash of the withdrawal request */
23854
- transactionHash: string;
23855
- /** Block timestamp when the withdrawal was requested (seconds, UTC) */
23856
- requestTimestamp: number;
23857
- /** Shares amount being redeemed */
23858
- shares: bigint;
23859
- /** Receiver address for the withdrawal */
23860
- receiver: string;
23861
- /** Computed claimable date in UTC (year, month, day) */
23862
- claimableDate: {
23863
- year: number;
23864
- month: number;
23865
- day: number;
23866
- };
23867
- /** Epoch timestamp when this withdrawal becomes claimable */
23868
- claimableEpoch: number;
23869
- /** Current status of the withdrawal */
23870
- status: 'pending' | 'ready_to_claim' | 'processed';
23871
- /** Transaction hash of the processing transaction (if processed) */
23872
- processedTransactionHash?: string;
23873
- /** Assets received (if processed) */
23874
- assetsReceived?: bigint;
23875
- }
23876
-
23877
- /**
23878
- * Higher-order function to wrap SDK methods with performance tracking.
23879
- * Tracks method calls, timing, chain usage, and errors.
23880
- *
23881
- * @param methodName - Name of the method being wrapped
23882
- * @param method - The original async method
23883
- * @param getChainId - Function to get current chain ID
23884
- * @returns Wrapped method with tracking
23885
- */
23886
- export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
23887
-
23888
- /**
23889
- * Wrap async operations with exponential backoff retry logic.
23890
- * Retries on network errors with increasing delays between attempts.
23891
- * @param fn - Async function to execute with retry logic
23892
- * @param maxRetries - Maximum number of retry attempts
23893
- * @param baseDelay - Initial delay in milliseconds (doubles each retry)
23894
- * @param shouldRetry - Custom function to determine if error is retryable
23895
- * @returns Result of successful function execution
23896
- * @throws Last error if all retries exhausted
23897
- */
23898
- export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
23899
-
23900
- /**
23901
- * Higher-order function to wrap synchronous SDK methods with tracking.
23902
- * Uses breadcrumbs for tracking since spans require async context.
23903
- *
23904
- * @param methodName - Name of the method being wrapped
23905
- * @param method - The original sync method
23906
- * @param getChainId - Function to get current chain ID
23907
- * @returns Wrapped method with tracking
23908
- */
23909
- export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
23910
-
23911
- export declare const WRAPPER_ADAPTOR: {
23912
- 43114: IAddress;
23913
- 1: IAddress;
23914
- };
23915
-
23916
- export { }
23253
+ export declare function swapRouterDeposit(signer: Signer | Wallet, options: ISwapRouterDepositOptions): Promise<string>;
23254
+
23255
+ /**
23256
+ * Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
23257
+ * the ERC-4626 (`deposit(uint256, address)`) and multi-asset
23258
+ * (`deposit(address, uint256, address)`) deposit interfaces.
23259
+ *
23260
+ * Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
23261
+ * constants exactly. Set by an admin per-vault via `enableVault` and looked
23262
+ * up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
23263
+ * this the router resolves it internally.
23264
+ */
23265
+ export declare enum SwapRouterVaultType {
23266
+ ERC4626 = 1,
23267
+ TokenizedVaultV2 = 2
23268
+ }
23269
+
23270
+ /**
23271
+ * Table of Contents
23272
+ * - Formatters
23273
+ * - Datetime
23274
+ * - Arrays
23275
+ * - Caching
23276
+ */
23277
+ export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
23278
+
23279
+ /**
23280
+ * Formatters
23281
+ */
23282
+ export declare function toTitleCase(str: string, type?: 'camel'): string;
23283
+
23284
+ /**
23285
+ * Track API response times and status.
23286
+ *
23287
+ * @param endpoint - The API endpoint called
23288
+ * @param method - HTTP method used
23289
+ * @param startTime - Start timestamp from performance.now()
23290
+ * @param status - HTTP response status code (0 for network errors)
23291
+ * @param server - Server identifier (production, staging, etc.)
23292
+ */
23293
+ export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
23294
+
23295
+ /**
23296
+ * Track chain/network switches for usage distribution analysis.
23297
+ *
23298
+ * @param chainId - The chain ID being switched to
23299
+ */
23300
+ export declare function trackNetworkSwitch(chainId: number): void;
23301
+
23302
+ export declare function truncate(s: string, amount?: number): string;
23303
+
23304
+ /* Excluded from this release type: tryRecoverTxHash */
23305
+
23306
+ /**
23307
+ * Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
23308
+ * Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
23309
+ * checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
23310
+ * would throw). Add an address here to drop its `latest_reported_tvl` from
23311
+ * the headline number — e.g. closed pre-deposit vaults, test vaults, or
23312
+ * migrated v1 pools that are double-counted by a v2 successor.
23313
+ */
23314
+ export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
23315
+
23316
+ /**
23317
+ * Validity window for a submitted Soroban invocation (seconds).
23318
+ *
23319
+ * This becomes the transaction's `maxTime`. Validators reject a tx whose
23320
+ * `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
23321
+ * realistic sign-then-submit path: hardware wallets, careful manual review,
23322
+ * and institutional approval flows (e.g. Fordefi) that don't sign instantly.
23323
+ * 10 minutes comfortably covers those while staying well inside the Soroban
23324
+ * footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
23325
+ *
23326
+ * The window is anchored to the *network* clock (see `getNetworkCloseTime` in
23327
+ * soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
23328
+ * make the deadline expire early.
23329
+ */
23330
+ declare const TX_TIMEOUT_SECONDS = 600;
23331
+
23332
+ export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
23333
+ [Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
23334
+ } & {
23335
+ /**
23336
+ * Return the function for a given name. This is useful when a contract
23337
+ * method name conflicts with a JavaScript name such as ``prototype`` or
23338
+ * when using a Contract programatically.
23339
+ */
23340
+ getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
23341
+ /**
23342
+ * Return the event for a given name. This is useful when a contract
23343
+ * event name conflicts with a JavaScript name such as ``prototype`` or
23344
+ * when using a Contract programatically.
23345
+ */
23346
+ getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
23347
+ /**
23348
+ * All the Events available on this contract.
23349
+ */
23350
+ filters: {
23351
+ [EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
23352
+ };
23353
+ };
23354
+
23355
+ 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']>>>> {
23356
+ (...args: [...TEventArgs]): DeferredTopicFilter;
23357
+ /**
23358
+ * The name of the Contract event.
23359
+ */
23360
+ name: TEventName;
23361
+ /**
23362
+ * The fragment of the Contract event. This will throw on ambiguous
23363
+ * method names.
23364
+ */
23365
+ fragment: EventFragment;
23366
+ /**
23367
+ * Returns the fragment constrained by %%args%%. This can be used to
23368
+ * resolve ambiguous event names.
23369
+ */
23370
+ getFragment(...args: [...TEventArgs]): EventFragment;
23371
+ }
23372
+
23373
+ 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>> {
23374
+ (...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
23375
+ /**
23376
+ * The name of the Contract method.
23377
+ */
23378
+ name: TFunctionName;
23379
+ /**
23380
+ * The fragment of the Contract method. This will throw on ambiguous
23381
+ * method names.
23382
+ */
23383
+ fragment: TFragment;
23384
+ /**
23385
+ * Returns the fragment constrained by %%args%%. This can be used to
23386
+ * resolve ambiguous method names.
23387
+ */
23388
+ getFragment(...args: [...TInputArgs]): TFragment;
23389
+ /**
23390
+ * Returns a populated transaction that can be used to perform the
23391
+ * contract method with %%args%%.
23392
+ */
23393
+ populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
23394
+ /**
23395
+ * Call the contract method with %%args%% and return the value.
23396
+ *
23397
+ * If the return value is a single type, it will be dereferenced and
23398
+ * returned directly, otherwise the full Result will be returned.
23399
+ */
23400
+ staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
23401
+ /**
23402
+ * Send a transaction for the contract method with %%args%%.
23403
+ */
23404
+ send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
23405
+ /**
23406
+ * Estimate the gas to send the contract method with %%args%%.
23407
+ */
23408
+ estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
23409
+ /**
23410
+ * Call the contract method with %%args%% and return the Result
23411
+ * without any dereferencing.
23412
+ */
23413
+ staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
23414
+ }
23415
+
23416
+ 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;
23417
+
23418
+ export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
23419
+ name: TFunction['name'];
23420
+ type: TFunction['type'];
23421
+ inputs: TFunction['inputs'];
23422
+ outputs: TFunction['outputs'];
23423
+ stateMutability: TFunction['stateMutability'];
23424
+ };
23425
+
23426
+ export declare function unixToDate(epoch: number): Date;
23427
+
23428
+ /**
23429
+ * Update the current user identity in Sentry.
23430
+ * Called when wallet address changes.
23431
+ *
23432
+ * @param walletAddress - New wallet address (or undefined to clear)
23433
+ * @param environment - Current environment
23434
+ */
23435
+ export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
23436
+
23437
+ /* Excluded from this release type: validateAmountPrecision */
23438
+
23439
+ /**
23440
+ * Vault adapter configurations mapping vault addresses to their adapter settings
23441
+ */
23442
+ export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
23443
+
23444
+ 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}`>;
23445
+
23446
+ /**
23447
+ * Hardcoded subaccount addresses for specific vaults allocations
23448
+ */
23449
+ export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
23450
+ AgoraAUSD: {
23451
+ address: IAddress;
23452
+ subaccount: IAddress;
23453
+ useDebank: boolean;
23454
+ };
23455
+ earnAUSD: {
23456
+ address: IAddress;
23457
+ subaccount: IAddress;
23458
+ useDebank: boolean;
23459
+ };
23460
+ };
23461
+
23462
+ /**
23463
+ * The functions to call on the vault contract
23464
+ * @returns The functions to call
23465
+ */
23466
+ export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
23467
+
23468
+ export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
23469
+
23470
+ export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
23471
+
23472
+ export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
23473
+
23474
+ /**
23475
+ * Vault Symbols Mapping
23476
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23477
+ */
23478
+ export declare const VAULT_SYMBOLS: Record<IAddress, string>;
23479
+
23480
+ /**
23481
+ * Vault Symbols Reverse Mapping
23482
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23483
+ */
23484
+ export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
23485
+
23486
+ /**
23487
+ * Address type for vault contracts across all supported chains.
23488
+ * EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
23489
+ * and Stellar vaults use 56-character base32 addresses (G/C prefix).
23490
+ *
23491
+ * Use this instead of `IAddress` when the address may belong to any chain.
23492
+ */
23493
+ export declare type VaultAddress = string;
23494
+
23495
+ /**
23496
+ * allowance checks user's current allowance per pool
23497
+ * @param signer - signer / provider object
23498
+ * @param options - object including pool contract address, user wallet address
23499
+ * @returns normalized number object of the user's current allowance
23500
+ */
23501
+ export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
23502
+
23503
+ /**
23504
+ * Approve a vault (or the appropriate adapter wrapper) to spend a token
23505
+ * ahead of a separate deposit call. Spender routing mirrors
23506
+ * {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
23507
+ * vault). Returns `undefined` when the existing allowance already covers
23508
+ * `amount` **or** when the deposit asset is native.
23509
+ *
23510
+ * @returns Transaction hash when an approval was sent, `undefined` when
23511
+ * the existing allowance already covers `amount` or the deposit asset is
23512
+ * native (no ERC-20 allowance applies). Use {@link approve} for a
23513
+ * discriminated `ApproveResult` if you need to tell those two cases apart.
23514
+ * @throws AugustValidationError on invalid wallet/target/amount.
23515
+ *
23516
+ * @example
23517
+ * ```ts
23518
+ * const hash = await augustSdk.evm.vaultApprove({
23519
+ * target: '0x...', // vault contract address
23520
+ * wallet: walletAddress,
23521
+ * amount: '100', // 100 of the deposit token (UI units)
23522
+ * wait: true, // wait for the approval to confirm
23523
+ * });
23524
+ * if (hash) console.log('approve tx', hash);
23525
+ * // hash === undefined means the on-chain allowance already covers the
23526
+ * // amount, or the deposit asset is native (msg.value, no allowance).
23527
+ * ```
23528
+ */
23529
+ export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
23530
+
23531
+ /**
23532
+ * Deposit underlying token into the specified vault. Auto-routes to the
23533
+ * correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
23534
+ * Paraswap adapter, native-token wrapper, depositWithPermit) based on the
23535
+ * vault version and `depositAsset`.
23536
+ *
23537
+ * Amounts are encoded against the **deposit token's** decimals, not the
23538
+ * vault's share decimals. The SDK reads the appropriate decimals via the
23539
+ * vault metadata and the asset's ERC-20.
23540
+ *
23541
+ * Approval is handled automatically: if the existing allowance doesn't
23542
+ * cover `amount`, an `approve` is sent and **always waited for** (regardless
23543
+ * of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
23544
+ * of the approval on Monad-style RPCs.
23545
+ *
23546
+ * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23547
+ * @param options Vault address, wallet, amount, optional `depositAsset` for
23548
+ * adapter routes, optional `wait` to wait for the deposit receipt.
23549
+ * @returns Deposit transaction hash.
23550
+ * @throws AugustValidationError on invalid wallet/target/amount or missing
23551
+ * adapter config when `depositAsset` differs from the vault underlying.
23552
+ * @throws AugustSDKError when the deposit submission or on-chain call fails.
23553
+ *
23554
+ * @example
23555
+ * ```ts
23556
+ * const hash = await augustSdk.evm.vaultDeposit({
23557
+ * target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
23558
+ * wallet: walletAddress,
23559
+ * amount: '100', // 100 USDC (UI units)
23560
+ * wait: true, // wait for the deposit receipt
23561
+ * });
23562
+ * ```
23563
+ *
23564
+ * @example Adapter deposit (different deposit asset than the vault's underlying)
23565
+ * ```ts
23566
+ * await augustSdk.evm.vaultDeposit({
23567
+ * target: vaultAddress,
23568
+ * wallet: walletAddress,
23569
+ * amount: '0.5',
23570
+ * depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
23571
+ * chainId: 1,
23572
+ * });
23573
+ * ```
23574
+ */
23575
+ export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23576
+
23577
+ /**
23578
+ * Check if vault has adapter support
23579
+ */
23580
+ export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
23581
+
23582
+ declare const vaultIdl: {
23583
+ address: string;
23584
+ metadata: {
23585
+ name: string;
23586
+ version: string;
23587
+ spec: string;
23588
+ description: string;
23589
+ };
23590
+ instructions: ({
23591
+ name: string;
23592
+ docs: string[];
23593
+ discriminator: number[];
23594
+ accounts: ({
23595
+ name: string;
23596
+ writable: boolean;
23597
+ pda: {
23598
+ seeds: {
23599
+ kind: string;
23600
+ value: number[];
23601
+ }[];
23602
+ };
23603
+ signer?: undefined;
23604
+ address?: undefined;
23605
+ } | {
23606
+ name: string;
23607
+ signer: boolean;
23608
+ writable?: undefined;
23609
+ pda?: undefined;
23610
+ address?: undefined;
23611
+ } | {
23612
+ name: string;
23613
+ writable: boolean;
23614
+ pda?: undefined;
23615
+ signer?: undefined;
23616
+ address?: undefined;
23617
+ } | {
23618
+ name: string;
23619
+ address: string;
23620
+ writable?: undefined;
23621
+ pda?: undefined;
23622
+ signer?: undefined;
23623
+ })[];
23624
+ args: any[];
23625
+ } | {
23626
+ name: string;
23627
+ docs: string[];
23628
+ discriminator: number[];
23629
+ accounts: ({
23630
+ name: string;
23631
+ writable: boolean;
23632
+ signer: boolean;
23633
+ docs?: undefined;
23634
+ pda?: undefined;
23635
+ address?: undefined;
23636
+ } | {
23637
+ name: string;
23638
+ docs: string[];
23639
+ writable: boolean;
23640
+ signer: boolean;
23641
+ pda?: undefined;
23642
+ address?: undefined;
23643
+ } | {
23644
+ name: string;
23645
+ docs: string[];
23646
+ writable: boolean;
23647
+ pda: {
23648
+ seeds: {
23649
+ kind: string;
23650
+ value: number[];
23651
+ }[];
23652
+ program?: undefined;
23653
+ };
23654
+ signer?: undefined;
23655
+ address?: undefined;
23656
+ } | {
23657
+ name: string;
23658
+ docs: string[];
23659
+ writable: boolean;
23660
+ signer?: undefined;
23661
+ pda?: undefined;
23662
+ address?: undefined;
23663
+ } | {
23664
+ name: string;
23665
+ writable: boolean;
23666
+ pda: {
23667
+ seeds: ({
23668
+ kind: string;
23669
+ value: number[];
23670
+ path?: undefined;
23671
+ } | {
23672
+ kind: string;
23673
+ path: string;
23674
+ value?: undefined;
23675
+ })[];
23676
+ program: {
23677
+ kind: string;
23678
+ value: number[];
23679
+ };
23680
+ };
23681
+ signer?: undefined;
23682
+ docs?: undefined;
23683
+ address?: undefined;
23684
+ } | {
23685
+ name: string;
23686
+ address: string;
23687
+ writable?: undefined;
23688
+ signer?: undefined;
23689
+ docs?: undefined;
23690
+ pda?: undefined;
23691
+ })[];
23692
+ args: {
23693
+ name: string;
23694
+ type: string;
23695
+ }[];
23696
+ } | {
23697
+ name: string;
23698
+ docs: string[];
23699
+ discriminator: number[];
23700
+ accounts: ({
23701
+ name: string;
23702
+ writable: boolean;
23703
+ pda: {
23704
+ seeds: ({
23705
+ kind: string;
23706
+ value: number[];
23707
+ path?: undefined;
23708
+ } | {
23709
+ kind: string;
23710
+ path: string;
23711
+ value?: undefined;
23712
+ })[];
23713
+ };
23714
+ signer?: undefined;
23715
+ } | {
23716
+ name: string;
23717
+ writable: boolean;
23718
+ pda?: undefined;
23719
+ signer?: undefined;
23720
+ } | {
23721
+ name: string;
23722
+ writable: boolean;
23723
+ signer: boolean;
23724
+ pda?: undefined;
23725
+ } | {
23726
+ name: string;
23727
+ writable?: undefined;
23728
+ pda?: undefined;
23729
+ signer?: undefined;
23730
+ })[];
23731
+ args: {
23732
+ name: string;
23733
+ type: string;
23734
+ }[];
23735
+ } | {
23736
+ name: string;
23737
+ docs: string[];
23738
+ discriminator: number[];
23739
+ accounts: ({
23740
+ name: string;
23741
+ writable: boolean;
23742
+ pda: {
23743
+ seeds: ({
23744
+ kind: string;
23745
+ value: number[];
23746
+ path?: undefined;
23747
+ } | {
23748
+ kind: string;
23749
+ path: string;
23750
+ value?: undefined;
23751
+ })[];
23752
+ };
23753
+ signer?: undefined;
23754
+ address?: undefined;
23755
+ } | {
23756
+ name: string;
23757
+ writable?: undefined;
23758
+ pda?: undefined;
23759
+ signer?: undefined;
23760
+ address?: undefined;
23761
+ } | {
23762
+ name: string;
23763
+ writable: boolean;
23764
+ signer: boolean;
23765
+ pda?: undefined;
23766
+ address?: undefined;
23767
+ } | {
23768
+ name: string;
23769
+ address: string;
23770
+ writable?: undefined;
23771
+ pda?: undefined;
23772
+ signer?: undefined;
23773
+ })[];
23774
+ args: {
23775
+ name: string;
23776
+ type: string;
23777
+ }[];
23778
+ } | {
23779
+ name: string;
23780
+ docs: string[];
23781
+ discriminator: number[];
23782
+ accounts: ({
23783
+ name: string;
23784
+ writable: boolean;
23785
+ pda: {
23786
+ seeds: {
23787
+ kind: string;
23788
+ value: number[];
23789
+ }[];
23790
+ };
23791
+ signer?: undefined;
23792
+ address?: undefined;
23793
+ } | {
23794
+ name: string;
23795
+ signer: boolean;
23796
+ writable?: undefined;
23797
+ pda?: undefined;
23798
+ address?: undefined;
23799
+ } | {
23800
+ name: string;
23801
+ writable: boolean;
23802
+ signer: boolean;
23803
+ pda?: undefined;
23804
+ address?: undefined;
23805
+ } | {
23806
+ name: string;
23807
+ address: string;
23808
+ writable?: undefined;
23809
+ pda?: undefined;
23810
+ signer?: undefined;
23811
+ })[];
23812
+ args: {
23813
+ name: string;
23814
+ type: string;
23815
+ }[];
23816
+ } | {
23817
+ name: string;
23818
+ docs: string[];
23819
+ discriminator: number[];
23820
+ accounts: ({
23821
+ name: string;
23822
+ writable: boolean;
23823
+ pda: {
23824
+ seeds: ({
23825
+ kind: string;
23826
+ value: number[];
23827
+ path?: undefined;
23828
+ } | {
23829
+ kind: string;
23830
+ path: string;
23831
+ value?: undefined;
23832
+ })[];
23833
+ program?: undefined;
23834
+ };
23835
+ signer?: undefined;
23836
+ } | {
23837
+ name: string;
23838
+ writable: boolean;
23839
+ pda: {
23840
+ seeds: ({
23841
+ kind: string;
23842
+ path: string;
23843
+ value?: undefined;
23844
+ } | {
23845
+ kind: string;
23846
+ value: number[];
23847
+ path?: undefined;
23848
+ })[];
23849
+ program: {
23850
+ kind: string;
23851
+ value: number[];
23852
+ };
23853
+ };
23854
+ signer?: undefined;
23855
+ } | {
23856
+ name: string;
23857
+ writable: boolean;
23858
+ pda?: undefined;
23859
+ signer?: undefined;
23860
+ } | {
23861
+ name: string;
23862
+ signer: boolean;
23863
+ writable?: undefined;
23864
+ pda?: undefined;
23865
+ } | {
23866
+ name: string;
23867
+ writable?: undefined;
23868
+ pda?: undefined;
23869
+ signer?: undefined;
23870
+ })[];
23871
+ args: {
23872
+ name: string;
23873
+ type: string;
23874
+ }[];
23875
+ })[];
23876
+ accounts: {
23877
+ name: string;
23878
+ discriminator: number[];
23879
+ }[];
23880
+ events: {
23881
+ name: string;
23882
+ discriminator: number[];
23883
+ }[];
23884
+ errors: {
23885
+ code: number;
23886
+ name: string;
23887
+ msg: string;
23888
+ }[];
23889
+ types: ({
23890
+ name: string;
23891
+ serialization: string;
23892
+ repr: {
23893
+ kind: string;
23894
+ };
23895
+ type: {
23896
+ kind: string;
23897
+ fields: {
23898
+ name: string;
23899
+ type: string;
23900
+ }[];
23901
+ };
23902
+ } | {
23903
+ name: string;
23904
+ type: {
23905
+ kind: string;
23906
+ fields: ({
23907
+ name: string;
23908
+ type: string;
23909
+ } | {
23910
+ name: string;
23911
+ type: {
23912
+ array: (string | number)[];
23913
+ };
23914
+ })[];
23915
+ };
23916
+ serialization?: undefined;
23917
+ repr?: undefined;
23918
+ })[];
23919
+ };
23920
+
23921
+ /**
23922
+ * @TODO
23923
+ * @description withdraw funds from the specified pool including accrued rewards
23924
+ * @param signer signer / wallet object
23925
+ * @param options object including pool contract address, user wallet address, and more
23926
+ * @returns claim tx hash
23927
+ */
23928
+ export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
23929
+ year: string;
23930
+ month: string;
23931
+ day: string;
23932
+ receiverIndex: string;
23933
+ }): Promise<string>;
23934
+
23935
+ export declare enum VaultRedemptionStatus {
23936
+ AWAITING_COOLDOWN = "awaiting_cooldown",
23937
+ READY_TO_CLAIM = "ready_to_claim"
23938
+ }
23939
+
23940
+ /**
23941
+ * Request to redeem vault shares. For EVM-1 vaults this queues a standard
23942
+ * redemption (claimable later via `vaultRedeem`); for EVM-2 vaults this
23943
+ * also handles the receipt-token allowance automatically. Pass
23944
+ * `isInstantRedeem: true` for vaults that support instant settlement.
23945
+ *
23946
+ * Approval of the receipt token (EVM-2) is always waited on before the
23947
+ * redeem call, regardless of the caller's `wait` flag.
23948
+ *
23949
+ * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23950
+ * @param options Vault address, wallet, amount, optional `isInstantRedeem`,
23951
+ * optional `wait` to wait for the redeem receipt.
23952
+ * @returns Redeem transaction hash.
23953
+ * @throws AugustValidationError on invalid wallet/target/amount.
23954
+ * @throws AugustSDKError when the redeem submission or on-chain call fails.
23955
+ *
23956
+ * @example
23957
+ * ```ts
23958
+ * const hash = await augustSdk.evm.vaultRequestRedeem({
23959
+ * target: vaultAddress,
23960
+ * wallet: walletAddress,
23961
+ * amount: '10', // 10 shares (UI units)
23962
+ * wait: true,
23963
+ * });
23964
+ * ```
23965
+ *
23966
+ * @example Instant redemption
23967
+ * ```ts
23968
+ * await augustSdk.evm.vaultRequestRedeem({
23969
+ * target: vaultAddress,
23970
+ * wallet: walletAddress,
23971
+ * amount: '10',
23972
+ * isInstantRedeem: true,
23973
+ * });
23974
+ * ```
23975
+ */
23976
+ export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23977
+
23978
+ /**
23979
+ * @deprecated Renamed to {@link SWAP_ROUTER_ELIGIBLE_VAULTS}, and the semantics
23980
+ * changed: this set no longer drives `vaultDeposit` auto-routing (that branch
23981
+ * was removed) — it now only marks vaults whose UI may offer the swap-router
23982
+ * deposit surface. Kept as an alias for one release; migrate to the new name.
23983
+ */
23984
+ export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
23985
+
23986
+ /**
23987
+ * Vault Receipt Symbol Mapping
23988
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23989
+ */
23990
+ 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';
23991
+
23992
+ /**
23993
+ * @deprecated Renamed to {@link isSwapRouterEligible}. The meaning also changed:
23994
+ * it no longer implies `vaultDeposit` routes the vault through the SwapRouter
23995
+ * (that behavior was removed) — it only reports swap-router *eligibility* for
23996
+ * the opt-in deposit surface. Kept as an alias for one release.
23997
+ */
23998
+ export declare const vaultUsesSwapRouter: typeof isSwapRouterEligible;
23999
+
24000
+ export declare function verifyAugustKey(key: string): Promise<boolean>;
24001
+
24002
+ export declare function verifyInfuraKey(key: string): Promise<boolean>;
24003
+
24004
+ /**
24005
+ * Convert a viem WalletClient to an ethers-compatible Signer
24006
+ * Uses the walletClient as a provider and wraps it for ethers compatibility
24007
+ * @param walletClient Viem WalletClient from wagmi or viem
24008
+ * @returns Ethers Signer that can be used with the SDK
24009
+ */
24010
+ export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
24011
+
24012
+ /**
24013
+ * @param walletClient a wagmi-derived client (from useWalletClient)
24014
+ * @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
24015
+ */
24016
+ export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
24017
+
24018
+ export declare const WEBSERVER_ENDPOINTS: {
24019
+ default: {
24020
+ hello: string;
24021
+ protected: string;
24022
+ };
24023
+ auth: {
24024
+ verify: string;
24025
+ sign: string;
24026
+ login: string;
24027
+ nonce: string;
24028
+ refresh: string;
24029
+ };
24030
+ subaccount: {
24031
+ rewards: (subaccount: IAddress) => string;
24032
+ tokens: (subaccount: IAddress) => string;
24033
+ twap: {
24034
+ create: (subaccount: IAddress) => string;
24035
+ stop: (subaccount: IAddress, id: string) => string;
24036
+ fills: (subaccount: IAddress, id: string) => string;
24037
+ };
24038
+ debank: (subaccount: IAddress) => string;
24039
+ health_factor: (subaccount: IAddress) => string;
24040
+ summary: (subaccount: IAddress) => string;
24041
+ batch: (subaccount: IAddress) => string;
24042
+ loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
24043
+ cefi: (subaccount: IAddress) => string;
24044
+ otc_positions: (subaccount: IAddress) => string;
24045
+ _: (subaccount: IAddress) => string;
24046
+ };
24047
+ users: {
24048
+ get: string;
24049
+ };
24050
+ prices: (symbol: string) => string;
24051
+ metrics: {
24052
+ pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
24053
+ };
24054
+ public: {
24055
+ integrations: {
24056
+ morpho: {
24057
+ apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
24058
+ };
24059
+ };
24060
+ tokenizedVault: {
24061
+ loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
24062
+ subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
24063
+ list: string;
24064
+ byVaultAddress: (vaultAddress: VaultAddress) => string;
24065
+ historicalApy: (vaultAddress: IAddress) => string;
24066
+ historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
24067
+ annualizedApy: (vaultAddress: IAddress) => string;
24068
+ summary: (vaultAddress: IAddress) => string;
24069
+ withdrawals: (chain: string, vaultAddress: IAddress) => string;
24070
+ debank: (vaultAddress: IAddress) => string;
24071
+ userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
24072
+ archivedVaults: string;
24073
+ };
24074
+ points: {
24075
+ byUserAddress: (userAddress: IAddress) => string;
24076
+ register: string;
24077
+ leaderboard: string;
24078
+ };
24079
+ vaults: {
24080
+ pendingRedemptions: (vaultAddress: IAddress) => string;
24081
+ };
24082
+ pnl: {
24083
+ unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
24084
+ unrealizedLatest: string;
24085
+ };
24086
+ };
24087
+ upshift: {
24088
+ vaults: {
24089
+ metadata: string;
24090
+ };
24091
+ };
24092
+ };
24093
+
24094
+ export declare const WEBSERVER_URL: {
24095
+ production: string;
24096
+ staging: string;
24097
+ development: string;
24098
+ localhost: string;
24099
+ qa: string;
24100
+ public: string;
24101
+ upshift: string;
24102
+ };
24103
+
24104
+ /**
24105
+ * Withdrawal request with computed claimable date and current processing status.
24106
+ * The unique identifier is (receiver, claimableDate).
24107
+ *
24108
+ * @interface WithdrawalRequestStatus
24109
+ */
24110
+ export declare interface WithdrawalRequestStatus {
24111
+ /** Transaction hash of the withdrawal request */
24112
+ transactionHash: string;
24113
+ /** Block timestamp when the withdrawal was requested (seconds, UTC) */
24114
+ requestTimestamp: number;
24115
+ /** Shares amount being redeemed */
24116
+ shares: bigint;
24117
+ /** Receiver address for the withdrawal */
24118
+ receiver: string;
24119
+ /** Computed claimable date in UTC (year, month, day) */
24120
+ claimableDate: {
24121
+ year: number;
24122
+ month: number;
24123
+ day: number;
24124
+ };
24125
+ /** Epoch timestamp when this withdrawal becomes claimable */
24126
+ claimableEpoch: number;
24127
+ /** Current status of the withdrawal */
24128
+ status: 'pending' | 'ready_to_claim' | 'processed';
24129
+ /** Transaction hash of the processing transaction (if processed) */
24130
+ processedTransactionHash?: string;
24131
+ /** Assets received (if processed) */
24132
+ assetsReceived?: bigint;
24133
+ }
24134
+
24135
+ /**
24136
+ * Higher-order function to wrap SDK methods with performance tracking.
24137
+ * Tracks method calls, timing, chain usage, and errors.
24138
+ *
24139
+ * @param methodName - Name of the method being wrapped
24140
+ * @param method - The original async method
24141
+ * @param getChainId - Function to get current chain ID
24142
+ * @returns Wrapped method with tracking
24143
+ */
24144
+ export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
24145
+
24146
+ /**
24147
+ * Wrap async operations with exponential backoff retry logic.
24148
+ * Retries on network errors with increasing delays between attempts.
24149
+ * @param fn - Async function to execute with retry logic
24150
+ * @param maxRetries - Maximum number of retry attempts
24151
+ * @param baseDelay - Initial delay in milliseconds (doubles each retry)
24152
+ * @param shouldRetry - Custom function to determine if error is retryable
24153
+ * @returns Result of successful function execution
24154
+ * @throws Last error if all retries exhausted
24155
+ */
24156
+ export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
24157
+
24158
+ /**
24159
+ * Higher-order function to wrap synchronous SDK methods with tracking.
24160
+ * Uses breadcrumbs for tracking since spans require async context.
24161
+ *
24162
+ * @param methodName - Name of the method being wrapped
24163
+ * @param method - The original sync method
24164
+ * @param getChainId - Function to get current chain ID
24165
+ * @returns Wrapped method with tracking
24166
+ */
24167
+ export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
24168
+
24169
+ export declare const WRAPPER_ADAPTOR: {
24170
+ 43114: IAddress;
24171
+ 1: IAddress;
24172
+ };
24173
+
24174
+ export { }