Skip to main content

Crate tari_template_lib_types

Crate tari_template_lib_types 

Source
Expand description

This crate contains types that are used across the Tari Template ecosystem.

This includes:

  • Substate address types (e.g. ComponentAddress, ResourceAddress, NonFungibleAddress etc.)
  • Auth and access rules (e.g. AccessRule, OwnerRule)
  • a 128-bit unsigned Amount type and a 192-bit signed PrecisionAmount type (if the precision feature is enabled)
  • stealth crypto types and traits (e.g. EncryptedData, StealthTransferStatement etc.)
  • various utility types and traits (e.g. Metadata, Hash, MaxBytes, MaxString etc.)

Include this crate when you need these types but aren’t authoring a template (e.g. building a wallet). For template authors, you typically want to use the tari_template_lib crate instead, which re-exports this crate.

no_std is supported by excluding the std feature and enabling the alloc feature.

Re-exports§

pub use access_rules::AccessRule;

Modules§

access_rules
Access control rules for template-related data like component methods and resources
address_prefixes
bytes
confidential
constants
A collection of convenient constant values
crypto
Cryptography utilities related to public keys and balance proofs
engine_args
hex
public_macros
serde_helpers
stealth

Macros§

__build_vec
__build_vec_inner
__expr_counter
Low-level macro used for counting characters in the encoding of arguments. Not intended for general usage
__require_rule
__restricted_access_rule
__rule_requirement
amount
Creates a constant Amount from a string literal representing a base-10 integer at compile time.
custom_signature_domain
impl_from
Macro to implement From trait for a type that can be constructed from an integer.
impl_try_from
metadata
Creates a metadata object
newtype_struct_serde_impl
Low-level macro used for generating serde serializers/deserializers for newtype structs that should be represented as string in human-readable contexts. Not intended for general usage
op_impl
partial_eq_impl
partial_ord_impl
rule
A macro to build access rules for components and resources.

Structs§

Amount
A 128-bit signed amount.
AuthHook
AuthHookCaller
ClaimedOutputTombstoneAddress
The global identifier of a claimed layer-one output in the Tari network. This substate is created when a L1 UTXO is claimed to prevent double claims.
ComponentAddress
A component’s unique global identifier.
ComponentKey
EncryptedData
Used by the receiver to determine the value and mask of the commitment. Used in stealth and confidential transfers, as well as Minotari burns
EntityId
Hash32
Representation of a 32-byte hash value
HashParseError
Representation of a hash parsing error
InvalidByteLengthError
Represents an error that occurs when reading byte data with an unexpected length
KeyParseError
Representation of a hash parsing error
LogLevelParseError
Error when trying to parse a log level from an String
MaxBytes
MaxString
MaxStringError
MaxVec
Metadata
A collection of user-defined data used to describe other types, for example, non-fungible tokens or events
NonFungibleAddress
The unique identifier of a non-fungible index in the Tari network
NonFungibleAddressContents
A NonFungibleId namespaced by a ResourceAddress.
ObjectKey
Representation of a 32-byte object key
ParseResourceTypeError
ResourceAddress
The globally-unique identifier of a resource.
ResourceInfo
Info for a resource, including its type and divisibility.
TransactionReceiptAddress
UtxoAddress
UtxoAddressContents
A NonFungibleId namespaced by a ResourceAddress.
UtxoId
ValidatorFeePoolAddress
VaultId
A vault’s unique identification in the Tari network

Enums§

BinaryTag
A tag applied to various engine types. We use an unassigned CBOR tag range (128 to 255 inclusive). https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml
LogLevel
All the possible log levels
NonFungibleId
The unique identification of a non-fungible token inside it’s parent resource
OwnerRule
An enum for all possible ways to specify ownership of values
ParseNonFungibleAddressError
All the types of errors that can occur when parsing a non-fungible addresses
ParseNonFungibleIdError
All the types of errors that can occur when parsing a non-fungible ID
ResourceType
Represents every possible type of resource in the Tari network.
SubstateOwnerRule

Functions§

parse_template_address

Type Aliases§

FunctionName
TemplateAddress
The address of a Template