Show labels of account parent (#306)

* Show derived accounts indentation

* Add parent labels

* Update branch

* styling

* CR requests

* Slightly reword derive documentation

* Remove derivation path from account metadata
This commit is contained in:
Ivan Rukhavets
2020-04-03 10:45:30 +02:00
committed by GitHub
parent 5e13f5e57f
commit 53d3ebce37
14 changed files with 173 additions and 43 deletions
@@ -303,7 +303,11 @@ export default class Extension {
}
private derivationCreate ({ genesisHash, name, parentAddress, parentPassword, password, suri }: RequestDeriveCreate): boolean {
const childPair = this.derive(parentAddress, suri, parentPassword, { genesisHash, name, parentAddress });
const childPair = this.derive(parentAddress, suri, parentPassword, {
genesisHash,
name,
parentAddress
});
keyring.addPair(childPair, password);
@@ -5,7 +5,7 @@
import { InjectedAccount, MetadataDef, ProviderList, ProviderMeta, InjectedMetadataKnown } from '@polkadot/extension-inject/types';
import { JsonRpcResponse } from '@polkadot/rpc-provider/types';
import { KeypairType } from '@polkadot/util-crypto/types';
import { KeyringPair } from '@polkadot/keyring/types';
import { KeyringPair, KeyringPair$Meta } from '@polkadot/keyring/types';
import { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import { TypeRegistry } from '@polkadot/types';
@@ -23,11 +23,21 @@ type NullKeys<T> = { [K in keyof T]: IsNull<T, K> }[keyof T];
export type SeedLengths = 12 | 24;
export interface AccountJson {
export interface AccountJson extends KeyringPair$Meta {
address: string;
genesisHash?: string | null;
isExternal?: boolean;
name?: string;
parentAddress?: string;
}
export type AccountWithChildren = AccountJson & {
children?: AccountWithChildren[];
}
export type AccountsContext = {
accounts: AccountJson[];
hierarchy: AccountWithChildren[];
}
export interface AuthorizeRequest {