Skip to content

Instantly share code, notes, and snippets.

@slipo
Last active February 4, 2018 00:20
Show Gist options
  • Save slipo/c1542c087bff7e17a067e903f0b24540 to your computer and use it in GitHub Desktop.
Save slipo/c1542c087bff7e17a067e903f0b24540 to your computer and use it in GitHub Desktop.
const net = 'http://35.192.230.39:5000/'
const contractScriptHash = '3363d19506d63e4dd386459aec81b0174cafadc0'
const destinationAddress = 'ARRo6ReXfQtHY4X22Vw1XYVDj67TAZc91p'
const privateKey = 'KxFbwhxkDaV9Z9rrB4CqWybvSHayAABveaMFtpRiM2ouPRdRLaco'
const intents = [
{
assetId: '602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7',
value: 0.00001,
scriptHash: wallet.getScriptHashFromAddress(destinationAddress),
},
]
const invoke = {
scriptHash: contractScriptHash,
operation: '',
args: [ ],
}
const txConfig = {
net: net,
address: wallet.getAddressFromScriptHash(contractScriptHash),
intents: intents,
script: invoke,
gas: 0,
privateKey: privateKey,
sendingFromSmartContract: true,
}
return api.sendAsset(txConfig)
.then((res) => {
return res.response
})
.catch((e) => {
console.log("ERROR", e)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment