atomicasset

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2023 License: MIT Imports: 9 Imported by: 0

README

Atomicassets API Client

Test Go Reference

This package aims to implement a client for Pinknetwork's atomicassets API in go.

Install package
go get -u github.com/eosswedenorg-go/atomicasset@latest
Example

package main

import (
	"fmt"
	"github.com/eosswedenorg-go/atomicasset"
)

func main() {

	client := atomicasset.New("https://wax.api.atomicassets.io")

	health, err := client.GetHealth()
	if err != nil {
		panic(err)
	}

	fmt.Println("Head block at:", health.Data.Chain.HeadBlock)
}

TODO
  • implement stats resource
Author

Henrik Hautakoski - Sw/eden - henrik@eossweden.org

Documentation

Index

Constants

View Source
const (
	BuyOfferSortCreated      = BuyOfferSortColumn("created")
	BuyOfferSortUpdated      = BuyOfferSortColumn("updated")
	BuyOfferSortID           = BuyOfferSortColumn("buyoffer_id")
	BuyOfferSortPrice        = BuyOfferSortColumn("price")
	BuyOfferSortTemplateMint = BuyOfferSortColumn("template_mint")
	BuyOfferSortName         = BuyOfferSortColumn("name")
)
View Source
const (
	LinkStateWaiting  = LinkState(0)
	LinkStateCreated  = LinkState(1)
	LinkStateCanceled = LinkState(2)
	LinkStateClaimed  = LinkState(3)
)
View Source
const (
	OfferStatePending  = OfferState("0")
	OfferStateInvalid  = OfferState("1")
	OfferStateUnknown  = OfferState("2")
	OfferStateAccepted = OfferState("3")
	OfferStateDeclined = OfferState("4")
	OfferStateCanceled = OfferState("5")
)
View Source
const (
	OfferSortCreated = OfferSortColumn("created")
	OfferSortUpdated = OfferSortColumn("updated")
)
View Source
const (
	SalesStateWaiting  = SalesState("0")
	SalesStateListed   = SalesState("1")
	SalesStateCanceled = SalesState("2")
	SalesStateSold     = SalesState("3")
	SalesStateInvalid  = SalesState("4")
)
View Source
const (
	SaleSortCreated      = SaleSortColumn("created")
	SaleSortUpdated      = SaleSortColumn("updated")
	SaleSortID           = SaleSortColumn("sale_id")
	SaleSortPrice        = SaleSortColumn("price")
	SaleSortTemplateMint = SaleSortColumn("template_mint")
	SaleSortName         = SaleSortColumn("name")
)
View Source
const (
	SaleTemplateSortPrice      = SaleTemplateSortColumn("price")
	SaleTemplateSortTemplateID = SaleTemplateSortColumn("template_id")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Success null.Bool   `json:"success"`
	Message null.String `json:"message"`
}

type APIResponse

type APIResponse struct {
	HTTPResponse
	Success   bool          `json:"success"`
	QueryTime unixtime.Time `json:"query_time"`
}

type Asset

type Asset struct {
	ID             string       `json:"asset_id"`
	Contract       string       `json:"contract"`
	Owner          string       `json:"owner"`
	Name           string       `json:"name"`
	IsTransferable bool         `json:"is_transferable"`
	IsBurnable     bool         `json:"is_burnable"`
	TemplateMint   string       `json:"template_mint"`
	Collection     Collection   `json:"collection"`
	Schema         InlineSchema `json:"schema"`
	Template       Template     `json:"template"`
	BackedTokens   []Token      `json:"backed_tokens"`

	Data          map[string]interface{} `json:"data"`
	ImmutableData map[string]interface{} `json:"immutable_data"`
	MutableData   map[string]interface{} `json:"mutable_data"`

	BurnedByAccount string        `json:"burned_by_account"`
	BurnedAtBlock   string        `json:"burned_at_block"`
	BurnedAtTime    unixtime.Time `json:"burned_at_time"`

	UpdatedAtBlock string        `json:"updated_at_block"`
	UpdatedAtTime  unixtime.Time `json:"updated_at_time"`

	TransferedAtBlock string        `json:"transferred_at_block"`
	TransferedAtTime  unixtime.Time `json:"transferred_at_time"`

	MintedAtBlock string        `json:"minted_at_block"`
	MintedAtTime  unixtime.Time `json:"minted_at_time"`
}

type AssetLogResponse

type AssetLogResponse struct {
	APIResponse
	Data []Log
}

type AssetResponse

type AssetResponse struct {
	APIResponse
	Data Asset
}

type AssetSale

type AssetSale struct {
	ID             string        `json:"sale_id"`
	MarketContract string        `json:"market_contract"`
	AuctionID      string        `json:"auction_id"`
	BuyOfferID     string        `json:"buyoffer_id"`
	Price          string        `json:"price"`
	TokenSymbol    string        `json:"token_symbol"`
	TokenPrecision int64         `json:"token_precision"`
	TokenContract  string        `json:"token_contract"`
	Seller         string        `json:"seller"`
	Buyer          string        `json:"buyer"`
	BlockTime      unixtime.Time `json:"block_time"`
}

type AssetSalesRequestParams

type AssetSalesRequestParams struct {
	Buyer  string    `qs:"buyer,omitempty"`
	Seller string    `qs:"seller,omitempty"`
	Symbol string    `qs:"symbol,omitempty"`
	Order  SortOrder `qs:"order,omitempty"`
}

AssetSalesRequestParams holds the parameters for an AssetSales request

type AssetSalesResponse

type AssetSalesResponse struct {
	APIResponse
	Data []AssetSale
}

type AssetsConfig

type AssetsConfig struct {
	Contract         string         `json:"contract"`
	CollectionFormat []SchemaFormat `json:"collection_format"`
	SupportedTokens  []PriceToken   `json:"supported_tokens"`
	Version          string         `json:"version"`
}

type AssetsConfigResponse

type AssetsConfigResponse struct {
	APIResponse
	Data AssetsConfig
}

type AssetsRequestParams

type AssetsRequestParams struct {
	CollectionName          string          `qs:"collection_name,omitempty"`
	CollectionBlacklist     ReqList[string] `qs:"collection_blacklist,omitempty"`
	CollectionWhitelist     ReqList[string] `qs:"collection_whitelist,omitempty"`
	SchemaName              string          `qs:"schema_name,omitempty"`
	TemplateID              int             `qs:"template_id,omitempty"`
	TemplateWhitelist       ReqList[int]    `qs:"template_whitelist,omitempty"`
	TemplateBlacklist       ReqList[int]    `qs:"template_blacklist,omitempty"`
	Owner                   string          `qs:"owner,omitempty"`
	Match                   string          `qs:"match,omitempty"`
	MatchImmutableName      string          `qs:"match_immutable_name,omitempty"`
	MatchMutableName        string          `qs:"match_mutable_name,omitempty"`
	HideTemplatesByAccounts string          `qs:"hide_templates_by_accounts,omitempty"`

	IsTransferable          bool `qs:"is_transferable,omitempty"`
	IsBurnable              bool `qs:"is_burnable,omitempty"`
	Burned                  bool `qs:"burned,omitempty"`
	OnlyDuplicatedTemplates bool `qs:"only_duplicated_templates,omitempty"`
	HasBackedTokens         bool `qs:"has_backend_tokens,omitempty"`
	HideOffers              bool `qs:"hide_offers,omitempty"`

	LowerBound string `qs:"lower_bound,omitempty"`
	UpperBound string `qs:"upper_bound,omitempty"`

	Before int `qs:"before,omitempty"`
	After  int `qs:"after,omitempty"`

	Limit int       `qs:"limit,omitempty"`
	Order SortOrder `qs:"order,omitempty"`
	Sort  string    `qs:"sort,omitempty"`
}

