@augustdigital/sdk 8.15.0 → 8.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/sdk.d.ts CHANGED
@@ -18210,6 +18210,15 @@ declare function assertNotStellar(address: string, operation: string): void;
18210
18210
  */
18211
18211
  export declare const getDefaultSubgraphUrl: (_network: string, _symbol: string) => string | undefined;
18212
18212
 
18213
+ /**
18214
+ * Program ids for `network`, or `undefined` when the canonical program has no
18215
+ * deployment there (currently `testnet`). Callers must handle `undefined` —
18216
+ * silently substituting a default would hand back a dead address.
18217
+ */
18218
+ declare function getDeployedProgramIds(network: ISolanaNetwork): {
18219
+ vault: string;
18220
+ } | undefined;
18221
+
18213
18222
  /**
18214
18223
  * Fetches the total amount deposited by an address on a whitelist contract
18215
18224
  * @param signer - signer / provider object
@@ -20794,6 +20803,9 @@ declare function assertNotStellar(address: string, operation: string): void;
20794
20803
  network?: ISolanaNetwork_2;
20795
20804
  }
20796
20805
 
20806
+ /** Solana networks the canonical august_vault program is actually deployed on. */
20807
+ declare type ISolanaDeployedNetwork = keyof typeof programIds;
20808
+
20797
20809
  export declare type ISolanaNetwork = 'devnet' | 'mainnet-beta' | 'testnet' | 'localnet';
20798
20810
 
20799
20811
  declare type ISolanaNetwork_2 = 'devnet' | 'mainnet-beta' | 'testnet' | 'localnet';
@@ -21489,6 +21501,12 @@ declare function assertNotStellar(address: string, operation: string): void;
21489
21501
  daily_pnl_per_share: Record<string, number>;
21490
21502
  latest_reported_tvl: number | null;
21491
21503
  cached_at?: string | null;
21504
+ /**
21505
+ * Per-vault provenance timestamps (APY recompute, newest share-price snapshot,
21506
+ * response assembly). Absent on older/cached responses predating the backend
21507
+ * change that added it.
21508
+ */
21509
+ freshness?: ITokenizedVaultFreshness | null;
21492
21510
  instant_redeem_config: null | {
21493
21511
  subaccount_address: string;
21494
21512
  output_asset_symbol: string;
@@ -21512,6 +21530,48 @@ declare function assertNotStellar(address: string, operation: string): void;
21512
21530
  name: string;
21513
21531
  }
21514
21532
 
21533
+ /**
21534
+ * Per-vault provenance timestamps returned by the backend on every tokenized-vault
21535
+ * read (list and single-vault, on both the `api.augustdigital.io/tokenized_vault`
21536
+ * and `api.upshift.finance/tokenized_vaults` surfaces).
21537
+ *
21538
+ * The three stamps describe *different* pipelines and are independently nullable —
21539
+ * one of them cannot stand in for another. Consumers use the ordering between them
21540
+ * to detect that the vault's share price has moved ahead of its APY: a
21541
+ * `share_ratio_snapshot_at` later than `apy_computed_at` means a share-price
21542
+ * snapshot has landed that the APY has not yet been recomputed from.
21543
+ *
21544
+ * All values are RFC 3339 UTC strings with a trailing `Z` (e.g.
21545
+ * `'2026-07-25T00:01:46Z'`). The trailing `Z` matters: `new Date()` parses an
21546
+ * offset-less date-time as *local* time, which would silently shift the stamp by
21547
+ * the viewer's UTC offset.
21548
+ *
21549
+ * @see ITokenizedVault.freshness
21550
+ */
21551
+ export declare interface ITokenizedVaultFreshness {
21552
+ /**
21553
+ * When `historical_apy`, TVL and drawdown were last recomputed, or null if they
21554
+ * have never been computed for this vault.
21555
+ */
21556
+ apy_computed_at: string | null;
21557
+ /**
21558
+ * `snapshot_datetime` of the newest persisted share-price snapshot, or null when
21559
+ * the vault has no snapshot yet.
21560
+ *
21561
+ * The backend stamps this from a scalar `max(snapshot_datetime)`, so it is
21562
+ * populated independently of `load_snapshots` — including on the basic and
21563
+ * sub-accounts views (`load_snapshots=false`), which is what every app call site
21564
+ * sends. Never substitute another timestamp for it.
21565
+ */
21566
+ share_ratio_snapshot_at: string | null;
21567
+ /**
21568
+ * When the backend assembled the response body, before it entered the backend's
21569
+ * own response cache. Distinct from the top-level `cached_at` only in scope:
21570
+ * this one travels with the vault object.
21571
+ */
21572
+ cached_at: string | null;
21573
+ }
21574
+
21515
21575
  export declare interface ITokenizedVaultOperator {
21516
21576
  address: `0x${string}`;
21517
21577
  operator_type: IOperatorTypeEnum;
@@ -21749,6 +21809,13 @@ declare function assertNotStellar(address: string, operation: string): void;
21749
21809
  defaultApyHorizon?: 7 | 30 | null;
21750
21810
  latest_reported_tvl?: number | null;
21751
21811
  cachedAt?: string | null;
21812
+ /**
21813
+ * Provenance timestamps for the vault's server-side data — when its APY was last
21814
+ * recomputed, when its newest share-price snapshot was taken, and when the
21815
+ * backend built the response. Null (or a null member) when the backend did not
21816
+ * report that stamp; see {@link IVaultFreshness}.
21817
+ */
21818
+ freshness?: IVaultFreshness | null;
21752
21819
  showCapFilled?: boolean | null;
21753
21820
  /** Controls how the vault's APY is displayed; null when the backend has not set an override. */
21754
21821
  apyOverride?: IApyOverride | null;
@@ -21835,14 +21902,38 @@ declare function assertNotStellar(address: string, operation: string): void;
21835
21902
  liquidAPY30Day?: number;
21836
21903
  }
21837
21904
 
21905
+ /**
21906
+ * A vault's APY breakdown.
21907
+ *
21908
+ * **Unit contract: every rate on this type is a PERCENTAGE, not a decimal
21909
+ * fraction.** `7.95` means 7.95%. The backend reports these as decimal fractions
21910
+ * (`0.0795`); the SDK multiplies by 100 exactly once, uniformly across every rate
21911
+ * field, before returning them. Consumers must therefore divide by 100 at most once
21912
+ * — and must apply the same treatment to `apy`, `liquidApy`, `pointsApy`,
21913
+ * `campaignApy` and `underlyingApy`, because they all arrive in the same unit.
21914
+ *
21915
+ * This is stated explicitly because the convention going undocumented let a
21916
+ * consumer scale a subset of these fields twice, making them contribute 1/100th of
21917
+ * their value to a displayed total (AUGUST-6967). The unit is uniform here by
21918
+ * design; treating some of these fields as decimals and others as percentages is
21919
+ * always a bug on the consumer side.
21920
+ */
21838
21921
  export declare interface IVaultApy {
21922
+ /** Base vault APY as a percentage (7.95 = 7.95%). */
21839
21923
  apy: number;
21924
+ /** Human-readable note on how the APY is derived; empty or null when unset. */
21840
21925
  explainer: string;
21926
+ /** Liquid-yield component as a percentage. */
21841
21927
  liquidApy: number;
21928
+ /** Points-program APY as a percentage, or null when the vault has no points. */
21842
21929
  pointsApy: number | null;
21930
+ /** Campaign-boost APY as a percentage, or null when no campaign is running. */
21843
21931
  campaignApy: number | null;
21932
+ /** Claimable rewards, in the reward token's own units — not a percentage. */
21844
21933
  rewardsClaimable: number;
21934
+ /** Compounded rewards, in the reward token's own units — not a percentage. */
21845
21935
  rewardsCompounded: number;
21936
+ /** Underlying-asset APY as a percentage (e.g. staking yield on the deposit asset). */
21846
21937
  underlyingApy: number;
21847
21938
  }
21848
21939
 
@@ -21938,6 +22029,64 @@ declare function assertNotStellar(address: string, operation: string): void;
21938
22029
  symbol: string;
21939
22030
  };
21940
22031
 
22032
+ /**
22033
+ * Provenance timestamps for a vault's server-side data, mapped from the backend
22034
+ * `freshness` object.
22035
+ *
22036
+ * A vault's share price and its APY come from two different pipelines: the SDK
22037
+ * reads share price live from chain (`totalAssets()/totalSupply()`), while APY is a
22038
+ * backend column recomputed on a schedule. These stamps make the remaining gap
22039
+ * visible so a UI can render "data as of X" instead of implying both numbers are
22040
+ * equally current.
22041
+ *
22042
+ * The three fields are **independently nullable and independently meaningful** —
22043
+ * none of them is a fallback for another. In particular, when
22044
+ * `shareRatioSnapshotAt` is later than `apyComputedAt`, a share-price snapshot has
22045
+ * landed that the APY has not yet been recomputed from: that ordering is the
22046
+ * staleness signal.
22047
+ *
22048
+ * Every value is an RFC 3339 UTC string with a trailing `Z`, exactly as the backend
22049
+ * sends it — the SDK does not reformat or reinterpret them. Keep the `Z` if you
22050
+ * pass these anywhere: `new Date('2026-07-25T00:01:46')` (no `Z`) is parsed as
22051
+ * *local* time and silently shifts by the viewer's UTC offset.
22052
+ *
22053
+ * @example
22054
+ * ```ts
22055
+ * const vault = await sdk.vaults.getVault(address);
22056
+ * const { apyComputedAt, shareRatioSnapshotAt } = vault.freshness ?? {};
22057
+ * // Only comparable when BOTH are present.
22058
+ * const apyLagsSharePrice =
22059
+ * !!apyComputedAt &&
22060
+ * !!shareRatioSnapshotAt &&
22061
+ * new Date(shareRatioSnapshotAt) > new Date(apyComputedAt);
22062
+ * ```
22063
+ */
22064
+ export declare interface IVaultFreshness {
22065
+ /**
22066
+ * When the backend last recomputed `historical_apy`, TVL and drawdown for this
22067
+ * vault. Null if never computed.
22068
+ */
22069
+ apyComputedAt: string | null;
22070
+ /**
22071
+ * Timestamp of the newest persisted share-price snapshot the backend holds. Null
22072
+ * only when the vault has no snapshot yet.
22073
+ *
22074
+ * Populated regardless of whether the read loaded snapshots — the backend stamps
22075
+ * it from a scalar `max(snapshot_datetime)`, so it is present even on
22076
+ * `load_snapshots=false` reads (the basic and sub-accounts views). When it is
22077
+ * null, treat it as absent: do not fall back to `apyComputedAt` or `cachedAt` in
22078
+ * its place.
22079
+ */
22080
+ shareRatioSnapshotAt: string | null;
22081
+ /**
22082
+ * When the backend assembled the response body this vault came from, before its
22083
+ * own response cache. Note this does **not** account for the SDK's client-side
22084
+ * LRU (10–15 min on `fetchTokenizedVault` / `fetchTokenizedVaults`), so a vault
22085
+ * served from that cache can be older than this stamp suggests is possible.
22086
+ */
22087
+ cachedAt: string | null;
22088
+ }
22089
+
21941
22090
  export declare type IVaultHistoricalParams = {
21942
22091
  daysAgo?: number;
21943
22092
  order?: IVaultOrderParam;
@@ -22860,6 +23009,25 @@ declare function assertNotStellar(address: string, operation: string): void;
22860
23009
  website_url: string;
22861
23010
  }[];
22862
23011
 
