From f760f1ef8dae937d30aba909d17fb52671f3d526 Mon Sep 17 00:00:00 2001 From: TZGyn Date: Mon, 17 Feb 2025 21:56:20 +0800 Subject: [PATCH] add bybit test data --- src/routes/api/bybit/test/+server.ts | 17 +++++++++++++++++ src/routes/dashboard/crypto-data/+page.svelte | 8 +++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/routes/api/bybit/test/+server.ts diff --git a/src/routes/api/bybit/test/+server.ts b/src/routes/api/bybit/test/+server.ts new file mode 100644 index 0000000..9d9952b --- /dev/null +++ b/src/routes/api/bybit/test/+server.ts @@ -0,0 +1,17 @@ +import { json } from '@sveltejs/kit' +import { RestClientV5 } from 'bybit-api' + +export const POST = async () => { + const client = new RestClientV5({ + key: 'wrc1w54Zp5JAfXLxY2', + secret: 'tY7oYPhwSE1gabFS4PmxtmbDOhkYWvPh0khf', + demoTrading: true, + }) + + const orders = await client.getActiveOrders({ + category: 'linear', + }) + return json({ + orders, + }) +} diff --git a/src/routes/dashboard/crypto-data/+page.svelte b/src/routes/dashboard/crypto-data/+page.svelte index 099bf9f..1ac3c9a 100644 --- a/src/routes/dashboard/crypto-data/+page.svelte +++ b/src/routes/dashboard/crypto-data/+page.svelte @@ -20,7 +20,7 @@ today, } from '@internationalized/date' import { cn } from '$lib/utils.js' - import { buttonVariants } from '$lib/components/ui/button' + import { Button, buttonVariants } from '$lib/components/ui/button' import Bingx from './(components)/bingx.svelte' import { ScrollArea } from '$lib/components/ui/scroll-area' @@ -105,6 +105,12 @@ +