Questions tagged [eosjs]

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

49 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
119 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
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?
2
votes
0answers
123 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 ...
2
votes
2answers
229 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
203 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 ...
1
vote
0answers
21 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
172 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
0answers
75 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
1
vote
1answer
154 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
65 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
233 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
61 views

Transaction exception while pushing transaction

While calling the push transaction API with the following body { "signatures": ["SIG_K1_K5umBpyieHE6czvtDMEAVjypG5Zz5sYo4NKbUkqJfe562mX22aLGwwZsYSQJLhBZi5s3hvjg6zVfS3ZucM97Ji5KNXSm4a"], ...
1
vote
3answers
237 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
77 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
89 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
158 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
210 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
90 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
276 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
138 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
232 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
0answers
150 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
1answer
56 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
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
0answers
6 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
4 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
9 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
26 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) ...
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 ...
0
votes
0answers
48 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
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....
0
votes
0answers
11 views

EOS token payment gateway

I was trying to create an API which integrates with nodeos on my server, rpc calls can be made by the web api for the purpose of a payment gateway for eos . My question is how to integrate an API with ...
0
votes
0answers
55 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 ...
0
votes
1answer
31 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
0answers
42 views

How to validate public key in eos using java?

As there are function in eosjs-ecc library to validate keys in JavaScript: const ecc = require('eosjs-ecc') const pubkey = 'EOSXXXXXXXXXXXXXXXXXXXXXX' const wif = '5HXXXXXXXXXXXXXXXXXXXXXXXX' ...
0
votes
1answer
32 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
0answers
36 views

Error while pushing a transaction using python?

after successfully signed the transaction, when i try to push it using the pyton api from the eos developers portal, i got the following error {'code': 500, 'message': 'Internal Service Error', '...
0
votes
1answer
108 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/...
0
votes
1answer
77 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
0answers
78 views

EOSJS error Non-base58 character

Please help! I'm currently encountering the ff. error Uncaught Error: Non-base58 character at Object.decode (eosjs-jssig.js:26) at Object.checkDecode (eosjs-jssig.js:15) at y (...
0
votes
0answers
29 views

error while compiling code in eosstudio?

Recentlty, i tried a eosio IDE named eosstudio,which is pretty impresive.The problem i face while compiling my code is given in the picture.then I got an advice from a telegram channel that,chenge the ...
0
votes
0answers
19 views

eosjs dist files generation issue under Wsl

I would like to have a copy of the eosjs browser files as the generation of theses files (dist files) doesn't work under windows (wsl : unbuntu) where can I get these files? (I've tried to use ...
0
votes
0answers
33 views

eosjs-ecc in other languages?

I'm looking for a way to do this https://github.com/EOS-Nation/eos-encrypt/blob/master/examples/encrypt-multiple-keys.ts it Java and Swift. Did anyone try to port it?
0
votes
1answer
44 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 ...
0
votes
0answers
31 views

How to sign with Scatter + Hard Coded Key?

I need to sign a transaction with both a hard coded key on the server as well as the user's key. How can I go about doing this? Is there an example somewhere?
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 . ...
0
votes
2answers
99 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 ...