Last active
December 15, 2017 07:41
-
-
Save 0xnbk/0f15e963fe9e376bbd1706bfef34cfc9 to your computer and use it in GitHub Desktop.
Lisk Sample Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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