rpc

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MUTEZ = 1000000

MUTEZ is mutez on the tezos network

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountActivation

type AccountActivation struct {
	Kind     Kind                       `json:"kind"`
	Pkh      string                     `json:"pkh"`
	Secret   string                     `json:"secret"`
	Metadata *AccountActivationMetadata `json:"metadata"`
}

AccountActivation represents an Activate_account in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*AccountActivation) ToContent

func (a *AccountActivation) ToContent() Content

ToContent converts a AccountActivation to Content

type AccountActivationMetadata

type AccountActivationMetadata struct {
	BalanceUpdates []BalanceUpdates `json:"balance_updates"`
}

AccountActivationMetadata represents the metadata for Activate_account in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type ActiveChains

type ActiveChains []struct {
	ChainID        string    `json:"chain_id"`
	TestProtocol   string    `json:"test_protocol"`
	ExpirationDate time.Time `json:"expiration_date"`
	Stopping       string    `json:"stopping"`
}

ActiveChains represents the active chains RPC.

RPC:

/monitor/active_chains (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-monitor-active-chains

type BakingRights

type BakingRights []struct {
	Level         int       `json:"level"`
	Delegate      string    `json:"delegate"`
	Priority      int       `json:"priority"`
	EstimatedTime time.Time `json:"estimated_time"`
}

BakingRights represents the baking rights RPC on the tezos network.

RPC:

../<block_id>/helpers/baking_rights (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-helpers-baking-rights

type BakingRightsInput

type BakingRightsInput struct {
	// The hash of block (height) of which you want to make the query.
	BlockHash string `validate:"required"`

	// The block level of which you want to make the query.
	Level int

	// The cycle of which you want to make the query.
	Cycle int

	// The delegate public key hash of which you want to make the query.
	Delegate string

	// The max priotity of which you want to make the query.
	MaxPriority int
}

BakingRightsInput is the input for the goTezos.BakingRights function.

Function:

func (t *GoTezos) BakingRights(input *BakingRightsInput) (*BakingRights, error) {}

type BalanceInput

type BalanceInput struct {
	// The block level of which you want to make the query. If not provided Cycle is required.
	Blockhash string
	// The cycle to get the balance at. If not provided Blockhash is required.
	Cycle int
	// The delegate that you want to make the query.
	Address string `validate:"required"`
}

BalanceInput is the input for the gotezos.Balance function.

Function:

func (c *Client) Balance(input BalanceInput) (string, error) {}

type BalanceUpdates

type BalanceUpdates struct {
	Kind     string `json:"kind"`
	Contract string `json:"contract,omitempty"`
	Change   string `json:"change"`
	Category string `json:"category,omitempty"`
	Delegate string `json:"delegate,omitempty"`
	Cycle    int    `json:"cycle,omitempty"`
	Level    int    `json:"level,omitempty"`
}

BalanceUpdates represents the balance updates in a Tezos block

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type Ballot

type Ballot struct {
	Kind     Kind   `json:"kind"`
	Source   string `json:"source"`
	Period   int    `json:"period"`
	Proposal string `json:"proposal"`
	Ballot   string `json:"ballot"`
}

Ballot represents a Ballot in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*Ballot) ToContent

func (b *Ballot) ToContent() Content

ToContent converts a Ballot to Content

type BallotList

type BallotList []struct {
	PublicKeyHash string `json:"pkh"`
	Ballot        string `json:"ballot"`
}

BallotList represents a list of casted ballots in a block.

Path:

../<block_id>/votes/ballot_list (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-ballot-list

type Ballots

type Ballots struct {
	Yay  int `json:"yay"`
	Nay  int `json:"nay"`
	Pass int `json:"pass"`
}

Ballots represents a ballot total.

Path:

../<block_id>/votes/ballots (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-ballots

type BigMapDiff

type BigMapDiff struct {
	Action            BigMapDiffAction `json:"action,omitempty"`
	BigMap            string           `json:"big_map,omitempty"`
	KeyHash           string           `json:"key_hash,omitempty"`
	Key               *json.RawMessage `json:"key,omitempty"`
	Value             *json.RawMessage `json:"value,omitempty"`
	SourceBigMap      string           `json:"source_big_map,omitempty"`
	DestinationBigMap string           `json:"destination_big_map,omitempty"`
	KeyType           *json.RawMessage `json:"key_type,omitempty"`
	ValueType         *json.RawMessage `json:"value_type,omitempty"`
}

BigMapDiff is an element of BigMapDiffs

func (BigMapDiff) ToAlloc

func (b BigMapDiff) ToAlloc() BigMapDiffAlloc

ToAlloc converts BigMapDiff to BigMapDiffAlloc

func (BigMapDiff) ToCopy

func (b BigMapDiff) ToCopy() BigMapDiffCopy

ToCopy converts BigMapDiff to BigMapDiffCopy

func (BigMapDiff) ToRemove

func (b BigMapDiff) ToRemove() BigMapDiffRemove

ToRemove converts BigMapDiff to BigMapDiffRemove

func (BigMapDiff) ToUpdate

func (b BigMapDiff) ToUpdate() BigMapDiffUpdate

ToUpdate converts BigMapDiff to BigMapDiffUpdate

type BigMapDiffAction

type BigMapDiffAction string

BigMapDiffAction is an Action in a BigMapDiff

const (
	// UPDATE is a big_map_diff action
	UPDATE BigMapDiffAction = "update"
	// REMOVE is a big_map_diff action
	REMOVE BigMapDiffAction = "remove"
	// COPY is a big_map_diff action
	COPY BigMapDiffAction = "copy"
	// ALLOC is a big_map_diff action
	ALLOC BigMapDiffAction = "alloc"
)

type BigMapDiffAlloc

type BigMapDiffAlloc struct {
	Action    BigMapDiffAction `json:"action"`
	BigMap    string           `json:"big_map"`
	KeyType   *json.RawMessage `json:"key_type"`
	ValueType *json.RawMessage `json:"value_type"`
}

BigMapDiffAlloc represents $contract.big_map_diff in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type BigMapDiffCopy

type BigMapDiffCopy struct {
	Action            BigMapDiffAction `json:"action"`
	SourceBigMap      string           `json:"source_big_map"`
	DestinationBigMap string           `json:"destination_big_map"`
}

BigMapDiffCopy represents $contract.big_map_diff in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type BigMapDiffRemove

type BigMapDiffRemove struct {
	Action BigMapDiffAction `json:"action"`
	BigMap string           `json:"big_map"`
}

BigMapDiffRemove represents $contract.big_map_diff in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type BigMapDiffUpdate

type BigMapDiffUpdate struct {
	Action  BigMapDiffAction `json:"action"`
	BigMap  string           `json:"big_map,omitempty"`
	KeyHash string           `json:"key_hash,omitempty"`
	Key     *json.RawMessage `json:"key"`
	Value   *json.RawMessage `json:"value,omitempty"`
}

BigMapDiffUpdate represents $contract.big_map_diff in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type BigMapDiffs

type BigMapDiffs []BigMapDiff

BigMapDiffs represents $contract.big_map_diff in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (BigMapDiffs) Organize

func (b BigMapDiffs) Organize() OrganizedBigMapDiff

Organize converts BigMapDiffs into OrganizedBigMapDiff

type BigMapInput

type BigMapInput struct {
	Cycle            int
	Blockhash        string
	BigMapID         int              `validate:"required"`
	ScriptExpression ScriptExpression `validate:"required"`
}

BigMapInput is the input for the goTezos.BigMap function.

Function:

func (t *GoTezos) BigMap(input BigMapInput) ([]byte, error) {}

type Block

type Block struct {
	Protocol   string         `json:"protocol"`
	ChainID    string         `json:"chain_id"`
	Hash       string         `json:"hash"`
	Header     Header         `json:"header"`
	Metadata   Metadata       `json:"metadata"`
	Operations [][]Operations `json:"operations"`
}

Block represents a Tezos block.

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type BlockHeader

type BlockHeader struct {
	Level            int       `json:"level"`
	Proto            int       `json:"proto"`
	Predecessor      string    `json:"predecessor"`
	Timestamp        time.Time `json:"timestamp"`
	ValidationPass   int       `json:"validation_pass"`
	OperationsHash   string    `json:"operations_hash"`
	Fitness          []string  `json:"fitness"`
	Context          string    `json:"context"`
	Priority         int       `json:"priority"`
	ProofOfWorkNonce string    `json:"proof_of_work_nonce"`
	SeedNonceHash    string    `json:"seed_nonce_hash"`
	Signature        string    `json:"signature"`
}

BlockHeader represents $block_header.alpha.full_header in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type BlocksInput

type BlocksInput struct {
	//length is the requested number of predecessors to returns (per requested head).
	Length int
	//An empty argument requests blocks from the current heads. A non empty list allow to request specific fragment of the chain.
	Head string
	// When `min_date` is provided, heads with a timestamp before `min_date` are filtered out
	MinDate *time.Time
}

BlocksInput is the input for the goTezos.Blocks function.

Function:

func (t *GoTezos) EndorsingRights(input *EndorsingRightsInput) (*EndorsingRights, error) {}

type Bootstrap

type Bootstrap struct {
	Block     string    `json:"block"`
	Timestamp time.Time `json:"timestamp"`
}

Bootstrap represents the bootstrap RPC.

RPC:

/monitor/bootstrapped (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-monitor-bootstrapped

type Checkpoint

type Checkpoint struct {
	Block struct {
		Level          int       `json:"level"`
		Proto          int       `json:"proto"`
		Predecessor    string    `json:"predecessor"`
		Timestamp      time.Time `json:"timestamp"`
		ValidationPass int       `json:"validation_pass"`
		OperationsHash string    `json:"operations_hash"`
		Fitness        []string  `json:"fitness"`
		Context        string    `json:"context"`
		ProtocolData   string    `json:"protocol_data"`
	} `json:"block"`
	SavePoint   int    `json:"save_point"`
	Caboose     int    `json:"caboose"`
	HistoryMode string `json:"history_mode"`
}

Checkpoint represents a Tezos checkpoint.

RPC:

/chains/<chain_id>/checkpoint (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-chains-chain-id-checkpoint

type Client

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

Client contains a client (http.Client), network contents, and the host of the node. Gives access to RPC related functions.

func New

func New(host string) (*Client, error)

New returns a pointer to a Client and initializes the rpc configuration with the host's Tezos netowrk constants.

Parameters:

host:
	A Tezos node.

func (*Client) ActiveChains

func (c *Client) ActiveChains() (ActiveChains, error)

ActiveChains monitor every chain creation and destruction. Currently active chains will be given as first elements.

Path:

/monitor/active_chains (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-monitor-active-chains

func (*Client) BakingRights

func (c *Client) BakingRights(input BakingRightsInput) (*BakingRights, error)

BakingRights retrieves the list of delegates allowed to bake a block. By default, it gives the best baking priorities for bakers that have at least one opportunity below the 64th priority for the next block. Parameters `level` and `cycle` can be used to specify the (valid) level(s) in the past or future at which the baking rights have to be returned. Parameter `delegate` can be used to restrict the results to the given delegates. If parameter `all` is set, all the baking opportunities for each baker at each level are returned, instead of just the first one. Returns the list of baking slots. Also returns the minimal timestamps that correspond to these slots. The timestamps are omitted for levels in the past, and are only estimates for levels later that the next block, based on the hypothesis that all predecessor blocks were baked at the first priority.

Path:

../<block_id>/helpers/baking_rights (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-helpers-baking-rights

func (*Client) Balance

func (c *Client) Balance(input BalanceInput) (string, error)

Balance gives access to the balance of a contract.

Path:

../<block_id>/context/contracts/<contract_id>/balance (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance

func (*Client) BallotList

func (c *Client) BallotList(blockhash string) (BallotList, error)

BallotList returns ballots casted so far during a voting period.

Path:

../<block_id>/votes/ballot_list (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-ballot-list

Parameters:

blockhash:
	The hash of block (height) of which you want to make the query.

func (*Client) Ballots

func (c *Client) Ballots(blockhash string) (Ballots, error)

Ballots returns sum of ballots casted so far during a voting period.

Path:

../<block_id>/votes/ballots (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-ballots

Parameters:

blockhash:
	The hash of block (height) of which you want to make the query.

func (*Client) BigMap

func (c *Client) BigMap(input BigMapInput) ([]byte, error)

BigMap reads data from a big_map.

Path:

../<block_id>/context/big_maps/<big_map_id>/<script_expr> (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-big-maps-big-map-id-script-expr

func (*Client) Block

func (c *Client) Block(id interface{}) (*Block, error)

Block gets all the information about a specific block

Path

/chains/<chain_id>/blocks/<block_id> (GET)

Link

https://tezos.gitlab.io/api/rpc.html#get-block-id

Parameters:

id:
	hash = <string> : The block hash.
	level = <int> : The block level.

func (*Client) Blocks

func (c *Client) Blocks(input BlocksInput) ([][]string, error)

Blocks lists known heads of the blockchain sorted with decreasing fitness. Optional arguments allows to returns the list of predecessors for known heads or the list of predecessors for a given list of blocks.

Path:

/chains/<chain_id>/blocks (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-chains-chain-id-blocks

Parameters:

input:
	Modifies the Blocks RPC query by passing optional URL parameters.

func (*Client) Bootstrap

func (c *Client) Bootstrap() (Bootstrap, error)

Bootstrap waits for the node to have synchronized its chain with a few peers (configured by the node's administrator), streaming head updates that happen during the bootstrapping process, and closing the stream at the end. If the node was already bootstrapped, returns the current head immediately.

Path:

/monitor/bootstrapped (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-monitor-bootstrapped

func (*Client) ChainID

func (c *Client) ChainID() (string, error)

ChainID gets the chain unique identifier.

Path:

/chains/<chain_id>/chain_id (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-chains-chain-id-chain-id

func (*Client) Checkpoint

func (c *Client) Checkpoint() (Checkpoint, error)

Checkpoint gets the current checkpoint for this chain.

Path:

/chains/<chain_id>/checkpoint (GET)RPC

Link:

https://tezos.gitlab.io/api/rpc.html#get-chains-chain-id-checkpoint

func (*Client) Commit

func (c *Client) Commit() (string, error)

Commit gets information on the build of the node.

Path:

/monitor/commit_hash (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-monitor-commit-hash

func (*Client) Connections

func (c *Client) Connections() (Connections, error)

Connections lists the running P2P connection.

Path:

/network/connections (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-network-connections

func (*Client) Constants

func (c *Client) Constants(blockhash string) (Constants, error)

Constants gets all constants.

Path:

../<block_id>/context/constants (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-constants

func (*Client) ContractStorage

func (c *Client) ContractStorage(input ContractStorageInput) ([]byte, error)

ContractStorage gets access the data of the contract.

Path:

../<block_id>/context/contracts/<contract_id>/storage (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-storage

func (*Client) Counter

func (c *Client) Counter(input CounterInput) (int, error)

Counter access the counter of a contract, if any.

Path:

../<block_id>/context/contracts/<contract_id>/counter (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-counter

func (*Client) CurrentPeriodKind

func (c *Client) CurrentPeriodKind(blockhash string) (string, error)

CurrentPeriodKind returns the current period kind.

Path:

../<block_id>/votes/current_period_kind (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-period-kind

Parameters:

blockhash:
	The hash of block (height) of which you want to make the query.

func (*Client) CurrentProposal

func (c *Client) CurrentProposal(blockhash string) (string, error)

CurrentProposal returns the current proposal under evaluation.

Path:

../<block_id>/votes/current_proposal (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-proposal

Parameters:

blockhash:
	The hash of block (height) of which you want to make the query.

func (*Client) CurrentQuorum

func (c *Client) CurrentQuorum(blockhash string) (int, error)

CurrentQuorum returns the current expected quorum.

Path:

../<block_id>/votes/current_proposal (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-current-quorum

Parameters:

blockhash:
	The hash of block (height) of which you want to make the query.

func (*Client) Cycle

func (c *Client) Cycle(cycle int) (Cycle, error)

Cycle gets information about a tezos snapshot or cycle.

Path:

../context/raw/json/cycle/%d" (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-raw-bytes

func (*Client) Delegate

func (c *Client) Delegate(input DelegateInput) (Delegate, error)

Delegate gets everything about a delegate.

Path:

../<block_id>/context/delegates/<pkh> (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-delegates-pkh

func (*Client) DelegatedContracts

func (c *Client) DelegatedContracts(input DelegatedContractsInput) ([]string, error)

DelegatedContracts Returns the list of contracts that delegate to a given delegate.

Path:

../<block_id>/context/delegates/<pkh>/delegated_contracts (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-delegates-pkh-delegated-contracts

func (*Client) Delegates

func (c *Client) Delegates(input DelegatesInput) ([]string, error)

Delegates lists all registered delegates.

Path:

../<block_id>/context/delegates (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-delegates

func (*Client) DeleteInvalidBlock

func (c *Client) DeleteInvalidBlock(blockHash string) error

DeleteInvalidBlock remove an invalid block for the tezos storage.

Path:

/chains/<chain_id>/invalid_blocks/<block_hash> (DELETE)

Link:

https://tezos.gitlab.io/api/rpc.html#delete-chains-chain-id-invalid-blocks-block-hash

func (*Client) EndorsingRights

func (c *Client) EndorsingRights(input EndorsingRightsInput) (*EndorsingRights, error)

EndorsingRights retrieves the delegates allowed to endorse a block. By default, it gives the endorsement slots for delegates that have at least one in the next block. Parameters `level` and `cycle` can be used to specify the (valid) level(s) in the past or future at which the endorsement rights have to be returned. Parameter `delegate` can be used to restrict the results to the given delegates. Returns the list of endorsement slots. Also returns the minimal timestamps that correspond to these slots. The timestamps are omitted for levels in the past, and are only estimates for levels later that the next block, based on the hypothesis that all predecessor blocks were baked at the first priority.

Path:

../<block_id>/helpers/endorsing_rights (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-helpers-endorsing-rights

func (*Client) ForgeOperation

func (c *Client) ForgeOperation(input ForgeOperationInput) (string, error)

ForgeOperation will forge an operation with the tezos RPC. For security purposes ForgeOperationWithRPC will preapply an operation to verify the node forged the operation with the requested contents.

NOTE:

  • Is is recommended that you forge locally with the go-tezos/v3/forge package instead. This eliminates the risk for a blind signature attack.
  • Forging with the RPC also unforges with the RPC and compares the expected contents for some security.

Path:

../<block_id>/helpers/forge/operations (POST)

Link:

https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-forge-operations

func (*Client) FrozenBalance

func (c *Client) FrozenBalance(input FrozenBalanceInput) (FrozenBalance, error)

FrozenBalance returns the total frozen balances of a given delegate, this includes the frozen deposits, rewards and fees.

Path:

../<block_id>/context/delegates/<pkh>/frozen_balance (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-delegates-pkh-frozen-balance

func (*Client) GetFA12Allowance

func (c *Client) GetFA12Allowance(input GetFA12AllowanceInput) (string, error)

GetFA12Allowance is a helper function to get the allowance of an FA1.2 contract. There isn't really a good way to get the allowance naturally because the FA1.2 contract entrypoints are meant to be called from another contract. As a result of this this function will run an operation that calls an intermediary contract which calls the FA1.2 contract and parses the result.

See: https://gitlab.com/camlcase-dev/dexter-integration/-/blob/master/call_fa1.2_view_entrypoints.md

func (*Client) GetFA12Balance

func (c *Client) GetFA12Balance(input GetFA12BalanceInput) (string, error)

GetFA12Balance is a helper function to get the balance of a participant in an FA1.2 contracts. There isn't really a good way to get the balance naturally because the FA1.2 contract entrypoints are meant to be called from another contract. As a result of this this function will run an operation that calls an intermediary contract which calls the FA1.2 contract and parses the result.

See: https://gitlab.com/camlcase-dev/dexter-integration/-/blob/master/call_fa1.2_view_entrypoints.md

func (*Client) GetFA12Supply

func (c *Client) GetFA12Supply(input GetFA12SupplyInput) (string, error)

GetFA12Supply is a helper function to get the total supply of an FA1.2 contract. There isn't really a good way to get the supply naturally because the FA1.2 contract entrypoints are meant to be called from another contract. As a result of this this function will run an operation that calls an intermediary contract which calls the FA1.2 contract and parses the result.

See: https://gitlab.com/camlcase-dev/dexter-integration/-/blob/master/call_fa1.2_view_entrypoints.md

func (*Client) Head

func (c *Client) Head() (*Block, error)

Head gets all the information about the head block.

Path:

/chains/<chain_id>/blocks/head (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-chains-chain-id-blocks

func (*Client) InjectionBlock

func (c *Client) InjectionBlock(input InjectionBlockInput) ([]byte, error)

InjectionBlock inject a block in the node and broadcast it. The `operations` embedded in `blockHeader` might be pre-validated using a contextual RPCs from the latest block (e.g. '/blocks/head/context/preapply'). Returns the ID of the block. By default, the RPC will wait for the block to be validated before answering. If ?async is true, the function returns immediately. Otherwise, the block will be validated before the result is returned. If ?force is true, it will be injected even on non strictly increasing fitness. An optional ?chain parameter can be used to specify whether to inject on the test chain or the main chain.

Path:

/injection/operation (POST)

Link:

https/tezos.gitlab.io/api/rpc.html#post-injection-operation

func (*Client) InjectionOperation

func (c *Client) InjectionOperation(input InjectionOperationInput) (string, error)

InjectionOperation injects an operation in node and broadcast it. Returns the ID of the operation. The `signedOperationContents` should be constructed using a contextual RPCs from the latest block and signed by the client. By default, the RPC will wait for the operation to be (pre-)validated before answering. See RPCs under /blocks/prevalidation for more details on the prevalidation context. If ?async is true, the function returns immediately. Otherwise, the operation will be validated before the result is returned. An optional ?chain parameter can be used to specify whether to inject on the test chain or the main chain.

Path:

/injection/operation (POST)

Link:

https/tezos.gitlab.io/api/rpc.html#post-injection-operation

func (*Client) InvalidBlock

func (c *Client) InvalidBlock(blockHash string) (InvalidBlock, error)

InvalidBlock gets the errors that appears during the block (in)validation.

Path:

/chains/<chain_id>/invalid_blocks/<block_hash> (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-chains-chain-id-invalid-blocks-block-hash

func (*Client) InvalidBlocks

func (c *Client) InvalidBlocks() ([]InvalidBlock, error)

InvalidBlocks lists blocks that have been declared invalid along with the errors that led to them being declared invalid.

Path:

/chains/<chain_id>/invalid_blocks (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-chains-chain-id-invalid-blocks

func (*Client) OperationHashes

func (c *Client) OperationHashes(blockhash string) ([][]string, error)

OperationHashes is the hashes of all the operations included in the block.

Path:

../<block_id>/operation_hashes (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-contracts-contract-id-balance

Parameters:

blockhash:
	The hash of block (height) of which you want to make the query.

func (*Client) PreapplyOperations

func (c *Client) PreapplyOperations(input PreapplyOperationsInput) ([]Operations, error)

PreapplyOperations simulates the validation of an operation.

Path:

../<block_id>/helpers/preapply/operations (POST)

Link:

https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-preapply-operations

func (*Client) Proposals

func (c *Client) Proposals(blockhash string) (Proposals, error)

Proposals returns a list of proposals with number of supporters.

Path:

../<block_id>/votes/proposals (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-proposals

Parameters:

blockhash:
	The hash of block (height) of which you want to make the query.

func (*Client) RunOperation

func (c *Client) RunOperation(input RunOperationInput) (Operations, error)

RunOperation will run an operation without signature checks.

Path:

../<block_id>/helpers/scripts/run_operation (POST)

Link:

https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-scripts-run-operation

func (*Client) SetChain

func (c *Client) SetChain(chain string)

SetChain sets the chain for the rpc

func (*Client) SetClient

func (c *Client) SetClient(client *http.Client)

SetClient overrides GoTezos's client. *http.Client satisfies the client interface.

Parameters:

client:
	A pointer to an http.Client.

func (*Client) SetConstants

func (c *Client) SetConstants(constants Constants)

SetConstants overrides GoTezos's networkConstants.

Parameters:

constants:
	Tezos Network Constants.

func (*Client) StakingBalance

func (c *Client) StakingBalance(input StakingBalanceInput) (int, error)

StakingBalance returns the total amount of tokens delegated to a given delegate. This includes the balances of all the contracts that delegate to it, but also the balance of the delegate itself and its frozen fees and deposits. The rewards do not count in the delegated balance until they are unfrozen.

Path:

../<block_id>/context/delegates/<pkh>/staking_balance (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-delegates-pkh-staking-balance

Parameters:

StakingBalanceInput
	Modifies the StakingBalance RPC query by passing optional parameters. Delegate and (Cycle or Blockhash) is required.

func (*Client) UnforgeOperation

func (c *Client) UnforgeOperation(input UnforgeOperationInput) ([]Operations, error)

UnforgeOperation will unforge an operation with the tezos RPC.

If you would rather not use a node at all, GoTezos supports local unforging operations REVEAL, TRANSFER, ORIGINATION, and DELEGATION.

Path:

../<block_id>/helpers/parse/operations (POST)

Link:

https://tezos.gitlab.io/api/rpc.html#post-block-id-helpers-parse-operations

func (*Client) UserActivatedProtocolOverrides

func (c *Client) UserActivatedProtocolOverrides() (UserActivatedProtocolOverrides, error)

UserActivatedProtocolOverrides list of protocols which replace other protocols.

Path:

/config/network/user_activated_protocol_overrides (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-config-network-user-activated-protocol-overrides

func (*Client) Version

func (c *Client) Version() (Version, error)

Version gets supported network layer version.

Path:

/network/version (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-network-version

func (*Client) VoteListings

func (c *Client) VoteListings(blockhash string) (Listings, error)

VoteListings returns a list of delegates with their voting weight, in number of rolls.

Path:

../<block_id>/votes/listings (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-listings

Parameters:

blockhash:
	The hash of block (height) of which you want to make the query.

type Connections

type Connections []struct {
	Incoming bool   `json:"incoming"`
	PeerID   string `json:"peer_id"`
	IDPoint  struct {
		Addr string `json:"addr"`
		Port int    `json:"port"`
	} `json:"id_point"`
	RemoteSocketPort int `json:"remote_socket_port"`
	Versions         []struct {
		Name  string `json:"name"`
		Major int    `json:"major"`
		Minor int    `json:"minor"`
	} `json:"versions"`
	Private       bool `json:"private"`
	LocalMetadata struct {
		DisableMempool bool `json:"disable_mempool"`
		PrivateNode    bool `json:"private_node"`
	} `json:"local_metadata"`
	RemoteMetadata struct {
		DisableMempool bool `json:"disable_mempool"`
		PrivateNode    bool `json:"private_node"`
	} `json:"remote_metadata"`
}

Connections represents the connections RPC.

RPC:

/network/connections (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-network-connections

type Constants

type Constants struct {
	ProofOfWorkNonceSize         int      `json:"proof_of_work_nonce_size"`
	NonceLength                  int      `json:"nonce_length"`
	MaxRevelationsPerBlock       int      `json:"max_revelations_per_block"`
	MaxOperationDataLength       int      `json:"max_operation_data_length"`
	MaxProposalsPerDelegate      int      `json:"max_proposals_per_delegate"`
	PreservedCycles              int      `json:"preserved_cycles"`
	BlocksPerCycle               int      `json:"blocks_per_cycle"`
	BlocksPerCommitment          int      `json:"blocks_per_commitment"`
	BlocksPerRollSnapshot        int      `json:"blocks_per_roll_snapshot"`
	BlocksPerVotingPeriod        int      `json:"blocks_per_voting_period"`
	TimeBetweenBlocks            []string `json:"time_between_blocks"`
	EndorsersPerBlock            int      `json:"endorsers_per_block"`
	HardGasLimitPerOperation     int      `json:"hard_gas_limit_per_operation,string"`
	HardGasLimitPerBlock         int      `json:"hard_gas_limit_per_block,string"`
	ProofOfWorkThreshold         string   `json:"proof_of_work_threshold"`
	TokensPerRoll                string   `json:"tokens_per_roll"`
	MichelsonMaximumTypeSize     int      `json:"michelson_maximum_type_size"`
	SeedNonceRevelationTip       string   `json:"seed_nonce_revelation_tip"`
	OriginationSize              int      `json:"origination_size"`
	BlockSecurityDeposit         int      `json:"block_security_deposit,string"`
	EndorsementSecurityDeposit   int      `json:"endorsement_security_deposit,string"`
	BlockReward                  IntArray `json:"block_reward"`
	EndorsementReward            IntArray `json:"endorsement_reward"`
	CostPerByte                  int      `json:"cost_per_byte,string"`
	HardStorageLimitPerOperation int      `json:"hard_storage_limit_per_operation,string"`
}

Constants represents the constants RPC.

RPC:

../<block_id>/context/constants (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-constants

type Content

type Content struct {
	Kind          Kind                `json:"kind,omitempty"`
	Level         int                 `json:"level,omitempty"`
	Nonce         string              `json:"nonce,omitempty"`
	Op1           *InlinedEndorsement `json:"Op1,omitempty"`
	Op2           *InlinedEndorsement `json:"Op2,omitempty"`
	Pkh           string              `json:"pkh,omitempty"`
	Secret        string              `json:"secret,omitempty"`
	Bh1           *BlockHeader        `json:"bh1,omitempty"`
	Bh2           *BlockHeader        `json:"bh2,omitempty"`
	Source        string              `json:"source,omitempty"`
	Period        int                 `json:"period,omitempty"`
	Proposals     []string            `json:"proposals,omitempty"`
	Proposal      string              `json:"proposal,omitempty"`
	Ballot        string              `json:"ballot,omitempty"`
	Fee           string              `json:"fee,omitempty"`
	Counter       string              `json:"counter,omitempty"`
	GasLimit      string              `json:"gas_limit,omitempty"`
	StorageLimit  string              `json:"storage_limit,omitempty"`
	PublicKey     string              `json:"public_key,omitempty"`
	ManagerPubkey string              `json:"managerPubKey,omitempty"`
	Amount        string              `json:"amount,omitempty"`
	Destination   string              `json:"destination,omitempty"`
	Balance       string              `json:"balance,omitempty"`
	Delegate      string              `json:"delegate,omitempty"`
	Script        Script              `json:"script,omitempty"`
	Parameters    *Parameters         `json:"parameters,omitempty"`
	Metadata      *ContentsMetadata   `json:"metadata,omitempty"`
}

Content is an element of Contents

func (*Content) MarshalJSON

func (c *Content) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler in order to correctly marshal contents based of kind

func (*Content) ToAccountActivation

func (c *Content) ToAccountActivation() AccountActivation

ToAccountActivation converts Content to AccountActivation.

func (*Content) ToBallot

func (c *Content) ToBallot() Ballot

ToBallot converts Content to Ballot.

func (*Content) ToDelegation

func (c *Content) ToDelegation() Delegation

ToDelegation converts Content to Origination.

func (*Content) ToDoubleBakingEvidence

func (c *Content) ToDoubleBakingEvidence() DoubleBakingEvidence

ToDoubleBakingEvidence converts Content to DoubleBakingEvidence.

func (*Content) ToDoubleEndorsementEvidence

func (c *Content) ToDoubleEndorsementEvidence() DoubleEndorsementEvidence

ToDoubleEndorsementEvidence converts Content to DoubleEndorsementEvidence.

func (*Content) ToEndorsement

func (c *Content) ToEndorsement() Endorsement

ToEndorsement converts Content to Endorsement.

func (*Content) ToOrigination

func (c *Content) ToOrigination() Origination

ToOrigination converts Content to Origination.

func (*Content) ToProposal

func (c *Content) ToProposal() Proposal

ToProposal converts Content to Proposal.

func (*Content) ToReveal

func (c *Content) ToReveal() Reveal

ToReveal converts Content to Reveal.

func (*Content) ToSeedNonceRevelations

func (c *Content) ToSeedNonceRevelations() SeedNonceRevelation

ToSeedNonceRevelations converts Content to SeedNonceRevelations.

func (*Content) ToTransaction

func (c *Content) ToTransaction() Transaction

ToTransaction converts Content to Transaction.

type Contents

type Contents []Content

Contents represents the contents in Tezos operations.

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (Contents) Organize

func (c Contents) Organize() OrganizedContents

Organize converts contents into OrganizedContents where contents are organized by Kind

type ContentsMetadata

type ContentsMetadata struct {
	BalanceUpdates          []BalanceUpdates           `json:"balance_updates,omitempty"`
	Delegate                string                     `json:"delegate,omitempty"`
	Slots                   []int                      `json:"slots,omitempty"`
	OperationResults        *OperationResults          `json:"operation_result,omitempty"`
	InternalOperationResult []InternalOperationResults `json:"internal_operation_results,omitempty"`
}

ContentsMetadata represents metadata in contents in Tezos operations.

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type ContractStorageInput

type ContractStorageInput struct {
	Blockhash string `validate:"required"`
	Contract  string `validate:"required"`
}

ContractStorageInput is the input for the client.ContractStorage() function.

Function:

func (c *Client) ContractStorage(input ContractStorageInput) ([]byte, error)  {}

type CounterInput

type CounterInput struct {
	Blockhash string `validate:"required"`
	Address   string `validate:"required"`
}

CounterInput is the input for the client.Counter function.

Function:

func (c *Client) Counter(input CounterInput) (int, error) {}

type Cycle

type Cycle struct {
	LastRoll     []string `json:"last_roll,omitempty"`
	Nonces       []string `json:"nonces,omitempty"`
	RandomSeed   string   `json:"random_seed"`
	RollSnapshot int      `json:"roll_snapshot"`
	BlockHash    string   `json:"-"`
}

Cycle represents the cycle RPC.

RPC:

../blocks/<block_id>/context/raw/json/cycle/<cycle_number> (GET)

type Delegate

type Delegate struct {
	Balance              string `json:"balance"`
	FrozenBalance        string `json:"frozen_balance"`
	FrozenBalanceByCycle []struct {
		Cycle   int `json:"cycle"`
		Deposit int `json:"deposit,string"`
		Fees    int `json:"fees,string"`
		Rewards int `json:"rewards,string"`
	} `json:"frozen_balance_by_cycle"`
	StakingBalance    string   `json:"staking_balance"`
	DelegateContracts []string `json:"delegated_contracts"`
	DelegatedBalance  string   `json:"delegated_balance"`
	Deactivated       bool     `json:"deactivated"`
	GracePeriod       int      `json:"grace_period"`
}

Delegate represents the frozen delegate RPC on the tezos network.

RPC:

../<block_id>/context/delegates/<pkh> (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-delegates-pkh

type DelegateInput

type DelegateInput struct {
	// The block level of which you want to make the query. If empty Cycle is required.
	Blockhash string
	// The cycle to get the balance at. If empty Blockhash is required.
	Cycle int
	// The delegate that you want to make the query.
	Delegate string `validate:"required"`
}

DelegateInput is the input for the client.Delegate() function.

Function:

func (t *GoTezos) DelegatedContracts(input DelegatedContractsInput) ([]string, error)  {}

type DelegatedContractsInput

type DelegatedContractsInput struct {
	// The block level of which you want to make the query. If empty Cycle is required.
	Blockhash string
	// The cycle to get the balance at. If empty Blockhash is required.
	Cycle int
	// The delegate that you want to make the query.
	Delegate string `validate:"required"`
}

DelegatedContractsInput is the input for the goTezos.DelegatedContractsInput function.

Function:

func (t *GoTezos) DelegatedContracts(input DelegatedContractsInput) ([]string, error)  {}

type DelegatesInput

type DelegatesInput struct {
	// The block level of which you want to make the query. If empty Cycle is required.
	Blockhash string
	// The cycle to get the balance at. If empty Blockhash is required.
	Cycle int
	// contains filtered or unexported fields
}

DelegatesInput is the input for the goTezos.Delegates function.

Function:

func (t *GoTezos) Delegates(input DelegatesInput) ([]string, error) {}

type Delegation

type Delegation struct {
	Kind         Kind                `json:"kind"`
	Source       string              `json:"source" validate:"required"`
	Fee          string              `json:"fee" validate:"required"`
	Counter      string              `json:"counter" validate:"required"`
	GasLimit     string              `json:"gas_limit" validate:"required"`
	StorageLimit string              `json:"storage_limit" validate:"required"`
	Delegate     string              `json:"delegate,omitempty"`
	Metadata     *DelegationMetadata `json:"metadata"`
}

Delegation represents a Delegation in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*Delegation) ToContent

func (d *Delegation) ToContent() Content

ToContent converts a Delegation to Content

type DelegationMetadata

type DelegationMetadata struct {
	BalanceUpdates           []BalanceUpdates           `json:"balance_updates"`
	OperationResults         OperationResultDelegation  `json:"operation_result"`
	InternalOperationResults []InternalOperationResults `json:"internal_operation_results,omitempty"`
}

DelegationMetadata represents the metadata Delegation in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type DoubleBakingEvidence

type DoubleBakingEvidence struct {
	Kind     Kind                          `json:"kind"`
	Bh1      *BlockHeader                  `json:"bh1"`
	Bh2      *BlockHeader                  `json:"bh2"`
	Metadata *DoubleBakingEvidenceMetadata `json:"metadata"`
}

DoubleBakingEvidence represents an Double_baking_evidence in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*DoubleBakingEvidence) ToContent

func (d *DoubleBakingEvidence) ToContent() Content

ToContent converts a DoubleBakingEvidence to Content

type DoubleBakingEvidenceMetadata

type DoubleBakingEvidenceMetadata struct {
	BalanceUpdates []BalanceUpdates `json:"balance_updates"`
}

DoubleBakingEvidenceMetadata represents the metadata of Double_baking_evidence in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type DoubleEndorsementEvidence

type DoubleEndorsementEvidence struct {
	Kind     Kind                               `json:"kind"`
	Op1      *InlinedEndorsement                `json:"Op1"`
	Op2      *InlinedEndorsement                `json:"Op2"`
	Metadata *DoubleEndorsementEvidenceMetadata `json:"metadata"`
}

DoubleEndorsementEvidence represents an Double_endorsement_evidence in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*DoubleEndorsementEvidence) ToContent

func (d *DoubleEndorsementEvidence) ToContent() Content

ToContent converts a DoubleEndorsementEvidence to Content

type DoubleEndorsementEvidenceMetadata

type DoubleEndorsementEvidenceMetadata struct {
	BalanceUpdates []BalanceUpdates `json:"balance_updates"`
}

DoubleEndorsementEvidenceMetadata represents the metadata for Double_endorsement_evidence in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type Endorsement

type Endorsement struct {
	Kind     Kind                 `json:"kind"`
	Level    int                  `json:"level"`
	Metadata *EndorsementMetadata `json:"metadata"`
}

Endorsement represents an endorsement in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*Endorsement) ToContent

func (e *Endorsement) ToContent() Content

ToContent converts Endorsement to Content

type EndorsementMetadata

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

EndorsementMetadata represents the metadata of an endorsement in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type EndorsingRights

type EndorsingRights []struct {
	Level         int       `json:"level"`
	Delegate      string    `json:"delegate"`
	Slots         []int     `json:"slots"`
	EstimatedTime time.Time `json:"estimated_time"`
}

EndorsingRights represents the endorsing rights RPC on the tezos network.

RPC:

../<block_id>/helpers/baking_rights (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-helpers-endorsing-rights

type EndorsingRightsInput

type EndorsingRightsInput struct {
	// The hash of block (height) of which you want to make the query.
	BlockHash string `validate:"required"`

	// The block level of which you want to make the query.
	Level int

	// The cycle of which you want to make the query.
	Cycle int

	// The delegate public key hash of which you want to make the query.
	Delegate string
}

EndorsingRightsInput is the input for the goTezos.EndorsingRights function.

Function:

func (t *GoTezos) EndorsingRights(input *EndorsingRightsInput) (*EndorsingRights, error) {}

type Error

type Error struct {
	Kind string `json:"kind"`
	Err  string `json:"error"`
}

Error represents and RPC error

func (*Error) Error

func (r *Error) Error() string

type Errors

type Errors []Error

Errors represents multiple RPCError(s).s

type ForgeOperationInput

type ForgeOperationInput struct {
	Blockhash    string   `validate:"required"`
	Branch       string   `validate:"required"`
	Contents     Contents `validate:"required"`
	CheckRPCAddr string
}

ForgeOperationInput is the input for the client.ForgeOperation function.

Function:

func (c *Client) ForgeOperation(input ForgeOperationInput) (string, error) {}

type FrozenBalance

type FrozenBalance struct {
	Deposits int `json:"deposits"`
	Fees     int `json:"fees"`
	Rewards  int `json:"rewards"`
}

FrozenBalance represents the frozen balance RPC on the tezos network.

RPC:

../<block_id>/context/delegates/<pkh>/frozen_balance (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-delegates-pkh-frozen-balance

func (*FrozenBalance) MarshalJSON

func (f *FrozenBalance) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler

func (*FrozenBalance) UnmarshalJSON

func (f *FrozenBalance) UnmarshalJSON(data []byte) error

UnmarshalJSON satisfies json.Marshaler

type FrozenBalanceInput

type FrozenBalanceInput struct {
	// The cycle to get the balance at.
	Cycle int `validate:"required"`
	// The delegate that you want to make the query.
	Delegate string `validate:"required"`
}

FrozenBalanceInput is the input for the client.Delegate() function.

Function:

func (t *GoTezos) DelegatedContracts(input DelegatedContractsInput) ([]string, error)  {}

type GetFA12AllowanceInput

type GetFA12AllowanceInput struct {
	// Blockhash is the block height at which to make the query. Can leave blank if using Cycle.
	Blockhash string
	// Cycle is the cycle in which to make the query. Can leave blank if using Blockhash.
	Cycle int
	// ChainID is the Chain ID of the chain you want to query
	ChainID string `validate:"required"`
	// Source to form the contents with. The operation is not forged or injected so it is possible for XTZ to be spent.
	Source string `validate:"required"`
	// FA12Contract address of the FA1.2 Contract you wish to query.
	FA12Contract string `validate:"required"`
	// OwnerAddress is the address to get the balance for in the FA1.2 contract
	OwnerAddress string `validate:"required"`
	// SpenderAddress is the address to check an allowance for on behalf of an owner
	SpenderAddress string `validate:"required"`
	// If true the function will use an intermediate contract deployed on Carthagenet, default mainnet.
	Testnet bool
	// If provided this will be the contract view address used to query the FA1.2 contract
	ContractViewAddress string
}

GetFA12AllowanceInput is the input for the goTezos.GetFA12Allowance function.

Function:

func (c *Client) GetFA12Allowance(input GetFA12AllowanceInput) (int, error) {}

type GetFA12BalanceInput

type GetFA12BalanceInput struct {
	// Blockhash is the block height at which to make the query. Can leave blank if using Cycle.
	Blockhash string
	// Cycle is the cycle in which to make the query. Can leave blank if using Blockhash.
	Cycle int
	// ChainID is the Chain ID of the chain you want to query
	ChainID string `validate:"required"`
	// Source to form the contents with. The operation is not forged or injected so it is possible for XTZ to be spent.
	Source string `validate:"required"`
	// FA12Contract address of the FA1.2 Contract you wish to query.
	FA12Contract string `validate:"required"`
	// OwnerAddress is the address to get the balance for in the FA1.2 contract
	OwnerAddress string `validate:"required"`
	// If true the function will use an intermediate contract deployed on Carthagenet, default mainnet.
	Testnet bool
	// If provided this will be the contract view address used to query the FA1.2 contract
	ContractViewAddress string
}

GetFA12BalanceInput is the input for the goTezos.GetFA12Balance function.

Function:

func (c *Client) GetFA12Balance(input GetFA12BalanceInput) (int, error) {}

type GetFA12SupplyInput

type GetFA12SupplyInput struct {
	// Blockhash is the block height at which to make the query. Can leave blank if using Cycle.
	Blockhash string
	// Cycle is the cycle in which to make the query. Can leave blank if using Blockhash.
	Cycle int
	// ChainID is the Chain ID of the chain you want to query
	ChainID string `validate:"required"`
	// Source to form the contents with. The operation is not forged or injected so it is possible for XTZ to be spent.
	Source string `validate:"required"`
	// FA12Contract address of the FA1.2 Contract you wish to query.
	FA12Contract string `validate:"required"`
	// If true the function will use an intermediate contract deployed on Carthagenet, default mainnet.
	Testnet bool
	// If provided this will be the contract view address used to query the FA1.2 contract
	ContractViewAddress string
}

GetFA12SupplyInput is the input for the goTezos.GetFA12Supply function.

Function:

func (c *Client) GetFA12Supply(input GetFA12SupplyInput) (int, error) {}
type Header struct {
	Level            int       `json:"level"`
	Proto            int       `json:"proto"`
	Predecessor      string    `json:"Predecessor"`
	Timestamp        time.Time `json:"timestamp"`
	ValidationPass   int       `json:"validation_pass"`
	OperationsHash   string    `json:"operations_hash"`
	Fitness          []string  `json:"fitness"`
	Context          string    `json:"context"`
	Priority         int       `json:"priority"`
	ProofOfWorkNonce string    `json:"proof_of_work_nonce"`
	SeedNonceHash    string    `json:"seed_nonce_hash"`
	Signature        string    `json:"signature"`
}

Header represents the header in a Tezos block

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type IFace

type IFace interface {
	ActiveChains() (ActiveChains, error)
	BakingRights(input BakingRightsInput) (*BakingRights, error)
	Balance(input BalanceInput) (string, error)
	BallotList(blockhash string) (BallotList, error)
	Ballots(blockhash string) (Ballots, error)
	BigMap(input BigMapInput) ([]byte, error)
	Block(id interface{}) (*Block, error)
	Blocks(input BlocksInput) ([][]string, error)
	Bootstrap() (Bootstrap, error)
	ChainID() (string, error)
	Checkpoint() (Checkpoint, error)
	Commit() (string, error)
	Connections() (Connections, error)
	Constants(blockhash string) (Constants, error)
	ContractStorage(input ContractStorageInput) ([]byte, error)
	Counter(input CounterInput) (int, error)
	CurrentPeriodKind(blockhash string) (string, error)
	CurrentProposal(blockhash string) (string, error)
	CurrentQuorum(blockhash string) (int, error)
	Cycle(cycle int) (Cycle, error)
	Delegate(input DelegateInput) (Delegate, error)
	Delegates(input DelegatesInput) ([]string, error)
	DelegatedContracts(input DelegatedContractsInput) ([]string, error)
	DeleteInvalidBlock(blockHash string) error
	EndorsingRights(input EndorsingRightsInput) (*EndorsingRights, error)
	ForgeOperation(input ForgeOperationInput) (string, error)
	GetFA12Allowance(input GetFA12AllowanceInput) (string, error)
	FrozenBalance(input FrozenBalanceInput) (FrozenBalance, error)
	GetFA12Balance(input GetFA12BalanceInput) (string, error)
	GetFA12Supply(input GetFA12SupplyInput) (string, error)
	Head() (*Block, error)
	InjectionBlock(input InjectionBlockInput) ([]byte, error)
	InjectionOperation(input InjectionOperationInput) (string, error)
	InvalidBlock(blockHash string) (InvalidBlock, error)
	InvalidBlocks() ([]InvalidBlock, error)
	OperationHashes(blockhash string) ([][]string, error)
	PreapplyOperations(input PreapplyOperationsInput) ([]Operations, error)
	Proposals(blockhash string) (Proposals, error)
	RunOperation(input RunOperationInput) (Operations, error)
	StakingBalance(input StakingBalanceInput) (int, error)
	UnforgeOperation(input UnforgeOperationInput) ([]Operations, error)
	UserActivatedProtocolOverrides() (UserActivatedProtocolOverrides, error)
	Version() (Version, error)
}

IFace is an interface mocking a GoTezos object.

type InjectionBlockInput

type InjectionBlockInput struct {
	// Block to inject
	Block *Block `validate:"required"`

	// If ?async is true, the function returns immediately.
	Async bool

	// If ?force is true, it will be injected even on non strictly increasing fitness.
	Force bool

	// Specify the ChainID.
	ChainID string
}

InjectionBlockInput is the input for the goTezos.InjectionBlock function.

Function:

func (c *Client) InjectionBlock(input InjectionBlockInput) ([]byte, error) {}

type InjectionOperationInput

type InjectionOperationInput struct {
	// The operation string.
	Operation string `validate:"required"`

	// If ?async is true, the function returns immediately.
	Async bool

	// Specify the ChainID.
	ChainID string
}

InjectionOperationInput is the input for the goTezos.InjectionOperation function.

Function:

func (c *Client) InjectionOperation(input InjectionOperationInput) ([]byte, error) {}

type InlinedEndorsement

type InlinedEndorsement struct {
	Branch     string                        `json:"branch"`
	Operations *InlinedEndorsementOperations `json:"operations"`
	Signature  string                        `json:"signature"`
}

InlinedEndorsement represents $inlined.endorsement in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type InlinedEndorsementOperations

type InlinedEndorsementOperations struct {
	Kind  string `json:"kind"`
	Level int    `json:"level"`
}

InlinedEndorsementOperations represents operations in $inlined.endorsement in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type IntArray

type IntArray []int

IntArray implements json.Marshaler so that a string of ints can be a slice of ints

func (*IntArray) MarshalJSON

func (i *IntArray) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler

func (*IntArray) UnmarshalJSON

func (i *IntArray) UnmarshalJSON(data []byte) error

UnmarshalJSON satisfies json.Marshaler

type InternalOperationResults

type InternalOperationResults struct {
	Kind        string            `json:"kind"`
	Source      string            `json:"source"`
	Nonce       int               `json:"nonce"`
	Amount      string            `json:"amount,omitempty"`
	PublicKey   string            `json:"public_key,omitempty"`
	Destination string            `json:"destination,omitempty"`
	Balance     string            `json:"balance,omitempty"`
	Delegate    string            `json:"delegate,omitempty"`
	Script      ScriptedContracts `json:"script,omitempty"`
	Parameters  struct {
		Entrypoint string           `json:"entrypoint"`
		Value      *json.RawMessage `json:"value"`
	} `json:"paramaters,omitempty"`
	Result OperationResult `json:"result"`
}

InternalOperationResults represents an InternalOperationResults in the $operation.alpha.internal_operation_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type InvalidBlock

type InvalidBlock struct {
	Block  string `json:"block"`
	Level  int    `json:"level"`
	Errors Errors `json:"errors"`
}

InvalidBlock represents Tezos invalid blocks.

RPC:

/chains/<chain_id>/invalid_blocks (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-chains-chain-id-invalid-blocks

type Kind

type Kind string

Kind is a contents kind

const (
	// ENDORSEMENT kind
	ENDORSEMENT Kind = "endorsement"
	// SEEDNONCEREVELATION kind
	SEEDNONCEREVELATION Kind = "seed_nonce_revelation"
	// DOUBLEENDORSEMENTEVIDENCE kind
	DOUBLEENDORSEMENTEVIDENCE Kind = "double_endorsement_evidence"
	// DOUBLEBAKINGEVIDENCE kind
	DOUBLEBAKINGEVIDENCE Kind = "Double_baking_evidence"
	// ACTIVATEACCOUNT kind
	ACTIVATEACCOUNT Kind = "activate_account"
	// PROPOSALS kind
	PROPOSALS Kind = "proposals"
	// BALLOT kind
	BALLOT Kind = "ballot"
	// REVEAL kind
	REVEAL Kind = "reveal"
	// TRANSACTION kind
	TRANSACTION Kind = "transaction"
	// ORIGINATION kind
	ORIGINATION Kind = "origination"
	// DELEGATION kind
	DELEGATION Kind = "delegation"
)

type Level

type Level struct {
	Level                int  `json:"level"`
	LevelPosition        int  `json:"level_position"`
	Cycle                int  `json:"cycle"`
	CyclePosition        int  `json:"cycle_position"`
	VotingPeriod         int  `json:"voting_period"`
	VotingPeriodPosition int  `json:"voting_period_position"`
	ExpectedCommitment   bool `json:"expected_commitment"`
}

Level represents the level in a Tezos block

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type Listings

type Listings []struct {
	PublicKeyHash string `json:"pkh"`
	Rolls         int    `json:"rolls"`
}

Listings represents a list of delegates with their voting weight, in number of rolls.

Path:

../<block_id>/votes/listings (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-listings

type MaxOperationListLength

type MaxOperationListLength struct {
	MaxSize int `json:"max_size"`
	MaxOp   int `json:"max_op,omitempty"`
}

MaxOperationListLength represents the maxoperationlistlength in a Tezos block

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type Metadata

type Metadata struct {
	Protocol               string                   `json:"protocol"`
	NextProtocol           string                   `json:"next_protocol"`
	TestChainStatus        TestChainStatus          `json:"test_chain_status"`
	MaxOperationsTTL       int                      `json:"max_operations_ttl"`
	MaxOperationDataLength int                      `json:"max_operation_data_length"`
	MaxBlockHeaderLength   int                      `json:"max_block_header_length"`
	MaxOperationListLength []MaxOperationListLength `json:"max_operation_list_length"`
	Baker                  string                   `json:"baker"`
	Level                  Level                    `json:"level"`
	VotingPeriodKind       string                   `json:"voting_period_kind"`
	NonceHash              interface{}              `json:"nonce_hash"`
	ConsumedGas            string                   `json:"consumed_gas"`
	Deactivated            []string                 `json:"deactivated"`
	BalanceUpdates         []BalanceUpdates         `json:"balance_updates"`
}

Metadata represents the metadata in a Tezos block

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type OperationResult

type OperationResult struct {
	Status                       string           `json:"status"`
	Storage                      *json.RawMessage `json:"storage"`
	BigMapDiff                   BigMapDiffs      `json:"big_map_diff"`
	BalanceUpdates               []BalanceUpdates `json:"balance_updates"`
	OriginatedContracts          []string         `json:"originated_contracts"`
	ConsumedGas                  string           `json:"consumed_gas,omitempty"`
	StorageSize                  string           `json:"storage_size,omitempty"`
	AllocatedDestinationContract bool             `json:"allocated_destination_contract,omitempty"`
	Errors                       []ResultError    `json:"errors,omitempty"`
}

OperationResult represents the operation result in a Tezos block

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type OperationResultDelegation

type OperationResultDelegation struct {
	Status      string   `json:"status"`
	ConsumedGas string   `json:"consumed_gas,omitempty"`
	Errors      []Errors `json:"errors,omitempty"`
}

OperationResultDelegation represents $operation.alpha.operation_result.delegation in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type OperationResultOrigination

type OperationResultOrigination struct {
	Status              string           `json:"status"`
	BigMapDiff          BigMapDiffs      `json:"big_map_diff,omitempty"`
	BalanceUpdates      []BalanceUpdates `json:"balance_updates,omitempty"`
	OriginatedContracts []string         `json:"originated_contracts,omitempty"`
	ConsumedGas         string           `json:"consumed_gas,omitempty"`
	StorageSize         string           `json:"storage_size,omitempty"`
	PaidStorageSizeDiff string           `json:"paid_storage_size_diff,omitempty"`
	Errors              []Errors         `json:"errors,omitempty"`
}

OperationResultOrigination represents $operation.alpha.operation_result.origination in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type OperationResultReveal

type OperationResultReveal struct {
	Status      string   `json:"status"`
	ConsumedGas string   `json:"consumed_gas,omitempty"`
	Errors      []Errors `json:"rpc_error,omitempty"`
}

OperationResultReveal represents an OperationResultReveal in the $operation.alpha.operation_result.reveal in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type OperationResultTransfer

type OperationResultTransfer struct {
	Status                       string           `json:"status"`
	Storage                      *json.RawMessage `json:"storage,omitempty"`
	BigMapDiff                   BigMapDiffs      `json:"big_map_diff,omitempty"`
	BalanceUpdates               []BalanceUpdates `json:"balance_updates,omitempty"`
	OriginatedContracts          []string         `json:"originated_contracts,omitempty"`
	ConsumedGas                  string           `json:"consumed_gas,omitempty"`
	StorageSize                  string           `json:"storage_size,omitempty"`
	PaidStorageSizeDiff          string           `json:"paid_storage_size_diff,omitempty"`
	AllocatedDestinationContract bool             `json:"allocated_destination_contract,omitempty"`
	Errors                       []Errors         `json:"errors,omitempty"`
}

OperationResultTransfer represents $operation.alpha.operation_result.transaction in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type OperationResults

type OperationResults struct {
	Status                       string           `json:"status"`
	BigMapDiff                   BigMapDiffs      `json:"big_map_diff,omitempty"`
	BalanceUpdates               []BalanceUpdates `json:"balance_updates,omitempty"`
	OriginatedContracts          []string         `json:"originated_contracts,omitempty"`
	ConsumedGas                  string           `json:"consumed_gas,omitempty"`
	StorageSize                  string           `json:"storage_size,omitempty"`
	PaidStorageSizeDiff          string           `json:"paid_storage_size_diff,omitempty"`
	Errors                       []Errors         `json:"errors,omitempty"`
	Storage                      *json.RawMessage `json:"storage,omitempty"`
	AllocatedDestinationContract bool             `json:"allocated_destination_contract,omitempty"`
}

OperationResults represents the operation_results in Tezos operations.

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type Operations

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

Operations represents the operations in a Tezos block

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type OrganizedBigMapDiff

type OrganizedBigMapDiff struct {
	Updates  []BigMapDiffUpdate
	Removals []BigMapDiffRemove
	Copies   []BigMapDiffCopy
	Allocs   []BigMapDiffAlloc
}

OrganizedBigMapDiff represents a BigMapDiffs organized by kind.

func (*OrganizedBigMapDiff) ToBigMapDiffs

func (o *OrganizedBigMapDiff) ToBigMapDiffs() BigMapDiffs

ToBigMapDiffs converts OrganizedBigMapDiff to BigMapDiffs

type OrganizedContents

type OrganizedContents struct {
	Endorsements              []Endorsement
	SeedNonceRevelations      []SeedNonceRevelation
	DoubleEndorsementEvidence []DoubleEndorsementEvidence
	DoubleBakingEvidence      []DoubleBakingEvidence
	AccountActivations        []AccountActivation
	Proposals                 []Proposal
	Ballots                   []Ballot
	Reveals                   []Reveal
	Transactions              []Transaction
	Originations              []Origination
	Delegations               []Delegation
}

OrganizedContents represents the contents in Tezos operations orginized by kind.

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*OrganizedContents) MarshalJSON

func (o *OrganizedContents) MarshalJSON() ([]byte, error)

MarshalJSON satisfies the json.MarshalJSON interface for contents

func (*OrganizedContents) ToContents

func (o *OrganizedContents) ToContents() Contents

ToContents converts OrganizedContents into Contents

type Origination

type Origination struct {
	Kind          Kind                 `json:"kind"`
	Source        string               `json:"source" validate:"required"`
	Fee           string               `json:"fee" validate:"required"`
	Counter       string               `json:"counter" validate:"required"`
	GasLimit      string               `json:"gas_limit" validate:"required"`
	StorageLimit  string               `json:"storage_limit" validate:"required"`
	Balance       string               `json:"balance"`
	Delegate      string               `json:"delegate,omitempty"`
	Script        Script               `json:"script" validate:"required"`
	ManagerPubkey string               `json:"managerPubkey,omitempty"`
	Metadata      *OriginationMetadata `json:"metadata"`
}

Origination represents a Origination in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*Origination) ToContent

func (o *Origination) ToContent() Content

ToContent converts a Origination to Content

type OriginationMetadata

type OriginationMetadata struct {
	BalanceUpdates           []BalanceUpdates           `json:"balance_updates"`
	OperationResults         OperationResultOrigination `json:"operation_result"`
	InternalOperationResults []InternalOperationResults `json:"internal_operation_results,omitempty"`
}

OriginationMetadata represents the metadata of Origination in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type Parameters

type Parameters struct {
	Entrypoint string           `json:"entrypoint"`
	Value      *json.RawMessage `json:"value"`
}

Parameters represents parameters in Tezos operations.

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type PreapplyOperationsInput

type PreapplyOperationsInput struct {
	Blockhash  string `validate:"required"`
	Operations []Operations
}

PreapplyOperationsInput is the input for the PreapplyOperations.

Function:

func PreapplyOperations(input PreapplyOperationsInput) ([]byte, error) {}

type Proposal

type Proposal struct {
	Kind      Kind     `json:"kind"`
	Source    string   `json:"source"`
	Period    int      `json:"period"`
	Proposals []string `json:"proposals"`
}

Proposal represents a Proposal in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*Proposal) ToContent

func (p *Proposal) ToContent() Content

ToContent converts a Proposal to Content

type Proposals

type Proposals []struct {
	Hash       string
	Supporters int
}

Proposals represents a list of proposals with number of supporters.

Path:

../<block_id>/votes/proposals (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-votes-proposals

func (*Proposals) UnmarshalJSON

func (p *Proposals) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Marshaler interface for Proposals

Parameters:

b:
	The byte representation of a Proposals.

type ResultError

type ResultError struct {
	Kind           string           `json:"kind"`
	ID             string           `json:"id,omitempty"`
	With           *json.RawMessage `json:"with,omitempty"`
	Msg            string           `json:"msg,omitempty"`
	Location       int              `json:"location,omitempty"`
	ContractHandle string           `json:"contract_handle,omitempty"`
	ContractCode   *json.RawMessage `json:"contract_code,omitempty"`
}

ResultError are errors reported by OperationResults

type Reveal

type Reveal struct {
	Kind         Kind            `json:"kind"`
	Source       string          `json:"source" validate:"required"`
	Fee          string          `json:"fee" validate:"required"`
	Counter      string          `json:"counter" validate:"required"`
	GasLimit     string          `json:"gas_limit" validate:"required"`
	StorageLimit string          `json:"storage_limit"`
	PublicKey    string          `json:"public_key" validate:"required"`
	Metadata     *RevealMetadata `json:"metadata"`
}

Reveal represents a Reveal in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*Reveal) ToContent

func (r *Reveal) ToContent() Content

ToContent converts a Reveal to Content

type RevealMetadata

type RevealMetadata struct {
	BalanceUpdates           []BalanceUpdates           `json:"balance_updates"`
	OperationResult          OperationResultReveal      `json:"operation_result"`
	InternalOperationResults []InternalOperationResults `json:"internal_operation_result,omitempty"`
}

RevealMetadata represents the metadata for Reveal in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type RunOperation

type RunOperation struct {
	Operation Operations `json:"operation" validate:"required"`
	ChainID   string     `json:"chain_id" validate:"required"`
}

RunOperation is a sub structure of RunOperationInput

type RunOperationInput

type RunOperationInput struct {
	Blockhash string       `validate:"required"`
	Operation RunOperation `json:"operation" validate:"required"`
}

RunOperationInput is the input for the rpc.RunOperation function.

Function:

func (c *Client) RunOperation(input RunOperationInput) (Operations, error)

type Script

type Script struct {
	Code    *json.RawMessage `json:"code,omitempty"`
	Storage *json.RawMessage `json:"storage,omitempty"`
}

Script represents the script in an Origination in the $operation.alpha.operation_contents_and_result -> $scripted.contracts in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type ScriptExpression

type ScriptExpression string

ScriptExpression is a string that will eventually be forged into a script_expression

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id-context-big-maps-big-map-id-script-expr

func ForgeScriptExpressionForAddress

func ForgeScriptExpressionForAddress(input string) (ScriptExpression, error)

ForgeScriptExpressionForAddress - A helper to forge a source account for a big_map script_exp

type ScriptedContracts

type ScriptedContracts struct {
	Code    *json.RawMessage `json:"code"`
	Storage *json.RawMessage `json:"storage"`
}

ScriptedContracts represents $scripted.contracts in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type SeedNonceRevelation

type SeedNonceRevelation struct {
	Kind     Kind                         `json:"kind"`
	Level    int                          `json:"level"`
	Nonce    string                       `json:"nonce"`
	Metadata *SeedNonceRevelationMetadata `json:"metadata"`
}

SeedNonceRevelation represents an Seed_nonce_revelation in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*SeedNonceRevelation) ToContent

func (s *SeedNonceRevelation) ToContent() Content

ToContent converts a SeedNonceRevelation to Content

type SeedNonceRevelationMetadata

type SeedNonceRevelationMetadata struct {
	BalanceUpdates []BalanceUpdates `json:"balance_updates"`
}

SeedNonceRevelationMetadata represents the metadata for Seed_nonce_revelation in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type StakingBalanceInput

type StakingBalanceInput struct {
	// The block level of which you want to make the query. If empty Cycle is required.
	Blockhash string
	// The cycle to get the balance at. If empty Blockhash is required.
	Cycle int
	// The delegate that you want to make the query.
	Delegate string `validate:"required"`
}

StakingBalanceInput is the input for the goTezos.StakingBalance function.

Function:

func (t *GoTezos) StakingBalance(blockhash, delegate string) (int, error) {}

type TestChainStatus

type TestChainStatus struct {
	Status     string    `json:"status"`
	Protocol   string    `json:"protocol"`
	ChainID    string    `json:"chain_id"`
	Genesis    string    `json:"genesis"`
	Expiration time.Time `json:"expiration"`
}

TestChainStatus represents the testchainstatus in a Tezos block

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type Transaction

type Transaction struct {
	Kind         Kind                 `json:"kind"`
	Source       string               `json:"source" validate:"required"`
	Fee          string               `json:"fee" validate:"required"`
	Counter      string               `json:"counter" validate:"required"`
	GasLimit     string               `json:"gas_limit" validate:"required"`
	StorageLimit string               `json:"storage_limit"`
	Amount       string               `json:"amount"`
	Destination  string               `json:"destination" validate:"required"`
	Parameters   *Parameters          `json:"parameters,omitempty"`
	Metadata     *TransactionMetadata `json:"metadata,omitempty"`
}

Transaction represents a Transaction in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

func (*Transaction) ToContent

func (t *Transaction) ToContent() Content

ToContent converts a Transaction to Content

type TransactionMetadata

type TransactionMetadata struct {
	BalanceUpdates           []BalanceUpdates           `json:"balance_updates"`
	OperationResult          OperationResultTransfer    `json:"operation_result"`
	InternalOperationResults []InternalOperationResults `json:"internal_operation_results,omitempty"`
}

TransactionMetadata represents the metadata of Transaction in the $operation.alpha.operation_contents_and_result in the tezos block schema

RPC:

/chains/<chain_id>/blocks/<block_id> (<dyn>)

Link:

https://tezos.gitlab.io/api/rpc.html#get-block-id

type UnforgeOperation

type UnforgeOperation struct {
	Data   string `json:"data" validate:"required"`
	Branch string `json:"branch" validate:"required"`
}

UnforgeOperation is a sub structure of UnforgeOperationWithRPCInput

type UnforgeOperationInput

type UnforgeOperationInput struct {
	Blockhash      string             `validate:"required"`
	Operations     []UnforgeOperation `json:"operations" validate:"required"`
	CheckSignature bool               `json:"check_signature"`
}

UnforgeOperationInput is the input for the goTezos.UnforgeOperationWithRPC function.

Function:

func (c *Client) UnforgeOperationWithRPC(blockhash string, operation string, checkSignature bool) (Operations, error) {}

type UserActivatedProtocolOverrides

type UserActivatedProtocolOverrides struct {
	ReplacedProtocol    string `json:"replaced_protocol"`
	ReplacementProtocol string `json:"replacement_protocol"`
}

UserActivatedProtocolOverrides represents user activated protocl overrides on the Tezos network.

RPC:

/config/network/user_activated_protocol_overrides (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-config-network-user-activated-protocol-overrides

type Version

type Version struct {
	ChainName            string `json:"chain_name"`
	DistributedDbVersion int    `json:"distributed_db_version"`
	P2PVersion           int    `json:"p2p_version"`
}

Version represents the Version RPC.

RPC:

/network/version (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-network-version

Jump to

Keyboard shortcuts

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