Documentation
¶
Overview ¶
sequence-metadata v0.4.0 adb20b68ad8ddf212aa9ed8fa5fc541db6921c6f -- Code generated by webrpc-gen@v0.25.3 with golang generator. DO NOT EDIT.
webrpc-gen -schema=metadata.ridl -target=golang -pkg=metadata -client -out=./clients/metadata.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 Admin
- type AdminClient
- type Asset
- type Collection
- type CollectionBaseURIs
- type CollectionMetadata
- type Collections
- type CollectionsClient
- type CollectionsService
- type ContractCollection
- type ContractIndex
- type ContractInfo
- type ContractInfoExtensionBridgeInfo
- type ContractInfoExtensions
- type ContractInfoExtensionsOverride
- type ContractInfoOverride
- type ContractType
- type Filter
- type GetNiftyswapUnitPricesRequest
- type GetNiftyswapUnitPricesResponse
- type HTTPClient
- type Metadata
- type MetadataClient
- type Options
- type Page
- type PropertyFilter
- type PropertyType
- type ResourceStatus
- type RunnableStatus
- type RuntimeStatus
- type Source
- type SwapType
- type Task
- type TaskStatus
- type Token
- type TokenIndex
- type TokenMetadata
- type Version
- type WebRPCError
- type WebrpcGenVersions
Constants ¶
const AdminPathPrefix = "/rpc/Admin/"
const CollectionsPathPrefix = "/rpc/Collections/"
const MetadataPathPrefix = "/rpc/Metadata/"
const WebrpcHeader = "Webrpc"
const WebrpcHeaderValue = "webrpc@v0.25.3;gen-golang@v0.18.4;sequence-metadata@v0.4.0"
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} ErrFail = WebRPCError{Code: 1005, Name: "Fail", Message: "Request Failed", HTTPStatus: 400} ErrGeoblocked = WebRPCError{Code: 1006, Name: "Geoblocked", Message: "Geoblocked region", HTTPStatus: 451} ErrTaskFailed = WebRPCError{Code: 1007, Name: "TaskFailed", Message: "Task failed", HTTPStatus: 400} ErrDeprecated = WebRPCError{Code: 1008, Name: "Deprecated", Message: "RPC method is deprecated", HTTPStatus: 400} ErrTimeout = WebRPCError{Code: 2000, Name: "Timeout", Message: "Request timed out", HTTPStatus: 408} ErrInvalidArgument = WebRPCError{Code: 2001, Name: "InvalidArgument", Message: "Invalid argument", HTTPStatus: 400} ErrRequiredArgument = WebRPCError{Code: 2002, Name: "RequiredArgument", Message: "Required argument missing", HTTPStatus: 400} ErrQueryFailed = WebRPCError{Code: 2003, Name: "QueryFailed", Message: "Query failed", HTTPStatus: 400} ErrValidationFailed = WebRPCError{Code: 2004, Name: "ValidationFailed", Message: "Validation failed", HTTPStatus: 400} ErrRateLimited = WebRPCError{Code: 2005, Name: "RateLimited", Message: "Rate limited", HTTPStatus: 429} ErrNotFound = WebRPCError{Code: 3000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} ErrProjectNotFound = WebRPCError{Code: 3002, Name: "ProjectNotFound", Message: "Project not found", HTTPStatus: 400} ErrChainNotFound = WebRPCError{Code: 3003, Name: "ChainNotFound", Message: "Chain not found", HTTPStatus: 400} ErrTokenDirectoryDisabled = WebRPCError{Code: 4001, Name: "TokenDirectoryDisabled", Message: "Token Directory is disabled", HTTPStatus: 400} )
Schema errors
var ContractType_name = map[uint16]string{
0: "UNKNOWN",
1: "ERC20",
2: "ERC721",
3: "ERC1155",
4: "ERC6909",
5: "MISC",
}
var ContractType_value = map[string]uint16{
"UNKNOWN": 0,
"ERC20": 1,
"ERC721": 2,
"ERC1155": 3,
"ERC6909": 4,
"MISC": 5,
}
var PropertyType_name = map[uint32]string{
0: "INT",
1: "STRING",
2: "ARRAY",
3: "GENERIC",
}
var PropertyType_value = map[string]uint32{
"INT": 0,
"STRING": 1,
"ARRAY": 2,
"GENERIC": 3,
}
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 Source_name = map[uint8]string{
0x00: "UNKNOWN",
0x10: "FETCHER",
0x11: "FETCHER_OPENSEA_API",
0x12: "FETCHER_ENS_API",
0x13: "FETCHER_ON_CHAIN_ERC20_INTERFACE",
0x14: "FETCHER_ON_CHAIN_TOKEN_URI",
0x15: "FETCHER_ON_CHAIN_CONTRACT_URI",
0x16: "FETCHER_TOKEN_DIRECTORY_ADMIN",
0x40: "TOKEN_DIRECTORY",
0x41: "TOKEN_DIRECTORY_PUBLIC_TOKEN_LIST",
0x42: "TOKEN_DIRECTORY_3RD_PARTY",
0x43: "TOKEN_DIRECTORY_SEQUENCE_GITHUB",
0x44: "TOKEN_DIRECTORY_SEQUENCE_BUILDER",
0x80: "SEQUENCE_BUILDER",
0x81: "SEQUENCE_BUILDER_DEPLOYED",
0x82: "SEQUENCE_BUILDER_COLLECTIONS",
0x83: "SEQUENCE_BUILDER_ADMIN",
}
var Source_value = map[string]uint8{
"UNKNOWN": 0x00,
"FETCHER": 0x10,
"FETCHER_OPENSEA_API": 0x11,
"FETCHER_ENS_API": 0x12,
"FETCHER_ON_CHAIN_ERC20_INTERFACE": 0x13,
"FETCHER_ON_CHAIN_TOKEN_URI": 0x14,
"FETCHER_ON_CHAIN_CONTRACT_URI": 0x15,
"FETCHER_TOKEN_DIRECTORY_ADMIN": 0x16,
"TOKEN_DIRECTORY": 0x40,
"TOKEN_DIRECTORY_PUBLIC_TOKEN_LIST": 0x41,
"TOKEN_DIRECTORY_3RD_PARTY": 0x42,
"TOKEN_DIRECTORY_SEQUENCE_GITHUB": 0x43,
"TOKEN_DIRECTORY_SEQUENCE_BUILDER": 0x44,
"SEQUENCE_BUILDER": 0x80,
"SEQUENCE_BUILDER_DEPLOYED": 0x81,
"SEQUENCE_BUILDER_COLLECTIONS": 0x82,
"SEQUENCE_BUILDER_ADMIN": 0x83,
}
var SwapType_name = map[uint32]string{
0: "UNKNOWN",
1: "BUY",
2: "SELL",
}
var SwapType_value = map[string]uint32{
"UNKNOWN": 0,
"BUY": 1,
"SELL": 2,
}
var TaskStatus_name = map[uint8]string{
0: "QUEUED",
1: "PAUSED",
2: "FAILED",
3: "DONE",
}
var TaskStatus_value = map[string]uint8{
"QUEUED": 0,
"PAUSED": 1,
"FAILED": 2,
"DONE": 3,
}
var WebRPCServices = map[string][]string{
"Metadata": {
"Ping",
"Version",
"RuntimeStatus",
"GetTask",
"GetTaskStatus",
"GetContractInfo",
"GetContractInfoBatch",
"FindContractInfo",
"FindContractInfoBatch",
"RefreshContractInfo",
"RefreshContractInfoBatch",
"SearchContractsByQuery",
"SearchContractInfo",
"SearchContractInfoBatch",
"SearchContracts",
"SearchMetadata",
"GetTokenMetadata",
"GetTokenMetadataBatch",
"RefreshTokenMetadata",
"SearchTokenMetadataByQuery",
"SearchTokenMetadata",
"SearchTokenMetadataTokenIDs",
"GetTokenMetadataPropertyFilters",
"RefreshAllContractTokens",
"SearchTokens",
"TokenCollectionFilters",
"GetTokenRefreshStatus",
"SearchTokenIDs",
"GetTokenDirectoryNetworks",
"GetTokenDirectory",
"SearchTokenDirectory",
"DirectoryGetNetworks",
"DirectoryGetCollections",
"DirectorySearchCollections",
"GetNiftyswapTokenQuantity",
"GetNiftyswapUnitPrices",
"GetNiftyswapUnitPricesWithQuantities",
},
"Collections": {
"CreateCollection",
"GetCollection",
"ListCollections",
"UpdateCollection",
"DeleteCollection",
"PublishCollection",
"UnpublishCollection",
"CreateContractCollection",
"GetContractCollection",
"ListContractCollections",
"UpdateContractCollection",
"DeleteContractCollection",
"CreateToken",
"GetToken",
"ListTokens",
"UpdateToken",
"DeleteToken",
"CreateAsset",
"GetAsset",
"UpdateAsset",
"DeleteAsset",
},
"Admin": {
"RefreshContractInfoUpdatedBefore",
"RefreshTokenMetadataUpdatedBefore",
"GetContractInfoOverride",
"GetContractInfoOverrides",
"AddContractInfoOverride",
"UpdateContractInfoOverride",
"RemoveContractInfoOverride",
"IsInTokenDirectory",
"SetTokenDirectoryFeatureIndex",
"AddContractToTokenDirectory",
"RemoveContractFromTokenDirectory",
"RefreshTokenDirectory",
"AddContractsToTokenDirectory",
"RemoveContractsFromTokenDirectory",
"ModifyFeatureIndex",
"GetFeatureIndex",
"ListTokenDirectory",
},
}
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.52.0
func WebrpcMethods() map[string]method
Types ¶
type Admin ¶ added in v0.38.0
type Admin interface { // ContractInfo RefreshContractInfoUpdatedBefore(ctx context.Context, before string, maxContractNumber int) ([]uint64, error) // TokenMetadata RefreshTokenMetadataUpdatedBefore(ctx context.Context, before string, maxTokenNumber int) ([]uint64, error) // Contract Info Overrides GetContractInfoOverride(ctx context.Context, chainID string, contractAddress string) (*ContractInfoOverride, error) GetContractInfoOverrides(ctx context.Context, chainID *string, page *Page) ([]*ContractInfoOverride, *Page, error) AddContractInfoOverride(ctx context.Context, chainID string, contractAddress string, contractInfoOverride *ContractInfoOverride) (bool, error) UpdateContractInfoOverride(ctx context.Context, chainID string, contractAddress string, contractInfoOverride *ContractInfoOverride) (bool, error) RemoveContractInfoOverride(ctx context.Context, chainID string, contractAddress string) (bool, error) // Token Directory IsInTokenDirectory(ctx context.Context, chainID string, contractAddress string) (bool, uint8, error) SetTokenDirectoryFeatureIndex(ctx context.Context, chainID string, contractAddress string, featureIndex uint8) (bool, error) AddContractToTokenDirectory(ctx context.Context, chainID string, contractAddress string) (bool, error) RemoveContractFromTokenDirectory(ctx context.Context, chainID string, contractAddress string) (bool, error) RefreshTokenDirectory(ctx context.Context) (uint64, error) // Deprecated: use new admin api AddContractsToTokenDirectory(ctx context.Context, contracts []*ContractInfo, featureIndexes []uint8) (bool, error) // Deprecated: use new admin api RemoveContractsFromTokenDirectory(ctx context.Context, chainHandle string, contracts []string) (bool, error) // Deprecated: use new admin api ModifyFeatureIndex(ctx context.Context, chainHandle string, contractAddress string, featured uint8) (bool, error) // Deprecated: use new admin api GetFeatureIndex(ctx context.Context, chainHandle string, contractAddress string) (uint8, error) // Deprecated: use new admin api ListTokenDirectory(ctx context.Context, chainID *uint64, includeTestnets *bool, onlyFeatured *bool, page *Page) (*Page, []*ContractInfo, error) }
type AdminClient ¶ added in v0.38.0
type AdminClient interface { // ContractInfo RefreshContractInfoUpdatedBefore(ctx context.Context, before string, maxContractNumber int) ([]uint64, error) // TokenMetadata RefreshTokenMetadataUpdatedBefore(ctx context.Context, before string, maxTokenNumber int) ([]uint64, error) // Contract Info Overrides GetContractInfoOverride(ctx context.Context, chainID string, contractAddress string) (*ContractInfoOverride, error) GetContractInfoOverrides(ctx context.Context, chainID *string, page *Page) ([]*ContractInfoOverride, *Page, error) AddContractInfoOverride(ctx context.Context, chainID string, contractAddress string, contractInfoOverride *ContractInfoOverride) (bool, error) UpdateContractInfoOverride(ctx context.Context, chainID string, contractAddress string, contractInfoOverride *ContractInfoOverride) (bool, error) RemoveContractInfoOverride(ctx context.Context, chainID string, contractAddress string) (bool, error) // Token Directory IsInTokenDirectory(ctx context.Context, chainID string, contractAddress string) (bool, uint8, error) SetTokenDirectoryFeatureIndex(ctx context.Context, chainID string, contractAddress string, featureIndex uint8) (bool, error) AddContractToTokenDirectory(ctx context.Context, chainID string, contractAddress string) (bool, error) RemoveContractFromTokenDirectory(ctx context.Context, chainID string, contractAddress string) (bool, error) RefreshTokenDirectory(ctx context.Context) (uint64, error) // Deprecated: use new admin api AddContractsToTokenDirectory(ctx context.Context, contracts []*ContractInfo, featureIndexes []uint8) (bool, error) // Deprecated: use new admin api RemoveContractsFromTokenDirectory(ctx context.Context, chainHandle string, contracts []string) (bool, error) // Deprecated: use new admin api ModifyFeatureIndex(ctx context.Context, chainHandle string, contractAddress string, featured uint8) (bool, error) // Deprecated: use new admin api GetFeatureIndex(ctx context.Context, chainHandle string, contractAddress string) (uint8, error) // Deprecated: use new admin api ListTokenDirectory(ctx context.Context, chainID *uint64, includeTestnets *bool, onlyFeatured *bool, page *Page) (*Page, []*ContractInfo, error) }
func NewAdminClient ¶ added in v0.38.0
func NewAdminClient(addr string, client HTTPClient) AdminClient
type Asset ¶ added in v0.29.3
type Asset struct { // asset id ID uint64 `json:"id" db:"id,omitempty"` // collection id associated to this asset CollectionID uint64 `json:"collectionId" db:"collection_id"` // token id associated to this collection TokenID *prototyp.BigInt `json:"tokenId" db:"token_id,omitempty"` // url where we can view the asset contents // ie. https://metadata.sequence.app/projects/1/collections/1/tokens/1/image URL string `json:"url" db:"-"` // metadata field related to TokenMetadata, some field names: // ['image', 'video', 'audio', 'animation_url', ...] MetadataField string `json:"metadataField,omitempty" db:"metadata_field"` // asset details 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 Collection ¶ added in v0.29.3
type Collection struct { ID uint64 `json:"id,omitempty" db:"id,omitempty"` ProjectID uint64 `json:"projectId,omitempty" db:"project_id"` Metadata *CollectionMetadata `json:"metadata,omitempty" db:"metadata"` Private bool `json:"private" db:"private"` RevealKey string `json:"revealKey,omitempty" db:"reveal_key"` TokenCount *uint64 `json:"tokenCount,omitempty" db:"-"` CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` DeletedAt *time.Time `json:"deletedAt,omitempty" db:"deleted_at"` BaseURIs *CollectionBaseURIs `json:"baseURIs,omitempty" db:"-"` // Assets associated to this collection metadata Assets []*Asset `json:"assets,omitempty" cbor:"-"` }
Collection represents the contract-level metadata for a collection.
the fields here should overlap with https://docs.opensea.io/docs/contract-level-metadata such that we can use this object for contract-level metadata.
type CollectionBaseURIs ¶ added in v0.29.3
type CollectionBaseURIs struct { // contractMetadataURI is the URI to the contract-level metadata for the collection, // which is the value to set on a contract. Note, we do not store this in the db, but we // do return it as part of the response. // // aka, `contractURI()` on a contract ContractMetadataURI string `json:"contractMetadataURI"` // tokenMetadataURI is the URI to the token-level metadata for the collection, // which is the value to set on a contract's token baseURI. Note, we do not store this // in the db, but we do return it as part of the response. // // aka `uri(uint256 tokenId)` on 721 and 1155 // // This base URI which satisfy 721 and 1155 // // https://eips.ethereum.org/EIPS/eip-721 // uri ending with '/ without placeholder for tokenID // // also use for 1155 // https://eips.ethereum.org/EIPS/eip-1155#metadata TokenMetadataURI string `json:"tokenMetadataURI"` }
type CollectionMetadata ¶ added in v0.29.3
type CollectionMetadata struct { Name string `json:"name"` Description string `json:"description"` Image string `json:"image,omitempty"` // NOTE: we use `external_link` for the field name because of OpenSea's // contract-level metadata https://docs.opensea.io/docs/contract-level-metadata ExternalLink string `json:"external_link,omitempty"` Properties map[string]interface{} `json:"properties,omitempty"` Attributes []map[string]interface{} `json:"attributes,omitempty"` }
type Collections ¶ added in v0.29.3
type Collections interface { CreateCollection(ctx context.Context, projectId *uint64, collection *Collection) (*Collection, error) GetCollection(ctx context.Context, projectId *uint64, collectionId uint64) (*Collection, error) ListCollections(ctx context.Context, projectId *uint64, page *Page) (*Page, []*Collection, error) UpdateCollection(ctx context.Context, projectId *uint64, collection *Collection) (*Collection, error) DeleteCollection(ctx context.Context, projectId *uint64, collectionId uint64) (bool, error) PublishCollection(ctx context.Context, projectId *uint64, collectionId uint64, recursive *bool) (*Collection, error) UnpublishCollection(ctx context.Context, projectId *uint64, collectionId uint64) (*Collection, error) CreateContractCollection(ctx context.Context, projectId uint64, contractCollection *ContractCollection) (*ContractCollection, error) GetContractCollection(ctx context.Context, projectId uint64, chainId uint64, contractAddress string) (*ContractCollection, error) ListContractCollections(ctx context.Context, projectId uint64, collectionId *uint64, page *Page) ([]*ContractCollection, []*Collection, *Page, error) UpdateContractCollection(ctx context.Context, projectId uint64, contractCollection *ContractCollection) (bool, error) DeleteContractCollection(ctx context.Context, projectId uint64, chainId uint64, contractAddress string) (bool, error) CreateToken(ctx context.Context, projectId *uint64, collectionId uint64, token *TokenMetadata, private *bool) (*TokenMetadata, []*Asset, error) GetToken(ctx context.Context, projectId *uint64, collectionId uint64, tokenId string) (*TokenMetadata, []*Asset, error) ListTokens(ctx context.Context, projectId *uint64, collectionId uint64, page *Page) (*Page, []*TokenMetadata, error) UpdateToken(ctx context.Context, projectId *uint64, collectionId uint64, tokenId string, token *TokenMetadata, private *bool) (*TokenMetadata, error) DeleteToken(ctx context.Context, projectId *uint64, collectionId uint64, tokenId string) (bool, error) CreateAsset(ctx context.Context, projectId *uint64, asset *Asset) (*Asset, error) GetAsset(ctx context.Context, projectId *uint64, assetId uint64) (*Asset, error) UpdateAsset(ctx context.Context, projectId *uint64, asset *Asset) (*Asset, error) DeleteAsset(ctx context.Context, projectId *uint64, assetId uint64) (bool, error) }
type CollectionsClient ¶ added in v0.31.0
type CollectionsClient interface { CreateCollection(ctx context.Context, projectId *uint64, collection *Collection) (*Collection, error) GetCollection(ctx context.Context, projectId *uint64, collectionId uint64) (*Collection, error) ListCollections(ctx context.Context, projectId *uint64, page *Page) (*Page, []*Collection, error) UpdateCollection(ctx context.Context, projectId *uint64, collection *Collection) (*Collection, error) DeleteCollection(ctx context.Context, projectId *uint64, collectionId uint64) (bool, error) PublishCollection(ctx context.Context, projectId *uint64, collectionId uint64, recursive *bool) (*Collection, error) UnpublishCollection(ctx context.Context, projectId *uint64, collectionId uint64) (*Collection, error) CreateContractCollection(ctx context.Context, projectId uint64, contractCollection *ContractCollection) (*ContractCollection, error) GetContractCollection(ctx context.Context, projectId uint64, chainId uint64, contractAddress string) (*ContractCollection, error) ListContractCollections(ctx context.Context, projectId uint64, collectionId *uint64, page *Page) ([]*ContractCollection, []*Collection, *Page, error) UpdateContractCollection(ctx context.Context, projectId uint64, contractCollection *ContractCollection) (bool, error) DeleteContractCollection(ctx context.Context, projectId uint64, chainId uint64, contractAddress string) (bool, error) CreateToken(ctx context.Context, projectId *uint64, collectionId uint64, token *TokenMetadata, private *bool) (*TokenMetadata, []*Asset, error) GetToken(ctx context.Context, projectId *uint64, collectionId uint64, tokenId string) (*TokenMetadata, []*Asset, error) ListTokens(ctx context.Context, projectId *uint64, collectionId uint64, page *Page) (*Page, []*TokenMetadata, error) UpdateToken(ctx context.Context, projectId *uint64, collectionId uint64, tokenId string, token *TokenMetadata, private *bool) (*TokenMetadata, error) DeleteToken(ctx context.Context, projectId *uint64, collectionId uint64, tokenId string) (bool, error) CreateAsset(ctx context.Context, projectId *uint64, asset *Asset) (*Asset, error) GetAsset(ctx context.Context, projectId *uint64, assetId uint64) (*Asset, error) UpdateAsset(ctx context.Context, projectId *uint64, asset *Asset) (*Asset, error) DeleteAsset(ctx context.Context, projectId *uint64, assetId uint64) (bool, error) }
func NewCollectionsClient ¶ added in v0.29.3
func NewCollectionsClient(addr string, client HTTPClient) CollectionsClient
type CollectionsService ¶ added in v0.29.3
type CollectionsService struct { Collections // contains filtered or unexported fields }
func NewCollections ¶ added in v0.29.3
func NewCollections(projectServiceJWTToken string, options ...Options) CollectionsService
NewCollections creates a new Sequence Metadata Collections client instance. Please see https://sequence.build to get a `projectServiceJWTToken` service-level account jwt token.
func (*CollectionsService) UploadAsset ¶ added in v0.29.3
type ContractCollection ¶ added in v0.43.1
type ContractCollection struct { ID uint64 `json:"id,omitempty" db:"id,omitempty"` ChainID uint64 `json:"chainId" db:"chain_id"` ContractAddress prototyp.Hash `json:"contractAddress" db:"contract_address"` CollectionID uint64 `json:"collectionId" db:"collection_id"` }
ContractCollection represents the relationship between a contract and a collection.
type ContractIndex ¶ added in v0.11.7
type ContractIndex struct { ChainID uint64 `json:"chainId" db:"chain_id"` Address prototyp.Hash `json:"address" db:"contract_address"` Type ContractType `json:"type" db:"type"` Source Source `json:"source" db:"source"` Metadata map[string]interface{} `json:"metadata" db:"metadata"` ContentHash uint64 `json:"contentHash,omitempty" db:"content_hash,omitempty"` Deployed bool `json:"deployed" db:"deployed"` BytecodeHash prototyp.Hash `json:"bytecodeHash" db:"bytecode_hash"` NotFound bool `json:"notFound,omitempty" db:"not_found"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` QueuedAt *time.Time `json:"queuedAt" db:"queued_at"` Status ResourceStatus `json:"status"` }
ContractIndex is a database type to track the index of contracts which are fetched on-demand through traversing on-chain contract metadata.
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.52.6
type ContractInfoExtensionBridgeInfo struct {
TokenAddress string `json:"tokenAddress" 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:"-"` 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 ContractInfoExtensionsOverride ¶ added in v0.52.4
type ContractInfoExtensionsOverride struct { Link *string `json:"link" cbor:"-"` Description *string `json:"description" cbor:"-"` Categories []string `json:"categories,omitempty" cbor:"-"` OgImage *string `json:"ogImage" cbor:"-"` OgName *string `json:"ogName" cbor:"-"` OriginChainID *uint64 `json:"originChainId" cbor:"-"` OriginAddress *string `json:"originAddress" cbor:"-"` Blacklist *bool `json:"blacklist,omitempty" cbor:"-"` Verified *bool `json:"verified" cbor:"-"` VerifiedBy *string `json:"verifiedBy,omitempty" cbor:"-"` FeatureIndex *uint8 `json:"featureIndex,omitempty"` }
type ContractInfoOverride ¶ added in v0.52.4
type ContractInfoOverride struct { 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:"-"` Extensions *ContractInfoExtensionsOverride `json:"extensions" cbor:"-"` }
type ContractType ¶ added in v0.11.7
type ContractType uint16
const ( ContractType_UNKNOWN ContractType = 0 ContractType_ERC20 ContractType = 1 ContractType_ERC721 ContractType = 2 ContractType_ERC1155 ContractType = 3 ContractType_ERC6909 ContractType = 4 ContractType_MISC ContractType = 5 )
func (*ContractType) Is ¶ added in v0.31.0
func (x *ContractType) Is(values ...ContractType) bool
func (ContractType) MarshalText ¶ added in v0.31.0
func (x ContractType) MarshalText() ([]byte, error)
func (ContractType) String ¶ added in v0.11.7
func (x ContractType) String() string
func (*ContractType) UnmarshalText ¶ added in v0.31.0
func (x *ContractType) UnmarshalText(b []byte) error
type Filter ¶ added in v0.19.7
type Filter struct { Text *string `json:"text"` Properties []*PropertyFilter `json:"properties"` }
type GetNiftyswapUnitPricesResponse ¶ added in v0.19.7
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 Metadata ¶
type Metadata interface { Ping(ctx context.Context) (bool, error) Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) GetTask(ctx context.Context, taskId uint64) (*Task, error) GetTaskStatus(ctx context.Context, taskId uint64) (*TaskStatus, error) // Contract Info -- returns contract meta-info for contracts found in registered chain's token-lists GetContractInfo(ctx context.Context, chainID string, contractAddress string) (*ContractInfo, *uint64, error) GetContractInfoBatch(ctx context.Context, chainID string, contractAddresses []string) (map[string]*ContractInfo, *uint64, error) // Find Contract Info across all chains token-lists. Similar to GetContractInfo above, // but it will traverse all chains and results from all. FindContractInfo(ctx context.Context, contractAddress string) ([]*ContractInfo, error) // map of contractAddress :: []ContractInfo FindContractInfoBatch(ctx context.Context, contractAddresses []string) (map[string][]*ContractInfo, error) // Refresh Contract Info -- refresh contract meta-info RefreshContractInfo(ctx context.Context, chainID string, contractAddress string) (*uint64, error) RefreshContractInfoBatch(ctx context.Context, chainID string, contractAddresses []string) (*uint64, error) // Search for contract infos using a query string SearchContractsByQuery(ctx context.Context, q string, chainID *string, chainIDs []string, types []ContractType, page *Page) ([]*ContractInfo, *Page, error) // Deprecated: UseFindContractInfo instead. (renamed). SearchContractInfo(ctx context.Context, contractAddress string) ([]*ContractInfo, error) // Deprecated: Use FindContractInfoBatch instead. (renamed) SearchContractInfoBatch(ctx context.Context, contractAddresses []string) (map[string][]*ContractInfo, error) // Deprecated: Use SearchContractsByQuery instead. (renamed) SearchContracts(ctx context.Context, q string, chainID *string, chainIDs []string, types []ContractType, page *Page) ([]*ContractInfo, *Page, error) // Deprecated: Use SearchContractsByQuery() and SearchTokenMetadataByQuery() instead. SearchMetadata(ctx context.Context, filter string, chainID *string, types []ContractType, excludeTokenMetadata *bool) ([]*TokenMetadata, []*ContractInfo, error) // GetTokenMetadata - fetch token metadata for a particular contract and respective tokenIDs GetTokenMetadata(ctx context.Context, chainID string, contractAddress string, tokenIDs []string) ([]*TokenMetadata, *uint64, error) // GetTokenMetadataBatch allows you to query the token metadata of a batch of contracts and respective tokenIDs // where map is contractAddress::[]tokenID => contractAddress::[]TokenMetadata // // Note, we limit each request to 50 contracts max and 50 tokens max per contract. GetTokenMetadataBatch(ctx context.Context, chainID string, contractTokenMap map[string][]string) (map[string][]*TokenMetadata, *uint64, error) // RefreshTokenMetadata allows you to refresh a contract metadata for contract-level and token-level metadata. RefreshTokenMetadata(ctx context.Context, chainID string, contractAddress string, tokenIDs []string, refreshAll *bool) (uint64, error) // Search ERC721 & ERC1155 token metadata by query string 'q' SearchTokenMetadataByQuery(ctx context.Context, q string, chainID *string, contractAddress *string, page *Page) ([]*TokenMetadata, *Page, error) // Search ERC721 & ERC1155 token metadata by filter object 'filter' // which allows to search by text or properties. SearchTokenMetadata(ctx context.Context, chainID string, contractAddress string, filter *Filter, page *Page) (*Page, []*TokenMetadata, error) // Search ERC721 & ERC1155 for token IDs by filter object 'filter' // which allows to search by text or properties. SearchTokenMetadataTokenIDs(ctx context.Context, chainID string, contractAddress string, filter *Filter, page *Page) (*Page, []string, error) // Get token metadata property filters for a contract address GetTokenMetadataPropertyFilters(ctx context.Context, chainID string, contractAddress string, excludeProperties []string, excludePropertyValues *bool) ([]*PropertyFilter, error) // Deprecated: Use RefreshTokenMetadata instead. RefreshAllContractTokens(ctx context.Context, chainHandle string, contractAddress string) (*uint64, uint64, error) // Deprecated: Use SearchTokenMetadataByQuery instead. (renamed) SearchTokens(ctx context.Context, q string, chainID *string, page *Page) ([]*TokenMetadata, *Page, error) // Deprecated: Use GetTokenMetadataPropertyFilters (renamed) TokenCollectionFilters(ctx context.Context, chainID string, contractAddress string) ([]*PropertyFilter, error) // Deprecated: Use GetTaskStatus instead. (its the same thing) GetTokenRefreshStatus(ctx context.Context, taskId uint64) (*TaskStatus, error) // Deprecated: Use SearchTokenMetadataTokenIDs instead. (renamed) SearchTokenIDs(ctx context.Context, chainID string, contractAddress string, filter *Filter, page *Page) (*Page, []string, error) // Gets Token Directory supported networks GetTokenDirectoryNetworks(ctx context.Context, includeTestnets *bool, onlyFeatured *bool) ([]uint64, []string, error) // Gets Token Directory entries GetTokenDirectory(ctx context.Context, chainID *string, includeTestnets *bool, onlyFeatured *bool, page *Page) ([]*ContractInfo, *Page, error) // Search in Token Directory SearchTokenDirectory(ctx context.Context, query string, chainID *uint64, includeTestnets *bool, onlyFeatured *bool, page *Page) ([]*ContractInfo, *Page, error) // Deprecated: Use GetTokenDirectoryNetworks instead. DirectoryGetNetworks(ctx context.Context, includeTestnets *bool, onlyFeatured *bool) ([]uint64, error) // Deprecated: Use GetTokenDirectory instead. DirectoryGetCollections(ctx context.Context, chainId *uint64, includeTestnets *bool, onlyFeatured *bool, page *Page) ([]*ContractInfo, *Page, error) // Deprecated: Use SearchTokenDirectory instead. DirectorySearchCollections(ctx context.Context, query string, chainId *uint64, includeTestnets *bool, onlyFeatured *bool, page *Page) ([]*ContractInfo, *Page, error) // Niftyswap querying data GetNiftyswapTokenQuantity(ctx context.Context, chainID string, contractAddress string, tokenIDs []string) (map[string]string, error) // map of tokenID :: quantity GetNiftyswapUnitPrices(ctx context.Context, chainID string, contractAddress string, req *GetNiftyswapUnitPricesRequest, fresh bool) (map[string]string, error) // map of tokenID :: price GetNiftyswapUnitPricesWithQuantities(ctx context.Context, chainID string, contractAddress string, req *GetNiftyswapUnitPricesRequest, fresh bool) (map[string]*GetNiftyswapUnitPricesResponse, error) }
type MetadataClient ¶ added in v0.31.0
type MetadataClient interface { Ping(ctx context.Context) (bool, error) Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) GetTask(ctx context.Context, taskId uint64) (*Task, error) GetTaskStatus(ctx context.Context, taskId uint64) (*TaskStatus, error) // Contract Info -- returns contract meta-info for contracts found in registered chain's token-lists GetContractInfo(ctx context.Context, chainID string, contractAddress string) (*ContractInfo, *uint64, error) GetContractInfoBatch(ctx context.Context, chainID string, contractAddresses []string) (map[string]*ContractInfo, *uint64, error) // Find Contract Info across all chains token-lists. Similar to GetContractInfo above, // but it will traverse all chains and results from all. FindContractInfo(ctx context.Context, contractAddress string) ([]*ContractInfo, error) // map of contractAddress :: []ContractInfo FindContractInfoBatch(ctx context.Context, contractAddresses []string) (map[string][]*ContractInfo, error) // Refresh Contract Info -- refresh contract meta-info RefreshContractInfo(ctx context.Context, chainID string, contractAddress string) (*uint64, error) RefreshContractInfoBatch(ctx context.Context, chainID string, contractAddresses []string) (*uint64, error) // Search for contract infos using a query string SearchContractsByQuery(ctx context.Context, q string, chainID *string, chainIDs []string, types []ContractType, page *Page) ([]*ContractInfo, *Page, error) // Deprecated: UseFindContractInfo instead. (renamed). SearchContractInfo(ctx context.Context, contractAddress string) ([]*ContractInfo, error) // Deprecated: Use FindContractInfoBatch instead. (renamed) SearchContractInfoBatch(ctx context.Context, contractAddresses []string) (map[string][]*ContractInfo, error) // Deprecated: Use SearchContractsByQuery instead. (renamed) SearchContracts(ctx context.Context, q string, chainID *string, chainIDs []string, types []ContractType, page *Page) ([]*ContractInfo, *Page, error) // Deprecated: Use SearchContractsByQuery() and SearchTokenMetadataByQuery() instead. SearchMetadata(ctx context.Context, filter string, chainID *string, types []ContractType, excludeTokenMetadata *bool) ([]*TokenMetadata, []*ContractInfo, error) // GetTokenMetadata - fetch token metadata for a particular contract and respective tokenIDs GetTokenMetadata(ctx context.Context, chainID string, contractAddress string, tokenIDs []string) ([]*TokenMetadata, *uint64, error) // GetTokenMetadataBatch allows you to query the token metadata of a batch of contracts and respective tokenIDs // where map is contractAddress::[]tokenID => contractAddress::[]TokenMetadata // // Note, we limit each request to 50 contracts max and 50 tokens max per contract. GetTokenMetadataBatch(ctx context.Context, chainID string, contractTokenMap map[string][]string) (map[string][]*TokenMetadata, *uint64, error) // RefreshTokenMetadata allows you to refresh a contract metadata for contract-level and token-level metadata. RefreshTokenMetadata(ctx context.Context, chainID string, contractAddress string, tokenIDs []string, refreshAll *bool) (uint64, error) // Search ERC721 & ERC1155 token metadata by query string 'q' SearchTokenMetadataByQuery(ctx context.Context, q string, chainID *string, contractAddress *string, page *Page) ([]*TokenMetadata, *Page, error) // Search ERC721 & ERC1155 token metadata by filter object 'filter' // which allows to search by text or properties. SearchTokenMetadata(ctx context.Context, chainID string, contractAddress string, filter *Filter, page *Page) (*Page, []*TokenMetadata, error) // Search ERC721 & ERC1155 for token IDs by filter object 'filter' // which allows to search by text or properties. SearchTokenMetadataTokenIDs(ctx context.Context, chainID string, contractAddress string, filter *Filter, page *Page) (*Page, []string, error) // Get token metadata property filters for a contract address GetTokenMetadataPropertyFilters(ctx context.Context, chainID string, contractAddress string, excludeProperties []string, excludePropertyValues *bool) ([]*PropertyFilter, error) // Deprecated: Use RefreshTokenMetadata instead. RefreshAllContractTokens(ctx context.Context, chainHandle string, contractAddress string) (*uint64, uint64, error) // Deprecated: Use SearchTokenMetadataByQuery instead. (renamed) SearchTokens(ctx context.Context, q string, chainID *string, page *Page) ([]*TokenMetadata, *Page, error) // Deprecated: Use GetTokenMetadataPropertyFilters (renamed) TokenCollectionFilters(ctx context.Context, chainID string, contractAddress string) ([]*PropertyFilter, error) // Deprecated: Use GetTaskStatus instead. (its the same thing) GetTokenRefreshStatus(ctx context.Context, taskId uint64) (*TaskStatus, error) // Deprecated: Use SearchTokenMetadataTokenIDs instead. (renamed) SearchTokenIDs(ctx context.Context, chainID string, contractAddress string, filter *Filter, page *Page) (*Page, []string, error) // Gets Token Directory supported networks GetTokenDirectoryNetworks(ctx context.Context, includeTestnets *bool, onlyFeatured *bool) ([]uint64, []string, error) // Gets Token Directory entries GetTokenDirectory(ctx context.Context, chainID *string, includeTestnets *bool, onlyFeatured *bool, page *Page) ([]*ContractInfo, *Page, error) // Search in Token Directory SearchTokenDirectory(ctx context.Context, query string, chainID *uint64, includeTestnets *bool, onlyFeatured *bool, page *Page) ([]*ContractInfo, *Page, error) // Deprecated: Use GetTokenDirectoryNetworks instead. DirectoryGetNetworks(ctx context.Context, includeTestnets *bool, onlyFeatured *bool) ([]uint64, error) // Deprecated: Use GetTokenDirectory instead. DirectoryGetCollections(ctx context.Context, chainId *uint64, includeTestnets *bool, onlyFeatured *bool, page *Page) ([]*ContractInfo, *Page, error) // Deprecated: Use SearchTokenDirectory instead. DirectorySearchCollections(ctx context.Context, query string, chainId *uint64, includeTestnets *bool, onlyFeatured *bool, page *Page) ([]*ContractInfo, *Page, error) // Niftyswap querying data GetNiftyswapTokenQuantity(ctx context.Context, chainID string, contractAddress string, tokenIDs []string) (map[string]string, error) // map of tokenID :: quantity GetNiftyswapUnitPrices(ctx context.Context, chainID string, contractAddress string, req *GetNiftyswapUnitPricesRequest, fresh bool) (map[string]string, error) // map of tokenID :: price GetNiftyswapUnitPricesWithQuantities(ctx context.Context, chainID string, contractAddress string, req *GetNiftyswapUnitPricesRequest, fresh bool) (map[string]*GetNiftyswapUnitPricesResponse, error) }
func NewMetadata ¶ added in v0.24.0
func NewMetadata(projectAccessKey string, options ...Options) MetadataClient
NewMetadata creates a new Sequence Metadata client instance. Please see https://sequence.build to get a `projectAccessKey`.
func NewMetadataClient ¶
func NewMetadataClient(addr string, client HTTPClient) MetadataClient
type Options ¶ added in v0.24.0
type Options struct { HTTPClient HTTPClient JWTAuthToken string MetadataServiceURL string }
type Page ¶ added in v0.11.7
type Page struct { // Numbered pages: Page number, this is multiplied by the value of the <pageSize> parameter. Page *uint32 `json:"page,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"` // Number of items per page PageSize *uint32 `json:"pageSize,omitempty"` // Indicates if there are more results available 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 PropertyFilter ¶ added in v0.19.7
type PropertyFilter struct { Name string `json:"name"` Type PropertyType `json:"type"` Min *int64 `json:"min"` Max *int64 `json:"max"` Values []interface{} `json:"values"` }
PropertyFilter
name -> name of the property, eg: hero type -> type of the values of the property, eg: Int, string min?, max? used if type is int, gives range of values for filtering values? -> if string then array of values, eg: ['Ada', 'Ari', 'Axel', 'Banjo' ...] NOTE: When Filter has an array of PropertyFilter, the logic used is an 'and' condition whereas if the user selects multiple values inside the PropertyFilter, they logic used is the 'or' condition this is to achieve the desired effect opensea had on their filters
type PropertyType ¶ added in v0.19.7
type PropertyType uint32
const ( PropertyType_INT PropertyType = 0 PropertyType_STRING PropertyType = 1 PropertyType_ARRAY PropertyType = 2 PropertyType_GENERIC PropertyType = 3 )
func (*PropertyType) Is ¶ added in v0.31.0
func (x *PropertyType) Is(values ...PropertyType) bool
func (PropertyType) MarshalText ¶ added in v0.31.0
func (x PropertyType) MarshalText() ([]byte, error)
func (PropertyType) String ¶ added in v0.19.7
func (x PropertyType) String() string
func (*PropertyType) UnmarshalText ¶ added in v0.31.0
func (x *PropertyType) UnmarshalText(b []byte) error
type ResourceStatus ¶ added in v0.44.3
type ResourceStatus uint32
const ( ResourceStatus_NOT_AVAILABLE ResourceStatus = 0 ResourceStatus_REFRESHING ResourceStatus = 1 ResourceStatus_AVAILABLE ResourceStatus = 2 )
func (*ResourceStatus) Is ¶ added in v0.44.3
func (x *ResourceStatus) Is(values ...ResourceStatus) bool
func (ResourceStatus) MarshalText ¶ added in v0.44.3
func (x ResourceStatus) MarshalText() ([]byte, error)
func (ResourceStatus) String ¶ added in v0.44.3
func (x ResourceStatus) String() string
func (*ResourceStatus) UnmarshalText ¶ added in v0.44.3
func (x *ResourceStatus) UnmarshalText(b []byte) error
type RunnableStatus ¶ added in v0.44.3
type RuntimeStatus ¶
type RuntimeStatus struct { HealthOK bool `json:"healthOK"` StartTime time.Time `json:"startTime"` Uptime uint64 `json:"uptime"` UptimeString string `json:"uptimeString"` Ver string `json:"ver"` Branch string `json:"branch"` CommitHash string `json:"commitHash"` Runnable map[string]*RunnableStatus `json:"runnable,omitempty"` }
type Source ¶ added in v0.47.0
type Source uint8
const ( Source_UNKNOWN Source = 0x00 Source_FETCHER Source = 0x10 Source_FETCHER_OPENSEA_API Source = 0x11 Source_FETCHER_ENS_API Source = 0x12 Source_FETCHER_ON_CHAIN_ERC20_INTERFACE Source = 0x13 Source_FETCHER_ON_CHAIN_TOKEN_URI Source = 0x14 Source_FETCHER_ON_CHAIN_CONTRACT_URI Source = 0x15 Source_FETCHER_TOKEN_DIRECTORY_ADMIN Source = 0x16 Source_TOKEN_DIRECTORY Source = 0x40 Source_TOKEN_DIRECTORY_PUBLIC_TOKEN_LIST Source = 0x41 Source_TOKEN_DIRECTORY_3RD_PARTY Source = 0x42 Source_TOKEN_DIRECTORY_SEQUENCE_GITHUB Source = 0x43 Source_TOKEN_DIRECTORY_SEQUENCE_BUILDER Source = 0x44 Source_SEQUENCE_BUILDER Source = 0x80 Source_SEQUENCE_BUILDER_DEPLOYED Source = 0x81 Source_SEQUENCE_BUILDER_COLLECTIONS Source = 0x82 Source_SEQUENCE_BUILDER_ADMIN Source = 0x83 )
func (Source) MarshalText ¶ added in v0.47.0
func (*Source) UnmarshalText ¶ added in v0.47.0
type SwapType ¶
type SwapType uint32
func (SwapType) MarshalText ¶ added in v0.31.0
func (*SwapType) UnmarshalText ¶ added in v0.31.0
type Task ¶ added in v0.28.2
type Task struct { ID uint64 `json:"id" db:"id,omitempty"` Queue string `json:"queue" db:"queue"` Status TaskStatus `json:"status" db:"status"` Try uint32 `json:"try" db:"try"` RunAt *time.Time `json:"runAt" db:"run_at,omitempty"` LastRanAt *time.Time `json:"lastRanAt" db:"last_ran_at,omitempty"` CreatedAt *time.Time `json:"createdAt" db:"created_at,omitempty"` Payload json.RawMessage `json:"payload" db:"payload"` Result json.RawMessage `json:"result"` }
type TaskStatus ¶ added in v0.28.2
type TaskStatus uint8
const ( TaskStatus_QUEUED TaskStatus = 0 TaskStatus_PAUSED TaskStatus = 1 TaskStatus_FAILED TaskStatus = 2 TaskStatus_DONE TaskStatus = 3 )
func (*TaskStatus) Is ¶ added in v0.31.0
func (x *TaskStatus) Is(values ...TaskStatus) bool
func (TaskStatus) MarshalText ¶ added in v0.31.0
func (x TaskStatus) MarshalText() ([]byte, error)
func (TaskStatus) String ¶ added in v0.28.2
func (x TaskStatus) String() string
func (*TaskStatus) UnmarshalText ¶ added in v0.31.0
func (x *TaskStatus) UnmarshalText(b []byte) error
type Token ¶ added in v0.29.3
type Token struct { CollectionID uint64 `json:"collectionId" db:"collection_id"` TokenID prototyp.BigInt `json:"tokenId" db:"token_id"` Metadata *TokenMetadata `json:"metadata" db:"metadata"` Private bool `json:"private" db:"private"` SearchColumn string `json:"-" db:"search_col"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` }
Token is a database type used by 'collections' that represents the token metadata for a collection. We use this as an internal type for storage, but it stores just TokenMetadata for a particular collectionId/tokenId.
type TokenIndex ¶ added in v0.11.7
type TokenIndex struct { ChainID uint64 `json:"chainId" db:"chain_id"` ContractAddress prototyp.Hash `json:"contractAddress,omitempty" db:"contract_address"` TokenID prototyp.BigInt `json:"tokenId" db:"token_id"` Source Source `json:"source" db:"source"` Metadata map[string]interface{} `json:"metadata" db:"metadata"` NotFound bool `json:"notFound,omitempty" db:"not_found"` LastFetched *time.Time `json:"lastFetched,omitempty" db:"last_fetched"` FetchCount *uint8 `json:"fetchCount,omitempty" db:"fetch_count"` UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` QueuedAt *time.Time `json:"queuedAt"` }
TokenIndex is a database type to track the index of token metadata which are fetched on-demand through traversing on-chain contract metadata.
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:"-"` // url Image string `json:"image" cbor:"-"` // non-standard fields we've added for Sequence. Others should adopt // these too and we should prompt, similar to how `image` field works. // url Video string `json:"video,omitempty" cbor:"-"` // url Audio string `json:"audio,omitempty" cbor:"-"` Properties map[string]interface{} `json:"properties" cbor:"-"` // OpenSea fields // see https://docs.opensea.io/docs/metadata-standards // // NOTE: its a bit unfortunate OpenSea didn't use camelCase, and // also introduces 'attributes' when 'properties' is actually the correct property name. 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:"-"` // // Misc // // decimals is deprecated, but still used by some Decimals *uint64 `json:"decimals,omitempty" cbor:"-"` UpdatedAt time.Time `json:"updatedAt" cbor:"-"` // Assets associated to this token metadata 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 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.43.2
type WebrpcGenVersions struct { WebrpcGenVersion string CodeGenName string CodeGenVersion string SchemaName string SchemaVersion string }
func VersionFromHeader ¶ added in v0.43.2
func VersionFromHeader(h http.Header) (*WebrpcGenVersions, error)