Documentation ¶
Index ¶
- Constants
- func Bech32Decode(bech string) (string, []byte, error)
- func Bech32Encode(hrp string, data []byte) (string, error)
- func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error)
- func CreateEmptyRawTransaction(vins []Vin, vouts []Vout, timeRange uint64, isTestNet bool) (string, error)
- func CreateMultiSig(required byte, pubkeys [][]byte, isTestNet bool) (string, string, error)
- func InsertSignatureIntoEmptyTransaction(txHex string, txHashes []TxHash) (string, error)
- func VerifyRawTransaction(txHex string) bool
- type MultiTx
- type NormalTx
- type SigPub
- type Transaction
- type TxHash
- type TxIn
- func (in TxIn) GetAmount() uint64
- func (in TxIn) GetAssetID() string
- func (in TxIn) GetControlProgram() string
- func (in TxIn) GetSourceID() string
- func (in TxIn) GetSourcePosition() uint64
- func (in *TxIn) SetAmount(amount uint64)
- func (in *TxIn) SetAssetID(hexID string) error
- func (in *TxIn) SetControlProgram(hexProgram string) error
- func (in *TxIn) SetSourceID(hexID string) error
- func (in *TxIn) SetSourcePosition(pos uint64)
- type TxOut
- type Vin
- type Vout
Constants ¶
View Source
const ( Bech32HRPSegwitMainNet = "bm" Bech32HRPSegwitTestNet = "tm" HashPrefixEntry = "entryid:" HashPrefixOutput = "output1:" HashPrefixSpend = "spend1:" HashPrefixMux = "mux1:" HashPrefixTxheader = "txheader:" DefaultWitnessVersion = byte(0) DefaultSerFlags = byte(7) DefaultTransactionVersion = uint64(1) DefaultAssetVersion = byte(1) DefaultOutVersion = byte(1) DefaultVMVersion = uint64(1) Op_true = byte(0x51) Op_1 = byte(0x51) Op_TxSignHash = byte(0xAE) Op_CheckMultiSig = byte(0xAD) BTMAssetID = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" )
Variables ¶
This section is empty.
Functions ¶
func Bech32Decode ¶
Decode decodes a bech32 encoded string, returning the human-readable part and the data part excluding the checksum.
func Bech32Encode ¶
Encode encodes a byte slice into a bech32 string with the human-readable part hrb. Note that the bytes must each encode 5 bits (base32).
func ConvertBits ¶
ConvertBits converts a byte slice where each byte is encoding fromBits bits, to a byte slice where each byte is encoding toBits bits.
func CreateMultiSig ¶
func VerifyRawTransaction ¶
Types ¶
type Transaction ¶
func DecodeRawTransaction ¶
func DecodeRawTransaction(txBytes []byte) (*Transaction, error)
func (*Transaction) GetTimeRange ¶
func (t *Transaction) GetTimeRange() uint64
func (*Transaction) SetTimeRange ¶
func (t *Transaction) SetTimeRange(time uint64)
func (*Transaction) SetTransVersion ¶
func (t *Transaction) SetTransVersion(ver uint64)
type TxHash ¶
func (TxHash) IsMultiSig ¶
func (*TxHash) PadMultiSig ¶
type TxIn ¶
type TxIn struct { SourceID []byte SourcePosition []byte AssetID []byte Amount []byte ControlProgram []byte SigPub *SigPub MultiSig []byte }
func (TxIn) GetAssetID ¶
func (TxIn) GetControlProgram ¶
func (TxIn) GetSourceID ¶
func (TxIn) GetSourcePosition ¶
func (*TxIn) SetAssetID ¶
func (*TxIn) SetControlProgram ¶
func (*TxIn) SetSourceID ¶
func (*TxIn) SetSourcePosition ¶
type TxOut ¶
func (*TxOut) SetAssetID ¶
func (out *TxOut) SetAssetID()
func (*TxOut) SetControlProgram ¶
Click to show internal directories.
Click to hide internal directories.