AssetsRequestParams holds the parameters for an Asset request

type AssetsResponse

type AssetsResponse struct {
	APIResponse
	Data []Asset
}

type Auction

type Auction struct {
	ID               string        `json:"auction_id"`
	MarketContract   string        `json:"market_contract"`
	AssetsContract   string        `json:"assets_contract"`
	Seller           string        `json:"seller"`
	Buyer            string        `json:"buyer"`
	Price            Token         `json:"price"`
	Assets           []Asset       `json:"assets"`
	Bids             []Bid         `json:"bids"`
	MakerMarketplace string        `json:"maker_marketplace"`
	TakerMarketplace string        `json:"taker_marketplace"`
	ClaimedByBuyer   bool          `json:"claimed_by_buyer"`
	ClaimedBySeller  bool          `json:"claimed_by_seller"`
	Collection       Collection    `json:"collection"`
	EndTime          unixtime.Time `json:"end_time"`
	IsSellerContract bool          `json:"is_seller_contract"`
	UpdatedAtBlock   string        `json:"updated_at_block"`
	UpdatedAtTime    unixtime.Time `json:"updated_at_time"`
	CreatedAtBlock   string        `json:"created_at_block"`
	CreatedAtTime    unixtime.Time `json:"created_at_time"`
	State            SalesState    `json:"state"`
}

type AuctionResponse

type AuctionResponse struct {
	APIResponse
	Data Auction
}

type AuctionsRequestParams

type AuctionsRequestParams struct {
	State               SalesState      `qs:"state,omitempty"`
	MaxAssets           int             `qs:"max_assets,omitempty"`
	MinAssets           int             `qs:"min_assets,omitempty"`
	ShowSellerContract  string          `qs:"show_seller_contract,omitempty"`
	ContractBlacklist   ReqList[string] `qs:"contract_blacklist,omitempty"`
	ContractWhitelist   ReqList[string] `qs:"contract_whitelist,omitempty"`
	SellerBlacklist     ReqList[string] `qs:"seller_blacklist,omitempty"`
	BuyerBlacklist      ReqList[string] `qs:"buyer_blacklist,omitempty"`
	AssetId             int             `qs:"asset_id,omitempty"`
	Marketplace         ReqList[string] `qs:"marketplace,omitempty"`
	MakerMarketplace    ReqList[string] `qs:"maker_marketplace,omitempty"`
	TakerMarketplace    ReqList[string] `qs:"taker_marketplace,omitempty"`
	Symbol              string          `qs:"symbol,omitempty"`
	Account             string          `qs:"account,omitempty"`
	Seller              ReqList[string] `qs:"seller,omitempty"`
	Buyer               ReqList[string] `qs:"buyer,omitempty"`
	MinPrice            int             `qs:"min_price,omitempty"`
	MaxPrice            int             `qs:"max_price,omitempty"`
	MinTemplateMint     int             `qs:"min_template_mint,omitempty"`
	MaxTemplateMint     int             `qs:"max_template_mint,omitempty"`
	CollectionName      string          `qs:"collection_name,omitempty"`
	CollectionBlacklist ReqList[string] `qs:"collection_blacklist,omitempty"`
	CollectionWhitelist ReqList[string] `qs:"collection_whitelist,omitempty"`
	SchemaName          string          `qs:"schema_name,omitempty"`
	TemplateID          int             `qs:"template_id,omitempty"`
	Burned              bool            `qs:"burned,omitempty"`
	Owner               string          `qs:"owner,omitempty"`
	Match               string          `qs:"match,omitempty"`
	Search              string          `qs:"search,omitempty"`
	MatchImmutableName  string          `qs:"match_immutable_name,omitempty"`
	MatchMutableName    string          `qs:"match_mutable_name,omitempty"`
	IsTransferable      bool            `qs:"is_transferable,omitempty"`
	IsBurnable          bool            `qs:"is_burnable,omitempty"`
	Minter              string          `qs:"minter,omitempty"`
	Burner              string          `qs:"burner,omitempty"`
	IDs                 ReqList[int]    `qs:"ids,omitempty"`
	LowerBound          string          `qs:"lower_bound,omitempty"`
	UpperBound          string          `qs:"upper_bound,omitempty"`
	Before              int             `qs:"before,omitempty"`
	After               int             `qs:"after,omitempty"`
	Page                int             `qs:"page,omitempty"`
	Limit               int             `qs:"limit,omitempty"`
	Order               SortOrder       `qs:"order,omitempty"`
	Sort                SaleSortColumn  `qs:"sort,omitempty"`
}

type AuctionsResponse

type AuctionsResponse struct {
	APIResponse
	Data []Auction
}

type Bid

type Bid struct {
	Number         int           `json:"number"`
	Account        string        `json:"account"`
	Amount         string        `json:"amount"`
	CreatedAtBlock string        `json:"created_at_block"`
	CreatedAtTime  unixtime.Time `json:"created_at_time"`
	TxID           string        `json:"txid"`
}

type BuyOffer

type BuyOffer struct {
	ID               string     `json:"buyoffer_id"`
	MarketContract   string     `json:"market_contract"`
	AssetsContract   string     `json:"assets_contract"`
	Seller           string     `json:"seller"`
	Buyer            string     `json:"buyer"`
	Price            Token      `json:"price"`
	Assets           []Asset    `json:"assets"`
	MakerMarketplace string     `json:"maker_marketplace,omitempty"`
	TakerMarketplace string     `json:"taker_marketplace,omitempty"`
	Collection       Collection `json:"collection"`
	State            SalesState `json:"state"`
	Memo             string     `json:"memo"`
	DeclineMemo      string     `json:"decline_memo"`

	UpdatedAtBlock string        `json:"updated_at_block"`
	UpdatedAtTime  unixtime.Time `json:"updated_at_time"`

	CreatedAtBlock string        `json:"created_at_block"`
	CreatedAtTime  unixtime.Time `json:"created_at_time"`
}

type BuyOfferResponse

type BuyOfferResponse struct {
	APIResponse
	Data BuyOffer
}

type BuyOfferSortColumn

type BuyOfferSortColumn string

type BuyOffersRequestParams

