Skip to content

Instantly share code, notes, and snippets.

@0xnbk
Last active December 15, 2017 07:41
Show Gist options
  • Save 0xnbk/0f15e963fe9e376bbd1706bfef34cfc9 to your computer and use it in GitHub Desktop.
Save 0xnbk/0f15e963fe9e376bbd1706bfef34cfc9 to your computer and use it in GitHub Desktop.
Lisk Sample Code
var LSK = lisk.api({ testnet: true, port: 7000 });
function getAccount (callback) {
LSK.sendRequest('accounts/open', { secret: passphrase }, function (data) {
var accAddress = LSK.getAddressFromSecret(passphrase);
if (data === undefined) {
LSK.sendRequest('accounts', { address : accAddress.address }, function (data_acc) {
var returnObj = {
open: data,
account: data_acc
};
callback(returnObj);
});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment