@midnightntwrk/compact-js-command 0.0.0-stage → 4.0.0

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 (102) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +263 -2
  3. package/dist/dts/effect/CompiledContractReflection.d.ts +66 -0
  4. package/dist/dts/effect/CompiledContractReflection.d.ts.map +1 -0
  5. package/dist/dts/effect/ConfigCompilationError.d.ts +38 -0
  6. package/dist/dts/effect/ConfigCompilationError.d.ts.map +1 -0
  7. package/dist/dts/effect/ConfigCompiler.d.ts +63 -0
  8. package/dist/dts/effect/ConfigCompiler.d.ts.map +1 -0
  9. package/dist/dts/effect/ConfigError.d.ts +34 -0
  10. package/dist/dts/effect/ConfigError.d.ts.map +1 -0
  11. package/dist/dts/effect/index.d.ts +73 -0
  12. package/dist/dts/effect/index.d.ts.map +1 -0
  13. package/dist/dts/effect/internal/args.d.ts +7 -0
  14. package/dist/dts/effect/internal/args.d.ts.map +1 -0
  15. package/dist/dts/effect/internal/circuitCommand.d.ts +2 -0
  16. package/dist/dts/effect/internal/circuitCommand.d.ts.map +1 -0
  17. package/dist/dts/effect/internal/command.d.ts +98 -0
  18. package/dist/dts/effect/internal/command.d.ts.map +1 -0
  19. package/dist/dts/effect/internal/commandConfigProvider.d.ts +2 -0
  20. package/dist/dts/effect/internal/commandConfigProvider.d.ts.map +1 -0
  21. package/dist/dts/effect/internal/compiledContractReflection.d.ts +5 -0
  22. package/dist/dts/effect/internal/compiledContractReflection.d.ts.map +1 -0
  23. package/dist/dts/effect/internal/deployCommand.d.ts +2 -0
  24. package/dist/dts/effect/internal/deployCommand.d.ts.map +1 -0
  25. package/dist/dts/effect/internal/encodedZswapLocalStateSchema.d.ts +129 -0
  26. package/dist/dts/effect/internal/encodedZswapLocalStateSchema.d.ts.map +1 -0
  27. package/dist/dts/effect/internal/era/binding.d.ts +270 -0
  28. package/dist/dts/effect/internal/era/binding.d.ts.map +1 -0
  29. package/dist/dts/effect/internal/era/eras.d.ts +16 -0
  30. package/dist/dts/effect/internal/era/eras.d.ts.map +1 -0
  31. package/dist/dts/effect/internal/era/registry.d.ts +2 -0
  32. package/dist/dts/effect/internal/era/registry.d.ts.map +1 -0
  33. package/dist/dts/effect/internal/era/v8.d.ts +2 -0
  34. package/dist/dts/effect/internal/era/v8.d.ts.map +1 -0
  35. package/dist/dts/effect/internal/era/v9.d.ts +2 -0
  36. package/dist/dts/effect/internal/era/v9.d.ts.map +1 -0
  37. package/dist/dts/effect/internal/json.d.ts +2 -0
  38. package/dist/dts/effect/internal/json.d.ts.map +1 -0
  39. package/dist/dts/effect/internal/maintainCircuitCommand.d.ts +2 -0
  40. package/dist/dts/effect/internal/maintainCircuitCommand.d.ts.map +1 -0
  41. package/dist/dts/effect/internal/maintainCommand.d.ts +2 -0
  42. package/dist/dts/effect/internal/maintainCommand.d.ts.map +1 -0
  43. package/dist/dts/effect/internal/maintainContractCommand.d.ts +2 -0
  44. package/dist/dts/effect/internal/maintainContractCommand.d.ts.map +1 -0
  45. package/dist/dts/effect/internal/options.d.ts +7 -0
  46. package/dist/dts/effect/internal/options.d.ts.map +1 -0
  47. package/dist/dts/index.d.ts +2 -0
  48. package/dist/dts/index.d.ts.map +1 -0
  49. package/dist/esm/effect/CompiledContractReflection.js +33 -0
  50. package/dist/esm/effect/CompiledContractReflection.js.map +1 -0
  51. package/dist/esm/effect/ConfigCompilationError.js +40 -0
  52. package/dist/esm/effect/ConfigCompilationError.js.map +1 -0
  53. package/dist/esm/effect/ConfigCompiler.js +73 -0
  54. package/dist/esm/effect/ConfigCompiler.js.map +1 -0
  55. package/dist/esm/effect/ConfigError.js +40 -0
  56. package/dist/esm/effect/ConfigError.js.map +1 -0
  57. package/dist/esm/effect/index.js +53 -0
  58. package/dist/esm/effect/index.js.map +1 -0
  59. package/dist/esm/effect/internal/args.js +25 -0
  60. package/dist/esm/effect/internal/args.js.map +1 -0
  61. package/dist/esm/effect/internal/circuitCommand.js +282 -0
  62. package/dist/esm/effect/internal/circuitCommand.js.map +1 -0
  63. package/dist/esm/effect/internal/command.js +316 -0
  64. package/dist/esm/effect/internal/command.js.map +1 -0
  65. package/dist/esm/effect/internal/commandConfigProvider.js +19 -0
  66. package/dist/esm/effect/internal/commandConfigProvider.js.map +1 -0
  67. package/dist/esm/effect/internal/compiledContractReflection.js +296 -0
  68. package/dist/esm/effect/internal/compiledContractReflection.js.map +1 -0
  69. package/dist/esm/effect/internal/deployCommand.js +68 -0
  70. package/dist/esm/effect/internal/deployCommand.js.map +1 -0
  71. package/dist/esm/effect/internal/encodedZswapLocalStateSchema.js +51 -0
  72. package/dist/esm/effect/internal/encodedZswapLocalStateSchema.js.map +1 -0
  73. package/dist/esm/effect/internal/era/binding.js +16 -0
  74. package/dist/esm/effect/internal/era/binding.js.map +1 -0
  75. package/dist/esm/effect/internal/era/eras.js +50 -0
  76. package/dist/esm/effect/internal/era/eras.js.map +1 -0
  77. package/dist/esm/effect/internal/era/registry.js +46 -0
  78. package/dist/esm/effect/internal/era/registry.js.map +1 -0
  79. package/dist/esm/effect/internal/era/v8.js +75 -0
  80. package/dist/esm/effect/internal/era/v8.js.map +1 -0
  81. package/dist/esm/effect/internal/era/v9.js +61 -0
  82. package/dist/esm/effect/internal/era/v9.js.map +1 -0
  83. package/dist/esm/effect/internal/json.js +41 -0
  84. package/dist/esm/effect/internal/json.js.map +1 -0
  85. package/dist/esm/effect/internal/maintainCircuitCommand.js +62 -0
  86. package/dist/esm/effect/internal/maintainCircuitCommand.js.map +1 -0
  87. package/dist/esm/effect/internal/maintainCommand.js +35 -0
  88. package/dist/esm/effect/internal/maintainCommand.js.map +1 -0
  89. package/dist/esm/effect/internal/maintainContractCommand.js +64 -0
  90. package/dist/esm/effect/internal/maintainContractCommand.js.map +1 -0
  91. package/dist/esm/effect/internal/options.js +137 -0
  92. package/dist/esm/effect/internal/options.js.map +1 -0
  93. package/dist/esm/index.js +44 -0
  94. package/dist/esm/index.js.map +1 -0
  95. package/dist/esm/package.json +4 -0
  96. package/effect/CompiledContractReflection/package.json +5 -0
  97. package/effect/ConfigCompilationError/package.json +5 -0
  98. package/effect/ConfigCompiler/package.json +5 -0
  99. package/effect/ConfigError/package.json +5 -0
  100. package/effect/index/package.json +5 -0
  101. package/effect/package.json +5 -0
  102. package/package.json +96 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiledContractReflection.js","sourceRoot":"","sources":["../../../../src/effect/internal/compiledContractReflection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAiB,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACzG,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE9F,OAAO,KAAK,0BAA0B,MAAM,kCAAkC,CAAC;AAE/E,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,yBAAyB,GAAG,YAAY,CAAC;AAC/C,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAE9C,kGAAkG;AAClG,kGAAkG;AAClG,2FAA2F;AAC3F,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAOhC,MAAM,SAAS;IAGQ;IAFrB,MAAM,CAA+B;IAErC,YAAqB,KAAmC;QAAnC,UAAK,GAAL,KAAK,CAA8B;QACtD,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAC7B,CAAC;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G,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAC9B,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;IAExC,OAAO,0BAA0B,CAAC,0BAA0B,CAAC,EAAE,CAAC;QAC9D,oBAAoB,EAAE,kBAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,mBAAmB,CAAC;KACxE,CAAC,CAAA;AACJ,CAAC,CAAC,CACH,CAAC"}
