@upshiftfinance/sdk 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +408 -2
  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 +953 -0
  40. package/lib/abis/SwapRouter.js +1228 -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 +249 -0
  65. package/lib/adapters/evm/index.d.ts +539 -0
  66. package/lib/adapters/evm/index.js +656 -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/confirm.d.ts +88 -0
  70. package/lib/adapters/solana/confirm.js +291 -0
  71. package/lib/adapters/solana/constants.d.ts +42 -0
  72. package/lib/adapters/solana/constants.js +59 -0
  73. package/lib/adapters/solana/getters.d.ts +42 -0
  74. package/lib/adapters/solana/getters.js +275 -0
  75. package/lib/adapters/solana/idl/vault-idl.d.ts +700 -0
  76. package/lib/adapters/solana/idl/vault-idl.js +2101 -0
  77. package/lib/adapters/solana/idl/withdrawal-queue-idl.d.ts +795 -0
  78. package/lib/adapters/solana/idl/withdrawal-queue-idl.js +1864 -0
  79. package/lib/adapters/solana/index.d.ts +372 -0
  80. package/lib/adapters/solana/index.js +459 -0
  81. package/lib/adapters/solana/pricing.d.ts +184 -0
  82. package/lib/adapters/solana/pricing.js +239 -0
  83. package/lib/adapters/solana/queue-hints.d.ts +29 -0
  84. package/lib/adapters/solana/queue-hints.js +59 -0
  85. package/lib/adapters/solana/queue.actions.d.ts +97 -0
  86. package/lib/adapters/solana/queue.actions.js +468 -0
  87. package/lib/adapters/solana/token-reads.d.ts +108 -0
  88. package/lib/adapters/solana/token-reads.js +145 -0
  89. package/lib/adapters/solana/types.d.ts +325 -0
  90. package/lib/adapters/solana/types.js +3 -0
  91. package/lib/adapters/solana/utils.d.ts +229 -0
  92. package/lib/adapters/solana/utils.js +773 -0
  93. package/lib/adapters/solana/vault.actions.d.ts +140 -0
  94. package/lib/adapters/solana/vault.actions.js +657 -0
  95. package/lib/adapters/solana/withdrawal-queue.d.ts +125 -0
  96. package/lib/adapters/solana/withdrawal-queue.js +301 -0
  97. package/lib/adapters/stellar/actions.d.ts +41 -0
  98. package/lib/adapters/stellar/actions.js +126 -0
  99. package/lib/adapters/stellar/constants.d.ts +43 -0
  100. package/lib/adapters/stellar/constants.js +53 -0
  101. package/lib/adapters/stellar/getters.d.ts +68 -0
  102. package/lib/adapters/stellar/getters.js +290 -0
  103. package/lib/adapters/stellar/index.d.ts +126 -0
  104. package/lib/adapters/stellar/index.js +187 -0
  105. package/lib/adapters/stellar/invocation.d.ts +55 -0
  106. package/lib/adapters/stellar/invocation.js +92 -0
  107. package/lib/adapters/stellar/soroban.d.ts +131 -0
  108. package/lib/adapters/stellar/soroban.js +617 -0
  109. package/lib/adapters/stellar/submit.d.ts +42 -0
  110. package/lib/adapters/stellar/submit.js +195 -0
  111. package/lib/adapters/stellar/types.d.ts +57 -0
  112. package/lib/adapters/stellar/types.js +6 -0
  113. package/lib/adapters/stellar/utils.d.ts +24 -0
  114. package/lib/adapters/stellar/utils.js +34 -0
  115. package/lib/adapters/sui/client.d.ts +83 -0
  116. package/lib/adapters/sui/client.js +216 -0
  117. package/lib/adapters/sui/constants.d.ts +33 -0
  118. package/lib/adapters/sui/constants.js +31 -0
  119. package/lib/adapters/sui/index.d.ts +57 -0
  120. package/lib/adapters/sui/index.js +100 -0
  121. package/lib/adapters/sui/targets.d.ts +171 -0
  122. package/lib/adapters/sui/targets.js +225 -0
  123. package/lib/adapters/sui/utils.d.ts +8 -0
  124. package/lib/adapters/sui/utils.js +17 -0
  125. package/lib/core/analytics/app-name.d.ts +27 -0
  126. package/lib/core/analytics/app-name.js +48 -0
  127. package/lib/core/analytics/chain-name.d.ts +9 -0
  128. package/lib/core/analytics/chain-name.js +34 -0
  129. package/lib/core/analytics/constants.d.ts +15 -0
  130. package/lib/core/analytics/constants.js +28 -0
  131. package/lib/core/analytics/env.d.ts +46 -0
  132. package/lib/core/analytics/env.js +147 -0
  133. package/lib/core/analytics/index.d.ts +39 -0
  134. package/lib/core/analytics/index.js +83 -0
  135. package/lib/core/analytics/instrumentation.d.ts +29 -0
  136. package/lib/core/analytics/instrumentation.js +292 -0
  137. package/lib/core/analytics/method-taxonomy.d.ts +19 -0
  138. package/lib/core/analytics/method-taxonomy.js +156 -0
  139. package/lib/core/analytics/metrics.d.ts +48 -0
  140. package/lib/core/analytics/metrics.js +142 -0
  141. package/lib/core/analytics/sanitize.d.ts +57 -0
  142. package/lib/core/analytics/sanitize.js +272 -0
  143. package/lib/core/analytics/sentry-runtime.d.ts +15 -0
  144. package/lib/core/analytics/sentry-runtime.js +131 -0
  145. package/lib/core/analytics/sentry.d.ts +100 -0
  146. package/lib/core/analytics/sentry.js +696 -0
  147. package/lib/core/analytics/types.d.ts +55 -0
  148. package/lib/core/analytics/types.js +3 -0
  149. package/lib/core/analytics/user-identity.d.ts +55 -0
  150. package/lib/core/analytics/user-identity.js +218 -0
  151. package/lib/core/analytics/version.d.ts +6 -0
  152. package/lib/core/analytics/version.js +10 -0
  153. package/lib/core/attribution.d.ts +159 -0
  154. package/lib/core/attribution.js +194 -0
  155. package/lib/core/auth/index.d.ts +1 -0
  156. package/lib/core/auth/index.js +18 -0
  157. package/lib/core/auth/verify.d.ts +2 -0
  158. package/lib/core/auth/verify.js +35 -0
  159. package/lib/core/base.class.d.ts +193 -0
  160. package/lib/core/base.class.js +163 -0
  161. package/lib/core/cache.d.ts +9 -0
  162. package/lib/core/cache.js +31 -0
  163. package/lib/core/constants/adapters.d.ts +103 -0
  164. package/lib/core/constants/adapters.js +180 -0
  165. package/lib/core/constants/core.d.ts +162 -0
  166. package/lib/core/constants/core.js +281 -0
  167. package/lib/core/constants/swap-router.d.ts +180 -0
  168. package/lib/core/constants/swap-router.js +203 -0
  169. package/lib/core/constants/vaults.d.ts +93 -0
  170. package/lib/core/constants/vaults.js +277 -0
  171. package/lib/core/constants/web3.d.ts +106 -0
  172. package/lib/core/constants/web3.js +251 -0
  173. package/lib/core/errors/index.d.ts +177 -0
  174. package/lib/core/errors/index.js +257 -0
  175. package/lib/core/fetcher.d.ts +237 -0
  176. package/lib/core/fetcher.js +1103 -0
  177. package/lib/core/helpers/adapters.d.ts +13 -0
  178. package/lib/core/helpers/adapters.js +39 -0
  179. package/lib/core/helpers/chain-address.d.ts +13 -0
  180. package/lib/core/helpers/chain-address.js +47 -0
  181. package/lib/core/helpers/chain-error.d.ts +207 -0
  182. package/lib/core/helpers/chain-error.js +697 -0
  183. package/lib/core/helpers/chain-support.d.ts +98 -0
  184. package/lib/core/helpers/chain-support.js +139 -0
  185. package/lib/core/helpers/concurrency.d.ts +51 -0
  186. package/lib/core/helpers/concurrency.js +79 -0
  187. package/lib/core/helpers/core.d.ts +92 -0
  188. package/lib/core/helpers/core.js +368 -0
  189. package/lib/core/helpers/explorer-link.d.ts +16 -0
  190. package/lib/core/helpers/explorer-link.js +26 -0
  191. package/lib/core/helpers/multicall.d.ts +68 -0
  192. package/lib/core/helpers/multicall.js +103 -0
  193. package/lib/core/helpers/revert-decode.d.ts +248 -0
  194. package/lib/core/helpers/revert-decode.js +515 -0
  195. package/lib/core/helpers/signer.d.ts +61 -0
  196. package/lib/core/helpers/signer.js +184 -0
  197. package/lib/core/helpers/swap-router.d.ts +269 -0
  198. package/lib/core/helpers/swap-router.js +542 -0
  199. package/lib/core/helpers/vault-version.d.ts +24 -0
  200. package/lib/core/helpers/vault-version.js +83 -0
  201. package/lib/core/helpers/vaults.d.ts +89 -0
  202. package/lib/core/helpers/vaults.js +241 -0
  203. package/lib/core/helpers/web3.d.ts +366 -0
  204. package/lib/core/helpers/web3.js +1034 -0
  205. package/lib/core/index.d.ts +23 -0
  206. package/lib/core/index.js +40 -0
  207. package/lib/core/logger/curator-alert.d.ts +217 -0
  208. package/lib/core/logger/curator-alert.js +276 -0
  209. package/lib/core/logger/index.d.ts +99 -0
  210. package/lib/core/logger/index.js +163 -0
  211. package/lib/core/logger/slack.d.ts +49 -0
  212. package/lib/core/logger/slack.js +111 -0
  213. package/lib/core/vault-metadata.d.ts +12 -0
  214. package/lib/core/vault-metadata.js +42 -0
  215. package/lib/core/version-check.d.ts +58 -0
  216. package/lib/core/version-check.js +182 -0
  217. package/lib/evm/index.d.ts +2 -0
  218. package/lib/evm/index.js +19 -0
  219. package/lib/evm/methods/crossChainVault.d.ts +132 -0
  220. package/lib/evm/methods/crossChainVault.js +857 -0
  221. package/lib/evm/methods/crossChainVaultRegistry.d.ts +92 -0
  222. package/lib/evm/methods/crossChainVaultRegistry.js +239 -0
  223. package/lib/evm/methods/index.d.ts +2 -0
  224. package/lib/evm/methods/index.js +19 -0
  225. package/lib/evm/types/crossChain.d.ts +363 -0
  226. package/lib/evm/types/crossChain.js +20 -0
  227. package/lib/evm/types/index.d.ts +1 -0
  228. package/lib/evm/types/index.js +18 -0
  229. package/lib/index.d.ts +30 -0
  230. package/lib/index.js +52 -0
  231. package/lib/main.d.ts +596 -0
  232. package/lib/main.js +681 -0
  233. package/lib/modules/api/fetcher.d.ts +108 -0
  234. package/lib/modules/api/fetcher.js +187 -0
  235. package/lib/modules/api/index.d.ts +1 -0
  236. package/lib/modules/api/index.js +6 -0
  237. package/lib/modules/api/main.d.ts +587 -0
  238. package/lib/modules/api/main.js +911 -0
  239. package/lib/modules/sub-accounts/fetcher.d.ts +53 -0
  240. package/lib/modules/sub-accounts/fetcher.js +96 -0
  241. package/lib/modules/sub-accounts/index.d.ts +2 -0
  242. package/lib/modules/sub-accounts/index.js +19 -0
  243. package/lib/modules/sub-accounts/main.d.ts +249 -0
  244. package/lib/modules/sub-accounts/main.js +211 -0
  245. package/lib/modules/sub-accounts/utils.d.ts +106 -0
  246. package/lib/modules/sub-accounts/utils.js +112 -0
  247. package/lib/modules/vaults/adapter.helpers.d.ts +84 -0
  248. package/lib/modules/vaults/adapter.helpers.js +202 -0
  249. package/lib/modules/vaults/fetcher.d.ts +147 -0
  250. package/lib/modules/vaults/fetcher.js +357 -0
  251. package/lib/modules/vaults/getters.d.ts +1060 -0
  252. package/lib/modules/vaults/getters.js +4079 -0
  253. package/lib/modules/vaults/index.d.ts +20 -0
  254. package/lib/modules/vaults/index.js +44 -0
  255. package/lib/modules/vaults/main.d.ts +607 -0
  256. package/lib/modules/vaults/main.js +1687 -0
  257. package/lib/modules/vaults/prefetch.d.ts +65 -0
  258. package/lib/modules/vaults/prefetch.js +120 -0
  259. package/lib/modules/vaults/read.actions.d.ts +406 -0
  260. package/lib/modules/vaults/read.actions.js +891 -0
  261. package/lib/modules/vaults/types.d.ts +149 -0
  262. package/lib/modules/vaults/types.js +3 -0
  263. package/lib/modules/vaults/utils/call-data-decoder.d.ts +61 -0
  264. package/lib/modules/vaults/utils/call-data-decoder.js +194 -0
  265. package/lib/modules/vaults/utils/date-utils.d.ts +50 -0
  266. package/lib/modules/vaults/utils/date-utils.js +84 -0
  267. package/lib/modules/vaults/utils.d.ts +153 -0
  268. package/lib/modules/vaults/utils.js +818 -0
  269. package/lib/modules/vaults/write.actions.d.ts +812 -0
  270. package/lib/modules/vaults/write.actions.js +2377 -0
  271. package/lib/polyfills.d.ts +1 -0
  272. package/lib/polyfills.js +12 -0
  273. package/lib/sdk.d.ts +30173 -0
  274. package/lib/services/coingecko/fetcher.d.ts +15 -0
  275. package/lib/services/coingecko/fetcher.js +67 -0
  276. package/lib/services/coingecko/index.d.ts +2 -0
  277. package/lib/services/coingecko/index.js +19 -0
  278. package/lib/services/coingecko/utils.d.ts +1 -0
  279. package/lib/services/coingecko/utils.js +24 -0
  280. package/lib/services/debank/fetcher.d.ts +126 -0
  281. package/lib/services/debank/fetcher.js +47 -0
  282. package/lib/services/debank/index.d.ts +2 -0
  283. package/lib/services/debank/index.js +19 -0
  284. package/lib/services/debank/utils.d.ts +50 -0
  285. package/lib/services/debank/utils.js +325 -0
  286. package/lib/services/layerzero/deposits.d.ts +55 -0
  287. package/lib/services/layerzero/deposits.js +174 -0
  288. package/lib/services/layerzero/redeems.d.ts +20 -0
  289. package/lib/services/layerzero/redeems.js +92 -0
  290. package/lib/services/layerzero/utils.d.ts +9 -0
  291. package/lib/services/layerzero/utils.js +22 -0
  292. package/lib/services/octavfi/fetcher.d.ts +33 -0
  293. package/lib/services/octavfi/fetcher.js +39 -0
  294. package/lib/services/octavfi/index.d.ts +3 -0
  295. package/lib/services/octavfi/index.js +20 -0
  296. package/lib/services/octavfi/types.d.ts +34 -0
  297. package/lib/services/octavfi/types.js +3 -0
  298. package/lib/services/octavfi/utils.d.ts +16 -0
  299. package/lib/services/octavfi/utils.js +244 -0
  300. package/lib/services/subgraph/fetcher.d.ts +2 -0
  301. package/lib/services/subgraph/fetcher.js +66 -0
  302. package/lib/services/subgraph/index.d.ts +2 -0
  303. package/lib/services/subgraph/index.js +19 -0
  304. package/lib/services/subgraph/schema.d.ts +48 -0
  305. package/lib/services/subgraph/schema.js +87 -0
  306. package/lib/services/subgraph/vaults.d.ts +83 -0
  307. package/lib/services/subgraph/vaults.js +1282 -0
  308. package/lib/services/swap-quotes/index.d.ts +105 -0
  309. package/lib/services/swap-quotes/index.js +77 -0
  310. package/lib/services/swap-quotes/paraswap.d.ts +51 -0
  311. package/lib/services/swap-quotes/paraswap.js +138 -0
  312. package/lib/services/untangled/fetcher.d.ts +40 -0
  313. package/lib/services/untangled/fetcher.js +110 -0
  314. package/lib/services/untangled/index.d.ts +3 -0
  315. package/lib/services/untangled/index.js +20 -0
  316. package/lib/services/untangled/types.d.ts +83 -0
  317. package/lib/services/untangled/types.js +10 -0
  318. package/lib/services/untangled/utils.d.ts +91 -0
  319. package/lib/services/untangled/utils.js +339 -0
  320. package/lib/types/api.d.ts +498 -0
  321. package/lib/types/api.js +3 -0
  322. package/lib/types/index.d.ts +12 -0
  323. package/lib/types/index.js +28 -0
  324. package/lib/types/points.d.ts +28 -0
  325. package/lib/types/points.js +3 -0
  326. package/lib/types/pools.d.ts +144 -0
  327. package/lib/types/pools.js +3 -0
  328. package/lib/types/staking.d.ts +28 -0
  329. package/lib/types/staking.js +3 -0
  330. package/lib/types/sub-accounts.d.ts +150 -0
  331. package/lib/types/sub-accounts.js +3 -0
  332. package/lib/types/subgraph.d.ts +84 -0
  333. package/lib/types/subgraph.js +3 -0
  334. package/lib/types/typed-contract.d.ts +102 -0
  335. package/lib/types/typed-contract.js +3 -0
  336. package/lib/types/user.d.ts +1 -0
  337. package/lib/types/user.js +3 -0
  338. package/lib/types/vaults.d.ts +886 -0
  339. package/lib/types/vaults.js +30 -0
  340. package/lib/types/web3.d.ts +100 -0
  341. package/lib/types/web3.js +14 -0
  342. package/lib/types/webserver.d.ts +730 -0
  343. package/lib/types/webserver.js +3 -0
  344. package/package.json +79 -3
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Export getters
3
+ */
4
+ export * from './getters';
5
+ export * from './utils';
6
+ /**
7
+ * UpshiftVaults class
8
+ */
9
+ export * from './main';
10
+ /**
11
+ * Export points-related functions
12
+ */
13
+ export { getUserPoints, registerUserForPoints, fetchPointsLeaderboard, getYieldLastRealizedOn, } from './getters';
14
+ export { fetchVaultMetadata } from './fetcher';
15
+ export { getRewardMultiplierByTimestamp } from './utils';
16
+ /**
17
+ * Export write/read actions
18
+ */
19
+ export * from './write.actions';
20
+ export * from './read.actions';
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.getRewardMultiplierByTimestamp = exports.fetchVaultMetadata = exports.getYieldLastRealizedOn = exports.fetchPointsLeaderboard = exports.registerUserForPoints = exports.getUserPoints = void 0;
18
+ /**
19
+ * Export getters
20
+ */
21
+ __exportStar(require("./getters"), exports);
22
+ __exportStar(require("./utils"), exports);
23
+ /**
24
+ * UpshiftVaults class
25
+ */
26
+ __exportStar(require("./main"), exports);
27
+ /**
28
+ * Export points-related functions
29
+ */
30
+ var getters_1 = require("./getters");
31
+ Object.defineProperty(exports, "getUserPoints", { enumerable: true, get: function () { return getters_1.getUserPoints; } });
32
+ Object.defineProperty(exports, "registerUserForPoints", { enumerable: true, get: function () { return getters_1.registerUserForPoints; } });
33
+ Object.defineProperty(exports, "fetchPointsLeaderboard", { enumerable: true, get: function () { return getters_1.fetchPointsLeaderboard; } });
34
+ Object.defineProperty(exports, "getYieldLastRealizedOn", { enumerable: true, get: function () { return getters_1.getYieldLastRealizedOn; } });
35
+ var fetcher_1 = require("./fetcher");
36
+ Object.defineProperty(exports, "fetchVaultMetadata", { enumerable: true, get: function () { return fetcher_1.fetchVaultMetadata; } });
37
+ var utils_1 = require("./utils");
38
+ Object.defineProperty(exports, "getRewardMultiplierByTimestamp", { enumerable: true, get: function () { return utils_1.getRewardMultiplierByTimestamp; } });
39
+ /**
40
+ * Export write/read actions
41
+ */
42
+ __exportStar(require("./write.actions"), exports);
43
+ __exportStar(require("./read.actions"), exports);
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,607 @@
1
+ /**
2
+ * The Upshift Vaults Module.
3
+ *
4
+ * @module UpshiftVaults
5
+ */
6
+ /**
7
+ * Export getters
8
+ */
9
+ export * from './getters';
10
+ import type { IAddress, IChainId, IGetOriginInfoOptions, INormalizedNumber, IOriginInfo, IVaultHistoricalParams, IVaultPosition, IVaultUserHistoryItem } from '../../types';
11
+ import type SolanaAdapter from '../../adapters/solana';
12
+ import { UpshiftBase, type IUpshiftBase } from '../../core';
13
+ import { type IContractWriteOptions, type INativeDepositOptions } from './write.actions';
14
+ import type { Signer, Wallet } from 'ethers';
15
+ import type { IGetVaultsOptions, IVaultBaseOptions, IVaultCustomOptions } from './types';
16
+ export type { IGetVaultsOptions, IVaultBaseOptions, IVaultCustomOptions, } from './types';
17
+ /**
18
+ * Vault operations class handling multi-chain vault queries and user positions.
19
+ * Supports both EVM and Solana vaults with unified interface.
20
+ */
21
+ export declare class UpshiftVaults extends UpshiftBase {
22
+ private solanaService;
23
+ private headers;
24
+ /**
25
+ * Consumer-supplied Soroban RPC override for Stellar vault reads, with the
26
+ * network it was configured for so it's only applied to matching-network
27
+ * vaults (see `IVaultBaseOptions.stellarRpc`).
28
+ */
29
+ private _stellarRpc?;
30
+ constructor(baseConfig: IUpshiftBase, solana: SolanaAdapter);
31
+ /**
32
+ * @description deposit underlying token into the specified pool with adapter support. This is for when we cannot pass in a signer in sdk and need to do so as an arg
33
+ * @param signer signer / wallet object
34
+ * @param options object including pool contract address, user wallet address, string amount, and optional depositAsset
35
+ * @returns deposit tx hash
36
+ */
37
+ vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
38
+ /**
39
+ * @description deposit native token (ETH/AVAX/etc) into a vault using MultiAssetNativeDepositWrapper
40
+ * @param signer signer / wallet object
41
+ * @param options object including wrapper contract address, receiver address (optional), and amount
42
+ * @returns deposit tx hash
43
+ */
44
+ depositNative(signer: Signer | Wallet, options: INativeDepositOptions): Promise<string>;
45
+ /**
46
+ * Fetch all vaults across configured networks with optional enrichment.
47
+ * Automatically filters by available providers and optionally by chain IDs.
48
+ * Includes closed vaults that are still visible (`status: 'closed'`,
49
+ * `is_visible: true`) so consumers can render positions held in closed
50
+ * vaults; closed vaults with `is_visible: false` are excluded.
51
+ *
52
+ * RPC volume (worst case, wallet enrichment path): the per-vault
53
+ * `balanceOf`/`lagDuration` reads are aggregated into chunked Multicall3
54
+ * `aggregate3` batches per chain (10 calls per chunk) on chains where the
55
+ * canonical Multicall3 deployment is verified; other chains (e.g. Citrea
56
+ * 4114) keep one `eth_call` per read. Measured on a
57
+ * cold cache for a wallet with 62
58
+ * vaults across Ethereum + Avalanche: 83 RPC HTTP requests before batching,
59
+ * 54 after (~35% fewer; 124 per-vault `eth_call`s collapse into ~13
60
+ * `aggregate3` calls — the remaining requests are the per-vault cached
61
+ * decimals/receipt-token reads on a cold cache).
62
+ * @param options Filtering and enrichment configuration
63
+ * @returns Array of vault objects with optional loans/allocations/positions
64
+ */
65
+ getVaults(options?: IGetVaultsOptions): Promise<import("../../types").IVault[]>;
66
+ /**
67
+ * Calculate total deposited across all tokenized vaults by summing latest_reported_tvl.
68
+ * Uses the /tokenized_vault endpoint which returns latest_reported_tvl in USD.
69
+ * Wrapper vaults (non-null `underlying_vault_address`) are skipped: their
70
+ * deposits sit in the underlying vault as LP and are already counted there.
71
+ * @param options Optional configuration for loading vaults
72
+ * @returns Total deposited amount in USD (sum of all latest_reported_tvl values)
73
+ */
74
+ getTotalDeposited(options?: {
75
+ loadSubaccounts?: boolean;
76
+ loadSnapshots?: boolean;
77
+ }): Promise<number>;
78
+ /**
79
+ * Fetch detailed data for a single vault with optional enrichment.
80
+ * Automatically includes loans and allocations unless explicitly disabled.
81
+ * @param vault Vault contract address
82
+ * @param chainId Optional chain ID (uses active network if not provided)
83
+ * @param options Enrichment and wallet options
84
+ * @returns Single vault object with optional position data
85
+ * @throws {@link UpshiftValidationError} (`INVALID_CHAIN`) when `chainId` is
86
+ * not a chain the SDK recognises, or is a supported EVM chain with no RPC
87
+ * URL configured on this SDK instance.
88
+ */
89
+ getVault({ vault, chainId, options, loadSubaccounts, loadSnapshots, }: {
90
+ vault: IAddress;
91
+ chainId?: IChainId;
92
+ options?: IVaultCustomOptions;
93
+ loadSubaccounts?: boolean;
94
+ loadSnapshots?: boolean;
95
+ }): Promise<import("../../types").IVault>;
96
+ /**
97
+ * Fetch the active loans issued by a vault.
98
+ * @param vault Vault contract address
99
+ * @param chainId Optional chain ID (uses active network if not provided)
100
+ * @returns Loan data for the vault
101
+ * @throws {@link UpshiftValidationError} (`INVALID_CHAIN`) when `chainId` is
102
+ * not a chain the SDK recognises, or is a supported EVM chain with no RPC
103
+ * URL configured on this SDK instance.
104
+ */
105
+ getVaultLoans({ vault, chainId, }: {
106
+ vault: IAddress;
107
+ chainId?: IChainId;
108
+ }): Promise<import("../../types").IVaultLoan[]>;
109
+ /**
110
+ * Fetch a vault's loans broken down by sub-account.
111
+ * @param vault Vault contract address
112
+ * @param chainId Optional chain ID (uses active network if not provided)
113
+ * @returns Sub-account loan data for the vault
114
+ * @throws {@link UpshiftValidationError} (`INVALID_CHAIN`) when `chainId` is
115
+ * not a chain the SDK recognises, or is a supported EVM chain with no RPC
116
+ * URL configured on this SDK instance.
117
+ */
118
+ getVaultSubaccountLoans({ vault, chainId, }: {
119
+ vault: IAddress;
120
+ chainId?: IChainId;
121
+ }): Promise<import("../../types").IVaultLoan[]>;
122
+ /**
123
+ * Fetch a vault's DeFi / CeFi / OTC allocation breakdown.
124
+ * @param vault Vault contract address
125
+ * @param chainId Optional chain ID (uses active network if not provided)
126
+ * @returns Allocation data for the vault
127
+ * @throws {@link UpshiftValidationError} (`INVALID_CHAIN`) when `chainId` is
128
+ * not a chain the SDK recognises, or is a supported EVM chain with no RPC
129
+ * URL configured on this SDK instance.
130
+ */
131
+ getVaultAllocations({ vault, chainId, }: {
132
+ vault: IAddress;
133
+ chainId?: IChainId;
134
+ }): Promise<import("../../types").IVaultAllocations | {
135
+ status: number;
136
+ message: string;
137
+ }>;
138
+ /**
139
+ * @deprecated use getVaultHistoricalTimeseries instead
140
+ * @function getVaultApy gets the vault/pool APR, both current and historical
141
+ * @param vault pool/vault contract address
142
+ * @param historical (optional) When passed, returns the historical records of the pool/vault APR
143
+ * @returns a value or array of objects containing the APR and timestamp
144
+ */
145
+ getVaultApy({ vault, historical, }: {
146
+ vault: IAddress;
147
+ historical?: Partial<IVaultHistoricalParams>;
148
+ }): Promise<{
149
+ value: number;
150
+ timestamp: string;
151
+ }[]>;
152
+ /**
153
+ * @function getVaultHistoricalTimeseries gets historical timeseries data for a vault
154
+ * @param vault Vault contract address
155
+ * @param nDays Number of days of historical data (default 30, min 1)
156
+ * @returns Historical timeseries data with TVL, APY, PnL, share price, and other metrics
157
+ */
158
+ getVaultHistoricalTimeseries({ vault, nDays, }: {
159
+ vault: IAddress;
160
+ nDays?: number;
161
+ }): Promise<import("../../types").IHistoricalTimeseriesResponse>;
162
+ /**
163
+ * A wallet's redemption requests on one vault, split into
164
+ * `availableRedemptions` and `pendingRedemptions`. EVM, Stellar and Solana
165
+ * vault addresses are accepted; see `UpshiftSDK.getVaultAvailableRedemptions`
166
+ * for what each list holds on Solana.
167
+ *
168
+ * @param props - `vault`, the vault address; `chainId`, the EVM chain whose
169
+ * RPC to use (the active network when omitted); `wallet`, the holder,
170
+ * required for Solana, where it is base58; `verbose`, to also return the
171
+ * processed and requested withdrawal lists (always empty for Solana).
172
+ * @returns `{ availableRedemptions, pendingRedemptions }`, plus the verbose lists.
173
+ * @throws Error when unauthorized, or when `vault` is missing or not an address.
174
+ */
175
+ getVaultAvailableRedemptions({ vault, chainId, wallet, verbose, }: {
176
+ vault: IAddress;
177
+ chainId?: number;
178
+ wallet?: IAddress;
179
+ verbose?: boolean;
180
+ }): Promise<{
181
+ processedWithdrawals: import("../../types").ISubgraphWithdrawProccessed[];
182
+ requestedWithdrawals: import("../../types").ISubgraphWithdrawRequest[];
183
+ availableRedemptions: import("../../types").IVaultAvailableRedemption[];
184
+ pendingRedemptions: import("../../types").IVaultAvailableRedemption[];
185
+ }>;
186
+ /**
187
+ * Historical redemption requests for a vault (settled, cancelled, and
188
+ * pending-but-out-of-window). Filterable by wallet.
189
+ *
190
+ * Stellar vaults return `[]` — on-chain redemption history is not yet
191
+ * indexed for that adapter.
192
+ *
193
+ * @param vault - Vault address (EVM or Stellar). Stellar input is
194
+ * accepted but always resolves to an empty array for now.
195
+ * @param chainId - Chain id to resolve the RPC URL against. Falls
196
+ * back to the active network.
197
+ * @param wallet - Optional EVM wallet filter; when omitted the
198
+ * response includes every wallet that has ever redeemed against
199
+ * the vault.
200
+ * @param lookbackBlocks - How far back to scan for redemption logs.
201
+ * Defaults to the SDK's internal lookback when omitted.
202
+ * @returns The same array shape `getVaultRedemptionHistory` returns
203
+ * at the module level — historical redemption records, newest
204
+ * first.
205
+ *
206
+ * @example
207
+ * ```ts
208
+ * const history = await sdk.vaultsModule.getVaultRedemptionHistory({
209
+ * vault: '0xVault',
210
+ * chainId: 8453,
211
+ * wallet: '0xWallet',
212
+ * });
213
+ * ```
214
+ */
215
+ getVaultRedemptionHistory({ vault, chainId, wallet, lookbackBlocks, }: {
216
+ vault: IAddress;
217
+ chainId?: IChainId;
218
+ wallet?: IAddress;
219
+ lookbackBlocks?: number;
220
+ }): Promise<import("../../types").IVaultRedemptionHistoryItem[]>;
221
+ /**
222
+ * Fetch the wallet's positions across vaults — a single vault, one chain,
223
+ * or every chain with a configured provider.
224
+ *
225
+ * RPC volume (worst case, multi-vault paths): the two non-cacheable
226
+ * per-vault reads (`balanceOf`, `lagDuration`) are aggregated into chunked
227
+ * Multicall3 `aggregate3` batches per chain (10 calls per chunk) on chains
228
+ * where the canonical deployment is verified; unverified chains (e.g.
229
+ * Citrea 4114) and non-EVM vaults keep one `eth_call` per read. Measured
230
+ * on a cold cache for a wallet with 62
231
+ * vaults across Ethereum + Avalanche: 83 RPC HTTP requests before batching,
232
+ * 54 after (~35% fewer). A vault whose batched read fails (e.g. paused)
233
+ * falls back to its own per-vault reads — never to a zeroed balance.
234
+ */
235
+ getVaultPositions({ vault, wallet, chainId, showAllVaults, solanaWallet, stellarWallet, suiWallet, options, }: {
236
+ vault?: IAddress;
237
+ wallet?: IAddress;
238
+ chainId?: IChainId;
239
+ showAllVaults?: boolean;
240
+ solanaWallet?: string;
241
+ stellarWallet?: string;
242
+ /**
243
+ * Sui wallet address (`0x` + 64 hex chars). Validated now; Sui positions
244
+ * are not read yet, so passing it does not add Sui vaults to the result.
245
+ */
246
+ suiWallet?: string;
247
+ options?: IVaultBaseOptions;
248
+ }): Promise<IVaultPosition[]>;
249
+ /**
250
+ *
251
+ */
252
+ getUserHistory({ wallet, chainId, vault, }: {
253
+ wallet: IAddress;
254
+ chainId?: IChainId;
255
+ vault?: IAddress;
256
+ options?: IVaultBaseOptions;
257
+ }): Promise<IVaultUserHistoryItem[]>;
258
+ /**
259
+ * Get lifetime PnL for a user in a specific vault.
260
+ * @param props Vault address, wallet address, and optional chain ID
261
+ * @returns Lifetime PnL data including realized and unrealized PnL
262
+ * @throws {@link UpshiftHistoryUnavailableError} (`HISTORY_UNAVAILABLE`) when a
263
+ * live position has no indexed deposits, withdrawals or priceable share
264
+ * transfers.
265
+ * @throws {@link UpshiftPriceUnavailableError} (`PRICE_UNAVAILABLE`) when the
266
+ * vault's underlying asset has no USD price.
267
+ */
268
+ getVaultUserLifetimePnl({ vault, wallet, chainId, }: {
269
+ vault: IAddress;
270
+ wallet: IAddress;
271
+ chainId?: IChainId;
272
+ }): Promise<import("../../types").IVaultUserLifetimePnl>;
273
+ /**
274
+ * Get PnL for a vault (vault-level, not user-specific).
275
+ * Returns the vault's overall profit and loss across all users.
276
+ * @param props Vault address and optional chain ID
277
+ * @returns Vault PnL in USD and notional value
278
+ */
279
+ getVaultPnl({ vault, chainId, }: {
280
+ vault: IAddress;
281
+ chainId?: IChainId;
282
+ }): Promise<import("../../types").IVaultPnl>;
283
+ /**
284
+ *
285
+ */
286
+ getUserTransfers({ wallet, chainId, vault, options, }: {
287
+ wallet: IAddress;
288
+ chainId?: IChainId;
289
+ vault?: IAddress;
290
+ options?: IVaultBaseOptions;
291
+ }): Promise<{
292
+ id: string;
293
+ value: string;
294
+ to: string;
295
+ from: string;
296
+ pool: string;
297
+ block: number;
298
+ timestamp: number;
299
+ transactionHash: string;
300
+ }[]>;
301
+ /**
302
+ * Fetch a vault's deposit/withdrawal activity across every participant.
303
+ *
304
+ * This is the vault-wide counterpart to {@link getUserHistory}: instead of
305
+ * filtering the subgraph to one wallet, it returns every deposit,
306
+ * withdrawal-request, and processed-withdrawal event for the pool. Use it to
307
+ * answer flow questions ("how many deposits in the last 7 days", "net flow
308
+ * this week") that point-in-time TVL cannot.
309
+ *
310
+ * Rows are read from the Goldsky subgraph, paginated internally so busy
311
+ * vaults are not truncated at the 1000-row page cap. When `sinceTs` is
312
+ * supplied the reader stops paging once it passes the window boundary, so a
313
+ * short lookback stays cheap even on high-volume vaults.
314
+ *
315
+ * @param params - Query parameters.
316
+ * @param params.vault - Vault (pool) address to read activity for.
317
+ * @param params.chainId - Chain id of the vault; falls back to the active
318
+ * network when omitted. Required for the subgraph lookup.
319
+ * @param params.sinceTs - Lower bound (inclusive) as a Unix timestamp in
320
+ * seconds. Events at or after this time are returned.
321
+ * @param params.untilTs - Upper bound (inclusive) as a Unix timestamp in
322
+ * seconds. Events at or before this time are returned.
323
+ * @param params.types - Restrict to a subset of event types (e.g.
324
+ * `['deposit']`). Returns all types when omitted.
325
+ * @returns Activity items sorted oldest-first, each with a normalized
326
+ * `amount`, actor `address`, `type`, and `transactionHash`.
327
+ * @throws If `vault` is not a valid address, or no chain id can be resolved.
328
+ * @example
329
+ * ```ts
330
+ * const weekAgo = Math.floor(Date.now() / 1000) - 7 * 86_400;
331
+ * const deposits = await sdk.getVaultActivity({
332
+ * vault: '0x36eDbF0C834591BFdfCaC0Ef9605528c75c406aA',
333
+ * chainId: 143,
334
+ * sinceTs: weekAgo,
335
+ * types: ['deposit'],
336
+ * });
337
+ * console.log(`${deposits.length} deposits in the last 7 days`);
338
+ * ```
339
+ */
340
+ getVaultActivity({ vault, chainId, sinceTs, untilTs, types, }: {
341
+ vault: IAddress;
342
+ chainId?: IChainId;
343
+ sinceTs?: number;
344
+ untilTs?: number;
345
+ types?: IVaultUserHistoryItem['type'][];
346
+ }): Promise<IVaultUserHistoryItem[]>;
347
+ /**
348
+ * Resolve the ERC-20 tokens currently whitelisted for the `SwapRouter` on a
349
+ * chain — the any-token set a deposit UI can offer as swap-and-deposit inputs,
350
+ * each verified `true` against the router's on-chain allowlist.
351
+ *
352
+ * Reconstructs the set from the router's `TokenEnabled` event history and
353
+ * re-checks `whitelistedTokens(token)` for each (the mapping is not
354
+ * enumerable). See {@link getSwapRouterWhitelistedTokens} for the full
355
+ * two-stage behavior and RPC cost. Uses this instance's configured provider
356
+ * for `chainId`; returns `[]` (no RPC) when no router is deployed there or no
357
+ * provider is configured.
358
+ *
359
+ * @param chainId - EVM chain ID to resolve the allowlist for.
360
+ * @param options - Optional `fromBlock` to override the deploy-block scan floor.
361
+ * @returns Checksummed whitelisted token addresses; `[]` when unavailable.
362
+ * Callers still exclude a target vault's natively-accepted assets (those
363
+ * deposit without a swap).
364
+ * @throws UpshiftSDKError when an `eth_getLogs` scan chunk fails.
365
+ * @example
366
+ * ```ts
367
+ * const tokens = await upshiftSdk.getSwapRouterWhitelistedTokens(1);
368
+ * ```
369
+ */
370
+ getSwapRouterWhitelistedTokens(chainId: number, options?: {
371
+ fromBlock?: number;
372
+ }): Promise<IAddress[]>;
373
+ /**
374
+ * Resolve the vaults that offer the any-token `SwapRouter` deposit surface
375
+ * (swap tokens) on a chain — every vault the Upshift API marks
376
+ * `swaps_enabled`. See {@link getSwapRouterEligibleVaults}.
377
+ *
378
+ * Returns `[]` (no request) when no router is deployed on `chainId`. App-level
379
+ * policy (e.g. excluding vaults with their own OVault deposit flow) remains
380
+ * the caller's responsibility.
381
+ *
382
+ * @param chainId - EVM chain ID to resolve eligible vaults for.
383
+ * @param options - Kept for compatibility; `fromBlock` is no longer read.
384
+ * @returns Checksummed `swaps_enabled` vault addresses; `[]` when unavailable.
385
+ * @throws When the Upshift API vault-list request fails.
386
+ * @example
387
+ * ```ts
388
+ * const vaults = await upshiftSdk.getSwapRouterEligibleVaults(1);
389
+ * ```
390
+ */
391
+ getSwapRouterEligibleVaults(chainId: number, options?: {
392
+ fromBlock?: number;
393
+ }): Promise<IAddress[]>;
394
+ /**
395
+ * Read a SwapRouter origin code's on-chain registration through this
396
+ * instance's provider for `chainId`. See {@link getOriginInfo} for the
397
+ * registration rule and caching.
398
+ *
399
+ * @param options - `chainId` and the `bytes32` `originCode` to look up.
400
+ * @returns {@link IOriginInfo}.
401
+ * @throws UpshiftValidationError (`INVALID_CHAIN`) when no provider is
402
+ * configured for `chainId`; (`INVALID_INPUT`) for a malformed code.
403
+ * @throws UpshiftSDKError when the `origins(bytes32)` read fails.
404
+ * @worstCaseRpcCalls 1 — one `origins(bytes32)` read, cached for 5 minutes.
405
+ * @example
406
+ * ```ts
407
+ * const info = await upshiftSdk.getOriginInfo({ chainId: 1, originCode });
408
+ * ```
409
+ */
410
+ getOriginInfo(options: Omit<IGetOriginInfoOptions, 'rpcUrl'>): Promise<IOriginInfo>;
411
+ /**
412
+ * @function getStakingPositions gets all available reward staking positions
413
+ * @param wallet optionally passed user wallet address
414
+ * @param chainId optionally passed chainId
415
+ * @returns all available staking positions for connected or passed network(s)
416
+ */
417
+ getStakingPositions(wallet?: IAddress, chainId?: IChainId): Promise<import("../../types").IActiveStakingPosition[]>;
418
+ /**
419
+ * @function getVaultTvl gets the vault/pool TVL, both current and historical
420
+ * @param vault pool/vault contract address
421
+ * @param historical (optional) When passed, returns the historical records of the pool/vault TVL
422
+ * @returns an object or array of objects containing the TVL and timestamp
423
+ */
424
+ getVaultTvl({ vault, chainId, historical, }: {
425
+ vault: IAddress;
426
+ chainId?: IChainId;
427
+ historical?: IVaultHistoricalParams;
428
+ }): Promise<{
429
+ value: INormalizedNumber;
430
+ timestamp: string;
431
+ }[]>;
432
+ /**
433
+ * @function getYieldLastRealizedOn gets the timestamp when yield was last realized for a vault
434
+ * @param vault Vault contract address
435
+ * @param chainId Optional chain ID (uses active network if not provided)
436
+ * @returns Timestamp (Unix timestamp in seconds) when yield was last realized
437
+ */
438
+ getYieldLastRealizedOn({ vault, chainId, }: {
439
+ vault: IAddress;
440
+ chainId?: IChainId;
441
+ }): Promise<number>;
442
+ /**
443
+ * Gets borrower health-factor data for vaults on a chain, optionally
444
+ * scoped to a single vault.
445
+ *
446
+ * Pass `vault` whenever the caller knows which pool it cares about —
447
+ * this skips the all-vaults cross-chain fanout and only reads the loans
448
+ * for that one pool. The response map is keyed by **lowercased** vault
449
+ * address; look entries up with `address.toLowerCase()`.
450
+ *
451
+ * Individual loan failures (bad/test loan contracts, unrecognized
452
+ * borrowers) are isolated and logged rather than rejecting the batch.
453
+ *
454
+ * @param chainId Optional chain to scope the read to. When omitted,
455
+ * iterates the SDK's configured providers and returns the flattened
456
+ * list (legacy shape — prefer passing a chain).
457
+ * @param vault Optional vault address. When provided alongside
458
+ * `chainId`, only that vault's data is fetched.
459
+ * @returns When `chainId` is set, an object map of lowercased vault
460
+ * address → array of borrower-health-factor rows. When `chainId` is
461
+ * omitted, a flat array (legacy behavior, kept for backward compat).
462
+ */
463
+ getVaultBorrowerHealthFactor(chainId?: IChainId, vault?: IAddress): Promise<Record<string, import("../../types").IVaultBorrowerHealthFactor[]> | Record<string, import("../../types").IVaultBorrowerHealthFactor[]>[]>;
464
+ /**
465
+ * @function getUserPoints fetches user points from the backend API
466
+ * @param userAddress User wallet address
467
+ * @returns Points data from the backend API
468
+ */
469
+ getUserPoints(userAddress: IAddress): Promise<any>;
470
+ /**
471
+ * Register a user for the points program, authenticated by a wallet signature.
472
+ *
473
+ * The caller produces a personal_sign signature over a canonical message
474
+ * built from these primitives — see `registerUserForPoints` in
475
+ * `./getters` for the exact template and a worked example.
476
+ *
477
+ * @param userAddress EVM wallet address being registered.
478
+ * @param referrerAddress Optional referrer EVM address.
479
+ * @param chainId Chain on which the wallet signed; powers the EIP-1271
480
+ * fallback for smart-contract wallets and pins the signature cross-chain.
481
+ * @param signature 0x-prefixed hex personal_sign signature over the canonical message.
482
+ * @param nonce Single-use random string (8–128 chars).
483
+ * @param expiry Unix seconds; must be in the future, within the backend's TTL.
484
+ * @returns Raw `Response` from the backend.
485
+ */
486
+ registerUserForPoints(userAddress: IAddress, referrerAddress: IAddress | undefined, chainId: number, signature: string, nonce: string, expiry: number): Promise<Response>;
487
+ /**
488
+ * @function fetchPointsLeaderboard fetches the points leaderboard data
489
+ * @param params Optional parameters for pagination and sorting
490
+ * @returns Leaderboard response data
491
+ */
492
+ fetchPointsLeaderboard(params?: {
493
+ page?: number;
494
+ perPage?: number;
495
+ sortBy?: 'streakDays' | 'totalPoints';
496
+ }): Promise<any>;
497
+ /**
498
+ * Get annualized APY metrics for a vault.
499
+ *
500
+ * Supported Vaults: cUSDO, tETH, wstETH, rsETH
501
+ *
502
+ * @deprecated The `hgETH30dLiquidAPY` and `hgETH7dLiquidAPY` response fields are deprecated.
503
+ * These fields will be removed in the next major release.
504
+ * Use `liquidAPY30Day` and `liquidAPY7Day` fields instead.
505
+ *
506
+ * @param vault Vault address
507
+ * @returns Annualized APY data including liquidity APY
508
+ */
509
+ getVaultAnnualizedApy(vault: IAddress): Promise<import("../../types").IVaultAnnualizedApy>;
510
+ /**
511
+ * Get summary data for a vault (name, type, chain, recent returns).
512
+ * @param vault Vault address
513
+ * @returns Vault summary data
514
+ */
515
+ getVaultSummary(vault: IAddress): Promise<import("../../types").IVaultSummary>;
516
+ /**
517
+ * Get withdrawal summary and pending queue for a vault.
518
+ * @param vault Vault address
519
+ * @param chainId Chain ID (will be converted to chain name)
520
+ * @returns Withdrawal summary and pending queue
521
+ */
522
+ getVaultWithdrawals(vault: IAddress, chainId?: number): Promise<import("../../types").IVaultWithdrawals>;
523
+ /**
524
+ * Fetch pending redemptions for a vault with liquidity analysis.
525
+ * @param vault - Vault contract address
526
+ * @param pastDays - Number of past days to include (default 7, min 1, max 30)
527
+ * @param futureDays - Number of future days to include (default 14, min 1, max 30)
528
+ * @returns Pending redemptions grouped by date with liquidity summary
529
+ */
530
+ getVaultPendingRedemptions({ vault, pastDays, futureDays, }: {
531
+ vault: IAddress;
532
+ pastDays?: number;
533
+ futureDays?: number;
534
+ }): Promise<import("../../types").IVaultPendingRedemptions>;
535
+ /**
536
+ * Preview the amount of assets that would be received for redeeming shares (queued redemption).
537
+ * @param vault Vault contract address
538
+ * @param sharesAmount Amount of shares to redeem (human-readable, raw bigint, or string)
539
+ * @param chainId Optional chain ID (uses active network if not provided)
540
+ * @returns The amount of assets as INormalizedNumber { normalized, raw }
541
+ */
542
+ previewRedemption({ vault, sharesAmount, chainId, }: {
543
+ vault: IAddress;
544
+ sharesAmount: string | bigint | number;
545
+ chainId?: IChainId;
546
+ }): Promise<INormalizedNumber>;
547
+ /**
548
+ * Get all withdrawal requests for a vault with deterministic status tracking.
549
+ *
550
+ * Matches requests to processed events by `(receiver, claimableDate)` tuple.
551
+ *
552
+ * **Status values:**
553
+ * - `'processed'` — Matching `WithdrawalProcessed` event found on-chain.
554
+ * - `'ready_to_claim'` — Claimable date has passed, no processed event found yet.
555
+ * - `'pending'` — Claimable date is still in the future.
556
+ *
557
+ * **Lookback window:** Processed events are fetched from on-chain logs, which
558
+ * only cover a finite block range. Requests whose claimable date is older than
559
+ * this window with no matching processed event are excluded (assumed already
560
+ * processed). Use `lookbackBlocks` to widen or narrow the scan range.
561
+ *
562
+ * @param vault - Vault contract address
563
+ * @param receiver - Optional receiver address to filter by
564
+ * @param lookbackBlocks - Optional on-chain log lookback window in blocks.
565
+ * Defaults to chain-specific value (e.g. 150,000 for Ethereum, 3,456,000 for Monad).
566
+ * @param chainId - Optional chain id for the vault address
567
+ * @returns Array of withdrawal requests with status and claimable dates
568
+ */
569
+ getWithdrawalRequestsWithStatus(vault: IAddress, receiver?: IAddress, lookbackBlocks?: number, chainId?: number): Promise<import("./getters").WithdrawalRequestStatus[]>;
570
+ /**
571
+ * Redeem vault shares for an underlying asset via instant redemption (RWA subaccount).
572
+ * Resolves the vault address to the RwaRedeemSubaccount internally.
573
+ * Handles vault share approval automatically.
574
+ * @param signer - Signer / wallet object
575
+ * @param vault - Vault contract address
576
+ * @param asset - Redeemable asset address (e.g. USDC, USDT)
577
+ * @param amount - Amount of vault shares to redeem
578
+ * @param minOut - Minimum output amount in output asset units (slippage protection)
579
+ * @param chainId - Optional chain ID (uses active network if not provided)
580
+ * @param wait - Wait for transaction confirmation
581
+ * @returns transaction hash
582
+ */
583
+ rwaRedeemAsset(signer: Signer | Wallet, { vault, asset, amount, minOut, chainId, wait, }: {
584
+ vault: IAddress;
585
+ asset: IAddress;
586
+ amount: string | bigint | number;
587
+ minOut: string | bigint | number;
588
+ chainId?: IChainId;
589
+ wait?: boolean;
590
+ }): Promise<string>;
591
+ /**
592
+ * Preview the output amount for an RWA instant redemption.
593
+ * Resolves the vault address to the RwaRedeemSubaccount internally.
594
+ * @param vault - Vault contract address
595
+ * @param asset - Redeemable asset address (e.g. USDC, USDT)
596
+ * @param amount - Amount of vault shares to preview
597
+ * @param chainId - Optional chain ID (uses active network if not provided)
598
+ * @returns normalized number of the expected output amount (in output asset decimals)
599
+ */
600
+ previewRwaRedemption({ vault, asset, amount, chainId, }: {
601
+ vault: IAddress;
602
+ asset: IAddress;
603
+ amount: string | bigint | number;
604
+ chainId?: IChainId;
605
+ }): Promise<INormalizedNumber>;
606
+ }
607
+ export default UpshiftVaults;