CryptoFly.us | CRYPTOCURRENCY BITCOIN SHIRTS CLOTHING APPAREL HATS

CRYPTO NEWS

6 Questions for Yat Siu of Animoca Brands

Typescript creating web3 contract abi

Trying to do a simple test call to my contract, im getting this error on the contract instantiation part, Type ‘{ contractName: string; abi: ({ inputs: any[]; stateMutability: string; type: string; anonymous?: undefined; name?: undefined; outputs?: undefined; constant?: undefined; } | { anonymous: boolean; inputs: { …; }[]; … 4 more …; constant?: undefined; }::Listen

Trying to do a simple test call to my contract, im getting this error on the contract instantiation part,

  Type '{ contractName: string; abi: ({ inputs: any[]; stateMutability: string; type: string; anonymous?: undefined; name?: undefined; outputs?: undefined; constant?: undefined; } | { anonymous: boolean; inputs: { ...; }[]; ... 4 more ...; constant?: undefined; } | { ...; } | { ...; })[]; ... 18 more ...; userdoc: { ...; }; }' is missing the following properties from type 'AbiItem[]': length, pop, push, concat, and 29 more 

With this code, the AANFT.json i am importing is the abi that was created and is already running up on the testned

    import dotenv from "dotenv"     import { AbiItem } from 'web3-utils'     import Abi from "./../models/AANFT.json"          const Web3 = require("web3");     dotenv.config()     const infura_URL = process.env.infura_URL     const contractAddress = process.env.contractAddress;     const abi = Abi          class BlockChain{         web3 = new Web3(             new Web3.providers.WebsocketProvider(`wss://ropsten.infura.io/ws/v3/${infura_URL}`)         )         contract = new web3.eth.Contract(abi as AbiItem[], contractAddress);         public getNFTDetails(): void{             let _owner = this.contract.methods.owner().call().then(result => console.log("Result",result))         }          }     export default BlockChain 

This is a link to the hosted contract on etherscan https://ropsten.etherscan.io/address/0x64e689a61bd06b49b731097ef5c18ba3f600da92

6 Questions for Yat Siu of Animoca Brands

Shopping cart
There are no products in the cart!
Continue shopping
0