Small examples. Real requests.
Copy a client, inspect a block, and verify a receipt. Each example reads public state without signing or submitting a transaction.
A client that checks network identity
Run this JavaScript in Node.js 22+ as an .mjs file. It checks transport status, JSON-RPC errors, and chain identity before reading activation. It prints the response received; it does not assume an active state.
const endpoint = 'https://rpc.sigil.ml/rpc';
const expectedChainId = 'sigil-mainnet-1';
async function readRpc(method, params = {}) {
const response = await fetch(endpoint, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),
signal: AbortSignal.timeout(15000),
});
if (!response.ok) throw new Error('HTTP ' + response.status);
const envelope = await response.json();
if (envelope.error) {
throw new Error(envelope.error.code + ': ' + envelope.error.message);
}
if (!Object.hasOwn(envelope, 'result')) throw new Error('Missing RPC result');
return envelope.result;
}
const node = await readRpc('sigil_getNodeInfo');
if (node.chain_id !== expectedChainId) throw new Error('Wrong network');
const activation = await readRpc('sigil_getNetworkActivationStatus');
console.log({ node, activation });Inspect a small block window
count is a positive integer, capped by the handler at 100. The response contains blocks, latest_height, and count.
curl --fail-with-body --show-error --silent --max-time 15 'https://rpc.sigil.ml/rpc' \
-H 'content-type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"sigil_getLatestBlock","params":{"count":3}}'Look up a transaction receipt
Replace YOUR_TRANSACTION_HASH with a transaction hash from the same network. Check the returned status and receipt instead of treating submission as settlement. A not-found error is distinct from success.
curl --fail-with-body --show-error --silent --max-time 15 'https://rpc.sigil.ml/rpc' \
-H 'content-type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"sigil_getTransactionReceipt","params":{"hash":"YOUR_TRANSACTION_HASH"}}'Study the reference contract interfaces
Sigil-FT-1, Sigil-Multisig-1, and Sigil-Vesting-1 are source-workspace reference contracts for the ANVIL WASM runtime. Their ABI takes a JSON string containing a pipe-delimited command; it is not an Ethereum ABI.
| Item | Details |
|---|---|
| Sigil-FT-1 | Read interfaces include balance|did, allowance|owner|spender, and total. |
| Sigil-Multisig-1 | Read interfaces include ready|proposal_id, approvals|proposal_id, and is_signer|did. |
| Sigil-Vesting-1 | Read interfaces include vested, released, and releasable. |