rosetta_types/call_request.rs
1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// CallRequest : CallRequest is the input to the `/call` endpoint.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct CallRequest {
15 #[serde(rename = "network_identifier")]
16 pub network_identifier: crate::NetworkIdentifier,
17 /// Method is some network-specific procedure call. This method could map to a network-specific RPC endpoint, a method in an SDK generated from a smart contract, or some hybrid of the two. The implementation must define all available methods in the Allow object. However, it is up to the caller to determine which parameters to provide when invoking `/call`.
18 #[serde(rename = "method")]
19 pub method: String,
20 /// Parameters is some network-specific argument for a method. It is up to the caller to determine which parameters to provide when invoking `/call`.
21 #[serde(rename = "parameters")]
22 pub parameters: serde_json::Value,
23}
24
25impl CallRequest {
26 /// CallRequest is the input to the `/call` endpoint.
27 pub fn new(
28 network_identifier: crate::NetworkIdentifier,
29 method: String,
30 parameters: serde_json::Value,
31 ) -> CallRequest {
32 CallRequest {
33 network_identifier,
34 method,
35 parameters,
36 }
37 }
38}