This file contains hidden or 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
| import getRawBody from 'raw-body'; | |
| // Action pseudo code | |
| async webhook(req) { | |
| const key = KEY_FROM_BOLETOSIMPLES_WEBHOOK; | |
| const signature = req.header('X-Hub-Signature'); | |
| // This is the important part. It only works with the raw body (in the form of a Buffer). |
This file contains hidden or 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
| import Web3 from 'web3' | |
| let getWeb3 = new Promise(function(resolve, reject) { | |
| // Wait for loading completion to avoid race conditions with web3 injection timing. | |
| window.addEventListener('load', function() { | |
| var results | |
| var web3 = window.web3 | |
| // Checking if Web3 has been injected by the browser (Mist/MetaMask) | |
| if (typeof web3 !== 'undefined') { |