opentool 0.8.28 → 0.8.29
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/adapters/hyperliquid/index.js +8 -1
- package/dist/adapters/hyperliquid/index.js.map +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/dist/store/index.d.ts +12 -1
- package/dist/store/index.js +14 -2
- package/dist/store/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/base/package.json +1 -1
|
@@ -109,8 +109,14 @@ function resolveConfig(options) {
|
|
|
109
109
|
}
|
|
110
110
|
async function store(input, options) {
|
|
111
111
|
const normalizedInput = normalizeStoreInput(input);
|
|
112
|
+
const mode = normalizedInput.mode ?? "live";
|
|
112
113
|
const eventLevel = normalizedInput.eventLevel;
|
|
113
114
|
const normalizedAction = normalizeAction(normalizedInput.action);
|
|
115
|
+
if (mode === "backtest" && !normalizedInput.backtestRunId) {
|
|
116
|
+
throw new StoreError(
|
|
117
|
+
`backtestRunId is required when mode is "backtest"`
|
|
118
|
+
);
|
|
119
|
+
}
|
|
114
120
|
if (eventLevel === "execution" || eventLevel === "lifecycle") {
|
|
115
121
|
if (!normalizedAction || !EXECUTION_ACTIONS_SET.has(normalizedAction)) {
|
|
116
122
|
throw new StoreError(
|
|
@@ -130,7 +136,8 @@ async function store(input, options) {
|
|
|
130
136
|
);
|
|
131
137
|
}
|
|
132
138
|
const { baseUrl, apiKey, fetchFn } = resolveConfig(options);
|
|
133
|
-
const
|
|
139
|
+
const path = mode === "backtest" ? "/apps/backtests/tx" : "/apps/positions/tx";
|
|
140
|
+
const url = `${baseUrl}${path}`;
|
|
134
141
|
let response;
|
|
135
142
|
try {
|
|
136
143
|
response = await fetchFn(url, {
|