use crate::api::ethereum::responses::{
EthereumAccountResponse, EthereumAccountsResponse, EthereumSignResponse,
EthereumSignTransactionResponse,
};
use alloy_primitives::Bytes;
use rustify_derive::Endpoint;
#[derive(Builder, Debug, Endpoint)]
#[endpoint(
path = "{self.mount}/ethereum/accounts",
method = "POST",
response = "EthereumAccountResponse",
builder = "true"
)]
#[builder(setter(into))]
pub struct CreateEthereumAccountRequest {
#[endpoint(skip)]
pub mount: String,
}
#[derive(Builder, Debug, Endpoint)]
#[endpoint(
path = "{self.mount}/ethereum/accounts/{self.address}",
method = "GET",
response = "EthereumAccountResponse",
builder = "true"
)]
#[builder(setter(into))]
pub struct ReadEthereumAccountRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub address: String,
}
#[derive(Builder, Debug, Endpoint)]
#[endpoint(
path = "{self.mount}/ethereum/accounts",
method = "GET",
response = "EthereumAccountsResponse",
builder = "true"
)]
#[builder(setter(into))]
pub struct ListEthereumAccountsRequest {
#[endpoint(skip)]
pub mount: String,
}
#[derive(Builder, Debug, Endpoint)]
#[endpoint(
path = "{self.mount}/ethereum/accounts/{self.address}/sign-transaction",
method = "POST",
response = "EthereumSignTransactionResponse",
builder = "true"
)]
#[builder(setter(into))]
pub struct SignEthereumTransactionRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub address: String,
#[endpoint(body)]
pub chain_id: String,
#[endpoint(body)]
pub amount: String,
#[endpoint(body)]
pub data: Bytes,
#[endpoint(body)]
pub gas_limit: u64,
#[endpoint(body)]
pub gas_price: String,
#[endpoint(body)]
pub nonce: u64,
#[endpoint(body)]
pub to: Option<String>,
}
#[derive(Builder, Debug, Endpoint)]
#[endpoint(
path = "{self.mount}/ethereum/accounts/import",
method = "POST",
response = "EthereumAccountResponse",
builder = "true"
)]
#[builder(setter(into))]
pub struct ImportPrivateKeyRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(body)]
pub private_key: String,
}
#[derive(Builder, Debug, Endpoint)]
#[endpoint(
path = "{self.mount}/ethereum/accounts/{self.address}/sign",
method = "POST",
response = "EthereumSignResponse",
builder = "true"
)]
#[builder(setter(into))]
pub struct EthereumSignRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub address: String,
#[endpoint(body)]
pub data: String,
}