Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
fixing link and removing default from signature provider syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Douglass committed Dec 18, 2018
1 parent 73152ad commit 251387f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Documentation can be found [here](https://eosio.github.io/eosjs)

### Browser Distribution

Clone this repository locally then run `npm run build-web` or `yarn build-web`. The browser distribution will be located in `dist-web` and can be directly copied into your project repository. The `dist-web` folder contains minified bundles ready for production, along with source mapped versions of the library for debugging. For full browser usage examples, [see the documentation](https://eosio.github.io/eosjs/static/3.-Browsers.html).
Clone this repository locally then run `npm run build-web` or `yarn build-web`. The browser distribution will be located in `dist-web` and can be directly copied into your project repository. The `dist-web` folder contains minified bundles ready for production, along with source mapped versions of the library for debugging. For full browser usage examples, [see the documentation](https://eosio.github.io/eosjs/guides/1.-Browsers.html).

## Import

Expand All @@ -26,28 +26,27 @@ Importing using ES6 module syntax in the browser is supported if you have a tran
```js
import { Api, JsonRpc, RpcError } from 'eosjs';

// If using default signature provider
import JsSignatureProvider from 'eosjs/dist/eosjs-jssig';
import JsSignatureProvider from 'eosjs/dist/eosjs-jssig'; // development only
```

### CommonJS

Importing using commonJS syntax is supported by NodeJS out of the box.
```js
const { Api, JsonRpc, RpcError } = require('eosjs');
const JsSignatureProvider = require('eosjs/dist/eosjs-jssig');
const JsSignatureProvider = require('eosjs/dist/eosjs-jssig'); // development only
const fetch = require('node-fetch'); // node only; not needed in browsers
const { TextEncoder, TextDecoder } = require('util'); // node only; native TextEncoder/Decoder
const { TextEncoder, TextDecoder } = require('text-encoding'); // React Native, IE11, and Edge Browsers only
```

## Basic Usage

### SignatureProvider
### Signature Provider

The SignatureProvider holds private keys and is responsible for signing transactions.
The Signature Provider holds private keys and is responsible for signing transactions.

***Using the default 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 webpage to ensure security when signing transactions in production***
***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 webpage to ensure security when signing transactions in production***

```js
const defaultPrivateKey = "5JtUScZK2XEp3g9gh7F8bwtPTRAkASmNrrftmx4AxDKD5K4zDnr"; // useraaaaaaaa
Expand Down
2 changes: 1 addition & 1 deletion docs/2.-Transaction-Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The signature provider must contains the private keys corresponsing to the actor

```javascript
const { Api, JsonRpc } = require('eosjs');
const JsSignatureProvider = require('eosjs/dist/eosjs-jssig');
const JsSignatureProvider = require('eosjs/dist/eosjs-jssig'); // development only
const fetch = require('node-fetch'); // node only; not needed in browsers
const { TextDecoder, TextEncoder } = require('text-encoding'); // node, IE11 and IE Edge Browsers

Expand Down

0 comments on commit 251387f

Please sign in to comment.