sui_graphql_client/query_types/coin.rs
1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4// ===========================================================================
5// Coin(s) Queries
6// ===========================================================================
7
8#[derive(cynic::QueryFragment, Debug)]
9#[cynic(schema = "rpc", graphql_type = "Query", variables = "CoinMetadataArgs")]
10pub struct CoinMetadataQuery {
11 #[arguments(coinType: $coin_type)]
12 pub coin_metadata: Option<CoinMetadata>,
13}
14
15// ===========================================================================
16// Coin(s) Query Args
17// ===========================================================================
18
19#[derive(cynic::QueryVariables, Debug)]
20pub struct CoinMetadataArgs<'a> {
21 pub coin_type: &'a str,
22}
23
24// ===========================================================================
25// Types
26// ===========================================================================
27
28use crate::query_types::schema;
29use crate::query_types::BigInt;
30
31/// The coin metadata associated with the given coin type.
32#[derive(cynic::QueryFragment, Debug)]
33#[cynic(schema = "rpc", graphql_type = "CoinMetadata")]
34pub struct CoinMetadata {
35 /// The number of decimal places used to represent the token.
36 pub decimals: Option<i32>,
37 /// Optional description of the token, provided by the creator of the token.
38 pub description: Option<String>,
39 /// Icon URL of the coin.
40 pub icon_url: Option<String>,
41 /// Full, official name of the token.
42 pub name: Option<String>,
43 /// The token's identifying abbreviation.
44 pub symbol: Option<String>,
45 /// The overall quantity of tokens that will be issued.
46 pub supply: Option<BigInt>,
47 /// Version of the token.
48 pub version: u64,
49}