1

We are working for FA 1.2 Tokens with the

Ref Link: https://assets.tqtezos.com/docs/token-contracts/fa12/2-fa12-ligo/

and got stuck at this point.

Code Used:

const op = await contract.methods
      .getBalance(
        "tz1WBCcuxGrKagQRCSYVg3qQvDoRMrGaMaa2"
        // "KT1TjdF4H8H2qzxichtEbiCwHxCRM1SVx6B7"
      )
      .send();

Can anyone help us?

Error reference

enter image description here

1

If you just want the balance of the contract, you should directly look in its storage. What you are doing now is calling an entry point which will cause the contract to call another contract and pass its balance as as an input. There are circumstances where this might be what you want but, in that case, you will need to pass two parameters, one being the key your are querying and the other being which contract the FA1.2 contract should call with that result.

| improve this answer | |
  • Input: looking for balance in storage: console.log("Storage", contract.storage); Got the Output: Storage function () {} <constructor>: "Function" name: "Function" Can you help me with example. – Bala Surendaran Apr 29 at 13:21

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.