money

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionTypeTransfer uint16 = 1
	TransactionTypeSplit    uint16 = 2
	TransactionTypeTransDC  uint16 = 3
	TransactionTypeSwapDC   uint16 = 4
	TransactionTypeLock     uint16 = 5
	TransactionTypeUnlock   uint16 = 6
)
View Source
const (
	UnitIDLength   = UnitPartLength + TypePartLength
	UnitPartLength = 32
	TypePartLength = 1
)
View Source
const DefaultPartitionID types.PartitionID = 1

Variables

View Source
var (
	BillUnitType            = []byte{1}
	FeeCreditRecordUnitType = []byte{16}
)

Functions

func HashForNewBillID

func HashForNewBillID(tx *types.TransactionOrder, splitIndex uint32, hashAlgorithm crypto.Hash) ([]byte, error)

HashForNewBillID generates a new bill ID (unit part of the extended identifier) from the transaction order. Use NewBillID to generate the extended identifier from the unit part.

func NewBillID

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

func NewFeeCreditRecordID

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

func NewFeeCreditRecordIDFromOwnerPredicate

func NewFeeCreditRecordIDFromOwnerPredicate(shardPart []byte, ownerPredicate []byte, latestAdditionTime uint64) (types.UnitID, error)

func NewFeeCreditRecordIDFromPublicKey

func NewFeeCreditRecordIDFromPublicKey(shardPart, pubKey []byte, latestAdditionTime uint64) (types.UnitID, error)

func NewFeeCreditRecordIDFromPublicKeyHash

func NewFeeCreditRecordIDFromPublicKeyHash(shardPart, pubKeyHash []byte, latestAdditionTime uint64) (types.UnitID, error)

func NewUnitData

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

Types

type BillData

type BillData struct {
	Value          uint64    `json:"value,string"`   // The monetary value of this bill
	OwnerPredicate hex.Bytes `json:"ownerPredicate"` // The owner predicate of this bill
	Locked         uint64    `json:"locked,string"`  // The lock status of this bill (non-zero value means locked)
	Counter        uint64    `json:"counter,string"` // The transaction counter of this bill
	// contains filtered or unexported fields
}

func NewBillData

func NewBillData(value uint64, ownerPredicate []byte) *BillData

func (*BillData) Copy

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

func (*BillData) IsLocked

func (b *BillData) IsLocked() bool

func (*BillData) Owner

func (b *BillData) Owner() []byte

func (*BillData) SummaryValueInput

func (b *BillData) SummaryValueInput() uint64

func (*BillData) Write

func (b *BillData) Write(hasher abhash.Hasher)

type LockAttributes

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

type LockAuthProof

type LockAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

type SplitAttributes

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

type SplitAuthProof

type SplitAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

type SwapDCAttributes

type SwapDCAttributes struct {
	DustTransferProofs []*types.TxRecordProof // the dust transfer records and proofs
	// contains filtered or unexported fields
}

type SwapDCAuthProof

type SwapDCAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

type TargetUnit

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

type TransferAttributes

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

type TransferAuthProof

type TransferAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

type TransferDCAttributes

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

type TransferDCAuthProof

type TransferDCAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

type UnlockAttributes

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

type UnlockAuthProof

type UnlockAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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