Closed 0xtaosu closed 3 years ago
Hey Guy! I run the demo of README and I paste it above ,
import * as Web3 from 'web3'; import { OpenSeaPort, Network } from 'opensea-js'; // This example provider won't let you make transactions, only read-only calls: const provider = new Web3.providers.HttpProvider('https://mainnet.infura.io'); const seaport = new OpenSeaPort(provider, { networkName: Network.Main, }); const asset = { tokenAddress: "0x06012c8cf97bead5deae237070f9587f8e7a266d", // CryptoKitties tokenId: "1", // Token ID } const balance = await seaport.getAssetBalance({ accountAddress, // string asset, // Asset }) const ownsKitty = balance.greaterThan(0) console.log(ownsKitty)
However, it print error message
const provider = new Web3.providers.HttpProvider('https://mainnet.infura.io'); ^ TypeError: Cannot read property 'HttpProvider' of undefined
Also , there are some info which may help you,
v14.15.4
6.14.10
^1.3.1
^1.1.10
Hope you can give me some advice and I ask same question on discord server
What was the solution?
Yeah what the solution
Hey Guy! I run the demo of README and I paste it above ,
However, it print error message
Also , there are some info which may help you,
v14.15.4
6.14.10
^1.3.1
^1.1.10
Hope you can give me some advice and I ask same question on discord server