Create a Public Client
| Parameter | Type | Description |
|---|---|---|
rpcUrl | string | JSON-RPC endpoint for the target chain |
chainId | number | Chain ID (e.g. 137 for Polygon, 1 for Ethereum) |
organizationId | string | Organization ID from your authenticated session |
fromAddress | string | Wallet address to sign and send from |
Transaction Flow
The SDK follows a prepare → sign → send → receipt pattern, similar to Viem.Step 1: Prepare
Build the unsigned transaction with nonce, chain ID, and gas parameters populated automatically:data for contract calls:
Step 2: Sign and Send
Sign the prepared transaction with your server wallet key and broadcast it to the network:Step 3: Wait for Receipt
Block until the transaction is confirmed on-chain:Full Example
Sign a Message
Sign an arbitrary string message (EIP-191 personal sign):Sign Typed Data (EIP-712)
Sign structured data following the EIP-712 standard:Sign Raw Payload
Sign an arbitrary hex-encoded payload with a specific hash function:| Parameter | Type | Options |
|---|---|---|
payload | string | Hex-encoded data to sign |
encoding | string | PAYLOAD_ENCODING_HEXADECIMAL, PAYLOAD_ENCODING_UTF8 |
hashFunction | string | HASH_FUNCTION_SHA256, HASH_FUNCTION_KECCAK256, HASH_FUNCTION_NO_OP |
Next Steps
- Export & Security — export private keys and follow security best practices
- Authentication — learn about the auth model and token lifecycle