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

Provider - RPC Reference

Complete reference for all RPC methods supported by the JAW SDK provider.

Installation

npm
npm install @jaw.id/core viem

Setup

import { JAW } from '@jaw.id/core';
 
const jaw = JAW.create({
  apiKey: 'YOUR_API_KEY',
  appName: 'My App',
});

Making Requests

All requests are made through the provider's request method:

const result = await jaw.provider.request({
  method: 'method_name',
  params: [...],
});

Provider Events

The provider emits events following the EIP-1193 specification:

// Account changes
jaw.provider.on('accountsChanged', (accounts: string[]) => {
  console.log('Accounts changed:', accounts);
});
 
// Chain changes
jaw.provider.on('chainChanged', (chainId: string) => {
  console.log('Chain changed:', chainId);
});
 
// Connection
jaw.provider.on('connect', (info: { chainId: string }) => {
  console.log('Connected to chain:', info.chainId);
});
 
// Disconnection
jaw.provider.on('disconnect', (error: ProviderRpcError) => {
  console.log('Disconnected:', error);
});

Account Methods

Methods for managing user accounts and authentication.

MethodDescriptionAuth Required
eth_requestAccountsRequest user authentication and account accessNo
eth_accountsGet currently connected accountsNo

Chain Methods

Methods for querying and switching blockchain networks.

MethodDescriptionAuth Required
eth_chainIdGet current chain ID (hex)No
wallet_switchEthereumChainSwitch to a different chainYes

Transaction Methods

Methods for sending transactions and batch operations.

MethodDescriptionAuth Required
eth_sendTransactionBroadcast a transaction to the networkYes
wallet_sendCallsBroadcast bundle of calls to the networkYes
wallet_showCallsStatusShow batch transaction status UIYes
wallet_getCallsStatusGet batch transaction statusNo

Signing Methods

Methods for signing messages and typed data.

MethodDescriptionAuth Required
personal_signSign a message with EIP-191Yes
eth_signTypedData_v4Sign structured typed data (EIP-712)Yes
wallet_signUnified signing method supporting multiple message formatsNo*

*Can use ephemeral signer if not authenticated

Wallet Methods

Methods for wallet connection and lifecycle management.

MethodDescriptionAuth Required
wallet_connectConnect with advanced capabilities (SIWE, subnames)No
wallet_disconnectDisconnect current sessionNo

Capability Methods

Methods for querying wallet capabilities.

MethodDescriptionAuth Required
wallet_getCapabilitiesGet wallet capabilities per chain (EIP-5792)No

Permission Methods

Methods for managing granular permissions for delegated transactions.

MethodDescriptionAuth Required
wallet_grantPermissionsGrant call and spend permissions to a spenderYes
wallet_revokePermissionsRevoke previously granted permissionsYes
wallet_getPermissionsGet all permissions for an accountNo*

*Requires address parameter if not authenticated

Asset Methods

Methods for querying token balances.

MethodDescriptionAuth Required
wallet_getAssetsGet token balances across chains (EIP-7811)No*

*Requires address parameter

Error Codes

JAW SDK follows EIP-1193 error codes:

CodeMessageDescription
4001User Rejected RequestUser declined in popup
4100UnauthorizedNot authenticated
4200Unsupported MethodMethod not supported
4900DisconnectedProvider disconnected
4901Chain DisconnectedChain not available
-32700Parse ErrorInvalid JSON
-32600Invalid RequestInvalid request object
-32601Method Not FoundMethod doesn't exist
-32602Invalid ParamsInvalid parameters
-32603Internal ErrorInternal JSON-RPC error