client

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Overview

Package client is a very limited Tezos RPC client library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicBlockInfo

type BasicBlockInfo struct {
	Hash     *tz.BlockHash
	Protocol *tz.ProtocolHash
}

type BigUint

type BigUint = tz.BigUint

type BlockHash

type BlockHash = tz.BlockHash

type BlockHeaderInfo

type BlockHeaderInfo = protocol.BlockHeaderInfo

type BlockInfo

type BlockInfo = protocol.BlockInfo

type BlockProtocols

type BlockProtocols = core.BlockProtocols

type BlockRequest

type BlockRequest struct {
	Chain    string
	Block    string
	Metadata MetadataMode
	Protocol *tz.ProtocolHash
}

type BlockShellHeader

type BlockShellHeader = core.ShellHeader

type ChainID

type ChainID = tz.ChainID

type Client

type Client struct {
	Client      *http.Client
	URL         string
	APIKey      string
	DebugLogger Logger
}

func (*Client) BasicBlockInfo

func (client *Client) BasicBlockInfo(ctx context.Context, chain string, block string) (*BasicBlockInfo, error)

BasicBlockInfo returns hash and protocol of the block (usually head) to be used for sequent requests

func (*Client) Block

func (client *Client) Block(ctx context.Context, r *BlockRequest) (BlockInfo, error)

func (*Client) BlockHash

func (client *Client) BlockHash(ctx context.Context, r *SimpleRequest) (*BlockHash, error)

func (*Client) BlockHeader

func (client *Client) BlockHeader(ctx context.Context, r *BlockRequest) (BlockHeaderInfo, error)

func (*Client) BlockProtocols

func (client *Client) BlockProtocols(ctx context.Context, r *SimpleRequest) (*BlockProtocols, error)

func (*Client) BlockShellHeader

func (client *Client) BlockShellHeader(ctx context.Context, r *SimpleRequest) (*BlockShellHeader, error)

func (*Client) Constants

func (client *Client) Constants(ctx context.Context, r *ContextRequest) (Constants, error)

func (*Client) ContractBalance

func (client *Client) ContractBalance(ctx context.Context, r *ContractRequest) (BigUint, error)

func (*Client) ContractBalanceAndFrozenBonds

func (client *Client) ContractBalanceAndFrozenBonds(ctx context.Context, r *ContractRequest) (BigUint, error)

func (*Client) ContractCounter

func (client *Client) ContractCounter(ctx context.Context, r *ContractRequest) (BigUint, error)

func (*Client) Heads

func (client *Client) Heads(ctx context.Context, r *HeadsRequest) (<-chan *Head, <-chan error, error)

func (*Client) InjectOperation

func (client *Client) InjectOperation(ctx context.Context, r *InjectOperationRequest) (*OperationHash, error)

func (*Client) RunOperation

type Constants

type Constants = core.Constants

type ContextRequest

type ContextRequest struct {
	Chain    string
	Block    string
	Protocol *tz.ProtocolHash
}

type ContractRequest

type ContractRequest struct {
	Chain string
	Block string
	ID    core.ContractID
}

type Error

type Error struct {
	Status int
	Raw    *http.Response
	Body   []byte
}

func (*Error) Error

func (e *Error) Error() string

type Flag

type Flag bool
type Head struct {
	Hash *tz.BlockHash `json:"hash"`
	core.ShellHeader
	ProtocolData []byte `json:"protocol_data"` // not dyn, takes the rest
}

type HeadsRequest

type HeadsRequest struct {
	Chain        string
	Protocol     *tz.ProtocolHash
	NextProtocol *tz.ProtocolHash
}

type InjectOperationRequest

type InjectOperationRequest struct {
	Chain   string
	Async   Flag
	Payload *InjectRequestPayload
}

type InjectRequestPayload

type InjectRequestPayload struct {
	Contents []byte `tz:"dyn"`
}

type Logger

type Logger interface {
	Printf(format string, a ...any)
}

type MetadataMode

type MetadataMode int
const (
	MetadataDefault MetadataMode = iota
	MetadataAlways
	MetadataNever
)

func (MetadataMode) String

func (m MetadataMode) String() string

type OperationHash

type OperationHash = tz.OperationHash

type OperationWithOptionalMetadata

type OperationWithOptionalMetadata = latest.OperationWithOptionalMetadata

type RunOperationRequest

type RunOperationRequest struct {
	Chain   string
	Block   string
	Payload *latest.RunOperationRequest
}

type SimpleRequest

type SimpleRequest struct {
	Chain string
	Block string
}

Jump to

Keyboard shortcuts

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