key

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtPrivkeyApi

type ExtPrivkeyApi interface {
	GetPubkey(extPrivkey *types.ExtPrivkey) (pubkey *types.Pubkey, err error)
	GetPrivkey(extPrivkey *types.ExtPrivkey) (privkey *types.Privkey, err error)
	GetExtPubkey(extPrivkey *types.ExtPrivkey) (pubkey *types.ExtPubkey, err error)
	GetExtPrivkeyByPath(extPrivkey *types.ExtPrivkey, bip32Path string) (derivedPrivkey *types.ExtPrivkey, err error)
	GetData(extPrivkey *types.ExtPrivkey) (data *types.ExtkeyData, err error)
}

type ExtPrivkeyApiImpl

type ExtPrivkeyApiImpl struct {
	cfdErrors.HasInitializeError
	// contains filtered or unexported fields
}

func NewExtPrivkeyApi

func NewExtPrivkeyApi(options ...config.CfdConfigOption) *ExtPrivkeyApiImpl

func (*ExtPrivkeyApiImpl) GetData

func (k *ExtPrivkeyApiImpl) GetData(extPrivkey *types.ExtPrivkey) (data *types.ExtkeyData, err error)

GetData ...

func (*ExtPrivkeyApiImpl) GetExtPrivkeyByPath

func (k *ExtPrivkeyApiImpl) GetExtPrivkeyByPath(extPrivkey *types.ExtPrivkey, bip32Path string) (derivedPrivkey *types.ExtPrivkey, err error)

func (*ExtPrivkeyApiImpl) GetExtPubkey

func (k *ExtPrivkeyApiImpl) GetExtPubkey(extPrivkey *types.ExtPrivkey) (pubkey *types.ExtPubkey, err error)

GetExtPubkey

func (*ExtPrivkeyApiImpl) GetPrivkey

func (k *ExtPrivkeyApiImpl) GetPrivkey(extPrivkey *types.ExtPrivkey) (privkey *types.Privkey, err error)

GetPrivkey

func (*ExtPrivkeyApiImpl) GetPubkey

func (k *ExtPrivkeyApiImpl) GetPubkey(extPrivkey *types.ExtPrivkey) (pubkey *types.Pubkey, err error)

GetPubkey ...

func (*ExtPrivkeyApiImpl) Valid

func (k *ExtPrivkeyApiImpl) Valid(extPrivkey *types.ExtPrivkey) error

Valid ...

type ExtPubkeyApi

type ExtPubkeyApi interface {
	GetPubkey(extPubkey *types.ExtPubkey) (pubkey *types.Pubkey, err error)
	// GetExtPubkeyByPath ...
	GetExtPubkeyByPath(extPubkey *types.ExtPubkey, bip32Path string) (derivedPubkey *types.ExtPubkey, err error)
	GetData(extPubkey *types.ExtPubkey) (data *types.ExtkeyData, err error)
}

type ExtPubkeyApiImpl

type ExtPubkeyApiImpl struct {
	cfdErrors.HasInitializeError
	// contains filtered or unexported fields
}

func NewExtPubkeyApi

func NewExtPubkeyApi(options ...config.CfdConfigOption) *ExtPubkeyApiImpl

func (*ExtPubkeyApiImpl) GetData

func (k *ExtPubkeyApiImpl) GetData(extPubkey *types.ExtPubkey) (data *types.ExtkeyData, err error)

GetData ...

func (*ExtPubkeyApiImpl) GetExtPubkeyByPath

func (k *ExtPubkeyApiImpl) GetExtPubkeyByPath(extPubkey *types.ExtPubkey, bip32Path string) (derivedPubkey *types.ExtPubkey, err error)

GetExtPubkeyByPath ...

func (*ExtPubkeyApiImpl) GetPubkey

func (k *ExtPubkeyApiImpl) GetPubkey(extPubkey *types.ExtPubkey) (pubkey *types.Pubkey, err error)

