1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Fireblocks API
//
// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
//
// The version of the OpenAPI document: 1.8.0
// Contact: developers@fireblocks.com
// Generated by: https://openapi-generator.tech
use {
crate::models,
serde::{Deserialize, Serialize},
};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ContractUploadRequest {
/// The name of the contract template
#[serde(rename = "name")]
pub name: String,
/// A short description of the contract template
#[serde(rename = "description")]
pub description: String,
/// A full description of the contract template. May contain to break the
/// lines
#[serde(rename = "longDescription", skip_serializing_if = "Option::is_none")]
pub long_description: Option<String>,
/// The compiled artifact of this smart contract. Used for deployment of
/// this contract template
#[serde(rename = "bytecode")]
pub bytecode: String,
/// The source code of the contract. Optional.
#[serde(rename = "sourcecode", skip_serializing_if = "Option::is_none")]
pub sourcecode: Option<String>,
/// The type of the contract template
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<Type>,
/// A `natspec` compliant documentation json. Can be retrieved from the
/// output json after compilation
#[serde(rename = "docs", skip_serializing_if = "Option::is_none")]
pub docs: Option<models::ContractDoc>,
#[serde(rename = "abi")]
pub abi: Vec<Vec<models::AbiFunction>>,
/// The attributes related to this contract template. It will be displayed
/// in the tokenization page
#[serde(rename = "attributes", skip_serializing_if = "Option::is_none")]
pub attributes: Option<models::ContractAttributes>,
}
impl ContractUploadRequest {
pub fn new(
name: String,
description: String,
bytecode: String,
abi: Vec<Vec<models::AbiFunction>>,
) -> ContractUploadRequest {
ContractUploadRequest {
name,
description,
long_description: None,
bytecode,
sourcecode: None,
r#type: None,
docs: None,
abi,
attributes: None,
}
}
}
/// The type of the contract template
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "FUNGIBLE_TOKEN")]
FungibleToken,
#[serde(rename = "NON_FUNGIBLE_TOKEN")]
NonFungibleToken,
#[serde(rename = "TOKEN_UTILITY")]
TokenUtility,
}
impl Default for Type {
fn default() -> Type {
Self::FungibleToken
}
}