unc_sdk/types/mod.rs
1mod vm_types;
2pub use self::vm_types::*;
3
4mod public_key;
5pub use self::public_key::{CurveType, PublicKey};
6
7mod primitives;
8pub use self::primitives::*;
9
10pub use unc_account_id::{AccountId, AccountIdRef};
11pub use unc_gas::UncGas as Gas;
12pub use unc_token::UncToken;
13
14mod error;
15pub use self::error::Abort;
16pub use self::error::FunctionError;
17
18/// Raw type for duration in nanoseconds
19pub type Duration = u64;
20
21/// Raw type for timestamp in nanoseconds
22pub type Timestamp = u64;
23
24/// Raw type for 32 bytes of the hash.
25pub type CryptoHash = [u8; 32];
26
27/// Weight of unused gas to use with [`promise_batch_action_function_call_weight`].
28///
29/// This weight will be used relative to other weights supplied in the function to distribute
30/// unused gas to those function calls. The default weight is 1.
31///
32/// For example, if 40 gas is leftover from the current method call and three functions specify
33/// the weights 1, 5, 2 then 5, 25, 10 gas will be added to each function call respectively,
34/// using up all remaining available gas.
35///
36/// [`promise_batch_action_function_call_weight`]: `crate::env::promise_batch_action_function_call_weight`
37#[derive(Debug, PartialEq, Eq)]
38#[repr(transparent)]
39pub struct GasWeight(pub u64);
40
41impl Default for GasWeight {
42 fn default() -> Self {
43 Self(1)
44 }
45}