C#
Contents
Cid type
type
Namespace
vBase.Core
Summary
Content Identifier (CID) is used to uniquely identify objects.
#ctor() constructor
constructor
Summary
Creates a new CID from the provided byte array.
Parameters
This constructor has no parameters.
#ctor(data) constructor
constructor
Summary
Creates a new CID from the provided hex string.
Parameters
data
Data property
property
Summary
The data of the CID.
Empty property
property
Summary
Empty CID.
ToHex() method
method
Summary
Returns the CID as a hex string.
Returns
Hex string.
Parameters
This method has no parameters.
Convert type
type
Namespace
vBase.Core.Utilities
Summary
Provides conversion methods.
CryptoUtils type
type
Namespace
vBase.Core.Utilities
Summary
Provides cryptographic utilities.
GetCid(value,size) method
method
Summary
Get SHA3 256 hash of the input integer.
Returns
SHA3 256 hash object.
Parameters
value
Integer value.
size
Size in bits.
GetCid(value) method
method
Summary
Get SHA3 256 hash of the input string.
Returns
SHA3 256 hash object
Parameters
value
input string
ForwarderCommitmentService type
type
Namespace
vBase.Core.Web3CommitmentService
Summary
Provides access to the CommitmentService smart contract over vBase forwarder.
ICommitmentService type
type
Namespace
vBase.Core
Summary
Common interface for commitment services.
AccountIdentifier property
property
Summary
Current user account identifier.
AddSet(setCid) method
method
Summary
Records a set commitment. If the set already exists, no action will be taken.
Parameters
setCid
The CID identifying the set.
AddSetObject(setCid,objectCid) method
method
Summary
Adds an object CID to the specified set.
Returns
Receipt of the operation.
Parameters
setCid
CID of the set where the objectCid will be added.
objectCid
Object CID to add.
UserSetExists(user,setCid) method
method
Summary
Checks if the specified object set exists.
Parameters
user
Set owner.
setCid
CID of the set.
VerifyUserObject(user,objectCid,timestamp) method
method
Summary
Checks whether the object with the specified CID was stamped at the given time.
Returns
True if the commitment has been verified successfully; False otherwise.
Parameters
user
The address for the user who recorded the commitment.
objectCid
The CID identifying the object.
timestamp
The timestamp of the transaction.
VerifyUserSetObjects(user,setCid,userSetObjectCidSum) method
method
Summary
Verifies an object commitment previously recorded.
Returns
True if the commitment has been verified successfully; False otherwise.
Parameters
user
The address for the user who recorded the commitment.
setCid
The CID for the set containing the object.
userSetObjectCidSum
The sum of all object hashes for the user set.
JsonSerializationDto type
type
Namespace
vBase.Core.Dataset
Summary
DTO for dataset JSON serialization. It's important to keep this class in sync with the Python and other SDKs.
Receipt type
type
Namespace
vBase.Core
Summary
Represents a transaction receipt.
#ctor() constructor
constructor
Summary
Represents a transaction receipt.
Parameters
This constructor has no parameters.
Utils type
type
Namespace
vBase.Core.Utilities
Summary
Provides utility methods.
VerificationResult type
type
Namespace
vBase.Core.Dataset
Summary
Contains a list of verification findings. VerifyCommitments
VerificationFindings property
property
Summary
A collection of verification findings.
VerificationPassed property
property
Summary
Indicates whether the verification passed.
AddFinding(finding) method
method
Summary
Adds a finding to the verification result.
Parameters
finding
Web3CommitmentService type
type
Namespace
vBase.Core.Web3CommitmentService
Summary
Provides access to the CommitmentService smart contract.
CallContractFunction(function,functionData) method
method
Summary
Executes Smart Contract function.
Returns
Parameters
function
Function descriptor.
functionData
Data which will be passed as a function arguments.
CallContractFunction(functionName,functionInput) method
method
Summary
Calls the specified contract function.
Returns
The result of the contract function execution.
Parameters
functionName
The name of the function to call.
functionInput
The input parameters for the function.
CallStateVariable``1(stateVariableName,functionInput) method
method
Summary
Fetches the specified state variable from the contract.
Returns
Variable value
Parameters
stateVariableName
Name of the variable to fetch
functionInput
Context identifying the set
Generic Types
TResultType
Expected variable type
FetchStateVariable``1(functionData) method
method
Summary
Fetches state variable from the Smart Contract.
Returns
Variable value
Parameters
functionData
Encoded state variable
Generic Types
TResultType
Expected result type
Web3Receipt type
type
Namespace
vBase.Core.Web3CommitmentService
Summary
WEB3-specific receipt. Additionally to the base timestamp, it contains the transaction hash.
#ctor() constructor
constructor
Summary
WEB3-specific receipt. Additionally to the base timestamp, it contains the transaction hash.
Parameters
This constructor has no parameters.
vBaseClient type
type
Namespace
vBase.Core
Summary
Provides Python validityBase (vBase) access.
AddNamedSet(name) method
method
Summary
Adds a new named set.
Returns
A task representing the asynchronous operation.
Parameters
name
The name of the set to add.
AddSet(setCid) method
method
Summary
Adds a new set.
Returns
A task representing the asynchronous operation.
Parameters
setCid
The identifier of the set.
AddSetObject(setCid,objectCid) method
method
Summary
Adds a new object to the set.
Returns
Receipt of the operation.
Parameters
setCid
Set CID.
objectCid
Object to add CID.
UserNamedSetExists(user,name) method
method
Summary
Checks if the user has a set with the specified CID.
Returns
Parameters
user
User's identifier.
name
Name of the set.
VerifyUserObject(user,objectCid,timestamp) method
method
Summary
Verifies if the specified object was stamped at the given time by the given user.
Returns
True if the object was stamped; otherwise, false.
Parameters
user
The object owner.
objectCid
The object identifier.
timestamp
The time when the object was stamped.
VerifyUserSetObjects(user,setCid,userSetObjectsCidSum) method
method
Summary
Verifies if the sum of all CIDs in the current dataset matches the sum of the dataset stored in the commitment service.
Returns
A boolean indicating whether the sums match.
Parameters
user
The set owner.
setCid
The CID of the set.
userSetObjectsCidSum
The sum of the CIDs of all objects belonging to the set.
vBaseDataset type
type
Namespace
vBase.Core.Dataset
Summary
vBase dataset.
#ctor(vBaseClient,name,recordTypeName) constructor
constructor
Summary
Creates a new instance of the vBase dataset.
Parameters
vBaseClient
The vBaseClient used for communication with the vBase smart protocol.
name
The name of the dataset.
recordTypeName
The type of records to be stored in the dataset.
Exceptions
Thrown if an unknown record type is provided.
#ctor(vBaseClient,json) constructor
constructor
Summary
Creates a new instance of the vBase dataset from JSON.
Parameters
vBaseClient
The vBaseClient used for communication with the vBase smart protocol.
json
The JSON representation of the dataset. JSON created by vBase SDKs for other platforms, such as Python or Java, is also supported.
Exceptions
Thrown when the current CID generation algorithm does not match the one used to generate the provided JSON.
AddRecord(recordData) method
method
Summary
Adds a record to the dataset.
Returns
A transaction receipt.
Parameters
recordData
The record to add. The record type must match the dataset type.
Initialize() method
method
Summary
Creates a new dataset on the blockchain if it does not already exist.
Returns
A task representing the asynchronous operation.
Parameters
This method has no parameters.
ToJson() method
method
Summary
Serializes the dataset into a vBase-compatible JSON representation.
Returns
A JSON string.
Parameters
This method has no parameters.
VerifyCommitments() method
method
Summary
Verifies if all records in the dataset were actually created on the Validity Base platform at the specified timestamps.
Returns
Validation result: A collection of errors. For each record that was not found on the Validity Base platform, or was added with a different timestamp, there will be a separate error item in the collection. Additionally, an error item will be added if the dataset on the Validity Base platform contains more records than exist in this client-side dataset.
Parameters
This method has no parameters.
vBaseException type
type
Namespace
vBase.Core.Exceptions
Summary
Base exception for all vBase exceptions.
vBaseObject type
type
Namespace
vBase.Core.Dataset.vBaseObjects
Summary
Base class for all vBase objects. Each implementation should provide a constructor with one object parameter, and parameterless constructor.
Data property
property
Summary
The data stored in the object.
StringData property
property
Summary
String representation of the data.
GetCid() method
method
Summary
Returns the Cid of the object.
Returns
CID (Content Identifiers) for the current object
Parameters
This method has no parameters.
GetJson() method
method
Summary
Serializes the object to a JSON value.
Returns
Parameters
This method has no parameters.
InitFromJson(jData) method
method
Summary
Initializes the object from a JSON object.
Parameters
jData
Json value.
vBaseStringObject type
type
Namespace
vBase.Core.Dataset.vBaseObjects
Summary
vBase Object representing a string data.
vBaseObjectType constants
constants
Summary
vBase string object name for bidirectional compatibility with vBase Python SDK the V letter is capitalized
Last updated