bitcoin

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMultiSigAddress

func CreateMultiSigAddress(m int, publicKeys []*btcutil.AddressPubKey, randomBytes []byte,
	params *chaincfg.Params) (

	script, address []byte, btcAddressList []string, err error)

func EstimateTxSizeBeforeUserSign added in v0.14.0

func EstimateTxSizeBeforeUserSign(tx *wire.MsgTx, isFirstLock bool) int

func GetBlockCypherChainType

func GetBlockCypherChainType(typeString string) string

func GetChainParams

func GetChainParams(typeString string) *chaincfg.Params

func ValidateLock

func ValidateLock(tx *wire.MsgTx, token, chainType string, lockScriptAddress []byte, currentBalance, lockAmount int64, isFirstlock bool) bool

func ValidateRedeem

func ValidateRedeem(tx *wire.MsgTx, token, chainType string, trackerPrevTxID *chainhash.Hash,
	lockScriptAddress []byte, currentBalance, redeemAmount int64) bool

Types

type ChainDriver

type ChainDriver interface {
	PrepareLockNew(prevLockTxID *chainhash.Hash, prevLockIndex uint32, prevLockBalance int64,
		inputs []InputTransaction, feesRate int64, lockAmount int64, returnAddress []byte,
		lockScriptAddress []byte) (txBytes []byte, err error)

	AddLockSignature([]byte, []byte, bool) *wire.MsgTx

	BroadcastTx(*wire.MsgTx, *rpcclient.Client) (*chainhash.Hash, error)

	CheckFinality(hash *chainhash.Hash, blockConfirmations int, token, chain string) (bool, error)

	PrepareRedeemNew(prevLockTxID *chainhash.Hash, prevLockIndex uint32, prevLockBalance int64,
		userAddress []byte, redeemAmount int64, feesInSatoshi int64,
		lockScriptAddress []byte) (txBytes []byte)
}

func NewChainDriver

func NewChainDriver(token string) ChainDriver

type ChainDriverOption added in v0.14.0

type ChainDriverOption struct {
	ChainType         string
	TotalSupply       string
	TotalSupplyAddr   string
	BlockConfirmation int64
}

type InputTransaction added in v0.14.0

type InputTransaction struct {
	TxID    *chainhash.Hash
	Index   uint32
	Balance int64
}

type KeyDB

type KeyDB struct {
	// contains filtered or unexported fields
}

func NewKeyDB

func NewKeyDB() *KeyDB

func (*KeyDB) Add

func (k *KeyDB) Add(key btcutil.Address, privateKey *btcec.PrivateKey)

func (KeyDB) GetKey

func (k KeyDB) GetKey(address btcutil.Address) (*btcec.PrivateKey, bool, error)

type TxHash

type TxHash [chainhash.HashSize]byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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