type BuyOffersRequestParams struct {
	State               SalesState         `qs:"state,omitempty"`
	MaxAssets           int                `qs:"max_assets,omitempty"`
	MinAssets           int                `qs:"min_assets,omitempty"`
	ShowSellerContract  string             `qs:"show_seller_contract,omitempty"`
	ContractBlacklist   ReqList[string]    `qs:"contract_blacklist,omitempty"`
	ContractWhitelist   ReqList[string]    `qs:"contract_whitelist,omitempty"`
	SellerBlacklist     ReqList[string]    `qs:"seller_blacklist,omitempty"`
	BuyerBlacklist      ReqList[string]    `qs:"buyer_blacklist,omitempty"`
	AssetId             int                `qs:"asset_id,omitempty"`
	Marketplace         ReqList[string]    `qs:"marketplace,omitempty"`
	MakerMarketplace    ReqList[string]    `qs:"maker_marketplace,omitempty"`
	TakerMarketplace    ReqList[string]    `qs:"taker_marketplace,omitempty"`
	Symbol              string             `qs:"symbol,omitempty"`
	Account             string             `qs:"account,omitempty"`
	Seller              ReqList[string]    `qs:"seller,omitempty"`
	Buyer               ReqList[string]    `qs:"buyer,omitempty"`
	MinPrice            int                `qs:"min_price,omitempty"`
	MaxPrice            int                `qs:"max_price,omitempty"`
	MinTemplateMint     int                `qs:"min_template_mint,omitempty"`
	MaxTemplateMint     int                `qs:"max_template_mint,omitempty"`
	CollectionName      string             `qs:"collection_name,omitempty"`
	CollectionBlacklist ReqList[string]    `qs:"collection_blacklist,omitempty"`
	CollectionWhitelist ReqList[string]    `qs:"collection_whitelist,omitempty"`
	SchemaName          string             `qs:"schema_name,omitempty"`
	TemplateID          int                `qs:"template_id,omitempty"`
	Burned              bool               `qs:"burned,omitempty"`
	Owner               string             `qs:"owner,omitempty"`
	Match               string             `qs:"match,omitempty"`
	Search              string             `qs:"search,omitempty"`
	MatchImmutableName  string             `qs:"match_immutable_name,omitempty"`
	MatchMutableName    string             `qs:"match_mutable_name,omitempty"`
	IsTransferable      bool               `qs:"is_transferable,omitempty"`
	IsBurnable          bool               `qs:"is_burnable,omitempty"`
	Minter              string             `qs:"minter,omitempty"`
	Burner              string             `qs:"burner,omitempty"`
	InitialReceiver     string             `qs:"initial_receiver,omitempty"`
	IDs                 ReqList[int]       `qs:"ids,omitempty"`
	LowerBound          string             `qs:"lower_bound,omitempty"`
	UpperBound          string             `qs:"upper_bound,omitempty"`
	Before              int                `qs:"before,omitempty"`
	After               int                `qs:"after,omitempty"`
	Page                int                `qs:"page,omitempty"`
	Limit               int                `qs:"limit,omitempty"`
	Order               SortOrder          `qs:"order,omitempty"`
	Sort                BuyOfferSortColumn `qs:"sort,omitempty"`
}

type BuyOffersResponse

type BuyOffersResponse struct {
	APIResponse
	Data []BuyOffer
}

type ChainHealth

type ChainHealth struct {
	Status    string        `json:"status"`
	HeadBlock int64         `json:"head_block"`
	HeadTime  unixtime.Time `json:"head_time"`
}

type Client

type Client struct {
	URL  string
	Host string
	// contains filtered or unexported fields
}

Client interacts with the api

func New

func New(url string) *Client

New Creates a new client object

func NewWithContext added in v0.1.1

func NewWithContext(url string, ctx context.Context) *Client

func (*Client) GetAsset

func (c *Client) GetAsset(assetID string) (AssetResponse, error)

GetAsset fetches "/atomicassets/v1/assets/{asset_id}" from API

func (*Client) GetAssetLog

func (c *Client) GetAssetLog(assetID string, params LogRequestParams) (AssetLogResponse, error)

GetAssetLog fetches "/atomicassets/v1/assets/{asset_id}/logs" from API

func (*Client) GetAssetSales

func (c *Client) GetAssetSales(assetID string, params AssetSalesRequestParams) (AssetSalesResponse, error)

GetAssetSales fetches "/atomicmarket/v1/assets/{asset_id}/sales" from API

func (*Client) GetAssets

func (c *Client) GetAssets(params AssetsRequestParams) (AssetsResponse, error)

GetAssets fetches "/atomicassets/v1/assets" from API

func (*Client) GetAssetsConfig

func (c *Client) GetAssetsConfig() (AssetsConfigResponse, error)

GetAssetsConfig fetches "/atomicassets/v1/config" from API

func (*Client) GetAuction

func (c *Client) GetAuction(auction_id int) (AuctionResponse, error)

GetAuction fetches "/atomicassets/v1/auctions/{auction_id}" from API

func (*Client) GetAuctionLogs

func (c *Client) GetAuctionLogs(auction_id int, params LogRequestParams) (LogsResponse, error)

GetAuctionLogs fetches "/atomicassets/v1/auctions/{auction_id}/logs" from API

func (*Client) GetAuctions

func (c *Client) GetAuctions(params AuctionsRequestParams) (AuctionsResponse, error)

GetAuctions fetches "/atomicassets/v2/auctions" from API

func (*Client) GetBuyOffer

func (c *Client) GetBuyOffer(buyoffer_id int) (BuyOfferResponse, error)

GetBuyOffer fetches "/atomicassets/v1/buyoffers/{buyoffer_id}" from API

func (*Client) GetBuyOfferLogs

func (c *Client) GetBuyOfferLogs(buyoffer_id int, params LogRequestParams) (LogsResponse, error)

GetBuyOfferLogs fetches "/atomicassets/v1/buyoffers/{buyoffer_id}/logs" from API

func (*Client) GetBuyOffers

func (c *Client) GetBuyOffers(params AuctionsRequestParams) (BuyOffersResponse, error)

GetBuyOffers fetches "/atomicassets/v1/buyoffers" from API

func (*Client) GetCollection

func (c *Client) GetCollection(name string) (CollectionResponse, error)

GetCollection fetches "/atomicassets/v1/collection/<name>" from API

func (*Client) GetCollectionLogs

func (c *Client) GetCollectionLogs(name string, params CollectionLogsRequestParams) (CollectionLogsResponse, error)

GetCollectionStats fetches "/atomicassets/v1/collection/<name>/stats" from API

func (*Client) GetCollectionStats

func (c *Client) GetCollectionStats(name string) (CollectionStatsResponse, error)

GetCollectionStats fetches "/atomicassets/v1/collection/<name>/stats" from API

func (*Client) GetCollections

func (c *Client) GetCollections(params CollectionsRequestParams) (CollectionsResponse, error)

GetCollections fetches "/atomicassets/v1/collections" from API

func (*Client) GetHealth

func (c *Client) GetHealth() (Health, error)

GetHealth fetches "/health" from API

func (c *Client) GetLink(id int64) (LinkResponse, error)

GetLink fetches "/atomictools/v1/links/{id}" from API

func (*Client) GetLinkLogs

func (c *Client) GetLinkLogs(id int64, params LogRequestParams) (LogsResponse, error)

GetLinkLogs fetches "/atomiclinks/v1/links/{id}/logs" from API

func (c *Client) GetLinks(params LinkRequestParams) (LinksResponse, error)

GetLinks fetches "/atomiclinks/v1/links" from API

func (*Client) GetMarketConfig

func (c *Client) GetMarketConfig() (MarketConfigResponse, error)

GetMarketConfig fetches "/atomicmarket/v1/config" from API

func (*Client) GetMarketplace

func (c *Client) GetMarketplace(name string) (MarketplaceResponse, error)

GetMarketplace fetches "/atomicassets/v1/marketplaces/{name}" from API

func (*Client) GetMarketplaces

func (c *Client) GetMarketplaces() (MarketplacesResponse, error)

GetMarketplaces fetches "/atomicassets/v1/marketplaces" from API

func (*Client) GetOffer

func (c *Client) GetOffer(offerID string) (OfferResponse, error)

GetOffer fetches "/atomicassets/v1/offers/{offers_id}" from API

func (*Client) GetOfferLog

func (c *Client) GetOfferLog(offerID string, params LogRequestParams) (OfferLogResponse, error)

GetOfferLog fetches "/atomicassets/v1/offers/{offers_id}/logs" from API

func (*Client) GetOffers

func (c *Client) GetOffers(params OfferRequestParams) (OffersResponse, error)

GetOffers fetches "/atomicassets/v1/offers" from API

func (*Client) GetPriceAssets

