@perpscope/percolator-adapter 0.4.0 → 0.5.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/README.md +4 -0
- package/index.js +3 -0
- package/package.json +1 -1
- package/src/lib/percolator-adapter.js +34 -0
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -2,8 +2,11 @@ export {
|
|
|
2
2
|
assertReadOnlySnapshot,
|
|
3
3
|
buildPercolatorCompatibilityReport,
|
|
4
4
|
detectPercolatorInputShape,
|
|
5
|
+
exportCompatibilityReport,
|
|
6
|
+
exportCompatibilityReportFromReport,
|
|
5
7
|
normalizePercolatorCliBundle,
|
|
6
8
|
normalizePercolatorSnapshot,
|
|
9
|
+
PERPSCOPE_ADAPTER_VERSION,
|
|
7
10
|
parsePercolatorJson,
|
|
8
11
|
simulatePriceShock,
|
|
9
12
|
toTerminalMarketDto
|
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { normalizeFundingSkewHistory } from "./funding-history.js";
|
|
2
2
|
|
|
3
|
+
export const PERPSCOPE_ADAPTER_VERSION = "0.5.0";
|
|
4
|
+
|
|
3
5
|
const KEYPAIR_FIELD_PATTERN = /(^|_)(secret|private|keypair|mnemonic|seed|walletPath|wallet)(_|$)/i;
|
|
4
6
|
const HISTORY_COMMAND_KEYS = new Set([
|
|
5
7
|
"fundinghistory",
|
|
@@ -137,6 +139,38 @@ export function buildPercolatorCompatibilityReport(input, normalizedSnapshot) {
|
|
|
137
139
|
};
|
|
138
140
|
}
|
|
139
141
|
|
|
142
|
+
export function exportCompatibilityReport(input, normalizedSnapshot, options = {}) {
|
|
143
|
+
const snapshot = normalizedSnapshot || normalizePercolatorSnapshot(input);
|
|
144
|
+
const report = buildPercolatorCompatibilityReport(input, snapshot);
|
|
145
|
+
return exportCompatibilityReportFromReport(report, options);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function exportCompatibilityReportFromReport(report, options = {}) {
|
|
149
|
+
return {
|
|
150
|
+
schema: "perpscope.compatibility-report",
|
|
151
|
+
version: 1,
|
|
152
|
+
package: {
|
|
153
|
+
name: "@perpscope/percolator-adapter",
|
|
154
|
+
version: options.packageVersion || PERPSCOPE_ADAPTER_VERSION
|
|
155
|
+
},
|
|
156
|
+
generatedAt: options.generatedAt || new Date().toISOString(),
|
|
157
|
+
safety: {
|
|
158
|
+
mode: "read-only",
|
|
159
|
+
rejected: report.status === "rejected"
|
|
160
|
+
},
|
|
161
|
+
shape: report.shape,
|
|
162
|
+
status: report.status,
|
|
163
|
+
compatible: report.compatible,
|
|
164
|
+
tone: report.tone,
|
|
165
|
+
score: report.score,
|
|
166
|
+
recognizedSections: report.recognizedSections,
|
|
167
|
+
missingFields: report.missingFields,
|
|
168
|
+
ignoredFields: report.ignoredFields,
|
|
169
|
+
source: report.source,
|
|
170
|
+
summary: report.summary
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
140
174
|
const COMPATIBILITY_SECTION_SPECS = [
|
|
141
175
|
{
|
|
142
176
|
id: "safety",
|