[][src]Module ergo_lib::chain::ergo_box

Ergo box

Modules

box_builder

ErgoBoxCandidate builder

Structs

BoxId

newtype for box ids

BoxValue

Box value in nanoERGs with bound checks

ErgoBox

Box (aka coin, or an unspent output) is a basic concept of a UTXO-based cryptocurrency. In Bitcoin, such an object is associated with some monetary value (arbitrary, but with predefined precision, so we use integer arithmetic to work with the value), and also a guarding script (aka proposition) to protect the box from unauthorized opening.

ErgoBoxAssetsData

Simple struct to hold ErgoBoxAssets values

ErgoBoxCandidate

Contains the same fields as ErgoBox, except if transaction id and index, that will be calculated after full transaction formation. Use box_builder::ErgoBoxCandidateBuilder to create an instance.

NonMandatoryRegisterIdParsingError

Error for failed parsing of the register id from string

NonMandatoryRegisters

Stores non-mandatory registers for the box

RegisterIdOutOfBounds

Register id out of bounds error (not in 0-9 range)

Enums

BoxValueError

BoxValue errors

ErgoBoxFromJsonError

Errors on parsing ErgoBox from JSON

MandatoryRegisterId

Register ids that every box have (box properties exposed as registers)

NonMandatoryRegisterId

newtype for additional registers R4 - R9

NonMandatoryRegistersError

Possible errors when building NonMandatoryRegisters

RegisterId

Box register id (0-9)

Traits

ErgoBoxAssets

Assets that ErgoBox holds

ErgoBoxId

id of the ergo box

Functions

checked_sum

Sums up all iterator's box values Returns Err on overflow

sum_tokens

Returns the total token amounts (all tokens combined)

sum_tokens_from_boxes

Returns the total token amounts (all tokens combined) of the given boxes

sum_value

Returns the total value of the given boxes