Hot answers tagged

9 votes
Accepted

Which NodeJs UI Framework is most suitable for EOSJS

This is a very subjective thing. Personally I would recommend to learn React with Redux. Here is a little Tutorial The main advantage is that you can use React for the visual representation und ...
user avatar
  • 2,104
8 votes
Accepted

Reading table rows with EOSJS

You have several ways to retrieve data from eos chain as i know. They differs a lot, so you should find a better one for you case. #1. Get from table As you noted there is getTableRows method in ...
user avatar
6 votes
Accepted

Eos and Scatter

That's the eosjs object that you have in the browser as Scatter requires it to be present to be able to sign EOS transactions. See here: https://github.com/EOSIO/eosjs Eos = require('eosjs') The ...
user avatar
  • 1,686
6 votes

EOSJS tutorials

I think the best examples lives in Scatter-Demo repository: https://github.com/EOSEssentials/Scatter-Demos I have also built MonsterEOS where you can check another interaction with EOSJS and Scatter:...
user avatar
  • 3,023
6 votes
Accepted

EOSjs getTableRows lower and upper bound on account name

The eosjs library has a format module that will transform account name strings into the appropriate table keys... const Eos = require("eosjs") const BigNumber = require("bignumber.js") const ...
user avatar
6 votes
Accepted

Can we set permission using eosjs?

Basically, pull the existing permission, change only what you need to change, then pass everything back to updateauth .. async function getNewPermissions(accountName) { const account = await eos....
user avatar
6 votes

how to create private network same as mainnet?

There is an article in the documentation detailing how you can setup and run a network with multiple producers, voting, and resource consumption. Excerpt: In this tutorial, we will start a number ...
user avatar
  • 5,524
6 votes

Multiple EOS transfers in a single transaction

In a smart contract, you could do this by emplacing multiple actions into a single transaction, as follows: transaction transfer; transfer.actions.emplace_back(eosio::permission_level {_self, N(active)...
user avatar
5 votes

Which NodeJs UI Framework is most suitable for EOSJS

I heavily use eosjs with Vue.js+Vuex, it is much more developer friendly and easier to learn than React when you want to scale. The first EOS browser extension, Scatter, also uses Vue for the frontend ...
user avatar
4 votes

Where is the API for block producer voting in EOSJS?

There is a system contract for voting. It can be found here: https://github.com/EOSIO/eos/blob/master/contracts/eosio.system/voting.cpp ABI can be found here: https://github.com/EOSIO/eos/blob/...
user avatar
4 votes

How can I get an accounts currency balance using eosjs

In eosjs v20.x, getCurrencyBalance has been renamed to get_currency_balance, and moved within the Rpc object. You can use it like this... const fetch = require('node-fetch'); const { JsonRpc } = ...
user avatar
4 votes

EOSJS vote producer fails when voting for more than two producers?

const sortedBPs = producers.sort(); await eos.voteproducer(userAccountName, proxy, sortedBPs ); ...Adding a sort and moving it outside the await fixed the issue.
user avatar
  • 81
4 votes
Accepted

New version of eosjs does not use chainId, How does it work?

eosjs does require chainId, but if it isn't provided directly it will be retrieved from the host endpoint. Api accepts chainId as an argument but if chainId isn't passed as an argument when the api ...
user avatar
  • 1,165
4 votes
Accepted

How to transfer EOS Token with eosjs?

After searching the official doc and trying different approches I finally got it to work. I've used eos.transaction instead of eos.transfer and the following example is working for those interested: ...
user avatar
  • 175
4 votes

Is there any IDE for eos smart contract?

Yes there is IDE for eosio you can try to this IDE https://www.eosstudio.io/
user avatar
  • 957
3 votes
Accepted

What is the maximum speed of EOS?

TL;DR: Single threaded performance: up to 8,000 TPS Multi-threaded performance: unlimited TPS Here's what Dan Larimer said at the launch of Dawn 3.0 https://medium.com/eosio/eosio-dawn-3-0-now-...
user avatar
3 votes

Where is the API for block producer voting in EOSJS?

Call voteproducer.. > eos.voteproducer() CONTRACT eosio FUNCTION voteproducer PARAMETERS { "voter": "account_name", "proxy": "account_name", "producers": "account_name[]" } EXAMPLE ...
user avatar
  • 173
3 votes

How to get operations history of account?

Of course, eosjs provides method getActions. Here's an example: const Eos = require('eosjs'); const api = new Eos({ httpEndpoint: 'https://eos.greymass.com', chainId: '...
user avatar
  • 131
3 votes

How to get operations history of account?

You can simply request a node to give you the action history of an account. Using cleos: cleos --url https://api1.eosdublin.io get actions <EOS account name> Using eosjs: const eosjs = ...
user avatar
3 votes
Accepted

What is the best way of storing data on EOS blockchain?

A good way would be to use the demux-js library. It listens for specified actions and allows updating logic for whatever kind of database you like. This is a RAM free option which essentially allows ...
user avatar
  • 3,405
3 votes
Accepted

How to watch my account for transactions

If you have the cheddar, you could go for a web-socket connection. https://www.dfuse.io/en - EOS Canada https://eospark.com/openapi If not, demux is likely your best bet. For best results, you ...
user avatar
  • 3,405
3 votes

How do i convert a 128_t binary hex to decimal in eosjs?

0x is a flag for compilers to know that it's a hex value. This isn't required for hexToUint8Array();
user avatar
2 votes

How to find the closest node to connect to mainnet in my dapp?

I know you want a web API for this but the simple thing to do would be to get cleos installed and call it from an AJAX endpoint to run: cleos -u http://api.eosnewyork.io system listproducers This ...
user avatar
  • 843
2 votes

EOSJS what is the keyProvider

Exactly, it provides private keys used to sign transactions. Here the definition from the eosjs github page: keyProvider [array|string|function]: Provides private keys used to sign transactions. ...
user avatar
2 votes

EOSJS what is the keyProvider

Yes you need a private key. If you are doing a front-end where you need to use EOSjs and need user's private key, ask them to enable Scatter wallet instead and you simply get an eosjs object from ...
user avatar
  • 843
2 votes
Accepted

How to prevent cheating in a turn-based-game on blockchain?

You could use an approach similar to the dice contract sample: Each user submits sha256(move), where move contains the user's actions plus a random number After the turn, each user submits move. The ...
user avatar
  • 1,985
2 votes
Accepted

How to get account name from Public or Private key via eosjs?

Use eosjs get_key_accounts. See https://github.com/EOSIO/eosjs-api/commit/21675aec294d6f65f3cbace049839751a087676f
user avatar
  • 236
2 votes
Accepted

EOS: How to get structured data within transaction?Is there restful API for this/

Yes there is. You can get this data from nodes that are running with the history_plugin plugin. You could use the HTTP API directly as in /v1/history/get_transaction, or you could use cleos: cleos --...
user avatar
2 votes

How can I transfer RAM from one account to another?

Short answer: You can't. From the mainnet governance repository: {{buyer}} acknowledges that RAM is non-transferable. What you can do to transfer RAM to someone is simply buying more RAM and ...
user avatar
2 votes
Accepted

EOSJS Api Is it possible to iterate over and eval the functions?

I guess the problem lies in the this.test allocation, because the result of your eos call is this.test, which is likely to be a promise. If you have Babel installed or ES6 support you can use an ...
user avatar
  • 2,104

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