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
2answers
216 views

Transaction requires authority, but does not have signatures for it

I am trying to send tokens from one account to another using eosjs & reactjs with the standard eosio.token contract but I have issues with the authority. Can someone please explain the meaning of ...
0
votes
1answer
12 views

How to get Block using JsonRpc from eosjs using nodejs?

Whenever I try to get the block using the eosjs in NodeJS like in the example I get the error 'Invalid Block number or ID, must be greater than 0 and less than 64 characters' Altho when I use other ...
0
votes
2answers
36 views

How to programmatically send tokens using EOSJS safely?

According to the EOSJS readme: Using the JsSignatureProvider in the browser is not secure and should only be used for development purposes. Use a secure vault outside of the context of the ...
0
votes
1answer
13 views

Unknown action hashit in contract eosio

stdClass Object ( [code] => 500 [message] => Internal Service Error [error] => stdClass Object ( [code] => 3050000 [name] => action_validate_exception [what] => Action validate exception [details] => ...
0
votes
0answers
6 views

error Error: Abi tokenAccount is not cached action.data transaction.actions

I am trying to push a transaction to another account through eosjs. But before doing that I want to call the balance of that account to check if the person is trying to transfer a higher value than ...
0
votes
1answer
26 views

Invalid packed transaction

I am trying RPC API. Here is the code which I am using on cmd for testing a dummy transaction. curl --request POST --url http://localhost:8080/v1/chain/push_transaction --header 'accept: application/...
0
votes
0answers
6 views

EOSJS getting an error while sending a transaction [duplicate]

I am getting an error while pushing a transaction to another account. const eos = Eos(config); const expiration = (new Date(new Date().getTime() + 2*60000)).toISOString(); const ...
0
votes
1answer
36 views

How to avoid CORS error on testnet?

When accessing an eos contract via eosjs, it works fine on a local net, but raises an error on testnet (jungle): Access to fetch at 'https://jungle.eosn.io/v1/chain/get_abi' from origin 'http://...
0
votes
1answer
20 views

Can we use addresses to query balances from EOSJS?

I wanted to know if we could use addresses instead of account names to query balances (get_currency_balance) from eosjs?
6
votes
3answers
878 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
2answers
157 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-...
0
votes
0answers
64 views

How to encode account name (to get uint64) using eosjs2?

I'm migrating from @scatterjs/eosjs eosjs@16.0.9 to @scatterjs/eosjs2 eosjs@20.0.0. using eosjs I had the following solution: Eos.modules.format.encodeName(name, false) using eosjs2 I found the ...
1
vote
0answers
87 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
2
votes
2answers
209 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 ...
2
votes
1answer
69 views

modules.format.encodeName() replacement in 20.0.0?

In eosjs@16.0.9 I have a Eos.modules.format.encodeName() Is there something like that in eosjs@20.0.0 or what can I use to replace it?
0
votes
1answer
57 views

How eosbetdice listen to new active bet and then push an resolvebet action?

I guess this is done off-chain? they should have some daemon to monitor actions. Once a new active bet is created, the daemon will sign the seed hash with the private key and then push an resolvebet . ...
3
votes
2answers
1k 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?
0
votes
0answers
8 views

Cannot create account using EOSJS 16: Permissions Error

I know EOSJS 16 is deprecated, but I want to know how to solve this following error in it. var Eos = require('eosjs'); // Default configuration var config = { chainId: 'CID', // 32 byte (64 ...
0
votes
1answer
117 views

Installing and running an EOS mainnet node

The purpose of this installation is for me to be able to make /v1/chain/ mainnet API requests on a remote server that I have access to that won't disrupt mainnet itself. I tried using EOSNation/...
2
votes
1answer
208 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 ...
0
votes
1answer
27 views

duplicate key value violates unique constraint “_block_number_txid_pkey”

i get this error when i run it 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) ...
1
vote
3answers
246 views

unsatisfied authorization error while push transaction

While using the push transaction I am getting the below error, Kindly help { "code": 500, "message": "Internal Service Error", "error": { "code": 3090003, "name": "unsatisfied_authorization", "what": ...
0
votes
1answer
47 views

Not able to run EOSIO module for demux

while trying to run demux, I am getting an error. The proper initialization has not occurred. Failed to migrate the postgres database. The full error code is this: {"name":"demux","hostname":"...
0
votes
0answers
7 views

“JsSignatureProvider is not a constructor” in Firebase Cloud Function

I run the following locally in my machine (or in any of my remote servers) and I get no problem: const JsSignatureProvider = require('eosjs/dist/eosjs-jssig').default; const signature = new ...
0
votes
0answers
6 views

eosjs sign data does not match with eosio assert_recover_key data

at client, I create a signature from seed like this. the key pair is [ '5KgLbwEy7d4qufeLqPnPL1YQU1tscJXCnpqTTn7REaZsjYBjDWr', 'EOS5Mk748B6ojrZdTHP8BoLBXyKjQzzthaqGa4v97vfiGEfbEM2Np'] import ...
3
votes
1answer
121 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, ...
1
vote
2answers
215 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 ...
0
votes
0answers
49 views

Search in a multi_index table by multiple fields (compound search)

Here is defined a sample table with four fields, two of them (account and type) I am going to use in my compound search: struct [[eosio::table]] total { uint64_t id; uint64_t account; ...
0
votes
2answers
101 views

How to “get currency balance” with mongo_db_plugin?

I'm struggling to find the answer to that issue and thought maybe the collective knowledge might be helpful ;-) I'm trying to get the balance of a certain token for a specific account from the ...
0
votes
0answers
12 views

It didn't match the Provied keys in eosjs

First I got a error: eos.min.js:1 {"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"Provided keys, permissions, and delays do not ...
1
vote
3answers
40 views

Is it posible to deny EOS transfers for Account?

Imagine I have account A and account B. Account A is the "owner" of B and A wants to deny EOS Transfers for Account B and allow all other Actions(that means A should have full "active" operations)? ...
1
vote
1answer
163 views

New JSSignatureProvider is not a function in EOSJS

Version of EOSJS eos@fffff and eos@beta3 Describe the bug const JsSignatureProvider = require('eosjs/dist/eosjs-jssig'); const signature = new JsSignatureProvider([privKey]); TypeError: ...
0
votes
1answer
46 views

Scatter detection delay issue

I am working on developing a web app in EOS. I am using scatter browser extension to sign the transactions. During page load, the status of scatter is checked using the following code const setStatus ...
2
votes
2answers
230 views

A possible alternative sign in/login process instead of firebase auth / amazon cognito using an eos contract?

I had the the idea of a secure alternative login process using an EOS smart contract instead of firebase or Amazon cognito. I would like to know if something like this feasible? My idea is somewhat ...
0
votes
1answer
78 views

Error while signing a transaction using nodejs wallet API?

I am building an eosdapp using nodejs code.I got the wallet api from the developers portal,but when i run the code i get the following error. {"code":500,"message":"Internal Service Error","error":{"...
0
votes
1answer
41 views

How to import eosjs-ecc into a react typescript project

I created a 'create react app' with typescript and I now want to import and use eosjs-ecc Can I just import it with yarn add eosjs-ecc and then do import ecc from 'eosjs-ecc' or do I need to clone ...
1
vote
0answers
22 views

Unable to retrieve user tokens using get_currency_balance

I am trying to get user tokens with the following method: static async getUserTokens(userAccount) { console.log("Get tokens for: " + userAccount); try { const rpc = new JsonRpc("http://...
3
votes
1answer
29 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("...
1
vote
1answer
32 views

What are the patterns and anti-patterns when programming for EOS?

When programming smart contracts or writing eosjs code, there are certain pitfalls that you might fall into if you are not careful. What are some of the patterns and anti-patterns to be aware of that ...
0
votes
0answers
8 views

JsSignatureProvider in a node or electron context

According eosjs documentation Using the JsSignatureProvider in the browser is not secure and should only be used for development purposes. Use a secure vault outside of the context of the ...
2
votes
0answers
128 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 ...
4
votes
1answer
221 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 ...
0
votes
1answer
41 views

Get address or eos account transactions

I want to get transaction list of request address or account using EOSJS or any RPC method. Kindly guide for it. As per check EOS dev documentation unable to find method which fullfill this.
3
votes
1answer
353 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: ...
5
votes
1answer
314 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 ...
1
vote
1answer
36 views

On method call: “assertion failure with message: read”

I am calling a method that is completely commented out. I am calling it from EOStudio and from command line tools. Is this a bug or does someone know how to fix this? assertion failure with message: ...
0
votes
1answer
24 views

Is there public node available for nodeos & keosd?

Is there any public node url exists of nodeos and keosd for EOSIO mainnet and testnet? Using that URL will access all RPC methods of chain and wallet.
8
votes
2answers
643 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": [{"...
0
votes
0answers
22 views

How can I get transaction receipt using its id in EOSJS or via RPC? [duplicate]

I want to get transaction by its hash using eosjs or rpc method.
0
votes
0answers
22 views

How to use eosjs with scatter to deploy contract?

I am working on a use case that requires the smart contract to be deployed from frontend, and I am using Scatter as the wallet for the keys. Is there a way to deploy contracts on EOS Network using Eos....