@augustdigital/sdk 9.6.0 → 9.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/sdk.d.ts CHANGED
@@ -15209,15 +15209,10 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
15209
15209
  * Pure and synchronous — no RPC, no I/O — so it is safe to call inside the hot
15210
15210
  * path with no added latency.
15211
15211
  *
15212
- * Known imprecision — vault shares are transferable ERC-20 receipt tokens, so a
15213
- * wallet that *received* shares via a direct token transfer (never deposited,
15214
- * never withdrew) legitimately has `position > 0` with no history records and
15215
- * will throw `HISTORY_UNAVAILABLE` even though its history loaded fine. This is
15216
- * not a regression — the pre-guard formula reported that same position as 100%
15217
- * profit, which was also wrong — but the error message is misleading for that
15218
- * (rare) path. If receipt-token transfer becomes a real user flow, distinguish
15219
- * it here (e.g. by checking for a share-transfer event) rather than widening
15220
- * the guard.
15212
+ * Shares received by a direct token transfer (never deposited, never withdrew)
15213
+ * reach this guard as deposits: {@link getVaultUserLifetimePnl} prices them
15214
+ * with {@link transferCostBasis} first. The guard still throws for such a
15215
+ * wallet when its transfers cannot be read or priced.
15221
15216
  *
15222
15217
  * @param params - See {@link PnlHistoryConsistencyParams}.
15223
15218
  * @returns `void` when the history is consistent.
@@ -15323,9 +15318,10 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
15323
15318
  * token.
15324
15319
  *
15325
15320
  * Backed by `GET /risk/collateral_excess_or_deficit` (60-second server-side
15326
- * cache), which resolves the subaccount and reads its current health factor,
15327
- * so an authenticated (admin-scoped) August API key is required. Makes
15328
- * exactly one HTTP request and no RPC calls.
15321
+ * cache), which resolves the subaccount and reads its current health factor.
15322
+ * The backend serves this route to anonymous callers today, so no August API
15323
+ * key is needed; pass one if you get `AUTH_UNAUTHORIZED`. Makes exactly one
15324
+ * HTTP request and no RPC calls.
15329
15325
  *
15330
15326
  * @param params.subaccount Subaccount (smart-contract wallet) address.
15331
15327
  * @param params.tokenAddress Collateral token address to evaluate.
@@ -15355,9 +15351,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
15355
15351
  * This is a pure, read-only simulation: the backend `POST
15356
15352
  * /risk/collateral_simulation` endpoint (60-second server-side cache)
15357
15353
  * computes required collateral and effective discount factors and changes
15358
- * no state. It runs against the authenticated backend, so an
15359
- * (admin-scoped) August API key is required. Makes exactly one HTTP request
15360
- * and no RPC calls.
15354
+ * no state. The route is public, so no August API key is needed. Makes
15355
+ * exactly one HTTP request and no RPC calls.
15361
15356
  *
15362
15357
  * @param input Simulation parameters — see {@link ICollateralSimulationInput}. `collateral_tokens` and `collateral_token_allocation` must be non-empty and equal length; when `on_platform` is `true`, both `loan_redeployed_token_*` fields are required.
15363
15358
  * @returns The simulated {@link ICollateralSimulationResults}: total debt, required collateral, resulting health factor, and a per-token breakdown.
@@ -15882,6 +15877,7 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
15882
15877
  constructor({ appName, providers, keys, monitoring, analytics, versionCheck, timeoutMs, publicApiBaseUrl, attribution, }: IAugustBase);
15883
15878
  /**
15884
15879
  * Verify the configured August API key and mark this instance as authorized.
15880
+ * Only for SDKs built with `keys.august`; a keyless SDK skips `init()`.
15885
15881
  * @throws Error when `keys.august` is missing or rejected by the API.
15886
15882
  */
15887
15883
  init(): Promise<void>;
@@ -16367,7 +16363,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
16367
16363
  * @param props - Vault address, wallet address, and optional chain ID
16368
16364
  * @returns Lifetime PnL data including realized and unrealized PnL in both native token and USD
16369
16365
  * @throws {@link AugustHistoryUnavailableError} (`HISTORY_UNAVAILABLE`) when a
16370
- * live position has no indexed deposits or withdrawals.
16366
+ * live position has no indexed deposits, withdrawals or priceable share
16367
+ * transfers.
16371
16368
  * @throws {@link AugustPriceUnavailableError} (`PRICE_UNAVAILABLE`) when the
16372
16369
  * vault's underlying asset has no USD price — the USD fields are never
16373
16370
  * computed from a stand-in price.
@@ -16593,7 +16590,13 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
16593
16590
  * Subaccount operation class interacting with August Subaccounts
16594
16591
  * Subaccount is a smart contract wallet that serves as the fundamental infrastructure for August's platform.
16595
16592
  * It functions as a cross-margin account designed for optimal capital efficiency.
16596
- * Most of the operations require a August API key to perform
16593
+ *
16594
+ * `getSubaccountSummary`, `getSubaccountHealthFactor`, `getSubaccountLoans`,
16595
+ * `getSubaccountCefiPositions` and `getSubaccountOtcPositions` work without an
16596
+ * August API key for subaccounts linked to a vault; `getSubaccountDebank` is
16597
+ * public. `getSubaccountTransactions` needs a key authorized for the
16598
+ * subaccount, and `getAllSubaccounts` and `getSubaccountLoanByAddress` need an
16599
+ * admin key.
16597
16600
  */
16598
16601
  export declare class AugustSubAccounts extends AugustBase {
16599
16602
  private headers;
@@ -17074,7 +17077,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
17074
17077
  * @param props Vault address, wallet address, and optional chain ID
17075
17078
  * @returns Lifetime PnL data including realized and unrealized PnL
17076
17079
  * @throws {@link AugustHistoryUnavailableError} (`HISTORY_UNAVAILABLE`) when a
17077
- * live position has no indexed deposits or withdrawals.
17080
+ * live position has no indexed deposits, withdrawals or priceable share
17081
+ * transfers.
17078
17082
  * @throws {@link AugustPriceUnavailableError} (`PRICE_UNAVAILABLE`) when the
17079
17083
  * vault's underlying asset has no USD price.
17080
17084
  */
@@ -18580,15 +18584,21 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
18580
18584
  export declare function fetchAugustWithBearer(bearerToken: string, relativeUrl: string, options?: IFetchAugustOptions): Promise<Response>;
18581
18585
 
18582
18586
  /**
18583
- * Make authenticated requests to August backend services using API key.
18587
+ * Make requests to August backend services, sending an API key when one is
18588
+ * configured. Many backend routes — vault-linked sub-account reads, the two
18589
+ * collateral risk routes, timelock requests — answer anonymous callers, so a
18590
+ * missing key is not an error here: the request goes out without the
18591
+ * `x-api-key` header and the backend decides. Routes that do require a key
18592
+ * answer `401`, which surfaces as an `AugustAuthError` with code
18593
+ * `AUTH_UNAUTHORIZED`.
18584
18594
  * Automatically logs errors with correlation IDs for debugging.
18585
- * @param apiKey - August API key for authentication
18595
+ * @param apiKey - August API key, or `undefined` for an anonymous request
18586
18596
  * @param relativeUrl - Endpoint path relative to base URL
18587
18597
  * @param options - Request configuration including method and headers
18588
18598
  * @returns Response object if successful
18589
18599
  * @throws Error with correlation ID if request fails
18590
18600
  */
18591
- export declare function fetchAugustWithKey(apiKey: string, relativeUrl: string, options?: IFetchAugustOptions): Promise<Response>;
18601
+ export declare function fetchAugustWithKey(apiKey: string | undefined, relativeUrl: string, options?: IFetchAugustOptions): Promise<Response>;
18592
18602
 
18593
18603
  /**
18594
18604
  * @deprecated Use fetchVaultDebankResponse for vault-level queries.
@@ -19989,12 +19999,21 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
19989
19999
  * from the price server. There is no stand-in price: when none resolves the
19990
20000
  * getter throws rather than returning USD values it cannot know.
19991
20001
  *
20002
+ * Shares received by transfer: when history has no deposit, peer transfers of
20003
+ * the share token (see {@link selectPeerTransfers}) are valued at the vault's
20004
+ * daily share ratio ({@link transferCostBasis}) — received shares become
20005
+ * `totalDeposited`, sent shares add to `totalWithdrawn`. PnL for such a wallet
20006
+ * therefore runs from the day its shares arrived. This costs one extra
20007
+ * subgraph query, plus one backend timeseries request when transfers exist,
20008
+ * and only for wallets with no indexed deposit.
20009
+ *
19992
20010
  * @param vault - Vault contract address
19993
20011
  * @param wallet - User wallet address
19994
20012
  * @param options - RPC configuration and service options
19995
20013
  * @returns Lifetime PnL data in both native token and USD
19996
20014
  * @throws {@link AugustHistoryUnavailableError} (`HISTORY_UNAVAILABLE`) when a
19997
- * live position has no indexed deposits or withdrawals.
20015
+ * live position has no indexed deposits, withdrawals or priceable share
20016
+ * transfers.
19998
20017
  * @throws {@link AugustPriceUnavailableError} (`PRICE_UNAVAILABLE`) when the
19999
20018
  * underlying asset has no USD price, or `asset()` cannot be read.
20000
20019
  */
@@ -20180,7 +20199,9 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20180
20199
  * is given, the vault state and share mint are read to quote the shares this
20181
20200
  * deposit should mint, and that quote lowered by `options.slippageBps`
20182
20201
  * (default {@link DEFAULT_SLIPPAGE_BPS}) is passed as the floor; the program
20183
- * reverts with `SlippageExceeded` if execution would mint fewer.
20202
+ * reverts with `SlippageExceeded` if execution would mint fewer. An `idl`
20203
+ * that predates `deposit_checked` gets the plain `deposit` with no floor,
20204
+ * unless `options` asks for one — then it throws {@link AugustValidationError}.
20184
20205
  */
20185
20206
  declare function handleSolanaDeposit({ provider, connection, network, vaultProgramId, vaultAddress, depositAmount, publicKey, idl, options, }: {
20186
20207
  vaultProgramId: PublicKey | string;
@@ -20209,6 +20230,9 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20209
20230
  * handler already reads, **net of the withdrawal fee**, and that quote
20210
20231
  * lowered by `options.slippageBps` (default {@link DEFAULT_SLIPPAGE_BPS}) is
20211
20232
  * passed as the floor; the program reverts with `SlippageExceeded` below it.
20233
+ * An `idl` that predates `redeem_checked` gets the plain `redeem` with no
20234
+ * floor, unless `options` asks for one — then it throws
20235
+ * {@link AugustValidationError}.
20212
20236
  * @throws AugustValidationError on missing wallet/programId or invalid amount,
20213
20237
  * or when the wallet holds fewer shares than `redeemShares`.
20214
20238
  * @throws AugustSDKError when a candidate token account's balance cannot be
@@ -20449,7 +20473,13 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20449
20473
  providers?: IProvidersConfig;
20450
20474
  solana?: ISolanaConfig;
20451
20475
  stellar?: IStellarConfig;
20452
- keys: IKeys;
20476
+ /**
20477
+ * Provider keys. Optional: vault reads and vault-linked sub-account reads
20478
+ * work without an August key. Supply `august` for admin and curator methods,
20479
+ * for authenticated-user reads such as `getDiscountFactors`, and for
20480
+ * sub-account reads where the subaccount is not linked to a vault.
20481
+ */
20482
+ keys?: IKeys;
20453
20483
  monitoring?: IMonitoring;
20454
20484
  /** Analytics configuration. Enabled by default (opt-out model). */
20455
20485
  analytics?: IAnalyticsConfig;
@@ -21267,8 +21297,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
21267
21297
  /** Per-request timeout in ms. Defaults to `REQUEST_TIMEOUT_MS`. */
21268
21298
  timeoutMs?: number;
21269
21299
  /**
21270
- * @deprecated Bypasses the API-key check for legacy unauthenticated endpoints.
21271
- * Will be removed in a future major version; pass a valid `apiKey` instead.
21300
+ * @deprecated No longer has any effect: an absent `apiKey` already sends an
21301
+ * anonymous request. Will be removed in a future major version; drop it.
21272
21302
  */
21273
21303
  override?: boolean;
21274
21304
  };
@@ -22323,6 +22353,10 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
22323
22353
  * Skips the quote and the single snapshot read it needs. `0n` restores the
22324
22354
  * unguarded behaviour of the plain `deposit` instruction.
22325
22355
  *
22356
+ * When the handler's `idl` predates `deposit_checked`, a non-zero floor or
22357
+ * any `slippageBps` throws {@link AugustValidationError} instead of being
22358
+ * silently dropped; with neither, the plain `deposit` is sent.
22359
+ *
22326
22360
  * Must be a `bigint` in `0 .. 2^64-1`; anything else throws
22327
22361
  * {@link AugustValidationError} before the transaction is built.
22328
22362
  */
@@ -22350,6 +22384,10 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
22350
22384
  * Explicit floor in raw deposit-mint units, net of the withdrawal fee,
22351
22385
  * passed to `redeem_checked` as is. Skips the quote. `0n` restores the
22352
22386
  * unguarded behaviour of the plain `redeem` instruction.
22387
+ *
22388
+ * When the handler's `idl` predates `redeem_checked`, a non-zero floor or
22389
+ * any `slippageBps` throws {@link AugustValidationError} instead of being
22390
+ * silently dropped; with neither, the plain `redeem` is sent.
22353
22391
  */
22354
22392
  minAssetsOut?: bigint;
22355
22393
  }
@@ -24006,6 +24044,11 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
24006
24044
  symbol: string;
24007
24045
  subgraph: string;
24008
24046
  address: string;
24047
+ /**
24048
+ * Subgraph indexing the vault's separate receipt token (evm-2 vaults), when
24049
+ * one is deployed. Absent for vaults whose shares are the vault token itself.
24050
+ */
24051
+ receipt_subgraph?: string;
24009
24052
  }
