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,698 @@
1
+ import type { IUserRoles } from './user';
2
+ import type { IAddress, ChainType, IStellarNetwork } from './web3';
3
+ /**
4
+ * Table of Contents
5
+ * 1) Subaccounts
6
+ * 2) Metrics
7
+ * 3) Tokens
8
+ * 4) Users
9
+ * 5) Statuses
10
+ * 6) Integrations
11
+ * 7) Lending Pools
12
+ */
13
+ export type IHIstoricalSnapshot = {
14
+ total_assets: number;
15
+ total_shares: number;
16
+ asset_share_ratio: number;
17
+ underlying_price: number;
18
+ snapshot_datetime: string;
19
+ block_id: number;
20
+ id: string;
21
+ tvl: number;
22
+ };
23
+ export interface IWSMonitorHeaders {
24
+ 'x-user-id'?: string;
25
+ 'x-environment'?: string;
26
+ }
27
+ /**
28
+ * Subaccounts
29
+ */
30
+ export type IWSSubaccountPermission = {
31
+ name: string;
32
+ chain: number;
33
+ account_address?: string;
34
+ };
35
+ export type IWSSubaccountTwap = {
36
+ source_token: string;
37
+ dest_token: string;
38
+ subaccount_chain: number;
39
+ time_interval: number;
40
+ amount: number;
41
+ start_time?: string;
42
+ limit_price?: number;
43
+ number_of_orders: number;
44
+ complete_all_orders?: boolean;
45
+ slippage_tolerance?: number;
46
+ };
47
+ export type IWSSubaccountTwapHistoryItem = {
48
+ start_time: string;
49
+ time_interval: number;
50
+ source_token: string;
51
+ destination_token: string;
52
+ amount: number | null;
53
+ limit_price: number;
54
+ active: boolean;
55
+ number_of_orders: number;
56
+ complete_all_orders: boolean;
57
+ id: string;
58
+ updated_at: string;
59
+ created_at: string;
60
+ subaccount_id: string;
61
+ };
62
+ export type IWSSubaccountTwapFill = {
63
+ transaction_hash: string | null;
64
+ source_token: string;
65
+ destination_token: string;
66
+ source_amount_in: number | null;
67
+ destination_amount_out: number | null;
68
+ implied_price: number | null;
69
+ fee_amount: number | null;
70
+ id: string;
71
+ updated_at: string;
72
+ created_at: string;
73
+ twap_id: string;
74
+ fireblocks_transaction_id: string;
75
+ status: IWSFireblocksTxStatus;
76
+ message: string;
77
+ };
78
+ export type IWSSubaccountToken = {
79
+ address: string;
80
+ chain: number;
81
+ decimals: number;
82
+ discount_factor: number;
83
+ img_url: string | null;
84
+ price: number;
85
+ symbol: string;
86
+ token_type: number;
87
+ };
88
+ interface IWSSubaccountCefiAsset {
89
+ type: string;
90
+ name: string;
91
+ underlying: string;
92
+ symbol: string;
93
+ asset_type: string;
94
+ }
95
+ interface IWSSubaccountCefiSpotToken {
96
+ asset: IWSSubaccountCefiAsset;
97
+ value: number;
98
+ balance: number;
99
+ }
100
+ interface IWSSubaccountCefiDerivative {
101
+ value: number;
102
+ asset_type: string;
103
+ asset: IWSSubaccountCefiAsset;
104
+ units: number;
105
+ avg_cost: number;
106
+ entry_cost: number;
107
+ }
108
+ export interface IWSSubaccountCefi {
109
+ value: number;
110
+ name: string;
111
+ spot_tokens: IWSSubaccountCefiSpotToken[];
112
+ derivative_positions: IWSSubaccountCefiDerivative[];
113
+ }
114
+ export interface IWSSubaccountLoan {
115
+ address: IAddress;
116
+ lender: IAddress;
117
+ borrower: IAddress;
118
+ state: string;
119
+ total_repaid: number;
120
+ principal_token: IWSTokenEntry;
121
+ principal_amount: number;
122
+ interest_amount: number;
123
+ upcoming_payment: {
124
+ amount: number;
125
+ due_date: string;
126
+ };
127
+ apr: number;
128
+ initial_principal_amount: number;
129
+ deployed_date: string;
130
+ payment_interval: number;
131
+ lender_apr: number;
132
+ }
133
+ /**
134
+ * Metrics
135
+ */
136
+ export type IWSMetricsPnlAttributes = {
137
+ pnl: number;
138
+ percent_return: number;
139
+ realized_apr: number;
140
+ } | null;
141
+ export type IWSMetricsPnl = {
142
+ id: string;
143
+ datetime: string | Date;
144
+ pnl: number;
145
+ pnl_vs_spot: number;
146
+ swaps_pnl: number;
147
+ timestamp: number;
148
+ debt_interest_owed: number;
149
+ credit_interest_owed: number;
150
+ total_account_value: number;
151
+ net_deposits: number;
152
+ net_deposits_pv: number;
153
+ hedger_pnl: number;
154
+ lifetime: IWSMetricsPnlAttributes;
155
+ lifetime_vs_spot: IWSMetricsPnlAttributes;
156
+ three_day: IWSMetricsPnlAttributes;
157
+ three_day_vs_spot: IWSMetricsPnlAttributes;
158
+ seven_day: IWSMetricsPnlAttributes;
159
+ seven_day_vs_spot: IWSMetricsPnlAttributes;
160
+ thirty_day: IWSMetricsPnlAttributes;
161
+ thirty_day_vs_spot: IWSMetricsPnlAttributes;
162
+ };
163
+ export type IWSMetricsStrategy = {
164
+ subaccount: string;
165
+ strategy: string;
166
+ datetime: string | Date;
167
+ chain_id: number;
168
+ estimated_apr: number;
169
+ strategy_pnl: number;
170
+ pending_rewards: number;
171
+ strategy_notional: number;
172
+ pnl_vs_spot: number;
173
+ pnl_vs_spot_3d: number;
174
+ pnl_vs_spot_7d: number;
175
+ pnl_vs_spot_30d: number;
176
+ realized_apr: number;
177
+ realized_apr_3d: number;
178
+ realized_apr_7d: number;
179
+ realized_apr_30d: number;
180
+ pool_weights: Record<string, number>;
181
+ lp_price: number;
182
+ strategy_name: string;
183
+ net_deposits: number;
184
+ };
185
+ export type IWSMetricsToken = {
186
+ subaccount: string;
187
+ strategy: string;
188
+ datetime: string | Date;
189
+ chain_id: number;
190
+ symbol: string;
191
+ units_held: number;
192
+ value_held: number;
193
+ units_implied: number;
194
+ value_implied: number;
195
+ collateral_posted_amount: number;
196
+ margin_posted_amount: number;
197
+ collateral_posted_value: number;
198
+ margin_posted_value: number;
199
+ pool_weight: number;
200
+ };
201
+ export type IWSMetricsTRS = {
202
+ datetime: string | Date;
203
+ reciever: string;
204
+ payer: string;
205
+ trs_address: string;
206
+ chain_id: number;
207
+ initial_underyling_price: number;
208
+ reference_underlying_price: number;
209
+ current_underlying_price: number;
210
+ required_reciever_margin: number;
211
+ required_payer_margin: number;
212
+ mark_to_market_pnl: number;
213
+ initial_margin: number;
214
+ swap_contract_units: number;
215
+ state: string;
216
+ direction: string;
217
+ underlying_token: string;
218
+ };
219
+ export type IWSMetricsHealthFactor = {
220
+ id: string;
221
+ datetime: string;
222
+ health_factor: number;
223
+ total_account_value: number;
224
+ total_equity_value: number;
225
+ total_loan_value: number;
226
+ total_loan_interest_amount: number;
227
+ total_pnl: number;
228
+ aggregate_payer_margin: number;
229
+ aggregate_receiver_margin: number;
230
+ intrest_paid: number;
231
+ total_net_deposits: number;
232
+ net_account_value: number;
233
+ life_time_apr: number;
234
+ percent_return: number;
235
+ margin_fraction: number;
236
+ maintenance_margin_fraction: number;
237
+ total_collateral_value: number;
238
+ total_pnl_3d: number;
239
+ total_pnl_7d: number;
240
+ total_pnl_30d: number;
241
+ realized_apr_3d: number;
242
+ realized_apr_7d: number;
243
+ realized_apr_30d: number;
244
+ };
245
+ export type IWSMetricsHedgerPnl = {
246
+ subaccount: string;
247
+ strategy: string;
248
+ datetime: string | Date;
249
+ chain_id: number;
250
+ symbol: string;
251
+ funding_payments: number;
252
+ fees: number;
253
+ unrealized: number;
254
+ realized: number;
255
+ pnl: number;
256
+ implied_delta: number;
257
+ hedge_delta: number;
258
+ oi_biased_implied_delta: number;
259
+ oi_bias: number;
260
+ };
261
+ export type IWSMetricsHedger = {
262
+ subaccount: string;
263
+ strategy: string;
264
+ datetime: string | Date;
265
+ chain_id: number;
266
+ strategy_notional: number;
267
+ strategy_pnl: number;
268
+ hedger_pnl: number;
269
+ trs_pnl: number;
270
+ realized_pnl: number;
271
+ unrealized_pnl: number;
272
+ fees: number;
273
+ funding: number;
274
+ corrections: number;
275
+ total_hedge_delta: number;
276
+ total_implied_delta: number;
277
+ net_pnl: number;
278
+ realized_apr_3d: number;
279
+ realized_apr_7d: number;
280
+ realized_apr_30d: number;
281
+ };
282
+ export type IWSMetricsTimeseries = {
283
+ aggregate_payer_margin: number;
284
+ aggregate_receiver_margin: number;
285
+ datetime: string | Date;
286
+ health_factor: number;
287
+ id: string;
288
+ intrest_paid: number;
289
+ life_time_apr: number;
290
+ maintenance_margin_fraction: number;
291
+ margin_fraction: number;
292
+ net_account_value: number;
293
+ percent_return: number;
294
+ realized_apr_3d: number | null;
295
+ realized_apr_7d: number | null;
296
+ realized_apr_30d: number | null;
297
+ total_account_value: number;
298
+ total_collateral_value: number;
299
+ total_equity_value: number;
300
+ total_loan_interest_amount: number;
301
+ total_loan_value: number;
302
+ total_net_deposits: number;
303
+ total_pnl: number;
304
+ total_pnl_3d: number | null;
305
+ total_pnl_7d: number | null;
306
+ total_pnl_30d: number | null;
307
+ };
308
+ /**
309
+ * Tokens
310
+ */
311
+ export type IWSTokenEntry = {
312
+ symbol: string;
313
+ address: `0x${string}`;
314
+ decimals: number;
315
+ img_url?: string;
316
+ price?: number;
317
+ chain?: number;
318
+ balance?: number;
319
+ value?: number;
320
+ label?: string;
321
+ discount_factor?: string;
322
+ type?: string;
323
+ };
324
+ export type IWSTokenPrice = {
325
+ price: number;
326
+ dt: string;
327
+ };
328
+ /**
329
+ * Users
330
+ */
331
+ export type IWSUserSubaccount = {
332
+ internal_name: string;
333
+ friendly_name: string;
334
+ address: string;
335
+ chains: {
336
+ chain_id: number;
337
+ name: string;
338
+ id: string;
339
+ }[];
340
+ status: string;
341
+ subaccount_type: string;
342
+ min_health_factor: number;
343
+ estimated_apr: number;
344
+ id: string;
345
+ user_id: string;
346
+ implementation: string;
347
+ turnkey_address: string;
348
+ };
349
+ export type IWSUser = {
350
+ eoa: string;
351
+ full_name: string;
352
+ type_: IUserRoles;
353
+ nonce: string;
354
+ disabled: boolean;
355
+ id: string;
356
+ };
357
+ /**
358
+ * Statuses
359
+ */
360
+ export type IWSFireblocksTxStatus = 'SUBMITTED' | 'PENDING_AML_SCREENING' | 'PENDING_AUTHORIZATION' | 'QUEUED' | 'PENDING_SIGNATURE' | 'PENDING_3RD_PARTY_MANUAL_APPROVAL' | 'PENDING_3RD_PARTY' | 'BROADCASTING' | 'CONFIRMING' | 'COMPLETED' | 'CANCELLING' | 'BLOCKED' | 'REJECTED' | 'FAILED';
361
+ /**
362
+ * Integrations
363
+ */
364
+ export interface IWSIntegrationMorphoApy {
365
+ apy: number;
366
+ vault_positions: any[];
367
+ token: IWSTokenEntry;
368
+ }
369
+ /**
370
+ * Lending Pools
371
+ */
372
+ export interface IWSVaultLoan {
373
+ address: IAddress;
374
+ lender: IAddress;
375
+ borrower: IAddress;
376
+ state: string;
377
+ total_repaid: number;
378
+ principal_token: IWSTokenEntry;
379
+ principal_amount: number;
380
+ interest_amount: number;
381
+ upcoming_payment: {
382
+ amount: number;
383
+ due_date: string;
384
+ };
385
+ apr: number;
386
+ initial_principal_amount: number;
387
+ deployed_date: string;
388
+ payment_interval: number;
389
+ }
390
+ export interface IDebankTokenExposure {
391
+ amount: number;
392
+ chain: string;
393
+ decimals: number;
394
+ id: IAddress;
395
+ logoUrl: string;
396
+ name: string;
397
+ symbol: string;
398
+ }
399
+ export interface IDebankProtocolExposure {
400
+ assetUsdValue: number;
401
+ chain: string;
402
+ debtUsdValue: number;
403
+ id: string;
404
+ logoUrl: string;
405
+ netUsdValue: number;
406
+ protocol: string;
407
+ siteUrl: string;
408
+ address: string;
409
+ tokenExposure: Record<string, string[] | string>;
410
+ protocolExposure: Record<string, string[] | string>;
411
+ }
412
+ export interface ITokenizedVaultSubaccount {
413
+ address: string;
414
+ strategist: ITokenizedVaultStrategist;
415
+ }
416
+ export type IOperatorTypeEnum = 'eoa' | 'subaccount';
417
+ export interface ITokenizedVaultOperator {
418
+ address: `0x${string}`;
419
+ operator_type: IOperatorTypeEnum;
420
+ }
421
+ export interface ITokenizedVaultEoaOperator {
422
+ address: string;
423
+ id: string;
424
+ name: string;
425
+ }
426
+ /**
427
+ * Controls how the vault's APY is displayed in the UI.
428
+ * When `is_show_target_apy` is true, the UI should show a target/projected APY.
429
+ * When `is_show_hardcoded_apy` is true, `hardcoded_apy` overrides the computed APY.
430
+ * When `is_show_compound_apy` is true, the UI should render the
431
+ * compound-annualized historical APY (`historical_compound_apy`) instead of
432
+ * the simple one.
433
+ */
434
+ export interface IApyOverride {
435
+ /** Whether to display a target APY rather than historical performance. */
436
+ is_show_target_apy: boolean;
437
+ /** Whether to display `hardcoded_apy` in place of the computed APY. */
438
+ is_show_hardcoded_apy: boolean;
439
+ /** The fixed APY value to display when `is_show_hardcoded_apy` is true, or null. */
440
+ hardcoded_apy: number | null;
441
+ /**
442
+ * Whether to display the compound-annualized historical APY
443
+ * (`historical_compound_apy`) instead of the simple `historical_apy`.
444
+ * Absent (older/cached responses) or false means simple. Independent of the
445
+ * target/hardcoded flags above, which keep their existing precedence.
446
+ */
447
+ is_show_compound_apy?: boolean;
448
+ }
449
+ /**
450
+ * Per-vault provenance timestamps returned by the backend on every tokenized-vault
451
+ * read (list and single-vault, on both the `api.augustdigital.io/tokenized_vault`
452
+ * and `api.upshift.finance/tokenized_vaults` surfaces).
453
+ *
454
+ * The three stamps describe *different* pipelines and are independently nullable —
455
+ * one of them cannot stand in for another. Consumers use the ordering between them
456
+ * to detect that the vault's share price has moved ahead of its APY: a
457
+ * `share_ratio_snapshot_at` later than `apy_computed_at` means a share-price
458
+ * snapshot has landed that the APY has not yet been recomputed from.
459
+ *
460
+ * All values are RFC 3339 UTC strings with a trailing `Z` (e.g.
461
+ * `'2026-07-25T00:01:46Z'`). The trailing `Z` matters: `new Date()` parses an
462
+ * offset-less date-time as *local* time, which would silently shift the stamp by
463
+ * the viewer's UTC offset.
464
+ *
465
+ * @see ITokenizedVault.freshness
466
+ */
467
+ export interface ITokenizedVaultFreshness {
468
+ /**
469
+ * When `historical_apy`, TVL and drawdown were last recomputed, or null if they
470
+ * have never been computed for this vault.
471
+ */
472
+ apy_computed_at: string | null;
473
+ /**
474
+ * `snapshot_datetime` of the newest persisted share-price snapshot, or null when
475
+ * the vault has no snapshot yet.
476
+ *
477
+ * The backend stamps this from a scalar `max(snapshot_datetime)`, so it is
478
+ * populated independently of `load_snapshots` — including on the basic and
479
+ * sub-accounts views (`load_snapshots=false`), which is what every app call site
480
+ * sends. Never substitute another timestamp for it.
481
+ */
482
+ share_ratio_snapshot_at: string | null;
483
+ /**
484
+ * When the backend assembled the response body, before it entered the backend's
485
+ * own response cache. Distinct from the top-level `cached_at` only in scope:
486
+ * this one travels with the vault object.
487
+ */
488
+ cached_at: string | null;
489
+ }
490
+ export interface ITokenizedVaultStrategist {
491
+ strategist_name: string;
492
+ strategist_logo: string;
493
+ /** URL of the strategist's website, or null if not provided. */
494
+ website_url: string | null;
495
+ id: string;
496
+ }
497
+ export interface IOTCTrade {
498
+ value: number;
499
+ payer: string;
500
+ receiver: string;
501
+ units: number;
502
+ price: number;
503
+ trade_name: string;
504
+ symbol: string;
505
+ strike: number;
506
+ expiry: string;
507
+ asset_type: string;
508
+ underlying: string;
509
+ average_cost: number;
510
+ }
511
+ export interface IOTCPosition {
512
+ value: number;
513
+ underlying: string;
514
+ settlement_type: string;
515
+ settlement_currency: string;
516
+ asset_type: string;
517
+ symbol: string;
518
+ trades: IOTCTrade[];
519
+ }
520
+ export interface ITokenizedVaultReward {
521
+ tokenizedvault_id: string;
522
+ id: string;
523
+ text: string;
524
+ img_url: string;
525
+ multiplier: number;
526
+ created_at: string;
527
+ start_datetime: string;
528
+ }
529
+ export interface ITokenizedVaultReportedAPY {
530
+ apy: number;
531
+ underlying_apy: number;
532
+ liquid_apy: number;
533
+ points_apy: number | null;
534
+ rewards_compounded: number;
535
+ rewards_claimable: number;
536
+ explainer: string;
537
+ id: string;
538
+ tokenized_vault_id: string;
539
+ created_at: Date;
540
+ updated_at: Date;
541
+ }
542
+ export interface ITokenizedVaultReceiptTokenIntegration {
543
+ address: string;
544
+ chain: number;
545
+ token_class: string;
546
+ shorthand: string;
547
+ symbol: string;
548
+ tiingo_ticker: string;
549
+ img_url: string;
550
+ is_transferable: boolean;
551
+ id: string;
552
+ position_id: string;
553
+ stable_token_pair_id: string;
554
+ }
555
+ export interface IComposabilityIntegration {
556
+ name: string;
557
+ description: string;
558
+ earning_multiplier: number;
559
+ protocol_url: string;
560
+ logo_url: string;
561
+ tokenized_vault_id: string;
562
+ id: string;
563
+ }
564
+ export interface ISolanaVaultMetadata {
565
+ vault_state_pda: string;
566
+ share_mint: string;
567
+ deposit_mint: string;
568
+ deposit_token_symbol?: string;
569
+ deposit_token_decimals?: number;
570
+ program_id?: string;
571
+ }
572
+ export interface IStellarVaultMetadata {
573
+ deposit_token_address: string | null;
574
+ deposit_token_symbol?: string;
575
+ deposit_token_decimals?: number;
576
+ network_name: IStellarNetwork;
577
+ utila_vault_id?: string;
578
+ utila_wallet_id?: string;
579
+ }
580
+ export interface ITokenizedVault {
581
+ address: string;
582
+ yield_distributor: string;
583
+ chain: number;
584
+ enable_external_assets_update: boolean;
585
+ chain_type: ChainType;
586
+ default_apy_horizon: 7 | 30 | null;
587
+ enabled_historical_price_horizons: any[];
588
+ description: string;
589
+ internal_type: 'lendingPool' | 'tokenizedVault' | 'tokenizedVaultV2' | 'multiAssetVault';
590
+ public_type: 'Lending' | 'Defi Yield' | 'Pre-deposit';
591
+ is_featured: boolean;
592
+ is_spotlighted?: boolean;
593
+ withdrawal_only?: boolean | null;
594
+ is_visible: boolean;
595
+ weekly_performance_fee_bps: number;
596
+ platform_fee_override: {
597
+ management_fee: number;
598
+ is_fee_waived: boolean;
599
+ };
600
+ management_fee_waived_until_date: string | null;
601
+ management_fee_waived_until_tvl: number | null;
602
+ performance_fee_waived_until_date: string | null;
603
+ performance_fee_waived_until_tvl: number | null;
604
+ start_datetime: Date;
605
+ vault_name: string;
606
+ vault_logo_url: string;
607
+ reserve_target: number;
608
+ reserve_tolerance: number;
609
+ status: 'active' | 'closed';
610
+ is_charge_fees_manual: boolean;
611
+ id: string;
612
+ receipt_token_symbol: string;
613
+ rewards: ITokenizedVaultReward[];
614
+ subaccounts: ITokenizedVaultSubaccount[];
615
+ reported_apy: ITokenizedVaultReportedAPY | null;
616
+ campaign_apy: number | null;
617
+ receipt_token_integrations: ITokenizedVaultReceiptTokenIntegration[];
618
+ hardcoded_strategists: ITokenizedVaultStrategist[];
619
+ max_daily_drawdown: number | null;
620
+ risk: string;
621
+ operators: ITokenizedVaultOperator[];
622
+ eoa_operators: ITokenizedVaultEoaOperator[];
623
+ composability_integrations?: IComposabilityIntegration[];
624
+ solana_vault_metadata?: ISolanaVaultMetadata | null;
625
+ stellar_vault_metadata?: IStellarVaultMetadata | null;
626
+ lagDuration: number;
627
+ /**
628
+ * Display buffer in seconds added on top of the on-chain lag for the
629
+ * withdrawal period shown to users. Null when not configured.
630
+ */
631
+ withdrawal_margin_seconds?: number | null;
632
+ /**
633
+ * IAT trader wallet addresses for the vault. Address format follows the
634
+ * vault's chain (EVM hex / Solana base58 / Stellar). Null when not
635
+ * configured.
636
+ */
637
+ iat_traders?: string[] | null;
638
+ historical_apy: Record<number, number> | null;
639
+ /**
640
+ * Compound-annualized historical APY keyed by horizon in days (1/7/30), as
641
+ * decimal fractions (0.0795 = 7.95%). Same shape and per-horizon null
642
+ * semantics as `historical_apy`. Absent on older/cached responses.
643
+ */
644
+ historical_compound_apy?: Record<number, number> | null;
645
+ /** @deprecated Use getVaultHistoricalTimeseries instead */
646
+ historical_snapshots?: IHIstoricalSnapshot[];
647
+ max_drawdown: number | null;
648
+ daily_pnl_per_share: Record<string, number>;
649
+ latest_reported_tvl: number | null;
650
+ cached_at?: string | null;
651
+ /**
652
+ * Per-vault provenance timestamps (APY recompute, newest share-price snapshot,
653
+ * response assembly). Absent on older/cached responses predating the backend
654
+ * change that added it.
655
+ */
656
+ freshness?: ITokenizedVaultFreshness | null;
657
+ instant_redeem_config: null | {
658
+ subaccount_address: string;
659
+ output_asset_symbol: string;
660
+ is_paused: boolean;
661
+ available_liquidity: number;
662
+ redeemable_assets: Array<{
663
+ address: string;
664
+ symbol: string;
665
+ decimals: number;
666
+ spread_bps: number;
667
+ }>;
668
+ };
669
+ show_cap_filled: boolean | null;
670
+ /** Controls APY display behaviour in the UI; null when the server has not set an override. */
671
+ apy_override: IApyOverride | null;
672
+ }
673
+ /**
674
+ * @deprecated
675
+ */
676
+ export interface IWSVaultHistoricalApy {
677
+ data: {
678
+ labels: string[];
679
+ values: number[];
680
+ };
681
+ average_apy: number;
682
+ status: number;
683
+ error: string | null;
684
+ }
685
+ export interface IHistoricalTimeseriesPoint {
686
+ tvl: number | null;
687
+ daily_apy: number | null;
688
+ daily_pnl: number | null;
689
+ share_price: number | null;
690
+ total_assets: number | null;
691
+ total_shares: number | null;
692
+ asset_share_ratio: number | null;
693
+ missing: boolean;
694
+ }
695
+ export interface IHistoricalTimeseriesResponse {
696
+ data: Record<string, IHistoricalTimeseriesPoint>;
697
+ }
698
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=webserver.js.map