@augustdigital/sdk 8.8.0 → 8.10.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
@@ -15111,8 +15111,268 @@ declare function assertNotStellar(address: string, operation: string): void;
15111
15111
  *
15112
15112
  * Accessible as `apiModule` on the SDK instance; the same methods are also
15113
15113
  * exposed directly on the SDK class.
15114
+ *
15115
+ * A subset of methods (loan book, risk) hit authenticated admin-only backend
15116
+ * endpoints and require an admin-scoped August API key on the SDK
15117
+ * constructor; each such method documents the requirement.
15114
15118
  */
15115
- export declare class AugustApi {
15119
+ export declare class AugustApi extends AugustBase {
15120
+ private headers;
15121
+ constructor(baseConfig: IAugustBase);
15122
+ /**
15123
+ * Retrieve the global loan-book aggregate across every active client
15124
+ * subaccount — one {@link ILoanBookInfo} entry per loan, with principal /
15125
+ * interest amounts, APRs, state, and the next upcoming payment.
15126
+ *
15127
+ * Backed by the admin-only `GET /dashboard/loans` backend endpoint (60-second
15128
+ * server-side cache), so the August API key configured on the SDK must
15129
+ * belong to an admin user. Makes exactly one HTTP request and no RPC calls.
15130
+ *
15131
+ * @returns Array of loan-book entries; empty when there are no active loans.
15132
+ * @throws AugustAuthError When the API key is missing or not admin-scoped.
15133
+ * @throws AugustServerError When the API responds with a non-2xx status.
15134
+ * @example
15135
+ * const loans = await sdk.apiModule.getDashboardLoans();
15136
+ * const active = loans.filter((l) => l.state === 'ACTIVE');
15137
+ */
15138
+ getDashboardLoans(): Promise<ILoanBookInfo[]>;
15139
+ /**
15140
+ * Retrieve every token discount-factor ladder the risk engine applies when
15141
+ * valuing collateral.
15142
+ *
15143
+ * Backed by `GET /risk/discount_factors` (60-second server-side cache),
15144
+ * which requires an authenticated August user; an admin-scoped API key
15145
+ * works. Makes exactly one HTTP request and no RPC calls.
15146
+ *
15147
+ * @returns Array of {@link IDiscountFactorLadder}, one per whitelisted token that has a configured ladder.
15148
+ * @throws AugustAuthError When the API key is missing or not authorized.
15149
+ * @throws AugustServerError When the API responds with a non-2xx status.
15150
+ * @example
15151
+ * const ladders = await sdk.apiModule.getDiscountFactors();
15152
+ * console.log(ladders.map((d) => `${d.address}@${d.chain}`));
15153
+ */
15154
+ getDiscountFactors(): Promise<IDiscountFactorLadder[]>;
15155
+ /**
15156
+ * Compute how much collateral a subaccount has in excess of — or is short
15157
+ * of — what it needs to hold a target health factor, for one collateral
15158
+ * token.
15159
+ *
15160
+ * Backed by `GET /risk/collateral_excess_or_deficit` (60-second server-side
15161
+ * cache), which resolves the subaccount and reads its current health factor,
15162
+ * so an authenticated (admin-scoped) August API key is required. Makes
15163
+ * exactly one HTTP request and no RPC calls.
15164
+ *
15165
+ * @param params.subaccount Subaccount (smart-contract wallet) address.
15166
+ * @param params.tokenAddress Collateral token address to evaluate.
15167
+ * @param params.tokenChain Numeric August chain id of the token (e.g. `1` for Ethereum mainnet).
15168
+ * @param params.targetHealthFactor Health factor to solve for. Defaults server-side to the minimum healthy factor (1.2); when supplied must be a finite number greater than 0.
15169
+ * @returns The signed excess (positive) or deficit (negative) in USD and token units. Zeroes when the subaccount has no debt.
15170
+ * @throws AugustValidationError When an address is invalid, `tokenChain` is not an integer, or `targetHealthFactor` is out of range.
15171
+ * @throws AugustServerError When the token has no discount factor (backend 404) or the API otherwise responds non-2xx.
15172
+ * @example
15173
+ * const r = await sdk.apiModule.getCollateralExcessOrDeficit({
15174
+ * subaccount: '0xabc…',
15175
+ * tokenAddress: '0xdef…',
15176
+ * tokenChain: 1,
15177
+ * });
15178
+ * console.log(r.amount_usd > 0 ? 'excess' : 'deficit');
15179
+ */
15180
+ getCollateralExcessOrDeficit(params: {
15181
+ subaccount: string;
15182
+ tokenAddress: string;
15183
+ tokenChain: number;
15184
+ targetHealthFactor?: number;
15185
+ }): Promise<ICollateralExcessOrDeficit>;
15186
+ /**
15187
+ * Simulate the collateral required to open a hypothetical loan against a
15188
+ * chosen basket of collateral tokens.
15189
+ *
15190
+ * This is a pure, read-only simulation: the backend `POST
15191
+ * /risk/collateral_simulation` endpoint (60-second server-side cache)
15192
+ * computes required collateral and effective discount factors and changes
15193
+ * no state. It runs against the authenticated backend, so an
15194
+ * (admin-scoped) August API key is required. Makes exactly one HTTP request
15195
+ * and no RPC calls.
15196
+ *
15197
+ * @param input Simulation parameters — see {@link ICollateralSimulationInput}. `collateral_tokens` and `collateral_token_allocation` must be non-empty and equal length; when `on_platform` is `true`, both `loan_redeployed_token_*` fields are required.
15198
+ * @returns The simulated {@link ICollateralSimulationResults}: total debt, required collateral, resulting health factor, and a per-token breakdown.
15199
+ * @throws AugustValidationError When addresses are invalid, `loan_amount` is not a finite non-negative number, the collateral arrays are empty / mismatched, or `on_platform` is set without redeployed-token details.
15200
+ * @throws AugustServerError When the API responds with a non-2xx status (e.g. a token missing a discount factor).
15201
+ * @example
15202
+ * const sim = await sdk.apiModule.simulateCollateral({
15203
+ * loan_token_chain: 1,
15204
+ * loan_token_address: '0xloan…',
15205
+ * loan_amount: 1_000_000,
15206
+ * collateral_tokens: [[1, '0xcol…']],
15207
+ * collateral_token_allocation: [1],
15208
+ * });
15209
+ * console.log(sim.total_required_collateral_usd);
15210
+ */
15211
+ simulateCollateral(input: ICollateralSimulationInput): Promise<ICollateralSimulationResults>;
15212
+ /**
15213
+ * Fetch the decoded revert reason(s) for a transaction — error messages,
15214
+ * revert strings, and recognized universal-subaccount errors extracted from
15215
+ * a `debug_traceTransaction` call tree.
15216
+ *
15217
+ * Backed by the public (unauthenticated) `GET /revert_reason` endpoint; no
15218
+ * API key required. The backend relies on the target chain's RPC supporting
15219
+ * `debug_trace*`; on chains/RPCs without it the backend returns a 5xx whose
15220
+ * detail explains why, surfaced here as an {@link AugustServerError}. Makes
15221
+ * exactly one HTTP request and no RPC calls from the SDK itself.
15222
+ *
15223
+ * @param txHash Transaction hash to trace.
15224
+ * @param chain Numeric August chain id the transaction is on (e.g. `1` for Ethereum mainnet).
15225
+ * @returns The decoded {@link IRevertReason}; all arrays empty when the trace yielded no matching signal.
15226
+ * @throws AugustValidationError When `txHash` is empty or `chain` is not an integer.
15227
+ * @throws AugustServerError When the chain/RPC does not support tracing, or the API otherwise responds non-2xx.
15228
+ * @example
15229
+ * const r = await sdk.apiModule.getRevertReason('0xabc…', 1);
15230
+ * console.log(r.revert_reasons);
15231
+ */
15232
+ getRevertReason(txHash: string, chain: number): Promise<IRevertReason>;
15233
+ /**
15234
+ * Retrieve every tracked OTC position.
15235
+ *
15236
+ * Backed by the admin-only `GET /otc/position` backend endpoint, so the
15237
+ * configured August API key must belong to an admin user. Makes exactly one
15238
+ * HTTP request and no RPC calls.
15239
+ *
15240
+ * @returns Array of {@link IOtcPositionRead}; empty when there are no OTC positions.
15241
+ * @throws AugustAuthError When the API key is missing or not admin-scoped.
15242
+ * @throws AugustServerError When the API responds with a non-2xx status.
15243
+ * @example
15244
+ * const positions = await sdk.apiModule.getOtcPositions();
15245
+ */
15246
+ getOtcPositions(): Promise<IOtcPositionRead[]>;
15247
+ /**
15248
+ * Retrieve OTC margin requirements, optionally filtered by counterparty
15249
+ * and/or payer.
15250
+ *
15251
+ * Backed by the admin-only `GET /otc/margin_requirement` backend endpoint,
15252
+ * so the configured August API key must belong to an admin user. Makes
15253
+ * exactly one HTTP request and no RPC calls.
15254
+ *
15255
+ * @param options - Optional filters
15256
+ * @param options.otcCounterpartyId - Restrict to a single counterparty (UUID)
15257
+ * @param options.payer - Restrict to a single payer address
15258
+ * @returns Array of {@link IOtcMarginRequirement} matching the filters (all when none given).
15259
+ * @throws AugustAuthError When the API key is missing or not admin-scoped.
15260
+ * @throws AugustServerError When the API responds with a non-2xx status.
15261
+ * @example
15262
+ * const reqs = await sdk.apiModule.getOtcMarginRequirements({ payer: '0xabc…' });
15263
+ */
15264
+ getOtcMarginRequirements(options?: {
15265
+ otcCounterpartyId?: string;
15266
+ payer?: string;
15267
+ }): Promise<IOtcMarginRequirement[]>;
15268
+ /**
15269
+ * List the subaccounts linked to a vault (curator surface).
15270
+ *
15271
+ * Backed by the curator-or-admin `GET
15272
+ * /curator/vaults/{vault_address}/subaccounts` backend endpoint, so the
15273
+ * configured August API key must belong to the vault's curator or an admin.
15274
+ * Makes exactly one HTTP request and no RPC calls.
15275
+ *
15276
+ * @param vaultAddress - The vault address (EVM `0x…`, Solana, or Stellar)
15277
+ * @returns Array of subaccount records linked to the vault (same shape as the subaccount directory); empty when none are linked.
15278
+ * @throws AugustValidationError When `vaultAddress` is not a valid address.
15279
+ * @throws AugustAuthError When the API key is missing or not curator/admin for the vault.
15280
+ * @throws AugustServerError When the API responds with a non-2xx status.
15281
+ * @example
15282
+ * const subs = await sdk.apiModule.getCuratorVaultSubaccounts('0xvault…');
15283
+ */
15284
+ getCuratorVaultSubaccounts(vaultAddress: string): Promise<IWSSubaccountListItem[]>;
15285
+ /**
15286
+ * Get on-chain whitelist status for every subaccount linked to a vault
15287
+ * (curator surface).
15288
+ *
15289
+ * Backed by the curator-or-admin `GET
15290
+ * /curator/vaults/{vault_address}/whitelist` backend endpoint. EVM vaults
15291
+ * only — non-EVM vaults manage access internally and the backend returns a
15292
+ * 400 (surfaced as {@link AugustServerError}). Makes exactly one HTTP
15293
+ * request and no RPC calls from the SDK.
15294
+ *
15295
+ * @param vaultAddress - The EVM vault address (`0x…`)
15296
+ * @returns Array of {@link ICuratorWhitelistStatus}, one per linked subaccount; empty when the vault has no subaccounts.
15297
+ * @throws AugustValidationError When `vaultAddress` is not a valid address.
15298
+ * @throws AugustAuthError When the API key is missing or not curator/admin for the vault.
15299
+ * @throws AugustServerError When the vault is non-EVM (backend 400) or the API otherwise responds non-2xx.
15300
+ * @example
15301
+ * const status = await sdk.apiModule.getCuratorVaultWhitelist('0xvault…');
15302
+ * console.log(status.filter((s) => !s.is_whitelisted));
15303
+ */
15304
+ getCuratorVaultWhitelist(vaultAddress: string): Promise<ICuratorWhitelistStatus[]>;
15305
+ /**
15306
+ * List timelock (governance) requests for a vault on a chain, optionally
15307
+ * filtered by status.
15308
+ *
15309
+ * Backed by the `GET /timelock-requests` backend endpoint. Makes exactly one
15310
+ * HTTP request and no RPC calls.
15311
+ *
15312
+ * @param params.vaultAddress The vault address the requests target.
15313
+ * @param params.chainId Numeric August chain id (must be a positive integer).
15314
+ * @param params.status Status filter: `"scheduled"` (backend default), `"executed"`, `"cancelled"`, or `"all"`. Omit to use the backend default.
15315
+ * @returns Array of {@link ITimelockRequest}; empty when the vault has no matching requests.
15316
+ * @throws AugustValidationError When `vaultAddress` is invalid or `chainId` is not a positive integer.
15317
+ * @throws AugustServerError When the API responds with a non-2xx status (e.g. an invalid status filter).
15318
+ * @example
15319
+ * const reqs = await sdk.apiModule.getTimelockRequests({ vaultAddress: '0xvault…', chainId: 1 });
15320
+ */
15321
+ getTimelockRequests(params: {
15322
+ vaultAddress: string;
15323
+ chainId: number;
15324
+ status?: string;
15325
+ }): Promise<ITimelockRequest[]>;
15326
+ /**
15327
+ * Compute a vault's performance fees over a period (backend-computed from
15328
+ * its snapshot history).
15329
+ *
15330
+ * Backed by `GET /metrics/vault_performance_fees`. The backend runs pandas
15331
+ * over the vault's full snapshot history, so the first call is slow; results
15332
+ * are cached server-side for 20 minutes. Makes exactly one HTTP request and
15333
+ * no RPC calls.
15334
+ *
15335
+ * @param params.vault The vault address (EVM `0x…`, Solana, or Stellar).
15336
+ * @param params.annualizedFeesPct Annualized performance-fee percentage. Defaults to 20.
15337
+ * @param params.nativeDenominated Whether to denominate in the vault's native token. Defaults to `true`.
15338
+ * @param params.calculationPeriod Period preset — `"YearToDate"` (default) or `"MonthToDate"`. Ignored by the backend when a custom `startDate`/`endDate` range is supplied.
15339
+ * @param params.startDate ISO-8601 datetime range start. Must be supplied together with `endDate`.
15340
+ * @param params.endDate ISO-8601 datetime range end. Must be supplied together with `startDate`.
15341
+ * @returns The vault's {@link IVaultPerformanceFees} computation.
15342
+ * @throws AugustValidationError When `vault` is invalid, or exactly one of `startDate`/`endDate` is supplied.
15343
+ * @throws AugustServerError When there is insufficient snapshot data for the period, or the API otherwise responds non-2xx.
15344
+ * @example
15345
+ * const fees = await sdk.apiModule.getVaultPerformanceFees({ vault: '0xvault…' });
15346
+ * console.log(fees.total_perf_fees_asset);
15347
+ */
15348
+ getVaultPerformanceFees(params: {
15349
+ vault: string;
15350
+ annualizedFeesPct?: number;
15351
+ nativeDenominated?: boolean;
15352
+ calculationPeriod?: string;
15353
+ startDate?: string;
15354
+ endDate?: string;
15355
+ }): Promise<IVaultPerformanceFees>;
15356
+ /**
15357
+ * Fetch a vault's NAV-oracle classification table — how each position/token
15358
+ * is priced (Primary / Secondary Market / CeFi) and its USD value, plus
15359
+ * warnings for tokens that could not be resolved.
15360
+ *
15361
+ * Backed by the public (unauthenticated) `GET
15362
+ * /upshift/oracle_classification/{vault_address}` endpoint; no API key
15363
+ * required. Reads the newest daily snapshot. Makes exactly one HTTP request
15364
+ * and no RPC calls from the SDK.
15365
+ *
15366
+ * @param vault The vault address (EVM `0x…`, Solana, or Stellar).
15367
+ * @param chainId Numeric August chain id the vault lives on.
15368
+ * @returns The vault's {@link IOracleClassification}.
15369
+ * @throws AugustValidationError When `vault` is invalid or `chainId` is not an integer.
15370
+ * @throws AugustServerError When the vault or its snapshot is not found, or the API otherwise responds non-2xx.
15371
+ * @example
15372
+ * const cls = await sdk.apiModule.getVaultOracleClassification('0xvault…', 1);
15373
+ * console.log(cls.warnings);
15374
+ */
15375
+ getVaultOracleClassification(vault: string, chainId: number): Promise<IOracleClassification>;
15116
15376
  /**
15117
15377
  * Fetch the historical unrealized-PnL series for a vault, newest first,
15118
15378
  * as computed by the August backend from periodic vault snapshots.
@@ -15743,6 +16003,31 @@ export declare class AugustServerError extends AugustSDKError {
15743
16003
  export declare class AugustSubAccounts extends AugustBase {
15744
16004
  private headers;
15745
16005
  constructor(baseConfig: IAugustBase);
16006
+ /**
16007
+ * Retrieves one page of the directory of all August subaccounts.
16008
+ *
16009
+ * Backed by the admin-only `GET /subaccount` backend endpoint, so the
16010
+ * August API key configured on the SDK must belong to an admin user —
16011
+ * non-admin keys are rejected with an auth error by the backend. Makes
16012
+ * exactly one HTTP request and no RPC calls.
16013
+ *
16014
+ * @param options - Pagination window over the subaccount directory
16015
+ * @param options.offset - Number of records to skip. Defaults to 0; must be a non-negative integer.
16016
+ * @param options.limit - Page size. Defaults to 100; must be an integer between 1 and 1000 (backend maximum).
16017
+ * @returns The page of subaccount records (address, internal/friendly names, status, type, linked chains, risk metadata). An empty array means the offset is past the end of the directory.
16018
+ * @throws AugustValidationError when `offset` or `limit` is out of range
16019
+ * @throws AugustAuthError when the API key is missing or not admin-scoped
16020
+ * @example
16021
+ * const page = await augustSdk.subAccountsModule.getAllSubaccounts({
16022
+ * offset: 0,
16023
+ * limit: 200,
16024
+ * });
16025
+ * console.log(page.map((s) => `${s.internal_name}: ${s.address}`));
16026
+ */
16027
+ getAllSubaccounts(options?: {
16028
+ offset?: number;
16029
+ limit?: number;
16030
+ }): Promise<IWSSubaccountListItem[]>;
15746
16031
  /**
15747
16032
  * Retrieves the health factor for a subaccount.
15748
16033
  * @param subaccountAddress - The address of the subaccount to query
@@ -15882,6 +16167,73 @@ export declare class AugustSubAccounts extends AugustBase {
15882
16167
  netAccountValue: number;
15883
16168
  totalEquityValue: number;
15884
16169
  }>;
16170
+ /**
16171
+ * Retrieves a subaccount's on-chain transaction history, newest first,
16172
+ * optionally windowed by a time range.
16173
+ *
16174
+ * Backed by the authenticated `GET /transactions/v2` backend endpoint,
16175
+ * which resolves and authorizes the subaccount, so the configured August
16176
+ * API key must be authorized for it (an admin-scoped key always is). Makes
16177
+ * exactly one HTTP request and no RPC calls.
16178
+ *
16179
+ * @param subaccountAddress - The address of the subaccount to query
16180
+ * @param options - Optional time window
16181
+ * @param options.startTime - ISO-8601 datetime lower bound (inclusive); omit for no lower bound
16182
+ * @param options.endTime - ISO-8601 datetime upper bound (inclusive); omit for no upper bound
16183
+ * @returns The subaccount's transactions with decoded logs, transfers, and function names
16184
+ * @throws AugustValidationError When `subaccountAddress` is not a valid EVM address
16185
+ * @throws AugustAuthError When the API key is missing or not authorized for the subaccount
16186
+ * @throws AugustServerError When the API responds with a non-2xx status
16187
+ * @example
16188
+ * const txs = await augustSdk.subAccountsModule.getSubaccountTransactions(
16189
+ * '0xabc…',
16190
+ * { startTime: '2026-01-01T00:00:00Z' },
16191
+ * );
16192
+ */
16193
+ getSubaccountTransactions(subaccountAddress: IAddress, options?: {
16194
+ startTime?: string;
16195
+ endTime?: string;
16196
+ }): Promise<ISubaccountTransaction[]>;
16197
+ /**
16198
+ * Retrieves the full loan-book detail for a single loan by its address and
16199
+ * chain.
16200
+ *
16201
+ * Backed by the admin-only `GET /subaccount/loans/{loan_address}` backend
16202
+ * endpoint (60-second server-side cache), so the configured August API key
16203
+ * must belong to an admin user. Makes exactly one HTTP request and no RPC
16204
+ * calls.
16205
+ *
16206
+ * @param loanAddress - The loan contract address
16207
+ * @param chainId - Numeric August chain id the loan lives on (e.g. `1` for Ethereum mainnet)
16208
+ * @returns The loan's {@link ILoanBookInfo} detail
16209
+ * @throws AugustValidationError When `chainId` is not an integer
16210
+ * @throws AugustAuthError When the API key is missing or not admin-scoped
16211
+ * @throws AugustServerError When the loan or chain is not found, or the API otherwise responds non-2xx
16212
+ * @example
16213
+ * const loan = await augustSdk.subAccountsModule.getSubaccountLoanByAddress(
16214
+ * '0xloan…',
16215
+ * 1,
16216
+ * );
16217
+ */
16218
+ getSubaccountLoanByAddress(loanAddress: string, chainId: number): Promise<ILoanBookInfo>;
16219
+ /**
16220
+ * Retrieves cross-chain DeBank protocol positions and token balances for a
16221
+ * subaccount and its associated strategies.
16222
+ *
16223
+ * Backed by `GET /subaccount/{subaccount_address}/debank` (300-second
16224
+ * server-side cache). This is a slow endpoint — it fans out to DeBank
16225
+ * across every supported chain — so expect higher latency than other
16226
+ * subaccount reads. Makes exactly one HTTP request and no RPC calls.
16227
+ *
16228
+ * @param subaccountAddress - The address of the subaccount to query
16229
+ * @returns The subaccount's DeBank positions/tokens plus per-strategy breakdowns
16230
+ * @throws AugustValidationError When `subaccountAddress` is not a valid EVM address
16231
+ * @throws AugustServerError When the API responds with a non-2xx status
16232
+ * @example
16233
+ * const debank = await augustSdk.subAccountsModule.getSubaccountDebank('0xabc…');
16234
+ * console.log(debank.subaccount.positions.length);
16235
+ */
16236
+ getSubaccountDebank(subaccountAddress: IAddress): Promise<ISubaccountDebank>;
15885
16237
  }
15886
16238
 
15887
16239
  /** Request exceeded its deadline. */
@@ -17203,6 +17555,14 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17203
17555
  readonly localnet: "http://127.0.0.1:8899";
17204
17556
  };
