Skip to main content
Version: 1.17.0

Class: CantonChain

Defined in: canton/index.ts:233

Canton chain implementation supporting Canton Ledger networks.

Extends​

Indexable​

[key: symbol]: () => string

Properties​

abort​

readonly abort: AbortSignal

Defined in: chain.ts:1076

Fires when the chain should tear down: either Chain.destroy was called, or the ChainContext abort signal fired. Listeners registered with { once: true } therefore self-unregister on whichever condition happens first, so no listener ever outlives its chain on a long-lived context.

Inherited from​

Chain.abort


activeParty​

activeParty: PartyId

Defined in: canton/index.ts:247


apiClient​

readonly apiClient: CCIPAPIClient | null

Defined in: chain.ts:1063

CCIP API client (null if opted out)

Inherited from​

Chain.apiClient


apiRetryConfig​

readonly apiRetryConfig: Required<ApiRetryConfig> | null

Defined in: chain.ts:1065

Retry configuration for API fallback operations (null if API client is disabled)

Inherited from​

Chain.apiRetryConfig


ccipParty​

readonly ccipParty: PartyId

Defined in: canton/index.ts:259


destroy​

destroy: (reason?: unknown) => void

Defined in: chain.ts:1128

Cleanup method to release resources (e.g., close connections).

Parameters​

ParameterType
reason?unknown

Returns​

void

Inherited from​

Chain.destroy


disableAutomaticContractCreation​

readonly disableAutomaticContractCreation: boolean

Defined in: canton/index.ts:257


edsClientProvider​

readonly edsClientProvider: EdsClientProvider

Defined in: canton/index.ts:250


indexerUrl​

readonly indexerUrl: string

Defined in: canton/index.ts:258


ledgerApiClient​

readonly ledgerApiClient: { getActiveContracts(request: { activeAtOffset: number; eventFormat: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: { Empty: Record<..., ...>; } | { InterfaceFilter: { value: ...; }; } | { TemplateFilter: { value: ...; }; } | { WildcardFilter: { value: ...; }; }; }[]; }; verbose?: boolean; }; streamContinuationToken?: string; }): Promise<{ contractEntry?: { JsActiveContract: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; contractKeyHash?: string; 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; contractKeyHash?: string; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: ...[]; nodeId: number; observers?: ...[]; 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; contractKeyHash?: string; 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[]; }; }; }; streamContinuationToken?: string; workflowId?: string; }[]>; getLedgerEnd(): Promise<{ offset?: number; synchronizerTimes?: { recordTime: string; synchronizerId: string; }[]; }>; getUpdateById(updateId: string, updateFormat?: { includeReassignments?: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; verbose?: boolean; }; includeTopologyEvents?: { includeParticipantAuthorizationEvents?: { parties?: string[]; }; }; includeTransactions?: { eventFormat: { filtersByParty?: {[key: string]: { cumulative?: ...[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ...; }[]; }; verbose?: boolean; }; transactionShape: "TRANSACTION_SHAPE_UNSPECIFIED" | "TRANSACTION_SHAPE_ACS_DELTA" | "TRANSACTION_SHAPE_LEDGER_EFFECTS"; }; }): Promise<{ update?: { OffsetCheckpoint: { value: { offset: number; synchronizerTimes?: { recordTime: string; synchronizerId: string; }[]; }; }; } | { Reassignment: { value: { commandId?: string; events: ({ JsAssignmentEvent: { createdEvent: ...; reassignmentCounter: ...; reassignmentId: ...; source: ...; submitter: ...; target: ...; }; } | { JsUnassignedEvent: { value: ...; }; })[]; offset: number; paidTrafficCost?: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }; }; } | { TopologyTransaction: { value: { events: { event?: { Empty: ...; } | { ParticipantAuthorizationAdded: ...; } | { ParticipantAuthorizationChanged: ...; } | { ParticipantAuthorizationOnboarding: ...; } | { ParticipantAuthorizationRevoked: ...; }; }[]; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; }; }; } | { Transaction: { value: { commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: ...; implementedInterfaces?: ...; nodeId: ...; offset: ...; packageName: ...; templateId: ...; witnessParties: ...; }; } | { CreatedEvent: { acsDelta: ...; contractId: ...; contractKey?: ...; contractKeyHash?: ...; createArgument: ...; createdAt: ...; createdEventBlob?: ...; interfaceViews?: ...; nodeId: ...; observers?: ...; offset: ...; packageName: ...; representativePackageId: ...; signatories: ...; templateId: ...; witnessParties: ...; }; } | { ExercisedEvent: { acsDelta: ...; actingParties: ...; choice: ...; choiceArgument: ...; consuming: ...; contractId: ...; exerciseResult?: ...; implementedInterfaces?: ...; interfaceId?: ...; lastDescendantNodeId: ...; nodeId: ...; offset: ...; packageName: ...; templateId: ...; witnessParties: ...; }; })[]; externalTransactionHash?: string; offset: number; paidTrafficCost?: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; transactionHash?: string; updateId: string; workflowId?: string; }; }; }; }>; }

Defined in: canton/index.ts:246

getActiveContracts()​

getActiveContracts(request: { activeAtOffset: number; eventFormat: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: { Empty: Record<..., ...>; } | { InterfaceFilter: { value: ...; }; } | { TemplateFilter: { value: ...; }; } | { WildcardFilter: { value: ...; }; }; }[]; }; verbose?: boolean; }; streamContinuationToken?: string; }): Promise<{ contractEntry?: { JsActiveContract: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; contractKeyHash?: string; 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; contractKeyHash?: string; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: ...[]; nodeId: number; observers?: ...[]; 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; contractKeyHash?: string; 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[]; }; }; }; streamContinuationToken?: string; workflowId?: string; }[]>

Parameters​
ParameterTypeDescription
request{ activeAtOffset: number; eventFormat: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: { Empty: Record<..., ...>; } | { InterfaceFilter: { value: ...; }; } | { TemplateFilter: { value: ...; }; } | { WildcardFilter: { value: ...; }; }; }[]; }; verbose?: boolean; }; streamContinuationToken?: string; }-
request.activeAtOffsetnumberFormat: 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. Must be a valid absolute offset (positive integer) or ledger begin offset (zero). If zero, the empty set will be returned. Required
request.eventFormat{ filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: { Empty: ...; } | { InterfaceFilter: ...; } | { TemplateFilter: ...; } | { WildcardFilter: ...; }; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: { Empty: Record<..., ...>; } | { InterfaceFilter: { value: ...; }; } | { TemplateFilter: { value: ...; }; } | { WildcardFilter: { value: ...; }; }; }[]; }; verbose?: boolean; }Description Format of the contract_entries in the result. In case of CreatedEvent the presentation will be of TRANSACTION_SHAPE_ACS_DELTA. Required
request.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: can be empty
request.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
request.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. If no CumulativeFilter defined, the default of a single WildcardFilter with include_created_event_blob unset is used. Optional: can be empty
request.eventFormat.verbose?booleanDescription 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.streamContinuationToken?stringDescription Opaque representation of a continuation token defining a position in the active contracts snapshot. The prefix of the active contracts snapshot will be omitted up to and including the element from which the continuation token was read. To reuse the continuation token from a GetActiveContractsPageResponse: - subsequent request must be executed on the same participant with the same version of canton, - subsequent request must have the same active_at_offset, - subsequent request must have the same event_format - and the participant must not have been pruned after the active_at_offset. If not specified, the whole active contracts snapshot will be returned. Optional: can be empty
Returns​

Promise<{ contractEntry?: { JsActiveContract: { createdEvent: { acsDelta: boolean; contractId: string; contractKey?: unknown; contractKeyHash?: string; 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; contractKeyHash?: string; createArgument: unknown; createdAt: string; createdEventBlob?: string; interfaceViews?: ...[]; nodeId: number; observers?: ...[]; 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; contractKeyHash?: string; 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[]; }; }; }; streamContinuationToken?: string; workflowId?: string; }[]>

getLedgerEnd()​

getLedgerEnd(): Promise<{ offset?: number; synchronizerTimes?: { recordTime: string; synchronizerId: string; }[]; }>

Returns​

Promise<{ offset?: number; synchronizerTimes?: { recordTime: string; synchronizerId: string; }[]; }>

getUpdateById()​

