database

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelCreation

type ChannelCreation struct {
	SwapId                 string
	Status                 boltz.ChannelState
	InboundLiquidity       uint32
	Private                bool
	FundingTransactionId   string
	FundingTransactionVout uint32
}

func (*ChannelCreation) Serialize

func (channelCreation *ChannelCreation) Serialize() ChannelCreationSerialized

type ChannelCreationSerialized

type ChannelCreationSerialized struct {
	SwapId                 string
	Status                 string
	InboundLiquidity       uint32
	Private                bool
	FundingTransactionId   string
	FundingTransactionVout uint32
}

type Database

type Database struct {
	Path string `long:"database.path" description:"Path to the database file"`
	// contains filtered or unexported fields
}

func (*Database) Connect

func (database *Database) Connect() error

func (*Database) CreateChannelCreation

func (database *Database) CreateChannelCreation(channelCreation ChannelCreation) error

func (*Database) CreateMacaroon added in v1.2.0

func (database *Database) CreateMacaroon(macaroon Macaroon) error

func (*Database) CreateReverseSwap

func (database *Database) CreateReverseSwap(reverseSwap ReverseSwap) error

func (*Database) CreateSwap

func (database *Database) CreateSwap(swap Swap) error

func (*Database) QueryChannelCreation

func (database *Database) QueryChannelCreation(id string) (channelCreation *ChannelCreation, err error)

func (*Database) QueryMacaroon added in v1.2.0

func (database *Database) QueryMacaroon(id []byte) (macaroon *Macaroon, err error)

func (*Database) QueryPendingReverseSwaps

func (database *Database) QueryPendingReverseSwaps() ([]ReverseSwap, error)

func (*Database) QueryPendingSwaps

func (database *Database) QueryPendingSwaps() ([]Swap, error)

func (*Database) QueryRefundableSwaps

func (database *Database) QueryRefundableSwaps(currentBlockHeight uint32) ([]Swap, error)

func (*Database) QueryReverseSwap

func (database *Database) QueryReverseSwap(id string) (reverseSwap *ReverseSwap, err error)

func (*Database) QueryReverseSwaps

func (database *Database) QueryReverseSwaps() ([]ReverseSwap, error)

func (*Database) QuerySwap

func (database *Database) QuerySwap(id string) (swap *Swap, err error)

func (*Database) QuerySwaps

func (database *Database) QuerySwaps() ([]Swap, error)

func (*Database) SetChannelFunding

func (database *Database) SetChannelFunding(channelCreation *ChannelCreation, fundingTransactionId string, fundingTransactionVout uint32) error

func (*Database) SetReverseSwapClaimTransactionId

func (database *Database) SetReverseSwapClaimTransactionId(reverseSwap *ReverseSwap, claimTransactionId string) error

func (*Database) SetReverseSwapLockupTransactionId

func (database *Database) SetReverseSwapLockupTransactionId(reverseSwap *ReverseSwap, lockupTransactionId string) error

func (*Database) SetSwapInvoice

func (database *Database) SetSwapInvoice(swap *Swap, invoice string) error

func (*Database) SetSwapLockupTransactionId

func (database *Database) SetSwapLockupTransactionId(swap *Swap, lockupTransactionId string) error

func (*Database) SetSwapRefundTransactionId

func (database *Database) SetSwapRefundTransactionId(swap *Swap, refundTransactionId string) error

func (*Database) UpdateChannelCreationStatus

func (database *Database) UpdateChannelCreationStatus(channelCreation *ChannelCreation, status boltz.ChannelState) error

func (*Database) UpdateReverseSwapState added in v1.2.3

func (database *Database) UpdateReverseSwapState(reverseSwap *ReverseSwap, state boltzrpc.SwapState, error string) error

func (*Database) UpdateReverseSwapStatus

func (database *Database) UpdateReverseSwapStatus(reverseSwap *ReverseSwap, status boltz.SwapUpdateEvent) error

func (*Database) UpdateSwapState added in v1.2.3

func (database *Database) UpdateSwapState(swap *Swap, state boltzrpc.SwapState, error string) error

func (*Database) UpdateSwapStatus

func (database *Database) UpdateSwapStatus(swap *Swap, status boltz.SwapUpdateEvent) error

type Macaroon added in v1.2.0

type Macaroon struct {
	Id      []byte
	RootKey []byte
}

type ReverseSwap

type ReverseSwap struct {
	Id                  string
	State               boltzrpc.SwapState
	Error               string
	Status              boltz.SwapUpdateEvent
	AcceptZeroConf      bool
	PrivateKey          *btcec.PrivateKey
	Preimage            []byte
	RedeemScript        []byte
	Invoice             string
	ClaimAddress        string
	OnchainAmount       uint64
	TimeoutBlockHeight  uint32
	LockupTransactionId string
	ClaimTransactionId  string
}

func (*ReverseSwap) Serialize

func (reverseSwap *ReverseSwap) Serialize() ReverseSwapSerialized

type ReverseSwapSerialized

type ReverseSwapSerialized struct {
	Id                  string
	State               string
	Error               string
	Status              string
	AcceptZeroConf      bool
	PrivateKey          string
	Preimage            string
	RedeemScript        string
	Invoice             string
	ClaimAddress        string
	OnchainAmount       uint64
	TimeoutBlockHeight  uint32
	LockupTransactionId string
	ClaimTransactionId  string
}

type Swap

type Swap struct {
	Id                  string
	State               boltzrpc.SwapState
	Error               string
	Status              boltz.SwapUpdateEvent
	PrivateKey          *btcec.PrivateKey
	Preimage            []byte
	RedeemScript        []byte
	Invoice             string
	Address             string
	ExpectedAmount      uint64
	TimoutBlockHeight   uint32
	LockupTransactionId string
	RefundTransactionId string
}

func (*Swap) Serialize

func (swap *Swap) Serialize() SwapSerialized

type SwapSerialized

type SwapSerialized struct {
	Id                  string
	State               string
	Error               string
	Status              string
	PrivateKey          string
	Preimage            string
	RedeemScript        string
	Invoice             string
	Address             string
	ExpectedAmount      uint64
	TimeoutBlockHeight  uint32
	LockupTransactionId string
	RefundTransactionId string
}

Jump to

Keyboard shortcuts

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