request

package
v0.26.17-access-fix-dy... Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 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

This section is empty.

Types

type Address

type Address flow.Address

func (Address) Flow

func (a Address) Flow() flow.Address

func (*Address) Parse

func (a *Address) Parse(raw string) error

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 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) 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
	ExpandsResult bool
}

func (*GetTransaction) Build

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

type GetTransactionResult

type GetTransactionResult struct {
	GetByIDRequest
}

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) 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) 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

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 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 TransactionSignature

type TransactionSignature flow.TransactionSignature

func (TransactionSignature) Flow

func (*TransactionSignature) Parse

func (s *TransactionSignature) Parse(
	rawAddress string,
	rawKeyIndex string,
	rawSignature string,
) error

type TransactionSignatures

type TransactionSignatures []TransactionSignature

func (TransactionSignatures) Flow

func (*TransactionSignatures) Parse

Jump to

Keyboard shortcuts

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