Hot answers tagged

6

Michelson doesn't support multiple entry points right now. Liquidity uses unions (or type variables) to make up for this. A union has a Left and Right side, but can also be nested. Let's analyse the parameter of the script provided: parameter (or :_entries (int %_Liq_entry_create) <-- Left Side (int %_Liq_entry_main)) <-- Right ...


6

Before sending transactions from an account, a 'reveal' operation must be made for the account. It looks like this account may have been activated, but not yet revealed. To make this work we would need to include the reveal operation in the list of operations: sotez.rpc.getHead() .then(head => { const operation = { branch: head.hash, ...


5

Last commit to eztz-cli was in November of 2017. So I would consider it outdated. The query in getBalance() is no longer valid. It's no longer possible to create free accounts, you need to use the faucet instead. Try to use eztz directly instead and it should work.


5

Yes this is possible with sotez. There initially was a bug with the activate function which was just fixed in 0.2.11. You can do something like the following to activate an account as well as generate the keys: import { rpc, crypto } from 'sotez'; // tz1eQV2GqDTY7dTucnjzNgvB5nP4H5c7Xr5m.json const accountJSON = { "mnemonic": [ "raw", "peace", ...


4

You can do this using the eztz library. Here are the relevant commands you want to look at: //Point to alphanet node eztz.node.setProvider("https://alphanet.tezrpc.me"); //From https://faucet.tzalpha.net/ var faucet = { "mnemonic": [ "viable", "decline", "spend", "excess", "hour", "panel", "decade", "sniff", "blame", ...


4

You can use the contract send method: eztz.contract.send(contract, keys, amount, parameter, fee, gasLimit, storageLimit) For parameter, you just enter in the raw Michelson input (the same you would use via the tezos-client command). e.g. You could do: eztz.contract.send(contract, keys, amount, '(Left (Pair "test" 1))', fee, gasLimit, storageLimit) //For ...


3

npm i eztz wont work. Instead you can add eztz's git repo as a dependency in your package.json "dependencies": { "eztz": "git://github.com/TezTech/eztz.git#0c6b93ffdd774f7ed3c528058f854deb0649a61c" } After that you just run npm i or yarn to install the package. When you want to use the library you have to import it import { eztz } from 'eztz';...


3

I don't have a readily available example for you but in eztz, contracts have a method send with a parameter parameter. That should do the trick. send : function(contract, keys, amount, parameter, fee){ return eztz.rpc.sendOperation({ "kind": "transaction", "amount": amount*100, "destination": contract, "parameters": eztz.utility.ml2tzjson(...


2

Tzscan has joined the Dune network and APIs can change quite dramatically, which will break your app. Why not using Taquito? It is simple and elegant and the package being bundled with your app, it won't break if there is an update. import { Tezos } from "@taquito/taquito"; [...] Tezos.setProvider({...}); const contract = await Tezos.contract.at(...


2

I found the solution! For me it: function httpGet() { let xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET", 'https://alphanet-node.tzscan.io/chains/main/blocks/head/context/contracts/<CONTRACT_ADDRESS>/storage', false ); // false for synchronous request xmlHttp.send( null ); return JSON.parse(xmlHttp.responseText) } It returns ...


2

There's actually a new function with eztz that does this now: eztz.rpc.awaitOperation( opHash, //The operation hash to watch interval, //Optional - Time between checks, defaults to 30 seconds timeout//Optional - Timeout - will end after this, defaults to 180 seconds ).then(function(blockHash){ //Will resolve with the blockHash if found console.log(...


2

I fixed the problem just know, the thing here was that i didn't realize until i noticed how i was receiving the balance of the contract that i had to send the atomized value of the amount in tez. So basically the conversion is quite simple ... You want the atomized value: value(int/float) * 1 000 000 You want the int/float value instead of the atomized ...


2

With regards to the difference between public key (pk), secret key (sk) and public key hash (pkh). The public key is used by other people to send encrypted messages to you, and it is also used by other people to verify that messages you send actually are from you The secret key is used by you to send messages The public key hash is used to identify your ...


2

These are very different operations... activate_account is an anonymous operation that bootstraps the account with some coins purchased during ICO. So, this is for the ICO participants only. Or for the testnets' faucet. reveal is a manager operation that shows everyone your public key, so that everyone can verify your signature in subsequent operations. It'...


1

TLDR: the first operation you injected in your node is valid but will be never be injected by other nodes/bakers because it has too low fees. It is then stuck in the mempool and make the the next operations you're trying to forge invalid because the next valid counter you want to use is already being taken by the too low fee operation. You can restart your ...


1

This occured because the Michelson in the parameter was ill written and the fee was to low. So these were the changes i made to the function ... -Before: eztz.contract .send( "KT18qHvhEZUwiawA8QEURwuK8RGJj184725L", "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv", keysextracted, 5, "RIGHT LEFT UNIT", 1000, 400000, 10000 ) -After: eztz.contract ...


1

Extracting an answer from the comments (kudos to @Klassare) That the private key (keysext.sk) is passed as an argument when eztz expects a keys object (keys = {pkh: string, sk: string, pk: string}) is one problem. Just pass the whole keys object instead. eztz.contract.send( "KT18qHvhEZUwiawA8QEURwuK8RGJj184725L", keysext.pkh, keysext, 5, "RIGHT LEFT UNIT", ...


1

I also faced same error - "Branch refused" sometimes for contract deployment on tezos network. This error occurs when we use wrong network url. First of all make sure your network provider link is correct. And try by changing gas price and maximum limit values while deploying. This might help you out.


1

You can use eztz function as that worked for me, storage = await eztz.contract.storage(contractAddress); The output will be in JSON format, you can stringify the output as, JSON.stringify(storage); Hope that will help you. Good luck...


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