mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-17 20:24:21 +01:00
* scaffolding wallet * remove wallet db, add loader instead * wip * implement some wallet methods * signing and utxos * renaming * fee estimator * chain source options * config * application service * clark docker-compose * CLI refactor * v0 clark * v0.1 clark * fix SignTapscriptInput (btcwallet) * wallet.Broadcast, send via explora * fix ASP pubkey * Use lnd's btcwallet & Add rpc to get wallet staus * wip * unilateral exit * Fixes on watching for notifications and cli init * handle non-final BIP68 errors * Fixes * Fixes * Fix * a * fix onboard cosigners + revert tree validation * fix covenant e2e tests * fix covenantless e2e tests * fix container naming * fix lint error * update REAME.md * Add env var for wallet password --------- Co-authored-by: altafan <18440657+altafan@users.noreply.github.com>
58 lines
1.3 KiB
Go
58 lines
1.3 KiB
Go
package btcwallet
|
|
|
|
import (
|
|
"encoding/hex"
|
|
|
|
"github.com/btcsuite/btcwallet/wallet"
|
|
)
|
|
|
|
// transactionOutputTxInput is a wrapper around wallet.TransactionOutput implementing the ports.TxInput interface
|
|
type transactionOutputTxInput struct {
|
|
*wallet.TransactionOutput
|
|
}
|
|
|
|
func (t transactionOutputTxInput) GetAsset() string {
|
|
panic("ports.TxInput.GetAsset unimplemented on Bitcoin network") // liquid only
|
|
}
|
|
|
|
func (t transactionOutputTxInput) GetIndex() uint32 {
|
|
return t.OutPoint.Index
|
|
}
|
|
|
|
func (t transactionOutputTxInput) GetScript() string {
|
|
return hex.EncodeToString(t.Output.PkScript)
|
|
}
|
|
|
|
func (t transactionOutputTxInput) GetTxid() string {
|
|
return t.OutPoint.Hash.String()
|
|
}
|
|
|
|
func (t transactionOutputTxInput) GetValue() uint64 {
|
|
return uint64(t.Output.Value)
|
|
}
|
|
|
|
// coinTxInput is a wrapper around wallet.Coin implementing the ports.TxInput interface
|
|
type coinTxInput struct {
|
|
wallet.Coin
|
|
}
|
|
|
|
func (c coinTxInput) GetAsset() string {
|
|
panic("ports.TxInput.GetAsset unimplemented on Bitcoin network") // liquid only
|
|
}
|
|
|
|
func (c coinTxInput) GetIndex() uint32 {
|
|
return c.OutPoint.Index
|
|
}
|
|
|
|
func (c coinTxInput) GetScript() string {
|
|
return hex.EncodeToString(c.TxOut.PkScript)
|
|
}
|
|
|
|
func (c coinTxInput) GetTxid() string {
|
|
return c.OutPoint.Hash.String()
|
|
}
|
|
|
|
func (c coinTxInput) GetValue() uint64 {
|
|
return uint64(c.TxOut.Value)
|
|
}
|