UNPKG

927 BJavaScriptView Raw
1let ScryptaCore = require('../src/index.js')
2let scrypta = new ScryptaCore
3// scrypta.mainnetIdaNodes = ['http://localhost:3001']
4
5async function send(amount = 0.001){
6 return new Promise(async response => {
7 let prv = 'Sq9GWa9vyM1HghsnVan5UJhtx2GumTaLBTHgDhCW4abjzZLmsYmr'
8 let pub = 'LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2'
9 let sidechain = '6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH'
10 let to = 'LchzGX6vqmanceCzNUMTk5cmnt1p6knGgT'
11 let password = 'password'
12 scrypta.usePlanum(sidechain)
13 await scrypta.importPrivateKey(prv, password)
14 let tx = await scrypta.sendPlanumAsset(pub, password, to, amount)
15 console.log('SXID IS ' + tx)
16 response(tx)
17 })
18}
19var i = 1
20async function runtest(){
21 let amount = i / 1000
22 console.log('SENDING ' + amount)
23 await send(amount)
24 i++
25 runtest()
26}
27runtest()
28/*
29setInterval(function(){
30 runtest()
31},2000)
32*/
\No newline at end of file