Documentation ¶
Index ¶
- Constants
- Variables
- func FreeTxFee(outputs []*Output) int64
- func GetAllCodes() [][]byte
- func GetBaseOpReturn() *txscript.ScriptBuilder
- func GetBlockFromRaw(raw []byte) (*wire.MsgBlock, error)
- func GetBlockFromTxs(txs []*wire.MsgTx, header *wire.BlockHeader) *wire.MsgBlock
- func GetBlockHeaderFromRaw(raw []byte) (*wire.BlockHeader, error)
- func GetDecimalValue(val float64, decimals uint8) float64
- func GetGenesisTime() time.Time
- func GetMaxSendForUTXOs(utxos []UTXO) int64
- func GetMaxSendFromCount(totalValue int64, numInputs int) int64
- func GetMaxSendLikeTip(totalValue int64, numInputs int) int64
- func GetMaxSendVoteTip(totalValue int64, numInputs int) int64
- func GetMaxSpendBuyTokens(totalValue int64, numInputs int) int64
- func GetMaxSpendReply(totalValue int64, numInputs int) int64
- func GetMaxSpendTopicMessage(totalValue int64, numInputs int) int64
- func GetMemoCodes() [][]byte
- func GetMsgFromRaw(raw []byte) (*wire.MsgTx, error)
- func GetOutputSize(script Script) (int64, error)
- func GetRaw(msg *wire.MsgTx) []byte
- func GetRawBlock(block wire.MsgBlock) []byte
- func GetRawBlockHeader(blockHeader wire.BlockHeader) []byte
- func GetSlpQuantity(quantity uint64, decimals uint8) float64
- func GetSlpQuantityInt(quantity float64, decimals int) uint64
- func GetSlpQuantityString(quantity uint64, decimals uint8) string
- func HasCoinbase(tx *wire.MsgTx) bool
- func IsCoinbase(prevHash []byte, prevIndex uint32) bool
- func IsCoinbaseInput(in *wire.TxIn) bool
- func IsFreeTx(outputs []*Output) bool
- func IsMemo(prefix []byte) bool
- func IsOfOutputType(item OutputType, acceptable []OutputType) bool
- func IsSpendable(balance int64) bool
- func IsSpendableTokenPin(balance int64) bool
- func SetChain(chain string)
- func SlpTypeByteString(slpType byte) string
- func SlpTypeString(tokenType uint16) string
- type InOut
- type Out
- type Output
- type OutputType
- type PollType
- type Script
- type ScriptHasher
- type SigHash
- type SlpOut
- type SlpType
- type Tx
- type TxInput
- type UTXO
- type UTXORequest
Constants ¶
View Source
const ( CodePrefix = 0x6d CodeTest = 0x00 CodeSetName = 0x01 CodePost = 0x02 CodeReply = 0x03 CodeLike = 0x04 CodeSetProfile = 0x05 CodeFollow = 0x06 CodeUnfollow = 0x07 CodeSetImageBaseUrl = 0x08 CodeAttachPicture = 0x09 CodeSetProfilePicture = 0x0a CodeRepost = 0x0b CodeTopicMessage = 0x0c CodeTopicFollow = 0x0d CodeTopicUnfollow = 0x0e CodePollCreate = 0x10 CodePollOption = 0x13 CodePollVote = 0x14 CodeMute = 0x16 CodeUnMute = 0x17 CodeLinkRequest = 0x20 CodeLinkAccept = 0x21 CodeLinkRevoke = 0x22 CodeSendMoney = 0x24 CodeSetAlias = 0x26 CodeSellTokenMake = 0x30 CodeSellTokenOffer = 0x31 CodeSellTokenSignature = 0x32 CodeTokenPin = 0x35 )
View Source
const ( CodePollTypeSingle = 0x01 CodePollTypeMulti = 0x02 CodePollTypeRank = 0x03 )
View Source
const ( RejectReasonTooLongMempoolChain = "too-long-mempool-chain" RejectReasonMandatoryScriptVerifyFlagFailed = "mandatory-script-verify-flag-failed (Operation not valid with the current stack size)" RejectReasonBadTxnsVinEmpty = "bad-txns-vin-empty" RejectReasonScriptsigNotPushonly = "scriptsig-not-pushonly" )
View Source
const ( MaxFundAmount = 10000 MinFundAmount = 1250 MaxFaucetTransactionsDay = 50 MaxFaucetTransactionsHour = 15 DesiredFaucetUtxoCount = 15 )
View Source
const ( MaxPostSize = 65000 MaxReplySize = 65000 MaxTagMessageSize = 65000 MaxPollQuestionSize = 209 MaxPollOptionSize = 184 MaxVoteCommentSize = 184 MaxSendSize = 65000 MaxFileSize = 99000 OldMaxPostSize = 217 OldMaxReplySize = 184 OldMaxTagMessageSize = 204 OldMaxSendSize = 194 )
View Source
const ( PkHashLength = 20 ScriptHashLength = 20 TxHashLength = 32 PubKeyLength = 64 LockHashLength = TxHashLength AddressLength = 25 AddressStringLength = 35 TxStringLength = 64 BlockHeaderLength = 80 )
View Source
const ( MaxTxFee int64 = 425 OutputFeeP2PKH int64 = 34 OutputFeeP2SH int64 = 32 OutputBaseFee int64 = 12 OutputFeeOpReturn int64 = 20 OutputOpDataFee int64 = 3 OutputValueSize int64 = 8 InputFeeP2PKH int64 = 148 BaseTxFee int64 = 10 FeeOpReturnSlpSend int64 = 72 FeeOpReturnLike int64 = 55 FeeOpReturnVote int64 = 55 FeeOpReturnTopic int64 = 23 FeeOpReturnReply int64 = 55 FeeP2pkh1In1OutTx = BaseTxFee + InputFeeP2PKH + OutputFeeP2PKH FeeP2pkh1In2OutTx = BaseTxFee + InputFeeP2PKH + OutputFeeP2PKH*2 Fee2In3OutSlpSendTx = BaseTxFee + InputFeeP2PKH*2 + OutputFeeP2PKH*3 + FeeOpReturnSlpSend )
View Source
const ( Int2Size = 2 // int16 Int4Size = 4 // int32 Int8Size = 8 // int64 )
View Source
const ( StringP2pkh = "p2pkh" StringP2sh = "p2sh" StringP2pk = "p2pk" StringReturn = "return" StringMemoMessage = "memo-message" StringMemoSetName = "memo-set-name" StringMemoFollow = "memo-follow" StringMemoUnfollow = "memo-unfollow" StringMemoLike = "memo-like" StringMemoReply = "memo-reply" StringMemoSetProfile = "memo-set-profile" StringMemoSetProfilePic = "memo-set-profile-pic" StringMemoSend = "memo-send" StringMemoMute = "memo-mute" StringMemoUnmute = "memo-unmute" StringBitcom = "bitcom" StringMemoTopicMessage = "topic-message" StringMemoTopicFollow = "topic-follow" StringMemoTopicUnfollow = "topic-unfollow" StringMemoPollQuestion = "poll-question" StringMemoPollOption = "poll-option" StringMemoPollVote = "poll-vote" StringTokenCreate = "token-create" StringTokenMint = "token-mint" StringTokenSend = "token-send" StringTokenSell = "token-sell" StringTokenOffer = "token-offer" StringTokenSignature = "token-signature" StringTokenPin = "token-pin" StringLinkRequest = "link-request" StringLinkAccept = "link-accept" StringLinkRevoke = "link-revoke" StringSetAlias = "set-alias" StringUnknown = "unknown" StringNone = "-" )
View Source
const ( SlpDefaultTokenType = 0x01 SlpNftGroupTokenType = 0x81 SlpNftChildTokenType = 0x41 SlpNftChildBatonVOut = 0x4c00 SlpType1 = "Normal" SlpTypeNftGroup = "NFT Group" SlpTypeNftChild = "NFT Child" )
View Source
const ( InOutTypeInput = 0x01 InOutTypeTokenOutputSelf = 0x02 InOutTypeBitcoinOutputSelf = 0x03 InOutTypeTokenOutputP2pkh = 0x04 InOutTypeBitcoinOutputP2pkh = 0x05 InOutTypeTokenOutputP2sh = 0x06 InOutTypeBitcoinOutputP2sh = 0x07 )
View Source
const BeginningOfMemoHeight = 525000
View Source
const BeginningOfSellToken = 585000
View Source
const BeginningOfSlpHeight = 543000
View Source
const BsvForkHeight = 555766
View Source
const DustMinimumOutput int64 = 546
View Source
const FaucetMaxAncestors = 20
View Source
const MaxAncestors = 2000
Variables ¶
View Source
var ( PrefixSetName = []byte{CodePrefix, CodeSetName} PrefixPost = []byte{CodePrefix, CodePost} PrefixReply = []byte{CodePrefix, CodeReply} PrefixLike = []byte{CodePrefix, CodeLike} PrefixSetProfile = []byte{CodePrefix, CodeSetProfile} PrefixFollow = []byte{CodePrefix, CodeFollow} PrefixUnfollow = []byte{CodePrefix, CodeUnfollow} PrefixSetImageBaseUrl = []byte{CodePrefix, CodeSetImageBaseUrl} PrefixAttachPicture = []byte{CodePrefix, CodeAttachPicture} PrefixSetProfilePic = []byte{CodePrefix, CodeSetProfilePicture} PrefixRepost = []byte{CodePrefix, CodeRepost} PrefixTopicMessage = []byte{CodePrefix, CodeTopicMessage} PrefixTopicFollow = []byte{CodePrefix, CodeTopicFollow} PrefixTopicUnfollow = []byte{CodePrefix, CodeTopicUnfollow} PrefixPollCreate = []byte{CodePrefix, CodePollCreate} PrefixPollOption = []byte{CodePrefix, CodePollOption} PrefixPollVote = []byte{CodePrefix, CodePollVote} PrefixSendMoney = []byte{CodePrefix, CodeSendMoney} PrefixMute = []byte{CodePrefix, CodeMute} PrefixUnmute = []byte{CodePrefix, CodeUnMute} PrefixLinkRequest = []byte{CodePrefix, CodeLinkRequest} PrefixLinkAccept = []byte{CodePrefix, CodeLinkAccept} PrefixLinkRevoke = []byte{CodePrefix, CodeLinkRevoke} PrefixSetAlias = []byte{CodePrefix, CodeSetAlias} PrefixBitcom = []byte("19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut") PrefixSlp = append([]byte("SLP"), 0x00) PrefixSellTokenMake = []byte{CodePrefix, CodeSellTokenMake} PrefixSellTokenOffer = []byte{CodePrefix, CodeSellTokenOffer} PrefixSellTokenSignature = []byte{CodePrefix, CodeSellTokenSignature} PrefixTokenPin = []byte{CodePrefix, CodeTokenPin} )
Functions ¶
func GetAllCodes ¶
func GetAllCodes() [][]byte
func GetBaseOpReturn ¶
func GetBaseOpReturn() *txscript.ScriptBuilder
func GetBlockFromTxs ¶
func GetBlockHeaderFromRaw ¶
func GetBlockHeaderFromRaw(raw []byte) (*wire.BlockHeader, error)
func GetDecimalValue ¶
func GetGenesisTime ¶
func GetMaxSendForUTXOs ¶
func GetMaxSendFromCount ¶
func GetMaxSendLikeTip ¶
func GetMaxSendVoteTip ¶
func GetMaxSpendBuyTokens ¶
func GetMaxSpendReply ¶
func GetMaxSpendTopicMessage ¶
func GetMemoCodes ¶
func GetMemoCodes() [][]byte
func GetOutputSize ¶
func GetRawBlock ¶
func GetRawBlockHeader ¶
func GetRawBlockHeader(blockHeader wire.BlockHeader) []byte
func GetSlpQuantity ¶
func GetSlpQuantityInt ¶
func GetSlpQuantityString ¶
func HasCoinbase ¶
func IsCoinbase ¶
func IsCoinbaseInput ¶
func IsOfOutputType ¶
func IsOfOutputType(item OutputType, acceptable []OutputType) bool
func IsSpendable ¶
func IsSpendableTokenPin ¶
func SlpTypeByteString ¶
func SlpTypeString ¶
Types ¶
type Output ¶
func (Output) GetPkScript ¶
func (Output) GetType ¶
func (o Output) GetType() OutputType
func (Output) GetValuePlusFee ¶
type OutputType ¶
type OutputType uint
const ( OutputTypeP2PKH OutputType = iota OutputTypeP2SH OutputTypeP2PK OutputTypeReturn OutputTypeMemoMessage OutputTypeMemoSetName OutputTypeMemoFollow OutputTypeMemoUnfollow OutputTypeMemoLike OutputTypeMemoReply OutputTypeMemoSetProfile OutputTypeMemoTopicMessage OutputTypeMemoTopicFollow OutputTypeMemoTopicUnfollow OutputTypeMemoPollQuestionSingle OutputTypeMemoPollQuestionMulti OutputTypeMemoPollOption OutputTypeMemoPollVote OutputTypeMemoSetProfilePic OutputTypeMemoSend OutputTypeBitcom OutputTypeTokenCreate OutputTypeTokenCreateNftGroup OutputTypeTokenCreateNftChild OutputTypeTokenMint OutputTypeTokenMintNftGroup OutputTypeTokenSend OutputTypeTokenSendNftGroup OutputTypeTokenSendNftChild OutputTypeTokenSell OutputTypeTokenOffer OutputTypeTokenSignature OutputTypeMemoMute OutputTypeMemoUnMute OutputTypeTokenPin OutputTypeLinkRequest OutputTypeLinkAccept OutputTypeLinkRevoke OutputTypeSetAlias OutputTypeUnknown OutputTypeNone )
func GetOutputType ¶
func GetOutputType(pkScript []byte) OutputType
func GetOutputTypeNew ¶
func GetOutputTypeNew(pkScript []byte) OutputType
func (OutputType) String ¶
func (s OutputType) String() string
type Script ¶
type Script interface { Get() ([]byte, error) Type() OutputType }
type ScriptHasher ¶
type ScriptHasher struct { Tx wire.MsgTx SigHashes []*SigHash // contains filtered or unexported fields }
func NewScriptHasher ¶
func NewScriptHasher(tx *wire.MsgTx) *ScriptHasher
func (*ScriptHasher) Add ¶
func (h *ScriptHasher) Add(pkScript []byte, hashType txscript.SigHashType, idx int, amt int64) error
type SigHash ¶
type SigHash struct { BVersion [4]byte HashPrevOuts []byte HashSequence []byte OutPointHash []byte OutPointIndex [4]byte InputSubScript []byte BAmount [8]byte BSequence [4]byte HashOutputs []byte BLockTime [4]byte BHashType [4]byte }
func (SigHash) GetCombined ¶
func (SigHash) OutputEach ¶
func (h SigHash) OutputEach()
type Tx ¶
type Tx struct { SelfPkHash []byte MsgTx *wire.MsgTx Inputs []*TxInput Outputs []*Output OpReturn *Output AncestorsNC uint }
func (Tx) GetType ¶
func (tx Tx) GetType() OutputType
type TxInput ¶
type TxInput struct { PkScript []byte PkHash []byte Value int64 PrevOutHash []byte PrevOutIndex uint32 }
func (TxInput) GetDisasmString ¶
func (TxInput) GetHashIndexString ¶
type UTXO ¶
type UTXO struct { Input TxInput SlpToken []byte SlpQuantity uint64 SlpType SlpType SellTxHash []byte AncestorsNC uint // Ancestors not confirmed }
func GetNonPointerUtxos ¶
func (UTXO) AtAncestorLimit ¶
func (UTXO) IsPrevOutSet ¶
func (UTXO) IsSellTokenInput ¶
type UTXORequest ¶
func (UTXORequest) GetHashString ¶
func (r UTXORequest) GetHashString() string
Click to show internal directories.
Click to hide internal directories.