Skip to content

[FEATURE] [RPC] Implement RPC Request/Response Types #39

@hulxv

Description

@hulxv

Description

Design and implement type-safe request and response structures for the RPC framework.

Motivation

Provide a clean API for handling JSON-RPC 2.0 requests and responses with proper error handling.

Proposed Solution

pub struct Request {
    method: String,
    params: serde_json::Value,
    id: Option<RequestId>,
}

impl Request {
    pub fn json<T: DeserializeOwned>(&self) -> Result<T>;
    pub fn param<T>(&self, key: &str) -> Result<T>;
}

Tasks

  • Design Request/Response types
  • Implement JSON-RPC 2.0 compliance
  • Add proper error types
  • Support batch requests
  • Add validation
  • Write unit tests
  • Document with examples

Expected

  • JSON-RPC 2.0 compliant
  • Type-safe parameter extraction
  • Proper error handling
  • Batch request support

Dependencies:

Metadata

Metadata

Assignees

No one assigned

    Labels

    coinswap-migration-phase-2The 2nd phase in integration of mill-io inside CoinswapenhancementNew feature or requestmill-rpcRelated to mill-rpc, our mill-io-based RPC framework

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions