Documentation ¶
Index ¶
- func ForEachOutput(outs []*ledger.OutputDataWithID, ...) error
- func GetChainAccount(chainID []byte, ind ledger.IndexerReader, state ledger.StateReader, ...) (*OutputWithChainID, []*OutputWithID, error)
- func MakeChainTransferTransactionOutputs(par *TransferData) ([]byte, []*ledger.OutputDataWithID, error)
- func MakeSimpleTransferTransactionOutputs(par *TransferData) ([]byte, []*ledger.OutputDataWithID, error)
- func MakeTransferTransaction(par *TransferData) ([]byte, error)
- func ValidationContextToString(v *state.TransactionContext) string
- type Output
- func (o *Output) Amount() uint64
- func (o *Output) AsArray() *lazyslice.Array
- func (o *Output) Bytes() []byte
- func (o *Output) ChainConstraint() (*constraints.ChainConstraint, byte)
- func (o *Output) Clone() *Output
- func (o *Output) Constraint(idx byte) []byte
- func (o *Output) ForEachConstraint(fun func(idx byte, constr []byte) bool)
- func (o *Output) Lock() constraints.Lock
- func (o *Output) NumConstraints() int
- func (o *Output) PushConstraint(c []byte) (byte, error)
- func (o *Output) PutConstraint(c []byte, idx byte)
- func (o *Output) SenderAddressED25519() (constraints.AddressED25519, bool)
- func (o *Output) TimeLock() (uint32, bool)
- func (o *Output) Timestamp() uint32
- func (o *Output) ToString(prefix ...string) string
- func (o *Output) WithAmount(amount uint64) *Output
- func (o *Output) WithLock(lock constraints.Lock) *Output
- func (o *Output) WithTimestamp(ts uint32) *Output
- type OutputWithChainID
- type OutputWithID
- type TransactionBuilder
- func (txb *TransactionBuilder) ConsumeOutput(out *Output, oid ledger.OutputID) (byte, error)
- func (txb *TransactionBuilder) InputCommitment() [32]byte
- func (txb *TransactionBuilder) InsertSimpleChainTransition(inChainData *ledger.OutputDataWithChainID, ts uint32) error
- func (txb *TransactionBuilder) NumInputs() int
- func (txb *TransactionBuilder) NumOutputs() int
- func (txb *TransactionBuilder) ProduceOutput(out *Output) (byte, error)
- func (txb *TransactionBuilder) PushEndorsement(txid *ledger.TransactionID)
- func (txb *TransactionBuilder) PutSignatureUnlock(outputIndex, constraintIndex byte)
- func (txb *TransactionBuilder) PutUnlockParams(outputIndex, constraintIndex byte, unlockParamData []byte)
- func (txb *TransactionBuilder) PutUnlockReference(outputIndex, constraintIndex, referencedOutputIndex byte) error
- func (txb *TransactionBuilder) SignED25519(privKey ed25519.PrivateKey)
- type TransferData
- func (t *TransferData) AdjustedAmount() uint64
- func (t *TransferData) WithAmount(amount uint64, adjustToMinimum ...bool) *TransferData
- func (t *TransferData) WithChainOutput(out *OutputWithChainID) *TransferData
- func (t *TransferData) WithConstraint(constr constraints.Constraint, idx ...byte) *TransferData
- func (t *TransferData) WithConstraintAtIndex(constr constraints.Constraint) *TransferData
- func (t *TransferData) WithConstraintBinary(constr []byte, idx ...byte) *TransferData
- func (t *TransferData) WithOutputs(outs []*OutputWithID) *TransferData
- func (t *TransferData) WithSender() *TransferData
- func (t *TransferData) WithTargetLock(lock constraints.Lock) *TransferData
- func (t *TransferData) WithUnlockData(consumedOutputIndex, constraintIndex byte, data []byte) *TransferData
- type UnlockData
- type UnlockParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForEachOutput ¶
func ForEachOutput(outs []*ledger.OutputDataWithID, fun func(o *Output, odata *ledger.OutputDataWithID) bool) error
func GetChainAccount ¶
func GetChainAccount(chainID []byte, ind ledger.IndexerReader, state ledger.StateReader, desc ...bool) (*OutputWithChainID, []*OutputWithID, error)
func MakeChainTransferTransactionOutputs ¶
func MakeChainTransferTransactionOutputs(par *TransferData) ([]byte, []*ledger.OutputDataWithID, error)
func MakeSimpleTransferTransactionOutputs ¶
func MakeSimpleTransferTransactionOutputs(par *TransferData) ([]byte, []*ledger.OutputDataWithID, error)
func MakeTransferTransaction ¶
func MakeTransferTransaction(par *TransferData) ([]byte, error)
func ValidationContextToString ¶
func ValidationContextToString(v *state.TransactionContext) string
Types ¶
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
func OutputBasic ¶
func OutputBasic(amount uint64, ts uint32, lock constraints.Lock) *Output
func OutputFromBytes ¶
func (*Output) ChainConstraint ¶
func (o *Output) ChainConstraint() (*constraints.ChainConstraint, byte)
ChainConstraint finds and parses chain constraint. Returns its constraintIndex or 0xff if not found
func (*Output) Constraint ¶
func (*Output) ForEachConstraint ¶
func (*Output) Lock ¶
func (o *Output) Lock() constraints.Lock
func (*Output) NumConstraints ¶
func (*Output) PutConstraint ¶
func (*Output) SenderAddressED25519 ¶
func (o *Output) SenderAddressED25519() (constraints.AddressED25519, bool)
func (*Output) WithAmount ¶
func (*Output) WithTimestamp ¶
type OutputWithChainID ¶
type OutputWithChainID struct { OutputWithID ChainID [32]byte PredecessorConstraintIndex byte }
func ParseChainConstraints ¶
func ParseChainConstraints(outs []*ledger.OutputDataWithID) ([]*OutputWithChainID, error)
type OutputWithID ¶
func ParseAndSortOutputData ¶
func ParseAndSortOutputData(outs []*ledger.OutputDataWithID, filter func(o *Output) bool, desc ...bool) ([]*OutputWithID, error)
type TransactionBuilder ¶
type TransactionBuilder struct { ConsumedOutputs []*Output Transaction *transaction }
func NewTransactionBuilder ¶
func NewTransactionBuilder() *TransactionBuilder
func (*TransactionBuilder) ConsumeOutput ¶
func (*TransactionBuilder) InputCommitment ¶
func (txb *TransactionBuilder) InputCommitment() [32]byte
func (*TransactionBuilder) InsertSimpleChainTransition ¶
func (txb *TransactionBuilder) InsertSimpleChainTransition(inChainData *ledger.OutputDataWithChainID, ts uint32) error
InsertSimpleChainTransition inserts a simple chain transition. Takes output with chain constraint from parameters, Produces identical output, only modifies timestamp. Unlocks chain-input lock with signature reference
func (*TransactionBuilder) NumInputs ¶
func (txb *TransactionBuilder) NumInputs() int
func (*TransactionBuilder) NumOutputs ¶
func (txb *TransactionBuilder) NumOutputs() int
func (*TransactionBuilder) ProduceOutput ¶
func (txb *TransactionBuilder) ProduceOutput(out *Output) (byte, error)
func (*TransactionBuilder) PushEndorsement ¶
func (txb *TransactionBuilder) PushEndorsement(txid *ledger.TransactionID)
func (*TransactionBuilder) PutSignatureUnlock ¶
func (txb *TransactionBuilder) PutSignatureUnlock(outputIndex, constraintIndex byte)
PutSignatureUnlock marker 0xff references signature of the transaction. It can be distinguished from any reference because it cannot be stringly less than any other reference
func (*TransactionBuilder) PutUnlockParams ¶
func (txb *TransactionBuilder) PutUnlockParams(outputIndex, constraintIndex byte, unlockParamData []byte)
func (*TransactionBuilder) PutUnlockReference ¶
func (txb *TransactionBuilder) PutUnlockReference(outputIndex, constraintIndex, referencedOutputIndex byte) error
PutUnlockReference references some preceding output
func (*TransactionBuilder) SignED25519 ¶
func (txb *TransactionBuilder) SignED25519(privKey ed25519.PrivateKey)
type TransferData ¶
type TransferData struct { SenderPrivateKey ed25519.PrivateKey SenderPublicKey ed25519.PublicKey SourceAccount constraints.Accountable Outputs []*OutputWithID ChainOutput *OutputWithChainID Timestamp uint32 // takes time.Now() if 0 Lock constraints.Lock Amount uint64 AdjustToMinimum bool AddSender bool AddConstraints [][]byte UnlockData []*UnlockData }
func NewTransferData ¶
func NewTransferData(senderKey ed25519.PrivateKey, sourceAccount constraints.Accountable, ts uint32) *TransferData
func (*TransferData) AdjustedAmount ¶
func (t *TransferData) AdjustedAmount() uint64
AdjustedAmount adjust amount to minimum storage deposit requirements
func (*TransferData) WithAmount ¶
func (t *TransferData) WithAmount(amount uint64, adjustToMinimum ...bool) *TransferData
func (*TransferData) WithChainOutput ¶
func (t *TransferData) WithChainOutput(out *OutputWithChainID) *TransferData
func (*TransferData) WithConstraint ¶
func (t *TransferData) WithConstraint(constr constraints.Constraint, idx ...byte) *TransferData
func (*TransferData) WithConstraintAtIndex ¶
func (t *TransferData) WithConstraintAtIndex(constr constraints.Constraint) *TransferData
func (*TransferData) WithConstraintBinary ¶
func (t *TransferData) WithConstraintBinary(constr []byte, idx ...byte) *TransferData
func (*TransferData) WithOutputs ¶
func (t *TransferData) WithOutputs(outs []*OutputWithID) *TransferData
func (*TransferData) WithSender ¶
func (t *TransferData) WithSender() *TransferData
func (*TransferData) WithTargetLock ¶
func (t *TransferData) WithTargetLock(lock constraints.Lock) *TransferData
func (*TransferData) WithUnlockData ¶
func (t *TransferData) WithUnlockData(consumedOutputIndex, constraintIndex byte, data []byte) *TransferData
type UnlockData ¶
type UnlockParams ¶
type UnlockParams struct {
// contains filtered or unexported fields
}
func NewUnlockBlock ¶
func NewUnlockBlock() *UnlockParams
func (*UnlockParams) Bytes ¶
func (u *UnlockParams) Bytes() []byte
Click to show internal directories.
Click to hide internal directories.