Documentation ¶
Index ¶
- Constants
- type BTCBaseClient
- type Builder
- func (b *Builder) BuildAllUsedWallet(req MintReq, payAddrPK string) ([]*WalletInfo, error)
- func (b *Builder) BuildMiddleTxWithEmptyInput(req MintReq, revealTxs []*WrapTx, prevScript []byte) (*WrapTx, error)
- func (b *Builder) BuildRevealTxsWithEmptyInput(pkAndScripts []*WalletInfo, req MintReq) ([]*WrapTx, error)
- func (b *Builder) CompleteMiddleTx(privKey btcec.PrivateKey, middleTx *WrapTx, commitTxHash string, ...) error
- func (b *Builder) CompleteRevealTxs(revealTxs []*WrapTx, pkAndScripts []*WalletInfo, middleTxHash chainhash.Hash) error
- type Inscriber
- type MintReq
- type MintTxs
- type Order
- type PayInfo
- type RunesMinter
- func (rm *RunesMinter) BuildRunesTxs(commitTxHash string, actualMiddlePrevOutputFee int64, payAddrPK string, ...) (*WrapTx, []*WrapTx, error)
- func (rm *RunesMinter) CalcRunesTxsFee(payAddrPK string, req MintReq) (int64, error)
- func (rm *RunesMinter) Inscribe(commitTxHash string, actualMiddlePrevOutputFee int64, payAddrPK string, ...) (*SendResult, error)
- func (rm *RunesMinter) SendRunesTxs(middleTx *WrapTx, revealTxs []*WrapTx) map[string]bool
- type SendResult
- type SendTask
- type WalletInfo
- type WrapTx
Constants ¶
View Source
const ( EnableRbfNoLockTime = wire.MaxTxInSequenceNum - 2 MaxStandardTxWeight = blockchain.MaxBlockWeight / 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BTCBaseClient ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func (*Builder) BuildAllUsedWallet ¶
func (b *Builder) BuildAllUsedWallet(req MintReq, payAddrPK string) ([]*WalletInfo, error)
func (*Builder) BuildMiddleTxWithEmptyInput ¶
func (b *Builder) BuildMiddleTxWithEmptyInput(req MintReq, revealTxs []*WrapTx, prevScript []byte) (*WrapTx, error)
note: include reveal tx1 + commit tx2... + 手续费 + 找零
func (*Builder) BuildRevealTxsWithEmptyInput ¶
func (b *Builder) BuildRevealTxsWithEmptyInput(pkAndScripts []*WalletInfo, req MintReq) ([]*WrapTx, error)
func (*Builder) CompleteMiddleTx ¶
func (b *Builder) CompleteMiddleTx(privKey btcec.PrivateKey, middleTx *WrapTx, commitTxHash string, actualMiddlePrevOutputFee int64) error
1. fill commit tx value 2. sign transaction
func (*Builder) CompleteRevealTxs ¶
type Inscriber ¶
type Inscriber struct {
// contains filtered or unexported fields
}
func NewInscriber ¶
func NewInscriber(btcClient BTCBaseClient) *Inscriber
func (*Inscriber) CreateOrder ¶
type MintTxs ¶
type MintTxs struct { PayTxHash string `json:"pay_tx_hash"` // user who pay for mint address's transaction hash MiddleTx *WrapTx `json:"middle_tx"` // which include one mint runes and other UTXO for reveals txs input RevealTxs []*WrapTx `json:"reveal_txs"` // all txs which have mint runes }
NOTE : len(middleTx) + len(RevealTxs) = MintReq.Count
type RunesMinter ¶
type RunesMinter struct {
// contains filtered or unexported fields
}
func NewRunesMinter ¶
func NewRunesMinter(net *chaincfg.Params, btcClient BTCBaseClient) *RunesMinter
func (*RunesMinter) BuildRunesTxs ¶
func (*RunesMinter) CalcRunesTxsFee ¶
func (rm *RunesMinter) CalcRunesTxsFee(payAddrPK string, req MintReq) (int64, error)
func (*RunesMinter) Inscribe ¶
func (rm *RunesMinter) Inscribe(commitTxHash string, actualMiddlePrevOutputFee int64, payAddrPK string, req MintReq) (*SendResult, error)
func (*RunesMinter) SendRunesTxs ¶
func (rm *RunesMinter) SendRunesTxs(middleTx *WrapTx, revealTxs []*WrapTx) map[string]bool
type SendResult ¶
type SendTask ¶
type SendTask struct {
// contains filtered or unexported fields
}
func NewSendTask ¶
func NewSendTask(client BTCBaseClient, who, runes, orderId string, count int64) *SendTask
func (*SendTask) LoopSendTxs ¶
func (s *SendTask) LoopSendTxs(sr *SendResult)
func (*SendTask) SaveToFile ¶
func (s *SendTask) SaveToFile(sr *SendResult)
type WalletInfo ¶
type WalletInfo struct { PrivateKey *btcec.PrivateKey `json:"private_key"` Address btcutil.Address `json:"address"` PkScript []byte `json:"pk_script"` RecoveryPKofWIF string `json:"recovery_pk_of_wif"` }
func CreateWallet ¶
func CreateWallet(net *chaincfg.Params, privateKey *btcec.PrivateKey) (*WalletInfo, error)
Click to show internal directories.
Click to hide internal directories.