UNPKG

@0xtemple/client

Version:
25 lines (24 loc) 1 kB
import type { AccountMangerParams } from '../../types'; import { KeyringPair } from '@polkadot/keyring/types'; export declare class VaraAccountManager { private mnemonics; private secretKey; currentKeyPair: Promise<KeyringPair>; /** * Support the following ways to init the VaraToolkit: * 1. mnemonics * 2. secretKey (base64 or hex) * If none of them is provided, will generate a random mnemonics with 24 words. * * @param mnemonics, 12 or 24 mnemonics words, separated by space * @param secretKey, base64 or hex string, when mnemonics is provided, secretKey will be ignored */ constructor({ mnemonics, secretKey }?: AccountMangerParams); getKeyPair(): Promise<KeyringPair>; getAddress(): Promise<string>; /** * Switch the current account with the given derivePathParams. * This is only useful when the mnemonics is provided. For secretKey mode, it will always use the same account. */ switchAccount(): void; }