Documentation
¶
Overview ¶
Package bitcoin provides Bitcoin wallet functionality for the bridge chain
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
GetUTXOs(ctx context.Context, address string) ([]*utxo.UTXO, error)
BroadcastTransaction(ctx context.Context, txHex string) (string, error)
GetTransaction(ctx context.Context, txID string) (*Transaction, error)
}
Client defines the interface for interacting with a Bitcoin node
type SignedTransaction ¶
type SignedTransaction struct {
Transaction
Witnesses [][]byte
}
SignedTransaction represents a signed Bitcoin transaction
type Transaction ¶
Transaction represents an unsigned Bitcoin transaction
type Wallet ¶
type Wallet interface {
// GetAddress returns the Bitcoin address for this wallet
GetAddress() string
// GetBalance returns the balance for a specific asset (BTC)
GetBalance(ctx context.Context) (*big.Int, error)
// CreateTransaction creates a new Bitcoin transaction
CreateTransaction(ctx context.Context, to string, amount *big.Int) (*Transaction, error)
// SignTransaction signs a transaction
SignTransaction(ctx context.Context, tx *Transaction) (*SignedTransaction, error)
// BroadcastTransaction broadcasts a signed transaction
BroadcastTransaction(ctx context.Context, tx *SignedTransaction) (ids.ID, error)
}
Wallet provides Bitcoin wallet functionality
Click to show internal directories.
Click to hide internal directories.