orders

package
v0.0.0-...-ec35a81 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package orders provides the binding for Switcheo Rest APIs orders endpoints https://docs.switcheo.network/#orders

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	API client.API
}

func (*Client) ListOrders

func (c *Client) ListOrders(params ListOrdersParams) (ListOrdersResponse, error)

List available orders

type FillOrder

type FillOrder struct {
	ID              string      `json:"id"`
	OfferHash       string      `json:"offer_hash"`
	OfferAssetID    string      `json:"offer_asset_id"`
	WantAssetID     string      `json:"want_asset_id"`
	FillAmount      string      `json:"fill_amount"`
	WantAmount      string      `json:"want_amount"`
	FilledAmount    string      `json:"filled_amount"`
	FeeAssetID      string      `json:"fee_asset_id"`
	FeeAmount       string      `json:"fee_amount"`
	Price           string      `json:"price"`
	Txn             interface{} `json:"txn"`
	Status          string      `json:"status"`
	CreatedAt       time.Time   `json:"created_at"`
	TransactionHash string      `json:"transaction_hash"`
}

type Interface

type Interface interface {
	ListOrders(params ListOrdersParams) (ListOrdersResponse, error)
}

Available methods

type ListOrdersParams

type ListOrdersParams struct {
	Address      string `json:"address"`
	ContractHash string `json:"contract_hash"`
}

type ListOrdersResponse

type ListOrdersResponse []struct {
	ID                      string      `json:"id"`
	Blockchain              string      `json:"blockchain"`
	ContractHash            string      `json:"contract_hash"`
	Address                 string      `json:"address"`
	Side                    string      `json:"side"`
	OfferAssetID            string      `json:"offer_asset_id"`
	WantAssetID             string      `json:"want_asset_id"`
	OfferAmount             string      `json:"offer_amount"`
	WantAmount              string      `json:"want_amount"`
	TransferAmount          string      `json:"transfer_amount"`
	PriorityGasAmount       string      `json:"priority_gas_amount"`
	UseNativeToken          bool        `json:"use_native_token"`
	NativeFeeTransferAmount int         `json:"native_fee_transfer_amount"`
	DepositTxn              interface{} `json:"deposit_txn"`
	CreatedAt               time.Time   `json:"created_at"`
	Status                  string      `json:"status"`
	Fills                   []FillOrder `json:"fills"`
	Makes                   []MakeOrder `json:"makes"`
}

type MakeOrder

type MakeOrder struct {
	ID              string      `json:"id"`
	OfferHash       string      `json:"offer_hash"`
	AvailableAmount string      `json:"available_amount"`
	OfferAssetID    string      `json:"offer_asset_id"`
	OfferAmount     string      `json:"offer_amount"`
	WantAssetID     string      `json:"want_asset_id"`
	WantAmount      string      `json:"want_amount"`
	FilledAmount    string      `json:"filled_amount"`
	Txn             interface{} `json:"txn"`
	CancelTxn       interface{} `json:"cancel_txn"`
	Price           string      `json:"price"`
	Status          string      `json:"status"`
	CreatedAt       time.Time   `json:"created_at"`
	TransactionHash string      `json:"transaction_hash"`
	Trades          []struct {
		ID           string    `json:"id"`
		Status       string    `json:"status"`
		WantAmount   string    `json:"want_amount"`
		FilledAmount string    `json:"filled_amount"`
		FeeAmount    string    `json:"fee_amount"`
		FeeAssetID   string    `json:"fee_asset_id"`
		Price        string    `json:"price"`
		CreatedAt    time.Time `json:"created_at"`
	} `json:"trades"`
}

Jump to

Keyboard shortcuts

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