Skip to content

Instantly share code, notes, and snippets.

@danfinlay
Last active August 8, 2019 19:14
Show Gist options
  • Save danfinlay/28bb77fe3be1f970913a4268a8a367a1 to your computer and use it in GitHub Desktop.
Save danfinlay/28bb77fe3be1f970913a4268a8a367a1 to your computer and use it in GitHub Desktop.
json-rpc-capabilities-middleware example usage via MetaMask
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