utils

package
v0.0.0-...-877b7d3 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoinSelect

func CoinSelect(
	vtxos []client.Vtxo, amount, dust uint64, sortByExpirationTime bool,
) ([]client.Vtxo, uint64, error)

func DecryptAES128

func DecryptAES128(encrypted, password []byte) ([]byte, error)

func EncryptAES128

func EncryptAES128(privateKey, password []byte) ([]byte, error)

func GenerateRandomPrivateKey

func GenerateRandomPrivateKey() (*secp256k1.PrivateKey, error)

func HashPassword

func HashPassword(password []byte) []byte

func IsOnchainOnly

func IsOnchainOnly(receivers []client.Output) bool

func NetworkFromString

func NetworkFromString(net string) common.Network

func ParseBitcoinAddress

func ParseBitcoinAddress(addr string, net chaincfg.Params) (
	bool, []byte, error,
)

func ParseLiquidAddress

func ParseLiquidAddress(addr string) (
	bool, []byte, error,
)

func ToBitcoinNetwork

func ToBitcoinNetwork(net common.Network) chaincfg.Params

func ToElementsNetwork

func ToElementsNetwork(net common.Network) network.Network

Types

type Cache

type Cache[V any] struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache[V any]() *Cache[V]

func (Cache[V]) Get

func (c Cache[V]) Get(key string) (V, bool)

func (Cache[V]) Set

func (c Cache[V]) Set(key string, value V)

type ClientFactory

type ClientFactory func(string) (client.ASPClient, error)

type SupportedType

type SupportedType[V any] map[string]V

func (SupportedType[V]) String

func (t SupportedType[V]) String() string

func (SupportedType[V]) Supports

func (t SupportedType[V]) Supports(typeStr string) bool

Jump to

Keyboard shortcuts

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