Documentation ¶
Index ¶
- Constants
- Variables
- func CreateEmptyTransactionAndHash(ins []Vin, outs []Vout, locktime, expiry uint32) (string, []string, error)
- func CreateOmniEmptyTransactionAndHash(ins []Vin, to, change *Vout, amount uint64, propertyID uint32, ...) (string, []string, error)
- func Decode(input string, alphabet *Alphabet) ([]byte, error)
- func DecodeCheck(address string) ([]byte, []byte, error)
- func Encode(input []byte, alphabet *Alphabet) string
- func EncodeCheck(prefix []byte, hash []byte) string
- func SignTransaction(hashStr string, prikey []byte) ([]byte, error)
- func VerifyAndCombineTransaction(emptyTrans string, sigPub []*SigPub) (bool, string)
- type Alphabet
- type SigPub
- type TxIn
- type TxOut
- type TxStruct
- type Vin
- type Vout
Constants ¶
View Source
const ( OP_RETURN byte = 0x6a TxTreeRegular byte = 0 TxTreeStake byte = 1 SigHashAll byte = 1 DefaultTxVersion uint16 = 1 DefaultPkScriptVersion uint16 = 0 NoExpiryValue uint32 = 0 )
View Source
const ( TxSerializeFull uint16 = iota TxSerializeNoWitness TxSerializeOnlyWitness TxSerializeWitnessSigning TxSerializeWitnessValueSigning )
View Source
const ( PropertyID_Omni uint32 = 1 PropertyID_LEEK uint32 = 11 PropertyID_YAX uint32 = 18 PropertyID_ENTCASH uint32 = 19 )
Variables ¶
View Source
var ( CurveOrder = []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xBA, 0xAE, 0xDC, 0xE6, 0xAF, 0x48, 0xA0, 0x3B, 0xBF, 0xD2, 0x5E, 0x8C, 0xD0, 0x36, 0x41, 0x41} HalfCurveOrder = []byte{0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5D, 0x57, 0x6E, 0x73, 0x57, 0xA4, 0x50, 0x1D, 0xDF, 0xE9, 0x2F, 0x46, 0x68, 0x1B, 0x20, 0xA0} )
View Source
var (
BitcoinAlphabet = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
)
Alphabet: copy from https://en.wikipedia.org/wiki/Base58
View Source
var (
ErrorInvalidBase58String = errors.New("invalid base58 string")
)
Errors
View Source
var (
PKHAddressPrefix = []byte{0x09, 0x7f}
)
Functions ¶
func DecodeCheck ¶
return prefix + hash + error
func EncodeCheck ¶
Types ¶
type Alphabet ¶
type Alphabet struct {
// contains filtered or unexported fields
}
Alphabet The base58 alphabet object.
func NewAlphabet ¶
NewAlphabet create a custom alphabet from 58-length string. Note: len(rune(alphabet)) must be 58.
type TxIn ¶
type TxStruct ¶
type TxStruct struct { TxVersion []byte SerType []byte TxIns []*TxIn TxOuts []*TxOut LockTime []byte Expiry []byte }
func NewTxStruct ¶
Click to show internal directories.
Click to hide internal directories.