Help us shape the future of Go! Take the 2026 Go Developer Survey

models

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Access API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

Index

Constants

View Source
const (
	PENDING_RESULT = PENDING_TransactionExecution
	SUCCESS_RESULT = SUCCESS_TransactionExecution
	FAILURE_RESULT = FAILURE_TransactionExecution
)
View Source
const (
	BLOCK_UNKNOWN   = UNKNOWN_BlockStatus
	BLOCK_FINALIZED = FINALIZED_BlockStatus
	BLOCK_SEALED    = SEALED_BlockStatus
)
View Source
const ExpandableExecutionResult = "execution_result"
View Source
const ExpandableFieldPayload = "payload"
View Source
const ExpandsTransactions = "transactions"

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedSignature

type AggregatedSignature struct {
	VerifierSignatures []string `json:"verifier_signatures"`
	SignerIds          []string `json:"signer_ids"`
}

func (*AggregatedSignature) Build

func (a *AggregatedSignature) Build(signature flow.AggregatedSignature)

type AggregatedSignatures

type AggregatedSignatures []AggregatedSignature

func (*AggregatedSignatures) Build

func (a *AggregatedSignatures) Build(signatures []flow.AggregatedSignature)

type Block

type Block struct {
	Header          *BlockHeader     `json:"header"`
	Payload         *BlockPayload    `json:"payload,omitempty"`
	ExecutionResult *ExecutionResult `json:"execution_result,omitempty"`
	Expandable      *BlockExpandable `json:"_expandable,omitempty"`
	Links           *Links           `json:"_links,omitempty"`
	BlockStatus     *BlockStatus     `json:"block_status"`
}

func NewBlock added in v0.40.0

func NewBlock(
	block *flow.Block,
	execResult *flow.ExecutionResult,
	link LinkGenerator,
	blockStatus flow.BlockStatus,
	expand map[string]bool,
) (*Block, error)

func (*Block) Build

func (b *Block) Build(
	block *flow.Block,
	execResult *flow.ExecutionResult,
	link LinkGenerator,
	blockStatus flow.BlockStatus,
	expand map[string]bool,
) error

type BlockEvents

type BlockEvents struct {
	BlockId        string    `json:"block_id,omitempty"`
	BlockHeight    string    `json:"block_height,omitempty"`
	BlockTimestamp time.Time `json:"block_timestamp,omitempty"`
	Events         []Event   `json:"events,omitempty"`
	Links          *Links    `json:"_links,omitempty"`
}

func (*BlockEvents) Build

func (b *BlockEvents) Build(blockEvents flow.BlockEvents)

type BlockExpandable

type BlockExpandable struct {
	Payload         string `json:"payload,omitempty"`
	ExecutionResult string `json:"execution_result,omitempty"`
}

type BlockHeader

type BlockHeader struct {
	Id                   string    `json:"id"`
	ParentId             string    `json:"parent_id"`
	Height               string    `json:"height"`
	Timestamp            time.Time `json:"timestamp"`
	ParentVoterSignature string    `json:"parent_voter_signature"`
}

func NewBlockHeader added in v0.40.0

func NewBlockHeader(header *flow.Header) *BlockHeader

func (*BlockHeader) Build

func (b *BlockHeader) Build(header *flow.Header)

type BlockHeight

type BlockHeight struct {
}

type BlockPayload

type BlockPayload struct {
	CollectionGuarantees []CollectionGuarantee `json:"collection_guarantees"`
	BlockSeals           []BlockSeal           `json:"block_seals"`
}

func (*BlockPayload) Build

func (b *BlockPayload) Build(payload *flow.Payload) error

type BlockSeal

type BlockSeal struct {
	BlockId                      string                `json:"block_id"`
	ResultId                     string                `json:"result_id"`
	FinalState                   string                `json:"final_state"`
	AggregatedApprovalSignatures []AggregatedSignature `json:"aggregated_approval_signatures"`
}

func (*BlockSeal) Build

func (b *BlockSeal) Build(seal *flow.Seal) error

type BlockSeals

type BlockSeals []BlockSeal

func (*BlockSeals) Build

func (b *BlockSeals) Build(seals []*flow.Seal) error

type BlockStatus added in v0.39.0

type BlockStatus string

BlockStatus : This value indicates the status of a block.

const (
	UNKNOWN_BlockStatus   BlockStatus = "BLOCK_UNKNOWN"
	FINALIZED_BlockStatus BlockStatus = "BLOCK_FINALIZED"
	SEALED_BlockStatus    BlockStatus = "BLOCK_SEALED"
)

