client

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ApplicationsURL = "/v1/applications"
View Source
const AssetsURL = "/v1/assets"
View Source
const BalancesURL = "/v2/balances"
View Source
const ClaimsURL = "/v1/rewards"
View Source
const CollectionsURL = "/v1/collections"
View Source
const DepositsURL = "/v1/deposits"
View Source
const MainnetURL = "https://api.x.immutable.com"
View Source
const MintableTokenURL = "/v1/mintable-token"
View Source
const MintsURL = "/v1/mints"
View Source
const OrdersURL = "/v1/orders"
View Source
const RopstenURL = "https://api.ropsten.x.immutable.com"
View Source
const SDKInitURL = "init"
View Source
const SDKTransferERC20URL = "erc20/transfer"
View Source
const SDKTransferERC721URL = "erc721/transfer"
View Source
const SnapshotURL = "/v1/snapshot/balances"
View Source
const TokensURL = "/v1/tokens"
View Source
const TradesURL = "/v1/trades"
View Source
const TransfersURL = "/v1/transfers"
View Source
const UsersURL = "/v1/users"
View Source
const WithdrawalsURL = "/v1/withdrawals"

Variables

This section is empty.

Functions

func MintSignature

func MintSignature(mint Mint, privateKey *ecdsa.PrivateKey) (string, error)

func Sign

func Sign(msg []byte, privateKey *ecdsa.PrivateKey) (string, error)

Types

type Asset

type Asset struct {
	ID           string      `json:"id"`
	TokenAddress string      `json:"token_address"`
	TokenID      string      `json:"token_id"`
	User         string      `json:"user"`
	Status       string      `json:"eth"`
	URI          string      `json:"uri"`
	Name         string      `json:"name"`
	Description  string      `json:"description"`
	ImageURL     string      `json:"image_url"`
	Metadata     interface{} `json:"metadata"`
	Collection   Collection  `json:"collection"`
	CreatedAt    string      `json:"created_at"`
	UpdatedAt    string      `json:"updated_at"`
}

type Balance

