@augustdigital/sdk 8.5.0 → 8.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +207 -117
  2. package/lib/adapters/evm/index.d.ts +4 -4
  3. package/lib/adapters/evm/index.js +2 -0
  4. package/lib/adapters/solana/constants.d.ts +1 -1
  5. package/lib/adapters/solana/getters.d.ts +1 -1
  6. package/lib/adapters/solana/index.d.ts +4 -4
  7. package/lib/adapters/solana/index.js +4 -0
  8. package/lib/adapters/solana/types.d.ts +1 -1
  9. package/lib/adapters/solana/utils.d.ts +3 -3
  10. package/lib/adapters/solana/vault.actions.d.ts +4 -4
  11. package/lib/adapters/stellar/actions.d.ts +1 -1
  12. package/lib/adapters/stellar/index.d.ts +24 -2
  13. package/lib/adapters/stellar/index.js +25 -2
  14. package/lib/adapters/stellar/soroban.d.ts +1 -1
  15. package/lib/adapters/stellar/soroban.js +1 -1
  16. package/lib/adapters/stellar/submit.d.ts +20 -3
  17. package/lib/adapters/stellar/submit.js +74 -8
  18. package/lib/adapters/sui/getters.d.ts +1 -1
  19. package/lib/adapters/sui/index.d.ts +1 -1
  20. package/lib/adapters/sui/index.js +2 -0
  21. package/lib/adapters/sui/transformer.d.ts +2 -2
  22. package/lib/adapters/sui/transformer.js +1 -0
  23. package/lib/adapters/sui/types.d.ts +1 -1
  24. package/lib/core/analytics/instrumentation.js +7 -11
  25. package/lib/core/analytics/sentry-runtime.js +1 -1
  26. package/lib/core/analytics/sentry.d.ts +3 -3
  27. package/lib/core/analytics/sentry.js +31 -5
  28. package/lib/core/analytics/types.d.ts +1 -1
  29. package/lib/core/analytics/user-identity.d.ts +2 -2
  30. package/lib/core/analytics/user-identity.js +1 -1
  31. package/lib/core/analytics/version.d.ts +1 -1
  32. package/lib/core/analytics/version.js +1 -1
  33. package/lib/core/base.class.d.ts +3 -3
  34. package/lib/core/base.class.js +10 -4
  35. package/lib/core/constants/adapters.d.ts +1 -1
  36. package/lib/core/constants/core.d.ts +2 -0
  37. package/lib/core/constants/core.js +6 -0
  38. package/lib/core/constants/swap-router.d.ts +37 -1
  39. package/lib/core/constants/swap-router.js +41 -1
  40. package/lib/core/constants/vaults.d.ts +1 -1
  41. package/lib/core/constants/web3.d.ts +1 -1
  42. package/lib/core/constants/web3.js +0 -3
  43. package/lib/core/errors/index.d.ts +2 -2
  44. package/lib/core/errors/index.js +9 -0
  45. package/lib/core/fetcher.d.ts +39 -39
  46. package/lib/core/fetcher.js +75 -57
  47. package/lib/core/helpers/adapters.d.ts +1 -1
  48. package/lib/core/helpers/chain-error.d.ts +66 -0
  49. package/lib/core/helpers/chain-error.js +174 -0
  50. package/lib/core/helpers/core.d.ts +21 -18
  51. package/lib/core/helpers/core.js +22 -20
  52. package/lib/core/helpers/explorer-link.d.ts +1 -1
  53. package/lib/core/helpers/signer.d.ts +1 -1
  54. package/lib/core/helpers/swap-router.d.ts +1 -1
  55. package/lib/core/helpers/vault-version.d.ts +1 -1
  56. package/lib/core/helpers/vaults.d.ts +1 -1
  57. package/lib/core/helpers/web3.d.ts +2 -2
  58. package/lib/core/helpers/web3.js +9 -9
  59. package/lib/core/index.d.ts +1 -0
  60. package/lib/core/index.js +1 -0
  61. package/lib/core/vault-metadata.d.ts +1 -1
  62. package/lib/core/version-check.js +1 -1
  63. package/lib/evm/methods/crossChainVault.js +1 -1
  64. package/lib/evm/types/crossChain.js +1 -1
  65. package/lib/main.d.ts +1 -1
  66. package/lib/main.js +7 -0
  67. package/lib/modules/sub-accounts/fetcher.d.ts +2 -2
  68. package/lib/modules/sub-accounts/main.d.ts +2 -2
  69. package/lib/modules/sub-accounts/main.js +1 -1
  70. package/lib/modules/sub-accounts/utils.d.ts +1 -1
  71. package/lib/modules/vaults/adapter.helpers.d.ts +3 -3
  72. package/lib/modules/vaults/fetcher.d.ts +25 -0
  73. package/lib/modules/vaults/fetcher.js +51 -1
  74. package/lib/modules/vaults/getters.d.ts +50 -50
  75. package/lib/modules/vaults/getters.js +68 -67
  76. package/lib/modules/vaults/main.js +3 -1
  77. package/lib/modules/vaults/read.actions.d.ts +2 -2
  78. package/lib/modules/vaults/read.actions.js +26 -12
  79. package/lib/modules/vaults/utils/call-data-decoder.d.ts +1 -1
  80. package/lib/modules/vaults/utils.d.ts +19 -3
  81. package/lib/modules/vaults/utils.js +39 -6
  82. package/lib/modules/vaults/write.actions.js +73 -7
  83. package/lib/polyfills.js +3 -3
  84. package/lib/sdk.d.ts +1409 -1198
  85. package/lib/services/coingecko/fetcher.d.ts +10 -9
  86. package/lib/services/coingecko/fetcher.js +22 -18
  87. package/lib/services/debank/fetcher.d.ts +1 -1
  88. package/lib/services/debank/utils.d.ts +1 -1
  89. package/lib/services/debank/utils.js +1 -1
  90. package/lib/services/layerzero/deposits.d.ts +1 -1
  91. package/lib/services/layerzero/redeems.d.ts +1 -1
  92. package/lib/services/octavfi/fetcher.d.ts +1 -1
  93. package/lib/services/octavfi/types.d.ts +1 -1
  94. package/lib/services/octavfi/utils.d.ts +2 -2
  95. package/lib/services/subgraph/fetcher.js +1 -1
  96. package/lib/services/subgraph/vaults.js +86 -3
  97. package/lib/services/swap-quotes/index.d.ts +9 -0
  98. package/lib/services/swap-quotes/index.js +2 -1
  99. package/lib/services/swap-quotes/paraswap.d.ts +8 -0
  100. package/lib/services/swap-quotes/paraswap.js +8 -0
  101. package/lib/types/pools.d.ts +2 -2
  102. package/lib/types/staking.d.ts +1 -1
  103. package/lib/types/sub-accounts.d.ts +1 -1
  104. package/lib/types/subgraph.d.ts +10 -1
  105. package/lib/types/vaults.d.ts +26 -0
  106. package/lib/types/web3.d.ts +1 -1
  107. package/lib/types/webserver.d.ts +2 -2
  108. package/package.json +1 -1
package/lib/sdk.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Abi } from 'abitype';
2
2
  import type { AbiParametersToPrimitiveTypes } from 'abitype';
3
- import { AnchorProvider } from '@coral-xyz/anchor';
3
+ import type { AnchorProvider } from '@coral-xyz/anchor';
4
4
  import type { BaseContract } from 'ethers';
5
5
  import { Connection } from '@solana/web3.js';
6
6
  import type { ContractTransaction } from 'ethers';
@@ -21,10 +21,10 @@ import { JsonRpcProvider } from 'ethers';
21
21
  import { LRUCache } from 'lru-cache';
22
22
  import type { Overrides } from 'ethers';
23
23
  import { Program } from '@coral-xyz/anchor';
24
- import { Provider } from 'ethers';
24
+ import type { Provider } from 'ethers';
25
25
  import { PublicKey } from '@solana/web3.js';
26
26
  import type { Result } from 'ethers';
27
- import { SendTransactionOptions } from '@solana/wallet-adapter-base';
27
+ import type { SendTransactionOptions } from '@solana/wallet-adapter-base';
28
28
  import type * as Sentry from '@sentry/browser';
29
29
  import { Signer } from 'ethers';
30
30
  import { Transaction } from '@solana/web3.js';
