Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 191 additions & 0 deletions doc/manifest-gateway-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# Manifest Gateway API (for CCXT private methods)

This document defines a minimal HTTP contract for the `manifest` CCXT adapter private methods.

## Base URLs

- Public stats API: `https://mfx-stats-mainnet.fly.dev`
- Private gateway API: configurable via `exchange.urls.api.private`

## Authentication

Recommended:

- `Authorization: Bearer <token>`
- Optional: `X-Manifest-Secret: <secret>`

The current adapter forwards both headers when `apiKey`/`secret` are configured.

## Endpoints

### `POST /order`

Creates an order.

Request:

```json
{
"marketId": "SOL_USDC",
"type": "limit",
"side": "buy",
"amount": "1.25",
"price": "170.5",
"timeInForce": "GTC",
"clientOrderId": "my-id-123"
}
```

Response:

```json
{
"success": true,
"order": {
"orderId": "123456789",
"clientOrderId": "my-id-123",
"marketId": "SOL_USDC",
"status": "open",
"type": "limit",
"side": "buy",
"price": "170.5",
"amount": "1.25",
"filled": "0",
"remaining": "1.25",
"timestamp": 1762360000000
}
}
```

### `DELETE /order`

Cancels an order.

Query params:

- `orderId` (required)
- `marketId` (optional but recommended)

Response:

```json
{
"success": true,
"order": {
"orderId": "123456789",
"status": "canceled",
"marketId": "SOL_USDC",
"timestamp": 1762360005000
}
}
```

### `GET /order`

Fetches a single order.

Query params:

- `orderId` (required)
- `marketId` (optional)

Response:

```json
{
"success": true,
"order": {
"orderId": "123456789",
"clientOrderId": "my-id-123",
"marketId": "SOL_USDC",
"status": "partially_filled",
"type": "limit",
"side": "buy",
"price": "170.5",
"amount": "1.25",
"filled": "0.5",
"remaining": "0.75",
"timestamp": 1762360000000,
"lastUpdateTimestamp": 1762360010000
}
}
```

### `GET /openOrders`

Fetches open orders.

Query params:

- `marketId` (optional)
- `since` (optional, ms)
- `limit` (optional)

Response:

```json
{
"success": true,
"orders": [
{
"orderId": "123456789",
"marketId": "SOL_USDC",
"status": "open",
"type": "limit",
"side": "buy",
"price": "170.5",
"amount": "1.25",
"filled": "0",
"remaining": "1.25",
"timestamp": 1762360000000
}
]
}
```

### `GET /myTrades`

Fetches user fills/trades.

Query params:

- `marketId` (optional)
- `since` (optional, ms)
- `limit` (optional)

Response:

```json
{
"success": true,
"trades": [
{
"tradeId": "fill-1",
"orderId": "123456789",
"marketId": "SOL_USDC",
"timestamp": 1762360020000,
"side": "buy",
"price": "170.5",
"amount": "0.5",
"cost": "85.25",
"fee": "0.042625",
"feeCurrency": "USDC",
"takerOrMaker": "taker"
}
]
}
```

## Error shape

Recommended error payload:

```json
{
"success": false,
"error": "ORDER_NOT_FOUND",
"message": "order not found"
}
```

The adapter maps `error`/`message` to CCXT exceptions via `handleErrors`.
3 changes: 3 additions & 0 deletions ts/ccxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ import latoken from './src/latoken.js'
import lbank from './src/lbank.js'
import lighter from './src/lighter.js'
import luno from './src/luno.js'
import manifest from './src/manifest.js'
import mercado from './src/mercado.js'
import mexc from './src/mexc.js'
import modetrade from './src/modetrade.js'
Expand Down Expand Up @@ -323,6 +324,7 @@ const exchanges = {
'lbank': lbank,
'lighter': lighter,
'luno': luno,
'manifest': manifest,
'mercado': mercado,
'mexc': mexc,
'modetrade': modetrade,
Expand Down Expand Up @@ -660,6 +662,7 @@ export {
lbank,
lighter,
luno,
manifest,
mercado,
mexc,
modetrade,
Expand Down
36 changes: 36 additions & 0 deletions ts/src/abstract/manifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// -------------------------------------------------------------------------------

// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code

// -------------------------------------------------------------------------------

import { implicitReturnType } from '../base/types.js';
import { Exchange as _Exchange } from '../base/Exchange.js';

interface Exchange {
publicGetHealth (params?: {}): Promise<implicitReturnType>;
publicGetTickers (params?: {}): Promise<implicitReturnType>;
publicGetMetadata (params?: {}): Promise<implicitReturnType>;
publicGetOrderbook (params?: {}): Promise<implicitReturnType>;
publicGetVolume (params?: {}): Promise<implicitReturnType>;
publicGetTraders (params?: {}): Promise<implicitReturnType>;
publicGetRecentFills (params?: {}): Promise<implicitReturnType>;
publicGetCompleteFills (params?: {}): Promise<implicitReturnType>;
publicGetCheckpoints (params?: {}): Promise<implicitReturnType>;
publicGetCheckpointStatus (params?: {}): Promise<implicitReturnType>;
publicGetWrapper (params?: {}): Promise<implicitReturnType>;
publicGetWrappers (params?: {}): Promise<implicitReturnType>;
publicGetTradersDebug (params?: {}): Promise<implicitReturnType>;
publicGetNotional (params?: {}): Promise<implicitReturnType>;
publicGetAlts (params?: {}): Promise<implicitReturnType>;
publicGetBackfill (params?: {}): Promise<implicitReturnType>;
privateGetOrder (params?: {}): Promise<implicitReturnType>;
privateGetOpenOrders (params?: {}): Promise<implicitReturnType>;
privateGetMyTrades (params?: {}): Promise<implicitReturnType>;
privatePostOrder (params?: {}): Promise<implicitReturnType>;
privateDeleteOrder (params?: {}): Promise<implicitReturnType>;
}
abstract class Exchange extends _Exchange {}

export default Exchange
Loading