Created
December 27, 2018 10:14
-
-
Save dioptx/fbcc155fc6307aac0e520afe6db91854 to your computer and use it in GitHub Desktop.
Code supposed to send 1 iota to test address
This file contains hidden or 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
const Iota = require('@iota/core'); | |
const Converter = require('@iota/converter'); | |
const iota = Iota.composeAPI({ | |
provider: 'https://nodes.devnet.iota.org:443' | |
}); | |
iota.getNodeInfo() | |
.then(info => console.log(info)) | |
.catch(err => {}); | |
const address = | |
'HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLODENNIS'; | |
const seed = | |
'ZODJGSIITXFNKKICPVXSFIWJNGLROFMZAEYTJAIKUU9TERRFQFFSQHZWWITVDACAYWXZABODDJQIYVSYS'; | |
const message = Converter.asciiToTrytes('Hello Dennis!'); | |
const transfers = [ | |
{ | |
value: 1, | |
address: address, | |
message: message | |
} | |
]; | |
iota.prepareTransfers(seed, transfers) | |
.then(trytes => iota.sendTrytes(trytes, (depth = 3), (mwm = 9))) | |
.then(bundle => { | |
console.log(bundle) | |
}).catch(err => { | |
// catch any errors | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment