Skip to content

Instantly share code, notes, and snippets.

@wilsonianb
Last active June 18, 2018 23:12
Show Gist options
  • Save wilsonianb/9aa7165c2af9b5f0664f4d465668f685 to your computer and use it in GitHub Desktop.
Save wilsonianb/9aa7165c2af9b5f0664f4d465668f685 to your computer and use it in GitHub Desktop.
var ripple = require('ripple-lib').RippleAPI
const api = new ripple.RippleAPI({
server: 'wss://s.altnet.rippletest.net'
});
api.connect().then(() => {
const account = 'rDd6FpNbeY2CrQajSmP178BmNGusmQiYMM'
api.prepareSettings(account, {
signers: {
threshold: 3,
weights: [{
address: 'rato1hAeQjm3FDRZ3J1vygZM3Y435wsGgw',
weight: 1
}, {
address: 'rKL8nYYZmNXkKoT2tCJCnAAnuwQkKGPTur',
weight: 1
}, {
address: 'rLHjNdeABJfbyYxXN1rSQzQ3Ne2Xjpyx2c',
weight: 1
}]
}
}).then(tx => {
console.log(JSON.stringify(JSON.parse(tx.txJSON), null, 2))
const {signedTransaction} = api.sign(tx.txJSON, 's**************************');
console.log(signedTransaction)
return api.submit(signedTransaction)
}).then(res => { console.log(res) })
.catch(error => {
console.log(error)
})
}).catch(error => {
console.log(error)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment