ckbtypes

package
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DepTypeCode     = "code"
	DepTypeDepGroup = "dep_group"
)
View Source
const (
	HashTypeType = "type"
	HashTypeData = "data"
)
View Source
const (
	TransactionStatusPending   = "pending"
	TransactionStatusCommitted = "committed"
)
View Source
const (
	CellStatusLive = "live"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoGenerated

type AutoGenerated struct {
	BytesLimit string `json:"bytes_limit"`
	Cellbase   struct {
		Cycles interface{} `json:"cycles"`
		Data   struct {
			CellDeps   []interface{} `json:"cell_deps"`
			HeaderDeps []interface{} `json:"header_deps"`
			Inputs     []struct {
				PreviousOutput struct {
					Index  string `json:"index"`
					TxHash string `json:"tx_hash"`
				} `json:"previous_output"`
				Since string `json:"since"`
			} `json:"inputs"`
			Outputs []struct {
				Capacity string `json:"capacity"`
				Lock     struct {
					Args     []string `json:"args"`
					CodeHash string   `json:"code_hash"`
					HashType string   `json:"hash_type"`
				} `json:"lock"`
				Type interface{} `json:"type"`
			} `json:"outputs"`
			OutputsData []string `json:"outputs_data"`
			Version     string   `json:"version"`
			Witnesses   []struct {
				Data []string `json:"data"`
			} `json:"witnesses"`
		} `json:"data"`
		Hash string `json:"hash"`
	} `json:"cellbase"`
	CompactTarget    string        `json:"compact_target"`
	CurrentTime      string        `json:"current_time"`
	CyclesLimit      string        `json:"cycles_limit"`
	Dao              string        `json:"dao"`
	Epoch            string        `json:"epoch"`
	Number           string        `json:"number"`
	ParentHash       string        `json:"parent_hash"`
	Proposals        []interface{} `json:"proposals"`
	Transactions     []interface{} `json:"transactions"`
	Uncles           []interface{} `json:"uncles"`
	UnclesCountLimit string        `json:"uncles_count_limit"`
	Version          string        `json:"version"`
	WorkID           string        `json:"work_id"`
}

type BannedAddress

type BannedAddress struct {
	Address   string `json:"address"`
	BanReason string `json:"ban_reason"`
	BanUntil  string `json:"ban_until"`
	CreatedAt string `json:"created_at"`
}

type Block

type Block struct {
	Header       Header        `json:"header"`
	Proposals    []string      `json:"proposals"`
	Transactions []Transaction `json:"transactions"`
	Uncles       []UncleBlock  `json:"uncles"`
}

type BlockChainInfo

type BlockChainInfo struct {
	Alerts []struct {
		ID          string `json:"id"`
		Message     string `json:"message"`
		NoticeUntil string `json:"notice_until"`
		Priority    string `json:"priority"`
	} `json:"alerts"`
	Chain                  string `json:"chain"`
	Difficulty             string `json:"difficulty"`
	Epoch                  string `json:"epoch"`
	IsInitialBlockDownload bool   `json:"is_initial_block_download"`
	MedianTime             string `json:"median_time"`
}

type BlockHashIndexState

type BlockHashIndexState struct {
	BlockHash   string `json:"block_hash"`
	BlockNumber string `json:"block_number"`
	LockHash    string `json:"lock_hash"`
}

type BlockHeader

type BlockHeader struct {
	CompactTarget    string `json:"compact_target"`
	Hash             string `json:"hash"`
	Number           string `json:"number"`
	ParentHash       string `json:"parent_hash"`
	Nonce            string `json:"nonce"`
	Timestamp        string `json:"timestamp"`
	TransactionsRoot string `json:"transactions_root"`
	ProposalsHash    string `json:"proposals_hash"`
	UnclesHash       string `json:"uncles_hash"`
	Version          string `json:"version"`
	Epoch            string `json:"epoch"`
	DAO              string `json:"dao"`
}

type BlockReward

type BlockReward struct {
	Total          string `json:"total"`
	Primary        string `json:"primary"`
	Secondary      string `json:"secondary"`
	TxFee          string `json:"tx_fee"`
	ProposalReward string `json:"proposal_reward"`
}

type BlockTemplate

type BlockTemplate struct {
	BytesLimit       string                `json:"bytes_limit"`
	Cellbase         CellbaseTemplate      `json:"cellbase"`
	CompactTarget    string                `json:"compact_target"`
	CurrentTime      string                `json:"current_time"`
	CyclesLimit      string                `json:"cycles_limit"`
	Dao              string                `json:"dao"`
	Epoch            string                `json:"epoch"`
	Number           string                `json:"number"`
	ParentHash       string                `json:"parent_hash"`
	Proposals        []string              `json:"proposals"`
	Transactions     []TransactionTemplate `json:"transactions"`
	Uncles           []UncleTemplate       `json:"uncles"`
	UnclesCountLimit string                `json:"uncles_count_limit"`
	Version          string                `json:"version"`
	WorkID           string                `json:"work_id"`
}

type CellBase

type CellBase struct {
	Primary        string `json:"primary"`
	ProposalReward string `json:"proposal_reward"`
	Secondary      string `json:"secondary"`
	Total          string `json:"total"`
	TxFee          string `json:"tx_fee"`
}

type CellData

type CellData struct {
	Content string `json:"content"`
	Hash    string `json:"hash"`
}

type CellDep

type CellDep struct {
	DepType  DepType  `json:"dep_type"`
	OutPoint OutPoint `json:"out_point"`
}

type CellInfo

type CellInfo struct {
	Lock   Script   `json:"lock"`
	Output Output   `json:"output"`
	Data   CellData `json:"data"`
}

type CellOutputWithOutPoint

type CellOutputWithOutPoint struct {
	BlockHash string   `json:"block_hash"`
	Capacity  string   `json:"capacity"`
	Lock      Script   `json:"lock"`
	OutPoint  OutPoint `json:"out_point"`
}

type CellStatus

type CellStatus string

type CellTransaction

type CellTransaction struct {
	ConsumedBy *TransactionPoint `json:"consumed_by,omitempty"`
	CreatedBy  TransactionPoint  `json:"created_by"`
}

type CellWithStatus

type CellWithStatus struct {
	Cell   CellInfo `json:"cell"`
	Status string   `json:"status"`
}

type CellbaseTemplate

type CellbaseTemplate struct {
	Cycles interface{} `json:"cycles"`
	Data   Transaction `json:"data"`
	Hash   string      `json:"hash"`
}

type DepType

type DepType string

type Epoch

type Epoch struct {
	Difficulty  string `json:"difficulty"`
	Length      string `json:"length"`
	Number      string `json:"number"`
	StartNumber string `json:"start_number"`
}

type FeeRate

type FeeRate struct {
	FeeRate string `json:"fee_rate"`
}

type HashType

type HashType string
type Header struct {
	Dao              string `json:"dao"`
	Difficulty       string `json:"difficulty"`
	Epoch            string `json:"epoch"`
	Hash             string `json:"hash"`
	Nonce            string `json:"nonce"`
	Number           string `json:"number"`
	ParentHash       string `json:"parent_hash"`
	ProposalsHash    string `json:"proposals_hash"`
	Timestamp        string `json:"timestamp"`
	TransactionsRoot string `json:"transactions_root"`
	UnclesCount      string `json:"uncles_count"`
	UnclesHash       string `json:"uncles_hash"`
	Version          string `json:"version"`
	WitnessesRoot    string `json:"witnesses_root"`
}

type Input

type Input struct {
	PreviousOutput OutPoint `json:"previous_output"`
	Since          string   `json:"since"`
}

type LiveCell

type LiveCell struct {
	CellOutput Output           `json:"cell_output"`
	CreatedBy  TransactionPoint `json:"created_by"`
}

type NodeInfo

type NodeInfo struct {
	Addresses []struct {
		Address string `json:"address"`
		Score   string `json:"score"`
	} `json:"addresses"`
	IsOutbound *bool  `json:"is_outbound"`
	NodeID     string `json:"node_id"`
	Version    string `json:"version"`
}

type OutPoint

type OutPoint struct {
	Index  string `json:"index"`
	TxHash string `json:"tx_hash"`
}

func (OutPoint) Clone

func (outPoint OutPoint) Clone() *OutPoint

type Output

type Output struct {
	Capacity string  `json:"capacity"`
	Lock     Script  `json:"lock"`
	Type     *Script `json:"type,omitempty"`
}

func (Output) ByteSize

func (output Output) ByteSize() (uint64, error)

func (Output) Clone

func (output Output) Clone() *Output

type PeerState

type PeerState struct {
	BlocksInFlight string `json:"blocks_in_flight"`
	LastUpdated    string `json:"last_updated"`
	Peer           string `json:"peer"`
}

type PoolInfo

type PoolInfo struct {
	LastTxsUpdatedAt string `json:"last_txs_updated_at"`
	Orphan           string `json:"orphan"`
	Pending          string `json:"pending"`
	Proposed         string `json:"proposed"`
	TotalTxCycles    string `json:"total_tx_cycles"`
	TotalTxSize      string `json:"total_tx_size"`
}

type RawTransaction

type RawTransaction struct {
	CellDeps    []CellDep     `json:"cell_deps"`
	HeaderDeps  []string      `json:"header_deps"`
	Inputs      []Input       `json:"inputs"`
	Outputs     []Output      `json:"outputs"`
	OutputsData []string      `json:"outputs_data"`
	Version     string        `json:"version"`
	Witnesses   []interface{} `json:"witnesses"`
}

type Script

type Script struct {
	Args     string   `json:"args"`
	CodeHash string   `json:"code_hash"`
	HashType HashType `json:"hash_type"`
}

func (Script) ByteSize

func (script Script) ByteSize() (uint64, error)

type Transaction

type Transaction struct {
	CellDeps    []CellDep     `json:"cell_deps"`
	Hash        string        `json:"hash"`
	HeaderDeps  []string      `json:"header_deps"`
	Inputs      []Input       `json:"inputs"`
	Outputs     []Output      `json:"outputs"`
	OutputsData []string      `json:"outputs_data"`
	Version     string        `json:"version"`
	Witnesses   []interface{} `json:"witnesses"`
}

func (Transaction) ToRaw

func (transaction Transaction) ToRaw() RawTransaction

type TransactionInfo

type TransactionInfo struct {
	Transaction Transaction           `json:"transaction"`
	Status      TransactionStatusInfo `json:"tx_status"`
}

type TransactionPoint

type TransactionPoint struct {
	BlockNumber string `json:"block_number"`
	Index       string `json:"index"`
	TxHash      string `json:"tx_hash"`
}

type TransactionStatus

type TransactionStatus string

type TransactionStatusInfo

type TransactionStatusInfo struct {
	BlockHash string            `json:"block_hash"`
	Status    TransactionStatus `json:"status"`
}

type TransactionTemplate

type TransactionTemplate struct {
	Hash     string      `json:"hash"`
	Required bool        `json:"required"`
	Cycles   string      `json:"cycles"`
	Depends  []string    `json:"depends"`
	Data     Transaction `json:"data"`
}

type TxStatus

type TxStatus struct {
	BlockHash string `json:"block_hash"`
	Status    string `json:"status"`
}

type UncleBlock

type UncleBlock struct {
	CellBase  Transaction `json:"cellbase"`
	Header    Header      `json:"header"`
	Proposals []string    `json:"proposals"`
}

type UncleTemplate

type UncleTemplate struct {
	Hash      string      `json:"hash"`
	Required  bool        `json:"required"`
	Proposals []string    `json:"proposals"`
	Header    BlockHeader `json:"header"`
}

type Witness

type Witness struct {
	Lock       string
	InputType  string
	OutputType string
}

func (Witness) Clone

func (witness Witness) Clone() *Witness

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL