bdk

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrErrorGeneric = fmt.Errorf("ErrorGeneric")

Err* are used for checking error type with `errors.Is`

View Source
var FfiConverterBalanceINSTANCE = FfiConverterBalance{}
View Source
var FfiConverterBoolINSTANCE = FfiConverterBool{}
View Source
var FfiConverterChainClientINSTANCE = FfiConverterChainClient{}
View Source
var FfiConverterErrorINSTANCE = FfiConverterError{}
View Source
var FfiConverterFloat64INSTANCE = FfiConverterFloat64{}
View Source
var FfiConverterInt64INSTANCE = FfiConverterInt64{}
View Source
var FfiConverterNetworkINSTANCE = FfiConverterNetwork{}
View Source
var FfiConverterOptionalStringINSTANCE = FfiConverterOptionalString{}
View Source
var FfiConverterSequenceWalletTransactionINSTANCE = FfiConverterSequenceWalletTransaction{}
View Source
var FfiConverterSequenceWalletTransactionOutputINSTANCE = FfiConverterSequenceWalletTransactionOutput{}
View Source
var FfiConverterStringINSTANCE = FfiConverterString{}
View Source
var FfiConverterUint32INSTANCE = FfiConverterUint32{}
View Source
var FfiConverterUint64INSTANCE = FfiConverterUint64{}
View Source
var FfiConverterWalletCredentialsINSTANCE = FfiConverterWalletCredentials{}
View Source
var FfiConverterWalletINSTANCE = FfiConverterWallet{}
View Source
var FfiConverterWalletSendResultINSTANCE = FfiConverterWalletSendResult{}
View Source
var FfiConverterWalletTransactionINSTANCE = FfiConverterWalletTransaction{}
View Source
var FfiConverterWalletTransactionOutputINSTANCE = FfiConverterWalletTransactionOutput{}

Functions

func DeriveDefaultXpub

func DeriveDefaultXpub(network Network, mnemonic string) (string, error)

func LiftFromRustBuffer

func LiftFromRustBuffer[GoType any](bufReader BufReader[GoType], rbuf RustBufferI) GoType

func LowerIntoRustBuffer

func LowerIntoRustBuffer[GoType any](bufWriter BufWriter[GoType], value GoType) C.RustBuffer

Types

type Balance

type Balance struct {
	Confirmed   uint64
	Unconfirmed uint64
}

func (*Balance) Destroy

func (r *Balance) Destroy()

type BufLifter

type BufLifter[GoType any] interface {
	Lift(value RustBufferI) GoType
}

type BufLowerer

type BufLowerer[GoType any] interface {
	Lower(value GoType) C.RustBuffer
}

type BufReader

type BufReader[GoType any] interface {
	Read(reader io.Reader) GoType
}

type BufWriter

type BufWriter[GoType any] interface {
	Write(writer io.Writer, value GoType)
}

type ChainClient

type ChainClient struct {
	// contains filtered or unexported fields
}

func NewChainClient

func NewChainClient(electrumUrl string) (*ChainClient, error)

func (*ChainClient) Destroy

func (object *ChainClient) Destroy()

type ChainClientInterface

type ChainClientInterface interface {
}

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewErrorGeneric

func NewErrorGeneric(
	var0 string,
) *Error

func (*Error) AsError

func (err *Error) AsError() error

Convience method to turn *Error into error Avoiding treating nil pointer as non nil error interface

func (Error) Error

func (err Error) Error() string

func (Error) Unwrap

func (err Error) Unwrap() error

type ErrorGeneric

type ErrorGeneric struct {
	Field0 string
}

Variant structs

func (ErrorGeneric) Error

func (err ErrorGeneric) Error() string

func (ErrorGeneric) Is

func (self ErrorGeneric) Is(target error) bool

type FfiConverterBalance

type FfiConverterBalance struct{}

func (FfiConverterBalance) Lift

func (FfiConverterBalance) Lower

func (c FfiConverterBalance) Lower(value Balance) C.RustBuffer

func (FfiConverterBalance) Read

func (c FfiConverterBalance) Read(reader io.Reader) Balance

func (FfiConverterBalance) Write

func (c FfiConverterBalance) Write(writer io.Writer, value Balance)

type FfiConverterBool

type FfiConverterBool struct{}

func (FfiConverterBool) Lift

func (FfiConverterBool) Lift(value C.int8_t) bool

func (FfiConverterBool) Lower

func (FfiConverterBool) Lower(value bool) C.int8_t

func (FfiConverterBool) Read

func (FfiConverterBool) Read(reader io.Reader) bool

func (FfiConverterBool) Write

func (FfiConverterBool) Write(writer io.Writer, value bool)

type FfiConverterChainClient

type FfiConverterChainClient struct{}

func (FfiConverterChainClient) Lift

func (FfiConverterChainClient) Lower

func (FfiConverterChainClient) Read

func (c FfiConverterChainClient) Read(reader io.Reader) *ChainClient

func (FfiConverterChainClient) Write

func (c FfiConverterChainClient) Write(writer io.Writer, value *ChainClient)

type FfiConverterError

type FfiConverterError struct{}

func (FfiConverterError) Lift

func (c FfiConverterError) Lift(eb RustBufferI) *Error

func (FfiConverterError) Lower

func (c FfiConverterError) Lower(value *Error) C.RustBuffer

func (FfiConverterError) Read

func (c FfiConverterError) Read(reader io.Reader) *Error

func (FfiConverterError) Write

func (c FfiConverterError) Write(writer io.Writer, value *Error)

type FfiConverterFloat64

type FfiConverterFloat64 struct{}

func (FfiConverterFloat64) Lift

func (FfiConverterFloat64) Lift(value C.double) float64

func (FfiConverterFloat64) Lower

func (FfiConverterFloat64) Lower(value float64) C.double

func (FfiConverterFloat64) Read

func (FfiConverterFloat64) Read(reader io.Reader) float64

func (FfiConverterFloat64) Write

func (FfiConverterFloat64) Write(writer io.Writer, value float64)

type FfiConverterInt64

type FfiConverterInt64 struct{}

func (FfiConverterInt64) Lift

func (FfiConverterInt64) Lift(value C.int64_t) int64

func (FfiConverterInt64) Lower

func (FfiConverterInt64) Lower(value int64) C.int64_t

func (FfiConverterInt64) Read

func (FfiConverterInt64) Read(reader io.Reader) int64

func (FfiConverterInt64) Write

func (FfiConverterInt64) Write(writer io.Writer, value int64)

type FfiConverterNetwork

type FfiConverterNetwork struct{}

func (FfiConverterNetwork) Lift

func (FfiConverterNetwork) Lower

func (c FfiConverterNetwork) Lower(value Network) C.RustBuffer

func (FfiConverterNetwork) Read

func (FfiConverterNetwork) Read(reader io.Reader) Network

func (FfiConverterNetwork) Write

func (FfiConverterNetwork) Write(writer io.Writer, value Network)

type FfiConverterOptionalString

type FfiConverterOptionalString struct{}

func (FfiConverterOptionalString) Lift

func (FfiConverterOptionalString) Lower

func (FfiConverterOptionalString) Read

func (_ FfiConverterOptionalString) Read(reader io.Reader) *string

func (FfiConverterOptionalString) Write

func (_ FfiConverterOptionalString) Write(writer io.Writer, value *string)

type FfiConverterSequenceWalletTransaction

type FfiConverterSequenceWalletTransaction struct{}

func (FfiConverterSequenceWalletTransaction) Lift

func (FfiConverterSequenceWalletTransaction) Lower

func (FfiConverterSequenceWalletTransaction) Read

func (FfiConverterSequenceWalletTransaction) Write

type FfiConverterSequenceWalletTransactionOutput

type FfiConverterSequenceWalletTransactionOutput struct{}

func (FfiConverterSequenceWalletTransactionOutput) Lift

func (FfiConverterSequenceWalletTransactionOutput) Lower

func (FfiConverterSequenceWalletTransactionOutput) Read

func (FfiConverterSequenceWalletTransactionOutput) Write

type FfiConverterString

type FfiConverterString struct{}

func (FfiConverterString) Lift

func (FfiConverterString) Lower

func (FfiConverterString) Lower(value string) C.RustBuffer

func (FfiConverterString) Read

func (FfiConverterString) Read(reader io.Reader) string

func (FfiConverterString) Write

func (FfiConverterString) Write(writer io.Writer, value string)

type FfiConverterUint32

type FfiConverterUint32 struct{}

func (FfiConverterUint32) Lift

func (FfiConverterUint32) Lift(value C.uint32_t) uint32

func (FfiConverterUint32) Lower

func (FfiConverterUint32) Lower(value uint32) C.uint32_t

func (FfiConverterUint32) Read

func (FfiConverterUint32) Read(reader io.Reader) uint32

func (FfiConverterUint32) Write

func (FfiConverterUint32) Write(writer io.Writer, value uint32)

type FfiConverterUint64

type FfiConverterUint64 struct{}

func (FfiConverterUint64) Lift

func (FfiConverterUint64) Lift(value C.uint64_t) uint64

func (FfiConverterUint64) Lower

func (FfiConverterUint64) Lower(value uint64) C.uint64_t

func (FfiConverterUint64) Read

func (FfiConverterUint64) Read(reader io.Reader) uint64

