@layerzerolabs/common-canton 1.2.64 → 1.2.66
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/{XWKAFAGE.js → PXHLNX4K.js} +4 -3
- package/dist/PXHLNX4K.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/refresh/deployment-address.d.ts.map +1 -1
- package/dist/refresh/deployment-address.js +2 -1
- package/dist/refresh/index.js +1 -1
- package/package.json +10 -10
- package/src/refresh/deployment-address.ts +2 -1
- package/dist/XWKAFAGE.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getCreateArgumentField } from './SWY4QT4I.js';
|
|
1
2
|
import { cantonActiveContractIdRef } from './QSQZYJB6.js';
|
|
2
3
|
import { __name } from './VUOMXK5T.js';
|
|
3
4
|
import { NonRetryableError } from '@layerzerolabs/common-error-utils';
|
|
@@ -10,7 +11,7 @@ var templateIdMatches = /* @__PURE__ */ __name((eventTemplateId, filterTemplateI
|
|
|
10
11
|
var buildCantonDeployedContractAddressRef = /* @__PURE__ */ __name((createdEvent, spec) => {
|
|
11
12
|
const qualifiedName = qualifiedTemplateName(createdEvent.templateId);
|
|
12
13
|
const createArgument = createdEvent.createArgument ?? {};
|
|
13
|
-
const ownerParty = createArgument
|
|
14
|
+
const ownerParty = getCreateArgumentField(createArgument, spec.ownerField);
|
|
14
15
|
if (typeof ownerParty !== "string") {
|
|
15
16
|
throw new NonRetryableError(`Template '${qualifiedName}' create argument is missing string owner field '${spec.ownerField}'`);
|
|
16
17
|
}
|
|
@@ -34,5 +35,5 @@ var buildCantonDeployedContractAddressRef = /* @__PURE__ */ __name((createdEvent
|
|
|
34
35
|
}, "buildCantonDeployedContractAddressRef");
|
|
35
36
|
|
|
36
37
|
export { buildCantonDeployedContractAddressRef, qualifiedTemplateName, templateIdMatches };
|
|
37
|
-
//# sourceMappingURL=
|
|
38
|
-
//# sourceMappingURL=
|
|
38
|
+
//# sourceMappingURL=PXHLNX4K.js.map
|
|
39
|
+
//# sourceMappingURL=PXHLNX4K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/refresh/deployment-address.ts"],"names":["qualifiedTemplateName","templateId","firstColon","indexOf","slice","templateIdMatches","eventTemplateId","filterTemplateId","buildCantonDeployedContractAddressRef","createdEvent","spec","qualifiedName","createArgument","ownerParty","getCreateArgumentField","ownerField","NonRetryableError","contractStateFilter","identityKeys","length","Object","fromEntries","map","key","undefined","cantonActiveContractIdRef","partyToFilter","party","expectedSignatories","packageName"],"mappings":";;;;;AAaO,IAAMA,qBAAAA,2BAAyBC,UAAAA,KAAAA;AAClC,EAAA,MAAMC,UAAAA,GAAaD,UAAAA,CAAWE,OAAAA,CAAQ,GAAA,CAAA;AACtC,EAAA,OAAOD,eAAe,EAAA,GAAKD,UAAAA,GAAaA,UAAAA,CAAWG,KAAAA,CAAMF,aAAa,CAAA,CAAA;AAC1E,CAAA,EAHqC,uBAAA;AAM9B,IAAMG,iBAAAA,2BAAqBC,eAAAA,EAAyBC,gBAAAA,KACvDP,sBAAsBM,eAAAA,CAAAA,KAAqBN,qBAAAA,CAAsBO,gBAAAA,CAAAA,EADpC,mBAAA;AAQ1B,IAAMC,qCAAAA,mBAAwC,MAAA,CAAA,CACjDC,YAAAA,EACAC,IAAAA,KAAAA;AAEA,EAAA,MAAMC,aAAAA,GAAgBX,qBAAAA,CAAsBS,YAAAA,CAAaR,UAAU,CAAA;AACnE,EAAA,MAAMW,cAAAA,GAAkBH,YAAAA,CAAaG,cAAAA,IAAkB,EAAC;AACxD,EAAA,MAAMC,UAAAA,GAAaC,sBAAAA,CAAuBF,cAAAA,EAAgBF,IAAAA,CAAKK,UAAU,CAAA;AACzE,EAAA,IAAI,OAAOF,eAAe,QAAA,EAAU;AAChC,IAAA,MAAM,IAAIG,iBAAAA,CACN,CAAA,UAAA,EAAaL,aAAAA,CAAAA,iDAAAA,EAAiED,IAAAA,CAAKK,UAAU,CAAA,CAAA,CAAG,CAAA;AAExG,EAAA;AAEA,EAAA,MAAME,mBAAAA,GAAsBP,IAAAA,CAAKQ,YAAAA,CAAaC,MAAAA,GACxCC,MAAAA,CAAOC,YAAYX,IAAAA,CAAKQ,YAAAA,CAAaI,GAAAA,CAAI,CAACC,GAAAA,KAAQ;AAACA,IAAAA,GAAAA;AAAKX,IAAAA,cAAAA,CAAeW,GAAAA;AAAK,GAAA,CAAA,CAAA,GAC5EC,MAAAA;AAEN,EAAA,OAAOC,yBAAAA,CAA0B;IAC7BC,aAAAA,EAAe;MAAEC,KAAAA,EAAOd;AAAW,KAAA;;IAEnCe,mBAAAA,EAAqB;AAACf,MAAAA;;AACtBZ,IAAAA,UAAAA,EAAY,CAAA,CAAA,EAAIS,IAAAA,CAAKmB,WAAW,CAAA,CAAA,EAAIlB,aAAAA,CAAAA,CAAAA;AACpC,IAAA,GAAIM,mBAAAA,GAAsB;AAAEA,MAAAA;AAAoB,KAAA,GAAI;GACxD,CAAA;AACJ,CAAA,EAxBqD,uCAAA","file":"PXHLNX4K.js","sourcesContent":["import { NonRetryableError } from '@layerzerolabs/common-error-utils';\n\nimport { cantonActiveContractIdRef, type CantonDeferredRef } from '../deferredValue';\nimport { getCreateArgumentField } from '../trusted-origin';\n\nexport interface CantonDeployedTemplateSpec {\n packageName: string;\n ownerField: string;\n // Immutable disambiguating fields only — mutable fields break recreate-survival.\n identityKeys: string[];\n}\n\n// Canton returns `<packageId>:Module:Entity`; the package id has no colon.\nexport const qualifiedTemplateName = (templateId: string): string => {\n const firstColon = templateId.indexOf(':');\n return firstColon === -1 ? templateId : templateId.slice(firstColon + 1);\n};\n\n/** Compare ledger vs filter template IDs, ignoring package-hash vs `#package-name` prefix. */\nexport const templateIdMatches = (eventTemplateId: string, filterTemplateId: string): boolean =>\n qualifiedTemplateName(eventTemplateId) === qualifiedTemplateName(filterTemplateId);\n\ninterface DeployedCreatedEvent {\n templateId: string;\n createArgument?: unknown;\n}\n\nexport const buildCantonDeployedContractAddressRef = (\n createdEvent: DeployedCreatedEvent,\n spec: CantonDeployedTemplateSpec,\n): CantonDeferredRef => {\n const qualifiedName = qualifiedTemplateName(createdEvent.templateId);\n const createArgument = (createdEvent.createArgument ?? {}) as Record<string, unknown>;\n const ownerParty = getCreateArgumentField(createArgument, spec.ownerField);\n if (typeof ownerParty !== 'string') {\n throw new NonRetryableError(\n `Template '${qualifiedName}' create argument is missing string owner field '${spec.ownerField}'`,\n );\n }\n\n const contractStateFilter = spec.identityKeys.length\n ? Object.fromEntries(spec.identityKeys.map((key) => [key, createArgument[key]]))\n : undefined;\n\n return cantonActiveContractIdRef({\n partyToFilter: { party: ownerParty },\n // LZ deploy templates: ownerField is a create-argument signatory.\n expectedSignatories: [ownerParty],\n templateId: `#${spec.packageName}:${qualifiedName}`,\n ...(contractStateFilter ? { contractStateFilter } : {}),\n });\n};\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import './5GUYLHA7.js';
|
|
2
|
+
export { CantonSdk } from './D52OIJDY.js';
|
|
1
3
|
import './AQJMQQ4W.js';
|
|
2
|
-
export { buildCantonDeployedContractAddressRef, qualifiedTemplateName, templateIdMatches } from './
|
|
4
|
+
export { buildCantonDeployedContractAddressRef, qualifiedTemplateName, templateIdMatches } from './PXHLNX4K.js';
|
|
3
5
|
export { resolveCantonTransaction } from './AM6OIKMW.js';
|
|
4
6
|
export { createContractAddressResolver, isConcreteActiveContractRef, isRefAlive, matchesContractStateFilter, queryLiveContractIdsForRef, queryLiveContractsForRef, resolveContractStateFilter, resolveExpectedSignatories } from './75B7Y26B.js';
|
|
5
7
|
export { wrapLzSdk } from './HF5HP2EX.js';
|
|
6
8
|
export { substituteCidsToRefs, substituteRefsToCids } from './WLHCBBAJ.js';
|
|
7
|
-
import './5GUYLHA7.js';
|
|
8
|
-
export { CantonSdk } from './D52OIJDY.js';
|
|
9
9
|
import './7JX6NIYS.js';
|
|
10
10
|
export { buildMultiTransactionSignatures, buildSignedTransaction } from './WKC6X2E3.js';
|
|
11
11
|
import './IIWYAFUO.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment-address.d.ts","sourceRoot":"","sources":["../../src/refresh/deployment-address.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"deployment-address.d.ts","sourceRoot":"","sources":["../../src/refresh/deployment-address.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrF,MAAM,WAAW,0BAA0B;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAEnB,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAGD,eAAO,MAAM,qBAAqB,GAAI,YAAY,MAAM,KAAG,MAG1D,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,MAAM,EAAE,kBAAkB,MAAM,KAAG,OACA,CAAC;AAEvF,UAAU,oBAAoB;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,qCAAqC,GAC9C,cAAc,oBAAoB,EAClC,MAAM,0BAA0B,KACjC,iBAqBF,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { buildCantonDeployedContractAddressRef, qualifiedTemplateName, templateIdMatches } from '../
|
|
1
|
+
export { buildCantonDeployedContractAddressRef, qualifiedTemplateName, templateIdMatches } from '../PXHLNX4K.js';
|
|
2
|
+
import '../SWY4QT4I.js';
|
|
2
3
|
import '../QSQZYJB6.js';
|
|
3
4
|
import '../VUOMXK5T.js';
|
|
4
5
|
//# sourceMappingURL=deployment-address.js.map
|
package/dist/refresh/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../AQJMQQ4W.js';
|
|
2
|
-
export { buildCantonDeployedContractAddressRef, qualifiedTemplateName, templateIdMatches } from '../
|
|
2
|
+
export { buildCantonDeployedContractAddressRef, qualifiedTemplateName, templateIdMatches } from '../PXHLNX4K.js';
|
|
3
3
|
export { resolveCantonTransaction } from '../AM6OIKMW.js';
|
|
4
4
|
export { createContractAddressResolver, isConcreteActiveContractRef, isRefAlive, matchesContractStateFilter, queryLiveContractIdsForRef, queryLiveContractsForRef, resolveContractStateFilter, resolveExpectedSignatories } from '../75B7Y26B.js';
|
|
5
5
|
export { wrapLzSdk } from '../HF5HP2EX.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/common-canton",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.66",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Canton VM client and utilities",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@protobuf-ts/runtime-rpc": "^2.11.1",
|
|
38
38
|
"es-toolkit": "^1.39.10",
|
|
39
39
|
"zod": "4.3.5",
|
|
40
|
-
"@layerzerolabs/common-chain-model": "1.2.
|
|
41
|
-
"@layerzerolabs/common-error-utils": "1.2.
|
|
42
|
-
"@layerzerolabs/common-encoding-utils": "1.2.
|
|
43
|
-
"@layerzerolabs/typescript-utils": "1.2.
|
|
40
|
+
"@layerzerolabs/common-chain-model": "1.2.66",
|
|
41
|
+
"@layerzerolabs/common-error-utils": "1.2.66",
|
|
42
|
+
"@layerzerolabs/common-encoding-utils": "1.2.66",
|
|
43
|
+
"@layerzerolabs/typescript-utils": "1.2.66"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@vitest/coverage-v8": "4.1.10",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"tsup": "^8.4.0",
|
|
49
49
|
"typescript": "^6.0.3",
|
|
50
50
|
"vitest": "^4.1.10",
|
|
51
|
-
"@layerzerolabs/eslint-configuration": "^1.2.
|
|
52
|
-
"@layerzerolabs/tsup-configuration": "1.2.
|
|
53
|
-
"@layerzerolabs/
|
|
54
|
-
"@layerzerolabs/
|
|
55
|
-
"@layerzerolabs/vm-tooling-canton": "1.2.
|
|
51
|
+
"@layerzerolabs/eslint-configuration": "^1.2.66",
|
|
52
|
+
"@layerzerolabs/tsup-configuration": "1.2.66",
|
|
53
|
+
"@layerzerolabs/typescript-configuration": "1.2.66",
|
|
54
|
+
"@layerzerolabs/vitest-configuration": "1.2.66",
|
|
55
|
+
"@layerzerolabs/vm-tooling-canton": "1.2.66"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NonRetryableError } from '@layerzerolabs/common-error-utils';
|
|
2
2
|
|
|
3
3
|
import { cantonActiveContractIdRef, type CantonDeferredRef } from '../deferredValue';
|
|
4
|
+
import { getCreateArgumentField } from '../trusted-origin';
|
|
4
5
|
|
|
5
6
|
export interface CantonDeployedTemplateSpec {
|
|
6
7
|
packageName: string;
|
|
@@ -30,7 +31,7 @@ export const buildCantonDeployedContractAddressRef = (
|
|
|
30
31
|
): CantonDeferredRef => {
|
|
31
32
|
const qualifiedName = qualifiedTemplateName(createdEvent.templateId);
|
|
32
33
|
const createArgument = (createdEvent.createArgument ?? {}) as Record<string, unknown>;
|
|
33
|
-
const ownerParty = createArgument
|
|
34
|
+
const ownerParty = getCreateArgumentField(createArgument, spec.ownerField);
|
|
34
35
|
if (typeof ownerParty !== 'string') {
|
|
35
36
|
throw new NonRetryableError(
|
|
36
37
|
`Template '${qualifiedName}' create argument is missing string owner field '${spec.ownerField}'`,
|
package/dist/XWKAFAGE.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/refresh/deployment-address.ts"],"names":["qualifiedTemplateName","templateId","firstColon","indexOf","slice","templateIdMatches","eventTemplateId","filterTemplateId","buildCantonDeployedContractAddressRef","createdEvent","spec","qualifiedName","createArgument","ownerParty","ownerField","NonRetryableError","contractStateFilter","identityKeys","length","Object","fromEntries","map","key","undefined","cantonActiveContractIdRef","partyToFilter","party","expectedSignatories","packageName"],"mappings":";;;;AAYO,IAAMA,qBAAAA,2BAAyBC,UAAAA,KAAAA;AAClC,EAAA,MAAMC,UAAAA,GAAaD,UAAAA,CAAWE,OAAAA,CAAQ,GAAA,CAAA;AACtC,EAAA,OAAOD,eAAe,EAAA,GAAKD,UAAAA,GAAaA,UAAAA,CAAWG,KAAAA,CAAMF,aAAa,CAAA,CAAA;AAC1E,CAAA,EAHqC,uBAAA;AAM9B,IAAMG,iBAAAA,2BAAqBC,eAAAA,EAAyBC,gBAAAA,KACvDP,sBAAsBM,eAAAA,CAAAA,KAAqBN,qBAAAA,CAAsBO,gBAAAA,CAAAA,EADpC,mBAAA;AAQ1B,IAAMC,qCAAAA,mBAAwC,MAAA,CAAA,CACjDC,YAAAA,EACAC,IAAAA,KAAAA;AAEA,EAAA,MAAMC,aAAAA,GAAgBX,qBAAAA,CAAsBS,YAAAA,CAAaR,UAAU,CAAA;AACnE,EAAA,MAAMW,cAAAA,GAAkBH,YAAAA,CAAaG,cAAAA,IAAkB,EAAC;AACxD,EAAA,MAAMC,UAAAA,GAAaD,cAAAA,CAAeF,IAAAA,CAAKI,UAAU,CAAA;AACjD,EAAA,IAAI,OAAOD,eAAe,QAAA,EAAU;AAChC,IAAA,MAAM,IAAIE,iBAAAA,CACN,CAAA,UAAA,EAAaJ,aAAAA,CAAAA,iDAAAA,EAAiED,IAAAA,CAAKI,UAAU,CAAA,CAAA,CAAG,CAAA;AAExG,EAAA;AAEA,EAAA,MAAME,mBAAAA,GAAsBN,IAAAA,CAAKO,YAAAA,CAAaC,MAAAA,GACxCC,MAAAA,CAAOC,YAAYV,IAAAA,CAAKO,YAAAA,CAAaI,GAAAA,CAAI,CAACC,GAAAA,KAAQ;AAACA,IAAAA,GAAAA;AAAKV,IAAAA,cAAAA,CAAeU,GAAAA;AAAK,GAAA,CAAA,CAAA,GAC5EC,MAAAA;AAEN,EAAA,OAAOC,yBAAAA,CAA0B;IAC7BC,aAAAA,EAAe;MAAEC,KAAAA,EAAOb;AAAW,KAAA;;IAEnCc,mBAAAA,EAAqB;AAACd,MAAAA;;AACtBZ,IAAAA,UAAAA,EAAY,CAAA,CAAA,EAAIS,IAAAA,CAAKkB,WAAW,CAAA,CAAA,EAAIjB,aAAAA,CAAAA,CAAAA;AACpC,IAAA,GAAIK,mBAAAA,GAAsB;AAAEA,MAAAA;AAAoB,KAAA,GAAI;GACxD,CAAA;AACJ,CAAA,EAxBqD,uCAAA","file":"XWKAFAGE.js","sourcesContent":["import { NonRetryableError } from '@layerzerolabs/common-error-utils';\n\nimport { cantonActiveContractIdRef, type CantonDeferredRef } from '../deferredValue';\n\nexport interface CantonDeployedTemplateSpec {\n packageName: string;\n ownerField: string;\n // Immutable disambiguating fields only — mutable fields break recreate-survival.\n identityKeys: string[];\n}\n\n// Canton returns `<packageId>:Module:Entity`; the package id has no colon.\nexport const qualifiedTemplateName = (templateId: string): string => {\n const firstColon = templateId.indexOf(':');\n return firstColon === -1 ? templateId : templateId.slice(firstColon + 1);\n};\n\n/** Compare ledger vs filter template IDs, ignoring package-hash vs `#package-name` prefix. */\nexport const templateIdMatches = (eventTemplateId: string, filterTemplateId: string): boolean =>\n qualifiedTemplateName(eventTemplateId) === qualifiedTemplateName(filterTemplateId);\n\ninterface DeployedCreatedEvent {\n templateId: string;\n createArgument?: unknown;\n}\n\nexport const buildCantonDeployedContractAddressRef = (\n createdEvent: DeployedCreatedEvent,\n spec: CantonDeployedTemplateSpec,\n): CantonDeferredRef => {\n const qualifiedName = qualifiedTemplateName(createdEvent.templateId);\n const createArgument = (createdEvent.createArgument ?? {}) as Record<string, unknown>;\n const ownerParty = createArgument[spec.ownerField];\n if (typeof ownerParty !== 'string') {\n throw new NonRetryableError(\n `Template '${qualifiedName}' create argument is missing string owner field '${spec.ownerField}'`,\n );\n }\n\n const contractStateFilter = spec.identityKeys.length\n ? Object.fromEntries(spec.identityKeys.map((key) => [key, createArgument[key]]))\n : undefined;\n\n return cantonActiveContractIdRef({\n partyToFilter: { party: ownerParty },\n // LZ deploy templates: ownerField is a create-argument signatory.\n expectedSignatories: [ownerParty],\n templateId: `#${spec.packageName}:${qualifiedName}`,\n ...(contractStateFilter ? { contractStateFilter } : {}),\n });\n};\n"]}
|