-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for using different tokens on ParaTimes #1265
Conversation
Deployed to Cloudflare Pages
|
a96fb2a
to
c99910b
Compare
c99910b
to
e1d3ffd
Compare
1c19e4b
to
bd8e8ad
Compare
Wait, let me adjust this so that we can support multiple tokens for paratimes... |
bd8e8ad
to
fa44b4c
Compare
3a89941
to
30a6d9a
Compare
62409af
to
d37cc87
Compare
Up to now, we assumed that the native token on each ParaTime is always the same as the native token on the network. Unfortunately this is not always true, so now we have to make it possible to use different tokens on paratimes.
- Rename a NativeTicker to Ticker - Add EUROe token (and logo) - Add metadata about known native tokens: - Ticker (symbol) - Is this a free token? - CoinGecko id - Generalize RosePriceCard to TokenPriceCard - Enhance layer token configuration - Describe the token, not the ticker - Support multiple tokens per layer - Define the tokens for the Pontus-X layer - CoinGecko: support pulling all wanted prices - Nexus API: - When loading data, observe the layer token configuration - Added RuntimeBalanceDisplay: a component for displaying balances in multiple tokens. - Added FiatMoneyAmount: a component for displaying fiat money value for balances in multiple tokens, summarizing value from all tokens. - ParaTimeSnapshot: display price/faucet for first token
The preferred fiat currency can now be configured per paratime / network.
d37cc87
to
3520ce1
Compare
isFree: !!token.free, | ||
hasUsedCoinGecko: !!token.geckoId, | ||
price: token.geckoId && geckoPrices ? (geckoPrices as any)[token.geckoId] : undefined, | ||
fiatCurrency: token.geckoId && geckoPrices ? fiatCurrency : 'xx', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'xx'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be an empty string. Anyway, since we don't have a price, the name of the currency will never be displayed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, we could simply use the provided fiatCurrency
, too. It doesn't matter, since (missing the price) it won't be displayed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #1285.
paraTimesConfig[runtime].decimals, | ||
), | ||
Denomination: getTickerForNetwork(network), | ||
Denomination: getTokensForScope({ network, layer: runtime })[0].ticker, // TODO find this out from event data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to differentiate decimals based on denomination. If EUROe has the same number of decimals as TEST, that is only coincidentally and unreliable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, decimals are not yet solved. However this code has been updated later in #1279
Up to now, we assumed that the native token on each ParaTime is always the same as the native token on the network.
Unfortunately this is not always true, so now we have to make it possible to use different tokens on paratimes.