feat(txwrapper-polkadot): Add support for Statemint & Statemine#75
feat(txwrapper-polkadot): Add support for Statemint & Statemine#75
Conversation
|
|
||
| const KNOWN_CHAIN_PROPERTIES = { | ||
| statemint: { | ||
| ss58Format: PolkadotSS58Format.polkadot, |
There was a problem hiding this comment.
@emostov @joepetrowski, I know the ss58Format is 0, and it shares that same property of Polkadot (assuming all parachains will share the same ss58Format as their relay chain). Just want to make confirm the tokenDecimals and tokenSymbol are the same. I saw in the statemint repo, that it calculates Dollars different from DOT ie: using 1/100 instead of 1/10.
Also Zeke should the key be statemint here as well. Just not sure how parachains will deal with
There was a problem hiding this comment.
Yeah good question. On the first part, I will defer final answers to Joe. But in general all non-development chains should ideally have there own ss58 prefix, so it does not make sense to me that it is 0 here. (Dev chains should have prefix 42).
To your second part, yes this is correct. Should not be a difference for parachains.
There was a problem hiding this comment.
DOLLARS is the same:
- Polkadot: https://github.com/paritytech/polkadot/blob/5b75542/runtime/polkadot/src/constants.rs#L21
- Statemint: https://github.com/paritytech/statemint/blob/564273d/runtime/statemint/src/constants.rs#L4
SS58 for Statemint will be 0 (same as Polkadot)
There was a problem hiding this comment.
@emostov - the reason that this uses 0 as its SS58 is that it's a common good chain, so it uses DOT as its native currency. It's basically part of Polkadot, but rather than bloat the Relay Chain with this logic, we're putting it in a parachain.
|
|
||
| const KNOWN_CHAIN_PROPERTIES = { | ||
| statemint: { | ||
| ss58Format: PolkadotSS58Format.polkadot, |
There was a problem hiding this comment.
Yeah good question. On the first part, I will defer final answers to Joe. But in general all non-development chains should ideally have there own ss58 prefix, so it does not make sense to me that it is 0 here. (Dev chains should have prefix 42).
To your second part, yes this is correct. Should not be a difference for parachains.
|
Looks good, would be good to add another instance for Statemine, Statemint's Kusama cousin.
|
|
@joepetrowski & @TarikGul (cc @dvdplm) I think we should ship methods for system parachains in To do this:
Any concerns with this plan? If not I think we can convert this PR to comply with the above |
|
That sounds good. As logic becomes more specialized I think we can code in some helpful warnings. For example, if Statemint is the only chain with |
Co-authored-by: David <dvdplm@gmail.com>
…tech/txwrapper-core into tarik-txwrapper-statemint
|
LGTM @emostov! Great job! |
| // The default type registry has polkadot types | ||
| const registry = new TypeRegistry(); | ||
|
|
||
| // As of now statemine is not a supported specName in the default polkadot-js/api type registry. |
There was a problem hiding this comment.
Do you know if there's an issue for that upstream? If there is, maybe link to it here?
Closes: #68
This PR adds support for the Statemint & Statemine chains.