# MOV Quant Delegation API

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

# Create Wallet

create quant-delegation wallet. Quant team can place/cancel order, but cannot withdraw (except to a white list address); funder can withdraw money.

# Request

POST /v1/account/create-wallet

# Body

  • String- funder_pubkey:funder's public_key, 64 characters
  • String- quant_pubkey:quant_team's public_key, 64 characters

# Response

  • String- address:generated wallet address
  • String- funder_pubkey:funder's public_key
  • String- quant_pubkey:quant_team's public_key
  • String- attester_pubkey:attester's public_key

# Example

# Request
POST https://ex.movapi.com/delegation/v1/account/create-wallet

{
  "funder_pubkey" : "643e230ca750787ea5730377c6afec949fd0d74c3924d5ce6b736b0db58d5760",
  "quant_pubkey" : "eaefdca818d946f75b85507c29535723395dd8f66e5cf74318ab520bfbe3573f"
}

# Response
{
  "code":200,
  "msg":"",
  "data":{
    "address":"vp1qmf6pdwldq9lcucymjqk5rr7xas08f5um7kc3l5hzrsecf20nwecsg5w9vx",
    "funder_pubkey":"643e230ca750787ea5730377c6afec949fd0d74c3924d5ce6b736b0db58d5760",
    "quant_pubkey":"eaefdca818d946f75b85507c29535723395dd8f66e5cf74318ab520bfbe3573f",
    "attester_pubkey":"1c1036de88f2ac612a402e502bf06cab0c917c299954d12f86b9c2ab524c2a75",
  }
}

# Place Order

The quant team should build-place-order-tx via mov spot api and then submit to delegation server, the delegation server will validate the tx, perform necessary signing and then further submit to blockchain.

# Request

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

# Params

  • String- address:delegation wallet address

# Body

  • String- raw_transaction:Raw Tx
  • String- client_id: Append Order Info
  • Array- signing_instructions:instructions on signing -Object- signing_instruction:
    • Array- sign_data: data to sign
  • Array- signatures:signing results according to "signing_instructions"

# Response

  • String- tx_hash:tx hash
  • Object- order:order information
    • String- symbol:trading pair
    • String- side:
      • String - buy:buy order
      • String - sell:sell order
    • Int - order_id:order ID
    • String- open_price:order open price
    • String- deal_price:order deal price
    • String- amount:order amount
    • String- filled_amount:成交数量
    • String- fee_amount:fee
    • String- status:order status
      • String- open:not traded
      • String- partial:parttraded
      • String- filled:all traded
      • String- cancelled:already canceled
      • String- submitted:order subbmited
      • String- cancelling:order canceled
    • String- type:order type
    • Array - order_txs:订单包含的交易
      • Object -
        • String- hash:订单哈希
        • String- type:订单类型
          • String- chain_tx:链式合并 UTXO 交易
          • String- mov_matched_tx:磁力合约成交交易
          • String- mov_place_order:磁力合约挂单交易
          • String- mov_cancel_order:磁力合约取消挂单交易
          • String- mov_cancel_order:闪兑交易
        • Int64- type:订单下到数据库的时间戳
    • Int64 - order_timestamp:订单下单时间
    • Int64 - update_timestamp:订单更新时间

# Example

# Request
POST https://ex.movapi.com/delegation/v1/merchant/submit-place-order-tx?address=vp1qzpm9pqf3phngkv9qnv73tgtr2mzdnxpdswphm3

{
  "raw_transaction":"07010001016c016a3d2c56dbd27be8d0fde4f0e76d74b81c9c8d42da32d7dd4feb3fcb4847596f22ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8090dfc04a0001220020da7416bbed017f8e609b902d418fc6ec1e74d39bf5b11fd2e21c3384a9f37671010002019501009201ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8084af5f016c0020184e1cc4ee4845023888810a79eed7a42c02c544cf2c61ceac05e176d575bd46018b03400d03220020da7416bbed017f8e609b902d418fc6ec1e74d39bf5b11fd2e21c3384a9f37671201c1036de88f2ac612a402e502bf06cab0c917c299954d12f86b9c2ab524c2a7500014b0049ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808cb0e14901220020da7416bbed017f8e609b902d418fc6ec1e74d39bf5b11fd2e21c3384a9f3767100",
  "signing_instructions":[
    {
      "derivation_path":null,
      "sign_data":[
        "857e097a54c1fb9833d932da2d992e5f6a0be58f4e4278693f1354fdf0196a1b"
      ]
    }
  ],
  "signatures":[
    [
      "43f4fd879563d4b1e9a7a8109b01638af882662cb2614c544a4ffcd896537320fcbcfb12c36a7cbb2e81833f8efd7d1dd639c883b0bb3051b93a7acba152460d"
    ]
  ],
  "fee":0
}