17205
17557
 
17558
+ /**
17559
+ * Fetch one page of the subaccount directory (admin-only backend endpoint)
17560
+ */
17561
+ export declare const fetchAllSubaccounts: (pagination: {
17562
+ offset?: number;
17563
+ limit?: number;
17564
+ }, augustKey: string, headers?: IFetchAugustOptions["headers"]) => Promise<IWSSubaccountListItem[]>;
17565
+
17206
17566
  /**
17207
17567
  * Make unauthenticated requests to August public API endpoints.
17208
17568
  * Used for fetching vault metadata and public market data.
@@ -17269,11 +17629,24 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17269
17629
  */
17270
17630
  export declare const fetchSubaccountCefiPositions: (address: IAddress, augustKey: string, headers?: IFetchAugustOptions["headers"]) => Promise<IWSSubaccountCefi[]>;
17271
17631
 
17632
+ /**
17633
+ * Fetch cross-chain DeBank positions for a subaccount (`GET
17634
+ * /subaccount/{subaccount_address}/debank`). Slow endpoint (300-second
17635
+ * server-side cache) — it fans out across every supported chain.
17636
+ */
17637
+ export declare const fetchSubaccountDebank: (address: IAddress, augustKey: string, headers?: IFetchAugustOptions["headers"]) => Promise<ISubaccountDebank>;
17638
+
17272
17639
  /**
17273
17640
  * Fetch subaccount health factor for a given subaccount address
17274
17641
  */
