Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
Moralis Web3API react hook returning 400

For some reason, my getNFTsForContract web3API call keeps returning 400s, but I can't tell why. Here is what I'm using to make the call:

const { fetch, data, error, isLoading } = useMoralisWeb3ApiCall(
    Web3Api.account.getNFTsForContract,
    {
      chain: networkId,
      address: user,
      token_address: retroCatsAddress,
    }
  )

And it looks like in my browser inspect tools that the request body of the API call is ok. I also have setup the MoralisProvider like so:

ReactDOM.render(
  <MoralisProvider
    appId={process.env.REACT_APP_MORALIS_APP_ID}
    serverUrl={process.env.REACT_APP_MORALIS_SERVER_URL}
  >
    <App />
  </MoralisProvider>,
  document.getElementById('root')
)

But am wondering if I'm missing something. The parameters i'm passing are:

address: 0x643315C9Be056cDEA171F4e7b2222a4ddaB9F88D chain: 4 token_address: 0xc8d8B5a3ED2aA35Df8F1781F2B06A14Fb0411bc8

And I've verified that the address in question has NFTs on the token_address.

So what am I missing?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to provide the chain as a string and in hex form:

const { fetch, data, error, isLoading } = useMoralisWeb3ApiCall(
    Web3Api.account.getNFTsForContract,
    {
      chain: "0x4",
      address: user,
      token_address: retroCatsAddress,
    }
  )
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!