getUpdateById(updateId: string, updateFormat?: { includeReassignments?: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; verbose?: boolean; }; includeTopologyEvents?: { includeParticipantAuthorizationEvents?: { parties?: string[]; }; }; includeTransactions?: { eventFormat: { filtersByParty?: {[key: string]: { cumulative?: ...[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ...; }[]; }; verbose?: boolean; }; transactionShape: "TRANSACTION_SHAPE_UNSPECIFIED" | "TRANSACTION_SHAPE_ACS_DELTA" | "TRANSACTION_SHAPE_LEDGER_EFFECTS"; }; }): Promise<{ update?: { OffsetCheckpoint: { value: { offset: number; synchronizerTimes?: { recordTime: string; synchronizerId: string; }[]; }; }; } | { Reassignment: { value: { commandId?: string; events: ({ JsAssignmentEvent: { createdEvent: ...; reassignmentCounter: ...; reassignmentId: ...; source: ...; submitter: ...; target: ...; }; } | { JsUnassignedEvent: { value: ...; }; })[]; offset: number; paidTrafficCost?: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }; }; } | { TopologyTransaction: { value: { events: { event?: { Empty: ...; } | { ParticipantAuthorizationAdded: ...; } | { ParticipantAuthorizationChanged: ...; } | { ParticipantAuthorizationOnboarding: ...; } | { ParticipantAuthorizationRevoked: ...; }; }[]; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; }; }; } | { Transaction: { value: { commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: ...; implementedInterfaces?: ...; nodeId: ...; offset: ...; packageName: ...; templateId: ...; witnessParties: ...; }; } | { CreatedEvent: { acsDelta: ...; contractId: ...; contractKey?: ...; contractKeyHash?: ...; createArgument: ...; createdAt: ...; createdEventBlob?: ...; interfaceViews?: ...; nodeId: ...; observers?: ...; offset: ...; packageName: ...; representativePackageId: ...; signatories: ...; templateId: ...; witnessParties: ...; }; } | { ExercisedEvent: { acsDelta: ...; actingParties: ...; choice: ...; choiceArgument: ...; consuming: ...; contractId: ...; exerciseResult?: ...; implementedInterfaces?: ...; interfaceId?: ...; lastDescendantNodeId: ...; nodeId: ...; offset: ...; packageName: ...; templateId: ...; witnessParties: ...; }; })[]; externalTransactionHash?: string; offset: number; paidTrafficCost?: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; transactionHash?: string; updateId: string; workflowId?: string; }; }; }; }>

