Documentation ¶
Index ¶
- Constants
- func GetCoinDerivationPath(path, symbol string) (derivationPath accounts.DerivationPath, err error)
- func GetCoinType(symbol string) (coinType uint32, err error)
- func GetDerivePath(path string, symbolID uint32, ap *AdditionalDeriveParam) (accounts.DerivationPath, error)
- type AdditionalDeriveParam
- type Deriver
Constants ¶
View Source
const ( PathFormat = "m/44'/%d'" FullPathFormat = "m/44'/%d'/0'/0/0" FullPathFormat4 = "m/44'/%d'/%d'/%d/%d" //symbol,account,0|1 external|internal(change), index Password = "DASafe360" // ChangeTypeExternal 通常用于收款,对外部可见 ChangeTypeExternal = 0 // ChangeTypeInternal 通常用于找零,通常不对外可见 ChangeTypeInternal = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetCoinDerivationPath ¶
func GetCoinDerivationPath(path, symbol string) (derivationPath accounts.DerivationPath, err error)
GetCoinDerivationPath get actual path for coin
func GetCoinType ¶
GetCoinType get bip44 id for symbol,
func GetDerivePath ¶
func GetDerivePath(path string, symbolID uint32, ap *AdditionalDeriveParam) (accounts.DerivationPath, error)
GetDerivePath provide path, symbole id (and other param ) to get bip44 derivation path
Types ¶
type AdditionalDeriveParam ¶
type AdditionalDeriveParam struct {
AccountIndex, ChangeType, Index int
}
AdditionalDeriveParam 额外的推导参数
type Deriver ¶
type Deriver interface { // DeriveAddress derives the account address of the derivation path. DeriveAddress() (address string, err error) // DerivePublicKey derives the public key of the derivation path. DerivePublicKey() (publicKey string, err error) // DerivePrivateKey derives the private key of the derivation path. DerivePrivateKey() (privateKey string, err error) }
Deriver derives address/publicKey/privateKey
Click to show internal directories.
Click to hide internal directories.