# 磁力产品API

MOV市场可以分为磁力兑换市场和闪电兑换市场,所以MOV做市也分为在磁力兑换市场做市和闪电兑换市场做市。目前可以通过MOV Server提供的RESTful API或MOV-MMDK在两个市场做市。 做市架构

做市架构 做市原理 MOV Server只是提供订单与交易之间的相互转化,实际上所有的订单都是由用户签名后提交, 并最终由智能合约进行撮合的过程。 MOV Server提供了与中心化交易所接近一致的API接口,其交易时的API使用体验,基本与中心化交易所一致,但依然有一些不同,下面我们将会进行说明。

Field Value
HTTP_SERVER_ENDPOINT https://ex.movapi.com/magnet

# 获取市场所有交易对

返回MOV所有的交易对信息

# Request

GET /v3/common/symbols

# Response

名称 类型 描述
price_decimal String 交易对报价的精度(小数点后位数)
amount_decimal String 交易对数量的精度(小数点后位数)
base_asset Object 基础货币的对象
├── asset_id String 基础货币的ID
└── symbol String 基础货币的名称
quote_asset Object 基础货币的对象
├── asset_id String 基础货币的ID
└── symbol String 基础货币的名称
  • 示例:
# Request
GET https://ex.movapi.com/magnet/v3/common/symbols

# Response
{
   "code":200,
   "msg":"",
   "data":[
      {
         "price_decimal":4,
         "amount_decimal":2,
         "base_asset":{
            "asset_id":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
            "symbol":"BTM"
         },
         "quote_asset":{
            "asset_id":"184e1cc4ee4845023888810a79eed7a42c02c544cf2c61ceac05e176d575bd46",
            "symbol":"USDT"
         }
      },
      {
         "price_decimal":2,
         "amount_decimal":4,
         "base_asset":{
            "asset_id":"78de44ffa1bce37b757c9eae8925b5f199dc4621b412ef0f3f46168865284a93",
            "symbol":"ETH"
         },
         "quote_asset":{
            "asset_id":"184e1cc4ee4845023888810a79eed7a42c02c544cf2c61ceac05e176d575bd46",
            "symbol":"USDT"
         }
      },
      {
         "price_decimal":8,
         "amount_decimal":2,
         "base_asset":{
            "asset_id":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
            "symbol":"BTM"
         },
         "quote_asset":{
            "asset_id":"78de44ffa1bce37b757c9eae8925b5f199dc4621b412ef0f3f46168865284a93",
            "symbol":"ETH"
         }
      },
      {
         "price_decimal":8,
         "amount_decimal":2,
         "base_asset":{
            "asset_id":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
            "symbol":"BTM"
         },
         "quote_asset":{
            "asset_id":"bda946b3110fa46fd94346ce3f05f0760f1b9de72e238835bc4d19f9d64f1742",
            "symbol":"BTC"
         }
      },
      {
         "price_decimal":2,
         "amount_decimal":4,
         "base_asset":{
            "asset_id":"bda946b3110fa46fd94346ce3f05f0760f1b9de72e238835bc4d19f9d64f1742",
            "symbol":"BTC"
         },
         "quote_asset":{
            "asset_id":"184e1cc4ee4845023888810a79eed7a42c02c544cf2c61ceac05e176d575bd46",
            "symbol":"USDT"
         }
      },
      {
         "price_decimal":6,
         "amount_decimal":4,
         "base_asset":{
            "asset_id":"78de44ffa1bce37b757c9eae8925b5f199dc4621b412ef0f3f46168865284a93",
            "symbol":"ETH"
         },
         "quote_asset":{
            "asset_id":"bda946b3110fa46fd94346ce3f05f0760f1b9de72e238835bc4d19f9d64f1742",
            "symbol":"BTC"
         }
      }
   ]
}

# 获取K线数据

根据查询条件查询K线数据

# Request

GET /market/v3/kline

# Params

名称 必选 类型 描述 取值范围
symbol String 查询深度的交易对 BTM/USDT, ETH/BTC...
period String 返回数据时间粒度,也就是每根蜡烛的时间区间 1min, 5min, 15min, 30min, 60min, 4hour, 1day, 1mon, 1week, 1year
size Int 返回 K 线数据数量 [1, 500]
end_timestamp Int 指定时间之前的K线数据

# Response

