2017-09-25 02:06:28 +00:00
|
|
|
import { RawTransaction } from 'libs/transaction';
|
|
|
|
|
2017-11-29 23:14:57 +00:00
|
|
|
interface IBaseWallet {
|
|
|
|
isReadOnly?: boolean;
|
2017-11-08 18:16:43 +00:00
|
|
|
getAddressString(): Promise<string> | string;
|
2017-11-29 23:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IReadOnlyWallet extends IBaseWallet {
|
|
|
|
isReadOnly: true;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IFullWallet extends IBaseWallet {
|
|
|
|
isReadOnly?: false;
|
2017-11-08 18:16:43 +00:00
|
|
|
signRawTransaction(tx: RawTransaction): Promise<string> | string;
|
|
|
|
signMessage(msg: string): Promise<string> | string;
|
2017-09-25 02:06:28 +00:00
|
|
|
}
|
2017-11-29 23:14:57 +00:00
|
|
|
|
|
|
|
export type IWallet = IReadOnlyWallet | IFullWallet;
|