Documentation ¶
Index ¶
- type Pegin
- type PeginService
- func (p *PeginService) CreatePeginAddress(addressType types.AddressType, pubkey *types.Pubkey, ...) (peginAddress *types.Address, claimScript *types.Script, err error)
- func (p *PeginService) CreatePeginTransaction(peginOutPoint *types.OutPoint, peginData *types.InputPeginData, ...) (tx *types.ConfidentialTx, unblindTx *types.ConfidentialTx, err error)
- func (p *PeginService) GetPeginUtxoData(proposalTx *types.ConfidentialTx, peginOutPoint *types.OutPoint, ...) (utxoData *types.ElementsUtxoData, err error)
- func (p *PeginService) GetPubkeyFromAccountExtPubkey(accountExtPubkey *types.ExtPubkey, bip32Path string) (pubkey *types.Pubkey, derivedExtPubkey *types.ExtPubkey, err error)
- func (p *PeginService) VerifyPubkeySignature(proposalTx *types.ConfidentialTx, utxoData *types.ElementsUtxoData, ...) (isVerify bool, err error)
- func (p *PeginService) WithBitcoinTxApi(transactionApi transaction.TransactionApi) *PeginService
- func (p *PeginService) WithConfidentialTxApi(confidentialTxApi transaction.ConfidentialTxApi) *PeginService
- func (p *PeginService) WithElementsAddressApi(addressApi address.ElementsAddressApi) *PeginService
- func (p *PeginService) WithElementsDescriptorApi(descriptorApi descriptor.DescriptorApi) *PeginService
- func (p *PeginService) WithPubkeyApi(pubkeyApi key.PubkeyApi) *PeginService
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 ¶ added in v0.3.10
func (p *PeginService) WithBitcoinTxApi(transactionApi transaction.TransactionApi) *PeginService
WithBitcoinTxApi This function set a bitcoin transaction api.
func (*PeginService) WithConfidentialTxApi ¶ added in v0.3.10
func (p *PeginService) WithConfidentialTxApi(confidentialTxApi transaction.ConfidentialTxApi) *PeginService
WithConfidentialTxApi This function set a confidential transaction api.
func (*PeginService) WithElementsAddressApi ¶ added in v0.3.10
func (p *PeginService) WithElementsAddressApi(addressApi address.ElementsAddressApi) *PeginService
WithElementsAddressApi This function set a elements address api.
func (*PeginService) WithElementsDescriptorApi ¶ added in v0.3.10
func (p *PeginService) WithElementsDescriptorApi(descriptorApi descriptor.DescriptorApi) *PeginService
WithElementsDescriptorApi This function set a elements descriptor api.
func (*PeginService) WithPubkeyApi ¶ added in v0.3.10
func (p *PeginService) WithPubkeyApi(pubkeyApi key.PubkeyApi) *PeginService
WithPubkeyApi This function set a pubkey api.