coinpayments

package module
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 8 Imported by: 0

README

coinpayments

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIParams

type APIParams struct {
	Version string `url:"version"`
	Command string `url:"cmd"`
	Key     string `url:"key"`
	TxnID   string `url:"txid"`
}

type AccountInfo

type AccountInfo struct {
	Username   string `json:"username"`
	MerchantID string `json:"merchant_id"`
	Email      string `json:"email"`
	PublicName string `json:"public_name"`
	TimeJoined int64  `json:"time_joined"`
}

type AccountInfoResponse

type AccountInfoResponse struct {
	Error  string       `json:"error"`
	Result *AccountInfo `json:"result"`
}

type AccountInfoService

type AccountInfoService struct {
	ApiPublicKey string
	Params       APIParams
	// contains filtered or unexported fields
}

func (*AccountInfoService) Show

type Balance

type Balance struct {
	// Balance    uint64 `json:"balance,string"`
	BalanceF   string `json:"balancef"`
	CoinStatus string `json:"coin_status"`
	Status     string `json:"status"`
}

Balances struct for JSON Response `Balance` field is commented because the response has a mix of types for the field "balance" (satoshi)

func (*Balance) GetSatoshi

func (b *Balance) GetSatoshi() uint64

type BalanceBodyParams

type BalanceBodyParams struct {
	APIParams
	BalanceParams
}

type BalanceParams

type BalanceParams struct {
	All uint8 `url:"all"`
}

type BalanceResponse

type BalanceResponse struct {
	Error  string             `json:"error"`
	Result map[string]Balance `json:"result"`
}

type BalanceService

type BalanceService struct {
	ApiPublicKey string
	Params       BalanceBodyParams
	// contains filtered or unexported fields
}

func (*BalanceService) Show

func (s *BalanceService) Show(balanceParams *BalanceParams) (BalanceResponse, *http.Response, error)

type CallbackAddressBodyParams

type CallbackAddressBodyParams struct {
	APIParams
	CallbackAddressParams
}

type CallbackAddressParams

type CallbackAddressParams struct {
	Currency string `url:"currency"`
	IPNUrl   string `url:"ipn_url"`
}

type Client