type Balance struct {
	Symbol              string `json:"symbol"`
	Balance             string `json:"balance"`
	PreparingWithdrawal string `json:"preparing_withdrawal"`
	Withdrawable        string `json:"withdrawable"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(network Network, privateKey, providerKey string, opts ...Option) (*Client, error)

func (*Client) GetAsset

func (c *Client) GetAsset(request *GetAssetRequest) (*Asset, error)

func (*Client) GetToken added in v0.1.7

func (c *Client) GetToken(request *GetTokenRequest) (*Token, error)

func (*Client) GetTransfer

func (c *Client) GetTransfer(request GetTransferRequest) (response types.Transfer, err error)

func (*Client) ListAssets

func (c *Client) ListAssets(request *ListAssetsRequest) (*ListAssetsResponse, error)

func (*Client) ListBalances

func (c *Client) ListBalances(request ListBalancesRequest) (response ListBalancesResponse, err error)

func (*Client) ListOrders

func (c *Client) ListOrders(request *ListOrdersRequest) (*ListOrdersResponse, error)

func (*Client) ListTransfers

func (c *Client) ListTransfers(request ListTransfersRequest) (response ListTransfersResponse, err error)

func (*Client) Mint

func (c *Client) Mint(request *MintRequest) (*MintResponse, error)

func (*Client) RestRequest

func (c *Client) RestRequest(method, path string, data url.Values, body, responseType interface{}) error

func (*Client) SDKRequest

func (c *Client) SDKRequest(method, path string, data url.Values, body, responseType interface{}) error

func (*Client) TransferERC20

func (c *Client) TransferERC20(request *TransferERC20Request) (response TransferERC20Response, err error)

func (*Client) TransferERC721

func (c *Client) TransferERC721(request *TransferERC721Request) (response TransferERC721Response, err error)

type Collection

type Collection struct {
	Name    string `json:"name"`
	IconURL string `json:"icon_url"`
}

type GetAssetRequest

type GetAssetRequest struct {
	TokenAddress string
	TokenID      string
}

type GetTokenRequest added in v0.1.7

type GetTokenRequest struct {
	TokenAddress string
}

type GetTransferRequest

type GetTransferRequest struct {
	TransferID string
}

type IMXError

type IMXError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type IMXResponse

type IMXResponse struct {
	Payload interface{}
}

type InitSDKRequest

type InitSDKRequest struct {
	Network    Network `json:"network"`
	PrivateKey string  `json:"private_key"`
	AlchemyKey string  `json:"alchemy_key"`
}

type InitSDKResponse

type InitSDKResponse struct {
	PublicApiUrl                string `json:"publicApiUrl"`
	ContractAddress             string `json:"contractAddress"`
	RegistrationContractAddress string `json:"registrationContractAddress"`
}

type ListAssetsRequest

type ListAssetsRequest struct {
	PageSize            int    `url:"page_size,omitempty"`
	Cursor              string `url:"cursor,omitempty"`
	OrderBy             string `url:"order_by,omitempty"`
	Direction           string `url:"direction,omitempty"`
	User                string `url:"user,omitempty"`
	Status              string `url:"status,omitempty"`
	Name                string `url:"name,omitempty"`
	Metadata            string `url:"metadata,omitempty"`
	SellOrders          bool   `url:"sell_orders,omitempty"`
	BuyOrders           bool   `url:"buy_orders,omitempty"`
	IncludeFees         bool   `url:"include_fees,omitempty"`
	Collection          string `url:"collection,omitempty"`
	UpdatedMinTimestamp string `url:"updated_min_timestamp,omitempty"`
	UpdatedMaxTimestamp string `url:"updated_max_timestamp,omitempty"`
}

type ListAssetsResponse

type ListAssetsResponse struct {
	Cursor    string  `json:"cursor"`
	Remaining int     `json:"remaining"`
	Result    []Asset `json:"result"`
}

type ListBalancesRequest

type ListBalancesRequest struct {
	Owner string `url:"owner,omitempty"`
}

type ListBalancesResponse

type ListBalancesResponse struct {
	Cursor    string    `json:"cursor"`
	Remaining int       `json:"remaining"`
	Result    []Balance `json:"result"`
}

type ListOrdersRequest

type ListOrdersRequest struct {
	PageSize            int    `url:"page_size,omitempty"`
	Cursor              string `url:"cursor,omitempty"`
	OrderBy             string `url:"order_by,omitempty"`
	Direction           string `url:"direction,omitempty"`
	User                string `url:"user,omitempty"`
	Status              string `url:"status,omitempty"`
	MinTimestamp        string `url:"min_timestamp,omitempty"`
	MaxTimestamp        string `url:"max_timestamp,omitempty"`
	UpdatedMinTimestamp string `url:"updated_min_timestamp,omitempty"`
	UpdatedMaxTimestamp string `url:"updated_max_timestamp,omitempty"`
	BuyTokenType        string `url:"buy_token_type,omitempty"`
	BuyTokenID          string `url:"buy_token_id,omitempty"`
	BuyAssetID          string `url:"buy_asset_id,omitempty"`
	BuyTokenAddress     string `url:"buy_token_address,omitempty"`
	BuyTokenName        string `url:"buy_token_name,omitempty"`
	BuyMinQuantity      string `url:"buy_min_quantity,omitempty"`
	BuyMaxQuantity      string `url:"buy_max_quantity,omitempty"`
	BuyMetadata         string `url:"buy_metadata,omitempty"`
	SellTokenType       string `url:"sell_token_type,omitempty"`
	SellTokenID         string `url:"sell_token_id,omitempty"`
	SellAssetID         string `url:"sell_asset_id,omitempty"`
	SellTokenAddress    string `url:"sell_token_address,omitempty"`
	SellMinQuantity     string `url:"sell_min_quantity,omitempty"`
	SellMaxQuantity     string `url:"sell_max_quantity,omitempty"`
	SellMetadata        string `url:"sell_metadata,omitempty"`
}

type ListOrdersResponse

type ListOrdersResponse struct {
	Cursor    string  `json:"cursor"`
	Remaining int     `json:"remaining"`
	Result    []Order `json:"result"`
}

type ListTransfersRequest

type ListTransfersRequest struct {
	PageSize            int    `url:"page_size,omitempty"`
	Cursor              string `url:"cursor,omitempty"`
	OrderBy             string `url:"order_by,omitempty"`
	Direction           string `url:"direction,omitempty"`
	User                string `url:"user,omitempty"`
	Receiver            string `url:"receiver,omitempty"`
	Status              string `url:"status,omitempty"`
	Name                string `url:"name,omitempty"`
	Metadata            string `url:"metadata,omitempty"`
	SellOrders          bool   `url:"sell_orders,omitempty"`
	BuyOrders           bool   `url:"buy_orders,omitempty"`
	IncludeFees         bool   `url:"include_fees,omitempty"`
	Collection          string `url:"collection,omitempty"`
	UpdatedMinTimestamp string `url:"updated_min_timestamp,omitempty"`
	UpdatedMaxTimestamp string `url:"updated_max_timestamp,omitempty"`
}

type ListTransfersResponse

type ListTransfersResponse struct {
	Cursor    string           `json:"cursor"`
	Remaining int              `json:"remaining"`
	Result    []types.Transfer `json:"result"`
}

type Mint

type Mint struct {
	User          string        `json:"user"`
	Tokens        []TokenToMint `json:"tokens"`
	Nonce         int64         `json:"nonce"`
	AuthSignature string        `json:"auth_signature"`
}

type MintData

type MintData struct {
	ID           string `json:"id"`
	Blueprint    string `json:"blueprint"`
	TokenAddress string `json:"token_address"`
}

type MintRequest

type MintRequest struct {
	Mints []Mint `json:"mints"`
}

type MintResponse

type MintResponse struct {
}

type Network

type Network string
var (
	Mainnet Network = "mainnet"
	Ropsten Network = "ropsten"
)

type Option

type Option interface {
	// contains filtered or unexported methods
}

func SetIMXSDKServiceParams

func SetIMXSDKServiceParams(params SDKServiceParams) Option

type Order

type Order struct {
	OrderID             int         `json:"order_id"`
	Status              string      `json:"status"`
	User                string      `json:"user"`
	Sell                OrderDetail `json:"sell"`
	Buy                 OrderDetail `json:"buy"`
	AmountSold          string      `json:"amount_sold"`
	ExpirationTimestamp string      `json:"expiration_timestamp"`
	Timestamp           string      `json:"timestamp"`
	UpdatedTimestamp    string      `json:"updated_timestamp"`
}

type OrderData

type OrderData struct {
	TokenID      string      `json:"token_id"`
	ID           string      `json:"id"`
	TokenAddress string      `json:"token_address"`
	Quantity     string      `json:"quantity"`
	Properties   interface{} `json:"properties"`
}

type OrderDetail

type OrderDetail struct {
	Type string    `json:"type"`
	Data OrderData `json:"data"`
}

type SDKServiceParams

type SDKServiceParams struct {
	Host string
	Port int
}

type SigMint

type SigMint struct {
	EtherKey      string        `json:"ether_key"`
	Tokens        []TokenToMint `json:"tokens"`
	Nonce         int64         `json:"nonce"`
	AuthSignature string        `json:"auth_signature"`
}

type Token

type Token struct {
	Name         string `json:"name"`
	ImageURL     string `json:"image_url"`
	TokenAddress string `json:"token_address"`
	Symbol       string `json:"symbol"`
	Decimals     string `json:"decimals"`
	Quantum      string `json:"quantum"`
}

type TokenToMint added in v0.1.7

type TokenToMint struct {
	Type string    `json:"type"`
	Data *MintData `json:"data"`
}

type TransferERC20Request

type TransferERC20Request struct {
	Type         string `json:"type,omitempty"`
	TokenAddress string `json:"token_address,omitempty"`
	ToAddress    string `json:"to_address,omitempty"`
	Amount       string `json:"amount,omitempty"`
	Symbol       string `json:"symbol,omitempty"`
}

type TransferERC20Response

type TransferERC20Response struct {
	TransferIDs []int `json:"transfer_ids"`
}

type TransferERC721Request

type TransferERC721Request struct {
	Type         string `json:"type,omitempty"`
	TokenID      string `json:"token_id,omitempty"`
	TokenAddress string `json:"token_address,omitempty"`
	ToAddress    string `json:"to_address,omitempty"`
}

type TransferERC721Response

type TransferERC721Response struct {
	TransferIDs []int `json:"transfer_ids"`
}

Jump to

Keyboard shortcuts

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