Skip to content

Wallet Actions

Porto provides a set of Wallet Actions for Application Developers. These Actions are designed to be used with a Viem Client that is connected to a Porto's EIP-1193 Provider.

import { createClient, custom } from 'viem' 
import { Porto } from 'porto' 
import { WalletActions } from 'porto/viem' 
 
// Instantiate a Porto instance. 
const porto = Porto.create() 
 
// Instantiate a Viem Client with Porto's EIP-1193 provider. 
const client = createClient({ 
  transport: custom(porto.provider), 
}) 
 
const { accounts } = await WalletActions.connect(client) 

ActionDescriptionStandard
connectConnect to a Porto Account.ERC-7846
disconnectDisconnect an account.ERC-7846
grantPermissionsGrant permissions to an application.Experimental
getPermissionsGet permissions attached to an account.Experimental
revokePermissionsRevoke a permission attached to an account.Experimental