0.0.3 • Published 5 years ago

haya-js-sp v0.0.3

Weekly downloads
2
License
-
Repository
github
Last release
5 years ago

node-eosjs-signature-provider

npm version

EosJS signature provider implementation that uses fc library to sign transactions via node cpp modules feature.

How to use?

First, you need to install library via npm or yarn

npm install --save node-eosjs-signature-provider

Than, you can use it like here:

import {Api, JsonRpc} from "eosjs";
import fetch from "node-fetch";
import * as encoding from "text-encoding";

import NodeEosSignatureProvider from "node-eosjs-signature-provider";


const rpc = new JsonRpc("http://your-url:8888", {fetch});
const signatureProvider = new NodeEosSignatureProvider(
            [
                "first p-key",
                "second p-key"
            ]
        );

const api = new Api({
                        rpc: rpc,
                        signatureProvider: signatureProvider,
                        textDecoder: new encoding.TextDecoder(),
                        textEncoder: new encoding.TextEncoder(),
                    });

api.transact(...);