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

Token registry design #1

Open
shaunxw opened this issue Mar 15, 2021 · 1 comment
Open

Token registry design #1

shaunxw opened this issue Mar 15, 2021 · 1 comment

Comments

@shaunxw
Copy link
Member

shaunxw commented Mar 15, 2021

Types

  • struct TokenInfo
    • id: MultiLocation
    • decimals: u8
    • #cfg(feature = full) extra: ExtraTokenInfo
  • struct ExtraTokenInfo
    • name: &'static str
    • symbol: &'static str
    • description: &' static str
    • icon: Option<&'static str>

Traits

  • ReserveChainLocation: should be implemented by each TokenInfo.
    • fn location() -> MultiLocation: returns the reserve chain location of a token.

Registry

  • mod polkadot
    • mod acala
      • const ACA: TokenInfo
      • const aUSD: TokenInfo
      • const all: [TokenInfo] = [ACA, aUSD]
    • mod plasm
      • use plasm_token_info::*
      • assuming Plasm have published their token info in crate plasm_token_info
  • mod kusama
    • mod karura
      • const KAR: TokenInfo
      • const kUSD: TokenInfo
      • const all: [TokenInfo] = [KAR, kUSD]

Dump

  • Add a bin crate and script to dump JSON file.
    • dump_token_info
      • generate a JSON file with all the token info
@stechu
Copy link

stechu commented Aug 11, 2021

A registry would be extremely useful. Kudos to the proposal!
For the TokenInfo struct, it might be helpful to add the associated coin-type from BIP-44. https://github.com/satoshilabs/slips/blob/master/slip-0044.md
This would be helpful information for both hardware and software wallets like ledger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@stechu @shaunxw and others