COM API Reference

Contents

AssemblyResolver type

Namespace

vBase.Infrastructure

Summary

Some dependencies are referenced transitively multiple times with different versions. Only the latest version is available in the application folder. To resolve older versions at runtime and return the latest version, we use the AssemblyResolver class.

ComGuids type

Namespace

vBase

Summary

Contains the GUIDs for the COM interfaces and classes.

IReceipt type

Namespace

vBase.Receipts

Summary

Represents a transaction receipt.

Timestamp property

Summary

The transaction timestamp in Unix time format (seconds).

IVerificationResult type

Namespace

vBase

Summary

Represents the result of a verification operation.

VerificationFindings property

Summary

A collection of verification findings.

VerificationPassed property

Summary

Indicates whether the verification passed.

IWeb3Receipt type

Namespace

vBase.Receipts

Summary

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

In COM interfaces can inherit from one another. However, the .NET implementation that exposes the .NET interface to COM does not support inheritance. Therefore, you must replicate any interface members in a base interface to the derived interface. The interop code does not look at base interface types when building the exposed COM interface.

Timestamp property

Summary

The transaction timestamp in Unix time format (seconds).

TransactionHash property

Summary

The transaction hash.

IvBaseBuilder type

Namespace

vBase

Summary

COM does not support constructors with parameters, so we need to use a factory method to create the objects.

CreateDataset(client,name,objectType) method

Summary

Create a COM visible dataset object.

Returns

Newly created dataset object.

Parameters

Name
Type
Description

client

vBase client.

name

The name of the dataset.

objectType

Type of the objects that will be stored in the dataset.

CreateDatasetFromJson(client,json) method

Summary

Create a COM visible dataset object.

Returns

Newly created dataset object.

Parameters

Name
Type
Description

client

vBase client.

json

Json that contains all data records, and dataset properties.

CreateForwarderClient(forwarderUrl,apiKey,privateKey) method

Summary

Create a COM visible client for the vBase API.

Returns

Newly created client object.

Parameters

Name
Type
Description

forwarderUrl

Forwarder API url.

apiKey

API key.

privateKey

Private key.

IvBaseClient type

Namespace

vBase

Summary

COM visible client interface for the vBase API. It's a shim between the COM client and the vBase.Core client class.

AddNamedSet(name) method

Summary

Creates a commitment for a set with a given name. The set will be added for the account associated with the client object.

Parameters

Name
Type
Description

name

The name of the set.

AddSet(setCid) method

Summary

Records a set commitment.

Parameters

Name
Type
Description

setCid

The HEX encoded CID (hash) identifying the set.

AddSetObject(setCid,objectCid) method

Summary

Adds a record to the dataset.

Returns

The transaction timestamp of the record addition in Unix time format (seconds).

Parameters

Name
Type
Description

setCid

HEX encoded CID for the set containing the object.

objectCid

HEX encoded CID of the object to record.

UserNamedSetExists(user,name) method

Summary

Checks if a named dataset exists.

Returns

True if the set with the given name exists; False otherwise.

Parameters

Name
Type
Description

user

The address for the user who recorded the commitment.

name

The name of the set.

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

objectCid

The HEX encoded CID of the object.

timestamp

The timestamp of the object's creation, in Unix time format (seconds).

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

userSetObjectsCidSum

The sum of all object hashes for the user set.

IvBaseDataset type

Namespace

vBase

Summary

Represents a set of records created on the Validity Base platform.

AddRecord(recordData) method

Summary

Adds a record to the dataset.

Parameters

Name
Type
Description

recordData

Record to add.

ToJson() method

Summary

Serializes the dataset to a JSON string.

Returns

JSON string that can be deserialized using vBase SDK on any other platform.

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.

ObjectTypes type

Namespace

vBase

Summary

Types of objects that can be stored in a dataset.

ReceiptConverter type

Namespace

vBase.Infrastructure

Summary

Converts between Receipt and COM-compatible IReceipt.

ToCom(receipt) method

Summary

Converts a Receipt to a IReceipt.

Returns

The converted receipt.

Parameters

Name
Type
Description

receipt

The receipt to convert.

SecurityProtocolHelper type

Namespace

vBase.Infrastructure

Summary

When running the shim in the VBA environment, we observed on some machines that the security protocol is explicitly set to Ssl3 or Tls. Such a configuration is incompatible with TLS 1.2, which is the protocol used by the Forwarder server. Experimentally, we found that setting the security protocol to 0 (SystemDefault) does not resolve the issue. Setting explicitly to Tls12 does.

ResetSecurityProtocol() method

Summary

Updates the security protocol to Tls12.

Parameters

This method has no parameters.

ShimInstaller type

Namespace

vBase.Infrastructure

Summary

It's important to register the assembly using both versions of regasm—32-bit and 64-bit. Even though the Excel process is 64-bit, it seems that the VBA execution process is 32-bit, so it doesn't recognize the registrations in the 64-bit registry.

Utils type

Namespace

vBase

Summary

Utility methods.

PreprocessException(action,logger) method

Summary

Executes an action and logs any exceptions that occur. Additionally, converts the exception into a VBA-friendly exception.

Parameters

Name
Type
Description

action

Action to execute.

logger

Logger.

PreprocessException(ex) method

Summary

Converts a regular .NET exception into a VBA-friendly exception with all relevant information aggregated into the exception message. This improves the user experience in a VBA environment, where the error object does not include the stack trace or the original exception type.

Returns

A VBA-friendly exception with aggregated information.

Parameters

Name
Type
Description

ex

The original exception.

PreprocessException``1(func,logger) method

Summary

Executes a function and logs any exceptions that occur. Additionally, converts the exception into a VBA-friendly exception.

Returns

Function execution result.

Parameters

Name
Type
Description

func

Function to execute.

logger

Logger.

Generic Types

Name
Description

T

Function return type.

Last updated