From 48805babd6fe8dc95acef9ba89091e37d4d15fbf Mon Sep 17 00:00:00 2001 From: AzizbekFayziyev Date: Mon, 28 Apr 2025 20:30:36 +0500 Subject: [PATCH] add: zano trade api docs --- docs/build/zano-trade-api/_category_.json | 3 ++ .../apply-for-matched-order/_category_.json | 4 ++ .../apply-for-matched-order.md | 28 ++++++++++ .../confirm-transaction/_category_.json | 4 ++ .../confirm-transaction.md | 19 +++++++ .../create-new-order/_category_.json | 4 ++ .../create-new-order/create-new-order.md | 24 +++++++++ .../delete-your-order/_category_.json | 4 ++ .../delete-your-order/delete-your-order.md | 17 ++++++ .../get-active-orders/_category_.json | 4 ++ .../get-active-orders/get-active-orders.md | 51 ++++++++++++++++++ .../get-active-tx-by-id/_category_.json | 4 ++ .../get-active-tx-by-id.md | 29 ++++++++++ .../get-dex-trading-pair/_category_.json | 4 ++ .../get-dex-trading-pair.md | 11 ++++ .../zano-trade-api/overview/_category_.json | 4 ++ .../build/zano-trade-api/overview/overview.md | 9 ++++ .../ping-activity-checker/_category_.json | 4 ++ .../ping-activity-checker.md | 22 ++++++++ .../zano-trade-api/trade-api/_category_.json | 4 ++ .../zano-trade-api/trade-api/trade-api.md | 25 +++++++++ .../ping-activity-checker/instant.jpg | Bin 0 -> 3433 bytes 22 files changed, 278 insertions(+) create mode 100644 docs/build/zano-trade-api/_category_.json create mode 100644 docs/build/zano-trade-api/apply-for-matched-order/_category_.json create mode 100644 docs/build/zano-trade-api/apply-for-matched-order/apply-for-matched-order.md create mode 100644 docs/build/zano-trade-api/confirm-transaction/_category_.json create mode 100644 docs/build/zano-trade-api/confirm-transaction/confirm-transaction.md create mode 100644 docs/build/zano-trade-api/create-new-order/_category_.json create mode 100644 docs/build/zano-trade-api/create-new-order/create-new-order.md create mode 100644 docs/build/zano-trade-api/delete-your-order/_category_.json create mode 100644 docs/build/zano-trade-api/delete-your-order/delete-your-order.md create mode 100644 docs/build/zano-trade-api/get-active-orders/_category_.json create mode 100644 docs/build/zano-trade-api/get-active-orders/get-active-orders.md create mode 100644 docs/build/zano-trade-api/get-active-tx-by-id/_category_.json create mode 100644 docs/build/zano-trade-api/get-active-tx-by-id/get-active-tx-by-id.md create mode 100644 docs/build/zano-trade-api/get-dex-trading-pair/_category_.json create mode 100644 docs/build/zano-trade-api/get-dex-trading-pair/get-dex-trading-pair.md create mode 100644 docs/build/zano-trade-api/overview/_category_.json create mode 100644 docs/build/zano-trade-api/overview/overview.md create mode 100644 docs/build/zano-trade-api/ping-activity-checker/_category_.json create mode 100644 docs/build/zano-trade-api/ping-activity-checker/ping-activity-checker.md create mode 100644 docs/build/zano-trade-api/trade-api/_category_.json create mode 100644 docs/build/zano-trade-api/trade-api/trade-api.md create mode 100644 static/img/build/zano-trade-api/ping-activity-checker/instant.jpg diff --git a/docs/build/zano-trade-api/_category_.json b/docs/build/zano-trade-api/_category_.json new file mode 100644 index 0000000..259bac9 --- /dev/null +++ b/docs/build/zano-trade-api/_category_.json @@ -0,0 +1,3 @@ +{ + "label": "Zano trade Api" +} diff --git a/docs/build/zano-trade-api/apply-for-matched-order/_category_.json b/docs/build/zano-trade-api/apply-for-matched-order/_category_.json new file mode 100644 index 0000000..56d30a7 --- /dev/null +++ b/docs/build/zano-trade-api/apply-for-matched-order/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Apply for matched order", + "position": 6 +} diff --git a/docs/build/zano-trade-api/apply-for-matched-order/apply-for-matched-order.md b/docs/build/zano-trade-api/apply-for-matched-order/apply-for-matched-order.md new file mode 100644 index 0000000..049628a --- /dev/null +++ b/docs/build/zano-trade-api/apply-for-matched-order/apply-for-matched-order.md @@ -0,0 +1,28 @@ +# Apply for matched order + +> Use this method to apply if another side hasn't done it yet. +> You can check if they applied by the **transaction** field in applyTips. If it's `false`, you can apply for it; otherwise, you are the finalizer and should use the **Confirm transaction** method. + +- **METHOD**: POST +- **PATH**: `/api/orders/apply-order` + +#### Request: +```typescript +{ + token: string; + orderData: { + id: string; + connected_order_id: string; + hex_raw_proposal: string; + }; +} +``` + +>Explanation of Fields: +>- to get `hex_raw_proposal` create [ionic swap proposal](https://docs.zano.org/docs/build/rpc-api/wallet-rpc-api/ionic_swap_generate_proposal/) via Zano wallet API; +>- hex_raw_proposal - Hex-encoded proposal raw data(encrypted with common shared key). Includes half-created transaction template and some extra information that would be needed counterparty to finialize and sign transaction +#### Response: +```typescript + success: boolean; + data?: string // error message +``` \ No newline at end of file diff --git a/docs/build/zano-trade-api/confirm-transaction/_category_.json b/docs/build/zano-trade-api/confirm-transaction/_category_.json new file mode 100644 index 0000000..d446b7c --- /dev/null +++ b/docs/build/zano-trade-api/confirm-transaction/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Сonfirm transaction", + "position": 7 +} diff --git a/docs/build/zano-trade-api/confirm-transaction/confirm-transaction.md b/docs/build/zano-trade-api/confirm-transaction/confirm-transaction.md new file mode 100644 index 0000000..1a04080 --- /dev/null +++ b/docs/build/zano-trade-api/confirm-transaction/confirm-transaction.md @@ -0,0 +1,19 @@ +# Confirm transaction + +> Use this method to confirm that you have finalized the transaction (order or part). You can get its id from the **get-active-tx-by-orders-ids** method. + +- **METHOD**: POST +- **PATH**: `/api/transactions/confirm` + +#### Request: +```typescript +{ + token: string; + transactionId: number; +} +``` +#### Response: +```typescript + success: boolean; + data?: string // error message +``` \ No newline at end of file diff --git a/docs/build/zano-trade-api/create-new-order/_category_.json b/docs/build/zano-trade-api/create-new-order/_category_.json new file mode 100644 index 0000000..a94f717 --- /dev/null +++ b/docs/build/zano-trade-api/create-new-order/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Create new order", + "position": 4 +} diff --git a/docs/build/zano-trade-api/create-new-order/create-new-order.md b/docs/build/zano-trade-api/create-new-order/create-new-order.md new file mode 100644 index 0000000..298fa82 --- /dev/null +++ b/docs/build/zano-trade-api/create-new-order/create-new-order.md @@ -0,0 +1,24 @@ +# Create new order + +- **METHOD**: POST +- **PATH**: `/api/orders/create` + +#### Request: +```typescript +{ + token: string; + orderData: { + type: 'buy' | 'sell'; + side: 'limit'; // field naming will be fixed soon. It won't affect bots, both field names will work + price: string; + amount: string; + pairId: number; + }; +} +``` + +#### Response: +```typescript + success: boolean; + data?: string // error message +``` \ No newline at end of file diff --git a/docs/build/zano-trade-api/delete-your-order/_category_.json b/docs/build/zano-trade-api/delete-your-order/_category_.json new file mode 100644 index 0000000..261f6e9 --- /dev/null +++ b/docs/build/zano-trade-api/delete-your-order/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Delete your order", + "position": 5 +} diff --git a/docs/build/zano-trade-api/delete-your-order/delete-your-order.md b/docs/build/zano-trade-api/delete-your-order/delete-your-order.md new file mode 100644 index 0000000..d4a2f4d --- /dev/null +++ b/docs/build/zano-trade-api/delete-your-order/delete-your-order.md @@ -0,0 +1,17 @@ +# Delete your order + +- **METHOD**: POST +- **PATH**: `/api/orders/cancel` + +#### Request: +```typescript +{ + token: string; + orderId: number; +} +``` +#### Response: +```typescript + success: boolean; + data?: string // error message +``` diff --git a/docs/build/zano-trade-api/get-active-orders/_category_.json b/docs/build/zano-trade-api/get-active-orders/_category_.json new file mode 100644 index 0000000..b6dc6a4 --- /dev/null +++ b/docs/build/zano-trade-api/get-active-orders/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Get your active orders", + "position": 3 +} diff --git a/docs/build/zano-trade-api/get-active-orders/get-active-orders.md b/docs/build/zano-trade-api/get-active-orders/get-active-orders.md new file mode 100644 index 0000000..ffe5339 --- /dev/null +++ b/docs/build/zano-trade-api/get-active-orders/get-active-orders.md @@ -0,0 +1,51 @@ +# Get your active orders +- **METHOD**: POST +- **PATH**: `/api/orders/get-user-page` + +#### Request: +```typescript +{ + token: string; + pairId: number; +} +#### Response: +```typescript + success: boolean; + data: { + orders: { + id: number; + type: string; + timestamp: string; + side: string; + price: string; + amount: string; + total: string; + pair_id: number; + user_id: number; + status: string; + left: string; + hasNotification: boolean; + createdAt: string; + updatedAt: string; + isInstant: boolean; + }[]; + + applyTips: { + id: number; + left: string; + price: string; + user: { + alias: string; + address: string; + createdAt: string; + updatedAt: string; + }; + type: string; + total: string; + connected_order_id: number; + transaction: boolean; + hex_raw_proposal: string; + isInstant: boolean; + }[]; + } +``` \ No newline at end of file diff --git a/docs/build/zano-trade-api/get-active-tx-by-id/_category_.json b/docs/build/zano-trade-api/get-active-tx-by-id/_category_.json new file mode 100644 index 0000000..305726b --- /dev/null +++ b/docs/build/zano-trade-api/get-active-tx-by-id/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Get active Tx by orders' Ids", + "position": 10 +} diff --git a/docs/build/zano-trade-api/get-active-tx-by-id/get-active-tx-by-id.md b/docs/build/zano-trade-api/get-active-tx-by-id/get-active-tx-by-id.md new file mode 100644 index 0000000..a98bf2e --- /dev/null +++ b/docs/build/zano-trade-api/get-active-tx-by-id/get-active-tx-by-id.md @@ -0,0 +1,29 @@ +# Get active Tx by orders' Ids + +> Get active transaction data by matching 2 orders. +> So you can check if the transaction is already confirmed by another user and/or get proposal hex. + +- **METHOD**: POST +- **PATH**: `/api/transactions/get-active-tx-by-orders-ids` + +#### Request: +```typescript +{ + token: string; + firstOrderId: number; + secondOrderId: number; +} +``` +#### Response: +```typescript + success: boolean; + data?: { + buy_order_id: number; + sell_order_id: number; + amount: string; + timestamp: number; + status: string; + creator: string; + hex_raw_proposal: string; + } | string // error message +``` \ No newline at end of file diff --git a/docs/build/zano-trade-api/get-dex-trading-pair/_category_.json b/docs/build/zano-trade-api/get-dex-trading-pair/_category_.json new file mode 100644 index 0000000..fe78865 --- /dev/null +++ b/docs/build/zano-trade-api/get-dex-trading-pair/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Get info about a DEX trading pair", + "position": 8 +} diff --git a/docs/build/zano-trade-api/get-dex-trading-pair/get-dex-trading-pair.md b/docs/build/zano-trade-api/get-dex-trading-pair/get-dex-trading-pair.md new file mode 100644 index 0000000..ac31ca2 --- /dev/null +++ b/docs/build/zano-trade-api/get-dex-trading-pair/get-dex-trading-pair.md @@ -0,0 +1,11 @@ +# Get info about a DEX trading pair + +- **METHOD**: POST +- **PATH**: `/api/dex/get-pair` + +#### Request: +```typescript +{ + id: number; +} +``` diff --git a/docs/build/zano-trade-api/overview/_category_.json b/docs/build/zano-trade-api/overview/_category_.json new file mode 100644 index 0000000..e224ed8 --- /dev/null +++ b/docs/build/zano-trade-api/overview/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Overview", + "position": 1 +} diff --git a/docs/build/zano-trade-api/overview/overview.md b/docs/build/zano-trade-api/overview/overview.md new file mode 100644 index 0000000..5634613 --- /dev/null +++ b/docs/build/zano-trade-api/overview/overview.md @@ -0,0 +1,9 @@ +# Trade API for custom bots + +## Additional Resources +- [Zano Trade Dex](https://trade.zano.org) +- [Zano Documentation](https://docs.zano.org) +- [Ionic Swaps Overview](https://docs.zano.org/docs/build/confidential-assets/ionic-swaps) + +## RestAPI ENDPOINTS +**base URL** - https://trade.zano.org \ No newline at end of file diff --git a/docs/build/zano-trade-api/ping-activity-checker/_category_.json b/docs/build/zano-trade-api/ping-activity-checker/_category_.json new file mode 100644 index 0000000..c68eef3 --- /dev/null +++ b/docs/build/zano-trade-api/ping-activity-checker/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Ping activity checker", + "position": 9 +} diff --git a/docs/build/zano-trade-api/ping-activity-checker/ping-activity-checker.md b/docs/build/zano-trade-api/ping-activity-checker/ping-activity-checker.md new file mode 100644 index 0000000..efb51f0 --- /dev/null +++ b/docs/build/zano-trade-api/ping-activity-checker/ping-activity-checker.md @@ -0,0 +1,22 @@ +# Ping activity checker + +> *You should call this method every 10 seconds to keep the `instant` icon active, so users know that your bot will accept the order immediately.* + +> ![instant icon](../../../../static/img/build/zano-trade-api/ping-activity-checker/instant.jpg) + +- **METHOD**: POST +- **PATH**: `/api/dex/renew-bot` + +#### Request: +```typescript +{ + token: string; + orderId: number; +} +``` + +#### Response: +```typescript + sucess: boolean; + data?: string // error message +``` \ No newline at end of file diff --git a/docs/build/zano-trade-api/trade-api/_category_.json b/docs/build/zano-trade-api/trade-api/_category_.json new file mode 100644 index 0000000..40bb974 --- /dev/null +++ b/docs/build/zano-trade-api/trade-api/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Authenticate in System", + "position": 2 +} diff --git a/docs/build/zano-trade-api/trade-api/trade-api.md b/docs/build/zano-trade-api/trade-api/trade-api.md new file mode 100644 index 0000000..4670727 --- /dev/null +++ b/docs/build/zano-trade-api/trade-api/trade-api.md @@ -0,0 +1,25 @@ +# Authenticate in System +- **METHOD**: POST +- **PATH**: `/api/auth` + +#### Request: +```typescript +{ + data: { + address: string; + alias: string; + message: string; + signature: string; + }; + neverExpires: boolean; +} +``` + +>Explanation of Fields: +>- To get ```data``` you should [sign some message using Zano wallet](https://docs.zano.org/docs/build/rpc-api/wallet-rpc-api/sign_message/) (random string) + +#### Response: +```typescript + success: boolean; + data?: string // error message +``` \ No newline at end of file diff --git a/static/img/build/zano-trade-api/ping-activity-checker/instant.jpg b/static/img/build/zano-trade-api/ping-activity-checker/instant.jpg new file mode 100644 index 0000000000000000000000000000000000000000..396dddf45faf128956b55c80e7c3b643ece4cc73 GIT binary patch literal 3433 zcmb_eXH-+m7M?VkQW8LEN|h!^Z_+zKkdD$shy)DMLIk8JK1+y^-a({_^bS%~kS6gfe0&LbYhyiulMapo;5T!_1p5Cr{FBmRtPKMi z0x%?PML@9rDfk~_Mm%jpnr4aCIXrhc1ir)Fe{!xJ9!&5j&~la9;TV7X4%eaay?9$| zeHu5TaRJZYxchJXj7K1bra4E`xc)kuUp4@$UjTr`|MIz~0C0~80N2#bMf%<>;!?p5ePa2-Clb7y*x-(B+vhC)HZ-*0FIy$1`z^KBm{

dttjGB+v#kY=ECoZ5if0q4F&% zoArUPM2A1&OK z?ur0h)YCU(XGV8d1lZF5ndJb`HeO@_P{|cmpRhS9kYj~L912TWSE^s$`qCsVAA92^ zT5v$5o!sk<*5KF}m^mIuWKmCW8FJ~4!)a>4HI8<~k2zU1G~CjiuaiE?9d6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