Documentation
¶
Index ¶
- Constants
- Variables
- type Addition
- type BlockCountMetrics
- type BlockEvent
- type BlockRecord
- type BlockchainState
- type Bytes
- type Bytes100
- type Bytes32
- type Bytes48
- type Bytes96
- type ClassgroupElement
- type Coin
- type CoinAddedEvent
- type CoinRecord
- type CoinSpend
- type CompressibleVDFField
- type Connection
- type CrawlerPeerCounts
- type DeclareProofOfSpace
- type EndOfSubSlotBundle
- type EventFarmerProof
- type EventFarmerSubmittedPartial
- type EventHarvesterFarmingInfo
- type FinishedPoTEvent
- type Foliage
- type FoliageBlockData
- type FoliageTransactionBlock
- type FullBlock
- type G1Element
- type G2Element
- type IPAddress
- type MempoolInclusionStatus
- type MempoolMinFees
- type NFT
- type NewCompactProofEvent
- type NewPeakEvent
- type NewSignagePoint
- type NodeType
- type PlotInfo
- type PoolTarget
- type ProofOfSpace
- type PublicKeyMPL
- type ReceiveBlockResult
- type RewardChainBlock
- type SentTo
- type SerializedProgram
- type SignagePointEvent
- type SignatureMPL
- type SkippingPeakEvent
- type SpendBundle
- type SubEpochSummary
- type Sync
- type TimelordChain
- type TransactionRecord
- type TransactionType
- type TransactionsInfo
- type Uint128
- func (u Uint128) Add(v Uint128) Uint128
- func (u Uint128) Add64(v uint64) Uint128
- func (u Uint128) AddWrap(v Uint128) Uint128
- func (u Uint128) AddWrap64(v uint64) Uint128
- func (u Uint128) And(v Uint128) Uint128
- func (u Uint128) And64(v uint64) Uint128
- func (u Uint128) Big() *big.Int
- func (u Uint128) Cmp(v Uint128) int
- func (u Uint128) Cmp64(v uint64) int
- func (u Uint128) Div(v Uint128) Uint128
- func (u Uint128) Div64(v uint64) Uint128
- func (u Uint128) Equals(v Uint128) bool
- func (u Uint128) Equals64(v uint64) bool
- func (u *Uint128) FitsInUint64() bool
- func (u Uint128) IsZero() bool
- func (u Uint128) LeadingZeros() int
- func (u Uint128) Len() int
- func (u Uint128) Lsh(n uint) (s Uint128)
- func (u *Uint128) MarshalJSON() ([]byte, error)
- func (u Uint128) Mod(v Uint128) (r Uint128)
- func (u Uint128) Mod64(v uint64) (r uint64)
- func (u Uint128) Mul(v Uint128) Uint128
- func (u Uint128) Mul64(v uint64) Uint128
- func (u Uint128) MulWrap(v Uint128) Uint128
- func (u Uint128) MulWrap64(v uint64) Uint128
- func (u Uint128) OnesCount() int
- func (u Uint128) Or(v Uint128) Uint128
- func (u Uint128) Or64(v uint64) Uint128
- func (u Uint128) PutBytes(b []byte)
- func (u Uint128) QuoRem(v Uint128) (q, r Uint128)
- func (u Uint128) QuoRem64(v uint64) (q Uint128, r uint64)
- func (u Uint128) Reverse() Uint128
- func (u Uint128) ReverseBytes() Uint128
- func (u Uint128) RotateLeft(k int) Uint128
- func (u Uint128) RotateRight(k int) Uint128
- func (u Uint128) Rsh(n uint) (s Uint128)
- func (u Uint128) String() string
- func (u Uint128) Sub(v Uint128) Uint128
- func (u Uint128) Sub64(v uint64) Uint128
- func (u Uint128) SubWrap(v Uint128) Uint128
- func (u Uint128) SubWrap64(v uint64) Uint128
- func (u Uint128) TrailingZeros() int
- func (u *Uint128) Uint64() uint64
- func (u *Uint128) UnmarshalJSON(data []byte) error
- func (u Uint128) Xor(v Uint128) Uint128
- func (u Uint128) Xor64(v uint64) Uint128
- type VDFInfo
- type VDFProof
- type WalletBalance
- type WalletInfo
- type WalletType
- type WebsocketBlockchainState
- type WebsocketRequest
- type WebsocketResponse
- type WebsocketSubscription
Constants ¶
const ( // WalletTypeStandard Standard Wallet WalletTypeStandard = WalletType(0) // WalletTypeRateLimited Rate Limited Wallet WalletTypeRateLimited = WalletType(1) // WalletTypeAtomicSwap Atomic Swap WalletTypeAtomicSwap = WalletType(2) // WalletTypeAuthorizedPayee Authorized Payee WalletTypeAuthorizedPayee = WalletType(3) // WalletTypeMultiSig Multi Sig WalletTypeMultiSig = WalletType(4) // WalletTypeCustody Custody WalletTypeCustody = WalletType(5) // WalletTypeCAT CAT Wallet WalletTypeCAT = WalletType(6) // WalletTypeRecoverable Recoverable Wallet WalletTypeRecoverable = WalletType(7) // WalletTypeDID DECENTRALIZED_ID Wallet WalletTypeDID = WalletType(8) // WalletTypePooling Pooling Wallet WalletTypePooling = WalletType(9) // WalletTypeNFT NFT Wallet WalletTypeNFT = WalletType(10) )
Variables ¶
var Uint128Max = NewUint128(math.MaxUint64, math.MaxUint64)
Uint128Max is the largest possible uint128 value.
Functions ¶
This section is empty.
Types ¶
type Addition ¶ added in v0.0.20
type Addition struct { Amount uint64 `json:"amount"` PuzzleHash Bytes32 `json:"puzzle_hash"` Memos []string `json:"memos,omitempty"` }
Addition an addition for a spend
type BlockCountMetrics ¶
type BlockCountMetrics struct { CompactBlocks uint32 `json:"compact_blocks"` UncompactBlocks uint32 `json:"uncompact_blocks"` HintCount uint64 `json:"hint_count"` }
BlockCountMetrics metrics from get_block_count_metrics endpoint
type BlockEvent ¶
type BlockEvent struct { TransactionBlock bool `json:"transaction_block"` KSize uint8 `json:"k_size"` HeaderHash Bytes32 `json:"header_hash"` Height uint32 `json:"height"` ValidationTime float64 `json:"validation_time"` PreValidationTime float64 `json:"pre_validation_time"` BlockCost uint64 `json:"block_cost"` BlockFees uint64 `json:"block_fees"` TransactionGeneratorSizeBytes uint64 `json:"transaction_generator_size_bytes"` TransactionGeneratorRefList []uint32 `json:"transaction_generator_ref_list"` ReceiveBlockResult ReceiveBlockResult `json:"receive_block_result"` }
BlockEvent data from block websocket event
type BlockRecord ¶
type BlockRecord struct { HeaderHash Bytes32 `json:"header_hash"` PrevHash Bytes32 `json:"prev_hash"` Height uint32 `json:"height"` Weight Uint128 `json:"weight"` TotalIters Uint128 `json:"total_iters"` SignagePointIndex uint8 `json:"signage_point_index"` ChallengeVDFOutput ClassgroupElement `json:"challenge_vdf_output"` InfusedChallengeVDFOutput *ClassgroupElement `json:"infused_challenge_vdf_output"` RewardInfusionNewChallenge Bytes32 `json:"reward_infusion_new_challenge"` ChallengeBlockInfoHash Bytes32 `json:"challenge_block_info_hash"` SubSlotIters uint64 `json:"sub_slot_iters"` PoolPuzzleHash Bytes32 `json:"pool_puzzle_hash"` FarmerPuzzleHash Bytes32 `json:"farmer_puzzle_hash"` RequiredIters uint64 `json:"required_iters"` Deficit uint8 `json:"deficit"` Overflow bool `json:"overflow"` PrevTransactionBlockHeight uint32 `json:"prev_transaction_block_height"` // Transaction Block - Present if is_transaction_block Timestamp *uint64 `json:"timestamp"` // @TODO time.Time ? PrevTransactionBlockHash *Bytes32 `json:"prev_transaction_block_hash"` Fees *uint64 `json:"fees"` RewardClaimsIncorporated []*Coin `json:"reward_claims_incorporated"` // Slot - present if this is the first SB in sub slot FinishedChallengeSlotHashes []Bytes32 `json:"finished_challenge_slot_hashes"` FinishedInfusedChallengeSlotHashes []Bytes32 `json:"finished_infused_challenge_slot_hashes"` FinishedRewardSlotHashes []Bytes32 `json:"finished_reward_slot_hashes"` // Sub-epoch - present if this is the first SB after sub-epoch SubEpochSummaryIncluded *SubEpochSummary `json:"sub_epoch_summary_included"` }
BlockRecord a single block record
type BlockchainState ¶
type BlockchainState struct { Difficulty uint64 `json:"difficulty"` GenesisChallengeInitialized bool `json:"genesis_challenge_initialized"` MempoolSize uint64 `json:"mempool_size"` MempoolCost uint64 `json:"mempool_cost"` MempoolMinFees *MempoolMinFees `json:"mempool_min_fees"` MempoolMaxTotalCost uint64 `json:"mempool_max_total_cost"` Peak *BlockRecord `json:"peak"` Space Uint128 `json:"space"` SubSlotIters uint64 `json:"sub_slot_iters"` Sync *Sync `json:"sync"` BlockMaxCost uint64 `json:"block_max_cost"` }
BlockchainState blockchain state
type Bytes ¶ added in v0.1.0
type Bytes []byte
Bytes is a wrapper around []byte that marshals down to hex and more closely matches types in chia-blockchain
func Bytes100ToBytes ¶ added in v0.1.0
Bytes100ToBytes returns []byte from [100]byte
func Bytes32ToBytes ¶ added in v0.0.13
Bytes32ToBytes returns []byte from [32]byte
func Bytes48ToBytes ¶ added in v0.1.0
Bytes48ToBytes returns []byte from [48]byte
func Bytes96ToBytes ¶ added in v0.1.0
Bytes96ToBytes returns []byte from [96]byte
func (Bytes) MarshalJSON ¶ added in v0.1.0
MarshalJSON marshals Bytes into hex for json
func (*Bytes) UnmarshalJSON ¶ added in v0.1.0
UnmarshalJSON unmarshals hex into []byte
type Bytes100 ¶ added in v0.1.0
type Bytes100 [100]byte
Bytes100 Helper type with custom json handling for [100]byte
func BytesToBytes100 ¶ added in v0.1.0
BytesToBytes100 Returns Bytes100 from Bytes If input is shorter than 100 bytes, the end will be padded If the input is longer than 100 bytes, an error will be returned
func (Bytes100) MarshalJSON ¶ added in v0.1.0
MarshalJSON marshals Bytes into hex for json
func (*Bytes100) UnmarshalJSON ¶ added in v0.1.0
UnmarshalJSON unmarshals hex into []byte
type Bytes32 ¶ added in v0.1.0
type Bytes32 [32]byte
Bytes32 Helper type with custom json handling for [32]byte
func BytesToBytes32 ¶ added in v0.0.13
BytesToBytes32 Returns Bytes32 from Bytes If input is shorter than 32 bytes, the end will be padded If the input is longer than 32 bytes, an error will be returned
func (Bytes32) MarshalJSON ¶ added in v0.1.0
MarshalJSON marshals Bytes into hex for json
func (*Bytes32) UnmarshalJSON ¶ added in v0.1.0
UnmarshalJSON unmarshals hex into []byte
type Bytes48 ¶ added in v0.1.0
type Bytes48 [48]byte
Bytes48 Helper type with custom json handling for [48]byte
func BytesToBytes48 ¶ added in v0.1.0
BytesToBytes48 Returns Bytes48 from Bytes If input is shorter than 48 bytes, the end will be padded If the input is longer than 48 bytes, an error will be returned
func (Bytes48) MarshalJSON ¶ added in v0.1.0
MarshalJSON marshals Bytes into hex for json
func (*Bytes48) UnmarshalJSON ¶ added in v0.1.0
UnmarshalJSON unmarshals hex into []byte
type Bytes96 ¶ added in v0.1.0
type Bytes96 [96]byte
Bytes96 Helper type with custom json handling for [96]byte
func BytesToBytes96 ¶ added in v0.1.0
BytesToBytes96 Returns Bytes96 from Bytes If input is shorter than 96 bytes, the end will be padded If the input is longer than 96 bytes, an error will be returned
func (Bytes96) MarshalJSON ¶ added in v0.1.0
MarshalJSON marshals Bytes into hex for json
func (*Bytes96) UnmarshalJSON ¶ added in v0.1.0
UnmarshalJSON unmarshals hex into []byte
type ClassgroupElement ¶
type ClassgroupElement struct {
Data Bytes100 `json:"data"`
}
ClassgroupElement Classgroup Element
type Coin ¶
type Coin struct { ParentCoinInfo Bytes32 `json:"parent_coin_info"` PuzzleHash Bytes32 `json:"puzzle_hash"` Amount Uint128 `json:"amount"` }
Coin is a coin
type CoinAddedEvent ¶
type CoinAddedEvent struct { Success bool `json:"success"` State string `json:"state"` WalletID uint32 `json:"wallet_id"` }
CoinAddedEvent data from coin-added websocket event
type CoinRecord ¶ added in v0.0.19
type CoinRecord struct { Coin Coin `json:"coin"` ConfirmedBlockIndex uint32 `json:"confirmed_block_index"` SpentBlockIndex uint32 `json:"spent_block_index"` Coinbase bool `json:"coinbase"` Timestamp uint64 `json:"timestamp"` }
CoinRecord type
type CoinSpend ¶ added in v0.0.18
type CoinSpend struct { Coin *Coin `json:"coin"` PuzzleReveal *SerializedProgram `json:"puzzle_reveal"` Solution *SerializedProgram `json:"solution"` }
CoinSpend spend to a coin
type CompressibleVDFField ¶
type CompressibleVDFField uint8
CompressibleVDFField Stores, for a given VDF, the field that uses it.
const ( // CompressibleVDFFieldCCEOSVDF CC_EOS_VDF CompressibleVDFFieldCCEOSVDF CompressibleVDFField = 1 // CompressibleVDFFieldICCEOSVDF ICC_EOS_VDF CompressibleVDFFieldICCEOSVDF CompressibleVDFField = 2 // CompressibleVDFFieldCCSPVDF CC_SP_VDF CompressibleVDFFieldCCSPVDF CompressibleVDFField = 3 // CompressibleVDFFieldCCIPVDF CC_IP_VDF CompressibleVDFFieldCCIPVDF CompressibleVDFField = 4 )
type Connection ¶
type Connection struct { BytesRead uint64 `json:"bytes_read"` BytesWritten uint64 `json:"bytes_written"` //CreationTime // @TODO parse to time - is seconds as float //LastMessageTime // @TODO parse to time - is seconds as float LocalPort uint16 `json:"local_port"` NodeID string `json:"node_id"` // @TODO Should this be Bytes or Bytes32? PeakHash string `json:"peak_hash"` // @TODO Should this be bytes32? PeakHeight uint32 `json:"peak_height"` PeakWeight Uint128 `json:"peak_weight"` PeerHost IPAddress `json:"peer_host"` PeerPort uint16 `json:"peer_port"` PeerServerPort uint16 `json:"peer_server_port"` Type NodeType `json:"type"` }
Connection represents a single peer or internal connection
type CrawlerPeerCounts ¶
type CrawlerPeerCounts struct { TotalLast5Days uint `json:"total_last_5_days"` ReliableNodes uint `json:"reliable_nodes"` IPV4Last5Days uint `json:"ipv4_last_5_days"` IPV6Last5Days uint `json:"ipv6_last_5_days"` Versions map[string]int `json:"versions"` }
CrawlerPeerCounts peer_count data from the crawler
type DeclareProofOfSpace ¶ added in v0.0.5
type DeclareProofOfSpace struct { ChallengeHash Bytes32 `json:"challenge_hash"` ChallengeChainSP Bytes32 `json:"challenge_chain_sp"` SignagePointIndex uint8 `json:"signage_point_index"` RewardChainSP Bytes32 `json:"reward_chain_sp"` ProofOfSpace ProofOfSpace `json:"proof_of_space"` ChallengeChainSPSignature G2Element `json:"challenge_chain_sp_signature"` RewardChainSPSignature G2Element `json:"reward_chain_sp_signature"` FarmerPuzzleHash Bytes32 `json:"farmer_puzzle_hash"` PoolTarget *PoolTarget `json:"pool_target,omitempty"` PoolSignature *G2Element `json:"pool_signature,omitempty"` }
DeclareProofOfSpace matches to the farmer protocol type
type EndOfSubSlotBundle ¶
type EndOfSubSlotBundle struct { }
EndOfSubSlotBundle end of subslot bundle
type EventFarmerProof ¶ added in v0.0.5
type EventFarmerProof struct { Proof DeclareProofOfSpace `json:"proof"` PassedFilter bool `json:"passed_filter"` }
EventFarmerProof is the farmer event `proof`
type EventFarmerSubmittedPartial ¶ added in v0.0.5
type EventFarmerSubmittedPartial struct { LauncherID string `json:"launcher_id"` PoolURL string `json:"pool_url"` CurrentDifficulty uint64 `json:"current_difficulty"` PointsAcknowledgedSinceStart uint64 `json:"points_acknowledged_since_start"` }
EventFarmerSubmittedPartial is the event data for `submitted_partial` from the farmer
type EventHarvesterFarmingInfo ¶ added in v0.0.5
type EventHarvesterFarmingInfo struct { ChallengeHash Bytes32 `json:"challenge_hash"` TotalPlots uint64 `json:"total_plots"` FoundProofs uint64 `json:"found_proofs"` EligiblePlots uint64 `json:"eligible_plots"` Time float64 `json:"time"` }
EventHarvesterFarmingInfo is the event data for `farming_info` from the harvester
type FinishedPoTEvent ¶
type FinishedPoTEvent struct { Success bool `json:"success"` Chain TimelordChain `json:"chain"` EstimatedIPS float64 `json:"estimated_ips"` IterationsNeeded uint64 `json:"iterations_needed"` VDFInfo VDFInfo `json:"vdf_info"` VDFProof VDFProof `json:"vdf_proof"` }
FinishedPoTEvent data every time a PoT Challenge is completed
type Foliage ¶
type Foliage struct { PrevBlockHash Bytes32 `json:"prev_block_hash"` RewardBlockHash Bytes32 `json:"reward_block_hash"` FoliageBlockData *FoliageBlockData `json:"foliage_block_data"` FoliageBlockDataSignature *G2Element `json:"foliage_block_data_signature"` FoliageTransactionBlockHash *Bytes32 `json:"foliage_transaction_block_hash"` FoliageTransactionBlockSignature *G2Element `json:"foliage_transaction_block_signature"` }
Foliage Foliage
type FoliageBlockData ¶
type FoliageBlockData struct { UnfinishedRewardBlockHash Bytes32 `json:"unfinished_reward_block_hash"` PoolTarget *PoolTarget `json:"pool_target"` PoolSignature *G2Element `json:"pool_signature"` FarmerRewardPuzzleHash Bytes32 `json:"farmer_reward_puzzle_hash"` ExtensionData Bytes32 `json:"extension_data"` }
FoliageBlockData FoliageBlockData
type FoliageTransactionBlock ¶
type FoliageTransactionBlock struct { PrevTransactionBlockHash Bytes32 `json:"prev_transaction_block_hash"` Timestamp uint64 `json:"timestamp"` // @TODO time.Time? FilterHash Bytes32 `json:"filter_hash"` AdditionsRoot Bytes32 `json:"additions_root"` RemovalsRoot Bytes32 `json:"removals_root"` TransactionsInfoHash Bytes32 `json:"transactions_info_hash"` }
FoliageTransactionBlock foliage transaction block
type FullBlock ¶
type FullBlock struct { FinishedSubSlots []*EndOfSubSlotBundle `json:"finished_sub_slots"` RewardChainBlock *RewardChainBlock `json:"reward_chain_block"` ChallengeChainSPProof *VDFProof `json:"challenge_chain_sp_proof"` ChallengeChainIPProof *VDFProof `json:"challenge_chain_ip_proof"` RewardChainSPProof *VDFProof `json:"reward_chain_sp_proof"` RewardChainIPProof *VDFProof `json:"reward_chain_ip_proof"` InfusedChallengeChainIPProof *VDFProof `json:"infused_challenge_chain_ip_proof"` Foliage *Foliage `json:"foliage"` FoliageTransactionBlock *FoliageTransactionBlock `json:"foliage_transaction_block"` TransactionsInfo *TransactionsInfo `json:"transactions_info"` TransactionsGenerator *SerializedProgram `json:"transactions_generator"` // @TODO Verify this is correct TransactionsGeneratorRefList []uint32 `json:"transactions_generator_ref_list"` // @TODO Verify this is correct }
FullBlock a full block
type G1Element ¶
type G1Element PublicKeyMPL
G1Element is a public key
func (G1Element) MarshalJSON ¶ added in v0.1.0
MarshalJSON custom hex marshaller
func (*G1Element) UnmarshalJSON ¶ added in v0.1.0
UnmarshalJSON custom hex unmarshaller
type G2Element ¶
type G2Element SignatureMPL
G2Element is a signature
func (G2Element) MarshalJSON ¶ added in v0.1.0
MarshalJSON custom hex marshaller
func (*G2Element) UnmarshalJSON ¶ added in v0.1.0
UnmarshalJSON custom hex unmarshaller
type IPAddress ¶ added in v0.0.11
IPAddress wraps net.IP so we can fix unmarshalling issues due to invalid [] wrapping ipv6 addresses in Chia RPC
func (*IPAddress) UnmarshalJSON ¶ added in v0.0.11
UnmarshalJSON Unmarshals IP
type MempoolInclusionStatus ¶
type MempoolInclusionStatus uint8
MempoolInclusionStatus status of being included in the mempool
const ( // MempoolInclusionStatusSuccess Successfully added to mempool MempoolInclusionStatusSuccess MempoolInclusionStatus = 1 // MempoolInclusionStatusPending Pending being added to the mempool MempoolInclusionStatusPending MempoolInclusionStatus = 2 // MempoolInclusionStatusFailed Failed being added to the mempool MempoolInclusionStatusFailed MempoolInclusionStatus = 3 )
type MempoolMinFees ¶
type MempoolMinFees struct {
Cost5m float64 `json:"cost_5000000"`
}
MempoolMinFees minimum fees to get in the mempool at varying costs
type NFT ¶ added in v0.0.14
type NFT struct { ChainInfo string `json:"chain_info"` DataHash Bytes `json:"data_hash"` DataUris []string `json:"data_uris"` LauncherID Bytes32 `json:"launcher_id"` LauncherPuzhash Bytes32 `json:"launcher_puzhash"` LicenseHash Bytes `json:"license_hash"` LicenseURIs []string `json:"license_uris"` MetadataHash Bytes `json:"metadata_hash"` MetadataURIs []string `json:"metadata_uris"` MintHeight uint32 `json:"mint_height"` MinterDid *Bytes32 `json:"minter_did"` NftCoinID Bytes32 `json:"nft_coin_id"` OwnerDid *Bytes32 `json:"owner_did"` P2Address Bytes32 `json:"p2_address"` PendingTransaction bool `json:"pending_transaction"` RoyaltyPercentage uint32 `json:"royalty_percentage"` RoyaltyPuzzleHash *Bytes32 `json:"royalty_puzzle_hash"` EditionNumber uint32 `json:"edition_number"` EditionCount uint32 `json:"edition_count"` SupportsDid bool `json:"supports_did"` UpdaterPuzhash Bytes32 `json:"updater_puzhash"` }
NFT is an NFT
type NewCompactProofEvent ¶
type NewCompactProofEvent struct { Success bool `json:"success"` HeaderHash Bytes32 `json:"header_hash"` Height uint32 `json:"height"` FieldVdf CompressibleVDFField `json:"field_vdf"` }
NewCompactProofEvent is an event from the timelord every time a new compact proof is generated
type NewPeakEvent ¶
NewPeakEvent data that is sent when a timelord skips a peak because it was fastest/already had the peak
type NewSignagePoint ¶
type NewSignagePoint struct { ChallengeHash Bytes32 `json:"challenge_hash"` ChallengeChainHash Bytes32 `json:"challenge_chain_hash"` RewardChainSP Bytes32 `json:"reward_chain_sp"` Difficulty uint64 `json:"difficulty"` SubSlotIters uint64 `json:"sub_slot_iters"` SignagePointIndex uint8 `json:"signage_point_index"` }
NewSignagePoint is the event broadcast to farmers for a new signage point
type NodeType ¶
type NodeType uint8
NodeType is the type of peer (farmer, full node, etc)
const ( // NodeTypeFullNode NodeType for full node NodeTypeFullNode NodeType = 1 // NodeTypeHarvester NodeType for Harvester NodeTypeHarvester NodeType = 2 // NodeTypeFarmer NodeType for Farmer NodeTypeFarmer NodeType = 3 // NodeTypeTimelord NodeType for Timelord NodeTypeTimelord NodeType = 4 // NodeTypeIntroducer NodeType for Introducer NodeTypeIntroducer NodeType = 5 // NodeTypeWallet NodeType for Wallet NodeTypeWallet NodeType = 6 )
type PlotInfo ¶ added in v0.0.6
type PlotInfo struct { FileSize uint64 `json:"file_size"` Filename string `json:"filename"` PlotID Bytes32 `json:"plot_id"` PlotPublicKey G1Element `json:"plot_public_key"` PoolContractPuzzleHash *Bytes32 `json:"pool_contract_puzzle_hash"` PoolPublicKey *G1Element `json:"pool_public_key"` Size uint8 `json:"size"` TimeModified int `json:"time_modified"` }
PlotInfo contains information about a plot, as used in get_plots rpc
type PoolTarget ¶
type PoolTarget struct { PuzzleHash *Bytes32 `json:"puzzle_hash"` MaxHeight uint32 `json:"max_height"` }
PoolTarget PoolTarget
type ProofOfSpace ¶
type ProofOfSpace struct { Challenge Bytes32 `json:"challenge"` PoolPublicKey *G1Element `json:"pool_public_key"` // Only one of these two should be present PoolContractPuzzleHash *Bytes32 `json:"pool_contract_puzzle_hash"` PlotPublicKey *G1Element `json:"plot_public_key"` Size uint8 `json:"size"` Proof Bytes `json:"proof"` }
ProofOfSpace Proof of Space
type ReceiveBlockResult ¶
type ReceiveBlockResult uint8
ReceiveBlockResult When Blockchain.receive_block(b) is called, one of these results is returned, showing whether the block was added to the chain (extending the peak), and if not, why it was not added. These values match values in chia blockchain. Must not be arbitrarily changed
const ( // ReceiveBlockResultNewPeak Added to the peak of the blockchain ReceiveBlockResultNewPeak ReceiveBlockResult = 1 // ReceiveBlockResultOrphan Added as an orphan/stale block (not a new peak of the chain) ReceiveBlockResultOrphan ReceiveBlockResult = 2 // ReceiveBlockResultInvalidBlock Block was not added because it was invalid ReceiveBlockResultInvalidBlock ReceiveBlockResult = 3 // ReceiveBlockResultAlreadyHaveBlock Block is already present in this blockchain ReceiveBlockResultAlreadyHaveBlock ReceiveBlockResult = 4 // ReceiveBlockResultDisconnectedBlock Block's parent (previous pointer) is not in this blockchain ReceiveBlockResultDisconnectedBlock ReceiveBlockResult = 5 )
type RewardChainBlock ¶
type RewardChainBlock struct { Weight Uint128 `json:"weight"` Height uint32 `json:"height"` TotalIters Uint128 `json:"total_iters"` SignagePointIndex uint8 `json:"signage_point_index"` POSSSCCChallengeHash Bytes32 `json:"pos_ss_cc_challenge_hash"` ProofOfSpace *ProofOfSpace `json:"proof_of_space"` ChallengeChainSPVDF *VDFInfo `json:"challenge_chain_sp_vdf"` ChallengeChainSPSignature *G2Element `json:"challenge_chain_sp_signature"` ChallengeChainIPVDF *VDFInfo `json:"challenge_chain_ip_vdf"` RewardChainSPVDF *VDFInfo `json:"reward_chain_sp_vdf"` // Not present for first sp in slot RewardChainSPSignature *G2Element `json:"reward_chain_sp_signature"` RewardChainIPVDF *VDFInfo `json:"reward_chain_ip_vdf"` InfusedChallengeChainIPVDF *VDFInfo `json:"infused_challenge_chain_ip_vdf"` // Iff deficit < 16 IsTransactionBlock bool `json:"is_transaction_block"` }
RewardChainBlock Reward Chain Block
type SentTo ¶
type SentTo struct { Peer string MempoolInclusionStatus *MempoolInclusionStatus Error *string }
SentTo Represents the list of peers that we sent the transaction to, whether each one included it in the mempool, and what the error message (if any) was sent_to: List[Tuple[str, uint8, Optional[str]]]
func (*SentTo) UnmarshalJSON ¶
UnmarshalJSON unmarshals the SentTo tuple into the struct
type SerializedProgram ¶
type SerializedProgram Bytes
SerializedProgram An opaque representation of a clvm program. It has a more limited interface than a full SExp
func (SerializedProgram) MarshalJSON ¶ added in v0.1.0
func (g SerializedProgram) MarshalJSON() ([]byte, error)
MarshalJSON custom hex marshaller
func (*SerializedProgram) UnmarshalJSON ¶ added in v0.1.0
func (g *SerializedProgram) UnmarshalJSON(data []byte) error
UnmarshalJSON custom hex unmarshaller
type SignagePointEvent ¶
type SignagePointEvent struct { Success bool `json:"success"` BroadcastFarmer NewSignagePoint `json:"broadcast_farmer"` }
SignagePointEvent is the data received for each signage point
type SkippingPeakEvent ¶
SkippingPeakEvent data that is sent when a timelord skips a peak because it was fastest/already had the peak
type SpendBundle ¶
type SpendBundle struct { CoinSpends []*CoinSpend `json:"coin_spends"` AggregatedSignature G2Element `json:"aggregated_signature"` }
SpendBundle Spend Bundle...
type SubEpochSummary ¶
type SubEpochSummary struct { PrevSubEpochSummaryHash Bytes32 `json:"prev_subepoch_summary_hash"` RewardChainHash Bytes32 `json:"reward_chain_hash"` NumBlocksOverflow uint8 `json:"num_blocks_overflow"` NewDifficulty uint64 `json:"new_difficulty"` NewSubSlotIters uint64 `json:"new_sub_slot_iters"` }
SubEpochSummary sub epoch summary
type Sync ¶
type Sync struct { SyncMode bool `json:"sync_mode"` SyncProgressHeight uint32 `json:"sync_progress_height"` SyncTipHeight uint32 `json:"sync_tip_height"` Synced bool `json:"synced"` }
Sync struct within blockchain state
type TimelordChain ¶
type TimelordChain uint8
TimelordChain references a particular chain within timelord code
const ( // TimelordChainChallenge Challenge Chain TimelordChainChallenge TimelordChain = 1 // TimelordChainReward Reward Chain TimelordChainReward TimelordChain = 2 // TimelordChainInfusedChallenge Infused Challenge Chain TimelordChainInfusedChallenge TimelordChain = 3 // TimelordChainBluebox Bluebox Chain TimelordChainBluebox TimelordChain = 4 )
type TransactionRecord ¶
type TransactionRecord struct { ConfirmedAtHeight uint32 `json:"confirmed_at_height"` CreatedAtTime uint64 `json:"created_at_time"` // @TODO time.Time? ToPuzzleHash *Bytes32 `json:"to_puzzle_hash"` Amount uint64 `json:"amount"` FeeAmount uint64 `json:"fee_amount"` Confirmed bool `json:"confirmed"` Sent uint32 `json:"sent"` SpendBundle *SpendBundle `json:"spend_bundle"` Additions []*Coin `json:"additions"` Removals []*Coin `json:"removals"` WalletID uint32 `json:"wallet_id"` SentTo []*SentTo `json:"sent_to"` TradeID *Bytes32 `json:"trade_id"` Type *TransactionType `json:"type"` Name Bytes32 `json:"name"` // ToAddress is not on the official type, but some endpoints return it anyways ToAddress string `json:"to_address"` }
TransactionRecord Single Transaction
type TransactionType ¶
type TransactionType uint32
TransactionType type of transaction
const ( // TransactionTypeIncomingTX incoming transaction TransactionTypeIncomingTX TransactionType = 0 // TransactionTypeOutgoingTX outgoing transaction TransactionTypeOutgoingTX TransactionType = 1 // TransactionTypeCoinbaseReward coinbase reward TransactionTypeCoinbaseReward TransactionType = 2 // TransactionTypeFeeReward fee reward TransactionTypeFeeReward TransactionType = 3 // TransactionTypeIncomingTrade incoming trade TransactionTypeIncomingTrade TransactionType = 4 // TransactionTypeOutgoingTrade outgoing trade TransactionTypeOutgoingTrade TransactionType = 5 )
type TransactionsInfo ¶
type TransactionsInfo struct { GeneratorRoot Bytes32 `json:"generator_root"` GeneratorRefsRoot Bytes32 `json:"generator_refs_root"` AggregatedSignature *G2Element `json:"aggregated_signature"` Fees uint64 `json:"fees"` Cost uint64 `json:"cost"` RewardClaimsIncorporated []*Coin `json:"reward_claims_incorporated"` }
TransactionsInfo transactions info
type Uint128 ¶
type Uint128 struct {
Lo, Hi uint64
}
A Uint128 is an unsigned 128-bit number.
var Uint128Zero Uint128
Uint128Zero is a zero-valued uint128.
func NewUint128 ¶
NewUint128 returns the Uint128 value (lo,hi).
func Uint128From64 ¶
Uint128From64 converts v to a Uint128 value.
func Uint128FromBig ¶
Uint128FromBig converts i to a Uint128 value. It panics if i is negative or overflows 128 bits.
func Uint128FromBytes ¶
Uint128FromBytes converts b to a Uint128 value.
func (Uint128) AddWrap ¶
AddWrap returns u+v with wraparound semantics; for example, Max.AddWrap(From64(1)) == Zero.
func (Uint128) AddWrap64 ¶
AddWrap64 returns u+v with wraparound semantics; for example, Max.AddWrap64(1) == Zero.
func (Uint128) Equals ¶
Equals returns true if u == v.
Uint128 values can be compared directly with ==, but use of the Equals method is preferred for consistency.
func (*Uint128) FitsInUint64 ¶
FitsInUint64 returns true if the value of the Uint128 will fit in Uint64
func (Uint128) LeadingZeros ¶
LeadingZeros returns the number of leading zero bits in u; the result is 128 for u == 0.
func (Uint128) Len ¶
Len returns the minimum number of bits required to represent u; the result is 0 for u == 0.
func (*Uint128) MarshalJSON ¶
MarshalJSON marshals the uint128 value to json
func (Uint128) MulWrap ¶
MulWrap returns u*v with wraparound semantics; for example, Max.MulWrap(Max) == 1.
func (Uint128) MulWrap64 ¶
MulWrap64 returns u*v with wraparound semantics; for example, Max.MulWrap64(2) == Max.Sub64(1).
func (Uint128) ReverseBytes ¶
ReverseBytes returns the value of u with its bytes in reversed order.
func (Uint128) RotateLeft ¶
RotateLeft returns the value of u rotated left by (k mod 128) bits.
func (Uint128) RotateRight ¶
RotateRight returns the value of u rotated left by (k mod 128) bits.
func (Uint128) SubWrap ¶
SubWrap returns u-v with wraparound semantics; for example, Zero.SubWrap(From64(1)) == Max.
func (Uint128) SubWrap64 ¶
SubWrap64 returns u-v with wraparound semantics; for example, Zero.SubWrap64(1) == Max.
func (Uint128) TrailingZeros ¶
TrailingZeros returns the number of trailing zero bits in u; the result is 128 for u == 0.
func (*Uint128) Uint64 ¶
Uint64 returns the Uint64 value of the Int Be careful with this - if the number is larger than Uint64, it will just return nonsense
func (*Uint128) UnmarshalJSON ¶
UnmarshalJSON Uint128 from json
type VDFInfo ¶
type VDFInfo struct { Challenge Bytes32 `json:"challenge"` NumberOfIterations uint64 `json:"number_of_iterations"` Output *ClassgroupElement `json:"output"` }
VDFInfo VDF Info
type VDFProof ¶
type VDFProof struct { WitnessType uint8 `json:"witness_type"` Witness Bytes `json:"witness"` NormalizedToIdentity bool `json:"normalized_to_identity"` }
VDFProof VDF Proof
type WalletBalance ¶
type WalletBalance struct { WalletID int32 `json:"wallet_id"` Fingerprint int `json:"fingerprint"` ConfirmedWalletBalance Uint128 `json:"confirmed_wallet_balance"` UnconfirmedWalletBalance Uint128 `json:"unconfirmed_wallet_balance"` SpendableBalance Uint128 `json:"spendable_balance"` PendingChange int64 `json:"pending_change"` MaxSendAmount int64 `json:"max_send_amount"` UnspentCoinCount int64 `json:"unspent_coin_count"` PendingCoinRemovalCount int64 `json:"pending_coin_removal_count"` WalletType *WalletType `json:"wallet_type"` AssetID string `json:"asset_id"` }
WalletBalance specific wallet balance information
type WalletInfo ¶
type WalletInfo struct { ID uint32 `json:"id"` Name string `json:"name"` Type *WalletType `json:"type"` Data string `json:"data"` }
WalletInfo single wallet record
type WalletType ¶
type WalletType uint8
WalletType types of wallets This matches constants on the chia-blockchain end as well. Don't change to arbitrary values.
type WebsocketBlockchainState ¶
type WebsocketBlockchainState struct {
BlockchainState BlockchainState `json:"blockchain_state"`
}
WebsocketBlockchainState is how blockchain_state comes across in the websockets (wrapped)
type WebsocketRequest ¶
type WebsocketRequest struct { Command string `json:"command"` Ack bool `json:"ack"` Origin string `json:"origin"` Destination string `json:"destination"` RequestID string `json:"request_id"` Data interface{} `json:"data"` }
WebsocketRequest defines a request sent over the websocket connection
type WebsocketResponse ¶
type WebsocketResponse struct { Command string `json:"command"` Ack bool `json:"ack"` Origin string `json:"origin"` Destination string `json:"destination"` RequestID string `json:"request_id"` Data json.RawMessage `json:"data"` }
WebsocketResponse defines the response structure received over the websocket connection
type WebsocketSubscription ¶
type WebsocketSubscription struct {
Service string `json:"service"`
}
WebsocketSubscription is the Data for a new subscribe request
Source Files
¶
- block.go
- bytes.go
- bytes100.go
- bytes32.go
- bytes48.go
- bytes96.go
- coin.go
- coinrecord.go
- connections.go
- crawler.go
- farmer.go
- foliage.go
- harvester.go
- nft.go
- pooltarget.go
- proofofspace.go
- signagepoint.go
- spend.go
- state.go
- subepochsummary.go
- timelord.go
- transaction.go
- types.go
- uint128.go
- vdf.go
- wallet.go
- websocket.go