@layerzerolabs/common-canton 0.2.112 → 0.2.114

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.
@@ -8,49 +8,22 @@
8
8
 
9
9
  ✅ dpm-3.4.8-openapi-generator-7.21.0
10
10
  🔧 openapi-generator version: 7.21.0
11
- $ docker image inspect --format {{.Architecture}} 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2
12
- (node:83754) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/configs/vm-tooling/values/docker-image-repo.ts is not specified and it doesn't parse as CommonJS.
11
+ 📦 Using mini workspace: /tmp/lz-mini-workspace-seGUgR
12
+ 📦 Copied 15 workspace package source(s)
13
+ 📦 No mini-workspace pruner configured; using unpruned package-level source copy fallback.
14
+ (node:150097) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/configs/vm-tooling/values/docker-image-repo.ts is not specified and it doesn't parse as CommonJS.
13
15
  Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
14
16
  To eliminate this warning, add "type": "module" to /home/runner/work/monorepo-internal/monorepo-internal/package.json.
15
17
  (Use `node --trace-warnings ...` to show where the warning was created)
16
- Error response from daemon: No such image: 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2
17
- 📥 Pulling Docker image from: 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2
18
- $ docker pull 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2
19
- openapi-generator-7.21.0-patch-2: Pulling from layerzerolabs/canton-openapi-tooling
20
- 17639c486e57: Pulling fs layer
21
- 051d551be118: Pulling fs layer
22
- 18a60288e8be: Pulling fs layer
23
- dfe8d6e6f390: Pulling fs layer
24
- e41c3f01e557: Pulling fs layer
25
- fe131d3b296c: Pulling fs layer
26
- dfe8d6e6f390: Waiting
27
- fe131d3b296c: Waiting
28
- e41c3f01e557: Waiting
29
- 18a60288e8be: Verifying Checksum
30
- 18a60288e8be: Download complete
31
- 17639c486e57: Verifying Checksum
32
- 17639c486e57: Download complete
33
- e41c3f01e557: Verifying Checksum
34
- e41c3f01e557: Download complete
35
- dfe8d6e6f390: Verifying Checksum
36
- dfe8d6e6f390: Download complete
37
- 17639c486e57: Pull complete
38
- fe131d3b296c: Verifying Checksum
39
- fe131d3b296c: Download complete
40
- 051d551be118: Verifying Checksum
41
- 051d551be118: Download complete
42
- 051d551be118: Pull complete
43
- 18a60288e8be: Pull complete
44
- dfe8d6e6f390: Pull complete
45
- e41c3f01e557: Pull complete
46
- fe131d3b296c: Pull complete
47
- Digest: sha256:9f4b76e7e635939d8107dbe5cf56b881ece20ecb08873f25e5e9d66b2955b5cb
48
- Status: Downloaded newer image for 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2
49
- 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2
50
- ✅ Successfully pulled: 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2
18
+ 📦 Docker volumes:
19
+ -v /tmp/lz-mini-workspace-seGUgR:/workspace
20
+ -v /home/runner/work/monorepo-internal/monorepo-internal/packages/vms/canton/common:/workspace/packages/vms/canton/common
21
+ -v /home/runner/work/monorepo-internal/monorepo-internal/node_modules/.pnpm:/workspace/node_modules/.pnpm:ro
22
+ $ docker image inspect --format {{.Architecture}} 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2
23
+ ✅ Using cached Docker image: 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2 (amd64)
51
24
  👤 Running container as UID:GID 1001:1001
52
25
  📜 Executing custom script: set -euo pipefail && rm -rf "src/open-api" && canton-openapi-generator generate -g typescript-fetch -o "src/open-api" --additional-properties=importFileExtension=.js
53
- $ docker run --rm --add-host=host.docker.internal:host-gateway -e LOCAL_UID=1001 -e LOCAL_GID=1001 -v /home/runner/work/monorepo-internal/monorepo-internal:/workspace -w /workspace/packages/vms/canton/common 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2 bash -c $'set -euo pipefail && rm -rf "src/open-api" && canton-openapi-generator generate -g typescript-fetch -o "src/open-api" --additional-properties=importFileExtension=.js'
26
+ $ docker run --rm --add-host=host.docker.internal:host-gateway -e LOCAL_UID=1001 -e LOCAL_GID=1001 -v /tmp/lz-mini-workspace-seGUgR:/workspace -v /home/runner/work/monorepo-internal/monorepo-internal/packages/vms/canton/common:/workspace/packages/vms/canton/common -v /home/runner/work/monorepo-internal/monorepo-internal/node_modules/.pnpm:/workspace/node_modules/.pnpm:ro -w /workspace/packages/vms/canton/common 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/canton-openapi-tooling:openapi-generator-7.21.0-patch-2 bash -c $'set -euo pipefail && rm -rf "src/open-api" && canton-openapi-generator generate -g typescript-fetch -o "src/open-api" --additional-properties=importFileExtension=.js'
54
27
  [main] INFO o.o.codegen.DefaultGenerator - Generating with dryRun=false
