diff --git a/typescript/ethers-v5/src/ethers5Adapter.ts b/typescript/ethers-v5/src/ethers5Adapter.ts index f897e95..08fd690 100644 --- a/typescript/ethers-v5/src/ethers5Adapter.ts +++ b/typescript/ethers-v5/src/ethers5Adapter.ts @@ -5,6 +5,9 @@ import { FunctionCall } from "@skalenetwork/skale-contracts"; import { BaseContract, ethers } from "ethers"; +import { + ContractAddress +} from "@skalenetwork/skale-contracts/lib/domain/types"; import { Provider } from "@ethersproject/providers"; @@ -47,7 +50,7 @@ export class Ethers5Adapter implements Adapter { } // eslint-disable-next-line class-methods-use-this - isAddress (value: string): boolean { + isAddress (value: string): value is ContractAddress { return ethers.utils.isAddress(value); } } diff --git a/typescript/ethers-v6/src/ethers6Adapter.ts b/typescript/ethers-v6/src/ethers6Adapter.ts index e7d0c9b..c420c16 100644 --- a/typescript/ethers-v6/src/ethers6Adapter.ts +++ b/typescript/ethers-v6/src/ethers6Adapter.ts @@ -5,6 +5,9 @@ import { FunctionCall } from "@skalenetwork/skale-contracts"; import { BaseContract, Provider, ethers } from "ethers"; +import { + ContractAddress +} from "@skalenetwork/skale-contracts/lib/domain/types"; export class Ethers6Adapter implements Adapter { @@ -46,7 +49,7 @@ export class Ethers6Adapter implements Adapter { } // eslint-disable-next-line class-methods-use-this - isAddress (value: string): boolean { + isAddress (value: string): value is ContractAddress { return ethers.isAddress(value); } }