func (c *Client) GetPriceAssets(params PriceAssetsRequestParams) (PriceAssetsResponse, error)

GetPriceAssets fetches "/atomicassets/v1/prices/assets" from API

func (*Client) GetPriceInventory

func (c *Client) GetPriceInventory(account string, params PriceInventoryRequestParams) (PriceInventoryResponse, error)

GetPriceInventory fetches "/atomicassets/v1/prices/inventory/{account}" from API

func (*Client) GetPriceTemplates

func (c *Client) GetPriceTemplates(params PriceTemplatesRequestParams) (PriceTemplatesResponse, error)

GetPriceTemplates fetches "/atomicassets/v1/prices/templates" from API

func (*Client) GetSale

func (c *Client) GetSale(sale_id int) (SaleResponse, error)

GetSale fetches "/atomicassets/v1/sales/{sale_id}" from API

func (*Client) GetSaleLogs

func (c *Client) GetSaleLogs(sale_id int, params LogRequestParams) (LogsResponse, error)

GetSaleLogs fetches "/atomicassets/v1/sales/{sale_id}/logs" from API

func (*Client) GetSalePrices

func (c *Client) GetSalePrices(params PriceSalesRequestParams) (SalePricesResponse, error)

GetSalePrices fetches "/atomicassets/v1/prices/sales" from API

func (*Client) GetSalePricesDays

func (c *Client) GetSalePricesDays(params PriceSalesRequestParams) (SalePricesDaysResponse, error)

GetSalePricesDays fetches "/atomicassets/v1/prices/sales/days" from API

func (*Client) GetSales

func (c *Client) GetSales(params SalesRequestParams) (SalesResponse, error)

GetSales fetches "/atomicassets/v2/sales" from API

func (*Client) GetSalesGroupByTemplate

func (c *Client) GetSalesGroupByTemplate(params SalesTemplateRequestParams) (SalesResponse, error)

func (*Client) GetSchemas

func (c *Client) GetSchemas(params SchemasRequestParams) (SchemasResponse, error)

GetSchemas fetches "/atomicassets/v1/schemas" from API

func (*Client) GetTemplate

func (c *Client) GetTemplate(collection, template_id string) (TemplateResponse, error)

GetSchemas fetches "/atomicassets/v1/template/{collection}/{template_id}" from API

func (*Client) GetTemplateStats

func (c *Client) GetTemplateStats(collection, template_id string) (TemplateStatsResponse, error)

func (*Client) GetTemplates

func (c *Client) GetTemplates(params TemplateRequestParams) (TemplatesResponse, error)

GetSchemas fetches "/atomicassets/v1/templates" from API

func (*Client) GetToolsConfig

func (c *Client) GetToolsConfig() (ToolsConfigResponse, error)

GetToolsConfig fetches "/atomictools/v1/config" from API

func (*Client) GetTransfers

func (c *Client) GetTransfers(params TransferRequestParams) (TransfersResponse, error)

GetTransfers fetches "/atomicassets/v1/transfers" from API

type Collection

type Collection struct {
	CollectionName     string   `json:"collection_name"`
	Contract           string   `json:"contract"`
	Name               string   `json:"name"`
	Image              string   `json:"img"` // Not defined in the spec. but might be included in a response.
	Author             string   `json:"author"`
	AllowNotify        bool     `json:"allow_notify"`
	AuthorizedAccounts []string `json:"authorized_accounts"`
	NotifyAccounts     []string `json:"notify_accounts"`
	MarketFee          float64  `json:"market_fee"`

	Data map[string]interface{} `json:"data"`

	CreatedAtBlock string        `json:"created_at_block"`
	CreatedAtTime  unixtime.Time `json:"created_at_time"`
}

type CollectionLogsRequestParams

type CollectionLogsRequestParams struct {
	Page            int             `qs:"page,omitempty"`
	Limit           int             `qs:"limit,omitempty"`
	Order           SortOrder       `qs:"order,omitempty"`
	ActionBlacklist ReqList[string] `qs:"action_blacklist,omitempty"`
	ActionWhitelist ReqList[string] `qs:"action_whitelist,omitempty"`
}

type CollectionLogsResponse

type CollectionLogsResponse struct {
	APIResponse
	Data []Log
}

type CollectionResponse

type CollectionResponse struct {
	APIResponse
	Data Collection
}

type CollectionSortColumn

type CollectionSortColumn string
const (

	// CollectionSortDefault sorts by the default column (created)
	CollectionSortDefault CollectionSortColumn = ""

	// CollectionSortCreated sorts by the created column
	CollectionSortCreated CollectionSortColumn = "created"

	// CollectionSortName sorts by the collection name column
	CollectionSortName CollectionSortColumn = "collection_name"
)

type CollectionStats

type CollectionStats struct {
	Assets           string   `json:"assets"`
	Burned           string   `json:"burned"`
	BurnedByTemplate []string `json:"burned_by_template"`
	BurnedBySchema   []string `json:"burned_by_schema"`
	Templates        string   `json:"templates"`
	Schemas          string   `json:"schemas"`
}

type CollectionStatsResponse

type CollectionStatsResponse struct {
	APIResponse
	Data CollectionStats
}

type CollectionsRequestParams

type CollectionsRequestParams struct {
	Author            string               `qs:"author,omitempty"`
	Match             string               `qs:"match,omitempty"`
	AuthorizedAccount string               `qs:"authorized_account,omitempty"`
	NotifyAccount     string               `qs:"notify_account,omitempty"`
	Blacklist         ReqList[string]      `qs:"collection_blacklist,omitempty"`
	Whitelist         ReqList[string]      `qs:"collection_whitelist,omitempty"`
	IDs               ReqList[int]         `qs:"ids,omitempty"`
	LowerBound        string               `qs:"lower_bound,omitempty"`
	UpperBound        string               `qs:"upper_bound,omitempty"`
	Before            int                  `qs:"before,omitempty"`
	After             int                  `qs:"after,omitempty"`
	Page              int                  `qs:"page,omitempty"`
	Limit             int                  `qs:"limit,omitempty"`
	Order             SortOrder            `qs:"order,omitempty"`
	Sort              CollectionSortColumn `qs:"sort,omitempty"`
}

type CollectionsResponse

type CollectionsResponse struct {
	APIResponse
	Data []Collection
}

type HTTPResponse

type HTTPResponse struct {
	HTTPStatusCode int
}

func (*HTTPResponse) IsError

func (resp *HTTPResponse) IsError() bool

type Health

type Health struct {
	APIResponse
	Data HealthData
}

type HealthData

type HealthData struct {
	Version  string         `json:"version"`
	Postgres PostgresHealth `json:"postgres"`
	Redis    RedisHealth    `json:"redis"`
	Chain    ChainHealth    `json:"chain"`
}

type InlineSchema

type InlineSchema struct {
	Name           string         `json:"schema_name"`
	Format         []SchemaFormat `json:"format"`
	CreatedAtBlock string         `json:"created_at_block"`
	CreatedAtTime  unixtime.Time  `json:"created_at_time"`
}
type Link struct {
	ID             string    `json:"link_id"`
	ToolsContract  string    `json:"tools_contract"`
	AssetsContract string    `json:"assets_contract"`
	Creator        string    `json:"creator"`
	Claimer        string    `json:"claimer,omitempty"`
	State          LinkState `json:"state"`
	PublicKey      string    `json:"public_key"`
	Memo           string    `json:"memo"`
	TxID           string    `json:"txid"`
	Assets         []Asset   `json:"assets"`

	CreatedAtBlock string        `json:"created_at_block"`
	CreatedAtTime  unixtime.Time `json:"created_at_time"`
	UpdatedAtBlock string        `json:"updated_at_block"`
	UpdatedAtTime  unixtime.Time `json:"updated_at_time"`
}

