20 lines
465 B
TypeScript
20 lines
465 B
TypeScript
import Tx from 'ethereumjs-tx';
|
|
|
|
interface IBaseWallet {
|
|
isReadOnly?: boolean;
|
|
getAddressString(): string;
|
|
getPrivateKeyString?(): string;
|
|
}
|
|
|
|
export interface IReadOnlyWallet extends IBaseWallet {
|
|
isReadOnly: true;
|
|
}
|
|
|
|
export interface IFullWallet extends IBaseWallet {
|
|
isReadOnly?: false;
|
|
signRawTransaction(tx: Tx): Promise<Buffer> | Buffer;
|
|
signMessage(msg: string): Promise<string> | string;
|
|
}
|
|
|
|
export type IWallet = IReadOnlyWallet | IFullWallet;
|