Documentation ¶
Index ¶
- Constants
- Variables
- func BlocksToHours(blockDelta uint32, currency Currency) float64
- func CalculateInvoiceExpiry(blockDelta uint32, currency Currency) int64
- func CheckAmounts(swapType SwapType, pair Pair, sendAmount uint64, receiveAmount uint64, ...) error
- func ConstructTransaction(network *Network, currency Currency, outputs []OutputDetails, ...) (Transaction, Results, error)
- func FindMagicRoutingHint(invoice *zpay32.Invoice) *btcec.PublicKey
- func FindPair[T any](pair Pair, nested map[Currency]map[Currency]T) (*T, error)
- func GetBlockTime(currency Currency) float64
- func StripQuotes(text []byte) string
- func ValidateAddress(network *Network, rawAddress string, currency Currency) error
- type Api
- func (boltz *Api) AcceptChainSwapQuote(swapId string, quote *Quote) error
- func (boltz *Api) BroadcastTransaction(currency Currency, txHex string) (string, error)
- func (boltz *Api) ClaimReverseSwap(swapId string, request *ClaimRequest) (*PartialSignature, error)
- func (boltz *Api) CreateChainSwap(request ChainRequest) (*ChainResponse, error)
- func (boltz *Api) CreateReverseSwap(request CreateReverseSwapRequest) (*CreateReverseSwapResponse, error)
- func (boltz *Api) CreateSwap(request CreateSwapRequest) (*CreateSwapResponse, error)
- func (boltz *Api) ExchangeChainSwapClaimSignature(swapId string, request *ChainSwapSigningRequest) (*PartialSignature, error)
- func (boltz *Api) FetchBolt12Invoice(offer string, amountSat uint64) (string, error)
- func (boltz *Api) GetChainPairs() (response ChainPairs, err error)
- func (boltz *Api) GetChainSwapClaimDetails(swapId string) (*ChainSwapSigningDetails, error)
- func (boltz *Api) GetChainSwapQuote(swapId string) (*Quote, error)
- func (boltz *Api) GetChainSwapTransactions(id string) (*GetChainSwapTransactionsResponse, error)
- func (boltz *Api) GetFeeEstimation(currency Currency) (float64, error)
- func (boltz *Api) GetInvoiceAmount(swapId string) (*GetInvoiceAmountResponse, error)
- func (boltz *Api) GetNodes() (Nodes, error)
- func (boltz *Api) GetPairs() (*GetPairsResponse, error)
- func (boltz *Api) GetReversePairs() (response ReversePairs, err error)
- func (boltz *Api) GetReverseSwapBip21(invoice string) (*ReverseBip21, error)
- func (boltz *Api) GetSubmarinePairs() (response SubmarinePairs, err error)
- func (boltz *Api) GetSwapClaimDetails(swapId string) (*SwapClaimDetails, error)
- func (boltz *Api) GetSwapTransaction(id string) (*GetSwapTransactionResponse, error)
- func (boltz *Api) GetTransaction(transactionId string, currency Currency) (string, error)
- func (boltz *Api) GetVersion() (*GetVersionResponse, error)
- func (boltz *Api) NewWebsocket() *Websocket
- func (boltz *Api) RefundChainSwap(swapId string, request *RefundRequest) (*PartialSignature, error)
- func (boltz *Api) RefundSwap(swapId string, request *RefundRequest) (*PartialSignature, error)
- func (boltz *Api) SendSwapClaimSignature(swapId string, signature *PartialSignature) error
- func (boltz *Api) SetInvoice(swapId string, invoice string) (*SetInvoiceResponse, error)
- func (boltz *Api) SwapStatus(id string) (*SwapStatusResponse, error)
- type BroadcastTransactionRequest
- type BroadcastTransactionResponse
- type BtcTransaction
- func (transaction *BtcTransaction) FindVout(network *Network, addressToFind string) (uint32, uint64, error)
- func (transaction *BtcTransaction) Hash() string
- func (transaction *BtcTransaction) Serialize() (string, error)
- func (transaction *BtcTransaction) VSize() uint64
- func (transaction *BtcTransaction) VoutValue(vout uint32) (uint64, error)
- type ChainPair
- type ChainPairs
- type ChainRequest
- type ChainResponse
- type ChainSwapData
- type ChainSwapSigningDetails
- type ChainSwapSigningRequest
- type ChainSwapTransaction
- type ChannelState
- type ClaimRequest
- type CreateReverseSwapRequest
- type CreateReverseSwapResponse
- type CreateSwapRequest
- type CreateSwapResponse
- type Currency
- type Error
- type ErrorMessage
- type FeeEstimations
- type GetChainSwapTransactionsResponse
- type GetInvoiceAmountResponse
- type GetPairsResponse
- type GetSwapTransactionRequest
- type GetSwapTransactionResponse
- type GetTransactionRequest
- type GetTransactionResponse
- type GetVersionResponse
- type HexString
- type LiquidTransaction
- func (transaction *LiquidTransaction) FindVout(network *Network, addressToFind string) (uint32, uint64, error)
- func (transaction *LiquidTransaction) Hash() string
- func (transaction *LiquidTransaction) Serialize() (string, error)
- func (transaction *LiquidTransaction) VSize() uint64
- func (transaction *LiquidTransaction) VoutValue(vout uint32) (uint64, error)
- type MusigSession
- type Network
- type NodeInfo
- type Nodes
- type OutputDetails
- type OutputResult
- type Pair
- type PartialSignature
- type Percentage
- type Quote
- type RefundRequest
- type ResponseError
- type Results
- type ReverseBip21
- type ReversePair
- type ReversePairs
- type SerializedLeaf
- type SerializedTree
- type SetInvoiceRequest
- type SetInvoiceResponse
- type SubmarinePair
- type SubmarinePairs
- type SwapClaimDetails
- type SwapStatusResponse
- type SwapTree
- func (tree *SwapTree) Address(network *Network, blindingPubKey *btcec.PublicKey) (string, error)
- func (tree *SwapTree) Check(swapType SwapType, timeoutBlockHeight uint32, preimageHash []byte) error
- func (tree *SwapTree) CheckAddress(expected string, network *Network, blindingPubKey *btcec.PublicKey) error
- func (tree *SwapTree) GetControlBlock(isRefund bool) ([]byte, error)
- func (tree *SwapTree) GetLeaf(isRefund bool) TapLeaf
- func (tree *SwapTree) GetLeafHash(isRefund bool) chainhash.Hash
- func (tree *SwapTree) Init(isLiquid bool, isClaim bool, ourKey *btcec.PrivateKey, ...) error
- func (tree *SwapTree) PubKey() *btcec.PublicKey
- func (tree *SwapTree) Serialize() *SerializedTree
- type SwapType
- type SwapUpdate
- type SwapUpdateEvent
- type TapLeaf
- type Transaction
- type TxSizes
- type Websocket
Constants ¶
View Source
const AbsoluteFeeToleranceSat = 1500
View Source
const BitcoinBlockTime = float64(10)
Block times in minutes
View Source
const LiquidBlockTime = float64(1)
View Source
const RelativeFeeTolerance = Percentage(25)
Variables ¶
View Source
var BtcSizes = TxSizes{}
View Source
var CompletedStatus = []string{ InvoiceSettled.String(), TransactionClaimed.String(), }
View Source
var ErrInvalidOnchainFee = errors.New("onchain fee way above expectation")
View Source
var ErrPartialSignaturesDisabled = errors.New("partial signatures are disabled")
View Source
var FailedStatus = []string{ SwapExpired.String(), InvoiceFailedToPay.String(), TransactionFailed.String(), TransactionLockupFailed.String(), TransactionRefunded.String(), }
View Source
var LiquidSizes = TxSizes{}
View Source
var MainNet = &Network{ Btc: &btc.MainNetParams, Liquid: &liquid.Liquid, Name: "mainnet", DummyLockupAddress: map[Currency]string{ CurrencyBtc: "bc1p28f027j7nte0pprte30nz4qxx65uc3rur23pukjganmzfwejj5lqjq5lky", CurrencyLiquid: "lq1pqtfldcsfag6u5lv20f85zjp68x99er90jxlqv3yc3ucy9zd3tt0ndztxkr9jaxynl8l4hvsfch7slg7l52pfw49te3wrhwazr9lq9s6y2cgwtpn9wv7z", }, }
View Source
var (
PairBtc = Pair{From: CurrencyBtc, To: CurrencyBtc}
)
View Source
var Regtest = &Network{ Btc: &btc.RegressionNetParams, Liquid: &liquid.Regtest, Name: "regtest", DummyLockupAddress: map[Currency]string{ CurrencyBtc: "bcrt1pedm5v4z658f3ad4gyxmnren7gdnnqhm6pdtgheksfvm8f4k74uas7tz83f", CurrencyLiquid: "el1pqfg7mxz4cnpu8sj2pza285vh062eq0sxwt982nprnx0d975tvmzpdcqdwvpsds5q664fp90645wlze8544j8x59vzhhy6hylmad6ycjw07nsa6thmkz7", }, }
View Source
var Sizes = map[Currency]TxSizes{
CurrencyBtc: {
NormalClaim: 151,
ReverseLockup: 154,
ReverseClaim: 111,
},
CurrencyLiquid: {
NormalClaim: 1337,
ReverseLockup: 2503,
ReverseClaim: 1309,
},
}
View Source
var TestNet = &Network{ Btc: &btc.TestNet3Params, Liquid: &liquid.Testnet, Name: "testnet", DummyLockupAddress: map[Currency]string{ CurrencyBtc: "tb1p5a2rc0hcuf8n2rssmfr9mqk08nlxzl9ngnlhj47gwegj7epjph5q9739y6", CurrencyLiquid: "tlq1pqghwg6s98dfhtrncxck6rl359eckxdwrk4680npy4m6q2lgud9y6p0w2jytj4akr2zhwze587d823zu5rg8vwfq0ehkk8c74lrvt77kmwqr5vwy7p47u", }, }
Functions ¶
func BlocksToHours ¶
func CalculateInvoiceExpiry ¶
func CheckAmounts ¶
func CheckAmounts(swapType SwapType, pair Pair, sendAmount uint64, receiveAmount uint64, serviceFee Percentage, estimations FeeEstimations, includeClaim bool) error
func ConstructTransaction ¶
func ConstructTransaction(network *Network, currency Currency, outputs []OutputDetails, satPerVbyte float64, boltzApi *Api) (Transaction, Results, error)
func FindMagicRoutingHint ¶
func GetBlockTime ¶
func StripQuotes ¶
Types ¶
type Api ¶
func (*Api) AcceptChainSwapQuote ¶
func (*Api) BroadcastTransaction ¶
func (*Api) ClaimReverseSwap ¶
func (boltz *Api) ClaimReverseSwap(swapId string, request *ClaimRequest) (*PartialSignature, error)
func (*Api) CreateChainSwap ¶
func (boltz *Api) CreateChainSwap(request ChainRequest) (*ChainResponse, error)
func (*Api) CreateReverseSwap ¶
func (boltz *Api) CreateReverseSwap(request CreateReverseSwapRequest) (*CreateReverseSwapResponse, error)
func (*Api) CreateSwap ¶
func (boltz *Api) CreateSwap(request CreateSwapRequest) (*CreateSwapResponse, error)
func (*Api) ExchangeChainSwapClaimSignature ¶
func (boltz *Api) ExchangeChainSwapClaimSignature(swapId string, request *ChainSwapSigningRequest) (*PartialSignature, error)
func (*Api) FetchBolt12Invoice ¶
func (*Api) GetChainPairs ¶
func (boltz *Api) GetChainPairs() (response ChainPairs, err error)
func (*Api) GetChainSwapClaimDetails ¶
func (boltz *Api) GetChainSwapClaimDetails(swapId string) (*ChainSwapSigningDetails, error)
func (*Api) GetChainSwapTransactions ¶
func (boltz *Api) GetChainSwapTransactions(id string) (*GetChainSwapTransactionsResponse, error)
func (*Api) GetFeeEstimation ¶
func (*Api) GetInvoiceAmount ¶
func (boltz *Api) GetInvoiceAmount(swapId string) (*GetInvoiceAmountResponse, error)
func (*Api) GetPairs ¶
func (boltz *Api) GetPairs() (*GetPairsResponse, error)
func (*Api) GetReversePairs ¶
func (boltz *Api) GetReversePairs() (response ReversePairs, err error)
func (*Api) GetReverseSwapBip21 ¶
func (boltz *Api) GetReverseSwapBip21(invoice string) (*ReverseBip21, error)
func (*Api) GetSubmarinePairs ¶
func (boltz *Api) GetSubmarinePairs() (response SubmarinePairs, err error)
func (*Api) GetSwapClaimDetails ¶
func (boltz *Api) GetSwapClaimDetails(swapId string) (*SwapClaimDetails, error)
func (*Api) GetSwapTransaction ¶
func (boltz *Api) GetSwapTransaction(id string) (*GetSwapTransactionResponse, error)
func (*Api) GetTransaction ¶
func (*Api) GetVersion ¶
func (boltz *Api) GetVersion() (*GetVersionResponse, error)
func (*Api) NewWebsocket ¶
func (*Api) RefundChainSwap ¶
func (boltz *Api) RefundChainSwap(swapId string, request *RefundRequest) (*PartialSignature, error)
func (*Api) RefundSwap ¶
func (boltz *Api) RefundSwap(swapId string, request *RefundRequest) (*PartialSignature, error)
func (*Api) SendSwapClaimSignature ¶
func (boltz *Api) SendSwapClaimSignature(swapId string, signature *PartialSignature) error
func (*Api) SetInvoice ¶
func (boltz *Api) SetInvoice(swapId string, invoice string) (*SetInvoiceResponse, error)
func (*Api) SwapStatus ¶
func (boltz *Api) SwapStatus(id string) (*SwapStatusResponse, error)
type BtcTransaction ¶
func NewBtcTxFromHex ¶
func NewBtcTxFromHex(hexString string) (*BtcTransaction, error)
func (*BtcTransaction) Hash ¶
func (transaction *BtcTransaction) Hash() string
func (*BtcTransaction) Serialize ¶
func (transaction *BtcTransaction) Serialize() (string, error)
func (*BtcTransaction) VSize ¶
func (transaction *BtcTransaction) VSize() uint64
type ChainPair ¶
type ChainPair struct { Hash string `json:"hash"` Rate float64 `json:"rate"` Limits struct { Minimal uint64 `json:"minimal"` Maximal uint64 `json:"maximal"` MaximalZeroConfAmount uint64 `json:"maximalZeroConf"` } `json:"limits"` Fees struct { Percentage float64 `json:"percentage"` MinerFees struct { Server uint64 `json:"server"` User struct { Claim uint64 `json:"claim"` Lockup uint64 `json:"lockup"` } `json:"user"` } `json:"minerFees"` } `json:"fees"` }
type ChainPairs ¶
type ChainRequest ¶
type ChainRequest struct { From Currency `json:"from"` To Currency `json:"to"` PreimageHash HexString `json:"preimageHash"` ClaimPublicKey HexString `json:"claimPublicKey,omitempty"` RefundPublicKey HexString `json:"refundPublicKey,omitempty"` UserLockAmount uint64 `json:"userLockAmount,omitempty"` ServerLockAmount uint64 `json:"serverLockAmount,omitempty"` PairHash string `json:"pairHash,omitempty"` ReferralId string `json:"referralId,omitempty"` }
type ChainResponse ¶
type ChainResponse struct { Id string `json:"id"` ClaimDetails *ChainSwapData `json:"claimDetails,omitempty"` LockupDetails *ChainSwapData `json:"lockupDetails,omitempty"` Error string `json:"error"` }
type ChainSwapData ¶
type ChainSwapData struct { SwapTree *SerializedTree `json:"swapTree,omitempty"` LockupAddress string `json:"lockupAddress"` ServerPublicKey HexString `json:"serverPublicKey,omitempty"` TimeoutBlockHeight uint32 `json:"timeoutBlockHeight"` Amount uint64 `json:"amount"` BlindingKey HexString `json:"blindingKey,omitempty"` Bip21 string `json:"bip21,omitempty"` }
type ChainSwapSigningDetails ¶
type ChainSwapSigningRequest ¶
type ChainSwapSigningRequest struct { Preimage HexString `json:"preimage"` Signature *PartialSignature `json:"signature"` ToSign *ClaimRequest `json:"toSign"` Error string `json:"error"` }
type ChainSwapTransaction ¶
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 ClaimRequest ¶
type CreateReverseSwapRequest ¶
type CreateReverseSwapRequest struct { From Currency `json:"from"` To Currency `json:"to"` PreimageHash HexString `json:"preimageHash"` ClaimPublicKey HexString `json:"claimPublicKey"` InvoiceAmount uint64 `json:"invoiceAmount,omitempty"` OnchainAmount uint64 `json:"onchainAmount,omitempty"` PairHash string `json:"pairHash,omitempty"` ReferralId string `json:"referralId"` Address string `json:"address,omitempty"` AddressSignature HexString `json:"addressSignature,omitempty"` Description string `json:"description,omitempty"` DescriptionHash HexString `json:"descriptionHash,omitempty"` InvoiceExpiry uint64 `json:"invoiceExpiry,omitempty"` Error string `json:"error"` }
type CreateReverseSwapResponse ¶
type CreateReverseSwapResponse struct { Id string `json:"id"` Invoice string `json:"invoice"` SwapTree *SerializedTree `json:"swapTree"` RefundPublicKey HexString `json:"refundPublicKey"` LockupAddress string `json:"lockupAddress"` TimeoutBlockHeight uint32 `json:"timeoutBlockHeight"` OnchainAmount uint64 `json:"onchainAmount"` BlindingKey HexString `json:"blindingKey"` Error string `json:"error"` }
type CreateSwapRequest ¶
type CreateSwapRequest struct { From Currency `json:"from"` To Currency `json:"to"` PairHash string `json:"pairHash,omitempty"` RefundPublicKey HexString `json:"refundPublicKey"` Invoice string `json:"invoice,omitempty"` ReferralId string `json:"referralId"` PreimageHash HexString `json:"preimageHash,omitempty"` Error string `json:"error"` }
type CreateSwapResponse ¶
type CreateSwapResponse struct { Id string `json:"id"` Bip21 string `json:"bip21"` Address string `json:"address"` SwapTree *SerializedTree `json:"swapTree"` ClaimPublicKey HexString `json:"claimPublicKey"` TimeoutBlockHeight uint32 `json:"timeoutBlockHeight"` AcceptZeroConf bool `json:"acceptZeroConf"` ExpectedAmount uint64 `json:"expectedAmount"` BlindingKey HexString `json:"blindingKey"` Error string `json:"error"` }
type Currency ¶
type Currency string
func GetAddressCurrency ¶
func ParseCurrency ¶
func TransactionCurrency ¶
func TransactionCurrency(transaction Transaction) Currency
func (*Currency) UnmarshalText ¶
type ErrorMessage ¶
type ErrorMessage struct {
Error string `json:"error"`
}
type FeeEstimations ¶
type GetChainSwapTransactionsResponse ¶
type GetChainSwapTransactionsResponse struct { UserLock *ChainSwapTransaction `json:"userLock"` ServerLock *ChainSwapTransaction `json:"serverLock"` Error string `json:"error"` }
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 GetTransactionRequest ¶
type GetTransactionResponse ¶
type GetVersionResponse ¶
type GetVersionResponse struct {
Version string `json:"version"`
}
Types for Boltz API
type HexString ¶
type HexString []byte
func (HexString) MarshalText ¶
func (*HexString) UnmarshalText ¶
type LiquidTransaction ¶
type LiquidTransaction struct { liquidtx.Transaction OurOutputBlindingKey *btcec.PrivateKey }
func NewLiquidTxFromHex ¶
func NewLiquidTxFromHex(hexString string, ourOutputBlindingKey *btcec.PrivateKey) (*LiquidTransaction, error)
func (*LiquidTransaction) Hash ¶
func (transaction *LiquidTransaction) Hash() string
func (*LiquidTransaction) Serialize ¶
func (transaction *LiquidTransaction) Serialize() (string, error)
func (*LiquidTransaction) VSize ¶
func (transaction *LiquidTransaction) VSize() uint64
type MusigSession ¶
func NewSigningSession ¶
func NewSigningSession(tree *SwapTree) (*MusigSession, error)
func (*MusigSession) Finalize ¶
func (session *MusigSession) Finalize(transaction Transaction, outputs []OutputDetails, network *Network, boltzSignature *PartialSignature) (err error)
func (*MusigSession) Sign ¶
func (session *MusigSession) Sign(hash []byte, boltzNonce []byte) (*PartialSignature, error)
type Network ¶
type Network struct { Btc *btc.Params Liquid *liquid.Network Name string DummyLockupAddress map[Currency]string }
func ParseChain ¶
type OutputDetails ¶
type OutputDetails struct { LockupTransaction Transaction Vout uint32 // the absolute fee to pay for this output Fee uint64 // which address to use as the destination for the output Address string 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 // taproot only SwapTree *SwapTree Cooperative bool // swap tree of server lockup transaction, required when cooperatively claiming a chain swap RefundSwapTree *SwapTree SwapId string SwapType SwapType }
func (*OutputDetails) IsRefund ¶
func (output *OutputDetails) IsRefund() bool
type OutputResult ¶
type PartialSignature ¶
type Percentage ¶
type Percentage float64
func (Percentage) Calculate ¶
func (p Percentage) Calculate(value uint64) uint64
func (Percentage) Ratio ¶
func (p Percentage) Ratio() float64
func (Percentage) String ¶
func (p Percentage) String() string
func (*Percentage) UnmarshalJSON ¶
func (p *Percentage) UnmarshalJSON(text []byte) error
type Quote ¶
type Quote struct { ResponseError Amount uint64 `json:"amount"` }
type RefundRequest ¶
type ResponseError ¶
type ResponseError struct {
Error string `json:"error"`
}
func (ResponseError) ApiError ¶
func (response ResponseError) ApiError(err error) error
type Results ¶
type Results map[string]OutputResult
type ReverseBip21 ¶
type ReversePair ¶
type ReversePair struct { Hash string `json:"hash"` Rate float64 `json:"rate"` Limits struct { Minimal uint64 `json:"minimal"` Maximal uint64 `json:"maximal"` } `json:"limits"` Fees struct { Percentage float64 `json:"percentage"` MinerFees struct { Lockup uint64 `json:"lockup"` Claim uint64 `json:"claim"` } `json:"minerFees"` } `json:"fees"` }
type ReversePairs ¶
type ReversePairs map[Currency]map[Currency]ReversePair
type SerializedLeaf ¶
type SerializedLeaf struct { Version txscript.TapscriptLeafVersion `json:"version"` Output HexString `json:"output"` }
func (*SerializedLeaf) Deserialize ¶
func (leaf *SerializedLeaf) Deserialize() TapLeaf
type SerializedTree ¶
type SerializedTree struct { ClaimLeaf SerializedLeaf `json:"claimLeaf"` RefundLeaf SerializedLeaf `json:"refundLeaf"` }
func (*SerializedTree) Deserialize ¶
func (tree *SerializedTree) Deserialize() *SwapTree
type SetInvoiceRequest ¶
type SetInvoiceRequest struct {
Invoice string `json:"invoice"`
}
type SetInvoiceResponse ¶
type SetInvoiceResponse struct {
Error string `json:"error"`
}
type SubmarinePair ¶
type SubmarinePair struct { Hash string `json:"hash"` Rate float64 `json:"rate"` Limits struct { Minimal uint64 `json:"minimal"` Maximal uint64 `json:"maximal"` MaximalZeroConfAmount uint64 `json:"maximalZeroConf"` } `json:"limits"` Fees struct { Percentage float64 `json:"percentage"` MinerFees uint64 `json:"minerFees"` } `json:"fees"` }
type SubmarinePairs ¶
type SubmarinePairs map[Currency]map[Currency]SubmarinePair
type SwapClaimDetails ¶
type SwapStatusResponse ¶
type SwapTree ¶
type SwapTree struct { ClaimLeaf TapLeaf RefundLeaf TapLeaf // contains filtered or unexported fields }
func (*SwapTree) CheckAddress ¶
func (*SwapTree) GetControlBlock ¶
func (*SwapTree) Serialize ¶
func (tree *SwapTree) Serialize() *SerializedTree
type SwapUpdate ¶
type SwapUpdate struct { SwapStatusResponse `mapstructure:",squash"` Id string `json:"id"` }
type SwapUpdateEvent ¶
type SwapUpdateEvent int
const ( SwapCreated SwapUpdateEvent = iota SwapExpired InvoiceSet InvoicePaid InvoicePending InvoiceSettled InvoiceFailedToPay ChannelCreated TransactionFailed TransactionMempool TransactionClaimed TransactionRefunded TransactionConfirmed TransactionLockupFailed TransactionClaimPending TransactionServerMempoool TransactionServerConfirmed TransactionDirect TransactionDirectMempool )
func ParseEvent ¶
func ParseEvent(event string) SwapUpdateEvent
func (SwapUpdateEvent) IsCompletedStatus ¶
func (event SwapUpdateEvent) IsCompletedStatus() bool
func (SwapUpdateEvent) IsFailedStatus ¶
func (event SwapUpdateEvent) IsFailedStatus() bool
func (SwapUpdateEvent) String ¶
func (event SwapUpdateEvent) String() string
type Transaction ¶
type Transaction interface { Hash() string Serialize() (string, error) VSize() uint64 FindVout(network *Network, address string) (uint32, uint64, error) VoutValue(vout uint32) (uint64, error) }
func NewTxFromHex ¶
func NewTxFromHex(currency Currency, hexString string, ourOutputBlindingKey *btcec.PrivateKey) (Transaction, error)
type Websocket ¶
type Websocket struct { Updates chan SwapUpdate // contains filtered or unexported fields }
func (*Websocket) Unsubscribe ¶
Click to show internal directories.
Click to hide internal directories.