Skip to content

Instantly share code, notes, and snippets.

@octalmage
Created February 7, 2020 19:54
Show Gist options
  • Save octalmage/d3e39e9508514e2c37fdf66c2f0c6717 to your computer and use it in GitHub Desktop.
Save octalmage/d3e39e9508514e2c37fdf66c2f0c6717 to your computer and use it in GitHub Desktop.
Checking the inline calls of a transaction.
const tx = await theWallet.transact({
actions: [{
account: 'blockarcade1',
name: 'result',
authorization: [{
actor: theAccount,
permission: 'active',
}],
data: {
customer_string: userID,
result: !!result,
jackpot: !!jackpotScored,
row,
score,
},
}],
}, {
blocksBehind: 10,
expireSeconds: 30,
});
// Pull the inline call to the reciept method and use that for the response.
let state = tx.processed.action_traces[0].inline_traces[0].act.data;
// When the user wins the reciept call with be after paying the user, so we want the second action.
if (typeof state.from !== 'undefined') {
state = tx.processed.action_traces[0].inline_traces[1].act.data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment