Documentation ¶
Index ¶
- Constants
- func AddressFromSeed(seed string) (string, error)
- func GetNewAddressByPub(pubkey string) (string, error)
- func NewAddress(privateKey string) (string, error)
- func NewTxDataBuilder() *txDataBuilder
- func SignedTx(arg ArgCreateTransaction, sender string, signature string) string
- func Transfer(args ArgCreateTransaction, privateKeyHex string) (string, error)
- func UnsignedTx(arg ArgCreateTransaction, sndAddr string, signature string) (string, error)
- func ValidateAddress(address string) bool
- type ArgCreateTransaction
- type Transaction
- type TxBuilder
- type TxDataBuilder
Constants ¶
View Source
const (
HRP = "erd"
)
Variables ¶
This section is empty.
Functions ¶
func AddressFromSeed ¶
func GetNewAddressByPub ¶
func NewAddress ¶
func NewTxDataBuilder ¶
func NewTxDataBuilder() *txDataBuilder
NewTxDataBuilder creates a new transaction data builder
func UnsignedTx ¶
func UnsignedTx(arg ArgCreateTransaction, sndAddr string, signature string) (string, error)
func ValidateAddress ¶
Types ¶
type ArgCreateTransaction ¶
type ArgCreateTransaction struct { Nonce uint64 Value string RcvAddr string GasPrice uint64 GasLimit uint64 // Arbitrary information about the transaction, base64-encoded. Data []byte // The chain identifier. ChainID string Version uint32 Options uint32 }
ArgCreateTransaction will hold the transaction fields
type Transaction ¶
type Transaction struct { Nonce uint64 `json:"nonce"` Value string `json:"value"` RcvAddr string `json:"receiver"` SndAddr string `json:"sender"` GasPrice uint64 `json:"gasPrice,omitempty"` GasLimit uint64 `json:"gasLimit,omitempty"` Data []byte `json:"data,omitempty"` ChainID string `json:"chainID"` Version uint32 `json:"version"` Options uint32 `json:"options,omitempty"` // The digital signature consisting of 128 hex-characters (thus 64 bytes in a raw representation) Signature string `json:"signature,omitempty"` }
type TxBuilder ¶
type TxBuilder struct {
// contains filtered or unexported fields
}
func NewTxBuilder ¶
func NewTxBuilder(key *ed25519.PrivateKey) *TxBuilder
NewTxBuilder will create a new transaction builder able to build and correctly sign a transaction
type TxDataBuilder ¶
type TxDataBuilder interface { Function(function string) TxDataBuilder ArgHexString(hexed string) TxDataBuilder ArgAddress(address string) TxDataBuilder ArgBigInt(value *big.Int) TxDataBuilder ArgInt64(value int64) TxDataBuilder ArgBytes(bytes []byte) TxDataBuilder ToDataString() (string, error) ToDataBytes() ([]byte, error) IsInterfaceNil() bool }
TxDataBuilder defines the behavior of a transaction data builder
Click to show internal directories.
Click to hide internal directories.