Documentation ¶
Index ¶
- Constants
- func BuildInscriptionWitness(datas []InscriptionData, privateKey *btcec.PrivateKey, revealOutValue int64) ([]byte, error)
- func DecodeTxFromHex(txHex string) (*wire.MsgTx, error)
- func EncodeTxToHex(tx *wire.MsgTx) (string, error)
- func GetRevealOutValue(revealOutValue int64) int64
- func GetSatBytes(decimalNum int64) ([]byte, error)
- func GetServiceFee(inscAmount int64) int64
- func SendRawTransaction(client *BlockchainClient, tx *wire.MsgTx) (*chainhash.Hash, error)
- func VerifySign(signature []byte, hash []byte, pubKey *btcec.PublicKey) (bool, error)
- type BlockchainClient
- type Info
- type InscribeTxBase
- type InscribeTxDetail
- type InscribeTxPrevOutput
- type InscribeTxPreview
- type InscribeTxsPreview
- type InscriptionData
- type InscriptionRawTx
- type InscriptionRequest
- type InscriptionWitness
- type StandardInscriber
- func (ins *StandardInscriber) AddInOutToTx(tx *wire.MsgTx, index int, destination string, revealOutValue int64) error
- func (ins *StandardInscriber) Init(req InscriptionRequest) error
- func (ins *StandardInscriber) InitAllRevealTx(dataList []InscriptionData, revealOutValue int64) ([]*InscriptionRawTx, error)
- func (ins *StandardInscriber) InitAllScript(rawTxs []*InscriptionRawTx) ([]*InscribeTxPreview, error)
- func (ins *StandardInscriber) InitAllWitness(dataList []InscriptionData, privateKeyList []*btcec.PrivateKey) ([]*InscriptionWitness, error)
- func (ins *StandardInscriber) InitEmptyMiddleTx(txs []*InscriptionRawTx, totalRevealPrevOutput int64, ...) (totalPrevOutput, serviceFee, minerFee int64, err error)
- func (ins *StandardInscriber) InitPrevOutputFetcher()
- func (ins *StandardInscriber) InitPrivateKeys(size int, payPrivateKey string) ([]*btcec.PrivateKey, error)
- func (ins *StandardInscriber) InitScript(tx *InscriptionRawTx) (*InscribeTxPreview, error)
Constants ¶
View Source
const ( DefaultSequenceNum = wire.MaxTxInSequenceNum - 10 MaxStandardTxWeight = blockchain.MaxBlockWeight / 10 )
View Source
const ( DefaultRevealOutValue = int64(546) MinRevealOutValue = int64(294) )
Variables ¶
This section is empty.
Functions ¶
func BuildInscriptionWitness ¶
func BuildInscriptionWitness(datas []InscriptionData, privateKey *btcec.PrivateKey, revealOutValue int64) ([]byte, error)
func GetRevealOutValue ¶
func GetSatBytes ¶
func GetServiceFee ¶
func SendRawTransaction ¶
Types ¶
type BlockchainClient ¶
type InscribeTxBase ¶
type InscribeTxDetail ¶
type InscribeTxPrevOutput ¶
type InscribeTxPreview ¶
type InscribeTxsPreview ¶
type InscribeTxsPreview struct { InscribeTxBase Destination string Previews []InscribeTxPreview }
type InscriptionData ¶
type InscriptionRawTx ¶
type InscriptionRawTx struct { TxPrevOutput *wire.TxOut WitnessScript *InscriptionWitness 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 InscriptionRequest ¶
type InscriptionRequest struct { // a local signature is required for committing the commit tx. // Currently, CommitTxPrivateKeyList[i] sign CommitTxOutPointList[i] CommitFeeRate int64 // note: 给矿工的手续费率,在构建commit tx时使用 FeeRate int64 // note: 交易费率,相当于gas price DataList []InscriptionData RevealOutValue int64 PrivateKey string }
type InscriptionWitness ¶
type InscriptionWitness struct { SignatureWitness []byte InsWitnessScript []byte ControlBlockWitness []byte }
func NewInscriptionWitness ¶
func NewInscriptionWitness() *InscriptionWitness
type StandardInscriber ¶
type StandardInscriber struct {
// contains filtered or unexported fields
}
func NewInscribeTool ¶
func (*StandardInscriber) AddInOutToTx ¶
func (*StandardInscriber) Init ¶
func (ins *StandardInscriber) Init(req InscriptionRequest) error
func (*StandardInscriber) InitAllRevealTx ¶
func (ins *StandardInscriber) InitAllRevealTx(dataList []InscriptionData, revealOutValue int64) ([]*InscriptionRawTx, error)
InitAllRevealTx middle tx is a special reveal tx
func (*StandardInscriber) InitAllScript ¶
func (ins *StandardInscriber) InitAllScript(rawTxs []*InscriptionRawTx) ([]*InscribeTxPreview, error)
func (*StandardInscriber) InitAllWitness ¶
func (ins *StandardInscriber) InitAllWitness(dataList []InscriptionData, privateKeyList []*btcec.PrivateKey) ([]*InscriptionWitness, error)
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()
func (*StandardInscriber) InitPrivateKeys ¶
func (ins *StandardInscriber) InitPrivateKeys(size int, payPrivateKey string) ([]*btcec.PrivateKey, error)
func (*StandardInscriber) InitScript ¶
func (ins *StandardInscriber) InitScript(tx *InscriptionRawTx) (*InscribeTxPreview, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.