btctx

package module
v0.0.0-...-68db423 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MIT Imports: 11 Imported by: 0

README

btc-tx

比特币交易构建签名工具

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeTxString

func DecodeTxString(rawtx string) (*wire.MsgTx, error)

func EncodeTxBytes

func EncodeTxBytes(tx *wire.MsgTx) ([]byte, error)

func EncodeTxString

func EncodeTxString(tx *wire.MsgTx) (string, error)

func SignTx

func SignTx(rawtx string, wif_priv string) (string, error)

不能签名p2pk格式的交易

Types

type Builder

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

func NewBuilder

func NewBuilder() *Builder

func (*Builder) AddTxOut

func (b *Builder) AddTxOut(wifaddr string, amount uint64)

func (*Builder) Build

func (b *Builder) Build() ([]byte, error)

func (*Builder) SetCoins

func (b *Builder) SetCoins(coins []*Coin)

func (*Builder) SetFee

func (b *Builder) SetFee(fee uint64)

func (*Builder) SetParams

func (b *Builder) SetParams(params *address.Params)

func (*Builder) SetRefund

func (b *Builder) SetRefund(wifaddr string)

type Coin

type Coin struct {
	TxHash   string
	Index    uint32
	PkScript string
	Amount   uint64
}

func (*Coin) ToTxIn

func (c *Coin) ToTxIn() (*wire.TxIn, error)

type Omni

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

func (*Omni) ToScript

func (o *Omni) ToScript() []byte

type OmniBuilder

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

func NewOmniBuilder

func NewOmniBuilder() *OmniBuilder

func (*OmniBuilder) AddTxOmniOut

func (ob *OmniBuilder) AddTxOmniOut(wifaddr string, token uint32, amount uint64, gift uint64)

func (*OmniBuilder) Build

func (ob *OmniBuilder) Build() ([]byte, error)

func (*OmniBuilder) SetCoins

func (ob *OmniBuilder) SetCoins(coins []*Coin)

func (*OmniBuilder) SetFee

func (ob *OmniBuilder) SetFee(fee uint64)

func (*OmniBuilder) SetParams

func (ob *OmniBuilder) SetParams(params *address.Params)

func (*OmniBuilder) SetRefund

func (ob *OmniBuilder) SetRefund(wifaddr string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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