coinpayments

package module
v0.0.0-...-1b789fc Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Unlicense Imports: 9 Imported by: 0

README

coinpayments PkgGoDev Go Report Card

This package is a coinpayments.net client library. See official documentation here

Installation

go get -u github.com/aidenesco/coinpayments

Usage

import "github.com/aidenesco/coinpayments"

client := coinpayments.NewClient("public key", "private key")

balances, _ := client.Balances()

fmt.Println(balances)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client allows programmatic access to the coinpayments api

func NewClient

func NewClient(publicKey, privateKey string, options ...ClientOption) *Client

NewClient returns a new Client with the applied options

func (*Client) Balances

func (c *Client) Balances(optionals ...OptionalValue) (*balancesResponse, error)

Balances calls the "balances" command

func (*Client) BuyPBNTags

func (c *Client) BuyPBNTags(coin string, optionals ...OptionalValue) (*buyPBNTagsResponse, error)

BuyPBNTags calls the "buy_pbn_tags" command

func (*Client) CancelWithdrawal

func (c *Client) CancelWithdrawal(id string, optionals ...OptionalValue) (*cancelWithdrawalResponse, error)

CancelWithdrawal calls the "create_withdrawal" command

func (*Client) ClaimPBNCoupon

func (c *Client) ClaimPBNCoupon(coupon string, optionals ...OptionalValue) (*claimPBNCouponResponse, error)

ClaimPBNCoupon calls the "claim_pbn_coupon" command

func (*Client) ClaimPBNTag

func (c *Client) ClaimPBNTag(tagid, name string, optionals ...OptionalValue) (*claimPBNTagResponse, error)

ClaimPBNTag calls the "claim_pbn_tag" command

func (*Client) Convert

func (c *Client) Convert(amount, from, to string, optionals ...OptionalValue) (*convertResponse, error)

Convert calls the "convert" command

func (*Client) ConvertLimits

func (c *Client) ConvertLimits(from, to string, optionals ...OptionalValue) (*convertLimitsResponse, error)

ConvertLimits calls the "convert_limits" command

func (*Client) CreateTransaction

func (c *Client) CreateTransaction(amount, currency1, currency2, buyerEmail string, optionals ...OptionalValue) (*createTransactionResponse, error)

CreateTransaction calls the "create_transaction" command

func (*Client) CreateTransfer

func (c *Client) CreateTransfer(amount, currency string, optionals ...OptionalValue) (*createTransferResponse, error)

CreateTransfer calls the "create_transfer" command

func (*Client) CreateWithdrawal

func (c *Client) CreateWithdrawal(amount, currency string, optionals ...OptionalValue) (*createWithdrawalResponse, error)

CreateWithdrawal calls the "create_withdrawal" command

func (*Client) DeletePBNTag

func (c *Client) DeletePBNTag(tagid string, optionals ...OptionalValue) (*deletePBNTagResponse, error)

DeletePBNTag calls the "delete_pbn_tag" command

func (*Client) GetBasicInfo

func (c *Client) GetBasicInfo(optionals ...OptionalValue) (*getBasicInfoResponse, error)

GetBasicInfo calls the "get_basic_info" command

func (*Client) GetCallbackAddress

func (c *Client) GetCallbackAddress(currency string, optionals ...OptionalValue) (*getCallbackAddressResponse, error)

GetCallbackAddress calls the "get_callback_address" command

func (*Client) GetConversionInfo

func (c *Client) GetConversionInfo(id string, optionals ...OptionalValue) (*getConversionInfoResponse, error)

GetConversionInfo calls the "get_conversion_info" command

func (*Client) GetDepositAddress

func (c *Client) GetDepositAddress(currency string, optionals ...OptionalValue) (*getDepositAddressResponse, error)

GetDepositAddress calls the "get_deposit_address" command

func (*Client) GetPBNInfo

func (c *Client) GetPBNInfo(pbntag string, optionals ...OptionalValue) (*getPBNInfoResponse, error)

