Class: CantonChain
Defined in: canton/index.ts:93
Canton chain implementation supporting Canton Ledger networks.
Extends
Indexable
[
key:symbol]: () =>string
Constructors
Constructor
new CantonChain(
client: {executeSubmissionAndWaitForTransaction:Promise<{transaction: {commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }; }>;getActiveContracts:Promise<{contractEntry?: {JsActiveContract: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };reassignmentCounter:number;synchronizerId:string; }; } | {JsEmpty:Record<string,never>; } | {JsIncompleteAssigned: {assignedEvent: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: ...[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };reassignmentCounter:number;reassignmentId:string;source:string;submitter?:string;target:string; }; }; } | {JsIncompleteUnassigned: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };unassignedEvent: {assignmentExclusivity?:string;contractId:string;nodeId:number;offset:number;packageName:string;reassignmentCounter:number;reassignmentId:string;source:string;submitter?:string;target:string;templateId:string;witnessParties:string[]; }; }; };workflowId?:string; }[]>;getConnectedSynchronizers:Promise<{permission:"PARTICIPANT_PERMISSION_CONFIRMATION"|"PARTICIPANT_PERMISSION_OBSERVATION"|"PARTICIPANT_PERMISSION_SUBMISSION"|"PARTICIPANT_PERMISSION_UNSPECIFIED";synchronizerAlias:string;synchronizerId:string; }[]>;getLedgerEnd:Promise<{offset:number; }>;getParticipantId:Promise<string>;getTransactionById:Promise<{commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ... | ...;interfaceId:string;viewStatus: {code: ...;details?: ...;message: ...; };viewValue?:unknown; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }>;getUpdateById:Promise<unknown>;isAlive:Promise<boolean>;isReady:Promise<boolean>;listParties:Promise<unknown[] |undefined>;prepareSubmission:Promise<{costEstimation?: {confirmationRequestTrafficCostEstimation?:number;confirmationResponseTrafficCostEstimation?:number;estimationTimestamp?:string;totalTrafficCostEstimation?:number; };hashingDetails?:string;hashingSchemeVersion?:"HASHING_SCHEME_VERSION_UNSPECIFIED"|"HASHING_SCHEME_VERSION_V2"|"HASHING_SCHEME_VERSION_V3";preparedTransaction?:string;preparedTransactionHash?:string; }>;submitAndWait:Promise<{completionOffset:number;updateId:string; }>;submitAndWaitForTransaction:Promise<{transaction: {commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }; }>; },acsDisclosureProvider:AcsDisclosureProvider,edsDisclosureProvider:EdsDisclosureProvider,transferInstructionClient: {getAcceptContext:Promise<ChoiceContext>;getRejectContext:Promise<ChoiceContext>;getTransferFactory:Promise<TransferFactoryWithChoiceContext>;getWithdrawContext:Promise<ChoiceContext>; },tokenMetadataClient: {getInstrument:Promise<Instrument>;getRegistryInfo:Promise<GetRegistryInfoResponse>;listInstruments:Promise<ListInstrumentsResponse>; },ccipParty:string,indexerUrl:string,network:NetworkInfo<"CANTON">,ctx?:ChainContext):CantonChain
Defined in: canton/index.ts:122
Creates a new CantonChain instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | { executeSubmissionAndWaitForTransaction: Promise<{ transaction: { commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: string; implementedInterfaces?: string[]; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; } | { CreatedEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; } | { ExercisedEvent: { acsDelta: boolean; actingParties: string[]; choice: string; choiceArgument: unknown; consuming: boolean; contractId: string; exerciseResult: unknown; implementedInterfaces?: string[]; interfaceId?: string; lastDescendantNodeId: number; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; })[]; externalTransactionHash?: string; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }; }>; getActiveContracts: Promise<{ contractEntry?: { JsActiveContract: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; reassignmentCounter: number; synchronizerId: string; }; } | { JsEmpty: Record<string, never>; } | { JsIncompleteAssigned: { assignedEvent: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: ...[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; reassignmentCounter: number; reassignmentId: string; source: string; submitter?: string; target: string; }; }; } | { JsIncompleteUnassigned: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; unassignedEvent: { assignmentExclusivity?: string; contractId: string; nodeId: number; offset: number; packageName: string; reassignmentCounter: number; reassignmentId: string; source: string; submitter?: string; target: string; templateId: string; witnessParties: string[]; }; }; }; workflowId?: string; }[]>; getConnectedSynchronizers: Promise<{ permission: "PARTICIPANT_PERMISSION_CONFIRMATION" | "PARTICIPANT_PERMISSION_OBSERVATION" | "PARTICIPANT_PERMISSION_SUBMISSION" | "PARTICIPANT_PERMISSION_UNSPECIFIED"; synchronizerAlias: string; synchronizerId: string; }[]>; getLedgerEnd: Promise<{ offset: number; }>; getParticipantId: Promise<string>; getTransactionById: Promise<{ commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: string; implementedInterfaces?: string[]; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; } | { CreatedEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ... | ...; interfaceId: string; viewStatus: { code: ...; details?: ...; message: ...; }; viewValue?: unknown; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; } | { ExercisedEvent: { acsDelta: boolean; actingParties: string[]; choice: string; choiceArgument: unknown; consuming: boolean; contractId: string; exerciseResult: unknown; implementedInterfaces?: string[]; interfaceId?: string; lastDescendantNodeId: number; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; })[]; externalTransactionHash?: string; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }>; getUpdateById: Promise<unknown>; isAlive: Promise<boolean>; isReady: Promise<boolean>; listParties: Promise<unknown[] | undefined>; prepareSubmission: Promise<{ costEstimation?: { confirmationRequestTrafficCostEstimation?: number; confirmationResponseTrafficCostEstimation?: number; estimationTimestamp?: string; totalTrafficCostEstimation?: number; }; hashingDetails?: string; hashingSchemeVersion?: "HASHING_SCHEME_VERSION_UNSPECIFIED" | "HASHING_SCHEME_VERSION_V2" | "HASHING_SCHEME_VERSION_V3"; preparedTransaction?: string; preparedTransactionHash?: string; }>; submitAndWait: Promise<{ completionOffset: number; updateId: string; }>; submitAndWaitForTransaction: Promise<{ transaction: { commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: string; implementedInterfaces?: string[]; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; } | { CreatedEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; } | { ExercisedEvent: { acsDelta: boolean; actingParties: string[]; choice: string; choiceArgument: unknown; consuming: boolean; contractId: string; exerciseResult: unknown; implementedInterfaces?: string[]; interfaceId?: string; lastDescendantNodeId: number; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; })[]; externalTransactionHash?: string; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }; }>; } | Canton Ledger API client. |
client.executeSubmissionAndWaitForTransaction | - | |
client.getActiveContracts | - | |
client.getConnectedSynchronizers | - | |
client.getLedgerEnd | - | |
client.getParticipantId | - | |
client.getTransactionById | - | |
client.getUpdateById | - | |
client.isAlive | - | |
client.isReady? | - | |
client.listParties? | - | |
client.prepareSubmission? | - | |
client.submitAndWait? | - | |
client.submitAndWaitForTransaction? | - | |
acsDisclosureProvider? | AcsDisclosureProvider | ACS-based disclosure provider. |
edsDisclosureProvider? | EdsDisclosureProvider | EDS-based disclosure provider. |
transferInstructionClient? | { getAcceptContext: Promise<ChoiceContext>; getRejectContext: Promise<ChoiceContext>; getTransferFactory: Promise<TransferFactoryWithChoiceContext>; getWithdrawContext: Promise<ChoiceContext>; } | Transfer Instruction API client. |
transferInstructionClient.getAcceptContext? | - | |
transferInstructionClient.getRejectContext? | - | |
transferInstructionClient.getTransferFactory? | - | |
transferInstructionClient.getWithdrawContext? | - | |
tokenMetadataClient? | { getInstrument: Promise<Instrument>; getRegistryInfo: Promise<GetRegistryInfoResponse>; listInstruments: Promise<ListInstrumentsResponse>; } | Token Metadata API client. |
tokenMetadataClient.getInstrument? | - | |
tokenMetadataClient.getRegistryInfo? | - | |
tokenMetadataClient.listInstruments? | - | |
ccipParty? | string | The party ID to use for CCIP operations |
indexerUrl? | string | Base URL of the CCV indexer service. |
network? | NetworkInfo<"CANTON"> | Network information for this chain. |
ctx? | ChainContext | Context containing logger. |
Returns
CantonChain
Overrides
Chain<typeof ChainFamily.Canton>.constructor
Properties
abort
readonlyabort:AbortSignal
Defined in: chain.ts:638
Abort signal from ChainContext; fires when the chain should tear down.
Inherited from
acsDisclosureProvider
readonlyacsDisclosureProvider:AcsDisclosureProvider
Defined in: canton/index.ts:103
apiClient
readonlyapiClient:CCIPAPIClient|null
Defined in: chain.ts:634
CCIP API client (null if opted out)
Inherited from
apiRetryConfig
readonlyapiRetryConfig:Required<ApiRetryConfig> |null
Defined in: chain.ts:636
Retry configuration for API fallback operations (null if API client is disabled)
Inherited from
ccipParty
readonlyccipParty:string
Defined in: canton/index.ts:108
destroy
destroy: (
reason?:unknown) =>void
Defined in: chain.ts:677
Cleanup method to release resources (e.g., close connections).
Parameters
| Parameter | Type |
|---|---|
reason? | unknown |
Returns
void
Inherited from
edsDisclosureProvider
readonlyedsDisclosureProvider:EdsDisclosureProvider
Defined in: canton/index.ts:104
indexerUrl
readonlyindexerUrl:string
Defined in: canton/index.ts:107
logger
logger:
Logger
Defined in: chain.ts:632
Inherited from
network
readonlynetwork:NetworkInfo<"CANTON">
Defined in: canton/index.ts:101
Overrides
provider
readonlyprovider: {executeSubmissionAndWaitForTransaction:Promise<{transaction: {commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }; }>;getActiveContracts:Promise<{contractEntry?: {JsActiveContract: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };reassignmentCounter:number;synchronizerId:string; }; } | {JsEmpty:Record<string,never>; } | {JsIncompleteAssigned: {assignedEvent: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: ...[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };reassignmentCounter:number;reassignmentId:string;source:string;submitter?:string;target:string; }; }; } | {JsIncompleteUnassigned: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };unassignedEvent: {assignmentExclusivity?:string;contractId:string;nodeId:number;offset:number;packageName:string;reassignmentCounter:number;reassignmentId:string;source:string;submitter?:string;target:string;templateId:string;witnessParties:string[]; }; }; };workflowId?:string; }[]>;getConnectedSynchronizers:Promise<{permission:"PARTICIPANT_PERMISSION_CONFIRMATION"|"PARTICIPANT_PERMISSION_OBSERVATION"|"PARTICIPANT_PERMISSION_SUBMISSION"|"PARTICIPANT_PERMISSION_UNSPECIFIED";synchronizerAlias:string;synchronizerId:string; }[]>;getLedgerEnd:Promise<{offset:number; }>;getParticipantId:Promise<string>;getTransactionById:Promise<{commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ... | ...;interfaceId:string;viewStatus: {code: ...;details?: ...;message: ...; };viewValue?:unknown; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }>;getUpdateById:Promise<unknown>;isAlive:Promise<boolean>;isReady:Promise<boolean>;listParties:Promise<unknown[] |undefined>;prepareSubmission:Promise<{costEstimation?: {confirmationRequestTrafficCostEstimation?:number;confirmationResponseTrafficCostEstimation?:number;estimationTimestamp?:string;totalTrafficCostEstimation?:number; };hashingDetails?:string;hashingSchemeVersion?:"HASHING_SCHEME_VERSION_UNSPECIFIED"|"HASHING_SCHEME_VERSION_V2"|"HASHING_SCHEME_VERSION_V3";preparedTransaction?:string;preparedTransactionHash?:string; }>;submitAndWait:Promise<{completionOffset:number;updateId:string; }>;submitAndWaitForTransaction:Promise<{transaction: {commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }; }>; }
Defined in: canton/index.ts:102
executeSubmissionAndWaitForTransaction()
executeSubmissionAndWaitForTransaction(
request: {deduplicationPeriod?: {DeduplicationDuration: {value: {nanos:number;seconds:number;unknownFields?: {fields: {[key:string]: {fixed32?: ... | ...;fixed64?: ... | ...;lengthDelimited?: ... | ...;varint?: ... | ...; }; }; }; }; }; } | {DeduplicationOffset: {value:number; }; } | {Empty:Record<string,never>; };hashingSchemeVersion:"HASHING_SCHEME_VERSION_UNSPECIFIED"|"HASHING_SCHEME_VERSION_V2"|"HASHING_SCHEME_VERSION_V3";minLedgerTime?: {time?: {Empty:Record<string,never>; } | {MinLedgerTimeAbs: {value:string; }; } | {MinLedgerTimeRel: {value: {nanos:number;seconds:number;unknownFields?: {fields: {[key: ...]: ...; }; }; }; }; }; };partySignatures: {signatures: {party:string;signatures: {format?:string;signature?:string;signedBy?:string;signingAlgorithmSpec?:string; }[]; }[]; };preparedTransaction:string;submissionId:string;transactionFormat?: {eventFormat: {filtersByParty?: {[key:string]: {cumulative?: {identifierFilter?: ...; }[]; }; };filtersForAnyParty?: {cumulative?: {identifierFilter?: ... | ... | ... | ... | ...; }[]; };verbose?:boolean; };transactionShape:"TRANSACTION_SHAPE_ACS_DELTA"|"TRANSACTION_SHAPE_LEDGER_EFFECTS"|"TRANSACTION_SHAPE_UNSPECIFIED"; };userId?:string; }):Promise<{transaction: {commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }; }>
Execute a previously prepared and externally-signed transaction, waiting for the full transaction response.
Calls the Executing Participant Node (EPN) with the prepared transaction and the party's signature(s), returning the committed transaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { deduplicationPeriod?: { DeduplicationDuration: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: ... | ...; fixed64?: ... | ...; lengthDelimited?: ... | ...; varint?: ... | ...; }; }; }; }; }; } | { DeduplicationOffset: { value: number; }; } | { Empty: Record<string, never>; }; hashingSchemeVersion: "HASHING_SCHEME_VERSION_UNSPECIFIED" | "HASHING_SCHEME_VERSION_V2" | "HASHING_SCHEME_VERSION_V3"; minLedgerTime?: { time?: { Empty: Record<string, never>; } | { MinLedgerTimeAbs: { value: string; }; } | { MinLedgerTimeRel: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: ...]: ...; }; }; }; }; }; }; partySignatures: { signatures: { party: string; signatures: { format?: string; signature?: string; signedBy?: string; signingAlgorithmSpec?: string; }[]; }[]; }; preparedTransaction: string; submissionId: string; transactionFormat?: { eventFormat: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; verbose?: boolean; }; transactionShape: "TRANSACTION_SHAPE_ACS_DELTA" | "TRANSACTION_SHAPE_LEDGER_EFFECTS" | "TRANSACTION_SHAPE_UNSPECIFIED"; }; userId?: string; } | - |
request.deduplicationPeriod? | { DeduplicationDuration: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: ... | ...; fixed64?: ... | ...; lengthDelimited?: ... | ...; varint?: ... | ...; }; }; }; }; }; } | { DeduplicationOffset: { value: number; }; } | { Empty: Record<string, never>; } | - |
request.hashingSchemeVersion | "HASHING_SCHEME_VERSION_UNSPECIFIED" | "HASHING_SCHEME_VERSION_V2" | "HASHING_SCHEME_VERSION_V3" | Description The hashing scheme version used when building the hash Required |
request.minLedgerTime? | { time?: { Empty: Record<string, never>; } | { MinLedgerTimeAbs: { value: string; }; } | { MinLedgerTimeRel: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: ...]: ...; }; }; }; }; }; } | Description If set will influence the chosen ledger effective time but will not result in a submission delay so any override should be scheduled to executed within the window allowed by synchronizer. Optional |
request.minLedgerTime.time? | { Empty: Record<string, never>; } | { MinLedgerTimeAbs: { value: string; }; } | { MinLedgerTimeRel: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: ...]: ...; }; }; }; }; } | - |
request.partySignatures | { signatures: { party: string; signatures: { format?: string; signature?: string; signedBy?: string; signingAlgorithmSpec?: string; }[]; }[]; } | Description The party(ies) signatures that authorize the prepared submission to be executed by this node. Each party can provide one or more signatures.. and one or more parties can sign. Note that currently, only single party submissions are supported. Required |
request.partySignatures.signatures | { party: string; signatures: { format?: string; signature?: string; signedBy?: string; signingAlgorithmSpec?: string; }[]; }[] | Description Additional signatures provided by all individual parties Required |
request.preparedTransaction | string | Description the prepared transaction Typically this is the value of the prepared_transaction field in PrepareSubmissionResponse obtained from calling prepareSubmission. Required |
request.submissionId | string | Description A unique identifier to distinguish completions for different submissions with the same change ID. Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission with the same change ID. Must be a valid LedgerString (as described in value.proto). Required |
request.transactionFormat? | { eventFormat: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; verbose?: boolean; }; transactionShape: "TRANSACTION_SHAPE_ACS_DELTA" | "TRANSACTION_SHAPE_LEDGER_EFFECTS" | "TRANSACTION_SHAPE_UNSPECIFIED"; } | Description If no transaction_format is provided, a default will be used where transaction_shape is set to TRANSACTION_SHAPE_ACS_DELTA, event_format is defined with filters_by_party containing wildcard-template filter for all original act_as and read_as parties and the verbose flag is set. When the transaction_shape TRANSACTION_SHAPE_ACS_DELTA shape is used (explicitly or is defaulted to as explained above), events will only be returned if the submitting party is hosted on this node. Optional |
request.transactionFormat.eventFormat | { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; verbose?: boolean; } | Description Required |
request.transactionFormat.eventFormat.filtersByParty? | {[key: string]: { cumulative?: { identifierFilter?: ...; }[]; }; } | Description Each key must be a valid PartyIdString (as described in value.proto). The interpretation of the filter depends on the transaction-shape being filtered: 1. For ledger-effects create and exercise events are returned, for which the witnesses include at least one of the listed parties and match the per-party filter. 2. For transaction and active-contract-set streams create and archive events are returned for all contracts whose stakeholders include at least one of the listed parties and match the per-party filter. Optional |
request.transactionFormat.eventFormat.filtersForAnyParty? | { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; } | Description Wildcard filters that apply to all the parties existing on the participant. The interpretation of the filters is the same with the per-party filter as described above. Optional |
request.transactionFormat.eventFormat.filtersForAnyParty.cumulative? | { identifierFilter?: ... | ... | ... | ... | ...; }[] | Description Every filter in the cumulative list expands the scope of the resulting stream. Each interface, template or wildcard filter means additional events that will match the query. The impact of include_interface_view and include_created_event_blob fields in the filters will also be accumulated. A template or an interface SHOULD NOT appear twice in the accumulative field. A wildcard filter SHOULD NOT be defined more than once in the accumulative field. Optional, if no CumulativeFilter defined, the default of a single WildcardFilter with include_created_event_blob unset is used. |
request.transactionFormat.eventFormat.verbose? | boolean | Description If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels for record fields. Optional |
request.transactionFormat.transactionShape | "TRANSACTION_SHAPE_ACS_DELTA" | "TRANSACTION_SHAPE_LEDGER_EFFECTS" | "TRANSACTION_SHAPE_UNSPECIFIED" | Description What transaction shape to use for interpreting the filters of the event format. Required |
request.userId? | string | Description See [PrepareSubmissionRequest.user_id] Optional |
Returns
Promise<{ transaction: { commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: string; implementedInterfaces?: string[]; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; } | { CreatedEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; } | { ExercisedEvent: { acsDelta: boolean; actingParties: string[]; choice: string; choiceArgument: unknown; consuming: boolean; contractId: string; exerciseResult: unknown; implementedInterfaces?: string[]; interfaceId?: string; lastDescendantNodeId: number; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; })[]; externalTransactionHash?: string; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }; }>
The committed transaction with all created/archived events.
getActiveContracts()
getActiveContracts(
request: {activeAtOffset:number;eventFormat?: {filtersByParty?: {[key:string]: {cumulative?: {identifierFilter?: ... | ... | ... | ... | ...; }[]; }; };filtersForAnyParty?: {cumulative?: {identifierFilter?: {Empty: ...; } | {InterfaceFilter: ...; } | {TemplateFilter: ...; } | {WildcardFilter: ...; }; }[]; };verbose?:boolean; };filter?: {filtersByParty?: {[key:string]: {cumulative?: {identifierFilter?: ... | ... | ... | ... | ...; }[]; }; };filtersForAnyParty?: {cumulative?: {identifierFilter?: {Empty: ...; } | {InterfaceFilter: ...; } | {TemplateFilter: ...; } | {WildcardFilter: ...; }; }[]; }; };verbose?:boolean; },options?: {limit?:number; }):Promise<{contractEntry?: {JsActiveContract: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };reassignmentCounter:number;synchronizerId:string; }; } | {JsEmpty:Record<string,never>; } | {JsIncompleteAssigned: {assignedEvent: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: ...[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };reassignmentCounter:number;reassignmentId:string;source:string;submitter?:string;target:string; }; }; } | {JsIncompleteUnassigned: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };unassignedEvent: {assignmentExclusivity?:string;contractId:string;nodeId:number;offset:number;packageName:string;reassignmentCounter:number;reassignmentId:string;source:string;submitter?:string;target:string;templateId:string;witnessParties:string[]; }; }; };workflowId?:string; }[]>
Query active contracts on the ledger
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { activeAtOffset: number; eventFormat?: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; verbose?: boolean; }; filter?: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; }; verbose?: boolean; } | - |
request.activeAtOffset | number | Format: int64 Description The offset at which the snapshot of the active contracts will be computed. Must be no greater than the current ledger end offset. Must be greater than or equal to the last pruning offset. Required, must be a valid absolute offset (positive integer) or ledger begin offset (zero). If zero, the empty set will be returned. |
request.eventFormat? | { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; verbose?: boolean; } | Description Format of the contract_entries in the result. In case of CreatedEvent the presentation will be of TRANSACTION_SHAPE_ACS_DELTA. Optional for backwards compatibility, defaults to an EventFormat where: - filters_by_party is the filter.filters_by_party from this request - filters_for_any_party is the filter.filters_for_any_party from this request - verbose is the verbose field from this request |
request.eventFormat.filtersByParty? | {[key: string]: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; } | Description Each key must be a valid PartyIdString (as described in value.proto). The interpretation of the filter depends on the transaction-shape being filtered: 1. For ledger-effects create and exercise events are returned, for which the witnesses include at least one of the listed parties and match the per-party filter. 2. For transaction and active-contract-set streams create and archive events are returned for all contracts whose stakeholders include at least one of the listed parties and match the per-party filter. Optional |
request.eventFormat.filtersForAnyParty? | { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; } | Description Wildcard filters that apply to all the parties existing on the participant. The interpretation of the filters is the same with the per-party filter as described above. Optional |
request.eventFormat.filtersForAnyParty.cumulative? | { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[] | Description Every filter in the cumulative list expands the scope of the resulting stream. Each interface, template or wildcard filter means additional events that will match the query. The impact of include_interface_view and include_created_event_blob fields in the filters will also be accumulated. A template or an interface SHOULD NOT appear twice in the accumulative field. A wildcard filter SHOULD NOT be defined more than once in the accumulative field. Optional, if no CumulativeFilter defined, the default of a single WildcardFilter with include_created_event_blob unset is used. |
request.eventFormat.verbose? | boolean | Description If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels for record fields. Optional |
request.filter? | { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; } | Description Provided for backwards compatibility, it will be removed in the Canton version 3.5.0. Templates to include in the served snapshot, per party. Optional, if specified event_format must be unset, if not specified event_format must be set. |
request.filter.filtersByParty? | {[key: string]: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; } | Description Each key must be a valid PartyIdString (as described in value.proto). The interpretation of the filter depends on the transaction-shape being filtered: 1. For transaction trees (used in GetUpdateTreesResponse for backwards compatibility) all party keys used as wildcard filters, and all subtrees whose root has one of the listed parties as an informee are returned. If there are CumulativeFilters, those will control returned CreatedEvent fields where applicable, but will not be used for template/interface filtering. 2. For ledger-effects create and exercise events are returned, for which the witnesses include at least one of the listed parties and match the per-party filter. 3. For transaction and active-contract-set streams create and archive events are returned for all contracts whose stakeholders include at least one of the listed parties and match the per-party filter. |
request.filter.filtersForAnyParty? | { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; } | Description Wildcard filters that apply to all the parties existing on the participant. The interpretation of the filters is the same with the per-party filter as described above. |
request.filter.filtersForAnyParty.cumulative? | { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[] | Description Every filter in the cumulative list expands the scope of the resulting stream. Each interface, template or wildcard filter means additional events that will match the query. The impact of include_interface_view and include_created_event_blob fields in the filters will also be accumulated. A template or an interface SHOULD NOT appear twice in the accumulative field. A wildcard filter SHOULD NOT be defined more than once in the accumulative field. Optional, if no CumulativeFilter defined, the default of a single WildcardFilter with include_created_event_blob unset is used. |
request.verbose? | boolean | Description Provided for backwards compatibility, it will be removed in the Canton version 3.5.0. If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels for record fields. Optional, if specified event_format must be unset. |
options? | { limit?: number; } | - |
options.limit? | number | - |
Returns
Promise<{ contractEntry?: { JsActiveContract: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; reassignmentCounter: number; synchronizerId: string; }; } | { JsEmpty: Record<string, never>; } | { JsIncompleteAssigned: { assignedEvent: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: ...[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; reassignmentCounter: number; reassignmentId: string; source: string; submitter?: string; target: string; }; }; } | { JsIncompleteUnassigned: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; unassignedEvent: { assignmentExclusivity?: string; contractId: string; nodeId: number; offset: number; packageName: string; reassignmentCounter: number; reassignmentId: string; source: string; submitter?: string; target: string; templateId: string; witnessParties: string[]; }; }; }; workflowId?: string; }[]>
Array of active contracts matching the filter
getConnectedSynchronizers()
getConnectedSynchronizers():
Promise<{permission:"PARTICIPANT_PERMISSION_CONFIRMATION"|"PARTICIPANT_PERMISSION_OBSERVATION"|"PARTICIPANT_PERMISSION_SUBMISSION"|"PARTICIPANT_PERMISSION_UNSPECIFIED";synchronizerAlias:string;synchronizerId:string; }[]>
Get the list of synchronizers the participant is currently connected to
Returns
Promise<{ permission: "PARTICIPANT_PERMISSION_CONFIRMATION" | "PARTICIPANT_PERMISSION_OBSERVATION" | "PARTICIPANT_PERMISSION_SUBMISSION" | "PARTICIPANT_PERMISSION_UNSPECIFIED"; synchronizerAlias: string; synchronizerId: string; }[]>
getLedgerEnd()
getLedgerEnd():
Promise<{offset:number; }>
Get the current ledger end offset
Returns
Promise<{ offset: number; }>
getParticipantId()
getParticipantId():
Promise<string>
Get the participant ID
Returns
Promise<string>
getTransactionById()
getTransactionById(
updateId:string):Promise<{commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ... | ...;interfaceId:string;viewStatus: {code: ...;details?: ...;message: ...; };viewValue?:unknown; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }>
Fetch a transaction by its update ID without requiring a known party.
Uses filtersForAnyParty with a wildcard so all visible events are returned.
Parameters
| Parameter | Type | Description |
|---|---|---|
updateId | string | The update ID (Canton transaction hash) |
Returns
Promise<{ commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: string; implementedInterfaces?: string[]; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; } | { CreatedEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ... | ...; interfaceId: string; viewStatus: { code: ...; details?: ...; message: ...; }; viewValue?: unknown; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; } | { ExercisedEvent: { acsDelta: boolean; actingParties: string[]; choice: string; choiceArgument: unknown; consuming: boolean; contractId: string; exerciseResult: unknown; implementedInterfaces?: string[]; interfaceId?: string; lastDescendantNodeId: number; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; })[]; externalTransactionHash?: string; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }>
The full JsTransaction including all events
getUpdateById()
getUpdateById(
updateId:string,party:string):Promise<unknown>
Get update by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
updateId | string | The update ID returned from submit-and-wait |
party | string | The party ID to filter events for |
Returns
Promise<unknown>
The full update with all events
isAlive()
isAlive():
Promise<boolean>
Check if the ledger API is alive
Returns
Promise<boolean>
isReady()
isReady():
Promise<boolean>
Check if the ledger API is ready
Returns
Promise<boolean>
listParties()
listParties(
options?: {filterParty?:string; }):Promise<unknown[] |undefined>
List known parties on the participant
Parameters
| Parameter | Type |
|---|---|
options? | { filterParty?: string; } |
options.filterParty? | string |
Returns
Promise<unknown[] | undefined>
prepareSubmission()
prepareSubmission(
request: {actAs:string[];commandId:string;commands: ({CreateAndExerciseCommand: {choice:string;choiceArgument:unknown;createArguments:unknown;templateId:string; }; } | {CreateCommand: {createArguments:unknown;templateId:string; }; } | {ExerciseByKeyCommand: {choice:string;choiceArgument:unknown;contractKey:unknown;templateId:string; }; } | {ExerciseCommand: {choice:string;choiceArgument:unknown;contractId:string;templateId:string; }; })[];disclosedContracts?: {contractId?:string;createdEventBlob:string;synchronizerId?:string;templateId?:string; }[];estimateTrafficCost?: {disabled?:boolean;expectedSignatures?: ("SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_256"|"SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_384"|"SIGNING_ALGORITHM_SPEC_ED25519"|"SIGNING_ALGORITHM_SPEC_UNSPECIFIED")[]; };hashingSchemeVersion?:"HASHING_SCHEME_VERSION_UNSPECIFIED"|"HASHING_SCHEME_VERSION_V2"|"HASHING_SCHEME_VERSION_V3";maxRecordTime?:string;minLedgerTime?: {time?: {Empty:Record<string,never>; } | {MinLedgerTimeAbs: {value:string; }; } | {MinLedgerTimeRel: {value: {nanos:number;seconds:number;unknownFields?: {fields: {[key: ...]: ...; }; }; }; }; }; };packageIdSelectionPreference?:string[];prefetchContractKeys?: {contractKey:unknown;templateId:string; }[];readAs?:string[];synchronizerId?:string;userId?:string;verboseHashing?:boolean; }):Promise<{costEstimation?: {confirmationRequestTrafficCostEstimation?:number;confirmationResponseTrafficCostEstimation?:number;estimationTimestamp?:string;totalTrafficCostEstimation?:number; };hashingDetails?:string;hashingSchemeVersion?:"HASHING_SCHEME_VERSION_UNSPECIFIED"|"HASHING_SCHEME_VERSION_V2"|"HASHING_SCHEME_VERSION_V3";preparedTransaction?:string;preparedTransactionHash?:string; }>
Prepare a transaction for external signing.
Calls the Preparing Participant Node (PPN) to convert ledger commands into a Daml transaction. The response contains the prepared transaction blob and a hash that must be signed by the external party.
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { actAs: string[]; commandId: string; commands: ({ CreateAndExerciseCommand: { choice: string; choiceArgument: unknown; createArguments: unknown; templateId: string; }; } | { CreateCommand: { createArguments: unknown; templateId: string; }; } | { ExerciseByKeyCommand: { choice: string; choiceArgument: unknown; contractKey: unknown; templateId: string; }; } | { ExerciseCommand: { choice: string; choiceArgument: unknown; contractId: string; templateId: string; }; })[]; disclosedContracts?: { contractId?: string; createdEventBlob: string; synchronizerId?: string; templateId?: string; }[]; estimateTrafficCost?: { disabled?: boolean; expectedSignatures?: ("SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_256" | "SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_384" | "SIGNING_ALGORITHM_SPEC_ED25519" | "SIGNING_ALGORITHM_SPEC_UNSPECIFIED")[]; }; hashingSchemeVersion?: "HASHING_SCHEME_VERSION_UNSPECIFIED" | "HASHING_SCHEME_VERSION_V2" | "HASHING_SCHEME_VERSION_V3"; maxRecordTime?: string; minLedgerTime?: { time?: { Empty: Record<string, never>; } | { MinLedgerTimeAbs: { value: string; }; } | { MinLedgerTimeRel: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: ...]: ...; }; }; }; }; }; }; packageIdSelectionPreference?: string[]; prefetchContractKeys?: { contractKey: unknown; templateId: string; }[]; readAs?: string[]; synchronizerId?: string; userId?: string; verboseHashing?: boolean; } | - |
request.actAs | string[] | Description Set of parties on whose behalf the command should be executed, if submitted. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to read (not act) on behalf of each of the given parties. This is because this RPC merely prepares a transaction and does not execute it. Therefore read authorization is sufficient even for actAs parties. Note: This may change, and more specific authorization scope may be introduced in the future. Each element must be a valid PartyIdString (as described in value.proto). Required, must be non-empty. |
request.commandId | string | Description Uniquely identifies the command. The triple (user_id, act_as, command_id) constitutes the change ID for the intended ledger change, where act_as is interpreted as a set of party names. The change ID can be used for matching the intended ledger changes with all their completions. Must be a valid LedgerString (as described in value.proto). Required |
request.commands | ({ CreateAndExerciseCommand: { choice: string; choiceArgument: unknown; createArguments: unknown; templateId: string; }; } | { CreateCommand: { createArguments: unknown; templateId: string; }; } | { ExerciseByKeyCommand: { choice: string; choiceArgument: unknown; contractKey: unknown; templateId: string; }; } | { ExerciseCommand: { choice: string; choiceArgument: unknown; contractId: string; templateId: string; }; })[] | Description Individual elements of this atomic command. Must be non-empty. Limitation: Only single command transaction are currently supported by the API. The field is marked as repeated in preparation for future support of multiple commands. Required |
request.disclosedContracts? | { contractId?: string; createdEventBlob: string; synchronizerId?: string; templateId?: string; }[] | Description Additional contracts used to resolve contract & contract key lookups. Optional |
request.estimateTrafficCost? | { disabled?: boolean; expectedSignatures?: ("SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_256" | "SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_384" | "SIGNING_ALGORITHM_SPEC_ED25519" | "SIGNING_ALGORITHM_SPEC_UNSPECIFIED")[]; } | Description Hints to improve the accuracy of traffic cost estimation. The estimation logic assumes that this node will be used for the execution of the transaction If another node is used instead, the estimation may be less precise. Request amplification is not accounted for in the estimation: each amplified request will result in the cost of the confirmation request to be charged additionally. Optional - Traffic cost estimation is enabled by default if this field is not set To turn off cost estimation, set the CostEstimationHints#disabled field to true |
request.estimateTrafficCost.disabled? | boolean | Description Disable cost estimation Default (not set) is false |
request.estimateTrafficCost.expectedSignatures? | ("SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_256" | "SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_384" | "SIGNING_ALGORITHM_SPEC_ED25519" | "SIGNING_ALGORITHM_SPEC_UNSPECIFIED")[] | Description Details on the keys that will be used to sign the transaction (how many and of which type). Signature size impacts the cost of the transaction. If empty, the signature sizes will be approximated with threshold-many signatures (where threshold is defined in the PartyToKeyMapping of the external party), using keys in the order they are registered. Optional (empty list is equivalent to not providing this field) |
request.hashingSchemeVersion? | "HASHING_SCHEME_VERSION_UNSPECIFIED" | "HASHING_SCHEME_VERSION_V2" | "HASHING_SCHEME_VERSION_V3" | Description Optional - defaults to HASHING_SCHEME_VERSION_V2 The hashing scheme version to be used when building the hash |
request.maxRecordTime? | string | Description Maximum timestamp at which the transaction can be recorded onto the ledger via the synchronizer specified in the PrepareSubmissionResponse. If submitted after it will be rejected even if otherwise valid, in which case it needs to be prepared and signed again with a new valid max_record_time. Use this to limit the time-to-life of a prepared transaction, which is useful to know when it can definitely not be accepted anymore and resorting to preparing another transaction for the same intent is safe again. Optional |
request.minLedgerTime? | { time?: { Empty: Record<string, never>; } | { MinLedgerTimeAbs: { value: string; }; } | { MinLedgerTimeRel: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: ...]: ...; }; }; }; }; }; } | Description Optional |
request.minLedgerTime.time? | { Empty: Record<string, never>; } | { MinLedgerTimeAbs: { value: string; }; } | { MinLedgerTimeRel: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: ...]: ...; }; }; }; }; } | - |
request.packageIdSelectionPreference? | string[] | Description The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation Optional |
request.prefetchContractKeys? | { contractKey: unknown; templateId: string; }[] | Description Fetches the contract keys into the caches to speed up the command processing. Should only contain contract keys that are expected to be resolved during interpretation of the commands. Keys of disclosed contracts do not need prefetching. Optional |
request.readAs? | string[] | Description Set of parties on whose behalf (in addition to all parties listed in act_as) contracts can be retrieved. This affects Daml operations such as fetch, fetchByKey, lookupByKey, exercise, and exerciseByKey. Note: A command can only use contracts that are visible to at least one of the parties in act_as or read_as. This visibility check is independent from the Daml authorization rules for fetch operations. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to read contract data on behalf of each of the given parties. Optional |
request.synchronizerId? | string | Description Must be a valid synchronizer id If not set, a suitable synchronizer that this node is connected to will be chosen Optional |
request.userId? | string | Description Uniquely identifies the participant user that prepares the transaction. Must be a valid UserIdString (as described in value.proto). Required unless authentication is used with a user token. In that case, the token's user-id will be used for the request's user_id. Optional |
request.verboseHashing? | boolean | Description When true, the response will contain additional details on how the transaction was encoded and hashed This can be useful for troubleshooting of hash mismatches. Should only be used for debugging. Optional, default to false |
Returns
Promise<{ costEstimation?: { confirmationRequestTrafficCostEstimation?: number; confirmationResponseTrafficCostEstimation?: number; estimationTimestamp?: string; totalTrafficCostEstimation?: number; }; hashingDetails?: string; hashingSchemeVersion?: "HASHING_SCHEME_VERSION_UNSPECIFIED" | "HASHING_SCHEME_VERSION_V2" | "HASHING_SCHEME_VERSION_V3"; preparedTransaction?: string; preparedTransactionHash?: string; }>
The prepared transaction, its hash, and the hashing scheme version.
submitAndWait()
submitAndWait(
commands: {actAs:string[];commandId:string;commands: ({CreateAndExerciseCommand: {choice:string;choiceArgument:unknown;createArguments:unknown;templateId:string; }; } | {CreateCommand: {createArguments:unknown;templateId:string; }; } | {ExerciseByKeyCommand: {choice:string;choiceArgument:unknown;contractKey:unknown;templateId:string; }; } | {ExerciseCommand: {choice:string;choiceArgument:unknown;contractId:string;templateId:string; }; })[];deduplicationPeriod?: {DeduplicationDuration: {value: {nanos:number;seconds:number;unknownFields?: {fields: {[key:string]: {fixed32?: ... | ...;fixed64?: ... | ...;lengthDelimited?: ... | ...;varint?: ... | ...; }; }; }; }; }; } | {DeduplicationOffset: {value:number; }; } | {Empty:Record<string,never>; };disclosedContracts?: {contractId?:string;createdEventBlob:string;synchronizerId?:string;templateId?:string; }[];minLedgerTimeAbs?:string;minLedgerTimeRel?: {nanos:number;seconds:number;unknownFields?: {fields: {[key:string]: {fixed32?:number[];fixed64?:number[];lengthDelimited?:string[];varint?:number[]; }; }; }; };packageIdSelectionPreference?:string[];prefetchContractKeys?: {contractKey:unknown;templateId:string; }[];readAs?:string[];submissionId?:string;synchronizerId?:string;userId?:string;workflowId?:string; }):Promise<{completionOffset:number;updateId:string; }>
Submit a command and wait for completion
Parameters
| Parameter | Type | Description |
|---|---|---|
commands | { actAs: string[]; commandId: string; commands: ({ CreateAndExerciseCommand: { choice: string; choiceArgument: unknown; createArguments: unknown; templateId: string; }; } | { CreateCommand: { createArguments: unknown; templateId: string; }; } | { ExerciseByKeyCommand: { choice: string; choiceArgument: unknown; contractKey: unknown; templateId: string; }; } | { ExerciseCommand: { choice: string; choiceArgument: unknown; contractId: string; templateId: string; }; })[]; deduplicationPeriod?: { DeduplicationDuration: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: ... | ...; fixed64?: ... | ...; lengthDelimited?: ... | ...; varint?: ... | ...; }; }; }; }; }; } | { DeduplicationOffset: { value: number; }; } | { Empty: Record<string, never>; }; disclosedContracts?: { contractId?: string; createdEventBlob: string; synchronizerId?: string; templateId?: string; }[]; minLedgerTimeAbs?: string; minLedgerTimeRel?: { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: number[]; fixed64?: number[]; lengthDelimited?: string[]; varint?: number[]; }; }; }; }; packageIdSelectionPreference?: string[]; prefetchContractKeys?: { contractKey: unknown; templateId: string; }[]; readAs?: string[]; submissionId?: string; synchronizerId?: string; userId?: string; workflowId?: string; } | - |
commands.actAs | string[] | Description Set of parties on whose behalf the command should be executed. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to act on behalf of each of the given parties. Each element must be a valid PartyIdString (as described in value.proto). Required, must be non-empty. |
commands.commandId | string | Description Uniquely identifies the command. The triple (user_id, act_as, command_id) constitutes the change ID for the intended ledger change, where act_as is interpreted as a set of party names. The change ID can be used for matching the intended ledger changes with all their completions. Must be a valid LedgerString (as described in value.proto). Required |
commands.commands | ({ CreateAndExerciseCommand: { choice: string; choiceArgument: unknown; createArguments: unknown; templateId: string; }; } | { CreateCommand: { createArguments: unknown; templateId: string; }; } | { ExerciseByKeyCommand: { choice: string; choiceArgument: unknown; contractKey: unknown; templateId: string; }; } | { ExerciseCommand: { choice: string; choiceArgument: unknown; contractId: string; templateId: string; }; })[] | Description Individual elements of this atomic command. Must be non-empty. Required |
commands.deduplicationPeriod? | { DeduplicationDuration: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: ... | ...; fixed64?: ... | ...; lengthDelimited?: ... | ...; varint?: ... | ...; }; }; }; }; }; } | { DeduplicationOffset: { value: number; }; } | { Empty: Record<string, never>; } | - |
commands.disclosedContracts? | { contractId?: string; createdEventBlob: string; synchronizerId?: string; templateId?: string; }[] | Description Additional contracts used to resolve contract & contract key lookups. Optional |
commands.minLedgerTimeAbs? | string | Description Lower bound for the ledger time assigned to the resulting transaction. Note: The ledger time of a transaction is assigned as part of command interpretation. Use this property if you expect that command interpretation will take a considerate amount of time, such that by the time the resulting transaction is sequenced, its assigned ledger time is not valid anymore. Must not be set at the same time as min_ledger_time_rel. Optional |
commands.minLedgerTimeRel? | { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: number[]; fixed64?: number[]; lengthDelimited?: string[]; varint?: number[]; }; }; }; } | Description Same as min_ledger_time_abs, but specified as a duration, starting from the time the command is received by the server. Must not be set at the same time as min_ledger_time_abs. Optional |
commands.minLedgerTimeRel.nanos | number | Format: int32 |
commands.minLedgerTimeRel.seconds | number | Format: int64 |
commands.minLedgerTimeRel.unknownFields? | { fields: {[key: string]: { fixed32?: number[]; fixed64?: number[]; lengthDelimited?: string[]; varint?: number[]; }; }; } | Description This field is automatically added as part of protobuf to json mapping |
commands.minLedgerTimeRel.unknownFields.fields | {[key: string]: { fixed32?: number[]; fixed64?: number[]; lengthDelimited?: string[]; varint?: number[]; }; } | - |
commands.packageIdSelectionPreference? | string[] | Description The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation |
commands.prefetchContractKeys? | { contractKey: unknown; templateId: string; }[] | Description Fetches the contract keys into the caches to speed up the command processing. Should only contain contract keys that are expected to be resolved during interpretation of the commands. Keys of disclosed contracts do not need prefetching. Optional |
commands.readAs? | string[] | Description Set of parties on whose behalf (in addition to all parties listed in act_as) contracts can be retrieved. This affects Daml operations such as fetch, fetchByKey, lookupByKey, exercise, and exerciseByKey. Note: A participant node of a Daml network can host multiple parties. Each contract present on the participant node is only visible to a subset of these parties. A command can only use contracts that are visible to at least one of the parties in act_as or read_as. This visibility check is independent from the Daml authorization rules for fetch operations. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to read contract data on behalf of each of the given parties. Optional |
commands.submissionId? | string | Description A unique identifier to distinguish completions for different submissions with the same change ID. Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission with the same change ID. Must be a valid LedgerString (as described in value.proto). If omitted, the participant or the committer may set a value of their choice. Optional |
commands.synchronizerId? | string | Description Must be a valid synchronizer id Optional |
commands.userId? | string | Description Uniquely identifies the participant user that issued the command. Must be a valid UserIdString (as described in value.proto). Required unless authentication is used with a user token. In that case, the token's user-id will be used for the request's user_id. |
commands.workflowId? | string | Description Identifier of the on-ledger workflow that this command is a part of. Must be a valid LedgerString (as described in value.proto). Optional |
Returns
Promise<{ completionOffset: number; updateId: string; }>
The update ID and completion offset
submitAndWaitForTransaction()
submitAndWaitForTransaction(
commands: {actAs:string[];commandId:string;commands: ({CreateAndExerciseCommand: {choice:string;choiceArgument:unknown;createArguments:unknown;templateId:string; }; } | {CreateCommand: {createArguments:unknown;templateId:string; }; } | {ExerciseByKeyCommand: {choice:string;choiceArgument:unknown;contractKey:unknown;templateId:string; }; } | {ExerciseCommand: {choice:string;choiceArgument:unknown;contractId:string;templateId:string; }; })[];deduplicationPeriod?: {DeduplicationDuration: {value: {nanos:number;seconds:number;unknownFields?: {fields: {[key:string]: {fixed32?: ... | ...;fixed64?: ... | ...;lengthDelimited?: ... | ...;varint?: ... | ...; }; }; }; }; }; } | {DeduplicationOffset: {value:number; }; } | {Empty:Record<string,never>; };disclosedContracts?: {contractId?:string;createdEventBlob:string;synchronizerId?:string;templateId?:string; }[];minLedgerTimeAbs?:string;minLedgerTimeRel?: {nanos:number;seconds:number;unknownFields?: {fields: {[key:string]: {fixed32?:number[];fixed64?:number[];lengthDelimited?:string[];varint?:number[]; }; }; }; };packageIdSelectionPreference?:string[];prefetchContractKeys?: {contractKey:unknown;templateId:string; }[];readAs?:string[];submissionId?:string;synchronizerId?:string;userId?:string;workflowId?:string; },eventFormat?: {filtersByParty?: {[key:string]: {cumulative?: {identifierFilter?: {Empty: ...; } | {InterfaceFilter: ...; } | {TemplateFilter: ...; } | {WildcardFilter: ...; }; }[]; }; };filtersForAnyParty?: {cumulative?: {identifierFilter?: {Empty:Record<..., ...>; } | {InterfaceFilter: {value?: ...; }; } | {TemplateFilter: {value?: ...; }; } | {WildcardFilter: {value?: ...; }; }; }[]; };verbose?:boolean; }):Promise<{transaction: {commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }; }>
Submit a command and wait for the full transaction response
Parameters
| Parameter | Type | Description |
|---|---|---|
commands | { actAs: string[]; commandId: string; commands: ({ CreateAndExerciseCommand: { choice: string; choiceArgument: unknown; createArguments: unknown; templateId: string; }; } | { CreateCommand: { createArguments: unknown; templateId: string; }; } | { ExerciseByKeyCommand: { choice: string; choiceArgument: unknown; contractKey: unknown; templateId: string; }; } | { ExerciseCommand: { choice: string; choiceArgument: unknown; contractId: string; templateId: string; }; })[]; deduplicationPeriod?: { DeduplicationDuration: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: ... | ...; fixed64?: ... | ...; lengthDelimited?: ... | ...; varint?: ... | ...; }; }; }; }; }; } | { DeduplicationOffset: { value: number; }; } | { Empty: Record<string, never>; }; disclosedContracts?: { contractId?: string; createdEventBlob: string; synchronizerId?: string; templateId?: string; }[]; minLedgerTimeAbs?: string; minLedgerTimeRel?: { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: number[]; fixed64?: number[]; lengthDelimited?: string[]; varint?: number[]; }; }; }; }; packageIdSelectionPreference?: string[]; prefetchContractKeys?: { contractKey: unknown; templateId: string; }[]; readAs?: string[]; submissionId?: string; synchronizerId?: string; userId?: string; workflowId?: string; } | - |
commands.actAs | string[] | Description Set of parties on whose behalf the command should be executed. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to act on behalf of each of the given parties. Each element must be a valid PartyIdString (as described in value.proto). Required, must be non-empty. |
commands.commandId? | string | Description Uniquely identifies the command. The triple (user_id, act_as, command_id) constitutes the change ID for the intended ledger change, where act_as is interpreted as a set of party names. The change ID can be used for matching the intended ledger changes with all their completions. Must be a valid LedgerString (as described in value.proto). Required |
commands.commands? | ({ CreateAndExerciseCommand: { choice: string; choiceArgument: unknown; createArguments: unknown; templateId: string; }; } | { CreateCommand: { createArguments: unknown; templateId: string; }; } | { ExerciseByKeyCommand: { choice: string; choiceArgument: unknown; contractKey: unknown; templateId: string; }; } | { ExerciseCommand: { choice: string; choiceArgument: unknown; contractId: string; templateId: string; }; })[] | Description Individual elements of this atomic command. Must be non-empty. Required |
commands.deduplicationPeriod? | { DeduplicationDuration: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: ... | ...; fixed64?: ... | ...; lengthDelimited?: ... | ...; varint?: ... | ...; }; }; }; }; }; } | { DeduplicationOffset: { value: number; }; } | { Empty: Record<string, never>; } | - |
commands.disclosedContracts? | { contractId?: string; createdEventBlob: string; synchronizerId?: string; templateId?: string; }[] | Description Additional contracts used to resolve contract & contract key lookups. Optional |
commands.minLedgerTimeAbs? | string | Description Lower bound for the ledger time assigned to the resulting transaction. Note: The ledger time of a transaction is assigned as part of command interpretation. Use this property if you expect that command interpretation will take a considerate amount of time, such that by the time the resulting transaction is sequenced, its assigned ledger time is not valid anymore. Must not be set at the same time as min_ledger_time_rel. Optional |
commands.minLedgerTimeRel? | { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: number[]; fixed64?: number[]; lengthDelimited?: string[]; varint?: number[]; }; }; }; } | Description Same as min_ledger_time_abs, but specified as a duration, starting from the time the command is received by the server. Must not be set at the same time as min_ledger_time_abs. Optional |
commands.minLedgerTimeRel.nanos? | number | Format: int32 |
commands.minLedgerTimeRel.seconds? | number | Format: int64 |
commands.minLedgerTimeRel.unknownFields? | { fields: {[key: string]: { fixed32?: number[]; fixed64?: number[]; lengthDelimited?: string[]; varint?: number[]; }; }; } | Description This field is automatically added as part of protobuf to json mapping |
commands.minLedgerTimeRel.unknownFields.fields? | {[key: string]: { fixed32?: number[]; fixed64?: number[]; lengthDelimited?: string[]; varint?: number[]; }; } | - |
commands.packageIdSelectionPreference? | string[] | Description The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation |
commands.prefetchContractKeys? | { contractKey: unknown; templateId: string; }[] | Description Fetches the contract keys into the caches to speed up the command processing. Should only contain contract keys that are expected to be resolved during interpretation of the commands. Keys of disclosed contracts do not need prefetching. Optional |
commands.readAs? | string[] | Description Set of parties on whose behalf (in addition to all parties listed in act_as) contracts can be retrieved. This affects Daml operations such as fetch, fetchByKey, lookupByKey, exercise, and exerciseByKey. Note: A participant node of a Daml network can host multiple parties. Each contract present on the participant node is only visible to a subset of these parties. A command can only use contracts that are visible to at least one of the parties in act_as or read_as. This visibility check is independent from the Daml authorization rules for fetch operations. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to read contract data on behalf of each of the given parties. Optional |
commands.submissionId? | string | Description A unique identifier to distinguish completions for different submissions with the same change ID. Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission with the same change ID. Must be a valid LedgerString (as described in value.proto). If omitted, the participant or the committer may set a value of their choice. Optional |
commands.synchronizerId? | string | Description Must be a valid synchronizer id Optional |
commands.userId? | string | Description Uniquely identifies the participant user that issued the command. Must be a valid UserIdString (as described in value.proto). Required unless authentication is used with a user token. In that case, the token's user-id will be used for the request's user_id. |
commands.workflowId? | string | Description Identifier of the on-ledger workflow that this command is a part of. Must be a valid LedgerString (as described in value.proto). Optional |
eventFormat? | { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: { Empty: Record<..., ...>; } | { InterfaceFilter: { value?: ...; }; } | { TemplateFilter: { value?: ...; }; } | { WildcardFilter: { value?: ...; }; }; }[]; }; verbose?: boolean; } | - |
eventFormat.filtersByParty? | {[key: string]: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; } | Description Each key must be a valid PartyIdString (as described in value.proto). The interpretation of the filter depends on the transaction-shape being filtered: 1. For ledger-effects create and exercise events are returned, for which the witnesses include at least one of the listed parties and match the per-party filter. 2. For transaction and active-contract-set streams create and archive events are returned for all contracts whose stakeholders include at least one of the listed parties and match the per-party filter. Optional |
eventFormat.filtersForAnyParty? | { cumulative?: { identifierFilter?: { Empty: Record<..., ...>; } | { InterfaceFilter: { value?: ...; }; } | { TemplateFilter: { value?: ...; }; } | { WildcardFilter: { value?: ...; }; }; }[]; } | Description Wildcard filters that apply to all the parties existing on the participant. The interpretation of the filters is the same with the per-party filter as described above. Optional |
eventFormat.filtersForAnyParty.cumulative? | { identifierFilter?: { Empty: Record<..., ...>; } | { InterfaceFilter: { value?: ...; }; } | { TemplateFilter: { value?: ...; }; } | { WildcardFilter: { value?: ...; }; }; }[] | Description Every filter in the cumulative list expands the scope of the resulting stream. Each interface, template or wildcard filter means additional events that will match the query. The impact of include_interface_view and include_created_event_blob fields in the filters will also be accumulated. A template or an interface SHOULD NOT appear twice in the accumulative field. A wildcard filter SHOULD NOT be defined more than once in the accumulative field. Optional, if no CumulativeFilter defined, the default of a single WildcardFilter with include_created_event_blob unset is used. |
eventFormat.verbose? | boolean | Description If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels for record fields. Optional |
Returns
Promise<{ transaction: { commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: string; implementedInterfaces?: string[]; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; } | { CreatedEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; } | { ExercisedEvent: { acsDelta: boolean; actingParties: string[]; choice: string; choiceArgument: unknown; consuming: boolean; contractId: string; exerciseResult: unknown; implementedInterfaces?: string[]; interfaceId?: string; lastDescendantNodeId: number; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; })[]; externalTransactionHash?: string; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }; }>
The transaction with all created/archived events
tokenMetadataClient
readonlytokenMetadataClient: {getInstrument:Promise<Instrument>;getRegistryInfo:Promise<GetRegistryInfoResponse>;listInstruments:Promise<ListInstrumentsResponse>; }
Defined in: canton/index.ts:106
getInstrument()
getInstrument(
instrumentId:string):Promise<Instrument>
Retrieve an instrument's metadata by its ID.
GET /registry/metadata/v1/instruments/{instrumentId}
Parameters
| Parameter | Type |
|---|---|
instrumentId | string |
Returns
Promise<Instrument>
getRegistryInfo()
getRegistryInfo():
Promise<GetRegistryInfoResponse>
Get information about the registry, including supported APIs.
GET /registry/metadata/v1/info
Returns
Promise<GetRegistryInfoResponse>
listInstruments()
listInstruments(
options?:ListInstrumentsOptions):Promise<ListInstrumentsResponse>
List all instruments managed by this instrument admin.
GET /registry/metadata/v1/instruments
Parameters
| Parameter | Type |
|---|---|
options? | ListInstrumentsOptions |
Returns
Promise<ListInstrumentsResponse>
transferInstructionClient
readonlytransferInstructionClient: {getAcceptContext:Promise<ChoiceContext>;getRejectContext:Promise<ChoiceContext>;getTransferFactory:Promise<TransferFactoryWithChoiceContext>;getWithdrawContext:Promise<ChoiceContext>; }
Defined in: canton/index.ts:105
getAcceptContext()
getAcceptContext(
transferInstructionId:string,request?:GetChoiceContextRequest):Promise<ChoiceContext>
Get the choice context to accept a transfer instruction.
POST /registry/transfer-instruction/v1/{transferInstructionId}/choice-contexts/accept
Parameters
| Parameter | Type |
|---|---|
transferInstructionId | string |
request? | GetChoiceContextRequest |
Returns
Promise<ChoiceContext>
getRejectContext()
getRejectContext(
transferInstructionId:string,request?:GetChoiceContextRequest):Promise<ChoiceContext>
Get the choice context to reject a transfer instruction.
POST /registry/transfer-instruction/v1/{transferInstructionId}/choice-contexts/reject
Parameters
| Parameter | Type |
|---|---|
transferInstructionId | string |
request? | GetChoiceContextRequest |
Returns
Promise<ChoiceContext>
getTransferFactory()
getTransferFactory(
request:GetFactoryRequest):Promise<TransferFactoryWithChoiceContext>
Get the factory and choice context for executing a direct transfer.
POST /registry/transfer-instruction/v1/transfer-factory
Parameters
| Parameter | Type |
|---|---|
request | GetFactoryRequest |
Returns
Promise<TransferFactoryWithChoiceContext>
getWithdrawContext()
getWithdrawContext(
transferInstructionId:string,request?:GetChoiceContextRequest):Promise<ChoiceContext>
Get the choice context to withdraw a transfer instruction.
POST /registry/transfer-instruction/v1/{transferInstructionId}/choice-contexts/withdraw
Parameters
| Parameter | Type |
|---|---|
transferInstructionId | string |
request? | GetChoiceContextRequest |
Returns
Promise<ChoiceContext>
decimals
readonlystaticdecimals:10=10
Defined in: canton/index.ts:99
Canton uses 10 decimals (lf-coin micro-units)
family
readonlystaticfamily:"CANTON"=ChainFamily.Canton
Defined in: canton/index.ts:97
Methods
estimateReceiveExecution()?
optionalestimateReceiveExecution(opts: {message:Omit<EstimateMessageInput,"onRampAddress"|"offRampAddress">;offRamp:string; } | {messageId:string; }):Promise<number>
Defined in: chain.ts:2082
Estimate ccipReceive execution cost (gas, computeUnits) for this destination chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { message: Omit<EstimateMessageInput, "onRampAddress" | "offRampAddress">; offRamp: string; } | { messageId: string; } | Either: - { offRamp, message } — estimate from message fields directly. message must include sourceChainSelector, messageId, receiver, and optionally sender, data, destTokenAmounts. - { messageId } — fetch the message from the CCIP API via getMessageById, resolve the offRamp from the message metadata or getExecutionInput, then estimate. Requires apiClient to be available. |
Returns
Promise<number>
Estimated execution cost (gas for EVM, compute units for Solana)
Inherited from
Chain.estimateReceiveExecution
execute()
execute(
opts:ExecuteOpts& {wallet:unknown; }):Promise<CCIPExecution>
Defined in: canton/index.ts:998
Executes a CCIP message on Canton by:
- Validating the wallet as a CantonWallet.
- Building the unsigned command via generateUnsignedExecute.
- Submitting the command to the Canton Ledger API.
- Parsing the resulting transaction into a CCIPExecution.
Parameters
| Parameter | Type |
|---|---|
opts | ExecuteOpts & { wallet: unknown; } |
Returns
Promise<CCIPExecution>
Throws
CCIPWalletInvalidError if wallet is not a valid CantonWallet
Throws
CCIPError if the Ledger API submission or result parsing fails
Overrides
generateUnsignedExecute()
generateUnsignedExecute(
opts:ExecuteOpts& {payer:string; }):Promise<UnsignedCantonTx>
Defined in: canton/index.ts:857
Builds a Canton JsCommands payload that exercises the Execute choice on
the caller's CCIPReceiver contract. The command includes:
- ACS disclosures – same-party contracts (
PerPartyRouter,CCIPReceiver) fetched via AcsDisclosureProvider. - EDS disclosures – cross-party contracts (OffRamp, GlobalConfig, TokenAdminRegistry, RMNRemote, CCVs) fetched via EdsDisclosureProvider.
- Choice argument – assembled from the encoded CCIP message,
verification data, and the opaque
contextDatareturned by the EDS.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | ExecuteOpts & { payer: string; } | Must use the offRamp + input variant of ExecuteOpts. input must contain encodedMessage and verifications (CCIP v2.0). payer is the Daml party ID used for actAs. |
Returns
Promise<UnsignedCantonTx>
An UnsignedCantonTx wrapping the ready-to-submit
JsCommands.
Overrides
generateUnsignedSendMessage()
generateUnsignedSendMessage(
opts:SendMessageOpts& {sender:string; }):Promise<UnsignedCantonTx>
Defined in: canton/index.ts:478
Generate unsigned txs for ccipSend'ing a message.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | SendMessageOpts & { sender: string; } | SendMessageOpts with sender address |
Returns
Promise<UnsignedCantonTx>
Promise resolving to chain-family specific unsigned txs
Overrides
Chain.generateUnsignedSendMessage
getBalance()
getBalance(
_opts:GetBalanceOpts):Promise<bigint>
Defined in: canton/index.ts:454
Query token balance for an address.
Parameters
| Parameter | Type | Description |
|---|---|---|
_opts | GetBalanceOpts | Balance query options |
Returns
Promise<bigint>
Token balance information including raw and formatted values
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
getBlockInfo()
getBlockInfo(
block:number|"finalized"|"latest"):Promise<BlockInfo>
Defined in: canton/index.ts:303
Fetch info (number and timestamp) for a given block or finality tag.
Parameters
| Parameter | Type | Description |
|---|---|---|
block | number | "finalized" | "latest" | Block number, or tag like 'finalized' or 'latest' |
Returns
Promise<BlockInfo>
Block info with number and timestamp
Throws
CCIPNotImplementedError Canton ledger uses offsets, not block numbers
Overrides
getBlockTimestamp()
getBlockTimestamp(
block:number|"finalized"|"latest"):Promise<number>
Defined in: chain.ts:706
Fetch the timestamp of a given block.
Parameters
| Parameter | Type | Description |
|---|---|---|
block | number | "finalized" | "latest" | Block number or finality tag |
Returns
Promise<number>
Unix timestamp in seconds
Deprecated
Use Chain.getBlockInfo instead.
Inherited from
getExecutionInput()
getExecutionInput(
opts: {request:CCIPRequest;verifications:CCIPVerifications; } &Pick<LogFilter,"page">):Promise<ExecutionInput>
Defined in: chain.ts:956
Fetch input data needed for executing messages Should be called on the source instance
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { request: CCIPRequest; verifications: CCIPVerifications; } & Pick<LogFilter, "page"> | getExecutionInput options containing request and verifications |
Returns
Promise<ExecutionInput>
input payload to be passed to execute
See
execute - method to execute a message
Inherited from
getExecutionReceipts()
getExecutionReceipts(
opts: {messageId?:string;offRamp:string;sourceChainSelector?:bigint;verifications?:CCIPVerifications; } &Pick<LogFilter,"page"|"startBlock"|"startTime"|"watch">):AsyncIterableIterator<CCIPExecution>
Defined in: chain.ts:1706
Default/generic implementation of getExecutionReceipts. Yields execution receipts for a given offRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { messageId?: string; offRamp: string; sourceChainSelector?: bigint; verifications?: CCIPVerifications; } & Pick<LogFilter, "page" | "startBlock" | "startTime" | "watch"> | getExecutionReceipts options |
Returns
AsyncIterableIterator<CCIPExecution>
Async generator of CCIPExecution receipts
Example
for await (const exec of dest.getExecutionReceipts({
offRamp: offRampAddress,
messageId: request.message.messageId,
startBlock: commit.log.blockNumber,
})) {
console.log(`State: ${exec.receipt.state}`)
if (exec.receipt.state === ExecutionState.Success) break
}
Inherited from
getFee()
getFee(
_opts:Omit<SendMessageOpts,"approveMax">):Promise<bigint>
Defined in: canton/index.ts:473
Returns the CCIP fee for sending a message.
Canton has no scalar upfront CCIP fee — the cost is computed inside the
on-chain command at send time. Returns 0n so --only-get-fee and the
balance check both pass cleanly.
Parameters
| Parameter | Type |
|---|---|
_opts | Omit<SendMessageOpts, "approveMax"> |
Returns
Promise<bigint>
Overrides
getFeeTokens()
getFeeTokens(
_router:string):Promise<Record<string,TokenInfo>>
Defined in: canton/index.ts:1295
Fetch list and info of supported feeTokens.
Parameters
| Parameter | Type | Description |
|---|---|---|
_router | string | Router address on this chain |
Returns
Promise<Record<string, TokenInfo>>
Promise resolving to mapping of token addresses to TokenInfo objects
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
getLaneFeatures()
getLaneFeatures(
opts: {destChainSelector:bigint;router:string;token?:string; }):Promise<Partial<LaneFeatures>>
Defined in: chain.ts:1647
Retrieve features for a lane (router/destChainSelector/token triplet).
Parameters
| Parameter | Type |
|---|---|
opts | { destChainSelector: bigint; router: string; token?: string; } |
opts.destChainSelector | bigint |
opts.router | string |
opts.token? | string |
Returns
Promise<Partial<LaneFeatures>>
Promise resolving to partial lane features record
Throws
CCIPNotImplementedError if not implemented for this chain family
Example
const features = await chain.getLaneFeatures({
router: '0x...',
destChainSelector: 4949039107694359620n,
})
// FINALITY_FAST has three states:
// - undefined: FTF is not supported on this lane (pre-v2.0)
// - 0: the lane supports FTF, but it is not enabled for this token
// - > 0: FTF is enabled with this many block confirmations
const ftf = features[LaneFeature.FINALITY_FAST]
if (ftf != null && ftf > 0) {
console.log(`FTF enabled with ${ftf} block confirmations`)
} else if (ftf === 0) {
console.log('FTF supported on this lane but not enabled for this token')
}
Inherited from
getLaneLatency()
getLaneLatency(
destChainSelector:bigint,numberOfBlocks?:number):Promise<LaneLatencyResponse>
Defined in: chain.ts:1606
Fetches estimated lane latency to a destination chain. Uses this chain's selector as the source.
Parameters
| Parameter | Type | Description |
|---|---|---|
destChainSelector | bigint | Destination CCIP chain selector (bigint) |
numberOfBlocks? | number | Optional number of block confirmations to use for latency calculation. When omitted or 0, uses the lane's default finality. When provided as a positive integer, the API returns latency for that custom finality value. |
Returns
Promise<LaneLatencyResponse>
Promise resolving to LaneLatencyResponse containing:
totalMs- Estimated delivery time in milliseconds
Throws
CCIPApiClientNotAvailableError if apiClient was disabled (set to null)
Throws
CCIPHttpError if API request fails (network error, 4xx, 5xx status)
Remarks
Each call makes a fresh API request. Consider caching results if making frequent calls for the same lane.
Examples
const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
try {
const latency = await chain.getLaneLatency(4949039107694359620n) // Arbitrum
console.log(`Estimated delivery: ${Math.round(latency.totalMs / 60000)} minutes`)
} catch (err) {
if (err instanceof CCIPHttpError) {
console.error(`API error: ${err.context.apiErrorCode}`)
}
}
const latency = await chain.getLaneLatency(4949039107694359620n, 10)
console.log(`Latency with 10 confirmations: ${Math.round(latency.totalMs / 60000)} minutes`)
Inherited from
getLogs()
Defined in: canton/index.ts:381
An async generator that yields logs based on the provided options.
Parameters
| Parameter | Type | Description |
|---|---|---|
_opts | LogFilter | Options object containing: - startBlock: fetch and generate logs forward starting from this block; required unless startTime is provided; explicit 0 is allowed - startTime: instead of a startBlock, a start timestamp may be provided; if either is provided, fetch logs forward from this starting point - endBlock: a fixed block height, finality tag or negative finality depth to stop iteration at; defaults to latest - endBefore: optional hint signature for end of iteration, instead of endBlock - address: if provided, fetch logs for this address only (may be required in some networks/implementations) - topics: if provided, fetch logs for these topics only; if string[], it's assumed to be a list of topic0s (i.e. string[] or string[][0], event_ids); some networks/implementations may not be able to filter topics other than topic0s, so one may want to assume those are optimization hints, instead of hard filters, and verify results - page: if provided, try to use this page/range for batches - watch: true or cancellation promise, stream logs after initial catch-up until endBlock finality tag (e.g. 'finalized'); requires endBlock to be a finality tag |
Returns
AsyncIterableIterator<ChainLog>
An async iterable iterator of logs.
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
getMessageById()
getMessageById(
messageId:string,_opts?: {onRamp?:string;page?:number; }):Promise<CCIPRequest<CCIPVersion>>
Defined in: chain.ts:904
Fetch a CCIP message by its unique message ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
messageId | string | The unique message ID (0x + 64 hex chars) |
_opts? | { onRamp?: string; page?: number; } | Optional: onRamp hint for non-EVM chains |
_opts.onRamp? | string | - |
_opts.page? | number | - |
Returns
Promise<CCIPRequest<CCIPVersion>>
CCIPRequest with metadata populated from API
Remarks
Uses the CCIP API to retrieve message details. The returned request includes
a metadata field with API-specific information.
Example
const request = await chain.getMessageById(messageId)
console.log(`Sender: ${request.message.sender}`)
if (request.metadata) {
console.log(`Status: ${request.metadata.status}`)
if (request.metadata.deliveryTime) {
console.log(`Delivered in ${request.metadata.deliveryTime}ms`)
}
}
Throws
CCIPApiClientNotAvailableError if API disabled
Throws
CCIPMessageIdNotFoundError if message not found
Throws
CCIPOnRampRequiredError if onRamp is required but not provided
Throws
CCIPHttpError if API request fails
Inherited from
getMessagesInBatch()
getMessagesInBatch<
R>(request:R,range:Pick<CommitReport,"minSeqNr"|"maxSeqNr">,opts?: {page?:number; }):Promise<R["message"][]>
Defined in: chain.ts:934
Fetches all CCIP messages contained in a given commit batch. To be implemented for chains supporting CCIPVersion v1.6.0 and earlier
Type Parameters
| Type Parameter |
|---|
R extends { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; log: { blockTimestamp: number; }; message: { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; }; } |
Parameters
| Parameter | Type | Description |
|---|---|---|
request | R | CCIPRequest to fetch batch for |
range | Pick<CommitReport, "minSeqNr" | "maxSeqNr"> | batch range { minSeqnr, maxSeqNr }, e.g. from CommitReport |
opts? | { page?: number; } | Optional parameters (e.g., page for pagination width) |
opts.page? | number | - |
Returns
Promise<R["message"][]>
Array of messages in the batch
Throws
CCIPMessageBatchIncompleteError if not all messages in range could be fetched
Example
const verifications = await dest.getVerifications({ offRamp, request })
const messages = await source.getMessagesInBatch(request, verifications.report)
console.log(`Found ${messages.length} messages in batch`)
Inherited from
getMessagesInRange()
getMessagesInRange(
opts:LogFilter):AsyncIterableIterator<CCIPRequest<CCIPVersion>>
Defined in: chain.ts:870
Discover and decode CCIP messages within a block/slot/checkpoint range.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | LogFilter | LogFilter options (startBlock, endBlock, address, topics, page) |
Returns
AsyncIterableIterator<CCIPRequest<CCIPVersion>>
Async iterator of CCIPRequest objects in native log order
Remarks
This is the range-scanning equivalent of getMessagesInTx. Results are yielded in native log order (block number + log index for EVM, slot order for Solana). Non-CCIP logs in the range are silently skipped.
On Solana, the address parameter is required (router program address).
On EVM, it is optional but recommended for public RPCs that require address filtering.
Throws
CCIPChainFamilyUnsupportedError if a pre-v1.6 message is found on a non-EVM chain
Throws
CCIPLogsAddressRequiredError on Solana if address is not provided (thrown by underlying Chain.getLogs)
See
- getMessagesInBatch - Batch discovery by sequence number range
- getMessagesInTx - Per-transaction message discovery
Example
for await (const request of chain.getMessagesInRange({
startBlock: 1000000,
endBlock: 1001000,
address: '0xOnRampAddress...', // optional on EVM
})) {
console.log(`seqNr=${request.message.sequenceNumber} dest=${request.lane.destChainSelector}`)
}
Inherited from
getMessagesInTx()
getMessagesInTx(
tx:string|ChainTransaction):Promise<CCIPRequest<CCIPVersion>[]>
Defined in: chain.ts:811
Fetch all CCIP requests in a transaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
tx | string | ChainTransaction | ChainTransaction or txHash to fetch requests from |
Returns
Promise<CCIPRequest<CCIPVersion>[]>
Promise resolving to CCIP messages in the transaction (at least one)
Throws
CCIPTransactionNotFoundError if transaction does not exist
Throws
CCIPMessageNotFoundInTxError if no CCIPSendRequested events in tx
Example
const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
const requests = await chain.getMessagesInTx('0xabc123...')
for (const req of requests) {
console.log(`Message ID: ${req.message.messageId}`)
}
Inherited from
getNativeTokenForRouter()
getNativeTokenForRouter(
_router:string):Promise<string>
Defined in: canton/index.ts:417
Returns Canton's default fee token.
Canton's default fee token is registry-level (not router-level): the Amulet instrument exposed by the token-metadata registry.
Parameters
| Parameter | Type |
|---|---|
_router | string |
Returns
Promise<string>
Overrides
getOffchainTokenData()
getOffchainTokenData(
request:CCIPRequest):Promise<OffchainTokenData[]>
Defined in: canton/index.ts:835
Fetch supported offchain token data for a request from this network. It logs but doesn't throw in case it can't fetch attestation, as the transfers may not be from the expected attestation providers. It returns default offchainData=undefined for those.
Parameters
| Parameter | Type | Description |
|---|---|---|
request | CCIPRequest | CCIP request, with tx.hash and message |
Returns
Promise<OffchainTokenData[]>
Promise resolving to array with one offchain token data for each token transfer
Overrides
getOffRampConfig()
getOffRampConfig(
_offRamp:string,_sourceChainSelector:bigint):Promise<OffRampConfig>
Defined in: canton/index.ts:404
Fetch the full OffRamp configuration for a given source chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
_offRamp | string | OffRamp contract address. |
_sourceChainSelector | bigint | Source chain selector. |
Returns
Promise<OffRampConfig>
Merged OffRamp config — at minimum router, onRamp, type, version, typeAndVersion.
Remarks
Returns a merged object containing every static (per-contract) and per-source
field exposed by the underlying contract. Concrete subclasses preserve the
contract-native field names and return richer objects than the
OffRampConfig base interface declares — they may include extra fields
available only on specific versions (e.g. EVM v2.0 exposes onRamps: string[]).
Overrides
getOffRampsForRouter()
getOffRampsForRouter(
_router:string,_sourceChainSelector:bigint):Promise<string[]>
Defined in: canton/index.ts:425
Fetch the OffRamps allowlisted in a Router. Used to discover OffRamp connected to an OnRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
_router | string | Router contract address |
_sourceChainSelector | bigint | Source chain selector |
Returns
Promise<string[]>
Promise resolving to array of OffRamp addresses
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
getOnRampConfig()
getOnRampConfig(
_onRamp:string,_destChainSelector:bigint):Promise<OnRampConfig>
Defined in: canton/index.ts:396
Fetch the full OnRamp configuration for a given destination chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
_onRamp | string | OnRamp contract address. |
_destChainSelector | bigint | Destination chain selector. |
Returns
Promise<OnRampConfig>
Merged OnRamp config — at minimum router, type, version, typeAndVersion.
Remarks
Returns a merged object containing every static (per-contract) and per-destination field exposed by the underlying contract. Concrete subclasses (e.g. EVMChain) preserve the contract-native field names and return richer objects than the OnRampConfig base interface declares — they may include extra fields available only on specific versions.
Overrides
getOnRampForRouter()
getOnRampForRouter(
_router:string,_destChainSelector:bigint):Promise<string>
Defined in: canton/index.ts:433
Fetch the OnRamp registered in a Router for a destination chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
_router | string | Router contract address |
_destChainSelector | bigint | Destination chain selector |
Returns
Promise<string>
Promise resolving to OnRamp address
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
getOnRampsForOffRamp()
getOnRampsForOffRamp(
offRamp:string,sourceChainSelector:bigint):Promise<string[]>
Defined in: chain.ts:1157
Fetch the OnRamps addresses set in OffRamp config. Used to discover OffRamp connected to an OnRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
offRamp | string | OffRamp contract address |
sourceChainSelector | bigint | Source chain selector |
Returns
Promise<string[]>
Promise resolving to OnRamps addresses
Remarks
Default implementation reads from Chain.getOffRampConfig; if the concrete
config exposes an onRamps: string[] (e.g. EVM v2.0 with multiple historical
OnRamps), it is returned as-is; otherwise [cfg.onRamp] is returned.
Example
const [onRamp] = await dest.getOnRampsForOffRamp(offRampAddress, sourceSelector)
console.log(`OnRamp: ${onRamp}`)
Inherited from
getRegistryTokenConfig()
getRegistryTokenConfig(
_registry:string,_token:string):Promise<RegistryTokenConfig>
Defined in: canton/index.ts:1268
Fetch token configuration from a TokenAdminRegistry.
Parameters
| Parameter | Type | Description |
|---|---|---|
_registry | string | TokenAdminRegistry contract address. |
_token | string | Token address to query. |
Returns
Promise<RegistryTokenConfig>
RegistryTokenConfig containing administrator and pool information.
Remarks
The TokenAdminRegistry is a contract that tracks token administrators and their associated pools. Each token has an administrator who can update pool configurations.
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
getRouterForOffRamp()
getRouterForOffRamp(
offRamp:string,sourceChainSelector:bigint):Promise<string>
Defined in: chain.ts:1091
Fetch the Router address set in OffRamp config.
Parameters
| Parameter | Type | Description |
|---|---|---|
offRamp | string | OffRamp contract address |
sourceChainSelector | bigint | Source chain selector |
Returns
Promise<string>
Promise resolving to Router address
Remarks
Default implementation reads .router from Chain.getOffRampConfig; subclasses
generally need not override this.
Throws
CCIPContractTypeInvalidError if address is not an OffRamp
Example
const router = await chain.getRouterForOffRamp(offRampAddress, sourceSelector)
console.log(`Router: ${router}`)
Inherited from
getRouterForOnRamp()
getRouterForOnRamp(
onRamp:string,destChainSelector:bigint):Promise<string>
Defined in: chain.ts:1069
Fetch the Router address set in OnRamp config. Used to discover OffRamp connected to OnRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
onRamp | string | OnRamp contract address |
destChainSelector | bigint | Destination chain selector |
Returns
Promise<string>
Promise resolving to Router address
Remarks
Default implementation reads .router from Chain.getOnRampConfig; subclasses
generally need not override this.
Throws
CCIPContractTypeInvalidError if address is not an OnRamp
Example
const router = await chain.getRouterForOnRamp(onRampAddress, destSelector)
console.log(`Router: ${router}`)
Inherited from
getSupportedTokens()
getSupportedTokens(
_address:string,_opts?: {page?:number; }):Promise<string[]>
Defined in: canton/index.ts:1260
List tokens supported by given TokenAdminRegistry contract.
Parameters
| Parameter | Type | Description |
|---|---|---|
_address | string | Usually TokenAdminRegistry, but chain may support receiving Router, OnRamp, etc. |
_opts? | { page?: number; } | Optional parameters (e.g., page for pagination range) |
_opts.page? | number | - |
Returns
Promise<string[]>
Promise resolving to array of supported token addresses
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
getTokenAdminRegistryFor()
getTokenAdminRegistryFor(
_address:string):Promise<string>
Defined in: canton/index.ts:462
Fetch TokenAdminRegistry configured in a given OnRamp, Router, etc. Needed to map a source token to its dest counterparts.
Parameters
| Parameter | Type | Description |
|---|---|---|
_address | string | Contract address (OnRamp, Router, etc.) |
Returns
Promise<string>
Promise resolving to TokenAdminRegistry address
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
Chain.getTokenAdminRegistryFor
getTokenForTokenPool()
getTokenForTokenPool(
tokenPool:string):Promise<string>
Defined in: chain.ts:1174
Fetch the TokenPool's token/mint.
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenPool | string | TokenPool address |
Returns
Promise<string>
Promise resolving to token or mint address
Example
const token = await chain.getTokenForTokenPool(tokenPoolAddress)
console.log(`Token: ${token}`)
Inherited from
getTokenInfo()
getTokenInfo(
token:string):Promise<{decimals:number;symbol:string; }>
Defined in: canton/index.ts:444
Returns token symbol and decimals for the given Canton fee token.
Looks up the instrument in the Canton token-metadata registry. token is
the full Canton fee-token string ("admin::id"); the registry is keyed by
the local id portion.
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
Promise<{ decimals: number; symbol: string; }>
Overrides
getTokenPoolConfig()
getTokenPoolConfig(
_tokenPool:string):Promise<TokenPoolConfig>
Defined in: canton/index.ts:1276
Fetch configuration of a token pool.
Parameters
| Parameter | Type | Description |
|---|---|---|
_tokenPool | string | Token pool contract address. |
Returns
Promise<TokenPoolConfig>
TokenPoolConfig containing token, router, version info, and optionally fee config.
Remarks
Return type varies by chain:
- EVM:
typeAndVersionis always present (required) - Solana: Includes extra
tokenPoolProgramfield - Aptos: Standard fields only
- Sui/TON: Throws CCIPNotImplementedError
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
getTokenPoolRemote()
getTokenPoolRemote(
tokenPool:string,remoteChainSelector:bigint):Promise<TokenPoolRemote>
Defined in: chain.ts:1907
Fetch remote chain configuration for a token pool for a specific destination.
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenPool | string | Token pool address on the current chain. |
remoteChainSelector | bigint | Chain selector of the desired remote chain. |
Returns
Promise<TokenPoolRemote>
TokenPoolRemote config for the specified remote chain.
Remarks
Convenience wrapper around getTokenPoolRemotes that returns a single configuration instead of a Record. Use this when you need configuration for a specific destination chain.
Example
const arbitrumSelector = 4949039107694359620n
const remote = await chain.getTokenPoolRemote(poolAddress, arbitrumSelector)
console.log(`Remote token: ${remote.remoteToken}`)
console.log(`Remote pools: ${remote.remotePools.join(', ')}`)
Throws
CCIPTokenPoolChainConfigNotFoundError if no configuration found for the specified remote chain.
Inherited from
getTokenPoolRemotes()
getTokenPoolRemotes(
_tokenPool:string,_remoteChainSelector?:bigint):Promise<Record<string,TokenPoolRemote>>
Defined in: canton/index.ts:1284
Fetch remote chain configurations for a token pool.
Parameters
| Parameter | Type | Description |
|---|---|---|
_tokenPool | string | Token pool address on the current chain. |
_remoteChainSelector? | bigint | Optional chain selector to filter results to a single destination. |
Returns
Promise<Record<string, TokenPoolRemote>>
Record where keys are chain names (e.g., "ethereum-mainnet") and values are TokenPoolRemote configs.
Remarks
A token pool maintains configurations for each destination chain it supports. The returned Record maps chain names to their respective configurations.
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
getTokenPrice()
getTokenPrice(
_opts: {router:string;timestamp?:number;token:string; }):Promise<TokenPrice>
Defined in: chain.ts:2066
Fetch the on-chain USD price of a token from the FeeQuoter or PriceRegistry.
Parameters
| Parameter | Type |
|---|---|
_opts | { router: string; timestamp?: number; token: string; } |
_opts.router | string |
_opts.timestamp? | number |
_opts.token | string |
Returns
Promise<TokenPrice>
Promise resolving to TokenPrice with the USD price per whole token.
Remarks
On EVM, the price contract is resolved via the Router's OnRamp:
PriceRegistry for v1.2/v1.5 lanes, FeeQuoter for v1.6+ lanes.
When timestamp is provided on EVM, the price is read at the
block closest to that timestamp (requires archive node).
On Solana and Aptos, the FeeQuoter is resolved directly from the
Router config; timestamp is not yet supported and will be ignored.
Throws
CCIPNotImplementedError if not implemented for this chain family
Example
const { price } = await chain.getTokenPrice({
router: routerAddress,
token: linkAddress,
})
console.log(`LINK: $${price.toFixed(2)}`)
Inherited from
getTotalFeesEstimate()
getTotalFeesEstimate(
_opts:Omit<SendMessageOpts,"approveMax">):Promise<TotalFeesEstimate>
Defined in: chain.ts:2032
Estimate total fees for a cross-chain message.
Returns two components:
- ccipFee: from
Router.getFee(), denominated in the message'sfeeToken(native token if omitted). Includes gas, DON costs, and FeeQuoter-level token transfer overhead (all CCIP versions). - tokenTransferFee: pool-level BPS fee deducted from the transferred
token amount (v2.0+ only). The recipient receives
amount - feeDeductedon the destination chain. Absent on pre-v2.0 lanes or data-only messages.
Parameters
| Parameter | Type | Description |
|---|---|---|
_opts | Omit<SendMessageOpts, "approveMax"> | SendMessageOpts without approveMax |
Returns
Promise<TotalFeesEstimate>
Promise resolving to TotalFeesEstimate
Throws
CCIPNotImplementedError if not implemented for this chain family
Inherited from
getTransaction()
getTransaction(
hash:string):Promise<ChainTransaction>
Defined in: canton/index.ts:326
Fetches a Canton transaction (update) by its update ID.
The ledger is queried via /v2/updates/transaction-by-id with a wildcard
party filter so that all visible events are returned without requiring a
known party ID.
Canton concepts are mapped to ChainTransaction fields as follows:
hash— the CantonupdateIdblockNumber— the ledgeroffsettimestamp—effectiveAtparsed to Unix secondsfrom— firstactingPartiesentry of the first exercised eventlogs— one ChainLog per transaction event
Parameters
| Parameter | Type | Description |
|---|---|---|
hash | string | The Canton update ID (transaction hash) to look up. |
Returns
Promise<ChainTransaction>
A ChainTransaction with events mapped to logs.
Overrides
getVerifications()
getVerifications(
opts: {offRamp:string;request: {lane: {destChainSelector:bigint;onRamp:string;sourceChainSelector:bigint;version:CCIPVersion; };log: {blockTimestamp:number; };message: {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; }; }; } &Pick<LogFilter,"page"|"startBlock"|"watch">):Promise<CCIPVerifications>
Defined in: canton/index.ts:1192
Fetches CCV verification results for a CCIP message from the Canton indexer.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { offRamp: string; request: { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; log: { blockTimestamp: number; }; message: { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; }; }; } & Pick<LogFilter, "page" | "startBlock" | "watch"> | Options that should only include the CCIP request with the message ID to query. |
Returns
Promise<CCIPVerifications>
CCIPVerifications with verification policy and individual verifier results.
Overrides
resolveExecuteOpts()
protectedresolveExecuteOpts(opts:ExecuteOpts):Promise<{input:ExecutionInput;offRamp:string; } & {forceBuffer?:boolean;forceLookupTable?:boolean;gasLimit?:number;tokensGasLimit?:number; }>
Defined in: chain.ts:1404
Resolves ExecuteOpts that may contain a messageId (API shorthand) into the
canonical { offRamp, input } form required by generateUnsignedExecute.
When opts already contains input the method is a no-op and returns it unchanged.
When opts contains only a messageId it calls apiClient.getExecutionInput and merges
the result back with any extra opts fields (e.g. gasLimit).
If opts.gasLimit is undefined and estimateReceiveExecution is available, try to estimate gasLimitOverride
Parameters
| Parameter | Type |
|---|---|
opts | ExecuteOpts |
Returns
Promise<{ input: ExecutionInput; offRamp: string; } & { forceBuffer?: boolean; forceLookupTable?: boolean; gasLimit?: number; tokensGasLimit?: number; }>
Throws
CCIPApiClientNotAvailableError if messageId is provided but no apiClient
Inherited from
sendMessage()
sendMessage(
opts:SendMessageOpts& {wallet:unknown; }):Promise<CCIPRequest<CCIPVersion>>
Defined in: canton/index.ts:754
Send a CCIP message through a router using provided wallet.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | SendMessageOpts & { wallet: unknown; } | SendMessageOpts with chain-specific wallet for signing |
Returns
Promise<CCIPRequest<CCIPVersion>>
Promise resolving to CCIP request with message details
Overrides
typeAndVersion()
typeAndVersion(
_address:string):Promise<[string,string,string,string]>
Defined in: canton/index.ts:389
Fetch typeAndVersion for a given CCIP contract address.
Parameters
| Parameter | Type | Description |
|---|---|---|
_address | string | CCIP contract address |
Returns
Promise<[string, string, string, string]>
Promise resolving to tuple:
type- Parsed type of the contract, e.g.OnRampversion- Parsed version of the contract, e.g.1.6.0typeAndVersion- Original (unparsed) typeAndVersion() stringsuffix- Suffix of the version, if any (e.g.-dev)
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
Overrides
waitFinalized()
waitFinalized(
opts: {abort?:AbortSignal;finality?:number|"finalized"|"latest";pollIntervalMs?:number;reorgSafetyBlocks?:number;request: {log: {blockTimestamp:number; }; }; }):Promise<BlockInfo>
Defined in: chain.ts:752
Confirm a log tx is finalized or wait for it to be finalized.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { abort?: AbortSignal; finality?: number | "finalized" | "latest"; pollIntervalMs?: number; reorgSafetyBlocks?: number; request: { log: { blockTimestamp: number; }; }; } | Options containing the request, finality level, and optional cancel promise |
opts.abort? | AbortSignal | - |
opts.finality? | number | "finalized" | "latest" | - |
opts.pollIntervalMs? | number | Delay in ms between block-height poller iterations. Default: 5000 |
opts.reorgSafetyBlocks? | number | How many blocks past the original tx blockNumber must be finalized without the tx reappearing before we declare it reorged out. Default: 10 |
opts.request | { log: { blockTimestamp: number; }; } | - |
opts.request.log | { blockTimestamp: number; } | - |
opts.request.log.blockTimestamp | number | - |
Returns
Promise<BlockInfo>
Some block info at or after tx finalization
Throws
CCIPTransactionNotFinalizedError if the transaction is not included (e.g., due to a reorg)
Example
const request = await source.getMessagesInTx(txHash)
try {
await source.waitFinalized({ request: request[0] })
console.log('Transaction finalized')
} catch (err) {
if (err instanceof CCIPTransactionNotFinalizedError) {
console.log('Transaction not yet finalized')
}
}
Inherited from
buildMessageForDest()
staticbuildMessageForDest(message:MessageInput):AnyMessage
Defined in: canton/index.ts:1526
Build a message targeted at this Canton destination chain, populating missing fields.
Parameters
| Parameter | Type |
|---|---|
message | MessageInput |
Returns
AnyMessage
Overrides
Chain.buildMessageForDest
decodeCommits()
staticdecodeCommits(_log:Pick<ChainLog,"data">,_lane?:Lane<CCIPVersion>): {maxSeqNr:bigint;merkleRoot:string;minSeqNr:bigint;onRampAddress:string;sourceChainSelector:bigint; }[] |undefined
Defined in: canton/index.ts:1478
Try to decode a commit report from a Canton log.
Parameters
| Parameter | Type |
|---|---|
_log | Pick<ChainLog, "data"> |
_lane? | Lane<CCIPVersion> |
Returns
{ maxSeqNr: bigint; merkleRoot: string; minSeqNr: bigint; onRampAddress: string; sourceChainSelector: bigint; }[] | undefined
undefined (Canton commit format not yet supported)
decodeExtraArgs()
staticdecodeExtraArgs(_extraArgs:BytesLike):undefined
Defined in: canton/index.ts:1461
Try to decode extra args serialized for Canton.
Parameters
| Parameter | Type |
|---|---|
_extraArgs | BytesLike |
Returns
undefined
undefined (Canton extra args format not yet supported)
decodeMessage()
staticdecodeMessage(_log:Pick<ChainLog,"data">):CCIPMessage|undefined
Defined in: canton/index.ts:1452
Try to decode a CCIP message from a Canton log/event.
Parameters
| Parameter | Type |
|---|---|
_log | Pick<ChainLog, "data"> |
Returns
CCIPMessage | undefined
undefined (Canton message format not yet supported)
decodeReceipt()
staticdecodeReceipt(_log:Pick<ChainLog,"data">):ExecutionReceipt|undefined
Defined in: canton/index.ts:1487
Try to decode an execution receipt from a Canton log.
Parameters
| Parameter | Type |
|---|---|
_log | Pick<ChainLog, "data"> |
Returns
ExecutionReceipt | undefined
undefined (Canton receipt format not yet supported)
encodeExtraArgs()
staticencodeExtraArgs(_extraArgs:ExtraArgs):string
Defined in: canton/index.ts:1470
Encode extraArgs for Canton.
Parameters
| Parameter | Type |
|---|---|
_extraArgs | ExtraArgs |
Returns
string
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
fromClient()
staticfromClient(client: {executeSubmissionAndWaitForTransaction:Promise<{transaction: {commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }; }>;getActiveContracts:Promise<{contractEntry?: {JsActiveContract: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };reassignmentCounter:number;synchronizerId:string; }; } | {JsEmpty:Record<string,never>; } | {JsIncompleteAssigned: {assignedEvent: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: ...[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };reassignmentCounter:number;reassignmentId:string;source:string;submitter?:string;target:string; }; }; } | {JsIncompleteUnassigned: {createdEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; };unassignedEvent: {assignmentExclusivity?:string;contractId:string;nodeId:number;offset:number;packageName:string;reassignmentCounter:number;reassignmentId:string;source:string;submitter?:string;target:string;templateId:string;witnessParties:string[]; }; }; };workflowId?:string; }[]>;getConnectedSynchronizers:Promise<{permission:"PARTICIPANT_PERMISSION_CONFIRMATION"|"PARTICIPANT_PERMISSION_OBSERVATION"|"PARTICIPANT_PERMISSION_SUBMISSION"|"PARTICIPANT_PERMISSION_UNSPECIFIED";synchronizerAlias:string;synchronizerId:string; }[]>;getLedgerEnd:Promise<{offset:number; }>;getParticipantId:Promise<string>;getTransactionById:Promise<{commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ... | ...;interfaceId:string;viewStatus: {code: ...;details?: ...;message: ...; };viewValue?:unknown; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }>;getUpdateById:Promise<unknown>;isAlive:Promise<boolean>;isReady:Promise<boolean>;listParties:Promise<unknown[] |undefined>;prepareSubmission:Promise<{costEstimation?: {confirmationRequestTrafficCostEstimation?:number;confirmationResponseTrafficCostEstimation?:number;estimationTimestamp?:string;totalTrafficCostEstimation?:number; };hashingDetails?:string;hashingSchemeVersion?:"HASHING_SCHEME_VERSION_UNSPECIFIED"|"HASHING_SCHEME_VERSION_V2"|"HASHING_SCHEME_VERSION_V3";preparedTransaction?:string;preparedTransactionHash?:string; }>;submitAndWait:Promise<{completionOffset:number;updateId:string; }>;submitAndWaitForTransaction:Promise<{transaction: {commandId?:string;effectiveAt:string;events: ({ArchivedEvent: {contractId:string;implementedInterfaces?:string[];nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; } | {CreatedEvent: {acsDelta:boolean;contractId:string;contractKey?:unknown;createArgument:unknown;createdAt:string;createdEventBlob?:string;interfaceViews?: {implementationPackageId?: ...;interfaceId: ...;viewStatus: ...;viewValue?: ...; }[];nodeId:number;observers:string[];offset:number;packageName:string;representativePackageId:string;signatories:string[];templateId:string;witnessParties:string[]; }; } | {ExercisedEvent: {acsDelta:boolean;actingParties:string[];choice:string;choiceArgument:unknown;consuming:boolean;contractId:string;exerciseResult:unknown;implementedInterfaces?:string[];interfaceId?:string;lastDescendantNodeId:number;nodeId:number;offset:number;packageName:string;templateId:string;witnessParties:string[]; }; })[];externalTransactionHash?:string;offset:number;recordTime:string;synchronizerId:string;traceContext?: {traceparent?:string;tracestate?:string; };updateId:string;workflowId?:string; }; }>; },acsDisclosureProvider:AcsDisclosureProvider,edsDisclosureProvider:EdsDisclosureProvider,transferInstructionClient: {getAcceptContext:Promise<ChoiceContext>;getRejectContext:Promise<ChoiceContext>;getTransferFactory:Promise<TransferFactoryWithChoiceContext>;getWithdrawContext:Promise<ChoiceContext>; },tokenMetadataClient: {getInstrument:Promise<Instrument>;getRegistryInfo:Promise<GetRegistryInfoResponse>;listInstruments:Promise<ListInstrumentsResponse>; },ccipParty:string,indexerUrl?:string,ctx?:ChainContext):Promise<CantonChain>
Defined in: canton/index.ts:178
Detect the Canton network and instantiate a CantonChain.
Network detection works by querying the connected synchronizers via
/v2/state/connected-synchronizers and matching the synchronizerAlias of the
first recognised synchronizer against the known Canton chain names.
Parameters
| Parameter | Type | Default value |
|---|---|---|
client | { executeSubmissionAndWaitForTransaction: Promise<{ transaction: { commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: string; implementedInterfaces?: string[]; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; } | { CreatedEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; } | { ExercisedEvent: { acsDelta: boolean; actingParties: string[]; choice: string; choiceArgument: unknown; consuming: boolean; contractId: string; exerciseResult: unknown; implementedInterfaces?: string[]; interfaceId?: string; lastDescendantNodeId: number; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; })[]; externalTransactionHash?: string; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }; }>; getActiveContracts: Promise<{ contractEntry?: { JsActiveContract: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; reassignmentCounter: number; synchronizerId: string; }; } | { JsEmpty: Record<string, never>; } | { JsIncompleteAssigned: { assignedEvent: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: ...[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; reassignmentCounter: number; reassignmentId: string; source: string; submitter?: string; target: string; }; }; } | { JsIncompleteUnassigned: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; unassignedEvent: { assignmentExclusivity?: string; contractId: string; nodeId: number; offset: number; packageName: string; reassignmentCounter: number; reassignmentId: string; source: string; submitter?: string; target: string; templateId: string; witnessParties: string[]; }; }; }; workflowId?: string; }[]>; getConnectedSynchronizers: Promise<{ permission: "PARTICIPANT_PERMISSION_CONFIRMATION" | "PARTICIPANT_PERMISSION_OBSERVATION" | "PARTICIPANT_PERMISSION_SUBMISSION" | "PARTICIPANT_PERMISSION_UNSPECIFIED"; synchronizerAlias: string; synchronizerId: string; }[]>; getLedgerEnd: Promise<{ offset: number; }>; getParticipantId: Promise<string>; getTransactionById: Promise<{ commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: string; implementedInterfaces?: string[]; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; } | { CreatedEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ... | ...; interfaceId: string; viewStatus: { code: ...; details?: ...; message: ...; }; viewValue?: unknown; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; } | { ExercisedEvent: { acsDelta: boolean; actingParties: string[]; choice: string; choiceArgument: unknown; consuming: boolean; contractId: string; exerciseResult: unknown; implementedInterfaces?: string[]; interfaceId?: string; lastDescendantNodeId: number; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; })[]; externalTransactionHash?: string; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }>; getUpdateById: Promise<unknown>; isAlive: Promise<boolean>; isReady: Promise<boolean>; listParties: Promise<unknown[] | undefined>; prepareSubmission: Promise<{ costEstimation?: { confirmationRequestTrafficCostEstimation?: number; confirmationResponseTrafficCostEstimation?: number; estimationTimestamp?: string; totalTrafficCostEstimation?: number; }; hashingDetails?: string; hashingSchemeVersion?: "HASHING_SCHEME_VERSION_UNSPECIFIED" | "HASHING_SCHEME_VERSION_V2" | "HASHING_SCHEME_VERSION_V3"; preparedTransaction?: string; preparedTransactionHash?: string; }>; submitAndWait: Promise<{ completionOffset: number; updateId: string; }>; submitAndWaitForTransaction: Promise<{ transaction: { commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: string; implementedInterfaces?: string[]; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; } | { CreatedEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: { implementationPackageId?: ...; interfaceId: ...; viewStatus: ...; viewValue?: ...; }[]; nodeId: number; observers: string[]; offset: number; packageName: string; representativePackageId: string; signatories: string[]; templateId: string; witnessParties: string[]; }; } | { ExercisedEvent: { acsDelta: boolean; actingParties: string[]; choice: string; choiceArgument: unknown; consuming: boolean; contractId: string; exerciseResult: unknown; implementedInterfaces?: string[]; interfaceId?: string; lastDescendantNodeId: number; nodeId: number; offset: number; packageName: string; templateId: string; witnessParties: string[]; }; })[]; externalTransactionHash?: string; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }; }>; } | undefined |
client.executeSubmissionAndWaitForTransaction | undefined | |
client.getActiveContracts | undefined | |
client.getConnectedSynchronizers | undefined | |
client.getLedgerEnd | undefined | |
client.getParticipantId | undefined | |
client.getTransactionById | undefined | |
client.getUpdateById | undefined | |
client.isAlive? | undefined | |
client.isReady? | undefined | |
client.listParties? | undefined | |
client.prepareSubmission? | undefined | |
client.submitAndWait? | undefined | |
client.submitAndWaitForTransaction? | undefined | |
acsDisclosureProvider? | AcsDisclosureProvider | undefined |
edsDisclosureProvider? | EdsDisclosureProvider | undefined |
transferInstructionClient? | { getAcceptContext: Promise<ChoiceContext>; getRejectContext: Promise<ChoiceContext>; getTransferFactory: Promise<TransferFactoryWithChoiceContext>; getWithdrawContext: Promise<ChoiceContext>; } | undefined |
transferInstructionClient.getAcceptContext? | undefined | |
transferInstructionClient.getRejectContext? | undefined | |
transferInstructionClient.getTransferFactory? | undefined | |
transferInstructionClient.getWithdrawContext? | undefined | |
tokenMetadataClient? | { getInstrument: Promise<Instrument>; getRegistryInfo: Promise<GetRegistryInfoResponse>; listInstruments: Promise<ListInstrumentsResponse>; } | undefined |
tokenMetadataClient.getInstrument? | undefined | |
tokenMetadataClient.getRegistryInfo? | undefined | |
tokenMetadataClient.listInstruments? | undefined | |
ccipParty? | string | undefined |
indexerUrl? | string | CCV_INDEXER_URL |
ctx? | ChainContext | undefined |
Returns
Promise<CantonChain>
Throws
CCIPChainNotFoundError if no connected synchronizer alias maps to a known Canton chain
fromUrl()
staticfromUrl(url:string,ctx?:ChainContext):Promise<CantonChain>
Defined in: canton/index.ts:248
Creates a CantonChain instance from a Canton Ledger JSON API URL. Verifies the connection and detects the network.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Base URL for the Canton Ledger JSON API (e.g., http://localhost:7575). |
ctx? | ChainContext | Context containing logger. |
Returns
Promise<CantonChain>
A new CantonChain instance.
Throws
CCIPHttpError if connection to the Canton Ledger JSON API fails
Throws
CCIPNotImplementedError if Canton network detection is not yet implemented
getAddress()
staticgetAddress(bytes:BytesLike):string
Defined in: canton/index.ts:1499
Receive bytes and try to decode as a Canton address (Daml party ID or contract ID).
Parameters
| Parameter | Type | Description |
|---|---|---|
bytes | BytesLike | Bytes or string to convert. |
Returns
string
Canton address string.
Throws
CCIPNotImplementedError if bytes cannot be decoded as a Canton address
getDestLeafHasher()
staticgetDestLeafHasher(_lane:Lane,_ctx?:WithLogger):LeafHasher
Defined in: canton/index.ts:1519
Gets the leaf hasher for Canton destination chains.
Parameters
| Parameter | Type |
|---|---|
_lane | Lane |
_ctx? | WithLogger |
Returns
LeafHasher
Throws
CCIPNotImplementedError always (not yet implemented for Canton)
isTxHash()
staticisTxHash(v:unknown):v is string
Defined in: canton/index.ts:1509
Validates a transaction (update) ID format for Canton. Canton update IDs are base64-encoded strings.
Parameters
| Parameter | Type |
|---|---|
v | unknown |
Returns
v is string