55
28
  [main] INFO o.o.c.ignore.CodegenIgnoreProcessor - Output directory (/workspace/packages/vms/canton/common/src/open-api) does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
56
29
  [main] INFO o.o.codegen.DefaultGenerator - OpenAPI Generator: typescript-fetch (client)
@@ -729,24 +702,24 @@ $ docker run --rm --add-host=host.docker.internal:host-gateway -e LOCAL_UID=1001
729
702
  # We appreciate your support! Please consider donation to help us maintain this project. #
730
703
  # https://opencollective.com/openapi_generator/donate #
731
704
  ############################################################################################
732
- ⏳ bash -c set -euo pipefail && rm -rf "src/open-api" && canton-openapi-generator generate -g typescript-fetch -o "src/open-api" --additional-properties=importFileExtension=.js: 3.741s
705
+ ⏳ bash -c set -euo pipefail && rm -rf "src/open-api" && canton-openapi-generator generate -g typescript-fetch -o "src/open-api" --additional-properties=importFileExtension=.js: 3.220s
733
706
  Testing types with tsc and vue-tsc is an experimental feature.
734
707
  Breaking changes might not follow SemVer, please pin Vitest's version when using it.
735
708
 
736
709
   RUN  v3.2.6 /home/runner/work/monorepo-internal/monorepo-internal/packages/vms/canton/common
737
710
 
738
- ✓ test/auth/local-token-provider.test.ts (5 tests) 11ms
739
- ✓ test/auth/client-credentials-token-provider.test.ts (7 tests) 12ms
740
- ✓ test/provider.test.ts (7 tests) 46ms
741
- ✓ test/crypto.test.ts (6 tests) 5ms
742
- ✓ test/daml-serde.test.ts (19 tests) 9ms
711
+ ✓ test/auth/client-credentials-token-provider.test.ts (7 tests) 13ms
712
+ ✓ test/auth/local-token-provider.test.ts (5 tests) 10ms
713
+ ✓ test/provider.test.ts (7 tests) 49ms
714
+ ✓ test/crypto.test.ts (6 tests) 8ms
715
+ ✓ test/daml-serde.test.ts (19 tests) 13ms
743
716
  stderr | test/sdk.test.ts > Error Handling (Unhappy Paths) > should handle double archive error
744
717
  Mock miss: GET /v2/state/connected-synchronizers
745
718
 
746
719
  stderr | test/sdk.test.ts > Error Handling (Unhappy Paths) > should handle unauthorized party error
747
720
  Mock miss: GET /v2/state/connected-synchronizers
748
721
 
749
- ✓ test/sdk.test.ts (18 tests) 28ms
722
+ ✓ test/sdk.test.ts (18 tests) 42ms
750
723
  ✓  TS  test/sdk.test.ts (18 tests)
751
724
  ✓  TS  test/auth/client-credentials-token-provider.test.ts (7 tests)
752
725
  ✓  TS  test/daml-serde.test.ts (19 tests)
@@ -757,6 +730,6 @@ Breaking changes might not follow SemVer, please pin Vitest's version when using
757
730
   Test Files  12 passed (12)
758
731
   Tests  124 passed (124)
759
732
  Type Errors  no errors
760
-  Start at  02:26:48
761
-  Duration  3.07s (transform 1.08s, setup 0ms, collect 1.73s, tests 112ms, environment 1ms, prepare 858ms, typecheck 2.75s)
733
+  Start at  18:06:20
734
+  Duration  4.79s (transform 1.00s, setup 0ms, collect 1.75s, tests 136ms, environment 1ms, prepare 828ms, typecheck 4.45s)
762
735
 
@@ -9,5 +9,5 @@ var CommandStatus = {
9
9
  };
10
10
 
11
11
  export { CommandStatus, buildTemplateId };
