Skip to content

Commit

Permalink
add ledger derivation path to account imported
Browse files Browse the repository at this point in the history
  • Loading branch information
Leouarz committed Aug 14, 2024
1 parent 3540089 commit c2df28c
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({

Check failure on line 18 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Expected parentheses around arrow function argument

Check failure on line 18 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Strings must use singlequote
decimals: [18],
displayName: "Avail network",

Check failure on line 20 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Strings must use singlequote
genesisHash: ["0xb91746b45e0346cc2f815a520b9c6cb4d5c0902af848db0a80f85932d2e8276a"],

Check failure on line 21 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Strings must use singlequote
hasLedgerSupport: true,
icon: "substrate",

Check failure on line 23 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Strings must use singlequote
isIgnored: false,
isTestnet: false,
network: "avail",

Check failure on line 26 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Strings must use singlequote
prefix: 709,
slip44: 709,
standardAccount: "*25519",

Check failure on line 29 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Strings must use singlequote
symbols: ["AVAIL"],

Check failure on line 30 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Strings must use singlequote
website: "https://availproject.org"

Check failure on line 31 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Strings must use singlequote
}).reverse()

Check failure on line 32 in packages/page-accounts/src/modals/CreateSuriLedger.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Missing semicolon

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 c2df28c

Please sign in to comment.