feat: integration with API Vega Cloud

This commit is contained in:
2025-10-14 11:16:23 +07:00
parent 8b24695a75
commit 1d341c3a7c
23 changed files with 468 additions and 431 deletions
+19
View File
@@ -0,0 +1,19 @@
import { httpRequest } from '~/helpers/http/axios'
import logger from '~/plugins/logger'
export async function sendCommandToThirdParty(topicData: string, payload: string): Promise<void> {
try {
const response = await httpRequest({
method: 'POST',
url: '/command',
body: {
topic: topicData,
payload,
},
})
logger.info({ msg: 'Third-party command sent successfully', topic: topicData, status: response.status })
} catch (error) {
logger.error({ msg: 'Failed to send command to third-party service', topic: topicData, error: (error as Error).message })
throw new Error('third_party_command_failed')
}
}