JSON-RPC API
Pockie wraps the JSON-RPC API using the window.pockie.request(args)
provider method.
For detailed information on standard Ethereum RPC methods, refer to the Ethereum Wiki. Every RPC method request can potentially return an error. Therefore, error handling is mandatory each time window.pockie.request(args)
is called.
Example using the eth_chainId RPC
method:
Use window.pockie.request(args)
as per the guidance in the Ethereum Wiki.
Methods
wallet_getPermissions
Retrieves the current wallet's permission information from the requester.
This gives information about the permissions linked to DApps in the wallet. If the requester has no permissions, the result array will be empty.
wallet_requestPermissions
Requests permissions from the user. Currently, only eth_accounts
requires permission requests. This request triggers a Pockie popup. Permission requests should only be made in response to a direct user action, like a button click.
wallet_switchEthereumChain
Prompts the user to switch to the chain with the specified chain ID. This method should only be invoked in response to a direct user action. Pockie will reject requests if:
The chain ID is incorrect.
Pockie does not support chains with the specified chain ID.
This method is defined by EIP-3326.
wallet_watchAsset
Requests the user to track a specified token in Pockie.
This allows DApp developers to request the user to track tokens in their wallet at runtime. This method is specified by EIP-747.
Methods Not Supported
wallet_addEthereumChain
wallet_registerOnboarding
wallet_scanQRCode
The above RPC Methods are currently not supported. For more details about Ethereum JSON-RPC, refer to the MetaMask API documentation.
Last updated