Documentation ¶
Index ¶
- Constants
- Variables
- func MsgpackMarshalPanic(val interface{}) []byte
- type Address
- type DataStore
- type DepositData
- type Domain
- type DomainReader
- type GhostChecker
- 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 MintData
- type MintDistribution
- type Node
- type NodeReader
- type Output
- type Round
- type RoundLink
- type Script
- type SignedTransaction
- func (tx *SignedTransaction) CheckMint() bool
- func (tx *SignedTransaction) LockInputs(locker UTXOLocker, fork bool) error
- func (tx *SignedTransaction) Marshal() []byte
- func (signed *SignedTransaction) SignInput(reader UTXOReader, index int, accounts []Address) error
- func (signed *SignedTransaction) SignRaw(key crypto.Key) error
- func (tx *SignedTransaction) Validate(store DataStore) error
- type Snapshot
- type SnapshotWithTopologicalOrder
- type Transaction
- func (tx *Transaction) AddDepositInput(data *DepositData)
- func (tx *Transaction) AddInput(hash crypto.Hash, index int)
- func (tx *Transaction) AddKernelNodeMintInput(batch uint64, amount Integer)
- func (tx *Transaction) AddScriptOutput(accounts []Address, s Script, amount Integer) error
- func (tx *Transaction) PayloadHash() crypto.Hash
- func (tx *Transaction) UnspentOutputs() []*UTXO
- func (tx *Transaction) ViewGhostKey(a *crypto.Key) []*Output
- type UTXO
- type UTXOLocker
- type UTXOReader
- type UTXOWithLock
Constants ¶
View Source
const ( NodeStatePledging = "PLEDGING" NodeStateAccepted = "ACCEPTED" NodeStateDeparting = "DEPARTING" )
View Source
const ( Operator0 = 0x00 Operator64 = 0x40 OperatorSum = 0xfe OperatorCmp = 0xff )
View Source
const ( TxVersion = 0x01 ExtraSizeLimit = 256 OutputTypeScript = 0x00 OutputTypeWithdrawal = 0xa1 OutputTypeSlash = 0xa2 OutputTypeNodePledge = 0xa3 OutputTypeNodeAccept = 0xa4 OutputTypeNodeDepart = 0xa5 OutputTypeNodeRemove = 0xa6 OutputTypeDomainAccept = 0xa7 OutputTypeDomainRemove = 0xa8 )
View Source
const MainNetworkId = "XIN"
View Source
const (
MintGroupKernelNode = "KERNELNODE"
)
View Source
const Precision = 8
Variables ¶
Functions ¶
func MsgpackMarshalPanic ¶
func MsgpackMarshalPanic(val interface{}) []byte
Types ¶
type Address ¶
type Address struct { PrivateSpendKey crypto.Key PrivateViewKey crypto.Key PublicSpendKey crypto.Key PublicViewKey crypto.Key }
func NewAddressFromSeed ¶
func NewAddressFromString ¶
func (Address) MarshalJSON ¶
func (*Address) UnmarshalJSON ¶
type DataStore ¶
type DataStore interface { UTXOReader UTXOLocker GhostChecker NodeReader DomainReader }
type DepositData ¶
type DepositData struct { Chain crypto.Hash `json:"chain"` AssetKey string `json:"asset"` TransactionHash string `json:"transaction"` OutputIndex uint64 `json:"index"` Amount Integer `json:"amount"` }
func (*DepositData) AssetId ¶ added in v0.1.4
func (d *DepositData) AssetId() crypto.Hash
func (*DepositData) UniqueKey ¶ added in v0.1.4
func (d *DepositData) UniqueKey() crypto.Hash
type DomainReader ¶
type DomainReader interface {
ReadDomains() []Domain
}
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 MintData ¶ added in v0.1.1
type MintData struct { Group string `json:"group"` Batch uint64 `json:"batch"` Amount Integer `json:"amount"` }
func (*MintData) Distribute ¶ added in v0.1.1
func (m *MintData) Distribute(tx crypto.Hash) *MintDistribution
type MintDistribution ¶ added in v0.1.1
type Node ¶
func (*Node) IsAccepted ¶
type NodeReader ¶
type NodeReader interface { ReadConsensusNodes() []*Node ReadTransaction(hash crypto.Hash) (*SignedTransaction, error) }
type Script ¶
type Script []uint8
func NewThresholdScript ¶ added in v0.1.1
func (Script) MarshalJSON ¶
func (*Script) UnmarshalJSON ¶
func (Script) VerifyFormat ¶
type SignedTransaction ¶
type SignedTransaction struct { Transaction Signatures [][]crypto.Signature `json:"signatures,omitempty"` }
func (*SignedTransaction) CheckMint ¶ added in v0.1.1
func (tx *SignedTransaction) CheckMint() bool
func (*SignedTransaction) LockInputs ¶
func (tx *SignedTransaction) LockInputs(locker UTXOLocker, fork bool) error
func (*SignedTransaction) Marshal ¶
func (tx *SignedTransaction) Marshal() []byte
func (*SignedTransaction) SignInput ¶
func (signed *SignedTransaction) SignInput(reader UTXOReader, index int, accounts []Address) error
func (*SignedTransaction) Validate ¶
func (tx *SignedTransaction) Validate(store DataStore) error
type Snapshot ¶
type Snapshot struct { NodeId crypto.Hash `json:"node"` Transaction crypto.Hash `json:"transaction"` References *RoundLink `json:"references"` RoundNumber uint64 `json:"round"` Timestamp uint64 `json:"timestamp"` Signatures []*crypto.Signature `json:"signatures,omitempty"` Hash crypto.Hash `msgpack:"-"json:"hash"` }
func (*Snapshot) PayloadHash ¶
type Transaction ¶
type Transaction struct { Version uint8 `json:"version"` Asset crypto.Hash `json:"asset"` Inputs []*Input `json:"inputs"` Outputs []*Output `json:"outputs"` Extra []byte `json:"extra,omitempty"` }
func NewTransaction ¶
func NewTransaction(asset crypto.Hash) *Transaction
func (*Transaction) AddDepositInput ¶
func (tx *Transaction) AddDepositInput(data *DepositData)
func (*Transaction) AddKernelNodeMintInput ¶ added in v0.1.1
func (tx *Transaction) AddKernelNodeMintInput(batch uint64, amount Integer)
func (*Transaction) AddScriptOutput ¶
func (tx *Transaction) AddScriptOutput(accounts []Address, s Script, amount Integer) error
func (*Transaction) PayloadHash ¶
func (tx *Transaction) PayloadHash() crypto.Hash
func (*Transaction) UnspentOutputs ¶
func (tx *Transaction) UnspentOutputs() []*UTXO
func (*Transaction) ViewGhostKey ¶
func (tx *Transaction) ViewGhostKey(a *crypto.Key) []*Output
type UTXOLocker ¶
type UTXOReader ¶
type UTXOWithLock ¶
Click to show internal directories.
Click to hide internal directories.