Skip to content

Instantly share code, notes, and snippets.

@adsc-cloudtec
Created January 24, 2018 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adsc-cloudtec/11fe6b28e7f13c0526d43f73af120ed6 to your computer and use it in GitHub Desktop.
Save adsc-cloudtec/11fe6b28e7f13c0526d43f73af120ed6 to your computer and use it in GitHub Desktop.
// TODO: Use token model
let token = {};
token.hash = tx.hash;
let valid = true;
tx.outputs.forEach(function(output) {
// Try to understand output as appId
token.appIds = [];
template.appIds.forEach(function(appId) {
if (appId.address === output.addresses[0]) {
console.log('found appId address: ' + appId.address);
if (output.value !== minAmount) {
console.log('invalid appId amount');
valid = false;
return;
}
token.appIds.push(appId);
}
});
}, this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment