Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const clientPlugin = createPlugin()
- const clientConn = await IlpStream.createConnection({
- plugin: clientPlugin,
- destinationAccount,
- sharedSecret
- })
- // Streams are automatically given ids (client-initiated ones are odd, server-initiated are even)
- const streamA = clientConn.createStream()
- const streamB = clientConn.createStream()
- console.log(`sending data to server on stream ${streamA.id}`)
- streamA.write('hello there!')
- console.log(`sending data to server on stream ${streamB.id}`)
- streamB.write('hello there!')
- console.log(`sending money to server on stream ${streamA.id}`)
- await streamA.sendTotal(100)
- console.log('sent 100 units')
- console.log(`sending money to server on stream ${streamB.id}`)
- await streamB.sendTotal(200)
- console.log('sent 200 units')
Add Comment
Please, Sign In to add comment