func (FfiConverterUint64) Write

func (FfiConverterUint64) Write(writer io.Writer, value uint64)

type FfiConverterWallet

type FfiConverterWallet struct{}

func (FfiConverterWallet) Lift

func (c FfiConverterWallet) Lift(pointer unsafe.Pointer) *Wallet

func (FfiConverterWallet) Lower

func (c FfiConverterWallet) Lower(value *Wallet) unsafe.Pointer

func (FfiConverterWallet) Read

func (c FfiConverterWallet) Read(reader io.Reader) *Wallet

func (FfiConverterWallet) Write

func (c FfiConverterWallet) Write(writer io.Writer, value *Wallet)

type FfiConverterWalletCredentials

type FfiConverterWalletCredentials struct{}

func (FfiConverterWalletCredentials) Lift

func (FfiConverterWalletCredentials) Lower

func (FfiConverterWalletCredentials) Read

func (FfiConverterWalletCredentials) Write

type FfiConverterWalletSendResult

type FfiConverterWalletSendResult struct{}

func (FfiConverterWalletSendResult) Lift

func (FfiConverterWalletSendResult) Lower

func (FfiConverterWalletSendResult) Read

func (FfiConverterWalletSendResult) Write

func (c FfiConverterWalletSendResult) Write(writer io.Writer, value WalletSendResult)

type FfiConverterWalletTransaction

type FfiConverterWalletTransaction struct{}

func (FfiConverterWalletTransaction) Lift

func (FfiConverterWalletTransaction) Lower

func (FfiConverterWalletTransaction) Read

func (FfiConverterWalletTransaction) Write

type FfiConverterWalletTransactionOutput

type FfiConverterWalletTransactionOutput struct{}

func (FfiConverterWalletTransactionOutput) Lift

func (FfiConverterWalletTransactionOutput) Lower

func (FfiConverterWalletTransactionOutput) Read

func (FfiConverterWalletTransactionOutput) Write

type FfiDestroyerBalance

type FfiDestroyerBalance struct{}

func (FfiDestroyerBalance) Destroy

func (_ FfiDestroyerBalance) Destroy(value Balance)

type FfiDestroyerBool

type FfiDestroyerBool struct{}

func (FfiDestroyerBool) Destroy

func (FfiDestroyerBool) Destroy(_ bool)

type FfiDestroyerChainClient

type FfiDestroyerChainClient struct{}

func (FfiDestroyerChainClient) Destroy

func (_ FfiDestroyerChainClient) Destroy(value *ChainClient)

type FfiDestroyerError

type FfiDestroyerError struct{}

func (FfiDestroyerError) Destroy

func (_ FfiDestroyerError) Destroy(value *Error)

type FfiDestroyerFloat64

type FfiDestroyerFloat64 struct{}

func (FfiDestroyerFloat64) Destroy

func (FfiDestroyerFloat64) Destroy(_ float64)

type FfiDestroyerInt64

type FfiDestroyerInt64 struct{}

func (FfiDestroyerInt64) Destroy

func (FfiDestroyerInt64) Destroy(_ int64)

type FfiDestroyerNetwork

type FfiDestroyerNetwork struct{}

func (FfiDestroyerNetwork) Destroy

func (_ FfiDestroyerNetwork) Destroy(value Network)

type FfiDestroyerOptionalString

type FfiDestroyerOptionalString struct{}

func (FfiDestroyerOptionalString) Destroy

func (_ FfiDestroyerOptionalString) Destroy(value *string)

type FfiDestroyerSequenceWalletTransaction

type FfiDestroyerSequenceWalletTransaction struct{}

func (FfiDestroyerSequenceWalletTransaction) Destroy

type FfiDestroyerSequenceWalletTransactionOutput

type FfiDestroyerSequenceWalletTransactionOutput struct{}

func (FfiDestroyerSequenceWalletTransactionOutput) Destroy

type FfiDestroyerString

type FfiDestroyerString struct{}

func (FfiDestroyerString) Destroy

func (FfiDestroyerString) Destroy(_ string)

type FfiDestroyerUint32

type FfiDestroyerUint32 struct{}

func (FfiDestroyerUint32) Destroy

func (FfiDestroyerUint32) Destroy(_ uint32)

type FfiDestroyerUint64

type FfiDestroyerUint64 struct{}

func (FfiDestroyerUint64) Destroy

func (FfiDestroyerUint64) Destroy(_ uint64)

type FfiDestroyerWallet

type FfiDestroyerWallet struct{}

func (FfiDestroyerWallet) Destroy

func (_ FfiDestroyerWallet) Destroy(value *Wallet)

type FfiDestroyerWalletCredentials

type FfiDestroyerWalletCredentials struct{}

