Documentation ¶
Index ¶
- Constants
- type Pegout
- type PegoutService
- func (p *PegoutService) ContainsPakEntry(pakEntry *types.ByteData, whitelist string) (exist bool, err error)
- func (p *PegoutService) CreateOnlinePrivateKey() (privkey *types.Privkey, err error)
- func (p *PegoutService) CreatePakEntry(accountExtPubkey *types.ExtPubkey, onlinePrivkey *types.Privkey) (pakEntry *types.PakEntry, err error)
- func (p *PegoutService) CreatePegoutAddress(addressType types.AddressType, accountExtPubkey *types.ExtPubkey, ...) (pegoutAddress *types.Address, baseDescriptor *types.Descriptor, err error)
- func (p *PegoutService) CreatePegoutTransaction(utxoList []*types.ElementsUtxoData, pegoutData types.InputConfidentialTxOut, ...) (tx *types.ConfidentialTx, pegoutAddress *types.Address, ...)
- func (p *PegoutService) IsNeedDummyBlind(utxoList []*types.ElementsUtxoData, txinList []*types.ConfidentialTxIn, ...) bool
- func (p *PegoutService) VerifyPubkeySignature(proposalTx *types.ConfidentialTx, utxoData *types.ElementsUtxoData, ...) (isVerify bool, err error)
- func (p *PegoutService) WithBitcoinAddressApi(addressApi address.AddressApi) *PegoutService
- func (p *PegoutService) WithConfidentialTxApi(confidentialTxApi transaction.ConfidentialTxApi) *PegoutService
- func (p *PegoutService) WithElementsDescriptorApi(descriptorApi descriptor.DescriptorApi) *PegoutService
- func (p *PegoutService) WithPubkeyApi(pubkeyApi key.PubkeyApi) *PegoutService
Constants ¶
const (
PegoutAmountMinimum int64 = 100000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pegout ¶
type Pegout interface { // CreateOnlinePrivateKey This function generate random private key for online key. CreateOnlinePrivateKey() (privkey *types.Privkey, err error) // CreatePakEntry This function create the PAK-Entry. CreatePakEntry( accountExtPubkey *types.ExtPubkey, onlinePrivkey *types.Privkey, ) (pakEntry *types.PakEntry, err error) // CreatePegoutAddress This function create the pegout address for bitcoin network. CreatePegoutAddress( addressType types.AddressType, accountExtPubkey *types.ExtPubkey, addressIndex uint32, ) (pegoutAddress *types.Address, baseDescriptor *types.Descriptor, err error) // CreatePegoutTransaction This function create the pegout transaction. CreatePegoutTransaction( utxoList []*types.ElementsUtxoData, pegoutData types.InputConfidentialTxOut, sendList []*types.InputConfidentialTxOut, changeAddress *string, option *types.PegoutTxOption, ) ( tx *types.ConfidentialTx, pegoutAddress *types.Address, 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) // ContainsPakEntry checks if a pakEntry is included in the whitelist. ContainsPakEntry(pakEntry *types.ByteData, whitelist string) (exist bool, err error) }
Pegout This interface defines the API used by the pegout function.
type PegoutService ¶
type PegoutService struct { cfdErrors.HasInitializeError // contains filtered or unexported fields }
PegoutService This struct is implements pegout api.
func NewPegoutService ¶
func NewPegoutService(options ...config.CfdConfigOption) *PegoutService
NewPegoutService returns an object that defines the API for Pegout.
func (*PegoutService) ContainsPakEntry ¶ added in v0.3.11
func (*PegoutService) CreateOnlinePrivateKey ¶
func (p *PegoutService) CreateOnlinePrivateKey() (privkey *types.Privkey, err error)
CreateOnlinePrivateKey This function generate random private key for online key.
func (*PegoutService) CreatePakEntry ¶
func (p *PegoutService) CreatePakEntry( accountExtPubkey *types.ExtPubkey, onlinePrivkey *types.Privkey, ) (pakEntry *types.PakEntry, err error)
CreatePakEntry This function create the PAK-Entry.
func (*PegoutService) CreatePegoutAddress ¶
func (p *PegoutService) CreatePegoutAddress( addressType types.AddressType, accountExtPubkey *types.ExtPubkey, addressIndex uint32, ) (pegoutAddress *types.Address, baseDescriptor *types.Descriptor, err error)
CreatePegoutAddress This function create the pegout address for bitcoin network.
func (*PegoutService) CreatePegoutTransaction ¶
func (p *PegoutService) CreatePegoutTransaction( utxoList []*types.ElementsUtxoData, pegoutData types.InputConfidentialTxOut, sendList []*types.InputConfidentialTxOut, changeAddress *string, option *types.PegoutTxOption, ) (tx *types.ConfidentialTx, pegoutAddress *types.Address, unblindTx *types.ConfidentialTx, err error)
CreatePegoutTransaction This function create the pegout transaction.
func (*PegoutService) IsNeedDummyBlind ¶ added in v0.3.15
func (p *PegoutService) IsNeedDummyBlind( utxoList []*types.ElementsUtxoData, txinList []*types.ConfidentialTxIn, txoutList []*types.ConfidentialTxOut, ) bool
func (*PegoutService) VerifyPubkeySignature ¶
func (p *PegoutService) VerifyPubkeySignature( proposalTx *types.ConfidentialTx, utxoData *types.ElementsUtxoData, signature *types.ByteData, ) (isVerify bool, err error)
VerifyPubkeySignature This function validate the signature by pubkey.
func (*PegoutService) WithBitcoinAddressApi ¶ added in v0.3.10
func (p *PegoutService) WithBitcoinAddressApi(addressApi address.AddressApi) *PegoutService
WithBitcoinAddressApi This function set a bitcoin address api.
func (*PegoutService) WithConfidentialTxApi ¶ added in v0.3.10
func (p *PegoutService) WithConfidentialTxApi(confidentialTxApi transaction.ConfidentialTxApi) *PegoutService
WithConfidentialTxApi This function set a confidential transaction api.
func (*PegoutService) WithElementsDescriptorApi ¶ added in v0.3.10
func (p *PegoutService) WithElementsDescriptorApi(descriptorApi descriptor.DescriptorApi) *PegoutService
WithElementsDescriptorApi This function set a elements descriptor api.
func (*PegoutService) WithPubkeyApi ¶ added in v0.3.10
func (p *PegoutService) WithPubkeyApi(pubkeyApi key.PubkeyApi) *PegoutService
WithPubkeyApi This function set a pubkey api.