엔드포인트
모든 JSON-RPC 호출은 단일 POST 엔드포인트를 사용합니다.
| 네트워크 | URL |
|---|
| 테스트넷 | https://api.test.stablenet.network |
모든 요청은 JSON-RPC 2.0 형식을 따릅니다:
{
"jsonrpc": "2.0",
"method": "<메서드명>",
"params": [...],
"id": 1
}
네임스페이스
| 네임스페이스 | 용도 | 퍼블릭 RPC |
|---|
eth | 블록, 트랜잭션, 상태, 가스 | ✅ |
net | 네트워크 정보 | ✅ |
web3 | 유틸리티 | ✅ |
txpool | 트랜잭션 풀 조회 | ✅ |
istanbul | WBFT 합의 검증자 | ✅ |
debug | 트레이싱, 진단 | 노드 운영자 전용 |
personal | 계정 관리 | 퍼블릭 RPC 비활성화 |
admin | 노드 관리 | 퍼블릭 RPC 비활성화 |
eth 네임스페이스
eth_blockNumber
현재 블록 번호를 반환합니다.
curl -X POST https://api.test.stablenet.network \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
import { JsonRpcProvider } from "ethers";
const provider = new JsonRpcProvider("https://api.test.stablenet.network");
const blockNumber = await provider.getBlockNumber();
console.log(blockNumber);
import { createPublicClient, http } from "viem";
const client = createPublicClient({
transport: http("https://api.test.stablenet.network"),
});
const blockNumber = await client.getBlockNumber();
응답
{ "jsonrpc": "2.0", "id": 1, "result": "0x132d3" }
eth_getBalance
계정의 KRC 잔액을 wei 단위로 반환합니다.
파라미터
| # | 타입 | 설명 |
|---|
| 1 | address | 계정 주소 |
| 2 | BlockTag | "latest", "earliest", "pending", 또는 블록 번호 (16진수) |
curl -X POST https://api.test.stablenet.network \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0xYourAddress", "latest"],
"id": 1
}'
const balance = await provider.getBalance("0xYourAddress");
console.log(ethers.formatEther(balance)); // KRC 단위
const balance = await client.getBalance({
address: "0xYourAddress",
});
응답
{ "jsonrpc": "2.0", "id": 1, "result": "0x1bc16d674ec80000" }
eth_call
읽기 전용 컨트랙트 호출을 실행합니다. 트랜잭션을 제출하거나 상태를 변경하지 않습니다.
파라미터
| # | 타입 | 설명 |
|---|
| 1 | TransactionObject | {to, data, from?, value?, gas?} |
| 2 | BlockTag | 실행 기준 블록 |
curl -X POST https://api.test.stablenet.network \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0xContractAddress",
"data": "0x70a08231000000000000000000000000YourAddress"
},
"latest"
],
"id": 1
}'
const contract = new ethers.Contract(address, abi, provider);
const result = await contract.balanceOf("0xYourAddress");
const result = await client.readContract({
address: "0xContractAddress",
abi,
functionName: "balanceOf",
args: ["0xYourAddress"],
});
eth_estimateGas
트랜잭션에 필요한 가스를 추정합니다.
curl -X POST https://api.test.stablenet.network \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0xSenderAddress",
"to": "0xRecipientAddress",
"value": "0xde0b6b3a7640000"
}
],
"id": 1
}'
const gas = await provider.estimateGas({
from: "0xSenderAddress",
to: "0xRecipientAddress",
value: ethers.parseEther("1.0"),
});
const gas = await client.estimateGas({
account: "0xSenderAddress",
to: "0xRecipientAddress",
value: parseEther("1.0"),
});
eth_sendRawTransaction
서명된 트랜잭션을 네트워크에 제출합니다.
StableNet은 최소 Gas Tip 27,600 Gwei를 강제합니다. maxPriorityFeePerGas가 이보다 낮은 트랜잭션은 거부됩니다.
curl -X POST https://api.test.stablenet.network \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": ["0xSignedTxHex"],
"id": 1
}'
const wallet = new ethers.Wallet(privateKey, provider);
const tx = await wallet.sendTransaction({
to: "0xRecipient",
value: ethers.parseEther("1.0"),
maxPriorityFeePerGas: ethers.parseUnits("27600", "gwei"),
});
const receipt = await tx.wait();
import { createWalletClient, parseEther, parseGwei } from "viem";
const hash = await walletClient.sendTransaction({
to: "0xRecipient",
value: parseEther("1.0"),
maxPriorityFeePerGas: parseGwei("27600"),
});
eth_getTransactionReceipt
확정된 트랜잭션의 영수증을 반환합니다.
curl -X POST https://api.test.stablenet.network \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getTransactionReceipt",
"params": ["0xTxHash"],
"id": 1
}'
const receipt = await provider.getTransactionReceipt("0xTxHash");
console.log(receipt.status); // 1 = 성공, 0 = 실패(revert)
const receipt = await client.getTransactionReceipt({
hash: "0xTxHash",
});
istanbul 네임스페이스
Anzeon WBFT 합의 상태를 조회하는 StableNet 고유 메서드입니다.
istanbul_getValidators
현재 검증자 집합을 반환합니다.
curl -X POST https://api.test.stablenet.network \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "istanbul_getValidators",
"params": ["latest"],
"id": 1
}'
응답
{
"jsonrpc": "2.0",
"id": 1,
"result": ["0xValidator1Address", "0xValidator2Address"]
}
istanbul_status
최근 블록의 라운드 및 시일러 통계를 반환합니다.
curl -X POST https://api.test.stablenet.network \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "istanbul_status",
"params": [],
"id": 1
}'
수수료 위임 확장 API
StableNet은 수수료 위임 서명을 위한 확장 메서드를 제공합니다.
| 메서드 | 설명 |
|---|
eth_signRawFeeDelegateTransaction | 잠금 해제된 계정으로 이미 서명된 트랜잭션에 수수료 지불자 서명 추가 |
personal_signRawFeeDelegateTransaction | 비밀번호 인증 방식으로 동일한 작업 수행 |
완성된 서명 트랜잭션은 eth_sendRawTransaction으로 제출합니다. 가스 비용은 발신자가 아닌 수수료 지불자가 부담합니다.
빠른 참조
| 메서드 | 설명 |
|---|
eth_chainId | Chain ID (8283 테스트넷, 8282 메인넷) |
eth_blockNumber | 최신 블록 번호 |
eth_getBalance | 계정 KRC 잔액 |
eth_getCode | 컨트랙트 바이트코드 |
eth_getStorageAt | 스토리지 슬롯 값 |
eth_call | 읽기 전용 컨트랙트 호출 |
eth_estimateGas | 가스 추정 |
eth_sendRawTransaction | 서명된 트랜잭션 제출 |
eth_getTransactionByHash | 트랜잭션 상세 조회 |
eth_getTransactionReceipt | 트랜잭션 영수증 |
eth_getBlockByNumber | 블록 번호로 조회 |
eth_getBlockByHash | 블록 해시로 조회 |
eth_feeHistory | 과거 수수료 데이터 |
txpool_status | 대기/큐 트랜잭션 수 |
istanbul_getValidators | 현재 검증자 집합 |
istanbul_status | 합의 라운드 통계 |