This the Neon Wallet's JS SDK for the NEO blockchain platform. It is currently in use by Neon.
Special thanks to neowallet.js for providing many of the underlying cryptography and network methods!
Take a look at the tests to find examples for all API functions.
import * as api from 'neon-js';
const testKeys = {
a: {
address: "ALfnhLg7rUyL6Jr98bzzoxz5J7m64fbR4s",
wif: "L2QTooFoDFyRFTxmtiVHt5CfsXfVnexdbENGDkkrrgTTryiLsPMG"
},
b: {
address: "AVf4UGKevVrMR1j3UkPsuoYKSC4ocoAkKx",
wif: "KyKvWLZsNwBJx5j9nurHYRwhYfdQUu9tTEDsLCUHDbYBL8cHxMiG"
}
}
// Get balance of account "a" on TestNet using Neon Wallet API
api.getBalance(api.TESTNET, testKeys.a.address).then((balance) => {
console.log(balance);
});
// Get balance of account "a" on MainNet using Neon Wallet API
api.getBalance(api.MAINNET, testKeys.a.address).then((balance) => {
console.log(balance);
});
// Claim all available GAS for account "a" on TestNet
api.claimAllGAS(api.TESTNET, testKeys.a.wif).then((response) => {
console.log(response);
});
// Send 1 ANS to "a" from "b" on TestNet
api.sendAssetTransaction(api.TESTNET, testKeys.a.address, testKeys.b.wif, "AntShares", 1).then((response) => {
console.log("Transaction complete!");
});
npm run test
npm run build
npm install --save git+https://github.com/CityOfZion/neon-js.git