func (FfiDestroyerWalletCredentials) Destroy

type FfiDestroyerWalletSendResult

type FfiDestroyerWalletSendResult struct{}

func (FfiDestroyerWalletSendResult) Destroy

type FfiDestroyerWalletTransaction

type FfiDestroyerWalletTransaction struct{}

func (FfiDestroyerWalletTransaction) Destroy

type FfiDestroyerWalletTransactionOutput

type FfiDestroyerWalletTransactionOutput struct{}

func (FfiDestroyerWalletTransactionOutput) Destroy

type FfiObject

type FfiObject struct {
	// contains filtered or unexported fields
}

type GoRustBuffer

type GoRustBuffer struct {
	// contains filtered or unexported fields
}

This is needed, because as of go 1.24 type RustBuffer C.RustBuffer cannot have methods, RustBuffer is treated as non-local type

func RustBufferFromExternal

func RustBufferFromExternal(b RustBufferI) GoRustBuffer

func (GoRustBuffer) AsReader

func (cb GoRustBuffer) AsReader() *bytes.Reader

func (GoRustBuffer) Capacity

func (cb GoRustBuffer) Capacity() uint64

func (GoRustBuffer) Data

func (cb GoRustBuffer) Data() unsafe.Pointer

func (GoRustBuffer) Free

func (cb GoRustBuffer) Free()

func (GoRustBuffer) Len

func (cb GoRustBuffer) Len() uint64

func (GoRustBuffer) ToGoBytes

func (cb GoRustBuffer) ToGoBytes() []byte

type NativeError

type NativeError interface {
	AsError() error
}

type Network

type Network uint
const (
	NetworkBitcoin Network = 1
	NetworkTestnet Network = 2
	NetworkRegtest Network = 3
	NetworkSignet  Network = 4
)

type RustBufferI

type RustBufferI interface {
	AsReader() *bytes.Reader
	Free()
	ToGoBytes() []byte
	Data() unsafe.Pointer
	Len() uint64
	Capacity() uint64
}

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

func NewWallet

func NewWallet(credentials WalletCredentials, dbPath string, network Network) (*Wallet, error)

func (*Wallet) ApplyTransaction

func (_self *Wallet) ApplyTransaction(txHex string) error

func (*Wallet) Balance

func (_self *Wallet) Balance() (Balance, error)

func (*Wallet) BumpTransactionFee

func (_self *Wallet) BumpTransactionFee(txId string, satPerVbyte float64) (string, error)

func (*Wallet) Destroy

func (object *Wallet) Destroy()

func (*Wallet) FullScan

func (_self *Wallet) FullScan(chainClient *ChainClient) error

func (*Wallet) GetTransactions

func (_self *Wallet) GetTransactions(limit uint64, offset uint64) ([]WalletTransaction, error)

func (*Wallet) NewAddress

func (_self *Wallet) NewAddress() (string, error)

func (*Wallet) SendToAddress

func (_self *Wallet) SendToAddress(address string, amount uint64, satPerVbyte float64, sendAll bool) (WalletSendResult, error)

func (*Wallet) Sync

func (_self *Wallet) Sync(chainClient *ChainClient) error

type WalletCredentials

type WalletCredentials struct {
	Mnemonic       *string
	CoreDescriptor string
}

func (*WalletCredentials) Destroy

func (r *WalletCredentials) Destroy()

type WalletInterface

type WalletInterface interface {
	ApplyTransaction(txHex string) error
	Balance() (Balance, error)
	BumpTransactionFee(txId string, satPerVbyte float64) (string, error)
	FullScan(chainClient *ChainClient) error
	GetTransactions(limit uint64, offset uint64) ([]WalletTransaction, error)
	NewAddress() (string, error)
	SendToAddress(address string, amount uint64, satPerVbyte float64, sendAll bool) (WalletSendResult, error)
	Sync(chainClient *ChainClient) error
}

type WalletSendResult

type WalletSendResult struct {
	TxHex      string
	Fee        uint64
	SendAmount uint64
}

func (*WalletSendResult) Destroy

func (r *WalletSendResult) Destroy()

type WalletTransaction

type WalletTransaction struct {
	Id              string
	Timestamp       uint64
	Outputs         []WalletTransactionOutput
	BlockHeight     uint32
	BalanceChange   int64
	IsConsolidation bool
}

func (*WalletTransaction) Destroy

func (r *WalletTransaction) Destroy()

type WalletTransactionOutput

type WalletTransactionOutput struct {
	Address      string
	Amount       uint64
	IsOurAddress bool
}

func (*WalletTransactionOutput) Destroy

func (r *WalletTransactionOutput) Destroy()

Jump to

Keyboard shortcuts

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