diff --git a/src/helpers/providers/ethersV6.ts b/src/helpers/providers/ethersV6.ts index 8819ed3b..895507a0 100644 --- a/src/helpers/providers/ethersV6.ts +++ b/src/helpers/providers/ethersV6.ts @@ -1,33 +1,16 @@ import type { Address, ContractCallerFunctions, - NoExtraKeysCheck, SignTypedDataContractCallerFn, StaticContractCallerFn, TransactionContractCallerFn, } from '../../types'; -import type { - // JsonRpcProvider, - // BaseProvider, - JsonRpcSigner, -} from '@ethersproject/providers'; -// import type { Signer } from '@ethersproject/abstract-signer'; -import type { - // Contract as EthersContract, - PayableOverrides, - CallOverrides, -} from '@ethersproject/contracts'; -import { assertEthersContractHasMethodsV5 } from '../misc'; import { assert } from 'ts-essentials'; import type { - BrowserProvider, JsonRpcProvider, - Provider, Signer, ContractRunner, - JsonRpcApiProvider, Contract as EthersContract, - ContractMethod, Overrides, TypedDataDomain, ContractTransactionResponse, @@ -50,7 +33,6 @@ export const constructContractCaller = ( const contract = new Contract(address, abi, providerOrSigner); - // assertEthersContractHasMethodsV5(contract, contractMethod); // drop keys not in CallOverrides const { block, gas, ...restOverrides } = overrides; // reassign values to keys in CallOverrides @@ -60,22 +42,10 @@ export const constructContractCaller = ( gasLimit: gas, }; - // type FinalCallOverrides = normalizedOverrides has extra props ? never : normalizedOverrides - type FinalCallOverrides = NoExtraKeysCheck< - typeof normalizedOverrides, - Overrides - >; - const callableContractFunction = contract.getFunction(contractMethod); // returns whatever the Contract.method returns: BigNumber, string, boolean return callableContractFunction(...args, normalizedOverrides); - - // enforce overrides shape ethers accepts - // TS will break if normalizedOverrides type has any keys not also present in CallOverrides - // const callOverrides: FinalCallOverrides = normalizedOverrides; - // // returns whatever the Contract.method returns: BigNumber, string, boolean - // return contract.callStatic[contractMethod](...args, callOverrides); }; const transactCall: TransactionContractCallerFn< @@ -97,7 +67,6 @@ export const constructContractCaller = ( const contract = new Contract(address, abi, signer); - // assertEthersContractHasMethodsV5(contract, contractMethod); // drop keys not in PayableOverrides const { gas, from, ...restOverrides } = overrides; // reassign values to keys in PayableOverrides @@ -115,22 +84,6 @@ export const constructContractCaller = ( ); return txResponse; - - // type FinalPayableOverrides = normalizedOverrides has extra props ? never : normalizedOverrides - // type FinalPayableOverrides = NoExtraKeysCheck< - // typeof normalizedOverrides, - // PayableOverrides - // >; - - // // enforce overrides shape ethers accepts - // // TS will break if normalizedOverrides type has any keys not also present in PayableOverrides - // const txOverrides: FinalPayableOverrides = normalizedOverrides; - // const txResponse: ContractTransaction = await contract[contractMethod]( - // ...args, - // txOverrides - // ); - - // return txResponse; }; const signTypedDataCall: SignTypedDataContractCallerFn = async ( @@ -148,8 +101,6 @@ export const constructContractCaller = ( ? await providerOrSigner.getSigner(account) : providerOrSigner; - // assert(isTypedDataCapableSigner(signer), 'Signer can sign typed data'); - const { data, domain, types } = typedData; const normalizedDomain: TypedDataDomain = { diff --git a/tests/nftOrders.test.ts b/tests/nftOrders.test.ts index 50816da1..28ead73d 100644 --- a/tests/nftOrders.test.ts +++ b/tests/nftOrders.test.ts @@ -3,10 +3,6 @@ import Web3 from 'web3'; import type { TransactionReceipt as Web3TransactionReceipt } from 'web3'; import { BigNumber as BigNumberEthers, Contract, ethers } from 'ethers'; import { ethers as ethersV6 } from 'ethersV6'; -import type { - TransactionResponse as EthersTransactionResponse, - TransactionReceipt as EthersTransactionReceipt, -} from '@ethersproject/abstract-provider'; import { hexValue, hexZeroPad } from '@ethersproject/bytes'; import axios from 'axios'; import {