tx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(bitcoindrpcClient *bitcoindrpc.Client, mempoolapisClient *mempoolapis.Client, addressClient *address.Client) *Client

func (*Client) BroadcastRawTx added in v0.1.0

func (c *Client) BroadcastRawTx(ctx context.Context, rawTx []byte) (string, error)

广播交易

func (*Client) CreateTxUsePSBTv0 added in v0.1.0

func (c *Client) CreateTxUsePSBTv0(ctx context.Context, inputParams *types.TxInputParams) (string, error)

转账交易-使用PSBTv0版本

func (*Client) FinalizePSBT added in v0.1.0

func (c *Client) FinalizePSBT(ctx context.Context, signedPSBT string) ([]byte, error)

接收OKX签名后的交易数据并解析

func (*Client) GetRawTx

func (c *Client) GetRawTx(ctx context.Context, txid string) ([]byte, error)

查询交易元数据: 优先使用bitcoindrpc, 如果没有再使用mempoolapis

func (*Client) GetTx

func (c *Client) GetTx(ctx context.Context, txid string) (*types.Tx, error)

按照types.Tx格式返回交易数据

func (*Client) MsgTxToPSBTV0 added in v0.1.0

func (c *Client) MsgTxToPSBTV0(ctx context.Context, tx *wire.MsgTx, inputParams *types.TxInputParams, utxos []*types.TxUTXO) (*types.TxUnsignedPSBT, error)

将交易 MsgTx 转为 PSBTv0 格式; 因为btcd还不支持v2, 暂时使用v0;

func (*Client) ValidateSignedPsbtBase64 added in v0.1.1

func (c *Client) ValidateSignedPsbtBase64(ctx context.Context, psbtBase64 string) (string, error)

校验已签名psbt的base64串

func (*Client) ValidateUnsignedPsbtBase64 added in v0.1.1

func (c *Client) ValidateUnsignedPsbtBase64(ctx context.Context, psbtBase64 string) error

校验psbt base64串是否合法

Jump to

Keyboard shortcuts

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