chains

package
v0.0.1-gowrapper-test Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitcoinChain

type BitcoinChain struct {
	// contains filtered or unexported fields
}

BitcoinChain implements the Chain interface for Bitcoin

func NewBitcoinChain

func NewBitcoinChain() *BitcoinChain

NewBitcoinChain creates a new Bitcoin chain instance

func (*BitcoinChain) BuildSigningInput

func (b *BitcoinChain) BuildSigningInput(
	hashType uint32,
	amount int64,
	byteFee int64,
	toAddress string,
	changeAddress string,
	utxos []struct {
		Hash    string // UTXO hash (hex string)
		Index   uint32 // UTXO index
		Address string // Address for this UTXO
		Amount  int64  // UTXO amount in satoshis
	},
) (*bitcoin.SigningInput, error)

BuildSigningInput creates a Bitcoin SigningInput from high-level parameters This abstracts away the complex UTXO and script management for users

func (*BitcoinChain) CompileTransaction

func (b *BitcoinChain) CompileTransaction(
	input *chain_abstraction.TransactionInput,
	signatures [][]byte,
	publicKeys [][]byte,
) ([]byte, error)

CompileTransaction compiles a Bitcoin transaction with signatures

func (*BitcoinChain) CreateAndSignTransaction

func (b *BitcoinChain) CreateAndSignTransaction(input interface{}, privateKey []byte) ([]byte, error)

CreateAndSignTransaction creates and signs a Bitcoin transaction

func (*BitcoinChain) CreateWallet

func (b *BitcoinChain) CreateWallet(mnemonic string) (*chain_abstraction.Wallet, error)

CreateWallet creates a Bitcoin wallet

func (*BitcoinChain) CreateWalletWithPrivateKey

func (b *BitcoinChain) CreateWalletWithPrivateKey(privateKey string) (*chain_abstraction.Wallet, error)

CreateWalletWithPrivateKey creates a Bitcoin wallet from private key

func (*BitcoinChain) GetCoinType

func (b *BitcoinChain) GetCoinType() core.CoinType

GetCoinType returns the Bitcoin coin type

func (*BitcoinChain) GetDecimals

func (b *BitcoinChain) GetDecimals() int

GetDecimals returns the number of decimals

func (*BitcoinChain) GetName

func (b *BitcoinChain) GetName() string

GetName returns the chain name

func (*BitcoinChain) GetPreimageHash

func (b *BitcoinChain) GetPreimageHash(input *chain_abstraction.TransactionInput) ([]byte, []byte, error)

GetPreimageHash gets the preimage hash for Bitcoin transaction

func (*BitcoinChain) GetPublicKeyFromPrivateKey

func (b *BitcoinChain) GetPublicKeyFromPrivateKey(privateKey []byte) ([]byte, error)

GetPublicKeyFromPrivateKey derives the public key from a private key

func (*BitcoinChain) GetSigningData

func (b *BitcoinChain) GetSigningData(hashes []byte) ([][]byte, [][]byte, error)

GetSigningData extracts all data hashes and public key hashes from Bitcoin PreSigningOutput This is useful for Bitcoin's multi-UTXO external signing where multiple hashes need to be signed

func (*BitcoinChain) GetSymbol

func (b *BitcoinChain) GetSymbol() string

GetSymbol returns the chain symbol

func (*BitcoinChain) GetTransactionHash

func (b *BitcoinChain) GetTransactionHash(encodedTx []byte) (string, error)

GetTransactionHash gets the transaction hash

func (*BitcoinChain) PrepareTransaction

func (b *BitcoinChain) PrepareTransaction(input interface{}) (*chain_abstraction.TransactionInput, error)

PrepareTransaction prepares a Bitcoin transaction for external signing

func (*BitcoinChain) Sign

func (b *BitcoinChain) Sign(preimage []byte, privateKey []byte) ([]byte, error)

Sign signs a preimage with the provided private key using the core's signing approach

func (*BitcoinChain) ValidateAddress

func (b *BitcoinChain) ValidateAddress(address string) bool

ValidateAddress validates a Bitcoin address

func (*BitcoinChain) ValidateTransactionInput

func (b *BitcoinChain) ValidateTransactionInput(input interface{}) error

ValidateTransactionInput validates Bitcoin transaction input

Jump to

Keyboard shortcuts

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