Integrate StandX exchange support by updating configuration files, adding environment variables, and enhancing documentation. Include new API endpoints and authentication details for StandX in README and dedicated documentation files. Update CLI and adapter logic to accommodate StandX functionalities.

This commit is contained in:
discountry
2025-12-21 15:37:03 +08:00
parent 84d5e1f3d7
commit 93c6409688
23 changed files with 3295 additions and 18 deletions
+12
View File
@@ -4,6 +4,7 @@ import { AsterExchangeAdapter } from "../src/exchanges/aster-adapter";
import { GrvtExchangeAdapter } from "../src/exchanges/grvt/adapter";
import { BackpackExchangeAdapter } from "../src/exchanges/backpack/adapter";
import { ParadexExchangeAdapter } from "../src/exchanges/paradex/adapter";
import { StandxExchangeAdapter } from "../src/exchanges/standx/adapter";
const ORIGINAL_ENV = { ...process.env };
@@ -30,6 +31,7 @@ describe("exchange factory", () => {
expect(resolveExchangeId("ASTER")).toBe("aster");
expect(resolveExchangeId("BACKPACK")).toBe("backpack");
expect(resolveExchangeId("PaRaDeX")).toBe("paradex");
expect(resolveExchangeId("StandX")).toBe("standx");
});
it("creates grvt adapter when EXCHANGE=grvt", () => {
@@ -67,4 +69,14 @@ describe("exchange factory", () => {
expect(adapter).toBeInstanceOf(ParadexExchangeAdapter);
expect(adapter.id).toBe("paradex");
});
it("creates standx adapter when EXCHANGE=standx", () => {
process.env.EXCHANGE = "standx";
process.env.STANDX_TOKEN = "token";
process.env.STANDX_SYMBOL = "BTC-USD";
const adapter = createExchangeAdapter({ symbol: "BTC-USD" });
expect(adapter).toBeInstanceOf(StandxExchangeAdapter);
expect(adapter.id).toBe("standx");
});
});