Parameters​
ParameterTypeDescription
updateIdstring-
updateFormat?{ includeReassignments?: { filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; verbose?: boolean; }; includeTopologyEvents?: { includeParticipantAuthorizationEvents?: { parties?: string[]; }; }; includeTransactions?: { eventFormat: { filtersByParty?: {[key: string]: { cumulative?: ...[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ...; }[]; }; verbose?: boolean; }; transactionShape: "TRANSACTION_SHAPE_UNSPECIFIED" | "TRANSACTION_SHAPE_ACS_DELTA" | "TRANSACTION_SHAPE_LEDGER_EFFECTS"; }; }-
updateFormat.includeReassignments?{ filtersByParty?: {[key: string]: { cumulative?: { identifierFilter?: ...; }[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ... | ... | ... | ... | ...; }[]; }; verbose?: boolean; }Description Include (un)assignments in the stream. The events in the result take the shape TRANSACTION_SHAPE_ACS_DELTA. If unset, no (un)assignments are emitted in the stream. Optional
updateFormat.includeReassignments.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: can be empty
updateFormat.includeReassignments.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
updateFormat.includeReassignments.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. If no CumulativeFilter defined, the default of a single WildcardFilter with include_created_event_blob unset is used. Optional: can be empty
updateFormat.includeReassignments.verbose?booleanDescription 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
updateFormat.includeTopologyEvents?{ includeParticipantAuthorizationEvents?: { parties?: string[]; }; }Description Include topology events in streams. If unset no topology events are emitted in the stream. Optional
updateFormat.includeTopologyEvents.includeParticipantAuthorizationEvents?{ parties?: string[]; }Description Include participant authorization topology events in streams. If unset, no participant authorization topology events are emitted in the stream. Optional
updateFormat.includeTopologyEvents.includeParticipantAuthorizationEvents.parties?string[]Description List of parties for which the topology transactions should be sent. Empty means: for all parties. Optional: can be empty
updateFormat.includeTransactions?{ eventFormat: { filtersByParty?: {[key: string]: { cumulative?: ...[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ...; }[]; }; verbose?: boolean; }; transactionShape: "TRANSACTION_SHAPE_UNSPECIFIED" | "TRANSACTION_SHAPE_ACS_DELTA" | "TRANSACTION_SHAPE_LEDGER_EFFECTS"; }Description Include Daml transactions in streams. If unset, no transactions are emitted in the stream. Optional
updateFormat.includeTransactions.eventFormat{ filtersByParty?: {[key: string]: { cumulative?: ...[]; }; }; filtersForAnyParty?: { cumulative?: { identifierFilter?: ...; }[]; }; verbose?: boolean; }Description Required
updateFormat.includeTransactions.eventFormat.filtersByParty?{[key: string]: { cumulative?: ...[]; }; }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: can be empty
updateFormat.includeTransactions.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
updateFormat.includeTransactions.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. If no CumulativeFilter defined, the default of a single WildcardFilter with include_created_event_blob unset is used. Optional: can be empty
updateFormat.includeTransactions.eventFormat.verbose?booleanDescription 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
updateFormat.includeTransactions.transactionShape"TRANSACTION_SHAPE_UNSPECIFIED" | "TRANSACTION_SHAPE_ACS_DELTA" | "TRANSACTION_SHAPE_LEDGER_EFFECTS"Description What transaction shape to use for interpreting the filters of the event format. Required
Returns​

Promise<{ update?: { OffsetCheckpoint: { value: { offset: number; synchronizerTimes?: { recordTime: string; synchronizerId: string; }[]; }; }; } | { Reassignment: { value: { commandId?: string; events: ({ JsAssignmentEvent: { createdEvent: ...; reassignmentCounter: ...; reassignmentId: ...; source: ...; submitter: ...; target: ...; }; } | { JsUnassignedEvent: { value: ...; }; })[]; offset: number; paidTrafficCost?: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; workflowId?: string; }; }; } | { TopologyTransaction: { value: { events: { event?: { Empty: ...; } | { ParticipantAuthorizationAdded: ...; } | { ParticipantAuthorizationChanged: ...; } | { ParticipantAuthorizationOnboarding: ...; } | { ParticipantAuthorizationRevoked: ...; }; }[]; offset: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; updateId: string; }; }; } | { Transaction: { value: { commandId?: string; effectiveAt: string; events: ({ ArchivedEvent: { contractId: ...; implementedInterfaces?: ...; nodeId: ...; offset: ...; packageName: ...; templateId: ...; witnessParties: ...; }; } | { CreatedEvent: { acsDelta: ...; contractId: ...; contractKey?: ...; contractKeyHash?: ...; createArgument: ...; createdAt: ...; createdEventBlob?: ...; interfaceViews?: ...; nodeId: ...; observers?: ...; offset: ...; packageName: ...; representativePackageId: ...; signatories: ...; templateId: ...; witnessParties: ...; }; } | { ExercisedEvent: { acsDelta: ...; actingParties: ...; choice: ...; choiceArgument: ...; consuming: ...; contractId: ...; exerciseResult?: ...; implementedInterfaces?: ...; interfaceId?: ...; lastDescendantNodeId: ...; nodeId: ...; offset: ...; packageName: ...; templateId: ...; witnessParties: ...; }; })[]; externalTransactionHash?: string; offset: number; paidTrafficCost?: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; transactionHash?: string; updateId: string; workflowId?: string; }; }; }; }>


logger​

logger: Logger

Defined in: chain.ts:1061

Inherited from​

Chain.logger


nativeToken​

readonly nativeToken: CantonTokenInfo

Defined in: canton/index.ts:260


network​

readonly network: NetworkInfo<"CANTON">

Defined in: canton/index.ts:241

Overrides​

Chain.network


provider​

readonly provider: CantonRpcProvider

Defined in: canton/index.ts:245


tokenStandardClientProvider​

readonly tokenStandardClientProvider: TokenStandardClientProvider

Defined in: canton/index.ts:252


verificationsIndexer?​

readonly optional verificationsIndexer?: readonly string[]

Defined in: chain.ts:1067

Default CCIP v2 indexer base URLs for getVerifications (undefined → network defaults)

Inherited from​

Chain.verificationsIndexer


verifierTransport?​

readonly optional verifierTransport?: VerifierTransport

Defined in: chain.ts:1069

Transport for direct verifier reads (undefined → grpc-web over fetch)

Inherited from​

Chain.verifierTransport


decimals​

readonly static decimals: 10 = CANTON_DECIMALS

Defined in: canton/index.ts:239

Canton uses 10 decimals (lf-coin micro-units)


family​

readonly static family: "CANTON" = ChainFamily.Canton

Defined in: canton/index.ts:237

Methods​

createCCIPReceiver()​

createCCIPReceiver(finality: FinalityRequested, ccvs: RawInstanceAddress[]): Promise<CantonCreatedContract>

Defined in: canton/index.ts:2117

Parameters​

ParameterType
finalityFinalityRequested
ccvsRawInstanceAddress[]

Returns​

Promise<CantonCreatedContract>


createCCIPSender()​

createCCIPSender(): Promise<CantonCreatedContract>

Defined in: canton/index.ts:2006

Returns​

Promise<CantonCreatedContract>


createPerPartyRouter()​

createPerPartyRouter(): Promise<CantonCreatedContract>

Defined in: canton/index.ts:1882

Returns​

Promise<CantonCreatedContract>


encodeTokenCcvData()​

protected encodeTokenCcvData(_versionTag: string, _data: {[k: string]: BytesLike; _tag: string; }): BytesLike

Defined in: chain.ts:2485

Encode a token issuer's offchain data as this destination's token verifier ccvData, for Chain.getTokenVerifierFallback.

Parameters​

ParameterTypeDescription
_versionTagstringThe 4-byte tag of the verifier implementation to route to
_data{[k: string]: BytesLike; _tag: string; }The issuer's offchain data, from getTokenVerifierData
_data._tagstring-

Returns​

BytesLike

The encoded ccvData

Throws​

CCIPNotImplementedError unless the family overrides it

Inherited from​

Chain.encodeTokenCcvData


estimateReceiveExecution()?​

optional estimateReceiveExecution(opts: { message: Omit<EstimateMessageInput, "onRampAddress" | "offRampAddress">; offRamp: string; } | { messageId: string; }): Promise<number>

Defined in: chain.ts:3202

Estimate ccipReceive execution cost (gas, computeUnits) for this destination chain.

Parameters​

ParameterTypeDescription
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:1601

Executes a CCIP message on Canton by:

  1. Building the unsigned command via generateUnsignedExecute.
  2. Submitting the command to the Canton Ledger API.
  3. Parsing the resulting transaction into a CCIPExecution.

The wallet opt is unused on Canton (the provider takes care of signing/submission);

Parameters​

ParameterType
optsExecuteOpts & { wallet: unknown; }

Returns​

Promise<CCIPExecution>

Throws​

CCIPError if the Ledger API submission or result parsing fails.

Overrides​

Chain.execute


fetchCCVResults()​

protected fetchCCVResults(messageId: string, policy: VerificationPolicy, opts: { indexer?: NetworkType | readonly string[]; 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; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">): Promise<VerifierResult[]>

Defined in: chain.ts:2356

Collect a CCIP v2.0 message's CCV results against the destination policy, from every source: opts.ccvData, then the CCIP API raced against the indexers, then opts.verifiers (read via ChainContext.verifierTransport), then the token-verifier fallback. For families' getVerifications implementations.

Parameters​

ParameterTypeDescription
messageIdstringThe message id
policyVerificationPolicyThis destination's CCV policy for the message
opts{ indexer?: NetworkType | readonly string[]; 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; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">The getVerifications options

Returns​

Promise<VerifierResult[]>

The results covering policy

Throws​

CCIPMessageNotVerifiedYetError if the sources can't cover policy

Inherited from​

Chain.fetchCCVResults


findActiveContractByInstanceAddress()​

findActiveContractByInstanceAddress(templateId: string | readonly string[], instanceAddress: string): Promise<CantonActiveContract | null>

Defined in: canton/index.ts:1802

Find the single active ACS contract whose derived RawInstanceAddress matches instanceAddress.

Accepts either the 0x-hex keccak InstanceAddress (0x optional) or the raw instanceId@party form; contracts are read from the ACS under the chain's active party (the provider's visibility), so only contracts the configured party can see are matched.

Parameters​

ParameterTypeDescription
templateIdstring | readonly string[]Template ID(s) to scan (any match qualifies).
instanceAddressstring0x-hex hash or raw instanceId@party form.

Returns​

Promise<CantonActiveContract | null>

The matching contract, or null when none is active.

Throws​

CCIPError (CANTON_API_ERROR) when several contracts match.


findActiveContractsByTemplate()​

findActiveContractsByTemplate(templateId: string | readonly string[], parties: string[], match?: (createArgument: unknown) => boolean): Promise<CantonActiveContract[]>

Defined in: canton/index.ts:817

Enumerate active contracts of one or more templates matching a predicate, in one ACS query. Deduplicates by contract ID; each result carries createdEventBlob/synchronizerId for disclosure.

Parameters​

ParameterTypeDescription
templateIdstring | readonly string[]Full template ID (#<pkg>:<Module>:<Entity>), or several.
partiesstring[]Parties whose ACS visibility to query.
match?(createArgument: unknown) => booleanPredicate over the decoded createArgument.

Returns​

Promise<CantonActiveContract[]>

All matching active contracts (may be empty).


generateUnsignedExecute()​

generateUnsignedExecute(opts: ExecuteOpts & { payer: string; }): Promise<UnsignedCantonTx>

Defined in: canton/index.ts:1378

Builds a Canton JsCommands payload that exercises the Execute choice on the caller's CCIPReceiver contract. The command includes:

  1. ACS disclosures – same-party contracts (PerPartyRouter, CCIPReceiver) fetched via AcsDisclosureProvider.
  2. EDS disclosures – cross-party contracts (OffRamp, GlobalConfig, TokenAdminRegistry, RMNRemote, CCVs) fetched via EdsDisclosureProvider.
  3. Choice argument – assembled from the encoded CCIP message, verification data, and the opaque contextData returned by the EDS.

Parameters​

ParameterTypeDescription
optsExecuteOpts & { payer: string; }ExecuteOpts with offRamp + input, or { messageId } when apiClient is configured (fetches execution inputs from the CCIP API). 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​

Chain.generateUnsignedExecute


generateUnsignedSendMessage()​

generateUnsignedSendMessage(opts: SendMessageOpts & { sender: string; }): Promise<UnsignedCantonTx>

Defined in: canton/index.ts:877

Generate unsigned txs for ccipSend'ing a message.

Parameters​

ParameterTypeDescription
optsSendMessageOpts & { 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:795

Query token balance for an address.

Parameters​

ParameterTypeDescription
_optsGetBalanceOptsBalance query options

Returns​

Promise<bigint>

Token balance information including raw and formatted values

Throws​

CCIPNotImplementedError always (not yet implemented for Canton)

Overrides​

Chain.getBalance


getBlockInfo()​

getBlockInfo(block: number | "finalized" | "latest"): Promise<BlockInfo>

Defined in: canton/index.ts:574

Fetch info (number and timestamp) for a given block or finality tag.

Parameters​

ParameterTypeDescription
blocknumber | "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​

Chain.getBlockInfo


getBlockTimestamp()​

getBlockTimestamp(block: number | bigint | "finalized" | "latest"): Promise<number>

Defined in: chain.ts:1157

Fetch the timestamp of a given block.

Parameters​

ParameterTypeDescription
blocknumber | bigint | "finalized" | "latest"Block number or finality tag

Returns​

Promise<number>

Unix timestamp in seconds

Deprecated​

Use Chain.getBlockInfo instead.

Inherited from​

Chain.getBlockTimestamp


getCCIPReceiver()​

getCCIPReceiver(finality: FinalityRequested, ccvs: RawInstanceAddress[]): Promise<string | undefined>

Defined in: canton/index.ts:2060

Parameters​

ParameterType
finalityFinalityRequested
ccvsRawInstanceAddress[]

Returns​

Promise<string | undefined>


getCCIPSender()​

getCCIPSender(): Promise<string | undefined>

Defined in: canton/index.ts:1995

Returns​

Promise<string | undefined>


getCCVsForMessage()​

getCCVsForMessage(messageId: string): Promise<RawInstanceAddress[]>

Defined in: canton/index.ts:1556

Helper method to get the CCVs for a given message. Returns the Canton RawInstanceAddresses for all verifiers that have verified this message. The message must be verified already and available on the indexer.

Parameters​

ParameterType
messageIdstring

Returns​

Promise<RawInstanceAddress[]>


getExecutionInput()​

getExecutionInput(opts: { request: CCIPRequest; verifications: CCIPVerifications; } & Pick<LogFilter, "page">): Promise<ExecutionInput>

Defined in: chain.ts:1429

Fetch input data needed for executing messages Should be called on the source instance

Parameters​

ParameterTypeDescription
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​

Chain.getExecutionInput


getExecutionReceipts()​

getExecutionReceipts(opts: { messageId?: string; offRamp: string; sequenceNumber?: bigint; sourceChainSelector?: bigint; verifications?: CCIPVerifications; } & Pick<LogFilter, "startBlock" | "watch" | "startTime" | "page" | "since">): AsyncIterableIterator<CCIPExecution>

Defined in: chain.ts:2685

Default/generic implementation of getExecutionReceipts. Yields execution receipts for a given offRamp.

Parameters​

ParameterTypeDescription
opts{ messageId?: string; offRamp: string; sequenceNumber?: bigint; sourceChainSelector?: bigint; verifications?: CCIPVerifications; } & Pick<LogFilter, "startBlock" | "watch" | "startTime" | "page" | "since">getExecutionReceipts options

Returns​

AsyncIterableIterator<CCIPExecution>

Async generator of CCIPExecution receipts

Example​

Watch for execution receipts

TypeScript
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​

Chain.getExecutionReceipts


getFee()​

getFee(_opts: Omit<SendMessageOpts, "approveMax">): Promise<bigint>

Defined in: canton/index.ts:872

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​

ParameterType
_optsOmit<SendMessageOpts, "approveMax">

Returns​

Promise<bigint>

Overrides​

Chain.getFee


getFeeTokens()​

getFeeTokens(_router: string): Promise<Record<string, TokenInfo>>

Defined in: canton/index.ts:2270

Fetch list and info of supported feeTokens.

Parameters​

ParameterTypeDescription
_routerstringRouter address on this chain

Returns​

Promise<Record<string, TokenInfo>>

Promise resolving to mapping of token addresses to TokenInfo objects

Overrides​

Chain.getFeeTokens


getLaneFeatures()​

getLaneFeatures(opts: { destChainSelector: bigint; router: string; token?: string; }): Promise<Partial<LaneFeatures>>

Defined in: chain.ts:2571

Retrieve features for a lane (router/destChainSelector/token triplet).

Parameters​

ParameterType
opts{ destChainSelector: bigint; router: string; token?: string; }
opts.destChainSelectorbigint
opts.routerstring
opts.token?string

Returns​

Promise<Partial<LaneFeatures>>

Promise resolving to partial lane features record

Throws​

CCIPNotImplementedError if not implemented for this chain family

Example​

Get lane features

TypeScript
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​

Chain.getLaneFeatures


getLaneLatency()​

getLaneLatency(destChainSelector: bigint, numberOfBlocks?: number): Promise<LaneLatencyResponse>

Defined in: chain.ts:2530

Fetches estimated lane latency to a destination chain. Uses this chain's selector as the source.

Parameters​

ParameterTypeDescription
destChainSelectorbigintDestination CCIP chain selector (bigint)
numberOfBlocks?numberOptional 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​

CCIPLaneLatencyInsufficientDataError if the API has too little history for the lane

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​

Get estimated delivery time

TypeScript
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}`)
}
}

Get latency with custom block confirmations

TypeScript
const latency = await chain.getLaneLatency(4949039107694359620n, 10)
console.log(`Latency with 10 confirmations: ${Math.round(latency.totalMs / 60000)} minutes`)

Inherited from​

Chain.getLaneLatency


getLogs()​

getLogs(_opts: { address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: number | bigint; since?: { blockTimestamp?: number | bigint; }; startBlock?: number | bigint; startTime?: number | bigint; topics?: (string | string[] | null)[]; typeAndVersions?: readonly (string | RegExp)[]; watch?: boolean | AbortSignal; }): AsyncIterableIterator<{ blockTimestamp: number; data: Record<string, unknown> | BytesLike; tx?: { blockNumber: number; error?: unknown; from: string; hash: string; logs?: readonly { transactionHash: string; blockNumber: number; address: string; topics: readonly string[]; index: number; blockTimestamp: number; data: Record<string, unknown> | BytesLike; tx?: { hash: string; ... 4 more ...; logs?: readonly ...[] | undefined; } | undefined; }[]; timestamp: number; }; }>

Defined in: canton/index.ts:696

An async generator that yields logs based on the provided options.

Parameters​

ParameterTypeDescription
_opts{ address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: number | bigint; since?: { blockTimestamp?: number | bigint; }; startBlock?: number | bigint; startTime?: number | bigint; topics?: (string | string[] | null)[]; typeAndVersions?: readonly (string | RegExp)[]; watch?: boolean | AbortSignal; }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 - since: a previous log (preferably the last finalized from a previous call), as log cursor; may be more efficient in some chains for paginating, and may replace startTime or startBlock - 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
_opts.address?stringContract address to filter logs by.
_opts.endBefore?stringCursor hint for the exclusive upper end of iteration on chains that support it.
_opts.endBlock?number | bigint | "finalized" | "latest"Ending block number (inclusive).
_opts.page?number | bigintPage size for pagination.
_opts.since?{ blockTimestamp?: number | bigint; }Resume hint: the last log emitted by a previous getLogs call on the same address/filter. Any subset of fields may be provided; each chain uses what it can. Two layers of behavior: 1. Start floors (ALL chains — see withSinceStart): blockNumber and blockTimestamp stand in for startBlock/startTime — each effective floor is the LARGER of the explicitly requested bound and the hint's — so a since carrying either satisfies the start requirement on its own. Blocks/versions are always fetched and emitted complete. 2. Block completeness: all chains implementations must guarantee all logs in some block are yielded in the same call before it returns. 3. Exclusive resume (chains with a native per-log cursor): the hinted log itself is NOT re-emitted, and other logs in the same block/tx may also not be; some chains may attempt to yield logs in the same block or transaction, but from 2., the contract guarantees only that logs from the next block or tx on are emitted, so for an hermetic poller, it's safer to only ever pass the last finalized log in the previous call as since hint. The hint only ever RAISES the start floors — startBlock is the scan floor (the scan never starts below it) and, when a startBlock exists, startTime is evaluated at filter-time just before emitting. A stale, foreign or malformed hint may be ignored (the usual walk runs). At-least-once is the only guarantee all families share: dedupe by (transactionHash, index). Cursors are FILTER-SCOPED: a hint produced by a NARROWER filter must never be replayed on a wider one. Where the cursor is a per-block prefix (EVM), the wider filter's earlier-index logs in the hinted block count as already emitted and are SKIPPED — a loss, not a duplicate. The SDK cannot validate this: the hint carries the log's own topics, never the breadth of the filter that produced it, so a wide sweep and a narrow one over the same block hand out a byte-identical hint while requiring opposite resume behavior (an address mismatch IS detectable and is rejected; a topic-subset resume is not). Key each cursor by the filter that produced it, and start a new filter from its own startBlock. Per-family resume — EVM/Solana/TON: the hinted block/tx streams whole and logs at/before the hinted index are skipped (later same-block/same-tx logs still flow; TON floors its v3 /messages fast path at the hint's created_lt). Aptos: event index on single-topic streams, blockNumber + 1 on multi-topic ones. Sui: inclusive checkpoint floors (re-delivered). Canton: unsupported.
_opts.since.blockTimestamp?number | bigint-
_opts.startBlock?number | bigintStarting block number (inclusive). Required unless startTime is provided; explicit 0 is allowed.
_opts.startTime?number | bigintStarting Unix timestamp (inclusive).
_opts.topics?(string | string[] | null)[]Topics to filter logs by.
_opts.typeAndVersions?readonly (string | RegExp)[]Restrict logs to contracts whose Chain.typeAndVersion matches any of these. Useful when filtering by topic alone (no address) would otherwise match logs from many unrelated contract types — e.g. ConfigSet is emitted by OnRamp, OffRamp, CommitStore, FeeQuoter, TokenPool, and PriceRegistry alike. Pass e.g. ['OnRamp'] to keep only on-ramps. See passesTypeAndVersion for the exact matching rule. undefined/empty means no restriction (default), and costs nothing — typeAndVersion is never called.
_opts.watch?boolean | AbortSignalwatch mode: polls for new logs after fetching since start (required), until endBlock finality tag (e.g. endBlock=finalized polls only finalized logs); can be an AbortSignal to cancel loop

Returns​

AsyncIterableIterator<{ blockTimestamp: number; data: Record<string, unknown> | BytesLike; tx?: { blockNumber: number; error?: unknown; from: string; hash: string; logs?: readonly { transactionHash: string; blockNumber: number; address: string; topics: readonly string[]; index: number; blockTimestamp: number; data: Record<string, unknown> | BytesLike; tx?: { hash: string; ... 4 more ...; logs?: readonly ...[] | undefined; } | undefined; }[]; timestamp: number; }; }>

An async iterable iterator of logs.

Throws​

CCIPNotImplementedError always (not yet implemented for Canton)

Overrides​

Chain.getLogs


getMessageById()​

getMessageById(messageId: string, _opts?: { onRamp?: string; page?: number; }): Promise<CCIPRequest<CCIPVersion>>

Defined in: chain.ts:1377

Fetch a CCIP message by its unique message ID.

Parameters​

ParameterTypeDescription
messageIdstringThe 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​

TypeScript
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​

Chain.getMessageById


getMessagesInBatch()​

getMessagesInBatch<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; }; }>(request: R, range: Pick<CommitReport, "minSeqNr" | "maxSeqNr">, opts?: { page?: number; }): Promise<R["message"][]>

Defined in: chain.ts:1407

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​

ParameterTypeDescription
requestRCCIPRequest to fetch batch for
rangePick<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​

Get all messages in a batch

TypeScript
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​

Chain.getMessagesInBatch


getMessagesInRange()​

getMessagesInRange(opts: { address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: number | bigint; since?: { blockTimestamp?: number | bigint; }; startBlock?: number | bigint; startTime?: number | bigint; topics?: (string | string[] | null)[]; typeAndVersions?: readonly (string | RegExp)[]; watch?: boolean | AbortSignal; }): AsyncIterableIterator<CCIPRequest<CCIPVersion>>

Defined in: chain.ts:1343

Discover and decode CCIP messages within a block/slot/checkpoint range.

Parameters​

ParameterTypeDescription
opts{ address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: number | bigint; since?: { blockTimestamp?: number | bigint; }; startBlock?: number | bigint; startTime?: number | bigint; topics?: (string | string[] | null)[]; typeAndVersions?: readonly (string | RegExp)[]; watch?: boolean | AbortSignal; }LogFilter options (startBlock, endBlock, address, topics, page)
opts.address?stringContract address to filter logs by.
opts.endBefore?stringCursor hint for the exclusive upper end of iteration on chains that support it.
opts.endBlock?number | bigint | "finalized" | "latest"Ending block number (inclusive).
opts.page?number | bigintPage size for pagination.
opts.since?{ blockTimestamp?: number | bigint; }Resume hint: the last log emitted by a previous getLogs call on the same address/filter. Any subset of fields may be provided; each chain uses what it can. Two layers of behavior: 1. Start floors (ALL chains — see withSinceStart): blockNumber and blockTimestamp stand in for startBlock/startTime — each effective floor is the LARGER of the explicitly requested bound and the hint's — so a since carrying either satisfies the start requirement on its own. Blocks/versions are always fetched and emitted complete. 2. Block completeness: all chains implementations must guarantee all logs in some block are yielded in the same call before it returns. 3. Exclusive resume (chains with a native per-log cursor): the hinted log itself is NOT re-emitted, and other logs in the same block/tx may also not be; some chains may attempt to yield logs in the same block or transaction, but from 2., the contract guarantees only that logs from the next block or tx on are emitted, so for an hermetic poller, it's safer to only ever pass the last finalized log in the previous call as since hint. The hint only ever RAISES the start floors — startBlock is the scan floor (the scan never starts below it) and, when a startBlock exists, startTime is evaluated at filter-time just before emitting. A stale, foreign or malformed hint may be ignored (the usual walk runs). At-least-once is the only guarantee all families share: dedupe by (transactionHash, index). Cursors are FILTER-SCOPED: a hint produced by a NARROWER filter must never be replayed on a wider one. Where the cursor is a per-block prefix (EVM), the wider filter's earlier-index logs in the hinted block count as already emitted and are SKIPPED — a loss, not a duplicate. The SDK cannot validate this: the hint carries the log's own topics, never the breadth of the filter that produced it, so a wide sweep and a narrow one over the same block hand out a byte-identical hint while requiring opposite resume behavior (an address mismatch IS detectable and is rejected; a topic-subset resume is not). Key each cursor by the filter that produced it, and start a new filter from its own startBlock. Per-family resume — EVM/Solana/TON: the hinted block/tx streams whole and logs at/before the hinted index are skipped (later same-block/same-tx logs still flow; TON floors its v3 /messages fast path at the hint's created_lt). Aptos: event index on single-topic streams, blockNumber + 1 on multi-topic ones. Sui: inclusive checkpoint floors (re-delivered). Canton: unsupported.
opts.since.blockTimestamp?number | bigint-
opts.startBlock?number | bigintStarting block number (inclusive). Required unless startTime is provided; explicit 0 is allowed.
opts.startTime?number | bigintStarting Unix timestamp (inclusive).
opts.topics?(string | string[] | null)[]Topics to filter logs by.
opts.typeAndVersions?readonly (string | RegExp)[]Restrict logs to contracts whose Chain.typeAndVersion matches any of these. Useful when filtering by topic alone (no address) would otherwise match logs from many unrelated contract types — e.g. ConfigSet is emitted by OnRamp, OffRamp, CommitStore, FeeQuoter, TokenPool, and PriceRegistry alike. Pass e.g. ['OnRamp'] to keep only on-ramps. See passesTypeAndVersion for the exact matching rule. undefined/empty means no restriction (default), and costs nothing — typeAndVersion is never called.
opts.watch?boolean | AbortSignalwatch mode: polls for new logs after fetching since start (required), until endBlock finality tag (e.g. endBlock=finalized polls only finalized logs); can be an AbortSignal to cancel loop

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​

Example​

Scan a block range on EVM

TypeScript
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​

Chain.getMessagesInRange


getMessagesInTx()​

getMessagesInTx(tx: string | ChainTransaction): Promise<CCIPRequest<CCIPVersion>[]>

Defined in: chain.ts:1284

Fetch all CCIP requests in a transaction.

Parameters​

ParameterTypeDescription
txstring | ChainTransactionChainTransaction 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​

Get messages from transaction

TypeScript
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​

Chain.getMessagesInTx


getNativeTokenForRouter()​

getNativeTokenForRouter(_router: string): Promise<string>

Defined in: canton/index.ts:732

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​

ParameterType
_routerstring

Returns​

Promise<string>

Overrides​

Chain.getNativeTokenForRouter


getOffchainTokenData()​

getOffchainTokenData(request: CCIPRequest): Promise<OffchainTokenData[]>

Defined in: canton/index.ts:1355

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​

ParameterTypeDescription
requestCCIPRequestCCIP request, with tx.hash and message

Returns​

Promise<OffchainTokenData[]>

Promise resolving to array with one offchain token data for each token transfer

Overrides​

Chain.getOffchainTokenData


getOffRampConfig()​

getOffRampConfig(_offRamp: string, _sourceChainSelector: bigint): Promise<OffRampConfig>

Defined in: canton/index.ts:719

Fetch the full OffRamp configuration for a given source chain.

Parameters​

ParameterTypeDescription
_offRampstringOffRamp contract address.
_sourceChainSelectorbigintSource 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​

Chain.getOffRampConfig


getOffRampsForRouter()​

getOffRampsForRouter(_router: string, _sourceChainSelector: bigint): Promise<string[]>

Defined in: canton/index.ts:740

Fetch the OffRamps allowlisted in a Router. Used to discover OffRamp connected to an OnRamp.

Parameters​

ParameterTypeDescription
_routerstringRouter contract address
_sourceChainSelectorbigintSource chain selector

Returns​

Promise<string[]>

Promise resolving to array of OffRamp addresses

Throws​

CCIPNotImplementedError always (not yet implemented for Canton)

Overrides​

Chain.getOffRampsForRouter


getOnRampConfig()​

getOnRampConfig(_onRamp: string, _destChainSelector: bigint): Promise<OnRampConfig>

Defined in: canton/index.ts:711

Fetch the full OnRamp configuration for a given destination chain.

Parameters​

ParameterTypeDescription
_onRampstringOnRamp contract address.
_destChainSelectorbigintDestination 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.

One OnRamp can serve more than one lane version to the same destination: a Solana 2.0 Router keeps its 1.6 lane config next to the 2.0 one. Give opts.version to select the lane; families whose OnRamp serves one version only ignore it. The lane version is not the contract version: the returned typeAndVersion always identifies the contract.

Overrides​

Chain.getOnRampConfig


getOnRampForRouter()​

getOnRampForRouter(_router: string, _destChainSelector: bigint): Promise<string>

Defined in: canton/index.ts:748

Fetch the OnRamp registered in a Router for a destination chain.

Parameters​

ParameterTypeDescription
_routerstringRouter contract address
_destChainSelectorbigintDestination chain selector

Returns​

Promise<string>

Promise resolving to OnRamp address

Throws​

CCIPNotImplementedError always (not yet implemented for Canton)

Overrides​

Chain.getOnRampForRouter


getOnRampsForOffRamp()​

getOnRampsForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string[]>

Defined in: chain.ts:1644

Fetch the OnRamps addresses set in OffRamp config. Used to discover OffRamp connected to an OnRamp.

Parameters​

ParameterTypeDescription
offRampstringOffRamp contract address
sourceChainSelectorbigintSource 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​

Get onRamp from offRamp config

TypeScript
const [onRamp] = await dest.getOnRampsForOffRamp(offRampAddress, sourceSelector)
console.log(`OnRamp: ${onRamp}`)

Inherited from​

Chain.getOnRampsForOffRamp


getPerPartyRouter()​

getPerPartyRouter(): Promise<string | undefined>

Defined in: canton/index.ts:1871

Returns​

Promise<string | undefined>


getRegistryTokenConfig()​

getRegistryTokenConfig(_registry: string, _token: string): Promise<RegistryTokenConfig>

Defined in: canton/index.ts:2246

Fetch token configuration from a TokenAdminRegistry.

Parameters​

ParameterTypeDescription
_registrystringTokenAdminRegistry contract address.
_tokenstringToken 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​

Chain.getRegistryTokenConfig


getRequiredCCVs()?​

optional getRequiredCCVs(opts: { message: GetRequiredCCVsMessage; offRamp: string; }): Promise<GetRequiredCCVsResult>

Defined in: chain.ts:3220

Resolve the CCV set the destination OffRamp will require for a candidate message, and whether its finality is accepted (a rejection throws CCIPFinalityNotAllowedError). A read via the getCCVsForMessage resolver; EVM destinations only. The set is informative and sender-scoped.

Parameters​

ParameterTypeDescription
opts{ message: GetRequiredCCVsMessage; offRamp: string; }Destination OffRamp (v2.0) address and the candidate message (GetRequiredCCVsMessage).
opts.messageGetRequiredCCVsMessage-
opts.offRampstring-

Returns​

Promise<GetRequiredCCVsResult>

{ requiredCCVs, optionalCCVs, optionalThreshold }.

Inherited from​

Chain.getRequiredCCVs


getRouterForOffRamp()​

getRouterForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string>

Defined in: chain.ts:1574

Fetch the Router address set in OffRamp config.

Parameters​

ParameterTypeDescription
offRampstringOffRamp contract address
sourceChainSelectorbigintSource 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​

Get router from offRamp

TypeScript
const router = await chain.getRouterForOffRamp(offRampAddress, sourceSelector)
console.log(`Router: ${router}`)

Inherited from​

Chain.getRouterForOffRamp


getRouterForOnRamp()​

getRouterForOnRamp(onRamp: string, destChainSelector: bigint): Promise<string>

Defined in: chain.ts:1551

Fetch the Router address set in OnRamp config. Used to discover OffRamp connected to OnRamp.

Parameters​

ParameterTypeDescription
onRampstringOnRamp contract address
destChainSelectorbigintDestination 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​

Get router from onRamp

TypeScript
const router = await chain.getRouterForOnRamp(onRampAddress, destSelector)
console.log(`Router: ${router}`)

Inherited from​

Chain.getRouterForOnRamp


getSupportedTokens()​

getSupportedTokens(_address: string, _opts?: { page?: number; }): Promise<string[]>

Defined in: canton/index.ts:2238

List tokens supported by given TokenAdminRegistry contract.

Parameters​

ParameterTypeDescription
_addressstringUsually 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​

Chain.getSupportedTokens


getTokenAdminRegistryFor()​

getTokenAdminRegistryFor(_address: string): Promise<string>

Defined in: canton/index.ts:803

Fetch TokenAdminRegistry configured in a given OnRamp, Router, etc. Needed to map a source token to its dest counterparts.

Parameters​

ParameterTypeDescription
_addressstringContract 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:1663

Fetch the TokenPool's token/mint.

Parameters​

ParameterTypeDescription
tokenPoolstringTokenPool address

Returns​

Promise<string>

Promise resolving to token or mint address

Throws​

CCIPLocalTokenRequiredError if the pool serves multiple tokens, since a pool address alone does not select one of them

Example​

Get token for pool

TypeScript
const token = await chain.getTokenForTokenPool(tokenPoolAddress)
console.log(`Token: ${token}`)

Inherited from​

Chain.getTokenForTokenPool


getTokenInfo()​

getTokenInfo(token: string): Promise<{ decimals: number; symbol: string; }>

Defined in: canton/index.ts:759

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 ("id@admin"); the registry is keyed by the local id portion.

Parameters​

ParameterType
tokenstring

Returns​

Promise<{ decimals: number; symbol: string; }>

Overrides​

Chain.getTokenInfo


getTokenPoolConfig()​

getTokenPoolConfig(_tokenPool: string): Promise<TokenPoolConfig>

Defined in: canton/index.ts:2254

Fetch configuration of a token pool.

Parameters​

ParameterTypeDescription
_tokenPoolstringToken pool contract address.

Returns​

Promise<TokenPoolConfig>

TokenPoolConfig containing token, router, version info, and optionally fee config.

Remarks​

Return type varies by chain:

  • EVM: typeAndVersion is always present (required)
  • Solana: Includes extra tokenPoolProgram field
  • Aptos: Standard fields only
  • Sui/TON: Throws CCIPNotImplementedError

Throws​

CCIPNotImplementedError always (not yet implemented for Canton)

Overrides​

Chain.getTokenPoolConfig


getTokenPoolFinality()​

protected getTokenPoolFinality(tokenPool: string, _destChainSelector: bigint, token?: string): Promise<Partial<FinalityAllowed>>

Defined in: chain.ts:2657

Finality a token pool allows for transfers on a lane, for Chain.getLaneFeatures.

Parameters​

ParameterTypeDescription
tokenPoolstringToken pool address.
_destChainSelectorbigintDestination chain selector of the lane.
token?stringThe local token, for pools that serve multiple tokens.

Returns​

Promise<Partial<FinalityAllowed>>

The pool's finalityDepth/finalitySafe from Chain.getTokenPoolConfig, pool-wide by default; families configuring finality per remote chain read the lane's.

Inherited from​

Chain.getTokenPoolFinality


getTokenPoolRemote()​

getTokenPoolRemote(tokenPool: string, remoteChainSelector: bigint, opts?: TokenPoolRemotesOpts): Promise<TokenPoolRemote>

Defined in: chain.ts:2982

Fetch remote chain configuration for a token pool for a specific destination.

Parameters​

ParameterTypeDescription
tokenPoolstringToken pool address on the current chain.
remoteChainSelectorbigintChain selector of the desired remote chain.
opts?TokenPoolRemotesOptsOptional token: the local token; required for multi-token pools, ignored by others.

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​

TypeScript
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.

Throws​

CCIPLocalTokenRequiredError if the pool serves multiple tokens and opts.token is not given

Inherited from​

Chain.getTokenPoolRemote


getTokenPoolRemotes()​

getTokenPoolRemotes(_tokenPool: string, _remoteChainSelector?: bigint): Promise<Record<string, TokenPoolRemote>>

Defined in: canton/index.ts:2262

Fetch remote chain configurations for a token pool.

Parameters​

ParameterTypeDescription
_tokenPoolstringToken pool address on the current chain.
_remoteChainSelector?bigintOptional 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​

Chain.getTokenPoolRemotes


getTokenPrice()​

getTokenPrice(_opts: { router: string; timestamp?: number; token: string; }): Promise<TokenPrice>

Defined in: chain.ts:3142

Fetch the on-chain USD price of a token from the FeeQuoter or PriceRegistry.

Parameters​

ParameterType
_opts{ router: string; timestamp?: number; token: string; }
_opts.routerstring
_opts.timestamp?number
_opts.tokenstring

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​

TypeScript
const { price } = await chain.getTokenPrice({
router: routerAddress,
token: linkAddress,
})
console.log(`LINK: $${price.toFixed(2)}`)

Inherited from​

Chain.getTokenPrice


getTokenVerifierFallback()​

protected getTokenVerifierFallback(opts: { indexer?: NetworkType | readonly string[]; 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; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">, missingCCVs: readonly string[]): Promise<VerifierResult[]>

Defined in: chain.ts:2397

Compose verification results for token CCVs that the managed sources left uncovered, from the token issuer's offchain attestation: Circle's for CCTP (USDC), Lombard's for LBTC.

This is the last source Chain.getVerifications tries. It is safe because the composed bytes are not trusted here: the destination CCV's onchain verifyMessage validates them, so wrong or incomplete data can only waste gas. Families take part by implementing Chain.getTokenVerifiers and Chain.encodeTokenCcvData.

Parameters​

ParameterTypeDescription
opts{ indexer?: NetworkType | readonly string[]; 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; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">The getVerifications options
missingCCVsreadonly string[]Required CCVs still missing, as policy addresses

Returns​

Promise<VerifierResult[]>

At most one result, for the token verifier of the message's token transfer

Inherited from​

Chain.getTokenVerifierFallback


getTokenVerifiers()​

protected getTokenVerifiers(_ccv: string, _sourceChainSelector: bigint): Promise<TokenVerifier[]>

Defined in: chain.ts:2469

List the token verifier implementations behind a destination CCV (resolving a versioned verifier resolver), for Chain.getTokenVerifierFallback.

The base implementation finds none; families with CCTP or Lombard verifiers override it.

Parameters​

ParameterTypeDescription
_ccvstringA destination CCV address, from the message's verification policy
_sourceChainSelectorbigintThe message's source chain

Returns​

Promise<TokenVerifier[]>

The token verifiers behind _ccv, possibly empty

Inherited from​

Chain.getTokenVerifiers


getTotalFeesEstimate()​

getTotalFeesEstimate(_opts: Omit<SendMessageOpts, "approveMax">): Promise<TotalFeesEstimate>

Defined in: chain.ts:3108

Estimate total fees for a cross-chain message.

Returns two components:

  • ccipFee: from Router.getFee(), denominated in the message's feeToken (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 - feeDeducted on the destination chain. Absent on pre-v2.0 lanes or data-only messages.

Parameters​

ParameterTypeDescription
_optsOmit<SendMessageOpts, "approveMax">SendMessageOpts without approveMax

Returns​

Promise<TotalFeesEstimate>

Promise resolving to TotalFeesEstimate

Throws​

CCIPNotImplementedError if not implemented for this chain family

Inherited from​

Chain.getTotalFeesEstimate


getTransaction()​

getTransaction(hash: string): Promise<ChainTransaction>

Defined in: canton/index.ts:627

Fetches a Canton transaction (update) by its update ID.

The ledger is queried via /v2/updates/transaction-by-id scoped to the provider's party so restricted participant nodes allow the lookup.

Canton concepts are mapped to ChainTransaction fields as follows:

  • hash — the Canton updateId
  • blockNumber — the ledger offset
  • timestamp — effectiveAt parsed to Unix seconds
  • from — first actingParties entry of the first exercised event
  • logs — one ChainLog per transaction event

Parameters​

ParameterTypeDescription
hashstringThe Canton update ID (transaction hash) to look up.

Returns​

Promise<ChainTransaction>

A ChainTransaction with events mapped to logs.

Overrides​

Chain.getTransaction


getVerifications()​

getVerifications(opts: { indexer?: NetworkType | readonly string[]; 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; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">): Promise<CCIPVerifications>

Defined in: canton/index.ts:2160

Fetches CCV verification results for a CCIP message from the Canton indexer.

Parameters​

ParameterTypeDescription
opts{ indexer?: NetworkType | readonly string[]; 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; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">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​

Chain.getVerifications


laneSupportsFastFinality()​

protected laneSupportsFastFinality(onRamp: string, _destChainSelector: bigint): Promise<boolean>

Defined in: chain.ts:2640

Whether a lane can carry fast finality (FINALITY_FAST/SAFE), for Chain.getLaneFeatures.

Parameters​

ParameterTypeDescription
onRampstringOnRamp of the lane.
_destChainSelectorbigintDestination chain selector of the lane.

Returns​

Promise<boolean>

Whether the OnRamp can carry GenericExtraArgsV3 extra args, i.e. is >= v2.0; families whose OnRamp serves lanes of several versions narrow it to the lane's.

Inherited from​

Chain.laneSupportsFastFinality


resolveEncodedMessage()​

protected resolveEncodedMessage(request: { message: { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; }; }): Promise<string>

Defined in: chain.ts:2335

The MessageV1Codec-encoded form of a CCIP v2.0 request's message: taken from the request when it carries one (decoded from source logs), else fetched from the CCIP API (whose getMessageById requests don't).

Parameters​

ParameterTypeDescription
request{ message: { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; }; }The v2.0 request
request.message{ messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; }-

Returns​

Promise<string>

The 0x-prefixed encoded message

Throws​

CCIPApiClientNotAvailableError if it must be fetched and the API is disabled

Inherited from​

Chain.resolveEncodedMessage


resolveExecuteOpts()​

protected resolveExecuteOpts(opts: ExecuteOpts): Promise<{ input: ExecutionInput; offRamp: string; } & { forceBuffer?: boolean; forceLookupTable?: boolean; gasLimit?: number; receiver?: string; tokensGasLimit?: number; txGasLimit?: number; }>

Defined in: chain.ts:2122

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​

ParameterType
optsExecuteOpts

Returns​

Promise<{ input: ExecutionInput; offRamp: string; } & { forceBuffer?: boolean; forceLookupTable?: boolean; gasLimit?: number; receiver?: string; tokensGasLimit?: number; txGasLimit?: number; }>

Throws​

CCIPApiClientNotAvailableError if messageId is provided but no apiClient

Inherited from​

Chain.resolveExecuteOpts


sendMessage()​

sendMessage(opts: SendMessageOpts & { txGasLimit?: number; wallet: unknown; }): Promise<CCIPRequest<CCIPVersion>>

Defined in: canton/index.ts:1265

Send a CCIP message through a router using provided wallet.

Parameters​

ParameterTypeDescription
optsSendMessageOpts & { txGasLimit?: number; wallet: unknown; }SendMessageOpts with chain-specific wallet for signing

Returns​

Promise<CCIPRequest<CCIPVersion>>

Promise resolving to CCIP request with message details

Overrides​

Chain.sendMessage


simulateLockOrBurn()?​

optional simulateLockOrBurn(opts: { amount: bigint; destChainSelector: bigint; finality?: FinalityRequested; onRamp: string; originalSender?: string; receiver?: string; token: string; tokenArgs?: string; tokenReceiver?: string; }): Promise<{ destPoolData: string; destTokenAddress: string; destTokenAmount: bigint; sourcePoolAddress: string; }>

Defined in: chain.ts:3161

Simulate the source pool's lockOrBurn for a prospective token transfer and return the pool-reported destTokenAddress, destPoolData (the value the destination pool's releaseOrMint consumes as sourcePoolData) and destTokenAmount (the post-fee amount the OnRamp writes into the emitted message), plus the resolved source pool address.

Optional; currently implemented for EVM chains. Used by estimateReceiveExecution to feed the destination-liquidity simulation the same source pool data a real transfer would carry.

Parameters​

ParameterTypeDescription
opts{ amount: bigint; destChainSelector: bigint; finality?: FinalityRequested; onRamp: string; originalSender?: string; receiver?: string; token: string; tokenArgs?: string; tokenReceiver?: string; }lane (onRamp, destChainSelector), token and amount (source decimals), and optionally originalSender, receiver, tokenReceiver, tokenArgs, and the requested finality
opts.amountbigintAmount in the source token's decimals
opts.destChainSelectorbigintDestination chain selector
opts.finality?FinalityRequestedRequested finality (v2 pools take it as the 2nd lockOrBurn argument)
opts.onRampstringOnRamp registered on the source Router for the destination chain
opts.originalSender?stringSender of the prospective message
opts.receiver?stringReceiver on the destination chain
opts.tokenstringSource token address
opts.tokenArgs?stringMessage-level GenericExtraArgsV3.tokenArgs, passed through to IPoolV2 pools
opts.tokenReceiver?stringToken receiver on the destination chain (v3 extraArgs); when set, takes precedence over receiver as the pool's lockOrBurnIn.receiver, mirroring the OnRamp

Returns​

Promise<{ destPoolData: string; destTokenAddress: string; destTokenAmount: bigint; sourcePoolAddress: string; }>

resolved sourcePoolAddress, destTokenAddress + destPoolData as returned by the pool, and the post-fee destTokenAmount

Inherited from​

Chain.simulateLockOrBurn


submitCommands()​

submitCommands(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; limit?: number; templateId: string; }[]; readAs?: string[]; submissionId?: string; synchronizerId?: string; tapsMaxPasses?: number; userId?: string; workflowId?: string; }, reason?: 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; contractKeyHash?: string; 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; paidTrafficCost?: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; transactionHash?: string; updateId: string; workflowId?: string; }; }>

Defined in: canton/index.ts:1752

Submit a command to the ledger via the provider.

The provider takes care of signing and submitting: the browser dApp wallet signs with the user's key, while the CLI provider submits JWT-authenticated via the participant. Public so CCT operations can submit their own commands through the same path.

Parameters​

ParameterTypeDefault valueDescription
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; limit?: number; templateId: string; }[]; readAs?: string[]; submissionId?: string; synchronizerId?: string; tapsMaxPasses?: number; userId?: string; workflowId?: string; }undefined-
commands.actAsstring[]undefinedDescription 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.commandIdstringundefinedDescription 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; }; })[]undefinedDescription Individual elements of this atomic command. Must be non-empty. Required: must be non-empty
commands.deduplicationPeriod?{ DeduplicationDuration: { value: { nanos: number; seconds: number; unknownFields?: { fields: {[key: string]: { fixed32?: ...[]; fixed64?: ...[]; lengthDelimited?: ...[]; varint?: ...[]; }; }; }; }; }; } | { DeduplicationOffset: { value: number; }; } | { Empty: Record<string, never>; }undefined-
commands.disclosedContracts?{ contractId?: string; createdEventBlob: string; synchronizerId?: string; templateId?: string; }[]undefinedDescription Additional contracts used to resolve contract & contract key lookups. Optional: can be empty
commands.minLedgerTimeAbs?stringundefinedDescription 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[]; }; }; }; }undefinedDescription 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.nanosnumberundefinedFormat: int32
commands.minLedgerTimeRel.secondsnumberundefinedFormat: int64
commands.minLedgerTimeRel.unknownFields?{ fields: {[key: string]: { fixed32?: number[]; fixed64?: number[]; lengthDelimited?: string[]; varint?: number[]; }; }; }undefinedDescription 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[]; }; }undefined-
commands.packageIdSelectionPreference?string[]undefinedDescription The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation Optional: can be empty
commands.prefetchContractKeys?{ contractKey: unknown; limit?: number; templateId: string; }[]undefinedDescription Fetches the contract keys into the caches to speed up the command processing. Each entry specifies a key and a limit on how many contracts to prefetch for that key. The limit does not count disclosed contracts, and should reflect the number of additional contracts expected to be resolved during interpretation of the commands. If a key appears multiple times, the last entry's limit wins. Optional: can be empty
commands.readAs?string[]undefinedDescription 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: can be empty
commands.submissionId?stringundefinedDescription 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?stringundefinedDescription Must be a valid synchronizer id Optional
commands.tapsMaxPasses?numberundefinedFormat: int32 Description The maximum number of passes for the Topology-Aware Package Selection (TAPS). Higher values can increase the chance of successful package selection for routing of interpreted transactions. If unset, this defaults to the value defined in the participant configuration. The provided value must not exceed the limit specified in the participant configuration. Optional
commands.userId?stringundefinedDescription 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. Optional
commands.workflowId?stringundefinedDescription Identifier of the on-ledger workflow that this command is a part of. Must be a valid LedgerString (as described in value.proto). Optional
reason?string'submit command'-

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; contractKeyHash?: string; 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; paidTrafficCost?: number; recordTime: string; synchronizerId: string; traceContext?: { traceparent?: string; tracestate?: string; }; transactionHash?: string; updateId: string; workflowId?: string; }; }>


typeAndVersion()​

typeAndVersion(_address: string): Promise<[type: string, version: string, typeAndVersion: string, suffix?: string]>

Defined in: canton/index.ts:704

Fetch typeAndVersion for a given CCIP contract address.

Parameters​

ParameterTypeDescription
_addressstringCCIP contract address

Returns​

Promise<[type: string, version: string, typeAndVersion: string, suffix?: string]>

Promise resolving to tuple:

  • type - Parsed type of the contract, e.g. OnRamp
  • version - Parsed version of the contract, e.g. 1.6.0
  • typeAndVersion - Original (unparsed) typeAndVersion() string
  • suffix - Suffix of the version, if any (e.g. -dev)

Throws​

CCIPNotImplementedError always (not yet implemented for Canton)

Overrides​

Chain.typeAndVersion


waitFinalized()​

waitFinalized(opts: { abort?: AbortSignal; finality?: number | bigint | "finalized" | "latest"; pollInterval?: number; reorgSafetyBlocks?: number; } & ({ request: { log: { blockTimestamp: number | bigint; }; }; } | { log: { blockTimestamp: number | bigint; }; })): Promise<BlockInfo | undefined>

Defined in: chain.ts:1205

Confirm a log tx is finalized or wait for it to be finalized.

Parameters​

ParameterTypeDescription
opts{ abort?: AbortSignal; finality?: number | bigint | "finalized" | "latest"; pollInterval?: number; reorgSafetyBlocks?: number; } & ({ request: { log: { blockTimestamp: number | bigint; }; }; } | { log: { blockTimestamp: number | bigint; }; })Options containing the request, finality level, and optional cancel promise

Returns​

Promise<BlockInfo | undefined>

Some block info at or after tx finalization

Throws​

CCIPTransactionNotFinalizedError if the transaction is not included (e.g., due to a reorg)

Example​

Wait for message finality

TypeScript
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​

Chain.waitFinalized


buildMessageForDest()​

static buildMessageForDest(message: MessageInput): AnyMessage

Defined in: canton/index.ts:2582

Build a message targeted at this Canton destination chain, populating missing fields.

Canton lanes require GenericExtraArgsV3. Default finality to finalized when unset. Empty executor is left for the source OnRamp lane defaultExecutor (no-execution on EVM → Canton).

Parameters​

ParameterType
messageMessageInput

Returns​

AnyMessage

Overrides​

Chain.buildMessageForDest


decodeCommits()​

static decodeCommits(_log: Pick<ChainLog, "data">, _lane?: Lane<CCIPVersion>): { maxSeqNr: bigint; merkleRoot: string; minSeqNr: bigint; onRampAddress: string; sourceChainSelector: bigint; }[] | undefined

Defined in: canton/index.ts:2531

Try to decode a commit report from a Canton log.

Parameters​

ParameterType
_logPick<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()​

static decodeExtraArgs(_extraArgs: BytesLike): undefined

Defined in: canton/index.ts:2514

Try to decode extra args serialized for Canton.

Parameters​

ParameterType
_extraArgsBytesLike

Returns​

undefined

undefined (Canton extra args format not yet supported)


decodeMessage()​

static decodeMessage(log: Pick<ChainLog, "data" | "transactionHash">): CCIPMessage | undefined

Defined in: canton/index.ts:2466

Decode a CCIP message from a Canton CCIPMessageSent created event.

log.data must be a single CreatedEvent, as returned per-log by CantonChain.getTransaction (and by CantonChain.sendMessage). The event's createArgument is decoded with the Daml bindings decoder.

Parameters​

ParameterType
logPick<ChainLog, "data" | "transactionHash">

Returns​

CCIPMessage | undefined

The decoded CCIPMessage, or undefined if log.data isn't a decodable CCIPMessageSent created event.


decodeReceipt()​

static decodeReceipt(_log: Pick<ChainLog, "data">): ExecutionReceipt | undefined

Defined in: canton/index.ts:2540

Try to decode an execution receipt from a Canton log.

Parameters​

ParameterType
_logPick<ChainLog, "data">

Returns​

ExecutionReceipt | undefined

undefined (Canton receipt format not yet supported)


encodeExtraArgs()​

static encodeExtraArgs(_extraArgs: ExtraArgs): string

Defined in: canton/index.ts:2523

Encode extraArgs for Canton.

Parameters​

ParameterType
_extraArgsExtraArgs

Returns​

string

Throws​

CCIPNotImplementedError always (not yet implemented for Canton)


fromProvider()​

static fromProvider(provider: CantonRpcProvider, ctx?: ChainContext): Promise<CantonChain>

Defined in: canton/index.ts:464

Creates a CantonChain instance from the given CantonRpcProvider.

Verifies the connection, detects the active network from the provider, and applies the chain's built-in defaults, overridable via ctx.cantonConfig (ccipParty, externalEdsUrlsByOwner, externalTokenStandardUrlsByOwner, indexerUrl, disableAutomaticContractCreation, ccvs, defaultSendGasLimit — all optional).

Parameters​

ParameterTypeDescription
providerCantonRpcProviderCanton provider instance, supplying connectivity and JWT-authenticated requests. Built by the embedder — the CLI builds one from its own CantonCliConfig.
ctx?ChainContextOptional context. logger defaults to console; all cantonConfig fields are optional overrides over the chain defaults.

Returns​

Promise<CantonChain>

A new CantonChain instance.

Throws​

CCIPChainNotFoundError if the provider reports a network with no chain defaults

Throws​

CCIPError (ADDRESS_INVALID) if no ccipParty is configured and the chain has no default

Throws​

CCIPError (METHOD_UNSUPPORTED) if no indexer URL can be resolved


fromUrl()​

static fromUrl(url: string, ctx?: ChainContext): Promise<CantonChain>

Defined in: canton/index.ts:558

Creates a CantonChain instance from a Canton Ledger JSON API URL. Verifies the connection and detects the network.

The URL itself is never dialed: ctx.cantonConfig.provider is required — a CantonRpcProvider supplying connectivity and JWT-authenticated requests must be constructed by the embedder and passed in (this method exists to satisfy the ChainStatic interface; prefer CantonChain.fromProvider directly when you already hold a provider, as the CLI does).

Parameters​

ParameterTypeDescription
urlstringignored.
ctx?ChainContextContext containing the required cantonConfig.provider.

Returns​

Promise<CantonChain>

A new CantonChain instance.

Throws​

CCIPError (METHOD_UNSUPPORTED) when ctx.cantonConfig.provider is missing


getAddress()​

static getAddress(bytes: BytesLike): string

Defined in: canton/index.ts:2552

Receive bytes and try to decode as a Canton address (Daml party ID or contract ID).

Parameters​

ParameterTypeDescription
bytesBytesLikeBytes or string to convert.

Returns​

string

Canton address string.

Throws​

CCIPNotImplementedError if bytes cannot be decoded as a Canton address


getDestLeafHasher()​

static getDestLeafHasher(_lane: Lane, _ctx?: WithLogger): LeafHasher

Defined in: canton/index.ts:2572

Gets the leaf hasher for Canton destination chains.

Parameters​

ParameterType
_laneLane
_ctx?WithLogger

Returns​

LeafHasher

Throws​

CCIPNotImplementedError always (not yet implemented for Canton)


isTxHash()​

static isTxHash(v: unknown): v is string

Defined in: canton/index.ts:2564

Validates that v is a Canton ledger update ID: 1220 multihash prefix + 64 hex chars, optionally 0x-prefixed (see isCantonUpdateId). Anything else — including CCIP message IDs (0x + 64 hex without the 1220 prefix) — is rejected outright.

Parameters​

ParameterType
vunknown

Returns​

v is string