model

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBase58

func DecodeBase58(text string) ([]byte, error)

func DecodeBase58Check

func DecodeBase58Check(text string) ([]byte, error)

func EncodeBase58

func EncodeBase58(data []byte) string

func EncodeBase58Check

func EncodeBase58Check(data []byte) string

Types

type BalanceUpdate

type BalanceUpdate interface {
	BalanceUpdateKind() string
}

type BalanceUpdates

type BalanceUpdates []BalanceUpdate

func (*BalanceUpdates) UnmarshalJSON

func (u *BalanceUpdates) UnmarshalJSON(text []byte) error

type Base58

type Base58 []byte

func (Base58) MarshalText

func (val Base58) MarshalText() ([]byte, error)

func (Base58) String

func (b Base58) String() string

func (*Base58) UnmarshalText

func (val *Base58) UnmarshalText(text []byte) (err error)

type BigInt

type BigInt struct {
	big.Int
}

func (*BigInt) MarshalJSON

func (b *BigInt) MarshalJSON() ([]byte, error)

func (*BigInt) UnmarshalJSON

func (b *BigInt) UnmarshalJSON(text []byte) error

type Block

type Block struct {
	Protocol   Base58          `json:"protocol"`
	ChainID    Base58          `json:"chain_id"`
	Hash       Base58          `json:"hash"`
	Header     RawBlockHeader  `json:"header"`
	Metadata   json.RawMessage `json:"metadata,omitempty"`
	Operations BlockOperations `json:"operations"`
}

func (*Block) GetHeader

func (b *Block) GetHeader() *BlockHeader

func (*Block) Stat

func (b *Block) Stat() *BlockStatistics

type BlockHeader

type BlockHeader struct {
	Protocol Base58 `json:"protocol"`
	ChainID  Base58 `json:"chain_id"`
	Hash     Base58 `json:"hash"`
	RawBlockHeader
}

type BlockInfo

type BlockInfo struct {
	Header       *BlockHeader     `json:"header"`
	Stat         *BlockStatistics `json:"statistics"`
	MinValidTime time.Time        `json:"minimal_valid_time"`
}

type BlockOperation

type BlockOperation struct {
	Protocol  Base58                 `json:"protocol"`
	ChainID   Base58                 `json:"chain_id"`
	Hash      Base58                 `json:"hash"`
	Branch    Base58                 `json:"branch"`
	Contents  BlockOperationContents `json:"contents"`
	Signature Base58                 `json:"signature,omitempty"`
}

type BlockOperationContents

type BlockOperationContents []Operation

func (*BlockOperationContents) UnmarshalJSON

func (ops *BlockOperationContents) UnmarshalJSON(text []byte) error

type BlockOperations

type BlockOperations [][]*BlockOperation

type BlockStatistics

type BlockStatistics struct {
	NumOps uint64  `json:"n_ops_total"`
	Ops    *NumOps `json:"n_ops"`
	Slots  uint64  `json:"endorsement_slots"`
}

type Bytes

type Bytes []byte

func (Bytes) MarshalText

func (val Bytes) MarshalText() ([]byte, error)

func (*Bytes) UnmarshalText

func (val *Bytes) UnmarshalText(text []byte) (err error)

type ContractBalanceUpdate

type ContractBalanceUpdate struct {
	Kind     string `json:"kind"`
	Contract Base58 `json:"contract"`
	Change   Int64  `json:"change"`
	Origin   string `json:"origin"`
}

func (*ContractBalanceUpdate) BalanceUpdateKind

func (*ContractBalanceUpdate) BalanceUpdateKind() string

type Endorsement

type Endorsement struct {
	Kind     string               `json:"kind"`
	Level    int64                `json:"level"`
	Metadata *EndorsementMetadata `json:"metadata,omitempty"`
}

func (*Endorsement) OperationKind

func (*Endorsement) OperationKind() string

type EndorsementMetadata

type EndorsementMetadata struct {
	BalanceUpdates BalanceUpdates `json:"balance_updates"`
	Delegate       Base58         `json:"delegate"`
	Slots          []uint64       `json:"slots"`
}

type EndorsementWithSlot

type EndorsementWithSlot struct {
	Kind        string               `json:"kind"`
	Endorsement InlinedEndorsement   `json:"endorsement"`
	Slot        uint64               `json:"slot"`
	Metadata    *EndorsementMetadata `json:"metadata,omitempty"`
}

func (*EndorsementWithSlot) OperationKind

func (*EndorsementWithSlot) OperationKind() string

type InlinedEndorsement

type InlinedEndorsement struct {
	Branch     Base58                     `json:"branch"`
	Operations InlinedEndorsementContents `json:"operations"`
	Signature  Base58                     `json:"signature,omitempty"`
}

type InlinedEndorsementContents

type InlinedEndorsementContents struct {
	Kind  string `json:"kind"`
	Level int64  `json:"level"`
}

type Int64

type Int64 int64

func (Int64) MarshalBinary

func (val Int64) MarshalBinary() (data []byte, err error)

func (Int64) MarshalText

func (val Int64) MarshalText() ([]byte, error)

func (*Int64) UnmarshalBinary

func (val *Int64) UnmarshalBinary(data []byte) error

func (*Int64) UnmarshalText

func (val *Int64) UnmarshalText(text []byte) error

type NonContractBalanceUpdate

type NonContractBalanceUpdate struct {
	Kind     string `json:"kind"`
	Category string `json:"category"`
	Delegate Base58 `json:"delegate"`
	Cycle    int64  `json:"cycle"`
	Change   Int64  `json:"change"`
	Origin   string `json:"origin"`
}

