0

I'm trying to understand the correct typing I should use for a web3 eth contract that is one of the parameters of my function:

import * as express from "express";
import { check, oneOf, validationResult } from "express-validator";
import * as web3 from "web3";

function publicApi(
  app: express.Application,
  blockPartiesPublic: <not sure what should go here>
) {
1

I couldn't know for sure if you only want to know the web3.eth.Contract type. But if it's what I imagine you can use this:

import { Contract } from 'web3-eth-contract';

For example:

import { Contract } from 'web3-eth-contract';
import { AbiItem } from 'web3-utils';

const Contract = new web3.eth.Contract(Token.abi as AbiItem, address)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.