stealthex

package module
v0.0.0-...-6b06338 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 10 Imported by: 0

README

go-stealthex

StealthEX.io API library in Golang

Documentation

Index

Constants

View Source
const (
	API_BASE = "https://api.stealthex.io/api/v2" // StealthEX API endpoint
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(apiKey string) (c *client)

NewClient return a new StealthEX HTTP client

func NewClientWithCustomHttpConfig

func NewClientWithCustomHttpConfig(apiKey string, httpClient *http.Client) (c *client)

NewClientWithCustomHttpConfig returns a new StealthEX HTTP client using the predefined http client

func NewClientWithCustomTimeout

func NewClientWithCustomTimeout(apiKey string, timeout time.Duration) (c *client)

NewClient returns a new StealthEX HTTP client with custom timeout

Types

type StealthEX

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

StealthEX represent a StealthEX client

func New

func New(apiKey string) *StealthEX

New returns an instantiated StealthEX struct

func NewWithCustomHttpClient

func NewWithCustomHttpClient(apiKey string, httpClient *http.Client) *StealthEX

NewWithCustomHttpClient returns an instantiated StealthEX struct with custom http client

func NewWithCustomTimeout

func NewWithCustomTimeout(apiKey string, timeout time.Duration) *StealthEX

NewWithCustomTimeout returns an instantiated StealthEX struct with custom timeout

func (*StealthEX) GetTrade

func (b *StealthEX) GetTrade(id string) (trade Trade, err error)

GetTrade is used to get a trade at StealthEX along with other meta data.

func (*StealthEX) SetDebug

func (b *StealthEX) SetDebug(enable bool)

SetDebug sets enable/disable http request/response dump

type Trade

type Trade struct {
	Id             string    `json:"id"`
	Type           string    `json:"type"`
	Timestamp      time.Time `json:"timestamp"`
	CurrencyFrom   string    `json:"currency_from"`
	CurrencyTo     string    `json:"currency_to"`
	AmountFrom     float64   `json:"amount_from,string"`
	ExpectedAmount float64   `json:"expected_amount,string"`
	AmountTo       float64   `json:"amount_to,string"`
	AddressFrom    string    `json:"address_from"`
	AddressTo      string    `json:"address_to"`
	ExtraIdFrom    string    `json:"extra_id_from"`
	ExtraIdTo      string    `json:"extra_id_to"`
	TxFrom         string    `json:"tx_from"`
	TxTo           string    `json:"tx_to"`
	Status         string    `json:"status"`
	RefundAddress  string    `json:"refund_address"`
	RefundExtraId  string    `json:"refund_extra_id"`
}

func (*Trade) UnmarshalJSON

func (t *Trade) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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