bitcoin

package
v0.0.0-...-cc9b5da Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const TxVersion int32 = 2

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error) errors.Status

Types

type BitcoinClient

type BitcoinClient string
var Blockbook BitcoinClient = "blockbook"
var Blockchair BitcoinClient = "blockchair"
var Native BitcoinClient = "native"

type BtcClient

type BtcClient interface {
	client.FullClient
	address.WithAddressDecoder
}

func NewBitcoinClient

func NewBitcoinClient(cfgI xc.ITask) (BtcClient, error)

func NewClient

func NewClient(cfgI xc.ITask) (BtcClient, error)

type TxBuilder

type TxBuilder struct {
	Asset          xc.ITask
	Params         *chaincfg.Params
	AddressDecoder address.AddressDecoder
}

TxBuilder for Bitcoin

func NewTxBuilder

func NewTxBuilder(cfgI xc.ITask) (TxBuilder, error)

NewTxBuilder creates a new Bitcoin TxBuilder

func (TxBuilder) NewNativeTransfer

func (txBuilder TxBuilder) NewNativeTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

NewNativeTransfer creates a new transfer for a native asset

func (TxBuilder) NewTokenTransfer

func (txBuilder TxBuilder) NewTokenTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

NewTokenTransfer creates a new transfer for a token asset

func (TxBuilder) NewTransfer

func (txBuilder TxBuilder) NewTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

Old transfer interface

func (TxBuilder) Transfer

func (txBuilder TxBuilder) Transfer(args xcbuilder.TransferArgs, input xc.TxInput) (xc.Tx, error)

NewTransfer creates a new transfer for an Asset, either native or token

func (TxBuilder) WithAddressDecoder

func (txBuilder TxBuilder) WithAddressDecoder(decoder address.AddressDecoder) TxBuilder

Directories

Path Synopsis
client

Jump to

Keyboard shortcuts

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