|
1 | | -import type { FragmentOf } from 'gql.tada'; |
2 | | -import { graphql } from '../graphql'; |
3 | | -import { ChainFragment } from './chain'; |
4 | | -import { CurrencyFragment, PercentValueFragment } from './common'; |
5 | | -import { ReserveFragment } from './reserve'; |
| 1 | +import type { FragmentOf } from "gql.tada"; |
| 2 | +import { graphql } from "../graphql"; |
| 3 | +import { ChainFragment } from "./chain"; |
| 4 | +import { CurrencyFragment, PercentValueFragment } from "./common"; |
| 5 | +import { ReserveFragment } from "./reserve"; |
6 | 6 |
|
7 | 7 | export const MarketUserStateFragment = graphql( |
8 | | - `fragment MarketUserState on MarketUserState { |
9 | | - __typename |
10 | | - netWorth |
11 | | - netAPY { |
12 | | - ...PercentValue |
| 8 | + ` |
| 9 | + fragment MarketUserState on MarketUserState { |
| 10 | + __typename |
| 11 | + netWorth |
| 12 | + netAPY { |
| 13 | + ...PercentValue |
| 14 | + } |
| 15 | + userEarnedAPY { |
| 16 | + ...PercentValue |
| 17 | + } |
| 18 | + userDebtAPY { |
| 19 | + ...PercentValue |
| 20 | + } |
| 21 | + healthFactor |
| 22 | + eModeEnabled |
| 23 | + totalCollateralBase |
| 24 | + totalDebtBase |
| 25 | + availableBorrowsBase |
| 26 | + currentLiquidationThreshold { |
| 27 | + ...PercentValue |
| 28 | + } |
| 29 | + ltv { |
| 30 | + ...PercentValue |
| 31 | + } |
| 32 | + isInIsolationMode |
13 | 33 | } |
14 | | - healthFactor |
15 | | - eModeEnabled |
16 | | - totalCollateralBase |
17 | | - totalDebtBase |
18 | | - availableBorrowsBase |
19 | | - currentLiquidationThreshold { |
20 | | - ...PercentValue |
21 | | - } |
22 | | - ltv { |
23 | | - ...PercentValue |
24 | | - } |
25 | | - isInIsolationMode |
26 | | - }`, |
27 | | - [PercentValueFragment], |
| 34 | + `, |
| 35 | + [PercentValueFragment] |
28 | 36 | ); |
29 | 37 | export type MarketUserState = FragmentOf<typeof MarketUserStateFragment>; |
30 | 38 |
|
31 | 39 | export const EmodeMarketReserveInfoFragment = graphql( |
32 | | - `fragment EmodeMarketReserveInfo on EmodeMarketReserveInfo { |
33 | | - __typename |
34 | | - underlyingToken { |
35 | | - ...Currency |
| 40 | + ` |
| 41 | + fragment EmodeMarketReserveInfo on EmodeMarketReserveInfo { |
| 42 | + __typename |
| 43 | + underlyingToken { |
| 44 | + ...Currency |
| 45 | + } |
| 46 | + canBeCollateral |
| 47 | + canBeBorrowed |
36 | 48 | } |
37 | | - canBeCollateral |
38 | | - canBeBorrowed |
39 | | - }`, |
40 | | - [CurrencyFragment], |
| 49 | + `, |
| 50 | + [CurrencyFragment] |
41 | 51 | ); |
42 | | -export type EmodeMarketReserveInfo = FragmentOf< |
43 | | - typeof EmodeMarketReserveInfoFragment |
44 | | ->; |
| 52 | +export type EmodeMarketReserveInfo = FragmentOf<typeof EmodeMarketReserveInfoFragment>; |
45 | 53 |
|
46 | 54 | export const EmodeMarketCategoryFragment = graphql( |
47 | | - `fragment EmodeMarketCategory on EmodeMarketCategory { |
48 | | - __typename |
49 | | - id |
50 | | - label |
51 | | - maxLTV { |
52 | | - ...PercentValue |
53 | | - } |
54 | | - liquidationThreshold { |
55 | | - ...PercentValue |
56 | | - } |
57 | | - liquidationPenalty { |
58 | | - ...PercentValue |
59 | | - } |
60 | | - reserves { |
61 | | - ...EmodeMarketReserveInfo |
| 55 | + ` |
| 56 | + fragment EmodeMarketCategory on EmodeMarketCategory { |
| 57 | + __typename |
| 58 | + id |
| 59 | + label |
| 60 | + maxLTV { |
| 61 | + ...PercentValue |
| 62 | + } |
| 63 | + liquidationThreshold { |
| 64 | + ...PercentValue |
| 65 | + } |
| 66 | + liquidationPenalty { |
| 67 | + ...PercentValue |
| 68 | + } |
| 69 | + reserves { |
| 70 | + ...EmodeMarketReserveInfo |
| 71 | + } |
62 | 72 | } |
63 | | - }`, |
64 | | - [PercentValueFragment, EmodeMarketReserveInfoFragment], |
| 73 | + `, |
| 74 | + [PercentValueFragment, EmodeMarketReserveInfoFragment] |
65 | 75 | ); |
66 | | -export type EmodeMarketCategory = FragmentOf< |
67 | | - typeof EmodeMarketCategoryFragment |
68 | | ->; |
| 76 | +export type EmodeMarketCategory = FragmentOf<typeof EmodeMarketCategoryFragment>; |
69 | 77 |
|
70 | 78 | export const MarketFragment = graphql( |
71 | | - `fragment Market on Market { |
72 | | - __typename |
73 | | - name |
74 | | - chain { |
75 | | - ...Chain |
76 | | - } |
77 | | - address |
78 | | - icon |
79 | | - totalMarketSize |
80 | | - totalAvailableLiquidity |
81 | | - eModeCategories { |
82 | | - ...EmodeMarketCategory |
83 | | - } |
84 | | - userState { |
85 | | - ...MarketUserState |
86 | | - } |
| 79 | + ` |
| 80 | + fragment Market on Market { |
| 81 | + __typename |
| 82 | + name |
| 83 | + chain { |
| 84 | + ...Chain |
| 85 | + } |
| 86 | + address |
| 87 | + icon |
| 88 | + totalMarketSize |
| 89 | + totalAvailableLiquidity |
| 90 | + eModeCategories { |
| 91 | + ...EmodeMarketCategory |
| 92 | + } |
| 93 | + userState { |
| 94 | + ...MarketUserState |
| 95 | + } |
87 | 96 |
|
88 | | - borrowReserves: reserves(request: { reserveType: BORROW, orderBy: $borrowsOrderBy }) { |
89 | | - ...Reserve |
90 | | - } |
| 97 | + borrowReserves: reserves(request: { reserveType: BORROW, orderBy: $borrowsOrderBy }) { |
| 98 | + ...Reserve |
| 99 | + } |
91 | 100 |
|
92 | | - supplyReserves: reserves(request: { reserveType: SUPPLY, orderBy: $suppliesOrderBy }) { |
93 | | - ...Reserve |
| 101 | + supplyReserves: reserves(request: { reserveType: SUPPLY, orderBy: $suppliesOrderBy }) { |
| 102 | + ...Reserve |
| 103 | + } |
94 | 104 | } |
95 | | - }`, |
96 | | - [ |
97 | | - ChainFragment, |
98 | | - EmodeMarketCategoryFragment, |
99 | | - ReserveFragment, |
100 | | - MarketUserStateFragment, |
101 | | - ], |
| 105 | + `, |
| 106 | + [ChainFragment, EmodeMarketCategoryFragment, ReserveFragment, MarketUserStateFragment] |
102 | 107 | ); |
103 | 108 | export type Market = FragmentOf<typeof MarketFragment>; |
0 commit comments