@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/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
- * 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.
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
- * @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.
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
- * @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).
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
- * 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.
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
- * 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.
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
- 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 { }
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 { }