Skip to content

Commit

Permalink
feat(Account): account constructor should take a KeyPair or a Signer …
Browse files Browse the repository at this point in the history
…as parameter
  • Loading branch information
jcaporossi-ledger committed Mar 23, 2022
1 parent 8ef4cf6 commit ea6ae40
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/account/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export class Account extends Provider implements AccountInterface {

private signer: SignerInterface;

constructor(provider: Provider, address: string, keyPair: KeyPair) {
constructor(provider: Provider, address: string, keyPairOrSigner: KeyPair | Signer) {
super(provider);
this.signer = new Signer(keyPair);
this.signer =
keyPairOrSigner instanceof Signer ? keyPairOrSigner : new Signer(keyPairOrSigner as KeyPair);
this.address = address;
}

Expand Down

0 comments on commit ea6ae40

Please sign in to comment.