Documentation ¶
Index ¶
- Variables
- func CreateEmptyTransaction(ts TxStruct) (string, error)
- func CreateJSONRawForSendTransaction(emptyTrans string, sp *SignaturePubkey) (*gjson.Result, error)
- func Decode(input string, alphabet *Alphabet) ([]byte, error)
- func DecodeCheck(address string) ([]byte, error)
- func Encode(input []byte, alphabet *Alphabet) string
- func EncodeCheck(prefix byte, hash []byte) string
- func VerifyTransaction(emptyTrans string, sp *SignaturePubkey) bool
- type Alphabet
- type SignaturePubkey
- type TxStruct
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TxTypeTransfer = byte(2) DefaultFeeScale = uint16(100) DefaultFixedFee = uint64(10000000) )
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
Functions ¶
func CreateEmptyTransaction ¶
创建空交易单 only transfer for now
func CreateJSONRawForSendTransaction ¶
func CreateJSONRawForSendTransaction(emptyTrans string, sp *SignaturePubkey) (*gjson.Result, error)
发送交易单
func EncodeCheck ¶
func VerifyTransaction ¶
func VerifyTransaction(emptyTrans string, sp *SignaturePubkey) bool
对签名结果进行验证
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 SignaturePubkey ¶
func SignTransaction ¶
func SignTransaction(emptyTrans string, prikey []byte) (*SignaturePubkey, error)
对空交易单进行签名
Click to show internal directories.
Click to hide internal directories.