UNPKG

p-sdk-wallet

Version:

A comprehensive wallet SDK for React Native (pwc), supporting multi-chain and multi-account features.

32 lines (31 loc) 1.13 kB
/** * Simple keyring for managing a single account from a private key. * Used for importing existing accounts that are not derived from a mnemonic. */ export declare class SimpleKeyring { readonly type = "Simple"; private privateKey; address: string; /** * Creates a new SimpleKeyring instance from a private key. * @param privateKey - The private key to import (hex string without '0x' prefix) */ constructor(privateKey: string); /** * Returns the private key. This should be used with extreme caution. * @returns The private key as a hex string */ getPrivateKey(): string; /** * Serializes the keyring into a plain object for encryption and storage. * @returns An object containing the keyring type and private key */ serialize(): any; /** * Deserializes a plain object back into a SimpleKeyring instance. * @param data - The serialized keyring data * @returns A new SimpleKeyring instance * @throws Error if the data is invalid or missing required fields */ static deserialize(data: any): SimpleKeyring; }