Documentation
¶
Index ¶
- Variables
- func CheckReverseSwapScript(redeemScript, preimageHash []byte, claimKey *btcec.PrivateKey, ...) error
- func CheckSwapAddress(chainParams *chaincfg.Params, address string, redeemScript []byte, ...) error
- func CheckSwapScript(redeemScript, preimageHash []byte, refundKey *btcec.PrivateKey, ...) error
- func ConstructTransaction(outputs []OutputDetails, outputAddress btcutil.Address, satPerVbyte int64) (*wire.MsgTx, error)
- func NestedScriptHashAddress(chainParams *chaincfg.Params, redeemScript []byte) (string, error)
- func ScriptHashAddress(chainParams *chaincfg.Params, redeemScript []byte) (string, error)
- func SerializeTransaction(transaction *wire.MsgTx) (string, error)
- func WitnessScriptHashAddress(chainParams *chaincfg.Params, redeemScript []byte) (string, error)
- type Boltz
- func (boltz *Boltz) BroadcastTransaction(transactionHex string) (*BroadcastTransactionResponse, error)
- func (boltz *Boltz) CreateChannelCreation(request CreateChannelCreationRequest) (response *CreateSwapResponse, err error)
- func (boltz *Boltz) CreateReverseSwap(request CreateReverseSwapRequest) (*CreateReverseSwapResponse, error)
- func (boltz *Boltz) CreateSwap(request CreateSwapRequest) (*CreateSwapResponse, error)
- func (boltz *Boltz) GetFeeEstimation() (*map[string]uint64, error)
- func (boltz *Boltz) GetNodes() (*GetNodesResponse, error)
- func (boltz *Boltz) GetPairs() (*GetPairsResponse, error)
- func (boltz *Boltz) GetSwapTransaction(id string) (*GetSwapTransactionResponse, error)
- func (boltz *Boltz) GetVersion() (*GetVersionResponse, error)
- func (boltz *Boltz) Init(symbol string)
- func (boltz *Boltz) SetInvoice(request SetInvoiceRequest) (*SetInvoiceResponse, error)
- func (boltz *Boltz) StreamSwapStatus(id string, events chan *SwapStatusResponse, stopListening chan bool) error
- func (boltz *Boltz) SwapRates(request SwapRatesRequest) (*SwapRatesResponse, error)
- func (boltz *Boltz) SwapStatus(id string) (*SwapStatusResponse, error)
- type BroadcastTransactionRequest
- type BroadcastTransactionResponse
- type Channel
- type ChannelState
- type CreateChannelCreationRequest
- type CreateReverseSwapRequest
- type CreateReverseSwapResponse
- type CreateSwapRequest
- type CreateSwapResponse
- type GetNodesResponse
- type GetPairsResponse
- type GetSwapTransactionRequest
- type GetSwapTransactionResponse
- type GetVersionResponse
- type OutputDetails
- type OutputType
- type SetInvoiceRequest
- type SetInvoiceResponse
- type SwapRatesRequest
- type SwapRatesResponse
- type SwapStatusRequest
- type SwapStatusResponse
- type SwapUpdateEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var CompletedStatus = []string{ InvoiceSettled.String(), TransactionClaimed.String(), }
View Source
var FailedStatus = []string{ SwapExpired.String(), InvoiceFailedToPay.String(), TransactionFailed.String(), TransactionRefunded.String(), }
Functions ¶
func CheckReverseSwapScript ¶
func CheckReverseSwapScript(redeemScript, preimageHash []byte, claimKey *btcec.PrivateKey, timeoutBlockHeight uint32) error
func CheckSwapAddress ¶
func CheckSwapScript ¶
func CheckSwapScript(redeemScript, preimageHash []byte, refundKey *btcec.PrivateKey, timeoutBlockHeight uint32) error
func ConstructTransaction ¶
func NestedScriptHashAddress ¶
func ScriptHashAddress ¶
Types ¶
type Boltz ¶
type Boltz struct {
URL string `long:"boltz.url" description:"URL endpoint of the Boltz API"`
// contains filtered or unexported fields
}
func (*Boltz) BroadcastTransaction ¶
func (boltz *Boltz) BroadcastTransaction(transactionHex string) (*BroadcastTransactionResponse, error)
func (*Boltz) CreateChannelCreation ¶
func (boltz *Boltz) CreateChannelCreation(request CreateChannelCreationRequest) (response *CreateSwapResponse, err error)
func (*Boltz) CreateReverseSwap ¶
func (boltz *Boltz) CreateReverseSwap(request CreateReverseSwapRequest) (*CreateReverseSwapResponse, error)
func (*Boltz) CreateSwap ¶
func (boltz *Boltz) CreateSwap(request CreateSwapRequest) (*CreateSwapResponse, error)
func (*Boltz) GetNodes ¶
func (boltz *Boltz) GetNodes() (*GetNodesResponse, error)
func (*Boltz) GetPairs ¶
func (boltz *Boltz) GetPairs() (*GetPairsResponse, error)
func (*Boltz) GetSwapTransaction ¶
func (boltz *Boltz) GetSwapTransaction(id string) (*GetSwapTransactionResponse, error)
func (*Boltz) GetVersion ¶
func (boltz *Boltz) GetVersion() (*GetVersionResponse, error)
func (*Boltz) SetInvoice ¶
func (boltz *Boltz) SetInvoice(request SetInvoiceRequest) (*SetInvoiceResponse, error)
func (*Boltz) StreamSwapStatus ¶
func (boltz *Boltz) StreamSwapStatus(id string, events chan *SwapStatusResponse, stopListening chan bool) error
func (*Boltz) SwapRates ¶
func (boltz *Boltz) SwapRates(request SwapRatesRequest) (*SwapRatesResponse, error)
func (*Boltz) SwapStatus ¶
func (boltz *Boltz) SwapStatus(id string) (*SwapStatusResponse, error)
type ChannelState ¶
type ChannelState int
const ( ChannelNone ChannelState = iota ChannelAccepted ChannelSettled )
func ParseChannelState ¶
func ParseChannelState(event string) ChannelState
func (ChannelState) String ¶
func (event ChannelState) String() string
type CreateReverseSwapResponse ¶
type CreateReverseSwapResponse struct {
Id string `json:"id"`
Invoice string `json:"invoice"`
OnchainAmount uint64 `json:"onchainAmount"`
RedeemScript string `json:"redeemScript"`
LockupAddress string `json:"lockupAddress"`
TimeoutBlockHeight uint32 `json:"TimeoutBlockHeight"`
Error string `json:"error"`
}
type CreateSwapRequest ¶
type CreateSwapResponse ¶
type CreateSwapResponse struct {
Id string `json:"id"`
Bip21 string `json:"bip21"`
Address string `json:"address"`
RedeemScript string `json:"redeemScript"`
AcceptZeroConf bool `json:"acceptZeroConf"`
ExpectedAmount uint64 `json:"expectedAmount"`
TimeoutBlockHeight uint32 `json:"timeoutBlockHeight"`
Error string `json:"error"`
}
type GetNodesResponse ¶
type GetPairsResponse ¶
type GetPairsResponse struct {
Warnings []string `json:"warnings"`
Pairs map[string]struct {
Rate float32 `json:"rate"`
Limits struct {
Maximal uint64 `json:"maximal"`
Minimal uint64 `json:"minimal"`
} `json:"limits"`
Fees struct {
Percentage float32 `json:"percentage"`
MinerFees struct {
BaseAsset symbolMinerFees `json:"baseAsset"`
QuoteAsset symbolMinerFees `json:"quoteAsset"`
} `json:"minerFees"`
} `json:"fees"`
} `json:"pairs"`
}
type GetSwapTransactionRequest ¶
type GetSwapTransactionRequest struct {
Id string `json:"id"`
}
type GetVersionResponse ¶
type GetVersionResponse struct {
Version string `json:"version"`
}
Types for Boltz API
type OutputDetails ¶
type OutputDetails struct {
LockupTransaction *btcutil.Tx
Vout uint32
OutputType OutputType
RedeemScript []byte
PrivateKey *btcec.PrivateKey
// Should be set to an empty array in case of a refund
Preimage []byte
// Can be zero in case of a claim transaction
TimeoutBlockHeight uint32
}
type SetInvoiceRequest ¶
type SetInvoiceResponse ¶
type SetInvoiceResponse struct {
Error string `json:"error"`
}
type SwapRatesRequest ¶
type SwapRatesRequest struct {
Id string `json:"id"`
}
type SwapRatesResponse ¶
type SwapStatusRequest ¶
type SwapStatusRequest struct {
Id string `json:"id"`
}
type SwapStatusResponse ¶
type SwapStatusResponse struct {
Status string `json:"status"`
Channel struct {
FundingTransactionId string `json:"fundingTransactionId"`
FundingTransactionVout uint32 `json:"fundingTransactionVout"`
} `json:"channel"`
Transaction struct {
Id string `json:"id"`
Hex string `json:"hex"`
} `json:"transaction"`
Error string `json:"error"`
}
type SwapUpdateEvent ¶
type SwapUpdateEvent int
const ( SwapCreated SwapUpdateEvent = iota SwapExpired InvoiceSet InvoicePaid InvoicePending InvoiceSettled InvoiceFailedToPay ChannelCreated TransactionFailed TransactionMempool TransactionClaimed TransactionRefunded TransactionConfirmed )
func ParseEvent ¶
func ParseEvent(event string) SwapUpdateEvent
func (SwapUpdateEvent) IsCompletedStatus ¶ added in v1.2.3
func (event SwapUpdateEvent) IsCompletedStatus() bool
func (SwapUpdateEvent) IsFailedStatus ¶ added in v1.2.3
func (event SwapUpdateEvent) IsFailedStatus() bool
func (SwapUpdateEvent) String ¶
func (event SwapUpdateEvent) String() string
Click to show internal directories.
Click to hide internal directories.