Documentation
¶
Overview ¶
sequence-relayer v0.4.1 62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a -- Code generated by webrpc-gen@v0.26.0 with golang generator. DO NOT EDIT.
webrpc-gen -schema=relayer.ridl -target=golang -pkg=proto -client -out=./clients/relayer.gen.go
Index ¶
- Constants
- Variables
- func HTTPRequestHeaders(ctx context.Context) (http.Header, bool)
- func MethodCtx(ctx context.Context) (method, bool)
- func MethodNameFromContext(ctx context.Context) string
- func RequestFromContext(ctx context.Context) *http.Request
- func ServiceNameFromContext(ctx context.Context) string
- func WebRPCSchemaHash() string
- func WebRPCSchemaVersion() string
- func WebRPCVersion() string
- func WebrpcMethods() map[string]method
- func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error)
- type ETHTxnStatus
- type FeeOption
- type FeeToken
- type FeeTokenType
- type GasSponsor
- type GasSponsorUsage
- type GasTank
- type GasTankBalanceAdjustment
- type HTTPClient
- type IntentPrecondition
- type IntentSolution
- type MetaTxn
- type MetaTxnLog
- type MetaTxnReceipt
- type MetaTxnReceiptLog
- type Page
- type Relayer
- type RelayerClient
- type RuntimeChecks
- type RuntimeStatus
- type SenderStatus
- type SentTransactionsFilter
- type SequenceContext
- type SimulateResult
- type SimulateStatus
- type SimulateV3Result
- type SortBy
- type SortOrder
- type Transaction
- type Transactions
- type TransferType
- type TxnLogTransfer
- type TxnLogUser
- type Version
- type WebRPCError
- type WebrpcGenVersions
Constants ¶
const RelayerPathPrefix = "/rpc/Relayer/"
const WebrpcHeader = "Webrpc"
const WebrpcHeaderValue = "webrpc@v0.26.0;gen-golang@v0.19.0;sequence-relayer@v0.4.1"
Variables ¶
var ( HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} HTTPRequestCtxKey = &contextKey{"HTTPRequest"} ServiceNameCtxKey = &contextKey{"ServiceName"} MethodNameCtxKey = &contextKey{"MethodName"} )
var ( ErrWebrpcEndpoint = WebRPCError{Code: 0, Name: "WebrpcEndpoint", Message: "endpoint error", HTTPStatus: 400} ErrWebrpcRequestFailed = WebRPCError{Code: -1, Name: "WebrpcRequestFailed", Message: "request failed", HTTPStatus: 400} ErrWebrpcBadRoute = WebRPCError{Code: -2, Name: "WebrpcBadRoute", Message: "bad route", HTTPStatus: 404} ErrWebrpcBadMethod = WebRPCError{Code: -3, Name: "WebrpcBadMethod", Message: "bad method", HTTPStatus: 405} ErrWebrpcBadRequest = WebRPCError{Code: -4, Name: "WebrpcBadRequest", Message: "bad request", HTTPStatus: 400} ErrWebrpcBadResponse = WebRPCError{Code: -5, Name: "WebrpcBadResponse", Message: "bad response", HTTPStatus: 500} ErrWebrpcServerPanic = WebRPCError{Code: -6, Name: "WebrpcServerPanic", Message: "server panic", HTTPStatus: 500} ErrWebrpcInternalError = WebRPCError{Code: -7, Name: "WebrpcInternalError", Message: "internal error", HTTPStatus: 500} ErrWebrpcClientDisconnected = WebRPCError{Code: -8, Name: "WebrpcClientDisconnected", Message: "client disconnected", HTTPStatus: 400} ErrWebrpcStreamLost = WebRPCError{Code: -9, Name: "WebrpcStreamLost", Message: "stream lost", HTTPStatus: 400} ErrWebrpcStreamFinished = WebRPCError{Code: -10, Name: "WebrpcStreamFinished", Message: "stream finished", HTTPStatus: 200} )
Webrpc errors
var ( ErrPermissionDenied = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403} ErrSessionExpired = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403} ErrMethodNotFound = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404} ErrRequestConflict = WebRPCError{Code: 1004, Name: "RequestConflict", Message: "Conflict with target resource", HTTPStatus: 409} ErrAborted = WebRPCError{Code: 1005, Name: "Aborted", Message: "Request aborted", HTTPStatus: 400} ErrGeoblocked = WebRPCError{Code: 1006, Name: "Geoblocked", Message: "Geoblocked region", HTTPStatus: 451} ErrRateLimited = WebRPCError{Code: 1007, Name: "RateLimited", Message: "Rate-limited. Please slow down.", HTTPStatus: 429} ErrProjectNotFound = WebRPCError{Code: 1008, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 401} ErrAccessKeyNotFound = WebRPCError{Code: 1101, Name: "AccessKeyNotFound", Message: "Access key not found", HTTPStatus: 401} ErrAccessKeyMismatch = WebRPCError{Code: 1102, Name: "AccessKeyMismatch", Message: "Access key mismatch", HTTPStatus: 409} ErrInvalidOrigin = WebRPCError{Code: 1103, Name: "InvalidOrigin", Message: "Invalid origin for Access Key", HTTPStatus: 403} ErrInvalidService = WebRPCError{Code: 1104, Name: "InvalidService", Message: "Service not enabled for Access key", HTTPStatus: 403} ErrQuotaExceeded = WebRPCError{Code: 1200, Name: "QuotaExceeded", Message: "Quota request exceeded", HTTPStatus: 429} ErrQuotaRateLimit = WebRPCError{Code: 1201, Name: "QuotaRateLimit", Message: "Quota rate limit exceeded", HTTPStatus: 429} ErrNoDefaultKey = WebRPCError{Code: 1300, Name: "NoDefaultKey", Message: "No default access key found", HTTPStatus: 403} ErrMaxAccessKeys = WebRPCError{Code: 1301, Name: "MaxAccessKeys", Message: "Access keys limit reached", HTTPStatus: 403} ErrAtLeastOneKey = WebRPCError{Code: 1302, Name: "AtLeastOneKey", Message: "You need at least one Access Key", HTTPStatus: 403} ErrTimeout = WebRPCError{Code: 1900, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} ErrInvalidArgument = WebRPCError{Code: 2001, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} ErrNotFound = WebRPCError{Code: 3000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} ErrInsufficientFee = WebRPCError{Code: 3004, Name: "InsufficientFee", Message: "Insufficient fee", HTTPStatus: 402} ErrNotEnoughBalance = WebRPCError{Code: 3005, Name: "NotEnoughBalance", Message: "Not enough balance", HTTPStatus: 402} ErrSimulationFailed = WebRPCError{Code: 3006, Name: "SimulationFailed", Message: "Simulation failed", HTTPStatus: 400} )
Schema errors
var ETHTxnStatus_name = map[uint]string{
0: "UNKNOWN",
1: "DROPPED",
2: "QUEUED",
3: "SENT",
4: "SUCCEEDED",
5: "PARTIALLY_FAILED",
6: "FAILED",
7: "PENDING_PRECONDITION",
}
var ETHTxnStatus_value = map[string]uint{
"UNKNOWN": 0,
"DROPPED": 1,
"QUEUED": 2,
"SENT": 3,
"SUCCEEDED": 4,
"PARTIALLY_FAILED": 5,
"FAILED": 6,
"PENDING_PRECONDITION": 7,
}
var FeeTokenType_name = map[uint32]string{
0: "UNKNOWN",
1: "ERC20_TOKEN",
2: "ERC1155_TOKEN",
}
var FeeTokenType_value = map[string]uint32{
"UNKNOWN": 0,
"ERC20_TOKEN": 1,
"ERC1155_TOKEN": 2,
}
var SimulateStatus_name = map[int]string{
0: "SKIPPED",
1: "SUCCEEDED",
2: "FAILED",
3: "ABORTED",
4: "REVERTED",
5: "NOT_ENOUGH_GAS",
}
var SimulateStatus_value = map[string]int{
"SKIPPED": 0,
"SUCCEEDED": 1,
"FAILED": 2,
"ABORTED": 3,
"REVERTED": 4,
"NOT_ENOUGH_GAS": 5,
}
var SortOrder_name = map[uint32]string{
0: "DESC",
1: "ASC",
}
var SortOrder_value = map[string]uint32{
"DESC": 0,
"ASC": 1,
}
var TransferType_name = map[uint32]string{
0: "SEND",
1: "RECEIVE",
2: "BRIDGE_DEPOSIT",
3: "BRIDGE_WITHDRAW",
4: "BURN",
5: "UNKNOWN",
}
var TransferType_value = map[string]uint32{
"SEND": 0,
"RECEIVE": 1,
"BRIDGE_DEPOSIT": 2,
"BRIDGE_WITHDRAW": 3,
"BURN": 4,
"UNKNOWN": 5,
}
var WebRPCServices = map[string][]string{
"Relayer": {
"Ping",
"Version",
"RuntimeStatus",
"GetSequenceContext",
"GetChainID",
"SendMetaTxn",
"GetMetaTxnNonce",
"GetMetaTxnReceipt",
"Simulate",
"SimulateV3",
"UpdateMetaTxnGasLimits",
"FeeTokens",
"FeeOptions",
"GetMetaTxnNetworkFeeOptions",
"GetMetaTransactions",
"GetTransactionCost",
"SentTransactions",
"PendingTransactions",
"GetGasTank",
"AddGasTank",
"UpdateGasTank",
"NextGasTankBalanceAdjustmentNonce",
"AdjustGasTankBalance",
"GetGasTankBalanceAdjustment",
"ListGasTankBalanceAdjustments",
"ListGasSponsors",
"GetGasSponsor",
"AddGasSponsor",
"UpdateGasSponsor",
"RemoveGasSponsor",
"AddressGasSponsors",
"GetProjectBalance",
"AdjustProjectBalance",
},
}
Functions ¶
func MethodNameFromContext ¶ added in v0.31.0
func RequestFromContext ¶ added in v0.31.0
func ServiceNameFromContext ¶ added in v0.31.0
func WebrpcMethods ¶ added in v0.47.0
func WebrpcMethods() map[string]method
Types ¶
type ETHTxnStatus ¶
type ETHTxnStatus uint
const ( ETHTxnStatus_UNKNOWN ETHTxnStatus = 0 // txn rejected by relayer ETHTxnStatus_DROPPED ETHTxnStatus = 1 // txn accepted by relayer, waiting to be sent ETHTxnStatus_QUEUED ETHTxnStatus = 2 // txn sent, waiting for txn to be mined ETHTxnStatus_SENT ETHTxnStatus = 3 // txn mined, all txns in the bundle succeeded ETHTxnStatus_SUCCEEDED ETHTxnStatus = 4 // txn mined, but some txns in the bundle failed ETHTxnStatus_PARTIALLY_FAILED ETHTxnStatus = 5 // txn mined, but all txns in the bundle failed ETHTxnStatus_FAILED ETHTxnStatus = 6 // txn accepted by relayer, waiting for preconditions to be satisfied ETHTxnStatus_PENDING_PRECONDITION ETHTxnStatus = 7 )
func (*ETHTxnStatus) Is ¶ added in v0.31.0
func (x *ETHTxnStatus) Is(values ...ETHTxnStatus) bool
func (ETHTxnStatus) MarshalText ¶ added in v0.31.0
func (x ETHTxnStatus) MarshalText() ([]byte, error)
func (ETHTxnStatus) String ¶
func (x ETHTxnStatus) String() string
func (*ETHTxnStatus) UnmarshalText ¶ added in v0.31.0
func (x *ETHTxnStatus) UnmarshalText(b []byte) error
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) Is ¶ added in v0.31.0
func (x *FeeTokenType) Is(values ...FeeTokenType) bool
func (FeeTokenType) MarshalText ¶ added in v0.31.0
func (x FeeTokenType) MarshalText() ([]byte, error)
func (FeeTokenType) String ¶ added in v0.4.12
func (x FeeTokenType) String() string
func (*FeeTokenType) UnmarshalText ¶ added in v0.31.0
func (x *FeeTokenType) UnmarshalText(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"`
ChainID uint64 `json:"chainId" db:"chain_id,omitempty"`
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"`
ChainID uint64 `json:"chainId" db:"chain_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 IntentPrecondition ¶ added in v0.60.0
type IntentSolution ¶ added in v0.60.0
type IntentSolution struct {
Transactions []*Transactions `json:"transactions"`
}
type MetaTxn ¶
type MetaTxn struct {
WalletAddress string `json:"walletAddress" db:"wallet_address"`
// TODO (later): rename this to `to: string`
Contract string `json:"contract" db:"to_address"`
// TODO: rename to 'execdata'
Input string `json:"input" db:"tx_data"`
}
TODO: rename this to MetaTxnRaw (eventually), we can leave it for now to not break compat or name it, MetaTxnArgs ..?
type MetaTxnLog ¶ added in v0.4.12
type MetaTxnLog struct {
ID uint64 `json:"id" db:"id,omitempty"`
ChainID uint64 `json:"chainId" db:"chain_id,omitempty"`
ProjectID uint64 `json:"projectId" db:"project_id"`
// this is optional, but we don't specify txnHash?: string,
// otherwise it sets go.field.type to pointer-type which we dont want.
TxnHash prototyp.HashMaybe `json:"txnHash" db:"txn_hash"`
// TODO: this should be txnNonce?: string, but pgx giving issues
// with *prototyp.BigInt scanning
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"`
// TODO: review this field.. we may not want it.. what goes in here..? is it just
// the input/target from MetaTxn above? we already have these as separate columns..
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"`
Cost decimal.Decimal `json:"cost" db:"-"`
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"`
}
TODO: review
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"`
BlockNumber prototyp.BigInt `json:"blockNumber"`
TxnHash string `json:"txnHash"`
TxnReceipt string `json:"txnReceipt"`
}
type MetaTxnReceiptLog ¶ added in v0.4.12
type Page ¶ added in v0.4.12
type Page struct {
// Common for both numbered pages and cursor: Number of items per page
PageSize *uint32 `json:"pageSize"`
// Numbered pages: Page number, this is multiplied by the value of the <pageSize> parameter.
Page *uint32 `json:"page"`
More *bool `json:"more"`
// Number of total items on this query.
TotalRecords *uint64 `json:"total_records,omitempty"`
// Cursor: column to compare before/after to
Column *string `json:"column,omitempty"`
// Cursor: return column < before - include to get previous page
Before *interface{} `json:"before,omitempty"`
// Cursor: return column > after - include to get next page
After *interface{} `json:"after,omitempty"`
// Sorting filter
Sort []*SortBy `json:"sort,omitempty"`
}
Page represents a results page. This can be used both to request a page and to store the state of a page.
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)
//
// Transactions
//
// TODO (future): rename this to just, 'SendTransaction(txn: MetaTransaction)' or 'SendTransaction(txn: SignedTransaction)', or something..
// Project ID is only used by service and admin calls. Other clients must have projectID passed via the context
// TODO: rename return txnHash: string to metaTxnID: string
SendMetaTxn(ctx context.Context, call *MetaTxn, quote *string, projectID *uint64, preconditions []*IntentPrecondition) (bool, string, error)
GetMetaTxnNonce(ctx context.Context, walletContractAddress string, space *string) (string, error)
// TODO: one day, make GetMetaTxnReceipt respond immediately with receipt or not
// and add WaitTransactionReceipt method, which will block and wait, similar to how GetMetaTxnReceipt
// is implemented now.
// For backwards compat, we can leave the current GetMetaTxnReceipt how it is, an deprecate it, and introduce
// new, GetTransactionReceipt and WaitTransactionReceipt methods
// we can also accept metaTxnId and txnHash .. so can take either or.. I wonder if ERC-4337 has any convention on this?
GetMetaTxnReceipt(ctx context.Context, metaTxID string) (*MetaTxnReceipt, error)
Simulate(ctx context.Context, wallet string, transactions string) ([]*SimulateResult, error)
SimulateV3(ctx context.Context, wallet string, calls string) ([]*SimulateV3Result, error)
// TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
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)
// TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
GetMetaTxnNetworkFeeOptions(ctx context.Context, walletConfig interface{}, payload string) ([]*FeeOption, error)
GetMetaTransactions(ctx context.Context, projectId uint64, page *Page) (*Page, []*MetaTxnLog, error)
GetTransactionCost(ctx context.Context, projectId uint64, from time.Time, to time.Time) (float64, error)
// Sent transactions from an account. If filter is omitted then it will return all transactions.
SentTransactions(ctx context.Context, filter *SentTransactionsFilter, page *Page) (*Page, []*Transaction, error)
// Pending transactions waiting to be mined for an account. This endpoint is just a sugar of `SentTransactions`
// with the filter set to pending: true.
PendingTransactions(ctx context.Context, page *Page) (*Page, []*Transaction, error)
// Legacy Gas Tank
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)
// Legacy Gas Adjustment
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)
// Gas Sponsorship
ListGasSponsors(ctx context.Context, projectId uint64, page *Page) (*Page, []*GasSponsor, error)
GetGasSponsor(ctx context.Context, projectId uint64, id uint64) (*GasSponsor, error)
AddGasSponsor(ctx context.Context, projectId uint64, address string, name *string, active *bool) (bool, *GasSponsor, error)
UpdateGasSponsor(ctx context.Context, projectId uint64, id uint64, name *string, active *bool) (bool, *GasSponsor, error)
RemoveGasSponsor(ctx context.Context, projectId uint64, id uint64) (bool, error)
// Gas Sponsor Lookup
AddressGasSponsors(ctx context.Context, address string, page *Page) (*Page, []*GasSponsor, error)
// Project Balance
GetProjectBalance(ctx context.Context, projectId uint64) (float64, error)
AdjustProjectBalance(ctx context.Context, projectId uint64, amount float64, identifier string) (float64, error)
}
type RelayerClient ¶ added in v0.31.0
type RelayerClient 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)
//
// Transactions
//
// TODO (future): rename this to just, 'SendTransaction(txn: MetaTransaction)' or 'SendTransaction(txn: SignedTransaction)', or something..
// Project ID is only used by service and admin calls. Other clients must have projectID passed via the context
// TODO: rename return txnHash: string to metaTxnID: string
SendMetaTxn(ctx context.Context, call *MetaTxn, quote *string, projectID *uint64, preconditions []*IntentPrecondition) (bool, string, error)
GetMetaTxnNonce(ctx context.Context, walletContractAddress string, space *string) (string, error)
// TODO: one day, make GetMetaTxnReceipt respond immediately with receipt or not
// and add WaitTransactionReceipt method, which will block and wait, similar to how GetMetaTxnReceipt
// is implemented now.
// For backwards compat, we can leave the current GetMetaTxnReceipt how it is, an deprecate it, and introduce
// new, GetTransactionReceipt and WaitTransactionReceipt methods
// we can also accept metaTxnId and txnHash .. so can take either or.. I wonder if ERC-4337 has any convention on this?
GetMetaTxnReceipt(ctx context.Context, metaTxID string) (*MetaTxnReceipt, error)
Simulate(ctx context.Context, wallet string, transactions string) ([]*SimulateResult, error)
SimulateV3(ctx context.Context, wallet string, calls string) ([]*SimulateV3Result, error)
// TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
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)
// TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date
GetMetaTxnNetworkFeeOptions(ctx context.Context, walletConfig interface{}, payload string) ([]*FeeOption, error)
GetMetaTransactions(ctx context.Context, projectId uint64, page *Page) (*Page, []*MetaTxnLog, error)
GetTransactionCost(ctx context.Context, projectId uint64, from time.Time, to time.Time) (float64, error)
// Sent transactions from an account. If filter is omitted then it will return all transactions.
SentTransactions(ctx context.Context, filter *SentTransactionsFilter, page *Page) (*Page, []*Transaction, error)
// Pending transactions waiting to be mined for an account. This endpoint is just a sugar of `SentTransactions`
// with the filter set to pending: true.
PendingTransactions(ctx context.Context, page *Page) (*Page, []*Transaction, error)
// Legacy Gas Tank
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)
// Legacy Gas Adjustment
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)
// Gas Sponsorship
ListGasSponsors(ctx context.Context, projectId uint64, page *Page) (*Page, []*GasSponsor, error)
GetGasSponsor(ctx context.Context, projectId uint64, id uint64) (*GasSponsor, error)
AddGasSponsor(ctx context.Context, projectId uint64, address string, name *string, active *bool) (bool, *GasSponsor, error)
UpdateGasSponsor(ctx context.Context, projectId uint64, id uint64, name *string, active *bool) (bool, *GasSponsor, error)
RemoveGasSponsor(ctx context.Context, projectId uint64, id uint64) (bool, error)
// Gas Sponsor Lookup
AddressGasSponsors(ctx context.Context, address string, page *Page) (*Page, []*GasSponsor, error)
// Project Balance
GetProjectBalance(ctx context.Context, projectId uint64) (float64, error)
AdjustProjectBalance(ctx context.Context, projectId uint64, amount float64, identifier string) (float64, error)
}
func NewRelayerClient ¶
func NewRelayerClient(addr string, client HTTPClient) RelayerClient
type RuntimeChecks ¶ added in v0.5.6
type RuntimeChecks struct {
}
type RuntimeStatus ¶
type RuntimeStatus struct {
// overall status, true/false
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"`
ChainID uint64 `json:"chainID"`
UseEIP1559 bool `json:"useEIP1559"`
Senders []*SenderStatus `json:"senders"`
Checks *RuntimeChecks `json:"checks"`
}
type SenderStatus ¶ added in v0.5.6
type SentTransactionsFilter ¶ added in v0.4.12
type SequenceContext ¶
type SimulateResult ¶ added in v0.13.0
type SimulateStatus ¶ added in v0.60.0
type SimulateStatus int
const ( SimulateStatus_SKIPPED SimulateStatus = 0 SimulateStatus_SUCCEEDED SimulateStatus = 1 SimulateStatus_FAILED SimulateStatus = 2 SimulateStatus_ABORTED SimulateStatus = 3 SimulateStatus_REVERTED SimulateStatus = 4 SimulateStatus_NOT_ENOUGH_GAS SimulateStatus = 5 )
func (*SimulateStatus) Is ¶ added in v0.60.0
func (x *SimulateStatus) Is(values ...SimulateStatus) bool
func (SimulateStatus) MarshalText ¶ added in v0.60.0
func (x SimulateStatus) MarshalText() ([]byte, error)
func (SimulateStatus) String ¶ added in v0.60.0
func (x SimulateStatus) String() string
func (*SimulateStatus) UnmarshalText ¶ added in v0.60.0
func (x *SimulateStatus) UnmarshalText(b []byte) error
type SimulateV3Result ¶ added in v0.60.0
type SimulateV3Result struct {
Status SimulateStatus `json:"status"`
Result *string `json:"result"`
Error *string `json:"error"`
GasUsed uint64 `json:"gasUsed"`
GasLimit uint64 `json:"gasLimit"`
}
type SortOrder ¶ added in v0.4.12
type SortOrder uint32
func (SortOrder) MarshalText ¶ added in v0.31.0
func (*SortOrder) UnmarshalText ¶ added in v0.31.0
type Transaction ¶ added in v0.4.12
type Transactions ¶ added in v0.60.0
type Transactions struct {
ChainID prototyp.BigInt `json:"chainId"`
Transactions []*Transaction `json:"transactions"`
Preconditions []*IntentPrecondition `json:"preconditions,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) Is ¶ added in v0.31.0
func (x *TransferType) Is(values ...TransferType) bool
func (TransferType) MarshalText ¶ added in v0.31.0
func (x TransferType) MarshalText() ([]byte, error)
func (TransferType) String ¶ added in v0.4.12
func (x TransferType) String() string
func (*TransferType) UnmarshalText ¶ added in v0.31.0
func (x *TransferType) UnmarshalText(b []byte) error
type TxnLogTransfer ¶ added in v0.4.12
type TxnLogUser ¶ added in v0.4.12
type TxnLogUser struct {
Username string `json:"username"`
}
TODO: remove this.. we're not going to include username here anymore, the client will have to do it.
type WebRPCError ¶ added in v0.31.0
type WebRPCError struct {
Name string `json:"error"`
Code int `json:"code"`
Message string `json:"msg"`
Cause string `json:"cause,omitempty"`
HTTPStatus int `json:"status"`
// contains filtered or unexported fields
}
func ErrorWithCause
deprecated
added in
v0.31.0
func ErrorWithCause(rpcErr WebRPCError, cause error) WebRPCError
Deprecated: Use .WithCause() method on WebRPCError.
func (WebRPCError) Error ¶ added in v0.31.0
func (e WebRPCError) Error() string
func (WebRPCError) Is ¶ added in v0.31.0
func (e WebRPCError) Is(target error) bool
func (WebRPCError) Unwrap ¶ added in v0.31.0
func (e WebRPCError) Unwrap() error
func (WebRPCError) WithCause ¶ added in v0.31.0
func (e WebRPCError) WithCause(cause error) WebRPCError
func (WebRPCError) WithCausef ¶ added in v0.31.0
func (e WebRPCError) WithCausef(format string, args ...interface{}) WebRPCError
type WebrpcGenVersions ¶ added in v0.47.0
type WebrpcGenVersions struct {
WebrpcGenVersion string
CodeGenName string
CodeGenVersion string
SchemaName string
SchemaVersion string
}
func VersionFromHeader ¶ added in v0.47.0
func VersionFromHeader(h http.Header) (*WebrpcGenVersions, error)