Skip to main content

aptos_client_icp/models/
view_request.rs

1/*
2 * Aptos Node API
3 *
4 * The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
5 *
6 * The version of the OpenAPI document: 1.2.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ViewRequest : View request for the Move View Function API
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ViewRequest {
17    /// Entry function id is string representation of a entry function defined on-chain.  Format: `{address}::{module name}::{function name}`  Both `module name` and `function name` are case-sensitive. 
18    #[serde(rename = "function")]
19    pub function: String,
20    /// Type arguments of the function
21    #[serde(rename = "type_arguments")]
22    pub type_arguments: Vec<String>,
23    /// Arguments of the function
24    #[serde(rename = "arguments")]
25    pub arguments: Vec<serde_json::Value>,
26}
27
28impl ViewRequest {
29    /// View request for the Move View Function API
30    pub fn new(function: String, type_arguments: Vec<String>, arguments: Vec<serde_json::Value>) -> ViewRequest {
31        ViewRequest {
32            function,
33            type_arguments,
34            arguments,
35        }
36    }
37}
38