pegin

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pegin

type Pegin interface {
	// GetPubkeyFromAccountExtPubkey This function get the pubkey from xpubkey.
	GetPubkeyFromAccountExtPubkey(
		accountExtPubkey *types.ExtPubkey,
		bip32Path string,
	) (
		pubkey *types.Pubkey,
		derivedExtPubkey *types.ExtPubkey,
		err error,
	)
	// CreatePeginAddress This function get the pegin address and claim script.
	CreatePeginAddress(
		addressType types.AddressType,
		pubkey *types.Pubkey,
		fedpegScript *types.Script,
	) (peginAddress *types.Address, claimScript *types.Script, err error)
	// CreatePeginTransaction This function create the pegin claim transaction.
	CreatePeginTransaction(
		peginOutPoint *types.OutPoint,
		peginData *types.InputPeginData,
		utxoList []*types.ElementsUtxoData,
		sendList []types.InputConfidentialTxOut,
		changeAddress *string,
		option *types.PeginTxOption,
	) (
		tx *types.ConfidentialTx,
		unblindTx *types.ConfidentialTx,
		err error,
	)
	// VerifyPubkeySignature This function validate the signature by pubkey.
	VerifyPubkeySignature(
		proposalTx *types.ConfidentialTx,
		utxoData *types.ElementsUtxoData,
		signature *types.ByteData,
	) (isVerify bool, err error)
	// GetPeginUtxoData This function get the pegin utxo data from transaction.
	GetPeginUtxoData(
		proposalTx *types.ConfidentialTx,
		peginOutPoint *types.OutPoint,
		pubkey *types.Pubkey,
	) (utxoData *types.ElementsUtxoData, err error)
}

Pegin This interface defines the API used by the pegin function.

type PeginService

type PeginService struct {
	cfdErrors.HasInitializeError
	// contains filtered or unexported fields
}

PeginService This struct is implements pegin api.

func NewPeginService

func NewPeginService(options ...config.CfdConfigOption) *PeginService

NewPeginService returns an object that defines the API for Pegin.

func (*PeginService) CreatePeginAddress

func (p *PeginService) CreatePeginAddress(
	addressType types.AddressType,
	pubkey *types.Pubkey,
	fedpegScript *types.Script,
) (
	peginAddress *types.Address,
	claimScript *types.Script,
	err error,
)

CreatePeginAddress This function get the pegin address and claim script.

func (*PeginService) CreatePeginTransaction

func (p *PeginService) CreatePeginTransaction(
	peginOutPoint *types.OutPoint,
	peginData *types.InputPeginData,
	utxoList []*types.ElementsUtxoData,
	sendList []types.InputConfidentialTxOut,
	changeAddress *string,
	option *types.PeginTxOption,
) (tx *types.ConfidentialTx, unblindTx *types.ConfidentialTx, err error)

CreatePeginTransaction This function create the pegin claim transaction.

func (*PeginService) GetPeginUtxoData

func (p *PeginService) GetPeginUtxoData(
	proposalTx *types.ConfidentialTx,
	peginOutPoint *types.OutPoint,
	pubkey *types.Pubkey,
) (utxoData *types.ElementsUtxoData, err error)

GetPeginUtxoData This function get the pegin utxo data from transaction.

func (*PeginService) GetPubkeyFromAccountExtPubkey

func (p *PeginService) GetPubkeyFromAccountExtPubkey(
	accountExtPubkey *types.ExtPubkey,
	bip32Path string,
) (
	pubkey *types.Pubkey,
	derivedExtPubkey *types.ExtPubkey,
	err error,
)

GetPubkeyFromExtPubkey This function get the pubkey from xpubkey.

func (*PeginService) VerifyPubkeySignature

func (p *PeginService) VerifyPubkeySignature(
	proposalTx *types.ConfidentialTx,
	utxoData *types.ElementsUtxoData,
	signature *types.ByteData,
) (isVerify bool, err error)

VerifyPubkeySignature This function validate the signature by pubkey.

func (*PeginService) WithBitcoinTxApi

func (p *PeginService) WithBitcoinTxApi(transactionApi transaction.TransactionApi) *PeginService

WithBitcoinTxApi This function set a bitcoin transaction api.

func (*PeginService) WithConfidentialTxApi

func (p *PeginService) WithConfidentialTxApi(confidentialTxApi transaction.ConfidentialTxApi) *PeginService

WithConfidentialTxApi This function set a confidential transaction api.

func (*PeginService) WithElementsAddressApi

func (p *PeginService) WithElementsAddressApi(addressApi address.ElementsAddressApi) *PeginService

WithElementsAddressApi This function set a elements address api.

func (*PeginService) WithElementsDescriptorApi

func (p *PeginService) WithElementsDescriptorApi(descriptorApi descriptor.DescriptorApi) *PeginService

WithElementsDescriptorApi This function set a elements descriptor api.

func (*PeginService) WithPubkeyApi

func (p *PeginService) WithPubkeyApi(pubkeyApi key.PubkeyApi) *PeginService

WithPubkeyApi This function set a pubkey api.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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