Documentation ¶
Index ¶
- Constants
- Variables
- func NewMoneyTx(systemID []byte, tx *txsystem.Transaction) (txsystem.GenericTransaction, error)
- func NewMoneyTxSystem(hashAlgorithm crypto.Hash, initialBill *InitialBill, dcMoneyAmount uint64, ...) (*moneyTxSystem, error)
- type BillData
- type InitialBill
- type Option
- type Options
- type Split
- type SplitOrder
- func (*SplitOrder) Descriptor() ([]byte, []int)deprecated
- func (x *SplitOrder) GetAmount() uint64
- func (x *SplitOrder) GetBacklink() []byte
- func (x *SplitOrder) GetRemainingValue() uint64
- func (x *SplitOrder) GetTargetBearer() []byte
- func (*SplitOrder) ProtoMessage()
- func (x *SplitOrder) ProtoReflect() protoreflect.Message
- func (x *SplitOrder) Reset()
- func (x *SplitOrder) String() string
- type Swap
- type SwapOrder
- func (*SwapOrder) Descriptor() ([]byte, []int)deprecated
- func (x *SwapOrder) GetBillIdentifiers() [][]byte
- func (x *SwapOrder) GetDcTransfers() []*txsystem.Transaction
- func (x *SwapOrder) GetOwnerCondition() []byte
- func (x *SwapOrder) GetProofs() []*block.BlockProof
- func (x *SwapOrder) GetTargetValue() uint64
- func (*SwapOrder) ProtoMessage()
- func (x *SwapOrder) ProtoReflect() protoreflect.Message
- func (x *SwapOrder) Reset()
- func (x *SwapOrder) String() string
- type Transfer
- type TransferDC
- type TransferDCOrder
- func (*TransferDCOrder) Descriptor() ([]byte, []int)deprecated
- func (x *TransferDCOrder) GetBacklink() []byte
- func (x *TransferDCOrder) GetNonce() []byte
- func (x *TransferDCOrder) GetTargetBearer() []byte
- func (x *TransferDCOrder) GetTargetValue() uint64
- func (*TransferDCOrder) ProtoMessage()
- func (x *TransferDCOrder) ProtoReflect() protoreflect.Message
- func (x *TransferDCOrder) Reset()
- func (x *TransferDCOrder) String() string
- type TransferOrder
- func (*TransferOrder) Descriptor() ([]byte, []int)deprecated
- func (x *TransferOrder) GetBacklink() []byte
- func (x *TransferOrder) GetNewBearer() []byte
- func (x *TransferOrder) GetTargetValue() uint64
- func (*TransferOrder) ProtoMessage()
- func (x *TransferOrder) ProtoReflect() protoreflect.Message
- func (x *TransferOrder) Reset()
- func (x *TransferOrder) String() string
Constants ¶
View Source
const ( TypeTransferOrder = "TransferOrder" TypeTransferDCOrder = "TransferDCOrder" TypeSplitOrder = "SplitOrder" TypeSwapOrder = "SwapOrder" )
Variables ¶
View Source
var ( ErrInitialBillIsNil = errors.New("initial bill may not be nil") ErrInvalidInitialBillID = errors.New("initial bill ID may not be equal to the DC money supply ID") )
View Source
var ( ErrInvalidBillValue = errors.New("transaction value must be equal to bill value") // swap tx specific validity conditions ErrSwapInvalidTargetValue = errors.New("target value of the bill must be equal to the sum of the target values of succeeded payments in swap transaction") ErrSwapInsufficientDCMoneySupply = errors.New("insufficient DC-money supply") ErrSwapBillAlreadyExists = errors.New("swapped bill id already exists") ErrSwapInvalidBillIdentifiers = errors.New("all bill identifiers in dust transfer orders must exist in transaction bill identifiers") ErrSwapInvalidBillId = errors.New("bill id is not properly computed") ErrSwapDustTransfersInvalidOrder = errors.New("transfer orders are not listed in strictly increasing order of bill identifiers") ErrSwapInvalidNonce = errors.New("dust transfer orders do not contain proper nonce") ErrSwapInvalidTargetBearer = errors.New("dust transfer orders do not contain proper target bearer") ErrInvalidProofType = errors.New("invalid proof type") )
View Source
var File_money_tx_proto protoreflect.FileDescriptor
View Source
var (
SchemeOpts = &allMoneySchemeOptions{}
)
Functions ¶
func NewMoneyTx ¶
func NewMoneyTx(systemID []byte, tx *txsystem.Transaction) (txsystem.GenericTransaction, error)
NewMoneyTx creates a new wrapper, returns an error if unknown transaction type is given as argument.
func NewMoneyTxSystem ¶
Types ¶
type BillData ¶
type BillData struct { V uint64 // The monetary value of this bill T uint64 // The round number of the last transaction with the bill Backlink []byte // Backlink (256-bit hash) }
func (*BillData) AddToHasher ¶
func (*BillData) Value ¶
func (b *BillData) Value() rma.SummaryValue
type SplitOrder ¶
type SplitOrder struct { Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` TargetBearer []byte `protobuf:"bytes,2,opt,name=target_bearer,json=targetBearer,proto3" json:"target_bearer,omitempty"` RemainingValue uint64 `protobuf:"varint,3,opt,name=remaining_value,json=remainingValue,proto3" json:"remaining_value,omitempty"` Backlink []byte `protobuf:"bytes,4,opt,name=backlink,proto3" json:"backlink,omitempty"` // contains filtered or unexported fields }
func (*SplitOrder) Descriptor
deprecated
func (*SplitOrder) Descriptor() ([]byte, []int)
Deprecated: Use SplitOrder.ProtoReflect.Descriptor instead.
func (*SplitOrder) GetAmount ¶
func (x *SplitOrder) GetAmount() uint64
func (*SplitOrder) GetBacklink ¶
func (x *SplitOrder) GetBacklink() []byte
func (*SplitOrder) GetRemainingValue ¶
func (x *SplitOrder) GetRemainingValue() uint64
func (*SplitOrder) GetTargetBearer ¶
func (x *SplitOrder) GetTargetBearer() []byte
func (*SplitOrder) ProtoMessage ¶
func (*SplitOrder) ProtoMessage()
func (*SplitOrder) ProtoReflect ¶
func (x *SplitOrder) ProtoReflect() protoreflect.Message
func (*SplitOrder) Reset ¶
func (x *SplitOrder) Reset()
func (*SplitOrder) String ¶
func (x *SplitOrder) String() string
type Swap ¶
type Swap interface { txsystem.GenericTransaction OwnerCondition() []byte BillIdentifiers() []*uint256.Int DCTransfers() []TransferDC Proofs() []*block.BlockProof TargetValue() uint64 }
type SwapOrder ¶
type SwapOrder struct { OwnerCondition []byte `protobuf:"bytes,1,opt,name=owner_condition,json=ownerCondition,proto3" json:"owner_condition,omitempty"` BillIdentifiers [][]byte `protobuf:"bytes,2,rep,name=bill_identifiers,json=billIdentifiers,proto3" json:"bill_identifiers,omitempty"` DcTransfers []*txsystem.Transaction `protobuf:"bytes,3,rep,name=dc_transfers,json=dcTransfers,proto3" json:"dc_transfers,omitempty"` Proofs []*block.BlockProof `protobuf:"bytes,4,rep,name=proofs,proto3" json:"proofs,omitempty"` TargetValue uint64 `protobuf:"varint,5,opt,name=target_value,json=targetValue,proto3" json:"target_value,omitempty"` // contains filtered or unexported fields }
func (*SwapOrder) Descriptor
deprecated
func (*SwapOrder) GetBillIdentifiers ¶
func (*SwapOrder) GetDcTransfers ¶
func (x *SwapOrder) GetDcTransfers() []*txsystem.Transaction
func (*SwapOrder) GetOwnerCondition ¶
func (*SwapOrder) GetProofs ¶
func (x *SwapOrder) GetProofs() []*block.BlockProof
func (*SwapOrder) GetTargetValue ¶
func (*SwapOrder) ProtoMessage ¶
func (*SwapOrder) ProtoMessage()
func (*SwapOrder) ProtoReflect ¶
func (x *SwapOrder) ProtoReflect() protoreflect.Message
type Transfer ¶
type Transfer interface { txsystem.GenericTransaction NewBearer() []byte TargetValue() uint64 Backlink() []byte }
type TransferDC ¶
type TransferDCOrder ¶
type TransferDCOrder struct { Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"` TargetBearer []byte `protobuf:"bytes,2,opt,name=target_bearer,json=targetBearer,proto3" json:"target_bearer,omitempty"` TargetValue uint64 `protobuf:"varint,3,opt,name=target_value,json=targetValue,proto3" json:"target_value,omitempty"` Backlink []byte `protobuf:"bytes,4,opt,name=backlink,proto3" json:"backlink,omitempty"` // contains filtered or unexported fields }
func (*TransferDCOrder) Descriptor
deprecated
func (*TransferDCOrder) Descriptor() ([]byte, []int)
Deprecated: Use TransferDCOrder.ProtoReflect.Descriptor instead.
func (*TransferDCOrder) GetBacklink ¶
func (x *TransferDCOrder) GetBacklink() []byte
func (*TransferDCOrder) GetNonce ¶
func (x *TransferDCOrder) GetNonce() []byte
func (*TransferDCOrder) GetTargetBearer ¶
func (x *TransferDCOrder) GetTargetBearer() []byte
func (*TransferDCOrder) GetTargetValue ¶
func (x *TransferDCOrder) GetTargetValue() uint64
func (*TransferDCOrder) ProtoMessage ¶
func (*TransferDCOrder) ProtoMessage()
func (*TransferDCOrder) ProtoReflect ¶
func (x *TransferDCOrder) ProtoReflect() protoreflect.Message
func (*TransferDCOrder) Reset ¶
func (x *TransferDCOrder) Reset()
func (*TransferDCOrder) String ¶
func (x *TransferDCOrder) String() string
type TransferOrder ¶
type TransferOrder struct { NewBearer []byte `protobuf:"bytes,1,opt,name=new_bearer,json=newBearer,proto3" json:"new_bearer,omitempty"` TargetValue uint64 `protobuf:"varint,2,opt,name=target_value,json=targetValue,proto3" json:"target_value,omitempty"` Backlink []byte `protobuf:"bytes,3,opt,name=backlink,proto3" json:"backlink,omitempty"` // contains filtered or unexported fields }
func (*TransferOrder) Descriptor
deprecated
func (*TransferOrder) Descriptor() ([]byte, []int)
Deprecated: Use TransferOrder.ProtoReflect.Descriptor instead.
func (*TransferOrder) GetBacklink ¶
func (x *TransferOrder) GetBacklink() []byte
func (*TransferOrder) GetNewBearer ¶
func (x *TransferOrder) GetNewBearer() []byte
func (*TransferOrder) GetTargetValue ¶
func (x *TransferOrder) GetTargetValue() uint64
func (*TransferOrder) ProtoMessage ¶
func (*TransferOrder) ProtoMessage()
func (*TransferOrder) ProtoReflect ¶
func (x *TransferOrder) ProtoReflect() protoreflect.Message
func (*TransferOrder) Reset ¶
func (x *TransferOrder) Reset()
func (*TransferOrder) String ¶
func (x *TransferOrder) String() string
Click to show internal directories.
Click to hide internal directories.