0.2.9 • Published 5 years ago

og-sdk v0.2.9

Weekly downloads
2
License
LGPL-2.1
Repository
-
Last release
5 years ago

js-og-sdk

Codacy Badge license

js-og-sdk is a Node.js node_module for OG DAG chain. OG JavaScript API.

New Features!

  • generate raw transaction
  • sign the raw transaction and send to og

You can also:

  • set the servers whatever you want
  • query the chain data through the functions.
  • generate secp256k1 privKey and get publicKey & address
  • sign the message with the privKey

Quick start

Using npm to include js-og-sdk in your own project:

npm install --save og-sdk

Install

To use as a module in a Node.js project

  1. Install it using npm:

    npm install --save og-sdk
  2. require/import it in your JavaScript:

    var OG = require('og-sdk');

Usage

For information on how to use js-og-sdk, take a look at the example.js.

var OG = require('og-sdk');
var og = new OG;
var privateKey = Buffer.from('942f9a3d695bb54a8748ef942e88a148de7d0a7fa3ad88d801615f812bd5b672', 'hex')
var txParams = {
       from : "0x05452b3d60ca312fa85b39c29864d6980a6eb436",
       to : "0xa7656df695f2e74b060e3c9a3c8e425cf2107c25",
       value : 0,
       publicKey : "08a69e709e264fcc370d407f2e83ade02d6aaaac7543f87da99f692588cbf72ed35bfac2ace827e507fee6c8435e74ea58dc496013fd92128e979b8ce7b34625",
       publicKey_raw : "0408a69e709e264fcc370d407f2e83ade02d6aaaac7543f87da99f692588cbf72ed35bfac2ace827e507fee6c8435e74ea58dc496013fd92128e979b8ce7b34625",
       height : 10,
       nonce : 1
   }
var signTarget = og.genRawTransaction(txParams);    //gen tx sign target
var signature = og.signRawTransaction(signTarget,privateKey).signature;    //sign the tx
var tx = og.makeUpTransaction(txParams,signature);    //put signature into txParams
og.sendTransaction(tx);    //send the complete tx to og

License

GNU Lesser General Public License v2.1

0.2.9

5 years ago

0.2.8

5 years ago

0.2.75

5 years ago

0.2.74

5 years ago

0.2.73

5 years ago

0.2.72

5 years ago

0.2.71

5 years ago

0.2.7

5 years ago

0.2.63

5 years ago

0.2.62

5 years ago

0.2.61

5 years ago

0.2.6

5 years ago

0.2.53

5 years ago

0.2.52

5 years ago

0.2.51

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.33

5 years ago

0.2.32

5 years ago

0.2.31

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.31

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.159

6 years ago

0.0.158

6 years ago

0.0.157

6 years ago

0.0.156

6 years ago

0.0.155

6 years ago

0.0.154

6 years ago

0.0.153

6 years ago

0.0.152

6 years ago

0.0.151

6 years ago

0.0.150

6 years ago