request

package
v0.37.22-verify-backwa... Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: AGPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const EmptyHeight uint64 = math.MaxUint64 - 3
View Source
const ExpandsTransactions = "transactions"
View Source
const FinalHeight uint64 = math.MaxUint64 - 2
View Source
const MaxBlockRequestHeightRange = 50
View Source
const MaxEventRequestHeightRange = 250
View Source
const MaxIDsLength = 50
View Source
const SealedHeight uint64 = math.MaxUint64 - 1

Special height values

Variables

This section is empty.

Functions

func ParseAddress added in v0.30.0

func ParseAddress(raw string, chain flow.Chain) (flow.Address, error)

Types

type Arguments

type Arguments [][]byte

func (Arguments) Flow

func (a Arguments) Flow() [][]byte

func (*Arguments) Parse

func (a *Arguments) Parse(raw []string) error

type CreateTransaction

type CreateTransaction struct {
	Transaction flow.TransactionBody
}

func (*CreateTransaction) Build

func (c *CreateTransaction) Build(r *Request) error

func (*CreateTransaction) Parse

func (c *CreateTransaction) Parse(rawTransaction io.Reader, chain flow.Chain) error

type EventType added in v0.32.0

type EventType string

func (EventType) Flow added in v0.32.0

func (e EventType) Flow() string

func (*EventType) Parse added in v0.32.0

func (e *EventType) Parse(raw string) error

type EventTypes added in v0.32.0

type EventTypes []EventType

func (EventTypes) Flow added in v0.32.0

func (e EventTypes) Flow() []string

func (*EventTypes) Parse added in v0.32.0

func (e *EventTypes) Parse(raw []string) error

type GetAccount

type GetAccount struct {
	Address flow.Address
	Height  uint64
}

func (*GetAccount) Build

func (g *GetAccount) Build(r *Request) error

func (*GetAccount) Parse

func (g *GetAccount) Parse(rawAddress string, rawHeight string, chain flow.Chain) error

type GetAccountBalance added in v0.37.1

type GetAccountBalance struct {
	Address flow.Address
	Height  uint64
}

func (*GetAccountBalance) Build added in v0.37.1

func (g *GetAccountBalance) Build(r *Request) error

func (*GetAccountBalance) Parse added in v0.37.1

func (g *GetAccountBalance) Parse(
	rawAddress string,
	rawHeight string,
	chain flow.Chain,
) error

type GetAccountKey added in v0.32.0

type GetAccountKey struct {
	Address flow.Address
	Index   uint32
	Height  uint64
}

func (*GetAccountKey) Build added in v0.32.0

func (g *GetAccountKey) Build(r *Request) error

func (*GetAccountKey) Parse added in v0.32.0

func (g *GetAccountKey) Parse(
	rawAddress string,
	rawIndex string,
	rawHeight string,
	chain flow.Chain,
) error

type GetAccountKeys added in v0.37.1

type GetAccountKeys struct {
	Address flow.Address
	Height  uint64
}

func (*GetAccountKeys) Build added in v0.37.1

func (g *GetAccountKeys) Build(r *Request) error

func (*GetAccountKeys) Parse added in v0.37.1

func (g *GetAccountKeys) Parse(
	rawAddress string,
	rawHeight string,
	chain flow.Chain,
) error

type GetBlock

type GetBlock struct {
	Heights      []uint64
	StartHeight  uint64
	EndHeight    uint64
	FinalHeight  bool
	SealedHeight bool
}

func (*GetBlock) Build

func (g *GetBlock) Build(r *Request) error

func (*GetBlock) HasHeights

func (g *GetBlock) HasHeights() bool

func (*GetBlock) Parse

func (g *GetBlock) Parse(rawHeights []string, rawStart string, rawEnd string) error

type GetBlockByIDs

type GetBlockByIDs struct {
	IDs []flow.Identifier
}

func (*GetBlockByIDs) Build

func (g *GetBlockByIDs) Build(r *Request) error

func (*GetBlockByIDs) Parse

func (g *GetBlockByIDs) Parse(rawIds []string) error

