Skip to content

Reference

findCreatedEventByTemplateName

Traverse transaction trees comparing CreatedTreeEvent template suffix after final colon against expected template names.

Uses isCreatedTreeEventWrapper guard; extracts fullTemplateId.split(':').pop() compared against templateName argument (exact match, unlike findCreatedEventByTemplateId suffix normalization).

Useful when matching Module.Namespace:Foo short names independent of package prefixes.

Setup

import { findCreatedEventByTemplateName } from '@fairmint/canton-node-sdk';

Minimal example

const marker = findCreatedEventByTemplateName(response, 'FeaturedAppActivityMarker');

console.log(marker?.CreatedTreeEvent.value.contractId);

Parameters

  • responseSubmitAndWaitForTransactionTreeResponse.
  • templateName — Final segment string (no colons).

Returns

CreatedTreeEventWrapper | undefined.

Errors

Pure — no throws.

See also

Source

src/utils/transactions/find-created-event.ts