@augustdigital/sdk 9.9.1 → 9.11.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.
@@ -515,6 +515,12 @@ async function resolveDepositRoute(signer, args) {
515
515
  if (!(await (0, core_1.readSwapRouterTokenWhitelisted)(signer, chainId, actualDepositAsset))) {
516
516
  return native('router-token-not-whitelisted');
517
517
  }
518
+ // After the cached registration gates, so only a deposit that would
519
+ // otherwise route pays the short-TTL read; before the origin check, so a
520
+ // paused router falls back to native instead of throwing under strictOrigin.
521
+ if (await (0, core_1.readSwapRouterPaused)(signer, chainId)) {
522
+ return native('router-paused');
523
+ }
518
524
  if (!(await (0, core_1.readOriginInfo)(chainId, originCode, () => signer)).registered) {
519
525
  if ((0, core_1.isStrictOrigin)()) {
520
526
  throw new core_1.AugustValidationError('INVALID_INPUT', `attribution.originCode is not registered on the SwapRouter for chain ${chainId} and attribution.strictOrigin is set. Register it with addOrigin, or unset strictOrigin to fall back to a native deposit.`, { context: { chainId, target } });
@@ -534,23 +540,25 @@ async function resolveDepositRoute(signer, args) {
534
540
  * Ethereum mainnet ({@link ORIGIN_ATTRIBUTION_CHAINS}) and has a SwapRouter,
535
541
  * the vault is registered on it, the vault accepts the asset directly (its
536
542
  * reference asset, or a Tokenized Vault V2 whitelisted asset — deposited
537
- * as-is, never swapped), the router whitelists the asset, the deposit is not a
538
- * permit, native-token or adapter deposit, and the code is registered.
539
- * Otherwise it is `native` with a `reason`.
543
+ * as-is, never swapped), the router whitelists the asset, the router is not
544
+ * paused, the deposit is not a permit, native-token or adapter deposit, and
545
+ * the code is registered. Otherwise it is `native` with a `reason`. A paused
546
+ * router gives `router-paused` even under `attribution.strictOrigin`.
540
547
  *
541
548
  * @param signer - ethers `Signer` / `Wallet` used for the reads.
542
549
  * @param options - {@link IGetDepositRouteOptions}; `depositAsset` defaults
543
550
  * to the vault's underlying.
544
551
  * @returns {@link IDepositRoute}.
545
552
  * @throws AugustValidationError on an invalid `target`, or an unregistered
546
- * code under `attribution.strictOrigin`.
553
+ * code under `attribution.strictOrigin` while the router is not paused.
547
554
  * @throws AugustSDKError when a backend, vault or router read fails.
548
- * @worstCaseRpcCalls 7 — the backend vault row, `asset()`, the router's
555
+ * @worstCaseRpcCalls 8 — the backend vault row, `asset()`, the router's
549
556
  * `vaultInfo`, the vault's `assetsWhitelistAddress()` and
550
557
  * `getWhitelistedAssets()` (Tokenized Vault V2 non-reference asset only),
551
- * the router's `whitelistedTokens(asset)`, and the router's `origins`. The
552
- * router reads and `getWhitelistedAssets()` are cached for 5 minutes. No
553
- * router read without a code or off Ethereum mainnet.
558
+ * the router's `whitelistedTokens(asset)`, `isPaused()` and `origins`. The
559
+ * router reads and `getWhitelistedAssets()` are cached for 5 minutes, except
560
+ * `isPaused()` (15 seconds). No router read without a code or off Ethereum
561
+ * mainnet.
554
562
  * @example
555
563
  * ```ts
556
564
  * const route = await augustSdk.evm.getDepositRoute({ target: vault, depositAsset: usdt });
@@ -1752,6 +1760,19 @@ async function resolveRouterOriginCode(signer, operation, chainId, vault, provid
1752
1760
  trackOriginAttribution({ via: 'native', spender: null, reason: 'origin-not-registered' }, { chainId, target: vault }, operation);
1753
1761
  return core_1.ORIGIN_CODES.default;
1754
1762
  }
1763
+ /**
1764
+ * Throw before any approval when the chain's SwapRouter is paused. Every
1765
+ * router entry point reverts with `ContractIsPaused` while it is paused, so an
1766
+ * approval sent first would only cost the user gas. Unlike `vaultDeposit`,
1767
+ * these methods have no native path to fall back to: the caller asked for the
1768
+ * router.
1769
+ * @internal
1770
+ */
1771
+ async function assertSwapRouterNotPaused(signer, operation, chainId, vault) {
1772
+ if (!(await (0, core_1.readSwapRouterPaused)(signer, chainId)))
1773
+ return;
1774
+ throw new core_1.AugustSDKError('UNKNOWN', `${operation}: the SwapRouter on chain ${chainId} is paused and rejects every deposit. Deposit into the vault directly with vaultDeposit, or retry once the router is unpaused.`, { context: { chainId, vault, reason: 'router-paused' } });
1775
+ }
1755
1776
  /** @internal */
1756
1777
  function resolveSwapRouterOrThrow(chainId) {
1757
1778
  const router = (0, core_1.getSwapRouterAddress)(chainId);
@@ -1848,7 +1869,8 @@ async function resolveSignerEOA(signer, callerContext) {
1848
1869
  * addresses, empty/oversized swap arrays, or an origin code not registered on
1849
1870
  * the router (a per-call code, or the instance code under
1850
1871
  * `attribution.strictOrigin`), before any approval.
1851
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
1872
+ * @throws {@link AugustSDKError} while the SwapRouter is paused (checked before
1873
+ * any approval), or on unrecoverable contract or RPC failure.
1852
1874
  *
1853
1875
  * @example
1854
1876
  * ```ts
@@ -1887,6 +1909,7 @@ async function swapAndDeposit(signer, options) {
1887
1909
  const routerAddress = resolveSwapRouterOrThrow(chainId);
1888
1910
  let tx;
1889
1911
  try {
1912
+ await assertSwapRouterNotPaused(signer, 'swapAndDeposit', chainId, vault);
1890
1913
  const origin = await resolveRouterOriginCode(signer, 'swapAndDeposit', chainId, vault, originCode);
1891
1914
  const eoa = await resolveSignerEOA(signer, 'swapAndDeposit');
1892
1915
  for (const [tokenIn, totalIn] of totalInputPerToken(swaps)) {
@@ -1923,7 +1946,8 @@ async function swapAndDeposit(signer, options) {
1923
1946
  * per-call code, or the instance code under `attribution.strictOrigin`),
1924
1947
  * before any approval; with code `ACCOUNT_NOT_FUNDED` when the account cannot
1925
1948
  * cover gas.
1926
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
1949
+ * @throws {@link AugustSDKError} while the SwapRouter is paused (checked before
1950
+ * any approval), or on unrecoverable contract or RPC failure.
1927
1951
  */
1928
1952
  async function depositViaSwapRouter(signer, options) {
1929
1953
  const { chainId, vault, receiver, asset, amount, originCode, wait } = options;
@@ -1939,6 +1963,7 @@ async function depositViaSwapRouter(signer, options) {
1939
1963
  const routerAddress = resolveSwapRouterOrThrow(chainId);
1940
1964
  let tx;
1941
1965
  try {
1966
+ await assertSwapRouterNotPaused(signer, 'depositViaSwapRouter', chainId, vault);
1942
1967
  const origin = await resolveRouterOriginCode(signer, 'depositViaSwapRouter', chainId, vault, originCode);
1943
1968
  const eoa = await resolveSignerEOA(signer, 'depositViaSwapRouter');
1944
1969
  await ensureAllowance(signer, asset, eoa, routerAddress, amount);
@@ -1984,7 +2009,8 @@ async function depositViaSwapRouter(signer, options) {
1984
2009
  * per-call code, or the instance code under `attribution.strictOrigin`),
1985
2010
  * before any approval; with code `ACCOUNT_NOT_FUNDED` when the account cannot
1986
2011
  * cover gas.
1987
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
2012
+ * @throws {@link AugustSDKError} while the SwapRouter is paused (checked before
2013
+ * any approval), or on unrecoverable contract or RPC failure.
1988
2014
  */
1989
2015
  async function depositNativeViaSwapRouter(signer, options) {
1990
2016
  const { chainId, vault, receiver, amount, originCode, wait } = options;
@@ -1999,6 +2025,7 @@ async function depositNativeViaSwapRouter(signer, options) {
1999
2025
  const routerAddress = resolveSwapRouterOrThrow(chainId);
2000
2026
  let tx;
2001
2027
  try {
2028
+ await assertSwapRouterNotPaused(signer, 'depositNativeViaSwapRouter', chainId, vault);
2002
2029
  const origin = await resolveRouterOriginCode(signer, 'depositNativeViaSwapRouter', chainId, vault, originCode);
2003
2030
  const routerContract = (0, core_1.createContract)({
2004
2031
  address: routerAddress,
@@ -2141,14 +2168,16 @@ async function isNativeSwapRouterDepositSupported(chainId, vault, options) {
2141
2168
  * not registered on the router (a per-call code, or the instance code under
2142
2169
  * `attribution.strictOrigin`), before any approval; with code
2143
2170
  * `ACCOUNT_NOT_FUNDED` when the account cannot cover gas.
2144
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
2145
- * @worstCaseRpcCalls 10 on the swap path into a Tokenized Vault V2 —
2171
+ * @throws {@link AugustSDKError} while the SwapRouter is paused (checked before
2172
+ * any approval), or on unrecoverable contract or RPC failure.
2173
+ * @worstCaseRpcCalls 11 on the swap path into a Tokenized Vault V2 —
2146
2174
  * tokenized-vault metadata, reference asset + decimals, deposit-token
2147
2175
  * decimals, the router's `vaultInfo` and `whitelistedTokens`, the vault's
2148
2176
  * `assetsWhitelistAddress()` and `getWhitelistedAssets()`, the quote, the
2149
- * origin code's `origins` (none for the zero sentinel), and the allowance
2150
- * read. The router reads and `getWhitelistedAssets()` are cached for 5
2151
- * minutes.
2177
+ * router's `isPaused()`, the origin code's `origins` (none for the zero
2178
+ * sentinel), and the allowance read. The router reads and
2179
+ * `getWhitelistedAssets()` are cached for 5 minutes, except `isPaused()`
2180
+ * (15 seconds).
2152
2181
  * @example
2153
2182
  * ```ts
2154
2183
  * // USDT deposited into a USDC-reference vault → swapped to USDC en route.
package/lib/sdk.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import type { Abi } from 'abitype';
2
2
  import type { AbiParametersToPrimitiveTypes } from 'abitype';
3
- import type { AnchorProvider } from '@coral-xyz/anchor';
3
+ import { AnchorProvider } from '@coral-xyz/anchor';
4
4
  import type { BaseContract } from 'ethers';
5
5
  import { Commitment } from '@solana/web3.js';
6
+ import { ConfirmOptions } from '@solana/web3.js';
6
7
  import { Connection } from '@solana/web3.js';
7
8
  import type { ContractTransaction } from 'ethers';
8
9
  import type { ContractTransactionResponse } from 'ethers';
@@ -28,9 +29,12 @@ import type { Result } from 'ethers';
28
29
  import type { SendTransactionOptions } from '@solana/wallet-adapter-base';
29
30
  import type * as Sentry from '@sentry/browser';
30
31
  import { Signer } from 'ethers';
32
+ import { Signer as Signer_2 } from '@solana/web3.js';
31
33
  import { Transaction } from '@solana/web3.js';
32
34
  import { TransactionReceipt } from 'ethers';
33
35
  import { TransactionResponse } from 'ethers';
36
+ import { TransactionSignature } from '@solana/web3.js';
37
+ import { VersionedTransaction } from '@solana/web3.js';
34
38
  import { Wallet } from 'ethers';
35
39
  import type { WalletClient } from 'viem';
36
40
  import { web3 } from '@coral-xyz/anchor';
@@ -15201,9 +15205,14 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
15201
15205
  * position as pure profit — a plausible-looking but wrong number.
15202
15206
  *
15203
15207
  * This guard rejects exactly that state: a non-zero position with no recorded
15204
- * deposits *and* no recorded withdrawals. Any of the following is treated as
15205
- * consistent and passes:
15208
+ * deposits, no shares received by transfer *and* no recorded withdrawals. It
15209
+ * also rejects a non-zero position with no recorded deposits when a share mint
15210
+ * to the wallet has no matching deposit (`mintsMatchHistory: false`): the mint
15211
+ * proves a deposit the history failed to return, so neither a peer transfer
15212
+ * nor a withdrawal makes the cost basis complete. Otherwise, any of the
15213
+ * following is treated as consistent and passes:
15206
15214
  * - deposits are present (the normal, computable case);
15215
+ * - shares were received by transfer and priced (see {@link transferCostBasis});
15207
15216
  * - withdrawals are present (a fully-exited-then-re-entered position is still
15208
15217
  * computable — the withdrawal records prove history loaded);
15209
15218
  * - the current position is zero (the wallet never interacted or fully exited,
@@ -15213,15 +15222,17 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
15213
15222
  * path with no added latency.
15214
15223
  *
15215
15224
  * Shares received by a direct token transfer (never deposited, never withdrew)
15216
- * reach this guard as deposits: {@link getVaultUserLifetimePnl} prices them
15217
- * with {@link transferCostBasis} first. The guard still throws for such a
15218
- * wallet when its transfers cannot be read or priced.
15225
+ * reach this guard as `receivedByTransferRaw`: {@link getVaultUserLifetimePnl}
15226
+ * prices them with {@link transferCostBasis} first. The guard still throws for
15227
+ * such a wallet when its transfers cannot be read or priced, or when a share
15228
+ * mint to it has no indexed deposit.
15219
15229
  *
15220
15230
  * @param params - See {@link PnlHistoryConsistencyParams}.
15221
15231
  * @returns `void` when the history is consistent.
15222
15232
  * @throws {@link AugustHistoryUnavailableError} with code `HISTORY_UNAVAILABLE`
15223
- * and `context: { vault, wallet }` when a non-zero position has neither
15224
- * deposits nor withdrawals recorded. The message carries the
15233
+ * and `context: { vault, wallet }` when a non-zero position has no deposits
15234
+ * recorded and either a share mint without a matching deposit or neither
15235
+ * received shares nor withdrawals. The message carries the
15225
15236
  * `#getVaultUserLifetimePnl::<vault>::<wallet>` prefix so it groups with the
15226
15237
  * other errors leaving the getter.
15227
15238
  * @example
@@ -15230,12 +15241,14 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
15230
15241
  * vault,
15231
15242
  * wallet,
15232
15243
  * hasDeposits: depositsByAsset.size > 0,
15244
+ * mintsMatchHistory,
15245
+ * receivedByTransferRaw: costBasis.receivedByTransferRaw,
15233
15246
  * totalWithdrawnRaw,
15234
15247
  * currentPositionRaw: currentPositionValue.raw,
15235
15248
  * });
15236
15249
  * ```
15237
15250
  */
15238
- export declare function assertPnlHistoryConsistent({ vault, wallet, hasDeposits, totalWithdrawnRaw, currentPositionRaw, }: PnlHistoryConsistencyParams): void;
15251
+ export declare function assertPnlHistoryConsistent({ vault, wallet, hasDeposits, mintsMatchHistory, receivedByTransferRaw, totalWithdrawnRaw, currentPositionRaw, }: PnlHistoryConsistencyParams): void;
15239
15252
 
15240
15253
  /**
15241
15254
  * Guard against converting lifetime PnL to USD with a fabricated price.
@@ -15922,7 +15935,7 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
15922
15935
  * ```
15923
15936
  */
15924
15937
  /** Stable error codes attached to SDK errors. */
15925
- export declare type AugustErrorCode = 'AUTH_MISSING_KEY' | 'AUTH_INVALID_KEY' | 'AUTH_FORBIDDEN' | 'AUTH_UNAUTHORIZED' | 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS' | 'ACCOUNT_NOT_FUNDED' | 'NETWORK_ERROR' | 'TIMEOUT' | 'RATE_LIMITED' | 'SERVER_ERROR' | 'HISTORY_UNAVAILABLE' | 'PRICE_UNAVAILABLE' | 'UNKNOWN';
15938
+ export declare type AugustErrorCode = 'AUTH_MISSING_KEY' | 'AUTH_INVALID_KEY' | 'AUTH_FORBIDDEN' | 'AUTH_UNAUTHORIZED' | 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS' | 'ACCOUNT_NOT_FUNDED' | 'NETWORK_ERROR' | 'TIMEOUT' | 'RATE_LIMITED' | 'SERVER_ERROR' | 'TRANSACTION_UNCONFIRMED' | 'HISTORY_UNAVAILABLE' | 'PRICE_UNAVAILABLE' | 'UNKNOWN';
15926
15939
 
15927
15940
  /** Options accepted by every SDK error constructor. */
15928
15941
  export declare interface AugustErrorOptions {
@@ -16863,6 +16876,35 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
16863
16876
  toJSON(): Record<string, unknown>;
16864
16877
  }
16865
16878
 
16879
+ /**
16880
+ * A transaction was sent but its outcome could not be established
16881
+ * (`TRANSACTION_UNCONFIRMED`). It may have landed: check {@link signature}
16882
+ * before resubmitting, or a deposit or redeem can execute twice.
16883
+ * `context.reason` says what was seen (e.g. `expired_not_found`: the blockhash
16884
+ * expired and no lookup found it, so it very likely never landed).
16885
+ *
16886
+ * @example
16887
+ * ```ts
16888
+ * try {
16889
+ * await sdk.solana.vaultDeposit(programId, idl, wallet, amount, undefined, vault);
16890
+ * } catch (err) {
16891
+ * if (err instanceof AugustTransactionError) showPending(err.signature);
16892
+ * else throw err;
16893
+ * }
16894
+ * ```
16895
+ */
16896
+ export declare class AugustTransactionError extends AugustSDKError {
16897
+ /** Signature of the transaction that was sent. */
16898
+ readonly signature: string;
16899
+ /**
16900
+ * @param message - Human-readable description, naming the signature.
16901
+ * @param signature - Signature of the transaction that was sent.
16902
+ * @param options - Standard SDK error options.
16903
+ */
16904
+ constructor(message: string, signature: string, options?: AugustErrorOptions);
16905
+ toJSON(): Record<string, unknown>;
16906
+ }
16907
+
16866
16908
  /** Caller-side input failed validation. */
16867
16909
  export declare class AugustValidationError extends AugustSDKError {
16868
16910
  constructor(code: Extract<AugustErrorCode, 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS' | 'ACCOUNT_NOT_FUNDED'>, message: string, options?: AugustErrorOptions);
@@ -17478,6 +17520,29 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
17478
17520
  */
17479
17521
  export declare function balanceOf(signer: IContractRunner, options: IBalanceOfOptions): Promise<bigint>;
17480
17522
 
17523
+ /**
17524
+ * `AnchorProvider` whose `sendAndConfirm` — what `program.methods…rpc()` calls —
17525
+ * confirms with {@link confirmByBlockhash} instead of Anchor's signature-only
17526
+ * WebSocket wait. Signing and Anchor's error translation are unchanged.
17527
+ */
17528
+ declare class BlockhashConfirmingProvider extends AnchorProvider {
17529
+ /**
17530
+ * Sign, send and confirm a transaction.
17531
+ *
17532
+ * @param tx - Transaction to send. Its blockhash (and fee payer, if unset)
17533
+ * are set here. A `VersionedTransaction` already carries a blockhash this
17534
+ * cannot learn the expiry of, so it takes Anchor's default path.
17535
+ * @param signers - Extra signers besides the wallet.
17536
+ * @param opts - Defaults to the provider's options.
17537
+ * @returns The transaction signature.
17538
+ * @throws See {@link confirmByBlockhash}; also whatever the wallet or
17539
+ * `sendRawTransaction` throws (user rejection, preflight failure).
17540
+ * @remarks **RPC cost.** `getLatestBlockhash` + `sendRawTransaction`, then
17541
+ * the confirmation polls described on {@link confirmByBlockhash}.
17542
+ */
17543
+ sendAndConfirm(tx: Transaction | VersionedTransaction, signers?: Signer_2[], opts?: ConfirmOptions): Promise<TransactionSignature>;
17544
+ }
17545
+
17481
17546
  /**
17482
17547
  * Build an ERC-8021 schema-0 attribution suffix from builder codes.
17483
17548
  *
@@ -17997,15 +18062,19 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
17997
18062
  * per-call code, or the instance code under `attribution.strictOrigin`),
17998
18063
  * before any approval; with code `ACCOUNT_NOT_FUNDED` when the account cannot
17999
18064
  * cover gas.
18000
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
18065
+ * @throws {@link AugustSDKError} while the SwapRouter is paused (checked before
18066
+ * any approval), or on unrecoverable contract or RPC failure.
18001
18067
  */
18002
18068
  export declare function depositNativeViaSwapRouter(signer: Signer | Wallet, options: ISwapRouterNativeDepositOptions): Promise<string>;
18003
18069
 
18004
18070
  /**
18005
18071
  * Why {@link getDepositRoute} kept a deposit on the vault's native path.
18006
18072
  * `no-origin-code` is what every SDK without `attribution.originCode` gets.
18073
+ * `router-paused` means the SwapRouter's owner paused it: the deposit goes
18074
+ * straight to the vault, even under `attribution.strictOrigin`, until the
18075
+ * router is unpaused.
18007
18076
  */
18008
- export declare type DepositRouteReason = 'no-origin-code' | 'no-router' | 'chain-not-supported' | 'permit' | 'native-token' | 'adapter' | 'vault-not-registered' | 'asset-not-accepted' | 'router-token-not-whitelisted' | 'origin-not-registered';
18077
+ export declare type DepositRouteReason = 'no-origin-code' | 'no-router' | 'chain-not-supported' | 'permit' | 'native-token' | 'adapter' | 'vault-not-registered' | 'asset-not-accepted' | 'router-token-not-whitelisted' | 'router-paused' | 'origin-not-registered';
18009
18078
 
18010
18079
  /**
18011
18080
  * Deposit a vault's reference asset directly through the SwapRouter — no
@@ -18021,7 +18090,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
18021
18090
  * per-call code, or the instance code under `attribution.strictOrigin`),
18022
18091
  * before any approval; with code `ACCOUNT_NOT_FUNDED` when the account cannot
18023
18092
  * cover gas.
18024
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
18093
+ * @throws {@link AugustSDKError} while the SwapRouter is paused (checked before
18094
+ * any approval), or on unrecoverable contract or RPC failure.
18025
18095
  */
18026
18096
  export declare function depositViaSwapRouter(signer: Signer | Wallet, options: ISwapRouterDirectDepositOptions): Promise<string>;
18027
18097
 
@@ -18227,9 +18297,10 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
18227
18297
  * (`route.spender`, not necessarily the vault). See {@link getDepositRoute}.
18228
18298
  *
18229
18299
  * @param options - {@link IGetDepositRouteOptions}.
18230
- * @returns `{ via, spender, reason? }` — `reason` explains a native route.
18300
+ * @returns `{ via, spender, reason? }` — `reason` explains a native route
18301
+ * (`router-paused` while the SwapRouter is paused).
18231
18302
  * @throws AugustValidationError on an invalid target, or an unregistered
18232
- * code under `attribution.strictOrigin`.
18303
+ * code under `attribution.strictOrigin` while the router is not paused.
18233
18304
  * @throws AugustSDKError when a backend, vault or router read fails.
18234
18305
  * @example
18235
18306
  * ```ts
@@ -18295,7 +18366,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
18295
18366
  * @param options - {@link ISwapAndDepositOptions}.
18296
18367
  * @returns The transaction hash of the `swapAndDeposit` call.
18297
18368
  * @throws AugustValidationError on invalid inputs (bad chain, empty swaps).
18298
- * @throws AugustSDKError on RPC / contract revert.
18369
+ * @throws AugustSDKError while the SwapRouter is paused (checked before any
18370
+ * approval), or on RPC / contract revert.
18299
18371
  *
18300
18372
  * @example
18301
18373
  * ```ts
@@ -18319,6 +18391,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
18319
18391
  *
18320
18392
  * @param options - {@link ISwapRouterDirectDepositOptions}.
18321
18393
  * @returns The transaction hash of the `deposit` call.
18394
+ * @throws AugustSDKError while the SwapRouter is paused (checked before any
18395
+ * approval), or on RPC / contract revert.
18322
18396
  */
18323
18397
  depositViaSwapRouter(options: ISwapRouterDirectDepositOptions): Promise<string>;
18324
18398
  /**
@@ -18328,6 +18402,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
18328
18402
  *
18329
18403
  * @param options - {@link ISwapRouterNativeDepositOptions}.
18330
18404
  * @returns The transaction hash of the `depositNativeToken` call.
18405
+ * @throws AugustSDKError while the SwapRouter is paused (checked before any
18406
+ * approval), or on RPC / contract revert.
18331
18407
  */
18332
18408
  depositNativeViaSwapRouter(options: ISwapRouterNativeDepositOptions): Promise<string>;
18333
18409
  /**
@@ -18345,6 +18421,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
18345
18421
  * @returns The transaction hash of the router deposit call.
18346
18422
  * @throws AugustValidationError on unsupported chain, invalid address, zero
18347
18423
  * amount, a native deposit into a non-wrapped-native vault, or quote drift.
18424
+ * @throws AugustSDKError while the SwapRouter is paused (checked before any
18425
+ * approval), or on RPC / contract revert.
18348
18426
  * @example
18349
18427
  * ```ts
18350
18428
  * const hash = await augustSdk.evm.swapRouterDeposit({
@@ -19161,23 +19239,25 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
19161
19239
  * Ethereum mainnet ({@link ORIGIN_ATTRIBUTION_CHAINS}) and has a SwapRouter,
19162
19240
  * the vault is registered on it, the vault accepts the asset directly (its
19163
19241
  * reference asset, or a Tokenized Vault V2 whitelisted asset — deposited
19164
- * as-is, never swapped), the router whitelists the asset, the deposit is not a
19165
- * permit, native-token or adapter deposit, and the code is registered.
19166
- * Otherwise it is `native` with a `reason`.
19242
+ * as-is, never swapped), the router whitelists the asset, the router is not
19243
+ * paused, the deposit is not a permit, native-token or adapter deposit, and
19244
+ * the code is registered. Otherwise it is `native` with a `reason`. A paused
19245
+ * router gives `router-paused` even under `attribution.strictOrigin`.
19167
19246
  *
19168
19247
  * @param signer - ethers `Signer` / `Wallet` used for the reads.
19169
19248
  * @param options - {@link IGetDepositRouteOptions}; `depositAsset` defaults
19170
19249
  * to the vault's underlying.
19171
19250
  * @returns {@link IDepositRoute}.
19172
19251
  * @throws AugustValidationError on an invalid `target`, or an unregistered
19173
- * code under `attribution.strictOrigin`.
19252
+ * code under `attribution.strictOrigin` while the router is not paused.
19174
19253
  * @throws AugustSDKError when a backend, vault or router read fails.
19175
- * @worstCaseRpcCalls 7 — the backend vault row, `asset()`, the router's
19254
+ * @worstCaseRpcCalls 8 — the backend vault row, `asset()`, the router's
19176
19255
  * `vaultInfo`, the vault's `assetsWhitelistAddress()` and
19177
19256
  * `getWhitelistedAssets()` (Tokenized Vault V2 non-reference asset only),
19178
- * the router's `whitelistedTokens(asset)`, and the router's `origins`. The
19179
- * router reads and `getWhitelistedAssets()` are cached for 5 minutes. No
19180
- * router read without a code or off Ethereum mainnet.
19257
+ * the router's `whitelistedTokens(asset)`, `isPaused()` and `origins`. The
19258
+ * router reads and `getWhitelistedAssets()` are cached for 5 minutes, except
19259
+ * `isPaused()` (15 seconds). No router read without a code or off Ethereum
19260
+ * mainnet.
19181
19261
  * @example
19182
19262
  * ```ts
19183
19263
  * const route = await augustSdk.evm.getDepositRoute({ target: vault, depositAsset: usdt });
@@ -20179,16 +20259,18 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20179
20259
  * shares add to `totalDeposited` (and are reported again as
20180
20260
  * `receivedByTransfer`), sent shares add to `totalWithdrawn`. This holds
20181
20261
  * alongside indexed deposits, so a wallet that received shares and also
20182
- * deposited is not credited with the received shares as profit. LayerZero
20183
- * OVaults count transfers only when history holds no deposit, because their
20184
- * composer delivers cross-chain deposits by transfer.
20262
+ * deposited is not credited with the received shares as profit. On LayerZero
20263
+ * OVaults, transfers from or to the hub composer and share OFT do not count,
20264
+ * because the composer delivers cross-chain deposits by transfer and those
20265
+ * are already counted as LayerZero deposits.
20185
20266
  *
20186
20267
  * Gaps in the indexed history: a share mint with no `Deposit` event counts as
20187
20268
  * a deposit of the assets in its `ReserveDeposit` event
20188
20269
  * ({@link selectReserveDeposits}; High Growth ETH emits it for Kelp gain-adapter
20189
20270
  * deposits), and a withdrawal request the vault logged twice counts once
20190
20271
  * ({@link countWithdrawalRequestsOnce}). Transfers fold in for a depositor only
20191
- * once every mint is explained.
20272
+ * once every mint is explained. A wallet with no indexed deposit and a mint
20273
+ * that no deposit explains throws `HISTORY_UNAVAILABLE`.
20192
20274
  *
20193
20275
  * Tokenized Vault V2 redemptions carry only shares, so a settled one counts at
20194
20276
  * the assets the vault paid, or at the share ratio on its claim date when the
@@ -20203,9 +20285,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20203
20285
  * for a Tokenized Vault V2 wallet with redemption requests, a `lagDuration()`
20204
20286
  * read plus one backend timeseries request. A timeseries window with no usable
20205
20287
  * ratio (a closed vault whose history stopped earlier) is read again in full,
20206
- * so the latest earlier day still prices it. For
20207
- * non-LayerZero vaults the transfer query runs in parallel with the history
20208
- * read; for LayerZero vaults it runs only when history holds no deposit.
20288
+ * so the latest earlier day still prices it. The transfer query runs for
20289
+ * every vault, in parallel with the history read.
20209
20290
  *
20210
20291
  * @param vault - Vault contract address
20211
20292
  * @param wallet - User wallet address
@@ -20213,7 +20294,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20213
20294
  * @returns Lifetime PnL data in both native token and USD
20214
20295
  * @throws {@link AugustHistoryUnavailableError} (`HISTORY_UNAVAILABLE`) when a
20215
20296
  * live position has no indexed deposits, withdrawals or priceable share
20216
- * transfers.
20297
+ * transfers, or has no indexed deposit while a share mint to the wallet has
20298
+ * no matching deposit.
20217
20299
  * @throws {@link AugustPriceUnavailableError} (`PRICE_UNAVAILABLE`) when the
20218
20300
  * underlying asset has no USD price, or `asset()` cannot be read.
20219
20301
  */
@@ -20389,6 +20471,9 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20389
20471
  * or when the wallet's deposit-mint balance is below `depositAmount`.
20390
20472
  * @throws AugustSDKError when a candidate token account's balance cannot be
20391
20473
  * read, or wrapping any downstream failure (`cause` preserved).
20474
+ * @throws AugustTransactionError (`TRANSACTION_UNCONFIRMED`) when the
20475
+ * transaction was sent but its outcome could not be established; check
20476
+ * `signature` before resubmitting.
20392
20477
  * @remarks **Side effects.** Submits exactly one transaction, signed by the
20393
20478
  * provider's wallet. When the wallet has no share account, that transaction
20394
20479
  * also creates one, and `publicKey` pays its rent — roughly 0.00204 SOL,
@@ -20437,6 +20522,9 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20437
20522
  * or when the wallet holds fewer shares than `redeemShares`.
20438
20523
  * @throws AugustSDKError when a candidate token account's balance cannot be
20439
20524
  * read, or wrapping any downstream failure (`cause` preserved).
20525
+ * @throws AugustTransactionError (`TRANSACTION_UNCONFIRMED`) when the
20526
+ * transaction was sent but its outcome could not be established; check
20527
+ * `signature` before resubmitting.
20440
20528
  * @remarks **Side effects.** Submits exactly one transaction, signed by the
20441
20529
  * provider's wallet. That transaction also creates the payout account when
20442
20530
  * the wallet has none, and the vault's fee-recipient account when *it* has
@@ -24884,9 +24972,10 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
24884
24972
  }
24885
24973
 
24886
24974
  /**
24887
- * One subaccount record from the admin-only `GET /subaccount` directory
24888
- * endpoint (backend `ISubaccountRead` schema). Nullable fields are optional
24889
- * metadata the operations team may not have filled in.
24975
+ * One subaccount record (backend `ISubaccountRead` schema), as returned by the
24976
+ * admin-only `GET /subaccount` directory, `GET /users/{address}/subaccounts`
24977
+ * and `GET /org/subaccounts`. Nullable fields are optional metadata the
24978
+ * operations team may not have filled in.
24890
24979
  */
24891
24980
  export declare interface IWSSubaccountListItem {
24892
24981
  id: string;
@@ -24908,6 +24997,15 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
24908
24997
  variant: string | null;
24909
24998
  default_fee_rate_in_bips: number | null;
24910
24999
  wallet_role: string | null;
25000
+ /**
25001
+ * Cached USD account value, refreshed out of band by an hourly backend job.
25002
+ * A sort key and placeholder, not an authoritative NAV — read the live value
25003
+ * from the subaccount summary. `null` before the job's first run; absent on
25004
+ * backends that predate the field.
25005
+ */
25006
+ latest_account_value?: number | null;
25007
+ /** Naive-UTC ISO timestamp of `latest_account_value`. */
25008
+ account_value_updated_at?: string | null;
24911
25009
  chains: IWSSubaccountListChain[];
24912
25010
  }
24913
25011
 
@@ -25524,7 +25622,9 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
25524
25622
  *
25525
25623
  * A depositor whose history misses a mint ({@link historyCoversMints}) is the
25526
25624
  * exception: its transfers do not count, so the result matches what the getter
25527
- * returned before transfers counted for depositors. On a LayerZero OVault the
25625
+ * returned before transfers counted for depositors. A wallet with no deposit
25626
+ * still gets a basis here when its history misses a mint, but
25627
+ * {@link assertPnlHistoryConsistent} rejects it. On a LayerZero OVault the
25528
25628
  * caller leaves the hub composer and share OFT out of the transfers (see
25529
25629
  * {@link selectPeerTransfers}): the composer's deliveries are already counted
25530
25630
  * as LayerZero deposits, and shares bridged to a spoke chain still count in the
@@ -25587,6 +25687,16 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
25587
25687
  * (subgraph deposits or LayerZero cross-chain deposits).
25588
25688
  */
25589
25689
  hasDeposits: boolean;
25690
+ /**
25691
+ * Whether the indexed deposits explain every share mint to the wallet (see
25692
+ * {@link historyCoversMints}). Defaults to `true`.
25693
+ */
25694
+ mintsMatchHistory?: boolean;
25695
+ /**
25696
+ * Shares received by peer transfer, priced in raw base units (asset
25697
+ * decimals) by {@link transferCostBasis}. Defaults to zero.
25698
+ */
25699
+ receivedByTransferRaw?: bigint;
25590
25700
  /** Total withdrawn, in raw base units (asset decimals). */
25591
25701
  totalWithdrawnRaw: bigint;
25592
25702
  /** Current on-chain position value, in raw base units (asset decimals). */
@@ -25737,6 +25847,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
25737
25847
 
25738
25848
  /* Excluded from this release type: readOriginInfo */
25739
25849
 
25850
+ /* Excluded from this release type: readSwapRouterPaused */
25851
+
25740
25852
  /* Excluded from this release type: readSwapRouterTokenWhitelisted */
25741
25853
 
25742
25854
  /* Excluded from this release type: readSwapRouterVaultInfo */
@@ -27174,7 +27286,7 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
27174
27286
  getProvider: ({ connection, publicKey, signTransaction, }: {
27175
27287
  publicKey: PublicKey;
27176
27288
  signTransaction: (<T extends Transaction | web3.VersionedTransaction>(transaction: T) => Promise<T>) | undefined;
27177
- } & ISolanaConnectionOptions) => AnchorProvider;
27289
+ } & ISolanaConnectionOptions) => BlockhashConfirmingProvider;
27178
27290
  getReadOnlyProvider: ({ connection }: ISolanaConnectionOptions) => AnchorProvider;
27179
27291
  deriveShareMintPda: (vaultProgramId: PublicKey | string) => web3.PublicKey;
27180
27292
  deriveVaultStatePda: (vaultProgramId: PublicKey | string) => web3.PublicKey;
@@ -27911,7 +28023,8 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
27911
28023
  * addresses, empty/oversized swap arrays, or an origin code not registered on
27912
28024
  * the router (a per-call code, or the instance code under
27913
28025
  * `attribution.strictOrigin`), before any approval.
27914
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
28026
+ * @throws {@link AugustSDKError} while the SwapRouter is paused (checked before
28027
+ * any approval), or on unrecoverable contract or RPC failure.
27915
28028
  *
27916
28029
  * @example
27917
28030
  * ```ts
@@ -27991,14 +28104,16 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
27991
28104
  * not registered on the router (a per-call code, or the instance code under
27992
28105
  * `attribution.strictOrigin`), before any approval; with code
27993
28106
  * `ACCOUNT_NOT_FUNDED` when the account cannot cover gas.
27994
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
27995
- * @worstCaseRpcCalls 10 on the swap path into a Tokenized Vault V2 —
28107
+ * @throws {@link AugustSDKError} while the SwapRouter is paused (checked before
28108
+ * any approval), or on unrecoverable contract or RPC failure.
28109
+ * @worstCaseRpcCalls 11 on the swap path into a Tokenized Vault V2 —
27996
28110
  * tokenized-vault metadata, reference asset + decimals, deposit-token
27997
28111
  * decimals, the router's `vaultInfo` and `whitelistedTokens`, the vault's
27998
28112
  * `assetsWhitelistAddress()` and `getWhitelistedAssets()`, the quote, the
27999
- * origin code's `origins` (none for the zero sentinel), and the allowance
28000
- * read. The router reads and `getWhitelistedAssets()` are cached for 5
28001
- * minutes.
28113
+ * router's `isPaused()`, the origin code's `origins` (none for the zero
28114
+ * sentinel), and the allowance read. The router reads and
28115
+ * `getWhitelistedAssets()` are cached for 5 minutes, except `isPaused()`
28116
+ * (15 seconds).
28002
28117
  * @example
28003
28118
  * ```ts
28004
28119
  * // USDT deposited into a USDC-reference vault → swapped to USDC en route.