17275
17642
  export declare const fetchSubaccountHeathFactor: (address: IAddress, augustKey: string, headers?: IFetchAugustOptions["headers"]) => Promise<IWSSubAccountHealthFactor>;
17276
17643
 
17644
+ /**
17645
+ * Fetch a single loan's loan-book detail by loan address + chain
17646
+ * (admin-only `GET /subaccount/loans/{loan_address}`).
17647
+ */
17648
+ export declare const fetchSubaccountLoanByAddress: (loanAddress: string, chainId: number, augustKey: string, headers?: IFetchAugustOptions["headers"]) => Promise<ILoanBookInfo>;
17649
+
17277
17650
  /**
17278
17651
  * Fetch subaccount loans details
17279
17652
  */
@@ -17293,6 +17666,16 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17293
17666
  */
17294
17667
  export declare const fetchSubaccountSummary: (address: IAddress, augustKey: string, headers?: IFetchAugustOptions["headers"]) => Promise<IWSSubaccountSummary>;
17295
17668
 
17669
+ /**
17670
+ * Fetch a subaccount's transaction history (authenticated `GET
17671
+ * /transactions/v2`), optionally windowed by ISO-8601 start/end datetimes.
17672
+ */
17673
+ export declare const fetchSubaccountTransactions: (payload: {
17674
+ address: IAddress;
17675
+ startTime?: string;
17676
+ endTime?: string;
17677
+ }, augustKey: string, headers?: IFetchAugustOptions["headers"]) => Promise<ISubaccountTransaction[]>;
17678
+
17296
17679
  /**
17297
17680
  * Fetch a swap quote and the calldata required for the on-chain SwapRouter
17298
17681
  * to execute it.
@@ -18479,6 +18862,68 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
18479
18862
  explorer: string;
18480
18863
  };
18481
18864
 
18865
+ /**
18866
+ * Per-collateral-token breakdown within a collateral simulation (backend
18867
+ * `CollateralDetailsResult` schema). `chain` is the numeric August chain id.
18868
+ */
18869
+ export declare interface ICollateralDetailsResult {
18870
+ chain: number;
18871
+ token_address: IAddress;
18872
+ price: number;
18873
+ allocation: number;
18874
+ collateral_value_from_redeployed_loan_usd: number;
18875
+ collateral_value_usd: number;
18876
+ amount_usd: number;
18877
+ amount_token: number;
18878
+ effective_discount_factor: number;
18879
+ is_top_up: boolean;
18880
+ }
18881
+
18882
+ /**
18883
+ * Result of `GET /risk/collateral_excess_or_deficit` (backend
18884
+ * `CollateralExcessOrDeficit` schema). A positive value is excess collateral
18885
+ * that could be withdrawn; a negative value is the shortfall that must be
18886
+ * deposited to reach the target health factor.
18887
+ */
18888
+ export declare interface ICollateralExcessOrDeficit {
18889
+ amount_usd: number;
18890
+ amount_token: number;
18891
+ }
18892
+
18893
+ /**
18894
+ * Request body for `POST /risk/collateral_simulation` (backend
18895
+ * `CollateralSimulation` schema). Chain fields are numeric August chain ids.
18896
+ * `collateral_tokens` is a list of `[chain, address]` pairs and
18897
+ * `collateral_token_allocation` the matching per-token weights (normalized
18898
+ * server-side, so relative magnitudes are what matter). When `on_platform`
18899
+ * is `true`, both `loan_redeployed_token_*` fields are required by the
18900
+ * backend.
18901
+ */
18902
+ export declare interface ICollateralSimulationInput {
18903
+ loan_token_chain: number;
18904
+ loan_token_address: IAddress;
18905
+ loan_amount: number;
18906
+ on_platform?: boolean;
18907
+ loan_redeployed_token_chain?: number | null;
18908
+ loan_redeployed_token_address?: IAddress | null;
18909
+ collateral_tokens: [number, IAddress][];
18910
+ collateral_token_allocation: number[];
18911
+ target_health_factor?: number;
18912
+ }
18913
+
18914
+ /**
18915
+ * Result of `POST /risk/collateral_simulation` (backend
18916
+ * `CollateralSimulationResults` schema). `collateral_details` is keyed by
18917
+ * `"<symbol>_<chainName>"`.
18918
+ */
18919
+ export declare interface ICollateralSimulationResults {
18920
+ total_debt_usd: number;
18921
+ total_required_collateral_usd: number;
18922
+ total_collateral_value_from_redeployed_loan_usd: number;
18923
+ health_factor: number;
18924
+ collateral_details: Record<string, ICollateralDetailsResult>;
18925
+ }
18926
+
18482
18927
  export declare interface IComposabilityIntegration {
18483
18928
  name: string;
18484
18929
  description: string;
@@ -18773,6 +19218,16 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
18773
19218
  hubOnlyReceipt?: boolean;
18774
19219
  }
