Documentation
¶
Index ¶
- Constants
- Variables
- type AddressType
- type CalculateTxSizeData
- type Config
- type Doge
- type GenerateAddressData
- type TxBuilder
- func (s *TxBuilder) AddInput(input TxInput) error
- func (s *TxBuilder) AddOutput(address string, amount decimal.Decimal) error
- func (s *TxBuilder) CalculateTxSize(feePerByte decimal.Decimal) CalculateTxSizeData
- func (s *TxBuilder) EmulateTxSize(feePerByte decimal.Decimal) (CalculateTxSizeData, error)
- func (s *TxBuilder) MsgTx() *wire.MsgTx
- func (s *TxBuilder) SignTx() error
- type TxInput
- type WalletSDK
- func (s *WalletSDK) AddressFromPrivateKey(privateKeyWIF string) (string, *btcec.PrivateKey, error)
- func (s *WalletSDK) ChainParams() *chaincfg.Params
- func (s *WalletSDK) DecodeAddressType(address string) (AddressType, error)
- func (s *WalletSDK) GenerateAddress(mnemonic, passphrase string, sequenceNumber uint32) (*GenerateAddressData, error)
- func (s *WalletSDK) ValidateAddress(address string) bool
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 Config ¶
type Config struct {
RPCConfig *rpcclient.ConnConfig
}
type Doge ¶
type Doge struct {
WalletSDK *WalletSDK
// contains filtered or unexported fields
}
func (*Doge) EstimateFeePerByte ¶ added in v0.9.13
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.
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 NewTxBuilder ¶
func (*TxBuilder) CalculateTxSize ¶
func (s *TxBuilder) CalculateTxSize(feePerByte decimal.Decimal) CalculateTxSizeData
func (*TxBuilder) EmulateTxSize ¶
func (s *TxBuilder) EmulateTxSize(feePerByte decimal.Decimal) (CalculateTxSizeData, error)
type WalletSDK ¶
type WalletSDK struct {
// contains filtered or unexported fields
}
func NewWalletSDK ¶
func (*WalletSDK) AddressFromPrivateKey ¶
func (*WalletSDK) ChainParams ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.