Last active
August 8, 2019 19:14
-
-
Save danfinlay/28bb77fe3be1f970913a4268a8a367a1 to your computer and use it in GitHub Desktop.
json-rpc-capabilities-middleware example usage via MetaMask
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
const requestedPermissions = { | |
eth_accounts: {}, | |
eth_sendTransaction: {}, | |
eth_decrypt: {}, | |
}; | |
async function main () { | |
const provider = window.ethereum | |
await provider.enable({ requestedPermissions }); | |
await provider.send({ method: 'eth_sendTransaction', parameters:[{ to: me, value: aModestSum }] }); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment