@augustdigital/sdk 8.6.0 → 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
@@ -19011,7 +19125,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19011
19125
  * only refresh user identity and the cached API-key hash.
19012
19126
  *
19013
19127
  * @param config - Analytics configuration. Pass `tracesSampleRate` to
19014
- * override the Phase 1/2 default of `1.0`.
19128
+ * override the default of `0.1`.
19015
19129
  * @param environment - Current environment (DEV or PROD).
19016
19130
  * @param walletAddress - Optional wallet address for user identification.
19017
19131
  * @param apiKey - Optional API key (hashed for identification).
@@ -19405,6 +19519,34 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19405
19519
 
19406
19520
  export declare function isEarlierThanNow(startTime: Date): boolean;
19407
19521
 
19522
+ /**
19523
+ * Is this error a routine on-chain read revert rather than a real failure?
19524
+ *
19525
+ * Reading a function a contract doesn't implement, or an address that holds no
19526
+ * (or incompatible) bytecode, reverts — a normal outcome when the SDK probes
19527
+ * heterogeneous vaults. Matches ethers' `CALL_EXCEPTION` code and the
19528
+ * message variants emitted by ethers and viem (`missing revert data`,
19529
+ * `execution reverted`, `call revert exception`, and the bare `reverted`
19530
+ * phrasing such as `the contract function "totalAssets" reverted`).
19531
+ *
19532
+ * Scope note: callers apply this on **read** paths only. A reverted *write*
19533
+ * (a tx that failed on-chain) is a genuine error and is intentionally not
19534
+ * demoted by this predicate's use in `write.actions`.
19535
+ *
19536
+ * @param error - The caught value, of unknown type.
19537
+ * @returns `true` when the failure is an expected/benign contract revert.
19538
+ *
19539
+ * @example
19540
+ * ```ts
19541
+ * try { return await vaultContract.maxDepositAmount(); }
19542
+ * catch (e) {
19543
+ * logChainError('maxDeposit', e, isExpectedRevertError(e));
19544
+ * throw e;
19545
+ * }
19546
+ * ```
19547
+ */
19548
+ export declare function isExpectedRevertError(error: unknown): boolean;
19549
+
19408
19550
  /**
19409
19551
  * Whether a vault's receipt token is hub-only (no cross-chain withdraw).
19410
19552
  * The deposit UI must not offer a spoke share destination for these vaults.
@@ -19527,6 +19669,20 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19527
19669
  */
19528
19670
  declare function isStellarAddress(address: string): boolean;
19529
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
+
19530
19686
  /** Parameters for building an unsigned Stellar vault deposit transaction. */
19531
19687
  declare interface IStellarDepositParams {
19532
19688
  contractId: string;
@@ -19676,6 +19832,27 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19676
19832
  ownerAddr: IAddress;
19677
19833
  }
19678
19834
 
