Documentation
¶
Index ¶
- Variables
- func CreateEmptyTransactionAndHash(in Vin, outs Vouts) (string, string, error)
- func Decode(input string, alphabet *Alphabet) ([]byte, error)
- func Encode(input []byte, alphabet *Alphabet) string
- func SignTransaction(hash string, prikey []byte) (string, error)
- func VerifyAndCombineTransaction(emptyTrans, signature, pubkey string) (string, bool)
- type Alphabet
- type ToStruct
- type Transfer
- type TransferDetail
- type TransferDetails
- type Transfers
- type TxStruct
- type Vin
- type Vout
- type Vouts
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 Transfer ¶
type Transfer struct { TxId string `json:"txid"` //转账交易ID,hash(sha356) From string `json:"from"` //转出地址/base58(hex([20]byte[:])) ToCount uint64 `json:"tocount"` //转入地址个数 Value uint64 `json:"value"` //转入总金额/1e-9FN Timestamp int64 `json:"timestamp"` //时间戳/秒 TransferDetails *TransferDetails `json:"transferdetails"` Sign string `json:"sign"` //签名(secp256k1) }
type TransferDetail ¶
type TransferDetails ¶
type TransferDetails []*TransferDetail //按照To字段进行排序
Click to show internal directories.
Click to hide internal directories.