Documentation ¶
Index ¶
- Constants
- Variables
- func BNBDecodeToBytes(input string) ([]byte, error)
- func BNBEncodeToString(bytes []byte) (string, error)
- func Base58Decode(b, alphabet string) ([]byte, error)
- func Base58Encode(b []byte, alphabet string) string
- func Bech32AddressDecodeToBytes(hrp string, input string) ([]byte, error)
- func Bech32AddressEncodeToString(hrp string, bytes []byte) (string, error)
- func Bech32DecodeToBytes(input string, hrp string) ([]byte, error)
- func Bech32EncodeToString(bytes []byte, hrp string) (string, error)
- func BitcoinCashDecodeToBytes(input string) ([]byte, error)
- func BitcoinCashEncodeToString(input []byte) (string, error)
- func BitcoinDecodeToBytes(input string) ([]byte, error)
- func BitcoinEncodeToString(input []byte) (string, error)
- func CosmosDecodeToBytes(input string) ([]byte, error)
- func CosmosEncodeToString(bytes []byte) (string, error)
- func EtherToBytes(input string) ([]byte, error)
- func EtherToString(input []byte) (string, error)
- func IoTexDecodeToBytes(input string) ([]byte, error)
- func IoTexEncodeToString(bytes []byte) (string, error)
- func MakeBitcoinDecodeToBytes(config *CoinConfig) func(string) ([]byte, error)
- func MakeBitcoinEncodeToString(config *CoinConfig) func([]byte) (string, error)
- func StellarDecodeToBytes(input string) ([]byte, error)
- func StellarEncodeToString(bytes []byte) (string, error)
- func ToBytes(input string, coinType uint32) ([]byte, error)
- func ToString(input []byte, coinType uint32) (string, error)
- func XRPDecodeToBytes(input string) ([]byte, error)
- func XRPEncodeToString(bytes []byte) (string, error)
- func ZilliqaDecodeToBytes(input string) ([]byte, error)
- func ZilliqaEncodeToString(bytes []byte) (string, error)
- type CoinConfig
Constants ¶
const ( OP_DUP = 0x76 OP_HASH160 = 0xa9 OP_EQUALVERIFY = 0x88 OP_CHECKSIG = 0xac OP_EQUAL = 0x87 )
Variables ¶
var ( P2PKH_SCRIPT_PREFIX = []byte{OP_DUP, OP_HASH160, btcKeyHashLenght} P2SH_SCRIPT_PREFIX = []byte{OP_HASH160, btcKeyHashLenght} )
Functions ¶
func BNBDecodeToBytes ¶
BNBDecodeToBytes converts the input string to a byte array
func BNBEncodeToString ¶
BNBEncodeToString converts the input byte array to a string representation of the BNB address.
func Base58Decode ¶ added in v1.0.4
Base58Decode decodes a modified base58 string to a byte slice and checks checksum.
func Base58Encode ¶ added in v1.0.4
Base58Encode encodes a byte slice to a modified base58 string.
func Bech32AddressDecodeToBytes ¶ added in v1.0.4
Bech32AddressDecodeToBytes converts the input string to a byte array
func Bech32AddressEncodeToString ¶ added in v1.0.4
Bech32AddressEncodeToString converts the input byte array to a string representation of the bech32 address.
func BitcoinCashDecodeToBytes ¶ added in v1.0.3
BitcoinCashDecodeToBytes converts the input string to a byte array
func BitcoinCashEncodeToString ¶ added in v1.0.3
BitcoinCashEncodeToString converts the input byte array to a string representation of the Bitcoin address.
func BitcoinDecodeToBytes ¶
BitcoinDecodeToBytes converts the input string to a byte array
func BitcoinEncodeToString ¶
BitcoinEncodeToString converts the input byte array to a string representation of the Bitcoin address.
func CosmosDecodeToBytes ¶ added in v1.0.4
CosmosDecodeToBytes converts the input string to a byte array
func CosmosEncodeToString ¶ added in v1.0.4
CosmosEncodeToString converts the input byte array to a string representation of the Cosmos address.
func EtherToBytes ¶
EtherToBytes converts the input string to a byte array.
func EtherToString ¶
EtherToString converts the input byte array to a string representation of the Ethereum address.
func IoTexDecodeToBytes ¶ added in v1.0.4
IoTexDecodeToBytes converts the input string to a byte array
func IoTexEncodeToString ¶ added in v1.0.4
IoTexEncodeToString converts the input byte array to a string representation of the Cosmos address.
func MakeBitcoinDecodeToBytes ¶ added in v1.0.3
func MakeBitcoinDecodeToBytes(config *CoinConfig) func(string) ([]byte, error)
MakeBitcoinDecodeToBytes takes a CoinConfig and returns a func to decode string to bytes
func MakeBitcoinEncodeToString ¶ added in v1.0.3
func MakeBitcoinEncodeToString(config *CoinConfig) func([]byte) (string, error)
MakeBitcoinEncodeToString takes a CoinConfig and returns a func to encode bytes to string
func StellarDecodeToBytes ¶ added in v1.0.4
StellarDecodeToBytes converts the input string to a byte array
func StellarEncodeToString ¶ added in v1.0.4
StellarEncodeToString converts the input byte array to a string representation of the Cosmos address.
func ToString ¶
ToString converts the input byte array to a string representation of the given coin type.
func XRPDecodeToBytes ¶ added in v1.0.4
XRPDecodeToBytes converts the input string to a byte array
func XRPEncodeToString ¶ added in v1.0.4
XRPEncodeToString converts the input byte array to a string representation of the XRP address.
func ZilliqaDecodeToBytes ¶ added in v1.0.4
ZilliqaDecodeToBytes converts the input string to a byte array
func ZilliqaEncodeToString ¶ added in v1.0.4
ZilliqaEncodeToString converts the input byte array to a string representation of the Zilliqa address.
Types ¶
type CoinConfig ¶ added in v1.0.3
CoinConfig for Bitcoin and its forks