Send a specified amount of an SLP token to a destination address
txParams Object containing to, from, value and sendTokenData properties
tokenId string id of token
Success txid contains the transaction id
Failure err will contain error details
if (typeof web4bch !== 'undefined') { web4bch = new Web4Bch(web4bch.currentProvider) var txParams = { to: "bitcoincash:pp8skudq3x5hzw8ew7vzsw8tn4k8wxsqsv0lt0mf3g", from: web4bch.bch.defaultAccount, value: "1000", sendTokenData: { tokenId: 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', tokenProtocol: 'slp' } } web4bch.bch.sendTransaction(txParams, (err, res) => { if (err) { console.log('send err', err) } else { console.log('send success, transaction id:', res) } }) } Copy
if (typeof web4bch !== 'undefined') { web4bch = new Web4Bch(web4bch.currentProvider) var txParams = { to: "bitcoincash:pp8skudq3x5hzw8ew7vzsw8tn4k8wxsqsv0lt0mf3g", from: web4bch.bch.defaultAccount, value: "1000", sendTokenData: { tokenId: 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', tokenProtocol: 'slp' } } web4bch.bch.sendTransaction(txParams, (err, res) => { if (err) { console.log('send err', err) } else { console.log('send success, transaction id:', res) } }) }
Demo Page
Demo Source