Skip to content

Instantly share code, notes, and snippets.

@duartefdias
Last active May 28, 2022 05:19
Show Gist options
  • Save duartefdias/3113112d8bb3d846876dd19e2b3fcabb to your computer and use it in GitHub Desktop.
Save duartefdias/3113112d8bb3d846876dd19e2b3fcabb to your computer and use it in GitHub Desktop.
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