goTezos: github.com/DefinitelyNotAGoat/goTezos Index | Files | Directories

package gotezos

import "github.com/DefinitelyNotAGoat/goTezos"

Index

Package Files

account.go block.go chains.go config.go contracts.go crypto.go delegate.go gotezos.go iface.go network.go operations.go

Constants

const (
    // TRANSACTIONOP is a kind of operation
    TRANSACTIONOP = "transaction"
    // REVEALOP is a kind of operation
    REVEALOP = "reveal"
    // ORIGINATIONOP is a kind of operation
    ORIGINATIONOP = "origination"
    // DELEGATIONOP is a kind of operation
    DELEGATIONOP = "delegation"
)
const MUTEZ = 1000000

MUTEZ is mutez on the tezos network

func ForgeDelegationOperation Uses

func ForgeDelegationOperation(branch string, input ForgeDelegationOperationInput) (*string, error)

ForgeDelegationOperation forges a delegation operation(s) locally. GoTezos does not use the RPC or a trusted source to forge operations. Current supported operations include transfer, reveal, delegation, and origination.

Parameters:

branch:
	The branch to forge the operation on.

input:
	The delegation contents to be formed.

func ForgeOperation Uses

func ForgeOperation(branch string, contents ...Contents) (*string, error)

ForgeOperation forges an operation locally. GoTezos does not use the RPC or a trusted source to forge operations. Current supported operations include transfer, reveal, delegation, and origination.

Parameters:

branch:
	The branch to forge the operation on.

contents:
	The operation contents to be formed.

func ForgeOriginationOperation Uses

func ForgeOriginationOperation(branch string, input ForgeOriginationOperationInput) (*string, error)

ForgeOriginationOperation forges a origination operation(s) locally. GoTezos does not use the RPC or a trusted source to forge operations. Current supported operations include transfer, reveal, delegation, and origination.

Parameters:

branch:
	The branch to forge the operation on.

input:
	The origination contents to be formed.

func ForgeRevealOperation Uses

func ForgeRevealOperation(branch string, input ForgeRevealOperationInput) (*string, error)

ForgeRevealOperation forges a reveal operation(s) locally. GoTezos does not use the RPC or a trusted source to forge operations. Current supported operations include transfer, reveal, delegation, and origination.

Parameters:

branch:
	The branch to forge the operation on.

input:
	The reveal contents to be formed.

func ForgeTransactionOperation Uses

func ForgeTransactionOperation(branch string, input ...ForgeTransactionOperationInput) (*string, error)

ForgeTransactionOperation forges a transaction operation(s) locally. GoTezos does not use the RPC or a trusted source to forge operations. Current supported operations include transfer, reveal, delegation, and origination.

Parameters:

branch:
	The branch to forge the operation on.

input:
	The transaction contents to be formed.

func UnforgeOperation Uses

func UnforgeOperation(operation string, signed bool) (*string, *[]Contents, error)

UnforgeOperation takes a forged/encoded tezos operation and decodes it by returning the operations branch, and contents.

Parameters:

operation:
	The hex string encoded operation.

signed:
	The ?true Unforge will decode a signed operation.

type ActiveChains Uses

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 Uses

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 Uses

type BakingRightsInput struct {
    // 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

    // The hash of block (height) of which you want to make the query.
    // Required.
    BlockHash *string `validate:"required"`
}

BakingRightsInput is the input for the goTezos.BakingRights function.

Function:

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

type BalanceUpdates Uses

type BalanceUpdates struct {
    Kind     string `json:"kind"`
    Contract string `json:"contract,omitempty"`
    Change   *Int   `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-context-contracts-contract-id-balance

type Block Uses

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-context-contracts-contract-id-balance

type BlocksInput Uses

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 Uses

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 Uses

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 Connections Uses

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 Uses

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"`
    HardGasLimitPerBlock         *Int     `json:"hard_gas_limit_per_block"`
    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"`
    EndorsementSecurityDeposit   *Int     `json:"endorsement_security_deposit"`
    BlockReward                  []*Int   `json:"block_reward"`
    EndorsementReward            []*Int   `json:"endorsement_reward"`
    CostPerByte                  *Int     `json:"cost_per_byte"`
    HardStorageLimitPerOperation *Int     `json:"hard_storage_limit_per_operation"`
}

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 Contents Uses

type Contents struct {
    Kind             string            `json:"kind,omitempty"`
    Source           string            `json:"source,omitempty"`
    Fee              *Int              `json:"fee,omitempty"`
    Counter          *Int              `json:"counter,omitempty"`
    GasLimit         *Int              `json:"gas_limit,omitempty"`
    StorageLimit     *Int              `json:"storage_limit,omitempty"`
    Amount           *Int              `json:"amount,omitempty"`
    Destination      string            `json:"destination,omitempty"`
    Delegate         string            `json:"delegate,omitempty"`
    Phk              string            `json:"phk,omitempty"`
    Secret           string            `json:"secret,omitempty"`
    Level            int               `json:"level,omitempty"`
    ManagerPublicKey string            `json:"managerPubkey,omitempty"`
    Balance          *Int              `json:"balance,omitempty"`
    Period           int               `json:"period,omitempty"`
    Proposal         string            `json:"proposal,omitempty"`
    Proposals        []string          `json:"proposals,omitempty"`
    Ballot           string            `json:"ballot,omitempty"`
    Metadata         *ContentsMetadata `json:"metadata,omitempty"`
}

Contents represents the contents in a Tezos operations

RPC:

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

Link:

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

type ContentsMetadata Uses

type ContentsMetadata struct {
    BalanceUpdates           []BalanceUpdates            `json:"balance_updates"`
    OperationResult          *OperationResult            `json:"operation_result,omitempty"`
    Slots                    []int                       `json:"slots"`
    InternalOperationResults []*InternalOperationResults `json:"internal_operation_results,omitempty"`
}

ContentsMetadata represents the contents metadata in a Tezos operations

RPC:

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

Link:

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

type Cycle Uses

type Cycle struct {
    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 Uses

type Delegate struct {
    Balance              string `json:"balance"`
    FrozenBalance        string `json:"frozen_balance"`
    FrozenBalanceByCycle []struct {
        Cycle   int  `json:"cycle"`
        Deposit *Int `json:"deposit"`
        Fees    *Int `json:"fees"`
        Rewards *Int `json:"rewards"`
    }   `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 DelegatesInput Uses

type DelegatesInput struct {

    // The hash of block (height) of which you want to make the query.
    // Required.
    BlockHash *string `validate:"required"`
    // contains filtered or unexported fields
}

DelegatesInput is the input for the goTezos.Delegates function.

Function:

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

type EndorsingRights Uses

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-baking-rights

type EndorsingRightsInput Uses

type EndorsingRightsInput struct {
    // 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 hash of block (height) of which you want to make the query.
    // Required.
    BlockHash *string `validate:"required"`
}

EndorsingRightsInput is the input for the goTezos.EndorsingRights function.

Function:

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

type Error Uses

type Error struct {
    Kind string `json:"kind"`
    ID   string `json:"id"`
}

Error respresents an error for operation results

RPC:

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

Link:

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

type ForgeDelegationOperationInput Uses

type ForgeDelegationOperationInput struct {
    Source       string `validate:"required"`
    Fee          *Int   `validate:"required"`
    Counter      int    `validate:"required"`
    GasLimit     *Int   `validate:"required"`
    Delegate     string `validate:"required"`
    StorageLimit *Int
}

ForgeDelegationOperationInput is the input for the ForgeDelegationOperation function.

Function:

func ForgeDelegationOperation(branch string, input ...ForgeDelegationOperationInput) (*string, error) {}

func (*ForgeDelegationOperationInput) Contents Uses

func (f *ForgeDelegationOperationInput) Contents() *Contents

Contents returns ForgeDelegationOperationInput as a pointer to Contents

type ForgeOriginationOperationInput Uses

type ForgeOriginationOperationInput struct {
    Source       string `validate:"required"`
    Fee          *Int   `validate:"required"`
    Counter      int    `validate:"required"`
    GasLimit     *Int   `validate:"required"`
    Balance      *Int   `validate:"required"`
    StorageLimit *Int
    Delegate     string
}

ForgeOriginationOperationInput is the input for the ForgeOriginationOperation function.

Function:

func ForgeOriginationOperation(branch string, input ...ForgeOriginationOperationInput) (*string, error) {}

func (*ForgeOriginationOperationInput) Contents Uses

func (f *ForgeOriginationOperationInput) Contents() *Contents

Contents returns ForgeOriginationOperationInput as a pointer to Contents

type ForgeRevealOperationInput Uses

type ForgeRevealOperationInput struct {
    Source       string `validate:"required"`
    Fee          *Int   `validate:"required"`
    Counter      int    `validate:"required"`
    GasLimit     *Int   `validate:"required"`
    Phk          string `validate:"required"`
    StorageLimit *Int
}

ForgeRevealOperationInput is the input for the ForgeRevalOperation function.

Function:

func ForgeRevalOperation(branch string, input ...ForgeRevealOperationInput) (*string, error) {}

func (*ForgeRevealOperationInput) Contents Uses

func (f *ForgeRevealOperationInput) Contents() *Contents

Contents returns ForgeRevealOperationInput as a pointer to Contents

type ForgeTransactionOperationInput Uses

type ForgeTransactionOperationInput struct {
    Source       string `validate:"required"`
    Fee          *Int   `validate:"required"`
    Counter      int    `validate:"required"`
    GasLimit     *Int   `validate:"required"`
    Destination  string `validate:"required"`
    Amount       *Int   `validate:"required"`
    StorageLimit *Int
}

ForgeTransactionOperationInput is the input for the ForgeTransactionOperation function.

Function:

func ForgeTransactionOperation(branch string, input ...ForgeTransactionOperationInput) (*string, error) {}

func (*ForgeTransactionOperationInput) Contents Uses

func (f *ForgeTransactionOperationInput) Contents() *Contents

Contents returns ForgeTransactionOperationInput as a pointer to Contents

type FrozenBalance Uses

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

type GoTezos Uses

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

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

func New Uses

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

New returns a pointer to a GoTezos and initializes the library with the host's Tezos netowrk constants.

Parameters:

host:
	A Tezos node.

func (*GoTezos) ActiveChains Uses

func (t *GoTezos) 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 (*GoTezos) BakingRights Uses

func (t *GoTezos) 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

Parameters:

BakingRightsInput:
	Modifies the BakingRights RPC query by passing optional URL parameters. BlockHash is required.

func (*GoTezos) Balance Uses

func (t *GoTezos) Balance(blockhash, address string) (*big.Int, 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

Parameters:

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

address:
	Any tezos public address.

func (*GoTezos) Block Uses

func (t *GoTezos) Block(id interface{}) (*Block, error)

Block gets all the information about block.RPC

Path

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

Link

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

Parameters:

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

func (*GoTezos) Blocks Uses

func (t *GoTezos) 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 (*GoTezos) Bootstrap Uses

func (t *GoTezos) 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 (*GoTezos) ChainID Uses

func (t *GoTezos) 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 (*GoTezos) Checkpoint Uses

func (t *GoTezos) 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 (*GoTezos) Commit Uses

func (t *GoTezos) 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 (*GoTezos) Connections Uses

func (t *GoTezos) 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 (*GoTezos) Constants Uses

func (t *GoTezos) 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 (*GoTezos) ContractStorage Uses

func (t *GoTezos) ContractStorage(blockhash string, KT1 string) ([]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

Parameters:

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

KT1:
	The contract address.

func (*GoTezos) Counter Uses

func (t *GoTezos) Counter(blockhash, pkh string) (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

Parameters:

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

pkh:
	The pkh (address) of the contract for the query.

func (*GoTezos) Cycle Uses

func (t *GoTezos) 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 (*GoTezos) Delegate Uses

func (t *GoTezos) Delegate(blockhash, delegate string) (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

Parameters:

cycle:
	The cycle of which you want to make the query.

delegate:
	The tz(1-3) address of the delegate.

func (*GoTezos) DelegatedContracts Uses

func (t *GoTezos) DelegatedContracts(blockhash, delegate string) ([]*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

Parameters:

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

delegate:
	The tz(1-3) address of the delegate.

func (*GoTezos) DelegatedContractsAtCycle Uses

func (t *GoTezos) DelegatedContractsAtCycle(cycle int, delegate string) ([]*string, error)

DelegatedContractsAtCycle returns the list of contracts that delegate to a given delegate at a specific cycle or snapshot.

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

Parameters:

cycle:
	The cycle of which you want to make the query.

delegate:
	The tz(1-3) address of the delegate.

func (*GoTezos) Delegates Uses

func (t *GoTezos) 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

Parameters:

cycle:
	The cycle of which you want to make the query.

delegate:
	The tz(1-3) address of the delegate.

func (*GoTezos) DeleteInvalidBlock Uses

func (t *GoTezos) 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 (*GoTezos) EndorsingRights Uses

func (t *GoTezos) 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

Parameters:

EndorsingRightsInput:
	Modifies the EndorsingRights RPC query by passing optional URL parameters. BlockHash is required.

func (*GoTezos) FrozenBalance Uses

func (t *GoTezos) FrozenBalance(cycle int, delegate string) (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

Parameters:

cycle:
	The cycle of which you want to make the query.

delegate:
	The tz(1-3) address of the delegate.

func (*GoTezos) Head Uses

func (t *GoTezos) 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 (*GoTezos) InjectionBlock Uses

func (t *GoTezos) 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

Parameters:

input:
	Modifies the InjectionBlock RPC query by passing optional URL parameters. Block is required.

func (*GoTezos) InjectionOperation Uses

func (t *GoTezos) InjectionOperation(input InjectionOperationInput) ([]byte, 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

Parameters:

input:
	Modifies the InjectionOperation RPC query by passing optional URL parameters. Operation is required.

func (*GoTezos) InvalidBlock Uses

func (t *GoTezos) 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 (*GoTezos) InvalidBlocks Uses

func (t *GoTezos) 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 (*GoTezos) OperationHashes Uses

func (t *GoTezos) 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 (*GoTezos) PreapplyOperations Uses

func (t *GoTezos) PreapplyOperations(blockhash string, contents []Contents, signature string) ([]byte, 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

Parameters:

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

contents:
	The contents of the of the operation.

signature:
	The operation signature.

func (*GoTezos) SetClient Uses

func (t *GoTezos) SetClient(client *http.Client)

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

Parameters:

client:
	A pointer to an http.Client.

func (*GoTezos) SetConstants Uses

func (t *GoTezos) SetConstants(constants Constants)

SetConstants overrides GoTezos's networkConstants.

Parameters:

constants:
	Tezos Network Constants.

func (*GoTezos) StakingBalance Uses

func (t *GoTezos) StakingBalance(blockhash, delegate string) (*big.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:

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

delegate:
	The tz(1-3) address of the delegate.

func (*GoTezos) StakingBalanceAtCycle Uses

func (t *GoTezos) StakingBalanceAtCycle(cycle int, delegate string) (*big.Int, error)

StakingBalanceAtCycle 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:

cycle:
	The cycle of which you want to make the query.

delegate:
	The tz(1-3) address of the delegate.

func (*GoTezos) UserActivatedProtocolOverrides Uses

func (t *GoTezos) 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 (*GoTezos) Version Uses

func (t *GoTezos) Version() (Version, error)

Version gets supported network layer version.

Path:

/network/version (GET)

Link:

https://tezos.gitlab.io/api/rpc.html#get-network-version
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"`
    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-context-contracts-contract-id-balance

type IFace Uses

type IFace interface {
    ActiveChains() (ActiveChains, error)
    BakingRights(input BakingRightsInput) (*BakingRights, error)
    Balance(blockhash, address string) (*big.Int, 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(blockhash string, KT1 string) ([]byte, error)
    Counter(blockhash, pkh string) (int, error)
    Cycle(cycle int) (Cycle, error)
    Delegate(blockhash, delegate string) (Delegate, error)
    Delegates(input DelegatesInput) ([]*string, error)
    DelegatedContracts(blockhash, delegate string) ([]*string, error)
    DelegatedContractsAtCycle(cycle int, delegate string) ([]*string, error)
    DeleteInvalidBlock(blockHash string) error
    EndorsingRights(input EndorsingRightsInput) (*EndorsingRights, error)
    FrozenBalance(cycle int, delegate string) (FrozenBalance, error)
    Head() (*Block, error)
    InjectionBlock(input InjectionBlockInput) ([]byte, error)
    InjectionOperation(input InjectionOperationInput) ([]byte, error)
    InvalidBlock(blockHash string) (InvalidBlock, error)
    InvalidBlocks() ([]InvalidBlock, error)
    OperationHashes(blockhash string) ([][]string, error)
    PreapplyOperations(blockhash string, contents []Contents, signature string) ([]byte, error)
    StakingBalance(blockhash, delegate string) (*big.Int, error)
    StakingBalanceAtCycle(cycle int, delegate string) (*big.Int, error)
    UserActivatedProtocolOverrides() (UserActivatedProtocolOverrides, error)
    Version() (Version, error)
}

IFace is an interface mocking a GoTezos object.

type InjectionBlockInput Uses

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 (t *GoTezos) InjectionBlock(input InjectionBlockInput) ([]byte, error) {}

type InjectionOperationInput Uses

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 (t *GoTezos) InjectionOperation(input InjectionOperationInput) ([]byte, error) {}

type Int Uses

type Int struct {
    Big *big.Int
}

Int Wrapper Description: Int wraps go's big.Int.

func NewInt Uses

func NewInt(i int) *Int

NewInt returns a pointer GoTezos's wrapper Int

func (*Int) MarshalJSON Uses

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

MarshalJSON implements the json.Marshaler interface for BigInt

func (*Int) UnmarshalJSON Uses

func (i *Int) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Marshaler interface for BigInt

Parameters:

b:
	The byte representation of a BigInt.

type InternalOperationResults Uses

type InternalOperationResults struct {
    Kind        string           `json:"kind"`
    Source      string           `json:"source"`
    Nonce       uint64           `json:"nonce"`
    Amount      string           `json:"amount"`
    Destination string           `json:"destination"`
    Result      *OperationResult `json:"result"`
}

InternalOperationResults represents a field in contents metadata in a Tezos operations

RPC:

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

Link:

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

type InvalidBlock Uses

type InvalidBlock struct {
    Block  string    `json:"block"`
    Level  int       `json:"level"`
    Errors RPCErrors `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 Level Uses

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-context-contracts-contract-id-balance

type MaxOperationListLength Uses

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-context-contracts-contract-id-balance

type Metadata Uses

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-context-contracts-contract-id-balance

type OperationResult Uses

type OperationResult struct {
    BalanceUpdates      []BalanceUpdates `json:"balance_updates"`
    OriginatedContracts []string         `json:"originated_contracts"`
    Status              string           `json:"status"`
    ConsumedGas         *Int             `json:"consumed_gas,omitempty"`
    Errors              []Error          `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-context-contracts-contract-id-balance

type Operations Uses

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

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-context-contracts-contract-id-balance

type RPCError Uses

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

RPCError represents and RPC error

func (*RPCError) Error Uses

func (r *RPCError) Error() string

type RPCErrors Uses

type RPCErrors []RPCError

RPCErrors represents multiple RPCError(s).s

type TestChainStatus Uses

type TestChainStatus struct {
    Status string `json:"status"`
}

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-context-contracts-contract-id-balance

type UserActivatedProtocolOverrides Uses

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 Uses

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

type Wallet Uses

type Wallet struct {
    Address  string
    Mnemonic string
    Seed     []byte
    Kp       keyPair
    Sk       string
    Pk       string
}

Wallet is a Tezos wallet.

func CreateWallet Uses

func CreateWallet(mnenomic string, password string) (*Wallet, error)

CreateWallet creates a new wallet.

Parameters:

mnenomic:
	The seed phrase for the new wallet.

password:
	The password for the wallet.

func ImportEncryptedWallet Uses

func ImportEncryptedWallet(password, esk string) (*Wallet, error)

ImportEncryptedWallet imports an encrypted wallet.

Parameters:

password:
	The password for the wallet.

esk:
	The encrypted secret key of the wallet (encrypted:edesk).

func ImportWallet Uses

func ImportWallet(hash, pk, sk string) (*Wallet, error)

ImportWallet imports an unencrypted wallet.

Parameters:

hash:
	The public key hash of the wallet (tz1, KT1).

pk:
	The public key of the wallet (edpk).

sk:
	The secret key of the wallet (edsk).

func (*Wallet) SignOperation Uses

func (w *Wallet) SignOperation(operation string) (string, error)

SignOperation will return an operation string signed by wallet

Directories

PathSynopsis
account
block
cycle
gt

Package gotezos imports 24 packages (graph). Updated 2020-04-05. Refresh now. Tools for package owners.