oasis_runtime_sdk/modules/accounts/
types.rs1use std::collections::BTreeMap;
3
4use crate::types::{address::Address, token};
5
6#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
8pub struct Transfer {
9 pub to: Address,
10 pub amount: token::BaseUnits,
11}
12
13#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
15pub struct Account {
16 #[cbor(optional)]
17 pub nonce: u64,
18}
19
20#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
22pub struct NonceQuery {
23 pub address: Address,
24}
25
26#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
28pub struct AddressesQuery {
29 pub denomination: token::Denomination,
30}
31
32#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
34pub struct BalancesQuery {
35 pub address: Address,
36}
37
38#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
40pub struct AccountBalances {
41 pub balances: BTreeMap<token::Denomination, u128>,
42}
43
44#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
46pub struct DenominationInfoQuery {
47 pub denomination: token::Denomination,
48}
49
50#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
52pub struct DenominationInfo {
53 pub decimals: u8,
55}