Documentation ¶
Index ¶
- Constants
- func AddrToPkScript(addr string, network *chaincfg.Params) ([]byte, error)
- func CalcFee(ins []*TxInput, outs []*TxOutput, sellerPsbt string, feeRate int64, ...) (int64, error)
- func CalcFeeForBatchBuy(ins []*TxInput, outs []*TxOutput, sellerPSBTList []string, feeRate int64, ...) (int64, error)
- func CalcFeeForBatchBuyWithMPC(ins []*TxInput, outs []*TxOutput, sellerPSBTList []string, feeRate int64, ...) (int64, error)
- func CalcInputSigHashForUnsignedPSBT(updater *psbt.Updater, i int, packet *psbt.Packet, ...) (string, error)
- func CheckDuplicateOfUpdater(updater *psbt.Updater, index int)
- func ExtractTxFromSignedPSBT(psbtHex string) (string, error)
- func GenerateBatchBuyingTx(ins []*TxInput, outs []*TxOutput, sellerPSBTList []string, ...) (string, error)
- func GenerateBatchBuyingTxPsbt(ins []*TxInput, outs []*TxOutput, sellerPSBTList []string, ...) (string, string, error)
- func GenerateSignedBuyingTx(ins []*TxInput, outs []*TxOutput, sellerPsbt string, network *chaincfg.Params) (string, error)
- func GenerateSignedListingPSBTBase64(in *TxInput, out *TxOutput, network *chaincfg.Params) (string, error)
- func GenerateUnsignedPSBTHex(ins []*TxInput, outs []*TxOutput, network *chaincfg.Params) (string, error)
- func GetPsbtFromString(psbtStr string) (*psbt.Packet, error)
- func GetRandomHash() (string, error)
- func GetTransactionWeight(tx *btcutil.Tx) int64
- func GetTxHex(tx *wire.MsgTx) (string, error)
- func GetTxVirtualSize(tx *btcutil.Tx) int64
- func IsHexString(s string) bool
- func PayToPubKeyHashScript(pubKeyHash []byte) ([]byte, error)
- func PayToWitnessPubKeyHashScript(pubKeyHash []byte) ([]byte, error)
- func SignPsbtWithKeyPathAndScriptPath(psbtHex string, privKey string, network *chaincfg.Params, ...) (string, error)
- func SignRawPSBTTransaction(psbtHex string, privKey string) (string, error)
- type GenerateMPCPSbtTxRes
- func GenerateMPCSignedBuyingTx(psbtBase64 string, signatures []string, pubKey string, batchSize int) (*GenerateMPCPSbtTxRes, error)
- func GenerateMPCSignedListingPSBT(psbtBase64 string, signature string, pubKey string) (*GenerateMPCPSbtTxRes, error)
- func GenerateMPCSignedPSBT(psbtStr string, pubKeyHex string, signatureList []string) (*GenerateMPCPSbtTxRes, error)
- func GenerateMPCUnsignedBuyingPSBT(ins []*TxInput, outs []*TxOutput, sellerPSBTList []string, ...) (*GenerateMPCPSbtTxRes, error)
- func GenerateMPCUnsignedListingPSBT(in *TxInput, out *TxOutput, network *chaincfg.Params) (*GenerateMPCPSbtTxRes, error)
- func GenerateMPCUnsignedPSBT(psbtStr string, pubKeyHex string) (*GenerateMPCPSbtTxRes, error)
- type SignPsbtOption
- type ToSignInput
- type TxInput
- type TxOutput
Constants ¶
View Source
const ( DefaultTxVersion = 2 DefaultSequenceNum = 0xfffffffd MaxStandardTxWeight = 4000000 / 10 WitnessScaleFactor = 4 )
View Source
const SellerSignatureIndex = 2
Variables ¶
This section is empty.
Functions ¶
func CalcFeeForBatchBuy ¶
func CheckDuplicateOfUpdater ¶
func ExtractTxFromSignedPSBT ¶
func GenerateBatchBuyingTx ¶
func GenerateSignedBuyingTx ¶
func GenerateUnsignedPSBTHex ¶
func GetRandomHash ¶
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 IsHexString ¶
func PayToPubKeyHashScript ¶
Types ¶
type GenerateMPCPSbtTxRes ¶
type GenerateMPCPSbtTxRes struct { Psbt string `json:"psbt"` PsbtTx string `json:"psbtTx"` SignHashList []string `json:"signHashList"` }
func GenerateMPCSignedListingPSBT ¶
func GenerateMPCSignedListingPSBT(psbtBase64 string, signature string, pubKey string) (*GenerateMPCPSbtTxRes, error)
func GenerateMPCSignedPSBT ¶
func GenerateMPCSignedPSBT(psbtStr string, pubKeyHex string, signatureList []string) (*GenerateMPCPSbtTxRes, error)
func GenerateMPCUnsignedPSBT ¶
func GenerateMPCUnsignedPSBT(psbtStr string, pubKeyHex string) (*GenerateMPCPSbtTxRes, error)
type SignPsbtOption ¶
type SignPsbtOption struct { AutoFinalized bool `json:"autoFinalized"` ToSignInputs []*ToSignInput `json:"toSignInputs"` }
type ToSignInput ¶
Click to show internal directories.
Click to hide internal directories.