Skip to content

Commit

Permalink
Merge pull request #85 from availproject/ghali/ledger-derivation
Browse files Browse the repository at this point in the history
add ledger derivation path to account imported
  • Loading branch information
Leouarz authored Aug 14, 2024
2 parents 3540089 + ea47188 commit 0ffc7b9
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions packages/page-accounts/src/modals/CreateSuriLedger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import React, { useEffect, useRef, useState } from 'react';

import { selectableNetworks } from '@polkadot/networks';
import { selectableNetworks as polkadotSelectableNetworks } from '@polkadot/networks';
import { Dropdown, MarkError, Modal } from '@polkadot/react-components';

import { useTranslation } from '../translate.js';
Expand All @@ -15,13 +15,29 @@ interface Props {
seedType: string;
}

const selectableNetworks = polkadotSelectableNetworks.filter((x) => x.network === 'polkadot').concat({
decimals: [18],
displayName: 'Avail network',
genesisHash: ['0xb91746b45e0346cc2f815a520b9c6cb4d5c0902af848db0a80f85932d2e8276a'],
hasLedgerSupport: true,
icon: 'substrate',
isIgnored: false,
isTestnet: false,
network: 'avail',
prefix: 709,
slip44: 709,
standardAccount: '*25519',
symbols: ['AVAIL'],
website: 'https://availproject.org'
}).reverse();

const ledgerNets = selectableNetworks.filter(({ hasLedgerSupport }) => hasLedgerSupport);

function CreateSuriLedger ({ className, onChange, seedType }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const [accIndex, setAccIndex] = useState(0);
const [addIndex, setAddIndex] = useState(0);
const [chainType, setChainType] = useState('polkadot');
const [chainType, setChainType] = useState('avail');

const netOpts = useRef(ledgerNets.map(({ displayName, network }) => ({
text: displayName,
Expand Down

0 comments on commit 0ffc7b9

Please sign in to comment.