@@ -0,0 +1,68 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ import { FileSystem } from '@effect/platform';
16
+ import { ContractRuntimeError } from '@midnightntwrk/compact-js/effect';
17
+ import { Effect, Option } from 'effect';
18
+ import * as CompiledContractReflection from '../CompiledContractReflection.js';
19
+ import * as InternalArgs from './args.js';
20
+ import * as InternalCommand from './command.js';
21
+ import { encodeZswapLocalStateObject } from './encodedZswapLocalStateSchema.js';
22
+ import * as InternalOptions from './options.js';
23
+ /** @internal */
24
+ export const Args = { args: InternalArgs.contractArgs };
25
+ /** @internal */
26
+ export const Options = {
27
+ signingKey: InternalOptions.signingKey,
28
+ signingKind: InternalOptions.signingKind,
29
+ outputFilePath: InternalOptions.outputFilePath,
30
+ outputPublicFilePath: InternalOptions.outputPublicFilePath,
31
+ outputPrivateStateFilePath: InternalOptions.outputPrivateStateFilePath,
32
+ outputZswapLocalStateFilePath: InternalOptions.outputZswapLocalStateFilePath
33
+ };
34
+ /**
35
+ * Builds the `deploy` handler for one era.
36
+ *
37
+ * @param ledger The era's `Ledger` facade.
38
+ * @param runtime The compact-runtime facade that era pairs with.
39
+ *
40
+ * @internal
41
+ */
42
+ export const makeHandler = (ledger, runtime) => {
43
+ const { tryLedger, newIntent, serializeIntent } = InternalCommand.makeIntents(ledger);
44
+ return ({ outputFilePath, outputPublicFilePath, outputPrivateStateFilePath, outputZswapLocalStateFilePath, args }, moduleSpec) => Effect.gen(function* () {
45
+ const fs = yield* FileSystem.FileSystem;
46
+ const { module: { default: contractModule } } = moduleSpec;
47
+ const contractReflector = yield* CompiledContractReflection.CompiledContractReflection;
48
+ const argsParser = yield* contractReflector.createArgumentParser(contractModule.contractExecutable.compiledContract);
49
+ const result = yield* contractModule.contractExecutable.initialize(contractModule.createInitialPrivateState(), ...(yield* argsParser.parseInitializationArgs(args)));
50
+ // `as never` throughout: the executable's results and the facade's parameters are this era's own
51
+ // types, which the handler deliberately does not name (see `era/binding.ts`). That the two
52
+ // genuinely match is the job of `invocationHandler`'s era reconciliation, not of a cast.
53
+ const ledgerContractState = yield* ledger.fromRuntimeContractState(result.public.contractState);
54
+ const emptyIntent = yield* newIntent();
55
+ const intent = yield* tryLedger('Failed to add the contract deployment to the intent', () => emptyIntent.addDeploy(new ledger.ContractDeploy(ledgerContractState)));
56
+ // If the output public file path is provided, write the on-chain (public state) data to the specified file.
57
+ if (Option.isSome(outputPublicFilePath)) {
58
+ yield* fs.writeFile(Option.getOrThrow(outputPublicFilePath), yield* tryLedger('Failed to serialize the initial contract state', () => ledgerContractState.serialize()));
59
+ }
60
+ yield* fs.writeFile(outputFilePath, yield* serializeIntent(intent));
61
+ yield* fs.writeFileString(outputPrivateStateFilePath, JSON.stringify(result.private.privateState));
62
+ yield* fs.writeFileString(outputZswapLocalStateFilePath, JSON.stringify(yield* encodeZswapLocalStateObject(
63
+ // As in `circuitCommand`: the intent file is already written above, so an unwrapped throw
64
+ // would be a defect leaving a partially-written output directory and reporting nothing.
65
+ yield* runtime.tryRuntime('Failed to encode the initial zswap local state', () => runtime.encodeZswapLocalState(result.private.zswapLocalState)))));
66
+ }).pipe(Effect.mapError((err) => ContractRuntimeError.make('Failed to initialize contract', err)));
67
+ };
68
+ //# sourceMappingURL=deployCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployCommand.js","sourceRoot":"","sources":["../../../../src/effect/internal/deployCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,0BAA0B,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,YAAY,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAA;AAE/E,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAIhD,gBAAgB;AAChB,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,YAAY,EAAE,CAAC;AAIxD,gBAAgB;AAChB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,UAAU,EAAE,eAAe,CAAC,UAAU;IACtC,WAAW,EAAE,eAAe,CAAC,WAAW;IACxC,cAAc,EAAE,eAAe,CAAC,cAAc;IAC9C,oBAAoB,EAAE,eAAe,CAAC,oBAAoB;IAC1D,0BAA0B,EAAE,eAAe,CAAC,0BAA0B;IACtE,6BAA6B,EAAE,eAAe,CAAC,6BAA6B;CAC7E,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAG8B,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;IACxE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,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AAC,CAAC,EAAE,CAAC,SAAS,CACjB,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,EACvC,KAAK,CAAC,CAAC,SAAS,CACd,gDAAgD,EAChD,GAAG,EAAE,CAAC,mBAAmB,CAAC,SAAS,EAAE,CACtC,CACF,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,CACjB,cAAc,EACd,KAAK,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAC/B,CAAC;QACF,KAAK,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,0BAA0B,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;QACnG,KAAK,CAAC,CAAC,EAAE,CAAC,eAAe,CACvB,6BAA6B,EAC7B,IAAI,CAAC,SAAS,CACZ,KAAK,CAAC,CAAC,2BAA2B;QAChC,0FAA0F;QAC1F,wFAAwF;QACxF,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,CACvB,gDAAgD,EAChD,GAAG,EAAE,CAAC,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,eAAwB,CAAC,CAC7E,CACF,CACF,CACF,CAAC;IACJ,CAAC,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,QAAQ,CACb,CAAC,GAAG,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,+BAA+B,EAAE,GAAG,CAAC,CACzE,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,51 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ import * as Schema from 'effect/Schema';
16
+ export const EncodedCoinPublicKeySchema = Schema.Struct({
17
+ bytes: Schema.Uint8Array
18
+ });
19
+ export const EncodedContractAddressSchema = Schema.Struct({
20
+ bytes: Schema.Uint8Array
21
+ });
22
+ export const EncodedQualifiedShieldedCoinInfoSchema = Schema.Struct({
23
+ nonce: Schema.Uint8Array,
24
+ color: Schema.Uint8Array,
25
+ value: Schema.BigInt,
26
+ mt_index: Schema.BigInt
27
+ });
28
+ export const EncodedShieldedCoinInfoSchema = Schema.Struct({
29
+ nonce: Schema.Uint8Array,
30
+ color: Schema.Uint8Array,
31
+ value: Schema.BigInt
32
+ });
33
+ export const EncodedRecipientSchema = Schema.Struct({
34
+ is_left: Schema.Boolean,
35
+ left: EncodedCoinPublicKeySchema,
36
+ right: EncodedContractAddressSchema
37
+ });
38
+ // `Schema.mutable` on the two collections: `Schema.Array` decodes to `readonly T[]`, which is the
39
+ // only thing that kept this schema's output from being the runtime's own `EncodedZswapLocalState`.
40
+ export const EncodedZswapLocalStateSchema = Schema.Struct({
41
+ coinPublicKey: EncodedCoinPublicKeySchema,
42
+ currentIndex: Schema.BigInt,
43
+ inputs: Schema.mutable(Schema.Array(EncodedQualifiedShieldedCoinInfoSchema)),
44
+ outputs: Schema.mutable(Schema.Array(Schema.Struct({
45
+ coinInfo: EncodedShieldedCoinInfoSchema,
46
+ recipient: EncodedRecipientSchema
47
+ })))
48
+ });
49
+ export const encodeZswapLocalStateObject = Schema.encodeUnknown(EncodedZswapLocalStateSchema);
50
+ export const decodeZswapLocalStateObject = Schema.decodeUnknown(EncodedZswapLocalStateSchema);
51
+ //# sourceMappingURL=encodedZswapLocalStateSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodedZswapLocalStateSchema.js","sourceRoot":"","sources":["../../../../src/effect/internal/encodedZsw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CAAC,MAAM,CAAC;QACjD,QAAQ,EAAE,6BAA6B;QACvC,SAAS,EAAE,sBAAsB;KAClC,CAAC,CAAC,CAAC;CACL,CAAC,CAAC;AAoBH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;AAC9F,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ export {};
16
+ //# sourceMappingURL=binding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
@@ -0,0 +1,50 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ /**
16
+ * Which ledger eras `--ledger-era` accepts, and which one it defaults to.
17
+ *
18
+ * @remarks
19
+ * Deliberately a **leaf**: it names the eras without importing the era modules that implement them.
20
+ * `options.ts` needs the accepted set while its options are being built, and the era modules import
21
+ * the command modules, which import `options.ts` — so a list that lived in `registry.ts` would put
22
+ * `options.ts` in a cycle and leave those bindings in the temporal dead zone at the moment the
23
+ * option is constructed. Splitting the *names* from the *implementations* keeps the graph acyclic
24
+ * with no lazy indirection anywhere.
25
+ *
26
+ * The two are still tied together: `registry.ts` builds its lookup with
27
+ * `satisfies Record<SelectableLedgerEra, EraCommands>`, so adding an era here without an
28
+ * `internal/era/v<N>.ts` — or adding one there that is not listed here — fails the build.
29
+ *
30
+ * This docblock carries no internal-marker JSDoc tag. A module docblock attaches to the file's
31
+ * first statement, so under `stripInternal` the marker deletes it — here the imports every
32
+ * declaration below is written in terms of, leaving typings that name namespaces they no longer
33
+ * import. Privacy comes from `package.json` `exports` blocking `./effect/internal/*` instead. See
34
+ * `compact-js`'s `internal/boundary.ts` for why this note does not spell the tag out.
35
+ */
36
+ import { Ledger } from '@midnightntwrk/compact-js/effect';
37
+ /**
38
+ * The ledger eras this CLI can select. One entry per `internal/era/v<N>.ts`, and per era-pinned
39
+ * entry `@midnightntwrk/compact-js` publishes.
40
+ */
41
+ export const SELECTABLE_LEDGER_ERAS = [8, 9];
42
+ /**
43
+ * The era an invocation gets when `--ledger-era` is not given: the era this build *binds*, which is
44
+ * also the era a `contract.config.ts` gets from the unsuffixed `@midnightntwrk/compact-js/effect`.
45
+ * Defaulting to anything else would change the meaning of every existing configuration.
46
+ */
47
+ export const DEFAULT_LEDGER_ERA = Ledger.era.ledger;
48
+ /** Whether `ledgerEra` is an era this CLI can select. */
49
+ export const isSelectableLedgerEra = (ledgerEra) => SELECTABLE_LEDGER_ERAS.includes(ledgerEra);
50
+ //# sourceMappingURL=eras.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eras.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/eras.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,EAAE,CAAC,CAAU,CAAC;AAKtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;AAEzE,yDAAyD;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAiB,EAAoC,EAAE,CAC1F,sBAA4C,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ import { isSelectableLedgerEra, SELECTABLE_LEDGER_ERAS } from './eras.js';
16
+ import * as V8 from './v8.js';
17
+ import * as V9 from './v9.js';
18
+ /**
19
+ * The era command sets, keyed by ledger major.
20
+ *
21
+ * `satisfies Record<SelectableLedgerEra, EraCommands>` is what ties this to `eras.ts`: a listed era
22
+ * with no entry here fails the build, and an entry here for an unlisted era is an excess property,
23
+ * which `satisfies` rejects on an object literal.
24
+ */
25
+ const commandsByEra = {
26
+ 8: V8.commands,
27
+ 9: V9.commands
28
+ };
29
+ /**
30
+ * Resolves the command set for a ledger era.
31
+ *
32
+ * @param ledgerEra The era `--ledger-era` yielded. Option parsing has already rejected anything
33
+ * outside {@link SELECTABLE_LEDGER_ERAS}, so the guard below is a total-function formality rather
34
+ * than a reachable user error — but it fails loudly rather than returning a silently wrong era if
35
+ * the option and this registry ever disagree.
36
+ *
37
+ * @internal
38
+ */
39
+ export const forLedgerEra = (ledgerEra) => {
40
+ if (!isSelectableLedgerEra(ledgerEra)) {
41
+ throw new Error(`No command set for ledger era ${ledgerEra}; this build selects between ` +
42
+ `${SELECTABLE_LEDGER_ERAS.join(', ')}.`);
43
+ }
44
+ return commandsByEra[ledgerEra];
45
+ };
46
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAyBH,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAA2B,MAAM,WAAW,CAAC;AACnG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAY9B;;;;;;GAMG;AACH,MAAM,aAAa,GAAG;IACpB,CAAC,EAAE,EAAE,CAAC,QAAQ;IACd,CAAC,EAAE,EAAE,CAAC,QAAQ;CAC6C,CAAC;AAE9D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAe,EAAE;IAC7D,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CACb,iCAAiC,SAAS,+BAA+B;YACvE,GAAG,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC1C,CAAC;IACJ,CAAC;IACD,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC,CAAC"}
@@ -0,0 +1,75 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ /**
16
+ * The command handlers applied to the **ledger 8 / compact-runtime 0.16** era pair.
17
+ *
18
+ * @remarks
19
+ * The twin of `v9.ts`, and the reason `--ledger-era` is now a selection rather than a check: the
20
+ * same four handler factories, the same four option sets, a different era passed in. Both era
21
+ * command sets are live in one process, so `--ledger-era 8` and `--ledger-era 9` are two branches
22
+ * of one binary rather than two builds.
23
+ *
24
+ * ## Capabilities
25
+ *
26
+ * Ledger 8 has neither of the two the commands gate on. `makeContractStateProvider` is **absent**
27
+ * rather than a function that fails, mirroring how `/v8/effect` omits the contract-event modules
28
+ * rather than exporting ones that throw (midnight-sdk#388): the `circuit` handler reads the absence
29
+ * and rejects `--contract-states-dir` by name, before reading a single file.
30
+ *
31
+ * ## What a ledger 8 invocation still needs from its caller
32
+ *
33
+ * Selecting this era makes the *CLI* speak ledger 8 — its intents, its state decoding, its
34
+ * conversions. It cannot make the contract speak it: a `contract.config.ts` targeting this era must
35
+ * import `@midnightntwrk/compact-js/v8/effect` (which `invocationHandler` checks, by comparing the
36
+ * executable's own era against the selected one), and the compiled artifact it loads resolves
37
+ * `@midnight-ntwrk/compact-runtime` itself — by bare specifier, asserting
38
+ * `checkRuntimeVersion('0.16.0')` on import — so that package must resolve to the 0.16 line where
39
+ * the artifact lives. No CLI option can influence that; it is a resolution-level fact about the
40
+ * caller's project.
41
+ *
42
+ * This docblock carries no internal-marker JSDoc tag. A module docblock attaches to the file's
43
+ * first statement, so under `stripInternal` the marker deletes it — here the imports every
44
+ * declaration below is written in terms of, leaving typings that name namespaces they no longer
45
+ * import. Privacy comes from `package.json` `exports` blocking `./effect/internal/*` instead. See
46
+ * `compact-js`'s `internal/boundary.ts` for why this note does not spell the tag out.
47
+ */
48
+ import { CompactRuntime, Ledger } from '@midnightntwrk/compact-js/v8/effect';
49
+ import * as CircuitCommand from '../circuitCommand.js';
50
+ import * as DeployCommand from '../deployCommand.js';
51
+ import * as MaintainCircuitCommand from '../maintainCircuitCommand.js';
52
+ import * as MaintainContractCommand from '../maintainContractCommand.js';
53
+ /**
54
+ * Ledger 8 has neither capability.
55
+ *
56
+ * @remarks
57
+ * Not an omission awaiting a later fix. onchain-runtime-v3 has no `crossContractCall` and no
58
+ * `ContractStateProvider` at all, and its `log` gather op carries a bare `EncodedStateValue` with
59
+ * no emitting-contract address and nothing accumulating it on the circuit context — so events here
60
+ * would be a rebuild against a different payload, not a binding. `compact-runtime` 0.16's
61
+ * `createExecutionContext` rejects a state provider outright, which is the second gate behind this
62
+ * one.
63
+ */
64
+ const capabilities = {
65
+ contractEvents: false
66
+ };
67
+ /** @internal */
68
+ export const commands = {
69
+ era: Ledger.era,
70
+ circuit: CircuitCommand.makeHandler(Ledger, CompactRuntime, capabilities),
71
+ deploy: DeployCommand.makeHandler(Ledger, CompactRuntime),
72
+ maintainCircuit: MaintainCircuitCommand.makeHandler(Ledger),
73
+ maintainContract: MaintainContractCommand.makeHandler(Ledger)
74
+ };
75
+ //# sourceMappingURL=v8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v8.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/v8.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,cAAc,EAA0C,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAErH,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,uBAAuB,MAAM,+BAA+B,CAAC;AAIzE;;;;;;;;;;GAUG;AACH,MAAM,YAAY,GAAG;IACnB,cAAc,EAAE,KAAK;CACe,CAAC;AAsBvC,gBAAgB;AAChB,MAAM,CAAC,MAAM,QAAQ,GAAgB;IACnC,GAAG,EAAE,MAAM,CAAC,GAAG;IACf,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,YAAY,CAAC;IACzE,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC;IACzD,eAAe,EAAE,sBAAsB,CAAC,WAAW,CAAC,MAAM,CAAC;IAC3D,gBAAgB,EAAE,uBAAuB,CAAC,WAAW,CAAC,MAAM,CAAC;CAC9D,CAAC"}
@@ -0,0 +1,61 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ /**
16
+ * The command handlers applied to the **ledger 9 / compact-runtime 0.21** era pair.
17
+ *
18
+ * @remarks
19
+ * Nothing here is era logic: the era arrives as an argument, exactly as it does in `compact-js`'s
20
+ * `internal/era/v9Executable.ts`. The module is a curated application — the two facades, the two
21
+ * capabilities ledger 9 has, and the four handler factories applied to them.
22
+ *
23
+ * Pinned to `@midnightntwrk/compact-js/v9/effect` rather than the unsuffixed entry. The
24
+ * distinction is the one the library draws for itself: the unsuffixed entry means "whichever era
25
+ * this build bound", so using it here would make a `--ledger-era 9` invocation silently follow the
26
+ * next era swap while still calling itself 9 (midnight-sdk#387/#388).
27
+ *
28
+ * This docblock carries no internal-marker JSDoc tag. A module docblock attaches to the file's
29
+ * first statement, so under `stripInternal` the marker deletes it — here the imports every
30
+ * declaration below is written in terms of, leaving typings that name namespaces they no longer
31
+ * import. Privacy comes from `package.json` `exports` blocking `./effect/internal/*` instead. See
32
+ * `compact-js`'s `internal/boundary.ts` for why this note does not spell the tag out.
33
+ */
34
+ import { CompactRuntime, Ledger } from '@midnightntwrk/compact-js/v9/effect';
35
+ import { FileSystemContractModuleProvider, FileSystemContractStateProvider } from '@midnightntwrk/compact-js-node/effect';
36
+ import * as CircuitCommand from '../circuitCommand.js';
37
+ import * as DeployCommand from '../deployCommand.js';
38
+ import * as MaintainCircuitCommand from '../maintainCircuitCommand.js';
39
+ import * as MaintainContractCommand from '../maintainContractCommand.js';
40
+ /**
41
+ * Ledger 9 has both of the capabilities the commands gate on.
42
+ *
43
+ * @remarks
44
+ * Both providers are built against **this** era's facades, not the bound ones: the state provider
45
+ * decodes the files in `--contract-states-dir` with the same conversions the handler uses for
46
+ * `--input`, so a cross-contract callee cannot be decoded by one era and executed by another.
47
+ */
48
+ const capabilities = {
49
+ makeContractStateProvider: (baseFolderPath) => FileSystemContractStateProvider.make(baseFolderPath, { ledger: Ledger }),
50
+ makeContractModuleProvider: (baseFolderPath) => FileSystemContractModuleProvider.make(baseFolderPath, { runtime: CompactRuntime }),
51
+ contractEvents: true
52
+ };
53
+ /** @internal */
54
+ export const commands = {
55
+ era: Ledger.era,
56
+ circuit: CircuitCommand.makeHandler(Ledger, CompactRuntime, capabilities),
57
+ deploy: DeployCommand.makeHandler(Ledger, CompactRuntime),
58
+ maintainCircuit: MaintainCircuitCommand.makeHandler(Ledger),
59
+ maintainContract: MaintainContractCommand.makeHandler(Ledger)
60
+ };
61
+ //# sourceMappingURL=v9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v9.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/v9.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,cAAc,EAA0C,MAAM,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EACL,gCAAgC,EAChC,+BAA+B,EAChC,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,uBAAuB,MAAM,+BAA+B,CAAC;AAIzE;;;;;;;GAOG;AACH,MAAM,YAAY,GAAG;IACnB,yBAAyB,EAAE,CAAC,cAAsB,EAAE,EAAE,CACpD,+BAA+B,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1E,0BAA0B,EAAE,CAAC,cAAsB,EAAE,EAAE,CACrD,gCAAgC,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IACpF,cAAc,EAAE,IAAI;CACgB,CAAC;AA0BvC,gBAAgB;AAChB,MAAM,CAAC,MAAM,QAAQ,GAAgB;IACnC,GAAG,EAAE,MAAM,CAAC,GAAG;IACf,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,YAAY,CAAC;IACzE,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC;IACzD,eAAe,EAAE,sBAAsB,CAAC,WAAW,CAAC,MAAM,CAAC;IAC3D,gBAAgB,EAAE,uBAAuB,CAAC,WAAW,CAAC,MAAM,CAAC;CAC9D,CAAC"}
@@ -0,0 +1,41 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ /**
16
+ * `JSON.stringify` replacer for circuit outputs (results and log events), which contain types that
17
+ * the default serializer mishandles:
18
+ * - `bigint` throws a `TypeError` unless converted, so it is emitted as its decimal string.
19
+ * - `Uint8Array` serializes as an object (`{"0":215,...}`) rather than an array, so it is emitted
20
+ * as a plain `number[]`.
21
+ *
22
+ * @internal
23
+ */
24
+ export const circuitOutputReplacer = (_key, value) => {
25
+ if (typeof value === 'bigint')
26
+ return value.toString();
27
+ if (value instanceof Uint8Array)
28
+ return Array.from(value);
29
+ return value;
30
+ };
31
+ /**
32
+ * Serializes a circuit output value to JSON using {@link circuitOutputReplacer}.
33
+ *
34
+ * @param value The value to serialize.
35
+ * @param space Optional indentation passed through to `JSON.stringify`.
36
+ * @returns The JSON string.
37
+ *
38
+ * @internal
39
+ */
40
+ export const stringifyCircuitOutput = (value, space) => JSON.stringify(value, circuitOutputReplacer, space);
41
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/effect/internal/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAE,KAAc,EAAW,EAAE;IAC7E,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IACvD,IAAI,KAAK,YAAY,UAAU;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAc,EAAE,KAAc,EAAU,EAAE,CAC/E,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,qBAAqB,EAAE,KAAK,CAAC,CAAC"}
@@ -0,0 +1,62 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ import { FileSystem } from '@effect/platform';
16
+ import { Contract, ContractRuntimeError } from '@midnightntwrk/compact-js/effect';
17
+ import { Effect, Option } from 'effect';
18
+ import * as InternalArgs from './args.js';
19
+ import * as InternalCommand from './command.js';
20
+ import * as InternalMaintainCommand from './maintainCommand.js';
21
+ import * as InternalOptions from './options.js';
22
+ /** @internal */
23
+ export const Args = {
24
+ ...InternalMaintainCommand.Args,
25
+ circuitId: InternalArgs.circuitId,
26
+ verifierKeyPath: InternalArgs.verifierKeyPath
27
+ };
28
+ /** @internal */
29
+ export const Options = {
30
+ ...InternalMaintainCommand.Options,
31
+ signingKey: InternalOptions.signingKey,
32
+ signingKind: InternalOptions.signingKind,
33
+ };
34
+ /**
35
+ * Builds the `maintain circuit` handler for one era.
36
+ *
37
+ * @param ledger The era's `Ledger` facade. As with `maintain contract`, no compact-runtime API is
38
+ * reached from here directly.
39
+ *
40
+ * @internal
41
+ */
42
+ export const makeHandler = (ledger) => {
43
+ const { tryLedger, newIntent, serializeIntent } = InternalCommand.makeIntents(ledger);
44
+ return ({ inputFilePath, outputFilePath, address, circuitId, verifierKeyPath }, moduleSpec) => Effect.gen(function* () {
45
+ const fs = yield* FileSystem.FileSystem;
46
+ const { module: { default: contractModule } } = moduleSpec;
47
+ const { contractExecutable } = contractModule;
48
+ const ledgerContractState = yield* fs.readFile(inputFilePath).pipe(Effect.flatMap(ledger.contractStateFromBytes));
49
+ const contractContext = {
50
+ address,
51
+ contractState: yield* ledger.toRuntimeContractState(ledgerContractState)
52
+ };
53
+ const result = yield* Option.match(verifierKeyPath, {
54
+ onSome: (filePath) => fs.readFile(filePath).pipe(Effect.flatMap((data) => contractExecutable.addOrReplaceContractOperation(Contract.ProvableCircuitId(circuitId), Contract.VerifierKey(data), contractContext))),
55
+ onNone: () => contractExecutable.removeContractOperation(Contract.ProvableCircuitId(circuitId), contractContext)
56
+ });
57
+ const emptyIntent = yield* newIntent();
58
+ const intent = yield* tryLedger('Failed to add the maintenance update to the intent', () => emptyIntent.addMaintenanceUpdate(result.public.maintenanceUpdate));
59
+ yield* fs.writeFile(outputFilePath, yield* serializeIntent(intent));
60
+ }).pipe(Effect.mapError((err) => ContractRuntimeError.make('Failed to apply maintenance operation', err)));
61
+ };
62
+ //# sourceMappingURL=maintainCircuitCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maintainCircuitCommand.js","sourceRoot":"","sources":["../../../../src/effect/internal/maintainCircuitCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,YAAY,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,uBAAuB,MAA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MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE;YAClD,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC9C,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,6BAA6B,CACvE,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,EACrC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAC1B,eAAwB,CACzB,CAAC,CACH;YACD,MAAM,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,uBAAuB,CACtD,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,EACrC,eAAwB,CACzB;SACF,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,SAAS,CAC7B,oDAAoD,EACpD,GAAG,EAAE,CAAC,WAAW,CAAC,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,iBAA0B,CAAC,CACjF,CAAC;QACF,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,CACjB,cAAc,EACd,KAAK,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAC/B,CAAC;IACJ,CAAC,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,QAAQ,CACb,CAAC,GAAG,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,uCAAuC,EAAE,GAAG,CAAC,CACjF,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ /*
2
+ * This file is part of midnight-sdk.
3
+ * Copyright (C) 2025 Midnight Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ import { ContractRuntimeError } from '@midnightntwrk/compact-js/effect';
16
+ import { Effect } from 'effect';
17
+ import * as InternalArgs from './args.js';
18
+ import * as InternalOptions from './options.js';
19
+ /** @internal */
20
+ export const Args = {
21
+ address: InternalArgs.contractAddress
22
+ };
23
+ /** @internal */
24
+ export const Options = {
25
+ inputFilePath: InternalOptions.inputFilePath,
26
+ outputFilePath: InternalOptions.outputFilePath
27
+ };
28
+ /** @internal */
29
+ export const handler = (_, __) => Effect.gen(function* () {
30
+ // TODO: The root `maintain` command. Currently there is no logic attached to this command, but in the
31
+ // future, perhaps it could produce a 'diff' of the circuits found in the currently compiled assets vs.
32
+ // what it present in the given contract state.
33
+ return yield* ContractRuntimeError.make('This command is not implemented.');
34
+ });
35
+ //# sourceMappingURL=maintainCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maintainCommand.js","sourceRoot":"","sources":["../../../../src/effect/internal/maintainCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAA2B,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACjG,OAAO,EAAoB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGlD,OAAO,KAAK,YAAY,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAIhD,gBAAgB;AAChB,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,OAAO,EAAE,YAAY,CAAC,eAAe;CACtC,CAAC;AAIF,gBAAgB;AAChB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,aAAa,EAAE,eAAe,CAAC,aAAa;IAC5C,cAAc,EAAE,eAAe,CAAC,cAAc;CAC/C,CAAA;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,OAAO,GAKlB,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC7B,sGAAsG;IACtG,uGAAuG;IACvG,+CAA+C;IAC/C,OAAO,KAAK,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;AAC9E,CAAC,CAAC,CAAC"}