@@ -15219,7 +15219,7 @@ export declare class AugustBase {
15219
15219
  * ```
15220
15220
  */
15221
15221
  /** Stable error codes attached to SDK errors. */
15222
- export declare type AugustErrorCode = 'AUTH_MISSING_KEY' | 'AUTH_INVALID_KEY' | 'AUTH_FORBIDDEN' | 'AUTH_UNAUTHORIZED' | 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS' | 'NETWORK_ERROR' | 'TIMEOUT' | 'RATE_LIMITED' | 'SERVER_ERROR' | 'UNKNOWN';
15222
+ 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' | 'UNKNOWN';
15223
15223
 
15224
15224
  /** Options accepted by every SDK error constructor. */
15225
15225
  export declare interface AugustErrorOptions {
@@ -15301,7 +15301,7 @@ declare class AugustSDK extends AugustBase {
15301
15301
  * @param symbol - Token symbol or contract address
15302
15302
  * @returns Current price in USD
15303
15303
  */
15304
- getPrice(symbol: string): Promise<any>;
15304
+ getPrice(symbol: string): Promise<number>;
15305
15305
  /**
15306
15306
  * Vault Data and Operations
15307
15307
  */
@@ -15868,7 +15868,7 @@ export declare class AugustTimeoutError extends AugustSDKError {
15868
15868
 
15869
15869
  /** Caller-side input failed validation. */
15870
15870
  export declare class AugustValidationError extends AugustSDKError {
15871
- constructor(code: Extract<AugustErrorCode, 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS'>, message: string, options?: AugustErrorOptions);
15871
+ constructor(code: Extract<AugustErrorCode, 'INVALID_URL' | 'INVALID_INPUT' | 'INVALID_CHAIN' | 'INVALID_ADDRESS' | 'ACCOUNT_NOT_FUNDED'>, message: string, options?: AugustErrorOptions);
15872
15872
  }
15873
15873
 
15874
15874
  /**
@@ -16381,21 +16381,23 @@ declare let cacheStats: {
16381
16381
  };
16382
16382
 
16383
16383
  /**
16384
- * Calculate weighted average for array of objects
16385
- * @param {Array<Object>} data - Array of objects with values
16386
- * @param {string} valueProperty - Property name containing the value to average
16387
- * @param {string} [weightProperty] - Optional property to base weights on
16388
- * @returns {number} Weighted average
16384
+ * Calculate weighted average for array of objects.
16385
+ * @param data - Array of objects with values
16386
+ * @param valueProperty - Property name containing the value to average
16387
+ * @param weightProperty - Optional property to base weights on
16388
+ * @returns Weighted average
16389
16389
  */
16390
- export declare function calculateWeightedAverage(data?: Array<any>, valueProperty?: string, weightProperty?: string): any;
16390
+ export declare function calculateWeightedAverage<T extends Record<string, unknown>>(data?: T[], valueProperty?: string, weightProperty?: string): number;
16391
16391
 
16392
16392
  /**
16393
- * Calculate weights based on a specific property in array of objects
16394
- * @param {Array<Object>} data - Array of objects to calculate weights for
16395
- * @param {string} weightProperty - Property name to base weights on
16396
- * @returns {Array<Object>} Original data with weights added
16393
+ * Calculate weights based on a specific property in array of objects.
16394
+ * @param data - Array of objects to calculate weights for
16395
+ * @param weightProperty - Property name to base weights on
16396
+ * @returns Original data with each item's `weight` added
16397
16397
  */
16398
- export declare function calculateWeights(data?: Array<any>, weightProperty?: string): any[];
16398
+ export declare function calculateWeights<T extends Record<string, unknown>>(data?: T[], weightProperty?: string): Array<T & {
16399
+ weight: number;
16400
+ }>;
16399
16401
 
16400
16402
  /**
16401
16403
  * Check if a user can deposit from their current chain.
@@ -17072,8 +17074,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17072
17074
  /**
17073
17075
  * Make unauthenticated requests to August public API endpoints.
17074
17076
  * Used for fetching vault metadata and public market data.
17075
- * @param relativeUrl Endpoint path relative to public API base URL
17076
- * @param options Request configuration including method and headers
17077
+ * @param relativeUrl - Endpoint path relative to public API base URL
17078
+ * @param options - Request configuration including method and headers
17077
17079
  * @returns Response object if successful
17078
17080
  * @throws Error with correlation ID if request fails
17079
17081
  */
@@ -17082,9 +17084,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17082
17084
  /**
17083
17085
  * Make authenticated requests using Bearer token authentication.
17084
17086
  * Typically used for user-specific operations requiring OAuth tokens.
17085
- * @param bearerToken OAuth bearer token
17086
- * @param relativeUrl Endpoint path relative to base URL
17087
- * @param options Request configuration including method and headers
17087
+ * @param bearerToken - OAuth bearer token
17088
+ * @param relativeUrl - Endpoint path relative to base URL
17089
+ * @param options - Request configuration including method and headers
17088
17090
  * @returns Response object if successful
17089
17091
  * @throws Error with correlation ID if request fails
17090
17092
  */
@@ -17093,9 +17095,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17093
17095
  /**
17094
17096
  * Make authenticated requests to August backend services using API key.
17095
17097
  * Automatically logs errors with correlation IDs for debugging.
17096
- * @param apiKey August API key for authentication
17097
- * @param relativeUrl Endpoint path relative to base URL
17098
- * @param options Request configuration including method and headers
17098
+ * @param apiKey - August API key for authentication
17099
+ * @param relativeUrl - Endpoint path relative to base URL
17100
+ * @param options - Request configuration including method and headers
17099
17101
  * @returns Response object if successful
17100
17102
  * @throws Error with correlation ID if request fails
17101
17103
  */
@@ -17117,8 +17119,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17117
17119
 
17118
17120
  /**
17119
17121
  * Fetch the points leaderboard data.
17120
- * @param params Optional parameters for pagination and sorting
17121
- * @param options Request options including headers
17122
+ * @param params - Optional parameters for pagination and sorting
17123
+ * @param options - Request options including headers
17122
17124
  * @returns Leaderboard response data
17123
17125
  */
17124
17126
  export declare function fetchPointsLeaderboard({ params, options, }: {
@@ -17188,8 +17190,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17188
17190
  /**
17189
17191
  * Fetch tokenized vault configurations from backend API.
17190
17192
  * Results are cached to reduce API calls. Optionally filter by specific vault address.
17191
- * @param pool Optional vault address to filter results
17192
- * @param headers Monitoring headers for request tracking
17193
+ * @param pool - Optional vault address to filter results
17194
+ * @param headers - Monitoring headers for request tracking
17193
17195
  * @returns Array of tokenized vault configurations
17194
17196
  */
17195
17197
  export declare function fetchTokenizedVault(pool: VaultAddress, headers?: IWSMonitorHeaders, loadSubaccounts?: boolean, loadSnapshots?: boolean): Promise<ITokenizedVault[]>;
@@ -17197,9 +17199,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17197
17199
  /**
17198
17200
  * Fetch active loans for a specific vault from backend API.
17199
17201
  * Results are cached per vault and chain to reduce API calls.
17200
- * @param pool Vault address
17201
- * @param chainId Network chain ID
17202
- * @param headers Monitoring headers for request tracking
17202
+ * @param pool - Vault address
17203
+ * @param chainId - Network chain ID
17204
+ * @param headers - Monitoring headers for request tracking
17203
17205
  * @returns Array of active loan objects
17204
17206
  */
17205
17207
  export declare function fetchTokenizedVaultLoans(pool: VaultAddress, chainId: number, headers?: IWSMonitorHeaders): Promise<IWSVaultLoan[]>;
@@ -17207,9 +17209,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17207
17209
  /**
17208
17210
  * Fetch tokenized vault configurations from backend API.
17209
17211
  * Results are cached to reduce API calls. Optionally filter by specific vault address.
17210
- * @param pool Optional vault address to filter results
17211
- * @param headers Monitoring headers for request tracking
17212
- * @param loadSubaccounts Optional flag to load subaccounts and EOA operators (defaults to true on API)
17212
+ * @param pool - Optional vault address to filter results
17213
+ * @param headers - Monitoring headers for request tracking
17214
+ * @param loadSubaccounts - Optional flag to load subaccounts and EOA operators (defaults to true on API)
17213
17215
  * @returns Array of tokenized vault configurations
17214
17216
  */
17215
17217
  export declare function fetchTokenizedVaults(pool?: IAddress, headers?: IWSMonitorHeaders, loadSubaccounts?: boolean, loadSnapshots?: boolean): Promise<ITokenizedVault[]>;
@@ -17217,9 +17219,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17217
17219
  /**
17218
17220
  * Fetch subaccount loans for a specific tokenized vault (lending pool).
17219
17221
  * Retrieves all active subaccount loan data from the backend.
17220
- * @param pool Vault address
17221
- * @param chainId Network chain ID
17222
- * @param headers Monitoring headers for request tracking
17222
+ * @param pool - Vault address
17223
+ * @param chainId - Network chain ID
17224
+ * @param headers - Monitoring headers for request tracking
17223
17225
  * @returns Array of active subaccount loan objects
17224
17226
  */
17225
17227
  export declare function fetchTokenizedVaultSubaccountLoans(pool: VaultAddress, chainId: number, headers?: IWSMonitorHeaders): Promise<IWSVaultLoan[]>;
@@ -17228,19 +17230,19 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17228
17230
  * Fetch current USD price for a token symbol or vault LP token.
17229
17231
  * For vault LP tokens, calculates share price using totalAssets/totalSupply ratio.
17230
17232
  * Falls back to CoinGecko if primary source fails.
17231
- * @param symbol Token symbol or contract address
17232
- * @param provider Optional web3 provider for on-chain price calculations
17233
- * @param coinGeckoKey Optional CoinGecko API key for fallback pricing
17234
- * @param headers Monitoring headers for request tracking
17233
+ * @param symbol - Token symbol or contract address
17234
+ * @param provider - Optional web3 provider for on-chain price calculations
17235
+ * @param coinGeckoKey - Optional CoinGecko API key for fallback pricing
17236
+ * @param headers - Monitoring headers for request tracking
17235
17237
  * @returns Token price in USD
17236
17238
  */
17237
- export declare function fetchTokenPrice(symbol: string, provider?: IContractRunner, coinGeckoKey?: string, headers?: IWSMonitorHeaders): Promise<any>;
17239
+ export declare function fetchTokenPrice(symbol: string, provider?: IContractRunner, coinGeckoKey?: string, headers?: IWSMonitorHeaders): Promise<number>;
17238
17240
 
17239
17241
  /**
17240
17242
  * Fetch token price by contract address and chain ID from August price server.
17241
- * @param address Token contract address
17242
- * @param chainId Network chain ID
17243
- * @param headers Optional monitoring headers for request tracking
17243
+ * @param address - Token contract address
17244
+ * @param chainId - Network chain ID
17245
+ * @param headers - Optional monitoring headers for request tracking
17244
17246
  * @returns Token price in USD, or 0 if not found
17245
17247
  */
17246
17248
  export declare function fetchTokenPriceByAddress(address: VaultAddress, chainId: number, headers?: IWSMonitorHeaders): Promise<number>;
@@ -17256,9 +17258,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17256
17258
  /**
17257
17259
  * Fetch historical timeseries data for a specific vault.
17258
17260
  * Returns TVL, APY, PnL, and share price data over time.
17259
- * @param vaultAddress Vault contract address
17260
- * @param nDays Number of days of historical data to fetch (default 30, min 1)
17261
- * @param headers Monitoring headers for request tracking
17261
+ * @param vaultAddress - Vault contract address
17262
+ * @param nDays - Number of days of historical data to fetch (default 30, min 1)
17263
+ * @param headers - Monitoring headers for request tracking
17262
17264
  * @returns Historical timeseries data with date keys
17263
17265
  */
17264
17266
  export declare function fetchVaultHistoricalTimeseries(vaultAddress: IAddress, nDays?: number, headers?: IWSMonitorHeaders): Promise<IHistoricalTimeseriesResponse>;
@@ -17402,8 +17404,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17402
17404
  * look up entries without worrying about EIP-55 checksum casing in either the
17403
17405
  * backend response or the caller's input.
17404
17406
  *
17405
- * @param options Standard vault options — `rpcUrl` should match `vault`'s chain.
17406
- * @param vault Optional vault address to scope the fetch to.
17407
+ * @param options - Standard vault options — `rpcUrl` should match `vault`'s chain.
17408
+ * @param vault - Optional vault address to scope the fetch to.
17407
17409
  * @returns Map of lowercased vault address → array of borrower-health-factor rows.
17408
17410
  */
17409
17411
  export declare function getHealthFactorOfBorrowersByVault({ options, vault, }: {
@@ -17505,10 +17507,10 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17505
17507
 
17506
17508
  /**
17507
17509
  * Preview the amount of assets that would be received for redeeming shares (queued redemption).
17508
- * @param vault Vault contract address
17509
- * @param sharesAmount Amount of shares to redeem (human-readable, raw bigint, or string)
17510
- * @param options RPC configuration
17511
- * @returns The amount of assets as INormalizedNumber { normalized, raw }
17510
+ * @param vault - Vault contract address
17511
+ * @param sharesAmount - Amount of shares to redeem (human-readable, raw bigint, or string)
17512
+ * @param options - RPC configuration
17513
+ * @returns The amount of assets as an INormalizedNumber with `normalized` and `raw` fields
17512
17514
  */
17513
17515
  export declare function getPreviewRedemption({ vault, sharesAmount, options, }: {
17514
17516
  vault: IAddress;
@@ -17686,8 +17688,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17686
17688
  /**
17687
17689
  * Fetch user points from the backend API endpoint.
17688
17690
  * This replaces client-side points calculation with server-side processing.
17689
- * @param userAddress User wallet address (EVM or Solana)
17690
- * @param options Request options including headers
17691
+ * @param userAddress - User wallet address (EVM or Solana)
17692
+ * @param options - Request options including headers
17691
17693
  * @returns Points data from the backend API
17692
17694
  */
17693
17695
  export declare function getUserPoints({ userAddress, options, }: {
@@ -17714,10 +17716,10 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17714
17716
  * Fetch comprehensive vault data including on-chain state and backend metadata.
17715
17717
  * Routes to appropriate chain adapter (EVM v1/v2, Solana, or Stellar) based on vault version.
17716
17718
  * Optionally enriches with loan and allocation data.
17717
- * @param vault Vault contract address (EVM hex, Stellar C-address, or Solana program ID)
17718
- * @param loans Include active loan data
17719
- * @param allocations Include DeFi/CeFi allocation breakdowns
17720
- * @param options RPC and service configuration
17719
+ * @param vault - Vault contract address (EVM hex, Stellar C-address, or Solana program ID)
17720
+ * @param loans - Include active loan data
17721
+ * @param allocations - Include DeFi/CeFi allocation breakdowns
17722
+ * @param options - RPC and service configuration
17721
17723
  * @returns Complete vault object with optional enrichments
17722
17724
  */
17723
17725
  export declare function getVault({ vault, loans, allocations, options, loadSubaccounts, loadSnapshots, }: {
@@ -17741,8 +17743,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17741
17743
  * Fetch comprehensive vault asset allocation breakdown.
17742
17744
  * Includes DeFi protocols (via DeBank), CeFi balances, OTC positions, and loans.
17743
17745
  * Categorizes exposures by borrowing, supplying, lending, and wallet holdings.
17744
- * @param vault Vault address
17745
- * @param options RPC configuration
17746
+ * @param vault - Vault address
17747
+ * @param options - RPC configuration
17746
17748
  * @returns Detailed allocation data with exposure categorization
17747
17749
  */
17748
17750
  export declare function getVaultAllocations(vault: IAddress, options: IVaultBaseOptions): Promise<IVaultAllocations>;
@@ -17756,8 +17758,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17756
17758
  * These fields will be removed on 2026-01-01.
17757
17759
  * Use `liquidAPY30Day` and `liquidAPY7Day` fields instead.
17758
17760
  *
17759
- * @param vault Vault contract address
17760
- * @param options Request options including headers
17761
+ * @param vault - Vault contract address
17762
+ * @param options - Request options including headers
17761
17763
  * @returns Annualized APY data including liquidity APY
17762
17764
  */
17763
17765
  export declare function getVaultAnnualizedApy({ vault, options, }: {
@@ -17802,8 +17804,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17802
17804
  * `health_factor: undefined` so callers can render an explicit empty state
17803
17805
  * rather than a perpetual loading skeleton.
17804
17806
  *
17805
- * @param vault Vault address to scope the fetch to.
17806
- * @param options Standard vault options — `rpcUrl` must point at `vault`'s chain.
17807
+ * @param vault - Vault address to scope the fetch to.
17808
+ * @param options - Standard vault options — `rpcUrl` must point at `vault`'s chain.
17807
17809
  * @returns Array of `IVaultBorrowerHealthFactor`, one entry per active loan.
17808
17810
  */
17809
17811
  export declare function getVaultBorrowerHealthFactor({ vault, options, }: {
@@ -17847,10 +17849,10 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17847
17849
 
17848
17850
  /**
17849
17851
  * Fetch pending redemptions for a vault with liquidity analysis.
17850
- * @param vault Vault contract address
17851
- * @param pastDays Number of past days to include (default 7, min 1, max 30)
17852
- * @param futureDays Number of future days to include (default 14, min 1, max 30)
17853
- * @param options Request options including headers
17852
+ * @param vault - Vault contract address
17853
+ * @param pastDays - Number of past days to include (default 7, min 1, max 30)
17854
+ * @param futureDays - Number of future days to include (default 14, min 1, max 30)
17855
+ * @param options - Request options including headers
17854
17856
  * @returns Pending redemptions grouped by date with liquidity summary
17855
17857
  */
17856
17858
  export declare function getVaultPendingRedemptions({ vault, pastDays, futureDays, options, }: {
@@ -17864,8 +17866,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17864
17866
  * Calculate PnL for a vault (vault-level, not user-specific).
17865
17867
  * Returns the vault's overall profit and loss across all users.
17866
17868
  *
17867
- * @param vault Vault contract address
17868
- * @param options RPC configuration and service options
17869
+ * @param vault - Vault contract address
17870
+ * @param options - RPC configuration and service options
17869
17871
  * @returns Vault PnL in USD and notional value
17870
17872
  */
17871
17873
  export declare function getVaultPnl({ vault, options, }: {
@@ -17892,9 +17894,18 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17892
17894
  }): Promise<IVaultRedemptionHistoryItem[]>;
17893
17895
 
17894
17896
  /**
17895
- * Get the rewards for the vault
17896
- * @param tokenizedVault - The tokenized vault
17897
- * @returns The rewards
17897
+ * Get the rewards for the vault.
17898
+ *
17899
+ * Builds the display-facing rewards summary from the raw tokenized-vault
17900
+ * rewards array. In addition to the legacy `additionalPoints` string list, it
17901
+ * emits `additionalPointsDetailed`, which pairs each label with its
17902
+ * backend-provided `img_url`. Consumers (e.g. the Upshift app) resolve a
17903
+ * reward's logo from this `imgUrl` first, falling back to a bundled asset only
17904
+ * when it is absent — so a newly-added reward with a backend logo (e.g.
17905
+ * "Cores") renders its icon without any client-side keyword mapping.
17906
+ *
17907
+ * @param tokenizedVault - The tokenized vault.
17908
+ * @returns The rewards summary, including `additionalPointsDetailed`.
17898
17909
  */
17899
17910
  export declare function getVaultRewards(tokenizedVault: ITokenizedVault): {
17900
17911
  points: string;
@@ -17904,6 +17915,13 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17904
17915
  value: number;
17905
17916
  }[];
17906
17917
  additionalPoints: string[];
17918
+ additionalPointsDetailed: {
17919
+ id: string;
17920
+ label: string;
17921
+ text: string;
17922
+ imgUrl: string;
17923
+ multiplier: number;
17924
+ }[];
17907
17925
  };
17908
17926
 
17909
17927
  /**
@@ -17913,8 +17931,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17913
17931
 
17914
17932
  /**
17915
17933
  * Fetch summary data for a vault (name, type, chain, recent returns).
17916
- * @param vault Vault contract address
17917
- * @param options Request options including headers
17934
+ * @param vault - Vault contract address
17935
+ * @param options - Request options including headers
17918
17936
  * @returns Vault summary data
17919
17937
  */
17920
17938
  export declare function getVaultSummary({ vault, options, }: {
@@ -17941,9 +17959,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17941
17959
  * 2. Fetch user's current assets (balanceOf * sharePrice via convertToAssets)
17942
17960
  * 3. Calculate PnL = assets withdrawn + current assets - assets deposited
17943
17961
  *
17944
- * @param vault Vault contract address
17945
- * @param wallet User wallet address
17946
- * @param options RPC configuration and service options
17962
+ * @param vault - Vault contract address
17963
+ * @param wallet - User wallet address
17964
+ * @param options - RPC configuration and service options
17947
17965
  * @returns Lifetime PnL data in both native token and USD
17948
17966
  */
17949
17967
  export declare function getVaultUserLifetimePnl({ vault, wallet, options, }: {
@@ -17959,9 +17977,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
17959
17977
 
17960
17978
  /**
17961
17979
  * Fetch withdrawal summary and pending queue for a vault.
17962
- * @param vault Vault contract address
17963
- * @param chain Chain identifier (e.g., chain ID as string)
17964
- * @param options Request options including headers
17980
+ * @param vault - Vault contract address
17981
+ * @param chain - Chain identifier (e.g., chain ID as string)
17982
+ * @param options - Request options including headers
17965
17983
  * @returns Withdrawal summary and pending queue
17966
17984
  */
17967
17985
  export declare function getVaultWithdrawals({ vault, chain, options, }: {
@@ -18000,13 +18018,13 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
18000
18018
  * - `'ready_to_claim'` — Claimable date has passed (within the lookback window) but no processed event found.
18001
18019
  * - `'pending'` — Claimable date is still in the future.
18002
18020
  *
18003
- * @param params - Query parameters
18004
- * @param params.vault - Vault address to query
18005
- * @param params.receiver - (Optional) Filter by receiver address
18006
- * @param params.lookbackBlocks - (Optional) On-chain log lookback window in blocks.
18007
- * Defaults to a chain-specific value (e.g. 150,000 for Ethereum, 3,456,000 for Monad).
18008
- * Increasing this scans more history but requires more RPC calls.
18009
- * @param params.options - Standard vault query options (provider, RPC URL, etc.)
18021
+ * @param params - Query parameters:
18022
+ * - `vault` Vault address to query.
18023
+ * - `receiver` (Optional) Filter by receiver address.
18024
+ * - `lookbackBlocks` (Optional) On-chain log lookback window in blocks.
18025
+ * Defaults to a chain-specific value (e.g. 150,000 for Ethereum, 3,456,000 for Monad).
18026
+ * Increasing this scans more history but requires more RPC calls.
18027
+ * - `options` Standard vault query options (provider, RPC URL, etc.).
18010
18028
  * @returns Array of withdrawal requests with status and claimable dates
18011
18029
  *
18012
18030
  * @example
@@ -18051,8 +18069,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
18051
18069
  /**
18052
18070
  * Fetch the timestamp when yield was last realized for a vault.
18053
18071
  * Returns the assetsUpdatedOn timestamp from the vault contract.
18054
- * @param vault Vault contract address
18055
- * @param options RPC configuration
18072
+ * @param vault - Vault contract address
18073
+ * @param options - RPC configuration
18056
18074
  * @returns Timestamp (Unix timestamp in seconds) when yield was last realized
18057
18075
  */
18058
18076
  export declare function getYieldLastRealizedOn({ vault, options, }: {
@@ -18822,7 +18840,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
18822
18840
  export declare type IFetchAugustOptions = {
18823
18841
  method?: IFetchAugustMethods;
18824
18842
  headers?: Record<string, string>;
18825
- data?: any;
18843
+ data?: unknown;
18826
18844
  server?: keyof typeof WEBSERVER_URL;
18827
18845
  /** Caller-supplied AbortSignal; combined with the default timeout. */
18828
18846
  signal?: AbortSignal;
@@ -18993,7 +19011,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
18993
19011
  * only refresh user identity and the cached API-key hash.
18994
19012
  *
18995
19013
  * @param config - Analytics configuration. Pass `tracesSampleRate` to
18996
- * override the Phase 1/2 default of `1.0`.
19014
+ * override the default of `0.1`.
18997
19015
  * @param environment - Current environment (DEV or PROD).
18998
19016
  * @param walletAddress - Optional wallet address for user identification.
18999
19017
  * @param apiKey - Optional API key (hashed for identification).
@@ -19387,6 +19405,34 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19387
19405
 
19388
19406
  export declare function isEarlierThanNow(startTime: Date): boolean;
19389
19407
 
19408
+ /**
19409
+ * Is this error a routine on-chain read revert rather than a real failure?
19410
+ *
19411
+ * Reading a function a contract doesn't implement, or an address that holds no
19412
+ * (or incompatible) bytecode, reverts — a normal outcome when the SDK probes
19413
+ * heterogeneous vaults. Matches ethers' `CALL_EXCEPTION` code and the
19414
+ * message variants emitted by ethers and viem (`missing revert data`,
19415
+ * `execution reverted`, `call revert exception`, and the bare `reverted`
19416
+ * phrasing such as `the contract function "totalAssets" reverted`).
19417
+ *
19418
+ * Scope note: callers apply this on **read** paths only. A reverted *write*
19419
+ * (a tx that failed on-chain) is a genuine error and is intentionally not
19420
+ * demoted by this predicate's use in `write.actions`.
19421
+ *
19422
+ * @param error - The caught value, of unknown type.
19423
+ * @returns `true` when the failure is an expected/benign contract revert.
19424
+ *
19425
+ * @example
19426
+ * ```ts
19427
+ * try { return await vaultContract.maxDepositAmount(); }
19428
+ * catch (e) {
19429
+ * logChainError('maxDeposit', e, isExpectedRevertError(e));
19430
+ * throw e;
19431
+ * }
19432
+ * ```
19433
+ */
19434
+ export declare function isExpectedRevertError(error: unknown): boolean;
19435
+
19390
19436
  /**
19391
19437
  * Whether a vault's receipt token is hub-only (no cross-chain withdraw).
19392
19438
  * The deposit UI must not offer a spoke share destination for these vaults.
@@ -19624,6 +19670,15 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19624
19670
  type: 'withdraw-request' | 'deposit' | 'withdraw-processed';
19625
19671
  decimals?: number;
19626
19672
  isInstant?: boolean;
19673
+ /**
19674
+ * Deposit asset token address, when known. Pre-deposit vaults accept
19675
+ * multiple deposit assets with differing decimals (e.g. USDS at 18,
19676
+ * USDC at 6), so `amount` cannot be normalized with the vault's own
19677
+ * decimals alone — consumers (notably lifetime PnL) key off this address
19678
+ * to resolve the correct per-asset decimals and USD price. Absent for
19679
+ * single-asset vaults, where the vault `decimals` is correct.
19680
+ */
19681
+ assetIn?: IAddress;
19627
19682
  }
19628
19683
 
19629
19684
  export declare interface ISubgraphWithdraw extends ISubgraphBase {
@@ -19649,6 +19704,27 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19649
19704
  ownerAddr: IAddress;
19650
19705
  }
19651
19706
 
19707
+ /**
19708
+ * Is this error a wallet/user rejection of a transaction or signature request?
19709
+ *
19710
+ * Detects ethers v6's `ACTION_REJECTED` code, the EIP-1193 `4001`
19711
+ * ("User rejected the request") code (top-level or nested), and the common
19712
+ * human-readable phrasings as a fallback for providers that omit a code.
19713
+ *
19714
+ * @param error - The caught value, of unknown type.
19715
+ * @returns `true` when the failure was the user declining in their wallet.
19716
+ *
19717
+ * @example
19718
+ * ```ts
19719
+ * try { await vault.deposit(...); }
19720
+ * catch (e) {
19721
+ * if (isUserRejectionError(e)) return; // user cancelled — not an error
19722
+ * throw e;
19723
+ * }
19724
+ * ```
19725
+ */
19726
+ export declare function isUserRejectionError(error: unknown): boolean;
19727
+
19652
19728
  /**
19653
19729
  * Signer Compatibility Helpers
19654
19730
  *
@@ -19726,6 +19802,15 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
19726
19802
  * in `[0, 10_000)` — 10_000 disables protection entirely and is rejected.
19727
19803
  */
19728
19804
  slippageBps?: number;
19805
+ /**
19806
+ * Optional aggregator contract-method filter. When set, the aggregator is
19807
+ * constrained to this single method (ParaSwap's `/prices`
19808
+ * `includeContractMethods`), so the returned calldata's leading 4-byte
19809
+ * selector is deterministic — required when the on-chain SwapRouter only
19810
+ * authorizes one selector per router. When omitted, the aggregator picks the
19811
+ * optimal method freely and the selector may vary between quotes.
19812
+ */
19813
+ contractMethod?: string;
19729
19814
  /** Aggregator partner key. Defaults to `'august'`. */
19730
19815
  partner?: string;
19731
19816
  /** Aggregator partner-fee receiver. Defaults to the August partner address. */
@@ -20389,6 +20474,27 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
20389
20474
  transactionHash?: string;
20390
20475
  };
20391
20476
 
20477
+ /**
20478
+ * A single reward paired with its backend-provided logo.
20479
+ *
20480
+ * `id` is the reward's stable backend identifier ({@link ITokenizedVaultReward.id})
20481
+ * and is the key consumers should join on — it is unique even when two rewards
20482
+ * share a multiplier and text. `label` is display-only: it mirrors the
20483
+ * corresponding {@link IVaultRewards.additionalPoints} string (and so carries a
20484
+ * leading space when `multiplier === 1`, e.g. `" Cores"`), so it is fine to
20485
+ * print but must not be treated as a unique key.
20486
+ *
20487
+ * `imgUrl` is `null` when the backend has no logo for the reward, in which
20488
+ * case consumers fall back to a bundled asset.
20489
+ */
20490
+ export declare type IVaultRewardDetail = {
20491
+ id: string;
20492
+ label: string;
20493
+ text: string;
20494
+ imgUrl: string | null;
20495
+ multiplier: number;
20496
+ };
20497
+
20392
20498
  export declare type IVaultRewards = {
20393
20499
  points: string;
20394
20500
  multiplier: number;
@@ -20397,6 +20503,12 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
20397
20503
  timestamp: number;
20398
20504
  }[];
20399
20505
  additionalPoints: string[];
20506
+ /**
20507
+ * Optional so this addition is non-breaking for external code that
20508
+ * constructs an {@link IVaultRewards}. `getVaultRewards` always populates it;
20509
+ * readers should treat an absent value as an empty list.
20510
+ */
20511
+ additionalPointsDetailed?: IVaultRewardDetail[];
20400
20512
  };
20401
20513
 
20402
20514
  export declare interface IVaultStrategist {
@@ -21009,6 +21121,26 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
21009
21121
 
21010
21122
  export declare function loanStateToReadable(loanState: number | bigint): "PREAPPROVED" | "FUNDING_REQUIRED" | "FUNDED" | "ACTIVE" | "CANCELLED" | "MATURED" | "CLOSED";
21011
21123
 
21124
+ /**
21125
+ * Log a caught chain error at the severity its category warrants, without
21126
+ * swallowing it. When `isBenign` is `true` the failure is recorded as a `warn`
21127
+ * (a Sentry breadcrumb that rides along with the next real issue, not a billed
21128
+ * standalone issue); otherwise it is logged at `error` (a Sentry issue). The
21129
+ * caller is still responsible for re-throwing — this only routes telemetry.
21130
+ *
21131
+ * Pass the benign decision explicitly (via {@link isUserRejectionError} or
21132
+ * {@link isExpectedRevertError}) so the call site documents *why* the demotion
21133
+ * is safe and each path opts into only the category that applies to it.
21134
+ *
21135
+ * @param tag - Low-cardinality call-site label (e.g. `'deposit'`), used as the
21136
+ * Sentry breadcrumb/issue grouping key.
21137
+ * @param error - The caught value, of unknown type.
21138
+ * @param isBenign - `true` to demote to `warn`; `false` to keep at `error`.
21139
+ * @param context - Optional structured context attached to the log entry. It is
21140
+ * sanitized by the logger before transport.
21141
+ */
21142
+ export declare function logChainError(tag: string, error: unknown, isBenign: boolean, context?: Record<string, unknown>): void;
21143
+
21012
21144
  export declare const Logger: {
21013
21145
  setLogger: typeof setLogger;
21014
21146
  setStructuredLogger: typeof setStructuredLogger;
@@ -21145,10 +21277,10 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
21145
21277
  /**
21146
21278
  * Arrays
21147
21279
  */
21148
- export declare function orderObjArrByDate(objectArray: any[], options?: {
21280
+ export declare function orderObjArrByDate<T extends Record<string, unknown>>(objectArray: T[], options?: {
21149
21281
  key?: string;
21150
21282
  order?: 'asc' | 'desc';
21151
- }): any[];
21283
+ }): T[];
21152
21284
 
21153
21285
  /**
21154
21286
  * 32-byte origin codes registered on the `SwapRouter` via `addOrigin`.
@@ -21276,9 +21408,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
21276
21408
  * Execute multiple promises with retry logic and allow partial failures.
21277
21409
  * Unlike Promise.all, continues execution if some promises fail.
21278
21410
  * Failed promises return null to maintain array index alignment.
21279
- * @param promises Array of promises to execute
21280
- * @param maxRetries Maximum retry attempts per promise
21281
- * @param baseDelay Initial delay for exponential backoff
21411
+ * @param promises - Array of promises to execute
21412
+ * @param maxRetries - Maximum retry attempts per promise
21413
+ * @param baseDelay - Initial delay for exponential backoff
21282
21414
  * @returns Array of results with null for failed promises
21283
21415
  */
21284
21416
  export declare function promiseSettle<T>(promises: Promise<T>[], maxRetries?: number, baseDelay?: number): Promise<T[]>;
@@ -21330,24 +21462,24 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
21330
21462
  * expires: {expiry}
21331
21463
  * ```
21332
21464
  *
21333
- * @param userAddress EVM wallet address being registered. Must match the
21465
+ * @param userAddress - EVM wallet address being registered. Must match the
21334
21466
  * signer that produced `signature`. Lowercased before being embedded in
21335
21467
  * the canonical message.
21336
- * @param referrerAddress Optional EVM address that referred this user.
21468
+ * @param referrerAddress - Optional EVM address that referred this user.
21337
21469
  * Lowercased when embedded; the literal string `"none"` is used when
21338
21470
  * absent. Tampering with this field after signing produces 401.
21339
- * @param chainId Chain on which the wallet signed. For smart-contract wallets
21471
+ * @param chainId - Chain on which the wallet signed. For smart-contract wallets
21340
21472
  * (Safe etc.) this is the chain whose RPC the backend will use to run the
21341
21473
  * EIP-1271 `isValidSignature` check; for EOAs it still pins the signature
21342
21474
  * to a chain so it can't be replayed cross-chain. Must be one of the chains
21343
21475
  * Upshift supports (see backend `SUPPORTED_REGISTRATION_CHAINS`).
21344
- * @param signature `0x`-prefixed hex of the personal_sign signature over
21476
+ * @param signature - `0x`-prefixed hex of the personal_sign signature over
21345
21477
  * the canonical message. Single-use: replays within ~10 min are rejected.
21346
- * @param nonce Caller-generated random string (8–128 chars). Pair with
21478
+ * @param nonce - Caller-generated random string (8–128 chars). Pair with
21347
21479
  * `userAddress` to form the single-use key in the backend's nonce store.
21348
- * @param expiry Unix timestamp (seconds). Must be in the future and within
21480
+ * @param expiry - Unix timestamp (seconds). Must be in the future and within
21349
21481
  * the backend's TTL window (currently 10 min).
21350
- * @param options Request options (headers).
21482
+ * @param options - Request options (headers).
21351
21483
  * @returns Raw `Response` from the backend. 200 on success, 401 for
21352
21484
  * expired / replayed / mismatched-signer / tampered-referrer, 422 for an
21353
21485
  * unsupported `chainId`.
@@ -21417,12 +21549,13 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
21417
21549
  export declare const REWARD_DISTRIBUTOR_ADDRESS: (chainId: number) => string[];
21418
21550
 
21419
21551
  /**
21420
- * @function round formats any type number value to a standard
21552
+ * Formats any numeric value (number, string, or bigint) to a standardized string.
21421
21553
  *
21422
- * @param value amount to be formatted
21423
- * @param options.showing amount of decimals to cut off at
21424
- * @param options.usd if wanting to display USD value
21425
- * @param options.decimals if passing type bigint, how many decimals to parse to
21554
+ * @param value - amount to be formatted
21555
+ * @param options - formatting options:
21556
+ * `showing` is the number of decimals to cut off at (or `'all'`);
21557
+ * `usd` toggles USD-value display;
21558
+ * `decimals` is how many decimals to parse to when `value` is a bigint.
21426
21559
  *
21427
21560
  * @returns standardized string type value
21428
21561
  */
@@ -22275,7 +22408,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
22275
22408
  * call with no arguments) to clear the override and fall back to the
