@midnightntwrk/midnight-js-protocol 0.0.0-stage → 5.0.1
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/README.md +291 -2
- package/dist/compact-js-v8-effect.d.ts +1 -0
- package/dist/compact-js-v8-effect.js +2 -0
- package/dist/compact-js-v8-effect.js.map +1 -0
- package/dist/engine.d.ts +420 -0
- package/dist/engine.js +832 -0
- package/dist/engine.js.map +1 -0
- package/dist/errors.d.ts +601 -0
- package/dist/errors.js +810 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +1471 -0
- package/dist/index.js +799 -0
- package/dist/index.js.map +1 -0
- package/dist/platform-effect-configuration.d.ts +1 -0
- package/dist/platform-effect-configuration.js +2 -0
- package/dist/platform-effect-configuration.js.map +1 -0
- package/dist/platform-effect-contract-address.d.ts +1 -0
- package/dist/platform-effect-contract-address.js +2 -0
- package/dist/platform-effect-contract-address.js.map +1 -0
- package/dist/platform.d.ts +1 -0
- package/dist/platform.js +2 -0
- package/dist/platform.js.map +1 -0
- package/dist/prove.d.ts +45 -0
- package/dist/prove.js +61 -0
- package/dist/prove.js.map +1 -0
- package/dist/shared/compose-options-BFA09u9q.js +468 -0
- package/dist/shared/compose-options-BFA09u9q.js.map +1 -0
- package/dist/shared/ledger-transaction-DQP8J8tv.js +134 -0
- package/dist/shared/ledger-transaction-DQP8J8tv.js.map +1 -0
- package/dist/shared/load-BMVWoBo6.js +49 -0
- package/dist/shared/load-BMVWoBo6.js.map +1 -0
- package/dist/shared/transaction-tags-I3J_Hh8r.js +82 -0
- package/dist/shared/transaction-tags-I3J_Hh8r.js.map +1 -0
- package/dist/transaction.d.ts +92 -0
- package/dist/transaction.js +6 -0
- package/dist/transaction.js.map +1 -0
- package/dist/v8.d.ts +1 -0
- package/dist/v8.js +3 -0
- package/dist/v8.js.map +1 -0
- package/dist/v9-compact-js-effect-contract.d.ts +1 -0
- package/dist/v9-compact-js-effect-contract.js +2 -0
- package/dist/v9-compact-js-effect-contract.js.map +1 -0
- package/dist/v9-compact-js-effect.d.ts +1 -0
- package/dist/v9-compact-js-effect.js +2 -0
- package/dist/v9-compact-js-effect.js.map +1 -0
- package/dist/v9-compact-js.d.ts +1 -0
- package/dist/v9-compact-js.js +2 -0
- package/dist/v9-compact-js.js.map +1 -0
- package/dist/v9-compact-runtime.d.ts +1 -0
- package/dist/v9-compact-runtime.js +2 -0
- package/dist/v9-compact-runtime.js.map +1 -0
- package/dist/v9-onchain-runtime.d.ts +1 -0
- package/dist/v9-onchain-runtime.js +2 -0
- package/dist/v9-onchain-runtime.js.map +1 -0
- package/dist/v9.d.ts +1 -0
- package/dist/v9.js +2 -0
- package/dist/v9.js.map +1 -0
- package/dist/version.d.ts +173 -0
- package/dist/version.js +125 -0
- package/dist/version.js.map +1 -0
- package/package.json +122 -3
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two ledger runtimes midnight-js can talk to. `v8` backs the node 1.x
|
|
3
|
+
* line; `v9` backs the 2.x line. This is a closed, exhaustive set — see
|
|
4
|
+
* `protocolVersionToLedger` (`../version.ts`) for how a raw `protocolVersion`
|
|
5
|
+
* integer maps onto it.
|
|
6
|
+
*
|
|
7
|
+
* compact-js names the same era by number: its `Ledger.Era['ledger']` (for
|
|
8
|
+
* example `executable.era.ledger`) is `8` for `'v8'` and `9` for `'v9'`.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link SharedTableDiscipline} for why the array is frozen.
|
|
11
|
+
* @see {@link ModuleGraphAndLazyLoading} for why the constant is declared in
|
|
12
|
+
* this leaf module and re-exported by `../version.ts`.
|
|
13
|
+
*/
|
|
14
|
+
declare const LEDGER_ERAS: readonly ["v8", "v9"];
|
|
15
|
+
type LedgerEra = (typeof LEDGER_ERAS)[number];
|
|
16
|
+
/**
|
|
17
|
+
* The era whose objects this build links eagerly, today through `./v9`.
|
|
18
|
+
*
|
|
19
|
+
* "Current" is relative: today it is ledger 9 (`'v9'`). At the next hard fork it
|
|
20
|
+
* moves to the new ledger and ledger 9 joins {@link RetainedLedgerEra}. Code
|
|
21
|
+
* bound to one ledger is named after that ledger (`Ledger9*`) instead.
|
|
22
|
+
*
|
|
23
|
+
* A protocol fact rather than a consumer's choice: it is decided by which
|
|
24
|
+
* ledger the package links eagerly, and every other era is reached lazily and
|
|
25
|
+
* crosses package boundaries as bytes. Declared here so that no package
|
|
26
|
+
* downstream restates "which era is now" as a literal of its own.
|
|
27
|
+
*
|
|
28
|
+
* The type is the single literal, not {@link LedgerEra}, so a value typed
|
|
29
|
+
* by it DISCRIMINATES: `midnight-js-contracts` types a current-era result's
|
|
30
|
+
* `era` with it, so a union of both eras' results narrows on `era`.
|
|
31
|
+
*/
|
|
32
|
+
declare const CURRENT_LEDGER_ERA: "v9";
|
|
33
|
+
type CurrentLedgerEra = typeof CURRENT_LEDGER_ERA;
|
|
34
|
+
/**
|
|
35
|
+
* Every era this build still speaks but does not run live: its runtime is
|
|
36
|
+
* loaded only on demand, through `loadLedger8Protocol`.
|
|
37
|
+
*
|
|
38
|
+
* "Retained" is relative: today the set is ledger 8 (`'v8'`). At the next hard
|
|
39
|
+
* fork the then-current ledger joins it. Code bound to one ledger is named
|
|
40
|
+
* after that ledger (`Ledger8*`) instead.
|
|
41
|
+
*
|
|
42
|
+
* Defined as the complement of {@link CURRENT_LEDGER_ERA}, so a further
|
|
43
|
+
* era joins this set by being added to {@link LEDGER_ERAS} and nothing
|
|
44
|
+
* else. The value list below is checked against that complement at build time.
|
|
45
|
+
*/
|
|
46
|
+
type RetainedLedgerEra = Exclude<LedgerEra, CurrentLedgerEra>;
|
|
47
|
+
declare const RETAINED_LEDGER_ERAS: readonly ["v8"];
|
|
48
|
+
|
|
49
|
+
/** Every transaction stage, in the order a transaction goes through them. */
|
|
50
|
+
declare const TRANSACTION_STAGES: readonly ["Unproven", "Unbound", "Finalized"];
|
|
51
|
+
/** The point in its life a transaction has reached: before proving, after proving, after binding. */
|
|
52
|
+
type TransactionStage = (typeof TRANSACTION_STAGES)[number];
|
|
53
|
+
/**
|
|
54
|
+
* The full header each ledger era writes in front of a transaction at each stage: the schema
|
|
55
|
+
* version, then the signature, proof and binding markers.
|
|
56
|
+
*/
|
|
57
|
+
declare const LEDGER_TRANSACTION_TAGS: Readonly<{
|
|
58
|
+
readonly v8: Readonly<{
|
|
59
|
+
Unproven: "midnight:transaction[v9](signature[v1],proof-preimage,embedded-fr[v1])";
|
|
60
|
+
Unbound: "midnight:transaction[v9](signature[v1],proof,embedded-fr[v1])";
|
|
61
|
+
Finalized: "midnight:transaction[v9](signature[v1],proof,pedersen-schnorr[v1])";
|
|
62
|
+
}>;
|
|
63
|
+
readonly v9: Readonly<{
|
|
64
|
+
Unproven: "midnight:transaction[v12](signature[v2],proof-preimage,embedded-fr[v1])";
|
|
65
|
+
Unbound: "midnight:transaction[v12](signature[v2],proof,embedded-fr[v1])";
|
|
66
|
+
Finalized: "midnight:transaction[v12](signature[v2],proof,pedersen-schnorr[v1])";
|
|
67
|
+
}>;
|
|
68
|
+
}>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Which call path asked for a ledger era:
|
|
72
|
+
* - `'read'` — the version was taken off an existing record.
|
|
73
|
+
* - `'construct'` — the version was chosen to build something new against the
|
|
74
|
+
* network's latest block.
|
|
75
|
+
*/
|
|
76
|
+
type VersionResolutionPath = 'read' | 'construct';
|
|
77
|
+
|
|
78
|
+
declare const LEDGER_STATE_KINDS: readonly ["ContractState", "LedgerParameters", "ZswapChainState"];
|
|
79
|
+
/**
|
|
80
|
+
* A kind of value the ledger writes and the indexer serves as bytes.
|
|
81
|
+
*/
|
|
82
|
+
type StateKind = (typeof LEDGER_STATE_KINDS)[number];
|
|
83
|
+
declare const LEDGER_STATE_TAGS: Readonly<{
|
|
84
|
+
readonly ContractState: Readonly<{
|
|
85
|
+
v8: "midnight:contract-state[v6]";
|
|
86
|
+
v9: "midnight:contract-state[v8]";
|
|
87
|
+
}>;
|
|
88
|
+
readonly LedgerParameters: Readonly<{
|
|
89
|
+
v8: "midnight:ledger-parameters[v5]";
|
|
90
|
+
v9: "midnight:ledger-parameters[v8]";
|
|
91
|
+
}>;
|
|
92
|
+
readonly ZswapChainState: Readonly<{
|
|
93
|
+
v8: "midnight:zswap-ledger-state[v5]";
|
|
94
|
+
v9: "midnight:zswap-ledger-state[v5]";
|
|
95
|
+
}>;
|
|
96
|
+
}>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Anything that can report the network's latest protocol version —
|
|
100
|
+
* typically an indexer or node client. Consumed by {@link latestNetworkLedgerVersion}.
|
|
101
|
+
*/
|
|
102
|
+
interface ProtocolVersionSource {
|
|
103
|
+
/**
|
|
104
|
+
* @returns The network's latest `protocolVersion` integer.
|
|
105
|
+
*/
|
|
106
|
+
queryLatestProtocolVersion(): Promise<number>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Any record carrying a raw `protocolVersion` integer field, e.g. a
|
|
110
|
+
* transaction or block already read from the indexer. Consumed by
|
|
111
|
+
* {@link versionOfRecord}.
|
|
112
|
+
*/
|
|
113
|
+
interface VersionedRecord {
|
|
114
|
+
readonly protocolVersion: number;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Maps a raw `protocolVersion` integer (as returned by the indexer or node)
|
|
118
|
+
* onto the ledger runtime it corresponds to.
|
|
119
|
+
*
|
|
120
|
+
* | protocolVersion range | node version | ledger |
|
|
121
|
+
* | --------------------- | ------------ | ------ |
|
|
122
|
+
* | 1_000_000 – 1_999_999 | 1.x | v8 |
|
|
123
|
+
* | 2_000_000 – 2_999_999 | 2.x | v9 |
|
|
124
|
+
*
|
|
125
|
+
* Most call sites should not call this directly. Prefer
|
|
126
|
+
* {@link versionOfRecord} for a `protocolVersion` read off an existing
|
|
127
|
+
* indexer/node record, or {@link latestNetworkLedgerVersion} for the network's
|
|
128
|
+
* latest ledger era — both tag the resulting error with the correct
|
|
129
|
+
* `path` automatically. Pass `path` explicitly here only when neither helper
|
|
130
|
+
* fits the call site.
|
|
131
|
+
*
|
|
132
|
+
* @param protocolVersion The raw integer read from an indexer or node record.
|
|
133
|
+
* @param path Which resolution path a failure is attributed to. Defaults to
|
|
134
|
+
* `'construct'`, and decides which of the two error codes a failure carries.
|
|
135
|
+
* @returns The {@link LedgerEra} that `protocolVersion`'s node major maps
|
|
136
|
+
* onto.
|
|
137
|
+
* @throws {@link UnknownProtocolVersionError} with `reason: 'malformed'` when
|
|
138
|
+
* `protocolVersion` is not a non-negative integer, and with `reason: 'unknown'`
|
|
139
|
+
* when it is a well-formed integer outside every range above.
|
|
140
|
+
* @see {@link SharedTableDiscipline}
|
|
141
|
+
*/
|
|
142
|
+
declare const protocolVersionToLedger: (protocolVersion: number, path?: VersionResolutionPath) => LedgerEra;
|
|
143
|
+
/**
|
|
144
|
+
* Resolves the ledger era for a record's `protocolVersion` field (e.g. a
|
|
145
|
+
* transaction or block already read from the indexer).
|
|
146
|
+
*
|
|
147
|
+
* @param record Any object carrying a raw `protocolVersion` integer field.
|
|
148
|
+
* @returns The {@link LedgerEra} that record was written under.
|
|
149
|
+
* @throws {@link UnknownProtocolVersionError} tagged with the `read` path, on
|
|
150
|
+
* the same two conditions as {@link protocolVersionToLedger}.
|
|
151
|
+
*/
|
|
152
|
+
declare const versionOfRecord: (record: VersionedRecord) => LedgerEra;
|
|
153
|
+
/**
|
|
154
|
+
* Queries `source` for the network's latest protocol version and
|
|
155
|
+
* resolves it to a {@link LedgerEra}.
|
|
156
|
+
*
|
|
157
|
+
* The source is expected to read the network on every call. This is the
|
|
158
|
+
* construct path: the era being resolved is the one a transaction built now
|
|
159
|
+
* will land in, and a stale reading is wrong exactly at the fork boundary,
|
|
160
|
+
* where that question matters. `PublicDataProvider.queryLatestProtocolVersion`
|
|
161
|
+
* states the same prohibition as a requirement on its implementations; this
|
|
162
|
+
* parameter is a structural type, so nothing here can enforce it. See ADR 0007.
|
|
163
|
+
*
|
|
164
|
+
* @param source The indexer or node client to ask for the latest version.
|
|
165
|
+
* @returns A promise for the {@link LedgerEra} of the network's latest block.
|
|
166
|
+
* @throws {@link UnknownProtocolVersionError} tagged with the `construct`
|
|
167
|
+
* path, on the same two conditions as {@link protocolVersionToLedger}. A
|
|
168
|
+
* rejection from `source.queryLatestProtocolVersion()` propagates unchanged.
|
|
169
|
+
*/
|
|
170
|
+
declare const latestNetworkLedgerVersion: (source: ProtocolVersionSource) => Promise<LedgerEra>;
|
|
171
|
+
|
|
172
|
+
export { CURRENT_LEDGER_ERA, LEDGER_ERAS, LEDGER_STATE_KINDS, LEDGER_STATE_TAGS, LEDGER_TRANSACTION_TAGS, RETAINED_LEDGER_ERAS, TRANSACTION_STAGES, latestNetworkLedgerVersion, protocolVersionToLedger, versionOfRecord };
|
|
173
|
+
export type { CurrentLedgerEra, LedgerEra, ProtocolVersionSource, RetainedLedgerEra, StateKind, TransactionStage, VersionedRecord };
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { UnknownProtocolVersionError } from './errors.js';
|
|
2
|
+
export { C as CURRENT_LEDGER_ERA, L as LEDGER_ERAS, a as LEDGER_TRANSACTION_TAGS, R as RETAINED_LEDGER_ERAS, T as TRANSACTION_STAGES } from './shared/transaction-tags-I3J_Hh8r.js';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* This file is part of midnight-js.
|
|
6
|
+
* Copyright (C) Midnight Foundation
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* You may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
const LEDGER_STATE_KINDS = Object.freeze(['ContractState', 'LedgerParameters', 'ZswapChainState']);
|
|
19
|
+
// The bracketed number is the format version of one kind, not the ledger era. Pinned by
|
|
20
|
+
// test/state-tags.test.ts; see docs/architecture/era-tagged-payload-decoders.md.
|
|
21
|
+
const LEDGER_STATE_TAGS = Object.freeze({
|
|
22
|
+
ContractState: Object.freeze({
|
|
23
|
+
v8: 'midnight:contract-state[v6]',
|
|
24
|
+
v9: 'midnight:contract-state[v8]'
|
|
25
|
+
}),
|
|
26
|
+
LedgerParameters: Object.freeze({
|
|
27
|
+
v8: 'midnight:ledger-parameters[v5]',
|
|
28
|
+
v9: 'midnight:ledger-parameters[v8]'
|
|
29
|
+
}),
|
|
30
|
+
ZswapChainState: Object.freeze({
|
|
31
|
+
v8: 'midnight:zswap-ledger-state[v5]',
|
|
32
|
+
v9: 'midnight:zswap-ledger-state[v5]'
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* This file is part of midnight-js.
|
|
38
|
+
* Copyright (C) Midnight Foundation
|
|
39
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
40
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
41
|
+
* You may not use this file except in compliance with the License.
|
|
42
|
+
* You may obtain a copy of the License at
|
|
43
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
44
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
45
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
46
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
47
|
+
* See the License for the specific language governing permissions and
|
|
48
|
+
* limitations under the License.
|
|
49
|
+
*/
|
|
50
|
+
// Deliberately narrower than the indexer's table: do not "restore" the 0.x
|
|
51
|
+
// major to match it without a caller needing it — see SharedTableDiscipline.
|
|
52
|
+
const NODE_MAJOR_TO_LEDGER = {
|
|
53
|
+
1: 'v8',
|
|
54
|
+
2: 'v9'
|
|
55
|
+
};
|
|
56
|
+
// A typed function rather than a direct index, because a `number`-typed key
|
|
57
|
+
// cannot index the `as const` table — see SharedTableDiscipline.
|
|
58
|
+
const lookupLedger = (table, key) => table[key];
|
|
59
|
+
/**
|
|
60
|
+
* Maps a raw `protocolVersion` integer (as returned by the indexer or node)
|
|
61
|
+
* onto the ledger runtime it corresponds to.
|
|
62
|
+
*
|
|
63
|
+
* | protocolVersion range | node version | ledger |
|
|
64
|
+
* | --------------------- | ------------ | ------ |
|
|
65
|
+
* | 1_000_000 – 1_999_999 | 1.x | v8 |
|
|
66
|
+
* | 2_000_000 – 2_999_999 | 2.x | v9 |
|
|
67
|
+
*
|
|
68
|
+
* Most call sites should not call this directly. Prefer
|
|
69
|
+
* {@link versionOfRecord} for a `protocolVersion` read off an existing
|
|
70
|
+
* indexer/node record, or {@link latestNetworkLedgerVersion} for the network's
|
|
71
|
+
* latest ledger era — both tag the resulting error with the correct
|
|
72
|
+
* `path` automatically. Pass `path` explicitly here only when neither helper
|
|
73
|
+
* fits the call site.
|
|
74
|
+
*
|
|
75
|
+
* @param protocolVersion The raw integer read from an indexer or node record.
|
|
76
|
+
* @param path Which resolution path a failure is attributed to. Defaults to
|
|
77
|
+
* `'construct'`, and decides which of the two error codes a failure carries.
|
|
78
|
+
* @returns The {@link LedgerEra} that `protocolVersion`'s node major maps
|
|
79
|
+
* onto.
|
|
80
|
+
* @throws {@link UnknownProtocolVersionError} with `reason: 'malformed'` when
|
|
81
|
+
* `protocolVersion` is not a non-negative integer, and with `reason: 'unknown'`
|
|
82
|
+
* when it is a well-formed integer outside every range above.
|
|
83
|
+
* @see {@link SharedTableDiscipline}
|
|
84
|
+
*/
|
|
85
|
+
const protocolVersionToLedger = (protocolVersion, path = 'construct') => {
|
|
86
|
+
if (!Number.isInteger(protocolVersion) || protocolVersion < 0) {
|
|
87
|
+
throw new UnknownProtocolVersionError(protocolVersion, path, 'malformed');
|
|
88
|
+
}
|
|
89
|
+
const ledger = lookupLedger(NODE_MAJOR_TO_LEDGER, Math.floor(protocolVersion / 1_000_000));
|
|
90
|
+
if (ledger === undefined) {
|
|
91
|
+
throw new UnknownProtocolVersionError(protocolVersion, path, 'unknown');
|
|
92
|
+
}
|
|
93
|
+
return ledger;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Resolves the ledger era for a record's `protocolVersion` field (e.g. a
|
|
97
|
+
* transaction or block already read from the indexer).
|
|
98
|
+
*
|
|
99
|
+
* @param record Any object carrying a raw `protocolVersion` integer field.
|
|
100
|
+
* @returns The {@link LedgerEra} that record was written under.
|
|
101
|
+
* @throws {@link UnknownProtocolVersionError} tagged with the `read` path, on
|
|
102
|
+
* the same two conditions as {@link protocolVersionToLedger}.
|
|
103
|
+
*/
|
|
104
|
+
const versionOfRecord = (record) => protocolVersionToLedger(record.protocolVersion, 'read');
|
|
105
|
+
/**
|
|
106
|
+
* Queries `source` for the network's latest protocol version and
|
|
107
|
+
* resolves it to a {@link LedgerEra}.
|
|
108
|
+
*
|
|
109
|
+
* The source is expected to read the network on every call. This is the
|
|
110
|
+
* construct path: the era being resolved is the one a transaction built now
|
|
111
|
+
* will land in, and a stale reading is wrong exactly at the fork boundary,
|
|
112
|
+
* where that question matters. `PublicDataProvider.queryLatestProtocolVersion`
|
|
113
|
+
* states the same prohibition as a requirement on its implementations; this
|
|
114
|
+
* parameter is a structural type, so nothing here can enforce it. See ADR 0007.
|
|
115
|
+
*
|
|
116
|
+
* @param source The indexer or node client to ask for the latest version.
|
|
117
|
+
* @returns A promise for the {@link LedgerEra} of the network's latest block.
|
|
118
|
+
* @throws {@link UnknownProtocolVersionError} tagged with the `construct`
|
|
119
|
+
* path, on the same two conditions as {@link protocolVersionToLedger}. A
|
|
120
|
+
* rejection from `source.queryLatestProtocolVersion()` propagates unchanged.
|
|
121
|
+
*/
|
|
122
|
+
const latestNetworkLedgerVersion = async (source) => protocolVersionToLedger(await source.queryLatestProtocolVersion(), 'construct');
|
|
123
|
+
|
|
124
|
+
export { LEDGER_STATE_KINDS, LEDGER_STATE_TAGS, latestNetworkLedgerVersion, protocolVersionToLedger, versionOfRecord };
|
|
125
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../src/lib/shared/state-tags.ts","../src/version.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;AAaG;AAII,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,CAAU;AAOjH;AACA;AACO,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;AAC7C,IAAA,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC;AAC3B,QAAA,EAAE,EAAE,6BAA6B;AACjC,QAAA,EAAE,EAAE;KACL,CAAC;AACF,IAAA,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC;AAC9B,QAAA,EAAE,EAAE,gCAAgC;AACpC,QAAA,EAAE,EAAE;KACL,CAAC;AACF,IAAA,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC;AAC7B,QAAA,EAAE,EAAE,iCAAiC;AACrC,QAAA,EAAE,EAAE;KACL;AAC8D,CAAA;;ACvCjE;;;;;;;;;;;;;AAaG;AAmDH;AACA;AACA,MAAM,oBAAoB,GAAG;AAC3B,IAAA,CAAC,EAAE,IAAI;AACP,IAAA,CAAC,EAAE;CACkD;AAQvD;AACA;AACA,MAAM,YAAY,GAAG,CAAC,KAAyC,EAAE,GAAW,KAC1E,KAAK,CAAC,GAAG,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACI,MAAM,uBAAuB,GAAG,CACrC,eAAuB,EACvB,IAAA,GAA8B,WAAW,KAC5B;AACb,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,eAAe,GAAG,CAAC,EAAE;QAC7D,MAAM,IAAI,2BAA2B,CAAC,eAAe,EAAE,IAAI,EAAE,WAAW,CAAC;IAC3E;AACA,IAAA,MAAM,MAAM,GAAG,YAAY,CAAC,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;AAC1F,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,MAAM,IAAI,2BAA2B,CAAC,eAAe,EAAE,IAAI,EAAE,SAAS,CAAC;IACzE;AACA,IAAA,OAAO,MAAM;AACf;AAEA;;;;;;;;AAQG;AACI,MAAM,eAAe,GAAG,CAAC,MAAuB,KACrD,uBAAuB,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM;AAExD;;;;;;;;;;;;;;;;AAgBG;MACU,0BAA0B,GAAG,OAAO,MAA6B,KAC5E,uBAAuB,CAAC,MAAM,MAAM,CAAC,0BAA0B,EAAE,EAAE,WAAW;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,125 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midnightntwrk/midnight-js-protocol",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Protocol type re-exports for midnight-js framework",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./errors": {
|
|
13
|
+
"types": "./dist/errors.d.ts",
|
|
14
|
+
"default": "./dist/errors.js"
|
|
15
|
+
},
|
|
16
|
+
"./version": {
|
|
17
|
+
"types": "./dist/version.d.ts",
|
|
18
|
+
"default": "./dist/version.js"
|
|
19
|
+
},
|
|
20
|
+
"./prove": {
|
|
21
|
+
"types": "./dist/prove.d.ts",
|
|
22
|
+
"default": "./dist/prove.js"
|
|
23
|
+
},
|
|
24
|
+
"./transaction": {
|
|
25
|
+
"types": "./dist/transaction.d.ts",
|
|
26
|
+
"default": "./dist/transaction.js"
|
|
27
|
+
},
|
|
28
|
+
"./v8": {
|
|
29
|
+
"types": "./dist/v8.d.ts",
|
|
30
|
+
"default": "./dist/v8.js"
|
|
31
|
+
},
|
|
32
|
+
"./v9": {
|
|
33
|
+
"types": "./dist/v9.d.ts",
|
|
34
|
+
"default": "./dist/v9.js"
|
|
35
|
+
},
|
|
36
|
+
"./v9/compact-runtime": {
|
|
37
|
+
"types": "./dist/v9-compact-runtime.d.ts",
|
|
38
|
+
"default": "./dist/v9-compact-runtime.js"
|
|
39
|
+
},
|
|
40
|
+
"./v9/compact-js": {
|
|
41
|
+
"types": "./dist/v9-compact-js.d.ts",
|
|
42
|
+
"default": "./dist/v9-compact-js.js"
|
|
43
|
+
},
|
|
44
|
+
"./v9/compact-js/effect": {
|
|
45
|
+
"types": "./dist/v9-compact-js-effect.d.ts",
|
|
46
|
+
"default": "./dist/v9-compact-js-effect.js"
|
|
47
|
+
},
|
|
48
|
+
"./v9/compact-js/effect/Contract": {
|
|
49
|
+
"types": "./dist/v9-compact-js-effect-contract.d.ts",
|
|
50
|
+
"default": "./dist/v9-compact-js-effect-contract.js"
|
|
51
|
+
},
|
|
52
|
+
"./v9/onchain-runtime": {
|
|
53
|
+
"types": "./dist/v9-onchain-runtime.d.ts",
|
|
54
|
+
"default": "./dist/v9-onchain-runtime.js"
|
|
55
|
+
},
|
|
56
|
+
"./v8/engine": {
|
|
57
|
+
"types": "./dist/engine.d.ts",
|
|
58
|
+
"default": "./dist/engine.js"
|
|
59
|
+
},
|
|
60
|
+
"./compact-js/v8/effect": {
|
|
61
|
+
"types": "./dist/compact-js-v8-effect.d.ts",
|
|
62
|
+
"default": "./dist/compact-js-v8-effect.js"
|
|
63
|
+
},
|
|
64
|
+
"./platform-js": {
|
|
65
|
+
"types": "./dist/platform.d.ts",
|
|
66
|
+
"default": "./dist/platform.js"
|
|
67
|
+
},
|
|
68
|
+
"./platform-js/effect/Configuration": {
|
|
69
|
+
"types": "./dist/platform-effect-configuration.d.ts",
|
|
70
|
+
"default": "./dist/platform-effect-configuration.js"
|
|
71
|
+
},
|
|
72
|
+
"./platform-js/effect/ContractAddress": {
|
|
73
|
+
"types": "./dist/platform-effect-contract-address.d.ts",
|
|
74
|
+
"default": "./dist/platform-effect-contract-address.js"
|
|
75
|
+
},
|
|
76
|
+
"./package.json": "./package.json"
|
|
77
|
+
},
|
|
78
|
+
"sideEffects": false,
|
|
79
|
+
"repository": {
|
|
80
|
+
"type": "git",
|
|
81
|
+
"url": "git+https://github.com/midnightntwrk/midnight-js.git",
|
|
82
|
+
"directory": "packages/protocol"
|
|
83
|
+
},
|
|
84
|
+
"homepage": "https://github.com/midnightntwrk/midnight-js/tree/main/packages/protocol#readme",
|
|
85
|
+
"bugs": {
|
|
86
|
+
"url": "https://github.com/midnightntwrk/midnight-js/issues"
|
|
87
|
+
},
|
|
88
|
+
"author": "Midnight Foundation",
|
|
89
|
+
"packageManager": "yarn@4.14.1",
|
|
90
|
+
"license": "Apache-2.0",
|
|
91
|
+
"scripts": {
|
|
92
|
+
"clean": "rm -rf dist tsconfig.build.tsbuildinfo .rollup.cache reports coverage",
|
|
93
|
+
"build": "rollup -c rollup.config.mjs",
|
|
94
|
+
"lint": "eslint src/",
|
|
95
|
+
"test": "vitest run"
|
|
96
|
+
},
|
|
97
|
+
"files": [
|
|
98
|
+
"dist/"
|
|
99
|
+
],
|
|
100
|
+
"dependencies": {
|
|
101
|
+
"@midnight-ntwrk/compact-js": "3.0.2",
|
|
102
|
+
"@midnight-ntwrk/compact-runtime": "0.21.0",
|
|
103
|
+
"@midnight-ntwrk/onchain-runtime-v3": "^3.0.0",
|
|
104
|
+
"@midnight-ntwrk/platform-js": "3.0.0",
|
|
105
|
+
"@midnightntwrk/ledger-v8": "8.1.3",
|
|
106
|
+
"@midnightntwrk/ledger-v9": "1.0.2",
|
|
107
|
+
"@midnightntwrk/onchain-runtime-v4": "4.0.2",
|
|
108
|
+
"compact-runtime-ledger8": "npm:@midnight-ntwrk/compact-runtime@0.16.0",
|
|
109
|
+
"effect": "^3.22.1"
|
|
110
|
+
},
|
|
111
|
+
"devDependencies": {
|
|
112
|
+
"@midnight-ntwrk/ledger-v8": "npm:@midnightntwrk/ledger-v8@8.1.3",
|
|
113
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
114
|
+
"@vitest/coverage-v8": "^5.0.4",
|
|
115
|
+
"eslint": "^10.12.0",
|
|
116
|
+
"rollup": "^4.60.4",
|
|
117
|
+
"rollup-plugin-dts": "^6.5.1",
|
|
118
|
+
"typescript": "^6.0.3",
|
|
119
|
+
"vite": "^8.3.4",
|
|
120
|
+
"vitest": "^5.0.4"
|
|
121
|
+
},
|
|
122
|
+
"engines": {
|
|
123
|
+
"node": ">=22.12"
|
|
124
|
+
}
|
|
6
125
|
}
|