Skip to content
On this page

requestPermissions

Requests permissions for a wallet.

Usage

ts
import { walletClient } from './client'
 
const permissions = await walletClient.requestPermissions({ eth_accounts: {} }) 
ts
import { createWalletClient, custom } from 'viem'
import { mainnet } from 'viem/chains'

export const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum)
})

Returns

WalletPermission[]

The wallet permissions.

JSON-RPC Methods

wallet_requestPermissions

Released under the MIT License.