getNFTS for contract

this is returning one error or another
header.ts initializes moralis

  ngOnInit(): void {

    Moralis.initialize("***");
    Moralis.serverURL = '***';
    this.init();
  }

this returns some error code or another
Cannot read properties of undefined (reading ‘appId’) when I include start

Web3Api not initialized, run Moralis.start() first
when I use await Moralis.enable();

Moralis.enable() is deprecated and will be removed, use Moralis.enableWeb3()

you guys just told use to use Moralis.enable a month ago, now it’s enableWeb3?

  public GET_AUCTION_NFTS(): Promise<any>{
    return new Promise(async (resolve, reject)=>{
      try {

        await Moralis.start()
        const options = { chain: '0x61', address:TEASHOP, token_address: NFT };
        const NFTS = await Moralis.Web3API.account.getNFTsForContract(options);
        //console.log(NFTS);

        resolve(NFTS.result);

      } catch (error) {
        console.log(error);
      }


    })
  }

works with
const appId = "*";
const serverUrl = 'https://
’;
Moralis.start({ serverUrl, appId });

NOT Moralis.initialize
you are making breaking changes, we don’t know about

Hi!

I already showed you the right way of initialization your app in the discord. You have it in your second message.

This is not a breaking change you still can use the previous init method. Also we added this new syntax for app initialization about month ago

Moralis.Web3.enable() => Moralis.enable() => Moralis.enableWeb3()

And you still can use outdated syntax.

Moralis.enable() is deprecated and will be removed, use Moralis.enableWeb3() is a warning for devs to update the syntax. We usually don’t do any breaking changes

1 Like