bitcoin

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLOCK_CONFIRMATIONS      = 6
	BLOCK_CONFIRMATIONS_TEST = 1
)

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 GetBlockCypherChainType

func GetBlockCypherChainType(typeString string) string

func GetChainParams

func GetChainParams(typeString string) *chaincfg.Params

func ValidateLock

func ValidateLock(tx *wire.MsgTx, token, chainType string, trackerPrevTxID *chainhash.Hash,
	lockScriptAddress []byte, currentBalance, lockAmount int64) 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(*chainhash.Hash, uint32, int64, *chainhash.Hash, uint32, int64, int64, []byte) (txBytes []byte)

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

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

	CheckFinality(*chainhash.Hash, string, 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 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