alephium_web3/api/types.rs
1// Copyright 2018 - 2022 The Alephium Authors
2// This file is part of the alephium project.
3
4use serde::{Deserialize, Serialize};
5use num_bigint::BigUint;
6
7/// Number256 type for large integers
8pub type Number256 = BigUint;
9
10/// Token information
11#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
12pub struct Token {
13 pub id: String,
14 pub amount: String,
15}
16
17/// Val type for contract values
18#[derive(Debug, Clone, Serialize, Deserialize)]
19#[serde(untagged)]
20pub enum Val {
21 Number(String),
22 Bool(bool),
23 String(String),
24 Array(Vec<Val>),
25 Object(std::collections::HashMap<String, Val>),
26}