12
- //# sourceMappingURL=CXNQT7WY.js.map
13
- //# sourceMappingURL=CXNQT7WY.js.map
12
+ //# sourceMappingURL=EYZBXTU6.js.map
13
+ //# sourceMappingURL=EYZBXTU6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"names":["buildTemplateId","packageId","modulePath","CommandStatus","Accepted","Rejected","Timeout"],"mappings":";;;AAaO,IAAMA,eAAAA,2BAAmBC,SAAAA,EAAmBC,UAAAA,KAC/C,GAAGD,SAAAA,CAAAA,CAAAA,EAAaC,UAAAA,CAAAA,CAAAA,EADW,iBAAA;AAyBxB,IAAMC,aAAAA,GAAgB;EACzBC,QAAAA,EAAU,UAAA;EACVC,QAAAA,EAAU,UAAA;EACVC,OAAAA,EAAS;AACb","file":"EYZBXTU6.js","sourcesContent":["import type { ContractId, Party } from '@daml/types';\n\n/**\n * Core Types\n */\nexport type TemplateId = string;\n\n/**\n * Build a Canton template ID from a package ID and module path.\n *\n * @example buildTemplateId('abc123', 'RequestFactory:RequestFactory')\n * // => 'abc123:RequestFactory:RequestFactory'\n */\nexport const buildTemplateId = (packageId: string, modulePath: string): TemplateId =>\n `${packageId}:${modulePath}`;\n\nexport type Contract<T extends object> = {\n templateId: TemplateId;\n contractId: ContractId<T>;\n payload: T;\n};\n\n/**\n * Submission Types\n */\nexport type SubmitActors = {\n actAs: Party[];\n readAs?: Party[];\n};\n\nexport type SubmitResult = {\n commandId: string;\n completionOffset: number;\n};\n\n/**\n * Wait / Reconciliation Types\n */\nexport const CommandStatus = {\n Accepted: 'accepted',\n Rejected: 'rejected',\n Timeout: 'timeout',\n} as const;\n\nexport type CommandStatus = (typeof CommandStatus)[keyof typeof CommandStatus];\n\nexport type WaitAccepted = {\n status: typeof CommandStatus.Accepted;\n commandId: string;\n updateId: string;\n offset: number;\n};\nexport type WaitRejected = {\n status: typeof CommandStatus.Rejected;\n commandId: string;\n offset: number;\n error: { code?: number; message: string; details?: unknown };\n};\ntype WaitTimeout = {\n status: typeof CommandStatus.Timeout;\n commandId: string;\n lastCheckedOffset?: number;\n};\n\nexport type WaitResult = WaitAccepted | WaitRejected | WaitTimeout;\n\nexport type WaitOptions = {\n parties: Party[];\n beginExclusive?: number;\n timeoutMs?: number;\n poll?: {\n limit?: number;\n streamIdleTimeoutMs?: number;\n backoffMs?: { initial: number; max: number };\n };\n};\n\n/**\n * External Party / Interactive Submission Types\n */\n\n/**\n * A prepared transaction ready for external signing.\n */\nexport type PreparedTransaction = {\n /** The transaction blob to sign */\n preparedTransaction: string;\n /** Hash of the transaction (sign this) */\n preparedTransactionHash: string;\n /** Hashing scheme version used */\n hashingSchemeVersion: 'HASHING_SCHEME_VERSION_UNSPECIFIED' | 'HASHING_SCHEME_VERSION_V2';\n /** Command ID for tracking */\n commandId: string;\n};\n\nexport type ExternalSignature = {\n /** The party that signed */\n party: Party;\n /** The signature bytes (base64 or hex) */\n signature: string;\n /** Fingerprint/ID of the signing key */\n signedBy: string;\n /** Signature format (e.g., 'Raw') */\n format: string;\n /** Signing algorithm (e.g., 'Ed25519') */\n signingAlgorithmSpec: string;\n};\n\n/**\n * A right granted to a Canton user, as returned by `/v2/users/{userId}/rights`.\n *\n * The `kind` is a discriminated union — only one variant is set per right:\n * - `CanActAs.value.party`: user can submit transactions as that party\n * - `CanReadAs.value.party`: user can read events visible to that party\n * - `ParticipantAdmin`: user has admin rights on the participant\n * - `IdentityProviderAdmin`: user can administer its identity provider\n * - `CanReadAsAnyParty`: user can read as any party\n * - `CanExecuteAsAnyParty`: user can submit as any party\n *\n * Hand-rolled because the OpenAPI generator's `Kind` converter is broken\n * (`instanceOfKindOneOf` checks lowercase `canActAs`, but `KindOneOfFromJSON`\n * reads uppercase `CanActAs`), so the typed client strips all party data.\n *\n * The four nullary variants carry `value: unknown` because Canton's wire\n * format for them is literally `{ \"value\": {} }` (see\n * https://docs.digitalasset.com/build/3.4/explanations/json-api/) and we\n * never read into that payload — only the presence of the variant matters.\n */\nexport type UserRightKind = {\n CanActAs?: { value: { party: string } };\n CanReadAs?: { value: { party: string } };\n ParticipantAdmin?: { value: unknown };\n IdentityProviderAdmin?: { value: unknown };\n CanReadAsAnyParty?: { value: unknown };\n CanExecuteAsAnyParty?: { value: unknown };\n};\n\nexport type UserRight = {\n kind: UserRightKind;\n};\n\n/** Normalized active contract (flat shape derived from JsActiveContract). */\nexport type NormalizedActiveContract = {\n contractId: string;\n templateId: string;\n payload: unknown;\n synchronizerId: string;\n};\n"]}
@@ -1,6 +1,7 @@
1
1
  import { SECP256K1_SPKI_DER_HEADER } from './CMDFOA7C.js';
2
2
  import { __name } from './VUOMXK5T.js';
3
3
  import { createHash } from 'crypto';
4
+ import { bytesToHex } from '@layerzerolabs/common-encoding-utils';
4
5
 
