morley-client-0.1.1: Client to interact with the Tezos blockchain
Safe HaskellNone
LanguageHaskell2010

Morley.Client.RPC.Types

Description

This module contains various types which are used in tezos-node RPC API.

Documentation for RPC API can be found e. g. here (010 is the protocol, change to the desired one).

Note that errors are reported a bit inconsistently by RPC. For more information see this question and this issue.

Synopsis

Documentation

data AppliedResult Source #

Constructors

AppliedResult 

Fields

newtype BlockHash Source #

Constructors

BlockHash 

Fields

data FeeConstants Source #

Constructors

FeeConstants 

Instances

Instances details
Default FeeConstants Source #

At the moment of writing, Tezos always uses these constants.

Instance details

Defined in Morley.Client.RPC.Types

Methods

def :: FeeConstants #

data BlockId Source #

A block identifier as submitted to RPC.

A block can be referenced by head, genesis, level or block hash

Constructors

HeadId

Identifier referring to the head block.

FinalHeadId

Identifier of the most recent block guaranteed to have been finalized. See: https://web.archive.org/web/20220305165609/https://tezos.gitlab.io/protocols/tenderbake.html#operations

GenesisId

Identifier referring to the genesis block.

LevelId Natural

Identifier referring to a block by its level.

BlockHashId Text

Idenfitier referring to a block by its hash in Base58Check notation.

AtDepthId Natural

Identifier of a block at specific depth relative to head.

Instances

Instances details
Eq BlockId Source # 
Instance details

Defined in Morley.Client.RPC.Types

Methods

(==) :: BlockId -> BlockId -> Bool #

(/=) :: BlockId -> BlockId -> Bool #

Show BlockId Source # 
Instance details

Defined in Morley.Client.RPC.Types

Buildable BlockId Source # 
Instance details

Defined in Morley.Client.RPC.Types

Methods

build :: BlockId -> Builder #

ToHttpApiData BlockId Source # 
Instance details

Defined in Morley.Client.RPC.Types

HasCLReader BlockId Source # 
Instance details

Defined in Morley.Client.RPC.Types

data BlockOperation Source #

$operation in Tezos docs.

Constructors

BlockOperation 

Instances

Instances details
FromJSON BlockOperation Source # 
Instance details

Defined in Morley.Client.RPC.Types

data CommonOperationData Source #

Data that is common for transaction and origination operations.

Constructors

CommonOperationData 

Fields

data GetBigMap Source #

Constructors

GetBigMap 

Fields

Instances

Instances details
ToJSON GetBigMap Source # 
Instance details

Defined in Morley.Client.RPC.Types

data GetBigMapResult Source #

Constructors

GetBigMapResult Expression 
GetBigMapNotFound 

Instances

Instances details
FromJSON GetBigMapResult Source # 
Instance details

Defined in Morley.Client.RPC.Types

data OperationResp Source #

Contents of an operation that can appear in RPC responses.

Constructors

TransactionOpResp TransactionOperation

Operation with kind transaction.

OtherOpResp

Operation with kind that we don't support yet (but need to parse to something).

Instances

Instances details
FromJSON OperationResp Source # 
Instance details

Defined in Morley.Client.RPC.Types

data OriginationOperation Source #

All the data needed to perform contract origination through Tezos RPC interface

Constructors

OriginationOperation 

Fields

data ProtocolParameters Source #

Protocol-wide constants.

There are more constants, but currently, we are using only these in our code.

Constructors

ProtocolParameters 

Fields

data RevealOperation Source #

All the data needed to perform key revealing through Tezos RPC interface

Constructors

RevealOperation 

Fields

data RunCode Source #

Data required for calling run_code RPC endpoint.

Constructors

RunCode 

Fields

Instances

Instances details
ToJSON RunCode Source # 
Instance details

Defined in Morley.Client.RPC.Types

data RunCodeResult Source #

Result storage of run_code RPC endpoint call.

Actual resulting JSON has more contents, but currently we're interested only in resulting storage.

Constructors

RunCodeResult 

Fields

Instances

Instances details
FromJSON RunCodeResult Source # 
Instance details

Defined in Morley.Client.RPC.Types

data TransactionOperation Source #

All the data needed to perform a transaction through Tezos RPC interface. For additional information, please refer to RPC documentation http://tezos.gitlab.io/api/rpc.html

Constructors

TransactionOperation 

Fields

mkCommonOperationData :: Address -> TezosInt64 -> ProtocolParameters -> CommonOperationData Source #

Create CommonOperationData based on current blockchain protocol parameters and sender info. This data is used for operation simulation.

Fee isn't accounted during operation simulation, so it's safe to use zero amount. Real operation fee is calculated later using 'tezos-client'.

Errors

data RunError Source #

Errors that are sent as part of operation result in an OK response (status 200). They are semi-formally defined as errors that can happen when a contract is executed and something goes wrong.

Constructors

RuntimeError Address 
ScriptRejected Expression 
BadContractParameter Address 
InvalidConstant Expression Expression 
InvalidContract Address 
InconsistentTypes Expression Expression 
InvalidPrimitive [Text] Text 
InvalidSyntacticConstantError Expression Expression 
InvalidExpressionKind [Text] Text 
InvalidContractNotation Text 
UnexpectedContract 
IllFormedType Expression 
UnexpectedOperation 
REEmptyTransaction

Transfer of 0 to an implicit account.

Fields

  • Address

    Receiver address.

ScriptOverflow

A contract failed due to the detection of an overflow. It seems to happen if a too big value is passed to shift instructions (as second argument).

GasExhaustedOperation 
MutezAdditionOverflow [TezosInt64] 
MutezSubtractionUnderflow [TezosInt64] 
MutezMultiplicationOverflow TezosInt64 TezosInt64 
CantPayStorageFee 
BalanceTooLow ("balance" :! Mutez) ("required" :! Mutez) 
PreviouslyRevealedKey Address 
NonExistingContract Address 

Instances

Instances details
Show RunError Source # 
Instance details

Defined in Morley.Client.RPC.Types

FromJSON RunError Source # 
Instance details

Defined in Morley.Client.RPC.Types

Buildable RunError Source # 
Instance details

Defined in Morley.Client.RPC.Types

Methods

build :: RunError -> Builder #

data InternalError Source #

Errors that are sent as part of an "Internal Server Error" response (HTTP code 500).

We call them internal because of the HTTP code, but we shouldn't treat them as internal. They can be easily triggered by making a failing operation.

Constructors

CounterInThePast

An operation assumed a contract counter in the past.

Fields

  • Address

    Address whose counter is invalid.

  • ("expected" :! Word)

    Expected counter.

  • ("found" :! Word)

    Found counter.

UnrevealedKey

One tried to apply a manager operation without revealing the manager public key.

Fields

  • Address

    Manager address.

Failure Text

Failure reported without specific id

Prisms

_InvalidConstant :: Prism' RunError (Expression, Expression) Source #

_InconsistentTypes :: Prism' RunError (Expression, Expression) Source #

Lenses