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: token and params display [web-nym] #1312

Merged
merged 11 commits into from
Nov 28, 2023
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
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
Loading