Documentation
¶
Index ¶
- Constants
- Variables
- func Inout2key(h Hash, typ InOutHashType, no byte) []byte
- func Inout2keyArray(h Hash, typ InOutHashType, no byte) [34]byte
- func SetupFee(conf *aklib.Config, w Wallet2, p *FeeParam, tr *Transaction) error
- type Body
- func (body *Body) AddInput(h Hash, idx byte)
- func (body *Body) AddMultisigIn(h Hash, idx byte)
- func (body *Body) AddMultisigOut(cfg *aklib.Config, m byte, v uint64, adrs ...string) error
- func (body *Body) AddOutput(cfg *aklib.Config, adr string, v uint64) error
- func (*Body) Descriptor() ([]byte, []int)
- func (this *Body) Equal(that interface{}) bool
- func (m *Body) Marshal() (dAtA []byte, err error)
- func (m *Body) MarshalTo(dAtA []byte) (int, error)
- func (body *Body) Prevs() []Hash
- func (*Body) ProtoMessage()
- func (m *Body) Reset()
- func (m *Body) Size() (n int)
- func (m *Body) String() string
- func (m *Body) Unmarshal(dAtA []byte) error
- func (m *Body) XXX_DiscardUnknown()
- func (m *Body) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Body) XXX_Merge(src proto.Message)
- func (m *Body) XXX_Size() int
- func (m *Body) XXX_Unmarshal(b []byte) error
- type BuildParam
- type ByteSlice
- type FeeParam
- type GetTXFunc
- type Hash
- type HashWithType
- func (*HashWithType) Descriptor() ([]byte, []int)
- func (this *HashWithType) Equal(that interface{}) bool
- func (m *HashWithType) Marshal() (dAtA []byte, err error)
- func (m *HashWithType) MarshalTo(dAtA []byte) (int, error)
- func (*HashWithType) ProtoMessage()
- func (m *HashWithType) Reset()
- func (m *HashWithType) Size() (n int)
- func (m *HashWithType) String() string
- func (m *HashWithType) Unmarshal(dAtA []byte) error
- func (m *HashWithType) XXX_DiscardUnknown()
- func (m *HashWithType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *HashWithType) XXX_Merge(src proto.Message)
- func (m *HashWithType) XXX_Size() int
- func (m *HashWithType) XXX_Unmarshal(b []byte) error
- type InOutHashType
- type InoutHash
- func (ih *InoutHash) Bytes() []byte
- func (*InoutHash) Descriptor() ([]byte, []int)
- func (this *InoutHash) Equal(that interface{}) bool
- func (m *InoutHash) Marshal() (dAtA []byte, err error)
- func (m *InoutHash) MarshalTo(dAtA []byte) (int, error)
- func (*InoutHash) ProtoMessage()
- func (m *InoutHash) Reset()
- func (ih *InoutHash) Serialize() [34]byte
- func (m *InoutHash) Size() (n int)
- func (m *InoutHash) String() string
- func (m *InoutHash) Unmarshal(dAtA []byte) error
- func (m *InoutHash) XXX_DiscardUnknown()
- func (m *InoutHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *InoutHash) XXX_Merge(src proto.Message)
- func (m *InoutHash) XXX_Size() int
- func (m *InoutHash) XXX_Unmarshal(b []byte) error
- type Input
- func (*Input) Descriptor() ([]byte, []int)
- func (this *Input) Equal(that interface{}) bool
- func (m *Input) Marshal() (dAtA []byte, err error)
- func (m *Input) MarshalTo(dAtA []byte) (int, error)
- func (*Input) ProtoMessage()
- func (m *Input) Reset()
- func (m *Input) Size() (n int)
- func (m *Input) String() string
- func (m *Input) Unmarshal(dAtA []byte) error
- func (m *Input) XXX_DiscardUnknown()
- func (m *Input) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Input) XXX_Merge(src proto.Message)
- func (m *Input) XXX_Size() int
- func (m *Input) XXX_Unmarshal(b []byte) error
- type MultiSigIn
- func (*MultiSigIn) Descriptor() ([]byte, []int)
- func (this *MultiSigIn) Equal(that interface{}) bool
- func (m *MultiSigIn) Marshal() (dAtA []byte, err error)
- func (m *MultiSigIn) MarshalTo(dAtA []byte) (int, error)
- func (*MultiSigIn) ProtoMessage()
- func (m *MultiSigIn) Reset()
- func (m *MultiSigIn) Size() (n int)
- func (m *MultiSigIn) String() string
- func (m *MultiSigIn) Unmarshal(dAtA []byte) error
- func (m *MultiSigIn) XXX_DiscardUnknown()
- func (m *MultiSigIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *MultiSigIn) XXX_Merge(src proto.Message)
- func (m *MultiSigIn) XXX_Size() int
- func (m *MultiSigIn) XXX_Unmarshal(b []byte) error
- type MultiSigOut
- func (*MultiSigOut) Descriptor() ([]byte, []int)
- func (this *MultiSigOut) Equal(that interface{}) bool
- func (m *MultiSigOut) Marshal() (dAtA []byte, err error)
- func (m *MultiSigOut) MarshalTo(dAtA []byte) (int, error)
- func (*MultiSigOut) ProtoMessage()
- func (m *MultiSigOut) Reset()
- func (m *MultiSigOut) Size() (n int)
- func (m *MultiSigOut) String() string
- func (m *MultiSigOut) Unmarshal(dAtA []byte) error
- func (m *MultiSigOut) XXX_DiscardUnknown()
- func (m *MultiSigOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *MultiSigOut) XXX_Merge(src proto.Message)
- func (m *MultiSigOut) XXX_Size() int
- func (m *MultiSigOut) XXX_Unmarshal(b []byte) error
- type MultisigStruct
- func (mout *MultisigStruct) Address(cfg *aklib.Config) string
- func (mout *MultisigStruct) AddressByte(cfg *aklib.Config) address.Bytes
- func (*MultisigStruct) Descriptor() ([]byte, []int)
- func (this *MultisigStruct) Equal(that interface{}) bool
- func (m *MultisigStruct) Marshal() (dAtA []byte, err error)
- func (m *MultisigStruct) MarshalTo(dAtA []byte) (int, error)
- func (*MultisigStruct) ProtoMessage()
- func (m *MultisigStruct) Reset()
- func (m *MultisigStruct) Size() (n int)
- func (m *MultisigStruct) String() string
- func (m *MultisigStruct) Unmarshal(dAtA []byte) error
- func (m *MultisigStruct) XXX_DiscardUnknown()
- func (m *MultisigStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *MultisigStruct) XXX_Merge(src proto.Message)
- func (m *MultisigStruct) XXX_Size() int
- func (m *MultisigStruct) XXX_Unmarshal(b []byte) error
- type Output
- func (*Output) Descriptor() ([]byte, []int)
- func (this *Output) Equal(that interface{}) bool
- func (m *Output) Marshal() (dAtA []byte, err error)
- func (m *Output) MarshalTo(dAtA []byte) (int, error)
- func (*Output) ProtoMessage()
- func (m *Output) Reset()
- func (m *Output) Size() (n int)
- func (m *Output) String() string
- func (m *Output) Unmarshal(dAtA []byte) error
- func (m *Output) XXX_DiscardUnknown()
- func (m *Output) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Output) XXX_Merge(src proto.Message)
- func (m *Output) XXX_Size() int
- func (m *Output) XXX_Unmarshal(b []byte) error
- type RawOutput
- func (*RawOutput) Descriptor() ([]byte, []int)
- func (this *RawOutput) Equal(that interface{}) bool
- func (m *RawOutput) Marshal() (dAtA []byte, err error)
- func (m *RawOutput) MarshalTo(dAtA []byte) (int, error)
- func (*RawOutput) ProtoMessage()
- func (m *RawOutput) Reset()
- func (m *RawOutput) Size() (n int)
- func (m *RawOutput) String() string
- func (m *RawOutput) Unmarshal(dAtA []byte) error
- func (m *RawOutput) XXX_DiscardUnknown()
- func (m *RawOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *RawOutput) XXX_Merge(src proto.Message)
- func (m *RawOutput) XXX_Size() int
- func (m *RawOutput) XXX_Unmarshal(b []byte) error
- type Signatures
- func (*Signatures) Descriptor() ([]byte, []int)
- func (this *Signatures) Equal(that interface{}) bool
- func (m *Signatures) Marshal() (dAtA []byte, err error)
- func (m *Signatures) MarshalTo(dAtA []byte) (int, error)
- func (*Signatures) ProtoMessage()
- func (m *Signatures) Reset()
- func (m *Signatures) Size() (n int)
- func (m *Signatures) String() string
- func (m *Signatures) Unmarshal(dAtA []byte) error
- func (m *Signatures) XXX_DiscardUnknown()
- func (m *Signatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Signatures) XXX_Merge(src proto.Message)
- func (m *Signatures) XXX_Size() int
- func (m *Signatures) XXX_Unmarshal(b []byte) error
- type Transaction
- func Build(conf *aklib.Config, w Wallet2, p *BuildParam) (*Transaction, error)
- func BuildMain(conf *aklib.Config, w Wallet, tag []byte, outputs []*RawOutput, ...) (*Transaction, error)
- func IssueTicket(ctx context.Context, s *aklib.Config, ticketOut []byte, previous ...Hash) (*Transaction, error)
- func New(s *aklib.Config, previous ...Hash) *Transaction
- func NewMinableFee(s *aklib.Config, previous ...Hash) *Transaction
- func NewMinableTicket(s *aklib.Config, ticketIn Hash, previous ...Hash) *Transaction
- func NewPopulatedTransaction(r randyTx, easy bool) *Transaction
- func (tr *Transaction) AddOTAOutput(s *aklib.Config, otAddress string, v uint64) (*address.Address, error)
- func (tr *Transaction) AddSig(sig *address.Signature)
- func (tr *Transaction) Check(cfg *aklib.Config, typ Type) error
- func (tr *Transaction) CheckAll(cfg *aklib.Config, getTX GetTXFunc, typ Type) error
- func (tr *Transaction) Clone() *Transaction
- func (*Transaction) Descriptor() ([]byte, []int)
- func (this *Transaction) Equal(that interface{}) bool
- func (tr *Transaction) Hash() Hash
- func (m *Transaction) Marshal() (dAtA []byte, err error)
- func (tr *Transaction) MarshalJSON() ([]byte, error)
- func (m *Transaction) MarshalTo(dAtA []byte) (int, error)
- func (tr *Transaction) OTAAddress(s *aklib.Config, priv *sidh.PrivateKey) (*address.Address, byte, error)
- func (tx *Transaction) PoW() error
- func (tx *Transaction) PoWContext(ctx context.Context) error
- func (*Transaction) ProtoMessage()
- func (m *Transaction) Reset()
- func (tr *Transaction) Sign(a *address.Address) error
- func (tr *Transaction) Signature(a *address.Address) (*address.Signature, error)
- func (m *Transaction) Size() (n int)
- func (m *Transaction) String() string
- func (m *Transaction) Unmarshal(dAtA []byte) error
- func (m *Transaction) XXX_DiscardUnknown()
- func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Transaction) XXX_Merge(src proto.Message)
- func (m *Transaction) XXX_Size() int
- func (m *Transaction) XXX_Unmarshal(b []byte) error
- type TransactionSigHash
- func (*TransactionSigHash) Descriptor() ([]byte, []int)
- func (this *TransactionSigHash) Equal(that interface{}) bool
- func (m *TransactionSigHash) Marshal() (dAtA []byte, err error)
- func (m *TransactionSigHash) MarshalTo(dAtA []byte) (int, error)
- func (*TransactionSigHash) ProtoMessage()
- func (m *TransactionSigHash) Reset()
- func (m *TransactionSigHash) Size() (n int)
- func (m *TransactionSigHash) String() string
- func (m *TransactionSigHash) Unmarshal(dAtA []byte) error
- func (m *TransactionSigHash) XXX_DiscardUnknown()
- func (m *TransactionSigHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TransactionSigHash) XXX_Merge(src proto.Message)
- func (m *TransactionSigHash) XXX_Size() int
- func (m *TransactionSigHash) XXX_Unmarshal(b []byte) error
- type Type
- type UTXO
- func (*UTXO) Descriptor() ([]byte, []int)
- func (this *UTXO) Equal(that interface{}) bool
- func (m *UTXO) Marshal() (dAtA []byte, err error)
- func (m *UTXO) MarshalTo(dAtA []byte) (int, error)
- func (*UTXO) ProtoMessage()
- func (m *UTXO) Reset()
- func (m *UTXO) Size() (n int)
- func (m *UTXO) String() string
- func (m *UTXO) Unmarshal(dAtA []byte) error
- func (m *UTXO) XXX_DiscardUnknown()
- func (m *UTXO) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *UTXO) XXX_Merge(src proto.Message)
- func (m *UTXO) XXX_Size() int
- func (m *UTXO) XXX_Unmarshal(b []byte) error
- type Wallet
- type Wallet2
Constants ¶
const ( MessageMax = 255 TransactionMax = 2000000 ArrayMax = 255 DefaultPreviousSize = 2 )
max length of tx and fields in a transaction.
const ( //HashTypeExcludeOutputs is for excluding some outputs. HashTypeNormal = 0x0 HashTypeExcludeOutputs = 0x10 HashTypeExcludeTicketOut = 0x20 )
Types when hashing a tx.
Variables ¶
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") )
var ErrCanceled = errors.New("PoW was canceled")
ErrCanceled means the PoW was canceled by context.
Functions ¶
func Inout2key ¶
func Inout2key(h Hash, typ InOutHashType, no byte) []byte
Inout2key returns a slice of serialized inout data.
func Inout2keyArray ¶
func Inout2keyArray(h Hash, typ InOutHashType, no byte) [34]byte
Inout2keyArray returns a serialized inout data as an array.
Types ¶
type Body ¶
type Body struct { Type ByteSlice `protobuf:"bytes,1,opt,name=type,proto3,casttype=ByteSlice" json:"type,omitempty"` Nonce []uint32 `protobuf:"varint,2,rep,packed,name=nonce,proto3" json:"nonce,omitempty"` Gnonce uint32 `protobuf:"varint,3,opt,name=gnonce,proto3" json:"gnonce,omitempty"` Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` Message ByteSlice `protobuf:"bytes,5,opt,name=message,proto3,casttype=ByteSlice" json:"message,omitempty"` ExchangeKey []byte `protobuf:"bytes,6,opt,name=exchange_key,json=exchangeKey,proto3" json:"exchange_key,omitempty"` Inputs []*Input `protobuf:"bytes,7,rep,name=inputs,proto3" json:"inputs,omitempty"` MultiSigIns []*MultiSigIn `protobuf:"bytes,8,rep,name=multi_sig_ins,json=multiSigIns,proto3" json:"multi_sig_ins,omitempty"` Outputs []*Output `protobuf:"bytes,9,rep,name=outputs,proto3" json:"outputs,omitempty"` MultiSigOuts []*MultiSigOut `protobuf:"bytes,10,rep,name=multi_sig_outs,json=multiSigOuts,proto3" json:"multi_sig_outs,omitempty"` Parent []Hash `protobuf:"bytes,11,rep,name=parent,proto3,casttype=Hash" json:"parent,omitempty"` Easiness uint32 `protobuf:"varint,12,opt,name=easiness,proto3" json:"easiness,omitempty"` LockTime time.Time `protobuf:"bytes,13,opt,name=lock_time,json=lockTime,proto3,stdtime" json:"lock_time"` HashType uint16 `protobuf:"varint,14,opt,name=hash_type,json=hashType,proto3,casttype=uint16" json:"hash_type,omitempty"` TicketInput Hash `protobuf:"bytes,15,opt,name=ticket_input,json=ticketInput,proto3,casttype=Hash" json:"ticket_input,omitempty"` TicketOutput github_com_AidosKuneen_aklib_address.Bytes `` /* 150-byte string literal not displayed */ }
Body is a Transactoin except signature.
func NewPopulatedBody ¶
func (*Body) AddMultisigIn ¶
AddMultisigIn add a multisig input into tx.
func (*Body) AddMultisigOut ¶
AddMultisigOut add a mulsig output into tx.
func (*Body) Descriptor ¶
func (*Body) ProtoMessage ¶
func (*Body) ProtoMessage()
func (*Body) XXX_DiscardUnknown ¶
func (m *Body) XXX_DiscardUnknown()
func (*Body) XXX_Unmarshal ¶
type BuildParam ¶
BuildParam is a param for building a tx..
type ByteSlice ¶
type ByteSlice []byte
ByteSlice is a byte slice marsharing to hex string.
func (ByteSlice) MarshalJSON ¶
MarshalJSON returns m as the JSON encoding of m.
func (*ByteSlice) UnmarshalJSON ¶
UnmarshalJSON sets *bs to a copy of data.
type Hash ¶
type Hash []byte
Hash is a tx hash.
func (Hash) Array ¶
Array converts slice to array If opssible the func get the underlaying array of slice h. So don't modify the returned array.
func (Hash) MarshalJSON ¶
MarshalJSON returns m as the JSON encoding of m.
func (*Hash) UnmarshalJSON ¶
UnmarshalJSON sets *bs to a copy of data.
type HashWithType ¶
type HashWithType struct { Hash Hash `protobuf:"bytes,1,opt,name=hash,proto3,casttype=Hash" json:"hash,omitempty"` Type Type `protobuf:"varint,2,opt,name=type,proto3,casttype=Type" json:"type,omitempty"` }
func NewPopulatedHashWithType ¶
func NewPopulatedHashWithType(r randyTx, easy bool) *HashWithType
func (*HashWithType) Descriptor ¶
func (*HashWithType) Descriptor() ([]byte, []int)
func (*HashWithType) Equal ¶
func (this *HashWithType) Equal(that interface{}) bool
func (*HashWithType) Marshal ¶
func (m *HashWithType) Marshal() (dAtA []byte, err error)
func (*HashWithType) ProtoMessage ¶
func (*HashWithType) ProtoMessage()
func (*HashWithType) Reset ¶
func (m *HashWithType) Reset()
func (*HashWithType) Size ¶
func (m *HashWithType) Size() (n int)
func (*HashWithType) String ¶
func (m *HashWithType) String() string
func (*HashWithType) Unmarshal ¶
func (m *HashWithType) Unmarshal(dAtA []byte) error
func (*HashWithType) XXX_DiscardUnknown ¶
func (m *HashWithType) XXX_DiscardUnknown()
func (*HashWithType) XXX_Marshal ¶
func (m *HashWithType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HashWithType) XXX_Merge ¶
func (dst *HashWithType) XXX_Merge(src proto.Message)
func (*HashWithType) XXX_Size ¶
func (m *HashWithType) XXX_Size() int
func (*HashWithType) XXX_Unmarshal ¶
func (m *HashWithType) XXX_Unmarshal(b []byte) error
type InOutHashType ¶
type InOutHashType byte
InOutHashType is a type in InOutHash struct.
const ( TypeIn InOutHashType = iota TypeMulin TypeTicketin TypeOut TypeMulout TypeTicketout TypeOTAOut )
Types for in/out txs.
func (InOutHashType) String ¶
func (t InOutHashType) String() string
type InoutHash ¶
type InoutHash struct { Hash Hash `protobuf:"bytes,1,opt,name=hash,proto3,casttype=Hash" json:"hash,omitempty"` Type InOutHashType `protobuf:"varint,2,opt,name=type,proto3,casttype=InOutHashType" json:"type,omitempty"` Index byte `protobuf:"varint,3,opt,name=index,proto3,casttype=byte" json:"index,omitempty"` }
InOutHashType is a type in InOutHash struct.
func InputHashes ¶
InputHashes returns output info referred by inputs of tr..
func NewInoutHash ¶
NewInoutHash returns a InoutHash object from serialized inout data.
func NewPopulatedInoutHash ¶
func (*InoutHash) Descriptor ¶
func (*InoutHash) ProtoMessage ¶
func (*InoutHash) ProtoMessage()
func (*InoutHash) XXX_DiscardUnknown ¶
func (m *InoutHash) XXX_DiscardUnknown()
func (*InoutHash) XXX_Marshal ¶
func (*InoutHash) XXX_Unmarshal ¶
type Input ¶
type Input struct { PreviousTX Hash `protobuf:"bytes,1,opt,name=previous_tx,json=previousTx,proto3,casttype=Hash" json:"previous_tx,omitempty"` Index byte `protobuf:"varint,2,opt,name=index,proto3,casttype=byte" json:"index,omitempty"` }
Input is an input in transactions.
func NewPopulatedInput ¶
func (*Input) Descriptor ¶
func (*Input) ProtoMessage ¶
func (*Input) ProtoMessage()
func (*Input) XXX_DiscardUnknown ¶
func (m *Input) XXX_DiscardUnknown()
func (*Input) XXX_Marshal ¶
func (*Input) XXX_Unmarshal ¶
type MultiSigIn ¶
type MultiSigIn struct { PreviousTX Hash `protobuf:"bytes,1,opt,name=previous_tx,json=previousTx,proto3,casttype=Hash" json:"previous_tx,omitempty"` Index byte `protobuf:"varint,2,opt,name=index,proto3,casttype=byte" json:"index,omitempty"` }
MultiSigIn is an multisig input in transactions.
func NewPopulatedMultiSigIn ¶
func NewPopulatedMultiSigIn(r randyTx, easy bool) *MultiSigIn
func (*MultiSigIn) Descriptor ¶
func (*MultiSigIn) Descriptor() ([]byte, []int)
func (*MultiSigIn) Equal ¶
func (this *MultiSigIn) Equal(that interface{}) bool
func (*MultiSigIn) Marshal ¶
func (m *MultiSigIn) Marshal() (dAtA []byte, err error)
func (*MultiSigIn) ProtoMessage ¶
func (*MultiSigIn) ProtoMessage()
func (*MultiSigIn) Reset ¶
func (m *MultiSigIn) Reset()
func (*MultiSigIn) Size ¶
func (m *MultiSigIn) Size() (n int)
func (*MultiSigIn) String ¶
func (m *MultiSigIn) String() string
func (*MultiSigIn) Unmarshal ¶
func (m *MultiSigIn) Unmarshal(dAtA []byte) error
func (*MultiSigIn) XXX_DiscardUnknown ¶
func (m *MultiSigIn) XXX_DiscardUnknown()
func (*MultiSigIn) XXX_Marshal ¶
func (m *MultiSigIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MultiSigIn) XXX_Merge ¶
func (dst *MultiSigIn) XXX_Merge(src proto.Message)
func (*MultiSigIn) XXX_Size ¶
func (m *MultiSigIn) XXX_Size() int
func (*MultiSigIn) XXX_Unmarshal ¶
func (m *MultiSigIn) XXX_Unmarshal(b []byte) error
type MultiSigOut ¶
type MultiSigOut struct { MultisigStruct `protobuf:"bytes,1,opt,name=MultisigStruct,proto3,embedded=MultisigStruct" json:"MultisigStruct"` Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` }
MultiSigOut is an multisig output in transactions.
func NewPopulatedMultiSigOut ¶
func NewPopulatedMultiSigOut(r randyTx, easy bool) *MultiSigOut
func (*MultiSigOut) Descriptor ¶
func (*MultiSigOut) Descriptor() ([]byte, []int)
func (*MultiSigOut) Equal ¶
func (this *MultiSigOut) Equal(that interface{}) bool
func (*MultiSigOut) Marshal ¶
func (m *MultiSigOut) Marshal() (dAtA []byte, err error)
func (*MultiSigOut) ProtoMessage ¶
func (*MultiSigOut) ProtoMessage()
func (*MultiSigOut) Reset ¶
func (m *MultiSigOut) Reset()
func (*MultiSigOut) Size ¶
func (m *MultiSigOut) Size() (n int)
func (*MultiSigOut) String ¶
func (m *MultiSigOut) String() string
func (*MultiSigOut) Unmarshal ¶
func (m *MultiSigOut) Unmarshal(dAtA []byte) error
func (*MultiSigOut) XXX_DiscardUnknown ¶
func (m *MultiSigOut) XXX_DiscardUnknown()
func (*MultiSigOut) XXX_Marshal ¶
func (m *MultiSigOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MultiSigOut) XXX_Merge ¶
func (dst *MultiSigOut) XXX_Merge(src proto.Message)
func (*MultiSigOut) XXX_Size ¶
func (m *MultiSigOut) XXX_Size() int
func (*MultiSigOut) XXX_Unmarshal ¶
func (m *MultiSigOut) XXX_Unmarshal(b []byte) error
type MultisigStruct ¶
type MultisigStruct struct { M byte `protobuf:"varint,1,opt,name=m,proto3,casttype=byte" json:"m,omitempty"` Addresses []github_com_AidosKuneen_aklib_address.Bytes `protobuf:"bytes,2,rep,name=addresses,proto3,casttype=github.com/AidosKuneen/aklib/address.Bytes" json:"addresses,omitempty"` }
MultisigStruct is a structure of multisig.
func NewPopulatedMultisigStruct ¶
func NewPopulatedMultisigStruct(r randyTx, easy bool) *MultisigStruct
func (*MultisigStruct) Address ¶
func (mout *MultisigStruct) Address(cfg *aklib.Config) string
Address returns a multisig address.
func (*MultisigStruct) AddressByte ¶
func (mout *MultisigStruct) AddressByte(cfg *aklib.Config) address.Bytes
AddressByte returns a multisig address in binary form.
func (*MultisigStruct) Descriptor ¶
func (*MultisigStruct) Descriptor() ([]byte, []int)
func (*MultisigStruct) Equal ¶
func (this *MultisigStruct) Equal(that interface{}) bool
func (*MultisigStruct) Marshal ¶
func (m *MultisigStruct) Marshal() (dAtA []byte, err error)
func (*MultisigStruct) ProtoMessage ¶
func (*MultisigStruct) ProtoMessage()
func (*MultisigStruct) Reset ¶
func (m *MultisigStruct) Reset()
func (*MultisigStruct) Size ¶
func (m *MultisigStruct) Size() (n int)
func (*MultisigStruct) String ¶
func (m *MultisigStruct) String() string
func (*MultisigStruct) Unmarshal ¶
func (m *MultisigStruct) Unmarshal(dAtA []byte) error
func (*MultisigStruct) XXX_DiscardUnknown ¶
func (m *MultisigStruct) XXX_DiscardUnknown()
func (*MultisigStruct) XXX_Marshal ¶
func (m *MultisigStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MultisigStruct) XXX_Merge ¶
func (dst *MultisigStruct) XXX_Merge(src proto.Message)
func (*MultisigStruct) XXX_Size ¶
func (m *MultisigStruct) XXX_Size() int
func (*MultisigStruct) XXX_Unmarshal ¶
func (m *MultisigStruct) XXX_Unmarshal(b []byte) error
type Output ¶
type Output struct { Address github_com_AidosKuneen_aklib_address.Bytes `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/AidosKuneen/aklib/address.Bytes" json:"address,omitempty"` Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` }
Output is an output in transactions.
func NewPopulatedOutput ¶
func (*Output) Descriptor ¶
func (*Output) ProtoMessage ¶
func (*Output) ProtoMessage()
func (*Output) XXX_DiscardUnknown ¶
func (m *Output) XXX_DiscardUnknown()
func (*Output) XXX_Marshal ¶
func (*Output) XXX_Unmarshal ¶
type RawOutput ¶
type RawOutput struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` }
RawOutput is an output in a tx.
func NewPopulatedRawOutput ¶
func (*RawOutput) Descriptor ¶
func (*RawOutput) ProtoMessage ¶
func (*RawOutput) ProtoMessage()
func (*RawOutput) XXX_DiscardUnknown ¶
func (m *RawOutput) XXX_DiscardUnknown()
func (*RawOutput) XXX_Marshal ¶
func (*RawOutput) XXX_Unmarshal ¶
type Signatures ¶
type Signatures struct {
Sigs []*address.Signature `protobuf:"bytes,1,rep,name=sigs,proto3" json:"sigs,omitempty"`
}
Signatures is a slice of Signature for protobuf
func NewPopulatedSignatures ¶
func NewPopulatedSignatures(r randyTx, easy bool) *Signatures
func (*Signatures) Descriptor ¶
func (*Signatures) Descriptor() ([]byte, []int)
func (*Signatures) Equal ¶
func (this *Signatures) Equal(that interface{}) bool
func (*Signatures) Marshal ¶
func (m *Signatures) Marshal() (dAtA []byte, err error)
func (*Signatures) ProtoMessage ¶
func (*Signatures) ProtoMessage()
func (*Signatures) Reset ¶
func (m *Signatures) Reset()
func (*Signatures) Size ¶
func (m *Signatures) Size() (n int)
func (*Signatures) String ¶
func (m *Signatures) String() string
func (*Signatures) Unmarshal ¶
func (m *Signatures) Unmarshal(dAtA []byte) error
func (*Signatures) XXX_DiscardUnknown ¶
func (m *Signatures) XXX_DiscardUnknown()
func (*Signatures) XXX_Marshal ¶
func (m *Signatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Signatures) XXX_Merge ¶
func (dst *Signatures) XXX_Merge(src proto.Message)
func (*Signatures) XXX_Size ¶
func (m *Signatures) XXX_Size() int
func (*Signatures) XXX_Unmarshal ¶
func (m *Signatures) XXX_Unmarshal(b []byte) error
type Transaction ¶
type Transaction struct { *Body `protobuf:"bytes,1,opt,name=body,proto3,embedded=body" json:"body,omitempty"` Signatures `protobuf:"bytes,2,opt,name=signatures,proto3,embedded=signatures" json:"signatures"` }
Transaction is a transactio in Aidos Kuneen.
func Build ¶
func Build(conf *aklib.Config, w Wallet2, p *BuildParam) (*Transaction, error)
Build builds a tx for sending coins with fee or ticket..
func BuildMain ¶
func BuildMain(conf *aklib.Config, w Wallet, tag []byte, outputs []*RawOutput, beforeSignFunc func(*Transaction) error) (*Transaction, error)
BuildMain builds a tx for sending coins.
func IssueTicket ¶
func IssueTicket(ctx context.Context, s *aklib.Config, ticketOut []byte, previous ...Hash) (*Transaction, error)
IssueTicket make and does PoW for a transaction for issuing tx.
func New ¶
func New(s *aklib.Config, previous ...Hash) *Transaction
New returns a transaction object.
func NewMinableFee ¶
func NewMinableFee(s *aklib.Config, previous ...Hash) *Transaction
NewMinableFee returns a minable transaction by fee..
func NewMinableTicket ¶
func NewMinableTicket(s *aklib.Config, ticketIn Hash, previous ...Hash) *Transaction
NewMinableTicket returns a minable transaction by ticket..
func NewPopulatedTransaction ¶
func NewPopulatedTransaction(r randyTx, easy bool) *Transaction
func (*Transaction) AddOTAOutput ¶
func (tr *Transaction) AddOTAOutput(s *aklib.Config, otAddress string, v uint64) (*address.Address, error)
AddOTAOutput returns a tx with outout of one time address.
func (*Transaction) AddSig ¶
func (tr *Transaction) AddSig(sig *address.Signature)
AddSig adds a signature to tx.
func (*Transaction) Check ¶
func (tr *Transaction) Check(cfg *aklib.Config, typ Type) error
Check checks the tx.
func (*Transaction) CheckAll ¶
CheckAll checks the tx, including other txs referred by the tx.. Genesis block must be saved in the store
func (*Transaction) Descriptor ¶
func (*Transaction) Descriptor() ([]byte, []int)
func (*Transaction) Equal ¶
func (this *Transaction) Equal(that interface{}) bool
func (*Transaction) Marshal ¶
func (m *Transaction) Marshal() (dAtA []byte, err error)
func (*Transaction) MarshalJSON ¶
func (tr *Transaction) MarshalJSON() ([]byte, error)
MarshalJSON marshals Transaction into valid JSON.
func (*Transaction) OTAAddress ¶
func (tr *Transaction) OTAAddress(s *aklib.Config, priv *sidh.PrivateKey) (*address.Address, byte, error)
OTAAddress returns an shared address and its output index in OTA transaction. return err if the OTA is not mine.
func (*Transaction) PoWContext ¶
func (tx *Transaction) PoWContext(ctx context.Context) error
PoWContext does PoW with context..
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) Reset ¶
func (m *Transaction) Reset()
func (*Transaction) Size ¶
func (m *Transaction) Size() (n int)
func (*Transaction) String ¶
func (m *Transaction) String() string
func (*Transaction) Unmarshal ¶
func (m *Transaction) Unmarshal(dAtA []byte) error
func (*Transaction) XXX_DiscardUnknown ¶
func (m *Transaction) XXX_DiscardUnknown()
func (*Transaction) XXX_Marshal ¶
func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Transaction) XXX_Merge ¶
func (dst *Transaction) XXX_Merge(src proto.Message)
func (*Transaction) XXX_Size ¶
func (m *Transaction) XXX_Size() int
func (*Transaction) XXX_Unmarshal ¶
func (m *Transaction) XXX_Unmarshal(b []byte) error
type TransactionSigHash ¶
type TransactionSigHash struct { *Body `protobuf:"bytes,1,opt,name=body,proto3,embedded=body" json:"body,omitempty"` SigHash []byte `protobuf:"bytes,2,opt,name=sig_hash,json=sigHash,proto3" json:"sig_hash,omitempty"` }
TransactionSigHash is a transactio whose sig is hash.
func NewPopulatedTransactionSigHash ¶
func NewPopulatedTransactionSigHash(r randyTx, easy bool) *TransactionSigHash
func (*TransactionSigHash) Descriptor ¶
func (*TransactionSigHash) Descriptor() ([]byte, []int)
func (*TransactionSigHash) Equal ¶
func (this *TransactionSigHash) Equal(that interface{}) bool
func (*TransactionSigHash) Marshal ¶
func (m *TransactionSigHash) Marshal() (dAtA []byte, err error)
func (*TransactionSigHash) MarshalTo ¶
func (m *TransactionSigHash) MarshalTo(dAtA []byte) (int, error)
func (*TransactionSigHash) ProtoMessage ¶
func (*TransactionSigHash) ProtoMessage()
func (*TransactionSigHash) Reset ¶
func (m *TransactionSigHash) Reset()
func (*TransactionSigHash) Size ¶
func (m *TransactionSigHash) Size() (n int)
func (*TransactionSigHash) String ¶
func (m *TransactionSigHash) String() string
func (*TransactionSigHash) Unmarshal ¶
func (m *TransactionSigHash) Unmarshal(dAtA []byte) error
func (*TransactionSigHash) XXX_DiscardUnknown ¶
func (m *TransactionSigHash) XXX_DiscardUnknown()
func (*TransactionSigHash) XXX_Marshal ¶
func (m *TransactionSigHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TransactionSigHash) XXX_Merge ¶
func (dst *TransactionSigHash) XXX_Merge(src proto.Message)
func (*TransactionSigHash) XXX_Size ¶
func (m *TransactionSigHash) XXX_Size() int
func (*TransactionSigHash) XXX_Unmarshal ¶
func (m *TransactionSigHash) XXX_Unmarshal(b []byte) error
type UTXO ¶
type UTXO struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Address *address.Address `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` *InoutHash `protobuf:"bytes,3,opt,name=inout_hash,json=inoutHash,proto3,embedded=inout_hash" json:"inout_hash,omitempty"` Value uint64 `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"` }
UTXO is an candidate of inputs in a tx.
func NewPopulatedUTXO ¶
func (*UTXO) Descriptor ¶
func (*UTXO) ProtoMessage ¶
func (*UTXO) ProtoMessage()
func (*UTXO) XXX_DiscardUnknown ¶
func (m *UTXO) XXX_DiscardUnknown()