名称 类型 描述
amount String 交易量以Base为基准
open String 开盘价
close String 收盘价
low String 最低价
high String 最高价
block_height String 本周期最高区块高度
timestamp String 单位秒,本周期开始时间,并以此作为此K线柱的id
indicator Object 指示器
├── change String 价格变化量,open价格-close价格
└── change_rate String 价格变化率

示例:

# Request
GET https://ex.movapi.com/magnet/v3/market/kline?symbol=BTM/ETH&period=60min&size=10
# Response
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "amount": "103371.6655444115",
            "open": "0.0000479300",
            "close": "0.0000476700",
            "low": "0.0000479200",
            "high": "0.0000475100",
            "block_height": 94363563,
            "timestamp": 1611810000,
            "indicator": {
                "change": "-0.0000002600",
                "change_rate": "-0.54246"
            }
        },
        {
            "amount": "15165.2609106430",
            "open": "0.0000479400",
            "close": "0.0000479300",
            "low": "0.0000478700",
            "high": "0.0000480000",
            "block_height": 94359948,
            "timestamp": 1611806400,
            "indicator": {
                "change": "-0.0000000100",
                "change_rate": "-0.02086"
            }
        },
        {
            "amount": "30438.1731260001",
            "open": "0.0000481500",
            "close": "0.0000479400",
            "low": "0.0000478300",
            "high": "0.0000482400",
            "block_height": 94352749,
            "timestamp": 1611802800,
            "indicator": {
                "change": "-0.0000002100",
                "change_rate": "-0.43614"
            }
        },
        {
            "amount": "11510.7676104221",
            "open": "0.0000483900",
            "close": "0.0000481500",
            "low": "0.0000480700",
            "high": "0.0000483900",
            "block_height": 94345555,
            "timestamp": 1611799200,
            "indicator": {
                "change": "-0.0000002400",
                "change_rate": "-0.49597"
            }
        },
        {
            "amount": "62396.3848495016",
            "open": "0.0000478300",
            "close": "0.0000483900",
            "low": "0.0000478300",
            "high": "0.0000484600",
            "block_height": 94338360,
            "timestamp": 1611795600,
            "indicator": {
                "change": "0.0000005600",
                "change_rate": "1.17081"
            }
        },
        {
            "amount": "29632.6091818503",
            "open": "0.0000478700",
            "close": "0.0000478300",
            "low": "0.0000478200",
            "high": "0.0000483500",
            "block_height": 94331160,
            "timestamp": 1611792000,
            "indicator": {
                "change": "-0.0000000400",
                "change_rate": "-0.08356"
            }
        },
        {
            "amount": "37243.7229185097",
            "open": "0.0000478200",
            "close": "0.0000478700",
            "low": "0.0000477900",
            "high": "0.0000480000",
            "block_height": 94323962,
            "timestamp": 1611788400,
            "indicator": {
                "change": "0.0000000500",
                "change_rate": "0.10456"
            }
        },
        {
            "amount": "132452.6558909063",
            "open": "0.0000478600",
            "close": "0.0000478200",
            "low": "0.0000472000",
            "high": "0.0000480800",
            "block_height": 94316765,
            "timestamp": 1611784800,
            "indicator": {
                "change": "-0.0000000400",
                "change_rate": "-0.08358"
            }
        },
        {
            "amount": "76665.7064058792",
            "open": "0.0000476500",
            "close": "0.0000478600",
            "low": "0.0000476500",
            "high": "0.0000480300",
            "block_height": 94309565,
            "timestamp": 1611781200,
            "indicator": {
                "change": "0.0000002100",
                "change_rate": "0.44071"
            }
        },
        {
            "amount": "66600.2123452163",
            "open": "0.0000475200",
            "close": "0.0000476500",
            "low": "0.0000470500",
            "high": "0.0000477800",
            "block_height": 94302366,
            "timestamp": 1611777600,
            "indicator": {
                "change": "0.0000001300",
                "change_rate": "0.27357"
            }
        }
    ]
}

# 获取市场深度

获取市场指定交易对的深度

# Request

GET /v3/market/depth

# Params

名称 必选 类型 描述
symbol String 查询深度的交易对,比如BTM/USDT
depth Int 查询的市场深度,默认是20

# Response

名称 类型 描述
symbol String 交易对
fee_rate String 交易手续费费率
timestamp Int64 服务器时间戳
bids Array 指定深度的买单的价格和数量
asks Array 指定深度的卖单的价格和数量
  • 示例:
# Request
GET https://ex.movapi.com/magnet/v3/market/depth?symbol=BTM/USDT&depth=5

# Response
{
   "code":200,
   "msg":"",
   "data":{
      "symbol":"BTM/USDT",
      "fee_rate":"",
      "asks":[
         [
            "0.0620",
            "213.25"
         ],
         [
            "0.0621",
            "26791.91"
         ],
         [
            "0.0622",
            "3401.84"
         ],
         [
            "0.0623",
            "3875.55"
         ],
         [
            "0.0624",
            "27415.30"
         ]
      ],
      "bids":[
         [
            "0.0612",
            "6488.12"
         ],
         [
            "0.0611",
            "6362.57"
         ],
         [
            "0.0610",
            "1731.20"
         ],
         [
            "0.0608",
            "1818.76"
         ],
         [
            "0.0607",
            "299.48"
         ]
      ],
      "timestamp":1589273712400
   }
}

# 构建订单

发送订单需要先构建交易,构建一笔订单可能产生多笔链上交易。
注意:MOV的挂单价格和数量是以交易对的前者为基准,比如BTC/USDT,是以BTC为基准,如果side为buy,则是用USDT买BTC,如果side为sell,则以BTC换USDT

# Request

POST /v3/merchant/build-place-order-tx

# Params

名称 必选 类型 描述
address String 账户地址

# Body

名称 必选 类型 描述
price String 挂单的价格
amount String 挂单的数量
side String 买单/卖单
symbol String 交易对,比如BTC/USDT
pubkey String 账户公钥

# Response

名称 类型 描述
tx Object 交易的对象
hash String 交易哈希
status_fail Bool 交易是否为一笔手续费耗尽的无效交易
size Int 交易体积
submission_timestamp Int 交易提交的时间戳
memo String Memo信息
inputs Array UTXO输入
├── script String 脚本地址
├── address String 地址
├── asset String 资产ID
├── amount Int 资产数量
└── type String UTXO类型
outputs Array UTXO输出
├── script String 脚本地址
├── address String 地址
├── asset String 资产ID
├── amount Int 资产数量
└── type String UTXO类型
fee Int 交易手续费
balances Array 资产金额变动
├── asset String 资产ID
└── amount Int 资产数量
types Array 交易类型
chain_tx:链式合并UTXO 交易
mov_matched_tx:磁力合约成交交易
mov_place_order:磁力合约挂单交易
mov_cancel_order:磁力合约取消挂单交易
raw_transaction String 待签名的交易信息
signing_instructions Array 交易需要签名的信息
├── derivation_path Array 派生路径
├── sign_data Array 签名数据
└── pubkey String 公钥
  • 示例:
# Request
POST https://ex.movapi.com/magnet/v3/merchant/build-place-order-tx?address=vp1qzpm9pqf3phngkv9qnv73tgtr2mzdnxpdswphm3

# Body
{
    "price": "0.02033848",
    "amount": "3",
    "symbol": "BTM/USDT",
    "side": "buy",
    "pubkey":"00140e5b5f38718b477c2d08365de85a5db384767e72"
}

