Skip to content

Commit

Permalink
fix parse locked tokens amount + xand dao details (#1892)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 authored Oct 26, 2023
1 parent 531c8b6 commit 350d27c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ const TokenDepositLock = ({
></VotingPowerBox>
</div>
)}

{(availableTokens != '0' || lockTokensFmt != '0') && (
<div className="pt-4 px-4">
{availableTokens != '0' && (
Expand Down
25 changes: 15 additions & 10 deletions components/ProposalVotingPower/LockedCommunityVotingPower.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions public/realms/mainnet-beta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6313,12 +6313,12 @@ ansi-escapes@^4.2.1:
dependencies:
type-fest "^0.21.3"

[email protected], ansi-regex@^2.0.0:
[email protected]:
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==
Expand Down

1 comment on commit 350d27c

@vercel
Copy link

@vercel vercel bot commented on 350d27c Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

governance-ui – ./

app.realms.today
governance-ui-git-main-solana-labs.vercel.app
governance-ui-solana-labs.vercel.app

Please sign in to comment.