Skip to content

Latest commit

 

History

History
283 lines (178 loc) · 6.82 KB

MarketDataAPI.md

File metadata and controls

283 lines (178 loc) · 6.82 KB

\MarketDataAPI

All URIs are relative to https://api.paxos.com/v2

Method HTTP request Description
GetOrderBook Get /markets/{market}/order-book Get Order Book
GetTicker Get /markets/{market}/ticker Get Ticker
ListMarkets Get /markets List Markets
ListRecentExecutions Get /markets/{market}/recent-executions List Recent Executions

GetOrderBook

GetOrderBookResponse GetOrderBook(ctx, market).Execute()

Get Order Book

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/avianlabs/paxos-go"
)

func main() {
	market := "market_example" // string | Market of Order Book.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.MarketDataAPI.GetOrderBook(context.Background(), market).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MarketDataAPI.GetOrderBook``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetOrderBook`: GetOrderBookResponse
	fmt.Fprintf(os.Stdout, "Response from `MarketDataAPI.GetOrderBook`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
market string Market of Order Book.

Other Parameters

Other parameters are passed through a pointer to a apiGetOrderBookRequest struct via the builder pattern

Name Type Description Notes

Return type

GetOrderBookResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetTicker

TickerRecord GetTicker(ctx, market).Execute()

Get Ticker

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/avianlabs/paxos-go"
)

func main() {
	market := "market_example" // string | Market of the Ticker.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.MarketDataAPI.GetTicker(context.Background(), market).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MarketDataAPI.GetTicker``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetTicker`: TickerRecord
	fmt.Fprintf(os.Stdout, "Response from `MarketDataAPI.GetTicker`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
market string Market of the Ticker.

Other Parameters

Other parameters are passed through a pointer to a apiGetTickerRequest struct via the builder pattern

Name Type Description Notes

Return type

TickerRecord

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListMarkets

ListMarketsResponse ListMarkets(ctx).Execute()

List Markets

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/avianlabs/paxos-go"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.MarketDataAPI.ListMarkets(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MarketDataAPI.ListMarkets``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListMarkets`: ListMarketsResponse
	fmt.Fprintf(os.Stdout, "Response from `MarketDataAPI.ListMarkets`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiListMarketsRequest struct via the builder pattern

Return type

ListMarketsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListRecentExecutions

ListRecentExecutionsResponse ListRecentExecutions(ctx, market).Execute()

List Recent Executions

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/avianlabs/paxos-go"
)

func main() {
	market := "market_example" // string | Market of the executions.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.MarketDataAPI.ListRecentExecutions(context.Background(), market).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MarketDataAPI.ListRecentExecutions``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListRecentExecutions`: ListRecentExecutionsResponse
	fmt.Fprintf(os.Stdout, "Response from `MarketDataAPI.ListRecentExecutions`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
market string Market of the executions.

Other Parameters

Other parameters are passed through a pointer to a apiListRecentExecutionsRequest struct via the builder pattern

Name Type Description Notes

Return type

ListRecentExecutionsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]