dispendiumapi

package
v0.0.0-...-5da754f Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceResponse

type BalanceResponse struct {
	*http.Response
	Success bool            `json:"success"`
	Error   *string         `json:"error"`
	Data    []BalanceResult `json:"data"`
	Trace   []string        `json:"_trace,omitempty"`
}

BalanceResponse response from the api call. It includes the http response plus the result

type BalanceResult

type BalanceResult struct {
	Name    string  `json:"name"`
	LBC     float64 `json:"lbc"`
	Satoshi uint64  `json:"satoshi"`
}

BalanceResult result from the api call to send funds

type Client

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

Client dispendium client for making calls to dispendium api

func NewClient

func NewClient(url, token string) *Client

NewClient creates a new dispendium client

func (Client) Balance

func (c Client) Balance() (*BalanceResponse, error)

Balance sends funds to an address

func (Client) SendFunds

func (c Client) SendFunds(args SendFundsArgs) (*SendFundsResponse, error)

SendFunds sends funds to an address

type SendFundsArgs

type SendFundsArgs struct {
	WalletAddress string
	Amount        btcutil.Amount
}

SendFundsArgs Arguments for sending funds via dispendium

type SendFundsResponse

type SendFundsResponse struct {
	*http.Response
	Success bool        `json:"success"`
	Error   *string     `json:"error"`
	Data    *SendResult `json:"data"`
	Trace   []string    `json:"_trace,omitempty"`
}

SendFundsResponse response from the api call. It includes the http response plus the result

type SendResult

type SendResult struct {
	LBCAmount     float64 `json:"lbc_amount"`
	SatoshiAmount uint64  `json:"satoshi_amount"`
	TxHash        string  `json:"tx_id"`
}

SendResult result from the api call to send funds

Jump to

Keyboard shortcuts

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