type Client struct {
	AccountInfo      *AccountInfoService
	Rates            *RateService
	Balances         *BalanceService
	DepositAddresses *DepositAddressService
	Transactions     *TransactionService
	Withdrawals      *WithdrawalService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(publicKey string, privateKey string, httpClient *http.Client) *Client

type DepositAddress

type DepositAddress struct {
	Address string `json:"address"`
	PubKey  string `json:"pubkey"`
	DestTag string `json:"dest_tag"`
}

type DepositAddressBodyParams

type DepositAddressBodyParams struct {
	APIParams
	DepositAddressParams
}

type DepositAddressParams

type DepositAddressParams struct {
	Currency string `url:"currency"`
}

type DepositAddressResponse

type DepositAddressResponse struct {
	Error  string          `json:"error"`
	Result *DepositAddress `json:"result"`
}

type DepositAddressService

type DepositAddressService struct {
	ApiPublicKey string
	Params       DepositAddressBodyParams
	// contains filtered or unexported fields
}

func (*DepositAddressService) GetNewAddress

func (s *DepositAddressService) GetNewAddress(depositAddressParams *DepositAddressParams) (DepositAddressResponse,
	*http.Response,
	error)

func (*DepositAddressService) GetNewCallbackAddress

func (s *DepositAddressService) GetNewCallbackAddress(callbackAddressParams *CallbackAddressParams) (DepositAddressResponse, *http.Response, error)

type RateBodyParams

type RateBodyParams struct {
	APIParams
	RateParams
}

type RateInfo

type RateInfo struct {
	IsFiat         uint8    `json:"is_fiat"`
	RateBTC        string   `json:"rate_btc"`
	LastUpdate     string   `json:"last_update"`
	TransactionFee string   `json:"tx_fee"`
	Name           string   `json:"name"`
	Confirms       string   `json:"confirms"`
	CanConvert     uint8    `json:"can_convert"`
	Status         string   `json:"status"`
	Capabilities   []string `json:"capabilities"`
}

type RateParams

type RateParams struct {
	Short    uint8 `url:"short"`
	Accepted uint8 `url:"accepted"`
}

type RateResponse

type RateResponse struct {
	Error  string              `json:"error"`
	Result map[string]RateInfo `json:"result"`
}

type RateService

type RateService struct {
	ApiPublicKey string
	Params       RateBodyParams
	// contains filtered or unexported fields
}

func (*RateService) Show

func (s *RateService) Show(params *RateParams) (RateResponse, *http.Response, error)

type TransactionBodyParams

type TransactionBodyParams struct {
	APIParams
	TransactionParams
}

type TransactionFindBodyParams added in v1.0.3

type TransactionFindBodyParams struct {
	APIParams
}

type TransactionParams

type TransactionParams struct {
	Amount     float64 `url:"amount"`
	Currency1  string  `url:"currency1"`
	Currency2  string  `url:"currency2"`
	Address    string  `url:"address"`
	BuyerEmail string  `url:"buyer_email"`
	BuyerName  string  `url:"buyer_name"`
	ItemName   string  `url:"item_name"`
	ItemNumber string  `url:"item_number"`
	Invoice    string  `url:"invoice"`
	Custom     string  `url:"custom"`
	IPNUrl     string  `url:"ipn_url"`
}

type TransactionService

type TransactionService struct {
	ApiPublicKey string
	Params       TransactionBodyParams
	FindParams   TransactionFindBodyParams
	// contains filtered or unexported fields
}

func (*TransactionService) CreateTransaction added in v1.2.0

func (s *TransactionService) CreateTransaction(transactionParams *TransactionParams) (map[string]interface{}, *http.Response, error)

func (TransactionService) FindTransaction

func (s TransactionService) FindTransaction(txnID string) (map[string]interface{}, *http.Response, error)

type Withdrawal added in v1.2.0

type Withdrawal struct {
	ID     string `json:"id"`
	Status int    `json:"status"`
	Amount string `json:"amount"`
}

type WithdrawalBodyParams added in v1.2.0

type WithdrawalBodyParams struct {
	APIParams
	WithdrawalParams
}

type WithdrawalFind added in v1.2.0

type WithdrawalFind struct {
	Amount     string `json:"amountf"`
	Address    string `json:"payment_address"`
	Coin       string `json:"coin"`
	Status     int    `json:"status"`
	StatusText string `json:"status_text"`
	Note       string `json:"note"`
}

type WithdrawalFindBodyParams added in v1.2.0

type WithdrawalFindBodyParams struct {
	APIParams
}

type WithdrawalFindResponse added in v1.2.0

type WithdrawalFindResponse struct {
	Error  string          `json:"error"`
	Result *WithdrawalFind `json:"result"`
}

type WithdrawalParams added in v1.2.0

type WithdrawalParams struct {
	Amount      float64 `url:"amount"`
	AddTXFree   int     `url:"add_tx_free"`
	Currency    string  `url:"currency"`
	Currency2   string  `url:"currency2"`
	Address     string  `url:"address"`
	IPNUrl      string  `url:"ipn_url"`
	AutoConfirm int     `url:"auto_confirm"`
	Note        string  `url:"note"`
}

type WithdrawalResponse added in v1.2.0

type WithdrawalResponse struct {
	Error  string      `json:"error"`
	Result *Withdrawal `json:"result"`
}

type WithdrawalService added in v1.2.0

type WithdrawalService struct {
	ApiPublicKey string
	Params       WithdrawalBodyParams
	FindParams   WithdrawalFindBodyParams
	// contains filtered or unexported fields
}

func (*WithdrawalService) CreateWithdrawal added in v1.2.0

func (s *WithdrawalService) CreateWithdrawal(transactionParams *WithdrawalParams) (WithdrawalResponse, *http.Response, error)

func (WithdrawalService) FindWithdrawal added in v1.2.0

func (s WithdrawalService) FindWithdrawal(txnID string) (WithdrawalFindResponse, *http.Response, error)

Jump to

Keyboard shortcuts

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