GetPubkey ...

func (*ExtPubkeyApiImpl) Valid

func (k *ExtPubkeyApiImpl) Valid(extPubkey *types.ExtPubkey) error

Valid ...

type HdWalletApi

type HdWalletApi interface {
	GetExtPrivkey(seed *types.ByteData) (privkey *types.ExtPrivkey, err error)
	GetExtPrivkeyByPath(seed *types.ByteData, bip32Path string) (derivedPrivkey *types.ExtPrivkey, err error)
	GetExtPubkeyByPath(seed *types.ByteData, bip32Path string) (derivedPubkey *types.ExtPubkey, err error)
	GetSeedFromMnemonicEng(mnemonic []string) (seed *types.ByteData, entropy *types.ByteData, err error)
	GetSeedFromMnemonicEngAndPassphrase(mnemonic []string, passphrase string) (seed *types.ByteData, entropy *types.ByteData, err error)
	GetMnemonicFromEntropyEng(entropy *types.ByteData) (mnemonic *[]string, err error)
	GetSeedFromMnemonic(mnemonic []string, language string) (seed *types.ByteData, entropy *types.ByteData, err error)
	GetSeedFromMnemonicAndPassphrase(mnemonic []string, language string, passphrase string) (seed *types.ByteData, entropy *types.ByteData, err error)
	GetMnemonicFromEntropy(entropy *types.ByteData, language string) (mnemonic *[]string, err error)
}

type HdWalletApiImpl

type HdWalletApiImpl struct {
	cfdErrors.HasInitializeError
	// contains filtered or unexported fields
}

func NewHdWalletApi

func NewHdWalletApi(options ...config.CfdConfigOption) *HdWalletApiImpl

func (*HdWalletApiImpl) GetExtPrivkey

func (h *HdWalletApiImpl) GetExtPrivkey(seed *types.ByteData) (privkey *types.ExtPrivkey, err error)

func (*HdWalletApiImpl) GetExtPrivkeyByPath

func (h *HdWalletApiImpl) GetExtPrivkeyByPath(seed *types.ByteData, bip32Path string) (derivedPrivkey *types.ExtPrivkey, err error)

func (*HdWalletApiImpl) GetExtPubkeyByPath

func (h *HdWalletApiImpl) GetExtPubkeyByPath(seed *types.ByteData, bip32Path string) (derivedPubkey *types.ExtPubkey, err error)

func (*HdWalletApiImpl) GetMnemonicFromEntropy

func (h *HdWalletApiImpl) GetMnemonicFromEntropy(entropy *types.ByteData, language string) (mnemonic *[]string, err error)

func (*HdWalletApiImpl) GetMnemonicFromEntropyEng

func (h *HdWalletApiImpl) GetMnemonicFromEntropyEng(entropy *types.ByteData) (mnemonic *[]string, err error)

func (*HdWalletApiImpl) GetSeedFromMnemonic

func (h *HdWalletApiImpl) GetSeedFromMnemonic(mnemonic []string, language string) (seed *types.ByteData, entropy *types.ByteData, err error)

func (*HdWalletApiImpl) GetSeedFromMnemonicAndPassphrase

func (h *HdWalletApiImpl) GetSeedFromMnemonicAndPassphrase(mnemonic []string, language string, passphrase string) (seed *types.ByteData, entropy *types.ByteData, err error)

func (*HdWalletApiImpl) GetSeedFromMnemonicEng

func (h *HdWalletApiImpl) GetSeedFromMnemonicEng(mnemonic []string) (seed *types.ByteData, entropy *types.ByteData, err error)

func (*HdWalletApiImpl) GetSeedFromMnemonicEngAndPassphrase

func (h *HdWalletApiImpl) GetSeedFromMnemonicEngAndPassphrase(mnemonic []string, passphrase string) (seed *types.ByteData, entropy *types.ByteData, err error)

type PrivkeyApi

