Documentation ¶
Index ¶
- Constants
- Variables
- 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 GetProgramHashFromAddress(address string) ([]byte, error)
- func SignRawTransaction(hash string, privateKey []byte) ([]byte, error)
- func VerifyAndCombineRawTransaction(emptyTrans string, sigPubs []SigPub) (bool, string)
- type Alphabet
- type Input
- type Output
- type SigPub
- type Sigpubs
- type Transaction
- type TxHash
- type Vin
- type Vout
Constants ¶
View Source
const ( TxTypeTransferAsset = byte(0x02) DefaultPayloadVersion = byte(0x00) AddressPrefix = byte(0x21) OP_CHECKSIG = byte(0xAC) AssetID_ELA = "a3d0eaa466df74983b5d7c543de6904f4c9418ead5ffd6d25814234a96db37b0" )
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 ¶
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 Transaction ¶
type Transaction struct { TxType byte PayloadVersion byte Attributes []*[]byte Inputs []*Input Outputs []*Output LockTime []byte Signatures []*SigPub }
func NewTransaction ¶
func NewTransaction(vins []Vin, vouts []Vout) (*Transaction, error)
func (Transaction) GetEmptyAndHash ¶
func (tx Transaction) GetEmptyAndHash() ([]byte, []byte)
Click to show internal directories.
Click to hide internal directories.