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