18775
19220
 
19221
+ /**
19222
+ * On-chain whitelist status of one subaccount linked to a vault, from
19223
+ * `GET /curator/vaults/{vault_address}/whitelist` (backend
19224
+ * `WhitelistStatusResponse` schema). EVM vaults only.
19225
+ */
19226
+ export declare interface ICuratorWhitelistStatus {
19227
+ address: IAddress;
19228
+ is_whitelisted: boolean;
19229
+ }
19230
+
18776
19231
  export declare interface IDebankAccountData {
18777
19232
  positions: IDebankUserProtocol[];
18778
19233
  app_positions: IDebankAppProtocol[];
@@ -18926,6 +19381,20 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
18926
19381
  portfolio_item_list: IDebankPortfolioItemObject[];
18927
19382
  }
18928
19383
 
19384
+ /**
19385
+ * A token's discount-factor ladder from `GET /risk/discount_factors`
19386
+ * (backend `DiscountFactorRead` schema). `steps` are ascending notional
19387
+ * thresholds (in the token's smallest unit) and `factors` the corresponding
19388
+ * ascending haircut multipliers in `[0, 1]`; the two arrays are equal length.
19389
+ * `chain` is the numeric August chain id.
19390
+ */
19391
+ export declare interface IDiscountFactorLadder {
19392
+ steps: number[] | null;
19393
+ factors: number[] | null;
19394
+ address: IAddress;
19395
+ chain: number;
19396
+ }
19397
+
18929
19398
  export declare const IDLE_CAPITAL_BORROWER_ADDRESS: `0x${string}`[];
