alfacashier

package module
v0.0.0-...-9804234 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: MIT Imports: 7 Imported by: 0

README

alfacashier-api-go

Go Library for interacting with the ALFAcashier API.

Documentation

Index

Constants

View Source
const KeyAddress = "address"

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelResponse

type CancelResponse struct {
	WithError

	SecretKey string `json:"secret_key"`
	Canceled  bool   `json:"canceled"`
}

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURL string) (*Client, error)

func (*Client) Cancel

func (c *Client) Cancel(ctx context.Context, secretKey string) (*CancelResponse, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, data CreateRequest) (*CreateResponse, error)

func (*Client) GetCoins

func (c *Client) GetCoins(ctx context.Context) (*GetCoinsResponse, error)

func (*Client) Limit

func (c *Client) Limit(ctx context.Context, pair string) (*LimitResponse, error)

func (*Client) PromoCode

func (c *Client) PromoCode(ctx context.Context, data PromoCodeRequest) (*PromoCodeResponse, error)

func (*Client) Rate

func (c *Client) Rate(ctx context.Context, data RateRequest) (*RateResponse, error)

func (*Client) Status

func (c *Client) Status(ctx context.Context, secretKey string) (*StatusResponse, error)

func (*Client) ValidateAddress

func (c *Client) ValidateAddress(ctx context.Context, data ValidateAddressRequest) (*ValidateAddressResponse, error)

type Coin

type Coin struct {
	Currency            string `json:"currency"`
	Title               string `json:"title"`
	Deposit             bool   `json:"deposit"`
	Withdrawal          bool   `json:"withdrawal"`
	ExplorerTxLink      string `json:"explorer_tx_link"`
	ExplorerAddressLink string `json:"explorer_address_link"`
}

type CreateRequest

type CreateRequest struct {
	Pair             string            `json:"pair"`
	DepositAmount    float64           `json:"deposit_amount"`
	WithdrawalAmount float64           `json:"withdrawal_amount"`
	Email            string            `json:"email"`
	Options          map[string]string `json:"options"`
	RUID             string            `json:"r_uid,omitempty"`
	PromoCode        string            `json:"promo_code"`
}

type CreateResponse

type CreateResponse struct {
	WithError

	SecretKey        string            `json:"secret_key"`
	Deposit          map[string]string `json:"deposit"`
	DepositAmount    float64           `json:"deposit_amount"`
	WithdrawalAmount float64           `json:"withdrawal_amount"`
	OrderID          string            `json:"order_id"`
}

type GetCoinsResponse

type GetCoinsResponse map[string]Coin

type LimitResponse

type LimitResponse struct {
	WithError

	Pair                 string  `json:"pair"`
	DepositMin           float64 `json:"deposit_min"`
	DepositMax           float64 `json:"deposit_max"`
	WithdrawalMin        float64 `json:"withdrawal_min"`
	WithdrawalMax        float64 `json:"withdrawal_max"`
	DepositDayLimit      float64 `json:"deposit_day_limit"`
	DepositMonthLimit    float64 `json:"deposit_month_limit"`
	WithdrawalDayLimit   float64 `json:"withdrawal_day_limit"`
	WithdrawalMonthLimit float64 `json:"withdrawal_month_limit"`
}

type PromoCodeRequest

type PromoCodeRequest struct {
	Code string `json:"code"`
	Pair string `json:"pair"`
}

type PromoCodeResponse

type PromoCodeResponse struct {
	WithError

	Discount string `json:"discount"`
}

type RateRequest

type RateRequest struct {
	Pair              string  `json:"pair"`
	DepositAmount     float64 `json:"deposit_amount"`
	WithdrawalAmount  float64 `json:"withdrawal_amount"`
	PromoCodeDiscount float64 `json:"promo_code_discount"`
}

type RateResponse

type RateResponse struct {
	WithError

	Pair string `json:"pair"`
	Rate string `json:"rate"`
}

type StatusResponse

type StatusResponse struct {
	WithError

	SecretKey        string            `json:"secret_key"`
	Pair             string            `json:"pair"`
	Status           string            `json:"status"`
	Deposit          map[string]string `json:"deposit"`
	Withdrawal       map[string]string `json:"withdrawal"`
	ReceivingAmount  string            `json:"receiving_amount"`
	DepositAmount    string            `json:"deposit_amount"`
	WithdrawalAmount string            `json:"withdrawal_amount"`
	TimeCreated      string            `json:"time_created"`
	SecondsRemaining int               `json:"seconds_remaining"`
}

type ValidateAddressRequest

type ValidateAddressRequest struct {
	Currency string            `json:"currency"`
	Options  map[string]string `json:"options"`
}

type ValidateAddressResponse

type ValidateAddressResponse struct {
	WithError

	Valid bool `json:"valid"`
}

type WithError

type WithError struct {
	Error string `json:"error"`
}

Jump to

Keyboard shortcuts

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