Hot answers tagged

3

0x is a flag for compilers to know that it's a hex value. This isn't required for hexToUint8Array();


2

In https://github.com/LimeChain/eoslime (uses eosjs behind the scene) there is a addPermission method, which you can use in order to accomplish your aim. It will add a permission for example eosio.code to your active authority.


2

There is nothing like addresses on EOS. Only Accountnames and key-pairs. There's no endpoint for querying by public Key. Key-pairs can be used for multiple Accounts - so you can't query the Balance of a single account by public Key.


1

You need to add public key to JsSignatureProvider.availableKeys (string[]) and private key to JsSignatureProvider.keys (Map<string,string>) by public key. var { Numeric } = require('eosjs'); var { JsSignatureProvider } = require('eosjs/dist/eosjs-jssig'); var ecc = require('eosjs-ecc'); var privateKeys = ['...']; var sp = new JsSignatureProvider(...


1

Use eosjs-ecc or eosjs-keygen to generate key pairs.


1

You need to authorize the transaction with signatures for both accounts. 1. The ressource-paying-account and 2. the acting account. Assuming that lionstester1010 should pay for the transaction but lionstester1011 is the acting account/the sender of the token: actions: [{ account: 'eosio.token', name: 'transfer', authorization: [{ actor: '...


1

Calling history/get_transaction will return the transaction with all the data belonging to it. You can find inline-traces in the "traces"-section of the returned json. But be aware, the history-plugin has been deprecated so the endpoint is likely to change.


1

Create simple contract for AccountB. Explanation: eosio.token::transfer uses require_recipient(to) which sends notification to the account/contract. What it effectively means is that your contract will execute action with eosio::on_notify("eosio.token::transfer") hook as inline action. ALL Inline actions need to succeed in order to transaction be valid. ...


1

Check who receives a transfer when notifying a contract If you have code which is activated upon receipt of a notification. For example: [[eosio::on_notify("eosio.token::transfer")]] void transfer(eosio::name const & from, eosio::name const & to, eosio::asset const & quantity, std::string const & memo); Then you should check that the to ...


1

Here is an example using eosjs@20 const BigNumber = require('bignumber.js') const { Serialize, Numeric } = require('eosjs') const { TextEncoder, TextDecoder } = require('util') const numericFromName = (accountName) => { const sb = new Serialize.SerialBuffer({ textEncoder: new TextEncoder(), textDecoder: new TextDecoder() }) sb....


1

There are several public nodes, since this is a distributed project, there is no single point of failure or central web site that documents them. There are several places where you can get a list of such services and these lists are dynamic in nature. Hopefully in the future this will change less frequently but usually it depends on the top block producers. ...


1

There was an opened issue in the repository. It was fixed today. You can get the updated eoslime code from the development branch. The fix is going to be uploaded on master branch and npm through the next week


1

This has its limitations but if you are fetching a table by the primary key which is an incremented integer value, you could use a combination of lower_bound, upper_bound, and limit and do something like this: // base setup var pageSize = 10 var curLower = 0 var curUpper = pageSize - 1 // fetch first page fetchRows(curLower, curUpper, pageSize) // next ...


1

You addPrivateKey is pointing to a public key instead of a private one. JSSignatureProvider expect a private key


1

Here are the links: Ecc in Swift : https://github.com/EOSIO/eosio-swift-ecc Ecc in Java : https://github.com/EOSTribe/java-ecc/tree/master/app/src/main/java/io/plactal/ecc


Only top voted, non community-wiki answers of a minimum length are eligible