proto

package
v0.30.1 Latest Latest
Warning

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

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

Documentation

Overview

sequence-relayer v0.4.1 13cf0e854e8127ae83218cc188ef0e7456241c96 -- Code generated by webrpc-gen@v0.12.x-dev with golang@v0.10.0 generator. DO NOT EDIT.

webrpc-gen -schema=relayer.ridl -target=golang@v0.10.0 -pkg=proto -client -out=./clients/relayer.gen.go

Index

Constants

View Source
const RelayerPathPrefix = "/rpc/Relayer/"

Variables

View Source
var (
	// For Client
	HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"}

	// For Server
	HTTPResponseWriterCtxKey = &contextKey{"HTTPResponseWriter"}

	HTTPRequestCtxKey = &contextKey{"HTTPRequest"}

	ServiceNameCtxKey = &contextKey{"ServiceName"}

	MethodNameCtxKey = &contextKey{"MethodName"}
)
View Source
var ETHTxnStatus_name = map[uint]string{
	0: "UNKNOWN",
	1: "DROPPED",
	2: "QUEUED",
	3: "SENT",
	4: "SUCCEEDED",
	5: "PARTIALLY_FAILED",
	6: "FAILED",
}
View Source
var ETHTxnStatus_value = map[string]uint{
	"UNKNOWN":          0,
	"DROPPED":          1,
	"QUEUED":           2,
	"SENT":             3,
	"SUCCEEDED":        4,
	"PARTIALLY_FAILED": 5,
	"FAILED":           6,
}
View Source
var FeeTokenType_name = map[uint32]string{
	0: "UNKNOWN",
	1: "ERC20_TOKEN",
	2: "ERC1155_TOKEN",
}
View Source
var FeeTokenType_value = map[string]uint32{
	"UNKNOWN":       0,
	"ERC20_TOKEN":   1,
	"ERC1155_TOKEN": 2,
}
View Source
var SortOrder_name = map[uint32]string{
	0: "DESC",
	1: "ASC",
}
View Source
var SortOrder_value = map[string]uint32{
	"DESC": 0,
	"ASC":  1,
}
View Source
var TransferType_name = map[uint32]string{
	0: "SEND",
	1: "RECEIVE",
	2: "BRIDGE_DEPOSIT",
	3: "BRIDGE_WITHDRAW",
	4: "BURN",
	5: "UNKNOWN",
}
View Source
var TransferType_value = map[string]uint32{
	"SEND":            0,
	"RECEIVE":         1,
	"BRIDGE_DEPOSIT":  2,
	"BRIDGE_WITHDRAW": 3,
	"BURN":            4,
	"UNKNOWN":         5,
}
View Source
var WebRPCServices = map[string][]string{
	"Relayer": {
		"Ping",
		"Version",
		"RuntimeStatus",
		"GetSequenceContext",
		"GetChainID",
		"SendMetaTxn",
		"GetMetaTxnNonce",
		"GetMetaTxnReceipt",
		"Simulate",
		"UpdateMetaTxnGasLimits",
		"FeeTokens",
		"FeeOptions",
		"GetMetaTxnNetworkFeeOptions",
		"GetMetaTransactions",
		"SentTransactions",
		"PendingTransactions",
		"GetGasTank",
		"AddGasTank",
		"UpdateGasTank",
		"GetGasSponsor",
		"ListGasSponsors",
		"AddGasSponsor",
		"UpdateGasSponsor",
		"RemoveGasSponsor",
		"ReportGasSponsorUsage",
		"NextGasTankBalanceAdjustmentNonce",
		"AdjustGasTankBalance",
		"GetGasTankBalanceAdjustment",
		"ListGasTankBalanceAdjustments",
	},
}

Functions

func HTTPRequestHeaders

func HTTPRequestHeaders(ctx context.Context) (http.Header, bool)

func HTTPStatusFromErrorCode

func HTTPStatusFromErrorCode(code ErrorCode) int

func IsErrorCode

