RPC Reference
The 1auth provider implements the EIP-1193 interface, making it compatible with viem, wagmi, ethers, and other Ethereum libraries.
Overview
All RPC methods can be called via the standard request interface:
const result = await provider.request({
method: 'method_name',
params: [...],
})Supported Methods
Ethereum Standard
| Method | Description | EIP |
|---|---|---|
eth_chainId | Returns the current chain ID | 695 |
eth_accounts | Returns connected accounts | - |
eth_requestAccounts | Requests account access | 1102 |
eth_sendTransaction | Sends a transaction | - |
Message Signing
| Method | Description | EIP |
|---|---|---|
personal_sign | Signs a message (EIP-191) | 191 |
eth_sign | Signs raw message hash | - |
eth_signTypedData_v4 | Signs typed data | 712 |
Wallet Namespace
| Method | Description | EIP |
|---|---|---|
wallet_connect | Connects wallet and requests accounts | - |
wallet_disconnect | Disconnects wallet session | - |
wallet_switchEthereumChain | Switches to a different chain | 3326 |
wallet_sendCalls | Sends batched calls atomically | 5792 |
wallet_getCallsStatus | Gets batch execution status | 5792 |
wallet_getCapabilities | Gets wallet capabilities | 5792 |
wallet_getAssets | Gets user's token balances | - |
Usage Example
import { createOneAuthProvider, OneAuthClient } from '@rhinestone/1auth'
const client = new OneAuthClient({
providerUrl: 'https://passkey.1auth.box',
})
const provider = createOneAuthProvider({
client,
chainId: 8453, // Base
})
// Request accounts
const accounts = await provider.request({
method: 'eth_requestAccounts',
})
// Sign a message
const signature = await provider.request({
method: 'personal_sign',
params: ['Hello, 1auth!', accounts[0]],
})Cross-Chain with tokenRequests
For ERC20 transfers and contract calls that need tokens, include tokenRequests to enable automatic cross-chain funding. The user can pay from any chain - the orchestrator handles bridging and swaps automatically.
import { encodeFunctionData, parseUnits } from 'viem';
const amount = parseUnits('100', 6); // 100 USDC
const transferData = encodeFunctionData({
abi: erc20Abi,
functionName: 'transfer',
args: [recipient, amount],
});
await provider.request({
method: 'eth_sendTransaction',
params: [{
to: USDC_ADDRESS,
data: transferData,
tokenRequests: [{ token: USDC_ADDRESS, amount }],
}],
});See Token Requests for detailed documentation.