add: zano trade api docs
This commit is contained in:
parent
0cc410898c
commit
48805babd6
22 changed files with 278 additions and 0 deletions
3
docs/build/zano-trade-api/_category_.json
vendored
Normal file
3
docs/build/zano-trade-api/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"label": "Zano trade Api"
|
||||
}
|
||||
4
docs/build/zano-trade-api/apply-for-matched-order/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/apply-for-matched-order/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Apply for matched order",
|
||||
"position": 6
|
||||
}
|
||||
28
docs/build/zano-trade-api/apply-for-matched-order/apply-for-matched-order.md
vendored
Normal file
28
docs/build/zano-trade-api/apply-for-matched-order/apply-for-matched-order.md
vendored
Normal file
|
|
@ -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**: <kbd>POST</kbd>
|
||||
- **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
|
||||
```
|
||||
4
docs/build/zano-trade-api/confirm-transaction/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/confirm-transaction/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Сonfirm transaction",
|
||||
"position": 7
|
||||
}
|
||||
19
docs/build/zano-trade-api/confirm-transaction/confirm-transaction.md
vendored
Normal file
19
docs/build/zano-trade-api/confirm-transaction/confirm-transaction.md
vendored
Normal file
|
|
@ -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**: <kbd>POST</kbd>
|
||||
- **PATH**: `/api/transactions/confirm`
|
||||
|
||||
#### Request:
|
||||
```typescript
|
||||
{
|
||||
token: string;
|
||||
transactionId: number;
|
||||
}
|
||||
```
|
||||
#### Response:
|
||||
```typescript
|
||||
success: boolean;
|
||||
data?: string // error message
|
||||
```
|
||||
4
docs/build/zano-trade-api/create-new-order/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/create-new-order/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Create new order",
|
||||
"position": 4
|
||||
}
|
||||
24
docs/build/zano-trade-api/create-new-order/create-new-order.md
vendored
Normal file
24
docs/build/zano-trade-api/create-new-order/create-new-order.md
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Create new order
|
||||
|
||||
- **METHOD**: <kbd>POST</kbd>
|
||||
- **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
|
||||
```
|
||||
4
docs/build/zano-trade-api/delete-your-order/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/delete-your-order/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Delete your order",
|
||||
"position": 5
|
||||
}
|
||||
17
docs/build/zano-trade-api/delete-your-order/delete-your-order.md
vendored
Normal file
17
docs/build/zano-trade-api/delete-your-order/delete-your-order.md
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Delete your order
|
||||
|
||||
- **METHOD**: <kbd>POST</kbd>
|
||||
- **PATH**: `/api/orders/cancel`
|
||||
|
||||
#### Request:
|
||||
```typescript
|
||||
{
|
||||
token: string;
|
||||
orderId: number;
|
||||
}
|
||||
```
|
||||
#### Response:
|
||||
```typescript
|
||||
success: boolean;
|
||||
data?: string // error message
|
||||
```
|
||||
4
docs/build/zano-trade-api/get-active-orders/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/get-active-orders/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Get your active orders",
|
||||
"position": 3
|
||||
}
|
||||
51
docs/build/zano-trade-api/get-active-orders/get-active-orders.md
vendored
Normal file
51
docs/build/zano-trade-api/get-active-orders/get-active-orders.md
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# Get your active orders
|
||||
- **METHOD**: <kbd>POST</kbd>
|
||||
- **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;
|
||||
}[];
|
||||
}
|
||||
```
|
||||
4
docs/build/zano-trade-api/get-active-tx-by-id/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/get-active-tx-by-id/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Get active Tx by orders' Ids",
|
||||
"position": 10
|
||||
}
|
||||
29
docs/build/zano-trade-api/get-active-tx-by-id/get-active-tx-by-id.md
vendored
Normal file
29
docs/build/zano-trade-api/get-active-tx-by-id/get-active-tx-by-id.md
vendored
Normal file
|
|
@ -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**: <kbd>POST</kbd>
|
||||
- **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
|
||||
```
|
||||
4
docs/build/zano-trade-api/get-dex-trading-pair/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/get-dex-trading-pair/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Get info about a DEX trading pair",
|
||||
"position": 8
|
||||
}
|
||||
11
docs/build/zano-trade-api/get-dex-trading-pair/get-dex-trading-pair.md
vendored
Normal file
11
docs/build/zano-trade-api/get-dex-trading-pair/get-dex-trading-pair.md
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Get info about a DEX trading pair
|
||||
|
||||
- **METHOD**: <kbd>POST</kbd>
|
||||
- **PATH**: `/api/dex/get-pair`
|
||||
|
||||
#### Request:
|
||||
```typescript
|
||||
{
|
||||
id: number;
|
||||
}
|
||||
```
|
||||
4
docs/build/zano-trade-api/overview/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/overview/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Overview",
|
||||
"position": 1
|
||||
}
|
||||
9
docs/build/zano-trade-api/overview/overview.md
vendored
Normal file
9
docs/build/zano-trade-api/overview/overview.md
vendored
Normal file
|
|
@ -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
|
||||
4
docs/build/zano-trade-api/ping-activity-checker/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/ping-activity-checker/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Ping activity checker",
|
||||
"position": 9
|
||||
}
|
||||
22
docs/build/zano-trade-api/ping-activity-checker/ping-activity-checker.md
vendored
Normal file
22
docs/build/zano-trade-api/ping-activity-checker/ping-activity-checker.md
vendored
Normal file
|
|
@ -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.*
|
||||
|
||||
> 
|
||||
|
||||
- **METHOD**: <kbd>POST</kbd>
|
||||
- **PATH**: `/api/dex/renew-bot`
|
||||
|
||||
#### Request:
|
||||
```typescript
|
||||
{
|
||||
token: string;
|
||||
orderId: number;
|
||||
}
|
||||
```
|
||||
|
||||
#### Response:
|
||||
```typescript
|
||||
sucess: boolean;
|
||||
data?: string // error message
|
||||
```
|
||||
4
docs/build/zano-trade-api/trade-api/_category_.json
vendored
Normal file
4
docs/build/zano-trade-api/trade-api/_category_.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"label": "Authenticate in System",
|
||||
"position": 2
|
||||
}
|
||||
25
docs/build/zano-trade-api/trade-api/trade-api.md
vendored
Normal file
25
docs/build/zano-trade-api/trade-api/trade-api.md
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Authenticate in System
|
||||
- **METHOD**: <kbd>POST</kbd>
|
||||
- **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
|
||||
```
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
Loading…
Add table
Reference in a new issue