Questions tagged [eosjs]

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

59 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
223 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
1answer
207 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
1answer
151 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
0answers
48 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 ...
2
votes
1answer
101 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?
2
votes
2answers
266 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 ...
2
votes
0answers
18 views

How to deserialise extended amount?

How to deserialise extended amount from "0x00924c50832000000000000000000000" to a number in JS or PHP?
2
votes
1answer
229 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 ...
2
votes
0answers
159 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 ...
1
vote
0answers
69 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
2answers
992 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 ...
1
vote
1answer
248 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: ...
1
vote
0answers
78 views

Demux: How to deserialize transaction data from MongoActionReader stored in MongoDB by mongo_db_plugin?

When I use NodeosActionReader I can get data passed as parametters to actions via payload.data.parametter. However when I use MongoActionReader payload.data contains only hex data. How to deserialize ...
1
vote
0answers
31 views

Payment to dapp with text comments best practice

I am new in eos, so maybe i say something strange. I want to create a dapp that can receive payments from mobile wallets with text comments. I imagine this like front end where user type text and ...
1
vote
0answers
279 views

Error 3090003 - How to provide signatures for eosio.code?

When I try call custom smart contract action I get this error. message":"transaction declares authority: '{\"actor\":\"triviafrenzy\",\"permission\":\"active\"}', but does not have ...
1
vote
0answers
70 views

Transaction exception while pushing transaction

While calling the push transaction API with the following body { "signatures": ["SIG_K1_K5umBpyieHE6czvtDMEAVjypG5Zz5sYo4NKbUkqJfe562mX22aLGwwZsYSQJLhBZi5s3hvjg6zVfS3ZucM97Ji5KNXSm4a"], ...
1
vote
3answers
343 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": ...
1
vote
0answers
96 views

generate eos keypair from Mnemonic/Seed

is it possible and is it secure to generate eos keypair using bip39 mnemonic seed? something like: const hdkey = require('hdkey') const wif = require('wif') const ecc = require('eosjs-ecc') const ...
1
vote
0answers
103 views

Maximum call stack size exceeded with scatterjs and eosjs

Use in vue const eosOptions = { expireInSeconds: 60 } const network ={ blockchain: 'eos', protocol: 'http', host: 'jungle.cryptolions.io', port: 18888, chainId:'...
1
vote
0answers
188 views

List of transactions from a contract

I've been on this all day and can't figuring it out on my own so I'm reaching out for your help ;-) How can I get the list of ALL the transactions associated with an account? I've tried to play ...
1
vote
2answers
272 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 ...
1
vote
0answers
92 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 ...
1
vote
0answers
308 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 ...
1
vote
0answers
146 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 ...
1
vote
0answers
252 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 ...
1
vote
1answer
65 views

latest EOSJS (20.0.0-beta2): missing node_modules/eosjs/lib/index.js?

Trying to import latest build of EOSJS but getting error: Error: ENOENT: no such file or directory, open '.../node_modules/eosjs/lib/index.js' previous versions 'work' until I try to access the Rpc....
0
votes
0answers
5 views

Why scatter can only sign string within 12 characters?

when use scatter sign a string, you can sign message like this i have a dream but can't sign the message international song because the word international is more than 12 chars, why there's the limit?
0
votes
0answers
6 views

Generate Keypair from Mnemonic/seed in new eosjs

in the new eosjs, is there a way to generate keypair from seed. the older version have a method seedPrivate() but its deprecated in new version.
0
votes
0answers
7 views

Usecase of EOS for DApps

I have watched several tutorials for building DApps with EOS. But, All they did in tutorials was deploying smart contract and storing data in the tables. What is the point of doing that?(storing data ...
0
votes
1answer
14 views

Advantage of storing data in EOS compared to traditional database

I am learning blockchain concept and EOS. From my understanding, data which is stored in blockchain can not be modified. But, data in table in EOS can actually be modified? Then what is difference ...
0
votes
0answers
6 views

EOS 'newaccount' action generates the error Error: missing authority.keys (type=key_weight[])

I have created a MultiNode Setup using the Bios Boot sequence https://developers.eos.io/welcome/latest/tutorials/bios-boot-sequence. And created the accounts as 'eosio' & 'accountnum11'. I am ...
0
votes
0answers
13 views

transaction authorization failed in execute A Multisig Transaction

I am facing this error,i follow all step first i propose a multisig transaction from the account of "adeelabbasna" then i approved the transaction with account of "rajazahoor11", ...
0
votes
1answer
22 views

Name should be less than 13 characters, or less than 14 if last character is between 1-5 or a-j

i am facing this error when i hit my Post API,Basically i am creating this API for propose the Multisig Transaction. And i am follow the documentation of EOSJS from offical website of EOSIO. MY naming ...
0
votes
0answers
21 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
11 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
26 views

How do I record LOG in eosio smart contract?

I deployed and tested eosio smart contract. I want to record the logs of a smart contract using the web API. How can I do this? I searched but didn't get any satisfying answer. I tried to get logs by ...
0
votes
0answers
12 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
23 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 ...
0
votes
1answer
81 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
41 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
74 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
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
20 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, ...
0
votes
1answer
41 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
145 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
31 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 ...
0
votes
1answer
79 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
62 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
150 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
26 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 ...