Documentation
¶
Index ¶
- Variables
- func ParseRsp(rsp restgo.IResponse, i interface{}) error
- func WrapperCountContext(ctx context.Context, count int) context.Context
- type AssetRequest
- type AssetsRequest
- type AssetsResponse
- type BundlesRequest
- type BundlesResponse
- type Client
- func (c *Client) Asset(ctx context.Context, req *AssetRequest) (*model.Asset, error)
- func (c *Client) Assets(ctx context.Context, req *AssetsRequest) (*AssetsResponse, error)
- func (c *Client) Bundles(ctx context.Context, req *BundlesRequest) ([]*model.Bundle, error)
- func (c *Client) Collection(ctx context.Context, req *CollectionRequest) (*model.Collection, error)
- func (c *Client) CollectionStats(ctx context.Context, req *CollectionRequest) (*model.CollectionStats, error)
- func (c *Client) Collections(ctx context.Context, req *CollectionsRequest) ([]*model.Collection, error)
- func (c *Client) Contract(ctx context.Context, req *ContractRequest) (*model.Contract, error)
- func (c *Client) Events(ctx context.Context, req *EventsRequest) (*EventsResponse, error)
- func (c *Client) Orders(ctx context.Context, req *OrderRequest) (*OrderResponse, error)
- type CollectionRequest
- type CollectionResponse
- type CollectionStatsResponse
- type CollectionsRequest
- type CollectionsResponse
- type ContractRequest
- type EventsRequest
- type EventsResponse
- type OptionFn
- type OrderRequest
- type OrderResponse
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type AssetRequest ¶
type AssetRequest struct { // The NFT contract address for the assets AssetContractAddress string `path:"asset_contract_address,required"` // Address of the contract for this NFT TokenID string `path:"token_id,required"` // Address of an owner of the token. // If you include this, the response will include an ownership object that includes // the number of tokens owned by the address provided instead of the top_ownerships object // included in the standard response, which provides the number of tokens owned by each of // the 10 addresses with the greatest supply of the token. AccountAddress string `query:"account_address"` }
type AssetsRequest ¶
type AssetsRequest struct { // The address of the owner of the assets Owner string `query:"owner"` // An array of token IDs to search for (e.g. ?token_ids=1&token_ids=209). // Will return a list of assets with token_id matching any of the IDs in this array. TokenIDs []string `query:"token_ids"` // The NFT contract address for the assets AssetContractAddress string `query:"asset_contract_address"` // An array of contract addresses to search for (e.g. ?asset_contract_addresses=0x1...&asset_contract_addresses=0x2...). // Will return a list of assets with contracts matching any of the addresses in this array. // If "token_ids" is also specified, then it will only return assets that match each (address, token_id) pairing, respecting order. AssetContractAddresses []string `query:"asset_contract_addresses"` // How to order the assets returned. By default, the API returns the fastest ordering. // Options you can set are sale_date (the last sale's transaction's timestamp), // sale_count (number of sales), and sale_price (the last sale's total_price) OrderBy string `query:"order_by"` // Can be asc for ascending or desc for descending OrderDirection string `query:"order_direction,required"` // Offset Offset int32 `query:"offset"` // Limit Limit int32 `query:"limit,required"` //Cursor A cursor pointing to the page to retrieve Cursor string `query:"cursor"` // Limit responses to members of a collection. // Case-sensitive and must match the collection slug exactly. // Will return all assets from all contracts in a collection. // For more information on collections, see our collections documentation. Collection string `query:"collection"` // Limit responses to members of a collection. // Case sensitive and must match the collection slug exactly. // Will return all assets from all contracts in a collection. // For more information on collections, CollectionSlug string `query:"collection_slug"` // CollectionEditor CollectionEditor string `query:"collection_editor"` // A flag determining if order information should be included in the response. IncludeOrders bool `query:"include_orders"` }
type AssetsResponse ¶
type BundlesRequest ¶
type BundlesRequest struct { // If set to true, only show bundles currently on sale. // If set to false, only show bundles that have been sold or cancelled. OnSale bool `json:"on_sale"` // The address of the owner of the assets Owner string `query:"owner"` // The NFT contract address for the assets AssetContractAddress string `query:"asset_contract_address"` // An array of contract addresses to search for (e.g. ?asset_contract_addresses=0x1...&asset_contract_addresses=0x2...). // Will return a list of assets with contracts matching any of the addresses in this array. // If "token_ids" is also specified, then it will only return assets that match each (address, token_id) pairing, respecting order. AssetContractAddresses []string `query:"asset_contract_addresses"` // An array of token IDs to search for (e.g. ?token_ids=1&token_ids=209). // Will return a list of assets with token_id matching any of the IDs in this array. TokenIDs []string `query:"token_ids"` // Limit Limit int32 `query:"limit,required"` // Offset Offset int32 `query:"offset,required"` }
type BundlesResponse ¶
type Client ¶
func (*Client) Assets ¶
func (c *Client) Assets(ctx context.Context, req *AssetsRequest) (*AssetsResponse, error)
Assets To retrieve assets from our API, call the /assets endpoint with the desired filter parameters.
func (*Client) Bundles ¶
Bundles are groups of items for sale on OpenSea. You can buy them all at once in one transaction, and you can create them without any transactions or gas, as long as you've already approved the assets inside.
func (*Client) Collection ¶
func (c *Client) Collection(ctx context.Context, req *CollectionRequest) (*model.Collection, error)
Collection Used for retrieving more in-depth information about individual collections, including real time statistics like floor price
func (*Client) CollectionStats ¶
func (c *Client) CollectionStats(ctx context.Context, req *CollectionRequest) (*model.CollectionStats, error)
CollectionStats Use this endpoint to fetch stats for a specific collection, including realtime floor price statistics
func (*Client) Collections ¶
func (c *Client) Collections(ctx context.Context, req *CollectionsRequest) ([]*model.Collection, error)
Collections Use this endpoint to fetch collections on OpenSea
func (*Client) Events ¶
func (c *Client) Events(ctx context.Context, req *EventsRequest) (*EventsResponse, error)
Events The /events endpoint provides a list of events that occur on the assets that OpenSea tracks. The "event_type" field indicates what type of event it is (transfer, successful auction, etc).
func (*Client) Orders ¶
func (c *Client) Orders(ctx context.Context, req *OrderRequest) (*OrderResponse, error)
Orders How to fetch orders from the OpenSea system
type CollectionRequest ¶
type CollectionRequest struct {
CollectionSlug string `path:"collection_slug,required"`
}
type CollectionResponse ¶
type CollectionResponse struct {
Collection *model.Collection `opensea:"collection"`
}
type CollectionStatsResponse ¶
type CollectionStatsResponse struct {
Stats *model.CollectionStats `opensea:"stats"`
}
type CollectionsRequest ¶
type CollectionsRequest struct { // A wallet address. If specified, will return collections where the owner owns at least one asset belonging to smart contracts in the collection. // The number of assets the account owns is shown as owned_asset_count for each collection. AssetOwner string `query:"asset_owner"` // Offset Offset int32 `query:"offset,required"` // Limit Limit int32 `query:"limit,required"` }
type CollectionsResponse ¶
type CollectionsResponse struct {
Collections []*model.Collection `opensea:"collections"`
}
type ContractRequest ¶
type ContractRequest struct { // Address of the contract AssetContractAddress string `path:"asset_contract_address,required"` }
type EventsRequest ¶
type EventsRequest struct { // Restrict to events on OpenSea auctions. Can be true or false OnlyOpensea bool `query:"only_opensea"` // The token's id to optionally filter by TokenID string `query:"token_id"` // The NFT contract address for the assets AssetContractAddress string `query:"asset_contract_address"` // Limit responses to events from a collection. Case sensitive and must match the collection slug exactly. // Will return all assets from all contracts in a collection. // For more information on collections, see our collections documentation. CollectionSlug string `query:"collection_slug"` CollectionEditor string `query:"collection_editor"` // A user account's wallet address to filter for events on an account AccountAddress string `query:"account_address"` // The event type to filter. EventType model.EventType `query:"event_type"` // Filter by an auction type. AuctionType model.AuctionType `query:"auction_type"` // Only show events listed before this timestamp. Seconds since the Unix epoch. // eg: 2017-07-21T17:32:28Z OccurredBefore string `query:"occurred_before"` // Only show events listed after this timestamp. Seconds since the Unix epoch. // eg: 2017-07-21T17:32:28Z OccurredAfter string `query:"occurred_after"` // A cursor pointing to the page to retrieve Cursor string `query:"cursor"` }
type EventsResponse ¶
type EventsResponse struct { // List of Event Object AssetEvents []*model.Event `opensea:"asset_events"` // A cursor to be supplied as a query param to retrieve the next page Next string `opensea:"next"` // A cursor to be supplied as a query param to retrieve the previous page Previous string `opensea:"previous"` }
type OptionFn ¶
type OptionFn func(*option)
func WithAPIKey ¶
func WithRetryWhenFreqLimit ¶ added in v0.1.0
func WithTestNets ¶ added in v0.1.0
type OrderRequest ¶
type OrderRequest struct { // Filter by smart contract address for the asset category. // Needs to be defined together with token_id or token_ids. AssetContractAddress string `query:"asset_contract_address"` // Filter by the address of the smart contract of the payment token that is accepted or offered by the order PaymentTokenAddress string `query:"payment_token_address"` // Filter by the order maker's wallet address Maker string `query:"maker"` // Filter by the order taker's wallet address. // Orders open for any taker have the null address as their taker. Taker string `query:"taker"` // Filter by the asset owner's wallet address Owner string `query:"owner"` // When "true", only show English Auction sell orders, // which wait for the highest bidder. When "false", exclude those. IsEnglish bool `query:"is_english"` // Only show orders for bundles of assets Bundled bool `query:"bundled"` // Include orders on bundles where all assets in the bundle share the address provided // in asset_contract_address or where the bundle's maker is the address provided in owner IncludeBundled bool `query:"include_bundled"` // Only show orders listed after this timestamp. Seconds since the Unix epoch. // eg: 2017-07-21T17:32:28Z ListedAfter string `query:"listed_after"` // Only show orders listed before this timestamp. Seconds since the Unix epoch. // eg: 2017-07-21T17:32:28Z ListedBefore string `query:"listed_before"` // Filter by the token ID of the order's asset. // Needs to be defined together with asset_contract_address. TokenID string `query:"token_id"` // Filter by a list of token IDs for the order's asset. // Needs to be defined together with asset_contract_address. TokenIDs []string `query:"token_ids"` // Filter by the side of the order. // 0 for buy orders and 1 for sale orders. Side model.Side `query:"side,required"` // Filter by the kind of sell order. // 0 for fixed-price sales or min-bid auctions, // and 1 for declining-price Dutch Auctions. // use only_english=true for filtering for only English Auctions SaleKind model.SaleKind `query:"sale_kind"` // Limit Limit int32 `query:"limit,required"` // Offset Offset int32 `query:"offset,required"` // How to sort the orders. Can be created_date for when they were made, // or eth_price to see the lowest-priced orders first (converted to their ETH values). // eth_price is only supported when asset_contract_address and token_id are also defined. OrderBy string `query:"order_by"` // Can be asc or desc for ascending or descending sort. // For example, to see the cheapest orders, do order_direction asc and order_by eth_price. OrderDirection string `query:"order_direction,required"` }