Hot answers tagged

5

You express the Unit in JavaScript by calling the method like this contract_instance.method([["unit"]]);


4

This is not something you will be able to achieve with Taquito (at least not for now, that will change in the future) and you have to use an indexer API. I recommend Better Call Dev API, you can easily get the number of keys with a fetch call to api.better-call.dev/v1/bigmap/${network}/${big_map_id}/keys (the big map ID should be available in Taquito by ...


2

As far as I know, you cannot check if the entrypoint returns the balance with JavaScript, because the entrypoint doesn't return a value but emits a transaction. I didn't try it for a FA2 token contract but to test a FA1.2 token contract with Truffle, I wrote a simple contract that would call the FA1.2 balance_of entrypoint and receive the balance on a ...


2

I haven't found a solution myself using what is provided by Truffle to do what you want, so here is what I do. I guess you must be using Taquito. In this case, you can use this function to change the signer whenever you need: const signerFactory = async pk => { await Tezos.setProvider({ signer: new InMemorySigner(pk) }); return Tezos; }; However, ...


2

The correct syntax for the parameter is the following: "remove", [account1, account2] (2 different parameters, no object). I built a simple contract to emulate your case, deployed it and wrote a little script to test it. After calling the entrypoint of your choice, you must provide 2 parameters: 1- the field you want to set the union value with 2- ...


1

It worked as soon as I provided the HEX of the addressSet[] values. Maybe someone can explain why this is the case. I stumbled upon this solution after trying out for hours by accident.


1

I believe the error is that you pass the 2 parameters (add and remove), but you should only pass the chosen one. I suggest you try : { add: [account1, account2] }


1

For some reason you need to represent the timestamp as a string. So contract_instance.test("1"); will work.


Only top voted, non community-wiki answers of a minimum length are eligible