# Response
{
  "code":200,
  "msg":"",
  "result":{
      "tx_hash":"27dad6d060ebd2171b2af018ef61bce4b46b9f209d4c00d2a56f664b1ecdf202",
      "order":{
        "symbol":"BTM/CTM",
        "side":"sell",
        "order_id":1,
        "open_price":"0.00000933000000000000",
        "deal_price":"0",
        "amount":"1.01",
        "filled_amount":"0.00",
        "fee_amount":"0.00000000",
        "status":"submitted",
        "type":"mov",
        "client_id":"123",
        "order_txs":[
          {
            "hash":"27dad6d060ebd2171b2af018ef61bce4b46b9f209d4c00d2a56f664b1ecdf202",
            "type":"mov_place_order",
            "timestamp":1575367734
          }
        ],
        "order_timestamp":1575367734,
        "update_timestamp":1575367734
      }
    }
}

# Cancel Order

量化方通过 ByCoin 服务器构建取消挂单交易后签名,然后提交给 交易验证委托方 服务器进行验证并签名,再由 交易验证委托方 提交给 ByCoin 服务器上链。

# Request

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

# Params

  • String- address:delegation wallet address

# Body

  • String- raw_transaction:Raw Tx
  • String- client_id: Append Order Info
  • Array- signing_instructions:instructions on signing -Object- signing_instruction:
    • Array- sign_data: data to sign
  • Array- signatures:signing results according to "signing_instructions"

# Response

  • String- tx_hash: transaction hash

# Example

# Request
POST https://ex.movapi.com/delegation/v1/merchant/submit-cancel-order-tx?address=vp1qzpm9pqf3phngkv9qnv73tgtr2mzdnxpdswphm3

{
  "raw_transaction":"0701000101b60101b3018285c85ba91d76b16456f7a0dcf5519b075bb57b0269965ed099098e7e283bc4ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8084af5f00016c0020184e1cc4ee4845023888810a79eed7a42c02c544cf2c61ceac05e176d575bd46018b03400d03220020da7416bbed017f8e609b902d418fc6ec1e74d39bf5b11fd2e21c3384a9f37671201c1036de88f2ac612a402e502bf06cab0c917c299954d12f86b9c2ab524c2a75010001014a0048ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8084af5f01220020da7416bbed017f8e609b902d418fc6ec1e74d39bf5b11fd2e21c3384a9f3767100",
  "signing_instructions":[
    {
      "derivation_path":null,
      "sign_data":[
        "bb8a0868fd07312932d9bfa5e3e6e460debca243e2131ea53807adb092ce86a3"
      ]
    }
  ],
  "signatures":[
    [
      "d8a7e0397ccefb2d1befcb42fff7b7c922a63b791a9026fbef15bee1942512fdf74b02632e96cf4653227c32ae4621c12da488e728606a55edd71a917f32070c"
    ]
  ]
}

# Response
{
  "code":200,
  "msg":"",
  "result":{
    {
      "tx_hash":"9305e357b35402c5acee22eff803ad890cea39732ce15b284cc305b443c98d82"
    }
  }
}

# Withdraw

资金拥有方通过 ByCoin 服务器构建转账交易后签名,然后提交给 交易验证委托方 服务器进行验证并签名,再由 交易验证委托方 提交给 ByCoin 服务器上链。

# Request

POST /v1/merchant/submit-withdrawal-tx

# Params

  • String- address:delegation wallet address

# Body

  • String- raw_transaction:Raw Tx
  • String- client_id: Append Order Info
  • Array- signing_instructions:instructions on signing -Object- signing_instruction:
    • Array- sign_data: data to sign
  • Array- signatures:signing results according to "signing_instructions"

# Response

  • String- tx_hash: transaction hash

# Example

