2017-09-25 02:06:28 +00:00
|
|
|
export default class DeterministicWallet {
|
|
|
|
private address: string;
|
|
|
|
private dPath: string;
|
|
|
|
private index: number;
|
2017-08-28 17:43:57 +00:00
|
|
|
|
2017-09-15 19:29:38 +00:00
|
|
|
constructor(address: string, dPath: string, index: number) {
|
2017-08-28 17:43:57 +00:00
|
|
|
this.address = address;
|
|
|
|
this.dPath = dPath;
|
2017-09-15 19:29:38 +00:00
|
|
|
this.index = index;
|
2017-08-28 17:43:57 +00:00
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
public getAddress(): Promise<string> {
|
2017-08-28 17:43:57 +00:00
|
|
|
return Promise.resolve(this.address);
|
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
public getPath(): string {
|
2017-09-15 19:29:38 +00:00
|
|
|
return `${this.dPath}/${this.index}`;
|
2017-08-28 17:43:57 +00:00
|
|
|
}
|
|
|
|
}
|