Skip to main content

thruput_sdk/
types.rs

1//! Types
2
3pub use xdrs::{BytesM, VecM};
4
5pub use thruput_xdr::auth_claim::AuthClaim;
6pub use thruput_xdr::auth_claim::AuthClaimType;
7pub use thruput_xdr::auth_claim::KeyID;
8pub use thruput_xdr::auth_claim::PubkeyAccountPreimage;
9pub use thruput_xdr::contract;
10pub use thruput_xdr::contract::Contract;
11pub use thruput_xdr::contract::ContractEntrypointID;
12pub use thruput_xdr::event;
13pub use thruput_xdr::exec_result::*;
14pub use thruput_xdr::genesis;
15pub use thruput_xdr::genesis_addresses;
16pub use thruput_xdr::retrocausal_queue::kQueueEntryMaxLen;
17pub use thruput_xdr::storage_cost::*;
18pub use thruput_xdr::storage_item::StorageDeltaFlags;
19/// [`StorageDeltaFlags`] under the name storage handles use for it: the flags
20/// (today only `ExclusiveLock`) a transaction requests for a key it writes.
21pub use thruput_xdr::storage_item::StorageDeltaFlags as StorageFlags;
22pub use thruput_xdr::transaction;
23pub use thruput_xdr::types::*;
24
25pub mod sys {
26    pub use thruput_xdr::SyscallNo;
27    pub use thruput_xdr::invoke_args::{
28        CopyableInvokeInputs, CopyableInvokeOutputs,
29    };
30    pub use thruput_xdr::syscall_error::SyscallErrorCode;
31    pub use thruput_xdr::syscalls::*;
32    pub use thruput_xdr::syserr::SysErr;
33
34    pub type SysResult<T = ()> = core::result::Result<T, SysErr>;
35}
36
37// Shorthand for use in contracts
38pub use StorageKeyContractData as StorageKey;
39
40/// The identity of a contract interface at a major version.
41///
42/// `#[contract]` on a trait derives it from the interface's effective name
43/// and major version — the same pair that namespaces the interface's
44/// entrypoint IDs — and exposes it as `Trait::INTERFACE_ID` and
45/// `<Iface>Entrypoints::INTERFACE_ID`. Two contracts implementing the same
46/// interface crate therefore agree on the ID, and a major-version bump
47/// changes it. The leading eight bytes of the hash, kept as bytes: an
48/// interface ID is a name anyone may declare, so its width only keeps
49/// honestly distinct interfaces apart (as with [`ContractEntrypointID`]),
50/// and bytes cross the wire and the interface table with no decoding. This
51/// is Thruput's analogue of an ERC-165 interface ID; `thruput-erc165-if`
52/// is the query surface for it.
53pub type InterfaceId = [u8; 8];
54
55pub use thruput_xdr::auth_token::{
56    AuthToken, AuthTokenNode, AuthTokenPayload, kAuthTokenMaxChildNodes,
57    kAuthTokenMaxDepth, kAuthTokenMaxLen,
58};