18930
19399
 
18931
19400
  declare interface IEmberVault {
@@ -19110,8 +19579,43 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19110
19579
  timestamp_: string;
19111
19580
  }
19112
19581
 
19582
+ /**
19583
+ * One loan-book entry from the admin loan-book endpoints (backend
19584
+ * `LoanBookInfo` schema). Amounts are decimal-adjusted floats; monetary
19585
+ * fields are denominated in the loan's principal token. `deployed_date` is an
19586
+ * ISO-8601 datetime string; `state` is the backend `LoanStateStr` value
19587
+ * (e.g. `"ACTIVE"`).
19588
+ */
19589
+ export declare interface ILoanBookInfo {
19590
+ address: IAddress;
19591
+ lender: IAddress;
19592
+ borrower: IAddress;
19593
+ state: string;
19594
+ total_repaid: number;
19595
+ principal_token: IWhitelistedToken;
19596
+ principal_amount: number;
19597
+ interest_amount: number;
19598
+ upcoming_payment: ILoanUpcomingPayment;
19599
+ apr: number;
19600
+ initial_principal_amount: number;
19601
+ deployed_date: string;
19602
+ payment_interval: number;
19603
+ total_interest_payment_fees: number;
19604
+ lender_apr: number;
19605
+ }
19606
+
19113
19607
  declare type ILoanOracleFeeCategories = 'LOAN.REPAY.INTERESTS';
