bav

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 3 Imported by: 0

README

bitcoin-address-validation

Go version bitcoin-address-validation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(addr string, defaultNetwork NetworkType) bool

Types

type AddressInfo

type AddressInfo struct {
	IsBench32 bool        `json:"is_bench32" mapstructure:"is_bench32"`
	Address   string      `json:"address" mapstructure:"address"`
	Network   NetworkType `json:"network" mapstructure:"network"`
	Type      AddressType `json:"type" mapstructure:"type"`
}

func GetAddressInfo

func GetAddressInfo(addr string) AddressInfo

type AddressType

type AddressType string
const (
	P2PKH                AddressType = "P2PKH"       // legacy
	P2SH_P2WPKH          AddressType = "P2SH-P2WPKH" // nested segwit
	P2WPKH               AddressType = "P2WPKH"      // native segwit
	P2TR                 AddressType = "P2TR"        // taproot
	P2SH                 AddressType = "P2SH"        // unlock by script hash
	P2WSH                AddressType = "P2WSH"       // multisig
	UNKNOWN_ADDRESS_TYPE AddressType = "Unknown"
)

type NetworkType

type NetworkType string
const (
	MainNet              NetworkType = "mainnet"
	TestNet              NetworkType = "testnet"
	Signet               NetworkType = "signet"
	Regtest              NetworkType = "regtest"
	UNKNOWN_NETWORK_TYPE NetworkType = "Unknown"
)

func GetNetworkType

func GetNetworkType(addr string) (btcutil.Address, NetworkType)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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