apis

package
v0.0.0-...-a3dd10e Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	APPLICATION_SETTINGS = settings.GetSettings()
)

Functions

func GenerateBCHAddress

func GenerateBCHAddress(walletType string) (string, error)

func GenerateBCHMultisigAddress

func GenerateBCHMultisigAddress(buyerPublicKey, sellerPublicKey string) (string, string, string, error)

func GenerateBTCAddress

func GenerateBTCAddress(walletType string) (string, error)

func GenerateBTCMultisigAddress

func GenerateBTCMultisigAddress(buyerPublicKey, sellerPublicKey string) (string, string, string, error)

func GenerateETHAddress

func GenerateETHAddress(walletType string) (string, error)

func GetCurrencyRates

func GetCurrencyRates(baseCurrency string) (map[string]float64, error)

func PostMattermostEvent

func PostMattermostEvent(url, text string)

func PostMattermostRawEvent

func PostMattermostRawEvent(url string, ir MattermostEvent)

Types

type BCHPayment

type BCHPayment struct {
	Address string  `json:"address"`
	Percent float64 `json:"percent,omitempty"`
	Amount  float64 `json:"amount,omitempty"`
}

type BCHPaymentResult

type BCHPaymentResult struct {
	Fee            int           `json:"fee"`
	Description    string        `json:"description"`
	Hash           string        `json:"hash"`
	RawTransaction string        `json:"rawTransaction"`
	Outputs        []BCHTxOutput `json:"outputs"`
	Error          *string       `json:"error"`
}

func EstimateBCHFeeFromMultipleWalletsWithAmountSplit

func EstimateBCHFeeFromMultipleWalletsWithAmountSplit(
	addressFrom []string,
	btcPayments []BCHPayment,
) (BCHPaymentResult, error)

func SendBCHFromMultipleWalletsWithAmountSplit

func SendBCHFromMultipleWalletsWithAmountSplit(addressFrom []string, btcPayments []BCHPayment) (BCHPaymentResult, error)

func SendBCHFromSingleWalletWithPercentSplit

func SendBCHFromSingleWalletWithPercentSplit(addressFrom string, btcPayments []BCHPayment) (BCHPaymentResult, error)

type BCHTxOutput

type BCHTxOutput struct {
	PublicKey string `json:"address"`
	Satoshis  int    `json:"satoshis"`
}

type BCHWalletBalance

type BCHWalletBalance struct {
	Balance            float64 `json:"balance"`
	UnconfirmedBalance float64 `json:"unconfirmed_balance"`
}

func GetAmountOnBCHAddress

func GetAmountOnBCHAddress(address string) (BCHWalletBalance, error)

type BTCPayment

type BTCPayment struct {
	Address string  `json:"address"`
	Percent float64 `json:"percent,omitempty"`
	Amount  float64 `json:"amount,omitempty"`
	Fee     bool    `json:"fee,omitempty"`
}

type BTCPaymentResult

type BTCPaymentResult struct {
	Fee            int           `json:"fee"`
	Description    string        `json:"description"`
	Hash           string        `json:"hash"`
	RawTransaction string        `json:"rawTransaction"`
	Outputs        []BTCTxOutput `json:"outputs"`
	Error          *string       `json:"error"`
}

func EstimateBTCFeeFromMultipleWalletsWithAmountSplit

func EstimateBTCFeeFromMultipleWalletsWithAmountSplit(addressFrom []string, btcPayments []BTCPayment) (BTCPaymentResult, error)

func SendBCHToBTC

func SendBCHToBTC(bchAddress, btcAddress string) (BTCPaymentResult, error)

func SendBTCFromMultipleWalletsWithAmountSplit

func SendBTCFromMultipleWalletsWithAmountSplit(addressFrom []string, btcPayments []BTCPayment) (BTCPaymentResult, error)

func SendBTCFromSingleWalletWithPercentSplit

func SendBTCFromSingleWalletWithPercentSplit(addressFrom string, btcPayments []BTCPayment) (BTCPaymentResult, error)

type BTCTxOutput

type BTCTxOutput struct {
	PublicKey string `json:"address"`
	Satoshis  int    `json:"satoshis"`
}

type BTCWalletBalance

type BTCWalletBalance struct {
	Balance            float64 `json:"balance"`
	UnconfirmedBalance float64 `json:"unconfirmed_balance"`
}

func GetAmountOnBTCAddress

func GetAmountOnBTCAddress(address string) (BTCWalletBalance, error)

type ETHPayment

type ETHPayment struct {
	Address string  `json:"address"`
	Percent float64 `json:"percent,omitempty"`
	Amount  float64 `json:"amount,omitempty"`
}

type ETHPaymentResult

type ETHPaymentResult struct {
	Hash           string `json:"hash"`
	RawTx          string `json:"rawTransaction"`
	WalletFrom     string `json:"wallet_from"`
	WalletTo       string `json:"wallet_to"`
	Cost           int64  `json:"cost"`
	Amount         int64  `json:"amount"`
	Contract       string `json:"contract,omitempty"`
	ContractMethod string `json:"contract_method,omitempty"`
}

func SendETH

func SendETH(addressFrom string, btcPayments []ETHPayment) (ETHPaymentResult, error)

type ETHWalletBalance

type ETHWalletBalance struct {
	Balance float64 `json:"balance"`
}

func GetAmountOnETHAddress

func GetAmountOnETHAddress(address string) (ETHWalletBalance, error)

type MattermostEvent

type MattermostEvent struct {
	Text        string                      `json:"text"`
	Attachments []MattermostEventAttachment `json:"attachments,omitempty"`
	Short       bool
}

type MattermostEventAttachment

type MattermostEventAttachment struct {
	Fallback   string                 `json:"fallback"`
	Text       string                 `json:"text,omitempty""`
	Color      string                 `json:"color,omitempty"`
	AuthorName string                 `json:"author_name,omitempty"`
	AuthorLink string                 `json:"author_link,omitempty"`
	Pretext    string                 `json:"pretext,omitempty"`
	Fields     []MattermostEventField `json:"fields,omitempty"`
}

type MattermostEventField

type MattermostEventField struct {
	Title string `json:"title,omitempty"`
	Value string `json:"value,omitempty"`
	Short bool   `json:"short"`
}

Jump to

Keyboard shortcuts

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