txbuilder

package
v0.0.0-...-6c424d2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const EnableRbfNoLockTime = wire.MaxTxInSequenceNum - 2
View Source
const MaxStandardTxWeight = blockchain.MaxBlockWeight / 10

Variables

This section is empty.

Functions

func CreateEmptyTx

func CreateEmptyTx() *wire.MsgTx

func GetRevealOutValue

func GetRevealOutValue(revealOutValue int64) int64

func GetServiceFee

func GetServiceFee(inscAmount int64) int64

Types

type Info

type Info struct {
	PayAddr       string
	PayPrivateKey string
	InscribeFee   int64
	ServiceFee    int64
	MinerFee      int64
}

type InscriptionRawTx

type InscriptionRawTx struct {
	TxPrevOutput   *wire.TxOut
	WitnessScript  *witness.RevealWitness
	Size           int64
	Raw            *wire.MsgTx
	RevealOutValue int64
	FeeRate        int64
	PrivateKey     *btcec.PrivateKey
}

func NewInscriptionRawTx

func NewInscriptionRawTx() *InscriptionRawTx

func (*InscriptionRawTx) CalcPrevOutput

func (irt *InscriptionRawTx) CalcPrevOutput(revealOutValue, feeRate int64) int64

func (*InscriptionRawTx) SetSize

func (irt *InscriptionRawTx) SetSize(txSize int64)

func (*InscriptionRawTx) SetTxPrevOutput

func (irt *InscriptionRawTx) SetTxPrevOutput(pkScript []byte, prevOutput int64)

func (*InscriptionRawTx) SetWitnessScript

func (irt *InscriptionRawTx) SetWitnessScript(inscriptionWitnessScript []byte)

type MintTxBuilder

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

func NewMintTxBuilder

func NewMintTxBuilder(private *btcec.PrivateKey, net *chaincfg.Params) *MintTxBuilder

func (*MintTxBuilder) BuildMintTx

func (mtb *MintTxBuilder) BuildMintTx(prev PrevInfo, req runes.EtchRequest) (*wire.MsgTx, error)

type PrevInfo

type PrevInfo struct {
	PrevTxId   string
	PrevScript []byte
	PreAmount  int64
}

func BuilderPrevInfo

func BuilderPrevInfo(txId, script string, amount int64) PrevInfo

type StandardInscriber

type StandardInscriber struct {
	RawTxs []*InscriptionRawTx
	// contains filtered or unexported fields
}

func NewInscribeTool

func NewInscribeTool(net *chaincfg.Params, rpcclient *rpcclient.Client, serviceFeeReceiveAddr string) (*StandardInscriber, error)

func (*StandardInscriber) AddInOutToTx

func (ins *StandardInscriber) AddInOutToTx(tx *wire.MsgTx, index int, destination string, revealOutValue int64, net *chaincfg.Params) error

func (*StandardInscriber) CompleteMiddleTx

func (ins *StandardInscriber) CompleteMiddleTx(commitTxHash string, actualMiddlePrevOutputFee int64) error

1. fill commit tx value 2. sign transaction

func (*StandardInscriber) CompleteRevealTxs

func (b *StandardInscriber) CompleteRevealTxs(revealTxs []*WrapTx, pkAndScripts []*WalletInfo, middleTxHash chainhash.Hash) error

func (*StandardInscriber) Init

func (*StandardInscriber) InitAllRevealTx

func (ins *StandardInscriber) InitAllRevealTx(ords []ord.InscriptionData, revealOutValue int64) ([]*InscriptionRawTx, error)

InitAllRevealTx middle tx is a special reveal tx

func (*StandardInscriber) InitEmptyMiddleTx

func (ins *StandardInscriber) InitEmptyMiddleTx(txs []*InscriptionRawTx, totalRevealPrevOutput int64, revealOutValue, feeRate, inscAmount int64) (totalPrevOutput, serviceFee, minerFee int64, err error)

InitEmptyMiddleTx : 构造middleTx: 连接commit tx和(除了第一笔)reveal tx的中间tx: 包含reveal tx1 + commit tx2... + 手续费 + 找零

func (*StandardInscriber) InitPrevOutputFetcher

func (ins *StandardInscriber) InitPrevOutputFetcher()

Jump to

Keyboard shortcuts

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