C#

Contents

Cid type

Namespace

vBase.Core

Summary

Content Identifier (CID) is used to uniquely identify objects.

#ctor() constructor

Summary

Creates a new CID from the provided byte array.

Parameters

This constructor has no parameters.

#ctor(data) constructor

Summary

Creates a new CID from the provided hex string.

Parameters

Name
Type
Description

data

Data property

Summary

The data of the CID.

Empty property

Summary

Empty CID.

ToHex() method

Summary

Returns the CID as a hex string.

Returns

Hex string.

Parameters

This method has no parameters.

Convert type

Namespace

vBase.Core.Utilities

Summary

Provides conversion methods.

CryptoUtils type

Namespace

vBase.Core.Utilities

Summary

Provides cryptographic utilities.

GetCid(value,size) method

Summary

Get SHA3 256 hash of the input integer.

Returns

SHA3 256 hash object.

Parameters

Name
Type
Description

value

Integer value.

size

Size in bits.

GetCid(value) method

Summary

Get SHA3 256 hash of the input string.

Returns

SHA3 256 hash object

Parameters

Name
Type
Description

value

input string

ForwarderCommitmentService type

Namespace

vBase.Core.Web3CommitmentService

Summary

Provides access to the CommitmentService smart contract over vBase forwarder.

ICommitmentService type

Namespace

vBase.Core

Summary

Common interface for commitment services.

AccountIdentifier property

Summary

Current user account identifier.

AddSet(setCid) method

Summary

Records a set commitment. If the set already exists, no action will be taken.

Parameters

Name
Type
Description

setCid

The CID identifying the set.

AddSetObject(setCid,objectCid) method

Summary

Adds an object CID to the specified set.

Returns

Receipt of the operation.

Parameters

Name
Type
Description

setCid

CID of the set where the objectCid will be added.

objectCid

Object CID to add.

UserSetExists(user,setCid) method

Summary

Checks if the specified object set exists.

Parameters

Name
Type
Description

user

Set owner.

setCid

CID of the set.

VerifyUserObject(user,objectCid,timestamp) 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

Name
Type
Description

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

Summary

Verifies an object commitment previously recorded.

Returns

True if the commitment has been verified successfully; False otherwise.

Parameters

Name
Type
Description

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

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

Namespace

vBase.Core

Summary

Represents a transaction receipt.

#ctor() constructor

Summary

Represents a transaction receipt.

Parameters

This constructor has no parameters.

Utils type

Namespace

vBase.Core.Utilities

Summary

Provides utility methods.

VerificationResult type

Namespace

vBase.Core.Dataset

Summary

Contains a list of verification findings. VerifyCommitments

VerificationFindings property

Summary

A collection of verification findings.

VerificationPassed property

Summary

Indicates whether the verification passed.

AddFinding(finding) method

Summary

Adds a finding to the verification result.

Parameters

Name
Type
Description

finding

Web3CommitmentService type

Namespace

vBase.Core.Web3CommitmentService

Summary

Provides access to the CommitmentService smart contract.

CallContractFunction(function,functionData) method

Summary

Executes Smart Contract function.

Returns

Parameters

Name
Type
Description

function

Function descriptor.

functionData

Data which will be passed as a function arguments.

CallContractFunction(functionName,functionInput) method

Summary

Calls the specified contract function.

Returns

The result of the contract function execution.

Parameters

Name
Type
Description

functionName

The name of the function to call.

functionInput

The input parameters for the function.

CallStateVariable``1(stateVariableName,functionInput) method

Summary

Fetches the specified state variable from the contract.

Returns

Variable value

Parameters

Name
Type
Description

stateVariableName

Name of the variable to fetch

functionInput

Context identifying the set

Generic Types

Name
Description

TResultType

Expected variable type

FetchStateVariable``1(functionData) method

Summary

Fetches state variable from the Smart Contract.

Returns

Variable value

Parameters

Name
Type
Description

functionData

Encoded state variable

Generic Types

Name
Description

TResultType

Expected result type

Web3Receipt type

Namespace

vBase.Core.Web3CommitmentService

Summary

WEB3-specific receipt. Additionally to the base timestamp, it contains the transaction hash.

#ctor() constructor

Summary

WEB3-specific receipt. Additionally to the base timestamp, it contains the transaction hash.

Parameters

This constructor has no parameters.

vBaseClient type

Namespace

vBase.Core

Summary

Provides Python validityBase (vBase) access.

AddNamedSet(name) method

Summary

Adds a new named set.

Returns

A task representing the asynchronous operation.

Parameters

Name
Type
Description

name

The name of the set to add.

AddSet(setCid) method

Summary

Adds a new set.

Returns

A task representing the asynchronous operation.

Parameters

Name
Type
Description

setCid

The identifier of the set.

AddSetObject(setCid,objectCid) method

Summary

Adds a new object to the set.

Returns

Receipt of the operation.

Parameters

Name
Type
Description

setCid

Set CID.

objectCid

Object to add CID.

UserNamedSetExists(user,name) method

Summary

Checks if the user has a set with the specified CID.

Returns

Parameters

Name
Type
Description

user

User's identifier.

name

Name of the set.

VerifyUserObject(user,objectCid,timestamp) 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

Name
Type
Description

user

The object owner.

objectCid

The object identifier.

timestamp

The time when the object was stamped.

VerifyUserSetObjects(user,setCid,userSetObjectsCidSum) 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

Name
Type
Description

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

Namespace

vBase.Core.Dataset

Summary

vBase dataset.

#ctor(vBaseClient,name,recordTypeName) constructor

Summary

Creates a new instance of the vBase dataset.

Parameters

Name
Type
Description

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

Name
Description

Thrown if an unknown record type is provided.

#ctor(vBaseClient,json) constructor

Summary

Creates a new instance of the vBase dataset from JSON.

Parameters

Name
Type
Description

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

Name
Description

Thrown when the current CID generation algorithm does not match the one used to generate the provided JSON.

AddRecord(recordData) method

Summary

Adds a record to the dataset.

Returns

A transaction receipt.

Parameters

Name
Type
Description

recordData

The record to add. The record type must match the dataset type.

Initialize() 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

Summary

Serializes the dataset into a vBase-compatible JSON representation.

Returns

A JSON string.

Parameters

This method has no parameters.

VerifyCommitments() 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

Namespace

vBase.Core.Exceptions

Summary

Base exception for all vBase exceptions.

vBaseObject 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

Summary

The data stored in the object.

StringData property

Summary

String representation of the data.

GetCid() method

Summary

Returns the Cid of the object.

Returns

CID (Content Identifiers) for the current object

Parameters

This method has no parameters.

GetJson() method

Summary

Serializes the object to a JSON value.

Returns

Parameters

This method has no parameters.

InitFromJson(jData) method

Summary

Initializes the object from a JSON object.

Parameters

Name
Type
Description

jData

Json value.

vBaseStringObject type

Namespace

vBase.Core.Dataset.vBaseObjects

Summary

vBase Object representing a string data.

vBaseObjectType constants

Summary

vBase string object name for bidirectional compatibility with vBase Python SDK the V letter is capitalized

Last updated