core

package
v0.10.0-beta.20200904 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

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

func EntropyFromMnemonic(mnemonic string) (entropy []byte, err error)

EntropyFromMnemonic returns the input entropy used to generate the given mnemonic

func NewEntropy

func NewEntropy(bits int) (entropy []byte, err error)

NewEntropy will create random entropy bytes

func NewMnemonic

func NewMnemonic(entropy []byte) (mnemonic string, err error)

NewMnemonic returns a randomly generated BIP-39 mnemonic using 128-256 bits of entropy.

func NewSeed

func NewSeed() (b []byte, err error)

NewSeed returns a randomly generated BIP-39 seed.

func NewSeedFromMnemonic

func NewSeedFromMnemonic(mnemonic string) ([]byte, error)

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
}

type MetadataProvider

type MetadataProvider interface {
	GetChainID() int //获取链id
	GetPath() string
	IsTestNet() bool
	GetSeed() []byte
	GetDerivationPath() []uint32
}

MetadataProvider we need a configuration data container per-symbol.

Directories

Path Synopsis
bbc
bch
bchd/txscript
Package txscript implements the bitcoin transaction script language.
Package txscript implements the bitcoin transaction script language.
bchd/wire
Package wire implements the bitcoin wire protocol.
Package wire implements the bitcoin wire protocol.
btc
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.
eth
internalized/testtool
Package testtool 测试用辅助函数
Package testtool 测试用辅助函数
trx
xrp
data
Package data aims to provides all the data types that are needed to build tools, clients and servers for use on the Ripple network.
Package data aims to provides all the data types that are needed to build tools, clients and servers for use on the Ripple network.

Jump to

Keyboard shortcuts

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