func (*NonContractBalanceUpdate) BalanceUpdateKind

func (u *NonContractBalanceUpdate) BalanceUpdateKind() string

type NumOps

type NumOps struct {
	Endorsement               uint64 `json:"endorsement"`
	SeedNonceRevelation       uint64 `json:"seed_nonce_revelation"`
	DoubleEndorsementEvidence uint64 `json:"double_endorsement_evidence"`
	DoubleBakingEvidence      uint64 `json:"double_baking_evidence"`
	ActivateAccount           uint64 `json:"activate_account"`
	Proposals                 uint64 `json:"proposals"`
	Ballot                    uint64 `json:"ballot"`
	Reveal                    uint64 `json:"reveal"`
	Transaction               uint64 `json:"transaction"`
	Origination               uint64 `json:"origination"`
	Delegation                uint64 `json:"delegation"`
	FailingNoop               uint64 `json:"failing_noop"`
}

type OpaqueOperation

type OpaqueOperation map[string]interface{}

func (OpaqueOperation) OperationKind

func (o OpaqueOperation) OperationKind() string

type Operation

type Operation interface {
	OperationKind() string
}

type ProtocolConstants

type ProtocolConstants struct {
	ProofOfWorkNonceSize              uint64    `json:"proof_of_work_nonce_size"`
	NonceLength                       uint64    `json:"nonce_length"`
	MaxAnonOpsPerBlock                uint64    `json:"max_anon_ops_per_block"`
	MaxOperationDataLength            int64     `json:"max_operation_data_length"`
	MaxProposalsPerDelegate           uint64    `json:"max_proposals_per_delegate"`
	PreservedCycles                   uint64    `json:"preserved_cycles"`
	BlocksPerCycle                    int64     `json:"blocks_per_cycle"`
	BlocksPerCommitment               int64     `json:"blocks_per_commitment"`
	BlocksPerRollSnapshot             int64     `json:"blocks_per_roll_snapshot"`
	BlocksPerVotingPeriod             int64     `json:"blocks_per_voting_period"`
	TimeBetweenBlocks                 []Int64   `json:"time_between_blocks"`
	EndorsersPerBlock                 uint64    `json:"endorsers_per_block"`
	HardGasLimitPerOperation          *BigInt   `json:"hard_gas_limit_per_operation"`
	HardGasLimitPerBlock              *BigInt   `json:"hard_gas_limit_per_block"`
	ProofOfWorkThreshold              int64     `json:"proof_of_work_threshold,string"`
	TokensPerRoll                     *BigInt   `json:"tokens_per_roll"`
	MichelsonMaximumTypeSize          uint64    `json:"michelson_maximum_type_size"`
	SeedNonceRevelationTip            *BigInt   `json:"seed_nonce_revelation_tip"`
	OriginationSize                   int64     `json:"origination_size"`
	BlockSecurityDeposit              *BigInt   `json:"block_security_deposit"`
	EndorsementSecurityDeposit        *BigInt   `json:"endorsement_security_deposit"`
	BakingRewardPerEndorsement        []*BigInt `json:"baking_reward_per_endorsement"`
	EndorsementReward                 []*BigInt `json:"endorsement_reward"`
	CostPerByte                       *BigInt   `json:"cost_per_byte"`
	HardStorageLimitPerOperation      *BigInt   `json:"hard_storage_limit_per_operation"`
	QuorumMin                         int64     `json:"quorum_min"`
	QuorumMax                         int64     `json:"quorum_max"`
	MinProposalQuorum                 int64     `json:"min_proposal_quorum"`
	InitialEndorsers                  uint64    `json:"initial_endorsers"`
	DelayPerMissingEndorsement        int64     `json:"delay_per_missing_endorsement,string"`
	MinimalBlockDelay                 int64     `json:"minimal_block_delay,string"`
	LiquidityBakingSubsidy            *BigInt   `json:"liquidity_baking_subsidy"`
	LiquidityBakingSunsetLevel        int64     `json:"liquidity_baking_sunset_level"`
	LiquidityBakingEscapeEMAThreshold int64     `json:"liquidity_baking_escape_ema_threshold"`
}

type RawBlockHeader

type RawBlockHeader struct {
	Level                     int64     `json:"level"`
	Proto                     uint64    `json:"proto"`
	Predecessor               Base58    `json:"predecessor"`
	Timestamp                 time.Time `json:"timestamp"`
	ValidationPass            uint64    `json:"validation_pass"`
	OperationsHash            Base58    `json:"operations_hash"`
	Fitness                   []Bytes   `json:"fitness"`
	Context                   Base58    `json:"context"`
	Priority                  uint64    `json:"priority"`
	ProofOfWorkNonce          Bytes     `json:"proof_of_work_nonce"`
	SeedNonceHash             Base58    `json:"seed_nonce_hash,omitempty"`
	LiquidityBakingEscapeVote bool      `json:"liquidity_baking_escape_vote"`
	Signature                 Base58    `json:"signature"`
}

type ShellBlockHeader

type ShellBlockHeader struct {
	Hash           Base58    `json:"hash"`
	Level          int64     `json:"level"`
	Proto          uint64    `json:"proto"`
	Predecessor    Base58    `json:"predecessor"`
	Timestamp      time.Time `json:"timestamp"`
	ValidationPass uint64    `json:"validation_pass"`
	OperationsHash Base58    `json:"operations_hash"`
	Fitness        []Bytes   `json:"fitness"`
	Context        Base58    `json:"context"`
	ProtocolData   Bytes     `json:"protocol_data"`
}

Jump to

Keyboard shortcuts

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