type PrivkeyApi interface {
	HasWif(wif string) bool
	GetWifFromHex(privkeyHex string) (privkey *types.Privkey, err error)
	GetWifFromHexWithCompressedPubkey(privkeyHex string, compressedPubkey bool) (privkey *types.Privkey, err error)
	GetPrivkeyFromWif(wif string) (privkey *types.Privkey, err error)
	GetPubkey(privkey *types.Privkey) (pubkey *types.Pubkey, err error)
	CreateEcSignature(privkey *types.Privkey, sighash *types.ByteData, sighashType *types.SigHashType) (signature *types.ByteData, err error)
	CreateEcSignatureGrindR(privkey *types.Privkey, sighash *types.ByteData, sighashType *types.SigHashType, grindR bool) (signature *types.ByteData, err error)
}

PrivkeyApi This interface has privkey operation API.

type PrivkeyApiImpl

type PrivkeyApiImpl struct {
	cfdErrors.HasInitializeError
	// contains filtered or unexported fields
}

func NewPrivkeyApi

func NewPrivkeyApi(options ...config.CfdConfigOption) *PrivkeyApiImpl

func (*PrivkeyApiImpl) CreateEcSignature

func (k *PrivkeyApiImpl) CreateEcSignature(privkey *types.Privkey, sighash *types.ByteData, sighashType *types.SigHashType) (signature *types.ByteData, err error)

CreateEcSignature ...

func (*PrivkeyApiImpl) CreateEcSignatureGrindR

func (k *PrivkeyApiImpl) CreateEcSignatureGrindR(privkey *types.Privkey, sighash *types.ByteData, sighashType *types.SigHashType, grindR bool) (signature *types.ByteData, err error)

CreateEcSignatureGrindR ...

func (*PrivkeyApiImpl) GetPrivkeyFromWif

func (k *PrivkeyApiImpl) GetPrivkeyFromWif(wif string) (privkey *types.Privkey, err error)

GetPrivkeyFromWif ...

func (*PrivkeyApiImpl) GetPubkey

func (k *PrivkeyApiImpl) GetPubkey(privkey *types.Privkey) (pubkey *types.Pubkey, err error)

GetPubkey ...

func (*PrivkeyApiImpl) GetWifFromHex

func (k *PrivkeyApiImpl) GetWifFromHex(privkeyHex string) (privkey *types.Privkey, err error)

GetWifFromHex ...

func (*PrivkeyApiImpl) GetWifFromHexWithCompressedPubkey

func (k *PrivkeyApiImpl) GetWifFromHexWithCompressedPubkey(privkeyHex string, compressedPubkey bool) (privkey *types.Privkey, err error)

GetWifFromHexWithCompressedPubkey ...

func (*PrivkeyApiImpl) HasWif

func (k *PrivkeyApiImpl) HasWif(wif string) bool

HasWif ...

type PubkeyApi

type PubkeyApi interface {
	// Verify ...
	Verify(pubkey *types.Pubkey) error
	// IsCompressed ...
	IsCompressed(pubkey *types.Pubkey) error
	// VerifyEcSignature ...
	VerifyEcSignature(pubkey *types.Pubkey, sighash, signature string) (isVerify bool, err error)
}

PubkeyApi This interface has pubkey operation API.

type PubkeyApiImpl

type PubkeyApiImpl struct {
}

func NewPubkeyApi

func NewPubkeyApi() *PubkeyApiImpl

func (*PubkeyApiImpl) IsCompressed

func (p *PubkeyApiImpl) IsCompressed(pubkey *types.Pubkey) error

IsCompressed ...

func (*PubkeyApiImpl) Verify

func (p *PubkeyApiImpl) Verify(pubkey *types.Pubkey) error

Verify ...

func (*PubkeyApiImpl) VerifyEcSignature

func (p *PubkeyApiImpl) VerifyEcSignature(pubkey *types.Pubkey, sighash, signature string) (isVerify bool, err error)

VerifyEcSignature ...

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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