Documentation ¶
Index ¶
- Constants
- type Bip32Item
- type ExtPrivkeyApi
- type ExtPrivkeyApiImpl
- func (k *ExtPrivkeyApiImpl) GetData(extPrivkey *types.ExtPrivkey) (data *types.ExtkeyData, err error)
- func (k *ExtPrivkeyApiImpl) GetExtPrivkeyByPath(extPrivkey *types.ExtPrivkey, bip32Path string) (derivedPrivkey *types.ExtPrivkey, err error)
- func (k *ExtPrivkeyApiImpl) GetExtPubkey(extPrivkey *types.ExtPrivkey) (pubkey *types.ExtPubkey, err error)
- func (k *ExtPrivkeyApiImpl) GetPrivkey(extPrivkey *types.ExtPrivkey) (privkey *types.Privkey, err error)
- func (k *ExtPrivkeyApiImpl) GetPubkey(extPrivkey *types.ExtPrivkey) (pubkey *types.Pubkey, err error)
- func (k *ExtPrivkeyApiImpl) Valid(extPrivkey *types.ExtPrivkey) error
- type ExtPubkeyApi
- type ExtPubkeyApiImpl
- func (k *ExtPubkeyApiImpl) ConvertToBip32(extPubkey *types.ExtPubkey) (bip32ExtPubkey *types.ExtPubkey, err error)
- func (k *ExtPubkeyApiImpl) GetData(extPubkey *types.ExtPubkey) (data *types.ExtkeyData, err error)
- func (k *ExtPubkeyApiImpl) GetExtPubkeyByPath(extPubkey *types.ExtPubkey, bip32Path string) (derivedPubkey *types.ExtPubkey, err error)
- func (k *ExtPubkeyApiImpl) GetPubkey(extPubkey *types.ExtPubkey) (pubkey *types.Pubkey, err error)
- func (k *ExtPubkeyApiImpl) Valid(extPubkey *types.ExtPubkey) error
- type HdWalletApi
- type HdWalletApiImpl
- func (h *HdWalletApiImpl) CreateBip32Path(items ...Bip32Item) (path string, err error)
- func (h *HdWalletApiImpl) GetExtPrivkey(seed *types.ByteData) (privkey *types.ExtPrivkey, err error)
- func (h *HdWalletApiImpl) GetExtPrivkeyByPath(seed *types.ByteData, bip32Path string) (derivedPrivkey *types.ExtPrivkey, err error)
- func (h *HdWalletApiImpl) GetExtPrivkeyByPathWithFormat(seed *types.ByteData, bip32Path string, formatType types.ExtkeyFormatType) (derivedPrivkey *types.ExtPrivkey, err error)
- func (h *HdWalletApiImpl) GetExtPrivkeyWithFormat(seed *types.ByteData, formatType types.ExtkeyFormatType) (privkey *types.ExtPrivkey, err error)
- func (h *HdWalletApiImpl) GetExtPubkeyByPath(seed *types.ByteData, bip32Path string) (derivedPubkey *types.ExtPubkey, err error)
- func (h *HdWalletApiImpl) GetExtPubkeyByPathWithFormat(seed *types.ByteData, bip32Path string, formatType types.ExtkeyFormatType) (derivedPubkey *types.ExtPubkey, err error)
- func (h *HdWalletApiImpl) GetMnemonicFromEntropy(entropy *types.ByteData, language string) (mnemonic *[]string, err error)
- func (h *HdWalletApiImpl) GetMnemonicFromEntropyEng(entropy *types.ByteData) (mnemonic *[]string, err error)
- func (h *HdWalletApiImpl) GetSeedFromMnemonic(mnemonic []string, language string) (seed *types.ByteData, entropy *types.ByteData, err error)
- func (h *HdWalletApiImpl) GetSeedFromMnemonicAndPassphrase(mnemonic []string, language string, passphrase string) (seed *types.ByteData, entropy *types.ByteData, err error)
- func (h *HdWalletApiImpl) GetSeedFromMnemonicEng(mnemonic []string) (seed *types.ByteData, entropy *types.ByteData, err error)
- func (h *HdWalletApiImpl) GetSeedFromMnemonicEngAndPassphrase(mnemonic []string, passphrase string) (seed *types.ByteData, entropy *types.ByteData, err error)
- type PrivkeyApi
- type PrivkeyApiImpl
- func (k *PrivkeyApiImpl) CreateEcSignature(privkey *types.Privkey, sighash *types.ByteData, ...) (signature *types.ByteData, err error)
- func (k *PrivkeyApiImpl) CreateEcSignatureGrindR(privkey *types.Privkey, sighash *types.ByteData, ...) (signature *types.ByteData, err error)
- func (k *PrivkeyApiImpl) GetPrivkeyFromWif(wif string) (privkey *types.Privkey, err error)
- func (k *PrivkeyApiImpl) GetPubkey(privkey *types.Privkey) (pubkey *types.Pubkey, err error)
- func (k *PrivkeyApiImpl) GetWifFromHex(privkeyHex string) (privkey *types.Privkey, err error)
- func (k *PrivkeyApiImpl) GetWifFromHexWithCompressedPubkey(privkeyHex string, compressedPubkey bool) (privkey *types.Privkey, err error)
- func (k *PrivkeyApiImpl) HasWif(wif string) bool
- func (k *PrivkeyApiImpl) SignMessage(privkey *types.Privkey, message, magic string, isOutputBase64 bool) (signature string, err error)
- type PubkeyApi
- type PubkeyApiImpl
- func (p *PubkeyApiImpl) IsCompressed(pubkey *types.Pubkey) error
- func (p *PubkeyApiImpl) Verify(pubkey *types.Pubkey) error
- func (p *PubkeyApiImpl) VerifyEcSignature(pubkey *types.Pubkey, sighash, signature string) (isVerify bool, err error)
- func (p *PubkeyApiImpl) VerifyMessage(pubkey *types.Pubkey, signature, message, magic string) (recoveredPubkey *types.Pubkey, isVerify bool, err error)
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bip32Item ¶ added in v0.4.0
type Bip32Item func() string
func Bip32ByNum ¶ added in v0.4.0
Bip32ByNum returns Bip32Item function.
func Bip32ByString ¶ added in v0.4.0
Bip32ByString returns Bip32Item function.
func HardenedBip32ByNum ¶ added in v0.4.0
HardenedBip32ByNum returns Bip32Item function.
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 ¶ added in v0.3.7
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) // ConvertToBip32 ... ConvertToBip32(extPubkey *types.ExtPubkey) (bip32ExtPubkey *types.ExtPubkey, err error) }
type ExtPubkeyApiImpl ¶
type ExtPubkeyApiImpl struct { cfdErrors.HasInitializeError // contains filtered or unexported fields }
func NewExtPubkeyApi ¶
func NewExtPubkeyApi(options ...config.CfdConfigOption) *ExtPubkeyApiImpl
func (*ExtPubkeyApiImpl) ConvertToBip32 ¶ added in v0.3.17
func (k *ExtPubkeyApiImpl) ConvertToBip32(extPubkey *types.ExtPubkey) (bip32ExtPubkey *types.ExtPubkey, err error)
ConvertToBip32 ...
func (*ExtPubkeyApiImpl) GetData ¶
func (k *ExtPubkeyApiImpl) GetData(extPubkey *types.ExtPubkey) (data *types.ExtkeyData, err error)
GetData ...
func (*ExtPubkeyApiImpl) GetExtPubkeyByPath ¶ added in v0.3.7
func (k *ExtPubkeyApiImpl) GetExtPubkeyByPath(extPubkey *types.ExtPubkey, bip32Path string) (derivedPubkey *types.ExtPubkey, err error)
GetExtPubkeyByPath ...
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) GetExtPrivkeyWithFormat(seed *types.ByteData, formatType types.ExtkeyFormatType) (privkey *types.ExtPrivkey, err error) GetExtPrivkeyByPathWithFormat(seed *types.ByteData, bip32Path string, formatType types.ExtkeyFormatType) (derivedPrivkey *types.ExtPrivkey, err error) GetExtPubkeyByPathWithFormat(seed *types.ByteData, bip32Path string, formatType types.ExtkeyFormatType) (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) CreateBip32Path(items ...Bip32Item) (path string, err error) }
type HdWalletApiImpl ¶
type HdWalletApiImpl struct { cfdErrors.HasInitializeError // contains filtered or unexported fields }
func NewHdWalletApi ¶ added in v0.3.7
func NewHdWalletApi(options ...config.CfdConfigOption) *HdWalletApiImpl
func (*HdWalletApiImpl) CreateBip32Path ¶ added in v0.4.0
func (h *HdWalletApiImpl) CreateBip32Path(items ...Bip32Item) (path string, err error)
func (*HdWalletApiImpl) GetExtPrivkey ¶ added in v0.3.7
func (h *HdWalletApiImpl) GetExtPrivkey(seed *types.ByteData) (privkey *types.ExtPrivkey, err error)
------------------------------------- implement HdWalletApiImpl -------------------------------------
func (*HdWalletApiImpl) GetExtPrivkeyByPath ¶ added in v0.3.7
func (h *HdWalletApiImpl) GetExtPrivkeyByPath(seed *types.ByteData, bip32Path string) (derivedPrivkey *types.ExtPrivkey, err error)
func (*HdWalletApiImpl) GetExtPrivkeyByPathWithFormat ¶ added in v0.4.0
func (h *HdWalletApiImpl) GetExtPrivkeyByPathWithFormat(seed *types.ByteData, bip32Path string, formatType types.ExtkeyFormatType) (derivedPrivkey *types.ExtPrivkey, err error)
func (*HdWalletApiImpl) GetExtPrivkeyWithFormat ¶ added in v0.4.0
func (h *HdWalletApiImpl) GetExtPrivkeyWithFormat(seed *types.ByteData, formatType types.ExtkeyFormatType) (privkey *types.ExtPrivkey, err error)
func (*HdWalletApiImpl) GetExtPubkeyByPath ¶ added in v0.3.7
func (*HdWalletApiImpl) GetExtPubkeyByPathWithFormat ¶ added in v0.4.0
func (h *HdWalletApiImpl) GetExtPubkeyByPathWithFormat(seed *types.ByteData, bip32Path string, formatType types.ExtkeyFormatType) (derivedPubkey *types.ExtPubkey, err error)
func (*HdWalletApiImpl) GetMnemonicFromEntropy ¶ added in v0.3.7
func (*HdWalletApiImpl) GetMnemonicFromEntropyEng ¶ added in v0.3.7
func (h *HdWalletApiImpl) GetMnemonicFromEntropyEng(entropy *types.ByteData) (mnemonic *[]string, err error)
func (*HdWalletApiImpl) GetSeedFromMnemonic ¶ added in v0.3.7
func (*HdWalletApiImpl) GetSeedFromMnemonicAndPassphrase ¶ added in v0.3.7
func (*HdWalletApiImpl) GetSeedFromMnemonicEng ¶ added in v0.3.7
func (*HdWalletApiImpl) GetSeedFromMnemonicEngAndPassphrase ¶ added in v0.3.7
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) SignMessage(privkey *types.Privkey, message, magic string, isOutputBase64 bool) (signature string, 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 ¶ added in v0.3.11
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) GetWifFromHex ¶ added in v0.3.15
func (k *PrivkeyApiImpl) GetWifFromHex(privkeyHex string) (privkey *types.Privkey, err error)
GetWifFromHex ...
func (*PrivkeyApiImpl) GetWifFromHexWithCompressedPubkey ¶ added in v0.3.15
func (k *PrivkeyApiImpl) GetWifFromHexWithCompressedPubkey(privkeyHex string, compressedPubkey bool) (privkey *types.Privkey, err error)
GetWifFromHexWithCompressedPubkey ...
func (*PrivkeyApiImpl) HasWif ¶ added in v0.3.14
func (k *PrivkeyApiImpl) HasWif(wif string) bool
HasWif ...
func (*PrivkeyApiImpl) SignMessage ¶ added in v0.4.0
func (k *PrivkeyApiImpl) SignMessage(privkey *types.Privkey, message, magic string, isOutputBase64 bool) (signature string, err error)
SignMessage ...
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) // VerifyMessage ... VerifyMessage(pubkey *types.Pubkey, signature, message, magic string) (recoveredPubkey *types.Pubkey, isVerify bool, err error) }
PubkeyApi This interface has pubkey operation API.
type PubkeyApiImpl ¶
type PubkeyApiImpl struct { }
func NewPubkeyApi ¶
func NewPubkeyApi() *PubkeyApiImpl
func (*PubkeyApiImpl) IsCompressed ¶ added in v0.3.14
func (p *PubkeyApiImpl) IsCompressed(pubkey *types.Pubkey) error
IsCompressed ...
func (*PubkeyApiImpl) Verify ¶ added in v0.3.14
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 ...
func (*PubkeyApiImpl) VerifyMessage ¶ added in v0.4.0
func (p *PubkeyApiImpl) VerifyMessage(pubkey *types.Pubkey, signature, message, magic string) (recoveredPubkey *types.Pubkey, isVerify bool, err error)
VerifyMessage ...