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
0
votes
0answers
9 views

Caught exception: TypeError: Cannot read property 'getAvailableKeys' of undefined

When i try to do transaction this error gets thrown no information on this so far I am using latest version of eosjs v= 21.0.2 I am reading the accounts names balance to transfer and public key from a ...
0
votes
1answer
7 views

CORs Error for /v1/chain/push_transactions To Production Block Producer (Not localhost)

All of my other POST calls to a production EOS BP are succeeding no problem. However, when I use push_transactions via ScatterJS I get a 500 CORs error. const networkJson = { blockchain:'eos', ...
0
votes
1answer
27 views

Eosjs. How to add new key to JsSignatureProvider

Here: var privateKeys = [...]; var sp = new JsSignatureProvider(privateKeys); var key = 'ASG...'; sp.addKey(key); // (1) I want to add new key to JsSignatureProvider, but I can't find method like (...
0
votes
1answer
21 views

How to integrate Restfull API with smart contract using c#?

I am new to EOSIO. I referred eos.io for learning. Now I need to learn how to integrate API with a smart contract. I am willing to do this in c#. I got answers mostly for eosjs which is used in nodejs,...
0
votes
0answers
10 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', ...
0
votes
0answers
14 views

EOSIO calculate transaction_mroot

As a general task i am trying to reverse engineer the production of a Block. With the help of EOSJS i was able to make a transaction from scratch and i can de/serialize it and sign it and so on. Now i ...
2
votes
0answers
45 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 ...
0
votes
1answer
57 views

Setting eosio.code permission for contract account in eosjs

I am trying to set the eosio.code permission for my contract on account kbo2byvpkbiy (private blockchain). The reason I want to do this is calling eosio.token/transfer from within this contract. All ...
0
votes
1answer
44 views

Get transaction EOSJS

I used the following function to get transaction with eosjs, but it doesn't display all the content. (async () => { await rpc.history_get_transaction('...
0
votes
1answer
27 views

eoslime: Provided keys, permissions, and delays do not satisfy declared authorizations

When Trying to run my test with eoslime test and calling eoslime.Contract.deploy(...., ....) I get Error: the string "{\"code\":500,\"message\":\"Internal Service Error\",\"error\":{\"code\":...
0
votes
1answer
58 views

Error: fetching abi for eosio: deadline exceeded by xx us

When launching a transaction like: await eosioApi.transact({ actions: [ { account: "eosio", name: 'newaccount', authorization: [{ actor:...
0
votes
1answer
32 views

How to generate Key Pairs with eosjs

How to generate eos Key Pairs with eosjs? I have installed EOSIO for development of my Dapp and can't figure out how to create Key Pairs with eosjs.
0
votes
0answers
7 views

eosjs in ArangoDB Foxx service

Has anyone used eosjs lib in ArangoDB Foxx service? I tried a little and faced the issue of not being able to use Node randomBytes package. I replaced var randomBytes = require('randombytes'); to ...
0
votes
0answers
18 views

I want to sell RAM using 'sellram' of eosio.I have written an eosjs code for the same, but it is giving error

async function sellRam(account_name, sell_bytes){ try{ const result = await api.transact ( { account: 'eosio', name: 'sellram', authorization: [ { actor: account_name, ...
1
vote
2answers
43 views

How to get account name or list of accounts from a public key using eosjs? Account is on Jungle testnet

const { Api, JsonRpc } = require('eosjs'); const fetch = require('node-fetch'); const rpc = new JsonRpc('https://api.jungle.alohaeos.com:443', { fetch }); let validAccounts =await rpc....
0
votes
2answers
26 views

I have some doubts about open function of eosio.token smartcontract

async function openAccount (tokenCreator ) { try{ const result = await api.transact({ actions: [{ account: tokenCreator, //'eosio.token', name: 'open', //'transfer'...
0
votes
1answer
33 views

Error: assertion failure with message: comparison of assets with different symbols is not allowed

I am trying to create and account from another account, both on JungleNet. I am using junglenet rpc. Here is my code: const {Api, JsonRpc} = require('eosjs'); const {JsSignatureProvider} = require('...
0
votes
1answer
96 views

I'm trying to transact EOS using Scatter in eosjs version 20.0. I'm getting the “f not a function” error. Can someone please guide me?

const ScatterJS = require('scatterjs-core').default const ScatterEOS = require('scatterjs-plugin-eosjs2').default const Eos = require('eosjs') const fetch = require('fetch'); //node only const { Api, ...
0
votes
1answer
29 views

Can't create EOS Account with eosjs library (UnhandledPromiseRejectionWarning)

I have already run this code few weeks back and back then it was working perfectly but now it's giving me an error: UnhandledPromiseRejectionWarning: Error: account names can only be 12 chars long I ...
1
vote
1answer
32 views

Can I transfer EOS from one account to other using eosjs or is EOS only used for buying RAM and staking? (Both accounts are on jungle testnet)

async function sendEos (sender, receiver ) { try{ const result = await api.transact({ actions: [{ account: 'eosio.token', //'eosio.token', name: 'transfer', //'...
1
vote
1answer
41 views

How to use a secondary account to pay for primary accounts cpu/ram using eosjs java script library

I am trying to use a secondary account to pay for cpu/ram for the primary accounts eosio.tokens how do I do that using eosjs library My current action looks like this actions: [{ account: '...
0
votes
1answer
48 views

Unable to creating Eos account with nodejs using eosjs library

I have no idea where am i making mistake? please help. const express = require('express'); const path= require('path'); const app =express(); const { Api, JsonRpc, RpcError } = require('eosjs'); ...
0
votes
1answer
65 views

How to sign this EOS transaction provided with below code and response?

This below code is working fine in testnet. I want to do transaction, signing and broadcasting individually. I generated the raw transaction, but I don't understand how to sign it. I have provided the ...
0
votes
1answer
56 views

How to read a table of a contract?

I'm trying to dump all rows of the sellorder, buyorder and tmporder table of the newdexpublic smart contract. My code is as the following: const fetch = require('node-fetch'); // node only; not ...
0
votes
1answer
48 views

How to retrieve filtered multi-index table data?

I have a smart contract that has a multi-index table called reservations - account, time, date, entity. From the code I am trying to use get_table_rows to get all reservations related to a given ...
0
votes
1answer
50 views

How to get a list of actions belong to a transaction with eosjs?

Given a transaction id, how to get all actions of this transaction? For example, this transaction 3871d503ec18800861f83851762455491c88e459e0c70d830ed0120134083501 has a inline action that calls ...
0
votes
1answer
56 views

how to create a unique user name using public or private key in nodejs?

Like BTC, ETH etc has address, do EOS has address or username etc, I am using below code to generate the public and private key, we do transaction in bitcoin,ethereum etc with a unique address sample ...
0
votes
1answer
131 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
1answer
24 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
15 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
197 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
7 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
26 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?
0
votes
1answer
24 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
95 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
18 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
28 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 ...
0
votes
0answers
24 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 ...
0
votes
1answer
39 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
66 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)? ...
0
votes
1answer
93 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
58 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://...
1
vote
1answer
46 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 ...
3
votes
1answer
45 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("...
0
votes
1answer
168 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.
1
vote
1answer
149 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
165 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.
0
votes
1answer
31 views

Create account in EOS using RPC method or npm package [duplicate]

I wants to create account in EOS using RPC method or Npm package.As per review dev doc of EOS not found any methods for it. I am implementing this in nodejs. Kindly guide for it, how can i process ...
0
votes
2answers
57 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 ...
1
vote
2answers
740 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 ...