type LinkRequestParams

type LinkRequestParams struct {
	Creator             string             `qs:"creator,omitempty"`
	Claimer             string             `qs:"claimer,omitempty"`
	PublicKey           string             `qs:"public_key,omitempty"`
	State               ReqList[LinkState] `qs:"state,omitempty"`
	CollectionWhitelist ReqList[string]    `qs:"collection_whitelist,omitempty"`
	CollectionBlacklist ReqList[string]    `qs:"collection_blacklist,omitempty"`
	IDs                 ReqList[int]       `qs:"ids,omitempty"`
	LowerBound          string             `qs:"lower_bound,omitempty"`
	UpperBound          string             `qs:"upper_bound,omitempty"`
	Before              int                `qs:"before,omitempty"`
	After               int                `qs:"after,omitempty"`
	Page                int                `qs:"page,omitempty"`
	Limit               int                `qs:"limit,omitempty"`
	Order               SortOrder          `qs:"order,omitempty"`
}

type LinkResponse

type LinkResponse struct {
	APIResponse
	Data Link
}

type LinkState

type LinkState int

type LinksResponse

type LinksResponse struct {
	APIResponse
	Data []Link
}

type ListingAsset

type ListingAsset struct {
	AssetID        string       `json:"asset_id"`
	Contract       string       `json:"contract"`
	Onwer          string       `json:"owner"`
	Name           string       `json:"name"`
	IsTransferable bool         `json:"is_transferable"`
	IsBurnable     bool         `json:"is_burnable"`
	TemplateMint   string       `json:"template_mint"`
	Collection     Collection   `json:"collection"`
	Schema         InlineSchema `json:"schema"`
	Template       Template     `json:"template"`
	BackedTokens   []Token      `json:"backed_tokens"`

	ImmutableData map[string]interface{} `json:"immutable_data"`
	MutableData   map[string]interface{} `json:"mutable_data"`
	Data          map[string]interface{} `json:"data"`

	BurnedByAccount string        `json:"burned_by_account"`
	BurnedAtBlock   string        `json:"burned_at_block"`
	BurnedAtTime    unixtime.Time `json:"burned_at_time"`

	UpdatedAtBlock string        `json:"updated_at_block"`
	UpdatedAtTime  unixtime.Time `json:"updated_at_time"`

	TransferedAtBlock string        `json:"transferred_at_block"`
	TransferedAtTime  unixtime.Time `json:"transferred_at_time"`

	MintedAtBlock string        `json:"minted_at_block"`
	MintedAtTime  unixtime.Time `json:"minted_at_time"`

	Sales    []Sale    `json:"sales"`
	Auctions []Auction `json:"actions"`
	Prices   []Price   `json:"prices"`
}

type Log

type Log struct {
	ID             string                 `json:"log_id"`
	TxID           string                 `json:"txid"`
	Name           string                 `json:"name"`
	Data           map[string]interface{} `json:"data"`
	CreatedAtBlock string                 `json:"created_at_block"`
	CreatedAtTime  unixtime.Time          `json:"created_at_time"`
}

type LogRequestParams

type LogRequestParams struct {
	Page            int             `qs:"page,omitempty"`
	Limit           int             `qs:"limit,omitempty"`
	Order           SortOrder       `qs:"order,omitempty"`
	ActionWhitelist ReqList[string] `qs:"action_whitelist,omitempty"`
	ActionBlacklist ReqList[string] `qs:"action_blacklist,omitempty"`
}

LogRequestParams holds the parameters for an Log request

type LogsResponse

type LogsResponse struct {
	APIResponse
	Data []Log
}

type MarketConfig

type MarketConfig struct {
	AtomicassetsContract   string       `json:"atomicassets_contract"`
	AtomicmarketContract   string       `json:"atomicmarket_contract"`
	DelphioracleContract   string       `json:"delphioracle_contract"`
	MakerMarketFee         float64      `json:"maker_market_fee"`
	TakerMarketFee         float64      `json:"taker_market_fee"`
	MinimumAuctionDuration int          `json:"minimum_auction_duration"`
	MaximumAuctionDuration int          `json:"maximum_auction_duration"`
	MinimumBidIncrease     float64      `json:"minimum_bid_increase"`
	AuctionResetDuration   int          `json:"auction_reset_duration"`
	SupportedTokens        []PriceToken `json:"supported_tokens"`
	SupportedPairs         []TokenPair  `json:"supported_pairs"`
	Version                string       `json:"version"`
}

type MarketConfigResponse

type MarketConfigResponse struct {
	APIResponse
	Data MarketConfig
}

type Marketplace

type Marketplace struct {
	Name           string        `json:"marketplace_name"`
	Creator        string        `json:"creator"`
	CreatedAtBlock string        `json:"created_at_block"`
	CreatedAtTime  unixtime.Time `json:"created_at_time"`
}

type MarketplaceResponse

type MarketplaceResponse struct {
	APIResponse
	Data Marketplace
}

type MarketplacesResponse

type MarketplacesResponse struct {
	APIResponse
	Data []Marketplace
}

type Offer

type Offer struct {
	ID                  string  `json:"offer_id"`
	Contract            string  `json:"contract"`
	Sender              string  `json:"sender_name"`
	Recipient           string  `json:"recipient_name"`
	Memo                string  `json:"memo"`
	State               int64   `json:"state"`
	IsSenderContract    bool    `json:"is_sender_contract"`
	IsRecipientContract bool    `json:"is_recipient_contract"`
	SenderAssets        []Asset `json:"sender_assets"`
	RecipientAssets     []Asset `json:"recipient_assets"`

	UpdatedAtBlock string        `json:"updated_at_block"`
	UpdatedAtTime  unixtime.Time `json:"updated_at_time"`

	CreatedAtBlock string        `json:"created_at_block"`
	CreatedAtTime  unixtime.Time `json:"created_at_time"`
}

type OfferLogResponse

type OfferLogResponse struct {
	APIResponse
	Data []Log
}

type OfferRequestParams

type OfferRequestParams struct {
	Account                 string          `qs:"account,omitempty"`
	Sender                  ReqList[string] `qs:"sender,omitempty"`
	Recipient               ReqList[string] `qs:"recipient,omitempty"`
	Memo                    string          `qs:"memo,omitempty"`
	MatchMemo               string          `qs:"match_memo,omitempty"`
	State                   OfferState      `qs:"state,omitempty"`
	IsRecipientContract     bool            `qs:"is_recipient_contract,omitempty"`
	AssetID                 ReqList[int]    `qs:"asset_id,omitempty"`
	TemplateID              ReqList[int]    `qs:"template_id,omitempty"`
	SchemaName              ReqList[string] `qs:"schema_name,omitempty"`
	CollectionName          ReqList[string] `qs:"collection_name,omitempty"`
	AccountWhitelist        ReqList[string] `qs:"account_whitelist,omitempty"`
	AccountBlacklist        ReqList[string] `qs:"account_blacklist,omitempty"`
	SenderAssetWhitelist    ReqList[string] `qs:"sender_asset_whitelist,omitempty"`
	SenderAssetBlacklist    ReqList[string] `qs:"sender_asset_blacklist,omitempty"`
	RecipientAssetWhitelist ReqList[string] `qs:"recipient_asset_whitelist,omitempty"`
	RecipientAssetBlacklist ReqList[string] `qs:"recipient_asset_blacklist,omitempty"`
	CollectionWhitelist     ReqList[string] `qs:"collection_whitelist,omitempty"`
	CollectionBlacklist     ReqList[string] `qs:"collection_blacklist,omitempty"`
	HideContracts           bool            `qs:"hide_contracts,omitempty"`
	HideEmptyOffers         bool            `qs:"hide_empty_offers,omitempty"`
	IDs                     ReqList[int]    `qs:"ids,omitempty"`
	LowerBound              string          `qs:"lower_bound,omitempty"`
	UpperBound              string          `qs:"upper_bound,omitempty"`
	Before                  int             `qs:"before,omitempty"`
	After                   int             `qs:"after,omitempty"`
	Page                    int             `qs:"page,omitempty"`
	Limit                   int             `qs:"limit,omitempty"`
	Order                   SortOrder       `qs:"order,omitempty"`
	Sort                    OfferSortColumn `qs:"sort,omitempty"`
}

