Documentation ¶
Index ¶
- Constants
- func MarshalMsgpack(v interface{}) ([]byte, error)
- func ParseFloat64(value interface{}, args ...float64) float64
- func ParseInt(value interface{}, args ...int) int
- func ParseInt64(value interface{}, args ...int64) int64
- func UnmarshalMsgpack(data []byte, val interface{}) error
- type Input
- type Integer
- func (x Integer) Add(y Integer) (v Integer)
- func (x Integer) Cmp(y Integer) int
- func (x Integer) Div(y int) (v Integer)
- func (x Integer) MarshalJSON() ([]byte, error)
- func (x Integer) MarshalMsgpack() ([]byte, error)
- func (x Integer) Mul(y int) (v Integer)
- func (x Integer) Sign() int
- func (x Integer) String() string
- func (x Integer) Sub(y Integer) (v Integer)
- func (x *Integer) UnmarshalJSON(b []byte) error
- func (x *Integer) UnmarshalMsgpack(data []byte) error
- type KernelService
- type Output
- type Script
- type Snapshot
- type Transaction
- type UTXO
Constants ¶
View Source
const ( ErrCodeInternal = 1 ErrCodeInvalidParam = 2 )
View Source
const ( // transaction ErrCodeTransactionNotExists = 10000 ErrCodeInvalidSignature = 10001 ErrCodeInvalidAsset = 10002 )
View Source
const ( // output ErrCodeOutputNotExists = 10100 ErrCodeOutputKeyExists = 10101 ErrCodeOutputAlreadySpent = 10102 )
View Source
const ( Operator0 = 0x00 Operator64 = 0x40 OperatorSum = 0xfe OperatorCmp = 0xff )
View Source
const Precision = 8
Variables ¶
This section is empty.
Functions ¶
func MarshalMsgpack ¶
func ParseFloat64 ¶
ParseFloat64 parse interface to float64
func ParseInt64 ¶
ParseInt64 parse interface to int64
func UnmarshalMsgpack ¶
Types ¶
type Integer ¶
type Integer struct {
// contains filtered or unexported fields
}
var Zero Integer
func NewInteger ¶
func NewIntegerFromString ¶
func (Integer) MarshalJSON ¶
func (Integer) MarshalMsgpack ¶
func (*Integer) UnmarshalJSON ¶
func (*Integer) UnmarshalMsgpack ¶
type KernelService ¶
type KernelService interface { SubmitTransaction(ctx context.Context, tx *Transaction) (crypto.Hash, error) ReadTransaction(ctx context.Context, txHash crypto.Hash) (*Transaction, error) ReadUTXO(ctx context.Context, txHash crypto.Hash, index int) (*UTXO, error) ReadSnapshots(ctx context.Context, from, count int) ([]*Snapshot, error) }
type Script ¶
type Script []uint8
func NewThresholdScript ¶
func (Script) MarshalJSON ¶
func (*Script) UnmarshalJSON ¶
func (Script) VerifyFormat ¶
type Snapshot ¶
type Snapshot struct { Hash string `json:"hash"` Transaction *Transaction `json:"transaction"` Topology int64 `json:"topology"` Timestamp int64 `json:"timestamp"` Signature string `json:"signature"` // snapshot signature, co-sign by kernel nodes }
type Transaction ¶
type Transaction struct { Hash *crypto.Hash `json:"hash,omitempty" msgpack:"-"` Version uint8 `json:"version"` Asset crypto.Hash `json:"asset"` Inputs []*Input `json:"inputs"` Outputs []*Output `json:"outputs"` Extra []byte `json:"extra,omitempty"` Signatures [][]crypto.Signature `json:"signatures,omitempty" msgpack:",omitempty"` Snapshot *crypto.Hash `json:"snapshot,omitempty" msgpack:"-"` }
func (*Transaction) MsgpackMarshal ¶
func (t *Transaction) MsgpackMarshal() ([]byte, error)
func (*Transaction) MsgpackMarshalPayload ¶
func (t *Transaction) MsgpackMarshalPayload() ([]byte, error)
func (*Transaction) TransactionHash ¶
func (t *Transaction) TransactionHash() (crypto.Hash, error)
Click to show internal directories.
Click to hide internal directories.