Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAN-2813: App redesign #1093

Open
wants to merge 183 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
560a7a5
Add LendVaultsContent and HeaderList components
iamsphere Nov 7, 2024
93e0ba3
Add LendVault card components
iamsphere Nov 7, 2024
35b8206
Add mock data for LendVaultsContent
iamsphere Nov 8, 2024
e0e8885
Add AssetsLogos component
iamsphere Nov 8, 2024
e4dfa82
Add ManageVaultModal, add input and action button
iamsphere Nov 11, 2024
d102b7c
Add VaultActivity to ManageVaultModal
iamsphere Nov 11, 2024
12b8b19
Add
iamsphere Nov 11, 2024
f19df43
Small styles improvements
iamsphere Nov 11, 2024
e05cc99
Add filter section to LendVaultsContent
iamsphere Nov 12, 2024
944a946
Add [email protected]
iamsphere Nov 12, 2024
095f1be
Add deposit and withdraw liquidity to pool txns
iamsphere Nov 12, 2024
2a99d20
Add useLiquidityPoolTxns hook
iamsphere Nov 12, 2024
6a42a5b
Add fetchVaultsPreview requests
iamsphere Nov 13, 2024
5aafe1d
Use real data from endpoint instead of mock
iamsphere Nov 14, 2024
5432c60
Merge branch 'development' of https://github.com/frakt-solana/banx-ui…
iamsphere Nov 19, 2024
3532e51
Merge branch 'development' of https://github.com/frakt-solana/banx-ui…
iamsphere Nov 22, 2024
c532aeb
Move LendVaultsContent to Lend folder, rename as LendVaultsPage
iamsphere Nov 22, 2024
757926e
Add empty LendVaultPage
iamsphere Nov 22, 2024
dd7fffa
Add ManageVault component to LendVaultPage
iamsphere Nov 22, 2024
4bb0e86
Add vault manage to LendVaultPage
iamsphere Nov 25, 2024
457e154
Add user stats section in
iamsphere Nov 25, 2024
7ae38a2
Add active view switcher
iamsphere Nov 25, 2024
f9042a0
Update LendVaultsPage previews
iamsphere Nov 25, 2024
4c44607
Update VaultPreviewSchema, small refactor
iamsphere Nov 25, 2024
8342855
Add activity with real data
iamsphere Nov 25, 2024
581b029
Add vault allocation table
iamsphere Nov 26, 2024
fb4fc0d
Add real data to allocation table
iamsphere Nov 26, 2024
e3ee2dc
UI improvements
iamsphere Nov 26, 2024
30ec367
Add secondary type tabs
iamsphere Nov 26, 2024
c35e3c1
Change sorting on preview page, small ui improvements
iamsphere Nov 26, 2024
f19d1c8
Add mobile adaptives
iamsphere Nov 26, 2024
8a95bbe
Add BreadcrumbHeader component
iamsphere Nov 26, 2024
f12a230
Change tooltip texts
iamsphere Nov 26, 2024
bdb84a7
Add user deposit filter
iamsphere Nov 26, 2024
bfe4706
validate withdraw input
iamsphere Nov 26, 2024
0ff11b6
Small ui improvements
iamsphere Nov 27, 2024
54c2371
Merge branch 'development' of https://github.com/frakt-solana/banx-ui…
iamsphere Nov 27, 2024
32d3640
Change layout for tables in LendVaultPage
iamsphere Nov 27, 2024
7f5338e
Add vault state for activity
iamsphere Nov 27, 2024
c533a52
Change table th height
iamsphere Nov 27, 2024
82dd068
Add claim rewards transactions
iamsphere Nov 27, 2024
acd1856
Update sdk, update schemas, add disabled state for deposit input
iamsphere Nov 29, 2024
2379871
Add optimistic logic for deposit and withdraw
iamsphere Dec 1, 2024
6a598af
Add deposit and withdraw via user escrow
iamsphere Dec 1, 2024
2a8efde
Implement request send logic
iamsphere Dec 2, 2024
e810815
Add optimistic for claim rewards and deposit rewards to escrow
iamsphere Dec 3, 2024
6fb319f
Fix fullBalance calculation
iamsphere Dec 3, 2024
5d06ed7
Change Banx logo
iamsphere Dec 3, 2024
4684d35
Add new navigation to header page
iamsphere Dec 3, 2024
ed0770c
Fix wrong navigation
iamsphere Dec 3, 2024
8295ea0
Remove old navbar
iamsphere Dec 3, 2024
976dcd4
Remove old nav link from BurgerMenu
iamsphere Dec 3, 2024
0773395
Add BreadcrumbHeader component
iamsphere Dec 3, 2024
41d47ce
Add onboard content to BreadcrumbHeader
iamsphere Dec 3, 2024
2543eed
Implement new WalletAccountSidebar UI
iamsphere Dec 4, 2024
0128cb0
Show dropdown menu by hovering
iamsphere Dec 4, 2024
770f8dc
Add wallet token assets to sidebar
iamsphere Dec 4, 2024
7bdfc90
Small UI improvements
iamsphere Dec 4, 2024
72cd663
Implement new BurgerMenu component, add zIndex variables
iamsphere Dec 5, 2024
2156e14
Change layout, fix navigation
iamsphere Dec 5, 2024
91fc2a6
Move TopNotification out of layout
iamsphere Dec 5, 2024
b687980
Implement new routing for nftLending pages
iamsphere Dec 5, 2024
51f0e06
Refactor routings
iamsphere Dec 5, 2024
872e66d
Change root layout
iamsphere Dec 5, 2024
beea38e
Add NewLendPlaceOffer
iamsphere Dec 6, 2024
31797ee
UI improvements on the NewLendPlaceOffer
iamsphere Dec 6, 2024
bd7b9b0
Small UI improvements on the NewLendPlaceOffer
iamsphere Dec 6, 2024
cb10e71
Replace LoansHeader and OffersHeader with BreadcrumbHeader
iamsphere Dec 6, 2024
21c4b1d
Add LendLandingPage to nft lend page
iamsphere Dec 6, 2024
6d9ee77
Merge branch 'development' of https://github.com/frakt-solana/banx-ui…
iamsphere Dec 7, 2024
92bf471
Remove landing page from borrow page
iamsphere Dec 7, 2024
5ad51dc
Small restyling of the notifications sidebar
iamsphere Dec 8, 2024
f9afb40
Small restyling of the burger menu
iamsphere Dec 8, 2024
183de53
Remove BorrowPage and OffersHeader from BorrowPage and OffersPage
iamsphere Dec 8, 2024
f722b7f
Implement new token switcher
iamsphere Dec 8, 2024
c16ea6e
Change card border radius and paddings
iamsphere Dec 8, 2024
6833cd9
Add border-radius to table cells
iamsphere Dec 8, 2024
edc3464
Add hover effect to cards
iamsphere Dec 8, 2024
fce6359
Change root container
iamsphere Dec 8, 2024
ce0f1d4
Add ltv to lend token card
iamsphere Dec 8, 2024
cb21d5b
Add FilterDropdown component and replace CategoryDropdown
iamsphere Dec 8, 2024
2b8f27f
Add reserves and requestedWithdrawAmount to vault preview schema
iamsphere Dec 9, 2024
817bb2e
Add withdraw logic and modify request logic
iamsphere Dec 9, 2024
ac81a90
Unite SOL and USDC loans in TokenLoansContent
iamsphere Dec 9, 2024
c7729ae
Use lending token type from bondTradeTransaction
iamsphere Dec 9, 2024
32fe074
Replace tokenType with lendingToken from bondTradeTransaction
iamsphere Dec 9, 2024
830e095
Change connected button in header
iamsphere Dec 10, 2024
5225b27
Implement SettingsModal, restyle ThemeSwitcher and PriorityFeesModal
iamsphere Dec 10, 2024
7d05903
Implement new type of tabs
iamsphere Dec 10, 2024
9553252
Change search select, filter button and sort dropdown styles
iamsphere Dec 10, 2024
1927a38
Remove summary in TokenLoanListingsTable
iamsphere Dec 10, 2024
ce3d2e0
Add my postions to Navbar
iamsphere Dec 10, 2024
194b367
Add border radius to cards
iamsphere Dec 10, 2024
a5ded3f
Merge branch 'development' of https://github.com/frakt-solana/banx-ui…
iamsphere Dec 10, 2024
7400c0a
Merge branch 'development' of https://github.com/frakt-solana/banx-ui…
iamsphere Dec 10, 2024
65c058e
Remove filter by token type from token store
iamsphere Dec 10, 2024
d0ea0a6
Small styles improvements in sidebars
iamsphere Dec 10, 2024
3a6b821
Add close icon to BurgerMenu
iamsphere Dec 10, 2024
c5715e3
Move LoansTokenPage to PortfolioToken folder
iamsphere Dec 10, 2024
04a4b70
Move OffersTokenPage to PortfolioToken folder
iamsphere Dec 10, 2024
42f9d4c
Rename NewLendPlaceOffer to PlaceTokenOfferPage
iamsphere Dec 10, 2024
ef85a73
Rename LendPlaceOfferPage to TokenMarketsPage
iamsphere Dec 10, 2024
861fdfe
Rename LendLoanMarketPage to TokenLoansMarketPage
iamsphere Dec 10, 2024
f113cbb
Renamings in routing
iamsphere Dec 10, 2024
f306edc
Move LeveragePositions to PortfolioToken folder
iamsphere Dec 10, 2024
b151d0f
Add tokenType param as optional for fetchTokenOffersPreview
iamsphere Dec 10, 2024
a7371cd
Use lendingToken from props instead of tokenType
iamsphere Dec 11, 2024
3e2e74d
Add lendingToken to ActionsButtons, Summary and
iamsphere Dec 11, 2024
5e3cda1
Update /spl-loans/borrower to /spl-loans/borrower-v2
iamsphere Dec 11, 2024
6747a60
Add BreadcrumbHeader to TokenPositionsPage
iamsphere Dec 11, 2024
e72621e
Add Dropdowns components
iamsphere Dec 11, 2024
8b904f4
Add TokenDropdown component to TokenMarketsPage
iamsphere Dec 11, 2024
de7b972
Add TokenDropdown to TokenLoansMarketPage, TokenLoansContent
iamsphere Dec 11, 2024
64a7d73
Add TokenDropdown to TokenLoanListingsTable
iamsphere Dec 11, 2024
340f16d
Change order of filters in LendToken and TokenOffers pages
iamsphere Dec 11, 2024
6c180aa
Update filters for all token pages
iamsphere Dec 12, 2024
075dc7c
Update filters for all nft pages
iamsphere Dec 12, 2024
59d172f
Add TokenDropdown to all nft pages
iamsphere Dec 12, 2024
33d981b
Small UI improvements
iamsphere Dec 12, 2024
8a222f3
Small UI improvements and fixes
iamsphere Dec 12, 2024
5c5a9c1
Add empty state and empty filtered state for token loans market page
iamsphere Dec 13, 2024
0f178c9
Update empty for token loans page
iamsphere Dec 14, 2024
84e6e8f
Add new Search component, add filterBySearchQuery helper
iamsphere Dec 14, 2024
e858006
Add search to TokenLoansMarketPage
iamsphere Dec 14, 2024
9cd2533
Replace SearchSelect with Search on loans token pages
iamsphere Dec 14, 2024
404e503
Replace SearchSelect with Search on offers token page
iamsphere Dec 14, 2024
e5e8430
Replace SearchSelect with Search on nft lend page
iamsphere Dec 14, 2024
2fbc3b8
Replace SearchSelect with Search on nft lend page and offers page
iamsphere Dec 14, 2024
0a5b834
Replace SearchSelect with Search on borrow page
iamsphere Dec 14, 2024
4f48f55
Remove SearchSelect component
iamsphere Dec 14, 2024
1edb62d
Remove unused styles, add new styles for Search component
iamsphere Dec 14, 2024
1338a1d
Update empty state for TokenLoansPage and TokenMarketsPage
iamsphere Dec 14, 2024
ef7dd2e
Update empty state for TokenOffersPage
iamsphere Dec 14, 2024
733ce45
Update empty state for TokenLoansPage
iamsphere Dec 14, 2024
8713718
Small UI fixes and improvements
iamsphere Dec 14, 2024
419fb36
Add close icon to Search
iamsphere Dec 14, 2024
77e7ff7
Add TokenDropdown to LenderTokenActivityTable and BorrowerTokenActivi…
iamsphere Dec 14, 2024
93720c7
Add filters to the token positions page
iamsphere Dec 15, 2024
b2cb17b
Update messages for tokens pages
iamsphere Dec 15, 2024
35cb3f6
Add empty message to the lend nft pages
iamsphere Dec 15, 2024
68fde4e
Update messages for nft loans pages
iamsphere Dec 15, 2024
f6bd083
Update empty message for nft offers pages
iamsphere Dec 15, 2024
4b03eaa
Update empty message for nft borrow pages and small UI improvements
iamsphere Dec 15, 2024
78d8160
Update PlaceTokenOfferPage and LendTokenActivityTable
iamsphere Dec 15, 2024
359f4b3
Fix scroll on overview page
iamsphere Dec 15, 2024
1932cda
Add max width to filter wrapper
iamsphere Dec 15, 2024
bbb3015
Add lendingTokenIcon to CollateralCell
iamsphere Dec 15, 2024
1a66c0f
Merge branch 'feature/BAN-2792' of https://github.com/frakt-solana/ba…
iamsphere Dec 16, 2024
4ce848c
Restyle the vaults page to match the new design
iamsphere Dec 16, 2024
e9e7fa7
Update image sizes
iamsphere Dec 16, 2024
0970df0
Rename PlaceTokenOfferPage to TokenMarketPage
iamsphere Dec 16, 2024
0b76962
Add content wrap to TokenMarketPage
iamsphere Dec 16, 2024
7dcca9d
Update messages
iamsphere Dec 16, 2024
f983cad
Update all empty lists
iamsphere Dec 16, 2024
c947636
Update loading states for all pages
iamsphere Dec 16, 2024
65dac2a
Add sorting by LTV to offers page
iamsphere Dec 16, 2024
e5af160
Add sorting by APR and optimize sorting by LTV
iamsphere Dec 16, 2024
7f7ffc7
Add fake infinite scroll to offers pages
iamsphere Dec 16, 2024
9784b1a
Remove core from types in useSortedOffers
iamsphere Dec 16, 2024
2fec5ed
Remove icon from BurgerMenu and change image sizes
iamsphere Dec 17, 2024
3a8d4cc
Small UI improvements
iamsphere Dec 17, 2024
69b352f
Update list loans form styles
iamsphere Dec 17, 2024
f4f49d1
Small update of borrow page, remove borders, change bg
iamsphere Dec 17, 2024
7d65482
Implement new sorting by usdc value, add useTokenPrice hook
iamsphere Dec 18, 2024
a4a4a59
Rename in offers to size in useSortedOffers
iamsphere Dec 18, 2024
7cdcc24
Squashed commit of the following:
iamsphere Dec 18, 2024
d22c0d9
Use sorting by ticker instead of name
iamsphere Dec 18, 2024
22c8ada
Rename sort fields
iamsphere Dec 18, 2024
7941812
Fix zero rendering on LeverageLanding
iamsphere Dec 18, 2024
8e5b4b1
Fix wallet connect button
iamsphere Dec 18, 2024
21dcaf3
Merge branch 'development' of https://github.com/frakt-solana/banx-ui…
iamsphere Dec 18, 2024
0d75ae8
Rename useWalletModal to useWalletSidebar
iamsphere Dec 18, 2024
a917997
Small UI fixes
iamsphere Dec 20, 2024
c8937cc
Small improvements, refactoring and bug fixes
iamsphere Dec 20, 2024
f2bf131
Refactor CollaterallCell
iamsphere Dec 20, 2024
6998309
Merge branch 'development' of https://github.com/frakt-solana/banx-ui…
iamsphere Dec 23, 2024
cc3cad4
Fix big with button text outside button in reborrow modal
iamsphere Dec 25, 2024
3930a39
Merge branch 'development' of https://github.com/frakt-solana/banx-ui…
iamsphere Jan 6, 2025
7672191
Add new wix font, update fonts
iamsphere Jan 6, 2025
d4257b8
Small ui changes in LeveragePage
iamsphere Jan 7, 2025
dc1dca3
Remove RootPage content, set leverage page as default page
iamsphere Jan 7, 2025
519b264
Fix sorting of order book
iamsphere Jan 7, 2025
7542c99
Change font-weight for important text
iamsphere Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@tanstack/react-query-persist-client": "^4.33.0",
"antd": "^5.7.3",
"axios": "^1.4.0",
"banx-vaults-sdk": "0.0.12",
"bs58": "^5.0.0",
"chart.js": "^4.4.0",
"classnames": "^2.3.2",
Expand Down
63 changes: 45 additions & 18 deletions src/api/tokens/core/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
TokenLoanSchema,
TokenMarketPreviewSchema,
TokenOfferPreviewSchema,
WalletTokenLoansAndOffersShema,
VaultPreviewSchema,
} from './schemas'
import {
BorrowOfferRaw,
Expand All @@ -32,7 +32,7 @@ import {
TokenMarketPreview,
TokenMarketPreviewResponse,
TokenOfferPreview,
WalletTokenLoansAndOffers,
VaultPreview,
} from './types'

type FetchTokenMarketsPreview = (
Expand Down Expand Up @@ -80,7 +80,7 @@ export const fetchTokenMarketOffers: FetchTokenMarketOffers = async ({

type FetchTokenOffersPreview = (props: {
walletPubkey: string
tokenType: LendingTokenType
tokenType?: LendingTokenType
}) => Promise<TokenOfferPreview[] | undefined>
export const fetchTokenOffersPreview: FetchTokenOffersPreview = async ({
walletPubkey,
Expand All @@ -89,21 +89,24 @@ export const fetchTokenOffersPreview: FetchTokenOffersPreview = async ({
const queryParams = new URLSearchParams({
getAll: String(true),
isPrivate: String(IS_PRIVATE_MARKETS),
marketType: String(convertToMarketType(tokenType)),
})

if (tokenType) {
queryParams.append('marketType', convertToMarketType(tokenType))
}

const { data } = await axios.get<{ data: TokenOfferPreview[] }>(
`${BACKEND_BASE_URL}/spl-offers/my-offers/${walletPubkey}?${queryParams.toString()}`,
`${BACKEND_BASE_URL}/spl-offers/my-offers-v2/${walletPubkey}?${queryParams.toString()}`,
)

return await parseResponseSafe<TokenOfferPreview[]>(data?.data, TokenOfferPreviewSchema.array())
}

type FetchWalletTokenLoansAndOffers = (props: {
walletPublicKey: string
tokenType: LendingTokenType
tokenType?: LendingTokenType
getAll?: boolean
}) => Promise<WalletTokenLoansAndOffers | undefined>
}) => Promise<TokenLoan[] | undefined>

export const fetchWalletTokenLoansAndOffers: FetchWalletTokenLoansAndOffers = async ({
walletPublicKey,
Expand All @@ -112,23 +115,23 @@ export const fetchWalletTokenLoansAndOffers: FetchWalletTokenLoansAndOffers = as
}) => {
const queryParams = new URLSearchParams({
getAll: String(getAll),
marketType: String(convertToMarketType(tokenType)),
isPrivate: String(IS_PRIVATE_MARKETS),
})

const { data } = await axios.get<{ data: WalletTokenLoansAndOffers }>(
`${BACKEND_BASE_URL}/spl-loans/borrower/${walletPublicKey}?${queryParams.toString()}`,
)
if (tokenType) {
queryParams.append('marketType', convertToMarketType(tokenType))
}

return await parseResponseSafe<WalletTokenLoansAndOffers>(
data?.data,
WalletTokenLoansAndOffersShema,
const { data } = await axios.get<{ data: TokenLoan[] }>(
`${BACKEND_BASE_URL}/spl-loans/borrower-v2/${walletPublicKey}?${queryParams.toString()}`,
)

return await parseResponseSafe<TokenLoan[]>(data?.data, TokenLoanSchema.array())
}

type FetchTokenLenderLoans = (props: {
walletPublicKey: string
tokenType: LendingTokenType
tokenType?: LendingTokenType
getAll?: boolean
}) => Promise<TokenLoan[] | undefined>
export const fetchTokenLenderLoans: FetchTokenLenderLoans = async ({
Expand All @@ -137,11 +140,14 @@ export const fetchTokenLenderLoans: FetchTokenLenderLoans = async ({
getAll = true,
}) => {
const queryParams = new URLSearchParams({
marketType: String(convertToMarketType(tokenType)),
isPrivate: String(IS_PRIVATE_MARKETS),
getAll: String(getAll),
})

if (tokenType) {
queryParams.append('marketType', convertToMarketType(tokenType))
}

const { data } = await axios.get<{ data: TokenLoan[] }>(
`${BACKEND_BASE_URL}/spl-loans/lender/${walletPublicKey}?${queryParams.toString()}`,
)
Expand Down Expand Up @@ -203,7 +209,7 @@ export const fetchTokenLoanAuctionsAndListings: fetchTokenLoanAuctionsAndListing

type FetchUserTokenLoanListings = (props: {
walletPubkey: string
tokenType: LendingTokenType
tokenType?: LendingTokenType
getAll?: boolean
}) => Promise<TokenLoan[] | undefined>

Expand All @@ -213,11 +219,14 @@ export const fetchUserTokenLoanListings: FetchUserTokenLoanListings = async ({
getAll = true,
}) => {
const queryParams = new URLSearchParams({
marketType: String(convertToMarketType(tokenType)),
isPrivate: String(IS_PRIVATE_MARKETS),
getAll: String(getAll),
})

if (tokenType) {
queryParams.append('marketType', convertToMarketType(tokenType))
}

const { data } = await axios.get<{ data: TokenLoan[] }>(
`${BACKEND_BASE_URL}/spl-loans/borrower-requests/${walletPubkey}?${queryParams.toString()}`,
)
Expand Down Expand Up @@ -252,6 +261,24 @@ export const fetchExtraTokenReward = async (): Promise<MarketTokenRewardsRespons
return data
}

type FetchVaultsPreview = (props: {
walletPubkey: string
tokenType: LendingTokenType
}) => Promise<VaultPreview[]>
export const fetchVaultsPreview: FetchVaultsPreview = async ({ walletPubkey, tokenType }) => {
const queryParams = new URLSearchParams({
getAll: String(true),
isPrivate: String(IS_PRIVATE_MARKETS),
marketType: String(convertToMarketType(tokenType)),
})

const { data } = await axios.get<{ data: VaultPreview[] }>(
`${BACKEND_BASE_URL}/vaults/preview?walletPublicKey=${walletPubkey}&${queryParams.toString()}`,
)

return await VaultPreviewSchema.array().parseAsync(data.data)
}

type FetchOfferWithMaxMultiplier = (params: {
marketPubkey: string
tokenType: LendingTokenType
Expand Down
60 changes: 52 additions & 8 deletions src/api/tokens/core/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { z } from 'zod'
import {
BondTradeTransactionSchema,
FraktBondSchema,
OfferSchema,
SerializedBNSchema,
SerializedIntBNSchema,
SerializedPublicKeySchema,
Expand Down Expand Up @@ -35,7 +34,7 @@ export const TokenLoanSchema = z.object({
collateral: TokenMetaSchema,
collateralPrice: StringIntSchema,
totalRepaidAmount: z.number().optional(),
pnl: z.number().optional(),
pnl: z.number().nullable().optional(),
})

export const TokenMarketPreviewSchema = z.object({
Expand Down Expand Up @@ -91,7 +90,12 @@ export const BondOfferV3Schema = z.object({
export const TokenOfferPreviewSchema = z.object({
publicKey: z.string(),
bondOffer: BondOfferV3Schema,
tokenMarketPreview: TokenMarketPreviewSchema,
tokenMarketPreview: z.object({
marketPubkey: z.string(),
collateral: TokenMetaSchema,
collateralPrice: StringIntSchema,
marketCategory: z.array(z.string().or(z.nativeEnum(MarketCategory))),
}),
tokenOfferPreview: z.object({
publicKey: z.string(),
liquidatedLoansAmount: z.number(),
Expand All @@ -103,11 +107,6 @@ export const TokenOfferPreviewSchema = z.object({
}),
})

export const WalletTokenLoansAndOffersShema = z.object({
loans: z.array(TokenLoanSchema),
offers: z.record(OfferSchema.array()),
})

export const TokenLoanAuctionsAndListingsSchema = z.object({
auctions: TokenLoanSchema.array(),
listings: TokenLoanSchema.array(),
Expand Down Expand Up @@ -161,6 +160,51 @@ export const BorrowOfferSchemaRaw = z.object({
assetReceiver: z.string(),
})

export const VaultPreviewSchema = z.object({
vaultPubkey: z.string(),
vaultName: z.string(),
lenderWalletPubkey: z.string(),

totalDepositedAmount: z.number(),
maxCapacity: z.number(),
loansTvl: z.number(),
currentApy: z.number(),
targetApy: z.number(),
performance: z.number(),

reserves: StringIntSchema,
requestedWithdrawAmount: StringIntSchema,
userTotalDepositedAmount: StringIntSchema,
pendingClaimAmount: StringIntSchema,

assetsAllocation: z.array(
z.object({
allocation: z.number(),
mint: z.string(),
ticker: z.string(),
logoUrl: z.string(),
totalDepositedAmount: z.number(),
maxCapacity: z.number(),
liquidationLtv: z.number(),
avgLtv: z.number(),
apr: z.number(),
}),
),

assetsDetails: z.array(
z.object({
mint: z.string(),
ticker: z.string(),
logoUrl: z.string(),
}),
),

curatorDetails: z.object({
name: z.string(),
logoUrl: z.string(),
}),
})

export const OfferWithMaxMultiplierSchema = z.object({
offer: z.object({
id: z.string(),
Expand Down
5 changes: 2 additions & 3 deletions src/api/tokens/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
TokenMarketPreviewSchema,
TokenMetaSchema,
TokenOfferPreviewSchema,
WalletTokenLoansAndOffersShema,
VaultPreviewSchema,
} from './schemas'

export type TokenMeta = z.infer<typeof TokenMetaSchema>
Expand All @@ -25,8 +25,6 @@ export type TokenMarketPreviewResponse = ResponseWithPagination<TokenMarketPrevi

export type TokenOfferPreview = z.infer<typeof TokenOfferPreviewSchema>

export type WalletTokenLoansAndOffers = z.infer<typeof WalletTokenLoansAndOffersShema>

export type TokenLoanAuctionsAndListings = z.infer<typeof TokenLoanAuctionsAndListingsSchema>
export type TokenLoanAuctionsAndListingsResponse =
ResponseWithPagination<TokenLoanAuctionsAndListings>
Expand Down Expand Up @@ -62,4 +60,5 @@ export interface MarketTokenRewards {

export type MarketTokenRewardsResponse = Record<string, MarketTokenRewards>

export type VaultPreview = z.infer<typeof VaultPreviewSchema>
export type OfferWithMaxMultiplier = z.infer<typeof OfferWithMaxMultiplierSchema>
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,39 @@
.sider {
background-color: var(--bg-primary);
right: 0;
overflow-y: auto;
display: flex;
flex-direction: column;

transform: translateX(0);
transition: transform 0.3s ease-in-out;
}

.siderHidden {
display: none;
transform: translateX(100%);
}

.siderOverlay {
background: var(--overlay-bg);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: var(--z-overlay);

opacity: 0;
transition: opacity 0.3s ease-in-out;
pointer-events: none;

&.visible {
opacity: 1;
pointer-events: auto;
}
}

//? Sider header styles
.header {
padding: 12px 24px;
border-bottom: var(--border-less-primary);
padding: 24px 24px 8px;
}

.headerTitleContainer {
Expand All @@ -23,13 +44,8 @@
}

.headerTitle {
color: var(--content-secondary);
font: var(--title-lg);
font: var(--title-md);
text-transform: uppercase;

@media (max-width: 640px) {
font: var(--title-md);
}
}

.clearNotificationsBtn {
Expand Down Expand Up @@ -70,15 +86,14 @@
}

.contentTitle {
font: var(--title-lg);
font: var(--title-md);
text-transform: uppercase;
width: 100%;
text-align: center;
margin-bottom: 16px;

@media (max-width: 640px) {
margin-bottom: 8px;
font: var(--title-md);
}
}
.contentTitleSign {
Expand Down Expand Up @@ -151,3 +166,40 @@
color: var(--content-secondary);
font: var(--body-text-xs);
}

.closeIcon {
display: none;

@media (max-width: 640px) {
background: var(--bg-primary);
border: var(--border-less-primary);
border-radius: 100px;
cursor: pointer;

display: none;
justify-content: center;
align-items: center;

position: absolute;
top: 16px;
left: -40px;
z-index: var(--z-sidebar);

min-height: 32px;
min-width: 32px;

&.visible {
display: flex;
}

svg {
width: 12px;

stroke: var(--content-primary);

rect {
fill: var(--content-primary);
}
}
}
}
Loading