List of BlockStatus

func (*BlockStatus) Build added in v0.39.0

func (b *BlockStatus) Build(status flow.BlockStatus)

type BlocksEvents

type BlocksEvents []BlockEvents

func (*BlocksEvents) Build

func (b *BlocksEvents) Build(blocksEvents []flow.BlockEvents)

type Chunk

type Chunk struct {
	CollectionIndex      string `json:"collection_index"`
	StartState           string `json:"start_state"`
	EventCollection      string `json:"event_collection"`
	BlockId              string `json:"block_id"`
	TotalComputationUsed string `json:"total_computation_used"`
	NumberOfTransactions string `json:"number_of_transactions"`
	Index                string `json:"index"`
	EndState             string `json:"end_state"`
}

func (*Chunk) Build

func (c *Chunk) Build(chunk *flow.Chunk)

type Collection

type Collection struct {
	Id           string                `json:"id"`
	Transactions []Transaction         `json:"transactions,omitempty"`
	Expandable   *CollectionExpandable `json:"_expandable"`
	Links        *Links                `json:"_links,omitempty"`
}

func (*Collection) Build

func (c *Collection) Build(
	collection *flow.LightCollection,
	txs []*flow.TransactionBody,
	link LinkGenerator,
	expand map[string]bool) error

type CollectionExpandable

type CollectionExpandable struct {
	Transactions []string `json:"transactions,omitempty"`
}

type CollectionGuarantee

type CollectionGuarantee struct {
	CollectionId  string `json:"collection_id"`
	SignerIndices string `json:"signer_indices"`
	Signature     string `json:"signature"`
}

func (*CollectionGuarantee) Build

func (c *CollectionGuarantee) Build(guarantee *flow.CollectionGuarantee)

type CollectionGuarantees

type CollectionGuarantees []CollectionGuarantee

func (*CollectionGuarantees) Build

func (c *CollectionGuarantees) Build(guarantees []*flow.CollectionGuarantee)

type Event

type Event struct {
	Type_            string `json:"type"`
	TransactionId    string `json:"transaction_id"`
	TransactionIndex string `json:"transaction_index"`
	EventIndex       string `json:"event_index"`
	Payload          string `json:"payload"`
}

func (*Event) Build

func (e *Event) Build(event flow.Event)

type Events

type Events []Event

func (*Events) Build

func (e *Events) Build(events []flow.Event)

type ExecutionResult

type ExecutionResult struct {
	Id               string  `json:"id"`
	BlockId          string  `json:"block_id"`
	Events           []Event `json:"events"`
	Chunks           []Chunk `json:"chunks,omitempty"`
	PreviousResultId string  `json:"previous_result_id"`
	Links            *Links  `json:"_links,omitempty"`
}

func (*ExecutionResult) Build

func (e *ExecutionResult) Build(
	exeResult *flow.ExecutionResult,
	link LinkGenerator,
) error

type LinkFunc

type LinkFunc func(id flow.Identifier) (string, error)

type LinkGenerator

type LinkGenerator interface {
	BlockLink(id flow.Identifier) (string, error)
	TransactionLink(id flow.Identifier) (string, error)
	TransactionResultLink(id flow.Identifier) (string, error)
	PayloadLink(id flow.Identifier) (string, error)
	ExecutionResultLink(id flow.Identifier) (string, error)
	AccountLink(address string) (string, error)
	CollectionLink(id flow.Identifier) (string, error)
}

LinkGenerator generates the expandable value for the known endpoints e.g. "/v1/blocks/c5e935bc75163db82e4a6cf9dc3b54656709d3e21c87385138300abd479c33b7"

type LinkGeneratorImpl

type LinkGeneratorImpl struct {
	// contains filtered or unexported fields
}

func NewLinkGeneratorImpl

func NewLinkGeneratorImpl(router *mux.Router) *LinkGeneratorImpl
func (generator *LinkGeneratorImpl) AccountLink(address string) (string, error)
func (generator *LinkGeneratorImpl) BlockLink(id flow.Identifier) (string, error)
func (generator *LinkGeneratorImpl) CollectionLink(id flow.Identifier) (string, error)
func (generator *LinkGeneratorImpl) ExecutionResultLink(id flow.Identifier) (string, error)
func (generator *LinkGeneratorImpl) PayloadLink(id flow.Identifier) (string, error)
func (generator *LinkGeneratorImpl) TransactionLink(id flow.Identifier) (string, error)
func (generator *LinkGeneratorImpl) TransactionResultLink(id flow.Identifier) (string, error)
type Links struct {
	Self string `json:"_self,omitempty"`
}
func SelfLink(id flow.Identifier, linkFun LinkFunc) (*Links, error)

