rest

package
v0.0.0-...-2649ce0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrRateLimited = "bybit: rate limited, should wait %d ms"
)

Constants used to define errors.

View Source
const (
	Url = "https://api.bybit.com"
)

Variables

This section is empty.

Functions

func GetOrderedParameters

func GetOrderedParameters(params map[string]interface{}) string

GetOrderedParameters is used to build a string with the passed parameters ordered alphabetically.

Types

type Client

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

Client represents the REST API Client for FTX.

func NewClient

func NewClient(cfg *config.Configuration) (*Client, error)

NewClient returns a new rest client for ftx

func (*Client) Get

func (c *Client) Get(endpoint string, params map[string]interface{}) ([]byte, error)

Get fetches the information.

This method is only implemented in every exchange in case some specific action must be taken before processing the request, which generally it does, due to authentication, etc.

func (*Client) Post

func (c *Client) Post(endpoint string, data map[string]interface{}) ([]byte, error)

Post submits information.

This method is only implemented in every exchange in case some specific action must be taken before processing the request, which generally it does, due to authentication, etc.

func (*Client) PrepareRequest

func (c *Client) PrepareRequest(method, endpoint, endpointUrl string, extraParams map[string]interface{}) error

PrepareRequest is used to prepare the request with the necessary information, including authentication info

func (*Client) PrepareSignedRequest

func (c *Client) PrepareSignedRequest(method, endpoint, endpointUrl string, extraParams map[string]interface{}) error

PrepareSignedRequest is used to fill the authentication data needed for authentication.

func (*Client) Sign

func (c *Client) Sign(payload string) (string, error)

Sign is used to sign the payload for authentication.

type SignatureFunc

type SignatureFunc func(method string, path string, body []byte) *http.Request

SignatureFunc is the

Jump to

Keyboard shortcuts

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