Documentation ¶
Index ¶
- func NewAccount() (address, seedHex string, err error)
- func PrivateKeyToAddr(privateKey string) (string, error)
- func PrivateKeyToPublicKeyHex(privateKey string) (string, error)
- func PublicKeyToAddress(publicKey string) (string, error)
- func SignTransaction(txBase58 string, privateKey string) (string, error)
- func ValidateAddress(addr string) bool
- type ActionTransfer
- type SignatureData
- type SignatureTransaction
- type Transaction
- type Transfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccount ¶
func PrivateKeyToAddr ¶
func PublicKeyToAddress ¶
func ValidateAddress ¶
ValidateAddress NOTE:Address is not account id.
Types ¶
type ActionTransfer ¶
type ActionTransfer struct {
Transfer Transfer `json:"transfer"`
}
type SignatureData ¶
type SignatureTransaction ¶
type SignatureTransaction struct { Sig serialize.Signature Tx *Transaction }
func CreateSignedTransaction ¶
func CreateSignedTransaction(tx *Transaction, sig string) (*SignatureTransaction, error)
func (*SignatureTransaction) Serialize ¶
func (stx *SignatureTransaction) Serialize() ([]byte, error)
type Transaction ¶
type Transaction struct { SignerId serialize.String PublicKey serialize.PublicKey Nonce serialize.U64 ReceiverId serialize.String BlockHash serialize.BlockHash Actions []serialize.IAction }
func CreateTransaction ¶
func CreateTransaction(from, to, publicKeyHex, blockHash string, nonce int64) (*Transaction, error)
func (*Transaction) GetSigningHash ¶
func (tx *Transaction) GetSigningHash() (string, error)
func (*Transaction) Serialize ¶
func (tx *Transaction) Serialize() ([]byte, error)
func (*Transaction) SetAction ¶
func (tx *Transaction) SetAction(action ...serialize.IAction)
Click to show internal directories.
Click to hide internal directories.