23012
+ /**
23013
+ * Map the backend `freshness` object onto the camelCased {@link IVaultFreshness}
23014
+ * shape carried on `IVault`. Shared across all chain adapters (EVM, Solana,
23015
+ * Stellar) so every surface reports provenance identically.
23016
+ *
23017
+ * Each of the three stamps is passed through independently: a missing member
23018
+ * becomes `null` and is never defaulted from one of the others. That is the point
23019
+ * of the object — `apy_computed_at` and `share_ratio_snapshot_at` describe two
23020
+ * different pipelines, and collapsing them would erase the very staleness signal
23021
+ * (snapshot newer than APY) the field exists to expose.
23022
+ *
23023
+ * @param tokenizedVault - Backend tokenized-vault payload. `freshness` is absent on
23024
+ * responses predating the backend change, and may be explicitly null.
23025
+ * @returns The mapped freshness object, or `null` when the backend reported none.
23026
+ * Values are the backend's RFC 3339 UTC strings verbatim — no reformatting, so
23027
+ * the trailing `Z` is preserved.
23028
+ */
23029
+ export declare function mapVaultFreshness(tokenizedVault: ITokenizedVault | undefined | null): IVaultFreshness | null;
23030
+
22863
23031
  /**
22864
23032
  * Max fee ceiling in stroops (1_000_000 stroops = 0.1 XLM).
22865
23033
  * assembleTransaction adjusts to the actual fee from simulation.
@@ -23107,9 +23275,6 @@ declare function assertNotStellar(address: string, operation: string): void;
23107
23275
  "mainnet-beta": {
23108
23276
  vault: string;
23109
23277
  };
23110
- testnet: {
23111
- vault: string;
23112
- };
23113
23278
  localnet: {
23114
23279
  vault: string;
23115
23280
  };
@@ -24315,7 +24480,7 @@ declare function assertNotStellar(address: string, operation: string): void;
24315
24480
  isSolanaAddress: isSolanaAddress;
24316
24481
  isSolana: (signature: string) => boolean;
24317
24482
  getProgram: ({ provider, idl, programId, network, }: {
24318
- idl: any;
24483
+ idl?: any;
24319
24484
  programId?: string;
24320
24485
  } & ISolanaConnectionOptions) => Program<any>;
24321
24486
  getProvider: ({ connection, publicKey, signTransaction, }: {
@@ -24379,9 +24544,6 @@ declare function assertNotStellar(address: string, operation: string): void;
24379
24544
  "mainnet-beta": {
24380
24545
  vault: string;
24381
24546
  };
24382
- testnet: {
24383
- vault: string;
24384
- };
24385
24547
  localnet: {
24386
24548
  vault: string;
24387
24549
  };
@@ -24433,1516 +24595,1490 @@ declare function assertNotStellar(address: string, operation: string): void;
24433
24595
  get connection(): web3.Connection;
24434
24596
  get provider(): AnchorProvider;
24435
24597
  setWalletProvider(_publicKey: PublicKey | string, signTransaction: (<T extends Transaction | web3.VersionedTransaction>(transaction: T) => Promise<T>) | undefined): void;
24436
- getProgram(programIdl: any): Program<any>;
24437
- getVaultState(vaultProgramId: PublicKey | string, idl: any, vaultAddress?: PublicKey | string): Promise<{
24438
- vaultState: unknown | null;
24439
- depositMintDecimals: number | null;
24440
- }>;
24441
- getVaultStateReadOnly(vaultProgramId: PublicKey | string, idl: any, vaultAddress?: PublicKey | string): Promise<{
24442
- vaultState: ISolanaVaultState | null;
24443
- depositMintDecimals: number | null;
24444
- }>;
24445
- getToken(mintAddress: string | PublicKey): Promise<{
24446
- address: string;
24447
- symbol: string;
24448
- decimals: number;
24449
- name: string;
24450
- image: string;
24451
- }>;
24452
- getTokenSymbol(mintAddress: string | PublicKey): Promise<string>;
24453
- fetchUserTokenBalance(publicKey: PublicKey | string, depositMint: PublicKey | string): Promise<any>;
24454
- fetchUserShareBalance(publicKey: PublicKey | string, shareMint: PublicKey | string): Promise<any>;
24455
24598
  /**
24456
- * BigInt-safe variant of {@link fetchUserShareBalance}. Returns the raw u64
24457
- * `amount` (as a base-units string) plus the mint's `decimals` (or `null`
24458
- * when the scale can't be determined — see Returns), so the caller can
24459
- * produce a correct `INormalizedNumber` without losing precision.
24599
+ * Build an Anchor `Program` bound to this adapter's provider and network.
24460
24600
  *
24461
- * Prefer this anywhere the result feeds BigInt math positions, max-
24462
- * actions, redemption sizing, allowance checks. `fetchUserShareBalance`
24463
- * returns a JS-number `uiAmount` which silently encodes against 18 decimals
24464
- * when passed through `toNormalizedBn(value)` without an explicit decimals
24465
- * argument; that's exactly how the jitoSOL "missing position" regression
24466
- * manifested.
24601
+ * The program id is resolved as: explicit `programId` the `address` carried
24602
+ * by a custom `programIdl` the canonical deployment for this adapter's
24603
+ * network. A copy of the SDK's bundled `vaultIdl` defers to the network
24604
+ * default (its embedded `address` is a build stamp, not network-aware), so
24605
+ * forwarding it on devnet never silently targets the mainnet program.
24467
24606
  *
24468
- * RPC cost: 1 `getParsedTokenAccountsByOwner` call. Worst case ~150ms on a
24469
- * healthy mainnet endpoint.
24470
- *
24471
- * @param publicKey Wallet owner (PublicKey or base58 string).
24472
- * @param shareMint The vault's share-token mint (PublicKey or base58).
24473
- * @returns
24474
- * `{ amount, decimals }`. Three observable shapes:
24475
- * - `{ amount: '<u64>', decimals: <number> }` token account exists.
24476
- * - `{ amount: '0', decimals: null }` — no token account for this mint
24477
- * under this wallet, OR `tokenAmount` was missing from the response,
24478
- * OR `publicKey`/`shareMint` was not supplied. Distinguishable from a
24479
- * genuine zero-balance account (`decimals` would be set there).
24480
- * - `{ amount: '0', decimals: null }` — RPC threw (error is logged).
24481
- *
24482
- * `decimals === null` means "we could not determine the scale" — callers
24483
- * that need an `INormalizedNumber` must fall back to a known decimals
24484
- * value (typically the deposit mint's decimals from backend metadata)
24485
- * before normalizing. Never throws.
24486
- */
24487
- fetchUserShareBalanceRaw(publicKey: PublicKey | string, shareMint: PublicKey | string): Promise<{
24488
- amount: string;
24489
- decimals: number | null;
24490
- }>;
24491
- /**
24492
- * Deposit funds into a Solana August vault.
24493
- * @param depositAmount `bigint` (raw on-chain units) or `number` (UI amount).
24494
- */
24495
- vaultDeposit(vaultProgramId: PublicKey | string, idl: any, publicKey: PublicKey | string, depositAmount: number | bigint, sendTransaction: (transaction: Transaction | web3.VersionedTransaction, connection: Connection, options?: SendTransactionOptions) => Promise<web3.TransactionSignature>, vaultAddress?: PublicKey | string): Promise<any>;
24496
- /**
24497
- * Redeem vault shares from a Solana August vault.
24498
- * @param redeemShares `bigint` (raw share units) or `number` (UI amount).
24499
- */
24500
- vaultRedeem(vaultProgramId: PublicKey | string, idl: any, publicKey: PublicKey | string, redeemShares: number | bigint, sendTransaction: (transaction: Transaction | web3.VersionedTransaction, connection: Connection, options?: SendTransactionOptions) => Promise<web3.TransactionSignature>, vaultAddress?: PublicKey | string): Promise<any>;
24501
- getProgramId(type: 'vault'): string;
24502
- }
24503
-
24504
- declare namespace SolanaConstants {
24505
- export {
24506
- fallbackDecimals,
24507
- fallbackNetwork,
24508
- fallbackRpcEndpoints,
24509
- programIds,
24510
- vaultIdl
24511
- }
24512
- }
24513
-
24514
- declare namespace SolanaGetters {
24515
- export {
24516
- getSolanaVault
24517
- }
24518
- }
24519
-
24520
- declare const SOROBAN_RPC_URLS: Record<IStellarNetwork, string>;
24521
-
24522
- export declare const SPECIAL_CHAINS: {
24523
- solana: {
24524
- name: string;
24525
- chainId: number;
24526
- explorer: string;
24527
- };
24528
- stellar: {
24529
- name: string;
24530
- chainId: number;
24531
- explorer: string;
24532
- };
24533
- };
24534
-
24535
- export declare const Stellar: {
24536
- utils: {
24537
- isStellarAddress: isStellarAddress;
24538
- getExplorerLink: getExplorerLink;
24539
- assertNotStellar: assertNotStellar;
24540
- };
24541
- constants: typeof StellarConstants;
24542
- actions: typeof StellarActions;
24543
- submit: typeof StellarSubmit;
24544
- getters: typeof StellarGetters;
24545
- };
24546
-
24547
- declare const STELLAR_CHAIN: {
24548
- name: string;
24549
- chainId: number;
24550
- explorer: string;
24551
- };
24552
-
24553
- declare const STELLAR_CHAIN_ID: number;
24554
-
24555
- declare const STELLAR_FALLBACK_DECIMALS = 7;
24556
-
24557
- declare namespace StellarActions {
24558
- export {
24559
- handleStellarDeposit,
24560
- handleStellarRedeem
24561
- }
24562
- }
24563
-
24564
- /**
24565
- * Stellar Adapter for August SDK
24566
- *
24567
- * @example
24568
- * ```
24569
- * const adapter = new StellarAdapter('testnet');
24570
- * const xdr = await adapter.vaultDeposit({
24571
- * contractId: 'CBGWW5...',
24572
- * amount: '1000000',
24573
- * senderAddress: 'GDLZ...',
24574
- * });
24575
- * // Sign xdr with wallet (e.g. Freighter), then submit via adapter.submitTransaction()
24576
- * ```
24577
- */
24578
- export declare class StellarAdapter {
24579
- private _network;
24580
- /**
24581
- * Optional consumer-supplied Soroban RPC endpoint (e.g. a keyed Alchemy URL).
24582
- * When set it is the primary, with the SDK's public endpoints as failover.
24583
- */
24584
- private _sorobanRpcUrl?;
24585
- /**
24586
- * @param network - Stellar network to operate on; defaults to `'mainnet'`.
24587
- * @param options - Optional adapter configuration. Its `sorobanRpcUrl` field
24588
- * overrides the Soroban RPC endpoint (e.g. a keyed Alchemy URL): it becomes
24589
- * the primary with the SDK's built-in public endpoints kept behind it as
24590
- * failover, and a per-call `sorobanRpcUrl` (on the deposit/redeem params)
24591
- * takes precedence over this adapter-level one.
24592
- */
24593
- constructor(network?: IStellarNetwork, options?: {
24594
- sorobanRpcUrl?: string;
24595
- });
24596
- get network(): IStellarNetwork;
24597
- isStellarAddress(address: string): boolean;
24598
- getExplorerLink(id: string, type?: 'contract' | 'account' | 'tx'): string;
24599
- /**
24600
- * Build an unsigned deposit transaction for a Stellar vault.
24601
- * @returns Base64-encoded XDR of the unsigned transaction.
24602
- */
24603
- vaultDeposit(params: Omit<IStellarDepositParams, 'network'>): Promise<string>;
24604
- /**
24605
- * Build an unsigned redeem transaction for a Stellar vault.
24606
- * @returns Base64-encoded XDR of the unsigned transaction.
24607
- */
24608
- vaultRedeem(params: Omit<IStellarRedeemParams, 'network'>): Promise<string>;
24609
- /**
24610
- * Submit a signed Soroban transaction and poll until the network confirms it.
24611
- *
24612
- * Submits on the network this adapter was constructed with, so `signedXdr`
24613
- * must be signed for that same network.
24614
- *
24615
- * @param signedXdr - Base64-encoded XDR of the signed transaction.
24616
- * @returns The transaction hash once the network confirms it as successful.
24617
- * @throws {@link AugustTimeoutError} when the transaction is not confirmed
24618
- * within the poll budget (`MAX_POLL_ATTEMPTS`).
24619
- * @throws {@link AugustSDKError} when the RPC rejects the submission or the
24620
- * transaction confirms as failed. Its `context` carries `{ network, status }`
24621
- * plus, when the result XDR decodes, a `resultCode` string holding the
24622
- * transaction-level reason (e.g. `"txBadSeq"`, `"txTooLate"`); `resultCode`
24623
- * is `undefined` when the code cannot be decoded.
24624
- * @example
24625
- * ```ts
24626
- * try {
24627
- * const hash = await adapter.submitTransaction(signedXdr);
24628
- * } catch (err) {
24629
- * if (err instanceof AugustSDKError && err.context?.resultCode === 'txBadSeq') {
24630
- * // stale sequence number — rebuild the transaction and resubmit
24631
- * }
24632
- * }
24633
- * ```
24634
- */
24635
- submitTransaction(signedXdr: string): Promise<string>;
24636
- /**
24637
- * Get user's vault share balance.
24638
- *
24639
- * @returns The position `{ shares, decimals, decimalsFromFallback }`, or null
24640
- * if the balance read fails. When `decimalsFromFallback` is `true` the
24641
- * `decimals()` read failed and `decimals` is the fallback (7) — callers sizing
24642
- * a redeem MUST refuse rather than trust it (see AUGUST-6381).
24643
- */
24644
- getUserPosition(vaultAddress: string, walletAddress: string): Promise<IStellarUserPosition | null>;
24645
- /**
24646
- * Preview how many vault shares a deposit amount would yield.
24647
- * @param vaultAddress Stellar contract ID (C… address)
24648
- * @param rawAmount Deposit amount in the deposit token's smallest unit
24649
- * @returns Raw share amount as a string, or null if query fails.
24607
+ * @param programIdl - Anchor IDL to bind. Defaults to the SDK's bundled
24608
+ * `august_vault` IDL. A custom IDL's `address` is honoured when it differs
24609
+ * from the bundled build stamp.
24610
+ * @param programId - Base58 program id that overrides both the IDL's address
24611
+ * and the network default. Use this to target a non-canonical deployment.
24612
+ * @returns An Anchor `Program` for the resolved program id. No RPC is made —
24613
+ * construction is offline.
24614
+ * @throws {@link AugustValidationError} if no program id can be resolved
24615
+ * because this adapter's network has no canonical deployment (e.g.
24616
+ * `testnet`) and neither `programId` nor a custom IDL address was supplied.
24617
+ *
24618
+ * @example
24619
+ * ```ts
24620
+ * // canonical program on the adapter's network
24621
+ * const program = sdk.solana.getProgram();
24622
+ *
24623
+ * // a different deployment, same interface
24624
+ * const legacy = sdk.solana.getProgram(vaultIdl, '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq');
24625
+ * ```
24626
+ */
24627
+ getProgram(programIdl?: any, programId?: string): Program<any>;
24628
+ getVaultState(vaultProgramId: PublicKey | string, idl: any, vaultAddress?: PublicKey | string): Promise<{
24629
+ vaultState: unknown | null;
24630
+ depositMintDecimals: number | null;
24631
+ }>;
24632
+ getVaultStateReadOnly(vaultProgramId: PublicKey | string, idl: any, vaultAddress?: PublicKey | string): Promise<{
24633
+ vaultState: ISolanaVaultState | null;
24634
+ depositMintDecimals: number | null;
24635
+ }>;
24636
+ getToken(mintAddress: string | PublicKey): Promise<{
24637
+ address: string;
24638
+ symbol: string;
24639
+ decimals: number;
24640
+ name: string;
24641
+ image: string;
24642
+ }>;
24643
+ getTokenSymbol(mintAddress: string | PublicKey): Promise<string>;
24644
+ fetchUserTokenBalance(publicKey: PublicKey | string, depositMint: PublicKey | string): Promise<any>;
24645
+ fetchUserShareBalance(publicKey: PublicKey | string, shareMint: PublicKey | string): Promise<any>;
24646
+ /**
24647
+ * BigInt-safe variant of {@link fetchUserShareBalance}. Returns the raw u64
24648
+ * `amount` (as a base-units string) plus the mint's `decimals` (or `null`
24649
+ * when the scale can't be determined — see Returns), so the caller can
24650
+ * produce a correct `INormalizedNumber` without losing precision.
24651
+ *
24652
+ * Prefer this anywhere the result feeds BigInt math — positions, max-
24653
+ * actions, redemption sizing, allowance checks. `fetchUserShareBalance`
24654
+ * returns a JS-number `uiAmount` which silently encodes against 18 decimals
24655
+ * when passed through `toNormalizedBn(value)` without an explicit decimals
24656
+ * argument; that's exactly how the jitoSOL "missing position" regression
24657
+ * manifested.
24658
+ *
24659
+ * RPC cost: 1 `getParsedTokenAccountsByOwner` call. Worst case ~150ms on a
24660
+ * healthy mainnet endpoint.
24661
+ *
24662
+ * @param publicKey Wallet owner (PublicKey or base58 string).
24663
+ * @param shareMint The vault's share-token mint (PublicKey or base58).
24664
+ * @returns
24665
+ * `{ amount, decimals }`. Three observable shapes:
24666
+ * - `{ amount: '<u64>', decimals: <number> }` — token account exists.
24667
+ * - `{ amount: '0', decimals: null }` — no token account for this mint
24668
+ * under this wallet, OR `tokenAmount` was missing from the response,
24669
+ * OR `publicKey`/`shareMint` was not supplied. Distinguishable from a
24670
+ * genuine zero-balance account (`decimals` would be set there).
24671
+ * - `{ amount: '0', decimals: null }` — RPC threw (error is logged).
24672
+ *
24673
+ * `decimals === null` means "we could not determine the scale" — callers
24674
+ * that need an `INormalizedNumber` must fall back to a known decimals
24675
+ * value (typically the deposit mint's decimals from backend metadata)
24676
+ * before normalizing. Never throws.
24677
+ */
24678
+ fetchUserShareBalanceRaw(publicKey: PublicKey | string, shareMint: PublicKey | string): Promise<{
24679
+ amount: string;
24680
+ decimals: number | null;
24681
+ }>;
24682
+ /**
24683
+ * Deposit funds into a Solana August vault.
24684
+ * @param depositAmount `bigint` (raw on-chain units) or `number` (UI amount).
24685
+ */
24686
+ vaultDeposit(vaultProgramId: PublicKey | string, idl: any, publicKey: PublicKey | string, depositAmount: number | bigint, sendTransaction: (transaction: Transaction | web3.VersionedTransaction, connection: Connection, options?: SendTransactionOptions) => Promise<web3.TransactionSignature>, vaultAddress?: PublicKey | string): Promise<any>;
24687
+ /**
24688
+ * Redeem vault shares from a Solana August vault.
24689
+ * @param redeemShares `bigint` (raw share units) or `number` (UI amount).
24690
+ */
24691
+ vaultRedeem(vaultProgramId: PublicKey | string, idl: any, publicKey: PublicKey | string, redeemShares: number | bigint, sendTransaction: (transaction: Transaction | web3.VersionedTransaction, connection: Connection, options?: SendTransactionOptions) => Promise<web3.TransactionSignature>, vaultAddress?: PublicKey | string): Promise<any>;
24692
+ /**
24693
+ * Canonical program id for a program type on this adapter's network.
24694
+ *
24695
+ * @param type - Program to look up. Only `'vault'` (august_vault) exists today.
24696
+ * @returns The base58 program id.
24697
+ * @throws {@link AugustValidationError} if the canonical program is not
24698
+ * deployed on this adapter's network (e.g. `testnet`). Previously an
24699
+ * unmapped network threw a bare `TypeError`.
24650
24700
  */
24651
- convertToShares(vaultAddress: string, rawAmount: string): Promise<string | null>;
24701
+ getProgramId(type: 'vault'): string;
24652
24702
  }
24653
24703
 