type OfferResponse

type OfferResponse struct {
	APIResponse
	Data Offer
}

type OfferSortColumn

type OfferSortColumn string

type OfferState

type OfferState string

type OffersResponse

type OffersResponse struct {
	APIResponse
	Data []Offer
}

type PostgresHealth

type PostgresHealth struct {
	Status  string                   `json:"status"`
	Readers []map[string]interface{} `json:"readers"`
}

type Price

type Price struct {
	Average          string     `json:"average"`
	MarketContract   string     `json:"market_contract"`
	Max              string     `json:"max"`
	Median           string     `json:"median"`
	Min              string     `json:"min"`
	Sales            string     `json:"sales"`
	SuggestedAverage string     `json:"suggested_average"`
	SuggestedMedian  string     `json:"suggested_median"`
	Token            PriceToken `json:"token"`
}

type PriceAsset

type PriceAsset struct {
	TokenSymbol      string `json:"token_symbol"`
	TokenPrecision   int64  `json:"token_precision"`
	TokenContract    string `json:"token_contract"`
	Median           string `json:"median"`
	Average          string `json:"average"`
	Min              string `json:"min"`
	Max              string `json:"max"`
	SuggestedMedian  string `json:"suggested_median"`
	SuggestedAverage string `json:"suggested_average"`
}

type PriceAssetsRequestParams

type PriceAssetsRequestParams struct {
	CollectionName      string          `qs:"collection_name,omitempty"`
	CollectionBlacklist ReqList[string] `qs:"collection_blacklist,omitempty"`
	CollectionWhitelist ReqList[string] `qs:"collection_whitelist,omitempty"`
	SchemaName          string          `qs:"schema_name,omitempty"`
	TemplateID          int             `qs:"template_id,omitempty"`
	Owner               string          `qs:"owner,omitempty"`
	Search              string          `qs:"search,omitempty"`
	Match               string          `qs:"match,omitempty"`
	MatchImmutableName  string          `qs:"match_immutable_name,omitempty"`
	MatchMutableName    string          `qs:"match_mutable_name,omitempty"`
	IsTransferable      bool            `qs:"is_transferable,omitempty"`
	IsBurnable          bool            `qs:"is_burnable,omitempty"`
	Burned              bool            `qs:"burned,omitempty"`
	Minter              string          `qs:"minter,omitempty"`
	Burner              string          `qs:"burner,omitempty"`
	InitialReceiver     string          `qs:"initial_receiver,omitempty"`
	HideOffers          bool            `qs:"hide_offers,omitempty"`
	Ids                 ReqList[string] `qs:"ids,omitempty"`
	LowerBound          string          `qs:"lower_bound,omitempty"`
	UpperBound          string          `qs:"upper_bound,omitempty"`
}

type PriceAssetsResponse

type PriceAssetsResponse struct {
	APIResponse
	Data []PriceAsset
}

type PriceInventory

type PriceInventory struct {
	Collection Collection   `json:"collection"`
	Prices     []PriceAsset `json:"prices"`
}

type PriceInventoryRequestParams

type PriceInventoryRequestParams PriceAssetsRequestParams

These "should" have identical fields, so just make an alias for now.

type PriceInventoryResponse

type PriceInventoryResponse struct {
	APIResponse
	Data []PriceInventory
}

type PriceSale

type PriceSale struct {
	SaleID         string        `json:"sale_id"`
	AuctionID      string        `json:"auction_id"`
	BuyofferID     string        `json:"buyoffer_id"`
	TemplateMint   int64         `json:"template_mint"`
	Price          string        `json:"price"`
	TokenSymbol    string        `json:"token_symbol"`
	TokenPrecision int64         `json:"token_precision"`
	TokenContract  string        `json:"token_contract"`
	BlockTime      unixtime.Time `json:"block_time"`
}

type PriceSaleDay

type PriceSaleDay struct {
	Median         string        `json:"median"`
	Average        string        `json:"average"`
	Sales          string        `json:"sales"`
	TokenSymbol    string        `json:"token_symbol"`
	TokenPrecision int64         `json:"token_precision"`
	TokenContract  string        `json:"token_contract"`
	Time           unixtime.Time `json:"time"`
}

type PriceSalesRequestParams

type PriceSalesRequestParams struct {
	Collection string `qs:"collection_name,omitempty"`
	Schema     string `qs:"schema_name,omitempty"`
	TemplateID int    `qs:"template_id,omitempty"`
	Burned     bool   `qs:"burned,omitempty"`
	Symbol     string `qs:"symbol,omitempty"`
}

type PriceTemplate

type PriceTemplate struct {
	MarketContract   string `json:"market_contract"`
	AssetsContract   string `json:"assets_contract"`
	CollectionName   string `json:"collection_name"`
	TemplateID       string `json:"template_id"`
	TokenSymbol      string `json:"token_symbol"`
	TokenPrecision   int64  `json:"token_precision"`
	TokenContract    string `json:"token_contract"`
	Median           string `json:"median"`
	Average          string `json:"average"`
	Min              string `json:"min"`
	Max              string `json:"max"`
	Sales            string `json:"sales"`
	SuggestedMedian  string `json:"suggested_median"`
	SuggestedAverage string `json:"suggested_average"`
}

type PriceTemplatesRequestParams

type PriceTemplatesRequestParams struct {
	Collection string    `qs:"collection_name,omitempty"`
	Schema     string    `qs:"schema_name,omitempty"`
	TemplateID int       `qs:"template_id,omitempty"`
	Burned     bool      `qs:"burned,omitempty"`
	Symbol     string    `qs:"symbol,omitempty"`
	Page       int       `qs:"page,omitempty"`
	Limit      int       `qs:"limit,omitempty"`
	Order      SortOrder `qs:"order,omitempty"`
}

type PriceTemplatesResponse

type PriceTemplatesResponse struct {
	APIResponse
	Data []PriceTemplate
}

type PriceToken

type PriceToken struct {
	Contract  string `json:"token_contract"`
	Symbol    string `json:"token_symbol"`
	Precision int    `json:"token_precision"`
}

type RedisHealth

type RedisHealth struct {
	Status string `json:"status"`
}

type ReqList

type ReqList[T any] []T

func (ReqList[T]) EncodeParam

func (l ReqList[T]) EncodeParam() (string, error)

func (ReqList[T]) IsZero

func (l ReqList[T]) IsZero() bool

type Sale