22276
22409
  * compiled-in `REQUEST_TIMEOUT_MS`.
22277
22410
  *
22278
- * @param ms Positive number of milliseconds to wait before aborting, or
22411
+ * @param ms - Positive number of milliseconds to wait before aborting, or
22279
22412
  * `null` to clear.
22280
22413
  */
22281
22414
  export declare function setSdkRequestTimeout(ms?: number | null): void;
@@ -22597,1109 +22730,1187 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
22597
22730
  */
22598
22731
  vaultRedeem(params: Omit<IStellarRedeemParams, 'network'>): Promise<string>;
22599
22732
  /**
22600
- * Submit a signed Soroban transaction and poll until confirmed.
22601
- * @returns Transaction hash on success
22602
- */
22603
- submitTransaction(signedXdr: string): Promise<string>;
22604
- /**
22605
- * Get user's vault share balance.
22733
+ * Submit a signed Soroban transaction and poll until the network confirms it.
22606
22734
  *
22607
- * @returns The position `{ shares, decimals, decimalsFromFallback }`, or null
22608
- * if the balance read fails. When `decimalsFromFallback` is `true` the
22609
- * `decimals()` read failed and `decimals` is the fallback (7) — callers sizing
22610
- * a redeem MUST refuse rather than trust it (see AUGUST-6381).
22611
- */
22612
- getUserPosition(vaultAddress: string, walletAddress: string): Promise<IStellarUserPosition | null>;
22613
- /**
22614
- * Preview how many vault shares a deposit amount would yield.
22615
- * @param vaultAddress Stellar contract ID (C… address)
22616
- * @param rawAmount Deposit amount in the deposit token's smallest unit
22617
- * @returns Raw share amount as a string, or null if query fails.
22618
- */
22619
- convertToShares(vaultAddress: string, rawAmount: string): Promise<string | null>;
22620
- }
22621
-
22622
- declare namespace StellarConstants {
22623
- export {
22624
- STELLAR_CHAIN_ID,
22625
- STELLAR_CHAIN,
22626
- SOROBAN_RPC_URLS,
22627
- NETWORK_PASSPHRASES,
22628
- STELLAR_FALLBACK_DECIMALS,
22629
- TX_TIMEOUT_SECONDS,
22630
- QUERY_TIMEOUT_SECONDS,
22631
- MAX_FEE_STROOPS,
22632
- POLL_INTERVAL_MS,
22633
- POLL_INTERVAL_MAX_MS,
22634
- POLL_INTERVAL_BACKOFF,
22635
- MAX_POLL_ATTEMPTS
22636
- }
22637
- }
22638
-
22639
- declare namespace StellarGetters {
22640
- export {
22641
- getStellarVault,
22642
- getStellarUserPosition,
22643
- convertToShares
22644
- }
22645
- }
22646
-
22647
- declare namespace StellarSubmit {
22648
- export {
22649
- submitStellarTransaction
22650
- }
22651
- }
22652
-
22653
- /**
22654
- * @deprecated
22655
- * Replaced by SUBGRAPH_VAULT_URLS which are subgraphs deployed on Goldsky.
22656
- */
22657
- export declare const SUBGRAPH_POOL_URLS: (apiKey: string, chainId?: number, pool?: IAddress) => {
22658
- 1: string;
22659
- 8453: string;
22660
- 43114: string;
22661
- 42161: string;
22662
- 56: string;
22663
- } | {
22664
- 999: string;
22665
- };
22666
-
22667
- /**
22668
- * Subgraph URLs
22669
- * @deprecated use getVaultMetadata to fetch subgraph URLs from the backend
22670
- */
22671
- export declare const SUBGRAPH_VAULT_URLS: Record<VaultSymbols, string>;
22672
-
22673
- /**
22674
- * Submit a signed Soroban transaction and poll until confirmed.
22675
- *
22676
- * @param signedXdr Base64-encoded XDR of the signed transaction
22677
- * @param network Stellar network name
22678
- * @returns Transaction hash on success
22679
- */
22680
- declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork): Promise<string>;
22681
-
22682
- /**
22683
- * Sui Adapter for August SDK
22684
- *
22685
- * @example
22686
- * To access the Sui adapter instance
22687
- * ```
22688
- * const sdk = new AugustSDK()
22689
- * sdk.sui.getEmberVaults()
22690
- * ```
22691
- */
22692
- declare class SuiAdapter {
22693
- private _apiBaseUrl;
22694
- private _chainId;
22695
- constructor(apiBaseUrl?: string, chainId?: number);
22696
- get apiBaseUrl(): string;
22697
- get chainId(): number;
22698
- getEmberVaults(options?: IFetchEmberVaultsOptions): Promise<IEmberVault[]>;
22699
- getEmberTVL(limit?: number): Promise<number>;
22700
- convertFromE9(value: string | number): number;
22701
- calculateUtilization(current: string | number, maximum: string | number): number;
22702
- isSuiAddress(address: string): boolean;
22703
- isSuiVault(chainId: number): boolean;
22704
- transformEmberVaultToIVault(emberVault: IEmberVault): IVault;
22705
- transformEmberVaultsToIVaults(emberVaults: IEmberVault[]): IVault[];
22706
- }
22707
-
22708
- /**
22709
- * Address of the `SwapRouter` periphery contract on each supported chain.
22710
- *
22711
- * Missing keys mean no SwapRouter is deployed on that chain — callers
22712
- * should fall back to legacy adapter paths.
22713
- *
22714
- * @see {@link getSwapRouterAddress} for the typed lookup helper.
22715
- */
22716
- export declare const SWAP_ROUTER_ADDRESSES: Readonly<Record<number, IAddress>>;
22717
-
22718
- /**
22719
- * Maximum number of swap legs the contract accepts in a single
22720
- * `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading
22721
- * the on-chain value at call time would add an RPC for no gain.
22722
- *
22723
- * Kept here so the SDK can reject oversize inputs at the boundary rather
22724
- * than wait for the on-chain `TooManySwaps` revert.
22725
- */
22726
- export declare const SWAP_ROUTER_MAX_SWAPS = 9;
22727
-
22728
- /**
22729
- * Wrapped-native ERC-20 per chain that has a SwapRouter deployment. Mirrors
22730
- * the on-chain `wrappedNativeTokenAddress()` view to avoid an extra RPC on
22731
- * every dispatch. Used to validate that native-token deposits target a
22732
- * vault whose reference asset is the wrapped native — the only configuration
22733
- * the contract's `depositNativeToken` / `swapAndDepositNativeToken` accept.
22734
- */
22735
- export declare const SWAP_ROUTER_WRAPPED_NATIVE: Readonly<Record<number, IAddress>>;
22736
-
22737
- /**
22738
- * Swap one or more whitelisted ERC-20s into a vault's reference asset via
22739
- * the on-chain SwapRouter, then deposit the proceeds into the vault.
22740
- *
22741
- * Approval is sent automatically when the caller's allowance on each
22742
- * `swaps[i].tokenIn` against the SwapRouter is below `amountIn`.
22743
- *
22744
- * @param signer - ethers `Signer` or `Wallet` with the EOA that holds the input tokens.
22745
- * @param options - {@link ISwapAndDepositOptions}.
22746
- * @returns The transaction hash of the `swapAndDeposit` call.
22747
- *
22748
- * @throws {@link AugustValidationError} for unsupported chains, invalid
22749
- * addresses, empty/oversized swap arrays.
22750
- * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
22751
- *
22752
- * @example
22753
- * ```ts
22754
- * const quote = await fetchSwapQuote({
22755
- * chainId: 1,
22756
- * srcToken: WBTC,
22757
- * srcDecimals: 8,
22758
- * destToken: USDC,
22759
- * destDecimals: 6,
22760
- * amount: 100_000_000n,
22761
- * receiver: SWAP_ROUTER_ADDRESSES[1]!,
22762
- * });
22763
- * const hash = await swapAndDeposit(signer, {
22764
- * chainId: 1,
22765
- * vault: '0x8AcA0841993ef4C87244d519166e767f49362C21',
22766
- * receiver: wallet,
22767
- * swaps: [{
22768
- * tokenIn: WBTC,
22769
- * tokenOut: USDC,
22770
- * amountIn: 100_000_000n,
22771
- * minAmountOut: quote.minAmountOut,
22772
- * router: quote.router,
22773
- * payload: quote.payload,
22774
- * }],
22775
- * });
22776
- * ```
22777
- */
22778
- export declare function swapAndDeposit(signer: Signer | Wallet, options: ISwapAndDepositOptions): Promise<string>;
22779
-
22780
- /**
22781
- * Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
22782
- * the ERC-4626 (`deposit(uint256, address)`) and multi-asset
22783
- * (`deposit(address, uint256, address)`) deposit interfaces.
22784
- *
22785
- * Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
22786
- * constants exactly. Set by an admin per-vault via `enableVault` and looked
22787
- * up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
22788
- * this — the router resolves it internally.
22789
- */
22790
- export declare enum SwapRouterVaultType {
22791
- ERC4626 = 1,
22792
- TokenizedVaultV2 = 2
22793
- }
22794
-
22795
- /**
22796
- * Table of Contents
22797
- * - Formatters
22798
- * - Datetime
22799
- * - Arrays
22800
- * - Caching
22801
- */
22802
- export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
22803
-
22804
- /**
22805
- * Formatters
22806
- */
22807
- export declare function toTitleCase(str: string, type?: 'camel'): string;
22808
-
22809
- /**
22810
- * Track API response times and status.
22811
- *
22812
- * @param endpoint - The API endpoint called
22813
- * @param method - HTTP method used
22814
- * @param startTime - Start timestamp from performance.now()
22815
- * @param status - HTTP response status code (0 for network errors)
22816
- * @param server - Server identifier (production, staging, etc.)
22817
- */
22818
- export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
22819
-
22820
- /**
22821
- * Track chain/network switches for usage distribution analysis.
22822
- *
22823
- * @param chainId - The chain ID being switched to
22824
- */
22825
- export declare function trackNetworkSwitch(chainId: number): void;
22826
-
22827
- export declare function truncate(s: string, amount?: number): string;
22828
-
22829
- /* Excluded from this release type: tryRecoverTxHash */
22830
-
22831
- /**
22832
- * Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
22833
- * Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
22834
- * checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
22835
- * would throw). Add an address here to drop its `latest_reported_tvl` from
22836
- * the headline number — e.g. closed pre-deposit vaults, test vaults, or
22837
- * migrated v1 pools that are double-counted by a v2 successor.
22838
- */
22839
- export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
22840
-
22841
- /**
22842
- * Validity window for a submitted Soroban invocation (seconds).
22843
- *
22844
- * This becomes the transaction's `maxTime`. Validators reject a tx whose
22845
- * `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
22846
- * realistic sign-then-submit path: hardware wallets, careful manual review,
22847
- * and institutional approval flows (e.g. Fordefi) that don't sign instantly.
22848
- * 10 minutes comfortably covers those while staying well inside the Soroban
22849
- * footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
22850
- *
22851
- * The window is anchored to the *network* clock (see `getNetworkCloseTime` in
22852
- * soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
22853
- * make the deadline expire early.
22854
- */
22855
- declare const TX_TIMEOUT_SECONDS = 600;
22856
-
22857
- export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
22858
- [Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
22859
- } & {
22860
- /**
22861
- * Return the function for a given name. This is useful when a contract
22862
- * method name conflicts with a JavaScript name such as ``prototype`` or
22863
- * when using a Contract programatically.
22864
- */
22865
- getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
22866
- /**
22867
- * Return the event for a given name. This is useful when a contract
22868
- * event name conflicts with a JavaScript name such as ``prototype`` or
22869
- * when using a Contract programatically.
22870
- */
22871
- getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
22872
- /**
22873
- * All the Events available on this contract.
22874
- */
22875
- filters: {
22876
- [EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
22877
- };
22878
- };
22879
-
22880
- 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']>>>> {
22881
- (...args: [...TEventArgs]): DeferredTopicFilter;
22882
- /**
22883
- * The name of the Contract event.
22884
- */
22885
- name: TEventName;
22886
- /**
22887
- * The fragment of the Contract event. This will throw on ambiguous
22888
- * method names.
22889
- */
22890
- fragment: EventFragment;
22891
- /**
22892
- * Returns the fragment constrained by %%args%%. This can be used to
22893
- * resolve ambiguous event names.
22894
- */
22895
- getFragment(...args: [...TEventArgs]): EventFragment;
22896
- }
22897
-
22898
- 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>> {
22899
- (...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
22900
- /**
22901
- * The name of the Contract method.
22902
- */
22903
- name: TFunctionName;
22904
- /**
22905
- * The fragment of the Contract method. This will throw on ambiguous
22906
- * method names.
22907
- */
22908
- fragment: TFragment;
22909
- /**
22910
- * Returns the fragment constrained by %%args%%. This can be used to
22911
- * resolve ambiguous method names.
22912
- */
22913
- getFragment(...args: [...TInputArgs]): TFragment;
22914
- /**
22915
- * Returns a populated transaction that can be used to perform the
22916
- * contract method with %%args%%.
22917
- */
22918
- populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
22735
+ * Submits on the network this adapter was constructed with, so `signedXdr`
22736
+ * must be signed for that same network.
22737
+ *
22738
+ * @param signedXdr - Base64-encoded XDR of the signed transaction.
22739
+ * @returns The transaction hash once the network confirms it as successful.
22740
+ * @throws {@link AugustTimeoutError} when the transaction is not confirmed
22741
+ * within the poll budget (`MAX_POLL_ATTEMPTS`).
22742
+ * @throws {@link AugustSDKError} when the RPC rejects the submission or the
22743
+ * transaction confirms as failed. Its `context` carries `{ network, status }`
22744
+ * plus, when the result XDR decodes, a `resultCode` string holding the
22745
+ * transaction-level reason (e.g. `"txBadSeq"`, `"txTooLate"`); `resultCode`
22746
+ * is `undefined` when the code cannot be decoded.
22747
+ * @example
22748
+ * ```ts
22749
+ * try {
22750
+ * const hash = await adapter.submitTransaction(signedXdr);
22751
+ * } catch (err) {
22752
+ * if (err instanceof AugustSDKError && err.context?.resultCode === 'txBadSeq') {
22753
+ * // stale sequence number — rebuild the transaction and resubmit
22754
+ * }
22755
+ * }
22756
+ * ```
22757
+ */
22758
+ submitTransaction(signedXdr: string): Promise<string>;
22919
22759
  /**
22920
- * Call the contract method with %%args%% and return the value.
22760
+ * Get user's vault share balance.
22921
22761
  *
22922
- * If the return value is a single type, it will be dereferenced and
22923
- * returned directly, otherwise the full Result will be returned.
22762
+ * @returns The position `{ shares, decimals, decimalsFromFallback }`, or null
22763
+ * if the balance read fails. When `decimalsFromFallback` is `true` the
22764
+ * `decimals()` read failed and `decimals` is the fallback (7) — callers sizing
22765
+ * a redeem MUST refuse rather than trust it (see AUGUST-6381).
22924
22766
  */
22925
- staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
22767
+ getUserPosition(vaultAddress: string, walletAddress: string): Promise<IStellarUserPosition | null>;
22926
22768
  /**
22927
- * Send a transaction for the contract method with %%args%%.
22769
+ * Preview how many vault shares a deposit amount would yield.
22770
+ * @param vaultAddress Stellar contract ID (C… address)
22771
+ * @param rawAmount Deposit amount in the deposit token's smallest unit
22772
+ * @returns Raw share amount as a string, or null if query fails.
22928
22773
  */
22929
- send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
22930
- /**
22931
- * Estimate the gas to send the contract method with %%args%%.
22932
- */
22933
- estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
22934
- /**
22935
- * Call the contract method with %%args%% and return the Result
22936
- * without any dereferencing.
22937
- */
22938
- staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
22774
+ convertToShares(vaultAddress: string, rawAmount: string): Promise<string | null>;
22939
22775
  }
22940
22776
 
22941
- 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;
22942
-
22943
- export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
22944
- name: TFunction['name'];
22945
- type: TFunction['type'];
22946
- inputs: TFunction['inputs'];
22947
- outputs: TFunction['outputs'];
22948
- stateMutability: TFunction['stateMutability'];
22949
- };
22950
-
22951
- export declare function unixToDate(epoch: number): Date;
22952
-
22953
- /**
22954
- * Update the current user identity in Sentry.
22955
- * Called when wallet address changes.
22956
- *
22957
- * @param walletAddress - New wallet address (or undefined to clear)
22958
- * @param environment - Current environment
22959
- */
22960
- export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
22961
-
22962
- /* Excluded from this release type: validateAmountPrecision */
22963
-
22964
- /**
22965
- * Vault adapter configurations mapping vault addresses to their adapter settings
22966
- */
22967
- export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
22968
-
22969
- 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}`>;
22970
-
22971
- /**
22972
- * Hardcoded subaccount addresses for specific vaults allocations
22973
- */
22974
- export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
22975
- AgoraAUSD: {
22976
- address: IAddress;
22977
- subaccount: IAddress;
22978
- useDebank: boolean;
22979
- };
22980
- earnAUSD: {
22981
- address: IAddress;
22982
- subaccount: IAddress;
22983
- useDebank: boolean;
22984
- };
22985
- };
22986
-
22987
- /**
22988
- * The functions to call on the vault contract
22989
- * @returns The functions to call
22990
- */
22991
- export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
22992
-
22993
- export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
22994
-
22995
- export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
22996
-
22997
- export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
22998
-
22999
- /**
23000
- * Vault Symbols Mapping
23001
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23002
- */
23003
- export declare const VAULT_SYMBOLS: Record<IAddress, string>;
23004
-
23005
- /**
23006
- * Vault Symbols Reverse Mapping
23007
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23008
- */
23009
- export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
23010
-
23011
- /**
23012
- * Address type for vault contracts across all supported chains.
23013
- * EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
23014
- * and Stellar vaults use 56-character base32 addresses (G/C prefix).
23015
- *
23016
- * Use this instead of `IAddress` when the address may belong to any chain.
23017
- */
23018
- export declare type VaultAddress = string;
23019
-
23020
- /**
23021
- * allowance checks user's current allowance per pool
23022
- * @param signer - signer / provider object
23023
- * @param options - object including pool contract address, user wallet address
23024
- * @returns normalized number object of the user's current allowance
23025
- */
23026
- export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
23027
-
23028
- /**
23029
- * Approve a vault (or the appropriate adapter wrapper) to spend a token
23030
- * ahead of a separate deposit call. Spender routing mirrors
23031
- * {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
23032
- * vault). Returns `undefined` when the existing allowance already covers
23033
- * `amount` **or** when the deposit asset is native.
23034
- *
23035
- * @returns Transaction hash when an approval was sent, `undefined` when
23036
- * the existing allowance already covers `amount` or the deposit asset is
23037
- * native (no ERC-20 allowance applies). Use {@link approve} for a
23038
- * discriminated `ApproveResult` if you need to tell those two cases apart.
23039
- * @throws AugustValidationError on invalid wallet/target/amount.
23040
- *
23041
- * @example
23042
- * ```ts
23043
- * const hash = await augustSdk.evm.vaultApprove({
23044
- * target: '0x...', // vault contract address
23045
- * wallet: walletAddress,
23046
- * amount: '100', // 100 of the deposit token (UI units)
23047
- * wait: true, // wait for the approval to confirm
23048
- * });
23049
- * if (hash) console.log('approve tx', hash);
23050
- * // hash === undefined means the on-chain allowance already covers the
23051
- * // amount, or the deposit asset is native (msg.value, no allowance).
23052
- * ```
23053
- */
23054
- export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
23055
-
23056
- /**
23057
- * Deposit underlying token into the specified vault. Auto-routes to the
23058
- * correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
23059
- * Paraswap adapter, native-token wrapper, depositWithPermit) based on the
23060
- * vault version and `depositAsset`.
23061
- *
23062
- * Amounts are encoded against the **deposit token's** decimals, not the
23063
- * vault's share decimals. The SDK reads the appropriate decimals via the
23064
- * vault metadata and the asset's ERC-20.
23065
- *
23066
- * Approval is handled automatically: if the existing allowance doesn't
23067
- * cover `amount`, an `approve` is sent and **always waited for** (regardless
23068
- * of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
23069
- * of the approval on Monad-style RPCs.
23070
- *
23071
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23072
- * @param options Vault address, wallet, amount, optional `depositAsset` for
23073
- * adapter routes, optional `wait` to wait for the deposit receipt.
23074
- * @returns Deposit transaction hash.
23075
- * @throws AugustValidationError on invalid wallet/target/amount or missing
23076
- * adapter config when `depositAsset` differs from the vault underlying.
23077
- * @throws AugustSDKError when the deposit submission or on-chain call fails.
23078
- *
23079
- * @example
23080
- * ```ts
23081
- * const hash = await augustSdk.evm.vaultDeposit({
23082
- * target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
23083
- * wallet: walletAddress,
23084
- * amount: '100', // 100 USDC (UI units)
23085
- * wait: true, // wait for the deposit receipt
23086
- * });
23087
- * ```
23088
- *
23089
- * @example Adapter deposit (different deposit asset than the vault's underlying)
23090
- * ```ts
23091
- * await augustSdk.evm.vaultDeposit({
23092
- * target: vaultAddress,
23093
- * wallet: walletAddress,
23094
- * amount: '0.5',
23095
- * depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
23096
- * chainId: 1,
23097
- * });
23098
- * ```
23099
- */
23100
- export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23101
-
23102
- /**
23103
- * Check if vault has adapter support
23104
- */
23105
- export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
23106
-
23107
- declare const vaultIdl: {
23108
- address: string;
23109
- metadata: {
23110
- name: string;
23111
- version: string;
23112
- spec: string;
23113
- description: string;
23114
- };
23115
- instructions: ({
23116
- name: string;
23117
- docs: string[];
23118
- discriminator: number[];
23119
- accounts: ({
23120
- name: string;
23121
- writable: boolean;
23122
- pda: {
23123
- seeds: {
23124
- kind: string;
23125
- value: number[];
23126
- }[];
23127
- };
23128
- signer?: undefined;
23129
- address?: undefined;
23130
- } | {
23131
- name: string;
23132
- signer: boolean;
23133
- writable?: undefined;
23134
- pda?: undefined;
23135
- address?: undefined;
23136
- } | {
23137
- name: string;
23138
- writable: boolean;
23139
- pda?: undefined;
23140
- signer?: undefined;
23141
- address?: undefined;
23142
- } | {
23143
- name: string;
23144
- address: string;
23145
- writable?: undefined;
23146
- pda?: undefined;
23147
- signer?: undefined;
23148
- })[];
23149
- args: any[];
23150
- } | {
23151
- name: string;
23152
- docs: string[];
23153
- discriminator: number[];
23154
- accounts: ({
23155
- name: string;
23156
- writable: boolean;
23157
- signer: boolean;
23158
- docs?: undefined;
23159
- pda?: undefined;
23160
- address?: undefined;
23161
- } | {
23162
- name: string;
23163
- docs: string[];
23164
- writable: boolean;
23165
- signer: boolean;
23166
- pda?: undefined;
23167
- address?: undefined;
23168
- } | {
23169
- name: string;
23170
- docs: string[];
23171
- writable: boolean;
23172
- pda: {
23173
- seeds: {
23174
- kind: string;
23175
- value: number[];
23176
- }[];
23177
- program?: undefined;
23178
- };
23179
- signer?: undefined;
23180
- address?: undefined;
23181
- } | {
23182
- name: string;
23183
- docs: string[];
23184
- writable: boolean;
23185
- signer?: undefined;
23186
- pda?: undefined;
23187
- address?: undefined;
23188
- } | {
23189
- name: string;
23190
- writable: boolean;
23191
- pda: {
23192
- seeds: ({
23193
- kind: string;
23194
- value: number[];
23195
- path?: undefined;
23196
- } | {
23197
- kind: string;
23198
- path: string;
23199
- value?: undefined;
23200
- })[];
23201
- program: {
23202
- kind: string;
23203
- value: number[];
23204
- };
23205
- };
23206
- signer?: undefined;
23207
- docs?: undefined;
23208
- address?: undefined;
23209
- } | {
23210
- name: string;
23211
- address: string;
23212
- writable?: undefined;
23213
- signer?: undefined;
23214
- docs?: undefined;
23215
- pda?: undefined;
23216
- })[];
23217
- args: {
23218
- name: string;
23219
- type: string;
23220
- }[];
23221
- } | {
23222
- name: string;
23223
- docs: string[];
23224
- discriminator: number[];
23225
- accounts: ({
23226
- name: string;
23227
- writable: boolean;
23228
- pda: {
23229
- seeds: ({
23230
- kind: string;
23231
- value: number[];
23232
- path?: undefined;
23233
- } | {
23234
- kind: string;
23235
- path: string;
23236
- value?: undefined;
23237
- })[];
23238
- };
23239
- signer?: undefined;
23240
- } | {
23241
- name: string;
23242
- writable: boolean;
23243
- pda?: undefined;
23244
- signer?: undefined;
23245
- } | {
23246
- name: string;
23247
- writable: boolean;
23248
- signer: boolean;
23249
- pda?: undefined;
23250
- } | {
23251
- name: string;
23252
- writable?: undefined;
23253
- pda?: undefined;
23254
- signer?: undefined;
23255
- })[];
23256
- args: {
23257
- name: string;
23258
- type: string;
23259
- }[];
23260
- } | {
23261
- name: string;
23262
- docs: string[];
23263
- discriminator: number[];
23264
- accounts: ({
23265
- name: string;
23266
- writable: boolean;
23267
- pda: {
23268
- seeds: ({
23269
- kind: string;
23270
- value: number[];
23271
- path?: undefined;
23272
- } | {
23273
- kind: string;
23274
- path: string;
23275
- value?: undefined;
23276
- })[];
23277
- };
23278
- signer?: undefined;
23279
- address?: undefined;
23280
- } | {
23281
- name: string;
23282
- writable?: undefined;
23283
- pda?: undefined;
23284
- signer?: undefined;
23285
- address?: undefined;
23286
- } | {
23287
- name: string;
23288
- writable: boolean;
23289
- signer: boolean;
23290
- pda?: undefined;
23291
- address?: undefined;
23292
- } | {
23293
- name: string;
23294
- address: string;
23295
- writable?: undefined;
23296
- pda?: undefined;
23297
- signer?: undefined;
23298
- })[];
23299
- args: {
23300
- name: string;
23301
- type: string;
23302
- }[];
23303
- } | {
23304
- name: string;
23305
- docs: string[];
23306
- discriminator: number[];
23307
- accounts: ({
23308
- name: string;
23309
- writable: boolean;
23310
- pda: {
23311
- seeds: {
23312
- kind: string;
23313
- value: number[];
23314
- }[];
23315
- };
23316
- signer?: undefined;
23317
- address?: undefined;
23318
- } | {
23319
- name: string;
23320
- signer: boolean;
23321
- writable?: undefined;
23322
- pda?: undefined;
23323
- address?: undefined;
23324
- } | {
23325
- name: string;
23326
- writable: boolean;
23327
- signer: boolean;
23328
- pda?: undefined;
23329
- address?: undefined;
23330
- } | {
23331
- name: string;
23332
- address: string;
23333
- writable?: undefined;
23334
- pda?: undefined;
23335
- signer?: undefined;
23336
- })[];
23337
- args: {
23338
- name: string;
23339
- type: string;
23340
- }[];
23341
- } | {
23342
- name: string;
23343
- docs: string[];
23344
- discriminator: number[];
23345
- accounts: ({
23346
- name: string;
23347
- writable: boolean;
23348
- pda: {
23349
- seeds: ({
23350
- kind: string;
23351
- value: number[];
23352
- path?: undefined;
23353
- } | {
23354
- kind: string;
23355
- path: string;
23356
- value?: undefined;
23357
- })[];
23358
- program?: undefined;
23359
- };
23360
- signer?: undefined;
23361
- } | {
23362
- name: string;
23363
- writable: boolean;
23364
- pda: {
23365
- seeds: ({
23366
- kind: string;
23367
- path: string;
23368
- value?: undefined;
23369
- } | {
23370
- kind: string;
23371
- value: number[];
23372
- path?: undefined;
23373
- })[];
23374
- program: {
23375
- kind: string;
23376
- value: number[];
23377
- };
23378
- };
23379
- signer?: undefined;
23380
- } | {
23381
- name: string;
23382
- writable: boolean;
23383
- pda?: undefined;
23384
- signer?: undefined;
23385
- } | {
23386
- name: string;
23387
- signer: boolean;
23388
- writable?: undefined;
23389
- pda?: undefined;
23390
- } | {
23391
- name: string;
23392
- writable?: undefined;
23393
- pda?: undefined;
23394
- signer?: undefined;
23395
- })[];
23396
- args: {
23397
- name: string;
23398
- type: string;
23399
- }[];
23400
- })[];
23401
- accounts: {
23402
- name: string;
23403
- discriminator: number[];
23404
- }[];
23405
- events: {
23406
- name: string;
23407
- discriminator: number[];
23408
- }[];
23409
- errors: {
23410
- code: number;
23411
- name: string;
23412
- msg: string;
23413
- }[];
23414
- types: ({
23415
- name: string;
23416
- serialization: string;
23417
- repr: {
23418
- kind: string;
23419
- };
23420
- type: {
23421
- kind: string;
23422
- fields: {
23423
- name: string;
23424
- type: string;
23425
- }[];
23426
- };
23427
- } | {
23428
- name: string;
23429
- type: {
23430
- kind: string;
23431
- fields: ({
23432
- name: string;
23433
- type: string;
23434
- } | {
23435
- name: string;
23436
- type: {
23437
- array: (string | number)[];
23438
- };
23439
- })[];
23440
- };
23441
- serialization?: undefined;
23442
- repr?: undefined;
23443
- })[];
23444
- };
23445
-
23446
- /**
23447
- * @TODO
23448
- * @description withdraw funds from the specified pool including accrued rewards
23449
- * @param signer signer / wallet object
23450
- * @param options object including pool contract address, user wallet address, and more
23451
- * @returns claim tx hash
23452
- */
23453
- export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
23454
- year: string;
23455
- month: string;
23456
- day: string;
23457
- receiverIndex: string;
23458
- }): Promise<string>;
23459
-
23460
- export declare enum VaultRedemptionStatus {
23461
- AWAITING_COOLDOWN = "awaiting_cooldown",
23462
- READY_TO_CLAIM = "ready_to_claim"
22777
+ declare namespace StellarConstants {
22778
+ export {
22779
+ STELLAR_CHAIN_ID,
22780
+ STELLAR_CHAIN,
22781
+ SOROBAN_RPC_URLS,
22782
+ NETWORK_PASSPHRASES,
22783
+ STELLAR_FALLBACK_DECIMALS,
22784
+ TX_TIMEOUT_SECONDS,
22785
+ QUERY_TIMEOUT_SECONDS,
22786
+ MAX_FEE_STROOPS,
22787
+ POLL_INTERVAL_MS,
22788
+ POLL_INTERVAL_MAX_MS,
22789
+ POLL_INTERVAL_BACKOFF,
22790
+ MAX_POLL_ATTEMPTS
22791
+ }
23463
22792
  }
23464
22793
 
23465
- /**
23466
- * Request to redeem vault shares. For EVM-1 vaults this queues a standard
23467
- * redemption (claimable later via `vaultRedeem`); for EVM-2 vaults this
23468
- * also handles the receipt-token allowance automatically. Pass
23469
- * `isInstantRedeem: true` for vaults that support instant settlement.
23470
- *
23471
- * Approval of the receipt token (EVM-2) is always waited on before the
23472
- * redeem call, regardless of the caller's `wait` flag.
23473
- *
23474
- * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23475
- * @param options Vault address, wallet, amount, optional `isInstantRedeem`,
23476
- * optional `wait` to wait for the redeem receipt.
23477
- * @returns Redeem transaction hash.
23478
- * @throws AugustValidationError on invalid wallet/target/amount.
23479
- * @throws AugustSDKError when the redeem submission or on-chain call fails.
23480
- *
23481
- * @example
23482
- * ```ts
23483
- * const hash = await augustSdk.evm.vaultRequestRedeem({
23484
- * target: vaultAddress,
23485
- * wallet: walletAddress,
23486
- * amount: '10', // 10 shares (UI units)
23487
- * wait: true,
23488
- * });
23489
- * ```
23490
- *
23491
- * @example Instant redemption
23492
- * ```ts
23493
- * await augustSdk.evm.vaultRequestRedeem({
23494
- * target: vaultAddress,
23495
- * wallet: walletAddress,
23496
- * amount: '10',
23497
- * isInstantRedeem: true,
23498
- * });
23499
- * ```
23500
- */
23501
- export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23502
-
23503
- /**
23504
- * Vault addresses registered on a `SwapRouter` via `enableVault`. The
23505
- * presence of a vault here is the signal to route its deposits through the
23506
- * SwapRouter rather than the legacy adapter path.
23507
- *
23508
- * Entries mirror the on-chain `vaultInfo[addr].referenceAsset != 0` state of
23509
- * the `SwapRouter` deployment. Verify against the deployed contract before
23510
- * adding a new entry — a vault that is not registered on-chain will revert
23511
- * with `InvalidVault` at deposit time.
23512
- *
23513
- * Lowercase comparison is required when checking — use
23514
- * {@link vaultUsesSwapRouter} rather than reading this set directly.
23515
- */
23516
- export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
23517
-
23518
- /**
23519
- * Vault Receipt Symbol Mapping
23520
- * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23521
- */
23522
- 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';
23523
-
23524
- /**
23525
- * Whether a vault has been registered on a `SwapRouter` and should route
23526
- * its deposits through it. Address comparison is case-insensitive.
23527
- *
23528
- * @param vaultAddress - August vault address.
23529
- * @returns `true` when the vault is in {@link VAULTS_USING_SWAP_ROUTER}.
23530
- */
23531
- export declare function vaultUsesSwapRouter(vaultAddress: IAddress): boolean;
23532
-
23533
- export declare function verifyAugustKey(key: string): Promise<boolean>;
23534
-
23535
- export declare function verifyInfuraKey(key: string): Promise<boolean>;
23536
-
23537
- /**
23538
- * Convert a viem WalletClient to an ethers-compatible Signer
23539
- * Uses the walletClient as a provider and wraps it for ethers compatibility
23540
- * @param walletClient Viem WalletClient from wagmi or viem
23541
- * @returns Ethers Signer that can be used with the SDK
23542
- */
23543
- export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
23544
-
23545
- /**
23546
- * @param walletClient a wagmi-derived client (from useWalletClient)
23547
- * @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
23548
- */
23549
- export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
23550
-
23551
- export declare const WEBSERVER_ENDPOINTS: {
23552
- default: {
23553
- hello: string;
23554
- protected: string;
23555
- };
23556
- auth: {
23557
- verify: string;
23558
- sign: string;
23559
- login: string;
23560
- nonce: string;
23561
- refresh: string;
23562
- };
23563
- subaccount: {
23564
- rewards: (subaccount: IAddress) => string;
23565
- tokens: (subaccount: IAddress) => string;
23566
- twap: {
23567
- create: (subaccount: IAddress) => string;
23568
- stop: (subaccount: IAddress, id: string) => string;
23569
- fills: (subaccount: IAddress, id: string) => string;
23570
- };
23571
- debank: (subaccount: IAddress) => string;
23572
- health_factor: (subaccount: IAddress) => string;
23573
- summary: (subaccount: IAddress) => string;
23574
- batch: (subaccount: IAddress) => string;
23575
- loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
23576
- cefi: (subaccount: IAddress) => string;
23577
- otc_positions: (subaccount: IAddress) => string;
23578
- _: (subaccount: IAddress) => string;
23579
- };
23580
- users: {
23581
- get: string;
23582
- };
23583
- prices: (symbol: string) => string;
23584
- metrics: {
23585
- pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
23586
- };
23587
- public: {
23588
- integrations: {
23589
- morpho: {
23590
- apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
23591
- };
23592
- };
23593
- tokenizedVault: {
23594
- loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
23595
- subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
23596
- list: string;
23597
- byVaultAddress: (vaultAddress: VaultAddress) => string;
23598
- historicalApy: (vaultAddress: IAddress) => string;
23599
- historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
23600
- annualizedApy: (vaultAddress: IAddress) => string;
23601
- summary: (vaultAddress: IAddress) => string;
23602
- withdrawals: (chain: string, vaultAddress: IAddress) => string;
23603
- debank: (vaultAddress: IAddress) => string;
23604
- };
23605
- points: {
23606
- byUserAddress: (userAddress: IAddress) => string;
23607
- register: string;
23608
- leaderboard: string;
23609
- };
23610
- vaults: {
23611
- pendingRedemptions: (vaultAddress: IAddress) => string;
23612
- };
23613
- pnl: {
23614
- unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
23615
- unrealizedLatest: string;
23616
- };
23617
- };
23618
- upshift: {
23619
- vaults: {
23620
- metadata: string;
23621
- };
23622
- };
23623
- };
23624
-
23625
- export declare const WEBSERVER_URL: {
23626
- production: string;
23627
- staging: string;
23628
- development: string;
23629
- localhost: string;
23630
- qa: string;
23631
- public: string;
23632
- upshift: string;
23633
- };
22794
+ declare namespace StellarGetters {
22795
+ export {
22796
+ getStellarVault,
22797
+ getStellarUserPosition,
22798
+ convertToShares
22799
+ }
22800
+ }
23634
22801
 
23635
- /**
23636
- * Withdrawal request with computed claimable date and current processing status.
23637
- * The unique identifier is (receiver, claimableDate).
23638
- *
23639
- * @interface WithdrawalRequestStatus
23640
- */
23641
- export declare interface WithdrawalRequestStatus {
23642
- /** Transaction hash of the withdrawal request */
23643
- transactionHash: string;
23644
- /** Block timestamp when the withdrawal was requested (seconds, UTC) */
23645
- requestTimestamp: number;
23646
- /** Shares amount being redeemed */
23647
- shares: bigint;
23648
- /** Receiver address for the withdrawal */
23649
- receiver: string;
23650
- /** Computed claimable date in UTC (year, month, day) */
23651
- claimableDate: {
23652
- year: number;
23653
- month: number;
23654
- day: number;
23655
- };
23656
- /** Epoch timestamp when this withdrawal becomes claimable */
23657
- claimableEpoch: number;
23658
- /** Current status of the withdrawal */
23659
- status: 'pending' | 'ready_to_claim' | 'processed';
23660
- /** Transaction hash of the processing transaction (if processed) */
23661
- processedTransactionHash?: string;
23662
- /** Assets received (if processed) */
23663
- assetsReceived?: bigint;
22802
+ declare namespace StellarSubmit {
22803
+ export {
22804
+ submitStellarTransaction
22805
+ }
23664
22806
  }
23665
22807
 
23666
22808
  /**
23667
- * Higher-order function to wrap SDK methods with performance tracking.
23668
- * Tracks method calls, timing, chain usage, and errors.
23669
- *
23670
- * @param methodName - Name of the method being wrapped
23671
- * @param method - The original async method
23672
- * @param getChainId - Function to get current chain ID
23673
- * @returns Wrapped method with tracking
22809
+ * @deprecated
22810
+ * Replaced by SUBGRAPH_VAULT_URLS which are subgraphs deployed on Goldsky.
23674
22811
  */
23675
- export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
22812
+ export declare const SUBGRAPH_POOL_URLS: (apiKey: string, chainId?: number, pool?: IAddress) => {
22813
+ 1: string;
22814
+ 8453: string;
22815
+ 43114: string;
22816
+ 42161: string;
22817
+ 56: string;
22818
+ } | {
22819
+ 999: string;
22820
+ };
23676
22821
 
23677
22822
  /**
23678
- * Wrap async operations with exponential backoff retry logic.
23679
- * Retries on network errors with increasing delays between attempts.
23680
- * @param fn Async function to execute with retry logic
23681
- * @param maxRetries Maximum number of retry attempts
23682
- * @param baseDelay Initial delay in milliseconds (doubles each retry)
23683
- * @param shouldRetry Custom function to determine if error is retryable
23684
- * @returns Result of successful function execution
23685
- * @throws Last error if all retries exhausted
22823
+ * Subgraph URLs
22824
+ * @deprecated use getVaultMetadata to fetch subgraph URLs from the backend
23686
22825
  */
23687
- export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
22826
+ export declare const SUBGRAPH_VAULT_URLS: Record<VaultSymbols, string>;
23688
22827
 
23689
22828
  /**
23690
- * Higher-order function to wrap synchronous SDK methods with tracking.
23691
- * Uses breadcrumbs for tracking since spans require async context.
22829
+ * Submit a signed Soroban transaction and poll until confirmed.
23692
22830
  *
23693
- * @param methodName - Name of the method being wrapped
23694
- * @param method - The original sync method
23695
- * @param getChainId - Function to get current chain ID
23696
- * @returns Wrapped method with tracking
23697
- */
23698
- export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
23699
-
23700
- export declare const WRAPPER_ADAPTOR: {
23701
- 43114: IAddress;
23702
- 1: IAddress;
23703
- };
23704
-
23705
- export { }
22831
+ * @param signedXdr - Base64-encoded XDR of the signed transaction
22832
+ * @param network - Stellar network name
22833
+ * @returns The transaction hash once the network confirms it as successful
22834
+ * @throws {@link AugustTimeoutError} when the transaction is not confirmed
22835
+ * within the poll budget (`MAX_POLL_ATTEMPTS`).
22836
+ * @throws {@link AugustSDKError} when the RPC rejects the submission or the
22837
+ * transaction confirms as failed. Its `context` carries `{ network, status }`
22838
+ * plus, when the result XDR decodes, a `resultCode` string holding the
22839
+ * transaction-level reason (e.g. `"txBadSeq"`, `"txTooLate"`); `resultCode`
22840
+ * is `undefined` when the code cannot be decoded.
22841
+ * @example
22842
+ * ```ts
22843
+ * try {
22844
+ * const hash = await submitStellarTransaction(signedXdr, 'mainnet');
22845
+ * } catch (err) {
22846
+ * if (err instanceof AugustSDKError && err.context?.resultCode === 'txBadSeq') {
22847
+ * // stale sequence number — rebuild the transaction and resubmit
22848
+ * }
22849
+ * }
22850
+ * ```
22851
+ */
22852
+ declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork): Promise<string>;
22853
+
22854
+ /**
22855
+ * Sui Adapter for August SDK
22856
+ *
22857
+ * @example
22858
+ * To access the Sui adapter instance
22859
+ * ```
22860
+ * const sdk = new AugustSDK()
22861
+ * sdk.sui.getEmberVaults()
22862
+ * ```
22863
+ */
22864
+ declare class SuiAdapter {
22865
+ private _apiBaseUrl;
22866
+ private _chainId;
22867
+ constructor(apiBaseUrl?: string, chainId?: number);
22868
+ get apiBaseUrl(): string;
22869
+ get chainId(): number;
22870
+ getEmberVaults(options?: IFetchEmberVaultsOptions): Promise<IEmberVault[]>;
22871
+ getEmberTVL(limit?: number): Promise<number>;
22872
+ convertFromE9(value: string | number): number;
22873
+ calculateUtilization(current: string | number, maximum: string | number): number;
22874
+ isSuiAddress(address: string): boolean;
22875
+ isSuiVault(chainId: number): boolean;
22876
+ transformEmberVaultToIVault(emberVault: IEmberVault): IVault;
22877
+ transformEmberVaultsToIVaults(emberVaults: IEmberVault[]): IVault[];
22878
+ }
22879
+
22880
+ /**
22881
+ * Address of the `SwapRouter` periphery contract on each supported chain.
22882
+ *
22883
+ * Missing keys mean no SwapRouter is deployed on that chain — callers
22884
+ * should fall back to legacy adapter paths.
22885
+ *
22886
+ * @see {@link getSwapRouterAddress} for the typed lookup helper.
22887
+ */
22888
+ export declare const SWAP_ROUTER_ADDRESSES: Readonly<Record<number, IAddress>>;
22889
+
22890
+ /**
22891
+ * The DEX aggregator whitelisted on each chain's `SwapRouter` via
22892
+ * `enableRouter`, plus the single aggregator contract method every swap leg is
22893
+ * pinned to and that method's 4-byte selector.
22894
+ *
22895
+ * This is the single source of truth tying the off-chain swap-leg builder to
22896
+ * the on-chain router whitelist. The two MUST agree or `swapAndDeposit` reverts
22897
+ * with `InvalidRouter()` (router not whitelisted) or `InvalidNotWhitelisted()`
22898
+ * (selector not authorized). It is consumed in three places:
22899
+ *
22900
+ * - `dispatchViaSwapRouter` asks {@link fetchSwapQuote} to pin the aggregator to
22901
+ * `contractMethod`, then asserts the returned quote's `router` and payload
22902
+ * selector match this entry before broadcasting — failing closed rather than
22903
+ * letting the user pay gas for a transaction the contract will reject.
22904
+ * - The CI check `scripts/verify-swap-router-aggregator.mjs` asserts the
22905
+ * deployed `SwapRouter` actually has `tokenTransferProxies[router] != 0` and
22906
+ * `isAuthorizedSelector(router, selector) == true` for every entry here, so
22907
+ * config drift is caught at release time, not by a user's failed deposit.
22908
+ *
22909
+ * Pinning to one generic method matters: the aggregator otherwise picks a route
22910
+ * method per quote (e.g. a direct `swapExactAmountInOnUniswapV3`) that varies
22911
+ * with market conditions, producing a different selector each time. Pinning
22912
+ * collapses that to one stable selector so the on-chain whitelist needs only
22913
+ * that selector and never drifts as routing changes.
22914
+ *
22915
+ * `router` is the address the aggregator's calldata targets (ParaSwap v6.2
22916
+ * pulls tokens to the Augustus contract itself, so the SwapRouter's
22917
+ * `tokenTransferProxies[router]` is the router address). `selector` is
22918
+ * `bytes4(keccak256("<contractMethod>(...)"))`. Verify both against the
22919
+ * deployed router before adding a chain — a wrong value reverts at deposit time.
22920
+ */
22921
+ export declare const SWAP_ROUTER_DEX_AGGREGATOR: Readonly<Record<number, {
22922
+ router: IAddress;
22923
+ contractMethod: string;
22924
+ selector: `0x${string}`;
22925
+ }>>;
22926
+
22927
+ /**
22928
+ * Maximum number of swap legs the contract accepts in a single
22929
+ * `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading
22930
+ * the on-chain value at call time would add an RPC for no gain.
22931
+ *
22932
+ * Kept here so the SDK can reject oversize inputs at the boundary rather
22933
+ * than wait for the on-chain `TooManySwaps` revert.
22934
+ */
22935
+ export declare const SWAP_ROUTER_MAX_SWAPS = 9;
22936
+
22937
+ /**
22938
+ * Wrapped-native ERC-20 per chain that has a SwapRouter deployment. Mirrors
22939
+ * the on-chain `wrappedNativeTokenAddress()` view to avoid an extra RPC on
22940
+ * every dispatch. Used to validate that native-token deposits target a
22941
+ * vault whose reference asset is the wrapped native — the only configuration
22942
+ * the contract's `depositNativeToken` / `swapAndDepositNativeToken` accept.
22943
+ */
22944
+ export declare const SWAP_ROUTER_WRAPPED_NATIVE: Readonly<Record<number, IAddress>>;
22945
+
22946
+ /**
22947
+ * Swap one or more whitelisted ERC-20s into a vault's reference asset via
22948
+ * the on-chain SwapRouter, then deposit the proceeds into the vault.
22949
+ *
22950
+ * Approval is sent automatically when the caller's allowance on each
22951
+ * `swaps[i].tokenIn` against the SwapRouter is below `amountIn`.
22952
+ *
22953
+ * @param signer - ethers `Signer` or `Wallet` with the EOA that holds the input tokens.
22954
+ * @param options - {@link ISwapAndDepositOptions}.
22955
+ * @returns The transaction hash of the `swapAndDeposit` call.
22956
+ *
22957
+ * @throws {@link AugustValidationError} for unsupported chains, invalid
22958
+ * addresses, empty/oversized swap arrays.
22959
+ * @throws {@link AugustSDKError} on unrecoverable contract or RPC failure.
22960
+ *
22961
+ * @example
22962
+ * ```ts
22963
+ * const quote = await fetchSwapQuote({
22964
+ * chainId: 1,
22965
+ * srcToken: WBTC,
22966
+ * srcDecimals: 8,
22967
+ * destToken: USDC,
22968
+ * destDecimals: 6,
22969
+ * amount: 100_000_000n,
22970
+ * receiver: SWAP_ROUTER_ADDRESSES[1]!,
22971
+ * });
22972
+ * const hash = await swapAndDeposit(signer, {
22973
+ * chainId: 1,
22974
+ * vault: '0x8AcA0841993ef4C87244d519166e767f49362C21',
22975
+ * receiver: wallet,
22976
+ * swaps: [{
22977
+ * tokenIn: WBTC,
22978
+ * tokenOut: USDC,
22979
+ * amountIn: 100_000_000n,
22980
+ * minAmountOut: quote.minAmountOut,
22981
+ * router: quote.router,
22982
+ * payload: quote.payload,
22983
+ * }],
22984
+ * });
22985
+ * ```
22986
+ */
22987
+ export declare function swapAndDeposit(signer: Signer | Wallet, options: ISwapAndDepositOptions): Promise<string>;
22988
+
22989
+ /**
22990
+ * Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
22991
+ * the ERC-4626 (`deposit(uint256, address)`) and multi-asset
22992
+ * (`deposit(address, uint256, address)`) deposit interfaces.
22993
+ *
22994
+ * Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
22995
+ * constants exactly. Set by an admin per-vault via `enableVault` and looked
22996
+ * up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
22997
+ * this — the router resolves it internally.
22998
+ */
22999
+ export declare enum SwapRouterVaultType {
23000
+ ERC4626 = 1,
23001
+ TokenizedVaultV2 = 2
23002
+ }
23003
+
23004
+ /**
23005
+ * Table of Contents
23006
+ * - Formatters
23007
+ * - Datetime
23008
+ * - Arrays
23009
+ * - Caching
23010
+ */
23011
+ export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | bigint): INormalizedNumber;
23012
+
23013
+ /**
23014
+ * Formatters
23015
+ */
23016
+ export declare function toTitleCase(str: string, type?: 'camel'): string;
23017
+
23018
+ /**
23019
+ * Track API response times and status.
23020
+ *
23021
+ * @param endpoint - The API endpoint called
23022
+ * @param method - HTTP method used
23023
+ * @param startTime - Start timestamp from performance.now()
23024
+ * @param status - HTTP response status code (0 for network errors)
23025
+ * @param server - Server identifier (production, staging, etc.)
23026
+ */
23027
+ export declare function trackApiCall(endpoint: string, method: string, startTime: number, status: number, server: string): void;
23028
+
23029
+ /**
23030
+ * Track chain/network switches for usage distribution analysis.
23031
+ *
23032
+ * @param chainId - The chain ID being switched to
23033
+ */
23034
+ export declare function trackNetworkSwitch(chainId: number): void;
23035
+
23036
+ export declare function truncate(s: string, amount?: number): string;
23037
+
23038
+ /* Excluded from this release type: tryRecoverTxHash */
23039
+
23040
+ /**
23041
+ * Vault addresses to exclude from `getTotalDeposited` TVL aggregation.
23042
+ * Addresses are lowercased so EVM, Solana, Sui and Stellar vaults can be
23043
+ * checked uniformly (don't wrap them with `getAddress` — non-EVM addresses
23044
+ * would throw). Add an address here to drop its `latest_reported_tvl` from
23045
+ * the headline number — e.g. closed pre-deposit vaults, test vaults, or
23046
+ * migrated v1 pools that are double-counted by a v2 successor.
23047
+ */
23048
+ export declare const TVL_EXCLUDED_VAULTS: ReadonlySet<string>;
23049
+
23050
+ /**
23051
+ * Validity window for a submitted Soroban invocation (seconds).
23052
+ *
23053
+ * This becomes the transaction's `maxTime`. Validators reject a tx whose
23054
+ * `maxTime` has passed (`txTOO_LATE`), so the window must outlast the slowest
23055
+ * realistic sign-then-submit path: hardware wallets, careful manual review,
23056
+ * and institutional approval flows (e.g. Fordefi) that don't sign instantly.
23057
+ * 10 minutes comfortably covers those while staying well inside the Soroban
23058
+ * footprint/ledger-entry TTL, so the simulated footprint can't go stale first.
23059
+ *
23060
+ * The window is anchored to the *network* clock (see `getNetworkCloseTime` in
23061
+ * soroban.ts), not the signer's `Date.now()`, so a skewed device clock can't
23062
+ * make the deadline expire early.
23063
+ */
23064
+ declare const TX_TIMEOUT_SECONDS = 600;
23065
+
23066
+ export declare type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
23067
+ [Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
23068
+ } & {
23069
+ /**
23070
+ * Return the function for a given name. This is useful when a contract
23071
+ * method name conflicts with a JavaScript name such as ``prototype`` or
23072
+ * when using a Contract programatically.
23073
+ */
23074
+ getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
23075
+ /**
23076
+ * Return the event for a given name. This is useful when a contract
23077
+ * event name conflicts with a JavaScript name such as ``prototype`` or
23078
+ * when using a Contract programatically.
23079
+ */
23080
+ getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
23081
+ /**
23082
+ * All the Events available on this contract.
23083
+ */
23084
+ filters: {
23085
+ [EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
23086
+ };
23087
+ };
23088
+
23089
+ 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']>>>> {
23090
+ (...args: [...TEventArgs]): DeferredTopicFilter;
23091
+ /**
23092
+ * The name of the Contract event.
23093
+ */
23094
+ name: TEventName;
23095
+ /**
23096
+ * The fragment of the Contract event. This will throw on ambiguous
23097
+ * method names.
23098
+ */
23099
+ fragment: EventFragment;
23100
+ /**
23101
+ * Returns the fragment constrained by %%args%%. This can be used to
23102
+ * resolve ambiguous event names.
23103
+ */
23104
+ getFragment(...args: [...TEventArgs]): EventFragment;
23105
+ }
23106
+
23107
+ 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>> {
23108
+ (...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
23109
+ /**
23110
+ * The name of the Contract method.
23111
+ */
23112
+ name: TFunctionName;
23113
+ /**
23114
+ * The fragment of the Contract method. This will throw on ambiguous
23115
+ * method names.
23116
+ */
23117
+ fragment: TFragment;
23118
+ /**
23119
+ * Returns the fragment constrained by %%args%%. This can be used to
23120
+ * resolve ambiguous method names.
23121
+ */
23122
+ getFragment(...args: [...TInputArgs]): TFragment;
23123
+ /**
23124
+ * Returns a populated transaction that can be used to perform the
23125
+ * contract method with %%args%%.
23126
+ */
23127
+ populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
23128
+ /**
23129
+ * Call the contract method with %%args%% and return the value.
23130
+ *
23131
+ * If the return value is a single type, it will be dereferenced and
23132
+ * returned directly, otherwise the full Result will be returned.
23133
+ */
23134
+ staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
23135
+ /**
23136
+ * Send a transaction for the contract method with %%args%%.
23137
+ */
23138
+ send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
23139
+ /**
23140
+ * Estimate the gas to send the contract method with %%args%%.
23141
+ */
23142
+ estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
23143
+ /**
23144
+ * Call the contract method with %%args%% and return the Result
23145
+ * without any dereferencing.
23146
+ */
23147
+ staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
23148
+ }
23149
+
23150
+ 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;
23151
+
23152
+ export declare type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>> = Omit<FunctionFragment, 'inputs' | 'outputs' | 'stateMutability' | 'name' | 'type'> & {
23153
+ name: TFunction['name'];
23154
+ type: TFunction['type'];
23155
+ inputs: TFunction['inputs'];
23156
+ outputs: TFunction['outputs'];
23157
+ stateMutability: TFunction['stateMutability'];
23158
+ };
23159
+
23160
+ export declare function unixToDate(epoch: number): Date;
23161
+
23162
+ /**
23163
+ * Update the current user identity in Sentry.
23164
+ * Called when wallet address changes.
23165
+ *
23166
+ * @param walletAddress - New wallet address (or undefined to clear)
23167
+ * @param environment - Current environment
23168
+ */
23169
+ export declare function updateUser(walletAddress?: string, environment?: IEnv): void;
23170
+
23171
+ /* Excluded from this release type: validateAmountPrecision */
23172
+
23173
+ /**
23174
+ * Vault adapter configurations mapping vault addresses to their adapter settings
23175
+ */
23176
+ export declare const VAULT_ADAPTER_CONFIGS: Record<IAddress, IVaultAdapterConfig>;
23177
+
23178
+ 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}`>;
23179
+
23180
+ /**
23181
+ * Hardcoded subaccount addresses for specific vaults allocations
23182
+ */
23183
+ export declare const VAULT_ALLOCATION_SUBACCOUNTS: {
23184
+ AgoraAUSD: {
23185
+ address: IAddress;
23186
+ subaccount: IAddress;
23187
+ useDebank: boolean;
23188
+ };
23189
+ earnAUSD: {
23190
+ address: IAddress;
23191
+ subaccount: IAddress;
23192
+ useDebank: boolean;
23193
+ };
23194
+ };
23195
+
23196
+ /**
23197
+ * The functions to call on the vault contract
23198
+ * @returns The functions to call
23199
+ */
23200
+ export declare const VAULT_FUNCTIONS_V1: IPoolFunctions[];
23201
+
23202
+ export declare const VAULT_FUNCTIONS_V2: IPoolFunctions[];
23203
+
23204
+ export declare const VAULT_FUNCTIONS_V2_RECEIPT: IPoolFunctions[];
23205
+
23206
+ export declare const VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS: IPoolFunctions[];
23207
+
23208
+ /**
23209
+ * Vault Symbols Mapping
23210
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23211
+ */
23212
+ export declare const VAULT_SYMBOLS: Record<IAddress, string>;
23213
+
23214
+ /**
23215
+ * Vault Symbols Reverse Mapping
23216
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23217
+ */
23218
+ export declare const VAULT_SYMBOLS_REVERSE: Record<VaultSymbols, IAddress>;
23219
+
23220
+ /**
23221
+ * Address type for vault contracts across all supported chains.
23222
+ * EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
23223
+ * and Stellar vaults use 56-character base32 addresses (G/C prefix).
23224
+ *
23225
+ * Use this instead of `IAddress` when the address may belong to any chain.
23226
+ */
23227
+ export declare type VaultAddress = string;
23228
+
23229
+ /**
23230
+ * allowance checks user's current allowance per pool
23231
+ * @param signer - signer / provider object
23232
+ * @param options - object including pool contract address, user wallet address
23233
+ * @returns normalized number object of the user's current allowance
23234
+ */
23235
+ export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
23236
+
23237
+ /**
23238
+ * Approve a vault (or the appropriate adapter wrapper) to spend a token
23239
+ * ahead of a separate deposit call. Spender routing mirrors
23240
+ * {@link vaultDeposit} (multi-asset → vault, adapter → wrapper, standard →
23241
+ * vault). Returns `undefined` when the existing allowance already covers
23242
+ * `amount` **or** when the deposit asset is native.
23243
+ *
23244
+ * @returns Transaction hash when an approval was sent, `undefined` when
23245
+ * the existing allowance already covers `amount` or the deposit asset is
23246
+ * native (no ERC-20 allowance applies). Use {@link approve} for a
23247
+ * discriminated `ApproveResult` if you need to tell those two cases apart.
23248
+ * @throws AugustValidationError on invalid wallet/target/amount.
23249
+ *
23250
+ * @example
23251
+ * ```ts
23252
+ * const hash = await augustSdk.evm.vaultApprove({
23253
+ * target: '0x...', // vault contract address
23254
+ * wallet: walletAddress,
23255
+ * amount: '100', // 100 of the deposit token (UI units)
23256
+ * wait: true, // wait for the approval to confirm
23257
+ * });
23258
+ * if (hash) console.log('approve tx', hash);
23259
+ * // hash === undefined means the on-chain allowance already covers the
23260
+ * // amount, or the deposit asset is native (msg.value, no allowance).
23261
+ * ```
23262
+ */
23263
+ export declare function vaultApprove(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string | undefined>;
23264
+
23265
+ /**
23266
+ * Deposit underlying token into the specified vault. Auto-routes to the
23267
+ * correct contract path (single-asset ERC-4626, EVM-2 multi-asset,
23268
+ * Paraswap adapter, native-token wrapper, depositWithPermit) based on the
23269
+ * vault version and `depositAsset`.
23270
+ *
23271
+ * Amounts are encoded against the **deposit token's** decimals, not the
23272
+ * vault's share decimals. The SDK reads the appropriate decimals via the
23273
+ * vault metadata and the asset's ERC-20.
23274
+ *
23275
+ * Approval is handled automatically: if the existing allowance doesn't
23276
+ * cover `amount`, an `approve` is sent and **always waited for** (regardless
23277
+ * of the caller's `wait` flag) so the deposit tx can't be re-ordered ahead
23278
+ * of the approval on Monad-style RPCs.
23279
+ *
23280
+ * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23281
+ * @param options Vault address, wallet, amount, optional `depositAsset` for
23282
+ * adapter routes, optional `wait` to wait for the deposit receipt.
23283
+ * @returns Deposit transaction hash.
23284
+ * @throws AugustValidationError on invalid wallet/target/amount or missing
23285
+ * adapter config when `depositAsset` differs from the vault underlying.
23286
+ * @throws AugustSDKError when the deposit submission or on-chain call fails.
23287
+ *
23288
+ * @example
23289
+ * ```ts
23290
+ * const hash = await augustSdk.evm.vaultDeposit({
23291
+ * target: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32', // vault
23292
+ * wallet: walletAddress,
23293
+ * amount: '100', // 100 USDC (UI units)
23294
+ * wait: true, // wait for the deposit receipt
23295
+ * });
23296
+ * ```
23297
+ *
23298
+ * @example Adapter deposit (different deposit asset than the vault's underlying)
23299
+ * ```ts
23300
+ * await augustSdk.evm.vaultDeposit({
23301
+ * target: vaultAddress,
23302
+ * wallet: walletAddress,
23303
+ * amount: '0.5',
23304
+ * depositAsset: WETH_ADDRESS, // swap WETH -> vault underlying via the adapter
23305
+ * chainId: 1,
23306
+ * });
23307
+ * ```
23308
+ */
23309
+ export declare function vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23310
+
23311
+ /**
23312
+ * Check if vault has adapter support
23313
+ */
23314
+ export declare function vaultHasAdapter(vaultAddress: IAddress): boolean;
23315
+
23316
+ declare const vaultIdl: {
23317
+ address: string;
23318
+ metadata: {
23319
+ name: string;
23320
+ version: string;
23321
+ spec: string;
23322
+ description: string;
23323
+ };
23324
+ instructions: ({
23325
+ name: string;
23326
+ docs: string[];
23327
+ discriminator: number[];
23328
+ accounts: ({
23329
+ name: string;
23330
+ writable: boolean;
23331
+ pda: {
23332
+ seeds: {
23333
+ kind: string;
23334
+ value: number[];
23335
+ }[];
23336
+ };
23337
+ signer?: undefined;
23338
+ address?: undefined;
23339
+ } | {
23340
+ name: string;
23341
+ signer: boolean;
23342
+ writable?: undefined;
23343
+ pda?: undefined;
23344
+ address?: undefined;
23345
+ } | {
23346
+ name: string;
23347
+ writable: boolean;
23348
+ pda?: undefined;
23349
+ signer?: undefined;
23350
+ address?: undefined;
23351
+ } | {
23352
+ name: string;
23353
+ address: string;
23354
+ writable?: undefined;
23355
+ pda?: undefined;
23356
+ signer?: undefined;
23357
+ })[];
23358
+ args: any[];
23359
+ } | {
23360
+ name: string;
23361
+ docs: string[];
23362
+ discriminator: number[];
23363
+ accounts: ({
23364
+ name: string;
23365
+ writable: boolean;
23366
+ signer: boolean;
23367
+ docs?: undefined;
23368
+ pda?: undefined;
23369
+ address?: undefined;
23370
+ } | {
23371
+ name: string;
23372
+ docs: string[];
23373
+ writable: boolean;
23374
+ signer: boolean;
23375
+ pda?: undefined;
23376
+ address?: undefined;
23377
+ } | {
23378
+ name: string;
23379
+ docs: string[];
23380
+ writable: boolean;
23381
+ pda: {
23382
+ seeds: {
23383
+ kind: string;
23384
+ value: number[];
23385
+ }[];
23386
+ program?: undefined;
23387
+ };
23388
+ signer?: undefined;
23389
+ address?: undefined;
23390
+ } | {
23391
+ name: string;
23392
+ docs: string[];
23393
+ writable: boolean;
23394
+ signer?: undefined;
23395
+ pda?: undefined;
23396
+ address?: undefined;
23397
+ } | {
23398
+ name: string;
23399
+ writable: boolean;
23400
+ pda: {
23401
+ seeds: ({
23402
+ kind: string;
23403
+ value: number[];
23404
+ path?: undefined;
23405
+ } | {
23406
+ kind: string;
23407
+ path: string;
23408
+ value?: undefined;
23409
+ })[];
23410
+ program: {
23411
+ kind: string;
23412
+ value: number[];
23413
+ };
23414
+ };
23415
+ signer?: undefined;
23416
+ docs?: undefined;
23417
+ address?: undefined;
23418
+ } | {
23419
+ name: string;
23420
+ address: string;
23421
+ writable?: undefined;
23422
+ signer?: undefined;
23423
+ docs?: undefined;
23424
+ pda?: undefined;
23425
+ })[];
23426
+ args: {
23427
+ name: string;
23428
+ type: string;
23429
+ }[];
23430
+ } | {
23431
+ name: string;
23432
+ docs: string[];
23433
+ discriminator: number[];
23434
+ accounts: ({
23435
+ name: string;
23436
+ writable: boolean;
23437
+ pda: {
23438
+ seeds: ({
23439
+ kind: string;
23440
+ value: number[];
23441
+ path?: undefined;
23442
+ } | {
23443
+ kind: string;
23444
+ path: string;
23445
+ value?: undefined;
23446
+ })[];
23447
+ };
23448
+ signer?: undefined;
23449
+ } | {
23450
+ name: string;
23451
+ writable: boolean;
23452
+ pda?: undefined;
23453
+ signer?: undefined;
23454
+ } | {
23455
+ name: string;
23456
+ writable: boolean;
23457
+ signer: boolean;
23458
+ pda?: undefined;
23459
+ } | {
23460
+ name: string;
23461
+ writable?: undefined;
23462
+ pda?: undefined;
23463
+ signer?: undefined;
23464
+ })[];
23465
+ args: {
23466
+ name: string;
23467
+ type: string;
23468
+ }[];
23469
+ } | {
23470
+ name: string;
23471
+ docs: string[];
23472
+ discriminator: number[];
23473
+ accounts: ({
23474
+ name: string;
23475
+ writable: boolean;
23476
+ pda: {
23477
+ seeds: ({
23478
+ kind: string;
23479
+ value: number[];
23480
+ path?: undefined;
23481
+ } | {
23482
+ kind: string;
23483
+ path: string;
23484
+ value?: undefined;
23485
+ })[];
23486
+ };
23487
+ signer?: undefined;
23488
+ address?: undefined;
23489
+ } | {
23490
+ name: string;
23491
+ writable?: undefined;
23492
+ pda?: undefined;
23493
+ signer?: undefined;
23494
+ address?: undefined;
23495
+ } | {
23496
+ name: string;
23497
+ writable: boolean;
23498
+ signer: boolean;
23499
+ pda?: undefined;
23500
+ address?: undefined;
23501
+ } | {
23502
+ name: string;
23503
+ address: string;
23504
+ writable?: undefined;
23505
+ pda?: undefined;
23506
+ signer?: undefined;
23507
+ })[];
23508
+ args: {
23509
+ name: string;
23510
+ type: string;
23511
+ }[];
23512
+ } | {
23513
+ name: string;
23514
+ docs: string[];
23515
+ discriminator: number[];
23516
+ accounts: ({
23517
+ name: string;
23518
+ writable: boolean;
23519
+ pda: {
23520
+ seeds: {
23521
+ kind: string;
23522
+ value: number[];
23523
+ }[];
23524
+ };
23525
+ signer?: undefined;
23526
+ address?: undefined;
23527
+ } | {
23528
+ name: string;
23529
+ signer: boolean;
23530
+ writable?: undefined;
23531
+ pda?: undefined;
23532
+ address?: undefined;
23533
+ } | {
23534
+ name: string;
23535
+ writable: boolean;
23536
+ signer: boolean;
23537
+ pda?: undefined;
23538
+ address?: undefined;
23539
+ } | {
23540
+ name: string;
23541
+ address: string;
23542
+ writable?: undefined;
23543
+ pda?: undefined;
23544
+ signer?: undefined;
23545
+ })[];
23546
+ args: {
23547
+ name: string;
23548
+ type: string;
23549
+ }[];
23550
+ } | {
23551
+ name: string;
23552
+ docs: string[];
23553
+ discriminator: number[];
23554
+ accounts: ({
23555
+ name: string;
23556
+ writable: boolean;
23557
+ pda: {
23558
+ seeds: ({
23559
+ kind: string;
23560
+ value: number[];
23561
+ path?: undefined;
23562
+ } | {
23563
+ kind: string;
23564
+ path: string;
23565
+ value?: undefined;
23566
+ })[];
23567
+ program?: undefined;
23568
+ };
23569
+ signer?: undefined;
23570
+ } | {
23571
+ name: string;
23572
+ writable: boolean;
23573
+ pda: {
23574
+ seeds: ({
23575
+ kind: string;
23576
+ path: string;
23577
+ value?: undefined;
23578
+ } | {
23579
+ kind: string;
23580
+ value: number[];
23581
+ path?: undefined;
23582
+ })[];
23583
+ program: {
23584
+ kind: string;
23585
+ value: number[];
23586
+ };
23587
+ };
23588
+ signer?: undefined;
23589
+ } | {
23590
+ name: string;
23591
+ writable: boolean;
23592
+ pda?: undefined;
23593
+ signer?: undefined;
23594
+ } | {
23595
+ name: string;
23596
+ signer: boolean;
23597
+ writable?: undefined;
23598
+ pda?: undefined;
23599
+ } | {
23600
+ name: string;
23601
+ writable?: undefined;
23602
+ pda?: undefined;
23603
+ signer?: undefined;
23604
+ })[];
23605
+ args: {
23606
+ name: string;
23607
+ type: string;
23608
+ }[];
23609
+ })[];
23610
+ accounts: {
23611
+ name: string;
23612
+ discriminator: number[];
23613
+ }[];
23614
+ events: {
23615
+ name: string;
23616
+ discriminator: number[];
23617
+ }[];
23618
+ errors: {
23619
+ code: number;
23620
+ name: string;
23621
+ msg: string;
23622
+ }[];
23623
+ types: ({
23624
+ name: string;
23625
+ serialization: string;
23626
+ repr: {
23627
+ kind: string;
23628
+ };
23629
+ type: {
23630
+ kind: string;
23631
+ fields: {
23632
+ name: string;
23633
+ type: string;
23634
+ }[];
23635
+ };
23636
+ } | {
23637
+ name: string;
23638
+ type: {
23639
+ kind: string;
23640
+ fields: ({
23641
+ name: string;
23642
+ type: string;
23643
+ } | {
23644
+ name: string;
23645
+ type: {
23646
+ array: (string | number)[];
23647
+ };
23648
+ })[];
23649
+ };
23650
+ serialization?: undefined;
23651
+ repr?: undefined;
23652
+ })[];
23653
+ };
23654
+
23655
+ /**
23656
+ * @TODO
23657
+ * @description withdraw funds from the specified pool including accrued rewards
23658
+ * @param signer signer / wallet object
23659
+ * @param options object including pool contract address, user wallet address, and more
23660
+ * @returns claim tx hash
23661
+ */
23662
+ export declare function vaultRedeem(signer: Signer | Wallet, options: IContractWriteOptions & {
23663
+ year: string;
23664
+ month: string;
23665
+ day: string;
23666
+ receiverIndex: string;
23667
+ }): Promise<string>;
23668
+
23669
+ export declare enum VaultRedemptionStatus {
23670
+ AWAITING_COOLDOWN = "awaiting_cooldown",
23671
+ READY_TO_CLAIM = "ready_to_claim"
23672
+ }
23673
+
23674
+ /**
23675
+ * Request to redeem vault shares. For EVM-1 vaults this queues a standard
23676
+ * redemption (claimable later via `vaultRedeem`); for EVM-2 vaults this
23677
+ * also handles the receipt-token allowance automatically. Pass
23678
+ * `isInstantRedeem: true` for vaults that support instant settlement.
23679
+ *
23680
+ * Approval of the receipt token (EVM-2) is always waited on before the
23681
+ * redeem call, regardless of the caller's `wait` flag.
23682
+ *
23683
+ * @param signer ethers Signer / Wallet (or viem WalletClient via {@link setSigner})
23684
+ * @param options Vault address, wallet, amount, optional `isInstantRedeem`,
23685
+ * optional `wait` to wait for the redeem receipt.
23686
+ * @returns Redeem transaction hash.
23687
+ * @throws AugustValidationError on invalid wallet/target/amount.
23688
+ * @throws AugustSDKError when the redeem submission or on-chain call fails.
23689
+ *
23690
+ * @example
23691
+ * ```ts
23692
+ * const hash = await augustSdk.evm.vaultRequestRedeem({
23693
+ * target: vaultAddress,
23694
+ * wallet: walletAddress,
23695
+ * amount: '10', // 10 shares (UI units)
23696
+ * wait: true,
23697
+ * });
23698
+ * ```
23699
+ *
23700
+ * @example Instant redemption
23701
+ * ```ts
23702
+ * await augustSdk.evm.vaultRequestRedeem({
23703
+ * target: vaultAddress,
23704
+ * wallet: walletAddress,
23705
+ * amount: '10',
23706
+ * isInstantRedeem: true,
23707
+ * });
23708
+ * ```
23709
+ */
23710
+ export declare function vaultRequestRedeem(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
23711
+
23712
+ /**
23713
+ * Vault addresses registered on a `SwapRouter` via `enableVault`. The
23714
+ * presence of a vault here is the signal to route its deposits through the
23715
+ * SwapRouter rather than the legacy adapter path.
23716
+ *
23717
+ * Entries mirror the on-chain `vaultInfo[addr].referenceAsset != 0` state of
23718
+ * the `SwapRouter` deployment. Verify against the deployed contract before
23719
+ * adding a new entry — a vault that is not registered on-chain will revert
23720
+ * with `InvalidVault` at deposit time.
23721
+ *
23722
+ * Lowercase comparison is required when checking — use
23723
+ * {@link vaultUsesSwapRouter} rather than reading this set directly.
23724
+ */
23725
+ export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet<string>;
23726
+
23727
+ /**
23728
+ * Vault Receipt Symbol Mapping
23729
+ * @deprecated use getVaultMetadata to fetch vault symbols from the backend
23730
+ */
23731
+ 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';
23732
+
23733
+ /**
23734
+ * Whether a vault has been registered on a `SwapRouter` and should route
23735
+ * its deposits through it. Address comparison is case-insensitive.
23736
+ *
23737
+ * @param vaultAddress - August vault address.
23738
+ * @returns `true` when the vault is in {@link VAULTS_USING_SWAP_ROUTER}.
23739
+ */
23740
+ export declare function vaultUsesSwapRouter(vaultAddress: IAddress): boolean;
23741
+
23742
+ export declare function verifyAugustKey(key: string): Promise<boolean>;
23743
+
23744
+ export declare function verifyInfuraKey(key: string): Promise<boolean>;
23745
+
23746
+ /**
23747
+ * Convert a viem WalletClient to an ethers-compatible Signer
23748
+ * Uses the walletClient as a provider and wraps it for ethers compatibility
23749
+ * @param walletClient Viem WalletClient from wagmi or viem
23750
+ * @returns Ethers Signer that can be used with the SDK
23751
+ */
23752
+ export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
23753
+
23754
+ /**
23755
+ * @param walletClient a wagmi-derived client (from useWalletClient)
23756
+ * @returns An ethers JsonRpcSigner object used in sdk.evm.setSigner
23757
+ */
23758
+ export declare function walletClientToSigner(walletClient: WalletClient): Promise<ethers.JsonRpcSigner>;
23759
+
23760
+ export declare const WEBSERVER_ENDPOINTS: {
23761
+ default: {
23762
+ hello: string;
23763
+ protected: string;
23764
+ };
23765
+ auth: {
23766
+ verify: string;
23767
+ sign: string;
23768
+ login: string;
23769
+ nonce: string;
23770
+ refresh: string;
23771
+ };
23772
+ subaccount: {
23773
+ rewards: (subaccount: IAddress) => string;
23774
+ tokens: (subaccount: IAddress) => string;
23775
+ twap: {
23776
+ create: (subaccount: IAddress) => string;
23777
+ stop: (subaccount: IAddress, id: string) => string;
23778
+ fills: (subaccount: IAddress, id: string) => string;
23779
+ };
23780
+ debank: (subaccount: IAddress) => string;
23781
+ health_factor: (subaccount: IAddress) => string;
23782
+ summary: (subaccount: IAddress) => string;
23783
+ batch: (subaccount: IAddress) => string;
23784
+ loans: (subaccount: IAddress, side?: "BORROWER" | "LENDER" | "BOTH", active?: boolean) => string;
23785
+ cefi: (subaccount: IAddress) => string;
23786
+ otc_positions: (subaccount: IAddress) => string;
23787
+ _: (subaccount: IAddress) => string;
23788
+ };
23789
+ users: {
23790
+ get: string;
23791
+ };
23792
+ prices: (symbol: string) => string;
23793
+ metrics: {
23794
+ pnl: (subaccount: IAddress, startTime?: string, endTime?: string) => string;
23795
+ };
23796
+ public: {
23797
+ integrations: {
23798
+ morpho: {
23799
+ apy: (subaccount: IAddress, vaultAddress: IAddress) => string;
23800
+ };
23801
+ };
23802
+ tokenizedVault: {
23803
+ loans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
23804
+ subaccountLoans: (vaultAddress: VaultAddress, chainId: number, active: boolean) => string;
23805
+ list: string;
23806
+ byVaultAddress: (vaultAddress: VaultAddress) => string;
23807
+ historicalApy: (vaultAddress: IAddress) => string;
23808
+ historicalTimeseries: (vaultAddress: IAddress, nDays?: number) => string;
23809
+ annualizedApy: (vaultAddress: IAddress) => string;
23810
+ summary: (vaultAddress: IAddress) => string;
23811
+ withdrawals: (chain: string, vaultAddress: IAddress) => string;
23812
+ debank: (vaultAddress: IAddress) => string;
23813
+ userHistory: (vaultAddress: IAddress, wallet: IAddress) => string;
23814
+ archivedVaults: string;
23815
+ };
23816
+ points: {
23817
+ byUserAddress: (userAddress: IAddress) => string;
23818
+ register: string;
23819
+ leaderboard: string;
23820
+ };
23821
+ vaults: {
23822
+ pendingRedemptions: (vaultAddress: IAddress) => string;
23823
+ };
23824
+ pnl: {
23825
+ unrealizedHistory: (vaultAddress: VaultAddress, limit?: number) => string;
23826
+ unrealizedLatest: string;
23827
+ };
23828
+ };
23829
+ upshift: {
23830
+ vaults: {
23831
+ metadata: string;
23832
+ };
23833
+ };
23834
+ };
23835
+
23836
+ export declare const WEBSERVER_URL: {
23837
+ production: string;
23838
+ staging: string;
23839
+ development: string;
23840
+ localhost: string;
23841
+ qa: string;
23842
+ public: string;
23843
+ upshift: string;
23844
+ };
23845
+
23846
+ /**
23847
+ * Withdrawal request with computed claimable date and current processing status.
23848
+ * The unique identifier is (receiver, claimableDate).
23849
+ *
23850
+ * @interface WithdrawalRequestStatus
23851
+ */
23852
+ export declare interface WithdrawalRequestStatus {
23853
+ /** Transaction hash of the withdrawal request */
23854
+ transactionHash: string;
23855
+ /** Block timestamp when the withdrawal was requested (seconds, UTC) */
23856
+ requestTimestamp: number;
23857
+ /** Shares amount being redeemed */
23858
+ shares: bigint;
23859
+ /** Receiver address for the withdrawal */
23860
+ receiver: string;
23861
+ /** Computed claimable date in UTC (year, month, day) */
23862
+ claimableDate: {
23863
+ year: number;
23864
+ month: number;
23865
+ day: number;
23866
+ };
23867
+ /** Epoch timestamp when this withdrawal becomes claimable */
23868
+ claimableEpoch: number;
23869
+ /** Current status of the withdrawal */
23870
+ status: 'pending' | 'ready_to_claim' | 'processed';
23871
+ /** Transaction hash of the processing transaction (if processed) */
23872
+ processedTransactionHash?: string;
23873
+ /** Assets received (if processed) */
23874
+ assetsReceived?: bigint;
23875
+ }
23876
+
23877
+ /**
23878
+ * Higher-order function to wrap SDK methods with performance tracking.
23879
+ * Tracks method calls, timing, chain usage, and errors.
23880
+ *
23881
+ * @param methodName - Name of the method being wrapped
23882
+ * @param method - The original async method
23883
+ * @param getChainId - Function to get current chain ID
23884
+ * @returns Wrapped method with tracking
23885
+ */
23886
+ export declare function withMethodTracking<T extends (...args: unknown[]) => Promise<unknown>>(methodName: string, method: T, getChainId?: () => number | undefined): T;
23887
+
23888
+ /**
23889
+ * Wrap async operations with exponential backoff retry logic.
23890
+ * Retries on network errors with increasing delays between attempts.
23891
+ * @param fn - Async function to execute with retry logic
23892
+ * @param maxRetries - Maximum number of retry attempts
23893
+ * @param baseDelay - Initial delay in milliseconds (doubles each retry)
23894
+ * @param shouldRetry - Custom function to determine if error is retryable
23895
+ * @returns Result of successful function execution
23896
+ * @throws Last error if all retries exhausted
23897
+ */
23898
+ export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number, shouldRetry?: (error: Error) => boolean): Promise<T>;
23899
+
23900
+ /**
23901
+ * Higher-order function to wrap synchronous SDK methods with tracking.
23902
+ * Uses breadcrumbs for tracking since spans require async context.
23903
+ *
23904
+ * @param methodName - Name of the method being wrapped
23905
+ * @param method - The original sync method
23906
+ * @param getChainId - Function to get current chain ID
23907
+ * @returns Wrapped method with tracking
23908
+ */
23909
+ export declare function withSyncMethodTracking<T extends (...args: unknown[]) => unknown>(methodName: string, method: T, getChainId?: () => number | undefined): T;
23910
+
23911
+ export declare const WRAPPER_ADAPTOR: {
23912
+ 43114: IAddress;
23913
+ 1: IAddress;
23914
+ };
23915
+
23916
+ export { }