0

I am calling balance_of function of contract using taquito but i am facing issue that how to pass parameters address and token value in it as it sit showing error const createInstance=async(res,obj,i)=> {

const contract = await Tezos.wallet.at('KT1M81KrJr6TxYLkZkVqcpSTNKGoya8XytWT').then(async(instance) => {  
    let methods = instance.parameterSchema.ExtractSignatures();
    console.log("<====>",methods)

    let number =0
    const balance = await instance.methods.balance_of({"address":"tz1YTMzKPWur5nm1sXTaHeNgAJeJX4E6kgbh"},0).then(output => {  

    console.log("balance is",output)
    })  
}).catch(err => {
    console.log(err)
})

console.log("Instance is");

}

0

For now, Taquito doesn't work with entrypoints that require a value of type contract, so you cannot call the balance_of entrypoint of an FA2 contract from Taquito. In general, you wouldn't need it because the entrypoint is reserved to get the balance of a user on-chain. With Taquito, you can read the balance directly from the ledger bigmap in the storage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.