5
6
  function extractTransactions(updates) {
6
7
  return updates.flatMap((update) => "Transaction" in update ? [
@@ -23,10 +24,10 @@ function computeCantonFingerprint(uncompressedPublicKey) {
23
24
  const result = new Uint8Array(MULTIHASH_SHA256_PREFIX.length + hash.length);
24
25
  result.set(MULTIHASH_SHA256_PREFIX);
25
26
  result.set(hash, MULTIHASH_SHA256_PREFIX.length);
26
- return Buffer.from(result).toString("hex");
27
+ return bytesToHex(result);
27
28
  }
28
29
  __name(computeCantonFingerprint, "computeCantonFingerprint");
29
30
 
30
31
  export { computeCantonFingerprint, extractTransactions };
31
- //# sourceMappingURL=JI3XNGXO.js.map
32
- //# sourceMappingURL=JI3XNGXO.js.map
32
+ //# sourceMappingURL=F42TZTWJ.js.map
33
+ //# sourceMappingURL=F42TZTWJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client/utils.ts"],"names":["extractTransactions","updates","flatMap","update","Transaction","value","HASH_PURPOSE_PUBLIC_KEY_FINGERPRINT","MULTIHASH_SHA256_PREFIX","Uint8Array","computeCantonFingerprint","uncompressedPublicKey","publicKeyDer","SECP256K1_SPKI_DER_HEADER","length","set","purposePrefix","DataView","buffer","setUint32","hash","createHash","digest","result","bytesToHex"],"mappings":";;;;;AAWO,SAASA,oBAAoBC,OAAAA,EAAuB;AACvD,EAAA,OAAOA,OAAAA,CAAQC,OAAAA,CAAQ,CAACC,MAAAA,KAAY,iBAAiBA,MAAAA,GAAS;AAACA,IAAAA,MAAAA,CAAOC,WAAAA,CAAYC;AAAS,GAAA,GAAA,EAAE,CAAA;AACjG;AAFgBL,MAAAA,CAAAA,mBAAAA,EAAAA,qBAAAA,CAAAA;AAIhB,IAAMM,mCAAAA,GAAsC,EAAA;AAC5C,IAAMC,uBAAAA,GAA0B,IAAIC,UAAAA,CAAW;AAAC,EAAA,EAAA;AAAM,EAAA;AAAK,CAAA,CAAA;AAMpD,SAASC,yBAAyBC,qBAAAA,EAAiC;AACtE,EAAA,MAAMC,eAAe,IAAIH,UAAAA,CACrBI,yBAAAA,CAA0BC,MAAAA,GAASH,sBAAsBG,MAAM,CAAA;AAEnEF,EAAAA,YAAAA,CAAaG,IAAIF,yBAAAA,CAAAA;AACjBD,EAAAA,YAAAA,CAAaG,GAAAA,CAAIJ,qBAAAA,EAAuBE,yBAAAA,CAA0BC,MAAM,CAAA;AAExE,EAAA,MAAME,aAAAA,GAAgB,IAAIP,UAAAA,CAAW,CAAA,CAAA;AACrC,EAAA,IAAIQ,SAASD,aAAAA,CAAcE,MAAM,CAAA,CAAEC,SAAAA,CAAU,GAAGZ,mCAAAA,CAAAA;AAEhD,EAAA,MAAMa,IAAAA,GAAOC,UAAAA,CAAW,QAAA,CAAA,CAAUjB,MAAAA,CAAOY,aAAAA,CAAAA,CAAeZ,MAAAA,CAAOQ,YAAAA,CAAAA,CAAcU,MAAAA,EAAM;AAEnF,EAAA,MAAMC,SAAS,IAAId,UAAAA,CAAWD,uBAAAA,CAAwBM,MAAAA,GAASM,KAAKN,MAAM,CAAA;AAC1ES,EAAAA,MAAAA,CAAOR,IAAIP,uBAAAA,CAAAA;AACXe,EAAAA,MAAAA,CAAOR,GAAAA,CAAIK,IAAAA,EAAMZ,uBAAAA,CAAwBM,MAAM,CAAA;AAE/C,EAAA,OAAOU,WAAWD,MAAAA,CAAAA;AACtB;AAjBgBb,MAAAA,CAAAA,wBAAAA,EAAAA,0BAAAA,CAAAA","file":"F42TZTWJ.js","sourcesContent":["import { createHash } from 'node:crypto';\n\nimport { bytesToHex } from '@layerzerolabs/common-encoding-utils';\n\nimport { SECP256K1_SPKI_DER_HEADER } from '../crypto';\nimport type { CantonTransaction, CantonUpdate } from './interface';\n\n/**\n * Extract transactions from Canton updates.\n * Filters out checkpoints, reassignments, and topology transactions.\n */\nexport function extractTransactions(updates: CantonUpdate[]): CantonTransaction[] {\n return updates.flatMap((update) => ('Transaction' in update ? [update.Transaction.value] : []));\n}\n\nconst HASH_PURPOSE_PUBLIC_KEY_FINGERPRINT = 12;\nconst MULTIHASH_SHA256_PREFIX = new Uint8Array([0x12, 0x20]);\n\n/**\n * Computes the Canton fingerprint for an uncompressed secp256k1 public key.\n * DER-encodes the key, then computes hex(SHA-256 multihash of purpose=12 || publicKeyDer).\n */\nexport function computeCantonFingerprint(uncompressedPublicKey: Uint8Array): string {\n const publicKeyDer = new Uint8Array(\n SECP256K1_SPKI_DER_HEADER.length + uncompressedPublicKey.length,\n );\n publicKeyDer.set(SECP256K1_SPKI_DER_HEADER);\n publicKeyDer.set(uncompressedPublicKey, SECP256K1_SPKI_DER_HEADER.length);\n\n const purposePrefix = new Uint8Array(4);\n new DataView(purposePrefix.buffer).setUint32(0, HASH_PURPOSE_PUBLIC_KEY_FINGERPRINT);\n\n const hash = createHash('sha256').update(purposePrefix).update(publicKeyDer).digest();\n\n const result = new Uint8Array(MULTIHASH_SHA256_PREFIX.length + hash.length);\n result.set(MULTIHASH_SHA256_PREFIX);\n result.set(hash, MULTIHASH_SHA256_PREFIX.length);\n\n return bytesToHex(result);\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import '../DYPWWRBK.js';
2
2
  import '../IIWYAFUO.js';
3
- export { computeCantonFingerprint, extractTransactions } from '../JI3XNGXO.js';
3
+ export { computeCantonFingerprint, extractTransactions } from '../F42TZTWJ.js';
4
4
  import '../CMDFOA7C.js';
5
5
  export { CantonClient } from '../SMLSAWCA.js';
6
6
  import '../5HH7PZW3.js';
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/client/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEnE;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,iBAAiB,EAAE,CAEhF;AAKD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,qBAAqB,EAAE,UAAU,GAAG,MAAM,CAiBlF"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/client/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEnE;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,iBAAiB,EAAE,CAEhF;AAKD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,qBAAqB,EAAE,UAAU,GAAG,MAAM,CAiBlF"}
@@ -1,4 +1,4 @@
1
- export { computeCantonFingerprint, extractTransactions } from '../JI3XNGXO.js';
1
+ export { computeCantonFingerprint, extractTransactions } from '../F42TZTWJ.js';
2
2
  import '../CMDFOA7C.js';
3
3
  import '../VUOMXK5T.js';
4
4
  //# sourceMappingURL=utils.js.map
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export * from './deferredValue';
6
6
  export * from './events';
7
7
  export * from './provider';
8
8
  export * from './transaction';
9
- export { buildTemplateId, CommandStatus, type Contract, type ExternalSignature, type PreparedTransaction, type SubmitActors, type SubmitResult, type TemplateId, type UserRight, type UserRightKind, type WaitOptions, type WaitResult, } from './types';
9
+ export { buildTemplateId, CommandStatus, type Contract, type ExternalSignature, type PreparedTransaction, type SubmitActors, type SubmitResult, type TemplateId, type UserRight, type UserRightKind, type WaitAccepted, type WaitOptions, type WaitRejected, type WaitResult, } from './types';
10
10
  export { CantonError, CantonProtocolError, CantonTransportError } from './errors';
11
11
  export { CantonClient, type CantonEvent, CantonGrpcClient, type CantonGrpcClientOptions, type CantonTransaction, type CantonUpdate, type CantonUpdateResponse, computeCantonFingerprint, extractTransactions, type ICantonClient, type TlsOptions, } from './client';
12
12
  export { CantonSdk, type NormalizedActiveContract } from './sdk/index';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAG9B,OAAO,EACH,eAAe,EACf,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,GAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,UA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ACjB,KAAK,oBAAoB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,UAAU,GAClB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,SAAS,EAAE,KAAK,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAGvE,YAAY,EACR,aAAa,EACb,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,KAAK,EACL,gBAAgB,EAChB,aAAa,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import './DYPWWRBK.js';
2
2
  import './IIWYAFUO.js';
3
- export { computeCantonFingerprint, extractTransactions } from './JI3XNGXO.js';
3
+ export { computeCantonFingerprint, extractTransactions } from './F42TZTWJ.js';
4
4
  import './5GUYLHA7.js';
5
5
  export { CantonSdk } from './SLTAV2JF.js';
6
- export { CommandStatus, buildTemplateId } from './CXNQT7WY.js';
6
+ export { CommandStatus, buildTemplateId } from './EYZBXTU6.js';
7
7
  import './35ELVFTS.js';
8
8
  import './RSV7WS7X.js';
9
9
  export { parseAmuletAmount, parseAmuletDecimal } from './CXTOAS7N.js';
package/dist/types.d.ts CHANGED
@@ -35,13 +35,13 @@ export declare const CommandStatus: {
35
35
  readonly Timeout: "timeout";
36
36
  };
37
37
  export type CommandStatus = (typeof CommandStatus)[keyof typeof CommandStatus];
38
- type WaitAccepted = {
38
+ export type WaitAccepted = {
39
39
  status: typeof CommandStatus.Accepted;
40
40
  commandId: string;
41
41
  updateId: string;
42
42
  offset: number;
43
43
  };
44
- type WaitRejected = {
44
+ export type WaitRejected = {
45
45
  status: typeof CommandStatus.Rejected;
46
46
  commandId: string;
47
47
  offset: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK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F,6EAA6E;AAC7E,MAAM,MAAM,wBAAwB,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CAC1B,CAAC"}
package/dist/types.js CHANGED
@@ -1,4 +1,4 @@
1
- export { CommandStatus, buildTemplateId } from './CXNQT7WY.js';
1
+ export { CommandStatus, buildTemplateId } from './EYZBXTU6.js';
2
2
  import './VUOMXK5T.js';
3
3
  //# sourceMappingURL=types.js.map
4
4
  //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/common-canton",
3
- "version": "0.2.112",
3
+ "version": "0.2.114",
4
4
  "private": false,
5
5
  "description": "Canton VM client and utilities",
6
6
  "license": "MIT",
@@ -23,10 +23,10 @@
23
23
  "@protobuf-ts/grpc-transport": "^2.9.4",
24
24
  "es-toolkit": "^1.39.10",
25
25
  "zod": "4.3.5",
26
- "@layerzerolabs/common-chain-model": "0.2.112",
27
- "@layerzerolabs/common-encoding-utils": "0.2.112",
28
- "@layerzerolabs/typescript-utils": "0.2.112",
29
- "@layerzerolabs/common-error-utils": "0.2.112"
26
+ "@layerzerolabs/common-chain-model": "0.2.114",
27
+ "@layerzerolabs/common-encoding-utils": "0.2.114",
28
+ "@layerzerolabs/common-error-utils": "0.2.114",
29
+ "@layerzerolabs/typescript-utils": "0.2.114"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.18.6",
@@ -35,12 +35,12 @@
35
35
  "tsup": "^8.4.0",
36
36
  "typescript": "^5.8.2",
37
37
  "vitest": "^3.2.6",
38
- "@layerzerolabs/eslint-configuration": "^0.2.112",
39
- "@layerzerolabs/tsup-configuration": "0.2.112",
40
- "@layerzerolabs/typescript-configuration": "0.2.112",
41
- "@layerzerolabs/ver-signer-adapter": "0.2.112",
42
- "@layerzerolabs/vitest-configuration": "0.2.112",
43
- "@layerzerolabs/vm-tooling-canton": "0.2.112"
38
+ "@layerzerolabs/eslint-configuration": "^0.2.114",
39
+ "@layerzerolabs/tsup-configuration": "0.2.114",
40
+ "@layerzerolabs/typescript-configuration": "0.2.114",
41
+ "@layerzerolabs/ver-signer-adapter": "0.2.114",
42
+ "@layerzerolabs/vitest-configuration": "0.2.114",
43
+ "@layerzerolabs/vm-tooling-canton": "0.2.114"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "restricted",
@@ -1,5 +1,7 @@
1
1
  import { createHash } from 'node:crypto';
2
2
 
3
+ import { bytesToHex } from '@layerzerolabs/common-encoding-utils';
4
+
3
5
  import { SECP256K1_SPKI_DER_HEADER } from '../crypto';
4
6
  import type { CantonTransaction, CantonUpdate } from './interface';
5
7
 
@@ -34,5 +36,5 @@ export function computeCantonFingerprint(uncompressedPublicKey: Uint8Array): str
34
36
  result.set(MULTIHASH_SHA256_PREFIX);
35
37
  result.set(hash, MULTIHASH_SHA256_PREFIX.length);
36
38
 
37
- return Buffer.from(result).toString('hex');
39
+ return bytesToHex(result);
38
40
  }
package/src/index.ts CHANGED
@@ -19,7 +19,9 @@ export {
19
19
  type TemplateId,
20
20
  type UserRight,
21
21
  type UserRightKind,
22
+ type WaitAccepted,
22
23
  type WaitOptions,
24
+ type WaitRejected,
23
25
  type WaitResult,
24
26
  } from './types';
25
27
 
package/src/types.ts CHANGED
@@ -44,13 +44,13 @@ export const CommandStatus = {
44
44
 
45
45
  export type CommandStatus = (typeof CommandStatus)[keyof typeof CommandStatus];
46
46
 
47
- type WaitAccepted = {
47
+ export type WaitAccepted = {
48
48
  status: typeof CommandStatus.Accepted;
49
49
  commandId: string;
50
50
  updateId: string;
51
51
  offset: number;
52
52
  };
53
- type WaitRejected = {
53
+ export type WaitRejected = {
54
54
  status: typeof CommandStatus.Rejected;
55
55
  commandId: string;
56
56
  offset: number;
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types.ts"],"names":["buildTemplateId","packageId","modulePath","CommandStatus","Accepted","Rejected","Timeout"],"mappings":";;;AAaO,IAAMA,eAAAA,2BAAmBC,SAAAA,EAAmBC,UAAAA,KAC/C,GAAGD,SAAAA,CAAAA,CAAAA,EAAaC,UAAAA,CAAAA,CAAAA,EADW,iBAAA;AAyBxB,IAAMC,aAAAA,GAAgB;EACzBC,QAAAA,EAAU,UAAA;EACVC,QAAAA,EAAU,UAAA;EACVC,OAAAA,EAAS;AACb","file":"CXNQT7WY.js","sourcesContent":["import type { ContractId, Party } from '@daml/types';\n\n/**\n * Core Types\n */\nexport type TemplateId = string;\n\n/**\n * Build a Canton template ID from a package ID and module path.\n *\n * @example buildTemplateId('abc123', 'RequestFactory:RequestFactory')\n * // => 'abc123:RequestFactory:RequestFactory'\n */\nexport const buildTemplateId = (packageId: string, modulePath: string): TemplateId =>\n `${packageId}:${modulePath}`;\n\nexport type Contract<T extends object> = {\n templateId: TemplateId;\n contractId: ContractId<T>;\n payload: T;\n};\n\n/**\n * Submission Types\n */\nexport type SubmitActors = {\n actAs: Party[];\n readAs?: Party[];\n};\n\nexport type SubmitResult = {\n commandId: string;\n completionOffset: number;\n};\n\n/**\n * Wait / Reconciliation Types\n */\nexport const CommandStatus = {\n Accepted: 'accepted',\n Rejected: 'rejected',\n Timeout: 'timeout',\n} as const;\n\nexport type CommandStatus = (typeof CommandStatus)[keyof typeof CommandStatus];\n\ntype WaitAccepted = {\n status: typeof CommandStatus.Accepted;\n commandId: string;\n updateId: string;\n offset: number;\n};\ntype WaitRejected = {\n status: typeof CommandStatus.Rejected;\n commandId: string;\n offset: number;\n error: { code?: number; message: string; details?: unknown };\n};\ntype WaitTimeout = {\n status: typeof CommandStatus.Timeout;\n commandId: string;\n lastCheckedOffset?: number;\n};\n\nexport type WaitResult = WaitAccepted | WaitRejected | WaitTimeout;\n\nexport type WaitOptions = {\n parties: Party[];\n beginExclusive?: number;\n timeoutMs?: number;\n poll?: {\n limit?: number;\n streamIdleTimeoutMs?: number;\n backoffMs?: { initial: number; max: number };\n };\n};\n\n/**\n * External Party / Interactive Submission Types\n */\n\n/**\n * A prepared transaction ready for external signing.\n */\nexport type PreparedTransaction = {\n /** The transaction blob to sign */\n preparedTransaction: string;\n /** Hash of the transaction (sign this) */\n preparedTransactionHash: string;\n /** Hashing scheme version used */\n hashingSchemeVersion: 'HASHING_SCHEME_VERSION_UNSPECIFIED' | 'HASHING_SCHEME_VERSION_V2';\n /** Command ID for tracking */\n commandId: string;\n};\n\nexport type ExternalSignature = {\n /** The party that signed */\n party: Party;\n /** The signature bytes (base64 or hex) */\n signature: string;\n /** Fingerprint/ID of the signing key */\n signedBy: string;\n /** Signature format (e.g., 'Raw') */\n format: string;\n /** Signing algorithm (e.g., 'Ed25519') */\n signingAlgorithmSpec: string;\n};\n\n/**\n * A right granted to a Canton user, as returned by `/v2/users/{userId}/rights`.\n *\n * The `kind` is a discriminated union — only one variant is set per right:\n * - `CanActAs.value.party`: user can submit transactions as that party\n * - `CanReadAs.value.party`: user can read events visible to that party\n * - `ParticipantAdmin`: user has admin rights on the participant\n * - `IdentityProviderAdmin`: user can administer its identity provider\n * - `CanReadAsAnyParty`: user can read as any party\n * - `CanExecuteAsAnyParty`: user can submit as any party\n *\n * Hand-rolled because the OpenAPI generator's `Kind` converter is broken\n * (`instanceOfKindOneOf` checks lowercase `canActAs`, but `KindOneOfFromJSON`\n * reads uppercase `CanActAs`), so the typed client strips all party data.\n *\n * The four nullary variants carry `value: unknown` because Canton's wire\n * format for them is literally `{ \"value\": {} }` (see\n * https://docs.digitalasset.com/build/3.4/explanations/json-api/) and we\n * never read into that payload — only the presence of the variant matters.\n */\nexport type UserRightKind = {\n CanActAs?: { value: { party: string } };\n CanReadAs?: { value: { party: string } };\n ParticipantAdmin?: { value: unknown };\n IdentityProviderAdmin?: { value: unknown };\n CanReadAsAnyParty?: { value: unknown };\n CanExecuteAsAnyParty?: { value: unknown };\n};\n\nexport type UserRight = {\n kind: UserRightKind;\n};\n\n/** Normalized active contract (flat shape derived from JsActiveContract). */\nexport type NormalizedActiveContract = {\n contractId: string;\n templateId: string;\n payload: unknown;\n synchronizerId: string;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/client/utils.ts"],"names":["extractTransactions","updates","flatMap","update","Transaction","value","HASH_PURPOSE_PUBLIC_KEY_FINGERPRINT","MULTIHASH_SHA256_PREFIX","Uint8Array","computeCantonFingerprint","uncompressedPublicKey","publicKeyDer","SECP256K1_SPKI_DER_HEADER","length","set","purposePrefix","DataView","buffer","setUint32","hash","createHash","digest","result","Buffer","from","toString"],"mappings":";;;;AASO,SAASA,oBAAoBC,OAAAA,EAAuB;AACvD,EAAA,OAAOA,OAAAA,CAAQC,OAAAA,CAAQ,CAACC,MAAAA,KAAY,iBAAiBA,MAAAA,GAAS;AAACA,IAAAA,MAAAA,CAAOC,WAAAA,CAAYC;AAAS,GAAA,GAAA,EAAE,CAAA;AACjG;AAFgBL,MAAAA,CAAAA,mBAAAA,EAAAA,qBAAAA,CAAAA;AAIhB,IAAMM,mCAAAA,GAAsC,EAAA;AAC5C,IAAMC,uBAAAA,GAA0B,IAAIC,UAAAA,CAAW;AAAC,EAAA,EAAA;AAAM,EAAA;AAAK,CAAA,CAAA;AAMpD,SAASC,yBAAyBC,qBAAAA,EAAiC;AACtE,EAAA,MAAMC,eAAe,IAAIH,UAAAA,CACrBI,yBAAAA,CAA0BC,MAAAA,GAASH,sBAAsBG,MAAM,CAAA;AAEnEF,EAAAA,YAAAA,CAAaG,IAAIF,yBAAAA,CAAAA;AACjBD,EAAAA,YAAAA,CAAaG,GAAAA,CAAIJ,qBAAAA,EAAuBE,yBAAAA,CAA0BC,MAAM,CAAA;AAExE,EAAA,MAAME,aAAAA,GAAgB,IAAIP,UAAAA,CAAW,CAAA,CAAA;AACrC,EAAA,IAAIQ,SAASD,aAAAA,CAAcE,MAAM,CAAA,CAAEC,SAAAA,CAAU,GAAGZ,mCAAAA,CAAAA;AAEhD,EAAA,MAAMa,IAAAA,GAAOC,UAAAA,CAAW,QAAA,CAAA,CAAUjB,MAAAA,CAAOY,aAAAA,CAAAA,CAAeZ,MAAAA,CAAOQ,YAAAA,CAAAA,CAAcU,MAAAA,EAAM;AAEnF,EAAA,MAAMC,SAAS,IAAId,UAAAA,CAAWD,uBAAAA,CAAwBM,MAAAA,GAASM,KAAKN,MAAM,CAAA;AAC1ES,EAAAA,MAAAA,CAAOR,IAAIP,uBAAAA,CAAAA;AACXe,EAAAA,MAAAA,CAAOR,GAAAA,CAAIK,IAAAA,EAAMZ,uBAAAA,CAAwBM,MAAM,CAAA;AAE/C,EAAA,OAAOU,MAAAA,CAAOC,IAAAA,CAAKF,MAAAA,CAAAA,CAAQG,SAAS,KAAA,CAAA;AACxC;AAjBgBhB,MAAAA,CAAAA,wBAAAA,EAAAA,0BAAAA,CAAAA","file":"JI3XNGXO.js","sourcesContent":["import { createHash } from 'node:crypto';\n\nimport { SECP256K1_SPKI_DER_HEADER } from '../crypto';\nimport type { CantonTransaction, CantonUpdate } from './interface';\n\n/**\n * Extract transactions from Canton updates.\n * Filters out checkpoints, reassignments, and topology transactions.\n */\nexport function extractTransactions(updates: CantonUpdate[]): CantonTransaction[] {\n return updates.flatMap((update) => ('Transaction' in update ? [update.Transaction.value] : []));\n}\n\nconst HASH_PURPOSE_PUBLIC_KEY_FINGERPRINT = 12;\nconst MULTIHASH_SHA256_PREFIX = new Uint8Array([0x12, 0x20]);\n\n/**\n * Computes the Canton fingerprint for an uncompressed secp256k1 public key.\n * DER-encodes the key, then computes hex(SHA-256 multihash of purpose=12 || publicKeyDer).\n */\nexport function computeCantonFingerprint(uncompressedPublicKey: Uint8Array): string {\n const publicKeyDer = new Uint8Array(\n SECP256K1_SPKI_DER_HEADER.length + uncompressedPublicKey.length,\n );\n publicKeyDer.set(SECP256K1_SPKI_DER_HEADER);\n publicKeyDer.set(uncompressedPublicKey, SECP256K1_SPKI_DER_HEADER.length);\n\n const purposePrefix = new Uint8Array(4);\n new DataView(purposePrefix.buffer).setUint32(0, HASH_PURPOSE_PUBLIC_KEY_FINGERPRINT);\n\n const hash = createHash('sha256').update(purposePrefix).update(publicKeyDer).digest();\n\n const result = new Uint8Array(MULTIHASH_SHA256_PREFIX.length + hash.length);\n result.set(MULTIHASH_SHA256_PREFIX);\n result.set(hash, MULTIHASH_SHA256_PREFIX.length);\n\n return Buffer.from(result).toString('hex');\n}\n"]}