2018-07-31 01:59:52 +03:00
|
|
|
|
2018-09-24 22:55:17 +03:00
|
|
|
import { isType, setType } from './utils/properties';
|
2018-07-31 01:59:52 +03:00
|
|
|
|
|
|
|
// Imported Abstracts
|
2018-09-24 22:55:17 +03:00
|
|
|
import { Provider } from './providers/abstract-provider';
|
2018-07-31 01:59:52 +03:00
|
|
|
|
|
|
|
// Imported Types
|
2018-09-24 22:55:17 +03:00
|
|
|
import { Arrayish } from './utils/bytes';
|
|
|
|
import { TransactionRequest, TransactionResponse } from './providers/abstract-provider';
|
2018-07-31 01:59:52 +03:00
|
|
|
|
|
|
|
|
|
|
|
export abstract class Signer {
|
2018-09-04 17:27:22 +03:00
|
|
|
readonly provider?: Provider;
|
2018-07-31 01:59:52 +03:00
|
|
|
|
|
|
|
abstract getAddress(): Promise<string>
|
|
|
|
|
|
|
|
abstract signMessage(message: Arrayish | string): Promise<string>;
|
|
|
|
abstract sendTransaction(transaction: TransactionRequest): Promise<TransactionResponse>;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
setType(this, 'Signer');
|
|
|
|
}
|
|
|
|
|
|
|
|
static isSigner(value: any): value is Signer {
|
|
|
|
return isType(value, 'Signer');
|
|
|
|
}
|
|
|
|
|
|
|
|
// readonly inherits: (child: any) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
//defineReadOnly(Signer, 'inherits', inheritable(Signer));
|
|
|
|
|