@layerzerolabs/common-canton 1.2.25 → 1.2.28
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.
- package/dist/{H3BWRDYY.js → 25GBI5E7.js} +3 -3
- package/dist/{H3BWRDYY.js.map → 25GBI5E7.js.map} +1 -1
- package/dist/{A2ZXPTGE.js → 3RGRZQQT.js} +4 -4
- package/dist/{A2ZXPTGE.js.map → 3RGRZQQT.js.map} +1 -1
- package/dist/{AVC5GQFU.js → 3T46OKQU.js} +3 -3
- package/dist/{AVC5GQFU.js.map → 3T46OKQU.js.map} +1 -1
- package/dist/{OO73Z5K6.js → 4FW6H35F.js} +3 -3
- package/dist/{OO73Z5K6.js.map → 4FW6H35F.js.map} +1 -1
- package/dist/{JUZKQC2G.js → 7STDATVZ.js} +3 -3
- package/dist/{JUZKQC2G.js.map → 7STDATVZ.js.map} +1 -1
- package/dist/{OIFJOKIO.js → 7ZK6FSHF.js} +3 -3
- package/dist/{OIFJOKIO.js.map → 7ZK6FSHF.js.map} +1 -1
- package/dist/{N3INXXRG.js → AMLJTQWB.js} +3 -3
- package/dist/{N3INXXRG.js.map → AMLJTQWB.js.map} +1 -1
- package/dist/{22ZNNS3H.js → BAIUJA2D.js} +3 -3
- package/dist/{22ZNNS3H.js.map → BAIUJA2D.js.map} +1 -1
- package/dist/{OUEL7K27.js → BFNNJFWC.js} +3 -3
- package/dist/{OUEL7K27.js.map → BFNNJFWC.js.map} +1 -1
- package/dist/{OZZHAISY.js → CLAE73FR.js} +3 -3
- package/dist/{OZZHAISY.js.map → CLAE73FR.js.map} +1 -1
- package/dist/{NX67V54F.js → DAP5XJGH.js} +3 -3
- package/dist/{NX67V54F.js.map → DAP5XJGH.js.map} +1 -1
- package/dist/{SNDN7G42.js → DJ67CXMJ.js} +3 -3
- package/dist/{SNDN7G42.js.map → DJ67CXMJ.js.map} +1 -1
- package/dist/{DDAINXFD.js → EWDK2D2A.js} +3 -3
- package/dist/{DDAINXFD.js.map → EWDK2D2A.js.map} +1 -1
- package/dist/{ZZCNITRN.js → FFZGONTK.js} +3 -3
- package/dist/{ZZCNITRN.js.map → FFZGONTK.js.map} +1 -1
- package/dist/{KJRFPBY4.js → FXR2Z54G.js} +3 -3
- package/dist/{KJRFPBY4.js.map → FXR2Z54G.js.map} +1 -1
- package/dist/{NJW7UX2A.js → GSEDMLUC.js} +3 -3
- package/dist/{NJW7UX2A.js.map → GSEDMLUC.js.map} +1 -1
- package/dist/{AWR6H7TM.js → I7FWUGTT.js} +23 -3
- package/dist/I7FWUGTT.js.map +1 -0
- package/dist/{PDIG5OUV.js → IIQYRITU.js} +3 -3
- package/dist/{PDIG5OUV.js.map → IIQYRITU.js.map} +1 -1
- package/dist/{BHESIRKK.js → IOW2523G.js} +3 -3
- package/dist/{BHESIRKK.js.map → IOW2523G.js.map} +1 -1
- package/dist/{QNO3456Y.js → KVXEYMWG.js} +3 -3
- package/dist/{QNO3456Y.js.map → KVXEYMWG.js.map} +1 -1
- package/dist/{S55KRBEC.js → KYBLHMHO.js} +6 -5
- package/dist/KYBLHMHO.js.map +1 -0
- package/dist/{4PEF77PU.js → MCD2CFLV.js} +3 -3
- package/dist/{4PEF77PU.js.map → MCD2CFLV.js.map} +1 -1
- package/dist/MIPVIR2V.js +68 -0
- package/dist/MIPVIR2V.js.map +1 -0
- package/dist/{TZTIULG5.js → MNIG6M5P.js} +21 -21
- package/dist/{TZTIULG5.js.map → MNIG6M5P.js.map} +1 -1
- package/dist/{FZGCL63V.js → NVDYBSHG.js} +3 -3
- package/dist/{FZGCL63V.js.map → NVDYBSHG.js.map} +1 -1
- package/dist/{GHWJBJNB.js → OQVZLKQ5.js} +3 -3
- package/dist/{GHWJBJNB.js.map → OQVZLKQ5.js.map} +1 -1
- package/dist/{RHNMCG3C.js → Q4H5IB4B.js} +3 -3
- package/dist/{RHNMCG3C.js.map → Q4H5IB4B.js.map} +1 -1
- package/dist/{KCFOSGPU.js → QZJONP6W.js} +3 -3
- package/dist/{KCFOSGPU.js.map → QZJONP6W.js.map} +1 -1
- package/dist/{3ESWXEO3.js → RJHKVYCL.js} +3 -3
- package/dist/{3ESWXEO3.js.map → RJHKVYCL.js.map} +1 -1
- package/dist/{R5PCNLRD.js → TDLALQCM.js} +3 -3
- package/dist/{R5PCNLRD.js.map → TDLALQCM.js.map} +1 -1
- package/dist/{KIQAFHKC.js → UV3W5HVQ.js} +3 -3
- package/dist/{KIQAFHKC.js.map → UV3W5HVQ.js.map} +1 -1
- package/dist/{CXQSVBVW.js → VJ4PVZYL.js} +2 -2
- package/dist/VJ4PVZYL.js.map +1 -0
- package/dist/{QJMVWOLL.js → VJP6DRFT.js} +3 -3
- package/dist/{QJMVWOLL.js.map → VJP6DRFT.js.map} +1 -1
- package/dist/{OWXOYIMA.js → W5H6OVFB.js} +3 -3
- package/dist/{OWXOYIMA.js.map → W5H6OVFB.js.map} +1 -1
- package/dist/{HKUMVSX6.js → WAKNWPCR.js} +4 -4
- package/dist/{HKUMVSX6.js.map → WAKNWPCR.js.map} +1 -1
- package/dist/{NRGCZ4DG.js → WRKQRG6I.js} +4 -4
- package/dist/{NRGCZ4DG.js.map → WRKQRG6I.js.map} +1 -1
- package/dist/{WUXXJWII.js → WUXBJ4EJ.js} +3 -3
- package/dist/{WUXXJWII.js.map → WUXBJ4EJ.js.map} +1 -1
- package/dist/{CYZU3DTJ.js → WXYN3MFC.js} +3 -3
- package/dist/{CYZU3DTJ.js.map → WXYN3MFC.js.map} +1 -1
- package/dist/client/canton-client.js +87 -87
- package/dist/client/grpc.d.ts +1 -0
- package/dist/client/grpc.d.ts.map +1 -1
- package/dist/client/grpc.js +3 -2
- package/dist/client/index.js +93 -92
- package/dist/client/topology/synchronizer-connectivity.d.ts.map +1 -1
- package/dist/client/topology/synchronizer-connectivity.js +1 -1
- package/dist/client/topology/types.d.ts +2 -0
- package/dist/client/topology/types.d.ts.map +1 -1
- package/dist/client/user-management.d.ts +21 -0
- package/dist/client/user-management.d.ts.map +1 -0
- package/dist/client/user-management.js +4 -0
- package/dist/client/user-management.js.map +1 -0
- package/dist/index.js +96 -95
- package/dist/open-api/apis/DefaultApi.js +85 -85
- package/dist/open-api/apis/index.js +85 -85
- package/dist/open-api/index.js +85 -85
- package/dist/open-api/models/Completion.js +1 -1
- package/dist/open-api/models/Completion1.js +1 -1
- package/dist/open-api/models/CompletionResponse.js +5 -5
- package/dist/open-api/models/CompletionResponseOneOf.js +1 -1
- package/dist/open-api/models/CompletionStreamResponse.js +5 -5
- package/dist/open-api/models/CreateUserRequest.js +4 -4
- package/dist/open-api/models/CumulativeFilter.js +2 -2
- package/dist/open-api/models/DeduplicationPeriod1.js +1 -1
- package/dist/open-api/models/DeduplicationPeriod2.js +2 -2
- package/dist/open-api/models/EventFormat.js +2 -2
- package/dist/open-api/models/FeaturesDescriptor.js +2 -2
- package/dist/open-api/models/Filters.js +2 -2
- package/dist/open-api/models/GetActiveContractsRequest.js +2 -2
- package/dist/open-api/models/GetEventsByContractIdRequest.js +2 -2
- package/dist/open-api/models/GetLedgerApiVersionResponse.js +3 -3
- package/dist/open-api/models/GetTransactionByIdRequest.js +2 -2
- package/dist/open-api/models/GetTransactionByOffsetRequest.js +2 -2
- package/dist/open-api/models/GetUpdateByIdRequest.js +2 -2
- package/dist/open-api/models/GetUpdateByOffsetRequest.js +2 -2
- package/dist/open-api/models/GetUpdatesRequest.js +2 -2
- package/dist/open-api/models/GrantUserRightsRequest.js +4 -4
- package/dist/open-api/models/GrantUserRightsResponse.js +4 -4
- package/dist/open-api/models/IdentifierFilter.js +2 -2
- package/dist/open-api/models/JsExecuteSubmissionAndWaitForTransactionRequest.js +5 -5
- package/dist/open-api/models/JsExecuteSubmissionAndWaitRequest.js +3 -3
- package/dist/open-api/models/JsExecuteSubmissionRequest.js +3 -3
- package/dist/open-api/models/JsGetUpdateResponse.js +17 -17
- package/dist/open-api/models/JsGetUpdateTreesResponse.js +10 -10
- package/dist/open-api/models/JsGetUpdatesResponse.js +17 -17
- package/dist/open-api/models/JsReassignment.js +4 -4
- package/dist/open-api/models/JsReassignmentEvent.js +3 -3
- package/dist/open-api/models/JsSubmitAndWaitForReassignmentResponse.js +5 -5
- package/dist/open-api/models/JsSubmitAndWaitForTransactionRequest.js +2 -2
- package/dist/open-api/models/JsTopologyTransaction.js +6 -6
- package/dist/open-api/models/Kind.js +2 -2
- package/dist/open-api/models/ListUserRightsResponse.js +4 -4
- package/dist/open-api/models/Reassignment.js +5 -5
- package/dist/open-api/models/Reassignment1.js +5 -5
- package/dist/open-api/models/RevokeUserRightsRequest.js +4 -4
- package/dist/open-api/models/RevokeUserRightsResponse.js +4 -4
- package/dist/open-api/models/Right.js +3 -3
- package/dist/open-api/models/SubmitAndWaitForReassignmentRequest.js +2 -2
- package/dist/open-api/models/TopologyEvent.js +5 -5
- package/dist/open-api/models/TopologyEventEvent.js +4 -4
- package/dist/open-api/models/TopologyTransaction.js +7 -7
- package/dist/open-api/models/TransactionFilter.js +2 -2
- package/dist/open-api/models/TransactionFormat.js +2 -2
- package/dist/open-api/models/Update.js +16 -16
- package/dist/open-api/models/Update1.js +9 -9
- package/dist/open-api/models/Update1OneOf1.js +6 -6
- package/dist/open-api/models/UpdateFormat.js +2 -2
- package/dist/open-api/models/UpdateOneOf1.js +6 -6
- package/dist/open-api/models/UpdateOneOf2.js +8 -8
- package/dist/open-api/models/index.js +84 -84
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +94 -93
- package/dist/refresh/index.js +2 -2
- package/dist/refresh/resolve.js +2 -2
- package/package.json +11 -11
- package/src/client/grpc.ts +16 -0
- package/src/client/topology/synchronizer-connectivity.ts +3 -2
- package/src/client/topology/types.ts +2 -0
- package/src/client/user-management.ts +74 -0
- package/src/provider.ts +1 -0
- package/.turbo/turbo-build.log +0 -2038
- package/.turbo/turbo-lint.log +0 -4
- package/.turbo/turbo-test.log +0 -771
- package/dist/AWR6H7TM.js.map +0 -1
- package/dist/CXQSVBVW.js.map +0 -1
- package/dist/S55KRBEC.js.map +0 -1
package/dist/AWR6H7TM.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client/grpc.ts"],"names":["DEFAULT_GRPC_CLIENT_OPTIONS","CantonGrpcClient","opts","tokenProvider","synchronizerId","GrpcTransport","host","channelCredentials","buildChannelCredentials","tls","clientOptions","grpcClientOptions","TopologyManagerReadServiceClient","TopologyManagerWriteServiceClient","SynchronizerConnectivityServiceClient","token","getToken","Authorization","response","listConnectedSynchronizers","meta","synchronizer","connectedSynchronizers","CantonProtocolError","mapping","serial","generateTransactions","GenerateTransactionsRequest","create","proposals","GenerateTransactionsRequest_Proposal","operation","Enums_TopologyChangeOp","ADD_REPLACE","store","synchronizerStore","generated","generatedTransactions","getNamespaceDelegation","namespaceFingerprint","listNamespaceDelegation","ListNamespaceDelegationRequest","baseQuery","headStateBaseQuery","filterNamespace","filterTargetKeyFingerprint","results","flatMap","result","item","publicKey","targetKey","namespace","targetKeyFingerprint","computePublicKeyFingerprint","isRootDelegation","context","getDecentralizedNamespaceDefinition","listDecentralizedNamespaceDefinition","ListDecentralizedNamespaceDefinitionRequest","decentralizedNamespace","threshold","owners","getPartyToKeyMapping","partyId","listPartyToKeyMapping","ListPartyToKeyMappingRequest","filterParty","party","signingKeyFingerprints","signingKeys","map","key","getPartyToParticipantMapping","listPartyToParticipant","ListPartyToParticipantRequest","filterParticipant","participants","participant","participantUid","permission","createNamespaceDelegationTx","params","buildNamespaceDelegationMapping","publicKeyDer","createDecentralizedNamespaceDefinitionTx","computeDecentralizedNamespace","buildDecentralizedNamespaceDefinitionMapping","updateDecentralizedNamespaceDefinitionTx","createPartyToKeyTx","buildPartyToKeyMapping","signingPublicKeyDers","createPartyToParticipantTx","buildPartyToParticipantMapping","participantIds","submitTopologyTransactions","transactions","length","CantonError","addTransactions","AddTransactionsRequest","close"],"mappings":";;;;;;;;;AA+CA,IAAMA,2BAAAA,GAA8B;AAChC,EAAA,iCAAA,EAAmC,MAA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,CAAA;AAEtC,EAAA;;EAGAiF,KAAAA,GAAc;AACV,IAAA,IAAA,CAAK,WAAWA,KAAAA,EAAK;AACzB,EAAA;AACJ","file":"AWR6H7TM.js","sourcesContent":["import {\n AddTransactionsRequest,\n Enums_TopologyChangeOp,\n GenerateTransactionsRequest,\n GenerateTransactionsRequest_Proposal,\n ListDecentralizedNamespaceDefinitionRequest,\n ListNamespaceDelegationRequest,\n ListPartyToKeyMappingRequest,\n ListPartyToParticipantRequest,\n type SignedTopologyTransaction,\n TopologyManagerReadServiceClient,\n TopologyManagerWriteServiceClient,\n type TopologyMapping,\n} from '@canton-network/core-ledger-proto';\nimport { GrpcTransport } from '@protobuf-ts/grpc-transport';\n\nimport type { TokenProvider } from '../auth/token-provider';\nimport { CantonError, CantonProtocolError } from '../errors';\nimport {\n buildDecentralizedNamespaceDefinitionMapping,\n buildNamespaceDelegationMapping,\n buildPartyToKeyMapping,\n buildPartyToParticipantMapping,\n} from './topology/mappings';\nimport { SynchronizerConnectivityServiceClient } from './topology/synchronizer-connectivity';\nimport type {\n CantonGrpcClientOptions,\n CreateDecentralizedNamespaceDefinitionTxParams,\n CreateNamespaceDelegationTxParams,\n CreatePartyToKeyMappingTxParams,\n CreatePartyToParticipantMappingTxParams,\n DecentralizedNamespaceDefinitionState,\n GeneratedTopologyTransaction,\n NamespaceDelegationState,\n PartyToKeyMappingState,\n PartyToParticipantMappingState,\n UpdateDecentralizedNamespaceDefinitionTxParams,\n} from './topology/types';\nimport {\n buildChannelCredentials,\n computeDecentralizedNamespace,\n headStateBaseQuery,\n synchronizerStore,\n} from './topology/utils';\nimport { computePublicKeyFingerprint } from './utils';\n\n/** Default gRPC client options: 128 MiB message-size limits for large admin responses. */\nconst DEFAULT_GRPC_CLIENT_OPTIONS = {\n 'grpc.max_receive_message_length': 128 * 1024 * 1024,\n 'grpc.max_send_message_length': 128 * 1024 * 1024,\n} as const;\n\n/**\n * gRPC client for the Canton participant admin Topology Manager API.\n *\n * Exposes read queries for topology mappings and write helpers that call\n * `GenerateTransactions` to produce unsigned topology transactions and\n * `AddTransactions` to submit signed ones.\n *\n * A fresh Bearer token is attached to each RPC via {@link TokenProvider}.\n */\nexport class CantonGrpcClient {\n readonly #transport: GrpcTransport;\n readonly #topologyRead: TopologyManagerReadServiceClient;\n readonly #topologyWrite: TopologyManagerWriteServiceClient;\n readonly #connectivity: SynchronizerConnectivityServiceClient;\n readonly #tokenProvider: TokenProvider;\n #synchronizerId?: string;\n\n /**\n * @param opts - Admin API host, auth, optional synchronizer id, and optional TLS.\n */\n constructor(opts: CantonGrpcClientOptions) {\n this.#tokenProvider = opts.tokenProvider;\n this.#synchronizerId = opts.synchronizerId;\n this.#transport = new GrpcTransport({\n host: opts.host,\n channelCredentials: buildChannelCredentials(opts.host, opts.tls),\n clientOptions: opts.grpcClientOptions ?? DEFAULT_GRPC_CLIENT_OPTIONS,\n });\n this.#topologyRead = new TopologyManagerReadServiceClient(this.#transport);\n this.#topologyWrite = new TopologyManagerWriteServiceClient(this.#transport);\n this.#connectivity = new SynchronizerConnectivityServiceClient(this.#transport);\n }\n\n /** Returns per-RPC gRPC metadata with a fresh Bearer token. */\n async #getMeta(): Promise<Record<string, string>> {\n const token = await this.#tokenProvider.getToken();\n return { Authorization: `Bearer ${token}` };\n }\n\n /**\n * Returns the client synchronizer id, discovering it on first use when omitted at construction.\n *\n * @throws {CantonProtocolError} If the participant exposes no synchronizer store.\n */\n async #getSynchronizerId(): Promise<string> {\n if (this.#synchronizerId) {\n return this.#synchronizerId;\n }\n this.#synchronizerId = await this.#discoverSynchronizerId();\n return this.#synchronizerId;\n }\n\n /**\n * Resolves the logical id of the first synchronizer the participant is connected to.\n *\n * @throws {CantonProtocolError} If the participant is not connected to any synchronizer.\n */\n async #discoverSynchronizerId(): Promise<string> {\n const { response } = await this.#connectivity.listConnectedSynchronizers(\n {},\n { meta: await this.#getMeta() },\n );\n for (const synchronizer of response.connectedSynchronizers) {\n if (synchronizer.synchronizerId) {\n return synchronizer.synchronizerId;\n }\n }\n throw new CantonProtocolError('Participant is not connected to any synchronizer');\n }\n\n /**\n * Calls `GenerateTransactions` for a single ADD_REPLACE mapping.\n *\n * @param synchronizerId - Synchronizer store to target.\n * @param mapping - Topology mapping to encode into the transaction.\n * @param serial - Topology serial (`0` lets Canton auto-determine).\n * @returns Unsigned topology transaction (`serializedTransaction`, `transactionHash`).\n * @throws {CantonProtocolError} If the RPC returns no generated transaction.\n */\n async #generateTopologyTransaction(\n synchronizerId: string,\n mapping: TopologyMapping,\n serial: number,\n ): Promise<GeneratedTopologyTransaction> {\n const { response } = await this.#topologyWrite.generateTransactions(\n GenerateTransactionsRequest.create({\n proposals: [\n GenerateTransactionsRequest_Proposal.create({\n operation: Enums_TopologyChangeOp.ADD_REPLACE,\n serial,\n mapping,\n store: synchronizerStore(synchronizerId),\n }),\n ],\n }),\n { meta: await this.#getMeta() },\n );\n\n const generated = response.generatedTransactions[0];\n if (!generated) {\n throw new CantonProtocolError('GenerateTransactions returned no topology transaction');\n }\n return generated;\n }\n\n /**\n * Lists Namespace Delegation (NSD) mappings for a namespace.\n *\n * Queries topology head state on the synchronizer. Returns every result from\n * the list RPC.\n *\n * @param namespaceFingerprint - Namespace to filter on (for root NSD, the owner key fingerprint).\n * @returns All matching NSD mappings, or an empty array if none exist.\n */\n async getNamespaceDelegation(\n namespaceFingerprint: string,\n ): Promise<NamespaceDelegationState[]> {\n const synchronizerId = await this.#getSynchronizerId();\n const { response } = await this.#topologyRead.listNamespaceDelegation(\n ListNamespaceDelegationRequest.create({\n baseQuery: headStateBaseQuery(synchronizerId),\n filterNamespace: namespaceFingerprint,\n // Empty string = no target-key filter; return all delegations for this namespace.\n filterTargetKeyFingerprint: '',\n }),\n { meta: await this.#getMeta() },\n );\n\n return response.results.flatMap((result) => {\n const item = result.item;\n const publicKey = item?.targetKey?.publicKey;\n if (!item || !publicKey) {\n return [];\n }\n return [\n {\n namespace: item.namespace,\n targetKeyFingerprint: computePublicKeyFingerprint(publicKey),\n isRootDelegation: item.isRootDelegation,\n serial: result.context?.serial ?? 0,\n },\n ];\n });\n }\n\n /**\n * Lists Decentralized Namespace Definition (DND) mappings for a namespace.\n *\n * Queries topology head state on the synchronizer. For a party id `hint::1220…`,\n * pass the `1220…` suffix as `namespaceFingerprint`.\n *\n * @param namespaceFingerprint - Decentralized namespace fingerprint to filter on.\n * @returns All matching DND mappings, or an empty array if none exist.\n */\n async getDecentralizedNamespaceDefinition(\n namespaceFingerprint: string,\n ): Promise<DecentralizedNamespaceDefinitionState[]> {\n const synchronizerId = await this.#getSynchronizerId();\n const { response } = await this.#topologyRead.listDecentralizedNamespaceDefinition(\n ListDecentralizedNamespaceDefinitionRequest.create({\n baseQuery: headStateBaseQuery(synchronizerId),\n filterNamespace: namespaceFingerprint,\n }),\n { meta: await this.#getMeta() },\n );\n\n return response.results.flatMap((result) => {\n const item = result.item;\n if (!item) {\n return [];\n }\n return [\n {\n namespace: item.decentralizedNamespace,\n threshold: item.threshold,\n owners: [...item.owners],\n serial: result.context?.serial ?? 0,\n },\n ];\n });\n }\n\n /**\n * Lists Party-to-Key (PTK) mappings for a party.\n *\n * Queries topology head state on the synchronizer.\n *\n * @param partyId - Full party identifier (e.g. `hint::1220…`).\n * @returns All matching PTK mappings, or an empty array if none exist.\n */\n async getPartyToKeyMapping(partyId: string): Promise<PartyToKeyMappingState[]> {\n const synchronizerId = await this.#getSynchronizerId();\n const { response } = await this.#topologyRead.listPartyToKeyMapping(\n ListPartyToKeyMappingRequest.create({\n baseQuery: headStateBaseQuery(synchronizerId),\n filterParty: partyId,\n }),\n { meta: await this.#getMeta() },\n );\n\n return response.results.flatMap((result) => {\n const item = result.item;\n if (!item) {\n return [];\n }\n return [\n {\n party: item.party,\n threshold: item.threshold,\n signingKeyFingerprints: item.signingKeys.map((key) =>\n computePublicKeyFingerprint(key.publicKey),\n ),\n serial: result.context?.serial ?? 0,\n },\n ];\n });\n }\n\n /**\n * Lists Party-to-Participant (PTP) mappings for a party.\n *\n * Queries topology head state on the synchronizer.\n *\n * @param partyId - Full party identifier (e.g. `hint::1220…`).\n * @param proposals - If `true`, query pending proposals instead of authorized mappings.\n * @returns All matching PTP mappings, or an empty array if none exist.\n */\n async getPartyToParticipantMapping(\n partyId: string,\n proposals = false,\n ): Promise<PartyToParticipantMappingState[]> {\n const synchronizerId = await this.#getSynchronizerId();\n const { response } = await this.#topologyRead.listPartyToParticipant(\n ListPartyToParticipantRequest.create({\n baseQuery: headStateBaseQuery(synchronizerId, proposals),\n filterParty: partyId,\n // Empty string = no participant filter; return all hosting mappings for this party.\n filterParticipant: '',\n }),\n { meta: await this.#getMeta() },\n );\n\n return response.results.flatMap((result) => {\n const item = result.item;\n if (!item) {\n return [];\n }\n return [\n {\n party: item.party,\n threshold: item.threshold,\n participants: item.participants.map((participant) => ({\n participantUid: participant.participantUid,\n permission: participant.permission,\n })),\n serial: result.context?.serial ?? 0,\n },\n ];\n });\n }\n\n /**\n * Builds an unsigned Namespace Delegation (NSD) topology transaction.\n *\n * Calls `GenerateTransactions` with an ADD_REPLACE mapping. The returned\n * `transactionHash` must be signed by the namespace key.\n *\n * @param params - Owner public key and optional serial.\n * @returns Unsigned topology transaction (`serializedTransaction`, `transactionHash`).\n */\n async createNamespaceDelegationTx(\n params: CreateNamespaceDelegationTxParams,\n ): Promise<GeneratedTopologyTransaction> {\n const synchronizerId = await this.#getSynchronizerId();\n const mapping = buildNamespaceDelegationMapping(params.publicKeyDer);\n return this.#generateTopologyTransaction(synchronizerId, mapping, params.serial ?? 0);\n }\n\n /**\n * Builds an unsigned Decentralized Namespace Definition (DND) topology transaction.\n *\n * The decentralized namespace id is derived from `params.owners`. All owners\n * must sign the transaction hash.\n *\n * @param params - Owner fingerprints, threshold, and optional serial.\n * @returns Unsigned topology transaction (`serializedTransaction`, `transactionHash`).\n */\n async createDecentralizedNamespaceDefinitionTx(\n params: CreateDecentralizedNamespaceDefinitionTxParams,\n ): Promise<GeneratedTopologyTransaction> {\n const synchronizerId = await this.#getSynchronizerId();\n const decentralizedNamespace = computeDecentralizedNamespace(params.owners);\n const mapping = buildDecentralizedNamespaceDefinitionMapping(\n decentralizedNamespace,\n params.threshold,\n params.owners,\n );\n return this.#generateTopologyTransaction(synchronizerId, mapping, params.serial ?? 0);\n }\n\n async updateDecentralizedNamespaceDefinitionTx(\n params: UpdateDecentralizedNamespaceDefinitionTxParams,\n ): Promise<GeneratedTopologyTransaction> {\n const synchronizerId = await this.#getSynchronizerId();\n const mapping = buildDecentralizedNamespaceDefinitionMapping(\n params.namespace,\n params.threshold,\n params.owners,\n );\n return this.#generateTopologyTransaction(synchronizerId, mapping, params.serial ?? 0);\n }\n\n /**\n * Builds an unsigned Party-to-Key (PTK) topology transaction.\n *\n * Decentralized namespace owners must sign the transaction hash.\n *\n * @param params - Party id, signing keys, threshold, and optional serial.\n * @returns Unsigned topology transaction (`serializedTransaction`, `transactionHash`).\n */\n async createPartyToKeyTx(\n params: CreatePartyToKeyMappingTxParams,\n ): Promise<GeneratedTopologyTransaction> {\n const synchronizerId = await this.#getSynchronizerId();\n const mapping = buildPartyToKeyMapping(\n params.partyId,\n params.signingPublicKeyDers,\n params.threshold,\n );\n return this.#generateTopologyTransaction(synchronizerId, mapping, params.serial ?? 0);\n }\n\n /**\n * Builds an unsigned Party-to-Participant (PTP) topology transaction.\n *\n * Party owners sign the transaction hash. On submit, set `proposal: true` on the\n * signed transaction so the hosting participant can authorize via `Authorize`.\n *\n * @param params - Party id, participant ids, threshold, and optional serial.\n * @returns Unsigned topology transaction (`serializedTransaction`, `transactionHash`).\n */\n async createPartyToParticipantTx(\n params: CreatePartyToParticipantMappingTxParams,\n ): Promise<GeneratedTopologyTransaction> {\n const synchronizerId = await this.#getSynchronizerId();\n const mapping = buildPartyToParticipantMapping(\n params.partyId,\n params.participantIds,\n params.threshold,\n );\n return this.#generateTopologyTransaction(synchronizerId, mapping, params.serial ?? 0);\n }\n\n /**\n * Submits signed topology transactions to the synchronizer store.\n *\n * Multiple transactions are submitted atomically in one `AddTransactions` call.\n * When batching, sign `computeMultiTransactionHash` over all transaction hashes\n * and attach the same `MultiTransactionSignatures` to each entry.\n *\n * Set `proposal: true` on a transaction when the hosting participant must\n * authorize that mapping afterward.\n *\n * @param transactions - One or more signed topology transactions.\n * @throws {CantonError} If `transactions` is empty.\n */\n async submitTopologyTransactions(\n transactions: readonly SignedTopologyTransaction[],\n ): Promise<void> {\n if (transactions.length === 0) {\n throw new CantonError('AddTransactions requires at least one transaction');\n }\n const synchronizerId = await this.#getSynchronizerId();\n await this.#topologyWrite.addTransactions(\n AddTransactionsRequest.create({\n transactions: [...transactions],\n store: synchronizerStore(synchronizerId),\n }),\n { meta: await this.#getMeta() },\n );\n }\n\n /** Closes the underlying gRPC transport. */\n close(): void {\n this.#transport.close();\n }\n}\n"]}
|
package/dist/CXQSVBVW.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client/topology/synchronizer-connectivity.ts"],"names":["SERVICE_NAME","connectedSynchronizerMessage","MessageType","no","name","kind","T","ScalarType","STRING","BOOL","requestMessage","responseMessage","repeat","RepeatType","UNPACKED","service","ServiceType","options","I","O","SynchronizerConnectivityServiceClient","transport","listConnectedSynchronizers","input","method","methods","stackIntercept","mergeOptions"],"mappings":";;;;AAgCA,IAAMA,YAAAA,GACF,+EAAA;AAsBJ,IAAMC,4BAAAA,GAA+B,IAAIC,WAAAA,CACrC,CAAA,EAAGF,YAAAA,CAAAA,0CAAAA,CAAAA,EACH;AACI,EAAA;IAAEG,EAAAA,EAAI,CAAA;IAAGC,IAAAA,EAAM,oBAAA;IAAsBC,IAAAA,EAAM,QAAA;AAAUC,IAAAA,CAAAA,EAAGC,UAAAA,CAAWC;AAAO,GAAA;AAC1E,EAAA;IAAEL,EAAAA,EAAI,CAAA;IAAGC,IAAAA,EAAM,iBAAA;IAAmBC,IAAAA,EAAM,QAAA;AAAUC,IAAAA,CAAAA,EAAGC,UAAAA,CAAWC;AAAO,GA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CAGL,OAAA,EAAS,IAAA,CAAK,UAAA,EAAYF,MAAAA,EAAQ,KAAK,UAAA,CAAWG,YAAAA,CAAaV,OAAAA,CAAAA,EAAUM,KAAAA,CAAAA;AAC/E,EAAA;AACJ","file":"CXQSVBVW.js","sourcesContent":["// `@protobuf-ts/runtime` and `@protobuf-ts/runtime-rpc` are already in the tree as\n// transitive deps of `@canton-network/core-ledger-proto` (and `@protobuf-ts/grpc-transport`),\n// so declaring them here adds no new dependency — pnpm's isolation just requires this\n// package to list them before it can import them directly.\nimport { MessageType, RepeatType, ScalarType } from '@protobuf-ts/runtime';\nimport {\n type MethodInfo,\n type RpcOptions,\n type RpcTransport,\n ServiceType,\n stackIntercept,\n type UnaryCall,\n} from '@protobuf-ts/runtime-rpc';\n\n/**\n * Minimal hand-written client for the Canton participant admin\n * `SynchronizerConnectivityService.ListConnectedSynchronizers` RPC.\n *\n * The published `@canton-network/core-ledger-proto` package does not ship the\n * `com.digitalasset.canton.admin.participant.v30` namespace, so the message and\n * service descriptors required for synchronizer discovery are declared here\n * against the same `@protobuf-ts` runtime the generated topology clients use.\n *\n * Field numbers mirror the `SynchronizerConnectivityService` definition in the\n * Canton `com.digitalasset.canton.admin.participant.v30` proto package; re-verify\n * them when bumping `@canton-network/core-ledger-proto` (pinned at ^0.22.0).\n *\n * TODO: the synchronizer id is also resolvable via the JSON Ledger API\n * (`/v2/state/connected-synchronizers`), in which case this hand-written gRPC\n * client can be removed — but consumers would then need to pass a JSON API URL too.\n */\n\nconst SERVICE_NAME =\n 'com.digitalasset.canton.admin.participant.v30.SynchronizerConnectivityService';\n\n/** Empty request for `ListConnectedSynchronizers`. */\nexport type ListConnectedSynchronizersRequest = Record<string, never>;\n\n/** A single connected-synchronizer entry. */\nexport type ConnectedSynchronizer = {\n /** Human-readable synchronizer alias (e.g. `global`). */\n synchronizerAlias: string;\n /** Logical synchronizer id — the value accepted by topology `BaseQuery.store`. */\n synchronizerId: string;\n /** Physical synchronizer id (logical id plus a `::<protocol>-<serial>` suffix). */\n physicalSynchronizerId: string;\n /** Whether the participant's connection to the synchronizer is healthy. */\n healthy: boolean;\n};\n\n/** Response for `ListConnectedSynchronizers`. */\nexport type ListConnectedSynchronizersResponse = {\n connectedSynchronizers: ConnectedSynchronizer[];\n};\n\nconst connectedSynchronizerMessage = new MessageType<ConnectedSynchronizer>(\n `${SERVICE_NAME}.ListConnectedSynchronizersResponse.Result`,\n [\n { no: 1, name: 'synchronizer_alias', kind: 'scalar', T: ScalarType.STRING },\n { no: 2, name: 'synchronizer_id', kind: 'scalar', T: ScalarType.STRING },\n { no: 3, name: 'physical_synchronizer_id', kind: 'scalar', T: ScalarType.STRING },\n { no: 4, name: 'healthy', kind: 'scalar', T: ScalarType.BOOL },\n ],\n);\n\nconst requestMessage = new MessageType<ListConnectedSynchronizersRequest>(\n `${SERVICE_NAME}.ListConnectedSynchronizersRequest`,\n [],\n);\n\nconst responseMessage = new MessageType<ListConnectedSynchronizersResponse>(\n `${SERVICE_NAME}.ListConnectedSynchronizersResponse`,\n [\n {\n no: 1,\n name: 'connected_synchronizers',\n kind: 'message',\n repeat: RepeatType.UNPACKED,\n T: () => connectedSynchronizerMessage,\n },\n ],\n);\n\nconst service = new ServiceType(SERVICE_NAME, [\n { name: 'ListConnectedSynchronizers', options: {}, I: requestMessage, O: responseMessage },\n]);\n\n/** Client for the participant admin `SynchronizerConnectivityService`. */\nexport class SynchronizerConnectivityServiceClient {\n readonly #transport: RpcTransport;\n\n constructor(transport: RpcTransport) {\n this.#transport = transport;\n }\n\n /** Lists synchronizers the participant is currently connected to. */\n listConnectedSynchronizers(\n input: ListConnectedSynchronizersRequest,\n options?: RpcOptions,\n ): UnaryCall<ListConnectedSynchronizersRequest, ListConnectedSynchronizersResponse> {\n const method = service.methods[0] as MethodInfo<\n ListConnectedSynchronizersRequest,\n ListConnectedSynchronizersResponse\n >;\n return stackIntercept<\n ListConnectedSynchronizersRequest,\n ListConnectedSynchronizersResponse\n >('unary', this.#transport, method, this.#transport.mergeOptions(options), input);\n }\n}\n"]}
|
package/dist/S55KRBEC.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/provider.ts"],"names":["parseCantonChainUri","uri","url","URL","adminApiHost","searchParams","get","Error","userId","actAsParam","actAs","split","map","party","trim","filter","length","walletUrl","tokenUrl","undefined","clientId","clientSecret","process","env","CANTON_CLIENT_SECRET","scope","audience","key","delete","jsonApiUrl","toString","replace","oauth2","createCantonChainProvider","isLocal","params","tokenProvider","createTokenProvider","configuration","Configuration","basePath","accessToken","getToken","client","CantonClient","grpcClient","CantonGrpcClient","host","LocalTokenProvider","admin","ClientCredentialsTokenProvider"],"mappings":";;;;;;;;AA6DO,SAASA,oBAAoBC,GAAAA,EAAW;AAC3C,EAAA,MAAMC,GAAAA,GAAM,IAAIC,GAAAA,CAAIF,GAAAA,CAAAA;AAEpB,EAAA,MAAMG,YAAAA,GAAeF,GAAAA,CAAIG,YAAAA,CAAaC,GAAAA,CAAI,WAAA,CAAA;AAC1C,EAAA,IAAI,CAACF,YAAAA,EAAc;AACf,IAAA,MAAM,IAAIG,MAAM,kEAAA,CAAA;AACpB,EAAA;AAEA,EAAA,MAAMC,MAAAA,GAASN,GAAAA,CAAIG,YAAAA,CAAaC,GAAAA,CAAI,SAAA,CAAA,IAAc,mBAAA;AAClD,EAAA,MAAMG,UAAAA,GAAaP,GAAAA,CAAIG,YAAAA,CAAaC,GAAAA,CAAI,QAAA,CAAA;AACxC,EAAA,MAAMI,QACFD,UAAAA,EACME,KAAAA,CAAM,GAAA,CAAA,CACPC,GAAAA,CAAI,CAACC,KAAAA,KAAUA,KAAAA,CAAMC,MAAI,CAAA,CACzBC,OAAO,CAACF,KAAAA,KAAUA,MAAMG,MAAAA,GAAS,CAAA,KAAM,EAAA;AAChD,EAAA,MAAMC,SAAAA,GAAYf,GAAAA,CAAIG,YAAAA,CAAaC,GAAAA,CAAI,YAAA,CAAA;AACvC,EAAA,IAAI,CAACW,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,EAAS;AACT,IAAA,OAAO,IAAIc,kBAAAA,CAAmB;AAC1BxC,MAAAA,MAAAA,EAAQ2B,MAAAA,CAAO3B,MAAAA;AACfE,MAAAA,KAAAA,EAAOyB,MAAAA,CAAOzB,KAAAA;MACduC,KAAAA,EAAO;KACX,CAAA;AACJ,EAAA;AAGA,EAAA,IAAI,CAACd,OAAOH,MAAAA,EAAQ;AAChB,IAAA,MAAM,IAAIzB,MACN,kHAAA,CAAA;AAER,EAAA;AAEA,EAAA,OAAO,IAAI2C,8BAAAA,CAA+Bf,MAAAA,CAAOH,MAAM,CAAA;AAC3D;AAjBSK,MAAAA,CAAAA,mBAAAA,EAAAA,qBAAAA,CAAAA","file":"S55KRBEC.js","sourcesContent":["import {\n ClientCredentialsTokenProvider,\n type ClientCredentialsTokenProviderConfig,\n} from './auth/client-credentials-token-provider';\nimport { LocalTokenProvider } from './auth/local-token-provider';\nimport type { TokenProvider } from './auth/token-provider';\nimport { CantonClient } from './client/canton-client';\nimport { CantonGrpcClient } from './client/grpc';\nimport type { ICantonClient } from './client/interface';\nimport { Configuration } from './open-api/runtime';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Provider Type\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * - {@link client} — JSON Ledger API (commands, queries, updates)\n * - {@link grpcClient} — gRPC Admin API (topology transactions, namespace queries)\n * - {@link tokenProvider} — Shared Bearer-token source used by both transports\n * - {@link walletUrl} — Canton Network validator wallet (scan-proxy CIP-56 endpoints)\n */\nexport type CantonChainProvider = {\n client: ICantonClient;\n grpcClient: CantonGrpcClient;\n tokenProvider: TokenProvider;\n /** Validator wallet URL for scan-proxy CIP-56 endpoints. Required. */\n walletUrl: string;\n};\n\n// ─────────────────────────────────────────────────────────────────────────────\n// URI Parsing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type CantonChainUriParams = {\n /** Base URL of the JSON Ledger API (e.g. \"http://localhost:5975\") */\n jsonApiUrl: string;\n /** Host:port of the gRPC Admin API (e.g. \"localhost:5076\") */\n adminApiHost: string;\n /** Ledger API user ID (default: \"participant_admin\") */\n userId: string;\n /** Parties granted `actAs` on localnet tokens (comma-separated in the URI). */\n actAs: string[];\n /** Validator wallet URL for scan-proxy CIP-56 endpoints (e.g. \"http://localhost:7201\"). Required. */\n walletUrl: string;\n /** OAuth2 client credentials config — present only for non-local environments */\n oauth2?: ClientCredentialsTokenProviderConfig;\n};\n\n/**\n * Parse a Canton chain provider URI into its constituent parts.\n *\n * URI format:\n * `<json-api-base>?admin-api=<host:port>&user-id=<id>&wallet-url=<url>[&token-url=...&client-id=...&client-secret=...&scope=...&audience=...]`\n *\n * The base URL (everything before the query string) is the JSON Ledger API endpoint.\n * Canton-specific params are extracted and removed; any remaining query params are\n * preserved on the JSON API URL.\n *\n * When `client-secret` is omitted from the URI, `CANTON_CLIENT_SECRET` is read from the\n * environment.\n */\nexport function parseCantonChainUri(uri: string): CantonChainUriParams {\n const url = new URL(uri);\n\n const adminApiHost = url.searchParams.get('admin-api');\n if (!adminApiHost) {\n throw new Error('Canton provider URI missing required \"admin-api\" query parameter');\n }\n\n const userId = url.searchParams.get('user-id') ?? 'participant_admin';\n const actAsParam = url.searchParams.get('act-as');\n const actAs =\n actAsParam\n ?.split(',')\n .map((party) => party.trim())\n .filter((party) => party.length > 0) ?? [];\n const walletUrl = url.searchParams.get('wallet-url');\n if (!walletUrl) {\n throw new Error('Canton provider URI missing required \"wallet-url\" query parameter');\n }\n const tokenUrl = url.searchParams.get('token-url') ?? undefined;\n const clientId = url.searchParams.get('client-id') ?? undefined;\n // Prefer URI param; fall back to env so secrets are not committed in provider configs.\n const clientSecret =\n url.searchParams.get('client-secret') ??\n // eslint-disable-next-line turbo/no-undeclared-env-vars -- runtime OAuth secret, not a turbo task input\n process.env.CANTON_CLIENT_SECRET ??\n undefined;\n const scope = url.searchParams.get('scope') ?? undefined;\n const audience = url.searchParams.get('audience') ?? undefined;\n\n for (const key of [\n 'admin-api',\n 'user-id',\n 'act-as',\n 'wallet-url',\n 'sequencer-url',\n 'sequencer-validators',\n 'sequencer-quorum',\n 'token-url',\n 'client-id',\n 'client-secret',\n 'scope',\n 'audience',\n ]) {\n url.searchParams.delete(key);\n }\n\n const jsonApiUrl = url.toString().replace(/\\/$/, '');\n\n const oauth2 =\n tokenUrl && clientId && clientSecret\n ? { tokenUrl, clientId, clientSecret, scope, audience }\n : undefined;\n\n return {\n jsonApiUrl,\n adminApiHost,\n userId,\n actAs,\n walletUrl,\n oauth2,\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Provider Factory\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type CreateCantonChainProviderOptions = {\n /** Raw provider URI (from provider config) */\n uri: string;\n /** When true, uses LocalTokenProvider (self-signed JWTs) instead of OAuth2 */\n isLocal: boolean;\n};\n\n/**\n * Create a {@link CantonChainProvider} from a provider URI.\n *\n * - **isLocal=true**: Uses {@link LocalTokenProvider} with admin-level access (self-signed JWTs).\n * - **isLocal=false**: Uses {@link ClientCredentialsTokenProvider} with OAuth2 client\n * credentials extracted from the URI query parameters.\n */\nexport function createCantonChainProvider({\n uri,\n isLocal,\n}: CreateCantonChainProviderOptions): CantonChainProvider {\n const params = parseCantonChainUri(uri);\n\n const tokenProvider = createTokenProvider(params, isLocal);\n\n // ── JSON Ledger API Client ──────────────────────────────────────────\n const configuration = new Configuration({\n basePath: params.jsonApiUrl,\n accessToken: () => tokenProvider.getToken(),\n });\n const client = new CantonClient(configuration, params.userId, {\n walletUrl: params.walletUrl,\n tokenProvider,\n });\n\n // ── gRPC Admin API Client ───────────────────────────────────────────\n const grpcClient = new CantonGrpcClient({\n host: params.adminApiHost,\n tokenProvider,\n });\n\n return {\n client,\n grpcClient,\n tokenProvider,\n walletUrl: params.walletUrl,\n };\n}\n\nfunction createTokenProvider(params: CantonChainUriParams, isLocal: boolean): TokenProvider {\n if (isLocal) {\n return new LocalTokenProvider({\n userId: params.userId,\n actAs: params.actAs,\n admin: true,\n });\n }\n\n // TODO(canton): add other prod auth methods (direct JWT passthrough, etc.).\n if (!params.oauth2) {\n throw new Error(\n 'Canton provider requires OAuth2 credentials (token-url, client-id, client-secret in URI or CANTON_CLIENT_SECRET)',\n );\n }\n\n return new ClientCredentialsTokenProvider(params.oauth2);\n}\n"]}
|