24010
24053
 
24011
24054
  export declare type IVaultOrderParam = 'asc' | 'desc';
@@ -25153,6 +25196,9 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
25153
25196
  tokenPriceUsd: number;
25154
25197
  }
25155
25198
 
25199
+ /** The receipt-token transfer fields the transfer cost basis reads. */
25200
+ export declare type PnlTransfer = Pick<ISubgraphTransfer, 'from' | 'to' | 'value' | 'timestamp_'>;
25201
+
25156
25202
  /** Multiplier applied to the poll interval after each NOT_FOUND poll. */
25157
25203
  declare const POLL_INTERVAL_BACKOFF = 1.5;
25158
25204
 
@@ -26377,6 +26423,30 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
26377
26423
 
26378
26424
  /* Excluded from this release type: SDKSentrySink */
26379
26425
 
26426
+ /**
26427
+ * Keep the receipt-token transfers that moved shares between `wallet` and
26428
+ * another holder.
26429
+ *
26430
+ * Vault shares are transferable ERC-20 tokens, so a wallet can hold a position
26431
+ * it never deposited into — a migration airdrop, a DEX purchase, a transfer from
26432
+ * another wallet. Mints (from the zero address), burns (to it) and transfers to
26433
+ * or from the vault itself are dropped: those are the deposit and withdrawal
26434
+ * legs the subgraph history already records, and counting them again would
26435
+ * double the cost basis.
26436
+ *
26437
+ * @param transfers - Receipt-token transfers touching `wallet`, as returned by
26438
+ * the vault's transfer subgraph.
26439
+ * @param wallet - The wallet whose position is being valued.
26440
+ * @param vault - The vault contract address.
26441
+ * @returns The peer-to-peer transfers, in input order. Addresses compare
26442
+ * case-insensitively.
26443
+ * @example
26444
+ * ```ts
26445
+ * const peer = selectPeerTransfers(transfers, wallet, vault);
26446
+ * ```
26447
+ */
26448
+ export declare function selectPeerTransfers<T extends PnlTransfer>(transfers: T[], wallet: IAddress, vault: IAddress): T[];
26449
+
26380
26450
  /**
26381
26451
  * Fetches the senders whitelist contract address from a whitelisted allocation vault
26382
26452
  * @param signer - signer / provider object
@@ -27464,1056 +27534,1116 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
27464
27534
  */
27465
27535
  export declare function trackNetworkSwitch(chainId: number): void;
27466
27536
 
