UNPKG

@metamask/eth-simple-keyring

Version:

A simple standard interface for a series of Ethereum private keys.

39 lines 1.95 kB
import { TypedTransaction } from "@ethereumjs/tx"; import { type TypedDataV1, type MessageTypes, type TypedMessage, EIP7702Authorization, SignTypedDataVersion } from "@metamask/eth-sig-util"; import { Keyring } from "@metamask/keyring-utils"; import { Eip1024EncryptedData, Hex } from "@metamask/utils"; type KeyringOpt = { withAppKeyOrigin?: string; version?: SignTypedDataVersion | string; }; export default class SimpleKeyring implements Keyring { #private; readonly type: string; static type: string; constructor(privateKeys?: string[]); serialize(): Promise<string[]>; deserialize(privateKeys: string[]): Promise<void>; addAccounts(numAccounts?: number): Promise<Hex[]>; getAccounts(): Promise<Hex[]>; signTransaction(address: Hex, transaction: TypedTransaction, opts?: KeyringOpt): Promise<TypedTransaction>; signEip7702Authorization(address: Hex, authorization: EIP7702Authorization, opts?: KeyringOpt): Promise<string>; signMessage(address: Hex, data: string, opts?: { withAppKeyOrigin: string; validateMessage: boolean; }): Promise<string>; signPersonalMessage(address: Hex, msgHex: Hex, opts?: { withAppKeyOrigin: string; }): Promise<string>; decryptMessage(withAccount: Hex, encryptedData: Eip1024EncryptedData): Promise<string>; signTypedData<Version extends SignTypedDataVersion, Types extends MessageTypes, Options extends { version?: Version; } & KeyringOpt>(address: Hex, data: Version extends 'V1' ? TypedDataV1 : TypedMessage<Types>, options?: Options): Promise<string>; getEncryptionPublicKey(withAccount: Hex, opts?: KeyringOpt): Promise<string>; getAppKeyAddress(address: Hex, origin: string): Promise<Hex>; exportAccount(address: Hex, opts?: { withAppKeyOrigin: string; }): Promise<string>; removeAccount(address: string): void; } export {}; //# sourceMappingURL=simple-keyring.d.mts.map