aion-keystore
This package is derived from a unreleased version of aion-web3 1.0
. The features here were tested to be functioning correctly. Currently, aion-web3 1.0
does not inherit all properties of this package. Therefore this package will continue to be maintained.
The functionality that this package provides are:
- Signing transactions (client side)
- Deriving Account information (
publicKey
,address
) - Import
Aion
keystore from RLP encodedBuffer
s - Export
Aion
keystore to RLP encodedBuffer
s
Installation
Node.js
npm install aion-keystore
Usage
Basics
// in node.jsconst Accounts = ; const account = ;const acc = account; // outputacc = _privateKey: Buffer _publicKey: Buffer privateKey: '0xce48884694409e26535e1a6e4e9d21747acdf2d59be910397af31f42de6fd1241ca54b71d7567a0eb6949031eeb3948f9ad7dc6f0689cdbccfff1b7cfc2b9139' publicKey: '0x1ca54b71d7567a0eb6949031eeb3948f9ad7dc6f0689cdbccfff1b7cfc2b9139' address: '0xa0a3b5b5fc4957cdd15aaec7ec7c968b81e617ca8ad763a2ca7494a6a70ac6e3' , sign: function(), encrypt: function(), encryptToRlp: function() };
Signing Transactions (Promise)
// in node.jsconst privateKey = "0xefbc7a4bb0bf24624f97409473027b62f7ff76e3d232f167e002e1f5872cc2884dcff097bf9912b71d619fc78100de8cf7f55dfddbc2bf5f9fdc36bd670781ee";const accs = ; // load account from private keyconst acc = accs; // construct transaction payloadconst transaction = to: "0xa050486fc4a5c236a9072961a5b7394885443cd53a704b2630d495d2fc6c268b" data: "" gasPrice: 10000000000 gas: 21000 value: "1000000000000000000" nonce: 1 timestamp: 1535399697; acc;
Signing Transactions (Callback)
// in node.jsconst privateKey = "0xefbc7a4bb0bf24624f97409473027b62f7ff76e3d232f167e002e1f5872cc2884dcff097bf9912b71d619fc78100de8cf7f55dfddbc2bf5f9fdc36bd670781ee";const accs = ; // load account from private keyconst acc = accs; // construct transaction payloadconst transaction = to: "0xa050486fc4a5c236a9072961a5b7394885443cd53a704b2630d495d2fc6c268b" data: "" gasPrice: 10000000000 gas: 21000 value: "1000000000000000000" nonce: 1 timestamp: 1535399697; acc;