type GetBlockPayload

type GetBlockPayload struct {
	GetByIDRequest
}

type GetByIDRequest

type GetByIDRequest struct {
	ID flow.Identifier
}

func (*GetByIDRequest) Build

func (g *GetByIDRequest) Build(r *Request) error

func (*GetByIDRequest) Parse

func (g *GetByIDRequest) Parse(rawID string) error

type GetCollection

type GetCollection struct {
	GetByIDRequest
	ExpandsTransactions bool
}

func (*GetCollection) Build

func (g *GetCollection) Build(r *Request) error

type GetEvents

type GetEvents struct {
	StartHeight uint64
	EndHeight   uint64
	Type        string
	BlockIDs    []flow.Identifier
}

func (*GetEvents) Build

func (g *GetEvents) Build(r *Request) error

func (*GetEvents) Parse

func (g *GetEvents) Parse(rawType string, rawStart string, rawEnd string, rawBlockIDs []string) error

type GetExecutionResult

type GetExecutionResult struct {
	GetByIDRequest
}

type GetExecutionResultByBlockIDs

type GetExecutionResultByBlockIDs struct {
	BlockIDs []flow.Identifier
}

func (*GetExecutionResultByBlockIDs) Build

func (*GetExecutionResultByBlockIDs) Parse

func (g *GetExecutionResultByBlockIDs) Parse(rawIDs []string) error

type GetScript

type GetScript struct {
	BlockID     flow.Identifier
	BlockHeight uint64
	Script      Script
}

func (*GetScript) Build

func (g *GetScript) Build(r *Request) error

func (*GetScript) Parse

func (g *GetScript) Parse(rawHeight string, rawID string, rawScript io.Reader) error

type GetTransaction

type GetTransaction struct {
	GetByIDRequest
	TransactionOptionals
	ExpandsResult bool
}

func (*GetTransaction) Build

func (g *GetTransaction) Build(r *Request) error

type GetTransactionResult

type GetTransactionResult struct {
	GetByIDRequest
	TransactionOptionals
}

func (*GetTransactionResult) Build added in v0.31.0

func (g *GetTransactionResult) Build(r *Request) error

type Height

type Height uint64

func (Height) Flow

func (h Height) Flow() uint64

func (*Height) Parse

func (h *Height) Parse(raw string) error

type Heights

type Heights []Height

func (Heights) Flow

func (h Heights) Flow() []uint64

func (*Heights) Parse

func (h *Heights) Parse(raw []string) error

type ID

type ID flow.Identifier

func (ID) Flow

func (i ID) Flow() flow.Identifier

func (*ID) Parse

func (i *ID) Parse(raw string) error

type IDs

type IDs []ID

func (IDs) Flow

func (i IDs) Flow() []flow.Identifier

func (*IDs) Parse

func (i *IDs) Parse(raw []string) error

type ProposalKey

type ProposalKey flow.ProposalKey

func (ProposalKey) Flow

func (p ProposalKey) Flow() flow.ProposalKey

func (*ProposalKey) Parse

func (p *ProposalKey) Parse(raw models.ProposalKey, chain flow.Chain) error

type Request

type Request struct {
	*http.Request
	ExpandFields map[string]bool

	Chain flow.Chain
	// contains filtered or unexported fields
}

Request a convenience wrapper around the http request to make it easy to read request query params

func Decorate

func Decorate(r *http.Request, chain flow.Chain) *Request

Decorate takes http request and applies functions to produce our custom request object decorated with values we need

func (*Request) CreateTransactionRequest

func (rd *Request) CreateTransactionRequest() (CreateTransaction, error)

func (*Request) Expands

func (rd *Request) Expands(field string) bool

func (*Request) GetAccountBalanceRequest added in v0.37.1

func (rd *Request) GetAccountBalanceRequest() (GetAccountBalance, error)

func (*Request) GetAccountKeyRequest added in v0.32.0

func (rd *Request) GetAccountKeyRequest() (GetAccountKey, error)

func (*Request) GetAccountKeysRequest added in v0.37.1