19114
19608
 
19609
+ /**
19610
+ * The amount and due date of a loan's next scheduled payment, as serialized
19611
+ * by the backend `UpcomingPayment` schema. `due_date` is an ISO-8601 datetime
19612
+ * string.
19613
+ */
19614
+ export declare interface ILoanUpcomingPayment {
19615
+ amount: number;
19616
+ due_date: string;
19617
+ }
19618
+
19115
19619
  /**
19116
19620
  * Structured logger interface (debug/info/warn/error). Sanitization runs
19117
19621
  * before any method here is invoked, so implementations needn't scrub secrets.
@@ -19217,6 +19721,45 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19217
19721
 
19218
19722
  export declare type IOperatorTypeEnum = 'eoa' | 'subaccount';
19219
19723
 
19724
+ /**
19725
+ * A vault's NAV-oracle classification from the public
19726
+ * `GET /upshift/oracle_classification/{vault_address}` endpoint (backend
19727
+ * `OracleClassificationResponse` schema). `warnings` lists tokens that could
19728
+ * not be resolved (`"unresolved:<symbol>"`). `snapshot_at` is an ISO-8601
19729
+ * datetime string.
19730
+ */
19731
+ export declare interface IOracleClassification {
19732
+ vault_address: IAddress;
19733
+ chain_id: number;
19734
+ snapshot_at: string;
19735
+ methodology: string;
19736
+ rows: IOracleClassificationRow[];
19737
+ warnings: string[];
19738
+ }
19739
+
19740
+ /**
19741
+ * One row of a vault's NAV-oracle classification table (backend
19742
+ * `OracleClassificationRow` schema) — how a single position/token is priced
19743
+ * and its USD value.
19744
+ */
19745
+ export declare interface IOracleClassificationRow {
19746
+ position: string;
19747
+ type: string;
19748
+ oracle_source: string;
19749
+ usd_value: number;
19750
+ }
19751
+
19752
+ /**
19753
+ * An OTC margin requirement from `GET /otc/margin_requirement` (backend
19754
+ * `IOTCMarginRequirementRead` schema) — the margin the `payer` must post to
19755
+ * the given counterparty.
19756
+ */
19757
+ export declare interface IOtcMarginRequirement {
19758
+ otc_counter_party_id: string;
19759
+ margin_requirement: number;
19760
+ payer: IAddress;
19761
+ }
19762
+
19220
19763
  export declare interface IOTCPosition {
19221
19764
  value: number;
19222
19765
  underlying: string;
@@ -19227,6 +19770,20 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19227
19770
  trades: IOTCTrade[];
19228
19771
  }
19229
19772
 
19773
+ /**
19774
+ * A tracked position from `GET /otc/position` (backend `IPositionRead`
19775
+ * schema). `configs` is a free-form JSON object of position-specific
19776
+ * settings; `category` is the position category (e.g. `"otc"`).
19777
+ */
19778
+ export declare interface IOtcPositionRead {
19779
+ id: string;
19780
+ slug: string;
19781
+ position_class: string | null;
19782
+ configs: Record<string, unknown> | null;
19783
+ category: string | null;
19784
+ position_discount_factor: number | null;
19785
+ }
19786
+
19230
19787
  export declare interface IOTCTrade {
19231
19788
  value: number;
19232
19789
  payer: string;
@@ -19508,6 +20065,18 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19508
20065
  refundChainId?: number;
19509
20066
  }
