application

package
v0.0.0-...-7880ed1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignModeLiquidityProvider = "liquidity_provider"
	SignModeSigner            = "signer"
)

Variables

View Source
var ErrTransactionNotFound = fmt.Errorf("transaction not found")

Functions

func NetworkToChainParams

func NetworkToChainParams(network string) *chaincfg.Params

Types

type BlockTimestamp

type BlockTimestamp struct {
	Height uint32
	Time   int64
}

type BlockchainScanner

type BlockchainScanner interface {
	WatchScripts(ctx context.Context, scripts []string) error
	UnwatchScripts(ctx context.Context, scripts []string) error
	GetNotificationChannel(ctx context.Context) <-chan map[string][]Utxo
	IsTransactionConfirmed(
		ctx context.Context, txid string,
	) (isConfirmed bool, blockHeight, blockTime int64, err error)
	Close()
}

type Utxo

type Utxo struct {
	Txid   string
	Index  uint32
	Script string
	Value  uint64
}

type WalletService

type WalletService interface {
	GetReadyUpdate(ctx context.Context) <-chan struct{}
	GenSeed(ctx context.Context) (string, error)
	Create(ctx context.Context, seed, password string) error
	Restore(ctx context.Context, seed, password string) error
	Unlock(ctx context.Context, password string) error
	Lock(ctx context.Context) error
	Status(ctx context.Context) WalletStatus
	GetNetwork(ctx context.Context) string
	GetSignerPubkey(ctx context.Context) (string, error)
	GetForfeitPubkey(ctx context.Context) (string, error)
	DeriveConnectorAddress(ctx context.Context) (string, error)
	DeriveAddresses(ctx context.Context, num int) ([]string, error)
	SignTransaction(
		ctx context.Context, signMode, partialTx string, extractRawTx bool, inputIndexes []int,
	) (string, error)
	SelectUtxos(ctx context.Context, amount uint64, confirmedOnly bool) ([]Utxo, uint64, error)
	BroadcastTransaction(ctx context.Context, txs ...string) (string, error)
	EstimateFees(ctx context.Context, psbt string) (uint64, error)
	FeeRate(ctx context.Context) (chainfee.SatPerKVByte, error)
	ListConnectorUtxos(ctx context.Context, connectorAddress string) ([]Utxo, error)
	MainAccountBalance(ctx context.Context) (uint64, uint64, error)
	ConnectorsAccountBalance(ctx context.Context) (uint64, uint64, error)
	LockConnectorUtxos(ctx context.Context, utxos []wire.OutPoint) error
	GetDustAmount(ctx context.Context) uint64
	GetTransaction(ctx context.Context, txid string) (string, error)
	GetCurrentBlockTime(ctx context.Context) (*BlockTimestamp, error)
	Withdraw(ctx context.Context, destinationAddress string, amount uint64) (string, error)
	LoadSignerKey(ctx context.Context, prvkey *btcec.PrivateKey) error
	Close()
}

type WalletStatus

type WalletStatus struct {
	IsInitialized bool
	IsUnlocked    bool
	IsSynced      bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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