Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
RPC Reference – 1auth
Skip to content

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

MethodDescriptionEIP
eth_chainIdReturns the current chain ID695
eth_accountsReturns connected accounts-
eth_requestAccountsRequests account access1102
eth_sendTransactionSends a transaction-

Message Signing

MethodDescriptionEIP
personal_signSigns a message (EIP-191)191
eth_signSigns raw message hash-
eth_signTypedData_v4Signs typed data712

Wallet Namespace

MethodDescriptionEIP
wallet_connectConnects wallet and requests accounts-
wallet_disconnectDisconnects wallet session-
wallet_switchEthereumChainSwitches to a different chain3326
wallet_sendCallsSends batched calls atomically5792
wallet_getCallsStatusGets batch execution status5792
wallet_getCapabilitiesGets wallet capabilities5792
wallet_getAssetsGets 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.