Hot answers tagged

6

You can use the tezos-codec binary to decode this: tezos-codec decode 006-PsCARTHA.operation from ...


5

As of Taquito release v6.1.0-beta.0 Taquito offers a new API for Maps which support pairs as keys in Maps and BigMaps. Here's a link to documentation & examples on Accessing Map values using Pairs


5

Taquito can parse forged bytes using the parse() method in the @taquito/local-forging package. TypeDocs are here. You can see the unit tests here. Implementation to decode a signed transaction: const { localForger } = require('@taquito/local-forging'); const sbytes = '...


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 ...


3

The contract you point to takes a single parameter of type address. Thus, as you write, it only has the default entrypoint. In taquito, the main entry point can be call through contract.methods.main. So your call should be: contract.methods.main(contractAddress).send()


3

There is no formula that will give you the full cost and gas usage of smart contract invocation. The best method is to simulate. Contract code size and storage directly affects costs through storage burn. Parameter size indirectly affect fees through gas size. See: Here for an overview on different fees and burns in Tezos. Here for a more detailed ...


3

You can call toTransferParams({amount: 5}) on the method you want to estimate, and pass that result to Tezos.estimate.transfer() The results of which will look something like: Estimate { _gasLimit: 66993, _storageLimit: 0, opSize: 216, baseFeeMutez: 100 } Full example: Tezos.contract.at('KT1KBhwoSeqJt26oK8yjubTfdSgDuaVC87xR')) .then(contract =>...


2

As of Taquito release v6.1.0-beta.0 Taquito offers a new API for Maps which provides you with get and set calls. The API does not offer an optional default value param, You will have to catch the error and assign your value. We will change the behaviour of get to return undefined on the unknown key. I will update this issue when it is released. You can ...


2

I ran your code, and found out that your payload hash is not correct; these lines of code: const payload: string = bufferToHexString(Buffer.from(bb)); await sodium.ready; const payloadHash = bufferToHexString(Buffer.from(sodium.crypto_generichash(32, payload))) . The function sodium.crypto_generichash involving the hashing of a uint8array and the ...


1

You can use the RPC endpoint: /chains/main/blocks/head/helpers/parse/operations to do that. Example: await axios.post( `${nodeURL}/chains/main/blocks/head/helpers/parse/operations`, parseOperationBytesData, { headers: { 'Content-Type': 'application/json' } } ...


1

Util Link: base58.ml The pre-apply RPC call validates the signature prefix, while the inject operation call doesn't. You should use the specific curve prefix. sig([4, 130, 43]) # sig(96) generic signature (Used after the operation injection) edsig([9, 245, 205, 134, 18]) # edsig(99) ED25519 signature (Used for tz1 signatures) spsig1([13, 115, 101, 19, 63]) #...


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 ...


1

Have you revealed the public key for tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb? You must reveal the key before you can transfer. You only have to do this once before you send for the first time.


1

Turns out I was setting the private key incorrectly.. I change to.. Tezos.setProvider({rpc: environment.network}); Tezos.importKey(environment.inMemorySigner); and all worked ok!


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