@midnightntwrk/compact-js 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.
- package/LICENSE +14 -0
- package/README.md +158 -2
- package/dist/dts/effect/CompactContext.d.ts +20 -0
- package/dist/dts/effect/CompactContext.d.ts.map +1 -0
- package/dist/dts/effect/CompactRuntime.d.ts +76 -0
- package/dist/dts/effect/CompactRuntime.d.ts.map +1 -0
- package/dist/dts/effect/CompiledContract.d.ts +107 -0
- package/dist/dts/effect/CompiledContract.d.ts.map +1 -0
- package/dist/dts/effect/Contract.d.ts +154 -0
- package/dist/dts/effect/Contract.d.ts.map +1 -0
- package/dist/dts/effect/ContractConfigurationError.d.ts +54 -0
- package/dist/dts/effect/ContractConfigurationError.d.ts.map +1 -0
- package/dist/dts/effect/ContractEventStore.d.ts +167 -0
- package/dist/dts/effect/ContractEventStore.d.ts.map +1 -0
- package/dist/dts/effect/ContractEventValidationError.d.ts +34 -0
- package/dist/dts/effect/ContractEventValidationError.d.ts.map +1 -0
- package/dist/dts/effect/ContractEventValidator.d.ts +18 -0
- package/dist/dts/effect/ContractEventValidator.d.ts.map +1 -0
- package/dist/dts/effect/ContractExecutable.d.ts +99 -0
- package/dist/dts/effect/ContractExecutable.d.ts.map +1 -0
- package/dist/dts/effect/ContractExecutableRuntime.d.ts +4 -0
- package/dist/dts/effect/ContractExecutableRuntime.d.ts.map +1 -0
- package/dist/dts/effect/ContractKeyLocation.d.ts +55 -0
- package/dist/dts/effect/ContractKeyLocation.d.ts.map +1 -0
- package/dist/dts/effect/ContractLog.d.ts +273 -0
- package/dist/dts/effect/ContractLog.d.ts.map +1 -0
- package/dist/dts/effect/ContractRuntimeError.d.ts +34 -0
- package/dist/dts/effect/ContractRuntimeError.d.ts.map +1 -0
- package/dist/dts/effect/Ledger.d.ts +104 -0
- package/dist/dts/effect/Ledger.d.ts.map +1 -0
- package/dist/dts/effect/MalformedHexPrefixError.d.ts +37 -0
- package/dist/dts/effect/MalformedHexPrefixError.d.ts.map +1 -0
- package/dist/dts/effect/ZKConfiguration.d.ts +52 -0
- package/dist/dts/effect/ZKConfiguration.d.ts.map +1 -0
- package/dist/dts/effect/ZKConfigurationReadError.d.ts +45 -0
- package/dist/dts/effect/ZKConfigurationReadError.d.ts.map +1 -0
- package/dist/dts/effect/ZKManifest.d.ts +50 -0
- package/dist/dts/effect/ZKManifest.d.ts.map +1 -0
- package/dist/dts/effect/ZKManifestError.d.ts +34 -0
- package/dist/dts/effect/ZKManifestError.d.ts.map +1 -0
- package/dist/dts/effect/index.d.ts +22 -0
- package/dist/dts/effect/index.d.ts.map +1 -0
- package/dist/dts/effect/internal/boundary.d.ts +35 -0
- package/dist/dts/effect/internal/boundary.d.ts.map +1 -0
- package/dist/dts/effect/internal/compactContext.d.ts +29 -0
- package/dist/dts/effect/internal/compactContext.d.ts.map +1 -0
- package/dist/dts/effect/internal/contractEventsSurface.d.ts +43 -0
- package/dist/dts/effect/internal/contractEventsSurface.d.ts.map +1 -0
- package/dist/dts/effect/internal/era/v8Executable.d.ts +65 -0
- package/dist/dts/effect/internal/era/v8Executable.d.ts.map +1 -0
- package/dist/dts/effect/internal/era/v8Ledger.d.ts +76 -0
- package/dist/dts/effect/internal/era/v8Ledger.d.ts.map +1 -0
- package/dist/dts/effect/internal/era/v8Runtime.d.ts +26 -0
- package/dist/dts/effect/internal/era/v8Runtime.d.ts.map +1 -0
- package/dist/dts/effect/internal/era/v9Executable.d.ts +65 -0
- package/dist/dts/effect/internal/era/v9Executable.d.ts.map +1 -0
- package/dist/dts/effect/internal/era/v9Ledger.d.ts +76 -0
- package/dist/dts/effect/internal/era/v9Ledger.d.ts.map +1 -0
- package/dist/dts/effect/internal/era/v9Runtime.d.ts +15 -0
- package/dist/dts/effect/internal/era/v9Runtime.d.ts.map +1 -0
- package/dist/dts/effect/internal/era.d.ts +117 -0
- package/dist/dts/effect/internal/era.d.ts.map +1 -0
- package/dist/dts/effect/internal/eraFreeSurface.d.ts +49 -0
- package/dist/dts/effect/internal/eraFreeSurface.d.ts.map +1 -0
- package/dist/dts/effect/internal/eraNeutralSurface.d.ts +35 -0
- package/dist/dts/effect/internal/eraNeutralSurface.d.ts.map +1 -0
- package/dist/dts/effect/internal/executable.d.ts +371 -0
- package/dist/dts/effect/internal/executable.d.ts.map +1 -0
- package/dist/dts/effect/internal/ledger/binding.d.ts +2 -0
- package/dist/dts/effect/internal/ledger/binding.d.ts.map +1 -0
- package/dist/dts/effect/internal/ledger/conformance.d.ts +2 -0
- package/dist/dts/effect/internal/ledger/conformance.d.ts.map +1 -0
- package/dist/dts/effect/internal/ledger/conversions.d.ts +167 -0
- package/dist/dts/effect/internal/ledger/conversions.d.ts.map +1 -0
- package/dist/dts/effect/internal/ledger/current.d.ts +8 -0
- package/dist/dts/effect/internal/ledger/current.d.ts.map +1 -0
- package/dist/dts/effect/internal/ledger/v8.d.ts +100 -0
- package/dist/dts/effect/internal/ledger/v8.d.ts.map +1 -0
- package/dist/dts/effect/internal/ledger/v9.d.ts +66 -0
- package/dist/dts/effect/internal/ledger/v9.d.ts.map +1 -0
- package/dist/dts/effect/internal/runtime/binding.d.ts +2 -0
- package/dist/dts/effect/internal/runtime/binding.d.ts.map +1 -0
- package/dist/dts/effect/internal/runtime/conformance.d.ts +2 -0
- package/dist/dts/effect/internal/runtime/conformance.d.ts.map +1 -0
- package/dist/dts/effect/internal/runtime/current.d.ts +11 -0
- package/dist/dts/effect/internal/runtime/current.d.ts.map +1 -0
- package/dist/dts/effect/internal/runtime/execution.d.ts +176 -0
- package/dist/dts/effect/internal/runtime/execution.d.ts.map +1 -0
- package/dist/dts/effect/internal/runtime/v0_16.d.ts +169 -0
- package/dist/dts/effect/internal/runtime/v0_16.d.ts.map +1 -0
- package/dist/dts/effect/internal/runtime/v0_21.d.ts +81 -0
- package/dist/dts/effect/internal/runtime/v0_21.d.ts.map +1 -0
- package/dist/dts/effect/internal/typeAssertions.d.ts +2 -0
- package/dist/dts/effect/internal/typeAssertions.d.ts.map +1 -0
- package/dist/dts/index.d.ts +7 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/v8/effect.d.ts +50 -0
- package/dist/dts/v8/effect.d.ts.map +1 -0
- package/dist/dts/v8/index.d.ts +10 -0
- package/dist/dts/v8/index.d.ts.map +1 -0
- package/dist/dts/v9/effect.d.ts +28 -0
- package/dist/dts/v9/effect.d.ts.map +1 -0
- package/dist/dts/v9/index.d.ts +16 -0
- package/dist/dts/v9/index.d.ts.map +1 -0
- package/dist/esm/effect/CompactContext.js +16 -0
- package/dist/esm/effect/CompactContext.js.map +1 -0
- package/dist/esm/effect/CompactRuntime.js +44 -0
- package/dist/esm/effect/CompactRuntime.js.map +1 -0
- package/dist/esm/effect/CompiledContract.js +102 -0
- package/dist/esm/effect/CompiledContract.js.map +1 -0
- package/dist/esm/effect/Contract.js +40 -0
- package/dist/esm/effect/Contract.js.map +1 -0
- package/dist/esm/effect/ContractConfigurationError.js +41 -0
- package/dist/esm/effect/ContractConfigurationError.js.map +1 -0
- package/dist/esm/effect/ContractEventStore.js +150 -0
- package/dist/esm/effect/ContractEventStore.js.map +1 -0
- package/dist/esm/effect/ContractEventValidationError.js +40 -0
- package/dist/esm/effect/ContractEventValidationError.js.map +1 -0
- package/dist/esm/effect/ContractEventValidator.js +49 -0
- package/dist/esm/effect/ContractEventValidator.js.map +1 -0
- package/dist/esm/effect/ContractExecutable.js +50 -0
- package/dist/esm/effect/ContractExecutable.js.map +1 -0
- package/dist/esm/effect/ContractExecutableRuntime.js +17 -0
- package/dist/esm/effect/ContractExecutableRuntime.js.map +1 -0
- package/dist/esm/effect/ContractKeyLocation.js +67 -0
- package/dist/esm/effect/ContractKeyLocation.js.map +1 -0
- package/dist/esm/effect/ContractLog.js +268 -0
- package/dist/esm/effect/ContractLog.js.map +1 -0
- package/dist/esm/effect/ContractRuntimeError.js +40 -0
- package/dist/esm/effect/ContractRuntimeError.js.map +1 -0
- package/dist/esm/effect/Ledger.js +115 -0
- package/dist/esm/effect/Ledger.js.map +1 -0
- package/dist/esm/effect/MalformedHexPrefixError.js +43 -0
- package/dist/esm/effect/MalformedHexPrefixError.js.map +1 -0
- package/dist/esm/effect/ZKConfiguration.js +23 -0
- package/dist/esm/effect/ZKConfiguration.js.map +1 -0
- package/dist/esm/effect/ZKConfigurationReadError.js +46 -0
- package/dist/esm/effect/ZKConfigurationReadError.js.map +1 -0
- package/dist/esm/effect/ZKManifest.js +286 -0
- package/dist/esm/effect/ZKManifest.js.map +1 -0
- package/dist/esm/effect/ZKManifestError.js +40 -0
- package/dist/esm/effect/ZKManifestError.js.map +1 -0
- package/dist/esm/effect/index.js +36 -0
- package/dist/esm/effect/index.js.map +1 -0
- package/dist/esm/effect/internal/boundary.js +61 -0
- package/dist/esm/effect/internal/boundary.js.map +1 -0
- package/dist/esm/effect/internal/compactContext.js +52 -0
- package/dist/esm/effect/internal/compactContext.js.map +1 -0
- package/dist/esm/effect/internal/contractEventsSurface.js +57 -0
- package/dist/esm/effect/internal/contractEventsSurface.js.map +1 -0
- package/dist/esm/effect/internal/era/v8Executable.js +31 -0
- package/dist/esm/effect/internal/era/v8Executable.js.map +1 -0
- package/dist/esm/effect/internal/era/v8Ledger.js +85 -0
- package/dist/esm/effect/internal/era/v8Ledger.js.map +1 -0
- package/dist/esm/effect/internal/era/v8Runtime.js +39 -0
- package/dist/esm/effect/internal/era/v8Runtime.js.map +1 -0
- package/dist/esm/effect/internal/era/v9Executable.js +31 -0
- package/dist/esm/effect/internal/era/v9Executable.js.map +1 -0
- package/dist/esm/effect/internal/era/v9Ledger.js +83 -0
- package/dist/esm/effect/internal/era/v9Ledger.js.map +1 -0
- package/dist/esm/effect/internal/era/v9Runtime.js +28 -0
- package/dist/esm/effect/internal/era/v9Runtime.js.map +1 -0
- package/dist/esm/effect/internal/era.js +16 -0
- package/dist/esm/effect/internal/era.js.map +1 -0
- package/dist/esm/effect/internal/eraFreeSurface.js +63 -0
- package/dist/esm/effect/internal/eraFreeSurface.js.map +1 -0
- package/dist/esm/effect/internal/eraNeutralSurface.js +49 -0
- package/dist/esm/effect/internal/eraNeutralSurface.js.map +1 -0
- package/dist/esm/effect/internal/executable.js +531 -0
- package/dist/esm/effect/internal/executable.js.map +1 -0
- package/dist/esm/effect/internal/ledger/binding.js +20 -0
- package/dist/esm/effect/internal/ledger/binding.js.map +1 -0
- package/dist/esm/effect/internal/ledger/conformance.js +16 -0
- package/dist/esm/effect/internal/ledger/conformance.js.map +1 -0
- package/dist/esm/effect/internal/ledger/conversions.js +119 -0
- package/dist/esm/effect/internal/ledger/conversions.js.map +1 -0
- package/dist/esm/effect/internal/ledger/current.js +22 -0
- package/dist/esm/effect/internal/ledger/current.js.map +1 -0
- package/dist/esm/effect/internal/ledger/v8.js +101 -0
- package/dist/esm/effect/internal/ledger/v8.js.map +1 -0
- package/dist/esm/effect/internal/ledger/v9.js +91 -0
- package/dist/esm/effect/internal/ledger/v9.js.map +1 -0
- package/dist/esm/effect/internal/runtime/binding.js +16 -0
- package/dist/esm/effect/internal/runtime/binding.js.map +1 -0
- package/dist/esm/effect/internal/runtime/conformance.js +16 -0
- package/dist/esm/effect/internal/runtime/conformance.js.map +1 -0
- package/dist/esm/effect/internal/runtime/current.js +25 -0
- package/dist/esm/effect/internal/runtime/current.js.map +1 -0
- package/dist/esm/effect/internal/runtime/execution.js +16 -0
- package/dist/esm/effect/internal/runtime/execution.js.map +1 -0
- package/dist/esm/effect/internal/runtime/v0_16.js +178 -0
- package/dist/esm/effect/internal/runtime/v0_16.js.map +1 -0
- package/dist/esm/effect/internal/runtime/v0_21.js +129 -0
- package/dist/esm/effect/internal/runtime/v0_21.js.map +1 -0
- package/dist/esm/effect/internal/typeAssertions.js +16 -0
- package/dist/esm/effect/internal/typeAssertions.js.map +1 -0
- package/dist/esm/index.js +21 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +4 -0
- package/dist/esm/v8/effect.js +64 -0
- package/dist/esm/v8/effect.js.map +1 -0
- package/dist/esm/v8/index.js +24 -0
- package/dist/esm/v8/index.js.map +1 -0
- package/dist/esm/v9/effect.js +47 -0
- package/dist/esm/v9/effect.js.map +1 -0
- package/dist/esm/v9/index.js +30 -0
- package/dist/esm/v9/index.js.map +1 -0
- package/effect/CompactContext/package.json +5 -0
- package/effect/CompactRuntime/package.json +5 -0
- package/effect/CompiledContract/package.json +5 -0
- package/effect/Contract/package.json +5 -0
- package/effect/ContractConfigurationError/package.json +5 -0
- package/effect/ContractEventStore/package.json +5 -0
- package/effect/ContractEventValidationError/package.json +5 -0
- package/effect/ContractEventValidator/package.json +5 -0
- package/effect/ContractExecutable/package.json +5 -0
- package/effect/ContractExecutableRuntime/package.json +5 -0
- package/effect/ContractKeyLocation/package.json +5 -0
- package/effect/ContractLog/package.json +5 -0
- package/effect/ContractRuntimeError/package.json +5 -0
- package/effect/Ledger/package.json +5 -0
- package/effect/MalformedHexPrefixError/package.json +5 -0
- package/effect/ZKConfiguration/package.json +5 -0
- package/effect/ZKConfigurationReadError/package.json +5 -0
- package/effect/ZKManifest/package.json +5 -0
- package/effect/ZKManifestError/package.json +5 -0
- package/effect/index/package.json +5 -0
- package/effect/package.json +5 -0
- package/package.json +220 -4
- package/v8/effect/package.json +5 -0
- package/v8/package.json +5 -0
- package/v9/effect/package.json +5 -0
- package/v9/package.json +5 -0
|
@@ -0,0 +1,85 @@
|
|
|
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 **ledger 8** `Ledger` facade — pinned to that era, independent of `current.ts`.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* The twin of `effect/Ledger.ts`, which instantiates the same conversions factory against whatever
|
|
20
|
+
* `current.ts` binds. This module instead pins ledger 8 and its paired compact-runtime 0.16 line,
|
|
21
|
+
* so `/v8/effect` genuinely *selects* an era rather than labelling the build's one bound era
|
|
22
|
+
* (midnight-sdk#387/#388).
|
|
23
|
+
*
|
|
24
|
+
* Both facades exist at once, which is the property that makes an era-suffixed subpath meaningful:
|
|
25
|
+
* `test/era8/LedgerEightFacade.test.ts` exercises this pair while the default test project
|
|
26
|
+
* exercises the ledger 9 pair.
|
|
27
|
+
*
|
|
28
|
+
* The duplication against `Ledger.ts` is deliberate and thin — a curated type re-export list plus
|
|
29
|
+
* one factory call. The *bodies* live in `internal/ledger/conversions.ts` and are shared; only the
|
|
30
|
+
* era binding differs. A type re-export cannot come from a factory, which is why there is a module
|
|
31
|
+
* per era rather than one parameterised module.
|
|
32
|
+
*
|
|
33
|
+
* This docblock carries no internal-marker JSDoc tag. A module docblock attaches to the file's
|
|
34
|
+
* first statement — here the `effect` import — so under `stripInternal` the marker deleted that
|
|
35
|
+
* import from the emitted typings while every conversion below went on returning an
|
|
36
|
+
* `Effect.Effect<…>`, leaving the published `.d.ts` naming a namespace it no longer imports.
|
|
37
|
+
* This is the `Ledger` of `/v8/effect`, so the damage landed on a headline entry. Privacy
|
|
38
|
+
* comes from `package.json` `exports` blocking `./effect/internal/*` instead. See
|
|
39
|
+
* `internal/boundary.ts` for why this note does not spell the tag out.
|
|
40
|
+
*/
|
|
41
|
+
import { Effect } from 'effect';
|
|
42
|
+
import * as ContractRuntimeError from '../../ContractRuntimeError.js';
|
|
43
|
+
import { makeConversions, tryConvert } from '../ledger/conversions.js';
|
|
44
|
+
import * as V8 from '../ledger/v8.js';
|
|
45
|
+
import * as V0_16 from '../runtime/v0_16.js';
|
|
46
|
+
export { tryConvert } from '../ledger/conversions.js';
|
|
47
|
+
export * from '../ledger/v8.js';
|
|
48
|
+
// Ledger 8 with compact-runtime 0.16 — the era pair `v8.ts` declares via `era.runtime`. Passing
|
|
49
|
+
// both halves to one factory is what makes a mismatched pair a construction error rather than a
|
|
50
|
+
// run-time surprise.
|
|
51
|
+
const conversions = makeConversions(V8, V0_16);
|
|
52
|
+
/** Converts a runtime `ContractState` to ledger 8's. @category conversions */
|
|
53
|
+
export const fromRuntimeContractState = conversions.fromRuntimeContractState;
|
|
54
|
+
/** Converts a ledger 8 `ContractState` to the paired runtime's. @category conversions */
|
|
55
|
+
export const toRuntimeContractState = conversions.toRuntimeContractState;
|
|
56
|
+
/** Deserializes ledger-serialized bytes into a ledger 8 `ContractState`. @category conversions */
|
|
57
|
+
export const contractStateFromBytes = conversions.contractStateFromBytes;
|
|
58
|
+
/** Deserializes ledger-serialized bytes into ledger 8 `LedgerParameters`. @category conversions */
|
|
59
|
+
export const parametersFromBytes = conversions.parametersFromBytes;
|
|
60
|
+
/** Converts a runtime `ContractMaintenanceAuthority` to ledger 8's. @category conversions */
|
|
61
|
+
export const fromRuntimeMaintenanceAuthority = conversions.fromRuntimeMaintenanceAuthority;
|
|
62
|
+
/** Converts a runtime `StateValue` to ledger 8's via the shared binary encoding. @category conversions */
|
|
63
|
+
export const fromRuntimeStateValue = conversions.fromRuntimeStateValue;
|
|
64
|
+
/** Converts a runtime `QueryContext` to ledger 8's. @category conversions */
|
|
65
|
+
export const fromRuntimeQueryContext = conversions.fromRuntimeQueryContext;
|
|
66
|
+
/**
|
|
67
|
+
* Adapts a platform-js signing key to ledger 8's `SigningKey`.
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* Returns a **bare hex string**, not the `{ tag, value }` pair the ledger 9 facade returns: this
|
|
71
|
+
* era has no tagged-key concept. An ECDSA key is rejected rather than coerced, because it has no
|
|
72
|
+
* representation here at all.
|
|
73
|
+
*
|
|
74
|
+
* @category conversions
|
|
75
|
+
*/
|
|
76
|
+
export const fromPlatformSigningKey = conversions.fromPlatformSigningKey;
|
|
77
|
+
/**
|
|
78
|
+
* Resolves the `ContractOperation` for a circuit from a ledger 8 contract state, failing if absent.
|
|
79
|
+
*
|
|
80
|
+
* @category conversions
|
|
81
|
+
*/
|
|
82
|
+
export const operationForCircuit = (state, circuitId, contractAddress) => tryConvert(`Unexpected error resolving the operation for circuit '${circuitId}' on '${contractAddress}'`, () => state.operation(circuitId)).pipe(Effect.flatMap((operation) => operation === undefined
|
|
83
|
+
? ContractRuntimeError.make(`Contract state for '${contractAddress}' has no operation for circuit '${circuitId}'.`)
|
|
84
|
+
: Effect.succeed(operation)));
|
|
85
|
+
//# sourceMappingURL=v8Ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v8Ledger.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/v8Ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,oBAAoB,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,cAAc,iBAAiB,CAAC;AAEhC,gGAAgG;AAChG,gGAAgG;AAChG,qBAAqB;AACrB,MAAM,WAAW,GAAG,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAE/C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,wBAAwB,CAAC;AAE7E,yFAAyF;AACzF,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAAsB,CAAC;AAEzE,kGAAkG;AAClG,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAAsB,CAAC;AAEzE,mGAAmG;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAAmB,CAAC;AAEnE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,+BAA+B,GAAG,WAAW,CAAC,+BAA+B,CAAC;AAE3F,0GAA0G;AAC1G,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,qBAAqB,CAAC;AAEvE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC;AAE3E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAAsB,CAAC;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAIsD,CACpF,KAAK,EACL,SAAS,EACT,eAAe,EACf,EAAE,CACF,UAAU,CAAC,yDAAyD,SAAS,SAAS,eAAe,GAAG,EAAE,GAAG,EAAE,CAC7G,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAC3B,CAAC,IAAI,CACJ,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAC3B,SAAS,KAAK,SAAS;IACrB,CAAC,CAAC,oBAAoB,CAAC,IAAI,CACvB,uBAAuB,eAAe,mCAAmC,SAAS,IAAI,CACvF;IACH,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAC9B,CACF,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 **compact-runtime 0.16** facade — the runtime half of the ledger 8 era, pinned rather than
|
|
17
|
+
* resolved through `current.ts`.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* The twin of `effect/CompactRuntime.ts`, and the runtime-side counterpart of
|
|
21
|
+
* {@link v8Ledger}: an era-pinned entry needs its own instance of *both* seams, or the entry names
|
|
22
|
+
* one era and hands back another's objects.
|
|
23
|
+
*
|
|
24
|
+
* The binding alone is not the facade. `internal/runtime/v0_16.ts` is a curated re-export of the
|
|
25
|
+
* 0.16 package, and every one of those names signals rejection by throwing across the WASM
|
|
26
|
+
* boundary — so an entry that exported the binding directly would be the one place in the package
|
|
27
|
+
* where a rejection becomes a defect instead of a typed failure. That is not a stylistic gap: a
|
|
28
|
+
* defect escapes the caller's declared error channel, so a dApp's `catchAll` over
|
|
29
|
+
* `ContractExecutionError` never sees it and the CLI (running with `disableErrorReporting`) exits
|
|
30
|
+
* non-zero printing nothing at all. Adding {@link tryRuntime} here is what makes `/v8/effect` offer
|
|
31
|
+
* the same failure contract as the unsuffixed entry.
|
|
32
|
+
*
|
|
33
|
+
* One function object backs every alias — `Ledger.tryConvert`, `CompactRuntime.tryRuntime`, and
|
|
34
|
+
* both eras' — because they all re-export `internal/boundary.ts`. The era 8 facade test asserts
|
|
35
|
+
* that identity rather than just the presence of a function.
|
|
36
|
+
*/
|
|
37
|
+
export { tryBoundary as tryRuntime } from '../boundary.js';
|
|
38
|
+
export * from '../runtime/v0_16.js';
|
|
39
|
+
//# sourceMappingURL=v8Runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v8Runtime.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/v8Runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3D,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 Internal from '../executable.js';
|
|
16
|
+
import * as Ledger from './v9Ledger.js';
|
|
17
|
+
import * as Runtime from './v9Runtime.js';
|
|
18
|
+
const executable = Internal.makeExecutable(Ledger, Runtime);
|
|
19
|
+
/**
|
|
20
|
+
* Takes a Compact compiled contract, and makes it executable against ledger 9.
|
|
21
|
+
*
|
|
22
|
+
* @category constructors
|
|
23
|
+
*/
|
|
24
|
+
export const make = executable.make;
|
|
25
|
+
/**
|
|
26
|
+
* Provides a layer to the executable contract.
|
|
27
|
+
*
|
|
28
|
+
* @category combinators
|
|
29
|
+
*/
|
|
30
|
+
export const provide = executable.provide;
|
|
31
|
+
//# sourceMappingURL=v9Executable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v9Executable.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/v9Executable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAkBH,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAK1C,MAAM,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AA0C5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
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 **ledger 9** `Ledger` facade — pinned to that era, independent of `current.ts`.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* The twin of `v8Ledger.ts`, and the reason `/v9/effect` is now an era-pinned entry rather than a
|
|
20
|
+
* second name for the build's bound era. Previously `/v9` re-exported `effect/Ledger.ts`, which
|
|
21
|
+
* resolves `internal/ledger/current.ts`; repointing that at a later era therefore turned `/v9` into
|
|
22
|
+
* an entry for *that* era, with no build error and no failing test — the `/v9`-versus-root parity
|
|
23
|
+
* checks compared an alias against its own target, so they passed by construction. Binding v9 here
|
|
24
|
+
* makes the suffix mean what it says (midnight-sdk#388).
|
|
25
|
+
*
|
|
26
|
+
* `effect/Ledger.ts` keeps its role: it is the facade for the **unsuffixed** entry, which is
|
|
27
|
+
* deliberately "whatever era this build bound". The two agree today and are expected to diverge the
|
|
28
|
+
* first time `current.ts` advances — that divergence is the point, not a defect.
|
|
29
|
+
*
|
|
30
|
+
* Both halves of the era pair are passed to one conversions factory, so a mismatched pair is a
|
|
31
|
+
* construction error rather than a run-time surprise. The bodies live in
|
|
32
|
+
* `internal/ledger/conversions.ts` and are shared with every other era; only the binding differs.
|
|
33
|
+
*
|
|
34
|
+
* This docblock carries no internal-marker JSDoc tag. A module docblock attaches to the file's
|
|
35
|
+
* first statement — here the `effect` import — so under `stripInternal` the marker deleted that
|
|
36
|
+
* import from the emitted typings while every conversion below went on returning an
|
|
37
|
+
* `Effect.Effect<…>`, leaving the published `.d.ts` naming a namespace it no longer imports.
|
|
38
|
+
* This is the `Ledger` of `/v9/effect`, so the damage landed on a headline entry. Privacy
|
|
39
|
+
* comes from `package.json` `exports` blocking `./effect/internal/*` instead. See
|
|
40
|
+
* `internal/boundary.ts` for why this note does not spell the tag out.
|
|
41
|
+
*/
|
|
42
|
+
import { Effect } from 'effect';
|
|
43
|
+
import * as ContractRuntimeError from '../../ContractRuntimeError.js';
|
|
44
|
+
import { makeConversions, tryConvert } from '../ledger/conversions.js';
|
|
45
|
+
import * as V9 from '../ledger/v9.js';
|
|
46
|
+
import * as V0_21 from '../runtime/v0_21.js';
|
|
47
|
+
export { tryConvert } from '../ledger/conversions.js';
|
|
48
|
+
export * from '../ledger/v9.js';
|
|
49
|
+
// Ledger 9 with compact-runtime 0.21 — the era pair `v9.ts` declares via `era.runtime`.
|
|
50
|
+
const conversions = makeConversions(V9, V0_21);
|
|
51
|
+
/** Converts a runtime `ContractState` to ledger 9's. @category conversions */
|
|
52
|
+
export const fromRuntimeContractState = conversions.fromRuntimeContractState;
|
|
53
|
+
/** Converts a ledger 9 `ContractState` to the paired runtime's. @category conversions */
|
|
54
|
+
export const toRuntimeContractState = conversions.toRuntimeContractState;
|
|
55
|
+
/** Deserializes ledger-serialized bytes into a ledger 9 `ContractState`. @category conversions */
|
|
56
|
+
export const contractStateFromBytes = conversions.contractStateFromBytes;
|
|
57
|
+
/** Deserializes ledger-serialized bytes into ledger 9 `LedgerParameters`. @category conversions */
|
|
58
|
+
export const parametersFromBytes = conversions.parametersFromBytes;
|
|
59
|
+
/** Converts a runtime `ContractMaintenanceAuthority` to ledger 9's. @category conversions */
|
|
60
|
+
export const fromRuntimeMaintenanceAuthority = conversions.fromRuntimeMaintenanceAuthority;
|
|
61
|
+
/** Converts a runtime `StateValue` to ledger 9's via the shared binary encoding. @category conversions */
|
|
62
|
+
export const fromRuntimeStateValue = conversions.fromRuntimeStateValue;
|
|
63
|
+
/** Converts a runtime `QueryContext` to ledger 9's. @category conversions */
|
|
64
|
+
export const fromRuntimeQueryContext = conversions.fromRuntimeQueryContext;
|
|
65
|
+
/**
|
|
66
|
+
* Adapts a platform-js signing key to ledger 9's `SigningKey`.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* Returns the `{ tag, value }` pair this era tags keys with, and accepts every scheme in the era's
|
|
70
|
+
* CMA allowlist — unlike ledger 8, which has no tagged-key concept and only BIP-340.
|
|
71
|
+
*
|
|
72
|
+
* @category conversions
|
|
73
|
+
*/
|
|
74
|
+
export const fromPlatformSigningKey = conversions.fromPlatformSigningKey;
|
|
75
|
+
/**
|
|
76
|
+
* Resolves the `ContractOperation` for a circuit from a ledger 9 contract state, failing if absent.
|
|
77
|
+
*
|
|
78
|
+
* @category conversions
|
|
79
|
+
*/
|
|
80
|
+
export const operationForCircuit = (state, circuitId, contractAddress) => tryConvert(`Unexpected error resolving the operation for circuit '${circuitId}' on '${contractAddress}'`, () => state.operation(circuitId)).pipe(Effect.flatMap((operation) => operation === undefined
|
|
81
|
+
? ContractRuntimeError.make(`Contract state for '${contractAddress}' has no operation for circuit '${circuitId}'.`)
|
|
82
|
+
: Effect.succeed(operation)));
|
|
83
|
+
//# sourceMappingURL=v9Ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v9Ledger.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/v9Ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,oBAAoB,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,cAAc,iBAAiB,CAAC;AAEhC,wFAAwF;AACxF,MAAM,WAAW,GAAG,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAE/C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,wBAAwB,CAAC;AAE7E,yFAAyF;AACzF,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAAsB,CAAC;AAEzE,kGAAkG;AAClG,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAAsB,CAAC;AAEzE,mGAAmG;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAAmB,CAAC;AAEnE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,+BAA+B,GAAG,WAAW,CAAC,+BAA+B,CAAC;AAE3F,0GAA0G;AAC1G,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,qBAAqB,CAAC;AAEvE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC;AAE3E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAAsB,CAAC;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAIsD,CACpF,KAAK,EACL,SAAS,EACT,eAAe,EACf,EAAE,CACF,UAAU,CAAC,yDAAyD,SAAS,SAAS,eAAe,GAAG,EAAE,GAAG,EAAE,CAC7G,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAC3B,CAAC,IAAI,CACJ,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAC3B,SAAS,KAAK,SAAS;IACrB,CAAC,CAAC,oBAAoB,CAAC,IAAI,CACvB,uBAAuB,eAAe,mCAAmC,SAAS,IAAI,CACvF;IACH,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAC9B,CACF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 **compact-runtime 0.21** facade — the runtime half of the ledger 9 era, pinned rather than
|
|
17
|
+
* resolved through `current.ts`.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* The ledger 9 twin of {@link v8Runtime}; see that module for why an era-pinned entry needs a
|
|
21
|
+
* facade rather than the bare binding, and why {@link tryRuntime} is part of what "same public API
|
|
22
|
+
* across eras" means. Pinned rather than re-exporting `effect/CompactRuntime.ts`, for the same
|
|
23
|
+
* reason {@link v9Ledger} does not re-export `effect/Ledger.ts`: that module follows `current.ts`,
|
|
24
|
+
* so `/v9/effect` would silently follow an era swap instead of staying on ledger 9.
|
|
25
|
+
*/
|
|
26
|
+
export { tryBoundary as tryRuntime } from '../boundary.js';
|
|
27
|
+
export * from '../runtime/v0_21.js';
|
|
28
|
+
//# sourceMappingURL=v9Runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v9Runtime.js","sourceRoot":"","sources":["../../../../../src/effect/internal/era/v9Runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3D,cAAc,qBAAqB,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=era.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"era.js","sourceRoot":"","sources":["../../../../src/effect/internal/era.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 **era-free** core of the `/effect` surface: modules whose runtime behaviour has no ledger or
|
|
17
|
+
* compact-runtime dependency at all, so every era entry can re-export the same objects.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* The distinction against `eraNeutralSurface.ts` is not stylistic. "Era-neutral" means *works on
|
|
21
|
+
* whichever era the build bound* — those modules reach `Ledger.js`/`CompactRuntime.js` and so
|
|
22
|
+
* resolve through each seam's `current.ts`. "Era-free" means the module graph never reaches either
|
|
23
|
+
* facade, so the same compiled object is correct on every era simultaneously. Only the second kind
|
|
24
|
+
* can be re-exported from an era-pinned entry without mislabelling what it returns.
|
|
25
|
+
*
|
|
26
|
+
* Membership is a verifiable property, not a judgement: take the transitive `import` closure of a
|
|
27
|
+
* module in the **built** output (types erased) and check it contains neither `CompactRuntime.js`
|
|
28
|
+
* nor `Ledger.js`. Two members look era-coupled in source and are not — `Contract.ts` and
|
|
29
|
+
* `ContractConfigurationError.ts` import runtime types with `import type`, which is erased. Their
|
|
30
|
+
* *type parameters* still name the bound era's shapes; that is a type-level inaccuracy for an older
|
|
31
|
+
* era, tracked with the executable's parameterisation, and it does not make the values era-bound.
|
|
32
|
+
*
|
|
33
|
+
* `ContractExecutable` is deliberately **not** here: it is the one module in the public surface with
|
|
34
|
+
* value-level imports of both facades, which is why `/v8/effect` cannot yet offer it
|
|
35
|
+
* (midnight-sdk#388). The contract-event modules are also absent, but for the opposite reason —
|
|
36
|
+
* they are era-free at run time yet meaningless on a line that cannot emit events, so they live in
|
|
37
|
+
* `contractEventsSurface.ts` and are composed only by entries whose era supports them.
|
|
38
|
+
*
|
|
39
|
+
* Internal by design: consumers reach these through `@midnightntwrk/compact-js/effect` or an
|
|
40
|
+
* era-pinned entry, and `package.json` `exports` blocks `./effect/internal/*` with `null`. The era
|
|
41
|
+
* entry files under `src/v<N>` are package-internal source, so they may import it.
|
|
42
|
+
*
|
|
43
|
+
* Keep alphabetized, matching `effect/index.ts`.
|
|
44
|
+
*
|
|
45
|
+
* This docblock carries no internal-marker JSDoc tag: a module docblock attaches to the file's
|
|
46
|
+
* first statement, so under `stripInternal` the marker deletes the first export below — silently,
|
|
47
|
+
* since the ESM emit keeps it. Privacy comes from `package.json` `exports` blocking
|
|
48
|
+
* `./effect/internal/*` instead, and `verify-exports` fails the build if the marker comes back.
|
|
49
|
+
* See `internal/boundary.ts` for why this note does not spell the tag out.
|
|
50
|
+
*/
|
|
51
|
+
export * as CompactContext from '../CompactContext.js';
|
|
52
|
+
export * as CompiledContract from '../CompiledContract.js';
|
|
53
|
+
export * as Contract from '../Contract.js';
|
|
54
|
+
export * as ContractConfigurationError from '../ContractConfigurationError.js';
|
|
55
|
+
export * as ContractExecutableRuntime from '../ContractExecutableRuntime.js';
|
|
56
|
+
export * as ContractKeyLocation from '../ContractKeyLocation.js';
|
|
57
|
+
export * as ContractRuntimeError from '../ContractRuntimeError.js';
|
|
58
|
+
export * as MalformedHexPrefixError from '../MalformedHexPrefixError.js';
|
|
59
|
+
export * as ZKConfiguration from '../ZKConfiguration.js';
|
|
60
|
+
export * as ZKConfigurationReadError from '../ZKConfigurationReadError.js';
|
|
61
|
+
export * as ZKManifest from '../ZKManifest.js';
|
|
62
|
+
export * as ZKManifestError from '../ZKManifestError.js';
|
|
63
|
+
//# sourceMappingURL=eraFreeSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eraFreeSurface.js","sourceRoot":"","sources":["../../../../src/effect/internal/eraFreeSurface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,0BAA0B,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,yBAAyB,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,mBAAmB,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,oBAAoB,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,uBAAuB,MAAM,+BAA+B,CAAC;AACzE,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,wBAAwB,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 **era-neutral** half of the `/effect` surface: the era-free core, plus the members that work
|
|
17
|
+
* on whichever era this build bound.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Split out from `effect/index.ts` so an era-scoped entry composes only the levels its runtime line
|
|
21
|
+
* can actually provide (midnight-sdk#387/#388). This barrel is what the *unsuffixed* entry uses:
|
|
22
|
+
* the three members added below reach `Ledger.js`/`CompactRuntime.js`, so they resolve through each
|
|
23
|
+
* seam's `current.ts` and describe the build's bound era rather than a named one.
|
|
24
|
+
*
|
|
25
|
+
* An era-pinned entry therefore composes `eraFreeSurface.ts` plus its **own** binding, not this
|
|
26
|
+
* module — see `src/v8/effect.ts` and `src/v9/effect.ts`. Re-exporting this barrel from `/v8` would
|
|
27
|
+
* hand back ledger-9-bound objects from a path named v8, and re-exporting it from `/v9` is what
|
|
28
|
+
* previously made `/v9` an alias that silently followed an era swap.
|
|
29
|
+
*
|
|
30
|
+
* #388 requires that a member which cannot exist on an older era is *absent* from that era's entry
|
|
31
|
+
* rather than present and failing at run time. The contract-event modules are absent from every
|
|
32
|
+
* barrel here and live in `contractEventsSurface.ts`, composed only by entries whose era can emit
|
|
33
|
+
* events. `LedgerEra.test.ts` asserts both halves of that.
|
|
34
|
+
*
|
|
35
|
+
* Internal by design: consumers reach these through `@midnightntwrk/compact-js/effect` or an
|
|
36
|
+
* era-pinned entry, and `package.json` `exports` blocks `./effect/internal/*` with `null`. The
|
|
37
|
+
* era entry files under the `src/v<N>` directories are package-internal source, so they may
|
|
38
|
+
* import it.
|
|
39
|
+
*
|
|
40
|
+
* Keep alphabetized, matching `effect/index.ts`.
|
|
41
|
+
*
|
|
42
|
+
* No internal-marker JSDoc tag — see `eraFreeSurface.ts` for why a module docblock must not carry
|
|
43
|
+
* one here.
|
|
44
|
+
*/
|
|
45
|
+
export * as CompactRuntime from '../CompactRuntime.js';
|
|
46
|
+
export * as ContractExecutable from '../ContractExecutable.js';
|
|
47
|
+
export * as Ledger from '../Ledger.js';
|
|
48
|
+
export * from './eraFreeSurface.js';
|
|
49
|
+
//# sourceMappingURL=eraNeutralSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eraNeutralSurface.js","sourceRoot":"","sources":["../../../../src/effect/internal/eraNeutralSurface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
|