Documentation
¶
Overview ¶
sequence-indexer v0.4.0 1117b6437f36df60afaa20427e689e446cfffb97 -- Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT.
webrpc-gen -schema=merged.gen.json -target=golang -pkg=indexer -client -out=./clients/indexer.gen.go
Index ¶
- Constants
- Variables
- func HTTPRequestHeaders(ctx context.Context) (http.Header, bool)
- func PtrTo[T any](v T) *T
- func WebRPCSchemaHash() string
- func WebRPCSchemaVersion() string
- func WebRPCVersion() string
- func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error)
- type Asset
- type BloomStats
- type BloomStatus
- type Bond
- type ChainInfo
- type ContractInfo
- type ContractInfoExtensionBridgeInfo
- type ContractInfoExtensionIndexingInfo
- type ContractInfoExtensions
- type ContractType
- type ContractVerificationStatus
- type DiskUsage
- type EtherBalance
- type EventDecoded
- type EventFilter
- type EventLog
- type EventLogDataType
- type EventLogType
- type GatewayBackendResponseTime
- type GatewayBackendRuntimeStatus
- type GatewayEtherBalance
- type GatewayNativeTokenBalance
- type GatewayNativeTokenBalances
- type GatewayOptions
- type GatewayPrice
- type GatewayRuntimeStatus
- type GatewayTokenBalance
- type GatewayTokenPriceQuery
- type GatewayTransaction
- type HTTPClient
- type IndexState
- type IndexedBlock
- type IndexerClient
- type IndexerGatewayClient
- type IndexerMetrics
- type MarketplaceOrder
- type MarketplaceOrderFilter
- type MarketplaceTopOrdersFilter
- type MetadataOptions
- type NativeTokenBalance
- type NetworkType
- type Options
- type OrderStatus
- type Page
- type PebbleMetrics
- type Price
- type ResourceStatus
- type RuntimeChecks
- type RuntimeStatus
- type SortBy
- type SortOrder
- type SubscribeBalanceUpdatesStreamReader
- type SubscribeEventsStreamReader
- type SubscribeReceiptsStreamReader
- type TokenBalance
- type TokenBalanceFilter
- type TokenBalancesByContractFilter
- type TokenBalancesFilter
- type TokenHistory
- type TokenIDRange
- type TokenMetadata
- type TokenPriceQuery
- type TokenSupply
- type Transaction
- type TransactionFilter
- type TransactionHistoryFilter
- type TransactionLog
- type TransactionReceipt
- type TransactionStatus
- type TransactionType
- type TxnInfo
- type TxnTransfer
- type TxnTransferType
- type Version
- type WALWriterRuntimeStatus
- type WebRPCError
- type WebhookListener
- type WebrpcGenVersions
Constants ¶
const DefaultIndexerGatewayServiceURL = "https://indexer.sequence.app"
const IndexerGatewayPathPrefix = "/rpc/IndexerGateway/"
const IndexerPathPrefix = "/rpc/Indexer/"
const WebrpcHeader = "Webrpc"
const WebrpcHeaderValue = "webrpc@v0.31.2;gen-golang@v0.23.3;sequence-indexer@v0.4.0"
Variables ¶
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} ErrWebrpcClientAborted = WebRPCError{Code: -8, Name: "WebrpcClientAborted", Message: "request aborted by client", 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 ( ErrAborted = WebRPCError{Code: 1005, Name: "Aborted", Message: "Request aborted", HTTPStatus: 400} ErrAccessKeyMismatch = WebRPCError{Code: 1102, Name: "AccessKeyMismatch", Message: "Access key mismatch", HTTPStatus: 409} ErrAccessKeyNotFound = WebRPCError{Code: 1101, Name: "AccessKeyNotFound", Message: "Access key not found", HTTPStatus: 401} ErrAtLeastOneKey = WebRPCError{Code: 1302, Name: "AtLeastOneKey", Message: "You need at least one Access Key", HTTPStatus: 403} ErrGeoblocked = WebRPCError{Code: 1006, Name: "Geoblocked", Message: "Geoblocked region", HTTPStatus: 451} ErrInvalidArgument = WebRPCError{Code: 2001, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} 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} ErrMaxAccessKeys = WebRPCError{Code: 1301, Name: "MaxAccessKeys", Message: "Access keys limit reached", HTTPStatus: 403} ErrMetadataCallFailed = WebRPCError{Code: 3003, Name: "MetadataCallFailed", Message: "Metadata service call failed", HTTPStatus: 400} ErrMethodNotFound = WebRPCError{Code: 1003, Name: "MethodNotFound", Message: "Method not found", HTTPStatus: 404} ErrNoDefaultKey = WebRPCError{Code: 1300, Name: "NoDefaultKey", Message: "No default access key found", HTTPStatus: 403} ErrNotFound = WebRPCError{Code: 3000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} ErrPermissionDenied = WebRPCError{Code: 1001, Name: "PermissionDenied", Message: "Permission denied", HTTPStatus: 403} ErrProjectNotFound = WebRPCError{Code: 1100, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 401} ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} ErrQuotaExceeded = WebRPCError{Code: 1200, Name: "QuotaExceeded", Message: "Quota exceeded", HTTPStatus: 429} ErrRateLimit = WebRPCError{Code: 1201, Name: "RateLimit", Message: "Rate limit exceeded", HTTPStatus: 429} ErrRateLimited = WebRPCError{Code: 1007, Name: "RateLimited", Message: "Rate-limited. Please slow down.", HTTPStatus: 429} ErrRequestConflict = WebRPCError{Code: 1004, Name: "RequestConflict", Message: "Conflict with target resource", HTTPStatus: 409} ErrResourceExhausted = WebRPCError{Code: 2004, Name: "ResourceExhausted", Message: "Resource exhausted", HTTPStatus: 400} ErrSessionExpired = WebRPCError{Code: 1002, Name: "SessionExpired", Message: "Session expired", HTTPStatus: 403} ErrTimeout = WebRPCError{Code: 1900, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} )
Schema errors
var ContractType_name = map[uint8]string{
0: "UNKNOWN",
1: "NATIVE",
2: "ERC20",
3: "ERC721",
4: "ERC1155",
5: "SEQUENCE_WALLET",
6: "ERC20_BRIDGE",
7: "ERC721_BRIDGE",
8: "ERC1155_BRIDGE",
9: "SEQ_MARKETPLACE",
10: "ERC6909",
}
var ContractType_value = map[string]uint8{
"UNKNOWN": 0,
"NATIVE": 1,
"ERC20": 2,
"ERC721": 3,
"ERC1155": 4,
"SEQUENCE_WALLET": 5,
"ERC20_BRIDGE": 6,
"ERC721_BRIDGE": 7,
"ERC1155_BRIDGE": 8,
"SEQ_MARKETPLACE": 9,
"ERC6909": 10,
}
var EventLogDataType_name = map[uint8]string{
0: "EVENT",
1: "TOKEN_TRANSFER",
2: "NATIVE_TOKEN_TRANSFER",
3: "SEQUENCE_TXN",
}
var EventLogDataType_value = map[string]uint8{
"EVENT": 0,
"TOKEN_TRANSFER": 1,
"NATIVE_TOKEN_TRANSFER": 2,
"SEQUENCE_TXN": 3,
}
var EventLogType_name = map[uint8]string{
0: "UNKNOWN",
1: "BLOCK_ADDED",
2: "BLOCK_REMOVED",
}
var EventLogType_value = map[string]uint8{
"UNKNOWN": 0,
"BLOCK_ADDED": 1,
"BLOCK_REMOVED": 2,
}
var (
HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"}
)
var NetworkType_name = map[uint8]string{
0: "MAINNETS",
1: "TESTNETS",
2: "ALL",
}
var NetworkType_value = map[string]uint8{
"MAINNETS": 0,
"TESTNETS": 1,
"ALL": 2,
}
var OrderStatus_name = map[uint32]string{
0: "OPEN",
1: "CLOSED",
2: "CANCELLED",
}
var OrderStatus_value = map[string]uint32{
"OPEN": 0,
"CLOSED": 1,
"CANCELLED": 2,
}
var ResourceStatus_name = map[uint32]string{
0: "NOT_AVAILABLE",
1: "REFRESHING",
2: "AVAILABLE",
}
var ResourceStatus_value = map[string]uint32{
"NOT_AVAILABLE": 0,
"REFRESHING": 1,
"AVAILABLE": 2,
}
var SortOrder_name = map[uint32]string{
0: "DESC",
1: "ASC",
}
var SortOrder_value = map[string]uint32{
"DESC": 0,
"ASC": 1,
}
var TransactionStatus_name = map[uint32]string{
0: "FAILED",
1: "SUCCESSFUL",
}
var TransactionStatus_value = map[string]uint32{
"FAILED": 0,
"SUCCESSFUL": 1,
}
var TransactionType_name = map[uint32]string{
0: "LegacyTxnType",
1: "AccessListTxnType",
2: "DynamicFeeTxnType",
}
var TransactionType_value = map[string]uint32{
"LegacyTxnType": 0,
"AccessListTxnType": 1,
"DynamicFeeTxnType": 2,
}
var TxnTransferType_name = map[uint32]string{
0: "UNKNOWN",
1: "SEND",
2: "RECEIVE",
}
var TxnTransferType_value = map[string]uint32{
"UNKNOWN": 0,
"SEND": 1,
"RECEIVE": 2,
}
Functions ¶
Types ¶
type Asset ¶
type Asset struct {
ID uint64 `json:"id" db:"id,omitempty"`
CollectionID uint64 `json:"collectionId" db:"collection_id"`
TokenID *prototyp.BigInt `json:"tokenId" db:"token_id,omitempty"`
URL string `json:"url" db:"url"`
MetadataField string `json:"metadataField,omitempty" db:"metadata_field"`
Filename string `json:"filename,omitempty" db:"filename"`
Filesize uint32 `json:"filesize,omitempty" db:"filesize"`
MimeType string `json:"mimeType,omitempty" db:"mime_type"`
Width *uint16 `json:"width,omitempty" db:"width"`
Height *uint16 `json:"height,omitempty" db:"height"`
UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
}
Asset is a database type used by 'collections' to record static assets for a particular 'token' for the token metadata.
type BloomStats ¶ added in v0.61.0
type BloomStatus ¶
type BloomStatus struct {
Enabled bool `json:"enabled"`
Initialized bool `json:"initialized"`
BloomInitElapsedTime string `json:"bloomInitElapsedTime"`
Stats *BloomStats `json:"stats"`
}
type Bond ¶
type Bond struct {
Pebble *PebbleMetrics `json:"pebble"`
EstimatedDiskUsagePerTable interface{} `json:"estimatedDiskUsagePerTable"`
EstimatedDiskUsageTotal string `json:"estimatedDiskUsageTotal"`
}
type ContractInfo ¶
type ContractInfo struct {
ChainID uint64 `json:"chainId" cbor:"-"`
Address string `json:"address" cbor:"-"`
Source string `json:"source" cbor:"-"`
Name string `json:"name" cbor:"-"`
Type string `json:"type" cbor:"-"`
Symbol string `json:"symbol" cbor:"-"`
Decimals *uint64 `json:"decimals,omitempty" cbor:"-"`
LogoURI string `json:"logoURI,omitempty" cbor:"-"`
Deployed bool `json:"deployed" cbor:"-"`
BytecodeHash prototyp.Hash `json:"bytecodeHash" cbor:"-"`
Extensions *ContractInfoExtensions `json:"extensions" cbor:"-"`
ContentHash uint64 `json:"-" cbor:"-"`
UpdatedAt time.Time `json:"updatedAt" cbor:"-"`
QueuedAt *time.Time `json:"queuedAt"`
Status ResourceStatus `json:"status"`
}
ContractInfo is RPC type for responding to clients that represents the contract-level metadata.
type ContractInfoExtensionBridgeInfo ¶ added in v0.61.0
type ContractInfoExtensionBridgeInfo struct {
TokenAddress string `json:"tokenAddress" cbor:"-"`
}
type ContractInfoExtensionIndexingInfo ¶ added in v0.61.0
type ContractInfoExtensionIndexingInfo struct {
UseOnChainBalance bool `json:"useOnChainBalance,omitempty" cbor:"-"`
}
type ContractInfoExtensions ¶
type ContractInfoExtensions struct {
Link string `json:"link,omitempty" cbor:"-"`
Description string `json:"description,omitempty" cbor:"-"`
Categories []string `json:"categories,omitempty" cbor:"-"`
BridgeInfo map[string]ContractInfoExtensionBridgeInfo `json:"bridgeInfo,omitempty" cbor:"-"`
IndexingInfo *ContractInfoExtensionIndexingInfo `json:"indexingInfo,omitempty" cbor:"-"`
OgImage string `json:"ogImage,omitempty" cbor:"-"`
OgName string `json:"ogName,omitempty" cbor:"-"`
OriginChainID uint64 `json:"originChainId,omitempty" cbor:"-"`
OriginAddress string `json:"originAddress,omitempty" cbor:"-"`
Blacklist bool `json:"blacklist,omitempty" cbor:"-"`
Verified bool `json:"verified,omitempty" cbor:"-"`
VerifiedBy string `json:"verifiedBy,omitempty" cbor:"-"`
Featured bool `json:"featured,omitempty" cbor:"-"`
FeatureIndex uint8 `json:"featureIndex,omitempty" cbor:"-"`
}
type ContractType ¶
type ContractType uint8
const ( ContractType_UNKNOWN ContractType = 0 ContractType_NATIVE ContractType = 1 ContractType_ERC20 ContractType = 2 ContractType_ERC721 ContractType = 3 ContractType_ERC1155 ContractType = 4 ContractType_SEQUENCE_WALLET ContractType = 5 ContractType_ERC20_BRIDGE ContractType = 6 ContractType_ERC721_BRIDGE ContractType = 7 ContractType_ERC1155_BRIDGE ContractType = 8 ContractType_SEQ_MARKETPLACE ContractType = 9 ContractType_ERC6909 ContractType = 10 )
func (*ContractType) Is ¶
func (x *ContractType) Is(values ...ContractType) bool
func (ContractType) MarshalText ¶
func (x ContractType) MarshalText() ([]byte, error)
func (ContractType) String ¶
func (x ContractType) String() string
func (*ContractType) UnmarshalText ¶
func (x *ContractType) UnmarshalText(b []byte) error
type ContractVerificationStatus ¶
type ContractVerificationStatus string
const ( ContractVerificationStatus_VERIFIED ContractVerificationStatus = "VERIFIED" ContractVerificationStatus_UNVERIFIED ContractVerificationStatus = "UNVERIFIED" ContractVerificationStatus_ALL ContractVerificationStatus = "ALL" )
func (*ContractVerificationStatus) Is ¶
func (x *ContractVerificationStatus) Is(values ...ContractVerificationStatus) bool
func (ContractVerificationStatus) MarshalText ¶
func (x ContractVerificationStatus) MarshalText() ([]byte, error)
func (*ContractVerificationStatus) UnmarshalText ¶
func (x *ContractVerificationStatus) UnmarshalText(b []byte) error
type EtherBalance ¶
type EventDecoded ¶
type EventFilter ¶
type EventLog ¶
type EventLog struct {
ID uint64 `json:"id,omitempty" cbor:"id,omitempty"`
UID prototyp.Hash `json:"uid,omitempty" cbor:"uid,omitempty"`
Type EventLogType `json:"type" cbor:"type"`
BlockNumber uint64 `json:"blockNumber" cbor:"block_num"`
BlockHash prototyp.Hash `json:"blockHash" cbor:"block_hash"`
ParentBlockHash prototyp.Hash `json:"parentBlockHash,omitempty" cbor:"parent_block_hash"`
ContractAddress prototyp.Hash `json:"contractAddress" cbor:"contract_address"`
ContractType ContractType `json:"contractType" cbor:"contract_type"`
TxnHash prototyp.Hash `json:"txnHash" cbor:"txn_hash"`
TxnIndex uint `json:"txnIndex" cbor:"txn_index"`
TxnLogIndex uint `json:"txnLogIndex" cbor:"txn_log_index"`
LogDataType EventLogDataType `json:"logDataType" cbor:"log_data_type"`
TS time.Time `json:"ts" cbor:"ts"`
TxnInfo *TxnInfo `json:"txnInfo,omitempty" cbor:"txn_info"`
RawLog map[string]interface{} `json:"rawLog,omitempty" cbor:"-"`
Event *EventDecoded `json:"event,omitempty" cbor:"-"`
}
type EventLogDataType ¶
type EventLogDataType uint8
const ( EventLogDataType_EVENT EventLogDataType = 0 EventLogDataType_TOKEN_TRANSFER EventLogDataType = 1 EventLogDataType_NATIVE_TOKEN_TRANSFER EventLogDataType = 2 EventLogDataType_SEQUENCE_TXN EventLogDataType = 3 )
func (*EventLogDataType) Is ¶
func (x *EventLogDataType) Is(values ...EventLogDataType) bool
func (EventLogDataType) MarshalText ¶
func (x EventLogDataType) MarshalText() ([]byte, error)
func (EventLogDataType) String ¶
func (x EventLogDataType) String() string
func (*EventLogDataType) UnmarshalText ¶
func (x *EventLogDataType) UnmarshalText(b []byte) error
type EventLogType ¶
type EventLogType uint8
const ( EventLogType_UNKNOWN EventLogType = 0 EventLogType_BLOCK_ADDED EventLogType = 1 EventLogType_BLOCK_REMOVED EventLogType = 2 )
func (*EventLogType) Is ¶
func (x *EventLogType) Is(values ...EventLogType) bool
func (EventLogType) MarshalText ¶
func (x EventLogType) MarshalText() ([]byte, error)
func (EventLogType) String ¶
func (x EventLogType) String() string
func (*EventLogType) UnmarshalText ¶
func (x *EventLogType) UnmarshalText(b []byte) error
type GatewayBackendRuntimeStatus ¶
type GatewayBackendRuntimeStatus struct {
Name string `json:"name"`
ChainID uint64 `json:"chainId"`
ResponseTime *GatewayBackendResponseTime `json:"responseTime"`
}
type GatewayEtherBalance ¶
type GatewayEtherBalance struct {
ChainID uint64 `json:"chainId"`
ErrorReason *string `json:"errorReason,omitempty"`
Result *EtherBalance `json:"result"`
}
type GatewayNativeTokenBalance ¶
type GatewayNativeTokenBalance struct {
ChainID uint64 `json:"chainId"`
ErrorReason *string `json:"errorReason,omitempty"`
Result *NativeTokenBalance `json:"result"`
}
type GatewayNativeTokenBalances ¶
type GatewayNativeTokenBalances struct {
ChainId uint64 `json:"chainId"`
ErrorReason *string `json:"errorReason,omitempty"`
Results []*NativeTokenBalance `json:"results"`
}
type GatewayOptions ¶ added in v0.60.8
type GatewayOptions struct {
// JWTAuthToken is an optional JWT token to authenticate with the indexer
// gateway service.
JWTAuthToken string
// IndexerGatewayServiceURL is an optional custom URL for the Sequence Indexer Gateway
// service. If not provided, the default URL in `DefaultIndexerGatewayServiceURL`
// will be used.
IndexerGatewayServiceURL string
// HTTPClient is an optional custom HTTP client to use for communicating with the
// indexer gateway service.
HTTPClient HTTPClient
}
type GatewayPrice ¶ added in v0.61.0
type GatewayRuntimeStatus ¶
type GatewayTokenBalance ¶
type GatewayTokenBalance struct {
ChainID uint64 `json:"chainId"`
ErrorReason *string `json:"errorReason,omitempty"`
Results []*TokenBalance `json:"results"`
}
type GatewayTokenPriceQuery ¶ added in v0.61.0
type GatewayTokenPriceQuery struct {
ChainID uint64 `json:"chainID"`
Queries []*TokenPriceQuery `json:"queries"`
}
type GatewayTransaction ¶
type GatewayTransaction struct {
ChainID uint64 `json:"chainId"`
ErrorReason *string `json:"errorReason,omitempty"`
Results []*Transaction `json:"results"`
}
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 IndexState ¶
type IndexedBlock ¶
type IndexerClient ¶
type IndexerClient interface {
AddWebhookListener(ctx context.Context, url string, filters *EventFilter, projectId *uint64) (bool, *WebhookListener, error)
// Fetches a single receipt and then will stop the subscription
FetchTransactionReceipt(ctx context.Context, txnHash string, maxBlockWait *int) (*TransactionReceipt, error)
// Fetches a single receipt with filter and then will stop the subscription
FetchTransactionReceiptWithFilter(ctx context.Context, filter *TransactionFilter, maxBlockWait *int) (*TransactionReceipt, error)
// Webhooks
GetAllWebhookListeners(ctx context.Context, projectId *uint64) ([]*WebhookListener, error)
// Get balance update aggregate values -- useful for syncing balance details of a contract, ie. from Skyweaver.
// Also consider using SubscribeBalanceUpdates or SubscribeEvents as other alternatives.
GetBalanceUpdates(ctx context.Context, contractAddress string, lastBlockNumber uint64, lastBlockHash *string, page *Page) (*Page, []*TokenBalance, error)
// Get the chain ID of the indexer
GetChainID(ctx context.Context) (uint64, error)
// Queries an ethereum node for the latest and confirm ETH balances
// DEPRECATED: use GetNativeTokenBalance instead
//
// Deprecated: GetNativeTokenBalance
GetEtherBalance(ctx context.Context, accountAddress *string) (*EtherBalance, error)
// GetMarketplaceOrders queries marketplace orders with filtering and pagination.
//
// Retrieves buy orders (offers) and sell orders (listings) from a specific marketplace
// and collection with comprehensive filtering options.
//
// Parameters:
// marketplaceContractAddress: Target marketplace contract (required)
// collectionAddress: NFT collection contract (required)
// filter: MarketplaceOrderFilter with options:
// - isListing: true=listings, false=offers, omit=both
// - userAddresses: Include specific users
// - currencyAddresses: Filter by currencies (empty=all)
// - orderIds: Filter by specific order ids (empty=all)
// - tokenIds: Filter by specific tokens (empty=all)
// - excludeUserAddresses: Exclude specific users
// - blockNumberGt: Orders greater than block number
// - createdAtAfter: Orders after timestamp
// - orderStatuses: Filter by status (OPEN, CLOSED, CANCELLED)
// - returnExpired: Include expired orders
// page: Pagination control (optional)
//
// Returns: Updated pagination info and array of matching orders
GetMarketplaceOrders(ctx context.Context, marketplaceContractAddress string, collectionAddress string, filter *MarketplaceOrderFilter, page *Page) (*Page, []*MarketplaceOrder, error)
// GetMarketplaceTopOrders finds the most competitive orders for specific tokens.
//
// Optimized for price discovery, returns the best available orders for each token.
// Useful for displaying current market prices and finding trading opportunities.
//
// Parameters:
// marketplaceContractAddress: Target marketplace contract (required)
// collectionAddress: NFT collection contract (required)
// filter: MarketplaceTopOrdersFilter with options:
// - currencyAddresses: Consider specific currencies (empty=all)
// - tokenIds: Target token IDs (required, non-empty)
// - isListing: true=listings/sell orders, false=offers/buy orders
// - priceSort: ASC=lowest first, DESC=highest first
// - excludeUser: Hide orders from specific user
//
// Returns: Array of top-priced active orders, sorted by priceSort preference
GetMarketplaceTopOrders(ctx context.Context, marketplaceContractAddress string, collectionAddress string, filter *MarketplaceTopOrdersFilter) ([]*MarketplaceOrder, error)
// GetNativeTokenBalance queries an ethereum node for the latest native token account balance.
// The native token is the token of the chain the indexer is connected to, for example, ETH on Ethereum
// and POL on Polygon.
GetNativeTokenBalance(ctx context.Context, accountAddress *string, omitPrices *bool) (*NativeTokenBalance, error)
// GetTokenBalances returns a balance summary/details for a specific account. By default
// if accountAddress is left empty, it will use the account from the jwt session.
//
// Also, if contractAddress is undefined, then it will list all current user coins/collectibles.
// But, if contractAddress is provided, then it will return the token balances for the contract, this is
// only useful for 1155, but for other tokens, it can act as a filter for the single balance.
//
// DEPRECATED: use GetTokenBalancesSummary / GetTokenBalancesDetails
//
// Deprecated: GetTokenBalancesSummary
GetTokenBalances(ctx context.Context, accountAddress *string, contractAddress *string, tokenID *string, includeMetadata *bool, metadataOptions *MetadataOptions, includeCollectionTokens *bool, page *Page) (*Page, []*TokenBalance, error)
// GetTokenBalancesByContract returns a balances for a specific accounts and
// contracts. The collection ERC721 & ERC1155 tokens are represented as
// individual balances.
//
// If `filter` is not provided, it will error out as it requires at least
// contract address.
//
// If `filter.contractStatus` is not provided, it will include verified only
// tokens.
GetTokenBalancesByContract(ctx context.Context, filter *TokenBalancesByContractFilter, omitMetadata *bool, page *Page) (*Page, []*TokenBalance, error)
// GetTokenBalancesDetails returns a detailed balance summary for a specific
// accounts. The collection ERC721 & ERC1155 tokens are represented as
// individual balances.
//
// If `filter` is not provided, it will use the filter with account from the
// jwt session.
//
// If `filter.contractStatus` is not provided, it will include verified only
// tokens.
GetTokenBalancesDetails(ctx context.Context, filter *TokenBalancesFilter, omitMetadata *bool, page *Page) (*Page, []*NativeTokenBalance, []*TokenBalance, error)
// GetTokenBalancesSummary returns a summary of token balances for a specific
// accounts. The collection ERC721 & ERC1155 tokens are represented as a
// single aggregated balance.
//
// If `filter` is not provided, it will use the filter with account from the
// jwt session.
//
// If `filter.contractStatus` is not provided, it will include verified only
// tokens.
GetTokenBalancesSummary(ctx context.Context, filter *TokenBalancesFilter, omitMetadata *bool, page *Page) (*Page, []*NativeTokenBalance, []*TokenBalance, error)
// GetTokenIDRanges returns the range of tokenIDs for a token collection contract.
// This is useful for ERC-721 and ERC-1155 contracts to get the range of valid tokenIDs. It is similar to
// GetTokenIDs, but returns the range of tokenIDs instead of the list of tokenIDs, which is more efficient
// for large collections and very easy to the caller to expand the range into a list of tokenIDs.
//
// NOTE: this method will only return up to 15,000 ranges, if there are more ranges, it will return
// a boolean to indicate there are more ranges beyond the first 15,000. Therefore, if `moreRanges` is
// false then you have all the ranges, but if true, you need to make a follow up call to fetch the next
// page of ranges.
//
// As an example, if a NFT collection of 100,000 tokens uses ids from 1,2,3,...,100_000 then this endpoint
// will return just a single range from [1,100_000], but if there are gaps between the sequence, then
// those will be broken into separate range entries.
GetTokenIDRanges(ctx context.Context, contractAddress string, lastTokenID *string) (ContractType, []*TokenIDRange, bool, error)
// GetTokenIDs returns the list of each individual token id for a token collection contract.
// This is useful for ERC-721 and ERC-1155 contracts to get the list of valid tokenIDs.
GetTokenIDs(ctx context.Context, contractAddress string, page *Page) (*Page, ContractType, []string, error)
GetTokenPrice(ctx context.Context, q *TokenPriceQuery) (*Price, error)
GetTokenPrices(ctx context.Context, q []*TokenPriceQuery) ([]*Price, error)
// GetTokenSupplies returns the set of tokenIDs used by a contract address, supporting ERC-20, ERC-721, and ERC-1155
// contracts, and their respective supply as well.
GetTokenSupplies(ctx context.Context, contractAddress string, includeMetadata *bool, page *Page) (*Page, ContractType, []*TokenSupply, error)
// GetTokenSuppliesMap returns the token supplies of ERC-20 and ERC-1155 tokens as requested in the `tokenMap`
// represented as a map of contractAddress :: []tokenIDs.
//
// For an ERC-20 specify tokenIDs as an empty array or [0], for example, { '0xdef': [] } or { '0xdef': [0] }
// For ERC-1155 pass the array of tokens are strings, ie. { '0xabc': ['1', '2', '3'] }
GetTokenSuppliesMap(ctx context.Context, tokenMap map[string][]string, includeMetadata *bool) (map[string][]*TokenSupply, error)
// History of mined transactions for the account which includes a list of token transfers (sent/recieved)
// and sent transactions from a Sequence wallet
GetTransactionHistory(ctx context.Context, filter *TransactionHistoryFilter, page *Page, includeMetadata *bool, metadataOptions *MetadataOptions) (*Page, []*Transaction, error)
GetWebhookListener(ctx context.Context, id uint64, projectId *uint64) (*WebhookListener, error)
ListTokenPrices(ctx context.Context, page *Page) (*Page, []*Price, error)
PauseAllWebhookListeners(ctx context.Context, projectId *uint64) (bool, error)
// Ping the indexer
Ping(ctx context.Context) (bool, error)
RemoveAllWebhookListeners(ctx context.Context, projectId *uint64) (bool, error)
RemoveWebhookListener(ctx context.Context, id uint64, projectId *uint64) (bool, error)
ResumeAllWebhookListeners(ctx context.Context, projectId *uint64) (bool, error)
// Get the current runtime health status of the indexer
RuntimeStatus(ctx context.Context) (*RuntimeStatus, error)
// SubscribeBalanceUpdates listens to balance updates for a specific contract address
SubscribeBalanceUpdates(ctx context.Context, contractAddress string) (SubscribeBalanceUpdatesStreamReader, error)
// SubscribeEvents listens to events on-chain based on the filter criteria
//
// TODO: some additional options can be passed such as block, reorg true, etc.
// or stay behind, etc.
SubscribeEvents(ctx context.Context, filter *EventFilter) (SubscribeEventsStreamReader, error)
// Listen to transaction receipts on-chain based on the filter criteria
SubscribeReceipts(ctx context.Context, filter *TransactionFilter) (SubscribeReceiptsStreamReader, error)
// Re-sync an incorrect token balance with the correct on-chain balance
// NOTE: this method is almost never used, but we've marked it internal in case
// we ever want to use it again. This method was written a very long time ago in
// scenarios when the indexer had little bugs, but now its solid.
SyncBalance(ctx context.Context, accountAddress string, contractAddress string, tokenID *string) error
ToggleWebhookListener(ctx context.Context, id uint64, projectId *uint64) (*WebhookListener, error)
UpdateWebhookListener(ctx context.Context, listener *WebhookListener, projectId *uint64) (bool, error)
// Get the current version of the indexer
Version(ctx context.Context) (*Version, error)
}
func NewClient ¶ added in v0.60.8
func NewClient(indexerURL string, projectAccessKey string, clientOptions ...Options) IndexerClient
NewClient creates a new Sequence Indexer client instance for a specific chain. Please see https://sequence.build to get a `projectAccessKey`, which is your project's access key used to communicate with Sequence services.
NOTE: the `projectAccessKey` may be optional if you're using a JWT auth token passed in via the `clientOptions`.
The `indexerURL` is the URL of the indexer service to connect to, for example: https://mainnet-indexer.sequence.app for Ethereum mainnet and https://polygon-indexer.sequence.app for Polygon mainnet. See https://docs.sequence.xyz for a complete list of indexer urls.
Additionally, you may be interested in the `NewGatewayClient` which is a single client that connects to multiple indexers for many different chains at once.
Finally, you may pass in optional `clientOptions` to configure the indexer client with jwt-based authentication, a receipts listener, and a custom HTTP client.
func NewIndexerClient ¶
func NewIndexerClient(addr string, client HTTPClient) IndexerClient
type IndexerGatewayClient ¶
type IndexerGatewayClient interface {
// GetTokenBalances returns a balance summary/details for an specific account
// on all indexer nodes. By default if accountAddress is left empty, it will
// use the account from the jwt session.
GetBalanceUpdates(ctx context.Context, chainIds []uint64, networks []string, networkType *NetworkType, contractAddress string, lastBlockNumber uint64, lastBlockHash *string, page *Page) (*Page, []*GatewayTokenBalance, error)
// GetChains returns a list of chains with their ID and name
GetChains(ctx context.Context, networkType *NetworkType) ([]*ChainInfo, error)
// GetNativeTokenBalance queries indexer nodes for the latest native token
// account balance.
GetNativeTokenBalance(ctx context.Context, chainIds []uint64, networks []string, networkType *NetworkType, accountAddress *string, omitPrices *bool) ([]*GatewayNativeTokenBalance, error)
// GetTokenBalances returns a balance summary/details for a specific account
// on all indexer nodes. By default if accountAddress is left empty, it will
// use the account from the jwt session.
//
// Deprecated: Use GetTokenBalancesSummary or GetTokenBalancesDetails instead.
GetTokenBalances(ctx context.Context, chainIds []uint64, networks []string, networkType *NetworkType, accountAddress *string, contractAddress *string, tokenID *string, includeMetadata *bool, metadataOptions *MetadataOptions, includeCollectionTokens *bool, page *Page) (*Page, []*GatewayTokenBalance, error)
// GetTokenBalancesByContract returns a balances for specific accounts and
// contracts on all indexer nodes. The collection ERC721 & ERC1155 tokens are
// represented as individual balances.
GetTokenBalancesByContract(ctx context.Context, chainIds []uint64, networks []string, networkType *NetworkType, filter *TokenBalancesByContractFilter, omitMetadata *bool, page *Page) (*Page, []*GatewayTokenBalance, error)
// GetTokenBalancesDetails returns a detailed balance summary for the given
// accounts on all indexer nodes. The collection ERC721 & ERC1155 tokens are
// represented as individual balances.
GetTokenBalancesDetails(ctx context.Context, chainIds []uint64, networks []string, networkType *NetworkType, filter *TokenBalancesFilter, omitMetadata *bool, page *Page) (*Page, []*GatewayNativeTokenBalances, []*GatewayTokenBalance, error)
// GetTokenBalancesSummary returns a summary of token balances for the given
// accounts on all indexer nodes. The collection ERC721 & ERC1155 tokens are
// represented as a single aggregated balance.
GetTokenBalancesSummary(ctx context.Context, chainIds []uint64, networks []string, networkType *NetworkType, filter *TokenBalancesFilter, omitMetadata *bool, page *Page) (*Page, []*GatewayNativeTokenBalances, []*GatewayTokenBalance, error)
GetTokenPrice(ctx context.Context, q *GatewayTokenPriceQuery) (*GatewayPrice, error)
GetTokenPrices(ctx context.Context, q []*GatewayTokenPriceQuery) ([]*GatewayPrice, error)
// GetTransactionHistory returns the history of mined transactions for the
// given account on all indexer nodes, which includes a list of token transfer
// (sent/received) , and sent transactions from a Sequence wallet.
GetTransactionHistory(ctx context.Context, chainIds []uint64, networks []string, networkType *NetworkType, filter *TransactionHistoryFilter, includeMetadata *bool, metadataOptions *MetadataOptions, page *Page) (*Page, []*GatewayTransaction, error)
// Ping the indexer
Ping(ctx context.Context) (bool, error)
// Get the current runtime health status of the indexer gatewya
RuntimeStatus(ctx context.Context) (*GatewayRuntimeStatus, error)
// Get the current version of the indexer
Version(ctx context.Context) (*Version, error)
}
func NewGatewayClient ¶ added in v0.60.8
func NewGatewayClient(projectAccessKey string, clientOptions ...GatewayOptions) IndexerGatewayClient
func NewIndexerGatewayClient ¶
func NewIndexerGatewayClient(addr string, client HTTPClient) IndexerGatewayClient
type IndexerMetrics ¶ added in v0.61.0
type MarketplaceOrder ¶ added in v0.61.0
type MarketplaceOrder struct {
OrderID prototyp.BigInt `json:"orderId" cbor:"1"`
TokenContract prototyp.Hash `json:"tokenContract" cbor:"2"`
TokenID prototyp.BigInt `json:"tokenId" cbor:"3"`
IsListing bool `json:"isListing" cbor:"4"`
Quantity prototyp.BigInt `json:"quantity" cbor:"5"`
QuantityRemaining prototyp.BigInt `json:"quantityRemaining" cbor:"6"`
CurrencyAddress prototyp.Hash `json:"currencyAddress" cbor:"7"`
PricePerToken prototyp.BigInt `json:"pricePerToken" cbor:"8"`
Expiry prototyp.BigInt `json:"expiry" cbor:"9"`
OrderStatus OrderStatus `json:"orderStatus" cbor:"10"`
CreatedBy prototyp.Hash `json:"createdBy" cbor:"11"`
BlockNumber uint64 `json:"blockNumber" cbor:"12"`
OrderbookContractAddress prototyp.Hash `json:"orderbookContractAddress" cbor:"13"`
CreatedAt uint64 `json:"createdAt" cbor:"14"`
}
type MarketplaceOrderFilter ¶ added in v0.61.0
type MarketplaceOrderFilter struct {
IsListing *bool `json:"isListing"`
UserAddresses []string `json:"userAddresses"`
CurrencyAddresses []string `json:"currencyAddresses"`
OrderIDs []string `json:"orderIds"`
TokenIDs []string `json:"tokenIds"`
ExcludeUserAddresses []string `json:"excludeUserAddresses"`
BlockNumberGt uint64 `json:"blockNumberGt"`
CreatedAtAfter int64 `json:"createdAtAfter"`
OrderStatuses []OrderStatus `json:"orderStatuses"`
ReturnExpired bool `json:"returnExpired"`
}
type MarketplaceTopOrdersFilter ¶ added in v0.61.0
type MetadataOptions ¶
type NativeTokenBalance ¶
type NativeTokenBalance struct {
AccountAddress prototyp.Hash `json:"accountAddress" cbor:"-"`
ChainID uint64 `json:"chainId" cbor:"-"`
Name string `json:"name" cbor:"-"`
Symbol string `json:"symbol" cbor:"-"`
Balance prototyp.BigInt `json:"balance" cbor:"-"`
BalanceUSD string `json:"balanceUSD,omitempty" cbor:"-"`
PriceUSD string `json:"priceUSD,omitempty" cbor:"-"`
ErrorReason *string `json:"errorReason,omitempty" cbor:"-"`
}
type NetworkType ¶
type NetworkType uint8
const ( NetworkType_MAINNETS NetworkType = 0 NetworkType_TESTNETS NetworkType = 1 NetworkType_ALL NetworkType = 2 )
func (*NetworkType) Is ¶
func (x *NetworkType) Is(values ...NetworkType) bool
func (NetworkType) MarshalText ¶
func (x NetworkType) MarshalText() ([]byte, error)
func (NetworkType) String ¶
func (x NetworkType) String() string
func (*NetworkType) UnmarshalText ¶
func (x *NetworkType) UnmarshalText(b []byte) error
type Options ¶
type Options struct {
// JWTAuthToken is an optional JWT token to authenticate with the indexer service.
JWTAuthToken string
// HTTPClient is an optional custom HTTP client to use for communicating with the
// indexer service.
HTTPClient HTTPClient
}
type OrderStatus ¶
type OrderStatus uint32
const ( OrderStatus_OPEN OrderStatus = 0 OrderStatus_CLOSED OrderStatus = 1 OrderStatus_CANCELLED OrderStatus = 2 )
func (*OrderStatus) Is ¶
func (x *OrderStatus) Is(values ...OrderStatus) bool
func (OrderStatus) MarshalText ¶
func (x OrderStatus) MarshalText() ([]byte, error)
func (OrderStatus) String ¶
func (x OrderStatus) String() string
func (*OrderStatus) UnmarshalText ¶
func (x *OrderStatus) UnmarshalText(b []byte) error
type Page ¶
type Page struct {
Page *uint32 `json:"page,omitempty"`
Column *string `json:"column,omitempty"`
Before *interface{} `json:"before,omitempty"`
After *interface{} `json:"after,omitempty"`
Sort []*SortBy `json:"sort,omitempty"`
PageSize *uint32 `json:"pageSize,omitempty"`
More *bool `json:"more,omitempty"`
}
Page represents a results page. This can be used both to request a page and to store the state of a page.
type PebbleMetrics ¶
type PebbleMetrics struct {
CompactionCount int64 `json:"compactionCount"`
CompactionEstimatedDebt uint64 `json:"compactionEstimatedDebt"`
CompactionInProgressBytes int64 `json:"compactionInProgressBytes"`
CompactionNumInProgress int64 `json:"compactionNumInProgress"`
CompactionMarkedFiles int `json:"compactionMarkedFiles"`
}
type ResourceStatus ¶
type ResourceStatus uint32
const ( ResourceStatus_NOT_AVAILABLE ResourceStatus = 0 ResourceStatus_REFRESHING ResourceStatus = 1 ResourceStatus_AVAILABLE ResourceStatus = 2 )
func (*ResourceStatus) Is ¶
func (x *ResourceStatus) Is(values ...ResourceStatus) bool
func (ResourceStatus) MarshalText ¶
func (x ResourceStatus) MarshalText() ([]byte, error)
func (ResourceStatus) String ¶
func (x ResourceStatus) String() string
func (*ResourceStatus) UnmarshalText ¶
func (x *ResourceStatus) UnmarshalText(b []byte) error
type RuntimeChecks ¶
type RuntimeChecks struct {
Running bool `json:"running"`
Runnables interface{} `json:"runnables"`
CgoEnabled bool `json:"cgoEnabled"`
QuotaControlEnabled bool `json:"quotaControlEnabled"`
SyncMode string `json:"syncMode"`
PercentIndexed float64 `json:"percentIndexed"`
LastBlockNum uint64 `json:"lastBlockNum"`
LastBlockNumWithState uint64 `json:"lastBlockNumWithState"`
BloomStatus *BloomStatus `json:"bloomStatus"`
Bond *Bond `json:"bond"`
DiskUsage *DiskUsage `json:"diskUsage"`
Metrics *IndexerMetrics `json:"metrics"`
}
type RuntimeStatus ¶
type RuntimeStatus struct {
HealthOK bool `json:"healthOK"`
IndexerEnabled bool `json:"indexerEnabled"`
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"`
Checks *RuntimeChecks `json:"checks"`
}
type SortOrder ¶
type SortOrder uint32
func (SortOrder) MarshalText ¶
func (*SortOrder) UnmarshalText ¶
type SubscribeBalanceUpdatesStreamReader ¶
type SubscribeBalanceUpdatesStreamReader interface {
Read() (balance *TokenBalance, err error)
}
type SubscribeReceiptsStreamReader ¶
type SubscribeReceiptsStreamReader interface {
Read() (receipt *TransactionReceipt, err error)
}
type TokenBalance ¶
type TokenBalance struct {
ContractType ContractType `json:"contractType" cbor:"1,omitempty"`
ContractAddress prototyp.Hash `json:"contractAddress" cbor:"2"`
AccountAddress prototyp.HashMaybe `json:"accountAddress,omitempty" cbor:"3,omitempty"`
TokenID *prototyp.BigInt `json:"tokenID,omitempty" cbor:"4"`
Balance prototyp.BigInt `json:"balance" cbor:"5"`
BalanceUSD string `json:"balanceUSD,omitempty" cbor:"-"`
PriceUSD string `json:"priceUSD,omitempty" cbor:"-"`
BlockHash prototyp.Hash `json:"blockHash,omitempty" cbor:"6"`
BlockNumber uint64 `json:"blockNumber,omitempty" cbor:"7"`
ChainID uint64 `json:"chainId" cbor:"-"`
UniqueCollectibles *prototyp.BigInt `json:"uniqueCollectibles,omitempty" cbor:"-"`
IsSummary bool `json:"isSummary,omitempty" cbor:"9"`
ContractInfo *ContractInfo `json:"contractInfo,omitempty" cbor:"-"`
TokenMetadata *TokenMetadata `json:"tokenMetadata,omitempty" cbor:"-"`
}
Token Balances
type TokenBalanceFilter ¶
type TokenBalancesByContractFilter ¶
type TokenBalancesByContractFilter struct {
ContractAddresses []prototyp.Hash `json:"contractAddresses"`
AccountAddresses []prototyp.Hash `json:"accountAddresses"`
ContractStatus ContractVerificationStatus `json:"contractStatus"`
}
type TokenBalancesFilter ¶
type TokenBalancesFilter struct {
AccountAddresses []prototyp.Hash `json:"accountAddresses"`
ContractStatus ContractVerificationStatus `json:"contractStatus"`
ContractTypes []ContractType `json:"contractTypes"`
ContractWhitelist []prototyp.Hash `json:"contractWhitelist"`
ContractBlacklist []prototyp.Hash `json:"contractBlacklist"`
OmitNativeBalances bool `json:"omitNativeBalances,omitempty"`
OmitPrices bool `json:"omitPrices,omitempty"`
}
type TokenHistory ¶
type TokenHistory struct {
BlockNumber uint64 `json:"blockNumber" cbor:"1"`
BlockHash prototyp.Hash `json:"blockHash" cbor:"2"`
ContractAddress prototyp.Hash `json:"contractAddress" cbor:"4"`
ContractType ContractType `json:"contractType" cbor:"5"`
FromAddress prototyp.Hash `json:"fromAddress" cbor:"6"`
ToAddress prototyp.Hash `json:"toAddress" cbor:"7"`
TxnHash prototyp.Hash `json:"txnHash" cbor:"8"`
TxnIndex uint `json:"txnIndex" cbor:"9"`
TxnLogIndex uint `json:"txnLogIndex" cbor:"a"`
TokenIDs []prototyp.BigInt `json:"tokenIDs" cbor:"b"`
Amounts []prototyp.BigInt `json:"amounts" cbor:"c"`
TS time.Time `json:"ts" cbor:"d"`
}
Token History
type TokenIDRange ¶
type TokenMetadata ¶
type TokenMetadata struct {
ChainID *uint64 `json:"chainId,omitempty" cbor:"-"`
ContractAddress prototyp.Hash `json:"contractAddress,omitempty" cbor:"-"`
TokenID string `json:"tokenId" cbor:"-"`
Source string `json:"source" cbor:"-"`
Name string `json:"name" cbor:"-"`
Description string `json:"description" cbor:"-"`
Image string `json:"image" cbor:"-"`
Video string `json:"video,omitempty" cbor:"-"`
Audio string `json:"audio,omitempty" cbor:"-"`
Properties map[string]interface{} `json:"properties" cbor:"-"`
Attributes []map[string]interface{} `json:"attributes" cbor:"-"`
ImageData string `json:"image_data,omitempty" cbor:"-"`
ExternalUrl string `json:"external_url,omitempty" cbor:"-"`
BackgroundColor string `json:"background_color,omitempty" cbor:"-"`
AnimationUrl string `json:"animation_url,omitempty" cbor:"-"`
Decimals *uint64 `json:"decimals,omitempty" cbor:"-"`
UpdatedAt time.Time `json:"updatedAt" cbor:"-"`
Assets []*Asset `json:"assets,omitempty" cbor:"-"`
Status ResourceStatus `json:"status"`
QueuedAt *time.Time `json:"queuedAt"`
LastFetched *time.Time `json:"lastFetched,omitempty"`
}
TokenMetadata based on 721/1155 standards, as well including some fields which are used by OpenSea.
TokenMetadata is RPC type for responding to clients that represents the token-level metadata.
type TokenPriceQuery ¶ added in v0.61.0
type TokenSupply ¶
type TokenSupply struct {
TokenID prototyp.BigInt `json:"tokenID,omitempty" cbor:"token_id"`
Supply prototyp.BigInt `json:"supply" cbor:"supply"`
ChainID uint64 `json:"chainId" cbor:"-"`
ContractInfo *ContractInfo `json:"contractInfo,omitempty" cbor:"-"`
TokenMetadata *TokenMetadata `json:"tokenMetadata,omitempty" cbor:"-"`
}
type Transaction ¶
type Transaction struct {
TxnHash prototyp.Hash `json:"txnHash" cbor:"1"`
BlockNumber uint64 `json:"blockNumber" cbor:"2"`
BlockHash prototyp.Hash `json:"blockHash" cbor:"3"`
ChainID uint64 `json:"chainId" cbor:"4"`
MetaTxnID *string `json:"metaTxnID" cbor:"5"`
Transfers []*TxnTransfer `json:"transfers" cbor:"6"`
Timestamp *time.Time `json:"timestamp" cbor:"7"`
}
type TransactionFilter ¶
type TransactionHistoryFilter ¶
type TransactionHistoryFilter struct {
AccountAddress *string `json:"accountAddress"`
ContractAddress *string `json:"contractAddress"`
AccountAddresses []string `json:"accountAddresses"`
ContractAddresses []string `json:"contractAddresses"`
TransactionHashes []string `json:"transactionHashes"`
MetaTransactionIDs []string `json:"metaTransactionIDs"`
FromBlock *uint64 `json:"fromBlock"`
ToBlock *uint64 `json:"toBlock"`
TokenID *prototyp.BigInt `json:"tokenID"`
OmitPrices *bool `json:"omitPrices"`
}
TODO: rename to TxnHistoryFilter
type TransactionLog ¶
type TransactionReceipt ¶
type TransactionReceipt struct {
TxnHash prototyp.Hash `json:"txnHash"`
TxnStatus TransactionStatus `json:"txnStatus"`
TxnIndex uint64 `json:"txnIndex"`
TxnType TransactionType `json:"txnType"`
BlockHash prototyp.Hash `json:"blockHash"`
BlockNumber uint64 `json:"blockNumber"`
GasUsed uint64 `json:"gasUsed"`
EffectiveGasPrice prototyp.BigInt `json:"effectiveGasPrice"`
From prototyp.Hash `json:"from"`
To prototyp.Hash `json:"to"`
Logs []*TransactionLog `json:"logs"`
Final bool `json:"final"`
Reorged bool `json:"reorged"`
}
type TransactionStatus ¶
type TransactionStatus uint32
const ( TransactionStatus_FAILED TransactionStatus = 0 TransactionStatus_SUCCESSFUL TransactionStatus = 1 )
func (*TransactionStatus) Is ¶
func (x *TransactionStatus) Is(values ...TransactionStatus) bool
func (TransactionStatus) MarshalText ¶
func (x TransactionStatus) MarshalText() ([]byte, error)
func (TransactionStatus) String ¶
func (x TransactionStatus) String() string
func (*TransactionStatus) UnmarshalText ¶
func (x *TransactionStatus) UnmarshalText(b []byte) error
type TransactionType ¶
type TransactionType uint32
const ( TransactionType_LegacyTxnType TransactionType = 0 TransactionType_AccessListTxnType TransactionType = 1 TransactionType_DynamicFeeTxnType TransactionType = 2 )
func (*TransactionType) Is ¶
func (x *TransactionType) Is(values ...TransactionType) bool
func (TransactionType) MarshalText ¶
func (x TransactionType) MarshalText() ([]byte, error)
func (TransactionType) String ¶
func (x TransactionType) String() string
func (*TransactionType) UnmarshalText ¶
func (x *TransactionType) UnmarshalText(b []byte) error
type TxnTransfer ¶
type TxnTransfer struct {
TransferType TxnTransferType `json:"transferType" cbor:"1"`
ContractAddress prototyp.Hash `json:"contractAddress" cbor:"2"`
ContractType ContractType `json:"contractType" cbor:"3"`
From prototyp.Hash `json:"from" cbor:"4"`
To prototyp.Hash `json:"to" cbor:"5"`
TokenIds []prototyp.BigInt `json:"tokenIds,omitempty" cbor:"6"`
Amounts []prototyp.BigInt `json:"amounts" cbor:"7"`
LogIndex uint `json:"logIndex" cbor:"8"`
AmountsUSD []string `json:"amountsUSD,omitempty" cbor:"-"`
PricesUSD []string `json:"pricesUSD,omitempty" cbor:"-"`
ContractInfo *ContractInfo `json:"contractInfo,omitempty" cbor:"-"`
TokenMetadata map[string]*TokenMetadata `json:"tokenMetadata,omitempty" cbor:"-"`
TxnIndex uint `json:"-" cbor:"-"`
}
type TxnTransferType ¶
type TxnTransferType uint32
const ( TxnTransferType_UNKNOWN TxnTransferType = 0 TxnTransferType_SEND TxnTransferType = 1 TxnTransferType_RECEIVE TxnTransferType = 2 )
func (*TxnTransferType) Is ¶
func (x *TxnTransferType) Is(values ...TxnTransferType) bool
func (TxnTransferType) MarshalText ¶
func (x TxnTransferType) MarshalText() ([]byte, error)
func (TxnTransferType) String ¶
func (x TxnTransferType) String() string
func (*TxnTransferType) UnmarshalText ¶
func (x *TxnTransferType) UnmarshalText(b []byte) error
type WALWriterRuntimeStatus ¶
type WALWriterRuntimeStatus 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"`
ChainID uint64 `json:"chainID"`
PercentWALWritten float64 `json:"percentWALWritten"`
}
type WebRPCError ¶
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
func ErrorWithCause(rpcErr WebRPCError, cause error) WebRPCError
Deprecated: Use .WithCause() method on WebRPCError.
func (WebRPCError) Error ¶
func (e WebRPCError) Error() string
func (WebRPCError) Is ¶
func (e WebRPCError) Is(target error) bool
func (WebRPCError) Unwrap ¶
func (e WebRPCError) Unwrap() error
func (WebRPCError) WithCause ¶
func (e WebRPCError) WithCause(cause error) WebRPCError
func (WebRPCError) WithCausef ¶
func (e WebRPCError) WithCausef(format string, args ...interface{}) WebRPCError
type WebhookListener ¶
type WebhookListener struct {
ID uint64 `json:"id" db:"id"`
ProjectID uint64 `json:"projectID" db:"project_id"`
Url string `json:"url" db:"url"`
Filters *EventFilter `json:"filters" db:"filters"`
Name string `json:"name" db:"name"`
UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
Active bool `json:"active" db:"active"`
}
type WebrpcGenVersions ¶
type WebrpcGenVersions struct {
WebrpcGenVersion string
CodeGenName string
CodeGenVersion string
SchemaName string
SchemaVersion string
}
func VersionFromHeader ¶
func VersionFromHeader(h http.Header) (*WebrpcGenVersions, error)