networks

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 23 Imported by: 1

Documentation

Overview

Package networks provides wallet generators for different cryptocurrency networks

Index

Constants

View Source
const (
	PolkadotSS58Prefix  byte = 0  // Polkadot mainnet
	KusamaSS58Prefix    byte = 2  // Kusama
	SubstrateSS58Prefix byte = 42 // Generic Substrate
)

SS58 network prefixes

Variables

View Source
var (
	// Bitcoin mainnet
	BitcoinMainnet = BitcoinParams{
		Name:            "Bitcoin",
		Network:         "btc",
		Params:          &chaincfg.MainNetParams,
		HDCoinType:      0,
		SegwitSupported: true,
	}

	// Bitcoin testnet
	BitcoinTestnet = BitcoinParams{
		Name:            "Bitcoin Testnet",
		Network:         "btc-testnet",
		Params:          &chaincfg.TestNet3Params,
		HDCoinType:      1,
		SegwitSupported: true,
	}

	// Litecoin mainnet
	LitecoinMainnet = BitcoinParams{
		Name:       "Litecoin",
		Network:    "ltc",
		HDCoinType: 2,
		Params: &chaincfg.Params{
			Name:                    "litecoin-mainnet",
			Net:                     0xdbb6c0fb,
			PubKeyHashAddrID:        0x30,
			ScriptHashAddrID:        0x32,
			PrivateKeyID:            0xb0,
			WitnessPubKeyHashAddrID: 0x06,
			WitnessScriptHashAddrID: 0x0a,
			Bech32HRPSegwit:         "ltc",
			HDPrivateKeyID:          [4]byte{0x04, 0x88, 0xad, 0xe4},
			HDPublicKeyID:           [4]byte{0x04, 0x88, 0xb2, 0x1e},
		},
		SegwitSupported: true,
	}

	// Dogecoin mainnet
	DogecoinMainnet = BitcoinParams{
		Name:       "Dogecoin",
		Network:    "doge",
		HDCoinType: 3,
		Params: &chaincfg.Params{
			Name:             "dogecoin-mainnet",
			Net:              0xc0c0c0c0,
			PubKeyHashAddrID: 0x1e,
			ScriptHashAddrID: 0x16,
			PrivateKeyID:     0x9e,
			HDPrivateKeyID:   [4]byte{0x02, 0xfa, 0xc3, 0x98},
			HDPublicKeyID:    [4]byte{0x02, 0xfa, 0xca, 0xfd},
		},
		SegwitSupported: false,
	}
)

Predefined network parameters

View Source
var (
	EthereumMainnet = EVMNetwork{Name: "Ethereum", Network: "eth", ChainID: 1}
	Polygon         = EVMNetwork{Name: "Polygon", Network: "polygon", ChainID: 137}
	BSC             = EVMNetwork{Name: "BNB Smart Chain", Network: "bsc", ChainID: 56}
	Arbitrum        = EVMNetwork{Name: "Arbitrum One", Network: "arbitrum", ChainID: 42161}
	Optimism        = EVMNetwork{Name: "Optimism", Network: "optimism", ChainID: 10}
	Avalanche       = EVMNetwork{Name: "Avalanche C-Chain", Network: "avax", ChainID: 43114}
	Fantom          = EVMNetwork{Name: "Fantom", Network: "ftm", ChainID: 250}
	Base            = EVMNetwork{Name: "Base", Network: "base", ChainID: 8453}
)

Common EVM networks

View Source
var BitcoinCashParams = &chaincfg.Params{
	Name:             "bitcoincash-mainnet",
	Net:              0xe8f3e1e3,
	PubKeyHashAddrID: 0x00,
	ScriptHashAddrID: 0x05,
	PrivateKeyID:     0x80,
	HDPrivateKeyID:   [4]byte{0x04, 0x88, 0xad, 0xe4},
	HDPublicKeyID:    [4]byte{0x04, 0x88, 0xb2, 0x1e},
}

BitcoinCashParams holds BCH-specific parameters

View Source
var DashMainnet = BitcoinParams{
	Name:       "Dash",
	Network:    "dash",
	HDCoinType: 5,
	Params: &chaincfg.Params{
		Name:             "dash-mainnet",
		Net:              0xbf0c6bbd,
		PubKeyHashAddrID: 0x4c,
		ScriptHashAddrID: 0x10,
		PrivateKeyID:     0xcc,
		HDPrivateKeyID:   [4]byte{0x04, 0x88, 0xad, 0xe4},
		HDPublicKeyID:    [4]byte{0x04, 0x88, 0xb2, 0x1e},
	},
	SegwitSupported: false,
}

