Questions tagged [eosjs]

QAs about the JavaScript module eosjs which uses RPC-APIs to interact with an EOS.IO blockchain.

Filter by
Sorted by
Tagged with
1 vote
2 answers
337 views

How to transfer/deposit tokens on Front end Dapp with Scatter?

I am working on an EOS frontend Dapp with Scatter on local chain. I am getting a problem with transfer/deposit tokens from one account to another. After logging into scatter with "test1" and trying to ...
  • 31
1 vote
0 answers
98 views

scatter get identity generating a new publickey instead of using the keypair in the identity

I am trying to verify if account name belong to a publickey gotten in the client side with the browser. Why does scatter getIdenity function returns the right identity with the right eos account but ...
  • 11
1 vote
0 answers
317 views

How to call a contract from scatter

I want to make a transaction with Scatter but I'm getting this error function callContract(){ const account = scatter.identity.accounts.find(x => x.blockchain === 'eos'); const ...
  • 291
1 vote
2 answers
616 views

Querying EOSIO system contract table

How do I query an EOSIO system contract table ? As a learning challenge, I am trying to figure out how to calculate the amount of EOS votes cast and aggregate attributes of vote. Can I use eosjs to ...
  • 113
2 votes
2 answers
837 views

Getting Error while creating new account using EOSjs on Jungle-testnet

I am creating accounnt using EOSjs(20.0.0-beta1).My account_creat function goes like this: const createNewAccount = async ( account_name, owner_publicKey, active_publicKey ) => { try { ...
1 vote
1 answer
33 views

Data bandwidth usage fees in eos

Where is smart contract data like a table stored? When I use eojs and execute getTableRows for example, are there any fees or limits?
  • 11
5 votes
1 answer
2k views

How can I get an accounts currency balance using eosjs

In the new version of eosjs, the getCurrencyBalance() method is no longer supported. How can I still get the currency balance of an account using eosjs?
  • 51
2 votes
2 answers
300 views

How to make a random uint64 to send to an EOS contract

My friend had made an EOS contract and he has asked me to submit a random uint64, I need to generate this in nodejs. Do I need to use a library like big number https://www.npmjs.com/package/big-...
  • 291
2 votes
1 answer
50 views

How to make "Game Items"

I have seen "game items" listed on https://bloks.io/account/rektplebeian how are these items created, and issued?
  • 291
1 vote
1 answer
74 views

Same name table of different contracts got merged

I wrote a contract, suppose C defining the multi-index table T. Table struct has two parameter suppose x and y. x was the primary key. I made some entries in T and when i tried to access it back, I ...
  • 137
2 votes
1 answer
141 views

How can I scan transactions on some contract address with eosjs

I want to scan transactions on some contract address and store this data to the DB with eosjs. How can I do this?
2 votes
4 answers
359 views

Error in eosjs account creation on localnet

I am trying to create an account using eosjs in node.js. I am using : eos = Eos({keyProvider}); eos.transaction(tr => { tr.newaccount({ creator: 'eosio', name: '...
  • 137
8 votes
3 answers
2k views

Multiple EOS transfers in a single transaction

Is it possible to pack a few transfers of EOS token to different accounts inside of single transaction? I know it's possible to pack multiple arbitrary actions inside one tx, but what about EOS token ...
2 votes
1 answer
315 views

How to access data returned from eosjs?

I am struggling to find the right way to access the data in my react component. This is my action creator. I save every row returned from the promise into an array export function getBlocks(){ ...
  • 23
2 votes
1 answer
109 views

I want to perform 2000 transactions but when i am looping trough the eosjs code it throws an error

The error name is expired_tx_exception and the code for the same is 3040005 please tell me how can I perform these much transactions per seconds. I am able to perform 250 transactions per seconds but ...
2 votes
1 answer
71 views

I Need Help Setting Up a Back-End Infrastructure for my Future DApp

I'm going through the process of designing a desktop DApp. I'm going to use GraphQL API's to connect the EOS blockchain to a Node.js server that'll use MongoDB with Electron.js and React.js on the ...
  • 141
4 votes
2 answers
1k views

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

I come across a situation where i need to implement a relational database for an application. Now my question is how to implement it and where should i save the data? also i don't want to save data on ...
1 vote
1 answer
102 views

how can I implement recovery key thing in eos private network?

There are two keys associated with wallet 1st active and 2nd owner key. What if I forget this keys and want to recover how can I do that on a private network?
2 votes
1 answer
1k views

Provided keys, permissions, and delays do not satisfy , but does not have signatures for it under a provided delay of 0 ms

my Code var EosApi = require('eosjs-api'); const Eos = require("eosjs"); // ./cleos create key #OwnerKey // Private key: 5KVihg2u3yZpBtoLhRGvqf6vBsq9swjyvUkvbpMVMQWz11NbMa2 // Public key: ...
  • 51
3 votes
1 answer
628 views

how to create private network same as mainnet?

I want to build a private network same as the mainnet of eos. Just like it's mainnet I want to have 21 producers I want voting and etc. etc. how exactly I can do that can anyone list the steps for the ...
3 votes
3 answers
951 views

How to create wallet using eosjs or RPC call

I want to perform cleos create wallet -n <wallet_name> using an RPC call or any predefined library like eosjs. Please Help... EOS version : 1.2.0
3 votes
1 answer
2k views

sign & push transaction separately eosjs

Goal: be able to separately create, sign and broadcast a transaction: Global for both approaches: const privkey = '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'; Approach 1: ...
  • 383
8 votes
2 answers
862 views

Can we set permission using eosjs?

Using cleos, we can set the permissions like this: cleos set account permission <your-account> active '{"threshold": 1,"keys": [{"key": "<your-key>","weight": 1}],"accounts": [{"...
2 votes
1 answer
388 views

EOSJS - error message when eos.transfer(..)

When I try to call eos.transfer(..) I'm getting this error { message: 'assertion failure with message: unable to find key', file: 'wasm_interface.cpp', line_number: 930, method: 'eosio_assert' } ...
4 votes
1 answer
225 views

Why do we have to provide private keys in eosjs?

Eosjs takes a parametre in its config viz. keyProvide where we have to pass the private keys. Eos = require('eosjs') // Private key or keys (array) provided statically or by way of a function. // ...
1 vote
2 answers
414 views

Get the block_num_hint for calling eos.getTransaction(id, blockNumHint)?

How can I get the block_num_hint for calling eos.getTransaction(transactionID, blockNumHint) ? Using eosjs or any other library/api. I tested it without, with only 1 above or below and received ...
  • 383
3 votes
1 answer
184 views

EOSJS how to query the top voters

I can get some unsorted voters by using await eos.getTableRows({ json: true, code: 'eosio', scope: 'eosio', table: 'voters', // tableKey, // lowerBound, // upperBound, ...
  • 145
1 vote
1 answer
500 views

How to find the common table names for EOS [duplicate]

Learning EOSJS right now, I wonder how to get the commonly used table names by EOSIO for eos.getTableRows method? It seems to be a very basic thing yet I can't seem to find a reference for it.
  • 145
3 votes
1 answer
286 views

list of confirmed and unconfirmed transactions of address / account

I wanna show users a list of confirmed and unconfirmed transactions of a specific EOS address or account name, using eosjs. Similar like a Ethereum block explorer. Any ideas or work arounds? If ...
  • 383
4 votes
1 answer
538 views

How can I transfer RAM from one account to another?

I have account with some kilobytes of RAM and I need transfer a part of the RAM to another account. What should I do?
1 vote
0 answers
152 views

How to get assertion messages from Nodeos?

When I trigger a failing eosio_assert my Nodeos instance outputs something like: 2018-08-01T16:45:42.006 thread-0 http_plugin.cpp:476 handle_exception ] Exception Details: 3050003 ...
  • 213
2 votes
1 answer
106 views

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

Backstory: I'm creating a UI and I'd like an option for advanced users to be able to execute any function in the API. I've successfully imported the eosio_system.json file which contains all the API ...
  • 1,135
1 vote
0 answers
277 views

Using recover_key with eosjs

I want to validate user signatures in my smart contract. As I understood, I am supposed to do that with recover_key function from crypto.h I am using JavaScript with eosjs and eosjs-ecc for ...
2 votes
1 answer
235 views

Set a contract containing deferred transaction from front-end

I am trying to figure out the way to set contract which has deferred transactions at run time from front-end. Is it even doable? Any suggestions would be appreciated.
3 votes
1 answer
499 views

Eos and Scatter

When using scatter, what does Eos refer to when making this call? const eos = scatter.eos( network, Eos, eosOptions ); Docs: https://get-scatter.com/docs/dev/signature-providers
4 votes
2 answers
1k views

How to get transaction logs from EOS?

Suppose I have a dapp that monitors transaction of some assets. The smart contract would be generating transactions and I'd get messages like "executed transaction: ...
  • 275
0 votes
1 answer
39 views

Is there an equivalent of geth console in EOS?

I have used geth and web3. Is there something similar for EOS? I saw already eosjs exists.
2 votes
1 answer
735 views

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

Suppose A sent a transaction to SC(smart contract), including structured data, for example: {"intention":"like","target":"ae16xx0...."} As usual, this transaction will be stored on all nodes in the ...
  • 35
4 votes
3 answers
3k views

How to get operations history of account?

Should I analyze all the blocks or are there some methods in the eosjs library?
2 votes
0 answers
168 views

How to calculate the minimum RAM & minimum Stake required for a new account?

In the browser via eosjs, I have made the below function adapted from the docs but how do I calculate the minimum RAM in bytes, stake_net_quantity and the stake_cpu_quantity? I understand these ...
  • 291
0 votes
1 answer
1k views

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

If I have only a private key, how shold I: 1. Check private key and generate public key 2. Get account name from Public or Private key via eosjs?
2 votes
2 answers
795 views

How can I get an account name from a given public key?

is there any way to get the name for a given public key, something like? eos.getKeyAccounts({ "public_key": "EOS73iTgPXEPXGazpU6XzU5Vq81Qk7TUHsmujTYn9DKJHm4MX1e2j" }) Am I ...
  • 291
3 votes
2 answers
264 views

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

In our dapp, we would like to offer the user to choose from a list of different mainnet nodes, so that latency is low. Ideally, from the list of BPs the user has voted for. How to retrieve a list ...
  • 833
1 vote
1 answer
135 views

Secure way to sign a Transaction in a polling Service

assume i have written an polling service in nodejs which i would like to run on an aws e2 instance (t2.nano/t2.micro). This service will observe a specific account every 10sec or so for incoming ...
  • 341
2 votes
2 answers
506 views

EOSJS what is the keyProvider

The Github Page of EOSjs mention a keyProvider to instantiate EOSjs. What is this? my private key?
  • 21
2 votes
1 answer
149 views

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

I want to create game where p1 and p2 take actions in turns but neither p1 nor p2 should be able to see the action, the other is doing till the end of the game. If I would do it like in a normal Web-...
  • 341
1 vote
1 answer
703 views

EOSJS transaction authority does not have signatures under a provided delay of 0 ms

I am trying this tutorial to connect to a local testnet on virtualbox from my host using eosjs https://steemit.com/eos/@eos-asia/deploying-your-first-production-eos-dapp this is the code: EOS = ...
  • 181
1 vote
1 answer
471 views

What is the maximum speed of EOS?

What is the maximum transaction speed for EOS? I read that 100,000 transactions per second. But I'm not sure about this
  • 53
3 votes
2 answers
2k views

EOSjs getTableRows lower and upper bound on account name

How can I pass an account name as the lower and upper bound in the getTableRows method? I've looked at types.hpp and saw the string_to_name method, is there a similar method in EOSjs?
  • 93
7 votes
3 answers
590 views

Which NodeJs UI Framework is most suitable for EOSJS

I'd like to know which Framework you should use in eosjs. I have little experience with JavaScript and so I don't know which Framework works best together with eosjs or does the framework even matter? ...
  • 341