func IsErrorCode(err error, code ErrorCode) bool

func IsValidErrorCode

func IsValidErrorCode(code ErrorCode) bool

func WebRPCSchemaHash

func WebRPCSchemaHash() string

Schema hash generated from your RIDL schema

func WebRPCSchemaVersion

func WebRPCSchemaVersion() string

Schema version of your RIDL schema

func WebRPCVersion

func WebRPCVersion() string

WebRPC description and code-gen version

func WithHTTPRequestHeaders

func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error)

Types

type ETHTxnStatus

type ETHTxnStatus uint
const (
	ETHTxnStatus_UNKNOWN          ETHTxnStatus = 0
	ETHTxnStatus_DROPPED          ETHTxnStatus = 1
	ETHTxnStatus_QUEUED           ETHTxnStatus = 2
	ETHTxnStatus_SENT             ETHTxnStatus = 3
	ETHTxnStatus_SUCCEEDED        ETHTxnStatus = 4
	ETHTxnStatus_PARTIALLY_FAILED ETHTxnStatus = 5
	ETHTxnStatus_FAILED           ETHTxnStatus = 6
)

func (ETHTxnStatus) MarshalJSON

func (x ETHTxnStatus) MarshalJSON() ([]byte, error)

func (ETHTxnStatus) String

func (x ETHTxnStatus) String() string

func (*ETHTxnStatus) UnmarshalJSON

func (x *ETHTxnStatus) UnmarshalJSON(b []byte) error

type Error

type Error interface {
	// Code is of the valid error codes
	Code() ErrorCode

	// Msg returns a human-readable, unstructured messages describing the error
	Msg() string

	// Cause is reason for the error
	Cause() error

	// Error returns a string of the form "webrpc error <Code>: <Msg>"
	Error() string

	// Error response payload
	Payload() ErrorPayload
}

func ErrorInternal

func ErrorInternal(format string, args ...interface{}) Error

func ErrorInvalidArgument

func ErrorInvalidArgument(argument string, validationMsg string) Error

func ErrorNotFound

func ErrorNotFound(format string, args ...interface{}) Error

func ErrorRequiredArgument

func ErrorRequiredArgument(argument string) Error

func Errorf

func Errorf(code ErrorCode, msgf string, args ...interface{}) Error

func Failf

func Failf(format string, args ...interface{}) Error

func WrapError

func WrapError(code ErrorCode, cause error, format string, args ...interface{}) Error

func WrapFailf

func WrapFailf(cause error, format string, args ...interface{}) Error

type ErrorCode

