Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. function displayContractContent(contracts, resaleItems) {
  2. let template = '';
  3. contracts.forEach(contract => {
  4. const { name, symbol, tokenAddress, tokenContractId } = contract;
  5. const currentResaleItems = resaleItems[tokenContractId];
  6.  
  7. let tokenMarkup = '';
  8. currentResaleItems.forEach(token => {
  9. const { metadata, price } = token;
  10.  
  11. tokenMarkup += `
  12. <div class="tile">
  13. <img src=${metadata.image} />
  14. <h3 class="bold">${metadata.name}</h3>
  15. <h3 class="color-primary">${cargo.web3.fromWei(
  16. price,
  17. 'ether'
  18. )} ETH</h3>
  19. </div>
  20. `;
  21. });
  22.  
  23. template += `
  24. <div class="contract-header">
  25. <h2>${name} ${symbol}</h2>
  26. <h3>${tokenAddress}</h3>
  27. </div>
  28. ${tokenMarkup}
  29. `;
  30. });
  31.  
  32. document.querySelector('[data-id="token-rows"]').innerHTML = template;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement