Questions tagged [eosjs]
QAs about the JavaScript module eosjs which uses RPC-APIs to interact with an EOS.IO blockchain.
199
questions
8
votes
2
answers
865
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": [{"...
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 ...
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?
...
7
votes
5
answers
2k
views
EOSJS tutorials
I have checked Where can I find complete (whole stack) EOS dApp development example projects? With smart-contracts, the necessary C++ coding and a browser interface? But I haven't found a full EOSJS ...
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?
5
votes
1
answer
322
views
Is it secure to use keosd in an aws to let dapp/app server sign transaction?
I would like to know if it is secure to run keosd on an aws locally as a hot-wallet, to let the server of a dapp send a transaction which should be signed to the aws. The server of the dapp would get ...
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?
4
votes
1
answer
760
views
New version of eosjs does not use chainId, How does it work?
I have worked with both new and previous versions of eosjs. In the previous version I had to make a config object like this:
Eos = require('eosjs')
// Default configuration
config = {
chainId: ...
4
votes
1
answer
130
views
EOSJS vote producer fails when voting for more than two producers?
We're trying to use scatter + eosjs for voting. This works fine if you pick one or two producers but any more than that and you get the following 500 error -
POST https://api.kylin.alohaeos.com/...
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 ...
4
votes
2
answers
879
views
Get Table Rows with Pagination
How do we get records from a table by pages?
My requirement: I have a table with 100 records and want to display all these records in my front-end-application with 10 records per page and if the user ...
4
votes
1
answer
226
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.
// ...
4
votes
1
answer
547
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?
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:
...
4
votes
1
answer
70
views
Trying to execute a smartcontract action using a multisig account, but it shows executed even when the transc fails due to smartcontract constraints
I'm proposing a transaction to execute an action of some smartcontract, the transaction is showing executed irrespective of failure or success of the smartcontract action(say transferFunds), this is ...
3
votes
1
answer
3k
views
Reading table rows with EOSJS
Is there a way to receive the return output of an action with EOSJS? Say for example I have an action that reads columns from a table, sums a row and returns the result. How would I structure the ...
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?
3
votes
2
answers
541
views
Where is the API for block producer voting in EOSJS?
I have found the 'system voteproducer' command in cleos. Should I make a raw transaction or something like that?
3
votes
1
answer
629
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
1
answer
500
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
3
votes
1
answer
768
views
How to transfer EOS Token with eosjs? [duplicate]
The title sums it up ;-) I'd like to move EOS tokens (say EOSDAC for example but any token will do it for my education) using the eosjs API...
I've tried to use Scatter.js and did that but it's not ...
3
votes
1
answer
73
views
How do i convert a 128_t binary hex to decimal in eosjs?
I have the value: 200000000000000000000000000000 which is represented as: 0x00000040952fe4da5c1f3c8602000000 that i'm trying to convert in eosjs.
signedBinaryToDecimal(hexToUint8Array("...
3
votes
2
answers
337
views
EOS connection to react native app
Can someone share an example of EOS blockchain integration with react-native? I am new to EOS development and I am struggling to integrate it in react-native app, there are always some missing ...
3
votes
3
answers
962
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
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 ...
3
votes
1
answer
668
views
Error: fetching abi for <accountname>: Read past end of buffer
I am trying to send transaction but getting this error
Error: fetching abi for : Read past end of buffer
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:
...
3
votes
1
answer
302
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 ...
3
votes
2
answers
176
views
modules.format.encodeName() replacement in 20.0.0?
In [email protected] I have a Eos.modules.format.encodeName()
Is there something like that in [email protected] or what can I use to replace it?
3
votes
1
answer
309
views
Deploy Contract from browser using eosjs
so I would like to deploy an EOS contract using eosjs. I encountered several problems (especially with converting the .abi and .wasm files).
All the examples either use node (so fs is available) or an ...
3
votes
1
answer
191
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,
...
2
votes
4
answers
360
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: '...
2
votes
2
answers
511
views
EOSJS what is the keyProvider
The Github Page of EOSjs mention a keyProvider to instantiate EOSjs. What is this? my private key?
2
votes
3
answers
442
views
Need to perform automatic smart contract function execution
Can we have a function in a smart contract to be executed automatically after some time?
for example, transfer some tokens after every 5 seconds.
2
votes
1
answer
49
views
Is there any way to discard a committed transaction?
I always have this doubt whenever i push a transcation. Is there any way to cancel a committed transaction before it's verifed by the block producers?
2
votes
1
answer
889
views
How to transfer EOS token using Scatter.js or eos.js?
I've successfully managed to use eosjs to transfer some EOS but when I'm trying to send something else (a token) it's no longer working.
For example that code is working:
import ScatterJS from '...
2
votes
1
answer
735
views
Calling a Smart Contract action through EOSJS
I have a local EOS network and I am trying to make my application work through a web page. I am using eosjs version 16.0.9. I downloaded it and ran npm install. I am able to run the following code ...
2
votes
2
answers
838
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 {
...
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: ...
2
votes
1
answer
392
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' }
...
2
votes
1
answer
108
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 ...
2
votes
1
answer
236
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.
2
votes
1
answer
742
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 ...
2
votes
2
answers
803
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 ...
2
votes
1
answer
152
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-...
2
votes
1
answer
42
views
Is having hashes of document certificates in EOS blockchain for tamper proof a good use case for EOS?
I have a application where I want to store a SHA256 hash of a document in a Blockchain. I want it to have a good life, ie storing the SHA256 hasha as a data in a transaction should bot be deleted ...
2
votes
1
answer
64
views
Multinode data with eosjs
I need to prepare eosio dashboard for that I need multi nodes information.
I am using eosjs nodejs library to get genesis node chain information. Can I get which other nodes are connected with genesis ...
2
votes
1
answer
43
views
How to use eosjs V20 to create and sign a offline actions?
when I create actions like this,and prapare to use JsSignatureProvider to sign
(async()=>{
let actions = [{
account: 'tommy',
name: 'hi',
authorization: [{
actor: 'tommy',
...
2
votes
1
answer
56
views
duplicate key value violates unique constraint "_block_number_txid_pkey"
I get this error when I run demux postgres the first time:
Key (block_number)=(1) already exists
The code abruptly stops. How do I fix this?
dataType:undefined
detail:"Key (block_number)=(1) ...
2
votes
1
answer
357
views
TypeError: f is not a function
I'm trying out the eosjs official documentation, but can't make any RPC calls.
This is how I've initialized everything:
const { Api, JsonRpc, RpcError } = require('eosjs');
const { fetch } = require('...