Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction( message string, recipient string, sender string, privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey, value float32) *Transaction
NewTransaction creates a new transaction with the given details.
func (*Transaction) GenerateSignature ¶
func (t *Transaction) GenerateSignature() *utils.Signature
GenerateSignature generates the signature for the transaction.
func (*Transaction) MarshalJSON ¶
func (t *Transaction) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON representation of the transaction.
type TransactionRequest ¶
type TransactionRequest struct { Message *string `json:"message"` RecipientBlockchainAddress *string `json:"recipientBlockchainAddress"` SenderBlockchainAddress *string `json:"senderBlockchainAddress"` SenderPrivateKey *string `json:"senderPrivateKey"` SenderPublicKey *string `json:"senderPublicKey"` Value *string `json:"value"` }
func (*TransactionRequest) Validate ¶
func (tr *TransactionRequest) Validate() bool
Validate checks if all the required fields in the transaction request are present.
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func (*Wallet) BlockchainAddress ¶
BlockchainAddress returns the blockchain address associated with the wallet.
func (*Wallet) MarshalJSON ¶
MarshalJSON returns the JSON representation of the wallet.
func (*Wallet) PrivateKey ¶
func (w *Wallet) PrivateKey() *ecdsa.PrivateKey
PrivateKey returns the ECDSA private key of the wallet.
func (*Wallet) PrivateKeyStr ¶
PrivateKeyStr returns the hexadecimal representation of the private key.
func (*Wallet) PublicKeyStr ¶
PublicKeyStr returns the hexadecimal representation of the public key.
Click to show internal directories.
Click to hide internal directories.