ftx

package
v0.0.0-...-a129c9c Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const URL = "https://ftx.com/api/"

Variables

This section is empty.

Functions

This section is empty.

Types

type FtxClient

type FtxClient struct {
	Client     *http.Client
	Api        string
	Secret     []byte
	Subaccount string
}

func New

func New(api string, secret string, subaccount string) *FtxClient

func (*FtxClient) CancelAllOrders

func (client *FtxClient) CancelAllOrders() (Response, error)

func (*FtxClient) CancelOrder

func (client *FtxClient) CancelOrder(orderId int64) (Response, error)

func (*FtxClient) CancelTriggerOrder

func (client *FtxClient) CancelTriggerOrder(orderId int64) (Response, error)

func (*FtxClient) ChangeSubaccountName

func (client *FtxClient) ChangeSubaccountName(nickname string, newNickname string) (Response, error)

func (*FtxClient) CreateSubaccount

func (client *FtxClient) CreateSubaccount(nickname string) (Subaccount, error)

func (*FtxClient) DeleteSubaccount

func (client *FtxClient) DeleteSubaccount(nickname string) (Response, error)

func (*FtxClient) GetHistoricalPriceLatest

func (client *FtxClient) GetHistoricalPriceLatest(
	market string,
	resolution int64,
	limit int64,
) (HistoricalPrices, error)

Name Type Value Description market_name string BTC-0628 name of the market resolution number 300 window length in seconds. options: 15, 60, 300, 900, 3600, 14400, 86400, or any multiple of 86400 up to 30*86400 start_time number 1559881511 optional end_time number 1559881711 optional

func (*FtxClient) GetHistoricalPrices

func (client *FtxClient) GetHistoricalPrices(market string, resolutionSeconds int64,
	limit int64, startTime int64, endTime int64) (HistoricalPrices, error)

func (*FtxClient) GetOpenOrders

func (client *FtxClient) GetOpenOrders(market string) (OpenOrders, error)

func (*FtxClient) GetOpenTriggerOrders

func (client *FtxClient) GetOpenTriggerOrders(market string) (OpenTriggerOrders, error)

func (*FtxClient) GetOpenTriggerOrdersOriginal

func (client *FtxClient) GetOpenTriggerOrdersOriginal(market string, _type string) (OpenTriggerOrders, error)

func (*FtxClient) GetOrderHistory

func (client *FtxClient) GetOrderHistory(market string, startTime float64, endTime float64, limit int64) (OrderHistory, error)

func (*FtxClient) GetPositions

func (client *FtxClient) GetPositions(showAvgPrice bool) (Positions, error)

func (*FtxClient) GetSubaccountBalances

func (client *FtxClient) GetSubaccountBalances(nickname string) (SubaccountBalances, error)

func (*FtxClient) GetSubaccounts

func (client *FtxClient) GetSubaccounts() (SubaccountsList, error)

func (*FtxClient) GetTrades

func (client *FtxClient) GetTrades(market string, limit int64, startTime int64, endTime int64) (Trades, error)

func (*FtxClient) GetTriggerOrdersHistory

func (client *FtxClient) GetTriggerOrdersHistory(market string, startTime float64, endTime float64, limit int64) (TriggerOrderHistory, error)

func (*FtxClient) GetTriggers

func (client *FtxClient) GetTriggers(orderId string) (Triggers, error)

func (*FtxClient) ModifyTriggerOrder

func (client *FtxClient) ModifyTriggerOrder(orderId int64, size float64, triggerPrice float64) (NewTriggerOrderResponse, error)

func (*FtxClient) PlaceMarketOrder

func (client *FtxClient) PlaceMarketOrder(market string, side string,
	_type string, size float64) (NewOrderResponse, error)

func (*FtxClient) PlaceOrder

func (client *FtxClient) PlaceOrder(market string, side string, price float64,
	_type string, size float64, reduceOnly bool, ioc bool, postOnly bool) (NewOrderResponse, error)

func (*FtxClient) PlaceTriggerOrder

func (client *FtxClient) PlaceTriggerOrder(market string, side string, size float64,
	_type string, reduceOnly bool, retryUntilFilled bool, triggerPrice float64,
	orderPrice float64, trailValue float64) (NewTriggerOrderResponse, error)

func (*FtxClient) TransferSubaccounts

func (client *FtxClient) TransferSubaccounts(coin string, size float64, source string, destination string) (TransferSubaccounts, error)

type HistoricalPrices

type HistoricalPrices structs.HistoricalPrices

type ModifyTriggerOrder

type ModifyTriggerOrder structs.ModifyTriggerOrder

type NewOrder

type NewOrder structs.NewOrder

type NewOrderResponse

type NewOrderResponse structs.NewOrderResponse

type NewTriggerOrder

type NewTriggerOrder structs.NewTriggerOrder

type NewTriggerOrderResponse

type NewTriggerOrderResponse structs.NewTriggerOrderResponse

type OpenOrders

type OpenOrders structs.OpenOrders

type OpenTriggerOrders

type OpenTriggerOrders structs.OpenTriggerOrders

type OrderHistory

type OrderHistory structs.OrderHistory

type Positions

type Positions structs.Positions

type Response

type Response structs.Response

type Subaccount

type Subaccount structs.Subaccount

type SubaccountBalances

type SubaccountBalances structs.SubaccountBalances

type SubaccountsList

type SubaccountsList structs.SubaccountsList

type Trades

type Trades structs.Trades

type TransferSubaccounts

type TransferSubaccounts structs.TransferSubaccounts

type TriggerOrderHistory

type TriggerOrderHistory structs.TriggerOrderHistory

type Triggers

type Triggers structs.Triggers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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