Yes, it is working just fine right now:
Bellow you can see the code that I temporarily wrote in order to keep my app working.
async function getBalances( cardId ) {
/* old code that doesn't work anymore */
const options = {
chain: CHAIN,
address: myAddress,
token_address: CARTERO_NFT,
token_id: cardId
};
const balance = await Moralis.Web3API.account.getNFTsForContract(options);
if( balance.result.length > 0 ) {
console.log(balance)
return balance.result[0].amount;
} else {
return 0;
}
/*
//new ugly code for getting the cards amount
let allUserCards = await getAllUserCards();
if (allUserCards['result'].length) {
for(let i = 0; i < allUserCards['result'].length; i++) {
if( allUserCards['result'][i].token_id == cardId){
return allUserCards['result'][i].amount;
}
}
}
return 0;
*/
}
Here is the full object returned after you fixed the problem:
{
“total”: 1,
“page”: 1,
“page_size”: 100,
“cursor”: null,
“result”: [
{
“token_address”: “0x5f312161aaf0beffe514177118be47dd81cc8412”,
“token_id”: “72”,
“owner_of”: “0xa1805583f58f645f60bc345972a4de0fcd9ea598”,
“block_number”: “20932604”,
“block_number_minted”: “20057563”,
“token_hash”: “9c76532db048c919ff28879210f0d9aa”,
“amount”: “3”,
“updated_at”: “1657441434.569”,
“contract_type”: “ERC1155”,
“name”: null,
“symbol”: null,
“token_uri”: “https://5oxgrye0adsz.usemoralis.com/{id}.json”,
“metadata”: null,
“last_token_uri_sync”: “2022-06-11T10:41:35.182Z”,
“last_metadata_sync”: “2022-06-11T12:53:46.688Z”
}
],
“status”: “INSERTING”
}
Thank you so much! This kind of help makes a HUGE DIFFERENCE.