Last active
May 28, 2022 05:19
-
-
Save duartefdias/3113112d8bb3d846876dd19e2b3fcabb to your computer and use it in GitHub Desktop.
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
function makePaymentRequest(buyerAddress, sellerAddress, itemPriceInWei) { | |
// Start wallet payment process | |
window.ethereum.request({ method: 'eth_sendTransaction', params: [{ from: buyerAddress, to: sellerAddress, value: itemPriceInWei }] }) | |
.then(response => { | |
console.log(response); | |
return true; | |
}) | |
.catch(error => { | |
console.log(error); | |
return false; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment