0.0.22 • Published 5 years ago
pcs-js-sdk v0.0.22
pcs-js-sdk
PCS SDK written in Javascript
install
npm package
npm install pcs-js-sdk # for npm user
yarn add pcs-js-sdk # for yarn user
script tag
<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
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
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
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.
0.0.22
5 years ago
0.0.21
5 years ago
0.0.20
5 years ago
0.0.19
5 years ago
0.0.18
5 years ago
0.0.17
5 years ago
0.0.16
5 years ago
0.0.14
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago