money

package
v0.0.0-...-e229939 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PayloadTypeTransfer = "trans"
	PayloadTypeSplit    = "split"
	PayloadTypeTransDC  = "transDC"
	PayloadTypeSwapDC   = "swapDC"
	PayloadTypeLock     = "lock"
	PayloadTypeUnlock   = "unlock"
)
View Source
const (
	UnitIDLength   = UnitPartLength + TypePartLength
	UnitPartLength = 32
	TypePartLength = 1
)
View Source
const DefaultSystemID types.SystemID = 0x00000001

Variables

View Source
var (
	BillUnitType            = []byte{0x00}
	FeeCreditRecordUnitType = []byte{0x0f}
)

Functions

func NewBillID

func NewBillID(shardPart []byte, unitPart []byte) types.UnitID

func NewFeeCreditRecordID

func NewFeeCreditRecordID(shardPart []byte, unitPart []byte) types.UnitID

func NewUnitData

func NewUnitData(unitID types.UnitID) (types.UnitData, error)

Types

type BillData

type BillData struct {
	V       uint64 `json:"value,string"`      // The monetary value of this bill
	T       uint64 `json:"lastUpdate,string"` // The round number of the last transaction with the bill
	Counter uint64 `json:"counter,string"`    // The transaction counter of this bill
	Locked  uint64 `json:"locked,string"`     // locked status of the bill, non-zero value means locked
	// contains filtered or unexported fields
}

func (*BillData) Copy

func (b *BillData) Copy() types.UnitData

func (*BillData) IsLocked

func (b *BillData) IsLocked() bool

func (*BillData) SummaryValueInput

func (b *BillData) SummaryValueInput() uint64

func (*BillData) Write

func (b *BillData) Write(hasher hash.Hash) error

type LockAttributes

type LockAttributes struct {
	LockStatus uint64 // status of the lock, non-zero value means locked
	Counter    uint64
	// contains filtered or unexported fields
}

type SplitAttributes

type SplitAttributes struct {
	TargetUnits    []*TargetUnit
	RemainingValue uint64
	Counter        uint64
	// contains filtered or unexported fields
}

type SwapDCAttributes

type SwapDCAttributes struct {
	OwnerCondition   []byte
	DcTransfers      []*types.TransactionRecord
	DcTransferProofs []*types.TxProof
	TargetValue      uint64 // value added to target bill
	// contains filtered or unexported fields
}

type TargetUnit

type TargetUnit struct {
	Amount         uint64
	OwnerCondition []byte
	// contains filtered or unexported fields
}

type TransferAttributes

type TransferAttributes struct {
	NewBearer   []byte
	TargetValue uint64
	Counter     uint64
	// contains filtered or unexported fields
}

type TransferDCAttributes

type TransferDCAttributes struct {
	Value             uint64
	TargetUnitID      []byte
	TargetUnitCounter uint64
	Counter           uint64
	// contains filtered or unexported fields
}

type UnlockAttributes

type UnlockAttributes struct {
	Counter uint64
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL