# pcs-js-sdk

> Client SDK for PCS protocol

Latest version **0.0.22** (published 2020-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install pcs-js-sdk
pnpm add pcs-js-sdk
yarn add pcs-js-sdk
bun add pcs-js-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.22 |
| Published | 2020-02-02 |
| First published | 2019-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 59.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | akatsuki_py |

## Links

- npm: https://www.npmjs.com/package/pcs-js-sdk
- Repository: https://github.com/product-crowd-sale-protocol/pcs-js-sdk
- npm.io page: https://npm.io/package/pcs-js-sdk

## Dependencies (6)

- [bigi](https://npm.io/package/bigi.md) ^1.4.2
- [bs58](https://npm.io/package/bs58.md) ^4.0.1
- [eosjs](https://npm.io/package/eosjs.md) 16.0.9
- [eosjs-ecc](https://npm.io/package/eosjs-ecc.md) ^4.0.7
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0
- [js-file-download](https://npm.io/package/js-file-download.md) ^0.4.8

## Recent versions

- 0.0.22 (latest) — 2020-02-02
- 0.0.21 — 2019-11-16
- 0.0.20 — 2019-11-15
- 0.0.19 — 2019-11-15
- 0.0.18 — 2019-11-10
- 0.0.17 — 2019-11-10
- 0.0.16 — 2019-10-26
- 0.0.14 — 2019-10-26
- 0.0.13 — 2019-10-26
- 0.0.12 — 2019-10-23
- 0.0.11 — 2019-10-17
- 0.0.10 — 2019-10-14
- 0.0.9 — 2019-10-13
- 0.0.8 — 2019-10-13
- 0.0.7 — 2019-10-13
- … 6 more at https://npm.io/package/pcs-js-sdk/versions

## README

# pcs-js-sdk
PCS SDK written in Javascript

## install

npm package

```sh
npm install pcs-js-sdk # for npm user

yarn add pcs-js-sdk # for yarn user
```

script tag

```html
<script type="text/javascript" src="https://pcs-embedded-html.s3-ap-northeast-1.amazonaws.com/sdk/bundle.js"></script>
```

inject SDK into window.PCS or PCS

## example

#### use SDK with eosjs@16.0.9

```javascript
const { Client } = require("pcs-js-sdk");
// if you use script tag, use window.PCS.Client
const Eos = require("eosjs");

(async () => {
    const trxObj = Client.issue("samplesample", "exampleexample", `1 TST`, "This is memo.");
    const eosActionTrx = await Eos({
        keyProvider,
        httpEndpoint,
        chainId
    }).transaction({
        trxObj
    }, {
        broadcast,
        blocksBehind,
        expireSeconds
    });
})();
```

#### use SDK with [ual-reactjs-renderer](https://github.com/EOSIO/ual-reactjs-renderer)

```javascript
const { Dex } = require("pcs-js-sdk");
// if you use script tag, use window.PCS.Dex

(async () => {
    const activeUser = this.props.activeUser;
    const accountName = await activeUser.getAccountName();

    const trxObj = Dex.addBuyOrder(accountName, symbol, price);
    await activeUser.signTransaction(trxObj, { broadcast: true });
})();
```

#### use SDK for PCS authentication

```javascript
const { Signature } = require("pcs-js-sdk");
// if you use script tag, use window.PCS.Signature

(async () => {
    const signature = await Signature.genSignatureFromPassword("TST", 1, "password");
    const isVerified = await Signature.verifySignature("TST", 1, signature);
    if (isVerified) {
        console.log("OK");
    } else {
        console.log("NG");
    }
})();
```

## plus ultra

If you want to know more about this SDK, please read [API Reference](./reference.md).

---
_Source: https://npm.io/package/pcs-js-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
