@distrohelena/canton-typescript-sdk 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +16 -0
  2. package/dist/client/canton-client.d.ts +2 -0
  3. package/dist/client/canton-client.js +3 -0
  4. package/dist/client/canton-hashing-client.d.ts +8 -0
  5. package/dist/client/canton-hashing-client.js +16 -0
  6. package/dist/client/external-party-activation-client.d.ts +15 -0
  7. package/dist/client/external-party-activation-client.js +126 -0
  8. package/dist/client/external-party-activation-request.d.ts +15 -0
  9. package/dist/client/external-party-activation-request.js +14 -0
  10. package/dist/client/external-party-activation-response.d.ts +13 -0
  11. package/dist/client/external-party-activation-response.js +12 -0
  12. package/dist/client/service-registry.js +20 -0
  13. package/dist/core/hashing/canton-hash.d.ts +3 -0
  14. package/dist/core/hashing/canton-hash.js +24 -0
  15. package/dist/core/transports/transport.interface.d.ts +8 -0
  16. package/dist/core/types/canton-hash-purpose.d.ts +4 -0
  17. package/dist/core/types/canton-hash-purpose.js +5 -0
  18. package/dist/core/types/requests/add-party-async-request.d.ts +27 -0
  19. package/dist/core/types/requests/add-party-async-request.js +25 -0
  20. package/dist/core/types/requests/clear-party-onboarding-flag-request.d.ts +13 -0
  21. package/dist/core/types/requests/clear-party-onboarding-flag-request.js +12 -0
  22. package/dist/core/types/requests/get-active-contracts-page-request.d.ts +12 -0
  23. package/dist/core/types/requests/get-active-contracts-page-request.js +12 -0
  24. package/dist/core/types/responses/add-party-async-response.d.ts +6 -0
  25. package/dist/core/types/responses/add-party-async-response.js +6 -0
  26. package/dist/core/types/responses/clear-party-onboarding-flag-response.d.ts +8 -0
  27. package/dist/core/types/responses/clear-party-onboarding-flag-response.js +8 -0
  28. package/dist/core/types/responses/get-active-contracts-page-response.d.ts +4 -0
  29. package/dist/core/types/responses/get-active-contracts-page-response.js +4 -0
  30. package/dist/core/types/topology/topology-public-key.d.ts +4 -0
  31. package/dist/core/types/topology/topology-public-key.js +4 -0
  32. package/dist/index.d.ts +10 -0
  33. package/dist/index.js +10 -0
  34. package/dist/services/participant-party-management/participant-party-management-service-client.d.ts +8 -0
  35. package/dist/services/participant-party-management/participant-party-management-service-client.js +8 -0
  36. package/dist/services/state/state-service-client.d.ts +1 -1
  37. package/dist/services/state/state-service-client.js +1 -1
  38. package/dist/transports/grpc/grpc-channel-factory.d.ts +3 -1
  39. package/dist/transports/grpc/grpc-channel-factory.js +8 -0
  40. package/dist/transports/grpc/grpc-transport.d.ts +6 -0
  41. package/dist/transports/grpc/grpc-transport.js +20 -1
  42. package/dist/transports/grpc/mappers/contracts-mapper.d.ts +6 -0
  43. package/dist/transports/grpc/mappers/contracts-mapper.js +40 -19
  44. package/dist/transports/grpc/mappers/participant-party-management-mapper.d.ts +9 -2
  45. package/dist/transports/grpc/mappers/participant-party-management-mapper.js +56 -1
  46. package/dist/transports/grpc/mappers/topology-common-mapper.js +3 -0
  47. package/dist/transports/grpc/mappers/topology-manager-write-mapper.js +17 -2
  48. package/dist/transports/json/json-transport.d.ts +6 -0
  49. package/dist/transports/json/json-transport.js +16 -0
  50. package/package.json +2 -1
package/README.md CHANGED
@@ -36,6 +36,12 @@ Override environment variables:
36
36
  - `SDK_TEST_LEDGER_ENDPOINT`
37
37
  - `SDK_TEST_LEDGER_ADMIN_ENDPOINT`
38
38
  - `SDK_TEST_PARTICIPANT_ADMIN_ENDPOINT`
39
+ - `SDK_TEST_SECONDARY_LEDGER_ENDPOINT`
40
+ - `SDK_TEST_SECONDARY_LEDGER_ADMIN_ENDPOINT`
41
+ - `SDK_TEST_SECONDARY_PARTICIPANT_ADMIN_ENDPOINT`
42
+ - `SDK_TEST_TERTIARY_LEDGER_ENDPOINT`
43
+ - `SDK_TEST_TERTIARY_LEDGER_ADMIN_ENDPOINT`
44
+ - `SDK_TEST_TERTIARY_PARTICIPANT_ADMIN_ENDPOINT`
39
45
 
40
46
  The live harness also supports bearer-token overrides:
41
47
 
@@ -55,6 +61,12 @@ Run:
55
61
  npm run test:live
56
62
  ```
57
63
 
64
+ Experimental multi-host external-party coverage is opt-in:
65
+
66
+ - set `SDK_TEST_ENABLE_MULTI_HOST_EXTERNAL_PARTY=1` to enable the multi-host live spec
67
+ - the default quickstart assumptions cover 2 nodes (`390x` and `490x`)
68
+ - configure the tertiary endpoint variables above to enable the 3-host scenario
69
+
58
70
  ## Shared Client
59
71
 
60
72
  ```ts
@@ -107,6 +119,10 @@ const contracts = await client.stateService.getActiveContractsPageAsync(
107
119
  );
108
120
  ```
109
121
 
122
+ `stateService.getActiveContractsPageAsync(...)` keeps `templateId` as the simple helper path, and on gRPC also supports interface-based ACS reads with `interfaceId`, `includeInterfaceView`, `includeCreatedEventBlob`, `activeAtOffset`, `maxPageSize`, and `pageToken`. JSON remains template-query only.
123
+
124
+ For interface views, do not use `contractService.getContractAsync(...)`. That contract lookup surface cannot return interface views; use `stateService` or `updateService` instead.
125
+
110
126
  `CantonClient` now splits its public surface across the real API boundaries:
111
127
 
112
128
  - ledger services use `ledgerEndpoint`
@@ -26,6 +26,7 @@ import { UpdateServiceClient } from "../services/update/update-service-client.js
26
26
  import { UserManagementServiceClient } from "../services/user-management/user-management-service-client.js";
27
27
  import { VersionServiceClient } from "../services/version/version-service-client.js";
28
28
  import { SynchronizerConnectivityServiceClient } from "../services/synchronizer-connectivity/synchronizer-connectivity-service-client.js";
29
+ import { CantonHashingClient } from "./canton-hashing-client.js";
29
30
  import { CantonClientOptions } from "./canton-client-options.js";
30
31
  export declare class CantonClient {
31
32
  private readonly options;
@@ -59,6 +60,7 @@ export declare class CantonClient {
59
60
  readonly updateService: UpdateServiceClient;
60
61
  readonly eventQueryService: EventQueryServiceClient;
61
62
  readonly contractService: ContractServiceClient;
63
+ readonly hashing: CantonHashingClient;
62
64
  constructor(options: CantonClientOptions);
63
65
  /** Disposes transport-owned resources for this client instance. */
64
66
  disposeAsync(): Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import { NotSupportedError } from "../core/errors/not-supported-error.js";
2
2
  import { TransportKind } from "../core/types/transport-kind.js";
3
+ import { CantonHashingClient } from "./canton-hashing-client.js";
3
4
  import { createServiceRegistry } from "./service-registry.js";
4
5
  export class CantonClient {
5
6
  options;
@@ -33,6 +34,7 @@ export class CantonClient {
33
34
  updateService;
34
35
  eventQueryService;
35
36
  contractService;
37
+ hashing;
36
38
  constructor(options) {
37
39
  this.options = options;
38
40
  if (options.transportKind === TransportKind.json &&
@@ -72,6 +74,7 @@ export class CantonClient {
72
74
  this.updateService = services.updateService;
73
75
  this.eventQueryService = services.eventQueryService;
74
76
  this.contractService = services.contractService;
77
+ this.hashing = new CantonHashingClient();
75
78
  }
76
79
  /** Disposes transport-owned resources for this client instance. */
77
80
  async disposeAsync() {
@@ -0,0 +1,8 @@
1
+ export declare class CantonHashingClient {
2
+ /** Computes a Canton multihash for the provided content and hash purpose. */
3
+ computeHash(content: Uint8Array, purpose: number): Uint8Array;
4
+ /** Computes a Canton multihash as lowercase hexadecimal for the provided content and hash purpose. */
5
+ computeHashHex(content: Uint8Array, purpose: number): string;
6
+ /** Computes the canonical Canton public-key fingerprint from serialized public key bytes. */
7
+ computePublicKeyFingerprint(publicKey: Uint8Array): string;
8
+ }
@@ -0,0 +1,16 @@
1
+ import { computeCantonHash, computeCantonHashHex, } from "../core/hashing/canton-hash.js";
2
+ import { CantonHashPurpose } from "../core/types/canton-hash-purpose.js";
3
+ export class CantonHashingClient {
4
+ /** Computes a Canton multihash for the provided content and hash purpose. */
5
+ computeHash(content, purpose) {
6
+ return computeCantonHash(content, purpose);
7
+ }
8
+ /** Computes a Canton multihash as lowercase hexadecimal for the provided content and hash purpose. */
9
+ computeHashHex(content, purpose) {
10
+ return computeCantonHashHex(content, purpose);
11
+ }
12
+ /** Computes the canonical Canton public-key fingerprint from serialized public key bytes. */
13
+ computePublicKeyFingerprint(publicKey) {
14
+ return computeCantonHashHex(publicKey, CantonHashPurpose.publicKeyFingerprint);
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ import { RequestOptions } from "../core/types/request-options.js";
2
+ import { CantonClient } from "./canton-client.js";
3
+ import { ExternalPartyActivationRequest } from "./external-party-activation-request.js";
4
+ import { ExternalPartyActivationResponse } from "./external-party-activation-response.js";
5
+ /** Coordinates multi-host external-party activation across participant-admin topology reads and writes. gRPC only. */
6
+ export declare class ExternalPartyActivationClient {
7
+ private readonly sourceClient;
8
+ constructor(sourceClient: CantonClient);
9
+ /** Waits for a PartyToParticipant proposal, asks additional participants to co-authorize it, and waits for activation. gRPC only. */
10
+ activateAsync(request: ExternalPartyActivationRequest, options?: RequestOptions): Promise<ExternalPartyActivationResponse>;
11
+ private waitForProposalOrActivationAsync;
12
+ private waitForActivationAsync;
13
+ private readStateAsync;
14
+ private createActivationResponse;
15
+ }
@@ -0,0 +1,126 @@
1
+ import { AuthorizeTopologyTransactionsRequest } from "../core/types/requests/authorize-topology-transactions-request.js";
2
+ import { ListPartyToParticipantRequest } from "../core/types/requests/list-party-to-participant-request.js";
3
+ import { TopologyBaseQuery } from "../core/types/topology/topology-base-query.js";
4
+ import { TopologyStoreId, TopologyStoreKind, TopologyStoreSynchronizer } from "../core/types/topology/topology-store-id.js";
5
+ import { ExternalPartyActivationResponse } from "./external-party-activation-response.js";
6
+ /** Coordinates multi-host external-party activation across participant-admin topology reads and writes. gRPC only. */
7
+ export class ExternalPartyActivationClient {
8
+ sourceClient;
9
+ constructor(sourceClient) {
10
+ this.sourceClient = sourceClient;
11
+ }
12
+ /** Waits for a PartyToParticipant proposal, asks additional participants to co-authorize it, and waits for activation. gRPC only. */
13
+ async activateAsync(request, options) {
14
+ if (request.activationTimeoutMs <= 0) {
15
+ throw new Error(`External party activation timeout must be greater than zero, received ${request.activationTimeoutMs}.`);
16
+ }
17
+ if (request.pollIntervalMs < 0) {
18
+ throw new Error(`External party activation poll interval must be zero or greater, received ${request.pollIntervalMs}.`);
19
+ }
20
+ const initialState = await this.waitForProposalOrActivationAsync(request, options);
21
+ if (initialState.active !== undefined) {
22
+ return this.createActivationResponse(request, initialState.active.context, initialState.active.mapping);
23
+ }
24
+ if (initialState.proposal === undefined) {
25
+ throw new Error(`External party activation did not find an active or proposed PartyToParticipant mapping for '${request.partyId}'.`);
26
+ }
27
+ const transactionHash = convertBytesToHex(initialState.proposal.context.transactionHash);
28
+ if (transactionHash.length === 0) {
29
+ throw new Error(`External party activation could not read a transaction hash for '${request.partyId}'.`);
30
+ }
31
+ const authorizeRequest = new AuthorizeTopologyTransactionsRequest({
32
+ transactionHash,
33
+ mustFullyAuthorize: false,
34
+ store: createSynchronizerStoreId(request.synchronizerId),
35
+ });
36
+ for (const client of request.authorizingClients) {
37
+ await client.topologyManagerWriteService.authorizeAsync(authorizeRequest, options);
38
+ }
39
+ const activatedState = await this.waitForActivationAsync(request, options);
40
+ return this.createActivationResponse(request, activatedState.context, activatedState.mapping);
41
+ }
42
+ async waitForProposalOrActivationAsync(request, options) {
43
+ const startedAt = Date.now();
44
+ while (Date.now() - startedAt <= request.activationTimeoutMs) {
45
+ const state = await this.readStateAsync(request, options);
46
+ if (state.active !== undefined || state.proposal !== undefined) {
47
+ return state;
48
+ }
49
+ await delayAsync(request.pollIntervalMs);
50
+ }
51
+ throw new Error(`External party activation timed out while waiting for a PartyToParticipant proposal for '${request.partyId}' on synchronizer '${request.synchronizerId}'.`);
52
+ }
53
+ async waitForActivationAsync(request, options) {
54
+ const startedAt = Date.now();
55
+ while (Date.now() - startedAt <= request.activationTimeoutMs) {
56
+ const state = await this.readStateAsync(request, options);
57
+ if (state.active !== undefined) {
58
+ return state.active;
59
+ }
60
+ await delayAsync(request.pollIntervalMs);
61
+ }
62
+ throw new Error(`External party activation timed out while waiting for '${request.partyId}' to become active on synchronizer '${request.synchronizerId}'.`);
63
+ }
64
+ async readStateAsync(request, options) {
65
+ const [activeResponse, proposalResponse] = await Promise.all([
66
+ this.sourceClient.topologyManagerReadService.listPartyToParticipantAsync(new ListPartyToParticipantRequest({
67
+ baseQuery: createSynchronizerQuery(request.synchronizerId, false),
68
+ filterParty: request.partyId,
69
+ }), options),
70
+ this.sourceClient.topologyManagerReadService.listPartyToParticipantAsync(new ListPartyToParticipantRequest({
71
+ baseQuery: createSynchronizerQuery(request.synchronizerId, true),
72
+ filterParty: request.partyId,
73
+ }), options),
74
+ ]);
75
+ const active = activeResponse.results.find((item) => item.item.party === request.partyId);
76
+ const proposal = proposalResponse.results.find((item) => item.item.party === request.partyId);
77
+ return {
78
+ active: active === undefined || active.context === undefined
79
+ ? undefined
80
+ : {
81
+ context: active.context,
82
+ mapping: active.item,
83
+ },
84
+ proposal: proposal === undefined || proposal.context === undefined
85
+ ? undefined
86
+ : {
87
+ context: proposal.context,
88
+ mapping: proposal.item,
89
+ },
90
+ };
91
+ }
92
+ createActivationResponse(request, context, mapping) {
93
+ return new ExternalPartyActivationResponse({
94
+ partyId: request.partyId,
95
+ synchronizerId: request.synchronizerId,
96
+ transactionHash: convertBytesToHex(context.transactionHash),
97
+ mapping,
98
+ });
99
+ }
100
+ }
101
+ function createSynchronizerStoreId(synchronizerId) {
102
+ return new TopologyStoreId({
103
+ kind: TopologyStoreKind.synchronizer,
104
+ synchronizer: new TopologyStoreSynchronizer({
105
+ id: synchronizerId,
106
+ }),
107
+ });
108
+ }
109
+ function createSynchronizerQuery(synchronizerId, includeProposals) {
110
+ return new TopologyBaseQuery({
111
+ storeId: createSynchronizerStoreId(synchronizerId),
112
+ includeProposals,
113
+ headState: true,
114
+ });
115
+ }
116
+ function convertBytesToHex(value) {
117
+ return Array.from(value, (item) => item.toString(16).padStart(2, "0")).join("");
118
+ }
119
+ async function delayAsync(durationMs) {
120
+ if (durationMs <= 0) {
121
+ return;
122
+ }
123
+ await new Promise((resolve) => {
124
+ setTimeout(resolve, durationMs);
125
+ });
126
+ }
@@ -0,0 +1,15 @@
1
+ import type { CantonClient } from "./canton-client.js";
2
+ export declare class ExternalPartyActivationRequest {
3
+ readonly partyId: string;
4
+ readonly synchronizerId: string;
5
+ readonly authorizingClients: readonly CantonClient[];
6
+ readonly activationTimeoutMs: number;
7
+ readonly pollIntervalMs: number;
8
+ constructor(init: {
9
+ partyId: string;
10
+ synchronizerId: string;
11
+ authorizingClients?: readonly CantonClient[];
12
+ activationTimeoutMs?: number;
13
+ pollIntervalMs?: number;
14
+ });
15
+ }
@@ -0,0 +1,14 @@
1
+ export class ExternalPartyActivationRequest {
2
+ partyId;
3
+ synchronizerId;
4
+ authorizingClients;
5
+ activationTimeoutMs;
6
+ pollIntervalMs;
7
+ constructor(init) {
8
+ this.partyId = init.partyId;
9
+ this.synchronizerId = init.synchronizerId;
10
+ this.authorizingClients = [...(init.authorizingClients ?? [])];
11
+ this.activationTimeoutMs = init.activationTimeoutMs ?? 45_000;
12
+ this.pollIntervalMs = init.pollIntervalMs ?? 500;
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ import { PartyToParticipant } from "../core/types/topology/party-to-participant.js";
2
+ export declare class ExternalPartyActivationResponse {
3
+ readonly partyId: string;
4
+ readonly synchronizerId: string;
5
+ readonly transactionHash: string;
6
+ readonly mapping: PartyToParticipant;
7
+ constructor(init: {
8
+ partyId: string;
9
+ synchronizerId: string;
10
+ transactionHash: string;
11
+ mapping: PartyToParticipant;
12
+ });
13
+ }
@@ -0,0 +1,12 @@
1
+ export class ExternalPartyActivationResponse {
2
+ partyId;
3
+ synchronizerId;
4
+ transactionHash;
5
+ mapping;
6
+ constructor(init) {
7
+ this.partyId = init.partyId;
8
+ this.synchronizerId = init.synchronizerId;
9
+ this.transactionHash = init.transactionHash;
10
+ this.mapping = init.mapping;
11
+ }
12
+ }
@@ -188,6 +188,14 @@ class PlaceholderTransport {
188
188
  this.throwIfDisposed();
189
189
  throw new TransportError("received ACS commitment inspection is not available yet");
190
190
  }
191
+ async addPartyAsync(_request, _options) {
192
+ this.throwIfDisposed();
193
+ throw new TransportError("participant party replication is not available yet");
194
+ }
195
+ async clearPartyOnboardingFlagAsync(_request, _options) {
196
+ this.throwIfDisposed();
197
+ throw new TransportError("party onboarding flag clearing is not available yet");
198
+ }
191
199
  async getHighestOffsetByTimestampAsync(_request, _options) {
192
200
  this.throwIfDisposed();
193
201
  throw new TransportError("highest offset by timestamp is not available yet");
@@ -536,6 +544,12 @@ class MissingEndpointTransport {
536
544
  async lookupReceivedAcsCommitmentsAsync() {
537
545
  this.throwMissingEndpoint();
538
546
  }
547
+ async addPartyAsync() {
548
+ this.throwMissingEndpoint();
549
+ }
550
+ async clearPartyOnboardingFlagAsync() {
551
+ this.throwMissingEndpoint();
552
+ }
539
553
  async getHighestOffsetByTimestampAsync() {
540
554
  this.throwMissingEndpoint();
541
555
  }
@@ -825,6 +839,12 @@ class CompositeTransport {
825
839
  async lookupReceivedAcsCommitmentsAsync() {
826
840
  throw new TransportError("Composite transport does not forward service calls.");
827
841
  }
842
+ async addPartyAsync() {
843
+ throw new TransportError("Composite transport does not forward service calls.");
844
+ }
845
+ async clearPartyOnboardingFlagAsync() {
846
+ throw new TransportError("Composite transport does not forward service calls.");
847
+ }
828
848
  async getHighestOffsetByTimestampAsync() {
829
849
  throw new TransportError("Composite transport does not forward service calls.");
830
850
  }
@@ -0,0 +1,3 @@
1
+ export declare function computeCantonHash(content: Uint8Array, purpose: number): Uint8Array;
2
+ export declare function computeCantonHashHex(content: Uint8Array, purpose: number): string;
3
+ export declare function computeCantonPublicKeyFingerprint(publicKey: Uint8Array | undefined): string | undefined;
@@ -0,0 +1,24 @@
1
+ import { createHash } from "node:crypto";
2
+ import { CantonHashPurpose } from "../types/canton-hash-purpose.js";
3
+ const sha256MultihashPrefix = new Uint8Array([0x12, 0x20]);
4
+ export function computeCantonHash(content, purpose) {
5
+ const purposePrefix = Buffer.alloc(4);
6
+ purposePrefix.writeUInt32BE(purpose, 0);
7
+ const digest = createHash("sha256")
8
+ .update(purposePrefix)
9
+ .update(content)
10
+ .digest();
11
+ return new Uint8Array(Buffer.concat([
12
+ Buffer.from(sha256MultihashPrefix),
13
+ digest,
14
+ ]));
15
+ }
16
+ export function computeCantonHashHex(content, purpose) {
17
+ return Buffer.from(computeCantonHash(content, purpose)).toString("hex");
18
+ }
19
+ export function computeCantonPublicKeyFingerprint(publicKey) {
20
+ if (publicKey === undefined || publicKey.length === 0) {
21
+ return undefined;
22
+ }
23
+ return computeCantonHashHex(publicKey, CantonHashPurpose.publicKeyFingerprint);
24
+ }
@@ -1,8 +1,10 @@
1
1
  import { TransportFeatures } from "./transport-features.interface.js";
2
2
  import { AllocateExternalPartyRequest } from "../types/requests/allocate-external-party-request.js";
3
3
  import { AllocatePartyRequest } from "../types/requests/allocate-party-request.js";
4
+ import { AddPartyAsyncRequest } from "../types/requests/add-party-async-request.js";
4
5
  import { AddTopologyTransactionsRequest } from "../types/requests/add-topology-transactions-request.js";
5
6
  import { AuthorizeTopologyTransactionsRequest } from "../types/requests/authorize-topology-transactions-request.js";
7
+ import { ClearPartyOnboardingFlagRequest } from "../types/requests/clear-party-onboarding-flag-request.js";
6
8
  import { GrantUserRightsRequest } from "../types/requests/grant-user-rights-request.js";
7
9
  import { CreateTemporaryTopologyStoreRequest } from "../types/requests/create-temporary-topology-store-request.js";
8
10
  import { GetActiveContractsPageRequest } from "../types/requests/get-active-contracts-page-request.js";
@@ -127,9 +129,11 @@ import { GetActiveContractsPageResponse } from "../types/responses/get-active-co
127
129
  import { GetLedgerApiVersionResponse } from "../types/responses/get-ledger-api-version-response.js";
128
130
  import { GetUpdatesPageResponse } from "../types/responses/get-updates-page-response.js";
129
131
  import { GetUserResponse } from "../types/responses/get-user-response.js";
132
+ import { AddPartyAsyncResponse } from "../types/responses/add-party-async-response.js";
130
133
  import { AddTopologyTransactionsResponse } from "../types/responses/add-topology-transactions-response.js";
131
134
  import { AllocateExternalPartyResponse } from "../types/responses/allocate-external-party-response.js";
132
135
  import { AuthorizeTopologyTransactionsResponse } from "../types/responses/authorize-topology-transactions-response.js";
136
+ import { ClearPartyOnboardingFlagResponse } from "../types/responses/clear-party-onboarding-flag-response.js";
133
137
  import { CreateTemporaryTopologyStoreResponse } from "../types/responses/create-temporary-topology-store-response.js";
134
138
  import { DropTemporaryTopologyStoreResponse } from "../types/responses/drop-temporary-topology-store-response.js";
135
139
  import { GenerateTopologyTransactionsResponse } from "../types/responses/generate-topology-transactions-response.js";
@@ -260,6 +264,10 @@ export interface ITransport {
260
264
  lookupSentAcsCommitmentsAsync(request: LookupSentAcsCommitmentsRequest, options?: RequestOptions): Promise<LookupSentAcsCommitmentsResponse>;
261
265
  /** Reads received ACS commitments. Supported on gRPC; JSON rejects it. */
262
266
  lookupReceivedAcsCommitmentsAsync(request: LookupReceivedAcsCommitmentsRequest, options?: RequestOptions): Promise<LookupReceivedAcsCommitmentsResponse>;
267
+ /** Starts online party replication on the target participant. Supported on gRPC; JSON rejects it. */
268
+ addPartyAsync(request: AddPartyAsyncRequest, options?: RequestOptions): Promise<AddPartyAsyncResponse>;
269
+ /** Clears an onboarding flag on the target participant. Supported on gRPC; JSON rejects it. */
270
+ clearPartyOnboardingFlagAsync(request: ClearPartyOnboardingFlagRequest, options?: RequestOptions): Promise<ClearPartyOnboardingFlagResponse>;
263
271
  /** Reads the highest participant ledger offset before or at a timestamp. Supported on gRPC; JSON rejects it. */
264
272
  getHighestOffsetByTimestampAsync(request: GetHighestOffsetByTimestampRequest, options?: RequestOptions): Promise<GetHighestOffsetByTimestampResponse>;
265
273
  /** Reads the safe participant pruning offset. Supported on gRPC; JSON rejects it. */
@@ -0,0 +1,4 @@
1
+ export declare enum CantonHashPurpose {
2
+ topologyTransactionSignature = 11,
3
+ publicKeyFingerprint = 12
4
+ }
@@ -0,0 +1,5 @@
1
+ export var CantonHashPurpose;
2
+ (function (CantonHashPurpose) {
3
+ CantonHashPurpose[CantonHashPurpose["topologyTransactionSignature"] = 11] = "topologyTransactionSignature";
4
+ CantonHashPurpose[CantonHashPurpose["publicKeyFingerprint"] = 12] = "publicKeyFingerprint";
5
+ })(CantonHashPurpose || (CantonHashPurpose = {}));
@@ -0,0 +1,27 @@
1
+ import { ParticipantPermission } from "../topology/participant-permission.js";
2
+ export declare class AddPartyAsyncArguments {
3
+ readonly partyId: string;
4
+ readonly synchronizerId: string;
5
+ readonly sourceParticipantUid: string;
6
+ readonly topologySerial: number;
7
+ readonly participantPermission: ParticipantPermission;
8
+ constructor(init: {
9
+ partyId: string;
10
+ synchronizerId: string;
11
+ sourceParticipantUid: string;
12
+ topologySerial: number;
13
+ participantPermission?: ParticipantPermission;
14
+ });
15
+ }
16
+ export declare class AddPartyAsyncRequest {
17
+ readonly arguments: AddPartyAsyncArguments;
18
+ constructor(init: {
19
+ arguments: AddPartyAsyncArguments | {
20
+ partyId: string;
21
+ synchronizerId: string;
22
+ sourceParticipantUid: string;
23
+ topologySerial: number;
24
+ participantPermission?: ParticipantPermission;
25
+ };
26
+ });
27
+ }
@@ -0,0 +1,25 @@
1
+ import { ParticipantPermission } from "../topology/participant-permission.js";
2
+ export class AddPartyAsyncArguments {
3
+ partyId;
4
+ synchronizerId;
5
+ sourceParticipantUid;
6
+ topologySerial;
7
+ participantPermission;
8
+ constructor(init) {
9
+ this.partyId = init.partyId;
10
+ this.synchronizerId = init.synchronizerId;
11
+ this.sourceParticipantUid = init.sourceParticipantUid;
12
+ this.topologySerial = init.topologySerial;
13
+ this.participantPermission =
14
+ init.participantPermission ?? ParticipantPermission.unspecified;
15
+ }
16
+ }
17
+ export class AddPartyAsyncRequest {
18
+ arguments;
19
+ constructor(init) {
20
+ this.arguments =
21
+ init.arguments instanceof AddPartyAsyncArguments
22
+ ? init.arguments
23
+ : new AddPartyAsyncArguments(init.arguments);
24
+ }
25
+ }
@@ -0,0 +1,13 @@
1
+ import { TopologyDuration } from "../topology/topology-duration.js";
2
+ export declare class ClearPartyOnboardingFlagRequest {
3
+ readonly partyId: string;
4
+ readonly synchronizerId: string;
5
+ readonly beginOffsetExclusive: string;
6
+ readonly waitForActivationTimeout?: TopologyDuration;
7
+ constructor(init: {
8
+ partyId: string;
9
+ synchronizerId: string;
10
+ beginOffsetExclusive: string;
11
+ waitForActivationTimeout?: TopologyDuration;
12
+ });
13
+ }
@@ -0,0 +1,12 @@
1
+ export class ClearPartyOnboardingFlagRequest {
2
+ partyId;
3
+ synchronizerId;
4
+ beginOffsetExclusive;
5
+ waitForActivationTimeout;
6
+ constructor(init) {
7
+ this.partyId = init.partyId;
8
+ this.synchronizerId = init.synchronizerId;
9
+ this.beginOffsetExclusive = init.beginOffsetExclusive;
10
+ this.waitForActivationTimeout = init.waitForActivationTimeout;
11
+ }
12
+ }
@@ -1,8 +1,20 @@
1
1
  export declare class GetActiveContractsPageRequest {
2
2
  readonly party: string;
3
3
  readonly templateId?: string;
4
+ readonly interfaceId?: string;
5
+ readonly includeInterfaceView?: boolean;
6
+ readonly includeCreatedEventBlob?: boolean;
7
+ readonly activeAtOffset?: string;
8
+ readonly maxPageSize?: number;
9
+ readonly pageToken?: Uint8Array;
4
10
  constructor(init: {
5
11
  party: string;
6
12
  templateId?: string;
13
+ interfaceId?: string;
14
+ includeInterfaceView?: boolean;
15
+ includeCreatedEventBlob?: boolean;
16
+ activeAtOffset?: string;
17
+ maxPageSize?: number;
18
+ pageToken?: Uint8Array;
7
19
  });
8
20
  }
@@ -1,8 +1,20 @@
1
1
  export class GetActiveContractsPageRequest {
2
2
  party;
3
3
  templateId;
4
+ interfaceId;
5
+ includeInterfaceView;
6
+ includeCreatedEventBlob;
7
+ activeAtOffset;
8
+ maxPageSize;
9
+ pageToken;
4
10
  constructor(init) {
5
11
  this.party = init.party;
6
12
  this.templateId = init.templateId;
13
+ this.interfaceId = init.interfaceId;
14
+ this.includeInterfaceView = init.includeInterfaceView;
15
+ this.includeCreatedEventBlob = init.includeCreatedEventBlob;
16
+ this.activeAtOffset = init.activeAtOffset;
17
+ this.maxPageSize = init.maxPageSize;
18
+ this.pageToken = init.pageToken;
7
19
  }
8
20
  }
@@ -0,0 +1,6 @@
1
+ export declare class AddPartyAsyncResponse {
2
+ readonly addPartyRequestId: string;
3
+ constructor(init?: {
4
+ addPartyRequestId?: string;
5
+ });
6
+ }
@@ -0,0 +1,6 @@
1
+ export class AddPartyAsyncResponse {
2
+ addPartyRequestId;
3
+ constructor(init = {}) {
4
+ this.addPartyRequestId = init.addPartyRequestId ?? "";
5
+ }
6
+ }
@@ -0,0 +1,8 @@
1
+ export declare class ClearPartyOnboardingFlagResponse {
2
+ readonly onboarded: boolean;
3
+ readonly earliestRetryTimestamp?: Date;
4
+ constructor(init?: {
5
+ onboarded?: boolean;
6
+ earliestRetryTimestamp?: Date;
7
+ });
8
+ }
@@ -0,0 +1,8 @@
1
+ export class ClearPartyOnboardingFlagResponse {
2
+ onboarded;
3
+ earliestRetryTimestamp;
4
+ constructor(init = {}) {
5
+ this.onboarded = init.onboarded ?? false;
6
+ this.earliestRetryTimestamp = init.earliestRetryTimestamp;
7
+ }
8
+ }
@@ -1,6 +1,10 @@
1
1
  export declare class GetActiveContractsPageResponse<TContract = unknown> {
2
2
  readonly contracts: readonly TContract[];
3
+ readonly activeAtOffset?: string;
4
+ readonly nextPageToken?: Uint8Array;
3
5
  constructor(init: {
4
6
  contracts: readonly TContract[];
7
+ activeAtOffset?: string;
8
+ nextPageToken?: Uint8Array;
5
9
  });
6
10
  }
@@ -1,6 +1,10 @@
1
1
  export class GetActiveContractsPageResponse {
2
2
  contracts;
3
+ activeAtOffset;
4
+ nextPageToken;
3
5
  constructor(init) {
4
6
  this.contracts = init.contracts;
7
+ this.activeAtOffset = init.activeAtOffset;
8
+ this.nextPageToken = init.nextPageToken;
5
9
  }
6
10
  }
@@ -1,10 +1,12 @@
1
1
  export declare class TopologySigningPublicKey {
2
+ readonly fingerprint?: string;
2
3
  readonly format?: string;
3
4
  readonly publicKey: Uint8Array;
4
5
  readonly scheme?: string;
5
6
  readonly usage: string[];
6
7
  readonly keySpec?: string;
7
8
  constructor(init?: {
9
+ fingerprint?: string;
8
10
  format?: string;
9
11
  publicKey?: Uint8Array;
10
12
  scheme?: string;
@@ -13,11 +15,13 @@ export declare class TopologySigningPublicKey {
13
15
  });
14
16
  }
15
17
  export declare class TopologyEncryptionPublicKey {
18
+ readonly fingerprint?: string;
16
19
  readonly format?: string;
17
20
  readonly publicKey: Uint8Array;
18
21
  readonly scheme?: string;
19
22
  readonly keySpec?: string;
20
23
  constructor(init?: {
24
+ fingerprint?: string;
21
25
  format?: string;
22
26
  publicKey?: Uint8Array;
23
27
  scheme?: string;