Casper.Network.SDK
Show / Hide Table of Contents

Class TransactionV1

A unit of work sent by a client to the network, which when executed can cause global state to be altered.

Inheritance
object
TransactionV1
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Casper.Network.SDK.Types
Assembly: Casper.Network.SDK.dll
Syntax
public class TransactionV1

Constructors

| Edit this page View Source

TransactionV1(TransactionV1Payload)

Declaration
public TransactionV1(TransactionV1Payload payload)
Parameters
Type Name Description
TransactionV1Payload payload
| Edit this page View Source

TransactionV1(string, TransactionV1Payload, List<Approval>)

Declaration
[JsonConstructor]
public TransactionV1(string hash, TransactionV1Payload payload, List<Approval> approvals)
Parameters
Type Name Description
string hash
TransactionV1Payload payload
List<Approval> approvals

Properties

| Edit this page View Source

Approvals

List of signers and signatures for this transaction.

Declaration
[JsonPropertyName("approvals")]
public List<Approval> Approvals { get; }
Property Value
Type Description
List<Approval>
| Edit this page View Source

Hash

A hash over the header of the transaction.

Declaration
[JsonPropertyName("hash")]
public string Hash { get; }
Property Value
Type Description
string
| Edit this page View Source

Payload

Payload for this transaction.

Declaration
[JsonPropertyName("payload")]
public TransactionV1Payload Payload { get; init; }
Property Value
Type Description
TransactionV1Payload

Methods

| Edit this page View Source

AddApproval(Approval)

Adds an approval to the transaction. No check is done to the approval signature.

Declaration
public void AddApproval(Approval approval)
Parameters
Type Name Description
Approval approval
| Edit this page View Source

GetTransactionSizeInBytes()

returns the number of bytes resulting from the binary serialization of the Deploy.

Declaration
public int GetTransactionSizeInBytes()
Returns
Type Description
int
| Edit this page View Source

Load(string)

Loads and deserializes a TransactionV1 from a file.

Declaration
public static TransactionV1 Load(string filename)
Parameters
Type Name Description
string filename
Returns
Type Description
TransactionV1
| Edit this page View Source

Parse(string)

Parses a Transaction from a string with json.

Declaration
public static TransactionV1 Parse(string json)
Parameters
Type Name Description
string json
Returns
Type Description
TransactionV1
| Edit this page View Source

Save(string)

Saves a transaction object to a file.

Declaration
public void Save(string filename)
Parameters
Type Name Description
string filename
| Edit this page View Source

SerializeToJson()

Returns a json string with the transaction.

Declaration
public string SerializeToJson()
Returns
Type Description
string
| Edit this page View Source

Sign(KeyPair)

Signs the transaction with a private key and adds a new Approval to it.

Declaration
public void Sign(KeyPair keyPair)
Parameters
Type Name Description
KeyPair keyPair
| Edit this page View Source

ToBytes()

Declaration
public byte[] ToBytes()
Returns
Type Description
byte[]
| Edit this page View Source

ValidateHashes(out string)

Validates the transaction hash.

Declaration
public bool ValidateHashes(out string message)
Parameters
Type Name Description
string message

output string with a validation error message if validation fails. empty otherwise.

Returns
Type Description
bool

false if the validation of hash is not successful

| Edit this page View Source

VerifySignatures(out string)

Verifies the signatures in the list of approvals.

Declaration
public bool VerifySignatures(out string message)
Parameters
Type Name Description
string message

an output string with the signer which signature could not be verified. empty if verification succeeds.

Returns
Type Description
bool

false if the verification of a signature fails.

  • Edit this page
  • View Source
In this article
Back to top Maintained by MAKE Technology LLC