Documentation ¶
Index ¶
- Constants
- func BuildInsufficientInputError(cat, inSatoshi, outSatoshi string) error
- func CanonicalSignatureDER(sig []byte) ([]byte, error)
- func CheckDerivation(public string, chainCode []byte, maxRange uint32) error
- func CheckFinalization(num uint64, coinbase bool) bool
- func CheckMultisigHolderSignerScript(script []byte) bool
- func CheckTransactionPartiallySignedBy(raw, public string) bool
- func DeriveBIP32(public string, chainCode []byte, children ...uint32) (string, string, error)
- func EncodeAddress(script []byte, chain byte) (string, error)
- func EstimateAvgFee(chain byte, rpc string) (int64, error)
- func ExtractPkScriptAddr(pkScript []byte, chain byte) (string, error)
- func HashMessageForSignature(msg string, chain byte) []byte
- func IsInsufficientInputError(err error) bool
- func MarshalWiredTransaction(msgTx *wire.MsgTx, encoding wire.MessageEncoding, chain byte) ([]byte, error)
- func NetConfig(chain byte) *chaincfg.Params
- func ParseAddress(addr string, chain byte) ([]byte, error)
- func ParseSatoshi(amount string) int64
- func ParseSequence(lock time.Duration, chain byte) int64
- func RPCGetBlockAverageFeePerBytes(chain byte, rpc string) (*big.Int, error)
- func RPCGetBlockHash(rpc string, num int64) (string, error)
- func RPCGetBlockHeight(rpc string) (int64, error)
- func RPCGetMempoolAverageFeePerBytes(rpc string) (*big.Int, error)
- func RPCGetTransactionOutput(chain byte, rpc, hash string, index int64) (*RPCTransaction, *Output, error)
- func RPCGetTransactionSender(chain byte, rpc string, tx *RPCTransaction) (string, error)
- func RPCSendRawTransaction(rpc, raw string) (string, error)
- func SpendSignedTransaction(raw string, feeInputs []*Input, accountant string, chain byte) (*wire.MsgTx, error)
- func ValueDust(chain byte) int64
- func VerifyHolderKey(public string) error
- func VerifySignatureDER(public string, msg, sig []byte) error
- func WriteBytes(enc *common.Encoder, b []byte)
- type Input
- type MemPoolTransaction
- type Output
- type PartiallySignedTransaction
- func BuildPartiallySignedTransaction(mainInputs []*Input, outputs []*Output, rid []byte, chain byte) (*PartiallySignedTransaction, error)
- func SignPartiallySignedTransaction(raw []byte, signer *secp256k1.PrivateKey) *PartiallySignedTransaction
- func UnmarshalPartiallySignedTransaction(b []byte) (*PartiallySignedTransaction, error)
- func (psbt *PartiallySignedTransaction) EstimateVirtualSize() int
- func (raw *PartiallySignedTransaction) Hash() string
- func (psbt *PartiallySignedTransaction) IsRecoveryTransaction() bool
- func (raw *PartiallySignedTransaction) Marshal() []byte
- func (psbt *PartiallySignedTransaction) SigHash(idx int) []byte
- func (psbt *PartiallySignedTransaction) SignedTransaction(holder, signer, observer string) (*wire.MsgTx, error)
- type RPCBlock
- type RPCBlockWithTransactions
- type RPCTransaction
- type WitnessScriptAccount
Constants ¶
View Source
const ( ChainBitcoin = 1 ChainLitecoin = 5 ValuePrecision = 8 ValueSatoshi = 100000000 MaxUnspentUtxo = 512 TimeLockMinimum = time.Hour * 1 TimeLockMaximum = time.Hour * 24 * 365 ScriptPubKeyTypeWitnessKeyHash = "witness_v0_keyhash" ScriptPubKeyTypeWitnessScriptHash = "witness_v0_scripthash" SigHashType = txscript.SigHashAll | txscript.SigHashAnyOneCanPay InputTypeP2WPKHAccoutant = 1 InputTypeP2WSHMultisigHolderSigner = 2 InputTypeP2WSHMultisigObserverSigner = 3 MaxTransactionSequence = 0xffffffff MaxStandardTxWeight = 300000 )
Variables ¶
This section is empty.
Functions ¶
func BuildInsufficientInputError ¶ added in v0.11.0
func CanonicalSignatureDER ¶ added in v0.6.1
func CheckDerivation ¶ added in v0.5.0
func CheckFinalization ¶
func CheckTransactionPartiallySignedBy ¶ added in v0.5.0
func DeriveBIP32 ¶ added in v0.4.1
func ExtractPkScriptAddr ¶ added in v0.8.0
func HashMessageForSignature ¶
func MarshalWiredTransaction ¶ added in v0.5.0
func ParseSatoshi ¶
func RPCGetBlockAverageFeePerBytes ¶ added in v0.12.0
func RPCGetBlockHeight ¶
func RPCGetMempoolAverageFeePerBytes ¶ added in v0.12.0
func RPCGetTransactionOutput ¶
func RPCGetTransactionSender ¶
func RPCGetTransactionSender(chain byte, rpc string, tx *RPCTransaction) (string, error)
func RPCSendRawTransaction ¶
func SpendSignedTransaction ¶ added in v0.5.0
func VerifyHolderKey ¶
func VerifySignatureDER ¶
func WriteBytes ¶ added in v0.11.0
Types ¶
type MemPoolTransaction ¶ added in v0.12.0
type PartiallySignedTransaction ¶
func SignPartiallySignedTransaction ¶ added in v0.8.0
func SignPartiallySignedTransaction(raw []byte, signer *secp256k1.PrivateKey) *PartiallySignedTransaction
func UnmarshalPartiallySignedTransaction ¶
func UnmarshalPartiallySignedTransaction(b []byte) (*PartiallySignedTransaction, error)
func (*PartiallySignedTransaction) EstimateVirtualSize ¶ added in v0.12.0
func (psbt *PartiallySignedTransaction) EstimateVirtualSize() int
func (*PartiallySignedTransaction) Hash ¶
func (raw *PartiallySignedTransaction) Hash() string
func (*PartiallySignedTransaction) IsRecoveryTransaction ¶ added in v0.8.0
func (psbt *PartiallySignedTransaction) IsRecoveryTransaction() bool
func (*PartiallySignedTransaction) Marshal ¶
func (raw *PartiallySignedTransaction) Marshal() []byte
func (*PartiallySignedTransaction) SigHash ¶
func (psbt *PartiallySignedTransaction) SigHash(idx int) []byte
func (*PartiallySignedTransaction) SignedTransaction ¶ added in v0.5.0
func (psbt *PartiallySignedTransaction) SignedTransaction(holder, signer, observer string) (*wire.MsgTx, error)
type RPCBlock ¶
type RPCBlock struct { Hash string `json:"hash"` Height uint64 `json:"height"` Tx []string `json:"tx"` Confirmations int `json:"confirmations"` }
func RPCGetBlock ¶
type RPCBlockWithTransactions ¶
type RPCBlockWithTransactions struct { Hash string `json:"hash"` Height uint64 `json:"height"` Tx []*RPCTransaction `json:"tx"` }
func RPCGetBlockWithTransactions ¶
func RPCGetBlockWithTransactions(chain byte, rpc, hash string) (*RPCBlockWithTransactions, error)
type RPCTransaction ¶
type RPCTransaction struct { TxId string `json:"txid"` Vin []*rpcIn `json:"vin"` Vout []*rpcOut `json:"vout"` BlockHash string `json:"blockhash"` Hex string `json:"hex"` Fee float64 `json:"fee"` VSize int64 `json:"vsize"` }
func RPCGetRawMempool ¶
func RPCGetRawMempool(chain byte, rpc string) ([]*RPCTransaction, error)
func RPCGetRawMempoolWithTransactions ¶ added in v0.12.0
func RPCGetRawMempoolWithTransactions(rpc string) ([]*RPCTransaction, error)
func RPCGetTransaction ¶
func RPCGetTransaction(chain byte, rpc, hash string) (*RPCTransaction, error)
type WitnessScriptAccount ¶
func BuildWitnessScriptAccount ¶
func BuildWitnessScriptAccount(holder, signer, observer string, lock time.Duration, chain byte) (*WitnessScriptAccount, error)
thresh(2,pk(HOLDER),pk(SIGNER),and(pk(OBSERVER),older(12960))) thresh(2,pk(HOLDER),s:pk(SIGNER),sj:and_v(v:pk(OBSERVER),n:older(12960)))
<HOLDER> OP_CHECKSIG OP_SWAP <SIGNER> OP_CHECKSIG OP_ADD OP_SWAP OP_SIZE OP_0NOTEQUAL OP_IF <OBSERVER> OP_CHECKSIGVERIFY <a032> OP_CHECKSEQUENCEVERIFY OP_0NOTEQUAL OP_ENDIF OP_ADD 2 OP_EQUAL
func UnmarshalWitnessScriptAccount ¶ added in v0.5.0
func UnmarshalWitnessScriptAccount(extra []byte) (*WitnessScriptAccount, error)
func (*WitnessScriptAccount) Marshal ¶ added in v0.5.0
func (wsa *WitnessScriptAccount) Marshal() []byte
Click to show internal directories.
Click to hide internal directories.