type ErrorCode string
const (
	// Unknown error. For example when handling errors raised by APIs that do not
	// return enough error information.
	ErrUnknown ErrorCode = "unknown"

	// Fail error. General failure error type.
	ErrFail ErrorCode = "fail"

	// Canceled indicates the operation was cancelled (typically by the caller).
	ErrCanceled ErrorCode = "canceled"

	// InvalidArgument indicates client specified an invalid argument. It
	// indicates arguments that are problematic regardless of the state of the
	// system (i.e. a malformed file name, required argument, number out of range,
	// etc.).
	ErrInvalidArgument ErrorCode = "invalid argument"

	// DeadlineExceeded means operation expired before completion. For operations
	// that change the state of the system, this error may be returned even if the
	// operation has completed successfully (timeout).
	ErrDeadlineExceeded ErrorCode = "deadline exceeded"

	// NotFound means some requested entity was not found.
	ErrNotFound ErrorCode = "not found"

	// BadRoute means that the requested URL path wasn't routable to a webrpc
	// service and method. This is returned by the generated server, and usually
	// shouldn't be returned by applications. Instead, applications should use
	// NotFound or Unimplemented.
	ErrBadRoute ErrorCode = "bad route"

	// AlreadyExists means an attempt to create an entity failed because one
	// already exists.
	ErrAlreadyExists ErrorCode = "already exists"

	// PermissionDenied indicates the caller does not have permission to execute
	// the specified operation. It must not be used if the caller cannot be
	// identified (Unauthenticated).
	ErrPermissionDenied ErrorCode = "permission denied"

	// Unauthenticated indicates the request does not have valid authentication
	// credentials for the operation.
	ErrUnauthenticated ErrorCode = "unauthenticated"

	// ResourceExhausted indicates some resource has been exhausted, perhaps a
	// per-user quota, or perhaps the entire file system is out of space.
	ErrResourceExhausted ErrorCode = "resource exhausted"

	// FailedPrecondition indicates operation was rejected because the system is
	// not in a state required for the operation's execution. For example, doing
	// an rmdir operation on a directory that is non-empty, or on a non-directory
	// object, or when having conflicting read-modify-write on the same resource.
	ErrFailedPrecondition ErrorCode = "failed precondition"

	// Aborted indicates the operation was aborted, typically due to a concurrency
	// issue like sequencer check failures, transaction aborts, etc.
	ErrAborted ErrorCode = "aborted"

	// OutOfRange means operation was attempted past the valid range. For example,
	// seeking or reading past end of a paginated collection.
	//
	// Unlike InvalidArgument, this error indicates a problem that may be fixed if
	// the system state changes (i.e. adding more items to the collection).
	//
	// There is a fair bit of overlap between FailedPrecondition and OutOfRange.
	// We recommend using OutOfRange (the more specific error) when it applies so
	// that callers who are iterating through a space can easily look for an
	// OutOfRange error to detect when they are done.
	ErrOutOfRange ErrorCode = "out of range"

	// Unimplemented indicates operation is not implemented or not
	// supported/enabled in this service.
	ErrUnimplemented ErrorCode = "unimplemented"

	// Internal errors. When some invariants expected by the underlying system
	// have been broken. In other words, something bad happened in the library or
	// backend service. Do not confuse with HTTP Internal Server Error; an
	// Internal error could also happen on the client code, i.e. when parsing a
	// server response.
	ErrInternal ErrorCode = "internal"

	// Unavailable indicates the service is currently unavailable. This is a most
	// likely a transient condition and may be corrected by retrying with a
	// backoff.
	ErrUnavailable ErrorCode = "unavailable"

	// DataLoss indicates unrecoverable data loss or corruption.
	ErrDataLoss ErrorCode = "data loss"

	// ErrNone is the zero-value, is considered an empty error and should not be
	// used.
	ErrNone ErrorCode = ""
)

type ErrorPayload

type ErrorPayload struct {
	Status int    `json:"status"`
	Code   string `json:"code"`
	Cause  string `json:"cause,omitempty"`
	Msg    string `json:"msg"`
	Error  string `json:"error"`
}

type FeeOption

type FeeOption struct {
	Token    *FeeToken `json:"token"`
	To       string    `json:"to"`
	Value    string    `json:"value"`
	GasLimit uint      `json:"gasLimit"`
}

type FeeToken

type FeeToken struct {
	ChainId         uint64        `json:"chainId"`
	Name            string        `json:"name"`
	Symbol          string        `json:"symbol"`
	Type            *FeeTokenType `json:"type"`
	Decimals        *uint32       `json:"decimals"`
	LogoURL         string        `json:"logoURL"`
	ContractAddress *string       `json:"contractAddress"`
	TokenID         *string       `json:"tokenID"`
}

type FeeTokenType added in v0.4.12

type FeeTokenType uint32
const (
	FeeTokenType_UNKNOWN       FeeTokenType = 0
	FeeTokenType_ERC20_TOKEN   FeeTokenType = 1
	FeeTokenType_ERC1155_TOKEN FeeTokenType = 2
)

func (FeeTokenType) MarshalJSON added in v0.4.12

func (x FeeTokenType) MarshalJSON() ([]byte, error)

func (FeeTokenType) String added in v0.4.12

func (x FeeTokenType) String() string

func (*FeeTokenType) UnmarshalJSON added in v0.4.12

func (x *FeeTokenType) UnmarshalJSON(b []byte) error

type GasSponsor added in v0.13.0

type GasSponsor struct {
	ID        uint64        `json:"id" db:"id,omitempty"`
	GasTankID uint64        `json:"gasTankId" db:"gas_tank_id,omitempty"`
	ProjectID uint64        `json:"projectId" db:"project_id"`
	Address   prototyp.Hash `json:"address" db:"address"`
	Name      string        `json:"name" db:"name"`
	Active    bool          `json:"active" db:"active"`
	UpdatedAt *time.Time    `json:"updatedAt" db:"updated_at,omitempty"`
	CreatedAt *time.Time    `json:"createdAt" db:"created_at,omitempty"`
	DeletedAt *time.Time    `json:"-" db:"deleted_at,omitempty"`
}

type GasSponsorUsage added in v0.13.0

type GasSponsorUsage struct {
	Name            string          `json:"name" db:"name"`
	ID              uint64          `json:"id" db:"gas_sponsor_id,omitempty"`
	TotalGasUsed    int64           `json:"totalGasUsed" db:"total_gas_used"`
	TotalTxnFees    float64         `json:"totalTxnFees" db:"total_txn_fees"`
	TotalTxnFeesUSD decimal.Decimal `json:"totalTxnFeesUsd" db:"total_txn_fees_usd"`
	AvgGasPrice     float64         `json:"avgGasPrice" db:"avg_gas_price"`
	TotalTxns       int64           `json:"totalTxns" db:"total_txns"`
	StartTime       *time.Time      `json:"startTime"`
	EndTime         *time.Time      `json:"endTime"`
}

type GasTank added in v0.29.1

type GasTank struct {
	ID              uint64          `json:"id" db:"id,omitempty"`
	Name            string          `json:"name" db:"name"`
	CurrentBalance  decimal.Decimal `json:"currentBalance" db:"current_balance"`
	Unlimited       bool            `json:"unlimited" db:"unlimited"`
	FeeMarkupFactor decimal.Decimal `json:"feeMarkupFactor" db:"fee_markup_factor"`
	UpdatedAt       *time.Time      `json:"updatedAt" db:"updated_at,omitempty"`
	CreatedAt       *time.Time      `json:"createdAt" db:"created_at,omitempty"`
}

type GasTankBalanceAdjustment added in v0.29.1

