API Operations

Utility Functions

The Canton Node SDK provides a comprehensive set of utility functions to simplify common blockchain operations.

Categories

Overview

This documentation covers all utility functions available in the SDK, organized by category:

Quick Examples

Creating a Party

import { createParty } from '@fairmint/canton-node-sdk';
import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
import { ValidatorApiClient } from '@fairmint/canton-node-sdk';

// Initialize your clients
const ledgerClient = new LedgerJsonApiClient(/* your config */);
const validatorClient = new ValidatorApiClient(/* your config */);

const result = await createParty({
  ledgerClient,
  validatorClient,
  partyName: 'Alice',
  amount: '100.0',
});

console.log(`Party created with ID: ${result.partyId}`);

Creating Transfer Offers

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

const offerId = await createTransferOffer({
  ledgerClient,
  receiverPartyId: 'Bob::1221',
  amount: '50.0',
  description: 'Payment for services',
});

Parsing Fees

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

const feeAnalysis = parseFeesFromEventTree(eventTree);
console.log(`Total fees: ${feeAnalysis.totalFees}`);

Generated from https://github.com/Fairmint/canton-node-sdk v0.0.1