Created
February 7, 2020 19:54
-
-
Save octalmage/d3e39e9508514e2c37fdf66c2f0c6717 to your computer and use it in GitHub Desktop.
Checking the inline calls of a transaction.
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
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