# Response
{
   "code":200,
   "msg":"",
   "data":[
      {
         "tx":{
            "hash":"22e11e644272a370c6ce1797c0d707a00bf7a7d5478519545a8a85bd2de53640",
            "status_fail":False,
            "size":338,
            "submission_timestamp":0,
            "memo":"",
            "inputs":[
               {
                  "script":"0014ba0e092db4cc577fe774d153b59fe7e634623553",
                  "address":"vp1qhg8qjtd5e3thlem569fmt8l8uc6xyd2nmsscks",
                  "asset":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
                  "amount":27000000,
                  "type":"spend"
               }
            ],
            "outputs":[
               {
                  "utxo_id":"2843646cb703ba22c80bd0b362b5c09ca64891c666f2086b13844c889fa55f3d",
                  "script":"0020184e1cc4ee4845023888810a79eed7a42c02c544cf2c61ceac05e176d575bd46515a160014ba0e092db4cc577fe774d153b59fe7e63462355320083b80e0259d963abbcd43d0195dfde3c03e50c6fb5e2ee13ff0429de091a2e2",
                  "address":"smart contract",
                  "asset":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
                  "amount":1000000,
                  "type":"control"
               },
               {
                  "utxo_id":"3d1e8964a1ca1b86d66e0454b819a2e7b73c63e9c56740899d8478833613d94a",
                  "script":"0014ba0e092db4cc577fe774d153b59fe7e634623553",
                  "address":"vp1qhg8qjtd5e3thlem569fmt8l8uc6xyd2nmsscks",
                  "asset":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
                  "amount":26000000,
                  "type":"control"
               }
            ],
            "fee":0,
            "balances":[
               {
                  "asset":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
                  "amount":"-1000000"
               }
            ],
            "types":[
               "mov_place_order"
            ]
         },
         "raw_transaction":"07010001015f015defdefb2fe997bda02f87f23721a6a2c4ab7650c959c95fa4cd443549095f55c4ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0f9ef0c0101160014ba0e092db4cc577fe774d153b59fe7e634623553220120083b80e0259d963abbcd43d0195dfde3c03e50c6fb5e2ee13ff0429de091a2e202018401008101ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0843d015c0020184e1cc4ee4845023888810a79eed7a42c02c544cf2c61ceac05e176d575bd46515a160014ba0e092db4cc577fe774d153b59fe7e63462355320083b80e0259d963abbcd43d0195dfde3c03e50c6fb5e2ee13ff0429de091a2e200013e003cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80f5b20c01160014ba0e092db4cc577fe774d153b59fe7e63462355300",
         "signing_instructions":[
            {
               "derivation_path":[
                  "2c000000",
                  "99000000",
                  "01000000",
                  "00000000",
                  "01000000"
               ],
               "sign_data":[
                  "69f89ff6071a885a86634f8c969d67101ad5f8ef24a8e0f5712cf7415341e50d"
               ],
               "pubkey":"083b80e0259d963abbcd43d0195dfde3c03e50c6fb5e2ee13ff0429de091a2e2"
            }
         ],
         "fee":0
      }
   ]
}

# 提交订单

# Request

POST /v3/merchant/submit-place-order-tx

# Params

名称 必选 类型 描述
address String 账户地址

# Body

名称 必选 类型 描述
raw_transaction String 上一个build-place-order-tx接口返回的数据
signatures Array 签名数据

# Response

名称 类型 描述
transaction_hash String 交易哈希
order Object 订单
symbol String 交易对,比如BTC/USDT
side String buy为买单,sell为卖单
order_id Int 订单ID
open_price String 下单价格
deal_price String 下单价格
amount String 下单数量
filled_amount String 成交数量
fee_amount String 手续费数量
status String 表示订单状态
open:未成交
partial:部分成交
filled:完全成交
cancelled:已经取消
submitted:挂单但为上链
cancelling:取消但未上链
type String 订单类型
order_txs Array 订单包含的交易
├── hash 订单哈希
├── type String 订单类型
chain_tx:链式合并UTXO 交易
mov_matched_tx:磁力合约成交交易
mov_place_order:磁力合约挂单交易
mov_cancel_order:磁力合约取消挂单交易
mov_cancel_order:闪兑交易
└── timestamp Int64 订单下到数据库的时间戳
order_timestamp Int64 订单下单时间
update_timestamp Int64 订单更新时间
  • 示例:
# Request
POST https://ex.movapi.com/magnet/v3/merchant/submit-place-order-tx?address=vp1qzpm9pqf3phngkv9qnv73tgtr2mzdnxpdswphm3

# Body
{
    "raw_transaction": "070100010160015ef90fd46c6d84fd9ab5820ebd4176cdc3cac71f561f8525c9198a9dc05584b9ded50a426bdaaf1458d161aba4d8c3ebdd095eac7e1bbeb4a0252a3737ccf2d4928094ebdc030201160014aaaa55bb767bfe0190f69ef641555f7e6f8d7cee22012040c7dec75fbfeec1de6f63d3f46a1298509609b3a88f8e63f52bbaf3a7c5de9002018f01008c01d50a426bdaaf1458d161aba4d8c3ebdd095eac7e1bbeb4a0252a3737ccf2d4920301690020a0889e1080999e59ed552865a1d3ee677202796222141ccc3552041708aad76c07a796525ff92e020600480f625e0b160014aaaa55bb767bfe0190f69ef641555f7e6f8d7cee2040c7dec75fbfeec1de6f63d3f46a1298509609b3a88f8e63f52bbaf3a7c5de9000013f003dd50a426bdaaf1458d161aba4d8c3ebdd095eac7e1bbeb4a0252a3737ccf2d492fd93ebdc0301160014aaaa55bb767bfe0190f69ef641555f7e6f8d7cee00",
    "signatures": [
        [
            "d4f5a8e88fd49d46ff1298abcb546405e98949e5c8905cd80359976e7f998216d9c6fbf86e1a44ccdc04dbd8fc026d3b3ceb3b61e290fb9403ce20082a6fed06"
        ]
    ],
}

# Response
{
   "code":200,
   "msg":"",
   "data":{
      "transaction_hash":"22e11e644272a370c6ce1797c0d707a00bf7a7d5478519545a8a85bd2de53640",
      "order":{
         "symbol":"BTM/USDT",
         "side":"sell",
         "order_id":615833,
         "open_price":"10.00000000000000000000",
         "deal_price":"0",
         "amount":"0.01",
         "filled_amount":"0.00",
         "fee_amount":"0.000000",
         "status":"submitted",
         "type":"mov",
         "client_id":"123",
         "order_txs":[
            {
               "hash":"22e11e644272a370c6ce1797c0d707a00bf7a7d5478519545a8a85bd2de53640",
               "type":"mov_place_order",
               "timestamp":1589274014
            }
         ],
         "order_timestamp":1589274014,
         "update_timestamp":1589274014
      }
   }
}

# 构建取消订单

# Request

POST /v3/merchant/build-cancel-order-tx

# Body

名称 必选 类型 描述
order_id Int 待取消的订单id

# Response

名称 类型 描述
tx Object 交易的对象
hash String 交易哈希
status Bool 交易是否为一笔手续费耗尽的无效交易
size Int 交易体积
submission_timestamp Int 交易提交的时间戳
memo String Memo信息
inputs Array UTXO输入
├── script String 脚本地址
├── address String 地址
├── asset Object 资产对象
├── asset_id String 资产id
├── symbol String 资产名称
├── amount Int 资产数量
└── type String UTXO类型
outputs Array UTXO输出
├── script String 脚本地址
├── address String 地址
├── asset Object 资产对象
├── asset_id String 资产id
├── symbol String 资产名称
├── amount Int 资产数量
└── type String UTXO类型
fee Int 交易手续费
balances Array 资产金额变动
types Array 交易类型
raw_transaction String 待签名的交易信息
signing_instructions Array 交易需要签名的信息
├── derivation_path Array 派生路径
└── sign_data Array 签名数据
  • 示例:
# Request
POST https://ex.movapi.com/magnet/v3/merchant/build-cancel-order-tx

# Body
{
    "order_id": 1
}

# Response
{
   "code":200,
   "msg":"",
   "data":{
      "tx":{
         "hash":"10ad8602b5a8f71459394ed076a9f520a7fa54cbf35233febf0f5171fdc14aa2",
         "status":True,
         "size":239,
         "submission_timestamp":0,
         "memo":"",
         "inputs":[
            {
               "script":"0020184e1cc4ee4845023888810a79eed7a42c02c544cf2c61ceac05e176d575bd46515a160014ba0e092db4cc577fe774d153b59fe7e63462355320083b80e0259d963abbcd43d0195dfde3c03e50c6fb5e2ee13ff0429de091a2e2",
               "address":"smart contract",
               "asset":{
                  "asset_id":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
                  "symbol":"BTM"
               },
               "amount":"0.01",
               "type":"spend"
            }
         ],
         "outputs":[
            {
               "utxo_id":"964e1ba5f502ab6e4303887f61df76f84793811c19c657c0731f2d643a16379c",
               "script":"0014ba0e092db4cc577fe774d153b59fe7e634623553",
               "address":"vp1qhg8qjtd5e3thlem569fmt8l8uc6xyd2nmsscks",
               "asset":{
                  "asset_id":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
                  "symbol":"BTM"
               },
               "amount":"0.01",
               "type":"control"
            }
         ],
         "fee":"0",
         "balances":[
            {
               "asset":{
                  "asset_id":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
                  "symbol":"BTM"
               },
               "amount":"0.01"
            }
         ],
         "types":[
            "ordinary"
         ]
      },
      "raw_transaction":"0701000101a50101a2019830463b7e4019a65788edb1cd946fd3de127eda867f04beac81d3a4a05a8ae3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0843d00015c0020184e1cc4ee4845023888810a79eed7a42c02c544cf2c61ceac05e176d575bd46515a160014ba0e092db4cc577fe774d153b59fe7e63462355320083b80e0259d963abbcd43d0195dfde3c03e50c6fb5e2ee13ff0429de091a2e2010001013d003bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0843d01160014ba0e092db4cc577fe774d153b59fe7e63462355300",
      "signing_instructions":[
         {
            "derivation_path":[
               "2c000000",
               "99000000",
               "01000000",
               "00000000",
               "01000000"
            ],
            "sign_data":[
               "d95058d693b7968bb97c22147ac29029267ccf9fd7c0ccf5b35781ac4760db28"
            ]
         }
      ]
   }
}

