Ethereum Provider API
Last updated
interface RequestArguments {
method: string;
params: unknown[] | object;
};
window.ethereum.request(args: RequestArguments): Promise<unknown>;window.ethereum
.request({ method: "eth_requestAccounts" })
.then((accounts) => {})
.catch((error) => {});window.ethereum
.request({
method: "eth_decrypt",
params: [encryptedMessage, accounts[0]],
})
.then((decryptedMessage) => {})
.catch((error) => {});window.ethereum
.request({
method: "eth_getEncryptionPublicKey",
params: [accounts[0]],
})
.then((result) => {})
.catch((error) => {});