type GasTankBalanceAdjustment struct {
	GasTankID        uint64          `json:"gasTankId" db:"gas_tank_id"`
	Nonce            uint64          `json:"nonce" db:"nonce"`
	Amount           decimal.Decimal `json:"amount" db:"amount"`
	TotalBalance     decimal.Decimal `json:"totalBalance" db:"total_balance"`
	BalanceTimestamp time.Time       `json:"balanceTimestamp" db:"balance_timestamp"`
	CreatedAt        *time.Time      `json:"createdAt" db:"created_at,omitempty"`
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

type MetaTxn

type MetaTxn struct {
	WalletAddress string `json:"walletAddress" db:"wallet_address"`
	Contract      string `json:"contract" db:"to_address"`
	Input         string `json:"input" db:"tx_data"`
}

type MetaTxnEntry added in v0.4.12

type MetaTxnEntry struct {
	ID              uint64        `json:"id" db:"id,omitempty"`
	MetaTxnID       string        `json:"metaTxnID" db:"metatx_logs_id"`
	TxnStatus       ETHTxnStatus  `json:"txnStatus" db:"status"`
	TxnRevertReason string        `json:"txnRevertReason" db:"revert_reason"`
	Index           uint64        `json:"index" db:"index"`
	Logs            []interface{} `json:"logs" db:"logs,omitempty"`
	UpdatedAt       *time.Time    `json:"updatedAt" db:"updated_at,omitempty"`
	CreatedAt       *time.Time    `json:"createdAt" db:"created_at,omitempty"`
}

type MetaTxnLog added in v0.4.12

type MetaTxnLog struct {
	ID              uint64                 `json:"id" db:"id,omitempty"`
	ProjectID       uint64                 `json:"projectId" db:"project_id"`
	TxnHash         prototyp.HashMaybe     `json:"txnHash" db:"txn_hash"`
	TxnNonce        prototyp.BigInt        `json:"txnNonce" db:"txn_nonce"`
	MetaTxnID       *string                `json:"metaTxnID" db:"meta_txn_id"`
	TxnStatus       ETHTxnStatus           `json:"txnStatus" db:"txn_status"`
	TxnRevertReason string                 `json:"txnRevertReason" db:"txn_revert_reason"`
	Requeues        uint                   `json:"requeues" db:"requeues"`
	QueuedAt        *time.Time             `json:"queuedAt" db:"queued_at,omitempty"`
	SentAt          *time.Time             `json:"sentAt" db:"sent_at,omitempty"`
	MinedAt         *time.Time             `json:"minedAt" db:"mined_at,omitempty"`
	Target          prototyp.Hash          `json:"target" db:"target"`
	Input           prototyp.Hash          `json:"input" db:"input"`
	TxnArgs         map[string]interface{} `json:"txnArgs" db:"txn_args"`
	TxnReceipt      map[string]interface{} `json:"txnReceipt" db:"txn_receipt,omitempty"`
	WalletAddress   prototyp.Hash          `json:"walletAddress" db:"wallet_address"`
	MetaTxnNonce    prototyp.BigInt        `json:"metaTxnNonce" db:"metatx_nonce"`
	GasLimit        uint64                 `json:"gasLimit" db:"gas_limit"`
	GasPrice        prototyp.BigInt        `json:"gasPrice" db:"gas_price"`
	GasUsed         uint64                 `json:"gasUsed" db:"gas_used"`
	GasEstimated    uint64                 `json:"gasEstimated" db:"gas_estimated"`
	GasFeeMarkup    *uint64                `json:"gasFeeMarkup" db:"gas_fee_markup"`
	UsdRate         prototyp.BigInt        `json:"usdRate" db:"usd_rate"`
	CreditsUsed     uint64                 `json:"creditsUsed" db:"credits_used"`
	IsWhitelisted   bool                   `json:"isWhitelisted" db:"is_whitelisted,omitempty"`
	GasSponsor      *uint64                `json:"gasSponsor" db:"gas_sponsor_id,omitempty"`
	GasTank         *uint64                `json:"gasTank" db:"gas_tank_id,omitempty"`
	UpdatedAt       *time.Time             `json:"updatedAt" db:"updated_at,omitempty"`
	CreatedAt       *time.Time             `json:"createdAt" db:"created_at,omitempty"`
}

type MetaTxnReceipt

type MetaTxnReceipt struct {
	ID           string               `json:"id"`
	Status       string               `json:"status"`
	RevertReason *string              `json:"revertReason"`
	Index        uint                 `json:"index"`
	Logs         []*MetaTxnReceiptLog `json:"logs"`
	Receipts     []*MetaTxnReceipt    `json:"receipts"`
	TxnReceipt   string               `json:"txnReceipt"`
}

type MetaTxnReceiptLog added in v0.4.12

type MetaTxnReceiptLog struct {
	Address string   `json:"address"`
	Topics  []string `json:"topics"`
	Data    string   `json:"data"`
}

type NumTxnsRelayed added in v0.29.1

type NumTxnsRelayed struct {
	Prev    uint64 `json:"prev"`
	Current uint64 `json:"current"`
	Period  uint64 `json:"period"`
}

type Page added in v0.4.12

type Page struct {
	PageSize     *uint32      `json:"pageSize"`
	Page         *uint32      `json:"page"`
	More         *bool        `json:"more"`
	TotalRecords *uint64      `json:"totalRecords"`
	Column       *string      `json:"column"`
	Before       *interface{} `json:"before"`
	After        *interface{} `json:"after"`
	Sort         []*SortBy    `json:"sort"`
}

type Relayer

type Relayer interface {
	Ping(ctx context.Context) (bool, error)
	Version(ctx context.Context) (*Version, error)
	RuntimeStatus(ctx context.Context) (*RuntimeStatus, error)
	GetSequenceContext(ctx context.Context) (*SequenceContext, error)
	GetChainID(ctx context.Context) (uint64, error)
	SendMetaTxn(ctx context.Context, call *MetaTxn, quote *string) (bool, string, error)
	GetMetaTxnNonce(ctx context.Context, walletContractAddress string, space *string) (string, error)
	GetMetaTxnReceipt(ctx context.Context, metaTxID string) (*MetaTxnReceipt, error)
	Simulate(ctx context.Context, wallet string, transactions string) ([]*SimulateResult, error)
	UpdateMetaTxnGasLimits(ctx context.Context, walletAddress string, walletConfig interface{}, payload string) (string, error)
	FeeTokens(ctx context.Context) (bool, []*FeeToken, error)
	FeeOptions(ctx context.Context, wallet string, to string, data string, simulate *bool) ([]*FeeOption, bool, *string, error)
	GetMetaTxnNetworkFeeOptions(ctx context.Context, walletConfig interface{}, payload string) ([]*FeeOption, error)
	GetMetaTransactions(ctx context.Context, projectId uint64, gasTankId uint64, page *Page) (*Page, []*MetaTxnLog, error)
	SentTransactions(ctx context.Context, filter *SentTransactionsFilter, page *Page) (*Page, []*Transaction, error)
	PendingTransactions(ctx context.Context, page *Page) (*Page, []*Transaction, error)
	GetGasTank(ctx context.Context, id uint64) (*GasTank, error)
	AddGasTank(ctx context.Context, name string, feeMarkupFactor float64, unlimited *bool) (bool, *GasTank, error)
	UpdateGasTank(ctx context.Context, id uint64, name *string, feeMarkupFactor *float64, unlimited *bool) (bool, *GasTank, error)
	GetGasSponsor(ctx context.Context, id uint64) (*GasSponsor, error)
	ListGasSponsors(ctx context.Context, projectId uint64, gasTankId uint64, page *Page) (*Page, []*GasSponsor, error)
	AddGasSponsor(ctx context.Context, projectId uint64, gasTankId uint64, address string, name *string, active *bool) (bool, *GasSponsor, error)
	UpdateGasSponsor(ctx context.Context, id uint64, name *string, active *bool) (bool, *GasSponsor, error)
	RemoveGasSponsor(ctx context.Context, id uint64) (bool, error)
	ReportGasSponsorUsage(ctx context.Context, projectId uint64, gasTankId uint64, startTime *time.Time, endTime *time.Time) ([]*GasSponsorUsage, error)
	NextGasTankBalanceAdjustmentNonce(ctx context.Context, id uint64) (uint64, error)
	AdjustGasTankBalance(ctx context.Context, id uint64, nonce uint64, amount float64) (bool, *GasTankBalanceAdjustment, error)
	GetGasTankBalanceAdjustment(ctx context.Context, id uint64, nonce uint64) (*GasTankBalanceAdjustment, error)
	ListGasTankBalanceAdjustments(ctx context.Context, id uint64, page *Page) (*Page, []*GasTankBalanceAdjustment, error)
}

func NewRelayerClient

func NewRelayerClient(addr string, client HTTPClient) Relayer

type RuntimeChecks added in v0.5.6

type RuntimeChecks struct {
}

type RuntimeStatus

type RuntimeStatus struct {
	HealthOK       bool            `json:"healthOK"`
	StartTime      time.Time       `json:"startTime"`
	Uptime         uint64          `json:"uptime"`
	Ver            string          `json:"ver"`
	Branch         string          `json:"branch"`
	CommitHash     string          `json:"commitHash"`
	Senders        []*SenderStatus `json:"senders"`
	Checks         *RuntimeChecks  `json:"checks"`
	NumTxnsRelayed *NumTxnsRelayed `json:"numTxnsRelayed"`
}

type SenderStatus added in v0.5.6

type SenderStatus struct {
	Index        uint32  `json:"index"`
	Address      string  `json:"address"`
	EtherBalance float64 `json:"etherBalance"`
	Active       bool    `json:"active"`
}

type SentTransactionsFilter added in v0.4.12

type SentTransactionsFilter struct {
	Pending *bool `json:"pending"`
	Failed  *bool `json:"failed"`
}

type SequenceContext

type SequenceContext struct {
	Factory              string `json:"factory"`
	MainModule           string `json:"mainModule"`
	MainModuleUpgradable string `json:"mainModuleUpgradable"`
	GuestModule          string `json:"guestModule"`
	Utils                string `json:"utils"`
}

type SimulateResult added in v0.13.0

type SimulateResult struct {
	Executed  bool    `json:"executed"`
	Succeeded bool    `json:"succeeded"`
	Result    *string `json:"result"`
	Reason    *string `json:"reason"`
	GasUsed   uint    `json:"gasUsed"`
	GasLimit  uint    `json:"gasLimit"`
}

type SortBy added in v0.4.12

type SortBy struct {
	Column string     `json:"column"`
	Order  *SortOrder `json:"order"`
}

type SortOrder added in v0.4.12

type SortOrder uint32
const (
	SortOrder_DESC SortOrder = 0
	SortOrder_ASC  SortOrder = 1
)

func (SortOrder) MarshalJSON added in v0.4.12

func (x SortOrder) MarshalJSON() ([]byte, error)

func (SortOrder) String added in v0.4.12

func (x SortOrder) String() string

func (*SortOrder) UnmarshalJSON added in v0.4.12

func (x *SortOrder) UnmarshalJSON(b []byte) error

type Transaction added in v0.4.12

type Transaction struct {
	TxnHash     *string                `json:"txnHash"`
	BlockNumber uint64                 `json:"blockNumber"`
	ChainId     uint64                 `json:"chainId"`
	MetaTxnID   *string                `json:"metaTxnID"`
	Transfers   []*TxnLogTransfer      `json:"transfers"`
	Users       map[string]*TxnLogUser `json:"users"`
	Timestamp   *time.Time             `json:"timestamp" db:"ts,omitempty"`
}

type TransferType added in v0.4.12

type TransferType uint32
const (
	TransferType_SEND            TransferType = 0
	TransferType_RECEIVE         TransferType = 1
	TransferType_BRIDGE_DEPOSIT  TransferType = 2
	TransferType_BRIDGE_WITHDRAW TransferType = 3
	TransferType_BURN            TransferType = 4
	TransferType_UNKNOWN         TransferType = 5
)

func (TransferType) MarshalJSON added in v0.4.12

func (x TransferType) MarshalJSON() ([]byte, error)

func (TransferType) String added in v0.4.12

func (x TransferType) String() string

func (*TransferType) UnmarshalJSON added in v0.4.12

func (x *TransferType) UnmarshalJSON(b []byte) error

type TxnLogTransfer added in v0.4.12

type TxnLogTransfer struct {
	TransferType    *TransferType     `json:"transferType"`
	ContractAddress string            `json:"contractAddress"`
	From            string            `json:"from"`
	To              string            `json:"to"`
	Ids             []prototyp.BigInt `json:"ids"`
	Amounts         []prototyp.BigInt `json:"amounts"`
}

type TxnLogUser added in v0.4.12

type TxnLogUser struct {
	Username string `json:"username"`
}

type Version

type Version struct {
	WebrpcVersion string `json:"webrpcVersion"`
	SchemaVersion string `json:"schemaVersion"`
	SchemaHash    string `json:"schemaHash"`
	AppVersion    string `json:"appVersion"`
}

Jump to

Keyboard shortcuts

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