SelfLink generates the _link key value pair for the response e.g. "_links": { "_self": "/v1/blocks/c5e935bc75163db82e4a6cf9dc3b54656709d3e21c87385138300abd479c33b7" sx}

func (*Links) Build

func (l *Links) Build(link string, err error) error

type ModelError

type ModelError struct {
	Code    int32  `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type ProposalKey

type ProposalKey struct {
	Address        string `json:"address"`
	KeyIndex       string `json:"key_index"`
	SequenceNumber string `json:"sequence_number"`
}

func (*ProposalKey) Build

func (p *ProposalKey) Build(key flow.ProposalKey)

type Transaction

type Transaction struct {
	Id string `json:"id"`
	// Base64 encoded Cadence script.
	Script string `json:"script"`
	// Array of Base64 encoded arguments with in [JSON-Cadence interchange format](https://docs.onflow.org/cadence/json-cadence-spec/).
	Arguments        []string `json:"arguments"`
	ReferenceBlockId string   `json:"reference_block_id"`
	// The limit on the amount of computation a transaction is allowed to preform.
	GasLimit           string                 `json:"gas_limit"`
	Payer              string                 `json:"payer"`
	ProposalKey        *ProposalKey           `json:"proposal_key"`
	Authorizers        []string               `json:"authorizers"`
	PayloadSignatures  []TransactionSignature `json:"payload_signatures"`
	EnvelopeSignatures []TransactionSignature `json:"envelope_signatures"`
	Result             *TransactionResult     `json:"result,omitempty"`
	Expandable         *TransactionExpandable `json:"_expandable"`
	Links              *Links                 `json:"_links,omitempty"`
}

func (*Transaction) Build

type TransactionExecution

type TransactionExecution string

TransactionExecution : This value indicates whether the transaction execution succeded or not, this value should be checked when determining transaction success.

const (
	PENDING_TransactionExecution TransactionExecution = "Pending"
	SUCCESS_TransactionExecution TransactionExecution = "Success"
	FAILURE_TransactionExecution TransactionExecution = "Failure"
)

List of TransactionExecution

func (*TransactionExecution) Build

type TransactionExpandable

type TransactionExpandable struct {
	Result string `json:"result,omitempty"`
}

type TransactionResult

type TransactionResult struct {
	BlockId      string                `json:"block_id"`
	CollectionId string                `json:"collection_id"`
	Execution    *TransactionExecution `json:"execution,omitempty"`
	Status       *TransactionStatus    `json:"status"`
	StatusCode   int32                 `json:"status_code"`
	// Provided transaction error in case the transaction wasn't successful.
	ErrorMessage    string  `json:"error_message"`
	ComputationUsed string  `json:"computation_used"`
	Events          []Event `json:"events"`
	Links           *Links  `json:"_links,omitempty"`
}

func (*TransactionResult) Build

type TransactionSignature

type TransactionSignature struct {
	Address   string `json:"address"`
	KeyIndex  string `json:"key_index"`
	Signature string `json:"signature"`
}

func (*TransactionSignature) Build

type TransactionSignatures

type TransactionSignatures []TransactionSignature

func (*TransactionSignatures) Build

func (t *TransactionSignatures) Build(signatures []flow.TransactionSignature)

type TransactionStatus

type TransactionStatus string

TransactionStatus : This value indicates the state of the transaction execution. Only sealed and expired are final and immutable states.

const (
	PENDING_TransactionStatus   TransactionStatus = "Pending"
	FINALIZED_TransactionStatus TransactionStatus = "Finalized"
	EXECUTED_TransactionStatus  TransactionStatus = "Executed"
	SEALED_TransactionStatus    TransactionStatus = "Sealed"
	EXPIRED_TransactionStatus   TransactionStatus = "Expired"
)

List of TransactionStatus

func (*TransactionStatus) Build

func (t *TransactionStatus) Build(status flow.TransactionStatus)

type Transactions

type Transactions []Transaction

func (*Transactions) Build

func (t *Transactions) Build(transactions []*flow.TransactionBody, link LinkGenerator)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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