19835
+ /**
19836
+ * Is this error a wallet/user rejection of a transaction or signature request?
19837
+ *
19838
+ * Detects ethers v6's `ACTION_REJECTED` code, the EIP-1193 `4001`
19839
+ * ("User rejected the request") code (top-level or nested), and the common
19840
+ * human-readable phrasings as a fallback for providers that omit a code.
19841
+ *
19842
+ * @param error - The caught value, of unknown type.
19843
+ * @returns `true` when the failure was the user declining in their wallet.
19844
+ *
19845
+ * @example
19846
+ * ```ts
19847
+ * try { await vault.deposit(...); }
19848
+ * catch (e) {
19849
+ * if (isUserRejectionError(e)) return; // user cancelled — not an error
19850
+ * throw e;
19851
+ * }
19852
+ * ```
19853
+ */
19854
+ export declare function isUserRejectionError(error: unknown): boolean;
19855
+
19679
19856
  /**
19680
19857
  * Signer Compatibility Helpers
19681
19858
  *
@@ -19823,6 +20000,44 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19823
20000
  wait?: boolean;
19824
20001
  }
19825
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
+
19826
20041
  /**
19827
20042
  * Options for `depositViaSwapRouter` — direct deposit (no swap) of an
19828
20043
  * already-held asset, routed through the SwapRouter so origin/swap-fee
@@ -21072,6 +21287,26 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
21072
21287
 
21073
21288
  export declare function loanStateToReadable(loanState: number | bigint): "PREAPPROVED" | "FUNDING_REQUIRED" | "FUNDED" | "ACTIVE" | "CANCELLED" | "MATURED" | "CLOSED";
21074
21289
 
21290
+ /**
21291
+ * Log a caught chain error at the severity its category warrants, without
21292
+ * swallowing it. When `isBenign` is `true` the failure is recorded as a `warn`
21293
+ * (a Sentry breadcrumb that rides along with the next real issue, not a billed
21294
+ * standalone issue); otherwise it is logged at `error` (a Sentry issue). The
21295
+ * caller is still responsible for re-throwing — this only routes telemetry.
21296
+ *
21297
+ * Pass the benign decision explicitly (via {@link isUserRejectionError} or
21298
+ * {@link isExpectedRevertError}) so the call site documents *why* the demotion
21299
+ * is safe and each path opts into only the category that applies to it.
21300
+ *
21301
+ * @param tag - Low-cardinality call-site label (e.g. `'deposit'`), used as the
21302
+ * Sentry breadcrumb/issue grouping key.
21303
+ * @param error - The caught value, of unknown type.
21304
+ * @param isBenign - `true` to demote to `warn`; `false` to keep at `error`.
21305
+ * @param context - Optional structured context attached to the log entry. It is
21306
+ * sanitized by the logger before transport.
21307
+ */
21308
+ export declare function logChainError(tag: string, error: unknown, isBenign: boolean, context?: Record<string, unknown>): void;
21309
+
21075
21310
  export declare const Logger: {
21076
21311
  setLogger: typeof setLogger;
21077
21312
  setStructuredLogger: typeof setStructuredLogger;
@@ -22476,6 +22711,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
22476
22711
 
22477
22712
  declare namespace SolanaActions {
22478
22713
  export {
22714
+ describeSolanaError,
22479
22715
  handleSolanaDeposit,
22480
22716
  handleSolanaRedeem
22481
22717
  }
@@ -22855,6 +23091,32 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
22855
23091
  selector: `0x${string}`;
22856
23092
  }>>;
22857
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
+
22858
23120
  /**
22859
23121
  * Maximum number of swap legs the contract accepts in a single
22860
23122
  * `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading
@@ -22918,930 +23180,973 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
22918
23180
  export declare function swapAndDeposit(signer: Signer | Wallet, options: ISwapAndDepositOptions): Promise<string>;
22919
23181
 
22920
23182
  /**
22921
- * Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
22922
- * the ERC-4626 (`deposit(uint256, address)`) and multi-asset
22923
- * (`deposit(address, uint256, address)`) deposit interfaces.
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}.
22924
23186
  *
22925
- * Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
22926
- * constants exactly. Set by an admin per-vault via `enableVault` and looked
22927
- * up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
22928
- * this the router resolves it internally.
22929
- */
22930
- export declare enum SwapRouterVaultType {
22931
- ERC4626 = 1,
22932
- TokenizedVaultV2 = 2
22933
- }
22934
-
22935
- /**
22936
- * Table of Contents
22937
- * - Formatters
22938
- * - Datetime
22939
- * - Arrays
22940
- * - Caching
22941
- */
22942
- export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
22943
-
22944
- /**
22945
- * Formatters
22946
- */
22947
- export declare function toTitleCase(str: string, type?: 'camel'): string;
22948
-
22949
- /**
22950
- * Track API response times and status.
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.
22951
23194
  *
22952
- * @param endpoint - The API endpoint called
22953
- * @param method - HTTP method used
22954
- * @param startTime - Start timestamp from performance.now()
22955
- * @param status - HTTP response status code (0 for network errors)
22956
- * @param server - Server identifier (production, staging, etc.)
22957
- */
22958
- export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
22959
-
22960
- /**
22961
- * Track chain/network switches for usage distribution analysis.
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}.
22962
23205
  *
22963
- * @param chainId - The chain ID being switched to
22964
- */
22965
- export declare function trackNetworkSwitch(chainId: number): void;
22966
-
22967
- export declare function truncate(s: string, amount?: number): string;
22968
-
22969
- /* Excluded from this release type: tryRecoverTxHash */
22970
-
22971
- /**
22972
- * Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
22973
- * Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
22974
- * checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
22975
- * would throw). Add an address here to drop its `latest_reported_tvl` from
22976
- * the headline number — e.g. closed pre-deposit vaults, test vaults, or
22977
- * migrated v1 pools that are double-counted by a v2 successor.
22978
- */
22979
- export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
22980
-
22981
- /**
22982
- * Validity window for a submitted Soroban invocation (seconds).
22983
- *
22984
- * This becomes the transaction's `maxTime`. Validators reject a tx whose
22985
- * `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
22986
- * realistic sign-then-submit path: hardware wallets, careful manual review,
22987
- * and institutional approval flows (e.g. Fordefi) that don't sign instantly.
22988
- * 10 minutes comfortably covers those while staying well inside the Soroban
22989
- * footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
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.
22990
23209
  *
22991
- * The window is anchored to the *network* clock (see `getNetworkCloseTime` in
22992
- * soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
22993
- * make the deadline expire early.
22994
- */
22995
- declare const TX_TIMEOUT_SECONDS = 600;
22996
-
22997
- export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
22998
- [Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
22999
- } & {
23000
- /**
23001
- * Return the function for a given name. This is useful when a contract
23002
- * method name conflicts with a JavaScript name such as ``prototype`` or
23003
- * when using a Contract programatically.
23004
- */
23005
- getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
23006
- /**
23007
- * Return the event for a given name. This is useful when a contract
23008
- * event name conflicts with a JavaScript name such as ``prototype`` or
23009
- * when using a Contract programatically.
23010
- */
23011
- getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
23012
- /**
23013
- * All the Events available on this contract.
23014
- */
23015
- filters: {
23016
- [EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
23017
- };
23018
- };
23019
-
23020
- export declare interface TypedContractEvent<TAbi extends Abi, TEventName extends string, TEvent extends ExtractAbiEvents<TAbi> = ExtractAbiEvent<TAbi, TEventName>, TEventArgs extends readonly unknown[] = AsArray<Partial<AbiParametersToPrimitiveTypes<TEvent['inputs']>>>> {
23021
- (...args: [...TEventArgs]): DeferredTopicFilter;
23022
- /**
23023
- * The name of the Contract event.
23024
- */
23025
- name: TEventName;
23026
- /**
23027
- * The fragment of the Contract event. This will throw on ambiguous
23028
- * method names.
23029
- */
23030
- fragment: EventFragment;
23031
- /**
23032
- * Returns the fragment constrained by %%args%%. This can be used to
23033
- * resolve ambiguous event names.
23034
- */
23035
- getFragment(...args: [...TEventArgs]): EventFragment;
23036
- }
23037
-
23038
- export declare interface TypedContractFunction<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>, TInputArgs extends readonly unknown[] = AsArray<AbiParametersToPrimitiveTypes<TFunction['inputs']>>, TResult = TypedContractFunctionResult<TAbi, TFunctionName>, TFragment = TypedFragment<TAbi, TFunctionName>> {
23039
- (...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
23040
- /**
23041
- * The name of the Contract method.
23042
- */
23043
- name: TFunctionName;
23044
- /**
23045
- * The fragment of the Contract method. This will throw on ambiguous
23046
- * method names.
23047
- */
23048
- fragment: TFragment;
23049
- /**
23050
- * Returns the fragment constrained by %%args%%. This can be used to
23051
- * resolve ambiguous method names.
23052
- */
23053
- getFragment(...args: [...TInputArgs]): TFragment;
23054
- /**
23055
- * Returns a populated transaction that can be used to perform the
23056
- * contract method with %%args%%.
23057
- */
23058
- populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
23059
- /**
23060
- * Call the contract method with %%args%% and return the value.
23061
- *
23062
- * If the return value is a single type, it will be dereferenced and
23063
- * returned directly, otherwise the full Result will be returned.
23064
- */
23065
- staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
23066
- /**
23067
- * Send a transaction for the contract method with %%args%%.
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
+ * ```
23068
23230
  */
23069
- send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
23070
- /**
23071
- * Estimate the gas to send the contract method with %%args%%.
23072
- */
23073
- estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
23074
- /**
23075
- * Call the contract method with %%args%% and return the Result
23076
- * without any dereferencing.
23077
- */
23078
- staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
23079
- }
23080
-
23081
- export declare type TypedContractFunctionResult<TAbi extends Abi, TFunctionName extends string, TOutputArgs = AbiParametersToPrimitiveTypes<ExtractAbiFunction<TAbi, TFunctionName>['outputs']>> = TOutputArgs extends readonly [] ? void : TOutputArgs extends readonly [infer Arg] ? Arg : TOutputArgs;
23082
-
23083
- export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
23084
- name: TFunction['name'];
23085
- type: TFunction['type'];
23086
- inputs: TFunction['inputs'];
23087
- outputs: TFunction['outputs'];
23088
- stateMutability: TFunction['stateMutability'];
23089
- };
23090
-
23091
- export declare function unixToDate(epoch: number): Date;
23092
-
23093
- /**
23094
- * Update the current user identity in Sentry.
23095
- * Called when wallet address changes.
23096
- *
23097
- * @param walletAddress - New wallet address (or undefined to clear)
23098
- * @param environment - Current environment
23099
- */
23100
- export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
23101
-
23102
- /* Excluded from this release type: validateAmountPrecision */
23103
-
23104
- /**
23105
- * Vault adapter configurations mapping vault addresses to their adapter settings
23106
- */
23107
- export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
23108
-
23109
- export declare const VAULT_ADDRESSES: Record<"musd" | "predlp" | "sentusd" | "pregrid" | "repouscc" | "earnxrp" | "tivkbtc" | "tivusdt0" | "supermon" | "earnmon" | "k3europ" | "wmon/ausd" | "wbtc/ausd" | "earnausd_monad" | "sausd" | "farmbold" | "sentuscc" | "sentbtc" | "svusdc" | "apusdc" | "testwethtsa" | "tacusr" | "upinjusdt" | "tac-teth" | "upausd" | "taccbbtc" | "xupusdc" | "uptbtc" | "gteth" | "ageth" | "upusdc" | "hgeth" | "upssylva" | "hbbtc" | "hbhype" | "upazt" | "susdt" | "upedge" | "coreusdc" | "upcusdo" | "shifteth" | "upsusde" | "uplbtc" | "upavax" | "tacrseth" | "earnausd" | "alpineusdcflagship" | "alpinecoinshiftusdc" | "upbtc" | "upstrbtc" | "maxiusr" | "upgammausdc" | "xhype" | "wildusd" | "alpinebtc" | "prenusd" | "upyzusd" | "upnusd" | "hlpe" | "nemo eth yield", `0x${string}`>;
23110
-
23111
- /**
23112
- * Hardcoded subaccount addresses for specific vaults allocations
23113
- */
23114
- export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
23115
- AgoraAUSD: {
23116
- address: IAddress;
23117
- subaccount: IAddress;
23118
- useDebank: boolean;
23119
- };
23120
- earnAUSD: {
23121
- address: IAddress;
23122
- subaccount: IAddress;
23123
- useDebank: boolean;
23124
- };
23125
- };
23126
-
23127
- /**
23128
- * The functions to call on the vault contract
23129
- * @returns The functions to call
23130
- */
23131
- export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
23132
-
23133
- export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
23134
-
23135
- export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
23136
-
23137
- export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
23138
-
23139
- /**
23140
- * Vault Symbols Mapping
23141
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23142
- */
23143
- export declare const VAULT_SYMBOLS: Record<IAddress, string>;
23144
-
23145
- /**
23146
- * Vault Symbols Reverse Mapping
23147
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23148
- */
23149
- export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
23150
-
23151
- /**
23152
- * Address type for vault contracts across all supported chains.
23153
- * EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
23154
- * and Stellar vaults use 56-character base32 addresses (G/C prefix).
23155
- *
23156
- * Use this instead of `IAddress` when the address may belong to any chain.
23157
- */
23158
- export declare type VaultAddress = string;
23159
-
23160
- /**
23161
- * allowance checks user's current allowance per pool
23162
- * @param signer - signer / provider object
23163
- * @param options - object including pool contract address, user wallet address
23164
- * @returns normalized number object of the user's current allowance
23165
- */
23166
- export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
23167
-
23168
- /**
23169
- * Approve a vault (or the appropriate adapter wrapper) to spend a token
23170
- * ahead of a separate deposit call. Spender routing mirrors
23171
- * {@link vaultDeposit} (multi-asset vault, adapter wrapper, standard
23172
- * vault). Returns `undefined` when the existing allowance already covers
23173
- * `amount` **or** when the deposit asset is native.
23174
- *
23175
- * @returns Transaction hash when an approval was sent, `undefined` when
23176
- * the existing allowance already covers `amount` or the deposit asset is
23177
- * native (no ERC-20 allowance applies). Use {@link approve} for a
23178
- * discriminated `ApproveResult` if you need to tell those two cases apart.
23179
- * @throws AugustValidationError on invalid wallet/target/amount.
23180
- *
23181
- * @example
23182
- * ```ts
23183
- * const hash = await augustSdk.evm.vaultApprove({
23184
- * target: '0x...', // vault contract address
23185
- * wallet: walletAddress,
23186
- * amount: '100', // 100 of the deposit token (UI units)
23187
- * wait: true, // wait for the approval to confirm
23188
- * });
23189
- * if (hash) console.log('approve tx', hash);
23190
- * // hash === undefined means the on-chain allowance already covers the
23191
- * // amount, or the deposit asset is native (msg.value, no allowance).
23192
- * ```
23193
- */
23194
- export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
23195
-
23196
- /**
23197
- * Deposit underlying token into the specified vault. Auto-routes to the
23198
- * correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
23199
- * Paraswap adapter, native-token wrapper, depositWithPermit) based on the
23200
- * vault version and `depositAsset`.
23201
- *
23202
- * Amounts are encoded against the **deposit token's** decimals, not the
23203
- * vault's share decimals. The SDK reads the appropriate decimals via the
23204
- * vault metadata and the asset's ERC-20.
23205
- *
23206
- * Approval is handled automatically: if the existing allowance doesn't
23207
- * cover `amount`, an `approve` is sent and **always waited for** (regardless
23208
- * of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
23209
- * of the approval on Monad-style RPCs.
23210
- *
23211
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23212
- * @param options Vault address, wallet, amount, optional `depositAsset` for
23213
- * adapter routes, optional `wait` to wait for the deposit receipt.
23214
- * @returns Deposit transaction hash.
23215
- * @throws AugustValidationError on invalid wallet/target/amount or missing
23216
- * adapter config when `depositAsset` differs from the vault underlying.
23217
- * @throws AugustSDKError when the deposit submission or on-chain call fails.
23218
- *
23219
- * @example
23220
- * ```ts
23221
- * const hash = await augustSdk.evm.vaultDeposit({
23222
- * target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
23223
- * wallet: walletAddress,
23224
- * amount: '100', // 100 USDC (UI units)
23225
- * wait: true, // wait for the deposit receipt
23226
- * });
23227
- * ```
23228
- *
23229
- * @example Adapter deposit (different deposit asset than the vault's underlying)
23230
- * ```ts
23231
- * await augustSdk.evm.vaultDeposit({
23232
- * target: vaultAddress,
23233
- * wallet: walletAddress,
23234
- * amount: '0.5',
23235
- * depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
23236
- * chainId: 1,
23237
- * });
23238
- * ```
23239
- */
23240
- export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23241
-
23242
- /**
23243
- * Check if vault has adapter support
23244
- */
23245
- export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
23246
-
23247
- declare const vaultIdl: {
23248
- address: string;
23249
- metadata: {
23250
- name: string;
23251
- version: string;
23252
- spec: string;
23253
- description: string;
23254
- };
23255
- instructions: ({
23256
- name: string;
23257
- docs: string[];
23258
- discriminator: number[];
23259
- accounts: ({
23260
- name: string;
23261
- writable: boolean;
23262
- pda: {
23263
- seeds: {
23264
- kind: string;
23265
- value: number[];
23266
- }[];
23267
- };
23268
- signer?: undefined;
23269
- address?: undefined;
23270
- } | {
23271
- name: string;
23272
- signer: boolean;
23273
- writable?: undefined;
23274
- pda?: undefined;
23275
- address?: undefined;
23276
- } | {
23277
- name: string;
23278
- writable: boolean;
23279
- pda?: undefined;
23280
- signer?: undefined;
23281
- address?: undefined;
23282
- } | {
23283
- name: string;
23284
- address: string;
23285
- writable?: undefined;
23286
- pda?: undefined;
23287
- signer?: undefined;
23288
- })[];
23289
- args: any[];
23290
- } | {
23291
- name: string;
23292
- docs: string[];
23293
- discriminator: number[];
23294
- accounts: ({
23295
- name: string;
23296
- writable: boolean;
23297
- signer: boolean;
23298
- docs?: undefined;
23299
- pda?: undefined;
23300
- address?: undefined;
23301
- } | {
23302
- name: string;
23303
- docs: string[];
23304
- writable: boolean;
23305
- signer: boolean;
23306
- pda?: undefined;
23307
- address?: undefined;
23308
- } | {
23309
- name: string;
23310
- docs: string[];
23311
- writable: boolean;
23312
- pda: {
23313
- seeds: {
23314
- kind: string;
23315
- value: number[];
23316
- }[];
23317
- program?: undefined;
23318
- };
23319
- signer?: undefined;
23320
- address?: undefined;
23321
- } | {
23322
- name: string;
23323
- docs: string[];
23324
- writable: boolean;
23325
- signer?: undefined;
23326
- pda?: undefined;
23327
- address?: undefined;
23328
- } | {
23329
- name: string;
23330
- writable: boolean;
23331
- pda: {
23332
- seeds: ({
23333
- kind: string;
23334
- value: number[];
23335
- path?: undefined;
23336
- } | {
23337
- kind: string;
23338
- path: string;
23339
- value?: undefined;
23340
- })[];
23341
- program: {
23342
- kind: string;
23343
- value: number[];
23344
- };
23345
- };
23346
- signer?: undefined;
23347
- docs?: undefined;
23348
- address?: undefined;
23349
- } | {
23350
- name: string;
23351
- address: string;
23352
- writable?: undefined;
23353
- signer?: undefined;
23354
- docs?: undefined;
23355
- pda?: undefined;
23356
- })[];
23357
- args: {
23358
- name: string;
23359
- type: string;
23360
- }[];
23361
- } | {
23362
- name: string;
23363
- docs: string[];
23364
- discriminator: number[];
23365
- accounts: ({
23366
- name: string;
23367
- writable: boolean;
23368
- pda: {
23369
- seeds: ({
23370
- kind: string;
23371
- value: number[];
23372
- path?: undefined;
23373
- } | {
23374
- kind: string;
23375
- path: string;
23376
- value?: undefined;
23377
- })[];
23378
- };
23379
- signer?: undefined;
23380
- } | {
23381
- name: string;
23382
- writable: boolean;
23383
- pda?: undefined;
23384
- signer?: undefined;
23385
- } | {
23386
- name: string;
23387
- writable: boolean;
23388
- signer: boolean;
23389
- pda?: undefined;
23390
- } | {
23391
- name: string;
23392
- writable?: undefined;
23393
- pda?: undefined;
23394
- signer?: undefined;
23395
- })[];
23396
- args: {
23397
- name: string;
23398
- type: string;
23399
- }[];
23400
- } | {
23401
- name: string;
23402
- docs: string[];
23403
- discriminator: number[];
23404
- accounts: ({
23405
- name: string;
23406
- writable: boolean;
23407
- pda: {
23408
- seeds: ({
23409
- kind: string;
23410
- value: number[];
23411
- path?: undefined;
23412
- } | {
23413
- kind: string;
23414
- path: string;
23415
- value?: undefined;
23416
- })[];
23417
- };
23418
- signer?: undefined;
23419
- address?: undefined;
23420
- } | {
23421
- name: string;
23422
- writable?: undefined;
23423
- pda?: undefined;
23424
- signer?: undefined;
23425
- address?: undefined;
23426
- } | {
23427
- name: string;
23428
- writable: boolean;
23429
- signer: boolean;
23430
- pda?: undefined;
23431
- address?: undefined;
23432
- } | {
23433
- name: string;
23434
- address: string;
23435
- writable?: undefined;
23436
- pda?: undefined;
23437
- signer?: undefined;
23438
- })[];
23439
- args: {
23440
- name: string;
23441
- type: string;
23442
- }[];
23443
- } | {
23444
- name: string;
23445
- docs: string[];
23446
- discriminator: number[];
23447
- accounts: ({
23448
- name: string;
23449
- writable: boolean;
23450
- pda: {
23451
- seeds: {
23452
- kind: string;
23453
- value: number[];
23454
- }[];
23455
- };
23456
- signer?: undefined;
23457
- address?: undefined;
23458
- } | {
23459
- name: string;
23460
- signer: boolean;
23461
- writable?: undefined;
23462
- pda?: undefined;
23463
- address?: undefined;
23464
- } | {
23465
- name: string;
23466
- writable: boolean;
23467
- signer: boolean;
23468
- pda?: undefined;
23469
- address?: undefined;
23470
- } | {
23471
- name: string;
23472
- address: string;
23473
- writable?: undefined;
23474
- pda?: undefined;
23475
- signer?: undefined;
23476
- })[];
23477
- args: {
23478
- name: string;
23479
- type: string;
23480
- }[];
23481
- } | {
23482
- name: string;
23483
- docs: string[];
23484
- discriminator: number[];
23485
- accounts: ({
23486
- name: string;
23487
- writable: boolean;
23488
- pda: {
23489
- seeds: ({
23490
- kind: string;
23491
- value: number[];
23492
- path?: undefined;
23493
- } | {
23494
- kind: string;
23495
- path: string;
23496
- value?: undefined;
23497
- })[];
23498
- program?: undefined;
23499
- };
23500
- signer?: undefined;
23501
- } | {
23502
- name: string;
23503
- writable: boolean;
23504
- pda: {
23505
- seeds: ({
23506
- kind: string;
23507
- path: string;
23508
- value?: undefined;
23509
- } | {
23510
- kind: string;
23511
- value: number[];
23512
- path?: undefined;
23513
- })[];
23514
- program: {
23515
- kind: string;
23516
- value: number[];
23517
- };
23518
- };
23519
- signer?: undefined;
23520
- } | {
23521
- name: string;
23522
- writable: boolean;
23523
- pda?: undefined;
23524
- signer?: undefined;
23525
- } | {
23526
- name: string;
23527
- signer: boolean;
23528
- writable?: undefined;
23529
- pda?: undefined;
23530
- } | {
23531
- name: string;
23532
- writable?: undefined;
23533
- pda?: undefined;
23534
- signer?: undefined;
23535
- })[];
23536
- args: {
23537
- name: string;
23538
- type: string;
23539
- }[];
23540
- })[];
23541
- accounts: {
23542
- name: string;
23543
- discriminator: number[];
23544
- }[];
23545
- events: {
23546
- name: string;
23547
- discriminator: number[];
23548
- }[];
23549
- errors: {
23550
- code: number;
23551
- name: string;
23552
- msg: string;
23553
- }[];
23554
- types: ({
23555
- name: string;
23556
- serialization: string;
23557
- repr: {
23558
- kind: string;
23559
- };
23560
- type: {
23561
- kind: string;
23562
- fields: {
23563
- name: string;
23564
- type: string;
23565
- }[];
23566
- };
23567
- } | {
23568
- name: string;
23569
- type: {
23570
- kind: string;
23571
- fields: ({
23572
- name: string;
23573
- type: string;
23574
- } | {
23575
- name: string;
23576
- type: {
23577
- array: (string | number)[];
23578
- };
23579
- })[];
23580
- };
23581
- serialization?: undefined;
23582
- repr?: undefined;
23583
- })[];
23584
- };
23585
-
23586
- /**
23587
- * @TODO
23588
- * @description withdraw funds from the specified pool including accrued rewards
23589
- * @param signer signer / wallet object
23590
- * @param options object including pool contract address, user wallet address, and more
23591
- * @returns claim tx hash
23592
- */
23593
- export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
23594
- year: string;
23595
- month: string;
23596
- day: string;
23597
- receiverIndex: string;
23598
- }): Promise<string>;
23599
-
23600
- export declare enum VaultRedemptionStatus {
23601
- AWAITING_COOLDOWN = "awaiting_cooldown",
23602
- READY_TO_CLAIM = "ready_to_claim"
23603
- }
23604
-
23605
- /**
23606
- * Request to redeem vault shares. For EVM-1 vaults this queues a standard
23607
- * redemption (claimable later via `vaultRedeem`); for EVM-2 vaults this
23608
- * also handles the receipt-token allowance automatically. Pass
23609
- * `isInstantRedeem: true` for vaults that support instant settlement.
23610
- *
23611
- * Approval of the receipt token (EVM-2) is always waited on before the
23612
- * redeem call, regardless of the caller's `wait` flag.
23613
- *
23614
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23615
- * @param options Vault address, wallet, amount, optional `isInstantRedeem`,
23616
- * optional `wait` to wait for the redeem receipt.
23617
- * @returns Redeem transaction hash.
23618
- * @throws AugustValidationError on invalid wallet/target/amount.
23619
- * @throws AugustSDKError when the redeem submission or on-chain call fails.
23620
- *
23621
- * @example
23622
- * ```ts
23623
- * const hash = await augustSdk.evm.vaultRequestRedeem({
23624
- * target: vaultAddress,
23625
- * wallet: walletAddress,
23626
- * amount: '10', // 10 shares (UI units)
23627
- * wait: true,
23628
- * });
23629
- * ```
23630
- *
23631
- * @example Instant redemption
23632
- * ```ts
23633
- * await augustSdk.evm.vaultRequestRedeem({
23634
- * target: vaultAddress,
23635
- * wallet: walletAddress,
23636
- * amount: '10',
23637
- * isInstantRedeem: true,
23638
- * });
23639
- * ```
23640
- */
23641
- export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23642
-
23643
- /**
23644
- * Vault addresses registered on a `SwapRouter` via `enableVault`. The
23645
- * presence of a vault here is the signal to route its deposits through the
23646
- * SwapRouter rather than the legacy adapter path.
23647
- *
23648
- * Entries mirror the on-chain `vaultInfo[addr].referenceAsset != 0` state of
23649
- * the `SwapRouter` deployment. Verify against the deployed contract before
23650
- * adding a new entry — a vault that is not registered on-chain will revert
23651
- * with `InvalidVault` at deposit time.
23652
- *
23653
- * Lowercase comparison is required when checking — use
23654
- * {@link vaultUsesSwapRouter} rather than reading this set directly.
23655
- */
23656
- export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
23657
-
23658
- /**
23659
- * Vault Receipt Symbol Mapping
23660
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23661
- */
23662
- declare type VaultSymbols = 'predlp' | 'sentusd' | 'pregrid' | 'repouscc' | 'earnxrp' | 'tivkbtc' | 'tivusdt0' | 'supermon' | 'earnmon' | 'k3europ' | 'wmon/ausd' | 'wbtc/ausd' | 'earnausd_monad' | 'sausd' | 'farmbold' | 'sentuscc' | 'sentbtc' | 'svusdc' | 'apusdc' | 'testwethtsa' | 'tacusr' | 'upinjusdt' | 'tac-teth' | 'upausd' | 'taccbbtc' | 'xupusdc' | 'uptbtc' | 'gteth' | 'ageth' | 'upusdc' | 'hgeth' | 'upssylva' | 'hbbtc' | 'hbhype' | 'upazt' | 'susdt' | 'upedge' | 'coreusdc' | 'upcusdo' | 'shifteth' | 'upsusde' | 'uplbtc' | 'upavax' | 'tacrseth' | 'musd' | 'earnausd' | 'alpineusdcflagship' | 'alpinecoinshiftusdc' | 'upbtc' | 'upstrbtc' | 'maxiusr' | 'upgammausdc' | 'xhype' | 'wildusd' | 'alpinebtc' | 'prenusd' | 'upyzusd' | 'upnusd' | 'hlpe' | 'nemo eth yield';
23663
-
23664
- /**
23665
- * Whether a vault has been registered on a `SwapRouter` and should route
23666
- * its deposits through it. Address comparison is case-insensitive.
23667
- *
23668
- * @param vaultAddress - August vault address.
23669
- * @returns `true` when the vault is in {@link VAULTS_USING_SWAP_ROUTER}.
23670
- */
23671
- export declare function vaultUsesSwapRouter(vaultAddress: IAddress): boolean;
23672
-
23673
- export declare function verifyAugustKey(key: string): Promise<boolean>;
23674
-
23675
- export declare function verifyInfuraKey(key: string): Promise<boolean>;
23676
-
23677
- /**
23678
- * Convert a viem WalletClient to an ethers-compatible Signer
23679
- * Uses the walletClient as a provider and wraps it for ethers compatibility
23680
- * @param walletClient Viem WalletClient from wagmi or viem
23681
- * @returns Ethers Signer that can be used with the SDK
23682
- */
23683
- export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
23684
-
23685
- /**
23686
- * @param walletClient a wagmi-derived client (from useWalletClient)
23687
- * @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
23688
- */
23689
- export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
23690
-
23691
- export declare const WEBSERVER_ENDPOINTS: {
23692
- default: {
23693
- hello: string;
23694
- protected: string;
23695
- };
23696
- auth: {
23697
- verify: string;
23698
- sign: string;
23699
- login: string;
23700
- nonce: string;
23701
- refresh: string;
23702
- };
23703
- subaccount: {
23704
- rewards: (subaccount: IAddress) => string;
23705
- tokens: (subaccount: IAddress) => string;
23706
- twap: {
23707
- create: (subaccount: IAddress) => string;
23708
- stop: (subaccount: IAddress, id: string) => string;
23709
- fills: (subaccount: IAddress, id: string) => string;
23710
- };
23711
- debank: (subaccount: IAddress) => string;
23712
- health_factor: (subaccount: IAddress) => string;
23713
- summary: (subaccount: IAddress) => string;
23714
- batch: (subaccount: IAddress) => string;
23715
- loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
23716
- cefi: (subaccount: IAddress) => string;
23717
- otc_positions: (subaccount: IAddress) => string;
23718
- _: (subaccount: IAddress) => string;
23719
- };
23720
- users: {
23721
- get: string;
23722
- };
23723
- prices: (symbol: string) => string;
23724
- metrics: {
23725
- pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
23726
- };
23727
- public: {
23728
- integrations: {
23729
- morpho: {
23730
- apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
23731
- };
23732
- };
23733
- tokenizedVault: {
23734
- loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
23735
- subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
23736
- list: string;
23737
- byVaultAddress: (vaultAddress: VaultAddress) => string;
23738
- historicalApy: (vaultAddress: IAddress) => string;
23739
- historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
23740
- annualizedApy: (vaultAddress: IAddress) => string;
23741
- summary: (vaultAddress: IAddress) => string;
23742
- withdrawals: (chain: string, vaultAddress: IAddress) => string;
23743
- debank: (vaultAddress: IAddress) => string;
23744
- userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
23745
- archivedVaults: string;
23746
- };
23747
- points: {
23748
- byUserAddress: (userAddress: IAddress) => string;
23749
- register: string;
23750
- leaderboard: string;
23751
- };
23752
- vaults: {
23753
- pendingRedemptions: (vaultAddress: IAddress) => string;
23754
- };
23755
- pnl: {
23756
- unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
23757
- unrealizedLatest: string;
23758
- };
23759
- };
23760
- upshift: {
23761
- vaults: {
23762
- metadata: string;
23763
- };
23764
- };
23765
- };
23766
-
23767
- export declare const WEBSERVER_URL: {
23768
- production: string;
23769
- staging: string;
23770
- development: string;
23771
- localhost: string;
23772
- qa: string;
23773
- public: string;
23774
- upshift: string;
23775
- };
23776
-
23777
- /**
23778
- * Withdrawal request with computed claimable date and current processing status.
23779
- * The unique identifier is (receiver, claimableDate).
23780
- *
23781
- * @interface WithdrawalRequestStatus
23782
- */
23783
- export declare interface WithdrawalRequestStatus {
23784
- /** Transaction hash of the withdrawal request */
23785
- transactionHash: string;
23786
- /** Block timestamp when the withdrawal was requested (seconds, UTC) */
23787
- requestTimestamp: number;
23788
- /** Shares amount being redeemed */
23789
- shares: bigint;
23790
- /** Receiver address for the withdrawal */
23791
- receiver: string;
23792
- /** Computed claimable date in UTC (year, month, day) */
23793
- claimableDate: {
23794
- year: number;
23795
- month: number;
23796
- day: number;
23797
- };
23798
- /** Epoch timestamp when this withdrawal becomes claimable */
23799
- claimableEpoch: number;
23800
- /** Current status of the withdrawal */
23801
- status: 'pending' | 'ready_to_claim' | 'processed';
23802
- /** Transaction hash of the processing transaction (if processed) */
23803
- processedTransactionHash?: string;
23804
- /** Assets received (if processed) */
23805
- assetsReceived?: bigint;
23806
- }
23807
-
23808
- /**
23809
- * Higher-order function to wrap SDK methods with performance tracking.
23810
- * Tracks method calls, timing, chain usage, and errors.
23811
- *
23812
- * @param methodName - Name of the method being wrapped
23813
- * @param method - The original async method
23814
- * @param getChainId - Function to get current chain ID
23815
- * @returns Wrapped method with tracking
23816
- */
23817
- export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
23818
-
23819
- /**
23820
- * Wrap async operations with exponential backoff retry logic.
23821
- * Retries on network errors with increasing delays between attempts.
23822
- * @param fn - Async function to execute with retry logic
23823
- * @param maxRetries - Maximum number of retry attempts
23824
- * @param baseDelay - Initial delay in milliseconds (doubles each retry)
23825
- * @param shouldRetry - Custom function to determine if error is retryable
23826
- * @returns Result of successful function execution
23827
- * @throws Last error if all retries exhausted
23828
- */
23829
- export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
23830
-
23831
- /**
23832
- * Higher-order function to wrap synchronous SDK methods with tracking.
23833
- * Uses breadcrumbs for tracking since spans require async context.
23834
- *
23835
- * @param methodName - Name of the method being wrapped
23836
- * @param method - The original sync method
23837
- * @param getChainId - Function to get current chain ID
23838
- * @returns Wrapped method with tracking
23839
- */
23840
- export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
23841
-
23842
- export declare const WRAPPER_ADAPTOR: {
23843
- 43114: IAddress;
23844
- 1: IAddress;
23845
- };
23846
-
23847
- export { }
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 { }