Skip to content

Commit 8cfcbdc

Browse files
authored
Merge pull request #260 from OrderlyNetwork/docs/add-admin-asset-convert-history-api-specs
Docs/add admin asset convert history api specs
2 parents 10b3947 + b3263b3 commit 8cfcbdc

4 files changed

Lines changed: 290 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
openapi: orderly.openapi get /v1/admin/asset/convert_history
3+
---

docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@
606606
"build-on-omnichain/restful-api/private/get-current-holding-1",
607607
"build-on-omnichain/restful-api/private/get-internal-transfer-history-1",
608608
"build-on-omnichain/restful-api/private/get-asset-history-1",
609+
"build-on-omnichain/restful-api/private/get-asset-conversion-history",
609610
"build-on-omnichain/restful-api/private/get-leverage-setting-1",
610611
"build-on-omnichain/restful-api/private/get-orders-1",
611612
"build-on-omnichain/restful-api/private/get-one-position-info-1",

llms-full.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ Base facts: API mainnet `https://api.orderly.org`, testnet `https://testnet-api.
492492
- [Get Current Holding 1](https://orderly.network/docs/build-on-omnichain/restful-api/private/get-current-holding-1): [GET /v1/admin/client/holding] Get current holding
493493
- [Get Internal Transfer History 1](https://orderly.network/docs/build-on-omnichain/restful-api/private/get-internal-transfer-history-1): [GET /v1/admin/internal_transfer_history] Get internal transfer history
494494
- [Get Asset History 1](https://orderly.network/docs/build-on-omnichain/restful-api/private/get-asset-history-1): [GET /v1/admin/asset/history] Get asset history
495+
- [Get Asset Conversion History](https://orderly.network/docs/build-on-omnichain/restful-api/private/get-asset-conversion-history): [GET /v1/admin/asset/convert_history] Get asset conversion history
495496
- [Get Leverage Setting 1](https://orderly.network/docs/build-on-omnichain/restful-api/private/get-leverage-setting-1): [GET /v1/admin/client/leverage] Get leverage setting
496497
- [Get Orders 1](https://orderly.network/docs/build-on-omnichain/restful-api/private/get-orders-1): [GET /v1/admin/orders] Get orders
497498
- [Get One Position Info 1](https://orderly.network/docs/build-on-omnichain/restful-api/private/get-one-position-info-1): [GET /v1/admin/position/{symbol}] Get one position info

orderly.openapi.yaml

Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8845,6 +8845,128 @@ paths:
88458845
schema:
88468846
$ref: "#/components/schemas/AdminAssetHistoryResponse"
88478847

8848+
/v1/admin/asset/convert_history:
8849+
get:
8850+
summary: Get asset conversion history
8851+
description: |
8852+
`GET /v1/admin/asset/convert_history`
8853+
8854+
Returns asset conversion history records from the Builder's trading platform. Only the Builder Admin can query this endpoint.
8855+
8856+
Use `page` and `size` for offset pagination, or pass the `next_cursor` from the previous response as `cursor` for consistent keyset pagination. When provided, `cursor` takes precedence over `page`. Cursor pagination is recommended for reconciliation and exports because offset pagination may duplicate or skip records when new conversions arrive between requests.
8857+
8858+
`start_t` and `end_t` are required. `start_t` must be less than or equal to `end_t`, and the query range cannot exceed 180 days. To filter by user, provide either `user_address` or `user_account`, but not both.
8859+
8860+
Example request:
8861+
`GET /v1/admin/asset/convert_history?page=1&size=20&start_t=1772706491837&end_t=1778747916938&user_address=0xa772873e31f088A88C3Fc77E624AE5f4fd1E296B`
8862+
tags:
8863+
- private
8864+
parameters:
8865+
- name: page
8866+
in: query
8867+
description: Page number, starting from 1. Ignored when `cursor` is provided.
8868+
required: false
8869+
example: 1
8870+
schema:
8871+
type: integer
8872+
minimum: 1
8873+
default: 1
8874+
- name: size
8875+
in: query
8876+
description: Number of rows per page.
8877+
required: false
8878+
example: 20
8879+
schema:
8880+
type: integer
8881+
minimum: 1
8882+
maximum: 100
8883+
default: 20
8884+
- name: cursor
8885+
in: query
8886+
description: Keyset cursor for consistent pagination. Pass the `next_cursor` value from the previous response. Takes precedence over `page` when provided.
8887+
required: false
8888+
example: 617574
8889+
schema:
8890+
type: integer
8891+
format: int64
8892+
- name: start_t
8893+
in: query
8894+
description: Start of the query window as a 13-digit Unix timestamp in milliseconds. Must be less than or equal to `end_t`; the query range cannot exceed 180 days.
8895+
required: true
8896+
example: 1772706491837
8897+
schema:
8898+
type: integer
8899+
format: int64
8900+
minimum: 1000000000000
8901+
maximum: 9999999999999
8902+
- name: end_t
8903+
in: query
8904+
description: End of the query window as a 13-digit Unix timestamp in milliseconds. Must be greater than or equal to `start_t`; the query range cannot exceed 180 days.
8905+
required: true
8906+
example: 1778747916938
8907+
schema:
8908+
type: integer
8909+
format: int64
8910+
minimum: 1000000000000
8911+
maximum: 9999999999999
8912+
- name: user_address
8913+
in: query
8914+
description: Filter by user wallet address. Provide either `user_address` or `user_account`, but not both.
8915+
required: false
8916+
example: "0xa772873e31f088A88C3Fc77E624AE5f4fd1E296B"
8917+
schema:
8918+
type: string
8919+
- name: user_account
8920+
in: query
8921+
description: Filter by internal account identifier. Provide either `user_account` or `user_address`, but not both.
8922+
required: false
8923+
example: "0x94e0bc419e3eecdba0d15e67f04cd62a5ee685a9190464cea4afb6e3c0b66e2b"
8924+
schema:
8925+
type: string
8926+
- $ref: "#/components/parameters/orderly_timestamp"
8927+
- $ref: "#/components/parameters/orderly_account_id"
8928+
- $ref: "#/components/parameters/orderly_key"
8929+
- $ref: "#/components/parameters/orderly_signature"
8930+
responses:
8931+
"200":
8932+
description: OK
8933+
content:
8934+
application/json:
8935+
schema:
8936+
$ref: "#/components/schemas/AdminAssetConvertHistoryResponse"
8937+
example:
8938+
success: true
8939+
data:
8940+
rows:
8941+
- convert_id: 617575
8942+
account_id: "0x94e0bc419e3eecdba0d15e67f04cd62a5ee685a9190464cea4afb6e3c0b66e2b"
8943+
user_address: "0xa772873e31f088A88C3Fc77E624AE5f4fd1E296B"
8944+
converted_asset:
8945+
USDT: 50.00000000
8946+
received_asset: "USDC"
8947+
received_qty: 49.61831000
8948+
type: "manual"
8949+
status: "completed"
8950+
details:
8951+
- transaction_id: 560847
8952+
venue: "on_chain"
8953+
converted_asset: "USDT"
8954+
received_asset: "USDC"
8955+
converted_qty: 50.00000000
8956+
received_qty: 49.61831000
8957+
chain_id: 56
8958+
tx_id: "0xeeab245a9981eb0adbbb8561762cfffc350978a7b70ebc29809a148834da66a6"
8959+
haircut: 0.00000000
8960+
result: "succeeded"
8961+
created_time: 1772706491837
8962+
updated_time: 1772706491837
8963+
meta:
8964+
total: 1
8965+
records_per_page: 20
8966+
current_page: 1
8967+
next_cursor: 617575
8968+
timestamp: 1778747916938
8969+
88488970
/v1/admin/client/leverage:
88498971
get:
88508972
summary: Get leverage setting
@@ -14163,6 +14285,169 @@ components:
1416314285
items:
1416414286
$ref: "#/components/schemas/AdminAssetHistoryRecord"
1416514287

14288+
AdminAssetConvertHistoryDetail:
14289+
type: object
14290+
required:
14291+
- transaction_id
14292+
- venue
14293+
- converted_asset
14294+
- received_asset
14295+
- converted_qty
14296+
- received_qty
14297+
- chain_id
14298+
- tx_id
14299+
- haircut
14300+
- result
14301+
properties:
14302+
transaction_id:
14303+
description: Unique identifier for the conversion transaction.
14304+
type: integer
14305+
format: int64
14306+
example: 560847
14307+
venue:
14308+
description: Venue where the conversion was executed.
14309+
type: string
14310+
example: "on_chain"
14311+
converted_asset:
14312+
description: Asset converted in this transaction.
14313+
type: string
14314+
example: "USDT"
14315+
received_asset:
14316+
description: Asset received from this transaction.
14317+
type: string
14318+
example: "USDC"
14319+
converted_qty:
14320+
description: Quantity converted in this transaction.
14321+
type: number
14322+
format: double
14323+
example: 50.00000000
14324+
received_qty:
14325+
description: Quantity received from this transaction.
14326+
type: number
14327+
format: double
14328+
example: 49.61831000
14329+
chain_id:
14330+
description: Chain ID used for the conversion transaction.
14331+
type: integer
14332+
example: 56
14333+
tx_id:
14334+
description: On-chain transaction hash for the conversion.
14335+
type: string
14336+
example: "0xeeab245a9981eb0adbbb8561762cfffc350978a7b70ebc29809a148834da66a6"
14337+
haircut:
14338+
description: Haircut applied to the conversion.
14339+
type: number
14340+
format: double
14341+
example: 0.00000000
14342+
result:
14343+
description: Result of the conversion transaction.
14344+
type: string
14345+
example: "succeeded"
14346+
14347+
AdminAssetConvertHistoryRecord:
14348+
type: object
14349+
required:
14350+
- convert_id
14351+
- account_id
14352+
- user_address
14353+
- converted_asset
14354+
- received_asset
14355+
- received_qty
14356+
- type
14357+
- status
14358+
- details
14359+
- created_time
14360+
- updated_time
14361+
properties:
14362+
convert_id:
14363+
description: Unique identifier for the asset conversion.
14364+
type: integer
14365+
format: int64
14366+
example: 617575
14367+
account_id:
14368+
description: Internal account identifier associated with the conversion.
14369+
type: string
14370+
example: "0x94e0bc419e3eecdba0d15e67f04cd62a5ee685a9190464cea4afb6e3c0b66e2b"
14371+
user_address:
14372+
description: Wallet address associated with the conversion.
14373+
type: string
14374+
example: "0xa772873e31f088A88C3Fc77E624AE5f4fd1E296B"
14375+
converted_asset:
14376+
description: Map of converted asset symbols to quantities.
14377+
type: object
14378+
additionalProperties:
14379+
type: number
14380+
format: double
14381+
example:
14382+
USDT: 50.00000000
14383+
received_asset:
14384+
description: Asset received from the conversion.
14385+
type: string
14386+
example: "USDC"
14387+
received_qty:
14388+
description: Total quantity received from the conversion.
14389+
type: number
14390+
format: double
14391+
example: 49.61831000
14392+
type:
14393+
description: Conversion type.
14394+
type: string
14395+
example: "manual"
14396+
status:
14397+
description: Current conversion status.
14398+
type: string
14399+
example: "completed"
14400+
details:
14401+
description: Execution details for the conversion.
14402+
type: array
14403+
items:
14404+
$ref: "#/components/schemas/AdminAssetConvertHistoryDetail"
14405+
created_time:
14406+
description: Timestamp when the conversion was created in milliseconds.
14407+
type: integer
14408+
format: int64
14409+
example: 1772706491837
14410+
updated_time:
14411+
description: Timestamp when the conversion was last updated in milliseconds.
14412+
type: integer
14413+
format: int64
14414+
example: 1772706491837
14415+
14416+
AdminAssetConvertHistoryResponse:
14417+
allOf:
14418+
- $ref: "#/components/schemas/BasicResponse"
14419+
- type: object
14420+
required:
14421+
- data
14422+
- timestamp
14423+
properties:
14424+
timestamp:
14425+
description: Server timestamp in milliseconds.
14426+
type: integer
14427+
format: int64
14428+
example: 1778747916938
14429+
data:
14430+
type: object
14431+
required:
14432+
- rows
14433+
- meta
14434+
- next_cursor
14435+
properties:
14436+
rows:
14437+
type: array
14438+
items:
14439+
$ref: "#/components/schemas/AdminAssetConvertHistoryRecord"
14440+
meta:
14441+
allOf:
14442+
- $ref: "#/components/schemas/PaginationMeta"
14443+
description: Page metadata. When using cursor pagination, `total` is a point-in-time reference value; follow the `next_cursor` chain instead of relying on `total` for reconciliation or export.
14444+
next_cursor:
14445+
description: Cursor for the next page, equal to the last `convert_id` in the current page. `null` means there are no more records. Pass this value as `cursor` in the next request.
14446+
type: integer
14447+
format: int64
14448+
nullable: true
14449+
example: 617575
14450+
1416614451
ClaimInsuranceFundBody:
1416714452
type: object
1416814453
required:

0 commit comments

Comments
 (0)