Documentation
¶
Index ¶
- Constants
- Variables
- func AddrToPkScript(addr string) ([]byte, error)
- func DogeByteLength(tx *wire.MsgTx) int64
- func GetTransactionWeight(tx *btcutil.Tx) int64
- func GetTxHex(tx *wire.MsgTx) (string, error)
- func GetTxVirtualSize(tx *btcutil.Tx) int64
- func Sign(tx *wire.MsgTx, privateKeys []*btcec.PrivateKey, ...) error
- type Chunk
- type DogScript
- type InscribeTxs
- type Inscription
- type InscriptionData
- type InscriptionRequest
- type InscriptionTool
- type PrevOutput
Constants ¶
View Source
const ( DefaultTxVersion = 2 DefaultSequenceNum = 0xfffffffd DefaultRevealOutValue = int64(100000) DefaultMinChangeValue = int64(100000) WitnessScaleFactor = 4 ChangeOutputMaxSize = int64(20 + 4 + 34 + 4) MaxChunkLen = 240 MaxPayloadLen = 1500 )
View Source
const ( PubKeyHashAddrID = 0x1e ScriptHashAddrID = 0x16 PrivateKeyID = 0x9e )
Variables ¶
View Source
var DogeMainNetParams = chaincfg.Params{ Name: "mainnet", Net: wire.MainNet, DefaultPort: "8333", PowLimit: mainPowLimit, PowLimitBits: 0x1d00ffff, BIP0034Height: 227931, BIP0065Height: 388381, BIP0066Height: 363725, CoinbaseMaturity: 100, SubsidyReductionInterval: 210000, TargetTimespan: time.Hour * 24 * 14, TargetTimePerBlock: time.Minute * 10, RetargetAdjustmentFactor: 4, ReduceMinDifficulty: false, MinDiffReductionTime: 0, GenerateSupported: false, RuleChangeActivationThreshold: 1916, MinerConfirmationWindow: 2016, RelayNonStdTxs: false, Bech32HRPSegwit: "doge", PubKeyHashAddrID: PubKeyHashAddrID, ScriptHashAddrID: ScriptHashAddrID, PrivateKeyID: PrivateKeyID, WitnessPubKeyHashAddrID: 0x00, WitnessScriptHashAddrID: 0x00, HDPublicKeyID: [4]byte{0x02, 0xfa, 0xca, 0xfd}, HDPrivateKeyID: [4]byte{0x02, 0xfa, 0xc3, 0x98}, HDCoinType: 3, }
MainNetParams defines the network parameters for the main Bitcoin network.
Functions ¶
func AddrToPkScript ¶
func DogeByteLength ¶
func GetTransactionWeight ¶
GetTransactionWeight computes the value of the weight metric for a given transaction. Currently the weight metric is simply the sum of the transactions's serialized size without any witness data scaled proportionally by the WitnessScaleFactor, and the transaction's serialized size including any witness data.
func GetTxVirtualSize ¶
GetTxVirtualSize computes the virtual size of a given transaction. A transaction's virtual size is based off its weight, creating a discount for any witness data it contains, proportional to the current blockchain.WitnessScaleFactor value.
func Sign ¶
func Sign(tx *wire.MsgTx, privateKeys []*btcec.PrivateKey, prevOutFetcher *txscript.MultiPrevOutFetcher) error
Types ¶
type InscribeTxs ¶
type InscribeTxs struct {
CommitTx string `json:"commitTx"`
RevealTxs []string `json:"revealTxs"`
CommitTxFee int64 `json:"commitTxFee"`
RevealTxFees []int64 `json:"revealTxFees"`
CommitAddrs []string `json:"commitAddrs"`
}
func Inscribe ¶
func Inscribe(request *InscriptionRequest) (*InscribeTxs, error)
type Inscription ¶
func (*Inscription) Amount ¶
func (i *Inscription) Amount() (int64, error)
type InscriptionData ¶
type InscriptionRequest ¶
type InscriptionRequest struct {
CommitTxPrevOutputList []*PrevOutput `json:"commitTxPrevOutputList"`
CommitFeeRate int64 `json:"commitFeeRate"`
RevealFeeRate int64 `json:"revealFeeRate"`
RevealOutValue int64 `json:"revealOutValue"`
InscriptionData *InscriptionData `json:"inscriptionData"`
Address string `json:"address"`
DustSize int64 `json:"dustSize"`
}
type InscriptionTool ¶
type InscriptionTool struct {
CommitTxPrevOutputFetcher *txscript.MultiPrevOutFetcher
CommitTxPrivateKeyList []*btcec.PrivateKey
InscriptionTxCtxData []*inscriptionTxCtxData
RevealTxPrevOutputFetcher *txscript.MultiPrevOutFetcher
CommitTxPrevOutputList []*PrevOutput
RevealTxs []*wire.MsgTx
CommitTx *wire.MsgTx
MustCommitTxFee int64
MustRevealTxFees []int64
CommitAddrs []string
FromAddr btcutil.Address
RevealAddr btcutil.Address
}
func NewInscriptionTool ¶
func NewInscriptionTool(request *InscriptionRequest) (*InscriptionTool, error)
func (*InscriptionTool) CalculateFee ¶
func (tool *InscriptionTool) CalculateFee() (int64, []int64)
func (*InscriptionTool) GetCommitTxHex ¶
func (tool *InscriptionTool) GetCommitTxHex() (string, error)
func (*InscriptionTool) GetRevealTxHexList ¶
func (tool *InscriptionTool) GetRevealTxHexList() ([]string, error)
Click to show internal directories.
Click to hide internal directories.