doge

package
v0.9.13-RC02 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssetIdentifier = "doge"
	AssetDecimals   = 1e8
)

Variables

View Source
var (
	ErrInputAlreadyUsed    = errors.New("input already used")
	ErrOutputAlreadyExists = errors.New("output already exists")
)
View Source
var DogecoinMainNetParams = btcchaincfg.Params{
	Name:        "dogecoin",
	Net:         0xc0c0c0c0,
	DefaultPort: "22556",
	DNSSeeds: []btcchaincfg.DNSSeed{
		{Host: "seed.dogecoin.com", HasFiltering: true},
		{Host: "seed2.dogecoin.com", HasFiltering: true},
		{Host: "seed.multidoge.org", HasFiltering: true},
		{Host: "seed2.multidoge.org", HasFiltering: true},
		{Host: "seed.moolah.io", HasFiltering: true},
		{Host: "seed.vdigger.com", HasFiltering: true},
	},
	GenesisHash:              newHashFromStr("1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"),
	PowLimit:                 new(big.Int).SetBytes(hexDecode("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffff")),
	TargetTimespan:           time.Hour * 4,
	TargetTimePerBlock:       time.Minute,
	RetargetAdjustmentFactor: 4,
	CoinbaseMaturity:         30,
	SubsidyReductionInterval: 100000,
	PubKeyHashAddrID:         0x1e,
	ScriptHashAddrID:         0x16,
	PrivateKeyID:             0x9e,
	HDPrivateKeyID:           [4]byte{0x02, 0xfa, 0xc3, 0x98},
	HDPublicKeyID:            [4]byte{0x02, 0xfa, 0xca, 0xfd},
	HDCoinType:               3,
	Bech32HRPSegwit:          "",
	BIP0034Height:            21111,
	BIP0065Height:            22857,
	BIP0066Height:            91812,
}

DogecoinMainNetParams defines the network parameters for Dogecoin Mainnet.

View Source
var DogecoinTestNet3Params = btcchaincfg.Params{
	Name:        "dogecoin-testnet",
	Net:         0xfcc1b7dc,
	DefaultPort: "44556",
	DNSSeeds: []btcchaincfg.DNSSeed{
		{Host: "testnet-seed.dogecoin.com"},
		{Host: "testnet-seed.multidoge.org"},
	},
	GenesisHash:              newHashFromStr("bb0a78264637406b6360aad926e6b0c2f20a3e6f914716cd76606cbeb7df48ab"),
	PowLimit:                 new(big.Int).SetBytes(hexDecode("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffff")),
	TargetTimespan:           time.Hour * 4,
	TargetTimePerBlock:       time.Minute,
	RetargetAdjustmentFactor: 4,
	CoinbaseMaturity:         30,
	SubsidyReductionInterval: 100000,
	PubKeyHashAddrID:         0x71,
	ScriptHashAddrID:         0xc4,
	PrivateKeyID:             0xf1,
	HDPrivateKeyID:           [4]byte{0x04, 0x35, 0x83, 0x94},
	HDPublicKeyID:            [4]byte{0x04, 0x35, 0x87, 0xcf},
	HDCoinType:               3,
	Bech32HRPSegwit:          "",
	BIP0034Height:            1,
	BIP0065Height:            1,
	BIP0066Height:            1,
}

DogecoinTestNet3Params defines the network parameters for Dogecoin Testnet.

Functions

This section is empty.

Types

type AddressType

type AddressType string
const (
	AddressTypeP2PKH AddressType = "P2PKH" // Legacy
	AddressTypeP2SH  AddressType = "P2SH"  // SegWit (nested)
)

func DecodeAddressType

func DecodeAddressType(address string, chainParams *chaincfg.Params) (AddressType, error)

func (AddressType) Validate

func (t AddressType) Validate() error

type CalculateTxSizeData

type CalculateTxSizeData struct {
	TxFullSize     decimal.Decimal
	TxStrippedSize decimal.Decimal
	Weight         decimal.Decimal
	VSize          decimal.Decimal
	TotalFee       decimal.Decimal
}

type Config

type Config struct {
	RPCConfig *rpcclient.ConnConfig
}

type Doge

type Doge struct {
	WalletSDK *WalletSDK
	// contains filtered or unexported fields
}

func NewDoge

func NewDoge(conf Config, walletSDK *WalletSDK) (*Doge, error)

func (*Doge) EstimateFeePerByte added in v0.9.13

func (d *Doge) EstimateFeePerByte() (decimal.Decimal, error)

EstimateFeePerByte returns the current network fee rate in base units per virtual byte estimated by the node. Returns zero if the node does not have enough data for the estimate yet.

func (*Doge) Name

func (d *Doge) Name() string

Name returns the service name

func (*Doge) Node

func (d *Doge) Node() *rpcclient.Client

Node returns the RPC client

func (*Doge) Start

func (d *Doge) Start(_ context.Context) error

Start

func (*Doge) Stop

func (d *Doge) Stop(_ context.Context) error

Stop

type GenerateAddressData

type GenerateAddressData struct {
	Address       ltcutil.Address
	PublicKey     *btcec.PublicKey
	PrivateKey    *btcec.PrivateKey
	PrivateKeyWIF *ltcutil.WIF
	MasterKey     *hdkeychain.ExtendedKey
	Sequence      uint32
	// contains filtered or unexported fields
}

func (GenerateAddressData) AddressPubKey

func (s GenerateAddressData) AddressPubKey() (string, error)

type TxBuilder

type TxBuilder struct {
	Inputs []TxInput
	// contains filtered or unexported fields
}

func NewTransactionFromBuilder

func NewTransactionFromBuilder(builder *TxBuilder) *TxBuilder

func NewTxBuilder

func NewTxBuilder(chainParams *chaincfg.Params) *TxBuilder

func (*TxBuilder) AddInput

func (s *TxBuilder) AddInput(input TxInput) error

func (*TxBuilder) AddOutput

func (s *TxBuilder) AddOutput(address string, amount decimal.Decimal) error

func (*TxBuilder) CalculateTxSize

func (s *TxBuilder) CalculateTxSize(feePerByte decimal.Decimal) CalculateTxSizeData

func (*TxBuilder) EmulateTxSize

func (s *TxBuilder) EmulateTxSize(feePerByte decimal.Decimal) (CalculateTxSizeData, error)

func (*TxBuilder) MsgTx

func (s *TxBuilder) MsgTx() *wire.MsgTx

MsgTx

func (*TxBuilder) SignTx

func (s *TxBuilder) SignTx() error

SignTx

type TxInput

type TxInput struct {
	PrivateKey *btcec.PrivateKey
	PkScript   string
	Hash       string
	Sequence   uint32
	Amount     int64
}

type WalletSDK

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

func NewWalletSDK

func NewWalletSDK(chainParams *chaincfg.Params) *WalletSDK

func (*WalletSDK) AddressFromPrivateKey

func (s *WalletSDK) AddressFromPrivateKey(privateKeyWIF string) (string, *btcec.PrivateKey, error)

func (*WalletSDK) ChainParams

func (s *WalletSDK) ChainParams() *chaincfg.Params

func (*WalletSDK) DecodeAddressType

func (s *WalletSDK) DecodeAddressType(address string) (AddressType, error)

func (*WalletSDK) GenerateAddress

func (s *WalletSDK) GenerateAddress(mnemonic, passphrase string, sequenceNumber uint32) (*GenerateAddressData, error)

func (*WalletSDK) ValidateAddress

func (s *WalletSDK) ValidateAddress(address string) bool

Jump to

Keyboard shortcuts

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