API Methods
Core methods that power RISE Chain's real-time capabilities.
eth_sendRawTransactionSync
Sends a signed transaction and waits for instant confirmation, returning the complete transaction receipt.
This method is based on EIP-7966, which introduces synchronous transaction confirmation to Ethereum. RISE Chain implements this standard to provide instant transaction finality.
Parameters
data
- Signed transaction data (hex string)
Returns
Complete TransactionReceipt
object with all standard fields:
{
transactionHash: string,
blockNumber: string,
blockHash: string,
transactionIndex: string,
from: string,
to: string | null,
gasUsed: string,
cumulativeGasUsed: string,
status: string, // "0x1" for success, "0x0" for failure
logs: Log[],
logsBloom: string,
contractAddress: string | null
}
Example
const receipt = await client.request({
method: 'eth_sendRawTransactionSync',
params: ['0x...signed_transaction']
})
// Transaction is already confirmed!
console.log('Transaction hash:', receipt.transactionHash)
console.log('Status:', receipt.status === '0x1' ? 'Success' : 'Failed')
Key Benefits
- Instant confirmation: No waiting for block inclusion
- Complete receipt: All transaction details immediately available
- Synchronous flow: Simplifies application logic
- Error handling: Failed transactions return immediately with status
0x0
WebSocket Subscriptions
RISE Chain enhances standard Ethereum subscriptions with real-time shred data.
shred
Subscribe to new shreds in real-time for instant transaction visibility.
Subscribe
{
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": ["shred"],
"id": 1
}
Subscription Response
{
"jsonrpc": "2.0",
"result": "0x9ce59a13059e417087c02d3236a0b1cc",
"id": 1
}
Notification Format
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0x9ce59a13059e417087c02d3236a0b1cc",
"result": {
"blockTimestamp": "0x...",
"blockNumber": "0x1",
"shredIndex": 0,
"startingLogIndex": 0,
"transactions": [
{
"hash": "0x...",
"status": "success",
"gasUsed": "0x5208",
"cumulativeGasUsed": "0x5208",
"logs": []
}
],
"stateChanges": [
{
"address": "0x...",
"nonce": 1,
"balance": "0x...",
"storageChanges": [],
"newCode": null
}
]
}
}
}
logs
Subscribe to contract event logs with shred-speed delivery. On RISE Chain, logs are delivered from shreds instead of blocks for faster event processing.
Subscribe with Filter
{
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": [
"logs",
{
"address": "0x...",
"topics": ["0x..."]
}
],
"id": 1
}
Enhanced Behavior
- Events delivered immediately when transactions are processed in shreds
- No waiting for block confirmation
- Standard Ethereum log format maintained for compatibility
- Filters work exactly like standard Ethereum
Example Usage
// Using viem
const unwatch = publicClient.watchContractEvent({
address: '0x...',
abi: contractAbi,
eventName: 'Transfer',
onLogs: logs => {
// Events arrive in milliseconds, not seconds!
logs.forEach(log => {
console.log('Transfer event:', log.args)
})
}
})
// Using raw WebSocket
ws.send(JSON.stringify({
jsonrpc: "2.0",
method: "eth_subscribe",
params: ["logs", { address: "0x..." }],
id: 1
}))
Usage Patterns
Synchronous Transaction Flow
import { sendTransactionSync } from 'shreds/viem'
// Traditional async pattern (not needed with RISE)
// const hash = await client.sendTransaction(tx)
// const receipt = await client.waitForTransactionReceipt({ hash })
// RISE synchronous pattern
const receipt = await sendTransactionSync(client, tx)
// Transaction already confirmed with receipt!
Real-Time Event Monitoring
import { watchShreds } from 'shreds/viem'
// Monitor all shreds
const unwatch = watchShreds(client, {
onShred: (shred) => {
console.log(`Shred ${shred.shredIndex} confirmed`)
shred.transactions.forEach(tx => {
console.log(`- Transaction ${tx.hash}: ${tx.status}`)
})
}
})
// Monitor specific contract events
client.watchContractEvent({
address: contractAddress,
abi: contractAbi,
onLogs: (logs) => {
// Process events in real-time
}
})
Error Handling
try {
const receipt = await sendTransactionSync(client, {
to: '0x...',
value: parseEther('1.0')
})
if (receipt.status === '0x0') {
console.error('Transaction failed')
// Handle failure immediately
}
} catch (error) {
// Handle RPC errors (insufficient funds, invalid nonce, etc.)
console.error('Transaction error:', error)
}
Performance Characteristics
RTT (Round-Trip Time) Targets
- Shred Confirmation: 3-5ms (p50), 10ms (p99)
- Event Delivery: < 10ms from transaction execution
- State Updates: Immediate upon shred confirmation
Throughput
- Transactions per Shred: 1-100
- Shreds per Second: 1000+
- Total TPS: 10,000+
Best Practices
-
Use Synchronous Methods for Critical Operations
// Preferred for payments and time-sensitive operations const receipt = await sendTransactionSync(client, tx)
-
Subscribe to Events for Real-Time Updates
// More efficient than polling client.watchContractEvent({ ... })
-
Handle Errors Immediately
// No need to wait for confirmation if (receipt.status === '0x0') { // Handle failure }
Next Steps
- Explore Examples for practical usage patterns
- Check the shreds npm module for TypeScript integration