sei-ec-remote / project-2-issues

1 stars 0 forks source link

Difficulty integrating API into the search bar #76

Closed daenamcclintock closed 2 years ago

daenamcclintock commented 2 years ago

What's the problem you're trying to solve?

I'm trying to integrate my API so the NFTs are searchable.

Post any code you think might be relevant (one fenced block per file)

const Moralis = require("moralis/node");
const { timer } = require("rxjs");

const serverUrl = "https://1sa1hg8dmqdd.usemoralis.com:2053/server" // link to server url in .env
const appId = "4n89IUpSAyBXWWPJtQbmcNsdA8FHIfFkIyzphIVq" // link to application id in .env
Moralis.start({ serverUrl, appId})

const collectionAddress = "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"; // NFT Collection Address
const collectionName = "BoredApeYachtClub"; // NFT Collectioon Name

const NFTs = await Moralis.Web3API.token.getAllTokenIds({
      address: collectionAddress,
    });

If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?

No error message.

What is your best guess as to the source of the problem?

I'm having difficulty with the syntax to integrate my API into the search aspect of website.

What things have you already tried to solve the problem?

I tried following a similar format to the Fetch assignment, but I think the syntax needs to be different because this API uses the await function to call the API.

Paste a link to your repository here

https://github.com/daenamcclintock/Project-2

cory-yonomi commented 2 years ago

Worked on the promises, closing this!