Files
pwap/pezkuwi-sdk-ui/packages/page-accounts/src/modals/CreateSuriLedger.tsx
T
pezkuwichain 971df8edba Rebrand: Remove 3rd party chains, update domains to PezkuwiChain
- Remove all 3rd party parachain configurations from endpoints:
  - productionRelayPolkadot.ts: Keep only system parachains
  - productionRelayDicle.ts: Keep only system parachains
  - testingRelayZagros.ts: Keep only system parachains
  - testingRelayTeyrChain.ts: Keep only system parachains

- Update domain references:
  - polkadot.js.org → pezkuwichain.app
  - wiki.polkadot.network → wiki.pezkuwichain.io
  - dotapps.io → pezkuwichain.app
  - statement.polkadot.network → docs.pezkuwichain.io/statement
  - support.polkadot.network → docs.pezkuwichain.io

- Update repository references:
  - github.com/pezkuwi-js/apps → github.com/pezkuwichain/pwap

- Rename system parachains to Pezkuwi ecosystem:
  - PolkadotAssetHub → PezkuwiAssetHub
  - polkadotBridgeHub → pezkuwiBridgeHub
  - polkadotCollectives → pezkuwiCollectives
  - polkadotCoretime → pezkuwiCoretime
  - polkadotPeople → pezkuwiPeople

- Update network name in claims utility:
  - Polkadot → Pezkuwi
2026-01-09 03:08:11 +03:00

82 lines
2.4 KiB
TypeScript

// Copyright 2017-2026 @pezkuwi/app-accounts authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React, { useEffect, useRef, useState } from 'react';
import { selectableNetworks } from '@pezkuwi/networks';
import { Dropdown, MarkError, Modal } from '@pezkuwi/react-components';
import { useTranslation } from '../translate.js';
import { AVAIL_INDEXES } from './Ledger.js';
interface Props {
className?: string;
onChange: (string: string) => void;
seedType: string;
}
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('pezkuwi');
const netOpts = useRef(ledgerNets.map(({ displayName, network }) => ({
text: displayName,
value: network
})));
const accOps = useRef(AVAIL_INDEXES.map((value) => ({
text: t('Account type {{index}}', { replace: { index: value } }),
value
})));
const addOps = useRef(AVAIL_INDEXES.map((value) => ({
text: t('Address index {{index}}', { replace: { index: value } }),
value
})));
useEffect((): void => {
const network = ledgerNets.find(({ network }) => network === chainType);
onChange(`m/44'/${network?.slip44}'/${accIndex}'/0'/${addIndex}'`);
}, [accIndex, addIndex, chainType, onChange]);
return (
<Modal.Columns
className={className}
hint={t('The derivation will be constructed from the values you specify.')}
>
{seedType === 'bip'
? (
<>
<Dropdown
label={t('Ledger app type (originated from)')}
onChange={setChainType}
options={netOpts.current}
value={chainType}
/>
<Dropdown
label={t('account type')}
onChange={setAccIndex}
options={accOps.current}
value={accIndex}
/>
<Dropdown
label={t('address index')}
onChange={setAddIndex}
options={addOps.current}
value={addIndex}
/>
</>
)
: <MarkError content={t('Derivation for Ledger-type accounts are only available on mnemonic seeds.')} />
}
</Modal.Columns>
);
}
export default React.memo(CreateSuriLedger);