Documentation ¶
Overview ¶
Package signer implements the ChainSigner interface for BTC
Index ¶
- Constants
- type Signer
- func (signer *Signer) AddWithdrawTxOutputs(tx *wire.MsgTx, to btcutil.Address, total float64, amount float64, ...) error
- func (signer *Signer) Broadcast(signedTx *wire.MsgTx) error
- func (signer *Signer) GetERC20CustodyAddress() ethcommon.Address
- func (signer *Signer) GetZetaConnectorAddress() ethcommon.Address
- func (signer *Signer) SetERC20CustodyAddress(_ ethcommon.Address)
- func (signer *Signer) SetZetaConnectorAddress(_ ethcommon.Address)
- func (signer *Signer) SignWithdrawTx(ctx context.Context, to btcutil.Address, amount float64, gasPrice *big.Int, ...) (*wire.MsgTx, error)
- func (signer *Signer) TryProcessOutbound(ctx context.Context, cctx *types.CrossChainTx, ...)
Constants ¶
const (
// the maximum number of inputs per outbound
MaxNoOfInputsPerTx = 20
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Signer ¶
Signer deals with signing BTC transactions and implements the ChainSigner interface
func NewSigner ¶
func NewSigner( chain chains.Chain, tss interfaces.TSSSigner, ts *metrics.TelemetryServer, logger base.Logger, cfg config.BTCConfig) (*Signer, error)
NewSigner creates a new Bitcoin signer
func (*Signer) AddWithdrawTxOutputs ¶
func (signer *Signer) AddWithdrawTxOutputs( tx *wire.MsgTx, to btcutil.Address, total float64, amount float64, nonceMark int64, fees *big.Int, cancelTx bool, ) error
AddWithdrawTxOutputs adds the 3 outputs to the withdraw tx 1st output: the nonce-mark btc to TSS itself 2nd output: the payment to the recipient 3rd output: the remaining btc to TSS itself
func (*Signer) GetERC20CustodyAddress ¶
GetERC20CustodyAddress returns dummy address
func (*Signer) GetZetaConnectorAddress ¶
GetZetaConnectorAddress returns dummy address
func (*Signer) SetERC20CustodyAddress ¶
SetERC20CustodyAddress does nothing for BTC
func (*Signer) SetZetaConnectorAddress ¶
SetZetaConnectorAddress does nothing for BTC
func (*Signer) SignWithdrawTx ¶
func (signer *Signer) SignWithdrawTx( ctx context.Context, to btcutil.Address, amount float64, gasPrice *big.Int, sizeLimit uint64, observer *observer.Observer, height uint64, nonce uint64, chain chains.Chain, cancelTx bool, ) (*wire.MsgTx, error)
SignWithdrawTx receives utxos sorted by value, amount in BTC, feeRate in BTC per Kb TODO(revamp): simplify the function
func (*Signer) TryProcessOutbound ¶
func (signer *Signer) TryProcessOutbound( ctx context.Context, cctx *types.CrossChainTx, outboundProcessor *outboundprocessor.Processor, outboundID string, chainObserver interfaces.ChainObserver, zetacoreClient interfaces.ZetacoreClient, height uint64, )
TryProcessOutbound signs and broadcasts a BTC transaction from a new outbound TODO(revamp): simplify the function