├── .babelrc
├── .env.template
├── .eslintignore
├── .eslintrc.js
├── .github
└── workflows
│ ├── ci.yaml
│ └── pull_request_template.md
├── .gitignore
├── .htaccess
├── .husky
├── pre-commit
└── pre-push
├── .lintstagedrc
├── .nvmrc
├── .prettierignore
├── .prettierrc.js
├── .storybook
├── main.js
└── preview.js
├── .stylelintrc.js
├── Dockerfile
├── Dockerfile.local
├── LICENSE
├── README.md
├── app.json
├── docker-compose.yaml
├── ecosystem.json
├── i18next-parser.config.js
├── nginx_default.conf
├── package.json
├── patches
└── @stylelint+postcss-css-in-js+0.37.2.patch
├── public
├── coins
│ ├── aave.png
│ ├── ada.png
│ ├── bch.png
│ ├── beth.png
│ ├── bnb.png
│ ├── btcb.png
│ ├── busd.png
│ ├── cake.png
│ ├── dai.png
│ ├── doge.png
│ ├── dot.png
│ ├── eth.png
│ ├── fil.png
│ ├── link.png
│ ├── ltc.png
│ ├── luna.png
│ ├── matic.png
│ ├── sxp.png
│ ├── trx.png
│ ├── tusd.png
│ ├── usdc.png
│ ├── usdt.png
│ ├── ust.png
│ ├── vaave.png
│ ├── vada.png
│ ├── vai.svg
│ ├── vbch.png
│ ├── vbeth.png
│ ├── vbnb.png
│ ├── vbtc.png
│ ├── vbusd.png
│ ├── vcake.png
│ ├── vdai.png
│ ├── vdoge.png
│ ├── vdot.png
│ ├── veth.png
│ ├── vfil.png
│ ├── vlink.png
│ ├── vltc.png
│ ├── vluna.png
│ ├── vmatic.png
│ ├── vrt.svg
│ ├── vsxp.png
│ ├── vtrx.png
│ ├── vtusd.png
│ ├── vusdc.png
│ ├── vusdt.png
│ ├── vust.png
│ ├── vxrp.png
│ ├── vxvs.png
│ ├── xrp.png
│ ├── xvs.png
│ └── xvs.svg
├── index.html
├── maintainance.html
├── maintenance.jpg
├── manifest.json
└── mockServiceWorker.js
├── pull_request_template.md
├── regconfig.json
├── src
├── __mocks__
│ ├── CSSStub.js
│ ├── api
│ │ ├── governance.json
│ │ ├── proposals.json
│ │ ├── transactions.json
│ │ ├── voterAccounts.json
│ │ ├── voterDetails.json
│ │ ├── voterHistory.json
│ │ └── voters.json
│ ├── contracts
│ │ ├── comptroller.ts
│ │ ├── governanceBravoDelegate.ts
│ │ ├── vaiUnitroller.ts
│ │ ├── vaiVault.ts
│ │ ├── vrtVault.ts
│ │ └── xvsVault.ts
│ └── models
│ │ ├── address.ts
│ │ ├── asset.ts
│ │ ├── assetsInAccount.ts
│ │ ├── marketSnapshots.ts
│ │ ├── markets.ts
│ │ ├── pools.ts
│ │ ├── proposals.ts
│ │ ├── transactionReceipt.ts
│ │ ├── transactions.ts
│ │ ├── vTokenApySimulations.ts
│ │ ├── vTokenBalanceTreasury.ts
│ │ ├── vTokenBalancesAccount.ts
│ │ ├── vaults.ts
│ │ ├── voterAccounts.ts
│ │ ├── voterDetails.ts
│ │ ├── voterHistory.ts
│ │ └── voters.ts
├── assets
│ ├── fonts
│ │ └── proximaNova
│ │ │ ├── proximaNovaBold.ttf
│ │ │ ├── proximaNovaBold.woff
│ │ │ ├── proximaNovaBold.woff2
│ │ │ ├── proximaNovaBoldIt.ttf
│ │ │ ├── proximaNovaBoldIt.woff
│ │ │ ├── proximaNovaBoldIt.woff2
│ │ │ ├── proximaNovaRegular.ttf
│ │ │ ├── proximaNovaRegular.woff
│ │ │ ├── proximaNovaRegular.woff2
│ │ │ ├── proximaNovaRegularIt.ttf
│ │ │ ├── proximaNovaRegularIt.woff
│ │ │ ├── proximaNovaRegularIt.woff2
│ │ │ ├── proximaNovaSemibold.ttf
│ │ │ ├── proximaNovaSemibold.woff
│ │ │ ├── proximaNovaSemibold.woff2
│ │ │ ├── proximaNovaSemiboldIt.ttf
│ │ │ ├── proximaNovaSemiboldIt.woff
│ │ │ └── proximaNovaSemiboldIt.woff2
│ ├── img
│ │ ├── mark.svg
│ │ ├── tokens
│ │ │ ├── aave.png
│ │ │ ├── ada.png
│ │ │ ├── bch.png
│ │ │ ├── beth.png
│ │ │ ├── bnb.png
│ │ │ ├── btc.png
│ │ │ ├── btcb.png
│ │ │ ├── busd.png
│ │ │ ├── cake.png
│ │ │ ├── dai.png
│ │ │ ├── doge.png
│ │ │ ├── dot.png
│ │ │ ├── eth.png
│ │ │ ├── fil.png
│ │ │ ├── link.png
│ │ │ ├── ltc.png
│ │ │ ├── luna.png
│ │ │ ├── matic.png
│ │ │ ├── sxp.png
│ │ │ ├── trx.png
│ │ │ ├── tusd.png
│ │ │ ├── usdc.png
│ │ │ ├── usdt.png
│ │ │ ├── ust.png
│ │ │ ├── vaave.png
│ │ │ ├── vada.png
│ │ │ ├── vai.svg
│ │ │ ├── vbch.png
│ │ │ ├── vbeth.png
│ │ │ ├── vbnb.png
│ │ │ ├── vbtc.png
│ │ │ ├── vbusd.png
│ │ │ ├── vcake.png
│ │ │ ├── vdai.png
│ │ │ ├── vdoge.png
│ │ │ ├── vdot.png
│ │ │ ├── veth.png
│ │ │ ├── vfil.png
│ │ │ ├── vlink.png
│ │ │ ├── vltc.png
│ │ │ ├── vluna.png
│ │ │ ├── vmatic.png
│ │ │ ├── vrt.svg
│ │ │ ├── vsxp.png
│ │ │ ├── vtrx.png
│ │ │ ├── vtusd.png
│ │ │ ├── vusdc.png
│ │ │ ├── vusdt.png
│ │ │ ├── vust.png
│ │ │ ├── vxrp.png
│ │ │ ├── vxvs.png
│ │ │ ├── xrp.png
│ │ │ └── xvs.svg
│ │ ├── venusLogoPure.svg
│ │ ├── venusLogoWithText.svg
│ │ └── wallets
│ │ │ ├── binanceChainWalletLogo.svg
│ │ │ ├── bitKeepLogo.svg
│ │ │ ├── braveWalletLogo.svg
│ │ │ ├── coinbaseWalletLogo.svg
│ │ │ ├── infinityWalletLogo.svg
│ │ │ ├── ledgerLogo.svg
│ │ │ ├── metaMaskLogo.svg
│ │ │ ├── operaWalletLogo.svg
│ │ │ ├── trustWalletLogo.svg
│ │ │ └── walletConnectLogo.svg
│ └── styles
│ │ ├── App.scss
│ │ ├── Global.scss
│ │ ├── index.scss
│ │ └── normalize.scss
├── clients
│ ├── api
│ │ ├── __mocks__
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── mutations
│ │ │ ├── approveToken
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useApproveToken.ts
│ │ │ ├── borrowVToken
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useBorrowVToken.ts
│ │ │ ├── cancelProposal
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useCancelProposal.ts
│ │ │ ├── claimVaiVaultReward
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useClaimVaiVaultReward.ts
│ │ │ ├── claimVrtVaultReward
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useClaimVrtVaultReward.ts
│ │ │ ├── claimXvsReward
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useClaimXvsReward.ts
│ │ │ ├── claimXvsVaultReward
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useClaimXvsVaultReward.ts
│ │ │ ├── convertVrt
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useConvertVrt.ts
│ │ │ ├── createProposal
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useCreateProposal.ts
│ │ │ ├── enterMarkets
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useEnterMarkets.ts
│ │ │ ├── executeProposal
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useExecuteProposal.ts
│ │ │ ├── executeWithdrawalFromXvsVault
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.tsx
│ │ │ │ └── useExecuteWithdrawalFromXvsVault.ts
│ │ │ ├── exitMarket
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useExitMarket.ts
│ │ │ ├── mintVai
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useMintVai.ts
│ │ │ ├── queueProposal
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useQueueProposal.ts
│ │ │ ├── redeem
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useRedeem.ts
│ │ │ ├── redeemUnderlying
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useRedeemUnderlying.ts
│ │ │ ├── repayBnb
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useRepayBnb.ts
│ │ │ ├── repayNonBnbVToken
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useRepayNonBnbVToken.ts
│ │ │ ├── repayVai
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useRepayVai.ts
│ │ │ ├── requestWithdrawalFromXvsVault
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.tsx
│ │ │ │ └── useRequestWithdrawalFromXvsVault.ts
│ │ │ ├── setVoteDelegate
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useSetVoteDelegate.ts
│ │ │ ├── stakeInVaiVault
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useStakeInVaiVault.ts
│ │ │ ├── stakeInVrtVault
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useStakeInVrtVault.ts
│ │ │ ├── stakeInXvsVault
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useStakeInXvsVault.ts
│ │ │ ├── supplyBnb
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useSupplyBnb.ts
│ │ │ ├── supplyNonBnb
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useSupplyNonBnb.ts
│ │ │ ├── useRepayVToken.ts
│ │ │ ├── useSupply.ts
│ │ │ ├── vote
│ │ │ │ ├── castVote.spec.ts
│ │ │ │ ├── castVote.ts
│ │ │ │ ├── castVoteWithReason.spec.ts
│ │ │ │ ├── castVoteWithReason.ts
│ │ │ │ ├── useCastVote.ts
│ │ │ │ └── useCastVoteWithReason.ts
│ │ │ ├── withdrawFromVaiVault
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useWithdrawFromVaiVault.ts
│ │ │ ├── withdrawFromVrtVault
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useWithdrawFromVrtVault.ts
│ │ │ └── withdrawXvs
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useWithdrawXvs.ts
│ │ ├── queries
│ │ │ ├── getAllowance
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── setCachedTokenAllowanceToMax.ts
│ │ │ │ └── useGetAllowance.ts
│ │ │ ├── getAssetsInAccount
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetAssetsInAccount.ts
│ │ │ ├── getBalanceOf
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetBalanceOf.ts
│ │ │ ├── getBlockNumber
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetBlockNumber.ts
│ │ │ ├── getCurrentVotes
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetCurrentVotes.ts
│ │ │ ├── getDailyXvs
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetDailyXvs.ts
│ │ │ ├── getHypotheticalAccountLiquidity
│ │ │ │ ├── index.spec.ts
│ │ │ │ └── index.ts
│ │ │ ├── getLatestProposalIdByProposer
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetLatestProposalIdByProposer.ts
│ │ │ ├── getMarketHistory
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetMarketHistory.ts
│ │ │ ├── getMarkets
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetMarkets.ts
│ │ │ ├── getMintableVai
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatToOutput.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetMintableVai.ts
│ │ │ ├── getMintedVai
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetMintedVai.ts
│ │ │ ├── getProposalEta
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetProposalEta.ts
│ │ │ ├── getProposalState
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetProposalState.ts
│ │ │ ├── getProposalThreshold
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetProposalThreshold.ts
│ │ │ ├── getProposals
│ │ │ │ ├── __snapshots__
│ │ │ │ │ ├── getProposal.spec.ts.snap
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── getProposal.spec.ts
│ │ │ │ ├── getProposal.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ ├── useGetProposal.ts
│ │ │ │ └── useGetProposals.ts
│ │ │ ├── getTransactions
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatTransaction.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetTransactions.ts
│ │ │ ├── getVTokenApySimulations
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVTokenApySimulations.ts
│ │ │ ├── getVTokenBalanceOf
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVTokenBalanceOf.ts
│ │ │ ├── getVTokenBalancesAll
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVTokenBalancesAll.ts
│ │ │ ├── getVTokenBorrowRate
│ │ │ │ ├── index.spec.ts
│ │ │ │ └── index.ts
│ │ │ ├── getVTokenCash
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVTokenCash.ts
│ │ │ ├── getVTokenInterestRateModel
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVTokenInterestRateModel.ts
│ │ │ ├── getVTokenSupplyRate
│ │ │ │ ├── index.spec.ts
│ │ │ │ └── index.ts
│ │ │ ├── getVaiTreasuryPercentage
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVaiTreasuryPercentage.ts
│ │ │ ├── getVaiVaultPendingXvs
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVaiVaultPendingXvs.ts
│ │ │ ├── getVaiVaultUserInfo
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatToUserInfo.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetVaiVaultUserInfo.ts
│ │ │ ├── getVenusVaiVaultDailyRate
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVenusVaiVaultDailyRate.ts
│ │ │ ├── getVoteDelegateAddress
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVoteDelegateAddress.ts
│ │ │ ├── getVoteReceipt
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVoteReceipt.ts
│ │ │ ├── getVoterAccounts
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatVoterAccountResponse.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetVoterAccounts.ts
│ │ │ ├── getVoterDetails
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatVoterDetailsResponse.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetVoterDetails.ts
│ │ │ ├── getVoterHistory
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatVoterHistoryResponse.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetVoterHistory.ts
│ │ │ ├── getVoters
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatToVoters.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetVoters.ts
│ │ │ ├── getVrtConversionEndTime
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVrtConversionEndTime.ts
│ │ │ ├── getVrtConversionRatio
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVrtConversionRatio.ts
│ │ │ ├── getVrtVaultAccruedInterest
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVrtVaultAccruedInterest.ts
│ │ │ ├── getVrtVaultInterestRatePerBlock
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetVrtVaultInterestRatePerBlock.ts
│ │ │ ├── getVrtVaultUserInfo
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatToUserInfo.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetVrtVaultUserInfo.ts
│ │ │ ├── getXvsReward
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetXvsReward.ts
│ │ │ ├── getXvsVaultLockedDeposits
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatToLockedDeposit.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetXvsVaultLockedDeposits.ts
│ │ │ ├── getXvsVaultPendingReward
│ │ │ │ ├── index.spec.ts
│ │ │ │ └── index.ts
│ │ │ ├── getXvsVaultPoolCount
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetXvsVaultPoolCount.ts
│ │ │ ├── getXvsVaultPoolInfo
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatToPoolInfo.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetXvsVaultPoolInfo.ts
│ │ │ ├── getXvsVaultRewardPerBlock
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetXvsVaultRewardPerBlock.ts
│ │ │ ├── getXvsVaultTotalAllocationPoints
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetXvsVaultTotalAllocationPoints.ts
│ │ │ ├── getXvsVaultUserInfo
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.ts.snap
│ │ │ │ ├── formatToUserInfo.ts
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── useGetXvsVaultUserInfo.ts
│ │ │ ├── getXvsWithdrawableAmount
│ │ │ │ ├── index.spec.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── useGetXvsWithdrawableAmount.ts
│ │ │ ├── useGetTreasuryTotals
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.tsx.snap
│ │ │ │ ├── index.spec.tsx
│ │ │ │ └── index.ts
│ │ │ ├── useGetUserMarketInfo
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.tsx.snap
│ │ │ │ ├── index.spec.tsx
│ │ │ │ └── index.ts
│ │ │ └── useGetVaults
│ │ │ │ ├── __snapshots__
│ │ │ │ └── index.spec.tsx.snap
│ │ │ │ ├── index.spec.tsx
│ │ │ │ ├── index.ts
│ │ │ │ ├── useGetVaiVault.ts
│ │ │ │ ├── useGetVestingVaults
│ │ │ │ ├── index.ts
│ │ │ │ ├── useGetXvsVaultPoolBalances.ts
│ │ │ │ └── useGetXvsVaultPools.ts
│ │ │ │ └── useGetVrtVault.ts
│ │ └── queryClient.ts
│ ├── contracts
│ │ ├── __mocks__
│ │ │ └── index.ts
│ │ ├── getters.ts
│ │ ├── hooks.ts
│ │ ├── index.ts
│ │ └── types.ts
│ └── web3
│ │ ├── Web3Wrapper
│ │ ├── Web3ReactManager.tsx
│ │ └── index.tsx
│ │ ├── addTokenToWallet.ts
│ │ ├── connectors.ts
│ │ ├── getWeb3NoAccount.ts
│ │ ├── index.ts
│ │ ├── types.ts
│ │ ├── useAuth
│ │ ├── index.spec.tsx
│ │ ├── index.ts
│ │ └── setUpNetwork.ts
│ │ ├── useEagerConnect.ts
│ │ ├── useInactiveListener.ts
│ │ ├── useWeb3.ts
│ │ └── walletDetectionUtils.ts
├── components
│ ├── Accordion
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── ActiveVotingProgress
│ │ ├── index.tsx
│ │ └── styles.tsx
│ ├── AuthModal
│ │ ├── AccountDetails
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── WalletList
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── constants.ts
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── types.ts
│ ├── BscLink
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Button
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── styles.tsx
│ │ └── types.ts
│ ├── ButtonGroup
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.tsx
│ ├── CellGroup
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Checkbox
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Chip
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── ConnectWallet
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Countdown
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Delimiter
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── EllipseAddress
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ └── types.ts
│ ├── EnableToken
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Form
│ │ ├── FormikMarkdownEditor.tsx
│ │ ├── FormikSubmitButton.tsx
│ │ ├── FormikTextField.tsx
│ │ ├── FormikTokenTextField.tsx
│ │ └── index.ts
│ ├── Icon
│ │ ├── icons
│ │ │ ├── arrowRight.tsx
│ │ │ ├── arrowShaft.tsx
│ │ │ ├── arrowUp.tsx
│ │ │ ├── attention.tsx
│ │ │ ├── bubble.tsx
│ │ │ ├── burger.tsx
│ │ │ ├── check.tsx
│ │ │ ├── checkInline.tsx
│ │ │ ├── checkboxBorder.tsx
│ │ │ ├── checked.tsx
│ │ │ ├── chevronLeft.tsx
│ │ │ ├── chevronRight.tsx
│ │ │ ├── close.tsx
│ │ │ ├── convert.tsx
│ │ │ ├── copy.tsx
│ │ │ ├── countdown.tsx
│ │ │ ├── dashboard.tsx
│ │ │ ├── discord.tsx
│ │ │ ├── dots.tsx
│ │ │ ├── exclamation.tsx
│ │ │ ├── fee.tsx
│ │ │ ├── gauge.tsx
│ │ │ ├── github.tsx
│ │ │ ├── history.tsx
│ │ │ ├── index.ts
│ │ │ ├── info.tsx
│ │ │ ├── loading.tsx
│ │ │ ├── logoMobile.tsx
│ │ │ ├── longArrow.tsx
│ │ │ ├── magnifier.tsx
│ │ │ ├── mark.tsx
│ │ │ ├── market.tsx
│ │ │ ├── mask.tsx
│ │ │ ├── medium.tsx
│ │ │ ├── notice.tsx
│ │ │ ├── open.tsx
│ │ │ ├── person.tsx
│ │ │ ├── shield.tsx
│ │ │ ├── sort.tsx
│ │ │ ├── tokens
│ │ │ │ ├── aave.tsx
│ │ │ │ ├── ada.tsx
│ │ │ │ ├── bch.tsx
│ │ │ │ ├── beth.tsx
│ │ │ │ ├── bnb.tsx
│ │ │ │ ├── btcb.tsx
│ │ │ │ ├── busd.tsx
│ │ │ │ ├── cake.tsx
│ │ │ │ ├── dai.tsx
│ │ │ │ ├── doge.tsx
│ │ │ │ ├── dot.tsx
│ │ │ │ ├── eth.tsx
│ │ │ │ ├── fil.tsx
│ │ │ │ ├── link.tsx
│ │ │ │ ├── ltc.tsx
│ │ │ │ ├── luna.tsx
│ │ │ │ ├── matic.tsx
│ │ │ │ ├── sxp.tsx
│ │ │ │ ├── trx.tsx
│ │ │ │ ├── tusd.tsx
│ │ │ │ ├── usdc.tsx
│ │ │ │ ├── usdt.tsx
│ │ │ │ ├── ust.tsx
│ │ │ │ ├── vai.tsx
│ │ │ │ ├── vrt.tsx
│ │ │ │ ├── xrp.tsx
│ │ │ │ └── xvs.tsx
│ │ │ ├── twitter.tsx
│ │ │ ├── vaiOutline.tsx
│ │ │ ├── vault.tsx
│ │ │ ├── venus.tsx
│ │ │ ├── vote.tsx
│ │ │ ├── vrt.tsx
│ │ │ ├── wallet.tsx
│ │ │ ├── xvs.tsx
│ │ │ ├── xvsOutlined.tsx
│ │ │ └── xvsPrediction.tsx
│ │ ├── index.stories.tsx
│ │ └── index.tsx
│ ├── InfoIcon
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── IsolatedAssetWarning
│ │ ├── AssetTable
│ │ │ ├── index.tsx
│ │ │ ├── styles.ts
│ │ │ └── testIds.ts
│ │ ├── __snapshots__
│ │ │ └── index.spec.tsx.snap
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ └── types.ts
│ ├── LabeledInlineContent
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── LayeredValues
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Layout
│ │ ├── ClaimXvsRewardButton
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── ConnectButton
│ │ │ └── index.tsx
│ │ ├── Footer
│ │ │ ├── constants.ts
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── Header
│ │ │ ├── Breadcrumbs
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.tsx.snap
│ │ │ │ ├── index.spec.tsx
│ │ │ │ ├── index.tsx
│ │ │ │ └── styles.ts
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── PageContainer
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── Sidebar
│ │ │ ├── Link
│ │ │ │ └── index.tsx
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── Toolbar
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── constants.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ ├── testIds.ts
│ │ └── types.ts
│ ├── LottieAnimation
│ │ ├── files
│ │ │ ├── index.ts
│ │ │ └── spinner.json
│ │ └── index.tsx
│ ├── LunaUstWarningModal
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Markdown
│ │ ├── Editor
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ ├── styles-overrides.scss
│ │ │ ├── styles.scss
│ │ │ └── styles.ts
│ │ ├── Viewer
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── index.ts
│ │ └── previewOptions.ts
│ ├── Modal
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Notice
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ └── types.ts
│ ├── Pagination
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ └── usePagination.ts
│ ├── ProgressBar
│ │ ├── AccountHealth
│ │ │ ├── index.stories.tsx
│ │ │ └── index.tsx
│ │ ├── LabeledProgressBar
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.tsx
│ │ ├── PercentageRepresentation
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── ProposalCard
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── ReadableActionSignature
│ │ ├── formatSignature.ts
│ │ ├── getContractName.ts
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── ResetScrollOnRouteChange
│ │ └── index.tsx
│ ├── RiskLevel
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Select
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Spinner
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ └── testIds.ts
│ ├── SuccessfulTransactionModal
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Table
│ │ ├── Head.tsx
│ │ ├── TableCards.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── storiesUtils.tsx
│ │ ├── styles.ts
│ │ └── types.ts
│ ├── Tabs
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.tsx
│ ├── TextField
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Toast
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Toggle
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Token
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── TokenGroup
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── TokenTextField
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ └── index.tsx
│ ├── Tooltip
│ │ ├── Tooltip.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.ts
│ │ └── styles.ts
│ ├── ValueUpdate
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── charts
│ │ ├── ApyChart
│ │ │ ├── formatToReadableDate.ts
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── InterestRateChart
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── TooltipContent
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ └── styles.ts
│ └── index.ts
├── config
│ └── index.ts
├── constants
│ ├── address.ts
│ ├── allowanceAmountWei.ts
│ ├── bsc.ts
│ ├── compoundMantissa.ts
│ ├── contracts
│ │ ├── abis
│ │ │ ├── bep20.json
│ │ │ ├── comptroller.json
│ │ │ ├── governorBravoDelegate.json
│ │ │ ├── interestModel.json
│ │ │ ├── maximillion.json
│ │ │ ├── oracle.json
│ │ │ ├── vBep20.json
│ │ │ ├── vBnbToken.json
│ │ │ ├── vaiToken.json
│ │ │ ├── vaiUnitroller.json
│ │ │ ├── vaiVault.json
│ │ │ ├── vault.json
│ │ │ ├── venusLens.json
│ │ │ ├── vote.json
│ │ │ ├── vrtConverter.json
│ │ │ ├── vrtToken.json
│ │ │ ├── vrtVault.json
│ │ │ ├── xvsToken.json
│ │ │ ├── xvsVault.json
│ │ │ ├── xvsVaultStore.json
│ │ │ └── xvsVesting.json
│ │ ├── addresses
│ │ │ ├── main.json
│ │ │ ├── tokens.json
│ │ │ └── vBepTokens.json
│ │ └── errorReporter.ts
│ ├── createProposalThresholdWei.ts
│ ├── daysPerYear.ts
│ ├── defaultRefetchInterval.ts
│ ├── endpoints.ts
│ ├── functionKey.ts
│ ├── indexedVotingSupportNames.ts
│ ├── localStorageKeys.ts
│ ├── maxUint256.ts
│ ├── placeholderKey.ts
│ ├── routing.ts
│ ├── safeBorrowLimitPercentage.ts
│ ├── smartContractPercentageDecimal.ts
│ ├── tokens.ts
│ └── xvs.ts
├── containers
│ ├── AmountForm
│ │ ├── index.tsx
│ │ └── validationSchema.ts
│ └── MarketTable
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ ├── types.ts
│ │ └── useGenerateData.tsx
├── context
│ ├── AuthContext.tsx
│ ├── DisableLunaUstWarning
│ │ ├── index.spec.tsx
│ │ └── index.tsx
│ ├── IncludeXvsContext.tsx
│ └── SuccessfulTransactionModalContext.tsx
├── errors
│ ├── VError.ts
│ ├── formatVErrorToReadableString.ts
│ ├── index.ts
│ ├── interactionErrorPhrases.ts
│ ├── transactionErrorPhrases.ts
│ ├── transactionErrors.ts
│ └── unexpectedErrorPhrases.ts
├── hooks
│ ├── __mocks__
│ │ ├── useClaimVaultReward.ts
│ │ ├── useStakeInVault.ts
│ │ └── useSuccessfulTransactionModal.ts
│ ├── responsive.ts
│ ├── useBatchRequest.ts
│ ├── useBorrowRepayModal
│ │ ├── Modal
│ │ │ ├── AccountData
│ │ │ │ └── index.tsx
│ │ │ ├── Borrow
│ │ │ │ ├── index.spec.tsx
│ │ │ │ ├── index.tsx
│ │ │ │ └── testIds.ts
│ │ │ ├── Repay
│ │ │ │ ├── index.spec.tsx
│ │ │ │ ├── index.tsx
│ │ │ │ ├── styles.ts
│ │ │ │ └── testIds.ts
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ └── index.tsx
│ ├── useClaimVaultReward.spec.tsx
│ ├── useClaimVaultReward.ts
│ ├── useCollateral
│ │ ├── CollateralConfirmModal
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ └── index.tsx
│ ├── useConvertWeiToReadableTokenString.ts
│ ├── useCopyToClipboard.ts
│ ├── useDailyXvsDistributionInterests.ts
│ ├── useHandleTransactionMutation.ts
│ ├── useIsMounted.ts
│ ├── useStakeInVault.spec.tsx
│ ├── useStakeInVault.ts
│ ├── useSuccessfulTransactionModal.ts
│ ├── useSupplyWithdrawModal
│ │ ├── Modal
│ │ │ ├── SupplyWithdrawForm.tsx
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ └── index.tsx
│ └── useVote.ts
├── index.tsx
├── pages
│ ├── Account
│ │ ├── PoolBreakdown
│ │ │ ├── Tables
│ │ │ │ ├── index.tsx
│ │ │ │ └── styles.ts
│ │ │ ├── __snapshots__
│ │ │ │ └── index.spec.tsx.snap
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ ├── styles.ts
│ │ │ ├── testIds.ts
│ │ │ └── useExtractData.ts
│ │ ├── __snapshots__
│ │ │ └── index.spec.tsx.snap
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ └── testIds.ts
│ ├── App.tsx
│ ├── ConvertVrt
│ │ ├── Convert
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.tsx
│ │ │ └── testIds.ts
│ │ ├── Withdraw
│ │ │ ├── index.spec.tsx
│ │ │ └── index.tsx
│ │ ├── constants.ts
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Dashboard
│ │ ├── ConnectWalletBanner
│ │ │ ├── illustration.png
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── HigherRiskTokensNotice
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── History
│ │ ├── Filters
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── HistoryTable
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ └── index.tsx
│ ├── Market
│ │ ├── Card
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── MarketInfo
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── __snapshots__
│ │ │ └── index.spec.tsx.snap
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ ├── testIds.ts
│ │ ├── types.ts
│ │ ├── useGetChartData.ts
│ │ └── useGetMarketData.ts
│ ├── Pool
│ │ ├── Table
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Pools
│ │ ├── Header
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── PoolTable
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── index.spec.tsx
│ │ └── index.tsx
│ ├── Proposal
│ │ ├── Description
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── ProposalSummary
│ │ │ ├── Stepper
│ │ │ │ ├── index.stories.tsx
│ │ │ │ ├── index.tsx
│ │ │ │ └── styles.ts
│ │ │ ├── index.tsx
│ │ │ ├── styles.ts
│ │ │ └── testIds.ts
│ │ ├── VoteModal
│ │ │ ├── index.tsx
│ │ │ ├── styles.ts
│ │ │ └── testIds.ts
│ │ ├── VoteSummary
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── styles.ts
│ │ └── testIds.ts
│ ├── Vai
│ │ ├── MintVai
│ │ │ ├── getReadableFeeVai.ts
│ │ │ ├── index.spec.tsx
│ │ │ └── index.tsx
│ │ ├── RepayVai
│ │ │ ├── index.spec.tsx
│ │ │ └── index.tsx
│ │ ├── constants.ts
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── Vault
│ │ ├── TransactionForm
│ │ │ ├── __snapshots__
│ │ │ │ └── index.spec.tsx.snap
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ ├── styles.ts
│ │ │ └── testIds.ts
│ │ ├── VaultItem
│ │ │ ├── __snapshots__
│ │ │ │ └── index.spec.tsx.snap
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ ├── styles.ts
│ │ │ └── testIds.ts
│ │ ├── __snapshots__
│ │ │ └── index.spec.tsx.snap
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ ├── modals
│ │ │ ├── ActionModal
│ │ │ │ ├── index.spec.tsx
│ │ │ │ ├── index.stories.tsx
│ │ │ │ └── index.tsx
│ │ │ ├── StakeModal
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.tsx.snap
│ │ │ │ ├── index.spec.tsx
│ │ │ │ ├── index.stories.tsx
│ │ │ │ └── index.tsx
│ │ │ ├── WithdrawFromVaiVaultModal
│ │ │ │ ├── __snapshots__
│ │ │ │ │ └── index.spec.tsx.snap
│ │ │ │ ├── index.spec.tsx
│ │ │ │ ├── index.stories.tsx
│ │ │ │ └── index.tsx
│ │ │ ├── WithdrawFromVestingVaultModal
│ │ │ │ ├── RequestWithdrawal
│ │ │ │ │ ├── __snapshots__
│ │ │ │ │ │ └── index.spec.tsx.snap
│ │ │ │ │ ├── index.spec.tsx
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ └── styles.ts
│ │ │ │ ├── Withdraw
│ │ │ │ │ ├── __snapshots__
│ │ │ │ │ │ └── index.spec.tsx.snap
│ │ │ │ │ ├── index.spec.tsx
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ ├── styles.ts
│ │ │ │ │ └── testIds.ts
│ │ │ │ ├── WithdrawalRequestList
│ │ │ │ │ ├── __snapshots__
│ │ │ │ │ │ └── index.spec.tsx.snap
│ │ │ │ │ ├── index.spec.tsx
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ ├── styles.ts
│ │ │ │ │ └── testIds.ts
│ │ │ │ ├── index.spec.tsx
│ │ │ │ ├── index.stories.tsx
│ │ │ │ ├── index.tsx
│ │ │ │ └── styles.ts
│ │ │ └── index.ts
│ │ └── styles.ts
│ ├── Vote
│ │ ├── CreateProposalModal
│ │ │ ├── ActionAccordion
│ │ │ │ ├── CallDataFields.tsx
│ │ │ │ ├── index.tsx
│ │ │ │ └── styles.ts
│ │ │ ├── ProposalPreview
│ │ │ │ ├── index.tsx
│ │ │ │ └── styles.ts
│ │ │ ├── encodeCallData.ts
│ │ │ ├── formatIfArray.ts
│ │ │ ├── formatProposalPayload.ts
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ ├── proposalSchema.ts
│ │ │ └── styles.ts
│ │ ├── DelegateModal
│ │ │ ├── addressValidationSchema.ts
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── Governance
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── GovernanceProposal
│ │ │ ├── index.stories.tsx
│ │ │ ├── index.tsx
│ │ │ ├── styles.ts
│ │ │ └── testIds.ts
│ │ ├── VotingWallet
│ │ │ ├── index.tsx
│ │ │ ├── styles.ts
│ │ │ └── testIds.ts
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── VoterDetails
│ │ ├── History
│ │ │ ├── VoterProposal
│ │ │ │ ├── index.stories.tsx
│ │ │ │ ├── index.tsx
│ │ │ │ └── styles.ts
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── Holding
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── Transactions
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ ├── VoterLeaderboard
│ │ ├── LeaderboardTable
│ │ │ ├── index.spec.tsx
│ │ │ ├── index.tsx
│ │ │ └── styles.ts
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
│ └── Xvs
│ │ ├── Header
│ │ └── index.tsx
│ │ ├── Table
│ │ └── index.tsx
│ │ ├── constants.ts
│ │ ├── index.spec.tsx
│ │ ├── index.stories.tsx
│ │ ├── index.tsx
│ │ └── styles.ts
├── react-app-env.d.ts
├── setupTests.ts
├── stories
│ ├── Typography.stories.tsx
│ └── decorators.tsx
├── testUtils
│ └── renderComponent.tsx
├── theme
│ └── MuiThemeProvider
│ │ ├── index.tsx
│ │ └── muiTheme.ts
├── translation
│ ├── index.tsx
│ └── translations
│ │ └── en.json
├── types
│ ├── declarations.d.ts
│ ├── index.ts
│ ├── mui.d.ts
│ └── tsfixme.d.ts
└── utilities
│ ├── __mocks__
│ └── restService.ts
│ ├── calculateCollateralValue.spec.ts
│ ├── calculateCollateralValue.ts
│ ├── calculateDailyEarningsCents.spec.ts
│ ├── calculateDailyEarningsCents.ts
│ ├── calculateNetApy.spec.ts
│ ├── calculateNetApy.ts
│ ├── calculatePercentage.ts
│ ├── calculateYearlyEarnings.spec.ts
│ ├── calculateYearlyEarnings.ts
│ ├── convertPercentageFromSmartContract.ts
│ ├── convertTokensToWei.ts
│ ├── convertWeiToTokens.ts
│ ├── encodeParameters.ts
│ ├── featureFlags.ts
│ ├── formatCentsToReadableValue.ts
│ ├── formatPercentage.ts
│ ├── formatToProposal.ts
│ ├── formatToReadablePercentage.ts
│ ├── formatTokensToReadableValue.spec.ts
│ ├── formatTokensToReadableValue.ts
│ ├── generateBscScanUrl.ts
│ ├── getArgs.ts
│ ├── getBigNumber.ts
│ ├── getContractAddress.ts
│ ├── getToken.ts
│ ├── getTokenByAddress.ts
│ ├── getTokenIdFromVAddress.ts
│ ├── getVBepToken.ts
│ ├── index.ts
│ ├── indexBy.ts
│ ├── notNull.ts
│ ├── notUndefined.ts
│ ├── parseFunctionSignature.ts
│ ├── promisify.ts
│ ├── restService.ts
│ ├── shortenTokensWithSuffix.ts
│ └── truncateAddress.ts
├── static.json
├── tsconfig.eslint.json
├── tsconfig.json
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "@babel/preset-env",
4 | "@babel/preset-react",
5 | "@babel/preset-typescript"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/.env.template:
--------------------------------------------------------------------------------
1 | NODE_ENV=development
2 | ESLINT_NO_DEV_ERRORS=true
3 | TSC_COMPILE_ON_ERROR=true
4 | #REACT_APP_CHAIN_ID should be 97 for testnet
5 | REACT_APP_CHAIN_ID=97
6 | REACT_APP_GOOGLE_ANALYTICS_ID=
7 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .eslintrc.js
3 | public
4 | build
5 | storybook-static
6 | i18next-parser.config.js
7 | coverage
8 |
--------------------------------------------------------------------------------
/.github/workflows/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Jira ticket(s)
2 |
3 | [VEN-XXX](VEN-XXX)
4 |
5 | ## Changes
6 |
7 | -
8 |
--------------------------------------------------------------------------------
/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Header always append X-Frame-Options DENY
3 | Header set X-XSS-Protection "1; mode=block"
4 | Header set X-Content-Type-Options nosniff
5 | Header set Content-Security-Policy "default-src 'self';"
6 | Header set Strict-Transport-Security "max-age=31536000; includeSubDomains;"
7 |
8 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | yarn lint-staged
5 |
--------------------------------------------------------------------------------
/.husky/pre-push:
--------------------------------------------------------------------------------
1 | yarn tsc
2 |
--------------------------------------------------------------------------------
/.lintstagedrc:
--------------------------------------------------------------------------------
1 | {
2 | "*{.ts,*.tsx,*.js,*.jsx}": ["eslint --fix", "prettier --write --check", "stylelint --fix"],
3 | "*.json": ["prettier --write --check"],
4 | "*.html": ["prettier --write --check"],
5 | "*.scss": ["stylelint --fix"]
6 | }
7 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v16.14.2
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | src/assets/images
2 | src/assets/font
3 | src/types/contracts
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | ...require('prettier-airbnb-config'),
3 | trailingComma: 'all',
4 | bracketSpacing: true,
5 | importOrder: [
6 | '(__mocks__|assets|clients|components|config|constants|containers|context|errors|hooks|pages|stories|testUtils|theme|translation|types|utilities)/(.*)$',
7 | '^[./]',
8 | ],
9 | importOrderSeparation: true,
10 | importOrderSortSpecifiers: true,
11 | };
12 |
--------------------------------------------------------------------------------
/.storybook/main.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | stories: [
3 | !!process.env.IS_CI_ENV
4 | ? // Only build root page stories when running on CI pipeline
5 | '../src/pages/*/*.stories.@(js|jsx|ts|tsx)'
6 | : '../src/**/*.stories.@(js|jsx|ts|tsx)',
7 | ],
8 | addons: [
9 | '@storybook/addon-links',
10 | '@storybook/addon-essentials',
11 | '@storybook/preset-create-react-app',
12 | ],
13 | framework: '@storybook/react',
14 | env: config => ({
15 | ...config,
16 | // Always run Storybook in test environment
17 | REACT_APP_CHAIN_ID: 97,
18 | }),
19 | };
20 |
--------------------------------------------------------------------------------
/Dockerfile.local:
--------------------------------------------------------------------------------
1 | FROM node:12.19.0-alpine3.12
2 |
3 | # must use development so that "npm run build" works
4 | ENV NODE_ENV development
5 | ENV NODE_PATH=src/
6 |
7 | RUN apk add --update --no-cache python3 git openssh
8 |
9 | WORKDIR /usr/app
10 |
11 | EXPOSE 3001
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Venus",
3 | "scripts": {},
4 | "env": {},
5 | "formation": {
6 | "web": {
7 | "quantity": 1
8 | }
9 | },
10 | "addons": [],
11 | "buildpacks": [
12 | {
13 | "url": "https://github.com/mars/create-react-app-buildpack.git"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | version: '3.9'
2 |
3 | services:
4 | venus-ui-dev:
5 | build:
6 | context: .
7 | dockerfile: Dockerfile.local
8 | command:
9 | - sh
10 | - -c
11 | - |
12 | npm install
13 | npm start
14 | ports:
15 | - 3001:3001
16 | volumes:
17 | - ./:/usr/app
18 | restart: always
19 |
20 | venus-ui-prod:
21 | build: .
22 | ports:
23 | - 3001:80
24 | restart: always
25 |
--------------------------------------------------------------------------------
/i18next-parser.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | defaultValue: 'TRANSLATION NEEDED',
3 | locales: ['en'],
4 | output: './src/translation/translations/$LOCALE.json',
5 | input: './src/**/*.{ts,tsx}',
6 | sort: true,
7 | createOldCatalogs: false,
8 | };
9 |
--------------------------------------------------------------------------------
/nginx_default.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80;
3 | listen [::]:80;
4 | server_name localhost;
5 |
6 | location / {
7 | root /usr/share/nginx/html;
8 | index index.html index.htm;
9 | try_files $uri /index.html;
10 | }
11 | }
--------------------------------------------------------------------------------
/public/coins/aave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/aave.png
--------------------------------------------------------------------------------
/public/coins/ada.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/ada.png
--------------------------------------------------------------------------------
/public/coins/bch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/bch.png
--------------------------------------------------------------------------------
/public/coins/beth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/beth.png
--------------------------------------------------------------------------------
/public/coins/bnb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/bnb.png
--------------------------------------------------------------------------------
/public/coins/btcb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/btcb.png
--------------------------------------------------------------------------------
/public/coins/busd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/busd.png
--------------------------------------------------------------------------------
/public/coins/cake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/cake.png
--------------------------------------------------------------------------------
/public/coins/dai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/dai.png
--------------------------------------------------------------------------------
/public/coins/doge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/doge.png
--------------------------------------------------------------------------------
/public/coins/dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/dot.png
--------------------------------------------------------------------------------
/public/coins/eth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/eth.png
--------------------------------------------------------------------------------
/public/coins/fil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/fil.png
--------------------------------------------------------------------------------
/public/coins/link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/link.png
--------------------------------------------------------------------------------
/public/coins/ltc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/ltc.png
--------------------------------------------------------------------------------
/public/coins/luna.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/luna.png
--------------------------------------------------------------------------------
/public/coins/matic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/matic.png
--------------------------------------------------------------------------------
/public/coins/sxp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/sxp.png
--------------------------------------------------------------------------------
/public/coins/trx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/trx.png
--------------------------------------------------------------------------------
/public/coins/tusd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/tusd.png
--------------------------------------------------------------------------------
/public/coins/usdc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/usdc.png
--------------------------------------------------------------------------------
/public/coins/usdt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/usdt.png
--------------------------------------------------------------------------------
/public/coins/ust.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/ust.png
--------------------------------------------------------------------------------
/public/coins/vaave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vaave.png
--------------------------------------------------------------------------------
/public/coins/vada.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vada.png
--------------------------------------------------------------------------------
/public/coins/vbch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vbch.png
--------------------------------------------------------------------------------
/public/coins/vbeth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vbeth.png
--------------------------------------------------------------------------------
/public/coins/vbnb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vbnb.png
--------------------------------------------------------------------------------
/public/coins/vbtc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vbtc.png
--------------------------------------------------------------------------------
/public/coins/vbusd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vbusd.png
--------------------------------------------------------------------------------
/public/coins/vcake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vcake.png
--------------------------------------------------------------------------------
/public/coins/vdai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vdai.png
--------------------------------------------------------------------------------
/public/coins/vdoge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vdoge.png
--------------------------------------------------------------------------------
/public/coins/vdot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vdot.png
--------------------------------------------------------------------------------
/public/coins/veth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/veth.png
--------------------------------------------------------------------------------
/public/coins/vfil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vfil.png
--------------------------------------------------------------------------------
/public/coins/vlink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vlink.png
--------------------------------------------------------------------------------
/public/coins/vltc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vltc.png
--------------------------------------------------------------------------------
/public/coins/vluna.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vluna.png
--------------------------------------------------------------------------------
/public/coins/vmatic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vmatic.png
--------------------------------------------------------------------------------
/public/coins/vsxp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vsxp.png
--------------------------------------------------------------------------------
/public/coins/vtrx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vtrx.png
--------------------------------------------------------------------------------
/public/coins/vtusd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vtusd.png
--------------------------------------------------------------------------------
/public/coins/vusdc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vusdc.png
--------------------------------------------------------------------------------
/public/coins/vusdt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vusdt.png
--------------------------------------------------------------------------------
/public/coins/vust.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vust.png
--------------------------------------------------------------------------------
/public/coins/vxrp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vxrp.png
--------------------------------------------------------------------------------
/public/coins/vxvs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/vxvs.png
--------------------------------------------------------------------------------
/public/coins/xrp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/xrp.png
--------------------------------------------------------------------------------
/public/coins/xvs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/coins/xvs.png
--------------------------------------------------------------------------------
/public/maintenance.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/public/maintenance.jpg
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Venus",
3 | "name": "Venus",
4 | "icons": [
5 | {
6 | "src": "icon16.png",
7 | "sizes": "16x16",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "icon32.png",
12 | "sizes": "32x32",
13 | "type": "image/png"
14 | }
15 | ],
16 | "start_url": "./index.html",
17 | "display": "standalone",
18 | "theme_color": "#3A78FF",
19 | "background_color": "#1F2028"
20 | }
21 |
--------------------------------------------------------------------------------
/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Jira ticket(s)
2 |
3 | VEN-XXX
4 |
5 | ## Changes
6 |
7 | -
8 |
--------------------------------------------------------------------------------
/regconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "core": {
3 | "workingDir": ".reg",
4 | "actualDir": ".loki/reference",
5 | "thresholdRate": 0.5,
6 | "addIgnore": true,
7 | "ximgdiff": {
8 | "invocationType": "client"
9 | }
10 | },
11 | "plugins": {
12 | "reg-keygen-git-hash-plugin": true,
13 | "reg-notify-github-plugin": {
14 | "prComment": true,
15 | "prCommentBehavior": "default",
16 | "clientId": "MzazNDSzNDM11y9LzSst1i0oyi/JT87P0c3MK0ktSktMTtU3MjYEqjE21w8DqQiAKgAA"
17 | },
18 | "reg-publish-s3-plugin": {
19 | "bucketName": "tf-venus-prod-vizreg"
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/__mocks__/CSSStub.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
2 |
--------------------------------------------------------------------------------
/src/__mocks__/contracts/vaiUnitroller.ts:
--------------------------------------------------------------------------------
1 | import { VaiUnitroller } from 'types/contracts';
2 |
3 | const vaiUnitrollerResponses: {
4 | getMintableVAI: Awaited<
5 | ReturnType['call']>
6 | >;
7 | } = {
8 | getMintableVAI: {
9 | 0: '20000000000000000000',
10 | 1: '40000000000000000000',
11 | },
12 | };
13 |
14 | export default vaiUnitrollerResponses;
15 |
--------------------------------------------------------------------------------
/src/__mocks__/contracts/vaiVault.ts:
--------------------------------------------------------------------------------
1 | import { VaiVault } from 'types/contracts';
2 |
3 | const vaiVaultResponses: {
4 | userInfo: Awaited['call']>>;
5 | pendingXVS: Awaited['call']>>;
6 | } = {
7 | userInfo: {
8 | amount: '100000000000000000000000',
9 | rewardDebt: '2000',
10 | 0: '100000000000000000000000',
11 | 1: '4000',
12 | },
13 | pendingXVS: '600000000',
14 | };
15 |
16 | export default vaiVaultResponses;
17 |
--------------------------------------------------------------------------------
/src/__mocks__/models/address.ts:
--------------------------------------------------------------------------------
1 | const address = '0x3d759121234cd36F8124C21aFe1c6852d2bEd848';
2 |
3 | export const altAddress = '0x3d759121234cd36F8124C21aFe1c6852d2bEd850';
4 |
5 | export default address;
6 |
--------------------------------------------------------------------------------
/src/__mocks__/models/pools.ts:
--------------------------------------------------------------------------------
1 | import { Pool } from 'types';
2 |
3 | import { assetData } from '__mocks__/models/asset';
4 |
5 | export const poolData: Pool[] = [
6 | {
7 | id: '1',
8 | assets: assetData,
9 | name: 'Venus',
10 | riskLevel: 'MINIMAL',
11 | description: 'Fake description 1',
12 | isIsolated: false,
13 | },
14 | {
15 | id: '2',
16 | assets: assetData,
17 | name: 'Metaverse',
18 | riskLevel: 'VERY_HIGH',
19 | description: 'Fake description 2',
20 | isIsolated: true,
21 | },
22 | {
23 | id: '3',
24 | assets: assetData,
25 | name: 'Gaming',
26 | riskLevel: 'MEDIUM',
27 | description: 'Fake description 3',
28 | isIsolated: true,
29 | },
30 | ];
31 |
--------------------------------------------------------------------------------
/src/__mocks__/models/proposals.ts:
--------------------------------------------------------------------------------
1 | import { formatToProposal } from 'utilities';
2 |
3 | import { ProposalsApiResponse } from 'clients/api/queries/getProposals';
4 |
5 | import proposalResponse from '../api/proposals.json';
6 |
7 | const proposals = proposalResponse.result.map(p =>
8 | formatToProposal(p as ProposalsApiResponse['result'][number]),
9 | );
10 |
11 | export default proposals;
12 |
--------------------------------------------------------------------------------
/src/__mocks__/models/transactionReceipt.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core/types';
2 |
3 | const transactionReceipt: TransactionReceipt = {
4 | status: true,
5 | transactionHash: 'fake-transaction-hash',
6 | transactionIndex: 0,
7 | blockHash: 'fake-block-hash',
8 | blockNumber: 0,
9 | from: 'fake-from',
10 | to: 'fake-to',
11 | cumulativeGasUsed: 99999,
12 | effectiveGasPrice: 99999,
13 | gasUsed: 99999,
14 | logs: [],
15 | logsBloom: 'fake-logs-bloom',
16 | };
17 |
18 | export default transactionReceipt;
19 |
--------------------------------------------------------------------------------
/src/__mocks__/models/vaults.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 | import { Vault } from 'types';
3 |
4 | export const vaults: Vault[] = [
5 | {
6 | rewardTokenId: 'xvs',
7 | stakedTokenId: 'vai',
8 | lockingPeriodMs: 300000,
9 | dailyEmissionWei: new BigNumber('144000000000000000000'),
10 | totalStakedWei: new BigNumber('415000000000000000000'),
11 | stakingAprPercentage: 12665.060240963856,
12 | },
13 | {
14 | rewardTokenId: 'xvs',
15 | stakedTokenId: 'xvs',
16 | lockingPeriodMs: 300000,
17 | dailyEmissionWei: new BigNumber('144000000000000000000'),
18 | totalStakedWei: new BigNumber('400000000000000000000000000'),
19 | stakingAprPercentage: 12.92281835063781,
20 | },
21 | ];
22 |
--------------------------------------------------------------------------------
/src/__mocks__/models/voterAccounts.ts:
--------------------------------------------------------------------------------
1 | import formatVoterAccountResponse from 'clients/api/queries/getVoterAccounts/formatVoterAccountResponse';
2 |
3 | import voterAccountsResponse from '../api/voterAccounts.json';
4 |
5 | const voterAccounts = formatVoterAccountResponse(voterAccountsResponse.data);
6 |
7 | export default voterAccounts;
8 |
--------------------------------------------------------------------------------
/src/__mocks__/models/voterDetails.ts:
--------------------------------------------------------------------------------
1 | import formatVoterDetailsResponse from 'clients/api/queries/getVoterDetails/formatVoterDetailsResponse';
2 | import { GetVoterDetailsResponse } from 'clients/api/queries/getVoterDetails/types';
3 | import { NULL_ADDRESS } from 'constants/address';
4 |
5 | import voterDetailsResponse from '../api/voterDetails.json';
6 |
7 | const voterDetails = formatVoterDetailsResponse(
8 | voterDetailsResponse.data as GetVoterDetailsResponse,
9 | NULL_ADDRESS,
10 | );
11 |
12 | export default voterDetails;
13 |
--------------------------------------------------------------------------------
/src/__mocks__/models/voterHistory.ts:
--------------------------------------------------------------------------------
1 | import formatVoterHistoryResponse from 'clients/api/queries/getVoterHistory/formatVoterHistoryResponse';
2 | import { GetVoterHistoryResponse } from 'clients/api/queries/getVoterHistory/types';
3 |
4 | import voterHistoryResponse from '../api/voterHistory.json';
5 |
6 | const voterHistory = formatVoterHistoryResponse(
7 | voterHistoryResponse.data as GetVoterHistoryResponse,
8 | );
9 |
10 | export default voterHistory;
11 |
--------------------------------------------------------------------------------
/src/__mocks__/models/voters.ts:
--------------------------------------------------------------------------------
1 | import { GetVotersApiResponse } from 'clients/api/queries/getVoters';
2 | import formatToVoters from 'clients/api/queries/getVoters/formatToVoters';
3 |
4 | import votersResponse from '../api/voters.json';
5 |
6 | const voters = formatToVoters(votersResponse.data as GetVotersApiResponse);
7 |
8 | export default voters;
9 |
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaBold.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaBold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaBold.woff
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaBold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaBold.woff2
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaBoldIt.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaBoldIt.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaBoldIt.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaBoldIt.woff
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaBoldIt.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaBoldIt.woff2
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaRegular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaRegular.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaRegular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaRegular.woff
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaRegular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaRegular.woff2
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaRegularIt.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaRegularIt.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaRegularIt.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaRegularIt.woff
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaRegularIt.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaRegularIt.woff2
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaSemibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaSemibold.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaSemibold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaSemibold.woff
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaSemibold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaSemibold.woff2
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaSemiboldIt.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaSemiboldIt.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaSemiboldIt.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaSemiboldIt.woff
--------------------------------------------------------------------------------
/src/assets/fonts/proximaNova/proximaNovaSemiboldIt.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/fonts/proximaNova/proximaNovaSemiboldIt.woff2
--------------------------------------------------------------------------------
/src/assets/img/mark.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/assets/img/tokens/aave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/aave.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/ada.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/ada.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/bch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/bch.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/beth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/beth.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/bnb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/bnb.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/btc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/btc.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/btcb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/btcb.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/busd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/busd.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/cake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/cake.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/dai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/dai.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/doge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/doge.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/dot.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/eth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/eth.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/fil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/fil.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/link.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/ltc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/ltc.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/luna.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/luna.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/matic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/matic.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/sxp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/sxp.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/trx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/trx.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/tusd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/tusd.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/usdc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/usdc.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/usdt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/usdt.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/ust.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/ust.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vaave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vaave.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vada.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vada.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vbch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vbch.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vbeth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vbeth.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vbnb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vbnb.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vbtc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vbtc.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vbusd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vbusd.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vcake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vcake.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vdai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vdai.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vdoge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vdoge.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vdot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vdot.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/veth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/veth.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vfil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vfil.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vlink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vlink.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vltc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vltc.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vluna.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vluna.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vmatic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vmatic.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vsxp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vsxp.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vtrx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vtrx.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vtusd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vtusd.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vusdc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vusdc.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vusdt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vusdt.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vust.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vust.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vxrp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vxrp.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/vxvs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/vxvs.png
--------------------------------------------------------------------------------
/src/assets/img/tokens/xrp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/assets/img/tokens/xrp.png
--------------------------------------------------------------------------------
/src/assets/img/wallets/binanceChainWalletLogo.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/assets/img/wallets/ledgerLogo.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/assets/styles/index.scss:
--------------------------------------------------------------------------------
1 | @import './App.scss';
2 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/cancelProposal/index.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core';
2 |
3 | import { GovernorBravoDelegate } from 'types/contracts';
4 |
5 | export interface CancelProposalInput {
6 | governorBravoContract: GovernorBravoDelegate;
7 | accountAddress: string;
8 | proposalId: number;
9 | }
10 |
11 | export type CancelProposalOutput = TransactionReceipt;
12 |
13 | const cancelProposal = async ({
14 | governorBravoContract,
15 | accountAddress,
16 | proposalId,
17 | }: CancelProposalInput): Promise =>
18 | governorBravoContract.methods.cancel(proposalId).send({ from: accountAddress });
19 |
20 | export default cancelProposal;
21 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/claimVaiVaultReward/index.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core/types';
2 |
3 | import { VaiVault } from 'types/contracts';
4 |
5 | export interface ClaimVaiVaultRewardInput {
6 | vaiVaultContract: VaiVault;
7 | fromAccountAddress: string;
8 | }
9 |
10 | export type ClaimVaiVaultRewardOutput = TransactionReceipt;
11 |
12 | const claimVaiVaultReward = async ({
13 | vaiVaultContract,
14 | fromAccountAddress,
15 | }: ClaimVaiVaultRewardInput): Promise => {
16 | const resp = await vaiVaultContract.methods.claim().send({ from: fromAccountAddress });
17 | return resp;
18 | };
19 |
20 | export default claimVaiVaultReward;
21 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/convertVrt/index.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core/types';
2 |
3 | import { VrtConverter } from 'types/contracts';
4 |
5 | export interface ConvertVrtInput {
6 | vrtConverterContract: VrtConverter;
7 | amountWei: string;
8 | accountAddress: string;
9 | }
10 |
11 | export type ConvertVrtOutput = TransactionReceipt;
12 |
13 | const convertVrt = async ({
14 | vrtConverterContract,
15 | amountWei,
16 | accountAddress,
17 | }: ConvertVrtInput): Promise =>
18 | vrtConverterContract.methods.convert(amountWei).send({
19 | from: accountAddress,
20 | });
21 |
22 | export default convertVrt;
23 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/executeProposal/index.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core';
2 |
3 | import { GovernorBravoDelegate } from 'types/contracts';
4 |
5 | export interface ExecuteProposalInput {
6 | governorBravoContract: GovernorBravoDelegate;
7 | accountAddress: string;
8 | proposalId: number;
9 | }
10 |
11 | export type ExecuteProposalOutput = TransactionReceipt;
12 |
13 | const executeProposal = async ({
14 | governorBravoContract,
15 | accountAddress,
16 | proposalId,
17 | }: ExecuteProposalInput): Promise =>
18 | governorBravoContract.methods.execute(proposalId).send({ from: accountAddress });
19 |
20 | export default executeProposal;
21 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/queueProposal/index.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core';
2 |
3 | import { GovernorBravoDelegate } from 'types/contracts';
4 |
5 | export interface QueueProposalInput {
6 | governorBravoContract: GovernorBravoDelegate;
7 | accountAddress: string;
8 | proposalId: number;
9 | }
10 |
11 | export type QueueProposalOutput = TransactionReceipt;
12 |
13 | const queueProposal = async ({
14 | governorBravoContract,
15 | accountAddress,
16 | proposalId,
17 | }: QueueProposalInput): Promise =>
18 | governorBravoContract.methods.queue(proposalId).send({ from: accountAddress });
19 |
20 | export default queueProposal;
21 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/setVoteDelegate/index.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core';
2 |
3 | import { XvsVault } from 'types/contracts';
4 |
5 | export interface SetVoteDelegateInput {
6 | xvsVaultContract: XvsVault;
7 | accountAddress: string;
8 | delegateAddress: string;
9 | }
10 |
11 | export type SetVoteDelegateOutput = TransactionReceipt;
12 |
13 | const setVoteDelegate = async ({
14 | xvsVaultContract,
15 | accountAddress,
16 | delegateAddress,
17 | }: SetVoteDelegateInput) =>
18 | xvsVaultContract.methods.delegate(delegateAddress).send({ from: accountAddress });
19 |
20 | export default setVoteDelegate;
21 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/stakeInVrtVault/index.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 | import type { TransactionReceipt } from 'web3-core/types';
3 |
4 | import { VrtVault } from 'types/contracts';
5 |
6 | export interface StakeInVrtVaultInput {
7 | vrtVaultContract: VrtVault;
8 | fromAccountAddress: string;
9 | amountWei: BigNumber;
10 | }
11 |
12 | export type StakeInVrtVaultOutput = TransactionReceipt;
13 |
14 | const stakeInVrtVault = async ({
15 | vrtVaultContract,
16 | fromAccountAddress,
17 | amountWei,
18 | }: StakeInVrtVaultInput): Promise =>
19 | vrtVaultContract.methods.deposit(amountWei.toFixed()).send({ from: fromAccountAddress });
20 |
21 | export default stakeInVrtVault;
22 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/vote/castVote.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core/types';
2 |
3 | import { GovernorBravoDelegate } from 'types/contracts';
4 |
5 | export interface CastVoteInput {
6 | governorBravoContract: GovernorBravoDelegate;
7 | fromAccountAddress: string;
8 | proposalId: number;
9 | voteType: 0 | 1 | 2;
10 | }
11 |
12 | export type CastVoteOutput = TransactionReceipt;
13 |
14 | const castVote = async ({
15 | governorBravoContract,
16 | fromAccountAddress,
17 | proposalId,
18 | voteType,
19 | }: CastVoteInput): Promise =>
20 | governorBravoContract.methods.castVote(proposalId, voteType).send({ from: fromAccountAddress });
21 |
22 | export default castVote;
23 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/withdrawFromVrtVault/index.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core/types';
2 |
3 | import { VrtVault } from 'types/contracts';
4 |
5 | export interface WithdrawFromVrtVaultInput {
6 | vrtVaultContract: VrtVault;
7 | fromAccountAddress: string;
8 | }
9 |
10 | export type WithdrawFromVrtVaultOutput = TransactionReceipt;
11 |
12 | const withdrawFromVrtVault = async ({
13 | vrtVaultContract,
14 | fromAccountAddress,
15 | }: WithdrawFromVrtVaultInput): Promise =>
16 | vrtVaultContract.methods.withdraw().send({ from: fromAccountAddress });
17 |
18 | export default withdrawFromVrtVault;
19 |
--------------------------------------------------------------------------------
/src/clients/api/mutations/withdrawXvs/index.ts:
--------------------------------------------------------------------------------
1 | import type { TransactionReceipt } from 'web3-core/types';
2 |
3 | import { XvsVesting } from 'types/contracts';
4 |
5 | export interface WithdrawXvsInput {
6 | xvsVestingContract: XvsVesting;
7 | accountAddress: string;
8 | }
9 |
10 | export type WithdrawXvsOutput = TransactionReceipt;
11 |
12 | const withdrawXvs = ({
13 | xvsVestingContract,
14 | accountAddress,
15 | }: WithdrawXvsInput): Promise =>
16 | xvsVestingContract.methods.withdraw().send({
17 | from: accountAddress,
18 | });
19 |
20 | export default withdrawXvs;
21 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getAssetsInAccount/index.ts:
--------------------------------------------------------------------------------
1 | import { Comptroller } from 'types/contracts';
2 |
3 | export interface GetAssetsInAccountInput {
4 | comptrollerContract: Comptroller;
5 | accountAddress: string;
6 | }
7 |
8 | export type GetAssetsInAccountOutput = {
9 | tokenAddresses: string[];
10 | };
11 |
12 | const getAssetsInAccount = async ({
13 | comptrollerContract,
14 | accountAddress,
15 | }: GetAssetsInAccountInput): Promise => {
16 | const tokenAddresses = await comptrollerContract.methods.getAssetsIn(accountAddress).call();
17 |
18 | return {
19 | tokenAddresses,
20 | };
21 | };
22 |
23 | export default getAssetsInAccount;
24 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getBalanceOf/index.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { Bep20, VaiToken, VrtToken, XvsToken } from 'types/contracts';
4 |
5 | export interface GetBalanceOfInput {
6 | tokenContract: VrtToken | XvsToken | Bep20 | VaiToken;
7 | accountAddress: string;
8 | }
9 |
10 | export type GetBalanceOfOutput = {
11 | balanceWei: BigNumber;
12 | };
13 |
14 | const getBalanceOf = async ({
15 | tokenContract,
16 | accountAddress,
17 | }: GetBalanceOfInput): Promise => {
18 | const resp = await tokenContract.methods.balanceOf(accountAddress).call();
19 |
20 | return {
21 | balanceWei: new BigNumber(resp),
22 | };
23 | };
24 |
25 | export default getBalanceOf;
26 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getBlockNumber/index.spec.ts:
--------------------------------------------------------------------------------
1 | import Web3 from 'web3';
2 |
3 | import getBlockNumber from '.';
4 |
5 | describe('api/queries/getBlockNumber', () => {
6 | test('calls passed web3 object correctly and returns the latest block number on success', async () => {
7 | const fakeBlockNumber = 123456789;
8 |
9 | const fakeWeb3 = {
10 | eth: {
11 | getBlockNumber: async () => fakeBlockNumber,
12 | },
13 | } as unknown as Web3;
14 |
15 | const res = await getBlockNumber({ web3: fakeWeb3 });
16 |
17 | expect(res).toStrictEqual({
18 | blockNumber: fakeBlockNumber,
19 | });
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getBlockNumber/index.ts:
--------------------------------------------------------------------------------
1 | import Web3 from 'web3';
2 |
3 | export interface GetBlockNumberInput {
4 | web3: Web3;
5 | }
6 |
7 | export interface GetBlockNumberOutput {
8 | blockNumber: number;
9 | }
10 |
11 | const getBlockNumber = async ({ web3 }: GetBlockNumberInput): Promise => {
12 | const blockNumber = await web3.eth.getBlockNumber();
13 |
14 | return {
15 | blockNumber,
16 | };
17 | };
18 |
19 | export default getBlockNumber;
20 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getCurrentVotes/index.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { XvsVault } from 'types/contracts';
4 |
5 | export interface GetCurrentVotesInput {
6 | xvsVaultContract: XvsVault;
7 | accountAddress: string;
8 | }
9 |
10 | export type GetCurrentVotesOutput = {
11 | votesWei: BigNumber;
12 | };
13 |
14 | const getCurrentVotes = async ({
15 | xvsVaultContract,
16 | accountAddress,
17 | }: GetCurrentVotesInput): Promise => {
18 | const resp = await xvsVaultContract.methods.getCurrentVotes(accountAddress).call();
19 |
20 | return {
21 | votesWei: new BigNumber(resp),
22 | };
23 | };
24 |
25 | export default getCurrentVotes;
26 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getMarketHistory/useGetMarketHistory.ts:
--------------------------------------------------------------------------------
1 | import { QueryObserverOptions, useQuery } from 'react-query';
2 |
3 | import getMarketHistory, {
4 | GetMarketHistoryInput,
5 | GetMarketHistoryOutput,
6 | } from 'clients/api/queries/getMarketHistory';
7 | import FunctionKey from 'constants/functionKey';
8 |
9 | type Options = QueryObserverOptions<
10 | GetMarketHistoryOutput,
11 | Error,
12 | GetMarketHistoryOutput,
13 | GetMarketHistoryOutput,
14 | FunctionKey.GET_MARKET_HISTORY
15 | >;
16 |
17 | const useGetMarketHistory = (input: GetMarketHistoryInput, options?: Options) =>
18 | useQuery(FunctionKey.GET_MARKET_HISTORY, () => getMarketHistory(input), options);
19 |
20 | export default useGetMarketHistory;
21 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getMarkets/useGetMarkets.ts:
--------------------------------------------------------------------------------
1 | import { QueryObserverOptions, useQuery } from 'react-query';
2 |
3 | import getMarkets, { GetMarketsOutput } from 'clients/api/queries/getMarkets';
4 | import { DEFAULT_REFETCH_INTERVAL_MS } from 'constants/defaultRefetchInterval';
5 | import FunctionKey from 'constants/functionKey';
6 |
7 | type Options = QueryObserverOptions<
8 | GetMarketsOutput,
9 | Error,
10 | GetMarketsOutput,
11 | GetMarketsOutput,
12 | FunctionKey.GET_MARKETS
13 | >;
14 |
15 | const useGetMarkets = (options?: Options) =>
16 | useQuery(FunctionKey.GET_MARKETS, getMarkets, {
17 | refetchInterval: DEFAULT_REFETCH_INTERVAL_MS,
18 | ...options,
19 | });
20 |
21 | export default useGetMarkets;
22 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getMintableVai/__snapshots__/index.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`api/queries/getMintableVai returns the mintable VAI in the correct format on success 1`] = `
4 | Object {
5 | "mintableVaiWei": "40000000000000000000",
6 | }
7 | `;
8 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getMintableVai/formatToOutput.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { VaiUnitroller } from 'types/contracts';
4 |
5 | import { GetMintableVaiOutput } from './types';
6 |
7 | const formatToProposal = (
8 | response: Awaited['call']>>,
9 | ): GetMintableVaiOutput => ({
10 | mintableVaiWei: new BigNumber(response[1]),
11 | });
12 |
13 | export default formatToProposal;
14 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getMintableVai/index.ts:
--------------------------------------------------------------------------------
1 | import formatToOutput from './formatToOutput';
2 | import { GetMintableVaiInput, GetMintableVaiOutput } from './types';
3 |
4 | export * from './types';
5 |
6 | const getMintableVai = async ({
7 | vaiControllerContract,
8 | accountAddress,
9 | }: GetMintableVaiInput): Promise => {
10 | const res = await vaiControllerContract.methods.getMintableVAI(accountAddress).call();
11 |
12 | return formatToOutput(res);
13 | };
14 |
15 | export default getMintableVai;
16 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getMintableVai/types.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { VaiUnitroller } from 'types/contracts';
4 |
5 | export interface GetMintableVaiInput {
6 | vaiControllerContract: VaiUnitroller;
7 | accountAddress: string;
8 | }
9 |
10 | export interface GetMintableVaiOutput {
11 | mintableVaiWei: BigNumber;
12 | }
13 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getMintedVai/index.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { Comptroller } from 'types/contracts';
4 |
5 | export interface GetMintedVaiInput {
6 | comptrollerContract: Comptroller;
7 | accountAddress: string;
8 | }
9 |
10 | export type GetMintedVaiOutput = {
11 | mintedVaiWei: BigNumber;
12 | };
13 |
14 | const getMintedVai = async ({
15 | comptrollerContract,
16 | accountAddress,
17 | }: GetMintedVaiInput): Promise => {
18 | const res = await comptrollerContract.methods.mintedVAIs(accountAddress).call();
19 |
20 | return {
21 | mintedVaiWei: new BigNumber(res),
22 | };
23 | };
24 |
25 | export default getMintedVai;
26 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getProposalEta/__snapshots__/index.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`api/queries/getProposalEta returns ETA in correct format on success 1`] = `
4 | Object {
5 | "eta": 2022-07-13T09:48:26.000Z,
6 | }
7 | `;
8 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getProposalEta/index.ts:
--------------------------------------------------------------------------------
1 | import { GovernorBravoDelegate } from 'types/contracts';
2 |
3 | export interface GetProposalEtaInput {
4 | governorBravoContract: GovernorBravoDelegate;
5 | proposalId: number;
6 | }
7 |
8 | export type GetProposalEtaOutput = {
9 | eta: Date;
10 | };
11 |
12 | const getProposalEta = async ({
13 | governorBravoContract,
14 | proposalId,
15 | }: GetProposalEtaInput): Promise => {
16 | const resp = await governorBravoContract.methods.proposals(proposalId).call();
17 |
18 | // Convert ETA expressed in seconds to milliseconds
19 | const eta = new Date(+resp.eta * 1000);
20 |
21 | return {
22 | eta,
23 | };
24 | };
25 |
26 | export default getProposalEta;
27 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getProposalState/index.ts:
--------------------------------------------------------------------------------
1 | import { GovernorBravoDelegate } from 'types/contracts';
2 |
3 | export interface GetProposalStateInput {
4 | governorBravoContract: GovernorBravoDelegate;
5 | proposalId: string;
6 | }
7 |
8 | export type GetProposalStateOutput = {
9 | state: string;
10 | };
11 |
12 | const getProposalState = async ({
13 | governorBravoContract,
14 | proposalId,
15 | }: GetProposalStateInput): Promise => {
16 | const state = await governorBravoContract.methods.state(proposalId).call();
17 |
18 | return { state };
19 | };
20 |
21 | export default getProposalState;
22 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getProposalThreshold/index.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { GovernorBravoDelegate } from 'types/contracts';
4 |
5 | export interface GetProposalThresholdInput {
6 | governorBravoContract: GovernorBravoDelegate;
7 | }
8 |
9 | export type GetProposalThresholdOutput = {
10 | thresholdWei: BigNumber;
11 | };
12 |
13 | const getProposalThreshold = async ({
14 | governorBravoContract,
15 | }: GetProposalThresholdInput): Promise => {
16 | const resp = await governorBravoContract.methods.proposalThreshold().call();
17 |
18 | return {
19 | thresholdWei: new BigNumber(resp),
20 | };
21 | };
22 |
23 | export default getProposalThreshold;
24 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getTransactions/types.ts:
--------------------------------------------------------------------------------
1 | export interface TransactionResponse {
2 | amount: number;
3 | blockNumber: number;
4 | category: string;
5 | createdAt: string;
6 | event: string;
7 | from: string;
8 | id: number;
9 | timestamp: string | null;
10 | to: string;
11 | transactionHash: string;
12 | updatedAt: string;
13 | vTokenAddress: string;
14 | }
15 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVTokenBalanceOf/index.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { VBep20, VBnbToken } from 'types/contracts';
4 |
5 | export interface GetVTokenBalanceOfInput {
6 | vTokenContract: VBep20 | VBnbToken;
7 | accountAddress: string;
8 | }
9 |
10 | export type GetVTokenBalanceOfOutput = {
11 | balanceWei: BigNumber;
12 | };
13 |
14 | const getVTokenBalanceOf = async ({
15 | vTokenContract,
16 | accountAddress,
17 | }: GetVTokenBalanceOfInput): Promise => {
18 | const res = await vTokenContract.methods.balanceOf(accountAddress).call();
19 |
20 | return {
21 | balanceWei: new BigNumber(res),
22 | };
23 | };
24 |
25 | export default getVTokenBalanceOf;
26 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVTokenBalancesAll/__snapshots__/index.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`api/queries/getVTokenBalancesAll returns the APY simulations in the correct format on success 1`] = `
4 | Object {
5 | "balances": Array [
6 | Object {
7 | "balanceOf": "10000",
8 | "balanceOfUnderlying": "20000",
9 | "borrowBalanceCurrent": "300",
10 | "tokenAllowance": "40000000000000000",
11 | "tokenBalance": "5000",
12 | "vToken": "0x3d759121234cd36F8124C21aFe1c6852d2bEd848",
13 | },
14 | ],
15 | }
16 | `;
17 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVTokenCash/index.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { VBep20, VBnbToken } from 'types/contracts';
4 |
5 | export interface GetVTokenCashInput {
6 | vTokenContract: VBep20 | VBnbToken;
7 | }
8 |
9 | export type GetVTokenCashOutput = {
10 | cashWei: BigNumber;
11 | };
12 |
13 | const getVTokenCash = async ({
14 | vTokenContract,
15 | }: GetVTokenCashInput): Promise => {
16 | const res = await vTokenContract.methods.getCash().call();
17 |
18 | return {
19 | cashWei: new BigNumber(res),
20 | };
21 | };
22 |
23 | export default getVTokenCash;
24 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVTokenInterestRateModel/index.ts:
--------------------------------------------------------------------------------
1 | import { VBep20, VBnbToken } from 'types/contracts';
2 |
3 | export interface GetVTokenInterestRateModelInput {
4 | vTokenContract: VBep20 | VBnbToken;
5 | }
6 |
7 | export type GetVTokenInterestRateModelOutput = {
8 | contractAddress: string;
9 | };
10 |
11 | const getVTokenInterestRateModel = async ({
12 | vTokenContract,
13 | }: GetVTokenInterestRateModelInput): Promise => {
14 | const contractAddress = await vTokenContract.methods.interestRateModel().call();
15 |
16 | return {
17 | contractAddress,
18 | };
19 | };
20 |
21 | export default getVTokenInterestRateModel;
22 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVaiVaultPendingXvs/index.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { VaiVault } from 'types/contracts';
4 |
5 | export interface GetVaiVaultPendingXvsInput {
6 | vaiVaultContract: VaiVault;
7 | accountAddress: string;
8 | }
9 |
10 | export type GetVaiVaultPendingXvsOutput = {
11 | pendingXvsWei: BigNumber;
12 | };
13 |
14 | const getVaiVaultPendingXvs = async ({
15 | vaiVaultContract,
16 | accountAddress,
17 | }: GetVaiVaultPendingXvsInput): Promise => {
18 | const res = await vaiVaultContract.methods.pendingXVS(accountAddress).call();
19 |
20 | return {
21 | pendingXvsWei: new BigNumber(res),
22 | };
23 | };
24 |
25 | export default getVaiVaultPendingXvs;
26 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVaiVaultUserInfo/__snapshots__/index.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`api/queries/getVaiVaultUserInfo returns the user info in the correct format 1`] = `
4 | Object {
5 | "stakedVaiWei": "1e+23",
6 | }
7 | `;
8 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVaiVaultUserInfo/formatToUserInfo.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { VaiVault } from 'types/contracts';
4 |
5 | import { GetVaiVaultUserInfoOutput } from './types';
6 |
7 | const formatToUserInfo = ({
8 | amount,
9 | }: Awaited<
10 | ReturnType['call']>
11 | >): GetVaiVaultUserInfoOutput => ({
12 | stakedVaiWei: new BigNumber(amount),
13 | });
14 |
15 | export default formatToUserInfo;
16 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVaiVaultUserInfo/index.ts:
--------------------------------------------------------------------------------
1 | import formatToUserInfo from './formatToUserInfo';
2 | import { GetVaiVaultUserInfoInput, GetVaiVaultUserInfoOutput } from './types';
3 |
4 | export * from './types';
5 |
6 | const getVaiVaultUserInfo = async ({
7 | vaiVaultContract,
8 | accountAddress,
9 | }: GetVaiVaultUserInfoInput): Promise => {
10 | const res = await vaiVaultContract.methods.userInfo(accountAddress).call();
11 | return formatToUserInfo(res);
12 | };
13 |
14 | export default getVaiVaultUserInfo;
15 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVaiVaultUserInfo/types.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { VaiVault } from 'types/contracts';
4 |
5 | export interface GetVaiVaultUserInfoInput {
6 | vaiVaultContract: VaiVault;
7 | accountAddress: string;
8 | }
9 |
10 | export interface GetVaiVaultUserInfoOutput {
11 | stakedVaiWei: BigNumber;
12 | }
13 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVoteReceipt/__snapshots__/index.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`api/queries/getVoteReceipt returns the correct string depending on what the contract call returns 1`] = `
4 | Object {
5 | "voteSupport": "AGAINST",
6 | }
7 | `;
8 |
9 | exports[`api/queries/getVoteReceipt returns the correct string depending on what the contract call returns 2`] = `
10 | Object {
11 | "voteSupport": "FOR",
12 | }
13 | `;
14 |
15 | exports[`api/queries/getVoteReceipt returns the correct string depending on what the contract call returns 3`] = `
16 | Object {
17 | "voteSupport": "ABSTAIN",
18 | }
19 | `;
20 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVoterAccounts/formatVoterAccountResponse.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { GetVoterAccountsResponse } from './types';
4 |
5 | const formatVoterResponse = (data: GetVoterAccountsResponse) => ({
6 | limit: data.limit,
7 | offset: data.offset,
8 | total: data.total,
9 | voterAccounts: data.result.map(d => ({
10 | address: d.address,
11 | createdAt: new Date(d.createdAt),
12 | id: d.id,
13 | proposalsVoted: d.proposalsVoted,
14 | updatedAt: new Date(d.updatedAt),
15 | voteWeightPercent: d.voteWeight,
16 | votesWei: new BigNumber(d.votes),
17 | })),
18 | });
19 |
20 | export default formatVoterResponse;
21 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVoterAccounts/types.ts:
--------------------------------------------------------------------------------
1 | export interface GetVoterAccountsResponse {
2 | limit: number;
3 | offset: number;
4 | total: number;
5 | result: {
6 | address: string;
7 | createdAt: string;
8 | id: string;
9 | proposalsVoted: number;
10 | updatedAt: string;
11 | voteWeight: number;
12 | votes: string;
13 | votes2: string;
14 | }[];
15 | }
16 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVoterHistory/types.ts:
--------------------------------------------------------------------------------
1 | import { ProposalApiResponse } from '../getProposals';
2 |
3 | export interface GetVoterHistoryResponse {
4 | limit: number;
5 | offset: number;
6 | total: number;
7 | result: {
8 | address: string;
9 | blockNumber: number;
10 | blockTimestamp: number;
11 | createdAt: string;
12 | hasVoted: boolean;
13 | id: string;
14 | proposal: Omit;
15 | proposalId: number;
16 | reason: null | string;
17 | support: 0 | 1 | 2;
18 | updatedAt: string;
19 | votes: string;
20 | }[];
21 | }
22 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVrtConversionEndTime/index.ts:
--------------------------------------------------------------------------------
1 | import { VrtConverter } from 'types/contracts';
2 |
3 | export interface GetVrtConversionEndTimeInput {
4 | vrtConverterContract: VrtConverter;
5 | }
6 |
7 | export type GetVrtConversionEndTimeOutput = {
8 | conversionEndTime: Date;
9 | };
10 |
11 | const getVrtConverstionEndTime = async ({
12 | vrtConverterContract,
13 | }: GetVrtConversionEndTimeInput): Promise => {
14 | const resp = await vrtConverterContract.methods.conversionEndTime().call();
15 |
16 | // End Date is returned as unix timestamp;
17 | return {
18 | conversionEndTime: new Date(+resp * 1000),
19 | };
20 | };
21 |
22 | export default getVrtConverstionEndTime;
23 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVrtConversionRatio/index.ts:
--------------------------------------------------------------------------------
1 | import { VrtConverter } from 'types/contracts';
2 |
3 | export interface VrtConversionRatioInput {
4 | vrtConverterContract: VrtConverter;
5 | }
6 |
7 | export type GetVrtConversionRatioOutput = {
8 | conversionRatio: string;
9 | };
10 |
11 | const getVrtConversionRatio = async ({
12 | vrtConverterContract,
13 | }: VrtConversionRatioInput): Promise => {
14 | const conversionRatio = await vrtConverterContract.methods.conversionRatio().call();
15 |
16 | return { conversionRatio };
17 | };
18 |
19 | export default getVrtConversionRatio;
20 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVrtVaultUserInfo/__snapshots__/index.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`api/queries/getVrtVaultUserInfo returns the user info in the correct format 1`] = `
4 | Object {
5 | "stakedVrtWei": "100000000000000",
6 | }
7 | `;
8 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVrtVaultUserInfo/formatToUserInfo.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { VrtVault } from 'types/contracts';
4 |
5 | import { GetVrtVaultUserInfoOutput } from './types';
6 |
7 | const formatToUserInfo = ({
8 | totalPrincipalAmount,
9 | }: Awaited<
10 | ReturnType['call']>
11 | >): GetVrtVaultUserInfoOutput => ({
12 | stakedVrtWei: new BigNumber(totalPrincipalAmount),
13 | });
14 |
15 | export default formatToUserInfo;
16 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVrtVaultUserInfo/index.ts:
--------------------------------------------------------------------------------
1 | import formatToUserInfo from './formatToUserInfo';
2 | import { GetVrtVaultUserInfoInput, GetVrtVaultUserInfoOutput } from './types';
3 |
4 | export * from './types';
5 |
6 | const getVrtVaultUserInfo = async ({
7 | vrtVaultContract,
8 | accountAddress,
9 | }: GetVrtVaultUserInfoInput): Promise => {
10 | const res = await vrtVaultContract.methods.userInfo(accountAddress).call();
11 | return formatToUserInfo(res);
12 | };
13 |
14 | export default getVrtVaultUserInfo;
15 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getVrtVaultUserInfo/types.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { VrtVault } from 'types/contracts';
4 |
5 | export interface GetVrtVaultUserInfoInput {
6 | vrtVaultContract: VrtVault;
7 | accountAddress: string;
8 | }
9 |
10 | export interface GetVrtVaultUserInfoOutput {
11 | stakedVrtWei: BigNumber;
12 | }
13 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultLockedDeposits/__snapshots__/index.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`api/queries/getXvsVaultLockedDeposits returns withdrawal requests on success 1`] = `
4 | Object {
5 | "lockedDeposits": Array [
6 | Object {
7 | "amountWei": "1000000000000000000",
8 | "unlockedAt": 2022-06-29T10:43:24.000Z,
9 | },
10 | Object {
11 | "amountWei": "2000000000000000000",
12 | "unlockedAt": 2022-06-30T14:30:04.000Z,
13 | },
14 | Object {
15 | "amountWei": "3000000000000000000",
16 | "unlockedAt": 2022-07-01T18:16:44.000Z,
17 | },
18 | ],
19 | }
20 | `;
21 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultLockedDeposits/formatToLockedDeposit.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 | import { LockedDeposit } from 'types';
3 |
4 | import { XvsVault } from 'types/contracts';
5 |
6 | const formatToLockedDeposit = ([amount, lockedUntil]: Awaited<
7 | ReturnType['call']>
8 | >[number]): LockedDeposit => {
9 | // lockedUntil is a timestamp expressed in seconds, so we convert it to milliseconds
10 | const lockedUntilMs = +lockedUntil * 1000;
11 | const unlockedAt = new Date(lockedUntilMs);
12 |
13 | return {
14 | amountWei: new BigNumber(amount),
15 | unlockedAt,
16 | };
17 | };
18 |
19 | export default formatToLockedDeposit;
20 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultLockedDeposits/types.ts:
--------------------------------------------------------------------------------
1 | import { LockedDeposit } from 'types';
2 |
3 | import { XvsVault } from 'types/contracts';
4 |
5 | export interface GetXvsVaultLockedDepositsInput {
6 | xvsVaultContract: XvsVault;
7 | rewardTokenAddress: string;
8 | poolIndex: number;
9 | accountAddress: string;
10 | }
11 |
12 | export type GetXvsVaultLockedDepositsOutput = {
13 | lockedDeposits: LockedDeposit[];
14 | };
15 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultPoolCount/index.ts:
--------------------------------------------------------------------------------
1 | import { getToken } from 'utilities';
2 |
3 | import { XvsVault } from 'types/contracts';
4 |
5 | export interface GetXvsVaultPoolCountInput {
6 | xvsVaultContract: XvsVault;
7 | }
8 |
9 | export type GetXvsVaultPoolCountOutput = {
10 | poolCount: number;
11 | };
12 |
13 | const getXvsVaultPoolCount = async ({
14 | xvsVaultContract,
15 | }: GetXvsVaultPoolCountInput): Promise => {
16 | const xvsTokenAddress = getToken('xvs').address;
17 | const xvsVaultPoolLength = await xvsVaultContract.methods.poolLength(xvsTokenAddress).call();
18 |
19 | return {
20 | poolCount: +xvsVaultPoolLength,
21 | };
22 | };
23 |
24 | export default getXvsVaultPoolCount;
25 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultPoolInfo/__snapshots__/index.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`api/queries/getXvsVaultPoolInfo returns the pool infos on success 1`] = `
4 | Object {
5 | "accRewardPerShare": "123871680",
6 | "allocationPoint": 10,
7 | "lastRewardBlock": 100000,
8 | "lockingPeriodMs": 200000,
9 | "stakedTokenAddress": "0x4B7268FC7C727B88c5Fc127D41b491BfAe63e144",
10 | }
11 | `;
12 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultPoolInfo/index.ts:
--------------------------------------------------------------------------------
1 | import formatToPoolInfo from './formatToPoolInfo';
2 | import { GetXvsVaultPoolInfoInput, GetXvsVaultPoolInfoOutput } from './types';
3 |
4 | export * from './types';
5 |
6 | const getXvsVaultPoolInfo = async ({
7 | xvsVaultContract,
8 | rewardTokenAddress,
9 | poolIndex,
10 | }: GetXvsVaultPoolInfoInput): Promise => {
11 | const res = await xvsVaultContract.methods.poolInfos(rewardTokenAddress, poolIndex).call();
12 | return formatToPoolInfo(res);
13 | };
14 |
15 | export default getXvsVaultPoolInfo;
16 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultPoolInfo/types.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { XvsVault } from 'types/contracts';
4 |
5 | export interface GetXvsVaultPoolInfoInput {
6 | xvsVaultContract: XvsVault;
7 | rewardTokenAddress: string;
8 | poolIndex: number;
9 | }
10 |
11 | export interface GetXvsVaultPoolInfoOutput {
12 | stakedTokenAddress: string;
13 | allocationPoint: number;
14 | lastRewardBlock: number;
15 | accRewardPerShare: BigNumber;
16 | lockingPeriodMs: number;
17 | }
18 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultTotalAllocationPoints/index.ts:
--------------------------------------------------------------------------------
1 | import { XvsVault } from 'types/contracts';
2 |
3 | export interface GetXvsVaultTotalAllocPointsInput {
4 | xvsVaultContract: XvsVault;
5 | tokenAddress: string;
6 | }
7 |
8 | export type GetXvsVaultTotalAllocPointsOutput = {
9 | totalAllocationPoints: number;
10 | };
11 |
12 | const getXvsVaultTotalAllocationPoints = async ({
13 | xvsVaultContract,
14 | tokenAddress,
15 | }: GetXvsVaultTotalAllocPointsInput): Promise => {
16 | const res = await xvsVaultContract.methods.totalAllocPoints(tokenAddress).call();
17 |
18 | return {
19 | totalAllocationPoints: +res,
20 | };
21 | };
22 |
23 | export default getXvsVaultTotalAllocationPoints;
24 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultUserInfo/__snapshots__/index.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`api/queries/getXvsVaultUserInfo returns user info related to XVS vault in correct format on success 1`] = `
4 | Object {
5 | "pendingWithdrawalsTotalAmountWei": "1000000000000000000",
6 | "rewardDebtAmountWei": "2000000000000000000",
7 | "stakedAmountWei": "30000000000000000000",
8 | }
9 | `;
10 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultUserInfo/formatToUserInfo.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { XvsVault } from 'types/contracts';
4 |
5 | import { GetXvsVaultUserInfoOutput } from './types';
6 |
7 | const formatToUserInfo = ({
8 | amount,
9 | pendingWithdrawals,
10 | rewardDebt,
11 | }: Awaited<
12 | ReturnType['call']>
13 | >): GetXvsVaultUserInfoOutput => ({
14 | stakedAmountWei: new BigNumber(amount),
15 | pendingWithdrawalsTotalAmountWei: new BigNumber(pendingWithdrawals),
16 | rewardDebtAmountWei: new BigNumber(rewardDebt),
17 | });
18 |
19 | export default formatToUserInfo;
20 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultUserInfo/index.ts:
--------------------------------------------------------------------------------
1 | import formatToUserInfo from './formatToUserInfo';
2 | import { GetXvsVaultUserInfoInput, GetXvsVaultUserInfoOutput } from './types';
3 |
4 | export * from './types';
5 |
6 | const getXvsVaultUserInfo = async ({
7 | xvsVaultContract,
8 | rewardTokenAddress,
9 | poolIndex,
10 | accountAddress,
11 | }: GetXvsVaultUserInfoInput): Promise => {
12 | const res = await xvsVaultContract.methods
13 | .getUserInfo(rewardTokenAddress, poolIndex, accountAddress)
14 | .call();
15 |
16 | return formatToUserInfo(res);
17 | };
18 |
19 | export default getXvsVaultUserInfo;
20 |
--------------------------------------------------------------------------------
/src/clients/api/queries/getXvsVaultUserInfo/types.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { XvsVault } from 'types/contracts';
4 |
5 | export interface GetXvsVaultUserInfoInput {
6 | xvsVaultContract: XvsVault;
7 | rewardTokenAddress: string;
8 | poolIndex: number;
9 | accountAddress: string;
10 | }
11 |
12 | export interface GetXvsVaultUserInfoOutput {
13 | stakedAmountWei: BigNumber;
14 | pendingWithdrawalsTotalAmountWei: BigNumber;
15 | rewardDebtAmountWei: BigNumber;
16 | }
17 |
--------------------------------------------------------------------------------
/src/clients/api/queryClient.ts:
--------------------------------------------------------------------------------
1 | import { QueryClient } from 'react-query';
2 |
3 | const queryClient = new QueryClient({
4 | defaultOptions: {
5 | queries: {
6 | // Set a stale time of 10 seconds so query results don't get wiped out of
7 | // the cache instantly after their hook unmounts (see documentation for
8 | // more info: https://react-query.tanstack.com/guides/important-defaults)
9 | staleTime: 10000,
10 | },
11 | },
12 | });
13 | export default queryClient;
14 |
--------------------------------------------------------------------------------
/src/clients/contracts/index.ts:
--------------------------------------------------------------------------------
1 | export * from './getters';
2 | export * from './hooks';
3 |
--------------------------------------------------------------------------------
/src/clients/contracts/types.ts:
--------------------------------------------------------------------------------
1 | import { TokenId, VTokenId } from 'types';
2 |
3 | import { Bep20, VBep20, VBnbToken, VaiToken, VrtToken, XvsToken } from 'types/contracts';
4 |
5 | export type TokenContract = T extends 'xvs'
6 | ? XvsToken
7 | : T extends 'vai'
8 | ? VaiToken
9 | : T extends 'vrt'
10 | ? VrtToken
11 | : Bep20;
12 |
13 | export type VTokenContract = T extends 'bnb' ? VBnbToken : VBep20;
14 |
--------------------------------------------------------------------------------
/src/clients/web3/Web3Wrapper/index.tsx:
--------------------------------------------------------------------------------
1 | import { Web3ReactProvider } from '@web3-react/core';
2 | import React from 'react';
3 |
4 | import Web3ReactManager from './Web3ReactManager';
5 |
6 | const Web3Wrapper: React.FC = ({ children }) => (
7 | provider}>
8 | {children}
9 |
10 | );
11 |
12 | export default Web3Wrapper;
13 |
--------------------------------------------------------------------------------
/src/clients/web3/getWeb3NoAccount.ts:
--------------------------------------------------------------------------------
1 | import config from 'config';
2 | import Web3 from 'web3';
3 |
4 | // @todo: we will get the "No 'Access-Control-Allow-Origin' header is present on the requested resource"
5 | // error on the frontend in testnet when the wallet is unconnected, because the bsc official testnet endpoints
6 | // don't support CORS request right now, and we didn't find any working testnet endpoints for
7 | // HTTPProvider or WebSocketProvider neither.
8 | const getWeb3NoAccount = () => {
9 | const httpProvider = new Web3.providers.HttpProvider(config.rpcUrl, {
10 | timeout: 10000,
11 | });
12 | const web3NoAccount = new Web3(httpProvider);
13 | return web3NoAccount;
14 | };
15 |
16 | export default getWeb3NoAccount;
17 |
--------------------------------------------------------------------------------
/src/clients/web3/index.ts:
--------------------------------------------------------------------------------
1 | export { useWeb3React as useWeb3Account } from '@web3-react/core';
2 |
3 | export { default as useWeb3 } from './useWeb3';
4 | export { default as useEagerConnect } from './useEagerConnect';
5 | export { default as useInactiveListener } from './useInactiveListener';
6 | export { default as useAuth } from './useAuth';
7 | export { default as getWeb3NoAccount } from './getWeb3NoAccount';
8 | export { default as Web3Wrapper } from './Web3Wrapper';
9 | export * from './connectors';
10 | export * from './types';
11 |
--------------------------------------------------------------------------------
/src/clients/web3/types.ts:
--------------------------------------------------------------------------------
1 | export enum Connector {
2 | MetaMask = 'MetaMask',
3 | TrustWallet = 'TrustWallet',
4 | WalletConnect = 'WalletConnect',
5 | CoinbaseWallet = 'CoinbaseWallet',
6 | BinanceChainWallet = 'BinanceChainWallet',
7 | BraveWallet = 'BraveWallet',
8 | InfinityWallet = 'InfinityWallet',
9 | OperaWallet = 'OperaWallet',
10 | BitKeep = 'BitKeep',
11 | }
12 |
--------------------------------------------------------------------------------
/src/clients/web3/useWeb3.ts:
--------------------------------------------------------------------------------
1 | import { useWeb3React } from '@web3-react/core';
2 | import { useEffect, useRef, useState } from 'react';
3 | import Web3 from 'web3';
4 |
5 | import getWeb3NoAccount from './getWeb3NoAccount';
6 |
7 | const useWeb3 = () => {
8 | const { library } = useWeb3React();
9 | const refEth = useRef(library);
10 | const [web3, setWeb3] = useState(library ? new Web3(library) : getWeb3NoAccount());
11 |
12 | useEffect(() => {
13 | if (library !== refEth.current) {
14 | setWeb3(library ? new Web3(library) : getWeb3NoAccount());
15 | refEth.current = library;
16 | }
17 | }, [library]);
18 |
19 | return web3;
20 | };
21 |
22 | export default useWeb3;
23 |
--------------------------------------------------------------------------------
/src/clients/web3/walletDetectionUtils.ts:
--------------------------------------------------------------------------------
1 | export const isRunningInOperaBrowser = () => window.ethereum?.isOpera;
2 |
3 | export const isRunningInBinanceChainWallet = () => !!window.BinanceChain;
4 |
--------------------------------------------------------------------------------
/src/components/ActiveVotingProgress/styles.tsx:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return {
7 | votesWrapper: css`
8 | display: flex;
9 | flex-direction: column;
10 | width: 100%;
11 | `,
12 | bar: css`
13 | :nth-of-type(2) {
14 | margin: ${theme.spacing(6)} 0;
15 | }
16 | `,
17 | };
18 | };
19 |
--------------------------------------------------------------------------------
/src/components/AuthModal/types.ts:
--------------------------------------------------------------------------------
1 | import { Connector } from 'clients/web3';
2 |
3 | export type BaseWallet = {
4 | name: string;
5 | Logo: React.FC>;
6 | };
7 |
8 | export type Wallet = BaseWallet & {
9 | connector: Connector;
10 | mainnetOnly?: boolean;
11 | };
12 |
13 | // Integrated wallets represent wallets that are integrated through third-party
14 | // apps but not directly from our dApp. These wallets are displayed on the UI as
15 | // options that on click redirect to a web page explaining how to set them up
16 | // through a third-party app (e.g.: MetaMask).
17 | export type IntegratedWallet = BaseWallet & {
18 | linkUrl: string;
19 | };
20 |
--------------------------------------------------------------------------------
/src/components/BscLink/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withCenterStory, withThemeProvider } from 'stories/decorators';
5 |
6 | import { BscLink } from '.';
7 |
8 | export default {
9 | title: 'Components/BscLink',
10 | component: BscLink,
11 | decorators: [withThemeProvider, withCenterStory({ width: 600 })],
12 | } as ComponentMeta;
13 |
14 | export const Default = () => (
15 |
16 | );
17 |
--------------------------------------------------------------------------------
/src/components/Button/types.ts:
--------------------------------------------------------------------------------
1 | export type Variant = 'primary' | 'secondary' | 'tertiary' | 'text';
2 |
--------------------------------------------------------------------------------
/src/components/Checkbox/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return {
7 | root: css`
8 | padding: 0;
9 |
10 | svg {
11 | height: ${theme.spacing(6)};
12 | width: ${theme.spacing(6)};
13 | }
14 | :hover {
15 | svg {
16 | color: ${theme.palette.interactive.primary};
17 | }
18 | }
19 | `,
20 | };
21 | };
22 |
23 | export default useStyles;
24 |
--------------------------------------------------------------------------------
/src/components/ConnectWallet/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import noop from 'noop-ts';
3 | import React from 'react';
4 |
5 | import { withCenterStory } from 'stories/decorators';
6 |
7 | import { Prompt as PromptUi } from '.';
8 |
9 | export default {
10 | title: 'Components/ConnectWallet',
11 | component: PromptUi,
12 | decorators: [withCenterStory({ width: 450 })],
13 | } as ComponentMeta;
14 |
15 | export const Prompt = () => (
16 |
17 | Protected content
18 |
19 | );
20 |
--------------------------------------------------------------------------------
/src/components/ConnectWallet/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | container: css`
9 | width: 100%;
10 | `,
11 | notice: css`
12 | margin-bottom: ${theme.spacing(10)};
13 | `,
14 | };
15 | };
16 |
--------------------------------------------------------------------------------
/src/components/Countdown/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | activeUntilDate: css`
9 | padding-left: ${theme.spacing(1)};
10 | `,
11 | };
12 | };
13 |
--------------------------------------------------------------------------------
/src/components/Delimiter/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withCenterStory, withThemeProvider } from 'stories/decorators';
5 |
6 | import { Delimiter } from '.';
7 |
8 | export default {
9 | title: 'Components/Delimiter',
10 | component: Delimiter,
11 | decorators: [withThemeProvider, withCenterStory({ width: 650 })],
12 | } as ComponentMeta;
13 |
14 | export const Default = () => (
15 | <>
16 | Some text
17 |
18 | and some more text
19 | >
20 | );
21 |
--------------------------------------------------------------------------------
/src/components/Delimiter/index.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxImportSource @emotion/react */
2 | import React from 'react';
3 |
4 | import { useDelimiterStyles as useStyles } from './styles';
5 |
6 | interface DelimiterProps {
7 | className?: string;
8 | }
9 |
10 | export const Delimiter = ({ className }: DelimiterProps) => {
11 | const styles = useStyles();
12 | return
;
13 | };
14 |
--------------------------------------------------------------------------------
/src/components/Delimiter/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useDelimiterStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | root: css`
9 | margin-top: 0;
10 | margin-bottom: 0;
11 | border-color: ${theme.palette.secondary.light};
12 | border-style: solid;
13 | `,
14 | };
15 | };
16 |
--------------------------------------------------------------------------------
/src/components/EllipseAddress/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import fakeAddress from '__mocks__/models/address';
5 | import { withCenterStory } from 'stories/decorators';
6 |
7 | import { EllipseAddress } from '.';
8 |
9 | export default {
10 | title: 'Components/EnableToken',
11 | component: EllipseAddress,
12 | decorators: [withCenterStory({ width: 450 })],
13 | } as ComponentMeta;
14 |
15 | export const Default = () => ;
16 |
17 | export const WithEllipseBreakpoint = () => (
18 |
19 | );
20 |
--------------------------------------------------------------------------------
/src/components/EllipseAddress/types.ts:
--------------------------------------------------------------------------------
1 | import { BREAKPOINTS } from 'theme/MuiThemeProvider/muiTheme';
2 |
3 | export type Breakpoint = keyof typeof BREAKPOINTS.values;
4 |
--------------------------------------------------------------------------------
/src/components/Form/index.ts:
--------------------------------------------------------------------------------
1 | export * from './FormikSubmitButton';
2 | export * from './FormikTokenTextField';
3 | export * from './FormikTextField';
4 | export * from './FormikMarkdownEditor';
5 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/arrowRight.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgArrowRight = (props: SVGProps) => (
5 |
8 | );
9 |
10 | export default SvgArrowRight;
11 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/arrowShaft.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgArrowShaft = (props: SVGProps) => (
5 |
8 | );
9 |
10 | export default SvgArrowShaft;
11 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/arrowUp.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgarrowUp = (props: SVGProps) => (
5 |
11 | );
12 |
13 | export default SvgarrowUp;
14 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/bubble.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgBubble = (props: SVGProps) => (
5 |
14 | );
15 |
16 | export default SvgBubble;
17 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/burger.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgBurger = (props: SVGProps) => (
5 |
8 | );
9 |
10 | export default SvgBurger;
11 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/check.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgCheck = (props: SVGProps) => (
5 |
21 | );
22 |
23 | export default SvgCheck;
24 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/checkInline.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgCheckInline = (props: SVGProps) => (
5 |
19 | );
20 |
21 | export default SvgCheckInline;
22 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/checkboxBorder.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgCheckboxBorder = (props: SVGProps) => (
5 |
8 | );
9 |
10 | export default SvgCheckboxBorder;
11 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/checked.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgChecked = (props: SVGProps) => (
5 |
15 | );
16 |
17 | export default SvgChecked;
18 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/chevronLeft.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgChevronLeft = (props: SVGProps) => (
5 |
8 | );
9 |
10 | export default SvgChevronLeft;
11 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/chevronRight.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgChevronRight = (props: SVGProps) => (
5 |
8 | );
9 |
10 | export default SvgChevronRight;
11 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/close.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgClose = (props: SVGProps) => (
5 |
9 | );
10 |
11 | export default SvgClose;
12 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/convert.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgConvert = (props: SVGProps) => (
5 |
14 | );
15 |
16 | export default SvgConvert;
17 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/copy.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgCopy = (props: SVGProps) => (
5 |
11 | );
12 |
13 | export default SvgCopy;
14 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/dashboard.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgDashboard = (props: SVGProps) => (
5 |
13 | );
14 |
15 | export default SvgDashboard;
16 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/dots.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgDots = (props: SVGProps) => (
5 |
17 | );
18 |
19 | export default SvgDots;
20 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/exclamation.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgExclamation = (props: SVGProps) => (
5 |
9 | );
10 |
11 | export default SvgExclamation;
12 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/info.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgInfo = (props: SVGProps) => (
5 |
14 | );
15 |
16 | export default SvgInfo;
17 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/loading.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgLoading = (props: SVGProps) => (
5 |
21 | );
22 |
23 | export default SvgLoading;
24 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/longArrow.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgLongArrow = (props: SVGProps) => (
5 |
8 | );
9 |
10 | export default SvgLongArrow;
11 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/mark.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgMark = (props: SVGProps) => (
5 |
14 | );
15 |
16 | export default SvgMark;
17 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/market.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgMarket = (props: SVGProps) => (
5 |
10 | );
11 |
12 | export default SvgMarket;
13 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/mask.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgMask = (props: SVGProps) => (
5 |
8 | );
9 |
10 | export default SvgMask;
11 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/medium.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgMedium = (props: SVGProps) => (
5 |
11 | );
12 |
13 | export default SvgMedium;
14 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/open.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgOpen = (props: SVGProps) => (
5 |
11 | );
12 |
13 | export default SvgOpen;
14 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/shield.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgShield = (props: SVGProps) => (
5 |
12 | );
13 |
14 | export default SvgShield;
15 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/sort.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgSort = (props: SVGProps) => (
5 |
8 | );
9 |
10 | export default SvgSort;
11 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/tokens/busd.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgBusd = (props: SVGProps) => (
5 |
12 | );
13 |
14 | export default SvgBusd;
15 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/tokens/link.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgLink = (props: SVGProps) => (
5 |
12 | );
13 |
14 | export default SvgLink;
15 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/tokens/tusd.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgTusd = (props: SVGProps) => (
5 |
12 | );
13 |
14 | export default SvgTusd;
15 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/tokens/vrt.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgVrt = (props: SVGProps) => (
5 |
14 | );
15 |
16 | export default SvgVrt;
17 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/tokens/xrp.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgXrp = (props: SVGProps) => (
5 |
12 | );
13 |
14 | export default SvgXrp;
15 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/twitter.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgTwitter = (props: SVGProps) => (
5 |
11 | );
12 |
13 | export default SvgTwitter;
14 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/vote.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgVote = (props: SVGProps) => (
5 |
11 | );
12 |
13 | export default SvgVote;
14 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/vrt.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgVrt = (props: SVGProps) => (
5 |
14 | );
15 |
16 | export default SvgVrt;
17 |
--------------------------------------------------------------------------------
/src/components/Icon/icons/wallet.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { SVGProps } from 'react';
3 |
4 | const SvgWallet = (props: SVGProps) => (
5 |
13 | );
14 |
15 | export default SvgWallet;
16 |
--------------------------------------------------------------------------------
/src/components/InfoIcon/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withCenterStory } from 'stories/decorators';
5 |
6 | import { InfoIcon } from '.';
7 |
8 | export default {
9 | title: 'Components/InfoIcon',
10 | component: InfoIcon,
11 | decorators: [withCenterStory({ width: 100 })],
12 | } as ComponentMeta;
13 |
14 | export const Default = () => ;
15 |
--------------------------------------------------------------------------------
/src/components/InfoIcon/index.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxImportSource @emotion/react */
2 | import React from 'react';
3 |
4 | import { Icon } from '../Icon';
5 | import { Tooltip } from '../Tooltip';
6 | import { useStyles } from './styles';
7 |
8 | export interface InfoIconProps {
9 | tooltip: string;
10 | className?: string;
11 | }
12 |
13 | export const InfoIcon = ({ tooltip, className }: InfoIconProps) => {
14 | const styles = useStyles();
15 |
16 | return (
17 |
18 |
19 |
20 | );
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/InfoIcon/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 |
3 | export const useStyles = () => ({
4 | container: css`
5 | display: inline-flex;
6 | `,
7 | icon: css`
8 | cursor: help;
9 | `,
10 | });
11 |
--------------------------------------------------------------------------------
/src/components/IsolatedAssetWarning/AssetTable/testIds.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | assetTable: 'isolated-asset-warning-asset-table',
3 | };
4 |
--------------------------------------------------------------------------------
/src/components/IsolatedAssetWarning/__snapshots__/index.spec.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`components/IsolatedAssetWarning displays list of assets correctly 1`] = `"USDC-5.36%$8,587.22BBUSD-4.05%$839.1MUSDT-4.97%$31.58MSXP-2.31%$709.26K"`;
4 |
--------------------------------------------------------------------------------
/src/components/IsolatedAssetWarning/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | container: css`
9 | position: relative;
10 | `,
11 | notice: css`
12 | padding: ${theme.spacing(3)};
13 | border-radius: ${theme.spacing(3)};
14 | margin-bottom: ${theme.spacing(2)};
15 | `,
16 | description: css`
17 | margin-bottom: ${theme.spacing(2)};
18 | `,
19 | inlineButton: css`
20 | padding: 0;
21 |
22 | > span {
23 | font-weight: ${theme.typography.body1.fontWeight};
24 | }
25 | `,
26 | };
27 | };
28 |
--------------------------------------------------------------------------------
/src/components/IsolatedAssetWarning/types.ts:
--------------------------------------------------------------------------------
1 | export type WarningType = 'borrow' | 'supply';
2 |
--------------------------------------------------------------------------------
/src/components/LayeredValues/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withCenterStory } from 'stories/decorators';
5 |
6 | import LayeredValue from '.';
7 |
8 | export default {
9 | title: 'Components/LayeredValue',
10 | component: LayeredValue,
11 | decorators: [withCenterStory({ width: 55 })],
12 | } as ComponentMeta;
13 |
14 | export const Default = () => ;
15 |
--------------------------------------------------------------------------------
/src/components/LayeredValues/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | container: css`
9 | display: flex;
10 | flex-direction: column;
11 | `,
12 | topValue: css`
13 | color: ${theme.palette.text.primary};
14 | `,
15 | };
16 | };
17 |
--------------------------------------------------------------------------------
/src/components/Layout/ClaimXvsRewardButton/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | button: css`
9 | white-space: nowrap;
10 | border-color: ${theme.palette.background.paper};
11 |
12 | > span {
13 | display: flex;
14 | align-items: center;
15 | }
16 | `,
17 | icon: css`
18 | margin-left: ${theme.spacing(2)};
19 | margin-right: ${theme.spacing(2)};
20 | width: ${theme.spacing(6)};
21 | height: ${theme.spacing(6)};
22 | `,
23 | };
24 | };
25 |
--------------------------------------------------------------------------------
/src/components/Layout/Footer/constants.ts:
--------------------------------------------------------------------------------
1 | export const VENUS_MEDIUM_URL = 'https://medium.com/@Venus_protocol';
2 | export const VENUS_DISCORD_URL = 'https://discord.com/invite/pTQ9EBHYtF';
3 | export const VENUS_TWITTER_URL = 'https://twitter.com/VenusProtocol';
4 | export const VENUS_GITHUB_URL = 'https://github.com/VenusProtocol/';
5 |
--------------------------------------------------------------------------------
/src/components/Layout/Footer/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { FooterUi } from '.';
5 |
6 | export default {
7 | title: 'Components/Layout/Footer',
8 | component: FooterUi,
9 | } as ComponentMeta;
10 |
11 | export const FooterDefault = () => ;
12 |
--------------------------------------------------------------------------------
/src/components/Layout/Header/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 | import { MemoryRouter, Route } from 'react-router';
4 |
5 | import { withRouter, withThemeProvider } from 'stories/decorators';
6 |
7 | import Header from '.';
8 |
9 | export default {
10 | title: 'Components/Layout/Header',
11 | component: Header,
12 | decorators: [withThemeProvider, withRouter],
13 | } as ComponentMeta;
14 |
15 | export const HeaderDefault = () => (
16 |
17 |
18 |
19 |
20 |
21 | );
22 |
--------------------------------------------------------------------------------
/src/components/Layout/PageContainer/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withRouter } from 'stories/decorators';
5 |
6 | import { PageContainer } from '.';
7 |
8 | export default {
9 | title: 'Components/Layout/PageContainer',
10 | component: PageContainer,
11 | decorators: [withRouter],
12 | } as ComponentMeta;
13 |
14 | export const PageContainerDefault = () => Hello from storybook;
15 |
--------------------------------------------------------------------------------
/src/components/Layout/PageContainer/index.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxImportSource @emotion/react */
2 | import Box from '@mui/material/Box';
3 | import React, { ReactNode } from 'react';
4 |
5 | import Footer from '../Footer';
6 | import { useStyles } from './styles';
7 |
8 | interface PageContainerProps {
9 | children: ReactNode;
10 | }
11 |
12 | export const PageContainer = ({ children }: PageContainerProps) => {
13 | const styles = useStyles();
14 | return (
15 | <>
16 |
17 | {children}
18 |
19 |
20 |
21 |
22 | >
23 | );
24 | };
25 |
--------------------------------------------------------------------------------
/src/components/Layout/Toolbar/index.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxImportSource @emotion/react */
2 | import MuiToolbar, { ToolbarProps } from '@mui/material/Toolbar';
3 | import React from 'react';
4 |
5 | import { useStyles } from './styles';
6 |
7 | export const Toolbar = (props: ToolbarProps) => {
8 | const styles = useStyles();
9 | return ;
10 | };
11 |
--------------------------------------------------------------------------------
/src/components/Layout/Toolbar/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return css`
7 | padding-top: ${theme.spacing(3)};
8 | padding-bottom: ${theme.spacing(3)};
9 | [${theme.breakpoints.down('md')}]: {
10 | min-height: none;
11 | }
12 | `;
13 | };
14 |
--------------------------------------------------------------------------------
/src/components/Layout/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withRouter, withThemeProvider } from 'stories/decorators';
5 |
6 | import { Layout } from '.';
7 |
8 | export default {
9 | title: 'Components/Layout/Layout',
10 | component: Layout,
11 | decorators: [withRouter, withThemeProvider],
12 | } as ComponentMeta;
13 |
14 | export const LayoutDefault = () => Hello from storybook;
15 |
--------------------------------------------------------------------------------
/src/components/Layout/index.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxImportSource @emotion/react */
2 | import Box from '@mui/material/Box';
3 | import React from 'react';
4 |
5 | import Header from './Header';
6 | import { PageContainer } from './PageContainer';
7 | import Sidebar from './Sidebar';
8 | import { useStyles } from './styles';
9 |
10 | export const Layout: React.FC = ({ children }) => {
11 | const styles = useStyles();
12 |
13 | return (
14 |
15 |
16 |
17 |
18 |
19 |
20 | {children}
21 |
22 |
23 | );
24 | };
25 |
--------------------------------------------------------------------------------
/src/components/Layout/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return {
7 | layout: css`
8 | display: flex;
9 | flex: 1;
10 | flex-direction: row;
11 | height: 100vh;
12 | ${theme.breakpoints.down('lg')} {
13 | flex-direction: column;
14 | }
15 | `,
16 | };
17 | };
18 |
--------------------------------------------------------------------------------
/src/components/Layout/testIds.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | claimXvsRewardButton: 'layout-claim-xvs-reward-button',
3 | };
4 |
--------------------------------------------------------------------------------
/src/components/Layout/types.ts:
--------------------------------------------------------------------------------
1 | import { IconName } from '../Icon';
2 |
3 | export interface MenuItem {
4 | href: string;
5 | icon: IconName;
6 | i18nKey: string;
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/LottieAnimation/files/index.ts:
--------------------------------------------------------------------------------
1 | export { default as spinner } from './spinner.json';
2 |
--------------------------------------------------------------------------------
/src/components/LunaUstWarningModal/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | icon: css`
9 | display: block;
10 | width: ${theme.spacing(16)};
11 | height: ${theme.spacing(16)};
12 | margin: ${theme.spacing(0, 'auto', 6)};
13 | color: ${theme.palette.interactive.warning};
14 | `,
15 | title: css`
16 | text-align: center;
17 | margin-bottom: ${theme.spacing(3)};
18 | `,
19 | message: css`
20 | margin-bottom: ${theme.spacing(10)};
21 | `,
22 | };
23 | };
24 |
--------------------------------------------------------------------------------
/src/components/Markdown/Viewer/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withCenterStory, withOnChange } from 'stories/decorators';
5 |
6 | import MarkdownViewer from '.';
7 |
8 | export default {
9 | title: 'Components/Markdown/Viewer',
10 | component: MarkdownViewer,
11 | decorators: [withCenterStory({ width: 250 }), withOnChange(e => e.target.checked)],
12 | } as ComponentMeta;
13 |
14 | export const Default = () => (
15 |
16 | );
17 |
--------------------------------------------------------------------------------
/src/components/Markdown/Viewer/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return {
7 | preview: css`
8 | p {
9 | color: ${theme.palette.text.primary};
10 | }
11 | `,
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/src/components/Markdown/index.ts:
--------------------------------------------------------------------------------
1 | export { default as MarkdownEditor } from './Editor';
2 | export * from './Editor';
3 | export { default as MarkdownViewer } from './Viewer';
4 |
--------------------------------------------------------------------------------
/src/components/Markdown/previewOptions.ts:
--------------------------------------------------------------------------------
1 | import rehypeSanitize from 'rehype-sanitize';
2 |
3 | const previewOptions = {
4 | skipHtml: true,
5 | allowedElements: ['h1', 'h2', 'h3', 'h4', 'p', 'a', 'ul', 'li', 'strong', 'em'],
6 | rehypePlugins: [rehypeSanitize],
7 | };
8 |
9 | export default previewOptions;
10 |
--------------------------------------------------------------------------------
/src/components/Notice/types.ts:
--------------------------------------------------------------------------------
1 | export type NoticeVariant = 'info' | 'error' | 'success' | 'warning';
2 |
--------------------------------------------------------------------------------
/src/components/ProgressBar/PercentageRepresentation/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withCenterStory } from 'stories/decorators';
5 |
6 | import { PercentageRepresentation } from '.';
7 |
8 | export default {
9 | title: 'Components/PercentageRepresentation',
10 | component: PercentageRepresentation,
11 | decorators: [withCenterStory({ width: 100 })],
12 | } as ComponentMeta;
13 |
14 | export const PercentageRepresentationDefault = () => ;
15 |
--------------------------------------------------------------------------------
/src/components/ProgressBar/PercentageRepresentation/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | root: css`
9 | display: flex;
10 | align-items: center;
11 | `,
12 | percentage: css`
13 | margin-left: ${theme.spacing(2)};
14 | `,
15 | };
16 | };
17 |
--------------------------------------------------------------------------------
/src/components/ReadableActionSignature/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return {
7 | signature: css`
8 | color: ${theme.palette.text.primary};
9 | overflow-wrap: anywhere;
10 |
11 | > a {
12 | color: ${theme.palette.interactive.success};
13 | :hover {
14 | color: ${theme.palette.interactive.success50};
15 | }
16 | }
17 | `,
18 | };
19 | };
20 |
--------------------------------------------------------------------------------
/src/components/ResetScrollOnRouteChange/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect } from 'react';
2 | import { useLocation } from 'react-router';
3 |
4 | export const ResetScrollOnRouteChange: React.FC = () => {
5 | const location = useLocation();
6 |
7 | useEffect(() => {
8 | window.scrollTo(0, 0);
9 | }, [location]);
10 |
11 | return null;
12 | };
13 |
--------------------------------------------------------------------------------
/src/components/Spinner/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = ({ variant }: { variant: 'large' | 'small' }) => {
5 | const theme = useTheme();
6 | const isLarge = variant === 'large';
7 | const size = isLarge ? 6.5 : 5;
8 | return {
9 | container: css`
10 | justify-content: center;
11 | align-items: center;
12 | display: flex;
13 | ${isLarge && 'width: 100%; height: 100%;'}
14 | `,
15 | spinner: css`
16 | height: ${theme.spacing(size)};
17 | width: ${theme.spacing(size)};
18 | `,
19 | };
20 | };
21 |
--------------------------------------------------------------------------------
/src/components/Spinner/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | spinner: 'spinner',
3 | };
4 |
5 | export default TEST_IDS;
6 |
--------------------------------------------------------------------------------
/src/components/Table/types.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export interface TableRowProps {
4 | key: string | number;
5 | render: () => React.ReactNode | string;
6 | value: string | number | boolean;
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/Tabs/styles.tsx:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const styles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | buttonsContainer: css`
9 | display: flex;
10 | align-items: center;
11 | margin-bottom: ${theme.spacing(8)};
12 | width: 100%;
13 |
14 | ${theme.breakpoints.down('sm')} {
15 | width: 100%;
16 | }
17 | `,
18 | };
19 | };
20 |
21 | export default styles;
22 |
--------------------------------------------------------------------------------
/src/components/Token/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withCenterStory } from 'stories/decorators';
5 |
6 | import { Token } from '.';
7 |
8 | export default {
9 | title: 'Components/Token',
10 | component: Token,
11 | decorators: [withCenterStory({ width: 100 })],
12 | } as ComponentMeta;
13 |
14 | export const Default = () => ;
15 |
16 | export const WithoutSymbol = () => ;
17 |
--------------------------------------------------------------------------------
/src/components/Token/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | container: css`
9 | display: flex;
10 | align-items: center;
11 | `,
12 | icon: css`
13 | margin-top: -2px;
14 | margin-right: ${theme.spacing(2)};
15 | width: ${theme.shape.iconSize.large}px;
16 | height: ${theme.shape.iconSize.large}px;
17 | `,
18 | };
19 | };
20 |
--------------------------------------------------------------------------------
/src/components/TokenGroup/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 | import { TokenId } from 'types';
4 |
5 | import { withCenterStory } from 'stories/decorators';
6 |
7 | import { TokenGroup } from '.';
8 |
9 | export default {
10 | title: 'Components/TokenGroup',
11 | component: TokenGroup,
12 | decorators: [withCenterStory({ width: 600 })],
13 | } as ComponentMeta;
14 |
15 | const tokenIds: TokenId[] = ['usdt', 'eth', 'usdc', 'xrp', 'bnb', 'aave'];
16 |
17 | export const Default = () => ;
18 |
19 | export const WithLimit = () => ;
20 |
--------------------------------------------------------------------------------
/src/components/TokenGroup/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | container: css`
9 | display: flex;
10 | align-items: center;
11 | `,
12 | token: css`
13 | margin-right: ${theme.spacing(1)};
14 | `,
15 | leftoverCount: css`
16 | color: ${theme.palette.text.primary};
17 | `,
18 | };
19 | };
20 |
--------------------------------------------------------------------------------
/src/components/Tooltip/Tooltip.tsx:
--------------------------------------------------------------------------------
1 | import { Global } from '@emotion/react';
2 | import MuiTooltip, { TooltipProps as MUITooltipProps } from '@mui/material/Tooltip';
3 | import React from 'react';
4 |
5 | import { useStyles } from './styles';
6 |
7 | export interface TooltipProps extends MUITooltipProps {
8 | title: string | React.ReactElement;
9 | }
10 |
11 | export const Tooltip = ({ children, placement = 'top', ...rest }: TooltipProps) => {
12 | const styles = useStyles();
13 |
14 | return (
15 | <>
16 |
17 |
18 | {children}
19 |
20 | >
21 | );
22 | };
23 |
--------------------------------------------------------------------------------
/src/components/Tooltip/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import Typography from '@mui/material/Typography';
2 | import { ComponentMeta } from '@storybook/react';
3 | import React from 'react';
4 |
5 | import { withCenterStory } from 'stories/decorators';
6 |
7 | import { Tooltip } from '.';
8 |
9 | export default {
10 | title: 'components/Tooltip',
11 | component: Tooltip,
12 | decorators: [withCenterStory({ width: 200 })],
13 | parameters: {
14 | backgrounds: {
15 | default: 'White',
16 | },
17 | },
18 | } as ComponentMeta;
19 |
20 | export const TooltipDefault = () => (
21 |
22 | Hello from storybook
23 |
24 | );
25 |
--------------------------------------------------------------------------------
/src/components/Tooltip/index.ts:
--------------------------------------------------------------------------------
1 | export * from './Tooltip';
2 |
--------------------------------------------------------------------------------
/src/components/Tooltip/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return css`
7 | .MuiTooltip-popper {
8 | .MuiTooltip-tooltip {
9 | box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
10 | border-radius: ${theme.spacing(3)};
11 | background-color: ${theme.palette.secondary.light};
12 | font-size: ${theme.typography.small2.fontSize};
13 | font-weight: ${theme.typography.small2.fontWeight};
14 | padding: ${theme.spacing(3)};
15 | }
16 | .MuiTooltip-arrow {
17 | color: ${theme.palette.secondary.light};
18 | }
19 | }
20 | `;
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/ValueUpdate/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withCenterStory, withThemeProvider } from 'stories/decorators';
5 |
6 | import { ValueUpdate } from '.';
7 |
8 | export default {
9 | title: 'Components/ValueUpdate',
10 | component: ValueUpdate,
11 | decorators: [withThemeProvider, withCenterStory({ width: 300 })],
12 | } as ComponentMeta;
13 |
14 | export const Increase = () => ;
15 |
16 | export const Decrease = () => ;
17 |
--------------------------------------------------------------------------------
/src/components/ValueUpdate/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = ({ isImprovement }: { isImprovement: boolean }) => {
5 | const theme = useTheme();
6 |
7 | return {
8 | container: css`
9 | display: flex;
10 | align-items: center;
11 | `,
12 | icon: css`
13 | color: ${isImprovement ? theme.palette.interactive.success : theme.palette.interactive.error};
14 | margin: 0 ${theme.spacing(2.5)};
15 | width: ${theme.shape.iconSize.medium}px;
16 | height: ${theme.shape.iconSize.medium}px;
17 | `,
18 | };
19 | };
20 |
--------------------------------------------------------------------------------
/src/components/charts/ApyChart/formatToReadableDate.ts:
--------------------------------------------------------------------------------
1 | import formatDate from 'date-fns/format';
2 |
3 | const READABLE_DATE_FORMAT = 'MM.dd';
4 |
5 | const formatToReadableDate = (timestampMs: number) =>
6 | formatDate(new Date(timestampMs), READABLE_DATE_FORMAT);
7 |
8 | export default formatToReadableDate;
9 |
--------------------------------------------------------------------------------
/src/components/charts/ApyChart/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | import { SPACING } from 'theme/MuiThemeProvider/muiTheme';
5 |
6 | export const useStyles = () => {
7 | const theme = useTheme();
8 |
9 | return {
10 | supplyChartColor: theme.palette.interactive.success,
11 | borrowChartColor: theme.palette.interactive.error,
12 | areaActiveDot: { r: SPACING * 2, strokeWidth: SPACING },
13 | container: css`
14 | width: 100%;
15 | height: ${theme.spacing(62)};
16 | `,
17 | };
18 | };
19 |
--------------------------------------------------------------------------------
/src/constants/address.ts:
--------------------------------------------------------------------------------
1 | export const NULL_ADDRESS = '0x0000000000000000000000000000000000000000';
2 |
--------------------------------------------------------------------------------
/src/constants/allowanceAmountWei.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | // Default allowance set when approving a token to be used from an account
4 | const ALLOWANCE_AMOUNT_WEI = new BigNumber(2).pow(256).minus(1).toFixed();
5 | export default ALLOWANCE_AMOUNT_WEI;
6 |
--------------------------------------------------------------------------------
/src/constants/bsc.ts:
--------------------------------------------------------------------------------
1 | import { BscChainId } from 'types';
2 |
3 | export const BLOCK_TIME_MS = 3000;
4 | // 20 blocks a minute, 60 minutes an hour, 24 hours a day
5 | export const BLOCKS_PER_DAY = (60 / (BLOCK_TIME_MS / 1000)) * 60 * 24;
6 |
7 | export const BSC_SCAN_URLS = {
8 | [BscChainId.MAINNET]: 'https://bscscan.com',
9 | [BscChainId.TESTNET]: 'https://testnet.bscscan.com',
10 | };
11 |
--------------------------------------------------------------------------------
/src/constants/compoundMantissa.ts:
--------------------------------------------------------------------------------
1 | // Specific to the Compound protocol (see https://compound.finance/docs)
2 | export const COMPOUND_MANTISSA = 1e18;
3 |
--------------------------------------------------------------------------------
/src/constants/createProposalThresholdWei.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | const CREATE_PROPOSAL_THRESHOLD_WEI = new BigNumber('300000000000000000000000');
4 |
5 | export default CREATE_PROPOSAL_THRESHOLD_WEI;
6 |
--------------------------------------------------------------------------------
/src/constants/daysPerYear.ts:
--------------------------------------------------------------------------------
1 | export const DAYS_PER_YEAR = 365;
2 |
--------------------------------------------------------------------------------
/src/constants/defaultRefetchInterval.ts:
--------------------------------------------------------------------------------
1 | import { BLOCK_TIME_MS } from './bsc';
2 |
3 | export const DEFAULT_REFETCH_INTERVAL_MS = BLOCK_TIME_MS * 3; // every 3 blocks (9 seconds)
4 |
--------------------------------------------------------------------------------
/src/constants/endpoints.ts:
--------------------------------------------------------------------------------
1 | import { BscChainId } from 'types';
2 |
3 | export const API_ENDPOINT_URLS = {
4 | [BscChainId.MAINNET]: 'https://api.venus.io/api',
5 | [BscChainId.TESTNET]: 'https://testnetapi.venus.io/api',
6 | };
7 |
8 | export const RPC_URLS: {
9 | [key: string]: string[];
10 | } = {
11 | [BscChainId.MAINNET]: [
12 | 'https://bsc-dataseed1.ninicoin.io',
13 | 'https://bsc-dataseed1.defibit.io',
14 | 'https://bsc-dataseed.binance.org',
15 | ],
16 | [BscChainId.TESTNET]: ['https://bsc-testnet.nodereal.io/v1/f9777f42cc9243f0a766937df1c6a5f3'],
17 | };
18 |
--------------------------------------------------------------------------------
/src/constants/indexedVotingSupportNames.ts:
--------------------------------------------------------------------------------
1 | import { VoteSupport } from 'types';
2 |
3 | const indexedVotingSupportNames: VoteSupport[] = ['AGAINST', 'FOR', 'ABSTAIN'];
4 |
5 | export default indexedVotingSupportNames;
6 |
--------------------------------------------------------------------------------
/src/constants/localStorageKeys.ts:
--------------------------------------------------------------------------------
1 | export const LS_KEY_CONNECTED_CONNECTOR = 'connected-connector';
2 | export const LS_KEY_HIDE_HIGHER_RISK_TOKENS_NOTICE = 'hide-risk-tokens-notice';
3 |
--------------------------------------------------------------------------------
/src/constants/maxUint256.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | const MAX_UINT256 = new BigNumber(2).pow(256).minus(1);
4 |
5 | export default MAX_UINT256;
6 |
--------------------------------------------------------------------------------
/src/constants/placeholderKey.ts:
--------------------------------------------------------------------------------
1 | const PLACEHOLDER_KEY = '-';
2 |
3 | export default PLACEHOLDER_KEY;
4 |
--------------------------------------------------------------------------------
/src/constants/safeBorrowLimitPercentage.ts:
--------------------------------------------------------------------------------
1 | export const SAFE_BORROW_LIMIT_PERCENTAGE = 80;
2 |
--------------------------------------------------------------------------------
/src/constants/smartContractPercentageDecimal.ts:
--------------------------------------------------------------------------------
1 | export const SMART_CONTRACT_PERCENTAGE_DECIMALS = 18;
2 |
--------------------------------------------------------------------------------
/src/constants/xvs.ts:
--------------------------------------------------------------------------------
1 | import { getToken } from 'utilities';
2 |
3 | export const XVS_TOKEN_ID = 'xvs';
4 | export const XVS_TOKEN_ADDRESS = getToken(XVS_TOKEN_ID).address;
5 | export const XVS_DECIMAL = getToken(XVS_TOKEN_ID).decimals;
6 |
--------------------------------------------------------------------------------
/src/containers/MarketTable/types.ts:
--------------------------------------------------------------------------------
1 | export type ColumnName =
2 | | 'asset'
3 | | 'supplyApyLtv'
4 | | 'labeledSupplyApyLtv'
5 | | 'borrowApy'
6 | | 'labeledBorrowApy'
7 | | 'pool'
8 | | 'riskLevel'
9 | | 'collateral'
10 | | 'walletBalance'
11 | | 'supplyBalance'
12 | | 'borrowBalance'
13 | | 'treasuryTotalBorrow'
14 | | 'treasuryTotalSupply'
15 | | 'liquidity'
16 | | 'percentOfLimit';
17 |
--------------------------------------------------------------------------------
/src/context/IncludeXvsContext.tsx:
--------------------------------------------------------------------------------
1 | import noop from 'noop-ts';
2 | import React from 'react';
3 |
4 | export interface IncludeXvsContextValue {
5 | includeXvs: boolean;
6 | setIncludeXvs: (updatedValue: boolean) => void;
7 | }
8 |
9 | export const IncludeXvsContext = React.createContext({
10 | includeXvs: true,
11 | setIncludeXvs: noop,
12 | });
13 |
14 | export const IncludeXvsProvider: React.FC = ({ children }) => {
15 | const [includeXvs, setIncludeXvs] = React.useState(true);
16 |
17 | return (
18 |
24 | {children}
25 |
26 | );
27 | };
28 |
--------------------------------------------------------------------------------
/src/errors/index.ts:
--------------------------------------------------------------------------------
1 | export * from './VError';
2 | export * from './transactionErrors';
3 | export * from './formatVErrorToReadableString';
4 |
--------------------------------------------------------------------------------
/src/errors/interactionErrorPhrases.ts:
--------------------------------------------------------------------------------
1 | import { t } from 'translation';
2 |
3 | export const interactionErrorPhrases = {
4 | collateralRequired: t('markets.errors.collateralRequired'),
5 | collateralEnableError: (args: { assetName: string }) =>
6 | t('markets.errors.collateralEnableError', args),
7 | collateralDisableError: (args: { assetName: string }) =>
8 | t('markets.errors.collateralDisableError', args),
9 | accountError: t('markets.errors.accountError'),
10 | createProposalFailed: t('vote.createProposalForm.submitError'),
11 | unsupportedWallet: t('wallets.errors.unsupportedWallet'),
12 | authorizeAccess: t('wallets.errors.authorizeAccess'),
13 | noProvider: t('wallets.errors.noProvider'),
14 | };
15 |
--------------------------------------------------------------------------------
/src/hooks/__mocks__/useClaimVaultReward.ts:
--------------------------------------------------------------------------------
1 | const claimReward = jest.fn();
2 | const isLoading = false;
3 |
4 | export default () => ({
5 | claimReward,
6 | isLoading,
7 | });
8 |
--------------------------------------------------------------------------------
/src/hooks/__mocks__/useStakeInVault.ts:
--------------------------------------------------------------------------------
1 | const stake = jest.fn();
2 | const isLoading = false;
3 |
4 | export default () => ({
5 | stake,
6 | isLoading,
7 | });
8 |
--------------------------------------------------------------------------------
/src/hooks/__mocks__/useSuccessfulTransactionModal.ts:
--------------------------------------------------------------------------------
1 | const openSuccessfulTransactionModal = jest.fn();
2 | const closeSuccessfulTransactionModal = jest.fn();
3 |
4 | export default () => ({
5 | openSuccessfulTransactionModal,
6 | closeSuccessfulTransactionModal,
7 | });
8 |
--------------------------------------------------------------------------------
/src/hooks/useBorrowRepayModal/Modal/Borrow/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | tokenTextField: 'borrow-modal-token-text-field',
3 | };
4 |
5 | export default TEST_IDS;
6 |
--------------------------------------------------------------------------------
/src/hooks/useBorrowRepayModal/Modal/Repay/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | selectButtonsContainer: css`
9 | display: flex;
10 | flex-direction: row;
11 | `,
12 | selectButton: css`
13 | flex: 1;
14 | border-radius: ${theme.spacing(13)};
15 | padding-left: ${theme.spacing(2)};
16 | padding-right: ${theme.spacing(2)};
17 |
18 | &:not(:last-child) {
19 | margin-right: ${theme.spacing(4)};
20 | }
21 | `,
22 | };
23 | };
24 |
--------------------------------------------------------------------------------
/src/hooks/useBorrowRepayModal/Modal/Repay/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | tokenTextField: 'borrow-modal-token-text-field',
3 | };
4 |
5 | export default TEST_IDS;
6 |
--------------------------------------------------------------------------------
/src/hooks/useCollateral/CollateralConfirmModal/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 |
3 | export const useStyles = () => ({
4 | collateralCell: css`
5 | display: flex;
6 | justify-content: flex-end;
7 | padding-right: 24px;
8 | `,
9 | loadingIcon: css`
10 | height: 68px;
11 | width: 68px;
12 | `,
13 | collateralModalContainer: css`
14 | display: flex;
15 | flex-direction: column;
16 | justify-content: space-between;
17 | align-items: center;
18 | `,
19 | });
20 |
--------------------------------------------------------------------------------
/src/hooks/useCopyToClipboard.ts:
--------------------------------------------------------------------------------
1 | import copyToClipboard from 'copy-to-clipboard';
2 | import { useTranslation } from 'translation';
3 |
4 | import { toast } from 'components/Toast';
5 |
6 | const useCopyToClipboard = (name: string) => {
7 | const { t } = useTranslation();
8 | return (str: string) => {
9 | copyToClipboard(str);
10 | toast.success({
11 | message: t('interactive.copyToClipboard', { name }),
12 | });
13 | };
14 | };
15 |
16 | export default useCopyToClipboard;
17 |
--------------------------------------------------------------------------------
/src/hooks/useIsMounted.ts:
--------------------------------------------------------------------------------
1 | import { useCallback, useEffect, useRef } from 'react';
2 |
3 | const useIsMounted = () => {
4 | const isMountedRef = useRef(false);
5 |
6 | useEffect(() => {
7 | isMountedRef.current = true;
8 |
9 | return () => {
10 | isMountedRef.current = false;
11 | };
12 | }, []);
13 |
14 | return useCallback(() => isMountedRef.current, []);
15 | };
16 |
17 | export default useIsMounted;
18 |
--------------------------------------------------------------------------------
/src/hooks/useSuccessfulTransactionModal.ts:
--------------------------------------------------------------------------------
1 | import { useContext } from 'react';
2 |
3 | import { SuccessfulTransactionModalContext } from 'context/SuccessfulTransactionModalContext';
4 |
5 | export type { OpenSuccessfulTransactionModalInput } from 'context/SuccessfulTransactionModalContext';
6 |
7 | const useSuccessfulTransactionModal = () => useContext(SuccessfulTransactionModalContext);
8 | export default useSuccessfulTransactionModal;
9 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 | import React from 'react';
3 | import ReactDOM from 'react-dom';
4 |
5 | import 'assets/styles/index.scss';
6 | import App from 'pages/App';
7 |
8 | // Initialize BigNumber format
9 | BigNumber.config({
10 | FORMAT: {
11 | decimalSeparator: '.',
12 | groupSize: 3,
13 | groupSeparator: ',',
14 | },
15 | });
16 |
17 | ReactDOM.render(, document.getElementById('root'));
18 |
--------------------------------------------------------------------------------
/src/pages/Account/PoolBreakdown/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { poolData } from '__mocks__/models/pools';
5 | import { withCenterStory } from 'stories/decorators';
6 | import { PALETTE } from 'theme/MuiThemeProvider/muiTheme';
7 |
8 | import PoolBreakdown from '.';
9 |
10 | export default {
11 | title: 'Pages/Account/PoolBreakdown',
12 | component: PoolBreakdown,
13 | decorators: [withCenterStory({ width: 1200 })],
14 | parameters: {
15 | backgrounds: {
16 | default: PALETTE.background.default,
17 | },
18 | },
19 | } as ComponentMeta;
20 |
21 | export const Default = () => ;
22 |
--------------------------------------------------------------------------------
/src/pages/Account/PoolBreakdown/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | stats: 'account-market-breakdown-stats',
3 | tables: 'account-market-breakdown-tables',
4 | };
5 |
6 | export default TEST_IDS;
7 |
--------------------------------------------------------------------------------
/src/pages/Account/__snapshots__/index.spec.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`pages/Account displays stats correctly 1`] = `"Net APY13.4%Daily Earnings$1,000.00Total Supply$1,000,000.00Total Borrow$100,000.00"`;
4 |
--------------------------------------------------------------------------------
/src/pages/Account/index.spec.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import renderComponent from 'testUtils/renderComponent';
4 |
5 | import Account from '.';
6 | import TEST_IDS from './testIds';
7 |
8 | jest.mock('clients/api');
9 |
10 | describe('pages/Account', () => {
11 | // TODO: mock relevant requests once wired up
12 |
13 | it('renders without crashing', () => {
14 | renderComponent();
15 | });
16 |
17 | it('displays stats correctly', () => {
18 | const { getByTestId } = renderComponent();
19 |
20 | expect(getByTestId(TEST_IDS.stats).textContent).toMatchSnapshot();
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/src/pages/Account/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 |
3 | import { withRouter } from 'stories/decorators';
4 |
5 | import Account from '.';
6 |
7 | export default {
8 | title: 'Pages/Account',
9 | component: Account,
10 | decorators: [withRouter],
11 | } as ComponentMeta;
12 |
13 | export { Account };
14 |
--------------------------------------------------------------------------------
/src/pages/Account/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | stats: 'account-stats',
3 | };
4 |
5 | export default TEST_IDS;
6 |
--------------------------------------------------------------------------------
/src/pages/ConvertVrt/Convert/testIds.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | vrtTokenTextField: 'convert-vrt-vrt-token-text-field',
3 | xvsTokenTextField: 'convert-vrt-xvs-token-text-field',
4 | };
5 |
--------------------------------------------------------------------------------
/src/pages/ConvertVrt/constants.ts:
--------------------------------------------------------------------------------
1 | import { getToken } from 'utilities';
2 |
3 | export const VRT_ID = 'vrt';
4 | export const VRT_DECIMAL = getToken(VRT_ID).decimals;
5 |
--------------------------------------------------------------------------------
/src/pages/Dashboard/ConnectWalletBanner/illustration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/multijump/venus-protocol-interface/3c5e9fa0ea772e79a05665018ec1d6d9fc70d878/src/pages/Dashboard/ConnectWalletBanner/illustration.png
--------------------------------------------------------------------------------
/src/pages/Dashboard/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 |
3 | import { withRouter } from 'stories/decorators';
4 |
5 | import Dashboard from '.';
6 |
7 | export default {
8 | title: 'Pages/Dashboard',
9 | component: Dashboard,
10 | decorators: [withRouter],
11 | } as ComponentMeta;
12 |
13 | export { Dashboard };
14 |
--------------------------------------------------------------------------------
/src/pages/History/Filters/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import noop from 'lodash';
3 | import React from 'react';
4 |
5 | import Filters, { ALL_VALUE } from '.';
6 |
7 | export default {
8 | title: 'Pages/Filters',
9 | component: Filters,
10 | parameters: {
11 | backgrounds: {
12 | default: 'White',
13 | },
14 | },
15 | } as ComponentMeta;
16 |
17 | export const Default = () => (
18 |
25 | );
26 |
--------------------------------------------------------------------------------
/src/pages/History/HistoryTable/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import transactions from '__mocks__/models/transactions';
5 |
6 | import { HistoryTableUi } from '.';
7 |
8 | export default {
9 | title: 'Pages/History/Table',
10 | component: HistoryTableUi,
11 | parameters: {
12 | backgrounds: {
13 | default: 'White',
14 | },
15 | },
16 | } as ComponentMeta;
17 |
18 | export const Default = () => ;
19 |
--------------------------------------------------------------------------------
/src/pages/Market/MarketInfo/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | itemList: css`
9 | margin: 0;
10 | padding: 0;
11 | `,
12 | item: css`
13 | list-style: none;
14 | padding: ${theme.spacing(3, 0)};
15 |
16 | :not(:last-of-type) {
17 | border-bottom: 1px solid ${theme.palette.secondary.light};
18 | }
19 | `,
20 | value: css`
21 | font-weight: ${theme.typography.body2.fontWeight};
22 | `,
23 | };
24 | };
25 |
--------------------------------------------------------------------------------
/src/pages/Market/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | supplyInfo: 'market-details-supply-info',
3 | borrowInfo: 'market-details-borrow-info',
4 | interestRateModel: 'market-details-interest-rate-model',
5 | marketInfo: 'market-details-market-info',
6 | };
7 |
8 | export default TEST_IDS;
9 |
--------------------------------------------------------------------------------
/src/pages/Market/types.ts:
--------------------------------------------------------------------------------
1 | export interface Stat {
2 | label: string;
3 | value: string | number;
4 | }
5 |
--------------------------------------------------------------------------------
/src/pages/Pool/Table/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | mobileSelect: css`
9 | width: ${theme.spacing(56)};
10 | margin-bottom: ${theme.spacing(4)};
11 | `,
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/src/pages/Pool/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { poolData } from '__mocks__/models/pools';
5 | import { withRouter } from 'stories/decorators';
6 |
7 | import { PoolUi } from '.';
8 |
9 | export default {
10 | title: 'Pages/Pool',
11 | component: PoolUi,
12 | decorators: [withRouter],
13 | } as ComponentMeta;
14 |
15 | export const Default = () => ;
16 |
--------------------------------------------------------------------------------
/src/pages/Pools/Header/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | cellGroup: css`
9 | margin-bottom: ${theme.spacing(8)};
10 |
11 | ${theme.breakpoints.down('xxl')} {
12 | margin-bottom: ${theme.spacing(6)};
13 | }
14 | `,
15 | };
16 | };
17 |
--------------------------------------------------------------------------------
/src/pages/Pools/index.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxImportSource @emotion/react */
2 | import React from 'react';
3 |
4 | import Header from './Header';
5 | import PoolTable from './PoolTable';
6 |
7 | const PoolsUi: React.FC = () => (
8 |
12 | );
13 |
14 | const Pools: React.FC = () => ;
15 |
16 | export default Pools;
17 |
--------------------------------------------------------------------------------
/src/pages/Proposal/ProposalSummary/testIds.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | executeButton: 'proposal-proposal-summary-execute-button',
3 | queueButton: 'proposal-proposal-summary-queue-button',
4 | cancelButton: 'proposal-proposal-summary-cancel-button',
5 | };
6 |
--------------------------------------------------------------------------------
/src/pages/Proposal/VoteModal/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return {
7 | root: css`
8 | > div:first-of-type {
9 | margin-bottom: ${theme.spacing(8)};
10 | }
11 | `,
12 | votingPower: css`
13 | margin-bottom: ${theme.spacing(8)};
14 | `,
15 | comment: css`
16 | margin-bottom: ${theme.spacing(8)};
17 | `,
18 | };
19 | };
20 |
--------------------------------------------------------------------------------
/src/pages/Proposal/VoteModal/testIds.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | submitButton: 'proposal-vote-modal-submit-button',
3 | };
4 |
--------------------------------------------------------------------------------
/src/pages/Proposal/testIds.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | voteSummary: {
3 | for: 'proposal-vote-summary-for',
4 | against: 'proposal-vote-summary-against',
5 | abstain: 'proposal-vote-summary-abstain',
6 | },
7 | };
8 |
--------------------------------------------------------------------------------
/src/pages/Vai/MintVai/getReadableFeeVai.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 | import { convertWeiToTokens } from 'utilities';
3 |
4 | import { VAI_ID } from '../constants';
5 |
6 | const getReadableFeeVai = ({
7 | valueWei,
8 | mintFeePercentage,
9 | }: {
10 | valueWei: BigNumber;
11 | mintFeePercentage: number;
12 | }) => {
13 | const feeWei = valueWei.multipliedBy(mintFeePercentage).dividedBy(100);
14 | return convertWeiToTokens({
15 | valueWei: feeWei,
16 | tokenId: VAI_ID,
17 | returnInReadableFormat: true,
18 | });
19 | };
20 |
21 | export default getReadableFeeVai;
22 |
--------------------------------------------------------------------------------
/src/pages/Vai/constants.ts:
--------------------------------------------------------------------------------
1 | export const VAI_ID = 'vai';
2 |
--------------------------------------------------------------------------------
/src/pages/Vault/TransactionForm/__snapshots__/index.spec.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`pages/Vault/TransactionForm displays available tokens and locking period correctly 1`] = `"Available XVS100,000 XVS"`;
4 |
5 | exports[`pages/Vault/TransactionForm displays available tokens and locking period correctly 2`] = `"Locking period3 days"`;
6 |
--------------------------------------------------------------------------------
/src/pages/Vault/TransactionForm/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | tokenTextField: css`
9 | margin-bottom: ${theme.spacing(8)};
10 |
11 | ${theme.breakpoints.down('md')} {
12 | margin-bottom: ${theme.spacing(7)};
13 | }
14 | `,
15 | getRow: ({ isLast }: { isLast: boolean }) => css`
16 | margin-bottom: ${theme.spacing(isLast ? 12 : 3)};
17 |
18 | ${theme.breakpoints.down('md')} {
19 | margin-bottom: ${theme.spacing(8)};
20 | }
21 | `,
22 | };
23 | };
24 |
--------------------------------------------------------------------------------
/src/pages/Vault/TransactionForm/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | tokenTextField: 'vault-transaction-form-token-text-field',
3 | availableTokens: 'vault-transaction-form-available-tokens',
4 | lockingPeriod: 'vault-transaction-form-locking-period',
5 | };
6 |
7 | export default TEST_IDS;
8 |
--------------------------------------------------------------------------------
/src/pages/Vault/VaultItem/__snapshots__/index.spec.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`pages/Vault/VaultItem renders vault correctly 1`] = `"VAI"`;
4 |
5 | exports[`pages/Vault/VaultItem renders vault correctly 2`] = `"100"`;
6 |
7 | exports[`pages/Vault/VaultItem renders vault correctly 3`] = `"200"`;
8 |
9 | exports[`pages/Vault/VaultItem renders vault correctly 4`] = `"12665.06%"`;
10 |
11 | exports[`pages/Vault/VaultItem renders vault correctly 5`] = `"144"`;
12 |
13 | exports[`pages/Vault/VaultItem renders vault correctly 6`] = `"415.00"`;
14 |
--------------------------------------------------------------------------------
/src/pages/Vault/VaultItem/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | symbol: 'vault-vault-item-symbol',
3 | userPendingRewardTokens: 'vault-vault-item-user-pending-reward-tokens',
4 | userStakedTokens: 'vault-vault-item-user-staked-tokens',
5 | dataListItem: 'vault-vault-item-data-list-item',
6 | withdrawFromVestingVaultModal: {
7 | withdrawalRequestListItem:
8 | 'vault-vault-item-withdraw-from-vesting-vault-modal-withdrawal-request-list-item',
9 | availableTokens: 'vault-vault-item-withdraw-from-vesting-vault-modal-available-tokens',
10 | },
11 | };
12 |
13 | export default TEST_IDS;
14 |
--------------------------------------------------------------------------------
/src/pages/Vault/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { vaults } from '__mocks__/models/vaults';
5 | import { withRouter } from 'stories/decorators';
6 |
7 | import { VaultUi } from '.';
8 |
9 | export default {
10 | title: 'Pages/Vault',
11 | component: VaultUi,
12 | decorators: [withRouter],
13 | } as ComponentMeta;
14 |
15 | export const Loading = () => ;
16 |
17 | export const Default = () => ;
18 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/StakeModal/__snapshots__/index.spec.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`pages/Vault/modals/StakeModal fetches and displays the user balance correctly 1`] = `"Available VAI100,000 VAI"`;
4 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVaiVaultModal/__snapshots__/index.spec.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`pages/Vault/modals/WithdrawFromVaiVaultModal fetches and displays the user balance correctly 1`] = `"Available VAI100,000 VAI"`;
4 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVestingVaultModal/RequestWithdrawal/__snapshots__/index.spec.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`pages/Vault/modals/WithdrawFromVestingVaultModal/RequestWithdrawal fetches staked tokens and locking period and displays them correctly 1`] = `"Requestable VAI24 VAI"`;
4 |
5 | exports[`pages/Vault/modals/WithdrawFromVestingVaultModal/RequestWithdrawal fetches staked tokens and locking period and displays them correctly 2`] = `"Locking period3 minutes"`;
6 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVestingVaultModal/RequestWithdrawal/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | displayWithdrawalRequestListButton: css`
9 | margin: ${theme.spacing(3, 'auto', -3)};
10 | `,
11 | };
12 | };
13 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVestingVaultModal/Withdraw/__snapshots__/index.spec.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`pages/Vault/modals/WithdrawFromVestingVaultModal/Withdraw fetches available tokens amount and displays it correctly 1`] = `"Available VAI3 VAI"`;
4 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVestingVaultModal/Withdraw/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | content: css`
9 | margin-bottom: ${theme.spacing(12)};
10 | `,
11 | };
12 | };
13 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVestingVaultModal/Withdraw/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | availableTokens: 'vault-vault-item-withdraw-from-vesting-vault-modal-available-tokens',
3 | };
4 |
5 | export default TEST_IDS;
6 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVestingVaultModal/WithdrawalRequestList/__snapshots__/index.spec.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`pages/Vault/modals/WithdrawFromVestingVaultModal/WithdrawalRequestList fetches withdrawal requests and displays them correctly 1`] = `"1 XVSLocked until 29.06.22 10:43 AM"`;
4 |
5 | exports[`pages/Vault/modals/WithdrawFromVestingVaultModal/WithdrawalRequestList fetches withdrawal requests and displays them correctly 2`] = `"2 XVSLocked until 30.06.22 2:30 PM"`;
6 |
7 | exports[`pages/Vault/modals/WithdrawFromVestingVaultModal/WithdrawalRequestList fetches withdrawal requests and displays them correctly 3`] = `"3 XVSLocked until 01.07.22 6:16 PM"`;
8 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVestingVaultModal/WithdrawalRequestList/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | listItem: css`
9 | :not(:last-of-type) {
10 | margin-bottom: ${theme.spacing(4)};
11 | }
12 | `,
13 | };
14 | };
15 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVestingVaultModal/WithdrawalRequestList/testIds.ts:
--------------------------------------------------------------------------------
1 | const TEST_IDS = {
2 | withdrawalRequestListItem:
3 | 'vault-vault-item-withdraw-from-vesting-vault-modal-withdrawal-request-list-item',
4 | };
5 |
6 | export default TEST_IDS;
7 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/WithdrawFromVestingVaultModal/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | tabContainer: css`
9 | margin-top: ${theme.spacing(10)};
10 |
11 | ${theme.breakpoints.down('md')} {
12 | margin-top: ${theme.spacing(8)};
13 | }
14 | `,
15 | };
16 | };
17 |
--------------------------------------------------------------------------------
/src/pages/Vault/modals/index.ts:
--------------------------------------------------------------------------------
1 | export { default as StakeModal } from './StakeModal';
2 | export { default as WithdrawFromVaiVaultModal } from './WithdrawFromVaiVaultModal';
3 | export { default as WithdrawFromVestingVaultModal } from './WithdrawFromVestingVaultModal';
4 |
--------------------------------------------------------------------------------
/src/pages/Vault/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | container: css`
9 | display: grid;
10 | grid-template-columns: 1fr 1fr;
11 | row-gap: ${theme.spacing(8)};
12 | column-gap: ${theme.spacing(8)};
13 |
14 | ${theme.breakpoints.down('xl')} {
15 | grid-template-columns: 1fr;
16 | }
17 | `,
18 | };
19 | };
20 |
--------------------------------------------------------------------------------
/src/pages/Vote/CreateProposalModal/encodeCallData.ts:
--------------------------------------------------------------------------------
1 | import { encodeParameters, parseFunctionSignature } from 'utilities';
2 |
3 | import formatIfArray from './formatIfArray';
4 |
5 | const encodeCallData = (signature: string, callData: (string | undefined)[]) => {
6 | const processedCallData = callData.reduce((acc, curr) => {
7 | if (curr !== undefined) {
8 | acc.push(formatIfArray(curr));
9 | }
10 | return acc;
11 | }, [] as (string | number | string[])[]);
12 | const callDataTypes = parseFunctionSignature(signature)?.inputs.map(input => input.type);
13 | return encodeParameters(callDataTypes || [], processedCallData);
14 | };
15 |
16 | export default encodeCallData;
17 |
--------------------------------------------------------------------------------
/src/pages/Vote/CreateProposalModal/formatIfArray.ts:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @param value string
4 | * Check if the string starts and ends with brackets to format array
5 | */
6 | export const formatIfArray = (value: string | number): string | number | string[] => {
7 | const val = value.toString();
8 | if (val?.slice(0, 1) === '[' && val.slice(val.length - 1, val.length) === ']') {
9 | try {
10 | return JSON.parse(val);
11 | } catch (err) {
12 | return value;
13 | }
14 | }
15 | return value;
16 | };
17 |
18 | export default formatIfArray;
19 |
--------------------------------------------------------------------------------
/src/pages/Vote/CreateProposalModal/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import noop from 'noop-ts';
3 | import React from 'react';
4 |
5 | import CreateProposalModal from '.';
6 |
7 | export default {
8 | title: 'Pages/Proposal/CreateProposalModal',
9 | component: CreateProposalModal,
10 | } as ComponentMeta;
11 |
12 | export const Default = () => (
13 |
19 | );
20 |
--------------------------------------------------------------------------------
/src/pages/Vote/CreateProposalModal/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return {
7 | modal: css`
8 | > div:first-of-type {
9 | margin-bottom: ${theme.spacing(8)};
10 | }
11 | `,
12 | formBottomMargin: css`
13 | margin-bottom: ${theme.spacing(6)};
14 | `,
15 | sectionSpacing: css`
16 | margin-bottom: ${theme.spacing(10)};
17 | `,
18 | };
19 | };
20 |
--------------------------------------------------------------------------------
/src/pages/Vote/DelegateModal/addressValidationSchema.ts:
--------------------------------------------------------------------------------
1 | import web3 from 'web3';
2 | import * as yup from 'yup';
3 |
4 | export type FormValues = yup.InferType;
5 |
6 | export enum ErrorCode {
7 | NOT_VALID = 'NOT_VALID', // value must be a valid address
8 | }
9 |
10 | const addressValidationSchema = yup.object({
11 | address: yup
12 | .string()
13 | .required()
14 | .test('isAddress', ErrorCode.NOT_VALID, value => web3.utils.isAddress(value as string)),
15 | });
16 |
17 | export default addressValidationSchema;
18 |
--------------------------------------------------------------------------------
/src/pages/Vote/GovernanceProposal/testIds.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | governanceProposal: (id: string) => `vote-governance-governance-proposal-${id}`,
3 | };
4 |
--------------------------------------------------------------------------------
/src/pages/Vote/VotingWallet/testIds.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | votingWeightValue: 'vote-voting-wallet-voting-weight-value',
3 | totalLockedValue: 'vote-voting-wallet-total-locked-value',
4 | delegateYourVoting: 'vote-voting-wallet-delegate-your-voting',
5 | depositYourTokens: 'vote-voting-wallet-deposit-your-tokens',
6 | };
7 |
--------------------------------------------------------------------------------
/src/pages/Vote/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withRouter } from 'stories/decorators';
5 |
6 | import Vote from '.';
7 |
8 | export default {
9 | title: 'Pages/Vote',
10 | component: Vote,
11 | decorators: [withRouter],
12 | } as ComponentMeta;
13 |
14 | export const Default = () => ;
15 |
--------------------------------------------------------------------------------
/src/pages/Vote/index.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxImportSource @emotion/react */
2 | import React from 'react';
3 |
4 | import Governance from './Governance';
5 | import VotingWallet from './VotingWallet';
6 | import { useStyles } from './styles';
7 |
8 | export const Vote: React.FC = () => {
9 | const styles = useStyles();
10 | return (
11 |
12 |
13 |
14 |
15 | );
16 | };
17 |
18 | export default Vote;
19 |
--------------------------------------------------------------------------------
/src/pages/Vote/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 | return {
7 | root: css`
8 | display: flex;
9 | flex-direction: row;
10 | ${theme.breakpoints.down('lg')} {
11 | flex-direction: column-reverse;
12 | }
13 | `,
14 | };
15 | };
16 |
--------------------------------------------------------------------------------
/src/pages/VoterDetails/History/VoterProposal/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 | import { useTheme } from '@mui/material';
3 |
4 | export const useStyles = () => {
5 | const theme = useTheme();
6 |
7 | return {
8 | root: css`
9 | margin-top: ${theme.spacing(6)};
10 | `,
11 | };
12 | };
13 |
--------------------------------------------------------------------------------
/src/pages/VoterDetails/History/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 |
3 | export const useStyles = () => ({
4 | pagination: css`
5 | justify-content: flex-start;
6 | `,
7 | });
8 |
--------------------------------------------------------------------------------
/src/pages/VoterDetails/index.spec.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import renderComponent from 'testUtils/renderComponent';
4 |
5 | import VoterDetail from '.';
6 |
7 | describe('pages/VoterDetail', () => {
8 | beforeAll(() => {
9 | jest.mock('clients/api');
10 | });
11 |
12 | it('renders without crashing', async () => {
13 | renderComponent();
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/src/pages/VoterLeaderboard/LeaderboardTable/index.spec.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import voterAccounts from '__mocks__/models/voterAccounts';
4 | import renderComponent from 'testUtils/renderComponent';
5 |
6 | import Table from '.';
7 |
8 | describe('pages/VoterLeaderboard/Table', () => {
9 | beforeAll(() => {
10 | jest.mock('clients/api');
11 | });
12 |
13 | it('renders without crashing', async () => {
14 | renderComponent(
15 | ,
20 | );
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/src/pages/VoterLeaderboard/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta, Story } from '@storybook/react';
2 | import React from 'react';
3 |
4 | import { withRouter } from 'stories/decorators';
5 |
6 | import VoterLeaderboard from '.';
7 |
8 | export default {
9 | title: 'Pages/VoterLeaderboard',
10 | component: VoterLeaderboard,
11 | decorators: [withRouter],
12 | parameters: {
13 | backgrounds: {
14 | default: 'White',
15 | },
16 | },
17 | } as ComponentMeta;
18 |
19 | const Template: Story = args => ;
20 |
21 | export const Page = Template.bind({});
22 |
--------------------------------------------------------------------------------
/src/pages/VoterLeaderboard/styles.ts:
--------------------------------------------------------------------------------
1 | import { css } from '@emotion/react';
2 |
3 | export const useStyles = () => ({
4 | root: css`
5 | display: flex;
6 | flex-direction: column;
7 | `,
8 | });
9 |
--------------------------------------------------------------------------------
/src/pages/Xvs/constants.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 | import { getToken } from 'utilities';
3 |
4 | export const XVS_DECIMALS = getToken('xvs').decimals;
5 | export const MINTED_XVS = '23700000';
6 | export const MINTED_XVS_WEI = new BigNumber(MINTED_XVS).times(new BigNumber(10).pow(XVS_DECIMALS));
7 |
--------------------------------------------------------------------------------
/src/pages/Xvs/index.stories.tsx:
--------------------------------------------------------------------------------
1 | import { ComponentMeta } from '@storybook/react';
2 |
3 | import { withRouter } from 'stories/decorators';
4 |
5 | import Xvs from '.';
6 |
7 | export default {
8 | title: 'Pages/Xvs',
9 | component: Xvs,
10 | decorators: [withRouter],
11 | } as ComponentMeta;
12 |
13 | export { Xvs };
14 |
--------------------------------------------------------------------------------
/src/pages/Xvs/index.tsx:
--------------------------------------------------------------------------------
1 | /** @jsxImportSource @emotion/react */
2 | import React from 'react';
3 |
4 | import Header from './Header';
5 | import Table from './Table';
6 | import { useStyles } from './styles';
7 |
8 | const Xvs: React.FC = () => {
9 | const styles = useStyles();
10 |
11 | return (
12 |
16 | );
17 | };
18 |
19 | export default Xvs;
20 |
--------------------------------------------------------------------------------
/src/react-app-env.d.ts:
--------------------------------------------------------------------------------
1 | // /
2 |
3 | interface Window {
4 | ethereum?: Record;
5 | BinanceChain?: unknown;
6 | }
7 |
--------------------------------------------------------------------------------
/src/setupTests.ts:
--------------------------------------------------------------------------------
1 | // react-testing-library renders your components to document.body,
2 | // this adds jest-dom's custom assertions
3 | import '@testing-library/jest-dom';
4 | import 'jest-canvas-mock';
5 |
--------------------------------------------------------------------------------
/src/theme/MuiThemeProvider/index.tsx:
--------------------------------------------------------------------------------
1 | import { CssBaseline } from '@mui/material';
2 | import { ThemeProvider } from '@mui/material/styles';
3 | import React, { ReactNode } from 'react';
4 |
5 | import 'assets/styles/normalize.scss';
6 |
7 | import mainTheme from './muiTheme';
8 |
9 | export function MuiThemeProvider({ children }: { children: ReactNode }) {
10 | return (
11 |
12 |
13 | {children}
14 |
15 | );
16 | }
17 |
--------------------------------------------------------------------------------
/src/types/declarations.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.png' {
2 | /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
3 | const value: any;
4 | export default value;
5 | }
6 |
7 | declare module '*.svg' {
8 | import React = require('react');
9 |
10 | export const ReactComponent: React.FC>;
11 | const src: string;
12 | export default src;
13 | }
14 |
15 | declare module '*.jpg' {
16 | /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
17 | const value: any;
18 | export default value;
19 | }
20 |
21 | declare module '*.scss' {
22 | const content: Record;
23 | export default content;
24 | }
25 |
26 | declare module 'emotion-theming';
27 |
--------------------------------------------------------------------------------
/src/types/tsfixme.d.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2 | type $TSFixMe = any;
3 | /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
4 | type $TsFixMeFunction = (...args: any[]) => any;
5 |
--------------------------------------------------------------------------------
/src/utilities/__mocks__/restService.ts:
--------------------------------------------------------------------------------
1 | export const restService = jest.fn();
2 |
--------------------------------------------------------------------------------
/src/utilities/calculateCollateralValue.spec.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { assetData } from '__mocks__/models/asset';
4 |
5 | import calculateCollateralValue from './calculateCollateralValue';
6 |
7 | describe('utilities/calculateCollateralValue', () => {
8 | test('calculate collateral value for a given amount of an asset', () => {
9 | const collateralValue = calculateCollateralValue({
10 | amountWei: new BigNumber('100000000000000000'),
11 | tokenId: assetData[0].id,
12 | tokenPriceTokens: assetData[0].tokenPrice,
13 | collateralFactor: assetData[0].collateralFactor,
14 | });
15 | expect(collateralValue.toString()).toBe('0.06393367');
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/src/utilities/calculateCollateralValue.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 | import { Asset } from 'types';
3 | import { convertWeiToTokens } from 'utilities';
4 |
5 | const calculateCollateralValue = ({
6 | tokenId,
7 | tokenPriceTokens,
8 | collateralFactor,
9 | amountWei,
10 | }: {
11 | tokenId: Asset['id'];
12 | tokenPriceTokens: Asset['tokenPrice'];
13 | collateralFactor: Asset['collateralFactor'];
14 | amountWei: BigNumber;
15 | }) => {
16 | const collateralValue = convertWeiToTokens({ valueWei: amountWei, tokenId })
17 | .times(tokenPriceTokens)
18 | .times(collateralFactor);
19 | return collateralValue;
20 | };
21 |
22 | export default calculateCollateralValue;
23 |
--------------------------------------------------------------------------------
/src/utilities/calculateDailyEarningsCents.spec.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import calculateDailyEarningsCents from './calculateDailyEarningsCents';
4 |
5 | describe('utilities/calculateDailyEarningsCentss', () => {
6 | test('calculates daily Earnings for a single asset', () => {
7 | expect(calculateDailyEarningsCents(new BigNumber('1924.21991227022443813375')).toString()).toBe(
8 | '5.27183537608280667982',
9 | );
10 | });
11 | });
12 |
--------------------------------------------------------------------------------
/src/utilities/calculateDailyEarningsCents.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | const calculateDailyEarningsCents = (yearlyEarningsCents: BigNumber) =>
4 | yearlyEarningsCents.dividedBy(365);
5 |
6 | export default calculateDailyEarningsCents;
7 |
--------------------------------------------------------------------------------
/src/utilities/calculateNetApy.spec.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import calculateNetApy from './calculateNetApy';
4 |
5 | describe('utilities/calculateNetApy', () => {
6 | test('calculates apy from balance and yearly earnings', () => {
7 | const apy = calculateNetApy({
8 | yearlyEarningsCents: new BigNumber('1924.21991227022443813375'),
9 | supplyBalanceCents: new BigNumber('21507.4246'),
10 | });
11 | expect(apy).toBe(8.95);
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/src/utilities/calculatePercentage.ts:
--------------------------------------------------------------------------------
1 | export interface CalculatePercentageInput {
2 | numerator: number;
3 | denominator: number;
4 | }
5 |
6 | const calculatePercentage = ({ numerator, denominator }: CalculatePercentageInput) => {
7 | if (denominator === 0) {
8 | return 0;
9 | }
10 |
11 | return (numerator * 100) / denominator;
12 | };
13 |
14 | export default calculatePercentage;
15 |
--------------------------------------------------------------------------------
/src/utilities/convertPercentageFromSmartContract.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | import { SMART_CONTRACT_PERCENTAGE_DECIMALS } from 'constants/smartContractPercentageDecimal';
4 |
5 | const convertPercentageFromSmartContract = (percentageFromSmartContract: string | BigNumber) =>
6 | new BigNumber(percentageFromSmartContract)
7 | .dividedBy(new BigNumber(10).pow(SMART_CONTRACT_PERCENTAGE_DECIMALS))
8 | // Convert to percentage
9 | .multipliedBy(100)
10 | .toNumber();
11 |
12 | export default convertPercentageFromSmartContract;
13 |
--------------------------------------------------------------------------------
/src/utilities/convertTokensToWei.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 | import { TokenId } from 'types';
3 | import { getToken } from 'utilities';
4 |
5 | export const convertTokensToWei = ({ value, tokenId }: { value: BigNumber; tokenId: TokenId }) => {
6 | const tokenDecimals = getToken(tokenId).decimals;
7 | return value.multipliedBy(new BigNumber(10).pow(tokenDecimals));
8 | };
9 |
10 | export default convertTokensToWei;
11 |
--------------------------------------------------------------------------------
/src/utilities/encodeParameters.ts:
--------------------------------------------------------------------------------
1 | import { ethers } from 'ethers';
2 |
3 | /**
4 | *
5 | * @param types - Array of solidity type
6 | * @param values - Array of values associated with types by order
7 | * @returns - encoded values for sending as part of a contract call
8 | */
9 | const encodeParameters = (types: string[], values: (string | number | string[])[]) => {
10 | const abi = new ethers.utils.AbiCoder();
11 | // values type on abi.encode is any
12 | return abi.encode(types, values as any);
13 | };
14 |
15 | export default encodeParameters;
16 |
--------------------------------------------------------------------------------
/src/utilities/featureFlags.ts:
--------------------------------------------------------------------------------
1 | import { TokenId } from 'types';
2 |
3 | export const DISABLED_TOKENS = ['luna', 'ust'];
4 |
5 | export const isAssetEnabled = (assetId: TokenId) => !DISABLED_TOKENS.includes(assetId);
6 |
--------------------------------------------------------------------------------
/src/utilities/formatPercentage.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | const formatPercentage = (value: string | number | BigNumber) => {
4 | const valueBn = new BigNumber(value);
5 |
6 | if (valueBn.absoluteValue().isGreaterThanOrEqualTo(100000000)) {
7 | return +valueBn.toExponential(2);
8 | }
9 |
10 | return +valueBn.dp(2).toFixed();
11 | };
12 |
13 | export default formatPercentage;
14 |
--------------------------------------------------------------------------------
/src/utilities/formatToReadablePercentage.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 | import { formatPercentage } from 'utilities';
3 |
4 | import PLACEHOLDER_KEY from 'constants/placeholderKey';
5 |
6 | const formatToReadablePercentage = (value: number | string | BigNumber | undefined) => {
7 | if (value === undefined) {
8 | return PLACEHOLDER_KEY;
9 | }
10 |
11 | return `${formatPercentage(value)}%`;
12 | };
13 |
14 | export default formatToReadablePercentage;
15 |
--------------------------------------------------------------------------------
/src/utilities/generateBscScanUrl.ts:
--------------------------------------------------------------------------------
1 | import config from 'config';
2 | import { TokenId } from 'types';
3 |
4 | import getToken from './getToken';
5 |
6 | export type UrlType = 'address' | 'token' | 'tx';
7 |
8 | export const generateBscScanUrl = (
9 | identifier: T extends 'token' ? TokenId : string,
10 | urlType?: T,
11 | ) => {
12 | const safeUrlType = urlType || 'address';
13 |
14 | let suffix: string = identifier;
15 | if (safeUrlType === 'token') {
16 | suffix = getToken(identifier as TokenId).address;
17 | }
18 |
19 | return `${config.bscScanUrl}/${safeUrlType}/${suffix}`;
20 | };
21 |
22 | export default generateBscScanUrl;
23 |
--------------------------------------------------------------------------------
/src/utilities/getArgs.ts:
--------------------------------------------------------------------------------
1 | const getArgs = (func: $TSFixMe) => {
2 | // First match everything inside the function argument parens.
3 | const args = func.toString().match(/.*?\(([^)]*)\)/)
4 | ? func.toString().match(/.*?\(([^)]*)\)/)[1]
5 | : '';
6 | // Split the arguments string into an array comma delimited.
7 | return args
8 | .split(',')
9 |
10 | .map((arg: $TSFixMe) =>
11 | // Ensure no inline comments are parsed and trim the whitespace.
12 | arg.replace(/\/\*.*\*\//, '').trim(),
13 | )
14 |
15 | .filter(
16 | (arg: $TSFixMe) =>
17 | // Ensure no undefined values are added.
18 | arg,
19 | );
20 | };
21 |
22 | export default getArgs;
23 |
--------------------------------------------------------------------------------
/src/utilities/getBigNumber.ts:
--------------------------------------------------------------------------------
1 | import BigNumber from 'bignumber.js';
2 |
3 | const getBigNumber = (value?: BigNumber | string | number): BigNumber => {
4 | if (!value) {
5 | return new BigNumber(0);
6 | }
7 | if (BigNumber.isBigNumber(value)) {
8 | return value;
9 | }
10 | return new BigNumber(value);
11 | };
12 |
13 | export default getBigNumber;
14 |
--------------------------------------------------------------------------------
/src/utilities/getContractAddress.ts:
--------------------------------------------------------------------------------
1 | import config from 'config';
2 |
3 | import mainContractAddresses from 'constants/contracts/addresses/main.json';
4 |
5 | const getContractAddress = (contractId: keyof typeof mainContractAddresses) =>
6 | mainContractAddresses[contractId][config.chainId];
7 |
8 | export default getContractAddress;
9 |
--------------------------------------------------------------------------------
/src/utilities/getToken.ts:
--------------------------------------------------------------------------------
1 | import { Token, TokenId } from 'types';
2 |
3 | import { TOKENS } from 'constants/tokens';
4 |
5 | export const getToken = (id: TokenId) => TOKENS[id] as Token;
6 |
7 | export default getToken;
8 |
--------------------------------------------------------------------------------
/src/utilities/getTokenByAddress.ts:
--------------------------------------------------------------------------------
1 | import { Token } from 'types';
2 |
3 | import { TOKENS } from 'constants/tokens';
4 |
5 | const getTokenByAddress = (address: string) => {
6 | let token: Token | undefined;
7 |
8 | Object.keys(TOKENS)
9 | .filter(key => Object.prototype.hasOwnProperty.call(TOKENS, key))
10 | .forEach(tokenId => {
11 | const currentToken = TOKENS[tokenId as keyof typeof TOKENS];
12 | if (currentToken?.address === address) {
13 | token = currentToken as Token;
14 | }
15 | });
16 |
17 | return token;
18 | };
19 |
20 | export default getTokenByAddress;
21 |
--------------------------------------------------------------------------------
/src/utilities/getTokenIdFromVAddress.ts:
--------------------------------------------------------------------------------
1 | import { TokenId } from 'types';
2 |
3 | import vBepTokens from 'constants/contracts/addresses/vBepTokens.json';
4 |
5 | const getTokenIdFromVAddress = (address: string) => {
6 | const token = Object.entries<{ [key: string]: string }>(vBepTokens).find(
7 | ([, value]) =>
8 | value[process.env.REACT_APP_CHAIN_ID || '56'].toLowerCase() === address.toLowerCase(),
9 | );
10 | if (token) {
11 | return token[0] as TokenId;
12 | }
13 | };
14 |
15 | export default getTokenIdFromVAddress;
16 |
--------------------------------------------------------------------------------
/src/utilities/getVBepToken.ts:
--------------------------------------------------------------------------------
1 | import { VBepToken, VTokenId } from 'types';
2 |
3 | import { VBEP_TOKENS } from 'constants/tokens';
4 |
5 | export const getVBepToken = (id: VTokenId) => VBEP_TOKENS[id] as VBepToken;
6 |
7 | export default getVBepToken;
8 |
--------------------------------------------------------------------------------
/src/utilities/indexBy.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Takes an index function and an array and returns an object with indexFn(item)
3 | * as keys and array items as values.
4 | *
5 | * @param {object => string} indexFn
6 | * @param {array} arr
7 | * @returns An object with the keys derived as indexFn(array item)
8 | */
9 |
10 | const indexBy = (indexFn: (v: V, index: number) => string, arr: V[]) =>
11 | arr.reduce((result: Record, item: V, index) => {
12 | result[indexFn(item, index)] = item;
13 | return result;
14 | }, {});
15 |
16 | export default indexBy;
17 |
--------------------------------------------------------------------------------
/src/utilities/notNull.ts:
--------------------------------------------------------------------------------
1 | const notNull = (value: TValue | null): value is TValue => value !== null;
2 |
3 | export default notNull;
4 |
--------------------------------------------------------------------------------
/src/utilities/notUndefined.ts:
--------------------------------------------------------------------------------
1 | const notUndefined = (value: TValue | undefined): value is TValue => value !== undefined;
2 |
3 | export default notUndefined;
4 |
--------------------------------------------------------------------------------
/src/utilities/parseFunctionSignature.ts:
--------------------------------------------------------------------------------
1 | import { ethers } from 'ethers';
2 |
3 | const parseFunctionSignature = (value: string | undefined) => {
4 | try {
5 | // Throws error if invalid
6 | const fragment = ethers.utils.FunctionFragment.from(value || '');
7 | ethers.utils.defaultAbiCoder.getDefaultValue(fragment.inputs);
8 | return fragment;
9 | } catch (err) {
10 | return undefined;
11 | }
12 | };
13 |
14 | export default parseFunctionSignature;
15 |
--------------------------------------------------------------------------------
/src/utilities/promisify.ts:
--------------------------------------------------------------------------------
1 | export function promisify(fn: $TSFixMe, ...args: $TSFixMe[]) {
2 | return new Promise((resolve, reject) => {
3 | fn.apply(null, [...args, resolve, reject]);
4 | });
5 | }
6 |
--------------------------------------------------------------------------------
/src/utilities/truncateAddress.ts:
--------------------------------------------------------------------------------
1 | export const truncateAddress = (address: string) => `${address.slice(0, 4)}...${address.slice(-4)}`;
2 |
--------------------------------------------------------------------------------
/static.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": "build/",
3 | "routes": {
4 | "/**": "index.html"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/tsconfig.eslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["@types/node"],
5 | "noEmit": true,
6 | "allowJs": true
7 | },
8 | }
9 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2016",
4 | "jsx": "react-jsx",
5 | "module": "esnext",
6 | "noEmit": true,
7 | "esModuleInterop": true,
8 | "forceConsistentCasingInFileNames": true,
9 | "strict": true,
10 | "skipLibCheck": true,
11 | "lib": ["dom", "dom.iterable", "esnext"],
12 | "allowJs": false,
13 | "allowSyntheticDefaultImports": true,
14 | "noFallthroughCasesInSwitch": true,
15 | "moduleResolution": "node",
16 | "resolveJsonModule": true,
17 | "isolatedModules": true,
18 | "rootDir": "./src",
19 | "baseUrl": "./src"
20 | },
21 | "exclude": ["node_modules"],
22 | "include": ["src"]
23 | }
24 |
--------------------------------------------------------------------------------