add bybit test data

master
TZGyn 10 months ago
parent 21eb346061
commit f760f1ef8d
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -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,
})
}

@ -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 @@
</script>
<ScrollArea class="max-h-[calc(100vh-64px)] flex-1">
<Button
onclick={() => {
fetch('/api/bybit/test', { method: 'POST' })
}}>
Test
</Button>
<div class="flex justify-center">
<Card.Root>
<Card.Content>

Loading…
Cancel
Save