Versions in this module Expand all Collapse all v0 v0.4.0 Mar 25, 2024 Changes in this version type Option + func WithPredicateExecutor(exec PredicateExecutor) Option + type PredicateExecutor func(ctx context.Context, predicate types.PredicateBytes, args []byte, ...) (bool, error) v0.3.0 Feb 28, 2024 Changes in this version + const DefaultSystemIdentifier + const PayloadTypeLock + const PayloadTypeSplit + const PayloadTypeSwapDC + const PayloadTypeTransDC + const PayloadTypeTransfer + const PayloadTypeUnlock + const TypePartLength + const UnitIDLength + const UnitPartLength + var BillUnitType = []byte + var DustCollectorMoneySupplyID = NewBillID(nil, nil) + var DustCollectorPredicate = templates.NewP2pkh256BytesFromKeyHash(abHasher.Sum256([]byte("dust collector"))) + var ErrAdditionTimeInvalid = errors.New("EarliestAdditionTime is greater than LatestAdditionTime") + var ErrBillLocked = errors.New("bill is already locked") + var ErrBillNil = errors.New("bill is nil") + var ErrBillUnlocked = errors.New("bill is already unlocked") + var ErrFeeProofExists = errors.New("fee tx cannot contain fee authorization proof") + var ErrInvalidBacklink = errors.New("the transaction backlink is not equal to unit backlink") + var ErrInvalidBillValue = errors.New("transaction value must be equal to bill value") + var ErrInvalidDataType = errors.New("invalid data type") + var ErrInvalidFCValue = errors.New("the amount to transfer cannot exceed the value of the bill") + var ErrInvalidFeeValue = errors.New("the transaction max fee cannot exceed the transferred amount") + var ErrInvalidLockStatus = errors.New("invalid lock status: expected non-zero value, got zero value") + var ErrReclaimFCInvalidTargetUnit = errors.New("invalid target unit") + var ErrReclaimFCInvalidTargetUnitBacklink = errors.New("invalid target unit backlink") + var ErrReclaimFCInvalidTxFee = errors.New("the transaction fees cannot exceed the transferred value") + var ErrRecordIDExists = errors.New("fee tx cannot contain fee credit reference") + var ErrTargetRecordIDEmpty = errors.New("TargetRecordID is empty") + var ErrTargetSystemIdentifierEmpty = errors.New("TargetSystemIdentifier is empty") + var ErrTxAttrNil = errors.New("tx attributes is nil") + var ErrTxNil = errors.New("tx is nil") + var FeeCreditRecordUnitType = []byte + func HashForIDCalculation(idBytes []byte, attr []byte, timeout uint64, idx uint32, hashFunc crypto.Hash) []byte + func NewBillID(shardPart []byte, unitPart []byte) types.UnitID + func NewFeeCreditRecordID(shardPart []byte, unitPart []byte) types.UnitID + func NewTxSystem(observe txsystem.Observability, opts ...Option) (*txsystem.GenericTxSystem, error) + func NewUnitData(unitID types.UnitID) (state.UnitData, error) + type BillData struct + Backlink []byte + Locked uint64 + T uint64 + V uint64 + func (b *BillData) Copy() state.UnitData + func (b *BillData) IsLocked() bool + func (b *BillData) SummaryValueInput() uint64 + func (b *BillData) Write(hasher hash.Hash) error + type DustCollector struct + func NewDustCollector(s *state.State) *DustCollector + func (d *DustCollector) AddDustBill(id types.UnitID, currentBlockNumber uint64) + func (d *DustCollector) GetDustBills(blockNumber uint64) []types.UnitID + func (d *DustCollector) RemoveDustBills(blockNumber uint64) + type LockAttributes struct + Backlink []byte + LockStatus uint64 + type Module struct + func NewMoneyModule(options *Options) (m *Module, err error) + func (m *Module) BeginBlockFuncs() []func(blockNr uint64) error + func (m *Module) EndBlockFuncs() []func(blockNumber uint64) error + func (m *Module) TxExecutors() map[string]txsystem.ExecuteFunc + type Option func(*Options) + func WithFeeCalculator(calc fc.FeeCalculator) Option + func WithHashAlgorithm(hashAlgorithm gocrypto.Hash) Option + func WithState(s *state.State) Option + func WithSystemDescriptionRecords(records []*genesis.SystemDescriptionRecord) Option + func WithSystemIdentifier(systemIdentifier types.SystemID) Option + func WithTrustBase(trust map[string]crypto.Verifier) Option + type Options struct + func DefaultOptions() *Options + type SplitAttributes struct + Backlink []byte + RemainingValue uint64 + TargetUnits []*TargetUnit + type SwapDCAttributes struct + DcTransferProofs []*types.TxProof + DcTransfers []*types.TransactionRecord + OwnerCondition []byte + TargetValue uint64 + type TargetUnit struct + Amount uint64 + OwnerCondition []byte + type TransferAttributes struct + Backlink []byte + NewBearer []byte + TargetValue uint64 + type TransferDCAttributes struct + Backlink []byte + TargetUnitBacklink []byte + TargetUnitID []byte + Value uint64 + type UnlockAttributes struct + Backlink []byte