# 提交取消订单

# Request

POST /v3/merchant/submit-cancel-order-tx

# Body

名称 必选 类型 描述
raw_transaction String 上一个cancel-place-order-tx接口返回的数据
signatures Array 签名数据

# Response

名称 类型 描述
transaction_hash String 交易哈希
  • 示例:
# Request

POST https://ex.movapi.com/magnet/v3/merchant/submit-cancel-order-tx

{
  'raw_transaction': '070100050160015ea36a32db05dde6387a1af256e59dbf549e3388b6e5fe76aec90ad3bc5375673b4483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f570383fa9ad104010116001449f9cb425163e24791f39e9189a7ef3126a0fe0a22012066fb66a351b651ad70de9bdb1cafa3c95c10fc28d19d627cc3c3e34c090eb4350160015e9e6916db156b3bdeb1053080841967cbfc6ef86ac933667fbb04ca5427b551604483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f5703e1d4a8ce04010116001449f9cb425163e24791f39e9189a7ef3126a0fe0a22012066fb66a351b651ad70de9bdb1cafa3c95c10fc28d19d627cc3c3e34c090eb4350160015e34fb4bfeb7e6cd6a3ab6d59139783748cec60408f91c7ce296a39d01c5bb29974483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f5703a9b6b6c004010116001449f9cb425163e24791f39e9189a7ef3126a0fe0a22012066fb66a351b651ad70de9bdb1cafa3c95c10fc28d19d627cc3c3e34c090eb4350160015e4fdb42acd18b165e1622ba3249f6c45cb06b66d2082545b8902c6000f2c02f2a4483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f5703cdeca9bf04010116001449f9cb425163e24791f39e9189a7ef3126a0fe0a22012066fb66a351b651ad70de9bdb1cafa3c95c10fc28d19d627cc3c3e34c090eb4350160015e2255d1f1b3967ce291c42f020d302b4a3e2b1ad11b45cabe2e5da8ca94fdb8c64483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f5703c0f79cbe04010116001449f9cb425163e24791f39e9189a7ef3126a0fe0a22012066fb66a351b651ad70de9bdb1cafa3c95c10fc28d19d627cc3c3e34c090eb435020188010085014483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f570380badadc16015e0020d50a426bdaaf1458d161aba4d8c3ebdd095eac7e1bbeb4a0252a3737ccf2d4925102d41716001449f9cb425163e24791f39e9189a7ef3126a0fe0a2066fb66a351b651ad70de9bdb1cafa3c95c10fc28d19d627cc3c3e34c090eb43500013d003b4483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f57039aaf660116001449f9cb425163e24791f39e9189a7ef3126a0fe0a00',
  'signatures': [
    ['718a54649e43dcccf3b4e855fd9bf4ea23d5bd05517540eea09e2eb96ebc5b59dcfa4741b3280ec8aae003b276482cb51e2b967087d7821cae5e2d469c245100'],
    ['57032992d83e998325a385d247670175d8fc031e117c54d7b14fb887f276947907321d4cef2a592fb25737092353b96252a9dcb943ab4588a9fde42df32a470e'],
    ['0f521a9fc08b32053cac86e845fae332928d6588aa1039a72c41fe1d9f5418d6a333be2754e83405eed4303ebcb2ddc908792fb3761cd12dcd3154354f64670c'],
    ['8a30dc5d085f701466f3918a88eb5322835860956e33cd8fbb1c3e1afffb8695fe0bc2eac83cd43f365422cdf9e8358af611b3b031b99eb233c984c93fc0c40d'],
    ['7e2d41ddd5b2d15b32375c46cb6807dba4d3d6e6cedb36fef04d4e11a971c1e4495cb0d633738d6113cacc7adb004ab1703f76954d2c952408a509d78d439e0a']
  ],
}

