Operator API

Websockets

sync/wallets/

Inputs

    subscribe to multi-wallet events:
    1
    {
    2
    "action": "subscribe",
    3
    "wallets": ["<wallet address without 0x prefix>"]
    4
    }
    Copied!

Outputs

    on subscribe action:
    1
    {
    2
    "status": "success",
    3
    "message": "subscription group updated successfully"
    4
    }
    Copied!
    on incoming transfer:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "incoming_transfer",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": "<tx object>"
    7
    }
    8
    }
    Copied!
    on incoming receipt:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "incoming_receipt",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": "<tx object>"
    7
    }
    8
    }
    Copied!
    on incoming transfer confirmation:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "incoming_confirmation",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": "<tx object>"
    7
    }
    8
    }
    Copied!
    on transfer timeout:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "timeout_transfer",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": "<tx object>"
    7
    }
    8
    }
    Copied!
    on swap match:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "matched_swap",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": "<tx object>"
    7
    }
    8
    }
    Copied!
    on swap finalization:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "finalized_swap",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": "<tx object>"
    7
    }
    8
    }
    Copied!
    on wallet admission:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "registered_wallet",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": { "address": "<wallet address>", "token": "<token address>" }
    7
    }
    8
    }
    Copied!
    on deposit confirmation:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "confirmed_deposit",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": {
    7
    "txid": "<ethereum tx id>",
    8
    "block": "<ethereum block number>",
    9
    "eon_number": "<commit-chain eon number>",
    10
    "amount": "<deposit amount>",
    11
    "time": "<deposit time>"
    12
    }
    13
    }
    14
    }
    Copied!
    on withdrawal request:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "requested_withdrawal",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": {
    7
    "txid": "<ethereum tx id>",
    8
    "block": "<ethereum block number>",
    9
    "eon_number": "<commit-chain eon number>",
    10
    "amount": "<withdrawal request amount>",
    11
    "time": "<withdrawal request time>",
    12
    "slashed": "<whether withdrawal request was slashed or not, this event will usually return slashed == false>"
    13
    }
    14
    }
    15
    }
    Copied!
    on withdrawal confirmation:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "confirmed_withdrawal",
    5
    "topic": "<wallet address without 0x prefix>",
    6
    "data": {
    7
    "txid": "<ethereum tx id>",
    8
    "block": "<ethereum block number>",
    9
    "eon_number": "<commit-chain eon number>",
    10
    "amount": "<withdrawal request amount>",
    11
    "time": "<withdrawal request time>",
    12
    "request": "<withdrawal request object>",
    13
    }
    14
    }
    15
    }
    Copied!

sync/swaps/

Inputs

    subscribe to token-pair events:
    1
    {
    2
    "action": "subscribe",
    3
    "swaps": ["<sell token address without 0x prefix><buy token address withour 0x prefix>"]
    4
    }
    Copied!

Outputs

    on subscribe action:
    1
    {
    2
    "status": "success",
    3
    "message": "subscription group updated successfully"
    4
    }
    Copied!
    on incoming swap:
    1
    {
    2
    "status": "notify",
    3
    "message": {
    4
    "type": "incoming_swap",
    5
    "topic": "<sell token address without 0x prefix><buy token address withour 0x prefix>",
    6
    "data": "<tx object>"
    7
    }
    8
    }
    Copied!
Notes to override the subscription list, simply send out another subscribe action message with the new list.

HTTP

Admission

Defines the endpoints and methods for registration.
    Getting registered wallets
    1
    GET admission/?[format=json]
    Copied!
    Registering new wallet
    1
    POST admission/
    2
    body: {
    3
    "authorization": "<commit-chain_authorisation>",
    4
    "address": "<wallet address without 0x prefix>",
    5
    "token": "<contract address without 0x prefix>"
    6
    }
    Copied!

Auditor

Defines the endpoints for data retrieval by clients.
    Commit-chain status overview
    1
    GET audit/?[format=json]
    Copied!
    List of commit-chain tokens
    1
    GET audit/tokens/?[format=json]
    Copied!
    Wallet synchronization data
    1
    GET audit/<token>/<wallet>/?[format=json]
    Copied!
    Wallet registration data
    1
    GET audit/<token>/<wallet>/whois?[format=json]
    Copied!
    List buy and sell order for a token pair (left token, right token)
    1
    GET audit/swaps/<left token address>/<right token address>?[format=json]
    Copied!

Transactor

