Skip to content

Dedicated input box for each nested field #216

@kariy

Description

@kariy
Image

The getEvents method in the JSON-RPC playground currently provides only a single input box, even though the parameter should be a JSON object with multiple nested fields. This makes it difficult to enter valid input, as users must manually type the entire object structure.

We should have dedicated input box (as long as it makes sense) for each nested field of the filter object.

JSON-RPC spec for the starknet_getEvents method: https://github.com/starkware-libs/starknet-specs/blob/a2d10fc6cbaddbe2d3cf6ace5174dd0a306f4885/api/starknet_api_openrpc.json#L799-L815

Reference on the Rust types used in Katana:

/// Events request.
pub struct EventFilterWithPage {
    pub event_filter: EventFilter,
    pub result_page_request: ResultPageRequest,
}

/// Event filter.
///
/// An event filter/query.
pub struct EventFilter {
    /// From block
    pub from_block: Option<BlockId>,
    /// To block
    pub to_block: Option<BlockId>,
    /// From contract
    pub address: Option<Felt>,
    /// The keys to filter over
    pub keys: Option<Vec<Vec<Felt>>>,
}

/// Result page request.
pub struct ResultPageRequest {
    /// The token returned from the previous query. If no token is provided the first page is
    /// returned.
    pub continuation_token: Option<String>,
    /// Chunk size
    pub chunk_size: u64,
}

This also applies to other RPC methods whose parameters consist of an object with multiple nested fields (eg. starknet_call).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions