Documentation
¶
Index ¶
- Variables
- func EncodeArrayWith16BitLen(values ...any) ([]byte, error)
- func LoadDataFromDataFrames(firstDataFrame *DataFrame, ...) ([]byte, error)
- func VerifyHash(data []byte, hash uint64) error
- type Block
- func (n Block) GetBlockHeight() (uint64, bool)
- func (b *Block) GetBlocktime() int64
- func (b *Block) GetParentSlot() uint64
- func (n Block) GetRewards() (cid.Cid, bool)
- func (b *Block) GetSlot() uint64
- func (n Block) HasRewards() bool
- func (x *Block) MarshalCBOR() ([]byte, error)
- func (b Block) Node()
- func (b *Block) Reset()
- func (x *Block) UnmarshalCBOR(data []byte) error
- type Buffer
- type DataFrame
- func (n DataFrame) Bytes() []uint8
- func (n DataFrame) GetHash() (uint64, bool)
- func (n DataFrame) GetIndex() (int, bool)
- func (n DataFrame) GetNext() (List__Link, bool)
- func (n DataFrame) GetTotal() (int, bool)
- func (n DataFrame) HasHash() bool
- func (n DataFrame) HasIndex() bool
- func (n DataFrame) HasNext() bool
- func (n DataFrame) HasTotal() bool
- func (x *DataFrame) MarshalCBOR() ([]byte, error)
- func (n DataFrame) MarshalJSON() ([]byte, error)
- func (d DataFrame) Node()
- func (d *DataFrame) Reset()
- func (x *DataFrame) UnmarshalCBOR(data []byte) error
- func (n *DataFrame) UnmarshalJSON(data []byte) error
- type Entry
- type Epoch
- type Hash
- type List__Link
- type List__Shredding
- type Node
- type Rewards
- type Shredding
- type SlotMeta
- type Subset
- type Transaction
- func (decodedTxObj *Transaction) GetMetadata() (*solanatxmetaparsers.TransactionStatusMetaContainer, error)
- func (decodedTxObj *Transaction) GetMetadataWithFrameLoader(...) (*solanatxmetaparsers.TransactionStatusMetaContainer, error)
- func (n Transaction) GetPositionIndex() (int, bool)
- func (decoded *Transaction) GetSolanaTransaction() (*solana.Transaction, error)
- func (n Transaction) HasIndex() bool
- func (x *Transaction) MarshalCBOR() ([]byte, error)
- func (t Transaction) Node()
- func (t *Transaction) Reset()
- func (decoded *Transaction) Signature() (solana.Signature, error)
- func (decoded *Transaction) Signatures() ([]solana.Signature, error)
- func (x *Transaction) UnmarshalCBOR(data []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrPiecesNotAvailable = errors.New("transaction pieces are not available") ErrMetadataNotFound = errors.New("transaction metadata not found") )
var DisableHashVerification bool
var Prototypes schemaSlab
Functions ¶
func EncodeArrayWith16BitLen ¶ added in v0.7.1
func LoadDataFromDataFrames ¶ added in v0.7.8
func VerifyHash ¶
VerifyHash verifies that the provided data matches the provided hash. In case of DataFrames, the hash is stored in the 'Hash' field, and it is the hash of the concatenated 'Data' fields of all the DataFrames.
Types ¶
type Block ¶
type Block struct {
Kind int `json:"kind" yaml:"kind"`
Slot int `json:"slot" yaml:"slot"`
Shredding List__Shredding `json:"shredding" yaml:"shredding"`
Entries List__Link `json:"entries" yaml:"entries"`
Meta SlotMeta `json:"meta" yaml:"meta"`
Rewards datamodel.Link `json:"rewards" yaml:"rewards"`
}
func (Block) GetBlockHeight ¶
GetBlockHeight returns the 'block_height' field, which indicates the height of the block, and a flag indicating whether the field has a value.
func (*Block) GetBlocktime ¶ added in v0.7.8
func (*Block) GetParentSlot ¶ added in v0.7.8
func (*Block) MarshalCBOR ¶ added in v0.7.0
func (*Block) Reset ¶ added in v0.7.8
func (b *Block) Reset()
Reset resets the Block to an empty state.
func (*Block) UnmarshalCBOR ¶ added in v0.6.0
type Buffer ¶
type Buffer []uint8
func (*Buffer) FromString ¶
func (Buffer) MarshalJSON ¶
Buffer.MarshalJSON() returns the JSON representation of the Buffer in base64.
func (*Buffer) UnmarshalJSON ¶
Buffer.UnmarshalJSON() decodes the JSON representation of the Buffer in base64.
type DataFrame ¶
type DataFrame struct {
Kind int `json:"kind" yaml:"kind"`
Hash **int `json:"hash" yaml:"hash"`
Index **int `json:"index" yaml:"index"`
Total **int `json:"total" yaml:"total"`
Data Buffer `json:"data" yaml:"data"`
Next **List__Link `json:"next" yaml:"next"`
}
func (DataFrame) Bytes ¶
GetData returns the value of the 'Data' field and a flag indicating whether the field has a value.
func (DataFrame) GetHash ¶
GetHash returns the value of the 'Hash' field and a flag indicating whether the field has a value.
func (DataFrame) GetIndex ¶
GetIndex returns the value of the 'Index' field and a flag indicating whether the field has a value. If the field is not present, assume the index is 0.
func (DataFrame) GetNext ¶
func (n DataFrame) GetNext() (List__Link, bool)
GetNext returns the value of the 'Next' field and a flag indicating whether the field has a value.
func (DataFrame) GetTotal ¶
GetTotal returns the value of the 'Total' field and a flag indicating whether the field has a value. If the field is not present, assume the total is 1.
func (DataFrame) HasIndex ¶
HasIndex returns whether the 'Index' field is present. If the field is not present, assume the index is 0.
func (DataFrame) HasTotal ¶
HasTotal returns whether the 'Total' field is present. If the field is not present, assume the total is 1.
func (*DataFrame) MarshalCBOR ¶ added in v0.7.0
func (DataFrame) MarshalJSON ¶
DataFrame.MarshalJSON implements the json.Marshaler interface.
func (*DataFrame) Reset ¶ added in v0.7.8
func (d *DataFrame) Reset()
Reset resets the DataFrame to an empty state.
func (*DataFrame) UnmarshalCBOR ¶ added in v0.6.0
func (*DataFrame) UnmarshalJSON ¶
DataFrame.UnmarshalJSON implements the json.Unmarshaler interface.
type Entry ¶
type Entry struct {
Kind int `json:"kind" yaml:"kind"`
NumHashes int `json:"num_hashes" yaml:"num_hashes"`
Hash Hash `json:"hash" yaml:"hash"`
Transactions List__Link `json:"transactions" yaml:"transactions"`
}
func (*Entry) MarshalCBOR ¶ added in v0.7.0
func (*Entry) Reset ¶ added in v0.7.8
func (e *Entry) Reset()
Reset resets the Entry to an empty state.
func (*Entry) UnmarshalCBOR ¶ added in v0.6.0
type Epoch ¶
type Epoch struct {
Kind int `json:"kind" yaml:"kind"`
Epoch int `json:"epoch" yaml:"epoch"`
Subsets List__Link `json:"subsets" yaml:"subsets"`
}
func (*Epoch) MarshalCBOR ¶ added in v0.7.0
func (*Epoch) Reset ¶ added in v0.7.8
func (e *Epoch) Reset()
Reset resets the Epoch to an empty state.
func (*Epoch) UnmarshalCBOR ¶ added in v0.6.0
implement the BinaryUnmarshaler interface for EpochFast
type Hash ¶
type Hash []uint8
func (Hash) MarshalJSON ¶
Hash.MarshalJSON() returns the JSON representation of the Hash in hex.
func (*Hash) UnmarshalJSON ¶
Hash.UnmarshalJSON() decodes the JSON representation of the Hash in hex.
type List__Link ¶
func (*List__Link) Reset ¶ added in v0.7.8
func (l *List__Link) Reset()
Reset resets the List__Link to an empty state.
type List__Shredding ¶
type List__Shredding []Shredding
func (*List__Shredding) Reset ¶ added in v0.7.8
func (l *List__Shredding) Reset()
Reset resets the List__Shredding to an empty state.
type Rewards ¶
type Rewards struct {
Kind int `json:"kind" yaml:"kind"`
Slot int `json:"slot" yaml:"slot"`
Data DataFrame `json:"data" yaml:"data"`
}
func (*Rewards) MarshalCBOR ¶ added in v0.7.0
func (*Rewards) Reset ¶ added in v0.7.8
func (r *Rewards) Reset()
Reset resets the Rewards to an empty state.
func (*Rewards) UnmarshalCBOR ¶ added in v0.6.0
type Shredding ¶
type SlotMeta ¶
type SlotMeta struct {
Parent_slot int `json:"parent_slot" yaml:"parent_slot"`
Blocktime int `json:"blocktime" yaml:"blocktime"`
Block_height **int `json:"block_height" yaml:"block_height"`
}
func (SlotMeta) Equivalent ¶ added in v0.7.0
SlotMeta.Equivalent returns whether the two SlotMeta objects are equivalent.
func (SlotMeta) GetBlockHeight ¶ added in v0.6.0
GetBlockHeight returns the value of the 'Block_height' field and a flag indicating whether the field has a value.
func (*SlotMeta) GetBlocktime ¶ added in v0.7.8
GetBlocktime returns the blocktime of the block.
func (SlotMeta) HasBlockHeight ¶ added in v0.6.0
SlotMeta.HasBlockHeight returns whether the 'Block_height' field is present.
type Subset ¶
type Subset struct {
Kind int `json:"kind" yaml:"kind"`
First int `json:"first" yaml:"first"`
Last int `json:"last" yaml:"last"`
Blocks List__Link `json:"blocks" yaml:"blocks"`
}
func (*Subset) MarshalCBOR ¶ added in v0.7.0
func (*Subset) Reset ¶ added in v0.7.8
func (s *Subset) Reset()
Reset resets the Subset to an empty state.
func (*Subset) UnmarshalCBOR ¶ added in v0.6.0
type Transaction ¶
type Transaction struct {
Kind int `json:"kind" yaml:"kind"`
Data DataFrame `json:"data" yaml:"data"`
Metadata DataFrame `json:"metadata" yaml:"metadata"`
Slot int `json:"slot" yaml:"slot"`
Index **int `json:"index" yaml:"index"`
}
func (*Transaction) GetMetadata ¶ added in v0.7.8
func (decodedTxObj *Transaction) GetMetadata() (*solanatxmetaparsers.TransactionStatusMetaContainer, error)
GetMetadata will parse and return the metadata of the transaction. NOTE: This will return ErrPiecesNotAvailable if the metadata is split into multiple dataframes. In that case, you should use GetMetadataWithFrameLoader instead.
func (*Transaction) GetMetadataWithFrameLoader ¶ added in v0.7.8
func (decodedTxObj *Transaction) GetMetadataWithFrameLoader(dataFrameGetter func(ctx context.Context, wantedCid cid.Cid) (*DataFrame, error)) (*solanatxmetaparsers.TransactionStatusMetaContainer, error)
GetMetadataWithFrameLoader will parse and return the metadata of the transaction. It uses the provided dataFrameGetter function to load the missing dataframes.
func (Transaction) GetPositionIndex ¶
func (n Transaction) GetPositionIndex() (int, bool)
GetPositionIndex returns the 'Index' field, which indicates the index of the transaction in the block (0-based), and a flag indicating whether the field has a value.
func (*Transaction) GetSolanaTransaction ¶ added in v0.4.0
func (decoded *Transaction) GetSolanaTransaction() (*solana.Transaction, error)
func (Transaction) HasIndex ¶
func (n Transaction) HasIndex() bool
Transaction.HasIndex returns whether the 'Index' field is present.
func (*Transaction) MarshalCBOR ¶ added in v0.7.0
func (x *Transaction) MarshalCBOR() ([]byte, error)
func (Transaction) Node ¶ added in v0.7.8
func (t Transaction) Node()
func (*Transaction) Reset ¶ added in v0.7.8
func (t *Transaction) Reset()
Reset resets the Transaction to an empty state.
func (*Transaction) Signature ¶ added in v0.4.0
func (decoded *Transaction) Signature() (solana.Signature, error)
func (*Transaction) Signatures ¶ added in v0.4.0
func (decoded *Transaction) Signatures() ([]solana.Signature, error)
func (*Transaction) UnmarshalCBOR ¶ added in v0.6.0
func (x *Transaction) UnmarshalCBOR(data []byte) error