19510
20067
 
20068
+ /**
20069
+ * Result of the public `GET /revert_reason` endpoint (backend `RevertResponse`
20070
+ * schema) — the decoded failure reasons for a reverted transaction, collected
20071
+ * from a `debug_traceTransaction` call tree. All three arrays are empty when
20072
+ * no matching signal was found in the trace.
20073
+ */
20074
+ export declare interface IRevertReason {
20075
+ error_messages: string[];
20076
+ revert_reasons: string[];
20077
+ universal_subaccount_errors: string[];
20078
+ }
20079
+
19511
20080
  export declare type IRwaRedeemOptions = {
19512
20081
  /** RwaRedeemSubaccount contract address */
19513
20082
  target: IAddress;
@@ -19622,6 +20191,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19622
20191
  */
19623
20192
  export declare function isHubOnlyReceipt(vault: IAddress): boolean;
19624
20193
 
20194
+ export declare function isInsufficientFundsError(error: unknown): boolean;
20195
+
19625
20196
  /**
19626
20197
  * True when `NODE_ENV` is `'development'` or `'test'`. The SDK auto-disables
19627
20198
  * analytics in these environments so partners' local dev runs and Jest suites
@@ -19803,6 +20374,54 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19803
20374
  utila_wallet_id?: string;
19804
20375
  }
19805
20376
 
20377
+ /**
20378
+ * Cross-chain DeBank protocol positions for a subaccount and its associated
20379
+ * strategies (backend `SubaccountDebankAccountData` schema). `strategies` is
20380
+ * keyed by strategy address. This endpoint is slow (300-second server-side
20381
+ * cache) as it fans out across every supported chain.
20382
+ */
20383
+ export declare interface ISubaccountDebank {
20384
+ subaccount: ISubaccountDebankData;
20385
+ strategies: Record<string, ISubaccountDebankData>;
20386
+ }
20387
+
20388
+ /**
20389
+ * DeBank positions and tokens for a single account (backend
20390
+ * `DebankAccountData` schema). `positions`, `app_positions`, and `tokens`
20391
+ * are passed through as raw DeBank objects.
20392
+ */
20393
+ export declare interface ISubaccountDebankData {
20394
+ positions: unknown[];
20395
+ app_positions: unknown[];
20396
+ tokens: unknown[];
20397
+ }
20398
+
20399
+ /**
20400
+ * One transaction record from `GET /transactions/v2` (backend
20401
+ * `TransactionAPIRead` schema). `chain` is the numeric August chain id;
20402
+ * `value` is decimal-adjusted; `timestamp` is a Unix epoch (seconds).
20403
+ * `from_` mirrors the backend field name (`from` is reserved). Nested
20404
+ * `logs` / `transfers` / `function_signature` / `otc_cashflow` are passed
20405
+ * through as-is. `transaction_name` is the resolved function name (or the raw
20406
+ * selector when unknown).
20407
+ */
20408
+ export declare interface ISubaccountTransaction {
20409
+ id: string;
20410
+ tx_hash: string;
20411
+ chain: number;
20412
+ from_: IAddress;
20413
+ to: IAddress;
20414
+ value: number;
20415
+ block_number: number;
20416
+ timestamp: number;
20417
+ selector: string | null;
20418
+ logs: unknown[];
20419
+ transfers: unknown[];
20420
+ function_signature: Record<string, unknown> | null;
20421
+ otc_cashflow: Record<string, unknown> | null;
20422
+ transaction_name: string | null;
20423
+ }
20424
+
19806
20425
  export declare interface ISubgraphBase {
19807
20426
  id: string;
19808
20427
  contractId_: IAddress;
@@ -20144,6 +20763,31 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
20144
20763
  wallet: IAddress;
20145
20764
  }): Promise<boolean | undefined>;
20146
20765
 
20766
+ /**
20767
+ * One timelock request from `GET /timelock-requests` (backend
20768
+ * `ITimelockRequestRead` schema). `chain_id` is the numeric chain id;
20769
+ * `status` is one of `"scheduled" | "executed" | "cancelled"`; `params` is a
20770
+ * free-form JSON object; datetime fields are ISO-8601 strings.
20771
+ */
20772
+ export declare interface ITimelockRequest {
20773
+ id: string;
20774
+ hash: string;
20775
+ vault_address: IAddress;
20776
+ timelock_address: IAddress;
20777
+ chain_id: number;
20778
+ action_id: string;
20779
+ params: Record<string, unknown>;
20780
+ status: string;
20781
+ schedule_tx_hash: string;
20782
+ execute_tx_hash: string | null;
20783
+ cancel_tx_hash: string | null;
20784
+ submitted_by: string | null;
20785
+ scheduled_at: string;
20786
+ resolved_at: string | null;
20787
+ created_at: string | null;
20788
+ updated_at: string | null;
20789
+ }
20790
+
20147
20791
  export declare interface ITokenizedVault {
20148
20792
  address: string;
20149
20793
  yield_distributor: string;
@@ -20690,6 +21334,28 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
20690
21334
  }>;
20691
21335
  }
20692
21336
 
21337
+ /**
21338
+ * Performance-fee computation for a vault from
21339
+ * `GET /metrics/vault_performance_fees` (backend `UpshiftVaultPerformanceFees`
21340
+ * schema). High/low water marks are share-price levels; `*_datetime` fields
21341
+ * are ISO-8601 strings. `calculation_period` is `"YearToDate"` /
21342
+ * `"MonthToDate"` (null when a custom date range was supplied).
21343
+ */
21344
+ export declare interface IVaultPerformanceFees {
21345
+ previous_water_mark: number;
21346
+ previous_water_mark_datetime: string;
21347
+ last_water_mark: number;
21348
+ last_water_mark_datetime: string;
21349
+ is_in_drawdown: boolean;
21350
+ asset_symbol: string | null;
21351
+ total_pnl_in_asset: number;
21352
+ total_perf_fees_asset: number;
21353
+ calculation_period: string | null;
21354
+ annualized_fees_pct: number;
21355
+ underlying_asset_vs_native_perf: number | null;
21356
+ native_token_symbol: string | null;
21357
+ }
21358
+
20693
21359
  export declare interface IVaultPnl {
20694
21360
  totalPnl: INormalizedNumber;
20695
21361
  pnlUsd: number;
@@ -20825,6 +21491,23 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
20825
21491
  enabled?: boolean;
20826
21492
  }
20827
21493
 
21494
+ /**
21495
+ * A whitelisted token as embedded in loan-book records by the backend
21496
+ * `WhitelistedTokenModel` schema. `chain` is the numeric August chain id
21497
+ * (backend `Chain` IntEnum value, e.g. `1` for Ethereum mainnet).
21498
+ */
21499
+ export declare interface IWhitelistedToken {
21500
+ chain: number;
21501
+ name: string;
21502
+ token_type: string;
21503
+ address: IAddress;
21504
+ decimals: number;
21505
+ symbol: string;
21506
+ discount_factor: number;
21507
+ img_url: string | null;
21508
+ price: number | null;
21509
+ }
21510
+
20828
21511
  /**
20829
21512
  * Statuses
20830
21513
  */
@@ -21066,6 +21749,44 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
21066
21749
  total_loan_value: number;
21067
21750
  }
21068
21751
 
21752
+ /**
21753
+ * Chain record attached to a subaccount directory entry, as serialized by the
21754
+ * backend `IChainRead` schema.
21755
+ */
21756
+ export declare interface IWSSubaccountListChain {
21757
+ id: string;
21758
+ chain_id: number;
21759
+ name: string;
21760
+ }
21761
+
21762
+ /**
21763
+ * One subaccount record from the admin-only `GET /subaccount` directory
21764
+ * endpoint (backend `ISubaccountRead` schema). Nullable fields are optional
21765
+ * metadata the operations team may not have filled in.
21766
+ */
21767
+ export declare interface IWSSubaccountListItem {
21768
+ id: string;
21769
+ user_id: string | null;
21770
+ internal_name: string;
21771
+ friendly_name: string | null;
21772
+ address: IAddress;
21773
+ status: string | null;
21774
+ subaccount_type: string | null;
21775
+ min_health_factor: number | null;
21776
+ estimated_apr: number | null;
21777
+ notes: string | null;
21778
+ proxy_salt: string | null;
21779
+ admin_salt: string | null;
21780
+ disable_discount_factor: boolean | null;
21781
+ turnkey_address: IAddress | null;
21782
+ autopay_frequency: string | null;
21783
+ implementation: string | null;
21784
+ variant: string | null;
21785
+ default_fee_rate_in_bips: number | null;
21786
+ wallet_role: string | null;
21787
+ chains: IWSSubaccountListChain[];
21788
+ }
21789
+
21069
21790
  export declare interface IWSSubaccountLoan {
21070
21791
  address: IAddress;
21071
21792
  lender: IAddress;
@@ -23539,6 +24260,11 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
23539
24260
  subaccount: IAddress;
23540
24261
  useDebank: boolean;
23541
24262
  };
24263
+ MonarqXRP: {
24264
+ address: IAddress;
24265
+ subaccount: IAddress;
24266
+ useDebank: boolean;
24267
+ };
23542
24268
  };
23543
24269
 
23544
24270
  /**
@@ -24110,6 +24836,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
24110
24836
  refresh: string;
24111
24837
  };
24112
24838
  subaccount: {
24839
+ list: (offset?: number, limit?: number) => string;
24113
24840
  rewards: (subaccount: IAddress) => string;
24114
24841
  tokens: (subaccount: IAddress) => string;
24115
24842
  twap: {
@@ -24124,14 +24851,43 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
24124
24851
  loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
24125
24852
  cefi: (subaccount: IAddress) => string;
24126
24853
  otc_positions: (subaccount: IAddress) => string;
24854
+ loanByAddress: (loanAddress: string, chainId: number) => string;
24127
24855
  _: (subaccount: IAddress) => string;
24128
24856
  };
24857
+ transactions: {
24858
+ v2: (subaccount: string, startTime?: string, endTime?: string) => string;
24859
+ };
24860
+ otc: {
24861
+ positions: string;
24862
+ marginRequirements: (otcCounterpartyId?: string, payer?: string) => string;
24863
+ };
24864
+ curator: {
24865
+ vaultSubaccounts: (vaultAddress: string) => string;
24866
+ vaultWhitelist: (vaultAddress: string) => string;
24867
+ };
24868
+ timelockRequests: (vaultAddress: string, chainId: number, status?: string) => string;
24129
24869
  users: {
24130
24870
  get: string;
24131
24871
  };
24872
+ dashboard: {
24873
+ loans: string;
24874
+ };
24875
+ risk: {
24876
+ discountFactors: string;
24877
+ collateralExcessOrDeficit: (subaccount: string, tokenAddress: string, tokenChain: number, targetHealthFactor?: number) => string;
24878
+ collateralSimulation: string;
24879
+ };
24132
24880
  prices: (symbol: string) => string;
24133
24881
  metrics: {
24134
24882
  pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
24883
+ vaultPerformanceFees: (params: {
24884
+ vaultAddress: string;
24885
+ annualizedFeesPct: number;
24886
+ nativeDenominated: boolean;
24887
+ calculationPeriod: string;
24888
+ startDate?: string;
24889
+ endDate?: string;
24890
+ }) => string;
24135
24891
  };
24136
24892
  public: {
24137
24893
  integrations: {
@@ -24165,6 +24921,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
24165
24921
  unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
24166
24922
  unrealizedLatest: string;
24167
24923
  };
24924
+ revertReason: (txHash: string, chain: number) => string;
24925
+ oracleClassification: (vaultAddress: string, chainId: number) => string;
24168
24926
  };
24169
24927
  upshift: {
24170
24928
  vaults: {