Skip to content

v1.6.0

Compare
Choose a tag to compare
@fundthmcalculus fundthmcalculus released this 29 Jun 16:43
· 574 commits to main since this release
d61232c

What's Changed

Language-Specific Changes

Key Changes for Typescript

With the move from grpc-ts to ts-proto, the syntax of creating a protobuf object has significantly changed. This is a compile time change, not an over-the-wire change. Rather than using a verbose Java-style builder pattern, the new format takes advantage of typescripts interfaces and type coercion.

  • For instance, to insert an item into a wallet:
// Was this
const insertResponse = await walletService.insertItem(new InsertItemRequest()
        .setItemJson(issueResponse.getSignedDocumentJson()));
// And is now this
let insertResponse = await trinsic.wallet().insertItem(
    InsertItemRequest.fromPartial({
        itemJson: issueResponse.signedDocumentJson,
    })
);
  • If you are defining every field on the object, you can skip the [CLASSNAME].fromPartial() call as shown here:
// Was this
const issueResponse = await credentialService.issueCredential(new IssueRequest()
    .setDocumentJson(JSON.stringify(unsignedDocument)));
// And is now this
let issueResponse = await trinsic.credential().issueCredential({
    documentJson: JSON.stringify(unsignedDocument),
});

Other methods are similar. While for these cases the savings isn't much, for objects with large numbers of fields being set, the code is much cleaner.

Key Changes for Java

In preparation for some backend work, we have moved Java from container classes (with inconsistent names) to singular classes inside each file. For instance, what was AccountOuterClass.AccountProfile is now AccountProfile and can be directly imported. This allows for .* imports of the relevant namespace, rather than explicitly defining the container class. This is a compile-time breaking change, not a runtime one. The VaccineDemo.java before and after


Single SDK Service

We have added a single wrapper, TrinsicService, which you can import and use in lieu of instanting each individual service (and trying to keep the AuthToken consistent among them). For now, the existing AccountService/WalletService/etc are simply wrapped. In the future, this API cleanup will also handle channel reuse to reduce resource consumption.

New Login Flow

We've changed the login flow to increase security and reduce developer confusion.

Previously, a call to SignIn would return an auth token string, which may or may require a call to Unprotect.

Now, simply call Login, followed by LoginConfirm, which will return an auth token string.

We have also added a helper method, LoginAnonymous, which you can use to create and login to an anonymous account (not tied to an email/phone number, and requiring no authentication). This is mainly useful for automated testing and prototyping.

The old flow is deprecated, and will be removed in a future release.

Webhooks

We have added support for Webhooks, wherein our services can call out to a REST endpoint which you provide and define.

Click here for more information on implementing webhook functionality.

New Language Support - Dart!

We have added beta support for Dart (and Android Flutter) with 1.6.0. Currently, the package is not published on dart pub, but this will be coming later. For now, you can import the required SDK package directly from github via pubspec.yaml as shown below:

dependencies:
  # Other dependencies here
  trinsic_dart:
    git:
      url: https://github.com/trinsic-id/sdk.git
      path: dart

Documentation and Samples

Protobuf / gRPC Updates

Single Service Access / Webhooks / New Signin Flow

Bugfixes / Minor Improvements

Internal Improvements

Full Changelog: v1.5.0...v1.6.0