UNPKG

radix-account-tools-js

Version:

Javascript/Typescript account creation tools for Radix DLT

29 lines (28 loc) 1.74 kB
import { PrivateKey, PublicKey } from "@radixdlt/radix-engine-toolkit"; export interface KeyPair { privateKey: PrivateKey; publicKey: PublicKey; } export interface AccountData extends KeyPair { address: string; } export interface AccountDataWithIndex extends AccountData { index: number; } export declare function generate12WordMnemonic(): string; export declare function generate24WordMnemonic(): string; export declare function generateAccountFromPrivateKeyBytes(privateKeyBytes: Uint8Array, // the array of bytes networkId: number): Promise<AccountData>; export declare function generateAccountsFromMnemonic(mnemonic: string, // the mnemonic phrase as a string with words separated by spaces indices: number[], // the entity indices to create account for networkId: number): Promise<AccountDataWithIndex[]>; export declare function generateKeyPair(mnemonic: string, // the mnemonic phrase as a string with words separated by spaces entityIndex: number, // the entity index of the account (several private/public key pairs can be derived from the same mnemonic phrase) - the same mneominc and same index will always result in the same pair networkId: number, // the Radix network id (stokenet = 2, mainnet = 1) entityType?: number): KeyPair; export declare function deriveAccountAddressFromPublicKey(publicKey: PublicKey, // the public key to derive the address for networkId: number): Promise<string>; export declare function generateEd25519PrivateKey(bytes: Uint8Array): Promise<PrivateKey>; export declare function generateNewVirtualAccount(privateKey: PrivateKey, // the private key to use to generate the account networkId: number): Promise<AccountData>; export declare function mnemonicToSeed(mnemonic: string): string;