Skip to content

Commit

Permalink
fix: token and params display [web-nym] (#1312)
Browse files Browse the repository at this point in the history
## Description

Closes: #XXXX

<!-- Add a description of the changes that this PR introduces and the
files that
are the most critical to review. -->

---

### Author Checklist

_All items are required. Please add a note to the item if the item is
not applicable and
please add links to any relevant follow up issues._

I have...

- [x] ran linting via `yarn lint`
- [ ] wrote tests where necessary
- [x] included the correct [type
prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json)
in the PR title
- [x] targeted the correct branch
- [x] provided a link to the relevant issue or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed
- [x] added a changeset via [`yarn && yarn
changeset`](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
  • Loading branch information
MonikaCat authored Nov 28, 2023
1 parent e749a3b commit c6ec239
Show file tree
Hide file tree
Showing 20 changed files with 1,305 additions and 75 deletions.
6 changes: 6 additions & 0 deletions .changeset/empty-months-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'web-nym': patch
'ui': patch
---

fix: token and params display
8 changes: 7 additions & 1 deletion apps/web-nym/src/chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"chainName": "nym",
"title": "NYM Block Explorer",
"extra": {
"votingPowerExponent": 6,
"profile": true,
"graphqlWs": false
},
Expand Down Expand Up @@ -205,7 +206,7 @@
}
}
},
"keplr": "{\"chainId\":\"nyx\",\"chainName\":\"Nyx\",\"chainSymbolImageUrl\":\"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/nyx/chain.png\",\"rpc\":\"https://rpc.nyx.nodes.guru\",\"rest\":\"https://api.nyx.nodes.guru/\",\"nodeProvider\":{\"name\":\"NodesGuru\",\"email\":\"[email protected]\",\"website\":\"https://nodes.guru/\"},\"bip44\":{\"coinType\":118},\"bech32Config\":{\"bech32PrefixAccAddr\":\"n\",\"bech32PrefixAccPub\":\"npub\",\"bech32PrefixValAddr\":\"nvaloper\",\"bech32PrefixValPub\":\"nvaloperpub\",\"bech32PrefixConsAddr\":\"nvalcons\",\"bech32PrefixConsPub\":\"nvalconspub\"},\"stakeCurrency\":{\"coinDenom\":\"nyx\",\"coinMinimalDenom\":\"unyx\",\"coinDecimals\":6},\"currencies\":[{\"coinDenom\":\"NYM\",\"coinMinimalDenom\":\"unym\",\"coinDecimals\":6,\"coinGeckoId\":\"nym\"},{\"coinDenom\":\"NYX\",\"coinMinimalDenom\":\"unyx\",\"coinDecimals\":6,\"coinGeckoId\":\"nyx\"}],\"feeCurrencies\":[{\"coinDenom\":\"nym\",\"coinMinimalDenom\":\"unym\",\"coinDecimals\":6,\"coinGeckoId\":\"nym\"},{\"coinDenom\":\"nyx\",\"coinMinimalDenom\":\"unyx\",\"coinDecimals\":6,\"coinGeckoId\":\"nyx\"}],\"features\":[\"cosmwasm\"]}",
"keplr": "{\"chainId\":\"nyx\",\"chainName\":\"Nyx\",\"chainSymbolImageUrl\":\"https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/nyx/chain.png\",\"rpc\":\"https://rpc.nyx.nodes.guru\",\"rest\":\"https://api.nyx.nodes.guru/\",\"nodeProvider\":{\"name\":\"NodesGuru\",\"email\":\"[email protected]\",\"website\":\"https://nodes.guru/\"},\"bip44\":{\"coinType\":118},\"bech32Config\":{\"bech32PrefixAccAddr\":\"n\",\"bech32PrefixAccPub\":\"npub\",\"bech32PrefixValAddr\":\"nvaloper\",\"bech32PrefixValPub\":\"nvaloperpub\",\"bech32PrefixConsAddr\":\"nvalcons\",\"bech32PrefixConsPub\":\"nvalconspub\"},\"stakeCurrency\":{\"coinDenom\":\"nyx\",\"coinMinimalDenom\":\"unyx\",\"coinDecimals\":6},\"currencies\":[{\"coinDenom\":\"NYX\",\"coinMinimalDenom\":\"unyx\",\"coinDecimals\":6,\"coinGeckoId\":\"nym\"},{\"coinDenom\":\"NYX\",\"coinMinimalDenom\":\"unyx\",\"coinDecimals\":6,\"coinGeckoId\":\"nyx\"}],\"feeCurrencies\":[{\"coinDenom\":\"nyx\",\"coinMinimalDenom\":\"unyx\",\"coinDecimals\":6,\"coinGeckoId\":\"nym\"},{\"coinDenom\":\"nyx\",\"coinMinimalDenom\":\"unyx\",\"coinDecimals\":6,\"coinGeckoId\":\"nyx\"}],\"features\":[\"cosmwasm\"]}",
"chains": [
{
"network": "nyx",
Expand All @@ -221,8 +222,13 @@
},
"primaryTokenUnit": "unyx",
"votingPowerTokenUnit": "unyx",
"priceTokenUnit": "unym",
"tokenUnits": {
"unyx": {
"display": "nyx",
"exponent": 6
},
"unym": {
"display": "nym",
"exponent": 6
}
Expand Down
149 changes: 149 additions & 0 deletions apps/web-nym/src/chainConfig/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
export interface ChainSettings {
network: string;
chainType: string;
genesis: {
time: string;
height: number;
};
prefix: {
consensus: string;
validator: string;
account: string;
};
primaryTokenUnit: string;
priceTokenUnit: string;
votingPowerTokenUnit: string;
tokenUnits: {
[token: string]: {
display: string;
exponent: number;
};
};
endpoints: {
graphql?: string;
graphqlWebsocket?: string;
publicRpcWebsocket?: string;
};
marketing: {
matomoURL?: string;
matomoSiteID?: string;
};
}

export interface PaletteSettings {
primary: {
main?: string;
contractText?: string;
};
background: {
default?: string;
paper?: string;
};
divider?: string;
text: {
primary?: string;
secondary?: string;
};
custom: {
general: {
background?: string;
surfaceOne?: string;
surfaceTwo?: string;
surfaceThree?: string;
icon?: string;
};
fonts: {
fontOne?: string;
fontTwo?: string;
fontThree?: string;
fontFour?: string;
fontFive?: string;
highlight?: string;
};
primaryData: {
one?: string;
two?: string;
three?: string;
four?: string;
};
results: {
pass?: string;
fail?: string;
};
tokenomics: {
one?: string;
two?: string;
three?: string;
};
conditions: {
zero?: string;
one?: string;
two?: string;
three?: string;
};
charts: {
zero?: string;
one?: string;
two?: string;
three?: string;
four?: string;
five?: string;
};
tags: {
zero?: string;
one?: string;
two?: string;
three?: string;
four?: string;
five?: string;
six?: string;
seven?: string;
eight?: string;
nine?: string;
ten?: string;
eleven?: string;
twelve?: string;
thirteen?: string;
fourteen?: string;
fifteen?: string;
sixteen?: string;
seventeen?: string;
eighteen?: string;
nineteen?: string;
twenty?: string;
};
wallet: {
background?: string;
backgroundTwo?: string;
surfaceOne: string;
surfaceTwo: string;
surfaceThree: string;
surfaceFour: string;
surfaceFive: string;
divider?: string;
textPrimary?: string;
textSecondary?: string;
active?: string;
inactive?: string;
};
};
}

export interface ChainConfig extends ChainSettings {
chainName: string;
title: string;
extra: {
profile: boolean;
graphqlWs: boolean;
votingPowerExponent?: number;
};
basePath: string;
previewImage?: string;
themes: {
default: string;
themeList: Array<'dark' | 'light' | 'deuteranopia' | 'tritanopia'>;
dark: PaletteSettings;
light: PaletteSettings;
};
keplr: string | undefined;
}
6 changes: 2 additions & 4 deletions apps/web-nym/src/graphql/general/params.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ query Params {
distributionParams: distribution_params(limit: 1, order_by: {height: desc}) {
params
}
govParams: gov_params (limit: 1, order_by: {height: desc}) {
depositParams: deposit_params
tallyParams: tally_params
votingParams: voting_params
govParams: gov_params(limit: 1, order_by: {height: desc}) {
params
}
}
3 changes: 1 addition & 2 deletions apps/web-nym/src/graphql/general/proposal_details.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ query ProposalDetails($proposalId: Int) {
content
proposalId: id
submitTime: submit_time
proposalType: proposal_type
depositEndTime: deposit_end_time
votingStartTime: voting_start_time
votingEndTime: voting_end_time
Expand All @@ -25,7 +24,7 @@ query ProposalDetailsTally($proposalId: Int) {
bondedTokens: bonded_tokens
}
quorum: gov_params (limit: 1, order_by: {height: desc}) {
tallyParams: tally_params
tallyParams: params
}
}

Expand Down
Loading

1 comment on commit c6ec239

@vercel
Copy link

@vercel vercel bot commented on c6ec239 Nov 28, 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:

cosmos – ./

cosmos-git-main-bigdipper.vercel.app
bigdipper.vercel.app
cosmos-bigdipper.vercel.app

Please sign in to comment.