# Request
POST https://ex.movapi.com/delegation/v1/merchant/submit-withdrawal-tx?address=vp1qzpm9pqf3phngkv9qnv73tgtr2mzdnxpdswphm3


{
  "raw_transaction": "07010001016c016a4c0323f530e9b295d50b5d7af6735f7a94b86b584e0c371dcdcf43b04aaa2459ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80c8afa025010122002013310a9d570625ff8195ec3547a3f4fe47e9deaef85679f38469b1225f761276010002013f003dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80fe98c60b011600145ef6854ecadd923902432f598ae60a6715c1d19a00014b0049ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80ca96da190122002013310a9d570625ff8195ec3547a3f4fe47e9deaef85679f38469b1225f76127600",
    "signing_instructions": [
        {
            "derivation_path": null,
            "sign_data": [
                "b2ad5b5b0ae89d33ffcb63b2566d9062385b23040291cc42852d0463aa05ba13"
            ]
        }
    ],
    "signatures":[["a718e93b8fd490638f37b5f43e3dcf893789c48afb9be1ae24eef10b887e3d2b4e82e55a3954db2129440f5d64cb06ed3276caa44f2093343ccf09563ce2a900"]]
}

// response
{
  "code":200,
  "msg":"",
  "result":{
    {
      "tx_hash":"9305e357b35402c5acee22eff803ad890cea39732ce15b284cc305b443c98d82"
    }
  }
}

# Add white list address

一般情况下,量化方只允许交易,而不允许转账(提现)。资金拥有方通过添加白名单地址允许量化方进行转账。

# Request

POST /v1/account/add-white-list-address

# Params

  • String- address:量化委托多签钱包地址
  • Int64- timestamp:Unix 时间戳 (秒)
  • String- signature:用 资金拥有方 的 私钥 对以下字符串进行的签名
    • 'POST\n/v1/account/del-white-list-address\naddress=' + 量化委托多签钱包地址 + '&timestamp=' + 上面所用的时间戳 + '\n{"address" : "' + 白名单地址 + '"}'

# Body

  • String- address:白名单地址

# Response

  • String- code: return code
  • String- msg: return msg

# Example

// url
"https://ex.movapi.com/delegation/v1/add-white-list-address?address=vp1qmvsxx3w4cjfv8t7xqnsp4xvjw5j220km77qsnsnpqxqlaz99hzksyfsysf&timestamp=1589773444&signature=684c85a95aad096ce5feb9fb5e2d2ea52187e35e901f46efd2b52bac82351d320483bb683dbf03e0f3d76b18d7aad9031d13c6c23fbcee5360ab2beef1865f0f"

// request 
{
  "address":"vp1qlc9jhf00w9mqsdczu2m8ehehhp3wgd6lfvyluc"
}

// response
{
  "code":200,
  "msg":""
}

# Delete white list address

一般情况下,量化方只允许交易,而不允许转账(提现)。资金拥有方通过移除白名单地址去除量化方进行转账的权限。

# Request

POST /v1/account/del-white-list-address

# Params

  • String- address:量化委托多签钱包地址
  • Int64- timestamp:Unix 时间戳 (秒)
  • String- signature:用 资金拥有方 的 私钥 对以下字符串进行的签名
    • 'POST\n/v1/account/del-white-list-address\naddress=' + 量化委托多签钱包地址 + '&timestamp=' + 上面所用的时间戳 + '\n{"address" : "' + 白名单地址 + '"}'

# Body

  • String- address:白名单地址

# Response

  • String- code: return code
  • String- msg: return msg

# Example

# Request
https://ex.movapi.com/delegation/v1/del-white-list-address?address=vp1qmvsxx3w4cjfv8t7xqnsp4xvjw5j220km77qsnsnpqxqlaz99hzksyfsysf&timestamp=1589773444&signature=684c85a95aad096ce5feb9fb5e2d2ea52187e35e901f46efd2b52bac82351d320483bb683dbf03e0f3d76b18d7aad9031d13c6c23fbcee5360ab2beef1865f0f

{
  "address":"vp1qlc9jhf00w9mqsdczu2m8ehehhp3wgd6lfvyluc"
}

# Response
{
  "code":200,
  "msg":""
}
Last Updated: 5/28/2020, 3:25:52 PM