Dash mainnet parameters

Functions

This section is empty.

Types

type BitcoinCashGenerator

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

BitcoinCashGenerator generates Bitcoin Cash wallets with CashAddr format

func BitcoinCash

func BitcoinCash() *BitcoinCashGenerator

BitcoinCash returns a Bitcoin Cash generator

func NewBitcoinCashGenerator

func NewBitcoinCashGenerator() *BitcoinCashGenerator

NewBitcoinCashGenerator creates a new BCH generator

func (*BitcoinCashGenerator) CoinType

func (g *BitcoinCashGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (145 for BCH)

func (*BitcoinCashGenerator) Generate

func (g *BitcoinCashGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a BCH wallet at the specified index

func (*BitcoinCashGenerator) Network

func (g *BitcoinCashGenerator) Network() string

Network returns the network identifier

type BitcoinGenerator

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

BitcoinGenerator generates Bitcoin-like wallets

func Bitcoin

func Bitcoin() *BitcoinGenerator

Bitcoin returns a Bitcoin SegWit generator

func BitcoinLegacy

func BitcoinLegacy() *BitcoinGenerator

BitcoinLegacy returns a Bitcoin Legacy generator

func BitcoinSegWitCompat added in v1.1.0

func BitcoinSegWitCompat() *BitcoinGenerator

BitcoinSegWitCompat returns a Bitcoin SegWit-compatible (P2SH-P2WPKH) generator

func BitcoinTaproot added in v1.1.0

func BitcoinTaproot() *BitcoinGenerator

BitcoinTaproot returns a Bitcoin Taproot (P2TR) generator

func DASH added in v1.1.0

func DASH() *BitcoinGenerator

DASH is an alias for Dash

func Dash added in v1.1.0

func Dash() *BitcoinGenerator

Dash returns a Dash generator (BIP44, legacy addresses starting with X) Path: m/44'/5'/0'/0/index

func Dogecoin

func Dogecoin() *BitcoinGenerator

Dogecoin returns a Dogecoin generator (legacy only)

func Litecoin

func Litecoin() *BitcoinGenerator

Litecoin returns a Litecoin SegWit generator

func LitecoinLegacy

func LitecoinLegacy() *BitcoinGenerator

LitecoinLegacy returns a Litecoin Legacy generator

func LitecoinSegWitCompat added in v1.1.0

func LitecoinSegWitCompat() *BitcoinGenerator

LitecoinSegWitCompat returns a Litecoin SegWit-compatible (P2SH-P2WPKH) generator

func NewBitcoinGenerator

func NewBitcoinGenerator(params BitcoinParams, addrType hdwallet.AddressType) *BitcoinGenerator

NewBitcoinGenerator creates a new Bitcoin generator

func (*BitcoinGenerator) CoinType

func (g *BitcoinGenerator) CoinType() uint32

CoinType returns the BIP44 coin type

func (*BitcoinGenerator) Generate

func (g *BitcoinGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a wallet at the specified index

func (*BitcoinGenerator) Network

func (g *BitcoinGenerator) Network() string

Network returns the network identifier

type BitcoinParams

type BitcoinParams struct {
	Name            string
	Network         string
	Params          *chaincfg.Params
	HDCoinType      uint32
	SegwitSupported bool
}

BitcoinParams holds network-specific parameters

type CustomPathGenerator

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

CustomPathGenerator allows generating wallets with arbitrary derivation paths

func BitcoinCashCustomPath added in v1.1.0

func BitcoinCashCustomPath(path string) (*CustomPathGenerator, error)

BitcoinCashCustomPath creates a Bitcoin Cash generator with custom derivation path

func BitcoinCustomPath

func BitcoinCustomPath(path string) (*CustomPathGenerator, error)

BitcoinCustomPath creates a Bitcoin generator with custom derivation path Example paths:

  • "m/44'/0'/0'/0/0" - Legacy
  • "m/49'/0'/0'/0/0" - SegWit wrapped
  • "m/84'/0'/0'/0/0" - SegWit native
  • "m/86'/0'/0'/0/0" - Taproot

func DashCustomPath added in v1.1.0

func DashCustomPath(path string) (*CustomPathGenerator, error)

DashCustomPath creates a Dash generator with custom derivation path

func DogecoinCustomPath

func DogecoinCustomPath(path string) (*CustomPathGenerator, error)

DogecoinCustomPath creates a Dogecoin generator with custom derivation path

func EthereumCustomPath

func EthereumCustomPath(path string) (*CustomPathGenerator, error)

EthereumCustomPath creates an Ethereum generator with custom derivation path Example paths:

  • "m/44'/60'/0'/0/0" - Standard (MetaMask default)
  • "m/44'/60'/0'/0/1" - Second address
  • "m/44'/60'/1'/0/0" - Second account

func LitecoinCustomPath

func LitecoinCustomPath(path string) (*CustomPathGenerator, error)

LitecoinCustomPath creates a Litecoin generator with custom derivation path

func PolkadotCustomPath added in v1.1.0

func PolkadotCustomPath(path string) (*CustomPathGenerator, error)

PolkadotCustomPath creates a Polkadot generator with custom derivation path Note: All Polkadot path components must be hardened (Ed25519 requirement)

func RippleCustomPath added in v1.1.0

func RippleCustomPath(path string) (*CustomPathGenerator, error)

RippleCustomPath creates a Ripple generator with custom derivation path

func SUICustomPath added in v1.1.0

func SUICustomPath(path string) (*CustomPathGenerator, error)

SUICustomPath creates a SUI generator with custom derivation path Note: All SUI path components must be hardened (Ed25519 requirement)

func SolanaCustomPath

func SolanaCustomPath(path string) (*CustomPathGenerator, error)

SolanaCustomPath creates a Solana generator with custom derivation path Example paths:

  • "m/44'/501'/0'/0'" - Phantom/Solflare standard
  • "m/44'/501'/0'" - Trust Wallet
  • "m/44'/501'/1'/0'" - Second account (Phantom)

Note: All Solana path components must be hardened (Ed25519 requirement)

func StellarCustomPath added in v1.1.0

func StellarCustomPath(path string) (*CustomPathGenerator, error)

StellarCustomPath creates a Stellar generator with custom derivation path Note: All Stellar path components must be hardened (Ed25519 requirement)

func TronCustomPath

func TronCustomPath(path string) (*CustomPathGenerator, error)

TronCustomPath creates a Tron generator with custom derivation path Example paths:

  • "m/44'/195'/0'/0/0" - Standard

func ZcashCustomPath added in v1.1.0

func ZcashCustomPath(path string) (*CustomPathGenerator, error)

ZcashCustomPath creates a Zcash generator with custom derivation path

func (*CustomPathGenerator) CoinType

func (g *CustomPathGenerator) CoinType() uint32

CoinType returns the BIP44 coin type

func (*CustomPathGenerator) Generate

func (g *CustomPathGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a wallet using the custom path

func (*CustomPathGenerator) Network

func (g *CustomPathGenerator) Network() string

Network returns the network identifier

type EVMNetwork

type EVMNetwork struct {
	Name    string
	Network string
	ChainID int64
}

EVMNetwork represents an EVM-compatible network

type EthereumGenerator

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

EthereumGenerator generates Ethereum/EVM wallets

func EVM

func EVM(network EVMNetwork) *EthereumGenerator

EVM returns a generator for any EVM-compatible network The generated address is the same for all EVM networks

func Ethereum

func Ethereum() *EthereumGenerator

Ethereum returns an Ethereum mainnet generator

func NewEthereumGenerator

func NewEthereumGenerator(network EVMNetwork) *EthereumGenerator

NewEthereumGenerator creates a new Ethereum generator

func (*EthereumGenerator) CoinType

func (g *EthereumGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (60 for Ethereum)

func (*EthereumGenerator) Generate

func (g *EthereumGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates an Ethereum wallet at the specified index

func (*EthereumGenerator) Network

func (g *EthereumGenerator) Network() string

Network returns the network identifier

type MoneroGenerator added in v1.1.0

type MoneroGenerator struct{}

MoneroGenerator generates Monero (XMR) wallets Uses SLIP-0010 Ed25519 derivation with Monero-specific key conversion Path: m/44'/128'/index' (SLIP-0010 Ed25519)

func Monero added in v1.1.0

func Monero() *MoneroGenerator

Monero returns a Monero (XMR) generator

func NewMoneroGenerator added in v1.1.0

func NewMoneroGenerator() *MoneroGenerator

NewMoneroGenerator creates a new Monero generator

func XMR added in v1.1.0

func XMR() *MoneroGenerator

XMR is an alias for Monero

func (*MoneroGenerator) CoinType added in v1.1.0

func (g *MoneroGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (128 for XMR)

func (*MoneroGenerator) Generate added in v1.1.0

func (g *MoneroGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a Monero wallet at the specified index Path: m/44'/128'/index' Monero derives spend key from BIP39 seed, then view key from spend key

func (*MoneroGenerator) Network added in v1.1.0

func (g *MoneroGenerator) Network() string

Network returns the network identifier

type PolkadotGenerator added in v1.1.0

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

PolkadotGenerator generates Polkadot (DOT) wallets Path: m/44'/354'/index'/0'/0' (SLIP-0010 Ed25519, all hardened)

func DOT added in v1.1.0

func DOT() *PolkadotGenerator

DOT is an alias for Polkadot

func Kusama added in v1.1.0

func Kusama() *PolkadotGenerator

Kusama returns a Kusama (KSM) generator

func NewKusamaGenerator added in v1.1.0

func NewKusamaGenerator() *PolkadotGenerator

NewKusamaGenerator creates a new Kusama generator

func NewPolkadotGenerator added in v1.1.0

func NewPolkadotGenerator() *PolkadotGenerator

NewPolkadotGenerator creates a new Polkadot generator

func Polkadot added in v1.1.0

func Polkadot() *PolkadotGenerator

Polkadot returns a Polkadot (DOT) generator

func (*PolkadotGenerator) CoinType added in v1.1.0

func (g *PolkadotGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (354 for DOT)

func (*PolkadotGenerator) Generate added in v1.1.0

func (g *PolkadotGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a Polkadot wallet at the specified index Path: m/44'/354'/index'/0'/0' (all hardened for Ed25519)

func (*PolkadotGenerator) Network added in v1.1.0

func (g *PolkadotGenerator) Network() string

Network returns the network identifier

type RippleGenerator added in v1.1.0

type RippleGenerator struct{}

RippleGenerator generates Ripple (XRP) wallets Path: m/44'/144'/0'/0/index

func NewRippleGenerator added in v1.1.0

func NewRippleGenerator() *RippleGenerator

NewRippleGenerator creates a new Ripple generator

func Ripple added in v1.1.0

func Ripple() *RippleGenerator

Ripple returns a Ripple (XRP) generator

func XRP added in v1.1.0

func XRP() *RippleGenerator

XRP is an alias for Ripple

func (*RippleGenerator) CoinType added in v1.1.0

func (g *RippleGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (144 for XRP)

func (*RippleGenerator) Generate added in v1.1.0

func (g *RippleGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a Ripple wallet at the specified index

func (*RippleGenerator) Network added in v1.1.0

func (g *RippleGenerator) Network() string

Network returns the network identifier

type SUIGenerator added in v1.1.0

type SUIGenerator struct{}

SUIGenerator generates SUI wallets Path: m/44'/784'/index'/0'/0' (SLIP-0010 Ed25519, all hardened)

func NewSUIGenerator added in v1.1.0

func NewSUIGenerator() *SUIGenerator

NewSUIGenerator creates a new SUI generator

func SUI added in v1.1.0

func SUI() *SUIGenerator

SUI returns a SUI generator

func (*SUIGenerator) CoinType added in v1.1.0

func (g *SUIGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (784 for SUI)

func (*SUIGenerator) Generate added in v1.1.0

func (g *SUIGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a SUI wallet at the specified index Path: m/44'/784'/index'/0'/0' (SLIP-0010 Ed25519)

func (*SUIGenerator) Network added in v1.1.0

func (g *SUIGenerator) Network() string

Network returns the network identifier

type SolanaGenerator

type SolanaGenerator struct{}

SolanaGenerator generates Solana wallets compatible with Phantom, Solflare, Ledger Path: m/44'/501'/account'/0'

func NewSolanaGenerator

func NewSolanaGenerator() *SolanaGenerator

NewSolanaGenerator creates a new Solana generator (Phantom compatible)

func Solana

func Solana() *SolanaGenerator

Solana returns a Solana generator (Phantom/Solflare compatible) Path: m/44'/501'/0'/0'

func SolanaPhantom

func SolanaPhantom() *SolanaGenerator

SolanaPhantom is an alias for Solana() - Phantom compatible

func (*SolanaGenerator) CoinType

func (g *SolanaGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (501 for Solana)

func (*SolanaGenerator) Generate

func (g *SolanaGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a Solana wallet at the specified index Path: m/44'/501'/index'/0' (Phantom, Solflare, Ledger compatible)

func (*SolanaGenerator) Network

func (g *SolanaGenerator) Network() string

Network returns the network identifier

type SolanaTrustWalletGenerator

type SolanaTrustWalletGenerator struct{}

SolanaTrustWalletGenerator generates Solana wallets compatible with Trust Wallet Path: m/44'/501'/account' (3 levels, no change level)

func NewSolanaTrustWalletGenerator

func NewSolanaTrustWalletGenerator() *SolanaTrustWalletGenerator

NewSolanaTrustWalletGenerator creates a new Solana generator (Trust Wallet compatible)

func SolanaTrustWallet

func SolanaTrustWallet() *SolanaTrustWalletGenerator

SolanaTrustWallet returns a Trust Wallet compatible Solana generator Path: m/44'/501'/0' (different from Phantom!)

func (*SolanaTrustWalletGenerator) CoinType

func (g *SolanaTrustWalletGenerator) CoinType() uint32

CoinType returns the BIP44 coin type

func (*SolanaTrustWalletGenerator) Generate

func (g *SolanaTrustWalletGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a Solana wallet at the specified index Path: m/44'/501'/index' (Trust Wallet compatible - 3 levels only!)

func (*SolanaTrustWalletGenerator) Network

func (g *SolanaTrustWalletGenerator) Network() string

Network returns the network identifier

type StellarGenerator added in v1.1.0

type StellarGenerator struct{}

StellarGenerator generates Stellar Lumens (XLM) wallets Path: m/44'/148'/index' (SLIP-0010 Ed25519, all hardened)

func NewStellarGenerator added in v1.1.0

func NewStellarGenerator() *StellarGenerator

NewStellarGenerator creates a new Stellar generator

func Stellar added in v1.1.0

func Stellar() *StellarGenerator

Stellar returns a Stellar Lumens (XLM) generator

func XLM added in v1.1.0

func XLM() *StellarGenerator

XLM is an alias for Stellar

func (*StellarGenerator) CoinType added in v1.1.0

func (g *StellarGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (148 for XLM)

func (*StellarGenerator) Generate added in v1.1.0

func (g *StellarGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a Stellar wallet at the specified index Path: m/44'/148'/index' (SEP-0005 standard)

func (*StellarGenerator) Network added in v1.1.0

func (g *StellarGenerator) Network() string

Network returns the network identifier

type TONBip39Generator

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

TONBip39Generator generates TON wallets from BIP39 mnemonic using SLIP-0010 Compatible with: Trust Wallet, Ledger, and other BIP39-based wallets

func NewTONBip39Generator

func NewTONBip39Generator(version TONWalletVersion) *TONBip39Generator

NewTONBip39Generator creates a new TON generator for BIP39 mnemonics

func TONBip39

func TONBip39(version TONWalletVersion) *TONBip39Generator

TONBip39 returns a TON generator using BIP39 mnemonic with SLIP-0010 This is an alias for TONTrustWallet

func TONTrustWallet

func TONTrustWallet() *TONBip39Generator

TONTrustWallet returns a TON generator compatible with Trust Wallet (BIP39) Use this for: Trust Wallet, Ledger, and other BIP39-based wallets

func TONTrustWalletV5

func TONTrustWalletV5() *TONBip39Generator

TONTrustWalletV5 returns a TON v5 generator compatible with Trust Wallet

func (*TONBip39Generator) CoinType

func (g *TONBip39Generator) CoinType() uint32

CoinType returns the BIP44 coin type (607 for TON)

func (*TONBip39Generator) Generate

func (g *TONBip39Generator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a TON wallet from BIP39 seed using SLIP-0010 derivation Path: m/44'/607'/0' (standard for Trust Wallet) This is compatible with Trust Wallet and other BIP39-based TON wallets

func (*TONBip39Generator) Network

func (g *TONBip39Generator) Network() string

Network returns the network identifier

type TONMnemonicType

type TONMnemonicType string

TONMnemonicType represents the type of mnemonic used

const (
	// TONMnemonicNative - native TON 24-word mnemonic (Tonkeeper, Tonhub, MyTonWallet)
	TONMnemonicNative TONMnemonicType = "native"
	// TONMnemonicBIP39 - standard BIP39 mnemonic with SLIP-0010 derivation (Trust Wallet, Ledger)
	TONMnemonicBIP39 TONMnemonicType = "bip39"
)

type TONNativeGenerator

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

TONNativeGenerator uses TON's native mnemonic system Compatible with: Tonkeeper, Tonhub, MyTonWallet, TON official wallets

func NewTONNativeGenerator

func NewTONNativeGenerator(version TONWalletVersion) *TONNativeGenerator

NewTONNativeGenerator creates a generator that uses TON's native approach

func TON

func TON() *TONNativeGenerator

TON returns a TON v4r2 native generator (Tonkeeper compatible) Use this for: Tonkeeper, Tonhub, MyTonWallet

func TONV5

func TONV5() *TONNativeGenerator

TONV5 returns a TON v5r1 native generator

func TONWithVersion

func TONWithVersion(version TONWalletVersion) *TONNativeGenerator

TONWithVersion returns a TON native generator with specified version

func (*TONNativeGenerator) CoinType

func (g *TONNativeGenerator) CoinType() uint32

CoinType returns the BIP44 coin type

func (*TONNativeGenerator) Generate

func (g *TONNativeGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate is not supported for TON native - use GenerateNew or GenerateFromTONMnemonic

func (*TONNativeGenerator) GenerateFromTONMnemonic

func (g *TONNativeGenerator) GenerateFromTONMnemonic(mnemonic string) (*hdwallet.WalletInfo, error)

GenerateFromTONMnemonic creates a TON wallet from an existing TON mnemonic (24 words)

func (*TONNativeGenerator) GenerateNew

func (g *TONNativeGenerator) GenerateNew() (*hdwallet.WalletInfo, string, error)

GenerateNew creates a new TON wallet with a fresh native mnemonic (24 words)

func (*TONNativeGenerator) Network

func (g *TONNativeGenerator) Network() string

Network returns the network identifier

type TONWalletVersion

type TONWalletVersion string

TONWalletVersion represents the version of TON wallet contract

const (
	TONV3R2 TONWalletVersion = "v3r2"
	TONV4R2 TONWalletVersion = "v4r2"
	TONV5R1 TONWalletVersion = "v5r1"
)

type TronGenerator

type TronGenerator struct{}

TronGenerator generates Tron wallets

func NewTronGenerator

func NewTronGenerator() *TronGenerator

NewTronGenerator creates a new Tron generator

func Tron

func Tron() *TronGenerator

Tron returns a Tron generator

func (*TronGenerator) CoinType

func (g *TronGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (195 for Tron)

func (*TronGenerator) Generate

func (g *TronGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a Tron wallet at the specified index

func (*TronGenerator) Network

func (g *TronGenerator) Network() string

Network returns the network identifier

type ZcashGenerator added in v1.1.0

type ZcashGenerator struct{}

ZcashGenerator generates Zcash (ZEC) transparent wallets Path: m/44'/133'/0'/0/index

func NewZcashGenerator added in v1.1.0

func NewZcashGenerator() *ZcashGenerator

NewZcashGenerator creates a new Zcash generator

func ZEC added in v1.1.0

func ZEC() *ZcashGenerator

ZEC is an alias for Zcash

func Zcash added in v1.1.0

func Zcash() *ZcashGenerator

Zcash returns a Zcash transparent address generator

func (*ZcashGenerator) CoinType added in v1.1.0

func (g *ZcashGenerator) CoinType() uint32

CoinType returns the BIP44 coin type (133 for ZEC)

func (*ZcashGenerator) Generate added in v1.1.0

func (g *ZcashGenerator) Generate(seed []byte, index uint32) (*hdwallet.WalletInfo, error)

Generate creates a Zcash transparent wallet at the specified index

func (*ZcashGenerator) Network added in v1.1.0

func (g *ZcashGenerator) Network() string

Network returns the network identifier

Jump to

Keyboard shortcuts

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