DEX API

创建限价单#

创建 DEX 限价单。

请求地址#

POST https://www.okx.com/api/v5/dex/aggregator/limit-order/save-order

请求参数#

参数类型必传描述
orderHashString订单hash
signatureString签名
chainIdString链 ID (如1: Ethereum,更多可查看链 ID 列表)
dataObject订单的数据对象
saltString随机数盐,作为幂等标识
当前时间戳 (秒值) (如:1691499249)
makingAmountString卖出币数量
(数量需包含精度,如 1.00 USDT 需输入 10000001.00 DAI 需输入 1000000000000000000)
takingAmountString买入币数量
(数量需包含精度,如 1.00 USDT 需输入 10000001.00 DAI 需输入 1000000000000000000)
makerTokenString卖出币种合约地址 (如:0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39)
takerTokenString买入币种合约地址 (如:0x2791bca1f2de4661ed88a30c99a7a9449aa84174)
makerString创建订单的钱包地址 (如:0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9)
deadLineString当前订单生效截止时间
时间戳 (秒值) (如:1699520029)
allowedSenderString设置零地址 (0x0000000000000000000000000000000000000000),每个人都可以与当前限价订单成交。如果您设置了指定值,则限价订单将仅可在指定地址执行 (如:0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9)
receiverString资产将会发送到当前receiver的地址 (如:0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9)
minReturnString买入币最小获得数量
(数量需包含精度,如 1.00 USDT 需输入 10000001.00 DAI 需输入 1000000000000000000)
partiallyAbleBool是否支持部分成交 (true 代表支持, false 代表不支持)

响应参数#

参数类型描述
codeString状态码 (如0: 操作成功,51000: 必填参数不能为空, 更多可查看错误码列表)
msgString服务端响应信息,接口正常无值,异常会返回异常

请求示例#

shell
{
  "orderHash":"0xf1852a5c82b9ff891123456731325f4a778603471c2e8fa8d80583824c21e97a",
  "signature":"0x78645ba7ed8c0266e01e46302160aad1234567ac9a0c751b9c315a516f44f54765acd11c11ffc88c9dd7f74fa63c606506ab145f94592bbbcb3cf2bac1cb13a01b",
  "chainId":"137",
  "data":{
    "salt":"1697032618",
    "makingAmount":"5900000",
    "takingAmount":"6000000",
    "makerToken":"0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
    "takerToken":"0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
    "maker":"0x230293u8238sh823472hjskq92j38ahj2i391k20",
    "deadLine":"1697784060",
    "allowedSender":"0x0000000000000000000000000000000000000000",
    "receiver":"0x230293u8238sh823472hjskq92j38ahj2i391k20",
    "minReturn":"6000000",
    "partiallyAble" : true
  }
}

响应示例#

200
{
        "code":"0",
        "msg":"save order success"
      }