func (rd *Request) GetAccountKeysRequest() (GetAccountKeys, error)

func (*Request) GetAccountRequest

func (rd *Request) GetAccountRequest() (GetAccount, error)

func (*Request) GetBlockByIDsRequest

func (rd *Request) GetBlockByIDsRequest() (GetBlockByIDs, error)

func (*Request) GetBlockPayloadRequest

func (rd *Request) GetBlockPayloadRequest() (GetBlockPayload, error)

func (*Request) GetBlockRequest

func (rd *Request) GetBlockRequest() (GetBlock, error)

func (*Request) GetCollectionRequest

func (rd *Request) GetCollectionRequest() (GetCollection, error)

func (*Request) GetEventsRequest

func (rd *Request) GetEventsRequest() (GetEvents, error)

func (*Request) GetExecutionResultByBlockIDsRequest

func (rd *Request) GetExecutionResultByBlockIDsRequest() (GetExecutionResultByBlockIDs, error)

func (*Request) GetExecutionResultRequest

func (rd *Request) GetExecutionResultRequest() (GetExecutionResult, error)

func (*Request) GetQueryParam

func (rd *Request) GetQueryParam(name string) string

func (*Request) GetQueryParams

func (rd *Request) GetQueryParams(name string) []string

func (*Request) GetScriptRequest

func (rd *Request) GetScriptRequest() (GetScript, error)

func (*Request) GetTransactionRequest

func (rd *Request) GetTransactionRequest() (GetTransaction, error)

func (*Request) GetTransactionResultRequest

func (rd *Request) GetTransactionResultRequest() (GetTransactionResult, error)

func (*Request) GetVar

func (rd *Request) GetVar(name string) string

func (*Request) GetVars

func (rd *Request) GetVars(name string) []string

func (*Request) Selects

func (rd *Request) Selects() []string

func (*Request) SubscribeEventsRequest added in v0.32.0

func (rd *Request) SubscribeEventsRequest() (SubscribeEvents, error)

type Script

type Script struct {
	Args   Arguments
	Source []byte
}

func (*Script) Parse

func (s *Script) Parse(raw io.Reader) error

type Signature

type Signature []byte

func (Signature) Flow

func (s Signature) Flow() []byte

func (*Signature) Parse

func (s *Signature) Parse(raw string) error

type SubscribeEvents added in v0.32.0

type SubscribeEvents struct {
	StartBlockID flow.Identifier
	StartHeight  uint64

	EventTypes []string
	Addresses  []string
	Contracts  []string

	HeartbeatInterval uint64
}

func (*SubscribeEvents) Build added in v0.32.0

func (g *SubscribeEvents) Build(r *Request) error

func (*SubscribeEvents) Parse added in v0.32.0

func (g *SubscribeEvents) Parse(
	rawStartBlockID string,
	rawStartHeight string,
	rawTypes []string,
	rawAddresses []string,
	rawContracts []string,
	rawHeartbeatInterval string,
) error

type Transaction

type Transaction flow.TransactionBody

func (Transaction) Flow

func (t Transaction) Flow() flow.TransactionBody

func (*Transaction) Parse

func (t *Transaction) Parse(raw io.Reader, chain flow.Chain) error

type TransactionOptionals added in v0.31.0

type TransactionOptionals struct {
	BlockID      flow.Identifier
	CollectionID flow.Identifier
}

func (*TransactionOptionals) Parse added in v0.31.0

func (t *TransactionOptionals) Parse(r *Request) error

type TransactionSignature

type TransactionSignature flow.TransactionSignature

func (TransactionSignature) Flow

func (*TransactionSignature) Parse

func (s *TransactionSignature) Parse(
	rawAddress string,
	rawKeyIndex string,
	rawSignature string,
	chain flow.Chain,
) error

type TransactionSignatures

type TransactionSignatures []TransactionSignature

func (TransactionSignatures) Flow

func (*TransactionSignatures) Parse

func (t *TransactionSignatures) Parse(rawSigs []models.TransactionSignature, chain flow.Chain) error

Jump to

Keyboard shortcuts

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