MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / postOrder

Function postOrder

ui/src/api/trading.ts:279–290  ·  view source on GitHub ↗
(url: string, body: unknown)

Source from the content-addressed store, hash-verified

277// ==================== Internal helpers ====================
278
279async function postOrder(url: string, body: unknown): Promise<WalletPushResult> {
280 const res = await fetch(url, {
281 method: 'POST',
282 headers: { 'Content-Type': 'application/json' },
283 body: JSON.stringify(body),
284 })
285 if (!res.ok) {
286 const json = (await res.json().catch(() => ({}))) as OrderErrorResponse
287 throw new OrderEntryError(res.status, { error: json.error ?? `Request failed (${res.status})`, phase: json.phase })
288 }
289 return res.json()
290}

Callers 3

placeOrderFunction · 0.85
closePositionFunction · 0.85
cancelOrderFunction · 0.85

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected