upshift-config 0.5.14

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 (316) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +349 -0
  3. package/lib/abis/AddressResolver.d.ts +28 -0
  4. package/lib/abis/AddressResolver.js +23 -0
  5. package/lib/abis/ChainlinkV3.d.ts +87 -0
  6. package/lib/abis/ChainlinkV3.js +117 -0
  7. package/lib/abis/ERC20.d.ts +168 -0
  8. package/lib/abis/ERC20.js +226 -0
  9. package/lib/abis/ERC20_Bytes32.d.ts +139 -0
  10. package/lib/abis/ERC20_Bytes32.js +196 -0
  11. package/lib/abis/ERC4626.d.ts +364 -0
  12. package/lib/abis/ERC4626.js +507 -0
  13. package/lib/abis/ERC721.d.ts +231 -0
  14. package/lib/abis/ERC721.js +321 -0
  15. package/lib/abis/FeeOracle.d.ts +120 -0
  16. package/lib/abis/FeeOracle.js +162 -0
  17. package/lib/abis/LendingPool.d.ts +1393 -0
  18. package/lib/abis/LendingPool.js +1807 -0
  19. package/lib/abis/LendingPoolV2.d.ts +1413 -0
  20. package/lib/abis/LendingPoolV2.js +1833 -0
  21. package/lib/abis/LendingPoolV3.d.ts +1677 -0
  22. package/lib/abis/LendingPoolV3.js +1160 -0
  23. package/lib/abis/Loan.d.ts +837 -0
  24. package/lib/abis/Loan.js +1080 -0
  25. package/lib/abis/MultiAssetNativeDepositWrapper.d.ts +137 -0
  26. package/lib/abis/MultiAssetNativeDepositWrapper.js +125 -0
  27. package/lib/abis/Multicall3.d.ts +30 -0
  28. package/lib/abis/Multicall3.js +97 -0
  29. package/lib/abis/OFT.d.ts +116 -0
  30. package/lib/abis/OFT.js +85 -0
  31. package/lib/abis/PoolAdapter.d.ts +36 -0
  32. package/lib/abis/PoolAdapter.js +51 -0
  33. package/lib/abis/RewardDistributor.d.ts +267 -0
  34. package/lib/abis/RewardDistributor.js +352 -0
  35. package/lib/abis/RwaRedeemSubaccount.d.ts +747 -0
  36. package/lib/abis/RwaRedeemSubaccount.js +548 -0
  37. package/lib/abis/SmartAccount.d.ts +17 -0
  38. package/lib/abis/SmartAccount.js +19 -0
  39. package/lib/abis/SwapRouter.d.ts +1043 -0
  40. package/lib/abis/SwapRouter.js +740 -0
  41. package/lib/abis/TextResolver.d.ts +16 -0
  42. package/lib/abis/TextResolver.js +16 -0
  43. package/lib/abis/TokenizedVaultV2.d.ts +1364 -0
  44. package/lib/abis/TokenizedVaultV2.js +1041 -0
  45. package/lib/abis/TokenizedVaultV2DepositWithPermit.d.ts +1456 -0
  46. package/lib/abis/TokenizedVaultV2DepositWithPermit.js +1878 -0
  47. package/lib/abis/TokenizedVaultV2Receipt.d.ts +1568 -0
  48. package/lib/abis/TokenizedVaultV2Receipt.js +1061 -0
  49. package/lib/abis/TokenizedVaultV2SenderAllocationWhitelist.d.ts +454 -0
  50. package/lib/abis/TokenizedVaultV2SenderAllocationWhitelist.js +327 -0
  51. package/lib/abis/TokenizedVaultV2WhitelistedAllocation.d.ts +1466 -0
  52. package/lib/abis/TokenizedVaultV2WhitelistedAllocation.js +1092 -0
  53. package/lib/abis/TokenizedVaultV2WhitelistedAssets.d.ts +274 -0
  54. package/lib/abis/TokenizedVaultV2WhitelistedAssets.js +167 -0
  55. package/lib/abis/UniversalResolverResolve.d.ts +69 -0
  56. package/lib/abis/UniversalResolverResolve.js +35 -0
  57. package/lib/abis/UniversalSignatureValidator.d.ts +17 -0
  58. package/lib/abis/UniversalSignatureValidator.js +30 -0
  59. package/lib/abis/WrapperAdapter.d.ts +71 -0
  60. package/lib/abis/WrapperAdapter.js +77 -0
  61. package/lib/abis/index.d.ts +34 -0
  62. package/lib/abis/index.js +51 -0
  63. package/lib/adapters/evm/getters.d.ts +19 -0
  64. package/lib/adapters/evm/getters.js +209 -0
  65. package/lib/adapters/evm/index.d.ts +353 -0
  66. package/lib/adapters/evm/index.js +434 -0
  67. package/lib/adapters/evm/utils.d.ts +8 -0
  68. package/lib/adapters/evm/utils.js +51 -0
  69. package/lib/adapters/solana/constants.d.ts +33 -0
  70. package/lib/adapters/solana/constants.js +52 -0
  71. package/lib/adapters/solana/getters.d.ts +11 -0
  72. package/lib/adapters/solana/getters.js +165 -0
  73. package/lib/adapters/solana/idl/vault-idl.d.ts +272 -0
  74. package/lib/adapters/solana/idl/vault-idl.js +1084 -0
  75. package/lib/adapters/solana/index.d.ts +233 -0
  76. package/lib/adapters/solana/index.js +291 -0
  77. package/lib/adapters/solana/types.d.ts +67 -0
  78. package/lib/adapters/solana/types.js +3 -0
  79. package/lib/adapters/solana/utils.d.ts +141 -0
  80. package/lib/adapters/solana/utils.js +595 -0
  81. package/lib/adapters/solana/vault.actions.d.ts +57 -0
  82. package/lib/adapters/solana/vault.actions.js +379 -0
  83. package/lib/adapters/stellar/actions.d.ts +28 -0
  84. package/lib/adapters/stellar/actions.js +77 -0
  85. package/lib/adapters/stellar/constants.d.ts +43 -0
  86. package/lib/adapters/stellar/constants.js +53 -0
  87. package/lib/adapters/stellar/getters.d.ts +68 -0
  88. package/lib/adapters/stellar/getters.js +290 -0
  89. package/lib/adapters/stellar/index.d.ts +114 -0
  90. package/lib/adapters/stellar/index.js +175 -0
  91. package/lib/adapters/stellar/soroban.d.ts +123 -0
  92. package/lib/adapters/stellar/soroban.js +613 -0
  93. package/lib/adapters/stellar/submit.d.ts +34 -0
  94. package/lib/adapters/stellar/submit.js +149 -0
  95. package/lib/adapters/stellar/types.d.ts +58 -0
  96. package/lib/adapters/stellar/types.js +6 -0
  97. package/lib/adapters/stellar/utils.d.ts +24 -0
  98. package/lib/adapters/stellar/utils.js +34 -0
  99. package/lib/adapters/sui/constants.d.ts +14 -0
  100. package/lib/adapters/sui/constants.js +29 -0
  101. package/lib/adapters/sui/getters.d.ts +9 -0
  102. package/lib/adapters/sui/getters.js +60 -0
  103. package/lib/adapters/sui/index.d.ts +45 -0
  104. package/lib/adapters/sui/index.js +101 -0
  105. package/lib/adapters/sui/transformer.d.ts +10 -0
  106. package/lib/adapters/sui/transformer.js +107 -0
  107. package/lib/adapters/sui/types.d.ts +66 -0
  108. package/lib/adapters/sui/types.js +3 -0
  109. package/lib/adapters/sui/utils.d.ts +10 -0
  110. package/lib/adapters/sui/utils.js +29 -0
  111. package/lib/core/analytics/chain-name.d.ts +9 -0
  112. package/lib/core/analytics/chain-name.js +34 -0
  113. package/lib/core/analytics/constants.d.ts +5 -0
  114. package/lib/core/analytics/constants.js +9 -0
  115. package/lib/core/analytics/env.d.ts +29 -0
  116. package/lib/core/analytics/env.js +59 -0
  117. package/lib/core/analytics/index.d.ts +36 -0
  118. package/lib/core/analytics/index.js +79 -0
  119. package/lib/core/analytics/instrumentation.d.ts +29 -0
  120. package/lib/core/analytics/instrumentation.js +277 -0
  121. package/lib/core/analytics/method-taxonomy.d.ts +19 -0
  122. package/lib/core/analytics/method-taxonomy.js +128 -0
  123. package/lib/core/analytics/metrics.d.ts +33 -0
  124. package/lib/core/analytics/metrics.js +116 -0
  125. package/lib/core/analytics/sanitize.d.ts +44 -0
  126. package/lib/core/analytics/sanitize.js +260 -0
  127. package/lib/core/analytics/sentry-runtime.d.ts +15 -0
  128. package/lib/core/analytics/sentry-runtime.js +97 -0
  129. package/lib/core/analytics/sentry.d.ts +67 -0
  130. package/lib/core/analytics/sentry.js +613 -0
  131. package/lib/core/analytics/types.d.ts +48 -0
  132. package/lib/core/analytics/types.js +3 -0
  133. package/lib/core/analytics/user-identity.d.ts +41 -0
  134. package/lib/core/analytics/user-identity.js +141 -0
  135. package/lib/core/analytics/version.d.ts +6 -0
  136. package/lib/core/analytics/version.js +10 -0
  137. package/lib/core/attribution.d.ts +111 -0
  138. package/lib/core/attribution.js +142 -0
  139. package/lib/core/auth/index.d.ts +1 -0
  140. package/lib/core/auth/index.js +18 -0
  141. package/lib/core/auth/verify.d.ts +2 -0
  142. package/lib/core/auth/verify.js +31 -0
  143. package/lib/core/base.class.d.ts +152 -0
  144. package/lib/core/base.class.js +172 -0
  145. package/lib/core/cache.d.ts +9 -0
  146. package/lib/core/cache.js +31 -0
  147. package/lib/core/constants/adapters.d.ts +103 -0
  148. package/lib/core/constants/adapters.js +180 -0
  149. package/lib/core/constants/core.d.ts +133 -0
  150. package/lib/core/constants/core.js +209 -0
  151. package/lib/core/constants/swap-router.d.ts +150 -0
  152. package/lib/core/constants/swap-router.js +169 -0
  153. package/lib/core/constants/vaults.d.ts +93 -0
  154. package/lib/core/constants/vaults.js +273 -0
  155. package/lib/core/constants/web3.d.ts +91 -0
  156. package/lib/core/constants/web3.js +229 -0
  157. package/lib/core/errors/index.d.ts +114 -0
  158. package/lib/core/errors/index.js +183 -0
  159. package/lib/core/fetcher.d.ts +198 -0
  160. package/lib/core/fetcher.js +903 -0
  161. package/lib/core/helpers/adapters.d.ts +13 -0
  162. package/lib/core/helpers/adapters.js +39 -0
  163. package/lib/core/helpers/chain-address.d.ts +13 -0
  164. package/lib/core/helpers/chain-address.js +47 -0
  165. package/lib/core/helpers/chain-error.d.ts +207 -0
  166. package/lib/core/helpers/chain-error.js +682 -0
  167. package/lib/core/helpers/chain-support.d.ts +80 -0
  168. package/lib/core/helpers/chain-support.js +115 -0
  169. package/lib/core/helpers/core.d.ts +68 -0
  170. package/lib/core/helpers/core.js +285 -0
  171. package/lib/core/helpers/explorer-link.d.ts +16 -0
  172. package/lib/core/helpers/explorer-link.js +26 -0
  173. package/lib/core/helpers/multicall.d.ts +68 -0
  174. package/lib/core/helpers/multicall.js +103 -0
  175. package/lib/core/helpers/revert-decode.d.ts +248 -0
  176. package/lib/core/helpers/revert-decode.js +515 -0
  177. package/lib/core/helpers/signer.d.ts +52 -0
  178. package/lib/core/helpers/signer.js +145 -0
  179. package/lib/core/helpers/swap-router.d.ts +211 -0
  180. package/lib/core/helpers/swap-router.js +480 -0
  181. package/lib/core/helpers/vault-version.d.ts +23 -0
  182. package/lib/core/helpers/vault-version.js +75 -0
  183. package/lib/core/helpers/vaults.d.ts +89 -0
  184. package/lib/core/helpers/vaults.js +235 -0
  185. package/lib/core/helpers/web3.d.ts +353 -0
  186. package/lib/core/helpers/web3.js +992 -0
  187. package/lib/core/index.d.ts +23 -0
  188. package/lib/core/index.js +40 -0
  189. package/lib/core/logger/index.d.ts +98 -0
  190. package/lib/core/logger/index.js +144 -0
  191. package/lib/core/logger/slack.d.ts +16 -0
  192. package/lib/core/logger/slack.js +57 -0
  193. package/lib/core/vault-metadata.d.ts +12 -0
  194. package/lib/core/vault-metadata.js +42 -0
  195. package/lib/core/version-check.d.ts +58 -0
  196. package/lib/core/version-check.js +182 -0
  197. package/lib/evm/index.d.ts +2 -0
  198. package/lib/evm/index.js +19 -0
  199. package/lib/evm/methods/crossChainVault.d.ts +128 -0
  200. package/lib/evm/methods/crossChainVault.js +853 -0
  201. package/lib/evm/methods/crossChainVaultRegistry.d.ts +93 -0
  202. package/lib/evm/methods/crossChainVaultRegistry.js +240 -0
  203. package/lib/evm/methods/index.d.ts +2 -0
  204. package/lib/evm/methods/index.js +19 -0
  205. package/lib/evm/types/crossChain.d.ts +363 -0
  206. package/lib/evm/types/crossChain.js +20 -0
  207. package/lib/evm/types/index.d.ts +1 -0
  208. package/lib/evm/types/index.js +18 -0
  209. package/lib/index.d.ts +30 -0
  210. package/lib/index.js +52 -0
  211. package/lib/main.d.ts +527 -0
  212. package/lib/main.js +601 -0
  213. package/lib/modules/api/fetcher.d.ts +82 -0
  214. package/lib/modules/api/fetcher.js +150 -0
  215. package/lib/modules/api/index.d.ts +1 -0
  216. package/lib/modules/api/index.js +6 -0
  217. package/lib/modules/api/main.d.ts +313 -0
  218. package/lib/modules/api/main.js +479 -0
  219. package/lib/modules/sub-accounts/fetcher.d.ts +53 -0
  220. package/lib/modules/sub-accounts/fetcher.js +120 -0
  221. package/lib/modules/sub-accounts/index.d.ts +2 -0
  222. package/lib/modules/sub-accounts/index.js +19 -0
  223. package/lib/modules/sub-accounts/main.d.ts +243 -0
  224. package/lib/modules/sub-accounts/main.js +205 -0
  225. package/lib/modules/sub-accounts/utils.d.ts +106 -0
  226. package/lib/modules/sub-accounts/utils.js +112 -0
  227. package/lib/modules/vaults/adapter.helpers.d.ts +64 -0
  228. package/lib/modules/vaults/adapter.helpers.js +184 -0
  229. package/lib/modules/vaults/fetcher.d.ts +147 -0
  230. package/lib/modules/vaults/fetcher.js +368 -0
  231. package/lib/modules/vaults/getters.d.ts +570 -0
  232. package/lib/modules/vaults/getters.js +3051 -0
  233. package/lib/modules/vaults/index.d.ts +20 -0
  234. package/lib/modules/vaults/index.js +44 -0
  235. package/lib/modules/vaults/main.d.ts +601 -0
  236. package/lib/modules/vaults/main.js +1623 -0
  237. package/lib/modules/vaults/prefetch.d.ts +65 -0
  238. package/lib/modules/vaults/prefetch.js +120 -0
  239. package/lib/modules/vaults/read.actions.d.ts +225 -0
  240. package/lib/modules/vaults/read.actions.js +596 -0
  241. package/lib/modules/vaults/types.d.ts +71 -0
  242. package/lib/modules/vaults/types.js +3 -0
  243. package/lib/modules/vaults/utils/call-data-decoder.d.ts +61 -0
  244. package/lib/modules/vaults/utils/call-data-decoder.js +194 -0
  245. package/lib/modules/vaults/utils/date-utils.d.ts +50 -0
  246. package/lib/modules/vaults/utils/date-utils.js +84 -0
  247. package/lib/modules/vaults/utils.d.ts +140 -0
  248. package/lib/modules/vaults/utils.js +799 -0
  249. package/lib/modules/vaults/write.actions.d.ts +529 -0
  250. package/lib/modules/vaults/write.actions.js +1749 -0
  251. package/lib/polyfills.d.ts +1 -0
  252. package/lib/polyfills.js +12 -0
  253. package/lib/sdk.d.ts +26721 -0
  254. package/lib/services/coingecko/fetcher.d.ts +15 -0
  255. package/lib/services/coingecko/fetcher.js +67 -0
  256. package/lib/services/coingecko/index.d.ts +2 -0
  257. package/lib/services/coingecko/index.js +19 -0
  258. package/lib/services/coingecko/utils.d.ts +1 -0
  259. package/lib/services/coingecko/utils.js +24 -0
  260. package/lib/services/debank/fetcher.d.ts +126 -0
  261. package/lib/services/debank/fetcher.js +47 -0
  262. package/lib/services/debank/index.d.ts +2 -0
  263. package/lib/services/debank/index.js +19 -0
  264. package/lib/services/debank/utils.d.ts +38 -0
  265. package/lib/services/debank/utils.js +297 -0
  266. package/lib/services/layerzero/deposits.d.ts +49 -0
  267. package/lib/services/layerzero/deposits.js +166 -0
  268. package/lib/services/layerzero/redeems.d.ts +20 -0
  269. package/lib/services/layerzero/redeems.js +92 -0
  270. package/lib/services/layerzero/utils.d.ts +9 -0
  271. package/lib/services/layerzero/utils.js +22 -0
  272. package/lib/services/octavfi/fetcher.d.ts +9 -0
  273. package/lib/services/octavfi/fetcher.js +103 -0
  274. package/lib/services/octavfi/index.d.ts +3 -0
  275. package/lib/services/octavfi/index.js +20 -0
  276. package/lib/services/octavfi/types.d.ts +34 -0
  277. package/lib/services/octavfi/types.js +3 -0
  278. package/lib/services/octavfi/utils.d.ts +16 -0
  279. package/lib/services/octavfi/utils.js +212 -0
  280. package/lib/services/subgraph/fetcher.d.ts +2 -0
  281. package/lib/services/subgraph/fetcher.js +61 -0
  282. package/lib/services/subgraph/index.d.ts +2 -0
  283. package/lib/services/subgraph/index.js +19 -0
  284. package/lib/services/subgraph/schema.d.ts +45 -0
  285. package/lib/services/subgraph/schema.js +75 -0
  286. package/lib/services/subgraph/vaults.d.ts +25 -0
  287. package/lib/services/subgraph/vaults.js +1106 -0
  288. package/lib/services/swap-quotes/index.d.ts +105 -0
  289. package/lib/services/swap-quotes/index.js +77 -0
  290. package/lib/services/swap-quotes/paraswap.d.ts +51 -0
  291. package/lib/services/swap-quotes/paraswap.js +138 -0
  292. package/lib/types/api.d.ts +280 -0
  293. package/lib/types/api.js +3 -0
  294. package/lib/types/index.d.ts +12 -0
  295. package/lib/types/index.js +28 -0
  296. package/lib/types/points.d.ts +28 -0
  297. package/lib/types/points.js +3 -0
  298. package/lib/types/pools.d.ts +144 -0
  299. package/lib/types/pools.js +3 -0
  300. package/lib/types/staking.d.ts +28 -0
  301. package/lib/types/staking.js +3 -0
  302. package/lib/types/sub-accounts.d.ts +140 -0
  303. package/lib/types/sub-accounts.js +3 -0
  304. package/lib/types/subgraph.d.ts +74 -0
  305. package/lib/types/subgraph.js +3 -0
  306. package/lib/types/typed-contract.d.ts +102 -0
  307. package/lib/types/typed-contract.js +3 -0
  308. package/lib/types/user.d.ts +1 -0
  309. package/lib/types/user.js +3 -0
  310. package/lib/types/vaults.d.ts +714 -0
  311. package/lib/types/vaults.js +24 -0
  312. package/lib/types/web3.d.ts +51 -0
  313. package/lib/types/web3.js +14 -0
  314. package/lib/types/webserver.d.ts +698 -0
  315. package/lib/types/webserver.js +3 -0
  316. package/package.json +78 -0
