@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 CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Read-only adapter helpers for Solana perps terminals that want PerpScope DTOs without adopting the cockpit UI.
4
4
 
5
+ ```bash
6
+ npm install @perpscope/percolator-adapter
7
+ ```
8
+
5
9
  ```js
6
10
  import {
7
11
  buildPercolatorCompatibilityReport,
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@perpscope/percolator-adapter",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Read-only Percolator adapter helpers for Solana perps terminals.",
6
6
  "main": "./index.js",
@@ -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",