-
-
Save emschwartz/0bfbf08dc21d5d53025ebc8f6cf42366 to your computer and use it in GitHub Desktop.
SPP Example
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
import { Client } from 'spp-client' | |
const client = new Client({ | |
username: 'alice@red.ilpdemo.org', | |
password: 'secret' | |
}) | |
function pay () { | |
const payment = client.payment({ | |
destination: 'bob@blue.ilpdemo.org', | |
destinationAmount: '0.01', | |
memo: 'Still love you!' | |
}) | |
return payment.send() | |
} | |
setInterval(pay, 1500) |
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
import { Client } from 'spp-client' | |
const client = new Client({ | |
username: 'bob@blue.ilpdemo.org', | |
password: 'secret' | |
}) | |
client.on('incoming', (payment) => { | |
console.log('Received ' + payment.amount + ' bucks!') | |
console.log(payment.sender + ' says: ' + payment.memo) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment