2

The Github Page of EOSjs mention a keyProvider to instantiate EOSjs. What is this? my private key?

2

Yes you need a private key. If you are doing a front-end where you need to use EOSjs and need user's private key, ask them to enable Scatter wallet instead and you simply get an eosjs object from Scatter instead.

2

Exactly, it provides private keys used to sign transactions.

Here the definition from the eosjs github page:

keyProvider [array|string|function]: Provides private keys used to sign transactions. If multiple private keys are found, the API get_required_keys is called to discover which signing keys to use. If a function is provided, this function is called for each transaction.

You just need to add it as the following (even if this is a fake private key):

keyProvider: ['5LLKiY1D3tCndrF5NW5tJa1enukCfrPNopUJwnkUmfErT8d11eN']

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.