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
- Variables
- func HTTPRequestHeaders(ctx context.Context) (http.Header, bool)
- func HTTPStatusFromErrorCode(code ErrorCode) int
- func IsErrorCode(err error, code ErrorCode) bool
- func IsValidErrorCode(code ErrorCode) bool
- func WebRPCSchemaHash() string
- func WebRPCSchemaVersion() string
- func WebRPCVersion() string
- func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error)
- type ETHTxnStatus
- type Error
- func ErrorInternal(format string, args ...interface{}) Error
- func ErrorInvalidArgument(argument string, validationMsg string) Error
- func ErrorNotFound(format string, args ...interface{}) Error
- func ErrorRequiredArgument(argument string) Error
- func Errorf(code ErrorCode, msgf string, args ...interface{}) Error
- func Failf(format string, args ...interface{}) Error
- func WrapError(code ErrorCode, cause error, format string, args ...interface{}) Error
- func WrapFailf(cause error, format string, args ...interface{}) Error
- type ErrorCode
- type ErrorPayload
- type FeeOption
- type FeeToken
- type FeeTokenType
- type GasSponsor
- type GasSponsorUsage
- type GasTank
- type GasTankBalanceAdjustment
- type HTTPClient
- type MetaTxn
- type MetaTxnEntry
- type MetaTxnLog
- type MetaTxnReceipt
- type MetaTxnReceiptLog
- type NumTxnsRelayed
- type Page
- type Relayer
- type RuntimeChecks
- type RuntimeStatus
- type SenderStatus
- type SentTransactionsFilter
- type SequenceContext
- type SimulateResult
- type SortBy
- type SortOrder
- type Transaction
- type TransferType
- type TxnLogTransfer
- type TxnLogUser
- type Version
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 HTTPStatusFromErrorCode ¶
func IsErrorCode ¶
func IsValidErrorCode ¶
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 ErrorInvalidArgument ¶
func ErrorNotFound ¶
func ErrorRequiredArgument ¶
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" // 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 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 ¶
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 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 NumTxnsRelayed ¶ added in v0.29.1
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 SentTransactionsFilter ¶ added in v0.4.12
type SequenceContext ¶
type SimulateResult ¶ added in v0.13.0
type SortOrder ¶ added in v0.4.12
type SortOrder uint32
func (SortOrder) MarshalJSON ¶ added in v0.4.12
func (*SortOrder) UnmarshalJSON ¶ added in v0.4.12
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 TxnLogUser ¶ added in v0.4.12
type TxnLogUser struct {
Username string `json:"username"`
}
Click to show internal directories.
Click to hide internal directories.