Documentation ¶
Index ¶
- Variables
- func EntropyFromMnemonic(mnemonic string) (entropy []byte, err error)
- func NewEntropy(bits int) (entropy []byte, err error)
- func NewMnemonic(entropy []byte) (mnemonic string, err error)
- func NewSeed() (b []byte, err error)
- func NewSeedFromMnemonic(mnemonic, password string) ([]byte, error)
- type Coin
- type CoinInfo
- type HasParentChain
- type MetadataProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrThisFeatureIsNotSupported = errors.New("this feature is not supported by this coin")
)
View Source
var ParentChainCofnig = map[string]string{
"OMNI": "BTC",
}
Functions ¶
func EntropyFromMnemonic ¶
EntropyFromMnemonic returns the input entropy used to generate the given mnemonic
func NewEntropy ¶
NewEntropy will create random entropy bytes
func NewMnemonic ¶
NewMnemonic returns a randomly generated BIP-39 mnemonic using 128-256 bits of entropy.
func NewSeedFromMnemonic ¶
NewSeedFromMnemonic returns a BIP-39 seed based on a BIP-39 mnemonic.
Types ¶
type Coin ¶
type Coin 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) // DecodeTx decodes raw tx to human readable format DecodeTx(msg string) (tx string, err error) // Sign signs raw tx with privateKey Sign(msg, privateKey string) (sig string, err error) // VerifySignature verifies rawTx's signature is intact VerifySignature(pubKey, msg, signature string) error }
Coin 定义了某种货币常用的可以提供的方法
type CoinInfo ¶
type CoinInfo struct { Symbol string DerivationPath accounts.DerivationPath MasterKey *hdkeychain.ExtendedKey ChainCfg *chaincfg.Params }
type HasParentChain ¶
type HasParentChain interface { // GetParentChainName get the symbol name of the parent chain GetParentChainName() string }
Directories ¶
Path | Synopsis |
---|---|
internal/helpers
Package helpers provides convenience functions to simplify wallet code.
|
Package helpers provides convenience functions to simplify wallet code. |
internal/txauthor
Package txauthor provides transaction creation code for wallets.
|
Package txauthor provides transaction creation code for wallets. |
internal/txrules
Package txrules provides transaction rules that should be followed by transaction authors for wide mempool acceptance and quick mining.
|
Package txrules provides transaction rules that should be followed by transaction authors for wide mempool acceptance and quick mining. |
internalized/testtool
Package testtool 测试用辅助函数
|
Package testtool 测试用辅助函数 |
Click to show internal directories.
Click to hide internal directories.