27467
- export declare function truncate(s: string, amount?: number): string;
27468
-
27469
- /* Excluded from this release type: tryRecoverTxHash */
27470
-
27471
- /**
27472
- * Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
27473
- * Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
27474
- * checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
27475
- * would throw). Add an address here to drop its `latest_reported_tvl` from
27476
- * the headline number — e.g. closed pre-deposit vaults, test vaults, or
27477
- * migrated v1 pools that are double-counted by a v2 successor.
27478
- */
27479
- export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
27480
-
27481
- /**
27482
- * Validity window for a submitted Soroban invocation (seconds).
27483
- *
27484
- * This becomes the transaction's `maxTime`. Validators reject a tx whose
27485
- * `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
27486
- * realistic sign-then-submit path: hardware wallets, careful manual review,
27487
- * and institutional approval flows (e.g. Fordefi) that don't sign instantly.
27488
- * 10 minutes comfortably covers those while staying well inside the Soroban
27489
- * footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
27490
- *
27491
- * The window is anchored to the *network* clock (see `getNetworkCloseTime` in
27492
- * soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
27493
- * make the deadline expire early.
27494
- */
27495
- declare const TX_TIMEOUT_SECONDS = 600;
27496
-
27497
- export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
27498
- [Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
27499
- } & {
27500
- /**
27501
- * Return the function for a given name. This is useful when a contract
27502
- * method name conflicts with a JavaScript name such as ``prototype`` or
27503
- * when using a Contract programatically.
27504
- */
27505
- getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
27506
- /**
27507
- * Return the event for a given name. This is useful when a contract
27508
- * event name conflicts with a JavaScript name such as ``prototype`` or
27509
- * when using a Contract programatically.
27510
- */
27511
- getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
27512
- /**
27513
- * All the Events available on this contract.
27514
- */
27515
- filters: {
27516
- [EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
27517
- };
27518
- };
27519
-
27520
- 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']>>>> {
27521
- (...args: [...TEventArgs]): DeferredTopicFilter;
27522
- /**
27523
- * The name of the Contract event.
27524
- */
27525
- name: TEventName;
27526
- /**
27527
- * The fragment of the Contract event. This will throw on ambiguous
27528
- * method names.
27529
- */
27530
- fragment: EventFragment;
27531
- /**
27532
- * Returns the fragment constrained by %%args%%. This can be used to
27533
- * resolve ambiguous event names.
27534
- */
27535
- getFragment(...args: [...TEventArgs]): EventFragment;
27536
- }
27537
-
27538
- 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>> {
27539
- (...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
27540
- /**
27541
- * The name of the Contract method.
27542
- */
27543
- name: TFunctionName;
27544
- /**
27545
- * The fragment of the Contract method. This will throw on ambiguous
27546
- * method names.
27547
- */
27548
- fragment: TFragment;
27549
- /**
27550
- * Returns the fragment constrained by %%args%%. This can be used to
27551
- * resolve ambiguous method names.
27552
- */
27553
- getFragment(...args: [...TInputArgs]): TFragment;
27554
- /**
27555
- * Returns a populated transaction that can be used to perform the
27556
- * contract method with %%args%%.
27557
- */
27558
- populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
27559
- /**
27560
- * Call the contract method with %%args%% and return the value.
27561
- *
27562
- * If the return value is a single type, it will be dereferenced and
27563
- * returned directly, otherwise the full Result will be returned.
27564
- */
27565
- staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
27566
- /**
27567
- * Send a transaction for the contract method with %%args%%.
27568
- */
27569
- send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
27570
- /**
27571
- * Estimate the gas to send the contract method with %%args%%.
27572
- */
27573
- estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
27574
- /**
27575
- * Call the contract method with %%args%% and return the Result
27576
- * without any dereferencing.
27577
- */
27578
- staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
27537
+ /** Asset amounts that peer transfers moved into and out of a position. */
27538
+ export declare interface TransferCostBasis {
27539
+ /** Assets the received shares were worth on arrival, raw at vault decimals. */
27540
+ receivedRaw: bigint;
27541
+ /** Assets the sent shares were worth when they left, raw at vault decimals. */
27542
+ sentRaw: bigint;
27579
27543
  }
27580
27544
 
27581
- 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;
27582
-
27583
- export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
27584
- name: TFunction['name'];
27585
- type: TFunction['type'];
27586
- inputs: TFunction['inputs'];
27587
- outputs: TFunction['outputs'];
27588
- stateMutability: TFunction['stateMutability'];
27589
- };
27590
-
27591
- export declare function unixToDate(epoch: number): Date;
27592
-
27593
27545
  /**
27594
- * Update the current user identity in Sentry.
27595
- * Called when wallet address changes.
27546
+ * Value peer share transfers in the vault's asset, at the vault's share ratio
27547
+ * on the day each one happened.
27596
27548
  *
27597
- * @param walletAddress - New wallet address (or undefined to clear)
27598
- * @param environment - Current environment
27599
- */
27600
- export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
27601
-
27602
- /* Excluded from this release type: validateAmountPrecision */
27603
-
27604
- /**
27605
- * Vault adapter configurations mapping vault addresses to their adapter settings
27606
- */
27607
- export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
27608
-
27609
- 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}`>;
27610
-
27611
- /**
27612
- * Hardcoded subaccount addresses for specific vaults allocations
27613
- */
27614
- export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
27615
- AgoraAUSD: {
27616
- address: IAddress;
27617
- subaccount: IAddress;
27618
- useDebank: boolean;
27619
- };
27620
- earnAUSD: {
27621
- address: IAddress;
27622
- subaccount: IAddress;
27623
- useDebank: boolean;
27624
- };
27625
- MonarqXRP: {
27626
- address: IAddress;
27627
- subaccount: IAddress;
27628
- useDebank: boolean;
27629
- };
27630
- };
27631
-
27632
- /**
27633
- * The functions to call on the vault contract
27634
- * @returns The functions to call
27635
- */
27636
- export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
27637
-
27638
- export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
27639
-
27640
- export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
27641
-
27642
- export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
27643
-
27644
- /**
27645
- * Vault Symbols Mapping
27646
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
27647
- */
27648
- export declare const VAULT_SYMBOLS: Record<IAddress, string>;
27649
-
27650
- /**
27651
- * Vault Symbols Reverse Mapping
27652
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
27653
- */
27654
- export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
27655
-
27656
- /**
27657
- * Address type for vault contracts across all supported chains.
27658
- * EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
27659
- * and Stellar vaults use 56-character base32 addresses (G/C prefix).
27549
+ * Used by {@link getVaultUserLifetimePnl} when a wallet has no indexed
27550
+ * deposits: received shares become its cost basis and sent shares count as
27551
+ * withdrawn, so lifetime PnL for a transfer recipient reads "PnL since the
27552
+ * shares arrived" rather than failing or reporting the whole position as
27553
+ * profit. A day with no usable ratio takes the latest earlier day's, and a
27554
+ * transfer older than the history takes the earliest day's.
27660
27555
  *
27661
- * Use this instead of `IAddress` when the address may belong to any chain.
27662
- */
27663
- export declare type VaultAddress = string;
27664
-
27665
- /**
27666
- * allowance checks user's current allowance per pool
27667
- * @param signer - signer / provider object
27668
- * @param options - object including pool contract address, user wallet address
27669
- * @returns normalized number object of the user's current allowance
27670
- */
27671
- export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
27672
-
27673
- /**
27674
- * Approve a vault (or the appropriate adapter wrapper) to spend a token
27675
- * ahead of a separate deposit call. Spender routing mirrors
27676
- * {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
27677
- * vault). Returns `undefined` when the existing allowance already covers
27678
- * `amount` **or** when the deposit asset is native.
27679
- *
27680
- * @returns Transaction hash when an approval was sent, `undefined` when
27681
- * the existing allowance already covers `amount` or the deposit asset is
27682
- * native (no ERC-20 allowance applies). Use {@link approve} for a
27683
- * discriminated `ApproveResult` if you need to tell those two cases apart.
27684
- * @throws AugustValidationError on invalid wallet/target/amount.
27685
- *
27686
- * @example
27687
- * ```ts
27688
- * const hash = await augustSdk.evm.vaultApprove({
27689
- * target: '0x...', // vault contract address
27690
- * wallet: walletAddress,
27691
- * amount: '100', // 100 of the deposit token (UI units)
27692
- * wait: true, // wait for the approval to confirm
27693
- * });
27694
- * if (hash) console.log('approve tx', hash);
27695
- * // hash === undefined means the on-chain allowance already covers the
27696
- * // amount, or the deposit asset is native (msg.value, no allowance).
27697
- * ```
27698
- */
27699
- export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
27700
-
27701
- /**
27702
- * Deposit underlying token into the specified vault. Auto-routes to the
27703
- * correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
27704
- * Paraswap adapter, native-token wrapper, depositWithPermit) based on the
27705
- * vault version and `depositAsset`.
27706
- *
27707
- * Amounts are encoded against the **deposit token's** decimals, not the
27708
- * vault's share decimals. The SDK reads the appropriate decimals via the
27709
- * vault metadata and the asset's ERC-20.
27710
- *
27711
- * Approval is handled automatically: if the existing allowance doesn't
27712
- * cover `amount`, an `approve` is sent and **always waited for** (regardless
27713
- * of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
27714
- * of the approval on Monad-style RPCs.
27715
- *
27716
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
27717
- * @param options Vault address, wallet, amount, optional `depositAsset` for
27718
- * adapter routes, optional `wait` to wait for the deposit receipt.
27719
- * @returns Deposit transaction hash.
27720
- * @throws AugustValidationError on invalid wallet/target/amount or missing
27721
- * adapter config when `depositAsset` differs from the vault underlying.
27722
- * @throws AugustSDKError when the deposit submission or on-chain call fails.
27723
- *
27724
- * @example
27725
- * ```ts
27726
- * const hash = await augustSdk.evm.vaultDeposit({
27727
- * target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
27728
- * wallet: walletAddress,
27729
- * amount: '100', // 100 USDC (UI units)
27730
- * wait: true, // wait for the deposit receipt
27731
- * });
27732
- * ```
27733
- *
27734
- * @example Adapter deposit (different deposit asset than the vault's underlying)
27735
- * ```ts
27736
- * await augustSdk.evm.vaultDeposit({
27737
- * target: vaultAddress,
27738
- * wallet: walletAddress,
27739
- * amount: '0.5',
27740
- * depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
27741
- * chainId: 1,
27742
- * });
27743
- * ```
27744
- */
27745
- export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
27746
-
27747
- /**
27748
- * Check if vault has adapter support
27749
- */
27750
- export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
27751
-
27752
- /**
27753
- * august_vault program IDL (Anchor).
27754
- *
27755
- * GENERATED — do not edit by hand. Source of truth is the program repo's build
27756
- * artifact: solana-vaults `frontend/idl/august_vault.json` (synced from the
27757
- * vendored program by `scripts/sync-idl.sh`). Regenerate from there, NOT with
27758
- * `anchor idl fetch`: an Anchor IDL upload is not refreshed by a program
27759
- * upgrade, so every IDL published for this program lineage is stale — both
27760
- * `up12…` on mainnet (last written 2026-01-21) and the `C8B1…` devnet reference
27761
- * (2026-01-23) predate the ProgramConfig build deployed on 2026-08-06.
27556
+ * Sent shares count only against a received basis. A wallet that sent shares
27557
+ * but received none gets a zero basis, so the lifetime-PnL history guard still
27558
+ * decides for it instead of reporting the sent shares as profit.
27762
27559
  *
27763
- * `address` is a build stamp (the mainnet id), NOT network-aware. Never rely on
27764
- * it: SolanaAdapter/getProgram resolve the real program id per network from
27765
- * programIds, or from an explicit `programId` override.
27560
+ * Pure and synchronous. Assumes, as the getter does, that shares and assets
27561
+ * share the vault's decimals.
27766
27562
  *
27767
- * Drift is guarded by tests/vaults/solana-idl-drift.test.ts: the deployed binary
27768
- * is pinned, every discriminator declared here must appear in that binary, and
27769
- * live VaultState accounts must decode against this file.
27770
- */
27771
- declare const vaultIdl: {
27772
- accounts: {
27773
- discriminator: number[];
27774
- name: string;
27775
- }[];
27776
- address: string;
27777
- errors: {
27778
- code: number;
27779
- msg: string;
27780
- name: string;
27781
- }[];
27782
- events: {
27783
- discriminator: number[];
27784
- name: string;
27785
- }[];
27786
- instructions: ({
27787
- accounts: ({
27788
- name: string;
27789
- signer: boolean;
27790
- writable: boolean;
27791
- docs?: undefined;
27792
- pda?: undefined;
27793
- address?: undefined;
27794
- } | {
27795
- docs: string[];
27796
- name: string;
27797
- signer: boolean;
27798
- writable: boolean;
27799
- pda?: undefined;
27800
- address?: undefined;
27801
- } | {
27802
- docs: string[];
27803
- name: string;
27804
- writable: boolean;
27805
- signer?: undefined;
27806
- pda?: undefined;
27807
- address?: undefined;
27808
- } | {
27809
- docs: string[];
27810
- name: string;
27811
- signer?: undefined;
27812
- writable?: undefined;
27813
- pda?: undefined;
27814
- address?: undefined;
27815
- } | {
27816
- name: string;
27817
- pda: {
27818
- program: {
27819
- kind: string;
27820
- value: number[];
27821
- };
27822
- seeds: ({
27823
- kind: string;
27824
- value: number[];
27825
- path?: undefined;
27826
- } | {
27827
- kind: string;
27828
- path: string;
27829
- value?: undefined;
27830
- })[];
27831
- };
27832
- writable: boolean;
27833
- signer?: undefined;
27834
- docs?: undefined;
27835
- address?: undefined;
27836
- } | {
27837
- address: string;
27838
- name: string;
27839
- signer?: undefined;
27840
- writable?: undefined;
27841
- docs?: undefined;
27842
- pda?: undefined;
27843
- })[];
27844
- args: {
27845
- name: string;
27846
- type: string;
27847
- }[];
27848
- discriminator: number[];
27849
- docs: string[];
27850
- name: string;
27851
- } | {
27852
- accounts: ({
27853
- docs: string[];
27854
- name: string;
27855
- pda: {
27856
- seeds: {
27857
- kind: string;
27858
- value: number[];
27859
- }[];
27860
- };
27861
- signer?: undefined;
27862
- writable?: undefined;
27863
- address?: undefined;
27864
- } | {
27865
- docs: string[];
27866
- name: string;
27867
- signer: boolean;
27868
- pda?: undefined;
27869
- writable?: undefined;
27870
- address?: undefined;
27871
- } | {
27872
- docs: string[];
27873
- name: string;
27874
- signer: boolean;
27875
- writable: boolean;
27876
- pda?: undefined;
27877
- address?: undefined;
27878
- } | {
27879
- name: string;
27880
- docs?: undefined;
27881
- pda?: undefined;
27882
- signer?: undefined;
27883
- writable?: undefined;
27884
- address?: undefined;
27885
- } | {
27886
- name: string;
27887
- writable: boolean;
27888
- docs?: undefined;
27889
- pda?: undefined;
27890
- signer?: undefined;
27891
- address?: undefined;
27892
- } | {
27893
- address: string;
27894
- name: string;
27895
- docs?: undefined;
27896
- pda?: undefined;
27897
- signer?: undefined;
27898
- writable?: undefined;
27899
- })[];
27900
- args: {
27901
- name: string;
27902
- type: string;
27903
- }[];
27904
- discriminator: number[];
27905
- docs: string[];
27906
- name: string;
27907
- } | {
27908
- accounts: ({
27909
- docs: string[];
27910
- name: string;
27911
- signer: boolean;
27912
- pda?: undefined;
27913
- writable?: undefined;
27914
- address?: undefined;
27915
- } | {
27916
- docs: string[];
27917
- name: string;
27918
- pda: {
27919
- program: {
27920
- kind: string;
27921
- value: number[];
27922
- };
27923
- seeds: {
27924
- kind: string;
27925
- value: number[];
27926
- }[];
27927
- };
27928
- signer?: undefined;
27929
- writable?: undefined;
27930
- address?: undefined;
27931
- } | {
27932
- name: string;
27933
- signer: boolean;
27934
- writable: boolean;
27935
- docs?: undefined;
27936
- pda?: undefined;
27937
- address?: undefined;
27938
- } | {
27939
- name: string;
27940
- pda: {
27941
- seeds: {
27942
- kind: string;
27943
- value: number[];
27944
- }[];
27945
- program?: undefined;
27946
- };
27947
- writable: boolean;
27948
- docs?: undefined;
27949
- signer?: undefined;
27950
- address?: undefined;
27951
- } | {
27952
- address: string;
27953
- name: string;
27954
- docs?: undefined;
27955
- signer?: undefined;
27956
- pda?: undefined;
27957
- writable?: undefined;
27958
- })[];
27959
- args: {
27960
- name: string;
27961
- type: string;
27962
- }[];
27963
- discriminator: number[];
27964
- docs: string[];
27965
- name: string;
27966
- } | {
27967
- accounts: ({
27968
- name: string;
27969
- writable: boolean;
27970
- signer?: undefined;
27971
- address?: undefined;
27972
- } | {
27973
- name: string;
27974
- writable?: undefined;
27975
- signer?: undefined;
27976
- address?: undefined;
27977
- } | {
27978
- name: string;
27979
- signer: boolean;
27980
- writable?: undefined;
27981
- address?: undefined;
27982
- } | {
27983
- name: string;
27984
- signer: boolean;
27985
- writable: boolean;
27986
- address?: undefined;
27987
- } | {
27988
- address: string;
27989
- name: string;
27990
- writable?: undefined;
27991
- signer?: undefined;
27992
- })[];
27993
- args: {
27994
- name: string;
27995
- type: string;
27996
- }[];
27997
- discriminator: number[];
27998
- docs: string[];
27999
- name: string;
28000
- } | {
28001
- accounts: ({
28002
- name: string;
28003
- writable: boolean;
28004
- pda?: undefined;
28005
- signer?: undefined;
28006
- } | {
28007
- name: string;
28008
- pda: {
28009
- program: {
28010
- kind: string;
28011
- value: number[];
28012
- };
28013
- seeds: {
28014
- kind: string;
28015
- path: string;
28016
- }[];
28017
- };
28018
- writable: boolean;
28019
- signer?: undefined;
28020
- } | {
28021
- name: string;
28022
- signer: boolean;
28023
- writable?: undefined;
28024
- pda?: undefined;
28025
- } | {
28026
- name: string;
28027
- writable?: undefined;
28028
- pda?: undefined;
28029
- signer?: undefined;
28030
- })[];
28031
- args: {
28032
- name: string;
28033
- type: string;
28034
- }[];
28035
- discriminator: number[];
28036
- docs: string[];
28037
- name: string;
28038
- } | {
28039
- accounts: ({
28040
- name: string;
28041
- pda: {
28042
- seeds: {
28043
- kind: string;
28044
- value: number[];
28045
- }[];
28046
- };
28047
- writable: boolean;
28048
- signer?: undefined;
28049
- } | {
28050
- name: string;
28051
- signer: boolean;
28052
- pda?: undefined;
28053
- writable?: undefined;
28054
- })[];
28055
- args: {
28056
- name: string;
28057
- type: string;
28058
- }[];
28059
- discriminator: number[];
28060
- docs: string[];
28061
- name: string;
28062
- } | {
28063
- accounts: ({
28064
- docs: string[];
28065
- name: string;
28066
- signer: boolean;
28067
- writable?: undefined;
28068
- pda?: undefined;
28069
- address?: undefined;
28070
- } | {
28071
- docs: string[];
28072
- name: string;
28073
- writable: boolean;
28074
- signer?: undefined;
28075
- pda?: undefined;
28076
- address?: undefined;
28077
- } | {
28078
- docs: string[];
28079
- name: string;
28080
- signer?: undefined;
28081
- writable?: undefined;
28082
- pda?: undefined;
28083
- address?: undefined;
28084
- } | {
28085
- name: string;
28086
- pda: {
28087
- program: {
28088
- kind: string;
28089
- value: number[];
28090
- };
28091
- seeds: ({
28092
- kind: string;
28093
- value: number[];
28094
- path?: undefined;
28095
- } | {
28096
- kind: string;
28097
- path: string;
28098
- value?: undefined;
28099
- })[];
28100
- };
28101
- writable: boolean;
28102
- docs?: undefined;
28103
- signer?: undefined;
28104
- address?: undefined;
28105
- } | {
28106
- address: string;
28107
- name: string;
28108
- docs?: undefined;
28109
- signer?: undefined;
28110
- writable?: undefined;
28111
- pda?: undefined;
28112
- })[];
28113
- args: {
28114
- name: string;
28115
- type: string;
28116
- }[];
28117
- discriminator: number[];
28118
- docs: string[];
28119
- name: string;
28120
- })[];
28121
- metadata: {
28122
- description: string;
28123
- name: string;
28124
- spec: string;
28125
- version: string;
28126
- };
28127
- types: ({
28128
- name: string;
28129
- repr: {
28130
- kind: string;
28131
- };
28132
- serialization: string;
28133
- type: {
28134
- fields: {
28135
- name: string;
28136
- type: string;
28137
- }[];
28138
- kind: string;
28139
- };
28140
- docs?: undefined;
28141
- } | {
28142
- docs: string[];
28143
- name: string;
28144
- type: {
28145
- fields: ({
28146
- docs: string[];
28147
- name: string;
28148
- type: string;
28149
- } | {
28150
- docs: string[];
28151
- name: string;
28152
- type: {
28153
- array: (string | number)[];
28154
- };
28155
- })[];
28156
- kind: string;
28157
- };
28158
- repr?: undefined;
28159
- serialization?: undefined;
28160
- } | {
28161
- name: string;
28162
- type: {
28163
- fields: ({
28164
- name: string;
28165
- type: string;
28166
- docs?: undefined;
28167
- } | {
28168
- name: string;
28169
- type: {
28170
- array: (string | number)[];
28171
- };
28172
- docs?: undefined;
28173
- } | {
28174
- docs: string[];
28175
- name: string;
28176
- type: string;
28177
- } | {
28178
- docs: string[];
28179
- name: string;
28180
- type: {
28181
- array: (string | number)[];
28182
- };
28183
- })[];
28184
- kind: string;
28185
- };
28186
- repr?: undefined;
28187
- serialization?: undefined;
28188
- docs?: undefined;
28189
- })[];
28190
- };
28191
-
28192
- /**
28193
- * @description withdraw funds from the specified pool including accrued rewards
28194
- * @param signer signer / wallet object
28195
- * @param options object including pool contract address, user wallet address, and more
28196
- * @returns claim tx hash
28197
- */
28198
- export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
28199
- year: string;
28200
- month: string;
28201
- day: string;
28202
- receiverIndex: string;
28203
- }): Promise<string>;
28204
-
28205
- export declare enum VaultRedemptionStatus {
28206
- AWAITING_COOLDOWN = "awaiting_cooldown",
28207
- READY_TO_CLAIM = "ready_to_claim"
28208
- }
28209
-
28210
- /**
28211
- * Request to redeem vault shares. For EVM-1 vaults this queues a standard
28212
- * redemption (claimable later via `vaultRedeem`). For EVM-2 vaults the queued
28213
- * `requestRedeem` escrows the shares in the vault via `transferFrom`, so this
28214
- * also approves the receipt token when its allowance is short; the instant
28215
- * path (`isInstantRedeem: true`) burns the caller's shares directly and sends
28216
- * no approval.
28217
- *
28218
- * The receipt-token approval (EVM-2 queued path) is always waited on before
28219
- * the redeem call, regardless of the caller's `wait` flag.
28220
- *
28221
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
28222
- * @param options Vault address, wallet, amount, optional `isInstantRedeem`,
28223
- * optional `wait` to wait for the redeem receipt.
28224
- * @returns Redeem transaction hash.
28225
- * @throws AugustValidationError on invalid wallet/target/amount.
28226
- * @throws AugustSDKError when the redeem submission or on-chain call fails.
28227
- *
28228
- * @example
28229
- * ```ts
28230
- * const hash = await augustSdk.evm.vaultRequestRedeem({
28231
- * target: vaultAddress,
28232
- * wallet: walletAddress,
28233
- * amount: '10', // 10 shares (UI units)
28234
- * wait: true,
28235
- * });
28236
- * ```
28237
- *
28238
- * @example Instant redemption
28239
- * ```ts
28240
- * await augustSdk.evm.vaultRequestRedeem({
28241
- * target: vaultAddress,
28242
- * wallet: walletAddress,
28243
- * amount: '10',
28244
- * isInstantRedeem: true,
28245
- * });
28246
- * ```
28247
- */
28248
- export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
28249
-
28250
- /**
28251
- * @deprecated Renamed to {@link SWAP_ROUTER_ELIGIBLE_VAULTS} (itself now
28252
- * superseded by {@link getSwapRouterEligibleVaults}, the on-chain-derived
28253
- * resolver), and the semantics changed: this set no longer drives
28254
- * `vaultDeposit` auto-routing (that branch was removed) — it only marks vaults
28255
- * whose UI may offer the swap-router deposit surface. Kept as an alias for one
28256
- * release; migrate to the async resolver.
28257
- */
28258
- export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
28259
-
28260
- /**
28261
- * Vault Receipt Symbol Mapping
28262
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
28263
- */
28264
- 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';
28265
-
28266
- /**
28267
- * @deprecated Renamed to {@link isSwapRouterEligible} (itself now superseded by
28268
- * {@link getSwapRouterEligibleVaults}, the on-chain-derived resolver). The
28269
- * meaning also changed: it no longer implies `vaultDeposit` routes the vault
28270
- * through the SwapRouter (that behavior was removed) — it only reports
28271
- * swap-router *eligibility* for the opt-in deposit surface. Kept as an alias
28272
- * for one release; migrate to the async resolver.
28273
- */
28274
- export declare const vaultUsesSwapRouter: typeof isSwapRouterEligible;
28275
-
28276
- export declare function verifyAugustKey(key: string): Promise<boolean>;
28277
-
28278
- export declare function verifyInfuraKey(key: string): Promise<boolean>;
28279
-
28280
- /**
28281
- * Convert a viem WalletClient to an ethers-compatible Signer
28282
- * Uses the walletClient as a provider and wraps it for ethers compatibility
28283
- * @param walletClient Viem WalletClient from wagmi or viem
28284
- * @returns Ethers Signer that can be used with the SDK
28285
- */
28286
- export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
28287
-
28288
- /**
28289
- * @param walletClient a wagmi-derived client (from useWalletClient)
28290
- * @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
28291
- */
28292
- export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
28293
-
28294
- export declare const WEBSERVER_ENDPOINTS: {
28295
- default: {
28296
- /** @deprecated No backend route. Removed in the next major release. */
28297
- hello: string;
28298
- protected: string;
28299
- };
28300
- auth: {
28301
- verify: string;
28302
- sign: string;
28303
- login: string;
28304
- nonce: string;
28305
- refresh: string;
28306
- };
28307
- subaccount: {
28308
- list: (offset?: number, limit?: number) => string;
28309
- /** @deprecated No backend route. Removed in the next major release. */
28310
- rewards: (subaccount: IAddress) => string;
28311
- tokens: (subaccount: IAddress) => string;
28312
- twap: {
28313
- create: (subaccount: IAddress) => string;
28314
- stop: (subaccount: IAddress, id: string) => string;
28315
- fills: (subaccount: IAddress, id: string) => string;
28316
- };
28317
- debank: (subaccount: IAddress) => string;
28318
- health_factor: (subaccount: IAddress) => string;
28319
- summary: (subaccount: IAddress) => string;
28320
- /** @deprecated No backend route. Removed in the next major release. */
28321
- batch: (subaccount: IAddress) => string;
28322
- loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
28323
- cefi: (subaccount: IAddress) => string;
28324
- otc_positions: (subaccount: IAddress) => string;
28325
- loanByAddress: (loanAddress: string, chainId: number) => string;
28326
- _: (subaccount: IAddress) => string;
28327
- };
28328
- transactions: {
28329
- v2: (subaccount: string, startTime?: string, endTime?: string) => string;
28330
- };
28331
- otc: {
28332
- positions: string;
28333
- marginRequirements: (otcCounterpartyId?: string, payer?: string) => string;
28334
- };
28335
- curator: {
28336
- vaultSubaccounts: (vaultAddress: string) => string;
28337
- vaultWhitelist: (vaultAddress: string) => string;
28338
- };
28339
- timelockRequests: (vaultAddress: string, chainId: number, status?: string) => string;
28340
- users: {
28341
- get: string;
28342
- };
28343
- dashboard: {
28344
- loans: string;
28345
- };
28346
- risk: {
28347
- discountFactors: string;
28348
- collateralExcessOrDeficit: (subaccount: string, tokenAddress: string, tokenChain: number, targetHealthFactor?: number) => string;
28349
- collateralSimulation: string;
28350
- };
28351
- prices: (symbol: string) => string;
28352
- metrics: {
28353
- pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
28354
- vaultPerformanceFees: (params: {
28355
- vaultAddress: string;
28356
- annualizedFeesPct: number;
28357
- nativeDenominated: boolean;
28358
- calculationPeriod: string;
28359
- startDate?: string;
28360
- endDate?: string;
28361
- }) => string;
28362
- };
28363
- public: {
28364
- integrations: {
28365
- morpho: {
28366
- apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
28367
- };
28368
- };
28369
- tokenizedVault: {
28370
- loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
28371
- subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
28372
- list: string;
28373
- byVaultAddress: (vaultAddress: VaultAddress) => string;
28374
- historicalApy: (vaultAddress: IAddress) => string;
28375
- historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
28376
- annualizedApy: (vaultAddress: IAddress) => string;
28377
- summary: (vaultAddress: IAddress) => string;
28378
- withdrawals: (chain: string, vaultAddress: IAddress) => string;
28379
- debank: (vaultAddress: IAddress) => string;
28380
- userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
28381
- archivedVaults: string;
28382
- };
28383
- points: {
28384
- byUserAddress: (userAddress: IAddress) => string;
28385
- register: string;
28386
- leaderboard: string;
28387
- };
28388
- vaults: {
28389
- pendingRedemptions: (vaultAddress: IAddress) => string;
28390
- };
28391
- pnl: {
28392
- unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
28393
- unrealizedLatest: string;
28394
- };
28395
- revertReason: (txHash: string, chain: number) => string;
28396
- oracleClassification: (vaultAddress: string, chainId: number) => string;
28397
- transparency: {
28398
- positions: (vaultAddress: string, chainId: number) => string;
28399
- historicalAllocations: (vaultAddress: string, chainId: number, startDate?: string, endDate?: string) => string;
28400
- fees: (vaultAddress: string, chainId: number) => string;
28401
- ratioSeries: (vaultAddress: string, startDate?: string, endDate?: string, limit?: number) => string;
28402
- smoothedApy: (vaultAddress: string, daysAgo: number, averagingPeriodDays: number, applySmoothing: boolean) => string;
28403
- governanceRoles: (vaultAddress: string, chainId: number) => string;
28404
- governancePermissions: (vaultAddress: string, chainId: number) => string;
28405
- governanceTimelocks: (vaultAddress: string, chainId: number, status?: string) => string;
28406
- governanceAuditLog: (vaultAddress: string, chainId: number, category?: string, before?: string, limit?: number) => string;
28407
- };
28408
- };
28409
- upshift: {
28410
- vaults: {
28411
- metadata: string;
28412
- };
28413
- };
28414
- };
28415
-
28416
- export declare const WEBSERVER_URL: {
28417
- production: string;
28418
- staging: string;
28419
- development: string;
28420
- localhost: string;
28421
- qa: string;
28422
- public: string;
28423
- upshift: string;
28424
- };
28425
-
28426
- /**
28427
- * Withdrawal request with computed claimable date and current processing status.
28428
- * The unique identifier is (receiver, claimableDate).
28429
- *
28430
- * @interface WithdrawalRequestStatus
28431
- */
28432
- export declare interface WithdrawalRequestStatus {
28433
- /** Transaction hash of the withdrawal request */
28434
- transactionHash: string;
28435
- /** Block timestamp when the withdrawal was requested (seconds, UTC) */
28436
- requestTimestamp: number;
28437
- /** Shares amount being redeemed */
28438
- shares: bigint;
28439
- /** Receiver address for the withdrawal */
28440
- receiver: string;
28441
- /** Computed claimable date in UTC (year, month, day) */
28442
- claimableDate: {
28443
- year: number;
28444
- month: number;
28445
- day: number;
28446
- };
28447
- /** Epoch timestamp when this withdrawal becomes claimable */
28448
- claimableEpoch: number;
28449
- /** Current status of the withdrawal */
28450
- status: 'pending' | 'ready_to_claim' | 'processed';
28451
- /** Transaction hash of the processing transaction (if processed) */
28452
- processedTransactionHash?: string;
28453
- /** Assets received (if processed) */
28454
- assetsReceived?: bigint;
28455
- }
28456
-
28457
- /**
28458
- * Higher-order function to wrap SDK methods with performance tracking.
28459
- * Tracks method calls, timing, chain usage, and errors.
28460
- *
28461
- * @param methodName - Name of the method being wrapped
28462
- * @param method - The original async method
28463
- * @param getChainId - Function to get current chain ID
28464
- * @returns Wrapped method with tracking
28465
- */
28466
- export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
28467
-
28468
- /**
28469
- * Wrap async operations with exponential backoff retry logic.
28470
- * Retries on network errors with increasing delays between attempts.
28471
- * @param fn - Async function to execute with retry logic
28472
- * @param maxRetries - Maximum number of retry attempts
28473
- * @param baseDelay - Initial delay in milliseconds (doubles each retry)
28474
- * @param shouldRetry - Custom function to determine if error is retryable
28475
- * @returns Result of successful function execution
28476
- * @throws Last error if all retries exhausted
28477
- */
28478
- export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
28479
-
28480
- /**
28481
- * Higher-order function to wrap synchronous SDK methods with tracking.
28482
- * Uses breadcrumbs for tracking since spans require async context.
28483
- *
28484
- * @param methodName - Name of the method being wrapped
28485
- * @param method - The original sync method
28486
- * @param getChainId - Function to get current chain ID
28487
- * @returns Wrapped method with tracking
28488
- */
28489
- export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
28490
-
28491
- export declare const WRAPPER_ADAPTOR: {
28492
- 43114: IAddress;
28493
- 1: IAddress;
28494
- };
28495
-
28496
- /**
28497
- * Wrap an ethers signer so every transaction it sends carries the active
28498
- * ERC-8021 attribution suffix (Base Builder Codes).
28499
- *
28500
- * Every ethers write in the SDK funnels through the wrapped signer's
28501
- * `sendTransaction`, so this single wrap attributes all vault writes. The
28502
- * wrapper is a Proxy — the caller's signer object is never mutated, so a
28503
- * signer reused outside the SDK sends unattributed transactions. Attribution
28504
- * state is read at send time, not wrap time; when no attribution is
28505
- * configured (see `IAugustBase.attribution`) the wrapper is a pass-through.
28506
- *
28507
- * Plain value transfers (no calldata) are never attributed, and calldata
28508
- * already ending in the ERC-8021 marker is left untouched. When the
28509
- * configured `chains` list requires a chain check and the transaction does
28510
- * not carry a `chainId`, the signer's provider network is consulted (one
28511
- * cached RPC call); if that lookup fails the transaction is sent
28512
- * unattributed.
28513
- *
28514
- * @param signer Normalized ethers Signer or Wallet.
28515
- * @returns A proxied signer with an attribution-aware `sendTransaction`.
28516
- */
28517
- export declare function wrapSignerWithAttribution<T extends Signer | Wallet>(signer: T): T;
28518
-
28519
- export { }
27563
+ * @param params - See {@link TransferCostBasisParams}.
27564
+ * @returns The received and sent asset amounts, raw at the vault's decimals;
27565
+ * both zero when no shares were received.
27566
+ * @throws {@link AugustHistoryUnavailableError} (`HISTORY_UNAVAILABLE`) when no
27567
+ * day in `history` carries a positive, finite `asset_share_ratio`.
27568
+ * @example
27569
+ * ```ts
27570
+ * const { data } = await fetchVaultHistoricalTimeseries(vault, nDays);
27571
+ * const { receivedRaw, sentRaw } = transferCostBasis({
27572
+ * transfers: selectPeerTransfers(transfers, wallet, vault),
27573
+ * wallet,
27574
+ * vault,
27575
+ * history: data,
27576
+ * });
27577
+ * ```
27578
+ */
27579
+ export declare function transferCostBasis({ transfers, wallet, vault, history, }: TransferCostBasisParams): TransferCostBasis;
27580
+
27581
+ /** Inputs {@link transferCostBasis} prices. */
27582
+ export declare interface TransferCostBasisParams {
27583
+ /** Peer transfers touching `wallet` — see {@link selectPeerTransfers}. */
27584
+ transfers: PnlTransfer[];
27585
+ /** The wallet whose cost basis is being computed. */
27586
+ wallet: IAddress;
27587
+ /** The vault contract address, used for the error message and context. */
27588
+ vault: IAddress;
27589
+ /**
27590
+ * The vault's daily history from `fetchVaultHistoricalTimeseries`, keyed by
27591
+ * UTC date (`YYYY-MM-DD`). Only `asset_share_ratio` (assets per share) is
27592
+ * read.
27593
+ */
27594
+ history: Record<string, Pick<IHistoricalTimeseriesPoint, 'asset_share_ratio'>>;
27595
+ }
27596
+
27597
+ export declare function truncate(s: string, amount?: number): string;
27598
+
27599
+ /* Excluded from this release type: tryRecoverTxHash */
27600
+
27601
+ /**
27602
+ * Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
27603
+ * Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
27604
+ * checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
27605
+ * would throw). Add an address here to drop its `latest_reported_tvl` from
27606
+ * the headline number — e.g. closed pre-deposit vaults, test vaults, or
27607
+ * migrated v1 pools that are double-counted by a v2 successor.
27608
+ */
27609
+ export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
27610
+
27611
+ /**
27612
+ * Validity window for a submitted Soroban invocation (seconds).
27613
+ *
27614
+ * This becomes the transaction's `maxTime`. Validators reject a tx whose
27615
+ * `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
27616
+ * realistic sign-then-submit path: hardware wallets, careful manual review,
27617
+ * and institutional approval flows (e.g. Fordefi) that don't sign instantly.
27618
+ * 10 minutes comfortably covers those while staying well inside the Soroban
27619
+ * footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
27620
+ *
27621
+ * The window is anchored to the *network* clock (see `getNetworkCloseTime` in
27622
+ * soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
27623
+ * make the deadline expire early.
27624
+ */
27625
+ declare const TX_TIMEOUT_SECONDS = 600;
27626
+
27627
+ export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
27628
+ [Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
27629
+ } & {
27630
+ /**
27631
+ * Return the function for a given name. This is useful when a contract
27632
+ * method name conflicts with a JavaScript name such as ``prototype`` or
27633
+ * when using a Contract programatically.
27634
+ */
27635
+ getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
27636
+ /**
27637
+ * Return the event for a given name. This is useful when a contract
27638
+ * event name conflicts with a JavaScript name such as ``prototype`` or
27639
+ * when using a Contract programatically.
27640
+ */
27641
+ getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
27642
+ /**
27643
+ * All the Events available on this contract.
27644
+ */
27645
+ filters: {
27646
+ [EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
27647
+ };
27648
+ };
27649
+
27650
+ 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']>>>> {
27651
+ (...args: [...TEventArgs]): DeferredTopicFilter;
27652
+ /**
27653
+ * The name of the Contract event.
27654
+ */
27655
+ name: TEventName;
27656
+ /**
27657
+ * The fragment of the Contract event. This will throw on ambiguous
27658
+ * method names.
27659
+ */
27660
+ fragment: EventFragment;
27661
+ /**
27662
+ * Returns the fragment constrained by %%args%%. This can be used to
27663
+ * resolve ambiguous event names.
27664
+ */
27665
+ getFragment(...args: [...TEventArgs]): EventFragment;
27666
+ }
27667
+
27668
+ 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>> {
27669
+ (...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
27670
+ /**
27671
+ * The name of the Contract method.
27672
+ */
27673
+ name: TFunctionName;
27674
+ /**
27675
+ * The fragment of the Contract method. This will throw on ambiguous
27676
+ * method names.
27677
+ */
27678
+ fragment: TFragment;
27679
+ /**
27680
+ * Returns the fragment constrained by %%args%%. This can be used to
27681
+ * resolve ambiguous method names.
27682
+ */
27683
+ getFragment(...args: [...TInputArgs]): TFragment;
27684
+ /**
27685
+ * Returns a populated transaction that can be used to perform the
27686
+ * contract method with %%args%%.
27687
+ */
27688
+ populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
27689
+ /**
27690
+ * Call the contract method with %%args%% and return the value.
27691
+ *
27692
+ * If the return value is a single type, it will be dereferenced and
27693
+ * returned directly, otherwise the full Result will be returned.
27694
+ */
27695
+ staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
27696
+ /**
27697
+ * Send a transaction for the contract method with %%args%%.
27698
+ */
27699
+ send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
27700
+ /**
27701
+ * Estimate the gas to send the contract method with %%args%%.
27702
+ */
27703
+ estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
27704
+ /**
27705
+ * Call the contract method with %%args%% and return the Result
27706
+ * without any dereferencing.
27707
+ */
27708
+ staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
27709
+ }
27710
+
27711
+ 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;
27712
+
27713
+ export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
27714
+ name: TFunction['name'];
27715
+ type: TFunction['type'];
27716
+ inputs: TFunction['inputs'];
27717
+ outputs: TFunction['outputs'];
27718
+ stateMutability: TFunction['stateMutability'];
27719
+ };
27720
+
27721
+ export declare function unixToDate(epoch: number): Date;
27722
+
27723
+ /**
27724
+ * Update the current user identity in Sentry.
27725
+ * Called when wallet address changes.
27726
+ *
27727
+ * @param walletAddress - New wallet address (or undefined to clear)
27728
+ * @param environment - Current environment
27729
+ */
27730
+ export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
27731
+
27732
+ /* Excluded from this release type: validateAmountPrecision */
27733
+
27734
+ /**
27735
+ * Vault adapter configurations mapping vault addresses to their adapter settings
27736
+ */
27737
+ export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
27738
+
27739
+ 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}`>;
27740
+
27741
+ /**
27742
+ * Hardcoded subaccount addresses for specific vaults allocations
27743
+ */
27744
+ export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
27745
+ AgoraAUSD: {
27746
+ address: IAddress;
27747
+ subaccount: IAddress;
27748
+ useDebank: boolean;
27749
+ };
27750
+ earnAUSD: {
27751
+ address: IAddress;
27752
+ subaccount: IAddress;
27753
+ useDebank: boolean;
27754
+ };
27755
+ MonarqXRP: {
27756
+ address: IAddress;
27757
+ subaccount: IAddress;
27758
+ useDebank: boolean;
27759
+ };
27760
+ };
27761
+
27762
+ /**
27763
+ * The functions to call on the vault contract
27764
+ * @returns The functions to call
27765
+ */
27766
+ export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
27767
+
27768
+ export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
27769
+
27770
+ export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
27771
+
27772
+ export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
27773
+
27774
+ /**
27775
+ * Vault Symbols Mapping
27776
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
27777
+ */
27778
+ export declare const VAULT_SYMBOLS: Record<IAddress, string>;
27779
+
27780
+ /**
27781
+ * Vault Symbols Reverse Mapping
27782
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
27783
+ */
27784
+ export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
27785
+
27786
+ /**
27787
+ * Address type for vault contracts across all supported chains.
27788
+ * EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
27789
+ * and Stellar vaults use 56-character base32 addresses (G/C prefix).
27790
+ *
27791
+ * Use this instead of `IAddress` when the address may belong to any chain.
27792
+ */
27793
+ export declare type VaultAddress = string;
27794
+
27795
+ /**
27796
+ * allowance checks user's current allowance per pool
27797
+ * @param signer - signer / provider object
27798
+ * @param options - object including pool contract address, user wallet address
27799
+ * @returns normalized number object of the user's current allowance
27800
+ */
27801
+ export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
27802
+
27803
+ /**
27804
+ * Approve a vault (or the appropriate adapter wrapper) to spend a token
27805
+ * ahead of a separate deposit call. Spender routing mirrors
27806
+ * {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
27807
+ * vault). Returns `undefined` when the existing allowance already covers
27808
+ * `amount` **or** when the deposit asset is native.
27809
+ *
27810
+ * @returns Transaction hash when an approval was sent, `undefined` when
27811
+ * the existing allowance already covers `amount` or the deposit asset is
27812
+ * native (no ERC-20 allowance applies). Use {@link approve} for a
27813
+ * discriminated `ApproveResult` if you need to tell those two cases apart.
27814
+ * @throws AugustValidationError on invalid wallet/target/amount.
27815
+ *
27816
+ * @example
27817
+ * ```ts
27818
+ * const hash = await augustSdk.evm.vaultApprove({
27819
+ * target: '0x...', // vault contract address
27820
+ * wallet: walletAddress,
27821
+ * amount: '100', // 100 of the deposit token (UI units)
27822
+ * wait: true, // wait for the approval to confirm
27823
+ * });
27824
+ * if (hash) console.log('approve tx', hash);
27825
+ * // hash === undefined means the on-chain allowance already covers the
27826
+ * // amount, or the deposit asset is native (msg.value, no allowance).
27827
+ * ```
27828
+ */
27829
+ export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
27830
+
27831
+ /**
27832
+ * Deposit underlying token into the specified vault. Auto-routes to the
27833
+ * correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
27834
+ * Paraswap adapter, native-token wrapper, depositWithPermit) based on the
27835
+ * vault version and `depositAsset`.
27836
+ *
27837
+ * Amounts are encoded against the **deposit token's** decimals, not the
27838
+ * vault's share decimals. The SDK reads the appropriate decimals via the
27839
+ * vault metadata and the asset's ERC-20.
27840
+ *
27841
+ * Approval is handled automatically: if the existing allowance doesn't
27842
+ * cover `amount`, an `approve` is sent and **always waited for** (regardless
27843
+ * of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
27844
+ * of the approval on Monad-style RPCs.
27845
+ *
27846
+ * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
27847
+ * @param options Vault address, wallet, amount, optional `depositAsset` for
27848
+ * adapter routes, optional `wait` to wait for the deposit receipt.
27849
+ * @returns Deposit transaction hash.
27850
+ * @throws AugustValidationError on invalid wallet/target/amount or missing
27851
+ * adapter config when `depositAsset` differs from the vault underlying.
27852
+ * @throws AugustSDKError when the deposit submission or on-chain call fails.
27853
+ *
27854
+ * @example
27855
+ * ```ts
27856
+ * const hash = await augustSdk.evm.vaultDeposit({
27857
+ * target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
27858
+ * wallet: walletAddress,
27859
+ * amount: '100', // 100 USDC (UI units)
27860
+ * wait: true, // wait for the deposit receipt
27861
+ * });
27862
+ * ```
27863
+ *
27864
+ * @example Adapter deposit (different deposit asset than the vault's underlying)
27865
+ * ```ts
27866
+ * await augustSdk.evm.vaultDeposit({
27867
+ * target: vaultAddress,
27868
+ * wallet: walletAddress,
27869
+ * amount: '0.5',
27870
+ * depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
27871
+ * chainId: 1,
27872
+ * });
27873
+ * ```
27874
+ */
27875
+ export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
27876
+
27877
+ /**
27878
+ * Check if vault has adapter support
27879
+ */
27880
+ export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
27881
+
27882
+ /**
27883
+ * august_vault program IDL (Anchor).
27884
+ *
27885
+ * GENERATED — do not edit by hand. Source of truth is the program repo's build
27886
+ * artifact: solana-vaults `frontend/idl/august_vault.json` (synced from the
27887
+ * vendored program by `scripts/sync-idl.sh`). Regenerate from there, NOT with
27888
+ * `anchor idl fetch`: an Anchor IDL upload is not refreshed by a program
27889
+ * upgrade, so every IDL published for this program lineage is stale — both
27890
+ * `up12…` on mainnet (last written 2026-01-21) and the `C8B1…` devnet reference
27891
+ * (2026-01-23) predate the ProgramConfig build deployed on 2026-08-06.
27892
+ *
27893
+ * `address` is a build stamp (the mainnet id), NOT network-aware. Never rely on
27894
+ * it: SolanaAdapter/getProgram resolve the real program id per network from
27895
+ * programIds, or from an explicit `programId` override.
27896
+ *
27897
+ * Drift is guarded by tests/vaults/solana-idl-drift.test.ts: the deployed binary
27898
+ * is pinned, every discriminator declared here must appear in that binary, and
27899
+ * live VaultState accounts must decode against this file.
27900
+ */
27901
+ declare const vaultIdl: {
27902
+ accounts: {
27903
+ discriminator: number[];
27904
+ name: string;
27905
+ }[];
27906
+ address: string;
27907
+ errors: {
27908
+ code: number;
27909
+ msg: string;
27910
+ name: string;
27911
+ }[];
27912
+ events: {
27913
+ discriminator: number[];
27914
+ name: string;
27915
+ }[];
27916
+ instructions: ({
27917
+ accounts: ({
27918
+ name: string;
27919
+ signer: boolean;
27920
+ writable: boolean;
27921
+ docs?: undefined;
27922
+ pda?: undefined;
27923
+ address?: undefined;
27924
+ } | {
27925
+ docs: string[];
27926
+ name: string;
27927
+ signer: boolean;
27928
+ writable: boolean;
27929
+ pda?: undefined;
27930
+ address?: undefined;
27931
+ } | {
27932
+ docs: string[];
27933
+ name: string;
27934
+ writable: boolean;
27935
+ signer?: undefined;
27936
+ pda?: undefined;
27937
+ address?: undefined;
27938
+ } | {
27939
+ docs: string[];
27940
+ name: string;
27941
+ signer?: undefined;
27942
+ writable?: undefined;
27943
+ pda?: undefined;
27944
+ address?: undefined;
27945
+ } | {
27946
+ name: string;
27947
+ pda: {
27948
+ program: {
27949
+ kind: string;
27950
+ value: number[];
27951
+ };
27952
+ seeds: ({
27953
+ kind: string;
27954
+ value: number[];
27955
+ path?: undefined;
27956
+ } | {
27957
+ kind: string;
27958
+ path: string;
27959
+ value?: undefined;
27960
+ })[];
27961
+ };
27962
+ writable: boolean;
27963
+ signer?: undefined;
27964
+ docs?: undefined;
27965
+ address?: undefined;
27966
+ } | {
27967
+ address: string;
27968
+ name: string;
27969
+ signer?: undefined;
27970
+ writable?: undefined;
27971
+ docs?: undefined;
27972
+ pda?: undefined;
27973
+ })[];
27974
+ args: {
27975
+ name: string;
27976
+ type: string;
27977
+ }[];
27978
+ discriminator: number[];
27979
+ docs: string[];
27980
+ name: string;
27981
+ } | {
27982
+ accounts: ({
27983
+ docs: string[];
27984
+ name: string;
27985
+ pda: {
27986
+ seeds: {
27987
+ kind: string;
27988
+ value: number[];
27989
+ }[];
27990
+ };
27991
+ signer?: undefined;
27992
+ writable?: undefined;
27993
+ address?: undefined;
27994
+ } | {
27995
+ docs: string[];
27996
+ name: string;
27997
+ signer: boolean;
27998
+ pda?: undefined;
27999
+ writable?: undefined;
28000
+ address?: undefined;
28001
+ } | {
28002
+ docs: string[];
28003
+ name: string;
28004
+ signer: boolean;
28005
+ writable: boolean;
28006
+ pda?: undefined;
28007
+ address?: undefined;
28008
+ } | {
28009
+ name: string;
28010
+ docs?: undefined;
28011
+ pda?: undefined;
28012
+ signer?: undefined;
28013
+ writable?: undefined;
28014
+ address?: undefined;
28015
+ } | {
28016
+ name: string;
28017
+ writable: boolean;
28018
+ docs?: undefined;
28019
+ pda?: undefined;
28020
+ signer?: undefined;
28021
+ address?: undefined;
28022
+ } | {
28023
+ address: string;
28024
+ name: string;
28025
+ docs?: undefined;
28026
+ pda?: undefined;
28027
+ signer?: undefined;
28028
+ writable?: undefined;
28029
+ })[];
28030
+ args: {
28031
+ name: string;
28032
+ type: string;
28033
+ }[];
28034
+ discriminator: number[];
28035
+ docs: string[];
28036
+ name: string;
28037
+ } | {
28038
+ accounts: ({
28039
+ docs: string[];
28040
+ name: string;
28041
+ signer: boolean;
28042
+ pda?: undefined;
28043
+ writable?: undefined;
28044
+ address?: undefined;
28045
+ } | {
28046
+ docs: string[];
28047
+ name: string;
28048
+ pda: {
28049
+ program: {
28050
+ kind: string;
28051
+ value: number[];
28052
+ };
28053
+ seeds: {
28054
+ kind: string;
28055
+ value: number[];
28056
+ }[];
28057
+ };
28058
+ signer?: undefined;
28059
+ writable?: undefined;
28060
+ address?: undefined;
28061
+ } | {
28062
+ name: string;
28063
+ signer: boolean;
28064
+ writable: boolean;
28065
+ docs?: undefined;
28066
+ pda?: undefined;
28067
+ address?: undefined;
28068
+ } | {
28069
+ name: string;
28070
+ pda: {
28071
+ seeds: {
28072
+ kind: string;
28073
+ value: number[];
28074
+ }[];
28075
+ program?: undefined;
28076
+ };
28077
+ writable: boolean;
28078
+ docs?: undefined;
28079
+ signer?: undefined;
28080
+ address?: undefined;
28081
+ } | {
28082
+ address: string;
28083
+ name: string;
28084
+ docs?: undefined;
28085
+ signer?: undefined;
28086
+ pda?: undefined;
28087
+ writable?: undefined;
28088
+ })[];
28089
+ args: {
28090
+ name: string;
28091
+ type: string;
28092
+ }[];
28093
+ discriminator: number[];
28094
+ docs: string[];
28095
+ name: string;
28096
+ } | {
28097
+ accounts: ({
28098
+ name: string;
28099
+ writable: boolean;
28100
+ signer?: undefined;
28101
+ address?: undefined;
28102
+ } | {
28103
+ name: string;
28104
+ writable?: undefined;
28105
+ signer?: undefined;
28106
+ address?: undefined;
28107
+ } | {
28108
+ name: string;
28109
+ signer: boolean;
28110
+ writable?: undefined;
28111
+ address?: undefined;
28112
+ } | {
28113
+ name: string;
28114
+ signer: boolean;
28115
+ writable: boolean;
28116
+ address?: undefined;
28117
+ } | {
28118
+ address: string;
28119
+ name: string;
28120
+ writable?: undefined;
28121
+ signer?: undefined;
28122
+ })[];
28123
+ args: {
28124
+ name: string;
28125
+ type: string;
28126
+ }[];
28127
+ discriminator: number[];
28128
+ docs: string[];
28129
+ name: string;
28130
+ } | {
28131
+ accounts: ({
28132
+ name: string;
28133
+ writable: boolean;
28134
+ pda?: undefined;
28135
+ signer?: undefined;
28136
+ } | {
28137
+ name: string;
28138
+ pda: {
28139
+ program: {
28140
+ kind: string;
28141
+ value: number[];
28142
+ };
28143
+ seeds: {
28144
+ kind: string;
28145
+ path: string;
28146
+ }[];
28147
+ };
28148
+ writable: boolean;
28149
+ signer?: undefined;
28150
+ } | {
28151
+ name: string;
28152
+ signer: boolean;
28153
+ writable?: undefined;
28154
+ pda?: undefined;
28155
+ } | {
28156
+ name: string;
28157
+ writable?: undefined;
28158
+ pda?: undefined;
28159
+ signer?: undefined;
28160
+ })[];
28161
+ args: {
28162
+ name: string;
28163
+ type: string;
28164
+ }[];
28165
+ discriminator: number[];
28166
+ docs: string[];
28167
+ name: string;
28168
+ } | {
28169
+ accounts: ({
28170
+ name: string;
28171
+ pda: {
28172
+ seeds: {
28173
+ kind: string;
28174
+ value: number[];
28175
+ }[];
28176
+ };
28177
+ writable: boolean;
28178
+ signer?: undefined;
28179
+ } | {
28180
+ name: string;
28181
+ signer: boolean;
28182
+ pda?: undefined;
28183
+ writable?: undefined;
28184
+ })[];
28185
+ args: {
28186
+ name: string;
28187
+ type: string;
28188
+ }[];
28189
+ discriminator: number[];
28190
+ docs: string[];
28191
+ name: string;
28192
+ } | {
28193
+ accounts: ({
28194
+ docs: string[];
28195
+ name: string;
28196
+ signer: boolean;
28197
+ writable?: undefined;
28198
+ pda?: undefined;
28199
+ address?: undefined;
28200
+ } | {
28201
+ docs: string[];
28202
+ name: string;
28203
+ writable: boolean;
28204
+ signer?: undefined;
28205
+ pda?: undefined;
28206
+ address?: undefined;
28207
+ } | {
28208
+ docs: string[];
28209
+ name: string;
28210
+ signer?: undefined;
28211
+ writable?: undefined;
28212
+ pda?: undefined;
28213
+ address?: undefined;
28214
+ } | {
28215
+ name: string;
28216
+ pda: {
28217
+ program: {
28218
+ kind: string;
28219
+ value: number[];
28220
+ };
28221
+ seeds: ({
28222
+ kind: string;
28223
+ value: number[];
28224
+ path?: undefined;
28225
+ } | {
28226
+ kind: string;
28227
+ path: string;
28228
+ value?: undefined;
28229
+ })[];
28230
+ };
28231
+ writable: boolean;
28232
+ docs?: undefined;
28233
+ signer?: undefined;
28234
+ address?: undefined;
28235
+ } | {
28236
+ address: string;
28237
+ name: string;
28238
+ docs?: undefined;
28239
+ signer?: undefined;
28240
+ writable?: undefined;
28241
+ pda?: undefined;
28242
+ })[];
28243
+ args: {
28244
+ name: string;
28245
+ type: string;
28246
+ }[];
28247
+ discriminator: number[];
28248
+ docs: string[];
28249
+ name: string;
28250
+ })[];
28251
+ metadata: {
28252
+ description: string;
28253
+ name: string;
28254
+ spec: string;
28255
+ version: string;
28256
+ };
28257
+ types: ({
28258
+ name: string;
28259
+ repr: {
28260
+ kind: string;
28261
+ };
28262
+ serialization: string;
28263
+ type: {
28264
+ fields: {
28265
+ name: string;
28266
+ type: string;
28267
+ }[];
28268
+ kind: string;
28269
+ };
28270
+ docs?: undefined;
28271
+ } | {
28272
+ docs: string[];
28273
+ name: string;
28274
+ type: {
28275
+ fields: ({
28276
+ docs: string[];
28277
+ name: string;
28278
+ type: string;
28279
+ } | {
28280
+ docs: string[];
28281
+ name: string;
28282
+ type: {
28283
+ array: (string | number)[];
28284
+ };
28285
+ })[];
28286
+ kind: string;
28287
+ };
28288
+ repr?: undefined;
28289
+ serialization?: undefined;
28290
+ } | {
28291
+ name: string;
28292
+ type: {
28293
+ fields: ({
28294
+ name: string;
28295
+ type: string;
28296
+ docs?: undefined;
28297
+ } | {
28298
+ name: string;
28299
+ type: {
28300
+ array: (string | number)[];
28301
+ };
28302
+ docs?: undefined;
28303
+ } | {
28304
+ docs: string[];
28305
+ name: string;
28306
+ type: string;
28307
+ } | {
28308
+ docs: string[];
28309
+ name: string;
28310
+ type: {
28311
+ array: (string | number)[];
28312
+ };
28313
+ })[];
28314
+ kind: string;
28315
+ };
28316
+ repr?: undefined;
28317
+ serialization?: undefined;
28318
+ docs?: undefined;
28319
+ })[];
28320
+ };
28321
+
28322
+ /**
28323
+ * @description withdraw funds from the specified pool including accrued rewards
28324
+ * @param signer signer / wallet object
28325
+ * @param options object including pool contract address, user wallet address, and more
28326
+ * @returns claim tx hash
28327
+ */
28328
+ export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
28329
+ year: string;
28330
+ month: string;
28331
+ day: string;
28332
+ receiverIndex: string;
28333
+ }): Promise<string>;
28334
+
28335
+ export declare enum VaultRedemptionStatus {
28336
+ AWAITING_COOLDOWN = "awaiting_cooldown",
28337
+ READY_TO_CLAIM = "ready_to_claim"
28338
+ }
28339
+
28340
+ /**
28341
+ * Request to redeem vault shares. For EVM-1 vaults this queues a standard
28342
+ * redemption (claimable later via `vaultRedeem`). For EVM-2 vaults the queued
28343
+ * `requestRedeem` escrows the shares in the vault via `transferFrom`, so this
28344
+ * also approves the receipt token when its allowance is short; the instant
28345
+ * path (`isInstantRedeem: true`) burns the caller's shares directly and sends
28346
+ * no approval.
28347
+ *
28348
+ * The receipt-token approval (EVM-2 queued path) is always waited on before
28349
+ * the redeem call, regardless of the caller's `wait` flag.
28350
+ *
28351
+ * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
28352
+ * @param options Vault address, wallet, amount, optional `isInstantRedeem`,
28353
+ * optional `wait` to wait for the redeem receipt.
28354
+ * @returns Redeem transaction hash.
28355
+ * @throws AugustValidationError on invalid wallet/target/amount.
28356
+ * @throws AugustSDKError when the redeem submission or on-chain call fails.
28357
+ *
28358
+ * @example
28359
+ * ```ts
28360
+ * const hash = await augustSdk.evm.vaultRequestRedeem({
28361
+ * target: vaultAddress,
28362
+ * wallet: walletAddress,
28363
+ * amount: '10', // 10 shares (UI units)
28364
+ * wait: true,
28365
+ * });
28366
+ * ```
28367
+ *
28368
+ * @example Instant redemption
28369
+ * ```ts
28370
+ * await augustSdk.evm.vaultRequestRedeem({
28371
+ * target: vaultAddress,
28372
+ * wallet: walletAddress,
28373
+ * amount: '10',
28374
+ * isInstantRedeem: true,
28375
+ * });
28376
+ * ```
28377
+ */
28378
+ export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
28379
+
28380
+ /**
28381
+ * @deprecated Renamed to {@link SWAP_ROUTER_ELIGIBLE_VAULTS} (itself now
28382
+ * superseded by {@link getSwapRouterEligibleVaults}, the on-chain-derived
28383
+ * resolver), and the semantics changed: this set no longer drives
28384
+ * `vaultDeposit` auto-routing (that branch was removed) — it only marks vaults
28385
+ * whose UI may offer the swap-router deposit surface. Kept as an alias for one
28386
+ * release; migrate to the async resolver.
28387
+ */
28388
+ export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
28389
+
28390
+ /**
28391
+ * Vault Receipt Symbol Mapping
28392
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
28393
+ */
28394
+ 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';
28395
+
28396
+ /**
28397
+ * @deprecated Renamed to {@link isSwapRouterEligible} (itself now superseded by
28398
+ * {@link getSwapRouterEligibleVaults}, the on-chain-derived resolver). The
28399
+ * meaning also changed: it no longer implies `vaultDeposit` routes the vault
28400
+ * through the SwapRouter (that behavior was removed) — it only reports
28401
+ * swap-router *eligibility* for the opt-in deposit surface. Kept as an alias
28402
+ * for one release; migrate to the async resolver.
28403
+ */
28404
+ export declare const vaultUsesSwapRouter: typeof isSwapRouterEligible;
28405
+
28406
+ export declare function verifyAugustKey(key: string): Promise<boolean>;
28407
+
28408
+ export declare function verifyInfuraKey(key: string): Promise<boolean>;
28409
+
28410
+ /**
28411
+ * Convert a viem WalletClient to an ethers-compatible Signer
28412
+ * Uses the walletClient as a provider and wraps it for ethers compatibility
28413
+ * @param walletClient Viem WalletClient from wagmi or viem
28414
+ * @returns Ethers Signer that can be used with the SDK
28415
+ */
28416
+ export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
28417
+
28418
+ /**
28419
+ * @param walletClient a wagmi-derived client (from useWalletClient)
28420
+ * @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
28421
+ */
28422
+ export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
28423
+
28424
+ export declare const WEBSERVER_ENDPOINTS: {
28425
+ default: {
28426
+ /** @deprecated No backend route. Removed in the next major release. */
28427
+ hello: string;
28428
+ protected: string;
28429
+ };
28430
+ auth: {
28431
+ verify: string;
28432
+ sign: string;
28433
+ login: string;
28434
+ nonce: string;
28435
+ refresh: string;
28436
+ };
28437
+ subaccount: {
28438
+ list: (offset?: number, limit?: number) => string;
28439
+ /** @deprecated No backend route. Removed in the next major release. */
28440
+ rewards: (subaccount: IAddress) => string;
28441
+ tokens: (subaccount: IAddress) => string;
28442
+ twap: {
28443
+ create: (subaccount: IAddress) => string;
28444
+ stop: (subaccount: IAddress, id: string) => string;
28445
+ fills: (subaccount: IAddress, id: string) => string;
28446
+ };
28447
+ debank: (subaccount: IAddress) => string;
28448
+ health_factor: (subaccount: IAddress) => string;
28449
+ summary: (subaccount: IAddress) => string;
28450
+ /** @deprecated No backend route. Removed in the next major release. */
28451
+ batch: (subaccount: IAddress) => string;
28452
+ loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
28453
+ cefi: (subaccount: IAddress) => string;
28454
+ otc_positions: (subaccount: IAddress) => string;
28455
+ loanByAddress: (loanAddress: string, chainId: number) => string;
28456
+ _: (subaccount: IAddress) => string;
28457
+ };
28458
+ transactions: {
28459
+ v2: (subaccount: string, startTime?: string, endTime?: string) => string;
28460
+ };
28461
+ otc: {
28462
+ positions: string;
28463
+ marginRequirements: (otcCounterpartyId?: string, payer?: string) => string;
28464
+ };
28465
+ curator: {
28466
+ vaultSubaccounts: (vaultAddress: string) => string;
28467
+ vaultWhitelist: (vaultAddress: string) => string;
28468
+ };
28469
+ timelockRequests: (vaultAddress: string, chainId: number, status?: string) => string;
28470
+ users: {
28471
+ get: string;
28472
+ };
28473
+ dashboard: {
28474
+ loans: string;
28475
+ };
28476
+ risk: {
28477
+ discountFactors: string;
28478
+ collateralExcessOrDeficit: (subaccount: string, tokenAddress: string, tokenChain: number, targetHealthFactor?: number) => string;
28479
+ collateralSimulation: string;
28480
+ };
28481
+ prices: (symbol: string) => string;
28482
+ metrics: {
28483
+ pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
28484
+ vaultPerformanceFees: (params: {
28485
+ vaultAddress: string;
28486
+ annualizedFeesPct: number;
28487
+ nativeDenominated: boolean;
28488
+ calculationPeriod: string;
28489
+ startDate?: string;
28490
+ endDate?: string;
28491
+ }) => string;
28492
+ };
28493
+ public: {
28494
+ integrations: {
28495
+ morpho: {
28496
+ apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
28497
+ };
28498
+ };
28499
+ tokenizedVault: {
28500
+ loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
28501
+ subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
28502
+ list: string;
28503
+ byVaultAddress: (vaultAddress: VaultAddress) => string;
28504
+ historicalApy: (vaultAddress: IAddress) => string;
28505
+ historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
28506
+ annualizedApy: (vaultAddress: IAddress) => string;
28507
+ summary: (vaultAddress: IAddress) => string;
28508
+ withdrawals: (chain: string, vaultAddress: IAddress) => string;
28509
+ debank: (vaultAddress: IAddress) => string;
28510
+ userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
28511
+ archivedVaults: string;
28512
+ };
28513
+ points: {
28514
+ byUserAddress: (userAddress: IAddress) => string;
28515
+ register: string;
28516
+ leaderboard: string;
28517
+ };
28518
+ vaults: {
28519
+ pendingRedemptions: (vaultAddress: IAddress) => string;
28520
+ };
28521
+ pnl: {
28522
+ unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
28523
+ unrealizedLatest: string;
28524
+ };
28525
+ revertReason: (txHash: string, chain: number) => string;
28526
+ oracleClassification: (vaultAddress: string, chainId: number) => string;
28527
+ transparency: {
28528
+ positions: (vaultAddress: string, chainId: number) => string;
28529
+ historicalAllocations: (vaultAddress: string, chainId: number, startDate?: string, endDate?: string) => string;
28530
+ fees: (vaultAddress: string, chainId: number) => string;
28531
+ ratioSeries: (vaultAddress: string, startDate?: string, endDate?: string, limit?: number) => string;
28532
+ smoothedApy: (vaultAddress: string, daysAgo: number, averagingPeriodDays: number, applySmoothing: boolean) => string;
28533
+ governanceRoles: (vaultAddress: string, chainId: number) => string;
28534
+ governancePermissions: (vaultAddress: string, chainId: number) => string;
28535
+ governanceTimelocks: (vaultAddress: string, chainId: number, status?: string) => string;
28536
+ governanceAuditLog: (vaultAddress: string, chainId: number, category?: string, before?: string, limit?: number) => string;
28537
+ };
28538
+ };
28539
+ upshift: {
28540
+ vaults: {
28541
+ metadata: string;
28542
+ };
28543
+ };
28544
+ };
28545
+
28546
+ export declare const WEBSERVER_URL: {
28547
+ production: string;
28548
+ staging: string;
28549
+ development: string;
28550
+ localhost: string;
28551
+ qa: string;
28552
+ public: string;
28553
+ upshift: string;
28554
+ };
28555
+
28556
+ /**
28557
+ * Withdrawal request with computed claimable date and current processing status.
28558
+ * The unique identifier is (receiver, claimableDate).
28559
+ *
28560
+ * @interface WithdrawalRequestStatus
28561
+ */
28562
+ export declare interface WithdrawalRequestStatus {
28563
+ /** Transaction hash of the withdrawal request */
28564
+ transactionHash: string;
28565
+ /** Block timestamp when the withdrawal was requested (seconds, UTC) */
28566
+ requestTimestamp: number;
28567
+ /** Shares amount being redeemed */
28568
+ shares: bigint;
28569
+ /** Receiver address for the withdrawal */
28570
+ receiver: string;
28571
+ /** Computed claimable date in UTC (year, month, day) */
28572
+ claimableDate: {
28573
+ year: number;
28574
+ month: number;
28575
+ day: number;
28576
+ };
28577
+ /** Epoch timestamp when this withdrawal becomes claimable */
28578
+ claimableEpoch: number;
28579
+ /** Current status of the withdrawal */
28580
+ status: 'pending' | 'ready_to_claim' | 'processed';
28581
+ /** Transaction hash of the processing transaction (if processed) */
28582
+ processedTransactionHash?: string;
28583
+ /** Assets received (if processed) */
28584
+ assetsReceived?: bigint;
28585
+ }
28586
+
28587
+ /**
28588
+ * Higher-order function to wrap SDK methods with performance tracking.
28589
+ * Tracks method calls, timing, chain usage, and errors.
28590
+ *
28591
+ * @param methodName - Name of the method being wrapped
28592
+ * @param method - The original async method
28593
+ * @param getChainId - Function to get current chain ID
28594
+ * @returns Wrapped method with tracking
28595
+ */
28596
+ export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
28597
+
28598
+ /**
28599
+ * Wrap async operations with exponential backoff retry logic.
28600
+ * Retries on network errors with increasing delays between attempts.
28601
+ * @param fn - Async function to execute with retry logic
28602
+ * @param maxRetries - Maximum number of retry attempts
28603
+ * @param baseDelay - Initial delay in milliseconds (doubles each retry)
28604
+ * @param shouldRetry - Custom function to determine if error is retryable
28605
+ * @returns Result of successful function execution
28606
+ * @throws Last error if all retries exhausted
28607
+ */
28608
+ export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
28609
+
28610
+ /**
28611
+ * Higher-order function to wrap synchronous SDK methods with tracking.
28612
+ * Uses breadcrumbs for tracking since spans require async context.
28613
+ *
28614
+ * @param methodName - Name of the method being wrapped
28615
+ * @param method - The original sync method
28616
+ * @param getChainId - Function to get current chain ID
28617
+ * @returns Wrapped method with tracking
28618
+ */
28619
+ export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
28620
+
28621
+ export declare const WRAPPER_ADAPTOR: {
28622
+ 43114: IAddress;
28623
+ 1: IAddress;
28624
+ };
28625
+
28626
+ /**
28627
+ * Wrap an ethers signer so every transaction it sends carries the active
28628
+ * ERC-8021 attribution suffix (Base Builder Codes).
28629
+ *
28630
+ * Every ethers write in the SDK funnels through the wrapped signer's
28631
+ * `sendTransaction`, so this single wrap attributes all vault writes. The
28632
+ * wrapper is a Proxy — the caller's signer object is never mutated, so a
28633
+ * signer reused outside the SDK sends unattributed transactions. Attribution
28634
+ * state is read at send time, not wrap time; when no attribution is
28635
+ * configured (see `IAugustBase.attribution`) the wrapper is a pass-through.
28636
+ *
28637
+ * Plain value transfers (no calldata) are never attributed, and calldata
28638
+ * already ending in the ERC-8021 marker is left untouched. When the
28639
+ * configured `chains` list requires a chain check and the transaction does
28640
+ * not carry a `chainId`, the signer's provider network is consulted (one
28641
+ * cached RPC call); if that lookup fails the transaction is sent
28642
+ * unattributed.
28643
+ *
28644
+ * @param signer Normalized ethers Signer or Wallet.
28645
+ * @returns A proxied signer with an attribution-aware `sendTransaction`.
28646
+ */
28647
+ export declare function wrapSignerWithAttribution<T extends Signer | Wallet>(signer: T): T;
28648
+
28649
+ export { }