mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 13:23:10 +00:00
49 lines
1.0 KiB
Rust
49 lines
1.0 KiB
Rust
use common::transaction::SignedTransaction;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
//Requests
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
pub struct SendTxRequest {
|
|
pub transaction: SignedTransaction,
|
|
///UTXO Commitment Root, Pub Tx Root
|
|
pub tx_roots: [[u8; 32]; 2],
|
|
}
|
|
|
|
//Responses
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
pub struct SendTxResponse {
|
|
pub status: String,
|
|
pub additional_data: Option<String>,
|
|
}
|
|
|
|
//General
|
|
|
|
#[derive(Debug, Clone, Serialize)]
|
|
pub struct SequencerRpcRequest {
|
|
jsonrpc: String,
|
|
pub method: String,
|
|
pub params: serde_json::Value,
|
|
pub id: u64,
|
|
}
|
|
|
|
impl SequencerRpcRequest {
|
|
pub fn from_payload_version_2_0(method: String, payload: serde_json::Value) -> Self {
|
|
Self {
|
|
jsonrpc: "2.0".to_string(),
|
|
method,
|
|
params: payload,
|
|
//ToDo: Correct checking of id
|
|
id: 1,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize)]
|
|
pub struct SequencerRpcResponse {
|
|
pub jsonrpc: String,
|
|
pub result: serde_json::Value,
|
|
pub id: u64,
|
|
}
|