From 350d27cfb4bd09855f6dbd7517af39deff31b65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezi=C5=84ski?= Date: Thu, 26 Oct 2023 12:53:51 +0200 Subject: [PATCH] fix parse locked tokens amount + xand dao details (#1892) --- .../LockPluginTokenBalanceCard.tsx | 1 + .../LockedCommunityVotingPower.tsx | 25 +++++++++++-------- public/realms/mainnet-beta.json | 9 +++++++ yarn.lock | 4 +-- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/VoteStakeRegistry/components/TokenBalance/LockPluginTokenBalanceCard.tsx b/VoteStakeRegistry/components/TokenBalance/LockPluginTokenBalanceCard.tsx index 12ee93f108..179c9c86a4 100644 --- a/VoteStakeRegistry/components/TokenBalance/LockPluginTokenBalanceCard.tsx +++ b/VoteStakeRegistry/components/TokenBalance/LockPluginTokenBalanceCard.tsx @@ -255,6 +255,7 @@ const TokenDepositLock = ({ > )} + {(availableTokens != '0' || lockTokensFmt != '0') && (
{availableTokens != '0' && ( diff --git a/components/ProposalVotingPower/LockedCommunityVotingPower.tsx b/components/ProposalVotingPower/LockedCommunityVotingPower.tsx index 0f56a4d298..784a4ed966 100644 --- a/components/ProposalVotingPower/LockedCommunityVotingPower.tsx +++ b/components/ProposalVotingPower/LockedCommunityVotingPower.tsx @@ -86,16 +86,21 @@ export default function LockedCommunityVotingPower(props: Props) { ) : new BigNumber('0') - const lockedTokensAmount = deposits - .filter( - (x) => - typeof x.lockup.kind['none'] === 'undefined' && - x.mint.publicKey.toBase58() === realm?.account.communityMint.toBase58() - ) - .reduce( - (curr, next) => curr.plus(new BigNumber(next.currentlyLocked.toString())), - new BigNumber(0) - ) + const lockedTokensAmount = mint + ? deposits + .filter( + (x) => + typeof x.lockup.kind['none'] === 'undefined' && + x.mint.publicKey.toBase58() === + realm?.account.communityMint.toBase58() + ) + .reduce( + (curr, next) => + curr.plus(new BigNumber(next.currentlyLocked.toString())), + new BigNumber(0) + ) + .shiftedBy(-mint.decimals) + : new BigNumber('0') const max = realm && proposal && mint diff --git a/public/realms/mainnet-beta.json b/public/realms/mainnet-beta.json index 4c400b37bb..2b6fa7f1fc 100644 --- a/public/realms/mainnet-beta.json +++ b/public/realms/mainnet-beta.json @@ -62,6 +62,15 @@ "discord": "https://discord.com/invite/2uwjsBc5yw", "github": "https://github.com/blockworks-foundation/" }, + { + "symbol": "XAND", + "category": "defi", + "displayName": "Xandeum DAO", + "programId": "DcG2PZTnj8s4Pnmp7xJswniCskckU5E6XsrKuyD7NYFK", + "realmId": "CFprdZRYitjPYEDUQKDQZwao1jcRcU1z1GsFspMpN8Ci", + "communityMint": "2j437Lt84XvysJiYbXTSJfAMy26Et9HiVGFvGFp8nYWH", + "ogImage": "https://xandeum.com/wp-content/uploads/2023/05/Xandeum-Logo-Standard.png" + }, { "symbol": "HPC", "displayName": "CryptoHelp", diff --git a/yarn.lock b/yarn.lock index 9e2ec0b356..8944b9416a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6313,12 +6313,12 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.21.3" -ansi-regex@3.0.1, ansi-regex@^2.0.0: +ansi-regex@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== -"ansi-regex@>=3.0.1 <=5.0.1", ansi-regex@^3.0.0, ansi-regex@^4.1.0, ansi-regex@^5.0.0, ansi-regex@^5.0.1: +"ansi-regex@>=3.0.1 <=5.0.1", ansi-regex@^2.0.0, ansi-regex@^3.0.0, ansi-regex@^4.1.0, ansi-regex@^5.0.0, ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==