GetPBNInfo calls the "get_pbn_info" command

func (*Client) GetPBNList

func (c *Client) GetPBNList(optionals ...OptionalValue) (*getPBNListResponse, error)

GetPBNList calls the "get_pbn_list" command

func (*Client) GetTxIds

func (c *Client) GetTxIds(optionals ...OptionalValue) (*getTxIdsResponse, error)

GetTxIds calls the "get_tx_ids" command

func (*Client) GetTxInfo

func (c *Client) GetTxInfo(txid string, optionals ...OptionalValue) (*getTxInfoResponse, error)

GetTxInfo calls the "get_tx_info" command

func (*Client) GetTxInfoMulti

func (c *Client) GetTxInfoMulti(txid string, optionals ...OptionalValue) (*getTxInfoMultiResponse, error)

GetTxInfoMulti calls the "get_tx_info_multi" command

func (*Client) GetWithdrawalHistory

func (c *Client) GetWithdrawalHistory(optionals ...OptionalValue) (*getWithdrawalHistoryResponse, error)

GetWithdrawalHistory calls the "get_withdrawal_history" command

func (*Client) GetWithdrawalInfo

func (c *Client) GetWithdrawalInfo(id string, optionals ...OptionalValue) (*getWithdrawalInfoResponse, error)

GetWithdrawalInfo calls the "get_withdrawal_info" command

func (*Client) ParseIPN

func (c *Client) ParseIPN(r *http.Request) (*IPN, error)

ParseIPN takes a http request and parses the IPN information from it

func (*Client) Rates

func (c *Client) Rates(optionals ...OptionalValue) (*ratesResponse, error)

Rates calls the "rates" command

func (*Client) RenewPBNTag

func (c *Client) RenewPBNTag(tagid, coin string, optionals ...OptionalValue) (*renewPBNTagResponse, error)

RenewPBNTag calls the "renew_pbn_tag" command

func (*Client) UpdatePBNTag

func (c *Client) UpdatePBNTag(tagid string, optionals ...OptionalValue) (*updatePBNTagResponse, error)

UpdatePBNTag calls the "update_pbn_tag" command

type ClientOption

type ClientOption func(client *Client)

ClientOption is an option used to modify a client

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

WithHTTPClient is an option that makes the Client use the provided http client

func WithIPNSecret

func WithIPNSecret(secret string) ClientOption

WithIPNSecret is an option that makes the Client use the provided secret

type IPN

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

IPN holds the data and type from an IPN

func (*IPN) ToApiIPN

func (i *IPN) ToApiIPN() (*apiIPN, error)

ToApiIPN returns the data from the "api" ipn type

func (*IPN) ToButtonIPN

func (i *IPN) ToButtonIPN() (*buttonIPN, error)

ToButtonIPN returns the data from the "button" ipn type

func (*IPN) ToCartIPN

func (i *IPN) ToCartIPN() (*cartIPN, error)

ToCartIPN returns the data from the "cart" ipn type

func (*IPN) ToDepositIPN

func (i *IPN) ToDepositIPN() (*depositIPN, error)

ToDepositIPN returns the data from the "deposit" ipn type

func (*IPN) ToDonationIPN

func (i *IPN) ToDonationIPN() (*donationIPN, error)

ToDonationIPN returns the data from the "donation" ipn type

func (*IPN) ToSimpleIPN

func (i *IPN) ToSimpleIPN() (*simpleIPN, error)

ToSimpleIPN returns the data from the "simple" ipn type

func (*IPN) ToWithdrawalIPN

func (i *IPN) ToWithdrawalIPN() (*withdrawalIPN, error)

ToWithdrawalIPN returns the data from the "withdrawal" ipn type

type OptionalValue

type OptionalValue func(values *url.Values)

OptionalValue is an option used to add values to an api request

func WithOptionalValue

func WithOptionalValue(key, value string) OptionalValue

WithOptionalValue is an option that adds values to an api request

Jump to

Keyboard shortcuts

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