Server Actions
Porto provides a set of Server Actions for Wallet & Account Developers. These Actions are designed to be used with a Viem Client that is connected to the Porto RPC Server.
import { createClient, http } from 'viem'
import { Chains } from 'porto'
import { Key, ServerActions } from 'porto/viem'
// Instantiate a Viem Client with Porto-compatible Chain.
const client = createClient({
chain: Chains.baseSepolia,
transport: http(),
})
const account = await ServerActions.createAccount(client, {
authorizeKeys: [Key.createSecp256k1()],
})
Action | Description |
---|---|
createAccount | Create a new Porto Account. |
getCallsStatus | Retrieve the status of a call bundle. |
getCapabilities | Retrieve the capabilities of the RPC server. |
getKeys | Retrieve all keys associated with an account. |
health | Retrieve the health of the server. |
prepareCalls | Prepare a bundle of calls for execution. |
prepareUpgradeAccount | Prepare an EOA to be upgraded to a Porto Account. |
sendPreparedCalls | Send a prepared and signed call bundle. |
upgradeAccount | Upgrade an EOA to a Porto Account. |
verifySignature | Verify a signature. |