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]int, 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{ SwapRefunded.String(), SwapAbandoned.String(), InvoiceSettled.String(), TransactionClaimed.String(), }
Functions ¶
func CheckReverseSwapScript ¶
func CheckReverseSwapScript(redeemScript, preimageHash []byte, claimKey *btcec.PrivateKey, timeoutBlockHeight int) error
func CheckSwapAddress ¶
func CheckSwapScript ¶
func CheckSwapScript(redeemScript, preimageHash []byte, refundKey *btcec.PrivateKey, timeoutBlockHeight int) 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 int `json:"onchainAmount"` RedeemScript string `json:"redeemScript"` LockupAddress string `json:"lockupAddress"` TimeoutBlockHeight int `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 int `json:"expectedAmount"` TimeoutBlockHeight int `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 int `json:"maximal"` Minimal int `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 int `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 // Client refunded transaction SwapRefunded // Client noticed the Swap expired but didn't find any output to refund SwapAbandoned )
func ParseEvent ¶
func ParseEvent(event string) SwapUpdateEvent
func (SwapUpdateEvent) String ¶
func (event SwapUpdateEvent) String() string
Click to show internal directories.
Click to hide internal directories.