type Sale struct {
	ID               string      `json:"sale_id"`
	MarketContract   string      `json:"market_contract"`
	AsssetsContract  string      `json:"assets_contract"`
	Seller           string      `json:"seller"`
	Buyer            string      `json:"buyer"`
	OfferID          string      `json:"offer_id"`
	Price            Token       `json:"price"`
	ListingPrice     json.Number `json:"listing_price"`
	ListingSymbol    string      `json:"listing_symbol"`
	Assets           []Asset     `json:"assets"`
	MakerMarketplace string      `json:"maker_marketplace,omitempty"`
	TakerMarketplace string      `json:"taker_marketplace,omitempty"`
	Collection       Collection  `json:"collection"`
	IsSellerContract bool        `json:"is_seller_contract"`
	State            SalesState  `json:"state"`

	UpdatedAtBlock string        `json:"updated_at_block"`
	UpdatedAtTime  unixtime.Time `json:"updated_at_time"`

	CreatedAtBlock string        `json:"created_at_block"`
	CreatedAtTime  unixtime.Time `json:"created_at_time"`
}

type SalePricesDaysResponse

type SalePricesDaysResponse struct {
	APIResponse
	Data []PriceSaleDay
}

type SalePricesResponse

type SalePricesResponse struct {
	APIResponse
	Data []PriceSale
}

type SaleResponse

type SaleResponse struct {
	APIResponse
	Data Sale
}

type SaleSortColumn

type SaleSortColumn string

type SaleTemplateSortColumn

type SaleTemplateSortColumn string

type SalesRequestParams

type SalesRequestParams struct {
	State               SalesState      `qs:"state,omitempty"`
	MaxAssets           int             `qs:"max_assets,omitempty"`
	MinAssets           int             `qs:"min_assets,omitempty"`
	ShowSellerContract  string          `qs:"show_seller_contract,omitempty"`
	ContractBlacklist   ReqList[string] `qs:"contract_blacklist,omitempty"`
	ContractWhitelist   ReqList[string] `qs:"contract_whitelist,omitempty"`
	SellerBlacklist     ReqList[string] `qs:"seller_blacklist,omitempty"`
	BuyerBlacklist      ReqList[string] `qs:"buyer_blacklist,omitempty"`
	AssetId             int             `qs:"asset_id,omitempty"`
	Marketplace         ReqList[string] `qs:"marketplace,omitempty"`
	MakerMarketplace    ReqList[string] `qs:"maker_marketplace,omitempty"`
	TakerMarketplace    ReqList[string] `qs:"taker_marketplace,omitempty"`
	Symbol              string          `qs:"symbol,omitempty"`
	Account             string          `qs:"account,omitempty"`
	Seller              ReqList[string] `qs:"seller,omitempty"`
	Buyer               ReqList[string] `qs:"buyer,omitempty"`
	MinPrice            int             `qs:"min_price,omitempty"`
	MaxPrice            int             `qs:"max_price,omitempty"`
	MinTemplateMint     int             `qs:"min_template_mint,omitempty"`
	MaxTemplateMint     int             `qs:"max_template_mint,omitempty"`
	CollectionName      string          `qs:"collection_name,omitempty"`
	CollectionBlacklist ReqList[string] `qs:"collection_blacklist,omitempty"`
	CollectionWhitelist ReqList[string] `qs:"collection_whitelist,omitempty"`
	SchemaName          string          `qs:"schema_name,omitempty"`
	TemplateID          int             `qs:"template_id,omitempty"`
	Burned              bool            `qs:"burned,omitempty"`
	Owner               string          `qs:"owner,omitempty"`
	Match               string          `qs:"match,omitempty"`
	Search              string          `qs:"search,omitempty"`
	MatchImmutableName  string          `qs:"match_immutable_name,omitempty"`
	MatchMutableName    string          `qs:"match_mutable_name,omitempty"`
	IsTransferable      bool            `qs:"is_transferable,omitempty"`
	IsBurnable          bool            `qs:"is_burnable,omitempty"`
	Minter              string          `qs:"minter,omitempty"`
	Burner              string          `qs:"burner,omitempty"`
	IDs                 ReqList[int]    `qs:"ids,omitempty"`
	LowerBound          string          `qs:"lower_bound,omitempty"`
	UpperBound          string          `qs:"upper_bound,omitempty"`
	Before              int             `qs:"before,omitempty"`
	After               int             `qs:"after,omitempty"`
	Page                int             `qs:"page,omitempty"`
	Limit               int             `qs:"limit,omitempty"`
	Order               SortOrder       `qs:"order,omitempty"`
	Sort                SaleSortColumn  `qs:"sort,omitempty"`
}

type SalesResponse

type SalesResponse struct {
	APIResponse
	Data []Sale
}

type SalesState

type SalesState string

Need to use string here as SalesRequestParams.State needs to have a zero value that is not 0. So we use the empty string for that.

func (*SalesState) UnmarshalJSON

func (s *SalesState) UnmarshalJSON(b []byte) error

And for json, we need to parse the value as and integer and then convert it to string.

type SalesTemplateRequestParams

type SalesTemplateRequestParams struct {
	Symbol              string                 `qs:"symbol,omitempty"`
	MinPrice            int                    `qs:"min_price,omitempty"`
	MaxPrice            int                    `qs:"max_price,omitempty"`
	CollectionName      string                 `qs:"collection_name,omitempty"`
	CollectionBlacklist ReqList[string]        `qs:"collection_blacklist,omitempty"`
	CollectionWhitelist ReqList[string]        `qs:"collection_whitelist,omitempty"`
	SchemaName          string                 `qs:"schema_name,omitempty"`
	TemplateID          int                    `qs:"template_id,omitempty"`
	Burned              bool                   `qs:"burned,omitempty"`
	Owner               string                 `qs:"owner,omitempty"`
	Match               string                 `qs:"match,omitempty"`
	Search              string                 `qs:"search,omitempty"`
	MatchImmutableName  string                 `qs:"match_immutable_name,omitempty"`
	MatchMutableName    string                 `qs:"match_mutable_name,omitempty"`
	IsTransferable      bool                   `qs:"is_transferable,omitempty"`
	IsBurnable          bool                   `qs:"is_burnable,omitempty"`
	Minter              string                 `qs:"minter,omitempty"`
	Burner              string                 `qs:"burner,omitempty"`
	InitialReceiver     string                 `qs:"initial_receiver,omitempty"`
	IDs                 ReqList[int]           `qs:"ids,omitempty"`
	LowerBound          string                 `qs:"lower_bound,omitempty"`
	UpperBound          string                 `qs:"upper_bound,omitempty"`
	Before              int                    `qs:"before,omitempty"`
	After               int                    `qs:"after,omitempty"`
	Page                int                    `qs:"page,omitempty"`
	Limit               int                    `qs:"limit,omitempty"`
	Order               SortOrder              `qs:"order,omitempty"`
	Sort                SaleTemplateSortColumn `qs:"sort,omitempty"`
}

type Schema

type Schema struct {
	Name           string         `json:"schema_name"`
	Contract       string         `json:"contract"`
	Format         []SchemaFormat `json:"format"`
	Collection     Collection     `json:"collection"`
	CreatedAtBlock string         `json:"created_at_block"`
	CreatedAtTime  unixtime.Time  `json:"created_at_time"`
}

type SchemaFormat

type SchemaFormat struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type SchemaSortColumn

type SchemaSortColumn string
const (

	// SchemaSortDefault sorts by the default column (created)
	SchemaSortDefault SchemaSortColumn = ""

	// SchemaSortCreated sorts by the created column
	SchemaSortCreated SchemaSortColumn = "created"

	// SchemaSortAssets sorts by the assets column
	SchemaSortAssets SchemaSortColumn = "assets"

	// SchemaSortName sorts by the schema name column
	SchemaSortName SchemaSortColumn = "schema_name"
)

