1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.SignerWithAddress = void 0;
|
4 | const ethers_1 = require("ethers");
|
5 | class SignerWithAddress extends ethers_1.ethers.Signer {
|
6 | constructor(address, _signer) {
|
7 | super();
|
8 | this.address = address;
|
9 | this._signer = _signer;
|
10 | this.provider = _signer.provider;
|
11 | }
|
12 | static async create(signer) {
|
13 | return new SignerWithAddress(await signer.getAddress(), signer);
|
14 | }
|
15 | async getAddress() {
|
16 | return this.address;
|
17 | }
|
18 | signMessage(message) {
|
19 | return this._signer.signMessage(message);
|
20 | }
|
21 | signTransaction(transaction) {
|
22 | return this._signer.signTransaction(transaction);
|
23 | }
|
24 | sendTransaction(transaction) {
|
25 | return this._signer.sendTransaction(transaction);
|
26 | }
|
27 | connect(provider) {
|
28 | return new SignerWithAddress(this.address, this._signer.connect(provider));
|
29 | }
|
30 | _signTypedData(...params) {
|
31 | return this._signer._signTypedData(...params);
|
32 | }
|
33 | toJSON() {
|
34 | return `<SignerWithAddress ${this.address}>`;
|
35 | }
|
36 | }
|
37 | exports.SignerWithAddress = SignerWithAddress;
|
38 |
|
\ | No newline at end of file |