Skip to content

Commit

Permalink
fix: eth signer
Browse files Browse the repository at this point in the history
  • Loading branch information
nitinmittal23 committed Mar 7, 2024
1 parent d702f08 commit 4bfe2b6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ethers/web3_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export class EtherWeb3Client extends BaseWeb3Client {
if ((provider as ETHER_PROVIDER)._isProvider) {
this.provider = provider as ETHER_PROVIDER;
this.signer = this.provider.getSigner();
if (!this.signer || !this.signer._address) {
this.signer = (provider as any);
}
}
else {
this.signer = (provider as any);
Expand Down Expand Up @@ -93,7 +96,7 @@ export class EtherWeb3Client extends BaseWeb3Client {
getTransactionReceipt(transactionHash: string) {
return this.provider.getTransactionReceipt(transactionHash).then(result => {
this.ensureTransactionNotNull_(result);

return ethReceiptToMaticReceipt(result);
});
}
Expand Down Expand Up @@ -151,14 +154,14 @@ export class EtherWeb3Client extends BaseWeb3Client {
hexToNumber(value) {
return BigNumber.from(value).toNumber();
}

hexToNumberString(value) {
return BigNumber.from(value).toString();
}

signTypedData(signer, typedData) {
const {domain, types, message: value} = typedData;
if(types.EIP712Domain) {
const { domain, types, message: value } = typedData;
if (types.EIP712Domain) {
delete types.EIP712Domain;
}
return this.signer._signTypedData(domain, types, value);
Expand Down

0 comments on commit 4bfe2b6

Please sign in to comment.