Sigil documentation
ReferenceJSON-RPC

sigil_getContractEvents

Fetch contract events with optional filters.

Method

sigil_getContractEvents is registered in the canonical JSON-RPC catalog. Use POST /rpc, Content-Type: application/json, JSON-RPC 2.0 and a caller-controlled request id. Node RPC profile, build feature and runtime activation checks still apply.

Fetch contract events with optional filters.

Request binding

Source handler: rpc_contract::handle_get_contract_events in sigil/node/sigil-node/src/rpc_contract.rs, line 277.

The handler directly reads these named fields: contract_did, from_height, limit, to_height, topic. Additional typed parsing, aliases and nested validation are defined by its request types. Field presence alone does not establish optionality.

Parsing excerpt

These source excerpts show binding and validation; they are not runnable client code.

    if let Some(d) = req.params.get("contract_did").and_then(Value::as_str) {
        q.contract_did = Some(d.to_string());

    if let Some(t) = req.params.get("topic").and_then(Value::as_str) {
        q.topic = Some(t.to_string());

    if let Some(h) = req.params.get("from_height").and_then(Value::as_u64) {
        q.from_height = Some(h);

    if let Some(h) = req.params.get("to_height").and_then(Value::as_u64) {
        q.to_height = Some(h);

    if let Some(l) = req.params.get("limit").and_then(Value::as_u64) {
        q.limit = Some(l as u32);

Responses and failures

Check HTTP status, parse the JSON-RPC envelope, reject error, and require result on success. Preserve large base-unit integers without floating-point rounding. A catalog method does not bypass authentication, capability, policy or activation requirements.

On this page