@midnight-ntwrk/midnight-js-protocol 5.0.0-beta.8-pre.765ca083 → 5.0.0-beta.8
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/index.d.ts +27 -3
- package/dist/index.js +1 -1
- package/dist/prove.d.ts +1 -1
- package/dist/prove.js +1 -1
- package/dist/version.d.ts +27 -3
- package/dist/version.js +16 -2
- package/dist/version.js.map +1 -1
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,30 @@ function _mergeNamespaces(n, m) {
|
|
|
41
41
|
*/
|
|
42
42
|
declare const LEDGER_VERSIONS: readonly ["v8", "v9"];
|
|
43
43
|
type LedgerVersion = (typeof LEDGER_VERSIONS)[number];
|
|
44
|
+
/**
|
|
45
|
+
* The era whose objects this build hands out live, through `./ledger`.
|
|
46
|
+
*
|
|
47
|
+
* A protocol fact rather than a consumer's choice: it is decided by which
|
|
48
|
+
* ledger the package links eagerly, and every other era is reached lazily and
|
|
49
|
+
* crosses package boundaries as bytes. Declared here so that no package
|
|
50
|
+
* downstream restates "which era is now" as a literal of its own.
|
|
51
|
+
*
|
|
52
|
+
* The type is the single literal, not {@link LedgerVersion}, so a value typed
|
|
53
|
+
* by it DISCRIMINATES — the same discipline `CurrentPipelineEra` follows in
|
|
54
|
+
* `midnight-js-contracts`.
|
|
55
|
+
*/
|
|
56
|
+
declare const CURRENT_LEDGER_VERSION: "v9";
|
|
57
|
+
type CurrentLedgerVersion = typeof CURRENT_LEDGER_VERSION;
|
|
58
|
+
/**
|
|
59
|
+
* Every era this build still speaks but does not run live — the eras that
|
|
60
|
+
* cross a package boundary as serialized bytes.
|
|
61
|
+
*
|
|
62
|
+
* Defined as the complement of {@link CURRENT_LEDGER_VERSION}, so a further
|
|
63
|
+
* era joins this set by being added to {@link LEDGER_VERSIONS} and nothing
|
|
64
|
+
* else. The value list below is checked against that complement at build time.
|
|
65
|
+
*/
|
|
66
|
+
type RetainedLedgerVersion = Exclude<LedgerVersion, CurrentLedgerVersion>;
|
|
67
|
+
declare const RETAINED_LEDGER_VERSIONS: readonly ["v8"];
|
|
44
68
|
|
|
45
69
|
/**
|
|
46
70
|
* Stable error-code strings for this package. Every error class in this module
|
|
@@ -947,7 +971,7 @@ declare const versionOfRecord: (record: VersionedRecord) => LedgerVersion;
|
|
|
947
971
|
* will land in, and a stale reading is wrong exactly at the fork boundary,
|
|
948
972
|
* where that question matters. `PublicDataProvider.queryLatestProtocolVersion`
|
|
949
973
|
* states the same prohibition as a requirement on its implementations; this
|
|
950
|
-
* parameter is a structural type, so nothing here can enforce it. See ADR
|
|
974
|
+
* parameter is a structural type, so nothing here can enforce it. See ADR 0007.
|
|
951
975
|
*
|
|
952
976
|
* @param source The indexer or node client to ask for the head version.
|
|
953
977
|
* @returns A promise for the {@link LedgerVersion} at the network head.
|
|
@@ -1258,5 +1282,5 @@ interface Ledger8Engine {
|
|
|
1258
1282
|
*/
|
|
1259
1283
|
declare const loadLedger8Engine: () => Promise<Ledger8Engine>;
|
|
1260
1284
|
|
|
1261
|
-
export { ComposeFailedError, ComposeOptionError, DownConvertFailedError, INITIAL_LEDGER_PARAMETERS, LEDGER_VERSIONS, Ledger8InstanceMismatchError, Ledger8RuntimeInvalidError, Ledger8RuntimeMissingError, MerkleNotRehashedError, NO_CIRCUIT, PROTOCOL_ERROR_CODES, PayloadNotATransactionError, StateDecodeFailedError, TRANSACTION_TAG_PREFIX, UnknownLedger8AxisError, UnknownLedgerVersionError, UnknownProtocolVersionError, loadLedger8, loadLedger8Engine, loadLedgerEra, networkHeadVersion, protocolVersionToLedger, versionOfRecord };
|
|
1262
|
-
export type { CallTranscriptSource, ComposeCallEntry, ComposeCallOptions, ComposeDeployOptions, ComposeOption, ComposeStage, ConstructorResultPojo, ContractEntryPointPojo, ContractStatePojo, DeployResultPojo, DownConvertStage, DownConvertedState, EraPartitionCallOptions, ExecuteCircuitOptions, ExecuteConstructorOptions, Ledger8ChargedState, Ledger8DeployableContractState, Ledger8Engine, Ledger8InstanceAxis, Ledger8StateValue, LedgerEra, LedgerParametersOption, LedgerVersion, PartitionContext, PartitionedCallTranscript, ProtocolErrorCode, ProtocolV8, ProtocolVersionSource, ProtocolVersionUnknownReason, RetainedEraSubpath, TranscriptPojo, VersionResolutionPath, VersionedRecord, WrapKeepStateCallOptions };
|
|
1285
|
+
export { CURRENT_LEDGER_VERSION, ComposeFailedError, ComposeOptionError, DownConvertFailedError, INITIAL_LEDGER_PARAMETERS, LEDGER_VERSIONS, Ledger8InstanceMismatchError, Ledger8RuntimeInvalidError, Ledger8RuntimeMissingError, MerkleNotRehashedError, NO_CIRCUIT, PROTOCOL_ERROR_CODES, PayloadNotATransactionError, RETAINED_LEDGER_VERSIONS, StateDecodeFailedError, TRANSACTION_TAG_PREFIX, UnknownLedger8AxisError, UnknownLedgerVersionError, UnknownProtocolVersionError, loadLedger8, loadLedger8Engine, loadLedgerEra, networkHeadVersion, protocolVersionToLedger, versionOfRecord };
|
|
1286
|
+
export type { CallTranscriptSource, ComposeCallEntry, ComposeCallOptions, ComposeDeployOptions, ComposeOption, ComposeStage, ConstructorResultPojo, ContractEntryPointPojo, ContractStatePojo, CurrentLedgerVersion, DeployResultPojo, DownConvertStage, DownConvertedState, EraPartitionCallOptions, ExecuteCircuitOptions, ExecuteConstructorOptions, Ledger8ChargedState, Ledger8DeployableContractState, Ledger8Engine, Ledger8InstanceAxis, Ledger8StateValue, LedgerEra, LedgerParametersOption, LedgerVersion, PartitionContext, PartitionedCallTranscript, ProtocolErrorCode, ProtocolV8, ProtocolVersionSource, ProtocolVersionUnknownReason, RetainedEraSubpath, RetainedLedgerVersion, TranscriptPojo, VersionResolutionPath, VersionedRecord, WrapKeepStateCallOptions };
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { hashVerifierKey } from '@midnight-ntwrk/compact-js';
|
|
|
9
9
|
import * as compactJs from '@midnight-ntwrk/compact-js';
|
|
10
10
|
export { compactJs };
|
|
11
11
|
import { l as loadLedger8 } from './shared/load-C0TZnEd2.js';
|
|
12
|
-
export { LEDGER_VERSIONS, networkHeadVersion, protocolVersionToLedger, versionOfRecord } from './version.js';
|
|
12
|
+
export { CURRENT_LEDGER_VERSION, LEDGER_VERSIONS, RETAINED_LEDGER_VERSIONS, networkHeadVersion, protocolVersionToLedger, versionOfRecord } from './version.js';
|
|
13
13
|
import * as compactRuntime from '@midnight-ntwrk/compact-runtime';
|
|
14
14
|
export { compactRuntime };
|
|
15
15
|
import * as platformJs from '@midnight-ntwrk/platform-js';
|
package/dist/prove.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ import { ProvingProvider } from '@midnightntwrk/ledger-v9';
|
|
|
31
31
|
* version-tagged shape the rest of the flow expects.
|
|
32
32
|
*
|
|
33
33
|
* @see docs/adr/0006-version-tagged-payloads-at-provider-seams.md
|
|
34
|
-
* @see docs/adr/
|
|
34
|
+
* @see docs/adr/0010-publish-era-handles-alongside-their-plain-data.md
|
|
35
35
|
*/
|
|
36
36
|
declare const proveV8Transaction: (txBytes: Uint8Array, provingProvider: ProvingProvider) => Promise<Uint8Array>;
|
|
37
37
|
|
package/dist/prove.js
CHANGED
|
@@ -67,7 +67,7 @@ const assertSerializedTransaction = (txBytes) => {
|
|
|
67
67
|
* version-tagged shape the rest of the flow expects.
|
|
68
68
|
*
|
|
69
69
|
* @see docs/adr/0006-version-tagged-payloads-at-provider-seams.md
|
|
70
|
-
* @see docs/adr/
|
|
70
|
+
* @see docs/adr/0010-publish-era-handles-alongside-their-plain-data.md
|
|
71
71
|
*/
|
|
72
72
|
const proveV8Transaction = async (txBytes, provingProvider) => {
|
|
73
73
|
assertSerializedTransaction(txBytes);
|
package/dist/version.d.ts
CHANGED
|
@@ -10,6 +10,30 @@
|
|
|
10
10
|
*/
|
|
11
11
|
declare const LEDGER_VERSIONS: readonly ["v8", "v9"];
|
|
12
12
|
type LedgerVersion = (typeof LEDGER_VERSIONS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* The era whose objects this build hands out live, through `./ledger`.
|
|
15
|
+
*
|
|
16
|
+
* A protocol fact rather than a consumer's choice: it is decided by which
|
|
17
|
+
* ledger the package links eagerly, and every other era is reached lazily and
|
|
18
|
+
* crosses package boundaries as bytes. Declared here so that no package
|
|
19
|
+
* downstream restates "which era is now" as a literal of its own.
|
|
20
|
+
*
|
|
21
|
+
* The type is the single literal, not {@link LedgerVersion}, so a value typed
|
|
22
|
+
* by it DISCRIMINATES — the same discipline `CurrentPipelineEra` follows in
|
|
23
|
+
* `midnight-js-contracts`.
|
|
24
|
+
*/
|
|
25
|
+
declare const CURRENT_LEDGER_VERSION: "v9";
|
|
26
|
+
type CurrentLedgerVersion = typeof CURRENT_LEDGER_VERSION;
|
|
27
|
+
/**
|
|
28
|
+
* Every era this build still speaks but does not run live — the eras that
|
|
29
|
+
* cross a package boundary as serialized bytes.
|
|
30
|
+
*
|
|
31
|
+
* Defined as the complement of {@link CURRENT_LEDGER_VERSION}, so a further
|
|
32
|
+
* era joins this set by being added to {@link LEDGER_VERSIONS} and nothing
|
|
33
|
+
* else. The value list below is checked against that complement at build time.
|
|
34
|
+
*/
|
|
35
|
+
type RetainedLedgerVersion = Exclude<LedgerVersion, CurrentLedgerVersion>;
|
|
36
|
+
declare const RETAINED_LEDGER_VERSIONS: readonly ["v8"];
|
|
13
37
|
|
|
14
38
|
/**
|
|
15
39
|
* Which call path asked for a ledger version:
|
|
@@ -83,7 +107,7 @@ declare const versionOfRecord: (record: VersionedRecord) => LedgerVersion;
|
|
|
83
107
|
* will land in, and a stale reading is wrong exactly at the fork boundary,
|
|
84
108
|
* where that question matters. `PublicDataProvider.queryLatestProtocolVersion`
|
|
85
109
|
* states the same prohibition as a requirement on its implementations; this
|
|
86
|
-
* parameter is a structural type, so nothing here can enforce it. See ADR
|
|
110
|
+
* parameter is a structural type, so nothing here can enforce it. See ADR 0007.
|
|
87
111
|
*
|
|
88
112
|
* @param source The indexer or node client to ask for the head version.
|
|
89
113
|
* @returns A promise for the {@link LedgerVersion} at the network head.
|
|
@@ -93,5 +117,5 @@ declare const versionOfRecord: (record: VersionedRecord) => LedgerVersion;
|
|
|
93
117
|
*/
|
|
94
118
|
declare const networkHeadVersion: (source: ProtocolVersionSource) => Promise<LedgerVersion>;
|
|
95
119
|
|
|
96
|
-
export { LEDGER_VERSIONS, networkHeadVersion, protocolVersionToLedger, versionOfRecord };
|
|
97
|
-
export type { LedgerVersion, ProtocolVersionSource, VersionedRecord };
|
|
120
|
+
export { CURRENT_LEDGER_VERSION, LEDGER_VERSIONS, RETAINED_LEDGER_VERSIONS, networkHeadVersion, protocolVersionToLedger, versionOfRecord };
|
|
121
|
+
export type { CurrentLedgerVersion, LedgerVersion, ProtocolVersionSource, RetainedLedgerVersion, VersionedRecord };
|
package/dist/version.js
CHANGED
|
@@ -25,6 +25,20 @@ import { UnknownProtocolVersionError } from './errors.js';
|
|
|
25
25
|
* this leaf module and re-exported by `../version.ts`.
|
|
26
26
|
*/
|
|
27
27
|
const LEDGER_VERSIONS = Object.freeze(['v8', 'v9']);
|
|
28
|
+
/**
|
|
29
|
+
* The era whose objects this build hands out live, through `./ledger`.
|
|
30
|
+
*
|
|
31
|
+
* A protocol fact rather than a consumer's choice: it is decided by which
|
|
32
|
+
* ledger the package links eagerly, and every other era is reached lazily and
|
|
33
|
+
* crosses package boundaries as bytes. Declared here so that no package
|
|
34
|
+
* downstream restates "which era is now" as a literal of its own.
|
|
35
|
+
*
|
|
36
|
+
* The type is the single literal, not {@link LedgerVersion}, so a value typed
|
|
37
|
+
* by it DISCRIMINATES — the same discipline `CurrentPipelineEra` follows in
|
|
38
|
+
* `midnight-js-contracts`.
|
|
39
|
+
*/
|
|
40
|
+
const CURRENT_LEDGER_VERSION = 'v9';
|
|
41
|
+
const RETAINED_LEDGER_VERSIONS = Object.freeze(['v8']);
|
|
28
42
|
|
|
29
43
|
/*
|
|
30
44
|
* This file is part of midnight-js.
|
|
@@ -104,7 +118,7 @@ const versionOfRecord = (record) => protocolVersionToLedger(record.protocolVersi
|
|
|
104
118
|
* will land in, and a stale reading is wrong exactly at the fork boundary,
|
|
105
119
|
* where that question matters. `PublicDataProvider.queryLatestProtocolVersion`
|
|
106
120
|
* states the same prohibition as a requirement on its implementations; this
|
|
107
|
-
* parameter is a structural type, so nothing here can enforce it. See ADR
|
|
121
|
+
* parameter is a structural type, so nothing here can enforce it. See ADR 0007.
|
|
108
122
|
*
|
|
109
123
|
* @param source The indexer or node client to ask for the head version.
|
|
110
124
|
* @returns A promise for the {@link LedgerVersion} at the network head.
|
|
@@ -114,5 +128,5 @@ const versionOfRecord = (record) => protocolVersionToLedger(record.protocolVersi
|
|
|
114
128
|
*/
|
|
115
129
|
const networkHeadVersion = async (source) => protocolVersionToLedger(await source.queryLatestProtocolVersion(), 'construct');
|
|
116
130
|
|
|
117
|
-
export { LEDGER_VERSIONS, networkHeadVersion, protocolVersionToLedger, versionOfRecord };
|
|
131
|
+
export { CURRENT_LEDGER_VERSION, LEDGER_VERSIONS, RETAINED_LEDGER_VERSIONS, networkHeadVersion, protocolVersionToLedger, versionOfRecord };
|
|
118
132
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../src/lib/shared/ledger-version.ts","../src/version.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;AAaG;AAEH;;;;;;;;;AASG;AACI,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,CAAU;;
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../src/lib/shared/ledger-version.ts","../src/version.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;AAaG;AAEH;;;;;;;;;AASG;AACI,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,CAAU;AAGlE;;;;;;;;;;;AAW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
|
+
"version": "5.0.0-beta.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Protocol type re-exports for midnight-js framework",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -104,6 +104,5 @@
|
|
|
104
104
|
},
|
|
105
105
|
"engines": {
|
|
106
106
|
"node": ">=22.12"
|
|
107
|
-
}
|
|
108
|
-
"stableVersion": "5.0.0-beta.7"
|
|
107
|
+
}
|
|
109
108
|
}
|