From fbe688ff4e3dbb549b2bc07aa8309a0325366d43 Mon Sep 17 00:00:00 2001 From: Jaco Date: Fri, 25 Jun 2021 15:40:06 +0300 Subject: [PATCH] Ledger info for Statemine (#1026) --- packages/hw-ledger/src/defaults.ts | 9 ++++----- packages/networks/src/defaults.ts | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/hw-ledger/src/defaults.ts b/packages/hw-ledger/src/defaults.ts index 726c41846..e383ece19 100644 --- a/packages/hw-ledger/src/defaults.ts +++ b/packages/hw-ledger/src/defaults.ts @@ -4,16 +4,15 @@ import type Transport from '@ledgerhq/hw-transport'; import type { SubstrateApp } from '@zondax/ledger-substrate'; -import { newDockApp, newEdgewareApp, newEquilibriumApp, newKusamaApp, newPolkadotApp, newPolymeshApp } from '@zondax/ledger-substrate'; +import { newDockApp, newEdgewareApp, newEquilibriumApp, newKusamaApp, newPolkadotApp, newPolymeshApp, newStateMineApp } from '@zondax/ledger-substrate'; -// These match up with the network keys in the @polkadot/networks package -// (which is turn aligns with the substrate/ss58-registry.json as the single -// source of truth) +// These match up with the keys of the knownLedger object in the @polkadot/networks/defaults.ts export const ledgerApps: Record SubstrateApp> = { 'dock-mainnet': newDockApp, edgeware: newEdgewareApp, equilibrium: newEquilibriumApp, kusama: newKusamaApp, polkadot: newPolkadotApp, - polymesh: newPolymeshApp + polymesh: newPolymeshApp, + statemine: newStateMineApp }; diff --git a/packages/networks/src/defaults.ts b/packages/networks/src/defaults.ts index a45f1c360..f94ba0716 100644 --- a/packages/networks/src/defaults.ts +++ b/packages/networks/src/defaults.ts @@ -43,6 +43,9 @@ export const knownGenesis: KnownGenesis = { polymesh: [ '0x9deeb940c92ae02111c3bd5baca89970384f4c9849f02a1b2e53e66414d30f9f' ], + statemine: [ + '0x48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a' + ], subsocial: [ '0x0bd72c1c305172e1275278aaeb3f161e02eccb7a819e63f62d47bd53a28189f8' ] @@ -51,17 +54,23 @@ export const knownGenesis: KnownGenesis = { // these are icon overrides export const knownIcon: KnownIcon = { kusama: 'polkadot', - polkadot: 'polkadot' + polkadot: 'polkadot', + statemine: 'polkadot', + statemint: 'polkadot', + westmint: 'polkadot' }; -// support for ledger +// These match up with the keys of the ledgerApps object in the @polkadot/hw-ledger/defaults.ts +// and maps to the known slip44 (minus the `0x8` hard derivation flag) +// NOTE: Any network here needs to have a genesisHash attached in the config above export const knownLedger: KnownLedger = { 'dock-mainnet': 0x00000252, edgeware: 0x0000020b, equilibrium: 0x05f5e0fd, kusama: 0x000001b2, polkadot: 0x00000162, - polymesh: 0x00000253 + polymesh: 0x00000253, + statemine: 0x000001b2 // common-good on Kusama, shares derivation }; // testnets should not allow selection