eth-onekey-bridge-keyring
Version:
A MetaMask compatible keyring, for onekey hardware wallets
37 lines (36 loc) • 1.44 kB
TypeScript
import type { ConnectSettings, Params, EVMSignedTx, EVMSignTransactionParams, EVMSignMessageParams, EVMSignTypedDataParams, EVMGetPublicKeyParams } from '@onekeyfe/hd-core';
import type { EthereumMessageSignature } from '@onekeyfe/hd-transport';
declare type Unsuccessful = {
success: false;
payload: {
error: string;
code?: string | number;
};
};
declare type Success<T> = {
success: true;
payload: T;
};
declare type Response<T> = Promise<Success<T> | Unsuccessful>;
export declare type OneKeyBridge = {
model?: string;
on(event: string, callback: (event: any) => void): void;
off(event: string): void;
init(settings: Partial<ConnectSettings>): Promise<void>;
dispose(): Promise<void>;
updateTransportMethod(transportType: string): Promise<void>;
getPublicKey(params: Params<EVMGetPublicKeyParams>): Response<{
publicKey: string;
chainCode: string;
}>;
batchGetPublicKey(params: Params<any> & {
bundle: EVMGetPublicKeyParams[];
}): Response<{
pub: string;
}[]>;
getPassphraseState(): Response<string | undefined>;
ethereumSignTransaction(params: Params<EVMSignTransactionParams>): Response<EVMSignedTx>;
ethereumSignMessage(params: Params<EVMSignMessageParams>): Response<EthereumMessageSignature>;
ethereumSignTypedData(params: Params<EVMSignTypedDataParams>): Response<EthereumMessageSignature>;
};
export {};