Defines the endpoints for making transfers.
    Transfer submission
    1
    PUT transfer/
    2
    body: {
    3
    "wallet": {
    4
    "address": "<wallet address without 0x prefix>",
    5
    "token": "<contract address without 0x prefix>"
    6
    },
    7
    "amount": <decimal>,
    8
    "round": <round the transfer is performed>,
    9
    "recipient": "<recipient address without 0x prefix>",
    10
    "nonce": <nonce of the transfer | decimal>,
    11
    "wallet_signature": {
    12
    "value": "wallet_signature"
    13
    },
    14
    "wallet_balance_signature": {
    15
    "value": "wallet_balance_signature"
    16
    },
    17
    18
    ["id": <transfer id>,]
    19
    ["time": "<datetime>",]
    20
    ["sender_aggregate": {
    21
    "wallet_signature": "<wallet_signature>",
    22
    "hub_signature": "<hub_signature>",
    23
    "updated_spendings": "<updated_spendings>",
    24
    "updated_gains": "<updated_gains>",
    25
    "tx_set_hash": "<tx_set_hash>",
    26
    "tx_set_proof": [<tx_proof>, <tx_proof>, ...],
    27
    "tx_set_index": <decimal>
    28
    },]
    29
    ["recipient_aggregate": {
    30
    "wallet_signature": "<wallet_signature>",
    31
    "hub_signature": "<hub_signature>",
    32
    "updated_spendings": "<updated_spendings>",
    33
    "updated_gains": "<updated_gains>",
    34
    "tx_set_hash": "<tx_set_hash>",
    35
    "tx_set_proof": [<tx_proof>, <tx_proof>, ...],
    36
    "tx_set_index": <decimal>
    37
    },]
    38
    ["processed": <has the transfer been processed>,]
    39
    ["complete": <is the transfer complete>,]
    40
    ["final_receipt_hashes": "<final_receipt_hashes>",]
    41
    ["final_receipt_index": "<integer>",]
    42
    }
    Copied!
    Receipt
    1
    GET transfer/<id>/[?format=json]
    Copied!
    Receipt submission
    1
    POST transfer/<id>
    2
    body: {
    3
    "wallet_signature": {
    4
    "value": "wallet_signature"
    5
    },
    6
    7
    ["wallet": {
    8
    "address": "<wallet address without 0x prefix>",
    9
    "token": "<contract address without 0x prefix>"
    10
    },]
    11
    ["recipient": "<recipient address without 0x prefix>",]
    12
    ["time": "<datetime>",]
    13
    ["sender_aggregate": {
    14
    "wallet_signature": "<wallet_signature>",
    15
    "hub_signature": "<hub_signature>",
    16
    "updated_spendings": "<updated_spendings>",
    17
    "updated_gains": "<updated_gains>",
    18
    "tx_set_hash": "<tx_set_hash>",
    19
    "tx_set_proof": [<tx_proof>, <tx_proof>, ...],
    20
    "tx_set_index": <decimal>
    21
    },]
    22
    ["recipient_aggregate": {
    23
    "wallet_signature": "<wallet_signature>",
    24
    "hub_signature": "<hub_signature>",
    25
    "updated_spendings": "<updated_spendings>",
    26
    "updated_gains": "<updated_gains>",
    27
    "tx_set_hash": "<tx_set_hash>",
    28
    "tx_set_proof": [<tx_proof>, <tx_proof>, ...],
    29
    "tx_set_index": <decimal>
    30
    },]
    31
    ["processed": <has the transfer been processed>,]
    32
    ["complete": <is the transfer complete>,]
    33
    ["amount": <decimal>,]
    34
    ["nonce": <nonce of the transfer | decimal>,]
    35
    }
    Copied!
    Cancel a transfer
    1
    XXX transfer/<id>/cancel
    2
    body: {
    3
    TODO: "to be documented"
    4
    }
    Copied!

Swapper

Defines the endpoints for making swaps, and contains the matching engine.
    Swap submission
    1
    PUT swap/
    2
    body: {
    3
    "wallet": {
    4
    "address": "<wallet address without 0x prefix>",
    5
    "token": "<contract address without 0x prefix>"
    6
    },
    7
    "amount": <decimal>,
    8
    "round": <round the transfer is performed>,
    9
    "recipient": {
    10
    "address": "<wallet address without 0x prefix>",
    11
    "token": "<contract address without 0x prefix>"
    12
    },
    13
    "nonce": <nonce of the transfer | decimal>,
    14
    "debit_signature": {
    15
    "value": "<debit_signature>"
    16
    },
    17
    "debit_balance_signature": {
    18
    "value": "<debit_balance_signature>"
    19
    },
    20
    "credit_signature": {
    21
    "value": "<credit_signature>"
    22
    },
    23
    "fulfillment_signature": {
    24
    "value": "<fulfillment_signature>"
    25
    },
    26
    27
    ["id": <transfer id>,]
    28
    ["time": "<datetime>",]
    29
    ["sender_aggregate": {
    30
    "wallet_signature": "<wallet_signature>",
    31
    "hub_signature": "<hub_signature>",
    32
    "updated_spendings": "<updated_spendings>",
    33
    "updated_gains": "<updated_gains>",
    34
    "tx_set_hash": "<tx_set_hash>",
    35
    "tx_set_proof": [<tx_proof>, <tx_proof>, ...],
    36
    "tx_set_index": <decimal>
    37
    },]
    38
    ["recipient_aggregate": {
    39
    "wallet_signature": "<wallet_signature>",
    40
    "hub_signature": "<hub_signature>",
    41
    "updated_spendings": "<updated_spendings>",
    42
    "updated_gains": "<updated_gains>",
    43
    "tx_set_hash": "<tx_set_hash>",
    44
    "tx_set_proof": [<tx_proof>, <tx_proof>, ...],
    45
    "tx_set_index": <decimal>
    46
    },]
    47
    ["processed": <has the transfer been processed>,]
    48
    ["complete": <is the transfer complete>,]
    49
    ["final_receipt_hashes": "<final_receipt_hashes>",]
    50
    ["final_receipt_index": "<integer>",]
    51
    ["amount_swapped": "<decimal>",]
    52
    }
    Copied!
    Swap finalization
    1
    PUT swap/<id>/finalize
    2
    body: {
    3
    "finalization_signature": {
    4
    "value": "<finalization_signature>"
    5
    }
    6
    }
    Copied!
    Swap freeze
    1
    PUT swap/<id>/freeze
    2
    body: {
    3
    "freezing_signature": {
    4
    "value": "<freezing_signature>"
    5
    }
    6
    }
    Copied!
    Swap cancellation
    1
    PUT swap/<id>/cancel
    2
    body: {
    3
    "sender_cancellation_signature": {
    4
    "value": "<sender_cancellation_signature>"
    5
    },
    6
    "recipient_cancellation_signature": {
    7
    "value": "<recipient_cancellation_signature>"
    8
    }
    9
    }
    Copied!
Last modified 2yr ago