Questions tagged [javascript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
35 views

General solution for getting fungible token balance off-chain

Given the public hash of a fungible token contract, I want to get the amount of tokens owned by a wallet. I want to perform this operation off-chain so that it is free. FA1.2 (tzip7) has getBalance() ...
user avatar
  • 139
0 votes
1 answer
59 views

Manipulation of Tezos.amount and test cleanup storage

I am about to write some tests to verify some method functionality. The method functionality is quite simple: function checkAmount(const store : storage) : storage is block{ if Tezos.amount <= ...
user avatar
1 vote
1 answer
31 views

Call method taking timestamp as parameter from JavaScript

I have a Truffle instance of the contract and I call the method like this contract_instance.test(1); Where test in a function that takes a timestamp as parameter. This gives me this error message: ...
user avatar
2 votes
1 answer
88 views

How to call PACK in JavaScript

In my smart contract in LIGO I serialize some data using Bytes.pack which calls the underlying PACK Michelson instruction. In my case, the function signature is (nat, address, nat) -> bytes. Does ...
user avatar
3 votes
1 answer
181 views

How do I call the FA2 balance_of endpoint through Truffle?

I have written a contract to implement FA2 and I have a Truffle/JavaScript setup to test this contract while running against a sandboxed node. I can test the transfer endpoint and the update_operators ...
user avatar
5 votes
3 answers
484 views

How to decode raw transaction?

I am using @taquito to build and sign a transaction. But before I send it I want to decode it to check my destination address, amount etc like you would normally do for other blockchains. Not sure ...
user avatar
  • 157
1 vote
1 answer
227 views

How to increase the counter of a transaction

I am using @taquito/taquito. To transfer tezos tokens from one address to another is am using below function. Tezos.contract.transfer({ to: toAddress, amount: amountToSend, ...
user avatar
4 votes
1 answer
221 views

How to estimate Baker and Storage fee with @taquito for a contract?

I have a simple smart-contract that holds user funds and that can be withdrawn by sending a signed message. However, I would like to offer the possibility for users to anticipate the fees they have ...
user avatar
2 votes
2 answers
461 views

How to retrieve data from smart-contract using javascript?

I have stored data that I would like to retrieve from a deployed smart-contract. The storage structure was defined using SmartPy: def __init__(self): self.init(bmap=sp.big_map(tkey=sp....
user avatar
1 vote
1 answer
28 views

How to fix 'paused before out-of-memory crash' contract deployment error in browser? [ConseilJS]

I wish to deploy a contract using ConseilJS that I am able to originate successfully using smartpy.io However, when I copy the generated Michelson and initial storage into the following function: ...
user avatar
1 vote
1 answer
134 views

How to interact with SmartPy BigMap in contract?

I would like to setup a smart contract that contains (as defined by smartpy) a BigMap storage. I have the following code: import smartpy as sp class contract(sp.Contract): def __init__(self): ...
user avatar
2 votes
1 answer
51 views

ConseilJS TezosContractIntrospector.generateEntryPointsFromAddress `Uncaught (in promise) TypeError: Cannot read property '0' of undefined`

Trying to retrieve contract entry points using the TezosContractIntrospector The following code: async function entry_points(){ const server={ url:'https://conseil-dev.cryptonomic-infra.tech:...
user avatar
2 votes
1 answer
207 views

How to deploy a smart contract influenced by UI inputs using ConseilJS and SmartPy generated Michelson?

I wish to be able to create a smart contract taking input from a UI to supply parameters pubKey,prvKey,pubHash for the deployment and minAmount and maxTime to influence the Michelson. I have the ...
user avatar
1 vote
1 answer
71 views

Transfer operation using ConseilJS

I'm trying to use ConseilJS to make a transfer to a contract from a webpage. I'm using a keystore object based on my tezos-client wallet. const keystore = { publicKey: '...
user avatar
  • 716
1 vote
3 answers
116 views

How to ensure that operation was included in a block with taquito

When I inject an operation using the taquito library, how can I have my program wait for a specific number of blocks after my operation is included in the network.
user avatar
1 vote
1 answer
156 views

How to originate a smart contract with Taquito

How can I access my contract after originating it using taquito? If I use taquito like this. Tezos.contract.originate({...contractOptions}) How can I access my new originated address and start using ...
user avatar
1 vote
1 answer
156 views

How can I derive a public key from a known private key?

Edpk from a edsk, programmatically?
user avatar
3 votes
0 answers
15 views

API Ballots not working

The API : https://api6.tzscan.io/v3/ballots/11 is not working, I don't understand why. Tzscan API instructions : https://tzscan.io/api#operation/405
user avatar
  • 141
2 votes
1 answer
44 views

Is there a TzScan API to find the number of Tezos Node?

I'm looking for an API to get the number of Tezos Node or the number of Bakers.
user avatar
  • 141
3 votes
0 answers
38 views

Is there a TzScan API to find the total number of delegated Tezos?

I'm looking for an API to get the total number of delegated Tezos. I already found an API to get the number of rolls delegated: https://api6.tzscan.io/v3/rolls_history/...
user avatar
  • 141
4 votes
2 answers
86 views

Issue with API Request Cycle

I have an issue to request the Cycle Number from this API. I don't understand how to use the map to get the data from the last cycle only. const ul2 = document.getElementById('Cycle'); const url2 =...
user avatar
  • 165
4 votes
1 answer
177 views

API Access HTML/Javascript problem

I have an issue trying to use javascript to get the circulating supply by requesting data from Tzscan API: HTML code to request the circulating supply: <!DOCTYPE html> <html> <head>...
user avatar
  • 165
7 votes
2 answers
473 views

Base58 encoding/decoding of addresses in Micheline

who know some javascript library for decoding optimized Micheline representation of an address value? 011cd5f135e80fd8ebb6e43335b24ca6116edeba6900 => KT1BDEn6wobs7tDReKkGheXAhoq278TGaNn5
user avatar