Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix parse locked tokens amount + xand dao details #1892

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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