type SchemasRequestParams

type SchemasRequestParams struct {
	Author            string           `qs:"author,omitempty"`
	Match             string           `qs:"match,omitempty"`
	AuthorizedAccount string           `qs:"authorized_account,omitempty"`
	NotifyAccount     string           `qs:"notify_account,omitempty"`
	Blacklist         ReqList[string]  `qs:"collection_blacklist,omitempty"`
	Whitelist         ReqList[string]  `qs:"collection_whitelist,omitempty"`
	IDs               ReqList[int]     `qs:"ids,omitempty"`
	LowerBound        string           `qs:"lower_bound,omitempty"`
	UpperBound        string           `qs:"upper_bound,omitempty"`
	Before            int              `qs:"before,omitempty"`
	After             int              `qs:"after,omitempty"`
	Page              int              `qs:"page,omitempty"`
	Limit             int              `qs:"limit,omitempty"`
	Order             SortOrder        `qs:"order,omitempty"`
	Sort              SchemaSortColumn `qs:"sort,omitempty"`
}

type SchemasResponse

type SchemasResponse struct {
	APIResponse
	Data []Schema
}

type SortOrder

type SortOrder string
const (

	// SortNone order is not specified.
	SortNone SortOrder = ""

	// SortAscending sorts in ascending order
	SortAscending SortOrder = "asc"

	// SortDescending sorts in descending order.
	SortDescending SortOrder = "desc"
)

type Template

type Template struct {
	ID             string                 `json:"template_id"`
	Contract       string                 `json:"contract"`
	MaxSupply      string                 `json:"max_supply"`
	IssuedSupply   string                 `json:"issued_supply"`
	IsTransferable bool                   `json:"is_transferable"`
	IsBurnable     bool                   `json:"is_burnable"`
	ImmutableData  map[string]interface{} `json:"immutable_data"`

	// Note: Collection.Contract is always non-existant in template responses.
	// But cba to create a new struct just for one field.
	Collection     Collection    `json:"collection"`
	Schema         InlineSchema  `json:"schema"`
	CreatedAtBlock string        `json:"created_at_block"`
	CreatedAtTime  unixtime.Time `json:"created_at_time"`
}

type TemplateRequestParams

type TemplateRequestParams struct {
	SchemaName          string           `qs:"schema_name,omitempty"`
	CollectionName      string           `qs:"collection_name,omitempty"`
	CollectionBlacklist ReqList[string]  `qs:"collection_blacklist,omitempty"`
	CollectionWhitelist ReqList[string]  `qs:"collection_whitelist,omitempty"`
	IssuedSypply        int              `qs:"issued_supply,omitempty"`
	MinIssuedSupply     int              `qs:"min_issued_supply,omitempty"`
	MaxIssuedSupply     int              `qs:"max_issued_supply,omitempty"`
	MaxSupply           int              `qs:"max_supply,omitempty"`
	HasAssets           bool             `qs:"has_assets,omitempty"`
	IsBurnable          bool             `qs:"is_burnable,omitempty"`
	IsTransferable      bool             `qs:"is_transferable,omitempty"`
	AuthorizedAccount   string           `qs:"authorized_account,omitempty"`
	Match               string           `qs:"match,omitempty"`
	IDs                 ReqList[int]     `qs:"ids,omitempty"`
	LowerBound          string           `qs:"lower_bound,omitempty"`
	UpperBound          string           `qs:"upper_bound,omitempty"`
	Before              int              `qs:"before,omitempty"`
	After               int              `qs:"after,omitempty"`
	Page                int              `qs:"page,omitempty"`
	Limit               int              `qs:"limit,omitempty"`
	Order               SortOrder        `qs:"order,omitempty"`
	Sort                SchemaSortColumn `qs:"sort,omitempty"`
}

type TemplateResponse

type TemplateResponse struct {
	APIResponse
	Data Template
}

type TemplateSortColumn

type TemplateSortColumn string
const (

	// TemplateSortDefault sorts by the default column (created)
	TemplateSortDefault TemplateSortColumn = ""

	// TemplateSortCreated sorts by the created column
	TemplateSortCreated TemplateSortColumn = "created"

	// TemplateSortName sorts by the name column
	TemplateSortName TemplateSortColumn = "name"
)

type TemplateStats

type TemplateStats struct {
	Assets    string `json:"assets"`
	Burned    string `json:"burned"`
	Templates string `json:"templates"`
	Schemas   string `json:"schemas"`
}

type TemplateStatsResponse

type TemplateStatsResponse struct {
	APIResponse
	Data TemplateStats
}

type TemplatesResponse

type TemplatesResponse struct {
	APIResponse
	Data []Template
}

type Token

type Token struct {
	Contract  string `json:"token_contract"`
	Symbol    string `json:"token_symbol"`
	Precision int    `json:"token_precision"`
	Amount    string `json:"amount"`
}

type TokenPair

type TokenPair struct {
	ListingSymbol    string                 `json:"listing_symbol"`
	SettlementSymbol string                 `json:"settlement_symbol"`
	DelphiPairName   string                 `json:"delphi_pair_name"`
	InvertDelphiPair bool                   `json:"invert_delphi_pair"`
	Data             map[string]interface{} `json:"data"`
}

type ToolsConfig

type ToolsConfig struct {
	AtomictoolsContract  string `json:"atomictools_contract"`
	AtomicassetsContract string `json:"atomicassets_contract"`
	Version              string `json:"version"`
}

type ToolsConfigResponse

type ToolsConfigResponse struct {
	APIResponse
	Data ToolsConfig
}

type Transfer

type Transfer struct {
	ID        string  `json:"transfer_id"`
	Contract  string  `json:"contract"`
	Sender    string  `json:"sender_name"`
	Recipient string  `json:"recipient_name"`
	Memo      string  `json:"memo"`
	Assets    []Asset `json:"assets"`

	CreatedAtBlock string        `json:"created_at_block"`
	CreatedAtTime  unixtime.Time `json:"created_at_time"`
}

type TransferRequestParams

type TransferRequestParams struct {
	Account             ReqList[string] `qs:"account,omitempty"`
	Sender              ReqList[string] `qs:"sender,omitempty"`
	Recipient           ReqList[string] `qs:"recipient,omitempty"`
	Memo                string          `qs:"memo,omitempty"`
	MatchMemo           string          `qs:"match_memo,omitempty"`
	AssetID             ReqList[int]    `qs:"asset_id,omitempty"`
	TemplateID          ReqList[int]    `qs:"template_id,omitempty"`
	SchemaName          ReqList[string] `qs:"schema_name,omitempty"`
	CollectionName      ReqList[string] `qs:"collection_name,omitempty"`
	CollectionWhitelist ReqList[string] `qs:"collection_whitelist,omitempty"`
	CollectionBlacklist ReqList[string] `qs:"collection_blacklist,omitempty"`
	HideContracts       bool            `qs:"hide_contracts,omitempty"`
	IDs                 ReqList[int]    `qs:"ids,omitempty"`
	LowerBound          string          `qs:"lower_bound,omitempty"`
	UpperBound          string          `qs:"upper_bound,omitempty"`
	Before              int             `qs:"before,omitempty"`
	After               int             `qs:"after,omitempty"`
	Page                int             `qs:"page,omitempty"`
	Limit               int             `qs:"limit,omitempty"`
	Order               SortOrder       `qs:"order,omitempty"`
}

type TransfersResponse

type TransfersResponse struct {
	APIResponse
	Data []Transfer
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL