Documentation ¶
Overview ¶
This module is a wrapper for the nonodo model that converts the internal types to GraphQL-compatible types.
Index ¶
- Constants
- Variables
- func ConvertToConvenienceFilter(filter []*ConvenientFilter) ([]*cModel.ConvenienceFilter, error)
- type AddressFilterInput
- type BooleanFilterInput
- type CompletionStatus
- type Connection
- type ConvenientFilter
- type Edge
- type Input
- type InputConnection
- type InputEdge
- type InputFilter
- type ModelWrapper
- type Notice
- type NoticeConnection
- type NoticeEdge
- type PageInfo
- type Proof
- type Report
- type ReportConnection
- type ReportEdge
- type Voucher
- type VoucherConnection
- type VoucherEdge
Constants ¶
View Source
const DefaultPaginationLimit = 1000
Variables ¶
View Source
var AllCompletionStatus = []CompletionStatus{ CompletionStatusUnprocessed, CompletionStatusAccepted, CompletionStatusRejected, CompletionStatusException, CompletionStatusMachineHalted, CompletionStatusCycleLimitExceeded, CompletionStatusTimeLimitExceeded, CompletionStatusPayloadLengthLimitExceeded, }
Functions ¶
func ConvertToConvenienceFilter ¶
func ConvertToConvenienceFilter( filter []*ConvenientFilter, ) ([]*cModel.ConvenienceFilter, error)
Types ¶
type AddressFilterInput ¶
type AddressFilterInput struct { Eq *string `json:"eq,omitempty"` Ne *string `json:"ne,omitempty"` In []*string `json:"in,omitempty"` Nin []*string `json:"nin,omitempty"` And []*ConvenientFilter `json:"and,omitempty"` Or []*ConvenientFilter `json:"or,omitempty"` }
type BooleanFilterInput ¶
type BooleanFilterInput struct { Eq *bool `json:"eq,omitempty"` Ne *bool `json:"ne,omitempty"` And []*ConvenientFilter `json:"and,omitempty"` Or []*ConvenientFilter `json:"or,omitempty"` }
type CompletionStatus ¶
type CompletionStatus string
const ( CompletionStatusUnprocessed CompletionStatus = "UNPROCESSED" CompletionStatusAccepted CompletionStatus = "ACCEPTED" CompletionStatusRejected CompletionStatus = "REJECTED" CompletionStatusException CompletionStatus = "EXCEPTION" CompletionStatusMachineHalted CompletionStatus = "MACHINE_HALTED" CompletionStatusCycleLimitExceeded CompletionStatus = "CYCLE_LIMIT_EXCEEDED" CompletionStatusTimeLimitExceeded CompletionStatus = "TIME_LIMIT_EXCEEDED" CompletionStatusPayloadLengthLimitExceeded CompletionStatus = "PAYLOAD_LENGTH_LIMIT_EXCEEDED" )
func (CompletionStatus) IsValid ¶
func (e CompletionStatus) IsValid() bool
func (CompletionStatus) MarshalGQL ¶
func (e CompletionStatus) MarshalGQL(w io.Writer)
func (CompletionStatus) String ¶
func (e CompletionStatus) String() string
func (*CompletionStatus) UnmarshalGQL ¶
func (e *CompletionStatus) UnmarshalGQL(v interface{}) error
type Connection ¶
type Connection[T any] struct { // Total number of entries that match the query TotalCount int `json:"totalCount"` // Pagination entries returned for the current page Edges []*Edge[T] `json:"edges"` // Pagination metadata PageInfo *PageInfo `json:"pageInfo"` }
Pagination result
func NewConnection ¶
func NewConnection[T any](offset int, total int, nodes []T) *Connection[T]
Create a new connection for the given slice of elements.
type ConvenientFilter ¶
type ConvenientFilter struct { Destination *AddressFilterInput `json:"destination,omitempty"` Executed *BooleanFilterInput `json:"executed,omitempty"` And []*ConvenientFilter `json:"and,omitempty"` Or []*ConvenientFilter `json:"or,omitempty"` }
type Edge ¶
type Edge[T any] struct { // Node instance Node T `json:"node"` // contains filtered or unexported fields }
Pagination entry
type Input ¶
type Input struct { // ID of the input ID string `json:"id"` // Input index starting from genesis Index int `json:"index"` // Status of the input Status CompletionStatus `json:"status"` // Address responsible for submitting the input MsgSender string `json:"msgSender"` // Timestamp associated with the input submission, as defined by the base layer's block in // which it was recorded Timestamp string `json:"timestamp"` // Number of the base layer block in which the input was recorded BlockNumber string `json:"blockNumber"` // Input payload in Ethereum hex binary format, starting with '0x' Payload string `json:"payload"` // Timestamp associated with the Espresso input submission EspressoTimestamp string `json:"espressoTimestamp"` // Number of the Espresso block in which the input was recorded EspressoBlockNumber string `json:"espressoBlockNumber"` // Input index in the Inpux Box InputBoxIndex string `json:"inputBoxIndex"` BlockTimestamp string `json:"blockTimestamp"` PrevRandao string `json:"prevRandao"` }
Request submitted to the application to advance its state
func ConvertInput ¶
func ConvertInput(input cModel.AdvanceInput) (*Input, error)
type InputConnection ¶
type InputConnection = Connection[*Input]
func ConvertToInputConnectionV1 ¶
func ConvertToInputConnectionV1( inputs []cModel.AdvanceInput, offset int, total int, ) (*InputConnection, error)
type InputFilter ¶
type InputFilter struct { // Filter only inputs with index lower than a given value IndexLowerThan *int `json:"indexLowerThan,omitempty"` // Filter only inputs with index greater than a given value IndexGreaterThan *int `json:"indexGreaterThan,omitempty"` // Filter only inputs with the message sender MsgSender *string `json:"msgSender,omitempty"` // Filter only inputs from 'inputbox' or 'espresso' Type *string `json:"type,omitempty"` }
Filter object to restrict results depending on input properties
type ModelWrapper ¶
type ModelWrapper struct {
// contains filtered or unexported fields
}
Nonodo model wrapper that convert types to GraphQL types.
func NewModelWrapper ¶
func NewModelWrapper(model *model.NonodoModel) *ModelWrapper
type Notice ¶
type Notice struct { // Notice index within the context of the input that produced it Index int `json:"index"` // Index of the input InputIndex int // Notice data as a payload in Ethereum hex binary format, starting with '0x' Payload string `json:"payload"` // InputId string Proof Proof `json:"proof"` }
Informational statement that can be validated in the base layer blockchain
func ConvertConvenientNoticeV1 ¶
func ConvertConvenientNoticeV1(cNotice cModel.ConvenienceNotice) *Notice
type NoticeConnection ¶
type NoticeConnection = Connection[*Notice]
func ConvertToNoticeConnectionV1 ¶
func ConvertToNoticeConnectionV1( notices []cModel.ConvenienceNotice, offset int, total int, ) (*NoticeConnection, error)
type NoticeEdge ¶
type PageInfo ¶
type PageInfo struct { // Cursor pointing to the first entry of the page StartCursor *string `json:"startCursor,omitempty"` // Cursor pointing to the last entry of the page EndCursor *string `json:"endCursor,omitempty"` // Indicates if there are additional entries after the end curs HasNextPage bool `json:"hasNextPage"` // Indicates if there are additional entries before the start curs HasPreviousPage bool `json:"hasPreviousPage"` }
Page metadata for the cursor-based Connection pagination pattern
type Report ¶
type Report struct { // Report index within the context of the input that produced it Index int `json:"index"` // Index of the input InputIndex int // Report data as a payload in Ethereum hex binary format, starting with '0x' Payload string `json:"payload"` }
Application log or diagnostic information
type ReportConnection ¶
type ReportConnection = Connection[*Report]
type ReportEdge ¶
type Voucher ¶
type Voucher struct { // Voucher index within the context of the input that produced it Index int `json:"index"` // Index of the input InputIndex int // Transaction destination address in Ethereum hex binary format (20 bytes), starting with // '0x' Destination string `json:"destination"` // Transaction payload in Ethereum hex binary format, starting with '0x' Payload string `json:"payload"` Value string `json:"value"` Executed bool `json:"executed"` Proof Proof `json:"proof"` TransactionHash string `json:"transactionHash"` }
Representation of a transaction that can be carried out on the base layer blockchain, such as a transfer of assets
func ConvertConvenientVoucherV1 ¶
func ConvertConvenientVoucherV1(cVoucher cModel.ConvenienceVoucher) *Voucher
type VoucherConnection ¶
type VoucherConnection = Connection[*Voucher]
func ConvertToVoucherConnectionV1 ¶
func ConvertToVoucherConnectionV1( vouchers []cModel.ConvenienceVoucher, offset int, total int, ) (*VoucherConnection, error)
type VoucherEdge ¶
Click to show internal directories.
Click to hide internal directories.