sui_graphql_client/query_types/
balance.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::query_types::schema;
5use crate::query_types::BigInt;
6use crate::Address;
7
8#[derive(cynic::QueryFragment, Debug)]
9#[cynic(schema = "rpc", graphql_type = "Query", variables = "BalanceArgs")]
10pub struct BalanceQuery {
11    #[arguments(address: $address)]
12    pub owner: Option<Owner>,
13}
14
15#[derive(cynic::QueryFragment, Debug)]
16#[cynic(schema = "rpc", graphql_type = "Owner", variables = "BalanceArgs")]
17pub struct Owner {
18    #[arguments(type: $coin_type)]
19    pub balance: Option<Balance>,
20}
21
22#[derive(cynic::QueryFragment, Debug)]
23#[cynic(schema = "rpc", graphql_type = "Balance")]
24pub struct Balance {
25    pub total_balance: Option<BigInt>,
26}
27
28#[derive(cynic::QueryVariables, Debug)]
29pub struct BalanceArgs {
30    pub address: Address,
31    pub coin_type: Option<String>,
32}