Documentation ¶
Index ¶
- type Tag
- type Transaction
- func (t *Transaction) AddTag(name string, value string) error
- func (t *Transaction) Data() string
- func (t *Transaction) FormatMsgBytes() ([]byte, error)
- func (t *Transaction) Hash() string
- func (t *Transaction) ID() []byte
- func (t *Transaction) LastTx() string
- func (t *Transaction) MarshalJSON() ([]byte, error)
- func (t *Transaction) Owner() string
- func (t *Transaction) Quantity() string
- func (t *Transaction) RawData() []byte
- func (t *Transaction) RawTags() []Tag
- func (t *Transaction) Reward() string
- func (t *Transaction) SetID(id []byte)
- func (t *Transaction) SetSignature(signature []byte)
- func (t *Transaction) Sign(w arweave.WalletSigner) (*Transaction, error)
- func (t *Transaction) Signature() string
- func (t *Transaction) Tags() ([]Tag, error)
- func (t *Transaction) Target() string
- func (t *Transaction) UnmarshalJSON(input []byte) error
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
}
Transaction struct
func NewTransaction ¶
func NewTransaction(lastTx string, owner *big.Int, quantity string, target string, data []byte, reward string) *Transaction
NewTransaction creates a brand new transaction struct
func (*Transaction) AddTag ¶ added in v0.0.2
func (t *Transaction) AddTag(name string, value string) error
AddTag adds a new tag to the transaction
func (*Transaction) Data ¶
func (t *Transaction) Data() string
Data returns the data of the transaction
func (*Transaction) FormatMsgBytes ¶ added in v0.0.3
func (t *Transaction) FormatMsgBytes() ([]byte, error)
FormatMsgBytes formats the message that needs to be signed. All fields need to be an array of bytes originating from the necessary data (not base64url encoded). The signing message is the SHA256 of the concatenation of the byte arrays of the owner public key, target address, data, quantity, reward and last transaction
func (*Transaction) Hash ¶
func (t *Transaction) Hash() string
Hash returns the base64 RawURLEncoding of the transaction hash
func (*Transaction) ID ¶
func (t *Transaction) ID() []byte
ID returns the id of the transaction which is the SHA256 of the signature
func (*Transaction) LastTx ¶
func (t *Transaction) LastTx() string
LastTx returns the last transaction of the account
func (*Transaction) MarshalJSON ¶
func (t *Transaction) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON
func (*Transaction) Owner ¶
func (t *Transaction) Owner() string
Owner returns the Owner of the transaction
func (*Transaction) Quantity ¶
func (t *Transaction) Quantity() string
Quantity returns the quantity of the transaction
func (*Transaction) RawData ¶
func (t *Transaction) RawData() []byte
RawData returns the unencoded data
func (*Transaction) RawTags ¶ added in v0.0.2
func (t *Transaction) RawTags() []Tag
RawTags returns the unencoded tags of the transaction
func (*Transaction) Reward ¶
func (t *Transaction) Reward() string
Reward returns the reward of the transaction
func (*Transaction) SetID ¶ added in v0.0.2
func (t *Transaction) SetID(id []byte)
func (*Transaction) SetSignature ¶ added in v0.0.3
func (t *Transaction) SetSignature(signature []byte)
func (*Transaction) Sign ¶
func (t *Transaction) Sign(w arweave.WalletSigner) (*Transaction, error)
Sign creates the signing message, and signs it using the private key, It takes the SHA256 of the resulting signature to calculate the id of the signature
func (*Transaction) Signature ¶
func (t *Transaction) Signature() string
Signature returns the signature of the transaction
func (*Transaction) Tags ¶
func (t *Transaction) Tags() ([]Tag, error)
Tags returns the tags of the transaction in plain text
func (*Transaction) Target ¶
func (t *Transaction) Target() string
Target returns the target of the transaction
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals as JSON