pegin

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Claim

func Claim(
	btcNetwork *chaincfg.Params,
	isDynaFedEnabled bool,
	peggedAsset []byte,
	parentGenesisBlockHash []byte,
	fedpegScript []byte,
	contract []byte,
	btcTx []byte,
	btcTxOutProof []byte,
	claimScript []byte,
	milisatsPerByte float64,
) (*transaction.Transaction, error)

Claim crafts raw claim pegin transaction which is to be signed and broadcated to network

func ClaimWitnessScript

func ClaimWitnessScript(
	publicKeyBytes []byte,
	net *network.Network,
) ([]byte, error)

ClaimWitnessScript returns claim script that is to be used to calculate contract (pegincontract.Calculate) and craft raw pegin transaction (pegin.Claim)

func GetPeginTxOutIndexAndAmount

func GetPeginTxOutIndexAndAmount(
	btcTx []byte,
	fedpegScript []byte,
	contract []byte,
	btcNetwork *chaincfg.Params,
	isDynaFedEnabled bool,
) (uint32, int64, error)

func MainChainAddress

func MainChainAddress(
	contract []byte,
	btcNetwork *chaincfg.Params,
	isDynaFedEnabled bool,
	fedpegScript []byte,
) (string, error)

MainChainAddress creates btc address to which BTC amount is to be sent that is to be pegged in Liquid network

func SerializeValue

func SerializeValue(value int64) ([]byte, error)

func StripWitnessFromBtcTx

func StripWitnessFromBtcTx(btcTx []byte) ([]byte, error)

Types

type AddressInfo

type AddressInfo struct {
	ClaimScript      string
	MainChainAddress string
}

type FedpegInfo

type FedpegInfo struct {
	FedpegScript  []byte
	FedpegProgram []byte
}

Jump to

Keyboard shortcuts

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