@@ -0,0 +1,714 @@
1
+ import type { IAddress, INormalizedNumber, VaultAddress } from './web3';
2
+ import type { IDebankProtocolExposure, IDebankTokenExposure, IOTCPosition, IWSSubaccountCefi, IWSSubaccountLoan, IWSTokenEntry, ITokenizedVaultOperator, ITokenizedVaultEoaOperator, IHIstoricalSnapshot, IApyOverride } from './webserver';
3
+ import type { InterfaceAbi } from 'ethers';
4
+ export interface IVaultLoan {
5
+ vault: VaultAddress;
6
+ address: IAddress;
7
+ lender: IAddress;
8
+ borrower: IAddress;
9
+ state: string;
10
+ totalRepaid: number;
11
+ principalToken: IWSTokenEntry;
12
+ principalAmount: number;
13
+ interestAmount: number;
14
+ upcomingPayment: {
15
+ amount: number;
16
+ dueDate: string;
17
+ };
18
+ apr: number;
19
+ initialPrincipalAmount: number;
20
+ deployedDate: string;
21
+ paymentInterval: number;
22
+ isIdleCapital: boolean;
23
+ allocation: number;
24
+ }
25
+ /**
26
+ * One row of borrower-health-factor data for a vault. `health_factor` is
27
+ * absent when the upstream August backend has no record for `borrower`
28
+ * (e.g. test loans whose borrower is not a registered subaccount), or when
29
+ * the per-borrower fetch failed — callers must handle the undefined case
30
+ * rather than assume a numeric value is present.
31
+ */
32
+ export interface IVaultBorrowerHealthFactor {
33
+ borrower: IAddress;
34
+ loan: IAddress;
35
+ health_factor?: {
36
+ datetime: string;
37
+ health_factor: number;
38
+ id: string;
39
+ total_collateral_value: number;
40
+ total_loan_value: number;
41
+ };
42
+ }
43
+ export type IVaultUserHistoryItem = {
44
+ timestamp: number;
45
+ address: IAddress;
46
+ amount: INormalizedNumber;
47
+ pool: IAddress;
48
+ chainId: number;
49
+ type: 'withdraw-request' | 'deposit' | 'withdraw-processed' | 'redeem';
50
+ transactionHash: IAddress;
51
+ /**
52
+ * The token address that was actually deposited, when known. Pre-deposit
53
+ * vaults accept multiple deposit assets (e.g. a sentUSD vault taking RLUSD,
54
+ * USDC, and USDT), so the vault's own metadata cannot tell a consumer which
55
+ * asset a given deposit used — only this per-row address can. UIs should
56
+ * resolve the displayed asset symbol/logo from `assetIn` rather than assuming
57
+ * the vault's first deposit asset. Absent for single-asset vaults and for
58
+ * withdraw/redeem rows, where the vault's underlying asset applies.
59
+ */
60
+ assetIn?: IAddress;
61
+ /**
62
+ * Receipt-token (vault share) amount burned on a withdraw **request**. An
63
+ * async withdrawal burns shares immediately, but the assets received are not
64
+ * known until the request settles (share price can drift), so `amount`'s
65
+ * asset figure is only a preview. UIs rendering a pending request should show
66
+ * these `shares` with the receipt symbol — the concrete on-chain fact — and
67
+ * reserve the asset amount for the settled ("processed") row. Present only on
68
+ * `withdraw-request` items.
69
+ */
70
+ shares?: INormalizedNumber;
71
+ };
72
+ /**
73
+ * A single reward paired with its backend-provided logo.
74
+ *
75
+ * `id` is the reward's stable backend identifier ({@link ITokenizedVaultReward.id})
76
+ * and is the key consumers should join on — it is unique even when two rewards
77
+ * share a multiplier and text. `label` is display-only: it mirrors the
78
+ * corresponding {@link IVaultRewards.additionalPoints} string (and so carries a
79
+ * leading space when `multiplier === 1`, e.g. `" Cores"`), so it is fine to
80
+ * print but must not be treated as a unique key.
81
+ *
82
+ * `imgUrl` is `null` when the backend has no logo for the reward, in which
83
+ * case consumers fall back to a bundled asset.
84
+ */
85
+ export type IVaultRewardDetail = {
86
+ id: string;
87
+ label: string;
88
+ text: string;
89
+ imgUrl: string | null;
90
+ multiplier: number;
91
+ };
92
+ export type IVaultRewards = {
93
+ points: string;
94
+ multiplier: number;
95
+ multipliers: {
96
+ value: number;
97
+ timestamp: number;
98
+ }[];
99
+ additionalPoints: string[];
100
+ /**
101
+ * Optional so this addition is non-breaking for external code that
102
+ * constructs an {@link IVaultRewards}. `getVaultRewards` always populates it;
103
+ * readers should treat an absent value as an empty list.
104
+ */
105
+ additionalPointsDetailed?: IVaultRewardDetail[];
106
+ };
107
+ export type IVaultExposureItem = {
108
+ amount: number;
109
+ chain: string;
110
+ decimals: number;
111
+ exposureType?: string;
112
+ id: string;
113
+ logoUrl?: string;
114
+ name: string;
115
+ protocol?: string;
116
+ symbol: string;
117
+ };
118
+ export type IExposurePerCategory = {
119
+ borrowing: IVaultExposureItem[];
120
+ supplying: IVaultExposureItem[];
121
+ lending: IWSSubaccountLoan[];
122
+ wallet: IVaultExposureItem[];
123
+ cefiBalance: number;
124
+ defiBalance: number;
125
+ walletBalance: number;
126
+ loanBalance: number;
127
+ };
128
+ /**
129
+ * @todo clean up to minimize data transfer
130
+ * ```typescript
131
+ * {
132
+ * defi: IOctavfiPortfolio[]
133
+ * cefi: IWSSubaccountCefi[]
134
+ * otc: Record<string, IOTCPosition>
135
+ * breakdown: { // this will be total net values
136
+ * defi: number;
137
+ * cefi: number;
138
+ * otc: number;
139
+ * total: number;
140
+ * }
141
+ * }
142
+ * ```
143
+ */
144
+ export interface IVaultAllocations {
145
+ defi: IDebankProtocolExposure[];
146
+ tokens: IDebankTokenExposure[];
147
+ cefi: IWSSubaccountCefi[];
148
+ unfilteredTokens: IDebankTokenExposure[];
149
+ otc: Record<string, IOTCPosition>;
150
+ exposurePerCategory?: IExposurePerCategory;
151
+ netValue?: number;
152
+ defiPerBorrower: Record<`0x${string}`, {
153
+ exposure: any[];
154
+ positions: any[];
155
+ }>;
156
+ }
157
+ /**
158
+ * A vault's APY breakdown.
159
+ *
160
+ * **Unit contract: every rate on this type is a PERCENTAGE, not a decimal
161
+ * fraction.** `7.95` means 7.95%. The backend reports these as decimal fractions
162
+ * (`0.0795`); the SDK multiplies by 100 exactly once, uniformly across every rate
163
+ * field, before returning them. Consumers must therefore divide by 100 at most once
164
+ * — and must apply the same treatment to `apy`, `liquidApy`, `pointsApy`,
165
+ * `campaignApy` and `underlyingApy`, because they all arrive in the same unit.
166
+ *
167
+ * This is stated explicitly because the convention going undocumented let a
168
+ * consumer scale a subset of these fields twice, making them contribute 1/100th of
169
+ * their value to a displayed total (AUGUST-6967). The unit is uniform here by
170
+ * design; treating some of these fields as decimals and others as percentages is
171
+ * always a bug on the consumer side.
172
+ */
173
+ export interface IVaultApy {
174
+ /** Base vault APY as a percentage (7.95 = 7.95%). */
175
+ apy: number;
176
+ /** Human-readable note on how the APY is derived; empty or null when unset. */
177
+ explainer: string;
178
+ /** Liquid-yield component as a percentage. */
179
+ liquidApy: number;
180
+ /** Points-program APY as a percentage, or null when the vault has no points. */
181
+ pointsApy: number | null;
182
+ /** Campaign-boost APY as a percentage, or null when no campaign is running. */
183
+ campaignApy: number | null;
184
+ /** Claimable rewards, in the reward token's own units — not a percentage. */
185
+ rewardsClaimable: number;
186
+ /** Compounded rewards, in the reward token's own units — not a percentage. */
187
+ rewardsCompounded: number;
188
+ /** Underlying-asset APY as a percentage (e.g. staking yield on the deposit asset). */
189
+ underlyingApy: number;
190
+ }
191
+ export interface IVaultStrategist {
192
+ address: IAddress;
193
+ logo: string;
194
+ name: string;
195
+ type?: string;
196
+ website_url: string | null;
197
+ }
198
+ export type IVaultVersion = 'evm-0' | 'evm-1' | 'evm-2' | 'sol-0' | 'sui-0' | 'stellar-0';
199
+ export type { ChainType } from './web3';
200
+ /**
201
+ * Adapter configuration for vaults that support deposits with alternative tokens
202
+ */
203
+ export interface IVaultAdapterConfig {
204
+ lpTokenAddress?: IAddress;
205
+ isNativeTokenDeposit: boolean;
206
+ isWrappedTokenDeposit: boolean;
207
+ wrappedTokenAddress?: IAddress;
208
+ referralId?: IAddress | string;
209
+ abi?: InterfaceAbi;
210
+ wrapperAddress?: IAddress;
211
+ viewAdapter?: IAddress;
212
+ tokens?: IAddress[];
213
+ bridgeId?: number;
214
+ }
215
+ /**
216
+ * Provenance timestamps for a vault's server-side data, mapped from the backend
217
+ * `freshness` object.
218
+ *
219
+ * A vault's share price and its APY come from two different pipelines: the SDK
220
+ * reads share price live from chain (`totalAssets()/totalSupply()`), while APY is a
221
+ * backend column recomputed on a schedule. These stamps make the remaining gap
222
+ * visible so a UI can render "data as of X" instead of implying both numbers are
223
+ * equally current.
224
+ *
225
+ * The three fields are **independently nullable and independently meaningful** —
226
+ * none of them is a fallback for another. In particular, when
227
+ * `shareRatioSnapshotAt` is later than `apyComputedAt`, a share-price snapshot has
228
+ * landed that the APY has not yet been recomputed from: that ordering is the
229
+ * staleness signal.
230
+ *
231
+ * Every value is an RFC 3339 UTC string with a trailing `Z`, exactly as the backend
232
+ * sends it — the SDK does not reformat or reinterpret them. Keep the `Z` if you
233
+ * pass these anywhere: `new Date('2026-07-25T00:01:46')` (no `Z`) is parsed as
234
+ * *local* time and silently shifts by the viewer's UTC offset.
235
+ *
236
+ * @example
237
+ * ```ts
238
+ * const vault = await sdk.vaults.getVault(address);
239
+ * const { apyComputedAt, shareRatioSnapshotAt } = vault.freshness ?? {};
240
+ * // Only comparable when BOTH are present.
241
+ * const apyLagsSharePrice =
242
+ * !!apyComputedAt &&
243
+ * !!shareRatioSnapshotAt &&
244
+ * new Date(shareRatioSnapshotAt) > new Date(apyComputedAt);
245
+ * ```
246
+ */
247
+ export interface IVaultFreshness {
248
+ /**
249
+ * When the backend last recomputed `historical_apy`, TVL and drawdown for this
250
+ * vault. Null if never computed.
251
+ */
252
+ apyComputedAt: string | null;
253
+ /**
254
+ * Timestamp of the newest persisted share-price snapshot the backend holds. Null
255
+ * only when the vault has no snapshot yet.
256
+ *
257
+ * Populated regardless of whether the read loaded snapshots — the backend stamps
258
+ * it from a scalar `max(snapshot_datetime)`, so it is present even on
259
+ * `load_snapshots=false` reads (the basic and sub-accounts views). When it is
260
+ * null, treat it as absent: do not fall back to `apyComputedAt` or `cachedAt` in
261
+ * its place.
262
+ */
263
+ shareRatioSnapshotAt: string | null;
264
+ /**
265
+ * When the backend assembled the response body this vault came from, before its
266
+ * own response cache. Note this does **not** account for the SDK's client-side
267
+ * LRU (10–15 min on `fetchTokenizedVault` / `fetchTokenizedVaults`), so a vault
268
+ * served from that cache can be older than this stamp suggests is possible.
269
+ */
270
+ cachedAt: string | null;
271
+ }
272
+ export interface IVault {
273
+ max_drawdown?: number | null;
274
+ historical_apy?: Record<number, number> | null;
275
+ /**
276
+ * Compound-annualized historical APY keyed by horizon in days (1/7/30), as
277
+ * decimal fractions. Same shape and per-horizon null semantics as
278
+ * `historical_apy`. Display is opted in per vault via
279
+ * `apyOverride.is_show_compound_apy`; absent on older/cached responses.
280
+ */
281
+ historical_compound_apy?: Record<number, number> | null;
282
+ /** @deprecated Use getVaultHistoricalTimeseries instead */
283
+ historical_snapshots?: IHIstoricalSnapshot[];
284
+ depositCap?: INormalizedNumber;
285
+ maxDepositAmount?: INormalizedNumber;
286
+ /**
287
+ * Vault contract address. May be an EVM hex address, Solana base58 address,
288
+ * or Stellar base32 address depending on the vault's chain.
289
+ */
290
+ address: VaultAddress;
291
+ chainId: number;
292
+ name: string;
293
+ logoUrl: string;
294
+ receipt: {
295
+ address: VaultAddress;
296
+ symbol: string;
297
+ decimals: number;
298
+ };
299
+ description: string;
300
+ startDatetime: string;
301
+ status: 'active' | 'closed' | 'testing';
302
+ version: IVaultVersion;
303
+ tags: string[];
304
+ isFeatured: boolean;
305
+ isSpotlighted?: boolean;
306
+ withdrawalOnly?: boolean;
307
+ isVisible: boolean;
308
+ reserveTarget: number;
309
+ reserveTolerance: number;
310
+ decimals: number;
311
+ totalAssets: INormalizedNumber;
312
+ totalSupply: INormalizedNumber;
313
+ maxSupply: INormalizedNumber;
314
+ operators: ITokenizedVaultOperator[];
315
+ eoa_operators: ITokenizedVaultEoaOperator[];
316
+ depositAssets: {
317
+ address: VaultAddress;
318
+ symbol: string;
319
+ decimals: number;
320
+ }[];
321
+ apy: IVaultApy;
322
+ operator: IAddress;
323
+ rewards: IVaultRewards;
324
+ strategists: IVaultStrategist[];
325
+ fees: {
326
+ management: number;
327
+ isManagementWaived: boolean;
328
+ managementFeeWaivedUntilDate: string | null;
329
+ managementFeeWaivedUntilTvl: number | null;
330
+ performance: number;
331
+ isPerformanceWaived: boolean;
332
+ performanceFeeWaivedUntilDate: string | null;
333
+ performanceFeeWaivedUntilTvl: number | null;
334
+ };
335
+ lagDuration: number;
336
+ /**
337
+ * Backend-configured display buffer in seconds added on top of
338
+ * `lagDuration` for the withdrawal period shown to users. Null when the
339
+ * backend has not set a value — consumers apply their own default.
340
+ */
341
+ withdrawalMarginSeconds?: number | null;
342
+ /**
343
+ * IAT trader wallet addresses for the vault, from the backend
344
+ * `iat_traders` field. Address format follows the vault's chain
345
+ * (EVM hex / Solana base58 / Stellar). Null when not configured.
346
+ */
347
+ iatTraders?: string[] | null;
348
+ maxDailyDrawdown: number;
349
+ risk: string;
350
+ isWithdrawalPaused: boolean;
351
+ isDepositPaused: boolean;
352
+ idleAssets: INormalizedNumber;
353
+ loans?: IVaultLoan[];
354
+ allocations?: IVaultAllocations;
355
+ position?: IVaultPosition;
356
+ linkOnly?: boolean;
357
+ composabilityIntegrations?: Array<{
358
+ name: string;
359
+ description: string;
360
+ earningMultiplier: number;
361
+ protocolUrl: string;
362
+ logoUrl: string;
363
+ tokenizedVaultId: string;
364
+ id: string;
365
+ }>;
366
+ dailyPnlPerShare?: {
367
+ timestamp: string;
368
+ value: number;
369
+ }[];
370
+ enabled_historical_price_horizons?: number[];
371
+ defaultApyHorizon?: 7 | 30 | null;
372
+ latest_reported_tvl?: number | null;
373
+ cachedAt?: string | null;
374
+ /**
375
+ * Provenance timestamps for the vault's server-side data — when its APY was last
376
+ * recomputed, when its newest share-price snapshot was taken, and when the
377
+ * backend built the response. Null (or a null member) when the backend did not
378
+ * report that stamp; see {@link IVaultFreshness}.
379
+ */
380
+ freshness?: IVaultFreshness | null;
381
+ showCapFilled?: boolean | null;
382
+ /** Controls how the vault's APY is displayed; null when the backend has not set an override. */
383
+ apyOverride?: IApyOverride | null;
384
+ programId?: string;
385
+ /** Instant redemption config, populated from backend instant_redeem_config */
386
+ instant_redeem_config?: {
387
+ subaccountAddress: IAddress;
388
+ outputAssetSymbol: string;
389
+ redeemableAssets: Array<{
390
+ address: IAddress;
391
+ symbol: string;
392
+ decimals: number;
393
+ spreadBps: number;
394
+ }>;
395
+ isPaused: boolean;
396
+ availableLiquidity: number;
397
+ } | null;
398
+ }
399
+ export declare enum VaultRedemptionStatus {
400
+ AWAITING_COOLDOWN = "awaiting_cooldown",
401
+ READY_TO_CLAIM = "ready_to_claim"
402
+ }
403
+ export type IVaultAvailableRedemption = {
404
+ id: string;
405
+ hash: string;
406
+ timestamp: number;
407
+ receiver: IAddress;
408
+ day: INormalizedNumber;
409
+ month: INormalizedNumber;
410
+ year: INormalizedNumber;
411
+ amount: INormalizedNumber;
412
+ date: Date;
413
+ vault: IAddress;
414
+ status?: VaultRedemptionStatus;
415
+ };
416
+ export type IVaultRedemptionHistoryItem = {
417
+ receiver: IAddress;
418
+ amount: INormalizedNumber;
419
+ processed: Date;
420
+ requested: Date;
421
+ vault: IAddress;
422
+ transactionHash?: string;
423
+ };
424
+ export interface IVaultPosition {
425
+ vault: VaultAddress;
426
+ status: string;
427
+ availableRedemptions: IVaultAvailableRedemption[];
428
+ pendingRedemptions: IVaultAvailableRedemption[];
429
+ redeemable: INormalizedNumber;
430
+ walletBalance: INormalizedNumber;
431
+ }
432
+ export type IVaultOrderParam = 'asc' | 'desc';
433
+ export type IVaultHistoricalParams = {
434
+ daysAgo?: number;
435
+ order?: IVaultOrderParam;
436
+ interval?: 'days' | 'weeks' | 'months' | 'years';
437
+ };
438
+ export interface IVaultUserLifetimePnl {
439
+ tokenSymbol: string;
440
+ totalDeposited: INormalizedNumber;
441
+ totalDepositedUsd: number;
442
+ totalWithdrawn: INormalizedNumber;
443
+ totalWithdrawnUsd: number;
444
+ currentPositionValue: INormalizedNumber;
445
+ currentPositionValueUsd: number;
446
+ lifetimePnl: INormalizedNumber;
447
+ lifetimePnlUsd: number;
448
+ pnlPercentage: number;
449
+ }
450
+ export interface IVaultPnl {
451
+ totalPnl: INormalizedNumber;
452
+ pnlUsd: number;
453
+ }
454
+ /**
455
+ * Response for GET /tokenized_vault/annualized_apy/{vault_address}
456
+ *
457
+ * Supported Vaults: cUSDO, tETH, wstETH, rsETH
458
+ *
459
+ * @deprecated The `hgETH30dLiquidAPY` and `hgETH7dLiquidAPY` fields are deprecated.
460
+ * These fields will be removed on 2026-01-01.
461
+ * Use `liquidAPY30Day` and `liquidAPY7Day` fields instead.
462
+ */
463
+ export interface IVaultAnnualizedApy {
464
+ vaultAddress: IAddress;
465
+ liquidityApy: number;
466
+ annualizedApy: number;
467
+ /** @deprecated Use `liquidAPY7Day` instead. Will be removed on 2026-01-01. */
468
+ hgETH7dLiquidAPY?: number;
469
+ /** @deprecated Use `liquidAPY30Day` instead. Will be removed on 2026-01-01. */
470
+ hgETH30dLiquidAPY?: number;
471
+ liquidAPY7Day?: number;
472
+ liquidAPY30Day?: number;
473
+ }
474
+ /**
475
+ * Response for GET /tokenized_vault/vault_summary/{vault_address}
476
+ */
477
+ export interface IVaultSummary {
478
+ vaultAddress: IAddress;
479
+ name: string;
480
+ type: string;
481
+ chain: string;
482
+ recentReturns: {
483
+ day: number;
484
+ week: number;
485
+ month: number;
486
+ };
487
+ }
488
+ /**
489
+ * Response for GET /withdrawals/{chain}/{vault_address}
490
+ */
491
+ export interface IVaultWithdrawals {
492
+ vaultAddress: IAddress;
493
+ chain: string;
494
+ totalWithdrawals: INormalizedNumber;
495
+ pendingQueue: Array<{
496
+ id: string;
497
+ amount: INormalizedNumber;
498
+ requestedAt: string;
499
+ estimatedCompletionDate: string;
500
+ receiver: IAddress;
501
+ }>;
502
+ }
503
+ /**
504
+ * Response for GET /vaults/\{vault_addr\}/pending-redemptions
505
+ */
506
+ export interface IVaultPendingRedemptions {
507
+ vault: {
508
+ address: string;
509
+ chainId: number;
510
+ name: string | null;
511
+ symbol: string | null;
512
+ };
513
+ asset: {
514
+ address: string;
515
+ symbol: string | null;
516
+ decimals: number | null;
517
+ };
518
+ liquidity: {
519
+ available: number;
520
+ };
521
+ summary: {
522
+ totalPending: number;
523
+ pendingCount: number;
524
+ pendingToLiquidityRatio: number | null;
525
+ isLiquiditySufficient: boolean;
526
+ shortfall: number | null;
527
+ nextRedemptionDate: string | null;
528
+ isOverdue: boolean;
529
+ };
530
+ redemptionsByDate: Array<{
531
+ date: string;
532
+ assets: number;
533
+ daysUntilDue: number;
534
+ isOverdue: boolean;
535
+ }>;
536
+ }
537
+ /**
538
+ * One unrealized-PnL snapshot for a vault, computed by the August backend
539
+ * from periodic vault state. `timestamp` is an ISO-8601 datetime; monetary
540
+ * fields are denominated in the vault's reference asset
541
+ * (`referenceAsset`) except `assetPrice`, which is the asset's USD price.
542
+ */
543
+ export type IUnrealizedPnlSnapshot = {
544
+ timestamp: string;
545
+ vaultName: string;
546
+ vaultAddress: string;
547
+ strategistName: string | null;
548
+ referenceAsset: string;
549
+ assetPrice: number;
550
+ tvlOnVault: number;
551
+ currentRedeemRatio: number;
552
+ actualTvl: number;
553
+ adjustedRedeemRatio: number;
554
+ unrealizedPnl: number;
555
+ unrealizedPnlInAsset: number;
556
+ };
557
+ /**
558
+ * Vault metadata item from upshift API
559
+ */
560
+ export interface IVaultMetadataItem {
561
+ symbol: string;
562
+ subgraph: string;
563
+ address: string;
564
+ }
565
+ /**
566
+ * Response type for getVaultMetadata
567
+ * Keys are lowercase of the symbol value
568
+ */
569
+ export type IVaultMetadata = Record<string, IVaultMetadataItem>;
570
+ /**
571
+ * Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
572
+ * the ERC-4626 (`deposit(uint256, address)`) and multi-asset
573
+ * (`deposit(address, uint256, address)`) deposit interfaces.
574
+ *
575
+ * Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
576
+ * constants exactly. Set by an admin per-vault via `enableVault` and looked
577
+ * up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
578
+ * this — the router resolves it internally.
579
+ */
580
+ export declare enum SwapRouterVaultType {
581
+ ERC4626 = 1,
582
+ TokenizedVaultV2 = 2
583
+ }
584
+ /**
585
+ * One swap leg passed to `SwapRouter.swapAndDeposit`.
586
+ *
587
+ * The router pulls `amountIn` of `tokenIn` from the caller, approves the
588
+ * configured `tokenTransferProxies[router]` address, and calls `router` with
589
+ * `payload`. Output is measured by balance-diff and must clear `minAmountOut`
590
+ * or the call reverts with `SlippageError`.
591
+ *
592
+ * For a single-hop swap, `tokenOut` is typically the vault's reference asset.
593
+ * For multi-hop, intermediate legs use any whitelisted token.
594
+ */
595
+ export interface ISwapParams {
596
+ /** ERC-20 address pulled from the caller. Must be whitelisted via `whitelistedTokens`. */
597
+ tokenIn: IAddress;
598
+ /** ERC-20 address the router is expected to produce. */
599
+ tokenOut: IAddress;
600
+ /** Input amount in `tokenIn`'s smallest unit (no decimals). */
601
+ amountIn: bigint;
602
+ /** Minimum acceptable `tokenOut` output. Below this the call reverts. */
603
+ minAmountOut: bigint;
604
+ /** Whitelisted DEX router target (enabled via `enableRouter`). */
605
+ router: IAddress;
606
+ /** ABI-encoded calldata to invoke on `router`. */
607
+ payload: `0x${string}`;
608
+ }
609
+ /**
610
+ * Common options shared by every public SwapRouter SDK method.
611
+ */
612
+ export interface ISwapRouterBaseOptions {
613
+ /** EVM chain ID — must have an entry in `SWAP_ROUTER_ADDRESSES`. */
614
+ chainId: number;
615
+ /** August vault address. Must be registered via `enableVault` on the router. */
616
+ vault: IAddress;
617
+ /** Address that receives the minted vault shares. */
618
+ receiver: IAddress;
619
+ /**
620
+ * 32-byte origin/referral code registered via `addOrigin`. Drives the
621
+ * origin-fee accrual. Defaults to {@link ORIGIN_CODES.default} when omitted.
622
+ */
623
+ originCode?: `0x${string}`;
624
+ /** When `true`, the helper awaits a single confirmation before returning. */
625
+ wait?: boolean;
626
+ }
627
+ /**
628
+ * Options for `swapAndDeposit` — ERC-20 in, vault reference asset out.
629
+ */
630
+ export interface ISwapAndDepositOptions extends ISwapRouterBaseOptions {
631
+ /** One or more swap legs. Capped by the contract's `MAX_SWAPS`. */
632
+ swaps: ISwapParams[];
633
+ }
634
+ /**
635
+ * Options for `depositViaSwapRouter` — direct deposit (no swap) of an
636
+ * already-held asset, routed through the SwapRouter so origin/swap-fee
637
+ * accounting still applies.
638
+ */
639
+ export interface ISwapRouterDirectDepositOptions extends ISwapRouterBaseOptions {
640
+ /** Deposited ERC-20 asset. For ERC-4626 vaults this must equal the reference asset. */
641
+ asset: IAddress;
642
+ /** Amount in `asset`'s smallest unit. */
643
+ amount: bigint;
644
+ }
645
+ /**
646
+ * Options for `depositNativeViaSwapRouter` — wraps `msg.value` to the
647
+ * chain's wrapped-native token and deposits. Only valid when the vault's
648
+ * reference asset equals `wrappedNativeTokenAddress`.
649
+ */
650
+ export interface ISwapRouterNativeDepositOptions extends ISwapRouterBaseOptions {
651
+ /** Native token amount in wei. Sent as `msg.value`. */
652
+ amount: bigint;
653
+ }
654
+ /**
655
+ * Options for {@link swapRouterDeposit} — the high-level, explicit SwapRouter
656
+ * deposit entry point. It reads the vault's reference asset and decimals
657
+ * on-chain, then picks the correct router path from `depositAsset`, so callers
658
+ * do not hand-build swap legs or pre-resolve decimals themselves.
659
+ *
660
+ * Prefer this over relying on the implicit routing inside `vaultDeposit`: here
661
+ * the caller opts into the SwapRouter deliberately, so a vault is never
662
+ * silently routed through a swap it does not need — the failure mode that broke
663
+ * native multi-asset deposits when a multi-asset vault was added to
664
+ * `VAULTS_USING_SWAP_ROUTER`.
665
+ *
666
+ * Unlike {@link ISwapRouterBaseOptions}, `receiver` is optional here and
667
+ * defaults to the signer's resolved EOA.
668
+ */
669
+ export interface ISwapRouterDepositOptions extends Omit<ISwapRouterBaseOptions, 'receiver'> {
670
+ /**
671
+ * Token being deposited, held by the signer. Its relationship to the vault's
672
+ * reference asset selects the router path:
673
+ * - equals the reference asset → direct router deposit (no swap);
674
+ * - the zero address → native-token deposit (only when the reference asset
675
+ * is the chain's wrapped-native token);
676
+ * - any other ERC-20 → a swap to the reference asset via the chain's
677
+ * whitelisted DEX aggregator, bundled into the deposit.
678
+ */
679
+ depositAsset: IAddress;
680
+ /** Amount in `depositAsset`'s smallest unit (decimal string or bigint). */
681
+ amount: string | bigint;
682
+ /** Address that receives the minted shares. Defaults to the signer's EOA. */
683
+ receiver?: IAddress;
684
+ /**
685
+ * Max slippage in basis points for the swap leg. Only used when `depositAsset`
686
+ * differs from the reference asset; passed through to the swap quote, whose
687
+ * own default applies when omitted.
688
+ */
689
+ slippageBps?: number;
690
+ }
691
+ /**
692
+ * Options for {@link getSwapRouterDepositResult} — resolves the real,
693
+ * post-execution outcome of a SwapRouter deposit from its mined transaction
694
+ * receipt, rather than the pre-trade quote shown before submission.
695
+ */
696
+ export interface ISwapRouterDepositResultOptions {
697
+ /** Hash of a mined SwapRouter deposit transaction (e.g. from {@link swapRouterDeposit}). */
698
+ txHash: string;
699
+ /** The vault that was deposited into — isolates its own `Deposit` event from the router's unrelated logs. */
700
+ vault: IAddress;
701
+ }
702
+ /**
703
+ * Real, on-chain outcome of a SwapRouter deposit, decoded from the vault's own
704
+ * `Deposit` event (the SwapRouter contract itself emits no deposit/amount-out
705
+ * event — see {@link getSwapRouterDepositResult}). For a swap deposit this is
706
+ * the actual post-swap amount that reached the vault, which can differ from
707
+ * the pre-trade quote a UI shows before the user submits.
708
+ */
709
+ export interface ISwapRouterDepositResult {
710
+ /** Raw amount of the vault's reference asset recorded as deposited (reference-asset decimals). */
711
+ amountOut: bigint;
712
+ /** Raw vault shares minted to the receiver (share-token decimals). */
713
+ sharesOut: bigint;
714
+ }