Skip to main content

aptos_client_icp/models/
script_payload.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/// ScriptPayload : Payload which runs a script that can run multiple functions
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ScriptPayload {
17    #[serde(rename = "code")]
18    pub code: Box<models::MoveScriptBytecode>,
19    /// Type arguments of the function
20    #[serde(rename = "type_arguments")]
21    pub type_arguments: Vec<String>,
22    /// Arguments of the function
23    #[serde(rename = "arguments")]
24    pub arguments: Vec<serde_json::Value>,
25}
26
27impl ScriptPayload {
28    /// Payload which runs a script that can run multiple functions
29    pub fn new(code: models::MoveScriptBytecode, type_arguments: Vec<String>, arguments: Vec<serde_json::Value>) -> ScriptPayload {
30        ScriptPayload {
31            code: Box::new(code),
32            type_arguments,
33            arguments,
34        }
35    }
36}
37