# Response
{
  "code": 200,
  "msg": "",
  "data": {
    "transaction_hash": "9c4d0e3da8b473695a59891329bc2aa92c37d889e4f1c162b8403b691b25c2db"
  }
}

# 查询订单

通过指定的参数查询满足条件的订单

# Request

POST /v3/merchant/list-orders

# Params

名称 必选 类型 描述
address String 账户地址
start Array 查询交易的开始序号,默认为0
limit Int 查询交易的数量,默认为10

# Body

名称 必选 类型 描述
symbol String 交易对
side String 买或者卖,不填表示所有订单
order_type String 订单类型
mov:磁力合约交易
swap:闪兑交易
filter String 过滤器,具体选项如下:
open:未成交的订单
partial:部分成交的订单
filled:全部成交的订单
cancelled:已撤销的订单
cancelling:正在撤销的订单
submitted:已提交,但还未上链,无法撤销的订单

# Response

名称 类型 描述
symbol String 交易对
side String 买或者卖
order_id Int 订单ID
amount String 总金额
filled_amount String 成交金额
open_price String 挂单的价格
deal_price String 成交的价格
status String 订单状态:
open:未成交的订单
partial:部分成交的订单
filled:全部成交的订单
cancelled:已撤销的订单
cancelling:正在撤销的订单
submitted:已提交,但还未上链,无法撤销的订单
client_id String 附加的订单信息
order_txs Array 订单哈希数组
├── hash String 哈希
├── type String 订单类型:
chain_tx:链式合并 UTXO 交易
mov_matched_tx:磁力合约成交交易
mov_place_order:磁力合约挂单交易
mov_cancel_order:磁力合约取消挂单交易
mov_cancel_order:闪兑交易
└── timestamp Int64 订单到数据库时间
order_timestamp Int64 订单创建的时间戳
update_timestamp Int64 订单更新的时间戳
  • 示例:
# Request
POST https://ex.movapi.com/magnet/v3/merchant/list-orders?address=vp1qzpm9pqf3phngkv9qnv73tgtr2mzdnxpdswphm3&start=10&limit=10

# Body
{
    "symbol": "ETH/BTC",
    "side": "buy",
    "filter":{
       "states": [
         "open",
         "partial",
         "filled",
         "canceled",
         "cancelling",
         "submitted"
      ],
      "order_type": "mov"
    }
}

# Response
{
   "code":200,
   "msg":"",
   "data":[
      {
         "symbol":"BTM/USDT",
         "side":"sell",
         "order_id":617158,
         "open_price":"10.0000000000",
         "deal_price":"0.0000000000",
         "amount":"0.01",
         "filled_amount":"0.00",
         "fee_amount":"0.000000",
         "status":"open",
         "type":"mov",
         "client_id":"123",
         "order_txs":[
            {
               "hash":"975188691f6e6f561f310bafaabe94b9b9d7355328249939012c9828e51cbfc8",
               "type":"mov_place_order",
               "timestamp":1589278879
            }
         ],
         "order_timestamp":1589278879,
         "update_timestamp":1589278881
      },
      {
         "symbol":"BTM/USDT",
         "side":"sell",
         "order_id":590412,
         "open_price":"10.0000000000",
         "deal_price":"0.0000000000",
         "amount":"1.00",
         "filled_amount":"0.00",
         "fee_amount":"0.000000",
         "status":"open",
         "type":"mov",
         "client_id":"123",
         "order_txs":[
            {
               "hash":"0d53d981f3c2c0721ead4ae7fea22f701b7e5f34b73ed7fb5b1ef8429ee39306",
               "type":"mov_place_order",
               "timestamp":1589182761
            }
         ],
         "order_timestamp":1589182761,
         "update_timestamp":1589182762
      }
   ],
   "pagination":{
      "start":0,
      "limit":1000,
      "_links":{

      }
   }
}
上次更新: 1/28/2021, 5:25:01 PM