24654
- declare namespace StellarConstants {
24704
+ declare namespace SolanaConstants {
24655
24705
  export {
24656
- STELLAR_CHAIN_ID,
24657
- STELLAR_CHAIN,
24658
- SOROBAN_RPC_URLS,
24659
- NETWORK_PASSPHRASES,
24660
- STELLAR_FALLBACK_DECIMALS,
24661
- TX_TIMEOUT_SECONDS,
24662
- QUERY_TIMEOUT_SECONDS,
24663
- MAX_FEE_STROOPS,
24664
- POLL_INTERVAL_MS,
24665
- POLL_INTERVAL_MAX_MS,
24666
- POLL_INTERVAL_BACKOFF,
24667
- MAX_POLL_ATTEMPTS
24706
+ fallbackDecimals,
24707
+ fallbackNetwork,
24708
+ fallbackRpcEndpoints,
24709
+ getDeployedProgramIds,
24710
+ programIds,
24711
+ vaultIdl,
24712
+ ISolanaDeployedNetwork
24668
24713
  }
24669
24714
  }
24670
24715
 
24671
- declare namespace StellarGetters {
24716
+ declare namespace SolanaGetters {
24672
24717
  export {
24673
- getStellarVault,
24674
- getStellarUserPosition,
24675
- convertToShares
24718
+ getSolanaVault
24676
24719
  }
24677
24720
  }
24678
24721
 
24679
- declare namespace StellarSubmit {
24722
+ declare const SOROBAN_RPC_URLS: Record<IStellarNetwork, string>;
24723
+
24724
+ export declare const SPECIAL_CHAINS: {
24725
+ solana: {
24726
+ name: string;
24727
+ chainId: number;
24728
+ explorer: string;
24729
+ };
24730
+ stellar: {
24731
+ name: string;
24732
+ chainId: number;
24733
+ explorer: string;
24734
+ };
24735
+ };
24736
+
24737
+ export declare const Stellar: {
24738
+ utils: {
24739
+ isStellarAddress: isStellarAddress;
24740
+ getExplorerLink: getExplorerLink;
24741
+ assertNotStellar: assertNotStellar;
24742
+ };
24743
+ constants: typeof StellarConstants;
24744
+ actions: typeof StellarActions;
24745
+ submit: typeof StellarSubmit;
24746
+ getters: typeof StellarGetters;
24747
+ };
24748
+
24749
+ declare const STELLAR_CHAIN: {
24750
+ name: string;
24751
+ chainId: number;
24752
+ explorer: string;
24753
+ };
24754
+
24755
+ declare const STELLAR_CHAIN_ID: number;
24756
+
24757
+ declare const STELLAR_FALLBACK_DECIMALS = 7;
24758
+
24759
+ declare namespace StellarActions {
24680
24760
  export {
24681
- submitStellarTransaction
24761
+ handleStellarDeposit,
24762
+ handleStellarRedeem
24682
24763
  }
24683
24764
  }
24684
24765
 
24685
24766
  /**
24686
- * @deprecated
24687
- * Replaced by SUBGRAPH_VAULT_URLS which are subgraphs deployed on Goldsky.
24767
+ * Stellar Adapter for August SDK
24768
+ *
24769
+ * @example
24770
+ * ```
24771
+ * const adapter = new StellarAdapter('testnet');
24772
+ * const xdr = await adapter.vaultDeposit({
24773
+ * contractId: 'CBGWW5...',
24774
+ * amount: '1000000',
24775
+ * senderAddress: 'GDLZ...',
24776
+ * });
24777
+ * // Sign xdr with wallet (e.g. Freighter), then submit via adapter.submitTransaction()
24778
+ * ```
24688
24779
  */
24689
- export declare const SUBGRAPH_POOL_URLS: (apiKey: string, chainId?: number, pool?: IAddress) => {
24690
- 1: string;
24691
- 8453: string;
24692
- 43114: string;
24693
- 42161: string;
24694
- 56: string;
24695
- } | {
24696
- 999: string;
24697
- };
24780
+ export declare class StellarAdapter {
24781
+ private _network;
24782
+ /**
24783
+ * Optional consumer-supplied Soroban RPC endpoint (e.g. a keyed Alchemy URL).
24784
+ * When set it is the primary, with the SDK's public endpoints as failover.
24785
+ */
24786
+ private _sorobanRpcUrl?;
24787
+ /**
24788
+ * @param network - Stellar network to operate on; defaults to `'mainnet'`.
24789
+ * @param options - Optional adapter configuration. Its `sorobanRpcUrl` field
24790
+ * overrides the Soroban RPC endpoint (e.g. a keyed Alchemy URL): it becomes
24791
+ * the primary with the SDK's built-in public endpoints kept behind it as
24792
+ * failover, and a per-call `sorobanRpcUrl` (on the deposit/redeem params)
24793
+ * takes precedence over this adapter-level one.
24794
+ */
24795
+ constructor(network?: IStellarNetwork, options?: {
24796
+ sorobanRpcUrl?: string;
24797
+ });
24798
+ get network(): IStellarNetwork;
24799
+ isStellarAddress(address: string): boolean;
24800
+ getExplorerLink(id: string, type?: 'contract' | 'account' | 'tx'): string;
24801
+ /**
24802
+ * Build an unsigned deposit transaction for a Stellar vault.
24803
+ * @returns Base64-encoded XDR of the unsigned transaction.
24804
+ */
24805
+ vaultDeposit(params: Omit<IStellarDepositParams, 'network'>): Promise<string>;
24806
+ /**
24807
+ * Build an unsigned redeem transaction for a Stellar vault.
24808
+ * @returns Base64-encoded XDR of the unsigned transaction.
24809
+ */
24810
+ vaultRedeem(params: Omit<IStellarRedeemParams, 'network'>): Promise<string>;
24811
+ /**
24812
+ * Submit a signed Soroban transaction and poll until the network confirms it.
24813
+ *
24814
+ * Submits on the network this adapter was constructed with, so `signedXdr`
24815
+ * must be signed for that same network.
24816
+ *
24817
+ * @param signedXdr - Base64-encoded XDR of the signed transaction.
24818
+ * @returns The transaction hash once the network confirms it as successful.
24819
+ * @throws {@link AugustTimeoutError} when the transaction is not confirmed
24820
+ * within the poll budget (`MAX_POLL_ATTEMPTS`).
24821
+ * @throws {@link AugustSDKError} when the RPC rejects the submission or the
24822
+ * transaction confirms as failed. Its `context` carries `{ network, status }`
24823
+ * plus, when the result XDR decodes, a `resultCode` string holding the
24824
+ * transaction-level reason (e.g. `"txBadSeq"`, `"txTooLate"`); `resultCode`
24825
+ * is `undefined` when the code cannot be decoded.
24826
+ * @example
24827
+ * ```ts
24828
+ * try {
24829
+ * const hash = await adapter.submitTransaction(signedXdr);
24830
+ * } catch (err) {
24831
+ * if (err instanceof AugustSDKError && err.context?.resultCode === 'txBadSeq') {
24832
+ * // stale sequence number — rebuild the transaction and resubmit
24833
+ * }
24834
+ * }
24835
+ * ```
24836
+ */
24837
+ submitTransaction(signedXdr: string): Promise<string>;
24838
+ /**
24839
+ * Get user's vault share balance.
24840
+ *
24841
+ * @returns The position `{ shares, decimals, decimalsFromFallback }`, or null
24842
+ * if the balance read fails. When `decimalsFromFallback` is `true` the
24843
+ * `decimals()` read failed and `decimals` is the fallback (7) — callers sizing
24844
+ * a redeem MUST refuse rather than trust it (see AUGUST-6381).
24845
+ */
24846
+ getUserPosition(vaultAddress: string, walletAddress: string): Promise<IStellarUserPosition | null>;
24847
+ /**
24848
+ * Preview how many vault shares a deposit amount would yield.
24849
+ * @param vaultAddress Stellar contract ID (C… address)
24850
+ * @param rawAmount Deposit amount in the deposit token's smallest unit
24851
+ * @returns Raw share amount as a string, or null if query fails.
24852
+ */
24853
+ convertToShares(vaultAddress: string, rawAmount: string): Promise<string | null>;
24854
+ }
24698
24855
 
24699
- /**
24700
- * Subgraph URLs
24701
- * @deprecated use getVaultMetadata to fetch subgraph URLs from the backend
24702
- */
24703
- export declare const SUBGRAPH_VAULT_URLS: Record<VaultSymbols, string>;
24856
+ declare namespace StellarConstants {
24857
+ export {
24858
+ STELLAR_CHAIN_ID,
24859
+ STELLAR_CHAIN,
24860
+ SOROBAN_RPC_URLS,
24861
+ NETWORK_PASSPHRASES,
24862
+ STELLAR_FALLBACK_DECIMALS,
24863
+ TX_TIMEOUT_SECONDS,
24864
+ QUERY_TIMEOUT_SECONDS,
24865
+ MAX_FEE_STROOPS,
24866
+ POLL_INTERVAL_MS,
24867
+ POLL_INTERVAL_MAX_MS,
24868
+ POLL_INTERVAL_BACKOFF,
24869
+ MAX_POLL_ATTEMPTS
24870
+ }
24871
+ }
24704
24872
 
24705
- /**
24706
- * Submit a signed Soroban transaction and poll until confirmed.
24707
- *
24708
- * @param signedXdr - Base64-encoded XDR of the signed transaction
24709
- * @param network - Stellar network name
24710
- * @param sorobanRpcUrl - Optional override Soroban RPC endpoint (e.g. a keyed
24711
- * Alchemy URL); becomes the primary with the SDK's public endpoints kept as
24712
- * failover. Omit to use the public endpoints.
24713
- * @returns The transaction hash once the network confirms it as successful
24714
- * @throws {@link AugustTimeoutError} when the transaction is not confirmed
24715
- * within the poll budget (`MAX_POLL_ATTEMPTS`).
24716
- * @throws {@link AugustSDKError} when the RPC rejects the submission or the
24717
- * transaction confirms as failed. Its `context` carries `{ network, status }`
24718
- * plus, when the result XDR decodes, a `resultCode` string holding the
24719
- * transaction-level reason (e.g. `"txBadSeq"`, `"txTooLate"`); `resultCode`
24720
- * is `undefined` when the code cannot be decoded.
24721
- * @example
24722
- * ```ts
24723
- * try {
24724
- * const hash = await submitStellarTransaction(signedXdr, 'mainnet');
24725
- * } catch (err) {
24726
- * if (err instanceof AugustSDKError && err.context?.resultCode === 'txBadSeq') {
24727
- * // stale sequence number — rebuild the transaction and resubmit
24728
- * }
24729
- * }
24730
- * ```
24731
- */
24732
- declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork, sorobanRpcUrl?: string): Promise<string>;
24873
+ declare namespace StellarGetters {
24874
+ export {
24875
+ getStellarVault,
24876
+ getStellarUserPosition,
24877
+ convertToShares
24878
+ }
24879
+ }
24733
24880
 
24734
- /**
24735
- * Sui Adapter for August SDK
24736
- *
24737
- * @example
24738
- * To access the Sui adapter instance
24739
- * ```
24740
- * const sdk = new AugustSDK()
24741
- * sdk.sui.getEmberVaults()
24742
- * ```
24743
- */
24744
- declare class SuiAdapter {
24745
- private _apiBaseUrl;
24746
- private _chainId;
24747
- constructor(apiBaseUrl?: string, chainId?: number);
24748
- get apiBaseUrl(): string;
24749
- get chainId(): number;
24750
- getEmberVaults(options?: IFetchEmberVaultsOptions): Promise<IEmberVault[]>;
24751
- getEmberTVL(limit?: number): Promise<number>;
24752
- convertFromE9(value: string | number): number;
24753
- calculateUtilization(current: string | number, maximum: string | number): number;
24754
- isSuiAddress(address: string): boolean;
24755
- isSuiVault(chainId: number): boolean;
24756
- transformEmberVaultToIVault(emberVault: IEmberVault): IVault;
24757
- transformEmberVaultsToIVaults(emberVaults: IEmberVault[]): IVault[];
24881
+ declare namespace StellarSubmit {
24882
+ export {
24883
+ submitStellarTransaction
24884
+ }
24758
24885
  }
24759
24886
 
24760
24887
  /**
24761
- * Address of the `SwapRouter` periphery contract on each supported chain.
24762
- *
24763
- * Missing keys mean no SwapRouter is deployed on that chain — callers
24764
- * should fall back to legacy adapter paths.
24765
- *
24766
- * @see {@link getSwapRouterAddress} for the typed lookup helper.
24888
+ * @deprecated
24889
+ * Replaced by SUBGRAPH_VAULT_URLS which are subgraphs deployed on Goldsky.
24767
24890
  */
24768
- export declare const SWAP_ROUTER_ADDRESSES: Readonly<Record<number, IAddress>>;
24891
+ export declare const SUBGRAPH_POOL_URLS: (apiKey: string, chainId?: number, pool?: IAddress) => {
24892
+ 1: string;
24893
+ 8453: string;
24894
+ 43114: string;
24895
+ 42161: string;
24896
+ 56: string;
24897
+ } | {
24898
+ 999: string;
24899
+ };
24769
24900
 
24770
24901
  /**
24771
- * Block at which each chain's `SwapRouter` was deployed/configured — the safe
24772
- * lower bound for scanning its `TokenEnabled` / `VaultEnabled` log history.
24773
- *
24774
- * The router stores its allowlist as `mapping(address => bool) whitelistedTokens`
24775
- * with no on-chain enumeration, so {@link getSwapRouterWhitelistedTokens} must
24776
- * reconstruct the candidate set from `TokenEnabled` events before verifying each
24777
- * against the current mapping. Starting the `eth_getLogs` scan here (rather than
24778
- * from genesis) bounds it to the router's own lifetime — a few chunks — instead
24779
- * of the whole chain.
24780
- *
24781
- * Mainnet value is the router's deployment block (its first emitted event, the
24782
- * constructor `OwnershipTransferred`). A too-low value only costs extra empty
24783
- * log ranges; a value ABOVE the first `TokenEnabled` would silently miss tokens,
24784
- * so err on the side of earlier.
24902
+ * Subgraph URLs
24903
+ * @deprecated use getVaultMetadata to fetch subgraph URLs from the backend
24785
24904
  */
24786
- export declare const SWAP_ROUTER_DEPLOY_BLOCKS: Readonly<Record<number, number>>;
24905
+ export declare const SUBGRAPH_VAULT_URLS: Record<VaultSymbols, string>;
24787
24906
 
24788
24907
  /**
24789
- * The DEX aggregator whitelisted on each chain's `SwapRouter` via
24790
- * `enableRouter`, plus the single aggregator contract method every swap leg is
24791
- * pinned to and that method's 4-byte selector.
24908
+ * Submit a signed Soroban transaction and poll until confirmed.
24792
24909
  *
24793
- * This is the single source of truth tying the off-chain swap-leg builder to
24794
- * the on-chain router whitelist. The two MUST agree or `swapAndDeposit` reverts
24795
- * with `InvalidRouter()` (router not whitelisted) or `InvalidNotWhitelisted()`
24796
- * (selector not authorized). It is consumed in three places:
24797
- *
24798
- * - `dispatchViaSwapRouter` asks {@link fetchSwapQuote} to pin the aggregator to
24799
- * `contractMethod`, then asserts the returned quote's `router` and payload
24800
- * selector match this entry before broadcasting — failing closed rather than
24801
- * letting the user pay gas for a transaction the contract will reject.
24802
- * - The CI check `scripts/verify-swap-router-aggregator.mjs` asserts the
24803
- * deployed `SwapRouter` actually has `tokenTransferProxies[router] != 0` and
24804
- * `isAuthorizedSelector(router, selector) == true` for every entry here, so
24805
- * config drift is caught at release time, not by a user's failed deposit.
24806
- *
24807
- * Pinning to one generic method matters: the aggregator otherwise picks a route
24808
- * method per quote (e.g. a direct `swapExactAmountInOnUniswapV3`) that varies
24809
- * with market conditions, producing a different selector each time. Pinning
24810
- * collapses that to one stable selector so the on-chain whitelist needs only
24811
- * that selector and never drifts as routing changes.
24812
- *
24813
- * `router` is the address the aggregator's calldata targets (ParaSwap v6.2
24814
- * pulls tokens to the Augustus contract itself, so the SwapRouter's
24815
- * `tokenTransferProxies[router]` is the router address). `selector` is
24816
- * `bytes4(keccak256("<contractMethod>(...)"))`. Verify both against the
24817
- * deployed router before adding a chain a wrong value reverts at deposit time.
24818
- */
24819
- export declare const SWAP_ROUTER_DEX_AGGREGATOR: Readonly<Record<number, {
24820
- router: IAddress;
24821
- contractMethod: string;
24822
- selector: `0x${string}`;
24823
- /** Human-readable aggregator name — for display; never derive routing logic from it. */
24824
- name: string;
24825
- }>>;
24910
+ * @param signedXdr - Base64-encoded XDR of the signed transaction
24911
+ * @param network - Stellar network name
24912
+ * @param sorobanRpcUrl - Optional override Soroban RPC endpoint (e.g. a keyed
24913
+ * Alchemy URL); becomes the primary with the SDK's public endpoints kept as
24914
+ * failover. Omit to use the public endpoints.
24915
+ * @returns The transaction hash once the network confirms it as successful
24916
+ * @throws {@link AugustTimeoutError} when the transaction is not confirmed
24917
+ * within the poll budget (`MAX_POLL_ATTEMPTS`).
24918
+ * @throws {@link AugustSDKError} when the RPC rejects the submission or the
24919
+ * transaction confirms as failed. Its `context` carries `{ network, status }`
24920
+ * plus, when the result XDR decodes, a `resultCode` string holding the
24921
+ * transaction-level reason (e.g. `"txBadSeq"`, `"txTooLate"`); `resultCode`
24922
+ * is `undefined` when the code cannot be decoded.
24923
+ * @example
24924
+ * ```ts
24925
+ * try {
24926
+ * const hash = await submitStellarTransaction(signedXdr, 'mainnet');
24927
+ * } catch (err) {
24928
+ * if (err instanceof AugustSDKError && err.context?.resultCode === 'txBadSeq') {
24929
+ * // stale sequence number — rebuild the transaction and resubmit
24930
+ * }
24931
+ * }
24932
+ * ```
24933
+ */
24934
+ declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork, sorobanRpcUrl?: string): Promise<string>;
24826
24935
 
24827
- /**
24828
- * Vaults whose UI **may offer the any-token SwapRouter deposit surface** —
24829
- * i.e. the SwapRouter is `enableVault`-ed for them on-chain.
24830
- *
24831
- * This is *eligibility metadata only*. It is consumed by:
24832
- * - the app UI, to decide whether to render the (flag-gated) swap-router
24833
- * deposit surface for a vault; and
24834
- * - {@link swapRouterDeposit}, optionally, as a fail-fast eligibility check.
24835
- *
24836
- * It is deliberately **NOT** read by {@link vaultDeposit}: `vaultDeposit` is the
24837
- * native/multiasset/adapter path and never routes through the SwapRouter. That
24838
- * separation is what stops a natively-accepted asset from being silently
24839
- * swapped — the regression that implicit auto-routing caused. Any-token swap
24840
- * deposits are the explicit, opt-in job of {@link swapRouterDeposit}.
24841
- *
24842
- * Membership requires the vault to be registered on-chain
24843
- * (`vaultInfo[addr].referenceAsset != 0`) — an unregistered vault reverts with
24844
- * `InvalidVault` at deposit time. A listed vault's natively-accepted assets
24845
- * (for a multi-asset vault, its whole deposit-asset set) still deposit via
24846
- * `vaultDeposit`; only tokens OUTSIDE that set go through `swapRouterDeposit`.
24847
- *
24848
- * Lowercase comparison is required when checking — use
24849
- * {@link isSwapRouterEligible} rather than reading this set directly.
24850
- *
24851
- * @deprecated Superseded by {@link getSwapRouterEligibleVaults}, which derives
24852
- * the eligible set from the router's on-chain `VaultEnabled` history and
24853
- * verifies each vault's current registration (`vaultInfo.referenceAsset != 0`)
24854
- * — so new enablements surface without an SDK release. This static set stays
24855
- * functional as the zero-RPC fallback seed (e.g. TanStack Query `initialData`)
24856
- * and for SDK-internal sync consumers.
24857
- */
24858
- export declare const SWAP_ROUTER_ELIGIBLE_VAULTS: ReadonlySet<string>;
24936
+ /**
24937
+ * Sui Adapter for August SDK
24938
+ *
24939
+ * @example
24940
+ * To access the Sui adapter instance
24941
+ * ```
24942
+ * const sdk = new AugustSDK()
24943
+ * sdk.sui.getEmberVaults()
24944
+ * ```
24945
+ */
24946
+ declare class SuiAdapter {
24947
+ private _apiBaseUrl;
24948
+ private _chainId;
24949
+ constructor(apiBaseUrl?: string, chainId?: number);
24950
+ get apiBaseUrl(): string;
24951
+ get chainId(): number;
24952
+ getEmberVaults(options?: IFetchEmberVaultsOptions): Promise<IEmberVault[]>;
24953
+ getEmberTVL(limit?: number): Promise<number>;
24954
+ convertFromE9(value: string | number): number;
24955
+ calculateUtilization(current: string | number, maximum: string | number): number;
24956
+ isSuiAddress(address: string): boolean;
24957
+ isSuiVault(chainId: number): boolean;
24958
+ transformEmberVaultToIVault(emberVault: IEmberVault): IVault;
24959
+ transformEmberVaultsToIVaults(emberVaults: IEmberVault[]): IVault[];
24960
+ }
24859
24961
 
24860
- /**
24861
- * Maximum number of swap legs the contract accepts in a single
24862
- * `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading
24863
- * the on-chain value at call time would add an RPC for no gain.
24864
- *
24865
- * Kept here so the SDK can reject oversize inputs at the boundary rather
24866
- * than wait for the on-chain `TooManySwaps` revert.
24867
- */
24868
- export declare const SWAP_ROUTER_MAX_SWAPS = 9;
24962
+ /**
24963
+ * Address of the `SwapRouter` periphery contract on each supported chain.
24964
+ *
24965
+ * Missing keys mean no SwapRouter is deployed on that chain callers
24966
+ * should fall back to legacy adapter paths.
24967
+ *
24968
+ * @see {@link getSwapRouterAddress} for the typed lookup helper.
24969
+ */
24970
+ export declare const SWAP_ROUTER_ADDRESSES: Readonly<Record<number, IAddress>>;
24869
24971
 
24870
- /**
24871
- * Human-readable display name of the `SwapRouter` periphery contract on each
24872
- * supported chain.
24873
- *
24874
- * The contract exposes no on-chain name (no `@title` accessor), so UIs that
24875
- * want to show *which contract* performed the swap-and-deposit — rather than a
24876
- * bare address read it from here. Display metadata only: never derive
24877
- * routing or eligibility logic from it.
24878
- *
24879
- * Missing keys mean no SwapRouter is deployed on that chain.
24880
- *
24881
- * @see {@link getSwapRouterName} for the typed lookup helper.
24882
- */
24883
- export declare const SWAP_ROUTER_NAMES: Readonly<Record<number, string>>;
24972
+ /**
24973
+ * Block at which each chain's `SwapRouter` was deployed/configured the safe
24974
+ * lower bound for scanning its `TokenEnabled` / `VaultEnabled` log history.
24975
+ *
24976
+ * The router stores its allowlist as `mapping(address => bool) whitelistedTokens`
24977
+ * with no on-chain enumeration, so {@link getSwapRouterWhitelistedTokens} must
24978
+ * reconstruct the candidate set from `TokenEnabled` events before verifying each
24979
+ * against the current mapping. Starting the `eth_getLogs` scan here (rather than
24980
+ * from genesis) bounds it to the router's own lifetime — a few chunks — instead
24981
+ * of the whole chain.
24982
+ *
24983
+ * Mainnet value is the router's deployment block (its first emitted event, the
24984
+ * constructor `OwnershipTransferred`). A too-low value only costs extra empty
24985
+ * log ranges; a value ABOVE the first `TokenEnabled` would silently miss tokens,
24986
+ * so err on the side of earlier.
24987
+ */
24988
+ export declare const SWAP_ROUTER_DEPLOY_BLOCKS: Readonly<Record<number, number>>;
24884
24989
 
24885
- /**
24886
- * Wrapped-native ERC-20 per chain that has a SwapRouter deployment. Mirrors
24887
- * the on-chain `wrappedNativeTokenAddress()` view to avoid an extra RPC on
24888
- * every dispatch. Used to validate that native-token deposits target a
24889
- * vault whose reference asset is the wrapped native — the only configuration
24890
- * the contract's `depositNativeToken` / `swapAndDepositNativeToken` accept.
24891
- */
24892
- export declare const SWAP_ROUTER_WRAPPED_NATIVE: Readonly<Record<number, IAddress>>;
24990
+ /**
24991
+ * The DEX aggregator whitelisted on each chain's `SwapRouter` via
24992
+ * `enableRouter`, plus the single aggregator contract method every swap leg is
24993
+ * pinned to and that method's 4-byte selector.
24994
+ *
24995
+ * This is the single source of truth tying the off-chain swap-leg builder to
24996
+ * the on-chain router whitelist. The two MUST agree or `swapAndDeposit` reverts
24997
+ * with `InvalidRouter()` (router not whitelisted) or `InvalidNotWhitelisted()`
24998
+ * (selector not authorized). It is consumed in three places:
24999
+ *
25000
+ * - `dispatchViaSwapRouter` asks {@link fetchSwapQuote} to pin the aggregator to
25001
+ * `contractMethod`, then asserts the returned quote's `router` and payload
25002
+ * selector match this entry before broadcasting — failing closed rather than
25003
+ * letting the user pay gas for a transaction the contract will reject.
25004
+ * - The CI check `scripts/verify-swap-router-aggregator.mjs` asserts the
25005
+ * deployed `SwapRouter` actually has `tokenTransferProxies[router] != 0` and
25006
+ * `isAuthorizedSelector(router, selector) == true` for every entry here, so
25007
+ * config drift is caught at release time, not by a user's failed deposit.
25008
+ *
25009
+ * Pinning to one generic method matters: the aggregator otherwise picks a route
25010
+ * method per quote (e.g. a direct `swapExactAmountInOnUniswapV3`) that varies
25011
+ * with market conditions, producing a different selector each time. Pinning
25012
+ * collapses that to one stable selector so the on-chain whitelist needs only
25013
+ * that selector and never drifts as routing changes.
25014
+ *
25015
+ * `router` is the address the aggregator's calldata targets (ParaSwap v6.2
25016
+ * pulls tokens to the Augustus contract itself, so the SwapRouter's
25017
+ * `tokenTransferProxies[router]` is the router address). `selector` is
25018
+ * `bytes4(keccak256("<contractMethod>(...)"))`. Verify both against the
25019
+ * deployed router before adding a chain — a wrong value reverts at deposit time.
25020
+ */
25021
+ export declare const SWAP_ROUTER_DEX_AGGREGATOR: Readonly<Record<number, {
25022
+ router: IAddress;
25023
+ contractMethod: string;
25024
+ selector: `0x${string}`;
25025
+ /** Human-readable aggregator name — for display; never derive routing logic from it. */
25026
+ name: string;
25027
+ }>>;
24893
25028
 
24894
- /**
24895
- * Swap one or more whitelisted ERC-20s into a vault's reference asset via
24896
- * the on-chain SwapRouter, then deposit the proceeds into the vault.
24897
- *
24898
- * Approval is sent automatically when the caller's allowance on each
24899
- * `swaps[i].tokenIn` against the SwapRouter is below `amountIn`.
24900
- *
24901
- * @param signer - ethers `Signer` or `Wallet` with the EOA that holds the input tokens.
24902
- * @param options - {@link ISwapAndDepositOptions}.
24903
- * @returns The transaction hash of the `swapAndDeposit` call.
24904
- *
24905
- * @throws {@link AugustValidationError} for unsupported chains, invalid
24906
- * addresses, empty/oversized swap arrays.
24907
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
24908
- *
24909
- * @example
24910
- * ```ts
24911
- * const quote = await fetchSwapQuote({
24912
- * chainId: 1,
24913
- * srcToken: WBTC,
24914
- * srcDecimals: 8,
24915
- * destToken: USDC,
24916
- * destDecimals: 6,
24917
- * amount: 100_000_000n,
24918
- * receiver: SWAP_ROUTER_ADDRESSES[1]!,
24919
- * });
24920
- * const hash = await swapAndDeposit(signer, {
24921
- * chainId: 1,
24922
- * vault: '0x8AcA0841993ef4C87244d519166e767f49362C21',
24923
- * receiver: wallet,
24924
- * swaps: [{
24925
- * tokenIn: WBTC,
24926
- * tokenOut: USDC,
24927
- * amountIn: 100_000_000n,
24928
- * minAmountOut: quote.minAmountOut,
24929
- * router: quote.router,
24930
- * payload: quote.payload,
24931
- * }],
24932
- * });
24933
- * ```
24934
- */
24935
- export declare function swapAndDeposit(signer: Signer | Wallet, options: ISwapAndDepositOptions): Promise<string>;
25029
+ /**
25030
+ * Vaults whose UI **may offer the any-token SwapRouter deposit surface**
25031
+ * i.e. the SwapRouter is `enableVault`-ed for them on-chain.
25032
+ *
25033
+ * This is *eligibility metadata only*. It is consumed by:
25034
+ * - the app UI, to decide whether to render the (flag-gated) swap-router
25035
+ * deposit surface for a vault; and
25036
+ * - {@link swapRouterDeposit}, optionally, as a fail-fast eligibility check.
25037
+ *
25038
+ * It is deliberately **NOT** read by {@link vaultDeposit}: `vaultDeposit` is the
25039
+ * native/multiasset/adapter path and never routes through the SwapRouter. That
25040
+ * separation is what stops a natively-accepted asset from being silently
25041
+ * swapped the regression that implicit auto-routing caused. Any-token swap
25042
+ * deposits are the explicit, opt-in job of {@link swapRouterDeposit}.
25043
+ *
25044
+ * Membership requires the vault to be registered on-chain
25045
+ * (`vaultInfo[addr].referenceAsset != 0`) — an unregistered vault reverts with
25046
+ * `InvalidVault` at deposit time. A listed vault's natively-accepted assets
25047
+ * (for a multi-asset vault, its whole deposit-asset set) still deposit via
25048
+ * `vaultDeposit`; only tokens OUTSIDE that set go through `swapRouterDeposit`.
25049
+ *
25050
+ * Lowercase comparison is required when checking — use
25051
+ * {@link isSwapRouterEligible} rather than reading this set directly.
25052
+ *
25053
+ * @deprecated Superseded by {@link getSwapRouterEligibleVaults}, which derives
25054
+ * the eligible set from the router's on-chain `VaultEnabled` history and
25055
+ * verifies each vault's current registration (`vaultInfo.referenceAsset != 0`)
25056
+ * — so new enablements surface without an SDK release. This static set stays
25057
+ * functional as the zero-RPC fallback seed (e.g. TanStack Query `initialData`)
25058
+ * and for SDK-internal sync consumers.
25059
+ */
25060
+ export declare const SWAP_ROUTER_ELIGIBLE_VAULTS: ReadonlySet<string>;
24936
25061
 
24937
25062
  /**
24938
- * Deposit into an August vault through the on-chain `SwapRouter`, selecting the
24939
- * correct router path from the deposit asset. This is the high-level, explicit
24940
- * counterpart to the SwapRouter branch inside {@link vaultDeposit}.
25063
+ * Maximum number of swap legs the contract accepts in a single
25064
+ * `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading
25065
+ * the on-chain value at call time would add an RPC for no gain.
24941
25066
  *
24942
- * Where `vaultDeposit` decides whether to use the SwapRouter from the
24943
- * `VAULTS_USING_SWAP_ROUTER` allowlist, this function always routes through the
24944
- * SwapRouter because the caller asked it to. Making the intent explicit is the
24945
- * point: a native-deposit vault (e.g. a multi-asset Tokenized Vault V2 whose
24946
- * non-reference assets are accepted directly) is never accidentally swapped —
24947
- * the regression that implicit, allowlist-driven routing caused. Use
24948
- * `vaultDeposit` for native / adapter deposits and this for SwapRouter deposits.
25067
+ * Kept here so the SDK can reject oversize inputs at the boundary rather
25068
+ * than wait for the on-chain `TooManySwaps` revert.
25069
+ */
25070
+ export declare const SWAP_ROUTER_MAX_SWAPS = 9;
25071
+
25072
+ /**
25073
+ * Human-readable display name of the `SwapRouter` periphery contract on each
25074
+ * supported chain.
24949
25075
  *
24950
- * The vault's reference asset and its decimals are read on-chain (never trusted
24951
- * from the caller a wrong reference asset would mis-route the swap). The path
24952
- * is then chosen from `depositAsset`:
24953
- * - equals the reference asset direct router deposit, no swap
24954
- * ({@link depositViaSwapRouter});
24955
- * - the zero address → native-token deposit ({@link depositNativeViaSwapRouter}),
24956
- * valid only when the reference asset is the chain's wrapped-native token;
24957
- * - any other ERC-20 → a swap to the reference asset (Paraswap quote pinned to
24958
- * the chain's whitelisted aggregator, fail-closed on router/selector drift)
24959
- * bundled into {@link swapAndDeposit}.
25076
+ * The contract exposes no on-chain name (no `@title` accessor), so UIs that
25077
+ * want to show *which contract* performed the swap-and-deposit rather than a
25078
+ * bare address read it from here. Display metadata only: never derive
25079
+ * routing or eligibility logic from it.
24960
25080
  *
24961
- * Side effects: reads tokenized-vault metadata, the vault's reference asset and
24962
- * decimals, and (on the swap path) one Paraswap quote; sends one ERC-20
24963
- * `approve` to the SwapRouter when allowance is short, then the deposit tx.
25081
+ * Missing keys mean no SwapRouter is deployed on that chain.
24964
25082
  *
24965
- * @param signer - ethers `Signer` or `Wallet` that signs the approval + deposit.
24966
- * @param options - {@link ISwapRouterDepositOptions}.
24967
- * @returns The transaction hash of the router deposit call.
24968
- * @throws {@link AugustValidationError} for an unsupported chain (no SwapRouter
24969
- * deployment), an invalid vault or deposit-asset address, a missing or zero
24970
- * amount, a native deposit into a non-wrapped-native vault, or drift between
24971
- * the aggregator quote and the on-chain router whitelist.
24972
- * @worstCaseRpcCalls 5 on the swap path — tokenized-vault metadata, reference
24973
- * asset + decimals, deposit-token decimals, the quote, and the allowance read.
24974
- * @example
24975
- * ```ts
24976
- * // USDT deposited into a USDC-reference vault → swapped to USDC en route.
24977
- * const hash = await augustSdk.evm.swapRouterDeposit({
24978
- * chainId: 1,
24979
- * vault: '0xe9b725010a9e419412ed67d0fa5f3a5f40159d32',
24980
- * depositAsset: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
24981
- * amount: '100',
24982
- * slippageBps: 50,
24983
- * });
24984
- * ```
24985
- */
24986
- export declare function swapRouterDeposit(signer: Signer | Wallet, options: ISwapRouterDepositOptions): Promise<string>;
24987
-
24988
- /**
24989
- * Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
24990
- * the ERC-4626 (`deposit(uint256, address)`) and multi-asset
24991
- * (`deposit(address, uint256, address)`) deposit interfaces.
24992
- *
24993
- * Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
24994
- * constants exactly. Set by an admin per-vault via `enableVault` and looked
24995
- * up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
24996
- * this — the router resolves it internally.
24997
- */
24998
- export declare enum SwapRouterVaultType {
24999
- ERC4626 = 1,
25000
- TokenizedVaultV2 = 2
25001
- }
25002
-
25003
- /**
25004
- * Table of Contents
25005
- * - Formatters
25006
- * - Datetime
25007
- * - Arrays
25008
- * - Caching
25009
- */
25010
- export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
25011
-
25012
- /**
25013
- * Formatters
25014
- */
25015
- export declare function toTitleCase(str: string, type?: 'camel'): string;
25016
-
25017
- /**
25018
- * Track API response times and status.
25019
- *
25020
- * @param endpoint - The API endpoint called
25021
- * @param method - HTTP method used
25022
- * @param startTime - Start timestamp from performance.now()
25023
- * @param status - HTTP response status code (0 for network errors)
25024
- * @param server - Server identifier (production, staging, etc.)
25025
- */
25026
- export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
25027
-
25028
- /**
25029
- * Track chain/network switches for usage distribution analysis.
25030
- *
25031
- * @param chainId - The chain ID being switched to
25032
- */
25033
- export declare function trackNetworkSwitch(chainId: number): void;
25034
-
25035
- export declare function truncate(s: string, amount?: number): string;
25036
-
25037
- /* Excluded from this release type: tryRecoverTxHash */
25038
-
25039
- /**
25040
- * Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
25041
- * Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
25042
- * checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
25043
- * would throw). Add an address here to drop its `latest_reported_tvl` from
25044
- * the headline number — e.g. closed pre-deposit vaults, test vaults, or
25045
- * migrated v1 pools that are double-counted by a v2 successor.
25046
- */
25047
- export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
25048
-
25049
- /**
25050
- * Validity window for a submitted Soroban invocation (seconds).
25051
- *
25052
- * This becomes the transaction's `maxTime`. Validators reject a tx whose
25053
- * `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
25054
- * realistic sign-then-submit path: hardware wallets, careful manual review,
25055
- * and institutional approval flows (e.g. Fordefi) that don't sign instantly.
25056
- * 10 minutes comfortably covers those while staying well inside the Soroban
25057
- * footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
25058
- *
25059
- * The window is anchored to the *network* clock (see `getNetworkCloseTime` in
25060
- * soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
25061
- * make the deadline expire early.
25062
- */
25063
- declare const TX_TIMEOUT_SECONDS = 600;
25064
-
25065
- export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
25066
- [Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
25067
- } & {
25068
- /**
25069
- * Return the function for a given name. This is useful when a contract
25070
- * method name conflicts with a JavaScript name such as ``prototype`` or
25071
- * when using a Contract programatically.
25072
- */
25073
- getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
25074
- /**
25075
- * Return the event for a given name. This is useful when a contract
25076
- * event name conflicts with a JavaScript name such as ``prototype`` or
25077
- * when using a Contract programatically.
25078
- */
25079
- getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
25080
- /**
25081
- * All the Events available on this contract.
25082
- */
25083
- filters: {
25084
- [EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
25085
- };
25086
- };
25087
-
25088
- 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']>>>> {
25089
- (...args: [...TEventArgs]): DeferredTopicFilter;
25090
- /**
25091
- * The name of the Contract event.
25092
- */
25093
- name: TEventName;
25094
- /**
25095
- * The fragment of the Contract event. This will throw on ambiguous
25096
- * method names.
25097
- */
25098
- fragment: EventFragment;
25099
- /**
25100
- * Returns the fragment constrained by %%args%%. This can be used to
25101
- * resolve ambiguous event names.
25102
- */
25103
- getFragment(...args: [...TEventArgs]): EventFragment;
25104
- }
25105
-
25106
- 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>> {
25107
- (...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
25108
- /**
25109
- * The name of the Contract method.
25110
- */
25111
- name: TFunctionName;
25112
- /**
25113
- * The fragment of the Contract method. This will throw on ambiguous
25114
- * method names.
25115
- */
25116
- fragment: TFragment;
25117
- /**
25118
- * Returns the fragment constrained by %%args%%. This can be used to
25119
- * resolve ambiguous method names.
25120
- */
25121
- getFragment(...args: [...TInputArgs]): TFragment;
25122
- /**
25123
- * Returns a populated transaction that can be used to perform the
25124
- * contract method with %%args%%.
25125
- */
25126
- populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
25083
+ * @see {@link getSwapRouterName} for the typed lookup helper.
25084
+ */
25085
+ export declare const SWAP_ROUTER_NAMES: Readonly<Record<number, string>>;
25086
+
25087
+ /**
25088
+ * Wrapped-native ERC-20 per chain that has a SwapRouter deployment. Mirrors
25089
+ * the on-chain `wrappedNativeTokenAddress()` view to avoid an extra RPC on
25090
+ * every dispatch. Used to validate that native-token deposits target a
25091
+ * vault whose reference asset is the wrapped native the only configuration
25092
+ * the contract's `depositNativeToken` / `swapAndDepositNativeToken` accept.
25093
+ */
25094
+ export declare const SWAP_ROUTER_WRAPPED_NATIVE: Readonly<Record<number, IAddress>>;
25095
+
25096
+ /**
25097
+ * Swap one or more whitelisted ERC-20s into a vault's reference asset via
25098
+ * the on-chain SwapRouter, then deposit the proceeds into the vault.
25099
+ *
25100
+ * Approval is sent automatically when the caller's allowance on each
25101
+ * `swaps[i].tokenIn` against the SwapRouter is below `amountIn`.
25102
+ *
25103
+ * @param signer - ethers `Signer` or `Wallet` with the EOA that holds the input tokens.
25104
+ * @param options - {@link ISwapAndDepositOptions}.
25105
+ * @returns The transaction hash of the `swapAndDeposit` call.
25106
+ *
25107
+ * @throws {@link AugustValidationError} for unsupported chains, invalid
25108
+ * addresses, empty/oversized swap arrays.
25109
+ * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
25110
+ *
25111
+ * @example
25112
+ * ```ts
25113
+ * const quote = await fetchSwapQuote({
25114
+ * chainId: 1,
25115
+ * srcToken: WBTC,
25116
+ * srcDecimals: 8,
25117
+ * destToken: USDC,
25118
+ * destDecimals: 6,
25119
+ * amount: 100_000_000n,
25120
+ * receiver: SWAP_ROUTER_ADDRESSES[1]!,
25121
+ * });
25122
+ * const hash = await swapAndDeposit(signer, {
25123
+ * chainId: 1,
25124
+ * vault: '0x8AcA0841993ef4C87244d519166e767f49362C21',
25125
+ * receiver: wallet,
25126
+ * swaps: [{
25127
+ * tokenIn: WBTC,
25128
+ * tokenOut: USDC,
25129
+ * amountIn: 100_000_000n,
25130
+ * minAmountOut: quote.minAmountOut,
25131
+ * router: quote.router,
25132
+ * payload: quote.payload,
25133
+ * }],
25134
+ * });
25135
+ * ```
25136
+ */
25137
+ export declare function swapAndDeposit(signer: Signer | Wallet, options: ISwapAndDepositOptions): Promise<string>;
25138
+
25127
25139
  /**
25128
- * Call the contract method with %%args%% and return the value.
25140
+ * Deposit into an August vault through the on-chain `SwapRouter`, selecting the
25141
+ * correct router path from the deposit asset. This is the high-level, explicit
25142
+ * counterpart to the SwapRouter branch inside {@link vaultDeposit}.
25129
25143
  *
25130
- * If the return value is a single type, it will be dereferenced and
25131
- * returned directly, otherwise the full Result will be returned.
25132
- */
25133
- staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
25134
- /**
25135
- * Send a transaction for the contract method with %%args%%.
25136
- */
25137
- send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
25138
- /**
25139
- * Estimate the gas to send the contract method with %%args%%.
25140
- */
25141
- estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
25142
- /**
25143
- * Call the contract method with %%args%% and return the Result
25144
- * without any dereferencing.
25145
- */
25146
- staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
25147
- }
25148
-
25149
- 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;
25150
-
25151
- export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
25152
- name: TFunction['name'];
25153
- type: TFunction['type'];
25154
- inputs: TFunction['inputs'];
25155
- outputs: TFunction['outputs'];
25156
- stateMutability: TFunction['stateMutability'];
25157
- };
25158
-
25159
- export declare function unixToDate(epoch: number): Date;
25160
-
25161
- /**
25162
- * Update the current user identity in Sentry.
25163
- * Called when wallet address changes.
25164
- *
25165
- * @param walletAddress - New wallet address (or undefined to clear)
25166
- * @param environment - Current environment
25167
- */
25168
- export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
25169
-
25170
- /* Excluded from this release type: validateAmountPrecision */
25171
-
25172
- /**
25173
- * Vault adapter configurations mapping vault addresses to their adapter settings
25174
- */
25175
- export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
25176
-
25177
- 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}`>;
25178
-
25179
- /**
25180
- * Hardcoded subaccount addresses for specific vaults allocations
25181
- */
25182
- export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
25183
- AgoraAUSD: {
25184
- address: IAddress;
25185
- subaccount: IAddress;
25186
- useDebank: boolean;
25187
- };
25188
- earnAUSD: {
25189
- address: IAddress;
25190
- subaccount: IAddress;
25191
- useDebank: boolean;
25192
- };
25193
- MonarqXRP: {
25194
- address: IAddress;
25195
- subaccount: IAddress;
25196
- useDebank: boolean;
25197
- };
25198
- };
25199
-
25200
- /**
25201
- * The functions to call on the vault contract
25202
- * @returns The functions to call
25203
- */
25204
- export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
25205
-
25206
- export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
25207
-
25208
- export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
25209
-
25210
- export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
25211
-
25212
- /**
25213
- * Vault Symbols Mapping
25214
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
25215
- */
25216
- export declare const VAULT_SYMBOLS: Record<IAddress, string>;
25217
-
25218
- /**
25219
- * Vault Symbols Reverse Mapping
25220
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
25221
- */
25222
- export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
25223
-
25224
- /**
25225
- * Address type for vault contracts across all supported chains.
25226
- * EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
25227
- * and Stellar vaults use 56-character base32 addresses (G/C prefix).
25228
- *
25229
- * Use this instead of `IAddress` when the address may belong to any chain.
25230
- */
25231
- export declare type VaultAddress = string;
25232
-
25233
- /**
25234
- * allowance checks user's current allowance per pool
25235
- * @param signer - signer / provider object
25236
- * @param options - object including pool contract address, user wallet address
25237
- * @returns normalized number object of the user's current allowance
25238
- */
25239
- export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
25240
-
25241
- /**
25242
- * Approve a vault (or the appropriate adapter wrapper) to spend a token
25243
- * ahead of a separate deposit call. Spender routing mirrors
25244
- * {@link vaultDeposit} (multi-asset vault, adapter wrapper, standard
25245
- * vault). Returns `undefined` when the existing allowance already covers
25246
- * `amount` **or** when the deposit asset is native.
25247
- *
25248
- * @returns Transaction hash when an approval was sent, `undefined` when
25249
- * the existing allowance already covers `amount` or the deposit asset is
25250
- * native (no ERC-20 allowance applies). Use {@link approve} for a
25251
- * discriminated `ApproveResult` if you need to tell those two cases apart.
25252
- * @throws AugustValidationError on invalid wallet/target/amount.
25253
- *
25254
- * @example
25255
- * ```ts
25256
- * const hash = await augustSdk.evm.vaultApprove({
25257
- * target: '0x...', // vault contract address
25258
- * wallet: walletAddress,
25259
- * amount: '100', // 100 of the deposit token (UI units)
25260
- * wait: true, // wait for the approval to confirm
25261
- * });
25262
- * if (hash) console.log('approve tx', hash);
25263
- * // hash === undefined means the on-chain allowance already covers the
25264
- * // amount, or the deposit asset is native (msg.value, no allowance).
25265
- * ```
25266
- */
25267
- export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
25268
-
25269
- /**
25270
- * Deposit underlying token into the specified vault. Auto-routes to the
25271
- * correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
25272
- * Paraswap adapter, native-token wrapper, depositWithPermit) based on the
25273
- * vault version and `depositAsset`.
25274
- *
25275
- * Amounts are encoded against the **deposit token's** decimals, not the
25276
- * vault's share decimals. The SDK reads the appropriate decimals via the
25277
- * vault metadata and the asset's ERC-20.
25278
- *
25279
- * Approval is handled automatically: if the existing allowance doesn't
25280
- * cover `amount`, an `approve` is sent and **always waited for** (regardless
25281
- * of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
25282
- * of the approval on Monad-style RPCs.
25283
- *
25284
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
25285
- * @param options Vault address, wallet, amount, optional `depositAsset` for
25286
- * adapter routes, optional `wait` to wait for the deposit receipt.
25287
- * @returns Deposit transaction hash.
25288
- * @throws AugustValidationError on invalid wallet/target/amount or missing
25289
- * adapter config when `depositAsset` differs from the vault underlying.
25290
- * @throws AugustSDKError when the deposit submission or on-chain call fails.
25291
- *
25292
- * @example
25293
- * ```ts
25294
- * const hash = await augustSdk.evm.vaultDeposit({
25295
- * target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
25296
- * wallet: walletAddress,
25297
- * amount: '100', // 100 USDC (UI units)
25298
- * wait: true, // wait for the deposit receipt
25299
- * });
25300
- * ```
25301
- *
25302
- * @example Adapter deposit (different deposit asset than the vault's underlying)
25303
- * ```ts
25304
- * await augustSdk.evm.vaultDeposit({
25305
- * target: vaultAddress,
25306
- * wallet: walletAddress,
25307
- * amount: '0.5',
25308
- * depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
25309
- * chainId: 1,
25310
- * });
25311
- * ```
25312
- */
25313
- export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
25314
-
25315
- /**
25316
- * Check if vault has adapter support
25317
- */
25318
- export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
25319
-
25320
- declare const vaultIdl: {
25321
- address: string;
25322
- metadata: {
25323
- name: string;
25324
- version: string;
25325
- spec: string;
25326
- description: string;
25327
- };
25328
- instructions: ({
25329
- name: string;
25330
- docs: string[];
25331
- discriminator: number[];
25332
- accounts: ({
25333
- name: string;
25334
- writable: boolean;
25335
- pda: {
25336
- seeds: {
25337
- kind: string;
25338
- value: number[];
25339
- }[];
25340
- };
25341
- signer?: undefined;
25342
- address?: undefined;
25343
- } | {
25344
- name: string;
25345
- signer: boolean;
25346
- writable?: undefined;
25347
- pda?: undefined;
25348
- address?: undefined;
25349
- } | {
25350
- name: string;
25351
- writable: boolean;
25352
- pda?: undefined;
25353
- signer?: undefined;
25354
- address?: undefined;
25355
- } | {
25356
- name: string;
25357
- address: string;
25358
- writable?: undefined;
25359
- pda?: undefined;
25360
- signer?: undefined;
25361
- })[];
25362
- args: any[];
25363
- } | {
25364
- name: string;
25365
- docs: string[];
25366
- discriminator: number[];
25367
- accounts: ({
25368
- name: string;
25369
- writable: boolean;
25370
- signer: boolean;
25371
- docs?: undefined;
25372
- pda?: undefined;
25373
- address?: undefined;
25374
- } | {
25375
- name: string;
25376
- docs: string[];
25377
- writable: boolean;
25378
- signer: boolean;
25379
- pda?: undefined;
25380
- address?: undefined;
25381
- } | {
25382
- name: string;
25383
- docs: string[];
25384
- writable: boolean;
25385
- pda: {
25386
- seeds: {
25387
- kind: string;
25388
- value: number[];
25389
- }[];
25390
- program?: undefined;
25391
- };
25392
- signer?: undefined;
25393
- address?: undefined;
25394
- } | {
25395
- name: string;
25396
- docs: string[];
25397
- writable: boolean;
25398
- signer?: undefined;
25399
- pda?: undefined;
25400
- address?: undefined;
25401
- } | {
25402
- name: string;
25403
- writable: boolean;
25404
- pda: {
25405
- seeds: ({
25406
- kind: string;
25407
- value: number[];
25408
- path?: undefined;
25409
- } | {
25410
- kind: string;
25411
- path: string;
25412
- value?: undefined;
25413
- })[];
25414
- program: {
25415
- kind: string;
25416
- value: number[];
25417
- };
25418
- };
25419
- signer?: undefined;
25420
- docs?: undefined;
25421
- address?: undefined;
25422
- } | {
25423
- name: string;
25424
- address: string;
25425
- writable?: undefined;
25426
- signer?: undefined;
25427
- docs?: undefined;
25428
- pda?: undefined;
25429
- })[];
25430
- args: {
25431
- name: string;
25432
- type: string;
25433
- }[];
25434
- } | {
25435
- name: string;
25436
- docs: string[];
25437
- discriminator: number[];
25438
- accounts: ({
25439
- name: string;
25440
- writable: boolean;
25441
- pda: {
25442
- seeds: ({
25443
- kind: string;
25444
- value: number[];
25445
- path?: undefined;
25446
- } | {
25447
- kind: string;
25448
- path: string;
25449
- value?: undefined;
25450
- })[];
25451
- };
25452
- signer?: undefined;
25453
- } | {
25454
- name: string;
25455
- writable: boolean;
25456
- pda?: undefined;
25457
- signer?: undefined;
25458
- } | {
25459
- name: string;
25460
- writable: boolean;
25461
- signer: boolean;
25462
- pda?: undefined;
25463
- } | {
25464
- name: string;
25465
- writable?: undefined;
25466
- pda?: undefined;
25467
- signer?: undefined;
25468
- })[];
25469
- args: {
25470
- name: string;
25471
- type: string;
25472
- }[];
25473
- } | {
25474
- name: string;
25475
- docs: string[];
25476
- discriminator: number[];
25477
- accounts: ({
25478
- name: string;
25479
- writable: boolean;
25480
- pda: {
25481
- seeds: ({
25482
- kind: string;
25483
- value: number[];
25484
- path?: undefined;
25485
- } | {
25486
- kind: string;
25487
- path: string;
25488
- value?: undefined;
25489
- })[];
25490
- };
25491
- signer?: undefined;
25492
- address?: undefined;
25493
- } | {
25494
- name: string;
25495
- writable?: undefined;
25496
- pda?: undefined;
25497
- signer?: undefined;
25498
- address?: undefined;
25499
- } | {
25500
- name: string;
25501
- writable: boolean;
25502
- signer: boolean;
25503
- pda?: undefined;
25504
- address?: undefined;
25505
- } | {
25506
- name: string;
25507
- address: string;
25508
- writable?: undefined;
25509
- pda?: undefined;
25510
- signer?: undefined;
25511
- })[];
25512
- args: {
25513
- name: string;
25514
- type: string;
25515
- }[];
25516
- } | {
25517
- name: string;
25518
- docs: string[];
25519
- discriminator: number[];
25520
- accounts: ({
25521
- name: string;
25522
- writable: boolean;
25523
- pda: {
25524
- seeds: {
25525
- kind: string;
25526
- value: number[];
25527
- }[];
25528
- };
25529
- signer?: undefined;
25530
- address?: undefined;
25531
- } | {
25532
- name: string;
25533
- signer: boolean;
25534
- writable?: undefined;
25535
- pda?: undefined;
25536
- address?: undefined;
25537
- } | {
25538
- name: string;
25539
- writable: boolean;
25540
- signer: boolean;
25541
- pda?: undefined;
25542
- address?: undefined;
25543
- } | {
25544
- name: string;
25545
- address: string;
25546
- writable?: undefined;
25547
- pda?: undefined;
25548
- signer?: undefined;
25549
- })[];
25550
- args: {
25551
- name: string;
25552
- type: string;
25553
- }[];
25554
- } | {
25555
- name: string;
25556
- docs: string[];
25557
- discriminator: number[];
25558
- accounts: ({
25559
- name: string;
25560
- writable: boolean;
25561
- pda: {
25562
- seeds: ({
25563
- kind: string;
25564
- value: number[];
25565
- path?: undefined;
25566
- } | {
25567
- kind: string;
25568
- path: string;
25569
- value?: undefined;
25570
- })[];
25571
- program?: undefined;
25572
- };
25573
- signer?: undefined;
25574
- } | {
25575
- name: string;
25576
- writable: boolean;
25577
- pda: {
25578
- seeds: ({
25579
- kind: string;
25580
- path: string;
25581
- value?: undefined;
25582
- } | {
25583
- kind: string;
25584
- value: number[];
25585
- path?: undefined;
25586
- })[];
25587
- program: {
25588
- kind: string;
25589
- value: number[];
25590
- };
25591
- };
25592
- signer?: undefined;
25593
- } | {
25594
- name: string;
25595
- writable: boolean;
25596
- pda?: undefined;
25597
- signer?: undefined;
25598
- } | {
25599
- name: string;
25600
- signer: boolean;
25601
- writable?: undefined;
25602
- pda?: undefined;
25603
- } | {
25604
- name: string;
25605
- writable?: undefined;
25606
- pda?: undefined;
25607
- signer?: undefined;
25608
- })[];
25609
- args: {
25610
- name: string;
25611
- type: string;
25612
- }[];
25613
- })[];
25614
- accounts: {
25615
- name: string;
25616
- discriminator: number[];
25617
- }[];
25618
- events: {
25619
- name: string;
25620
- discriminator: number[];
25621
- }[];
25622
- errors: {
25623
- code: number;
25624
- name: string;
25625
- msg: string;
25626
- }[];
25627
- types: ({
25628
- name: string;
25629
- serialization: string;
25630
- repr: {
25631
- kind: string;
25632
- };
25633
- type: {
25634
- kind: string;
25635
- fields: {
25636
- name: string;
25637
- type: string;
25638
- }[];
25639
- };
25640
- } | {
25641
- name: string;
25642
- type: {
25643
- kind: string;
25644
- fields: ({
25645
- name: string;
25646
- type: string;
25647
- } | {
25648
- name: string;
25649
- type: {
25650
- array: (string | number)[];
25651
- };
25652
- })[];
25653
- };
25654
- serialization?: undefined;
25655
- repr?: undefined;
25656
- })[];
25657
- };
25658
-
25659
- /**
25660
- * @TODO
25661
- * @description withdraw funds from the specified pool including accrued rewards
25662
- * @param signer signer / wallet object
25663
- * @param options object including pool contract address, user wallet address, and more
25664
- * @returns claim tx hash
25665
- */
25666
- export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
25667
- year: string;
25668
- month: string;
25669
- day: string;
25670
- receiverIndex: string;
25671
- }): Promise<string>;
25672
-
25673
- export declare enum VaultRedemptionStatus {
25674
- AWAITING_COOLDOWN = "awaiting_cooldown",
25675
- READY_TO_CLAIM = "ready_to_claim"
25676
- }
25677
-
25678
- /**
25679
- * Request to redeem vault shares. For EVM-1 vaults this queues a standard
25680
- * redemption (claimable later via `vaultRedeem`); for EVM-2 vaults this
25681
- * also handles the receipt-token allowance automatically. Pass
25682
- * `isInstantRedeem: true` for vaults that support instant settlement.
25683
- *
25684
- * Approval of the receipt token (EVM-2) is always waited on before the
25685
- * redeem call, regardless of the caller's `wait` flag.
25686
- *
25687
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
25688
- * @param options Vault address, wallet, amount, optional `isInstantRedeem`,
25689
- * optional `wait` to wait for the redeem receipt.
25690
- * @returns Redeem transaction hash.
25691
- * @throws AugustValidationError on invalid wallet/target/amount.
25692
- * @throws AugustSDKError when the redeem submission or on-chain call fails.
25693
- *
25694
- * @example
25695
- * ```ts
25696
- * const hash = await augustSdk.evm.vaultRequestRedeem({
25697
- * target: vaultAddress,
25698
- * wallet: walletAddress,
25699
- * amount: '10', // 10 shares (UI units)
25700
- * wait: true,
25701
- * });
25702
- * ```
25703
- *
25704
- * @example Instant redemption
25705
- * ```ts
25706
- * await augustSdk.evm.vaultRequestRedeem({
25707
- * target: vaultAddress,
25708
- * wallet: walletAddress,
25709
- * amount: '10',
25710
- * isInstantRedeem: true,
25711
- * });
25712
- * ```
25713
- */
25714
- export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
25715
-
25716
- /**
25717
- * @deprecated Renamed to {@link SWAP_ROUTER_ELIGIBLE_VAULTS} (itself now
25718
- * superseded by {@link getSwapRouterEligibleVaults}, the on-chain-derived
25719
- * resolver), and the semantics changed: this set no longer drives
25720
- * `vaultDeposit` auto-routing (that branch was removed) — it only marks vaults
25721
- * whose UI may offer the swap-router deposit surface. Kept as an alias for one
25722
- * release; migrate to the async resolver.
25723
- */
25724
- export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
25725
-
25726
- /**
25727
- * Vault Receipt Symbol Mapping
25728
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
25729
- */
25730
- 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';
25731
-
25732
- /**
25733
- * @deprecated Renamed to {@link isSwapRouterEligible} (itself now superseded by
25734
- * {@link getSwapRouterEligibleVaults}, the on-chain-derived resolver). The
25735
- * meaning also changed: it no longer implies `vaultDeposit` routes the vault
25736
- * through the SwapRouter (that behavior was removed) — it only reports
25737
- * swap-router *eligibility* for the opt-in deposit surface. Kept as an alias
25738
- * for one release; migrate to the async resolver.
25739
- */
25740
- export declare const vaultUsesSwapRouter: typeof isSwapRouterEligible;
25741
-
25742
- export declare function verifyAugustKey(key: string): Promise<boolean>;
25743
-
25744
- export declare function verifyInfuraKey(key: string): Promise<boolean>;
25745
-
25746
- /**
25747
- * Convert a viem WalletClient to an ethers-compatible Signer
25748
- * Uses the walletClient as a provider and wraps it for ethers compatibility
25749
- * @param walletClient Viem WalletClient from wagmi or viem
25750
- * @returns Ethers Signer that can be used with the SDK
25751
- */
25752
- export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
25753
-
25754
- /**
25755
- * @param walletClient a wagmi-derived client (from useWalletClient)
25756
- * @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
25757
- */
25758
- export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
25759
-
25760
- export declare const WEBSERVER_ENDPOINTS: {
25761
- default: {
25762
- hello: string;
25763
- protected: string;
25764
- };
25765
- auth: {
25766
- verify: string;
25767
- sign: string;
25768
- login: string;
25769
- nonce: string;
25770
- refresh: string;
25771
- };
25772
- subaccount: {
25773
- list: (offset?: number, limit?: number) => string;
25774
- rewards: (subaccount: IAddress) => string;
25775
- tokens: (subaccount: IAddress) => string;
25776
- twap: {
25777
- create: (subaccount: IAddress) => string;
25778
- stop: (subaccount: IAddress, id: string) => string;
25779
- fills: (subaccount: IAddress, id: string) => string;
25780
- };
25781
- debank: (subaccount: IAddress) => string;
25782
- health_factor: (subaccount: IAddress) => string;
25783
- summary: (subaccount: IAddress) => string;
25784
- batch: (subaccount: IAddress) => string;
25785
- loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
25786
- cefi: (subaccount: IAddress) => string;
25787
- otc_positions: (subaccount: IAddress) => string;
25788
- loanByAddress: (loanAddress: string, chainId: number) => string;
25789
- _: (subaccount: IAddress) => string;
25790
- };
25791
- transactions: {
25792
- v2: (subaccount: string, startTime?: string, endTime?: string) => string;
25793
- };
25794
- otc: {
25795
- positions: string;
25796
- marginRequirements: (otcCounterpartyId?: string, payer?: string) => string;
25797
- };
25798
- curator: {
25799
- vaultSubaccounts: (vaultAddress: string) => string;
25800
- vaultWhitelist: (vaultAddress: string) => string;
25801
- };
25802
- timelockRequests: (vaultAddress: string, chainId: number, status?: string) => string;
25803
- users: {
25804
- get: string;
25805
- };
25806
- dashboard: {
25807
- loans: string;
25808
- };
25809
- risk: {
25810
- discountFactors: string;
25811
- collateralExcessOrDeficit: (subaccount: string, tokenAddress: string, tokenChain: number, targetHealthFactor?: number) => string;
25812
- collateralSimulation: string;
25813
- };
25814
- prices: (symbol: string) => string;
25815
- metrics: {
25816
- pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
25817
- vaultPerformanceFees: (params: {
25818
- vaultAddress: string;
25819
- annualizedFeesPct: number;
25820
- nativeDenominated: boolean;
25821
- calculationPeriod: string;
25822
- startDate?: string;
25823
- endDate?: string;
25824
- }) => string;
25825
- };
25826
- public: {
25827
- integrations: {
25828
- morpho: {
25829
- apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
25830
- };
25831
- };
25832
- tokenizedVault: {
25833
- loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
25834
- subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
25835
- list: string;
25836
- byVaultAddress: (vaultAddress: VaultAddress) => string;
25837
- historicalApy: (vaultAddress: IAddress) => string;
25838
- historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
25839
- annualizedApy: (vaultAddress: IAddress) => string;
25840
- summary: (vaultAddress: IAddress) => string;
25841
- withdrawals: (chain: string, vaultAddress: IAddress) => string;
25842
- debank: (vaultAddress: IAddress) => string;
25843
- userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
25844
- archivedVaults: string;
25845
- };
25846
- points: {
25847
- byUserAddress: (userAddress: IAddress) => string;
25848
- register: string;
25849
- leaderboard: string;
25850
- };
25851
- vaults: {
25852
- pendingRedemptions: (vaultAddress: IAddress) => string;
25853
- };
25854
- pnl: {
25855
- unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
25856
- unrealizedLatest: string;
25857
- };
25858
- revertReason: (txHash: string, chain: number) => string;
25859
- oracleClassification: (vaultAddress: string, chainId: number) => string;
25860
- };
25861
- upshift: {
25862
- vaults: {
25863
- metadata: string;
25864
- };
25865
- };
25866
- };
25867
-
25868
- export declare const WEBSERVER_URL: {
25869
- production: string;
25870
- staging: string;
25871
- development: string;
25872
- localhost: string;
25873
- qa: string;
25874
- public: string;
25875
- upshift: string;
25876
- };
25877
-
25878
- /**
25879
- * Withdrawal request with computed claimable date and current processing status.
25880
- * The unique identifier is (receiver, claimableDate).
25881
- *
25882
- * @interface WithdrawalRequestStatus
25883
- */
25884
- export declare interface WithdrawalRequestStatus {
25885
- /** Transaction hash of the withdrawal request */
25886
- transactionHash: string;
25887
- /** Block timestamp when the withdrawal was requested (seconds, UTC) */
25888
- requestTimestamp: number;
25889
- /** Shares amount being redeemed */
25890
- shares: bigint;
25891
- /** Receiver address for the withdrawal */
25892
- receiver: string;
25893
- /** Computed claimable date in UTC (year, month, day) */
25894
- claimableDate: {
25895
- year: number;
25896
- month: number;
25897
- day: number;
25898
- };
25899
- /** Epoch timestamp when this withdrawal becomes claimable */
25900
- claimableEpoch: number;
25901
- /** Current status of the withdrawal */
25902
- status: 'pending' | 'ready_to_claim' | 'processed';
25903
- /** Transaction hash of the processing transaction (if processed) */
25904
- processedTransactionHash?: string;
25905
- /** Assets received (if processed) */
25906
- assetsReceived?: bigint;
25907
- }
25908
-
25909
- /**
25910
- * Higher-order function to wrap SDK methods with performance tracking.
25911
- * Tracks method calls, timing, chain usage, and errors.
25912
- *
25913
- * @param methodName - Name of the method being wrapped
25914
- * @param method - The original async method
25915
- * @param getChainId - Function to get current chain ID
25916
- * @returns Wrapped method with tracking
25917
- */
25918
- export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
25919
-
25920
- /**
25921
- * Wrap async operations with exponential backoff retry logic.
25922
- * Retries on network errors with increasing delays between attempts.
25923
- * @param fn - Async function to execute with retry logic
25924
- * @param maxRetries - Maximum number of retry attempts
25925
- * @param baseDelay - Initial delay in milliseconds (doubles each retry)
25926
- * @param shouldRetry - Custom function to determine if error is retryable
25927
- * @returns Result of successful function execution
25928
- * @throws Last error if all retries exhausted
25929
- */
25930
- export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
25931
-
25932
- /**
25933
- * Higher-order function to wrap synchronous SDK methods with tracking.
25934
- * Uses breadcrumbs for tracking since spans require async context.
25935
- *
25936
- * @param methodName - Name of the method being wrapped
25937
- * @param method - The original sync method
25938
- * @param getChainId - Function to get current chain ID
25939
- * @returns Wrapped method with tracking
25940
- */
25941
- export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
25942
-
25943
- export declare const WRAPPER_ADAPTOR: {
25944
- 43114: IAddress;
25945
- 1: IAddress;
25946
- };
25947
-
25948
- export { }
25144
+ * Where `vaultDeposit` decides whether to use the SwapRouter from the
25145
+ * `VAULTS_USING_SWAP_ROUTER` allowlist, this function always routes through the
25146
+ * SwapRouter because the caller asked it to. Making the intent explicit is the
25147
+ * point: a native-deposit vault (e.g. a multi-asset Tokenized Vault V2 whose
25148
+ * non-reference assets are accepted directly) is never accidentally swapped —
25149
+ * the regression that implicit, allowlist-driven routing caused. Use
25150
+ * `vaultDeposit` for native / adapter deposits and this for SwapRouter deposits.
25151
+ *
25152
+ * The vault's reference asset and its decimals are read on-chain (never trusted
25153
+ * from the caller a wrong reference asset would mis-route the swap). The path
25154
+ * is then chosen from `depositAsset`:
25155
+ * - equals the reference asset → direct router deposit, no swap
25156
+ * ({@link depositViaSwapRouter});
25157
+ * - the zero address native-token deposit ({@link depositNativeViaSwapRouter}),
25158
+ * valid only when the reference asset is the chain's wrapped-native token;
25159
+ * - any other ERC-20 → a swap to the reference asset (Paraswap quote pinned to
25160
+ * the chain's whitelisted aggregator, fail-closed on router/selector drift)
25161
+ * bundled into {@link swapAndDeposit}.
25162
+ *
25163
+ * Side effects: reads tokenized-vault metadata, the vault's reference asset and
25164
+ * decimals, and (on the swap path) one Paraswap quote; sends one ERC-20
25165
+ * `approve` to the SwapRouter when allowance is short, then the deposit tx.
25166
+ *
25167
+ * @param signer - ethers `Signer` or `Wallet` that signs the approval + deposit.
25168
+ * @param options - {@link ISwapRouterDepositOptions}.
25169
+ * @returns The transaction hash of the router deposit call.
25170
+ * @throws {@link AugustValidationError} for an unsupported chain (no SwapRouter
25171
+ * deployment), an invalid vault or deposit-asset address, a missing or zero
25172
+ * amount, a native deposit into a non-wrapped-native vault, or drift between
25173
+ * the aggregator quote and the on-chain router whitelist.
25174
+ * @worstCaseRpcCalls 5 on the swap path — tokenized-vault metadata, reference
25175
+ * asset + decimals, deposit-token decimals, the quote, and the allowance read.
25176
+ * @example
25177
+ * ```ts
25178
+ * // USDT deposited into a USDC-reference vault → swapped to USDC en route.
25179
+ * const hash = await augustSdk.evm.swapRouterDeposit({
25180
+ * chainId: 1,
25181
+ * vault: '0xe9b725010a9e419412ed67d0fa5f3a5f40159d32',
25182
+ * depositAsset: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
25183
+ * amount: '100',
25184
+ * slippageBps: 50,
25185
+ * });
25186
+ * ```
25187
+ */
25188
+ export declare function swapRouterDeposit(signer: Signer | Wallet, options: ISwapRouterDepositOptions): Promise<string>;
25189
+
25190
+ /**
25191
+ * Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
25192
+ * the ERC-4626 (`deposit(uint256, address)`) and multi-asset
25193
+ * (`deposit(address, uint256, address)`) deposit interfaces.
25194
+ *
25195
+ * Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
25196
+ * constants exactly. Set by an admin per-vault via `enableVault` and looked
25197
+ * up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
25198
+ * this — the router resolves it internally.
25199
+ */
25200
+ export declare enum SwapRouterVaultType {
25201
+ ERC4626 = 1,
25202
+ TokenizedVaultV2 = 2
25203
+ }
25204
+
25205
+ /**
25206
+ * Table of Contents
25207
+ * - Formatters
25208
+ * - Datetime
25209
+ * - Arrays
25210
+ * - Caching
25211
+ */
25212
+ export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
25213
+
25214
+ /**
25215
+ * Formatters
25216
+ */
25217
+ export declare function toTitleCase(str: string, type?: 'camel'): string;
25218
+
25219
+ /**
25220
+ * Track API response times and status.
25221
+ *
25222
+ * @param endpoint - The API endpoint called
25223
+ * @param method - HTTP method used
25224
+ * @param startTime - Start timestamp from performance.now()
25225
+ * @param status - HTTP response status code (0 for network errors)
25226
+ * @param server - Server identifier (production, staging, etc.)
25227
+ */
25228
+ export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
25229
+
25230
+ /**
25231
+ * Track chain/network switches for usage distribution analysis.
25232
+ *
25233
+ * @param chainId - The chain ID being switched to
25234
+ */
25235
+ export declare function trackNetworkSwitch(chainId: number): void;
25236
+
25237
+ export declare function truncate(s: string, amount?: number): string;
25238
+
25239
+ /* Excluded from this release type: tryRecoverTxHash */
25240
+
25241
+ /**
25242
+ * Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
25243
+ * Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
25244
+ * checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
25245
+ * would throw). Add an address here to drop its `latest_reported_tvl` from
25246
+ * the headline number — e.g. closed pre-deposit vaults, test vaults, or
25247
+ * migrated v1 pools that are double-counted by a v2 successor.
25248
+ */
25249
+ export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
25250
+
25251
+ /**
25252
+ * Validity window for a submitted Soroban invocation (seconds).
25253
+ *
25254
+ * This becomes the transaction's `maxTime`. Validators reject a tx whose
25255
+ * `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
25256
+ * realistic sign-then-submit path: hardware wallets, careful manual review,
25257
+ * and institutional approval flows (e.g. Fordefi) that don't sign instantly.
25258
+ * 10 minutes comfortably covers those while staying well inside the Soroban
25259
+ * footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
25260
+ *
25261
+ * The window is anchored to the *network* clock (see `getNetworkCloseTime` in
25262
+ * soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
25263
+ * make the deadline expire early.
25264
+ */
25265
+ declare const TX_TIMEOUT_SECONDS = 600;
25266
+
25267
+ export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
25268
+ [Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
25269
+ } & {
25270
+ /**
25271
+ * Return the function for a given name. This is useful when a contract
25272
+ * method name conflicts with a JavaScript name such as ``prototype`` or
25273
+ * when using a Contract programatically.
25274
+ */
25275
+ getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
25276
+ /**
25277
+ * Return the event for a given name. This is useful when a contract
25278
+ * event name conflicts with a JavaScript name such as ``prototype`` or
25279
+ * when using a Contract programatically.
25280
+ */
25281
+ getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
25282
+ /**
25283
+ * All the Events available on this contract.
25284
+ */
25285
+ filters: {
25286
+ [EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
25287
+ };
25288
+ };
25289
+
25290
+ 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']>>>> {
25291
+ (...args: [...TEventArgs]): DeferredTopicFilter;
25292
+ /**
25293
+ * The name of the Contract event.
25294
+ */
25295
+ name: TEventName;
25296
+ /**
25297
+ * The fragment of the Contract event. This will throw on ambiguous
25298
+ * method names.
25299
+ */
25300
+ fragment: EventFragment;
25301
+ /**
25302
+ * Returns the fragment constrained by %%args%%. This can be used to
25303
+ * resolve ambiguous event names.
25304
+ */
25305
+ getFragment(...args: [...TEventArgs]): EventFragment;
25306
+ }
25307
+
25308
+ 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>> {
25309
+ (...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
25310
+ /**
25311
+ * The name of the Contract method.
25312
+ */
25313
+ name: TFunctionName;
25314
+ /**
25315
+ * The fragment of the Contract method. This will throw on ambiguous
25316
+ * method names.
25317
+ */
25318
+ fragment: TFragment;
25319
+ /**
25320
+ * Returns the fragment constrained by %%args%%. This can be used to
25321
+ * resolve ambiguous method names.
25322
+ */
25323
+ getFragment(...args: [...TInputArgs]): TFragment;
25324
+ /**
25325
+ * Returns a populated transaction that can be used to perform the
25326
+ * contract method with %%args%%.
25327
+ */
25328
+ populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
25329
+ /**
25330
+ * Call the contract method with %%args%% and return the value.
25331
+ *
25332
+ * If the return value is a single type, it will be dereferenced and
25333
+ * returned directly, otherwise the full Result will be returned.
25334
+ */
25335
+ staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
25336
+ /**
25337
+ * Send a transaction for the contract method with %%args%%.
25338
+ */
25339
+ send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
25340
+ /**
25341
+ * Estimate the gas to send the contract method with %%args%%.
25342
+ */
25343
+ estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
25344
+ /**
25345
+ * Call the contract method with %%args%% and return the Result
25346
+ * without any dereferencing.
25347
+ */
25348
+ staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
25349
+ }
25350
+
25351
+ 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;
25352
+
25353
+ export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
25354
+ name: TFunction['name'];
25355
+ type: TFunction['type'];
25356
+ inputs: TFunction['inputs'];
25357
+ outputs: TFunction['outputs'];
25358
+ stateMutability: TFunction['stateMutability'];
25359
+ };
25360
+
25361
+ export declare function unixToDate(epoch: number): Date;
25362
+
25363
+ /**
25364
+ * Update the current user identity in Sentry.
25365
+ * Called when wallet address changes.
25366
+ *
25367
+ * @param walletAddress - New wallet address (or undefined to clear)
25368
+ * @param environment - Current environment
25369
+ */
25370
+ export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
25371
+
25372
+ /* Excluded from this release type: validateAmountPrecision */
25373
+
25374
+ /**
25375
+ * Vault adapter configurations mapping vault addresses to their adapter settings
25376
+ */
25377
+ export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
25378
+
25379
+ 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}`>;
25380
+
25381
+ /**
25382
+ * Hardcoded subaccount addresses for specific vaults allocations
25383
+ */
25384
+ export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
25385
+ AgoraAUSD: {
25386
+ address: IAddress;
25387
+ subaccount: IAddress;
25388
+ useDebank: boolean;
25389
+ };
25390
+ earnAUSD: {
25391
+ address: IAddress;
25392
+ subaccount: IAddress;
25393
+ useDebank: boolean;
25394
+ };
25395
+ MonarqXRP: {
25396
+ address: IAddress;
25397
+ subaccount: IAddress;
25398
+ useDebank: boolean;
25399
+ };
25400
+ };
25401
+
25402
+ /**
25403
+ * The functions to call on the vault contract
25404
+ * @returns The functions to call
25405
+ */
25406
+ export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
25407
+
25408
+ export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
25409
+
25410
+ export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
25411
+
25412
+ export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
25413
+
25414
+ /**
25415
+ * Vault Symbols Mapping
25416
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
25417
+ */
25418
+ export declare const VAULT_SYMBOLS: Record<IAddress, string>;
25419
+
25420
+ /**
25421
+ * Vault Symbols Reverse Mapping
25422
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
25423
+ */
25424
+ export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
25425
+
25426
+ /**
25427
+ * Address type for vault contracts across all supported chains.
25428
+ * EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
25429
+ * and Stellar vaults use 56-character base32 addresses (G/C prefix).
25430
+ *
25431
+ * Use this instead of `IAddress` when the address may belong to any chain.
25432
+ */
25433
+ export declare type VaultAddress = string;
25434
+
25435
+ /**
25436
+ * allowance checks user's current allowance per pool
25437
+ * @param signer - signer / provider object
25438
+ * @param options - object including pool contract address, user wallet address
25439
+ * @returns normalized number object of the user's current allowance
25440
+ */
25441
+ export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
25442
+
25443
+ /**
25444
+ * Approve a vault (or the appropriate adapter wrapper) to spend a token
25445
+ * ahead of a separate deposit call. Spender routing mirrors
25446
+ * {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
25447
+ * vault). Returns `undefined` when the existing allowance already covers
25448
+ * `amount` **or** when the deposit asset is native.
25449
+ *
25450
+ * @returns Transaction hash when an approval was sent, `undefined` when
25451
+ * the existing allowance already covers `amount` or the deposit asset is
25452
+ * native (no ERC-20 allowance applies). Use {@link approve} for a
25453
+ * discriminated `ApproveResult` if you need to tell those two cases apart.
25454
+ * @throws AugustValidationError on invalid wallet/target/amount.
25455
+ *
25456
+ * @example
25457
+ * ```ts
25458
+ * const hash = await augustSdk.evm.vaultApprove({
25459
+ * target: '0x...', // vault contract address
25460
+ * wallet: walletAddress,
25461
+ * amount: '100', // 100 of the deposit token (UI units)
25462
+ * wait: true, // wait for the approval to confirm
25463
+ * });
25464
+ * if (hash) console.log('approve tx', hash);
25465
+ * // hash === undefined means the on-chain allowance already covers the
25466
+ * // amount, or the deposit asset is native (msg.value, no allowance).
25467
+ * ```
25468
+ */
25469
+ export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
25470
+
25471
+ /**
25472
+ * Deposit underlying token into the specified vault. Auto-routes to the
25473
+ * correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
25474
+ * Paraswap adapter, native-token wrapper, depositWithPermit) based on the
25475
+ * vault version and `depositAsset`.
25476
+ *
25477
+ * Amounts are encoded against the **deposit token's** decimals, not the
25478
+ * vault's share decimals. The SDK reads the appropriate decimals via the
25479
+ * vault metadata and the asset's ERC-20.
25480
+ *
25481
+ * Approval is handled automatically: if the existing allowance doesn't
25482
+ * cover `amount`, an `approve` is sent and **always waited for** (regardless
25483
+ * of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
25484
+ * of the approval on Monad-style RPCs.
25485
+ *
25486
+ * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
25487
+ * @param options Vault address, wallet, amount, optional `depositAsset` for
25488
+ * adapter routes, optional `wait` to wait for the deposit receipt.
25489
+ * @returns Deposit transaction hash.
25490
+ * @throws AugustValidationError on invalid wallet/target/amount or missing
25491
+ * adapter config when `depositAsset` differs from the vault underlying.
25492
+ * @throws AugustSDKError when the deposit submission or on-chain call fails.
25493
+ *
25494
+ * @example
25495
+ * ```ts
25496
+ * const hash = await augustSdk.evm.vaultDeposit({
25497
+ * target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
25498
+ * wallet: walletAddress,
25499
+ * amount: '100', // 100 USDC (UI units)
25500
+ * wait: true, // wait for the deposit receipt
25501
+ * });
25502
+ * ```
25503
+ *
25504
+ * @example Adapter deposit (different deposit asset than the vault's underlying)
25505
+ * ```ts
25506
+ * await augustSdk.evm.vaultDeposit({
25507
+ * target: vaultAddress,
25508
+ * wallet: walletAddress,
25509
+ * amount: '0.5',
25510
+ * depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
25511
+ * chainId: 1,
25512
+ * });
25513
+ * ```
25514
+ */
25515
+ export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
25516
+
25517
+ /**
25518
+ * Check if vault has adapter support
25519
+ */
25520
+ export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
25521
+
25522
+ /**
25523
+ * august_vault program IDL (Anchor).
25524
+ *
25525
+ * GENERATED — do not edit by hand. The versioned multi-vault interface the SDK
25526
+ * targets, generated from the devnet on-chain IDL of `C8B1…` — the only
25527
+ * deployment that publishes one matching this file. Refresh with
25528
+ * `anchor idl fetch C8B1… -u devnet`.
25529
+ *
25530
+ * At runtime the SDK targets the canonical `up12…` instead, whose own published
25531
+ * IDL is STALE (an Anchor IDL upload is not refreshed by a program upgrade), so
25532
+ * it can't be used as the generation source. The solana-idl-drift check (CI)
25533
+ * therefore validates `up12…` by pinning its deployed binary and by decoding
25534
+ * live VaultState accounts against this file — see
25535
+ * tests/vaults/solana-idl-drift.test.ts.
25536
+ *
25537
+ * `address` is a build stamp (the mainnet id), NOT network-aware. Never rely on
25538
+ * it: SolanaAdapter/getProgram resolve the real program id per network from
25539
+ * programIds, or from an explicit `programId` override.
25540
+ */
25541
+ declare const vaultIdl: {
25542
+ accounts: {
25543
+ discriminator: number[];
25544
+ name: string;
25545
+ }[];
25546
+ address: string;
25547
+ errors: {
25548
+ code: number;
25549
+ msg: string;
25550
+ name: string;
25551
+ }[];
25552
+ events: {
25553
+ discriminator: number[];
25554
+ name: string;
25555
+ }[];
25556
+ instructions: ({
25557
+ accounts: ({
25558
+ name: string;
25559
+ signer: boolean;
25560
+ writable: boolean;
25561
+ docs?: undefined;
25562
+ pda?: undefined;
25563
+ address?: undefined;
25564
+ } | {
25565
+ docs: string[];
25566
+ name: string;
25567
+ signer: boolean;
25568
+ writable: boolean;
25569
+ pda?: undefined;
25570
+ address?: undefined;
25571
+ } | {
25572
+ docs: string[];
25573
+ name: string;
25574
+ writable: boolean;
25575
+ signer?: undefined;
25576
+ pda?: undefined;
25577
+ address?: undefined;
25578
+ } | {
25579
+ docs: string[];
25580
+ name: string;
25581
+ signer?: undefined;
25582
+ writable?: undefined;
25583
+ pda?: undefined;
25584
+ address?: undefined;
25585
+ } | {
25586
+ name: string;
25587
+ pda: {
25588
+ program: {
25589
+ kind: string;
25590
+ value: number[];
25591
+ };
25592
+ seeds: ({
25593
+ kind: string;
25594
+ value: number[];
25595
+ path?: undefined;
25596
+ } | {
25597
+ kind: string;
25598
+ path: string;
25599
+ value?: undefined;
25600
+ })[];
25601
+ };
25602
+ writable: boolean;
25603
+ signer?: undefined;
25604
+ docs?: undefined;
25605
+ address?: undefined;
25606
+ } | {
25607
+ address: string;
25608
+ name: string;
25609
+ signer?: undefined;
25610
+ writable?: undefined;
25611
+ docs?: undefined;
25612
+ pda?: undefined;
25613
+ })[];
25614
+ args: {
25615
+ name: string;
25616
+ type: string;
25617
+ }[];
25618
+ discriminator: number[];
25619
+ docs: string[];
25620
+ name: string;
25621
+ } | {
25622
+ accounts: ({
25623
+ name: string;
25624
+ writable: boolean;
25625
+ signer?: undefined;
25626
+ address?: undefined;
25627
+ } | {
25628
+ name: string;
25629
+ writable?: undefined;
25630
+ signer?: undefined;
25631
+ address?: undefined;
25632
+ } | {
25633
+ name: string;
25634
+ signer: boolean;
25635
+ writable?: undefined;
25636
+ address?: undefined;
25637
+ } | {
25638
+ name: string;
25639
+ signer: boolean;
25640
+ writable: boolean;
25641
+ address?: undefined;
25642
+ } | {
25643
+ address: string;
25644
+ name: string;
25645
+ writable?: undefined;
25646
+ signer?: undefined;
25647
+ })[];
25648
+ args: {
25649
+ name: string;
25650
+ type: string;
25651
+ }[];
25652
+ discriminator: number[];
25653
+ docs: string[];
25654
+ name: string;
25655
+ } | {
25656
+ accounts: ({
25657
+ name: string;
25658
+ writable: boolean;
25659
+ pda?: undefined;
25660
+ signer?: undefined;
25661
+ } | {
25662
+ name: string;
25663
+ pda: {
25664
+ program: {
25665
+ kind: string;
25666
+ value: number[];
25667
+ };
25668
+ seeds: ({
25669
+ kind: string;
25670
+ path: string;
25671
+ value?: undefined;
25672
+ } | {
25673
+ kind: string;
25674
+ value: number[];
25675
+ path?: undefined;
25676
+ })[];
25677
+ };
25678
+ writable: boolean;
25679
+ signer?: undefined;
25680
+ } | {
25681
+ name: string;
25682
+ signer: boolean;
25683
+ writable?: undefined;
25684
+ pda?: undefined;
25685
+ } | {
25686
+ name: string;
25687
+ writable?: undefined;
25688
+ pda?: undefined;
25689
+ signer?: undefined;
25690
+ })[];
25691
+ args: {
25692
+ name: string;
25693
+ type: string;
25694
+ }[];
25695
+ discriminator: number[];
25696
+ docs: string[];
25697
+ name: string;
25698
+ } | {
25699
+ accounts: ({
25700
+ docs: string[];
25701
+ name: string;
25702
+ signer: boolean;
25703
+ writable?: undefined;
25704
+ pda?: undefined;
25705
+ address?: undefined;
25706
+ } | {
25707
+ docs: string[];
25708
+ name: string;
25709
+ writable: boolean;
25710
+ signer?: undefined;
25711
+ pda?: undefined;
25712
+ address?: undefined;
25713
+ } | {
25714
+ docs: string[];
25715
+ name: string;
25716
+ signer?: undefined;
25717
+ writable?: undefined;
25718
+ pda?: undefined;
25719
+ address?: undefined;
25720
+ } | {
25721
+ name: string;
25722
+ pda: {
25723
+ program: {
25724
+ kind: string;
25725
+ value: number[];
25726
+ };
25727
+ seeds: ({
25728
+ kind: string;
25729
+ value: number[];
25730
+ path?: undefined;
25731
+ } | {
25732
+ kind: string;
25733
+ path: string;
25734
+ value?: undefined;
25735
+ })[];
25736
+ };
25737
+ writable: boolean;
25738
+ docs?: undefined;
25739
+ signer?: undefined;
25740
+ address?: undefined;
25741
+ } | {
25742
+ address: string;
25743
+ name: string;
25744
+ docs?: undefined;
25745
+ signer?: undefined;
25746
+ writable?: undefined;
25747
+ pda?: undefined;
25748
+ })[];
25749
+ args: {
25750
+ name: string;
25751
+ type: string;
25752
+ }[];
25753
+ discriminator: number[];
25754
+ docs: string[];
25755
+ name: string;
25756
+ })[];
25757
+ metadata: {
25758
+ description: string;
25759
+ name: string;
25760
+ spec: string;
25761
+ version: string;
25762
+ };
25763
+ types: ({
25764
+ name: string;
25765
+ repr: {
25766
+ kind: string;
25767
+ };
25768
+ serialization: string;
25769
+ type: {
25770
+ fields: {
25771
+ name: string;
25772
+ type: string;
25773
+ }[];
25774
+ kind: string;
25775
+ };
25776
+ } | {
25777
+ name: string;
25778
+ type: {
25779
+ fields: ({
25780
+ name: string;
25781
+ type: string;
25782
+ } | {
25783
+ name: string;
25784
+ type: {
25785
+ array: (string | number)[];
25786
+ };
25787
+ })[];
25788
+ kind: string;
25789
+ };
25790
+ repr?: undefined;
25791
+ serialization?: undefined;
25792
+ })[];
25793
+ };
25794
+
25795
+ /**
25796
+ * @TODO
25797
+ * @description withdraw funds from the specified pool including accrued rewards
25798
+ * @param signer signer / wallet object
25799
+ * @param options object including pool contract address, user wallet address, and more
25800
+ * @returns claim tx hash
25801
+ */
25802
+ export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
25803
+ year: string;
25804
+ month: string;
25805
+ day: string;
25806
+ receiverIndex: string;
25807
+ }): Promise<string>;
25808
+
25809
+ export declare enum VaultRedemptionStatus {
25810
+ AWAITING_COOLDOWN = "awaiting_cooldown",
25811
+ READY_TO_CLAIM = "ready_to_claim"
25812
+ }
25813
+
25814
+ /**
25815
+ * Request to redeem vault shares. For EVM-1 vaults this queues a standard
25816
+ * redemption (claimable later via `vaultRedeem`); for EVM-2 vaults this
25817
+ * also handles the receipt-token allowance automatically. Pass
25818
+ * `isInstantRedeem: true` for vaults that support instant settlement.
25819
+ *
25820
+ * Approval of the receipt token (EVM-2) is always waited on before the
25821
+ * redeem call, regardless of the caller's `wait` flag.
25822
+ *
25823
+ * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
25824
+ * @param options Vault address, wallet, amount, optional `isInstantRedeem`,
25825
+ * optional `wait` to wait for the redeem receipt.
25826
+ * @returns Redeem transaction hash.
25827
+ * @throws AugustValidationError on invalid wallet/target/amount.
25828
+ * @throws AugustSDKError when the redeem submission or on-chain call fails.
25829
+ *
25830
+ * @example
25831
+ * ```ts
25832
+ * const hash = await augustSdk.evm.vaultRequestRedeem({
25833
+ * target: vaultAddress,
25834
+ * wallet: walletAddress,
25835
+ * amount: '10', // 10 shares (UI units)
25836
+ * wait: true,
25837
+ * });
25838
+ * ```
25839
+ *
25840
+ * @example Instant redemption
25841
+ * ```ts
25842
+ * await augustSdk.evm.vaultRequestRedeem({
25843
+ * target: vaultAddress,
25844
+ * wallet: walletAddress,
25845
+ * amount: '10',
25846
+ * isInstantRedeem: true,
25847
+ * });
25848
+ * ```
25849
+ */
25850
+ export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
25851
+
25852
+ /**
25853
+ * @deprecated Renamed to {@link SWAP_ROUTER_ELIGIBLE_VAULTS} (itself now
25854
+ * superseded by {@link getSwapRouterEligibleVaults}, the on-chain-derived
25855
+ * resolver), and the semantics changed: this set no longer drives
25856
+ * `vaultDeposit` auto-routing (that branch was removed) it only marks vaults
25857
+ * whose UI may offer the swap-router deposit surface. Kept as an alias for one
25858
+ * release; migrate to the async resolver.
25859
+ */
25860
+ export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
25861
+
25862
+ /**
25863
+ * Vault Receipt Symbol Mapping
25864
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
25865
+ */
25866
+ 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';
25867
+
25868
+ /**
25869
+ * @deprecated Renamed to {@link isSwapRouterEligible} (itself now superseded by
25870
+ * {@link getSwapRouterEligibleVaults}, the on-chain-derived resolver). The
25871
+ * meaning also changed: it no longer implies `vaultDeposit` routes the vault
25872
+ * through the SwapRouter (that behavior was removed) it only reports
25873
+ * swap-router *eligibility* for the opt-in deposit surface. Kept as an alias
25874
+ * for one release; migrate to the async resolver.
25875
+ */
25876
+ export declare const vaultUsesSwapRouter: typeof isSwapRouterEligible;
25877
+
25878
+ export declare function verifyAugustKey(key: string): Promise<boolean>;
25879
+
25880
+ export declare function verifyInfuraKey(key: string): Promise<boolean>;
25881
+
25882
+ /**
25883
+ * Convert a viem WalletClient to an ethers-compatible Signer
25884
+ * Uses the walletClient as a provider and wraps it for ethers compatibility
25885
+ * @param walletClient Viem WalletClient from wagmi or viem
25886
+ * @returns Ethers Signer that can be used with the SDK
25887
+ */
25888
+ export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
25889
+
25890
+ /**
25891
+ * @param walletClient a wagmi-derived client (from useWalletClient)
25892
+ * @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
25893
+ */
25894
+ export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
25895
+
25896
+ export declare const WEBSERVER_ENDPOINTS: {
25897
+ default: {
25898
+ hello: string;
25899
+ protected: string;
25900
+ };
25901
+ auth: {
25902
+ verify: string;
25903
+ sign: string;
25904
+ login: string;
25905
+ nonce: string;
25906
+ refresh: string;
25907
+ };
25908
+ subaccount: {
25909
+ list: (offset?: number, limit?: number) => string;
25910
+ rewards: (subaccount: IAddress) => string;
25911
+ tokens: (subaccount: IAddress) => string;
25912
+ twap: {
25913
+ create: (subaccount: IAddress) => string;
25914
+ stop: (subaccount: IAddress, id: string) => string;
25915
+ fills: (subaccount: IAddress, id: string) => string;
25916
+ };
25917
+ debank: (subaccount: IAddress) => string;
25918
+ health_factor: (subaccount: IAddress) => string;
25919
+ summary: (subaccount: IAddress) => string;
25920
+ batch: (subaccount: IAddress) => string;
25921
+ loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
25922
+ cefi: (subaccount: IAddress) => string;
25923
+ otc_positions: (subaccount: IAddress) => string;
25924
+ loanByAddress: (loanAddress: string, chainId: number) => string;
25925
+ _: (subaccount: IAddress) => string;
25926
+ };
25927
+ transactions: {
25928
+ v2: (subaccount: string, startTime?: string, endTime?: string) => string;
25929
+ };
25930
+ otc: {
25931
+ positions: string;
25932
+ marginRequirements: (otcCounterpartyId?: string, payer?: string) => string;
25933
+ };
25934
+ curator: {
25935
+ vaultSubaccounts: (vaultAddress: string) => string;
25936
+ vaultWhitelist: (vaultAddress: string) => string;
25937
+ };
25938
+ timelockRequests: (vaultAddress: string, chainId: number, status?: string) => string;
25939
+ users: {
25940
+ get: string;
25941
+ };
25942
+ dashboard: {
25943
+ loans: string;
25944
+ };
25945
+ risk: {
25946
+ discountFactors: string;
25947
+ collateralExcessOrDeficit: (subaccount: string, tokenAddress: string, tokenChain: number, targetHealthFactor?: number) => string;
25948
+ collateralSimulation: string;
25949
+ };
25950
+ prices: (symbol: string) => string;
25951
+ metrics: {
25952
+ pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
25953
+ vaultPerformanceFees: (params: {
25954
+ vaultAddress: string;
25955
+ annualizedFeesPct: number;
25956
+ nativeDenominated: boolean;
25957
+ calculationPeriod: string;
25958
+ startDate?: string;
25959
+ endDate?: string;
25960
+ }) => string;
25961
+ };
25962
+ public: {
25963
+ integrations: {
25964
+ morpho: {
25965
+ apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
25966
+ };
25967
+ };
25968
+ tokenizedVault: {
25969
+ loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
25970
+ subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
25971
+ list: string;
25972
+ byVaultAddress: (vaultAddress: VaultAddress) => string;
25973
+ historicalApy: (vaultAddress: IAddress) => string;
25974
+ historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
25975
+ annualizedApy: (vaultAddress: IAddress) => string;
25976
+ summary: (vaultAddress: IAddress) => string;
25977
+ withdrawals: (chain: string, vaultAddress: IAddress) => string;
25978
+ debank: (vaultAddress: IAddress) => string;
25979
+ userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
25980
+ archivedVaults: string;
25981
+ };
25982
+ points: {
25983
+ byUserAddress: (userAddress: IAddress) => string;
25984
+ register: string;
25985
+ leaderboard: string;
25986
+ };
25987
+ vaults: {
25988
+ pendingRedemptions: (vaultAddress: IAddress) => string;
25989
+ };
25990
+ pnl: {
25991
+ unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
25992
+ unrealizedLatest: string;
25993
+ };
25994
+ revertReason: (txHash: string, chain: number) => string;
25995
+ oracleClassification: (vaultAddress: string, chainId: number) => string;
25996
+ };
25997
+ upshift: {
25998
+ vaults: {
25999
+ metadata: string;
26000
+ };
26001
+ };
26002
+ };
26003
+
26004
+ export declare const WEBSERVER_URL: {
26005
+ production: string;
26006
+ staging: string;
26007
+ development: string;
26008
+ localhost: string;
26009
+ qa: string;
26010
+ public: string;
26011
+ upshift: string;
26012
+ };
26013
+
26014
+ /**
26015
+ * Withdrawal request with computed claimable date and current processing status.
26016
+ * The unique identifier is (receiver, claimableDate).
26017
+ *
26018
+ * @interface WithdrawalRequestStatus
26019
+ */
26020
+ export declare interface WithdrawalRequestStatus {
26021
+ /** Transaction hash of the withdrawal request */
26022
+ transactionHash: string;
26023
+ /** Block timestamp when the withdrawal was requested (seconds, UTC) */
26024
+ requestTimestamp: number;
26025
+ /** Shares amount being redeemed */
26026
+ shares: bigint;
26027
+ /** Receiver address for the withdrawal */
26028
+ receiver: string;
26029
+ /** Computed claimable date in UTC (year, month, day) */
26030
+ claimableDate: {
26031
+ year: number;
26032
+ month: number;
26033
+ day: number;
26034
+ };
26035
+ /** Epoch timestamp when this withdrawal becomes claimable */
26036
+ claimableEpoch: number;
26037
+ /** Current status of the withdrawal */
26038
+ status: 'pending' | 'ready_to_claim' | 'processed';
26039
+ /** Transaction hash of the processing transaction (if processed) */
26040
+ processedTransactionHash?: string;
26041
+ /** Assets received (if processed) */
26042
+ assetsReceived?: bigint;
26043
+ }
26044
+
26045
+ /**
26046
+ * Higher-order function to wrap SDK methods with performance tracking.
26047
+ * Tracks method calls, timing, chain usage, and errors.
26048
+ *
26049
+ * @param methodName - Name of the method being wrapped
26050
+ * @param method - The original async method
26051
+ * @param getChainId - Function to get current chain ID
26052
+ * @returns Wrapped method with tracking
26053
+ */
26054
+ export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
26055
+
26056
+ /**
26057
+ * Wrap async operations with exponential backoff retry logic.
26058
+ * Retries on network errors with increasing delays between attempts.
26059
+ * @param fn - Async function to execute with retry logic
26060
+ * @param maxRetries - Maximum number of retry attempts
26061
+ * @param baseDelay - Initial delay in milliseconds (doubles each retry)
26062
+ * @param shouldRetry - Custom function to determine if error is retryable
26063
+ * @returns Result of successful function execution
26064
+ * @throws Last error if all retries exhausted
26065
+ */
26066
+ export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
26067
+
26068
+ /**
26069
+ * Higher-order function to wrap synchronous SDK methods with tracking.
26070
+ * Uses breadcrumbs for tracking since spans require async context.
26071
+ *
26072
+ * @param methodName - Name of the method being wrapped
26073
+ * @param method - The original sync method
26074
+ * @param getChainId - Function to get current chain ID
26075
+ * @returns Wrapped method with tracking
26076
+ */
26077
+ export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
26078
+
26079
+ export declare const WRAPPER_ADAPTOR: {
26080
+ 43114: IAddress;
26081
+ 1: IAddress;
26082
+ };
26083
+
26084
+ export { }