Raiden’s API Documentation

Introduction

Raiden has a Restful API with URL endpoints corresponding to user-facing interaction allowed by a Raiden node. The endpoints accept and return JSON encoded objects. The api url path always contains the api version in order to differentiate queries to different API versions. All queries start with: /api/<version>/

JSON Object Encoding

The objects that are sent to and received from the API are JSON-encoded. Following are the common objects used in the API.

Channel Object

{
   "channel_address": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226",
   "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
   "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
   "balance": 35000000,
   "state": "opened",
   "settle_timeout": 100,
   "reveal_timeout": 40
}

A channel object consists of a

  • channel_address should be a string containing the hexadecimal address of the channel
  • partner_address should be a string containing the hexadecimal address of the partner with whom we have opened a channel
  • token_address should be a string containing the hexadecimal address of the token we are trading in the channel.
  • balance should be an integer of the amount of the token_address token we have available for transferring.
  • state should be the current state of the channel represented by a string. Possible value are: - 'opened': The channel is open and tokens are tradeable - 'closed': The channel has been closed by a participant - 'settled': The channel has been closed by a participant and also settled.
  • 'settle_timeout': The number of blocks that are required to be mined from the time that close() is called until the channel can be settled with a call to settle().
  • 'reveal_timeout': The maximum number of blocks allowed between the setting of a hashlock and the revealing of the related secret.

Event Object

Channels events are encoded as json objects with the event arguments as attributes of the dictionary, with one difference. The event_type and the block_number are also added for all events to easily distinguish between events.

Errors

For any non-successful http status code, e.g. 409 Conflict or 400 Bad Request there will be an accompanying errors field in the response json which you can check for more information on what went wrong with your request.

Endpoints

Following are the available API endpoints with which you can interact with Raiden.

Querying Information About Your Raiden Node

GET /api/(version)/address

Query your address. When raiden starts, you choose an ethereum address which will also be your raiden address.

Example Request:

http

GET /api/1/address HTTP/1.1
Host: localhost:5001

curl

curl -i http://localhost:5001/api/1/address

wget

wget -S -O- http://localhost:5001/api/1/address

httpie

http http://localhost:5001/api/1/address

python-requests

requests.get('http://localhost:5001/api/1/address')

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "our_address": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226"
}

Deploying

PUT /api/(version)/tokens/(token_address)

Registers a token. If a token is not registered yet (i.e.: A token network for that token does not exist in the registry), we need to register it by deploying a token network contract for that token.

Example Request:

http

PUT /api/1/tokens/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8 HTTP/1.1
Host: localhost:5001

curl

curl -i -X PUT http://localhost:5001/api/1/tokens/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8

wget

wget -S -O- --method=PUT http://localhost:5001/api/1/tokens/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8

httpie

http PUT http://localhost:5001/api/1/tokens/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8

python-requests

requests.put('http://localhost:5001/api/1/tokens/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8')

Example Response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "token_network_address": "0xC4F8393fb7971E8B299bC1b302F85BfFB3a1275a"
}
Status Codes:
  • 201 Created – A token network for the token has been successfully created.
  • 202 Accepted – Creation of the token network for the token has been started but did not finish yet. Please check again once the related transaction has been mined.
  • 404 Not Found – The given token address is invalid.
  • 409 Conflict
    • The token was already registered before, or
    • The registering transaction failed.
Response JSON Object:
 
  • token_network_address (address) – The deployed token networks address.

Querying Information About Channels and Tokens

GET /api/(version)/channels

Get a list of all unsettled channels.

Example Request:

http

GET /api/1/channels HTTP/1.1
Host: localhost:5001

curl

curl -i http://localhost:5001/api/1/channels

wget

wget -S -O- http://localhost:5001/api/1/channels

httpie

http http://localhost:5001/api/1/channels

python-requests

requests.get('http://localhost:5001/api/1/channels')

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "token_network_identifier": "0xE5637F0103794C7e05469A9964E4563089a5E6f2",
        "channel_identifier": "0xa24f51685de3effe829f7c2e94b9db8e9e1b17b137da59fa727a793ae2cae776",
        "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
        "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
        "balance": 35000000,
        "state": "open",
        "settle_timeout": 100,
        "reveal_timeout": 30
    }
]
Status Codes:
GET /api/(version)/channels/(token_address)/(partner_address)

Query information about one of your channels. The channel is specified by the address of the token and the partner’s address.

Example Request:

http

GET /api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9 HTTP/1.1
Host: localhost:5001

curl

curl -i http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9

wget

wget -S -O- http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9

httpie

http http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9

python-requests

requests.get('http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9')

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "token_network_identifier": "0xE5637F0103794C7e05469A9964E4563089a5E6f2",
    "channel_identifier": "0xa24f51685de3effe829f7c2e94b9db8e9e1b17b137da59fa727a793ae2cae776",
    "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
    "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
    "balance": 35000000,
    "state": "open",
    "settle_timeout": 100,
    "reveal_timeout": 30
}
Status Codes:
GET /api/(version)/tokens

Returns a list of addresses of all registered tokens.

Example Request:

http

GET /api/1/tokens HTTP/1.1
Host: localhost:5001

curl

curl -i http://localhost:5001/api/1/tokens

wget

wget -S -O- http://localhost:5001/api/1/tokens

httpie

http http://localhost:5001/api/1/tokens

python-requests

requests.get('http://localhost:5001/api/1/tokens')

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

[
    "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
    "0x61bB630D3B2e8eda0FC1d50F9f958eC02e3969F6"
]
Status Codes:
GET /api/(version)/tokens/(token_address)/partners

Returns a list of all partners with whom you have non-settled channels for a certain token.

Example Request:

http

GET /api/1/tokens/0x61bB630D3B2e8eda0FC1d50F9f958eC02e3969F6/partners HTTP/1.1
Host: localhost:5001

curl

curl -i http://localhost:5001/api/1/tokens/0x61bB630D3B2e8eda0FC1d50F9f958eC02e3969F6/partners

wget

wget -S -O- http://localhost:5001/api/1/tokens/0x61bB630D3B2e8eda0FC1d50F9f958eC02e3969F6/partners

httpie

http http://localhost:5001/api/1/tokens/0x61bB630D3B2e8eda0FC1d50F9f958eC02e3969F6/partners

python-requests

requests.get('http://localhost:5001/api/1/tokens/0x61bB630D3B2e8eda0FC1d50F9f958eC02e3969F6/partners')

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

[
   {
       "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
       "channel": "/api/<version>/channels/0x2a65Aca4D5fC5B5C859090a6c34d164135398226"
   }
]
Status Codes:
Response JSON Array of Objects:
 
  • partner_address (address) – The partner we have a channel with
  • channel (link) – A link to the channel resource

Channel Management

PUT /api/(version)/channels

Opens (i. e. creates) a channel.

Example Request:

http

PUT /api/1/channels HTTP/1.1
Host: localhost:5001
Content-Type: application/json

{
    "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
    "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
    "balance": 35000000,
    "settle_timeout": 100
}

curl

curl -i -X PUT http://localhost:5001/api/1/channels -H 'Content-Type: application/json' --data-raw '{"balance": 35000000, "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "settle_timeout": 100, "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8"}'

wget

wget -S -O- --method=PUT http://localhost:5001/api/1/channels --header='Content-Type: application/json' --body-data='{"balance": 35000000, "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "settle_timeout": 100, "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8"}'

httpie

echo '{
  "balance": 35000000,
  "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
  "settle_timeout": 100,
  "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8"
}' | http PUT http://localhost:5001/api/1/channels Content-Type:application/json

python-requests

requests.put('http://localhost:5001/api/1/channels', headers={'Content-Type': 'application/json'}, json={'balance': 35000000, 'partner_address': '0x61C808D82A3Ac53231750daDc13c777b59310bD9', 'settle_timeout': 100, 'token_address': '0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8'})
Request JSON Object:
 
  • balance (int) – Initial deposit to make to the channel.

The request’s payload is a channel object; since it is a new channel, its channel_address and status fields will be ignored and can be omitted.

The request to the endpoint should later return the fully created channel object from which we can find the address of the channel.

Example Response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "channel_address": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226",
    "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
    "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
    "balance": 35000000,
    "state": "open",
    "settle_timeout": 100,
    "reveal_timeout": 30
}
Status Codes:
PATCH /api/(version)/channels/(token_address)/(partner_address)

This request is used to close a channel or to increase the deposit in it.

Example Request (close channel):

http

PATCH /api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9 HTTP/1.1
Host: localhost:5001
Content-Type: application/json

{
    "state": "closed"
}

curl

curl -i -X PATCH http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9 -H 'Content-Type: application/json' --data-raw '{"state": "closed"}'

wget

wget -S -O- --method=PATCH http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9 --header='Content-Type: application/json' --body-data='{"state": "closed"}'

httpie

echo '{
  "state": "closed"
}' | http PATCH http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9 Content-Type:application/json

python-requests

requests.patch('http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9', headers={'Content-Type': 'application/json'}, json={'state': 'closed'})

Example Request (increase deposit):

http

PATCH /api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9 HTTP/1.1
Host: localhost:5001
Content-Type: application/json

{
    "total_deposit": 100
}

curl

curl -i -X PATCH http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9 -H 'Content-Type: application/json' --data-raw '{"total_deposit": 100}'

wget

wget -S -O- --method=PATCH http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9 --header='Content-Type: application/json' --body-data='{"total_deposit": 100}'

httpie

echo '{
  "total_deposit": 100
}' | http PATCH http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9 Content-Type:application/json

python-requests

requests.patch('http://localhost:5001/api/1/channels/0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8/0x61C808D82A3Ac53231750daDc13c777b59310bD9', headers={'Content-Type': 'application/json'}, json={'total_deposit': 100})
Request JSON Object:
 
  • state (string) – Desired new state; the only valid choice is "closed"
  • total_deposit (int) – The increased total deposit

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "channel_address": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226",
    "partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
    "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
    "balance": 35000000,
    "state": "closed",
    "settle_timeout": 100,
    "reveal_timeout": 30
}
Status Codes:
  • 200 OK – Success
  • 202 Accepted – The requested action has been started but did not finish yet. Please check again once the related transaction has been mined.
  • 400 Bad Request
    • The provided JSON is in some way malformed, or
    • there is nothing to do since neither state nor total_deposit have been given, or
    • the value of state is not a valid channel state.
  • 402 Payment Required – Insufficient balance to do a deposit
  • 408 Request Timeout – Deposit event was not read in time by the Ethereum node
  • 409 Conflict
    • Provided channel does not exist or
    • state and total_deposit have been attempted to update in the same request.
  • 500 Internal Server Error – Internal Raiden node error

Connection Management

GET /api/(version)/connections

Query details of all joined token networks.

The request will return a JSON object where each key is a token address for which you have open channels.

Example Request:

http

GET /api/1/connections HTTP/1.1
Host: localhost:5001

curl

curl -i http://localhost:5001/api/1/connections

wget

wget -S -O- http://localhost:5001/api/1/connections

httpie

http http://localhost:5001/api/1/connections

python-requests

requests.get('http://localhost:5001/api/1/connections')

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "0x2a65Aca4D5fC5B5C859090a6c34d164135398226": {
        "funds": 100,
        "sum_deposits": 67,
        "channels": 3
    },
    "0x0f114A1E9Db192502E7856309cc899952b3db1ED": {
        "funds": 49
        "sum_deposits": 31,
        "channels": 1
    }
}
Response JSON Array of Objects:
 
  • funds (int) – Funds from last connect request
  • sum_deposits (int) – Sum of deposits of all currently open channels
  • channels (int) – Number of channels currently open for that token
Status Codes:
PUT /api/(version)/connections/(token_address)

Automatically join a token network. The request will only return once all blockchain calls for opening and/or depositing to a channel have completed.

Example Request:

http

PUT /api/1/connections/0x2a65Aca4D5fC5B5C859090a6c34d164135398226 HTTP/1.1
Host: localhost:5001
Content-Type: application/json

{
    "funds": 1337
}

curl

curl -i -X PUT http://localhost:5001/api/1/connections/0x2a65Aca4D5fC5B5C859090a6c34d164135398226 -H 'Content-Type: application/json' --data-raw '{"funds": 1337}'

wget

wget -S -O- --method=PUT http://localhost:5001/api/1/connections/0x2a65Aca4D5fC5B5C859090a6c34d164135398226 --header='Content-Type: application/json' --body-data='{"funds": 1337}'

httpie

echo '{
  "funds": 1337
}' | http PUT http://localhost:5001/api/1/connections/0x2a65Aca4D5fC5B5C859090a6c34d164135398226 Content-Type:application/json

python-requests

requests.put('http://localhost:5001/api/1/connections/0x2a65Aca4D5fC5B5C859090a6c34d164135398226', headers={'Content-Type': 'application/json'}, json={'funds': 1337})
Request JSON Object:
 
  • funds (int) – amount of funding you want to put into the network
  • initial_channel_target (int) – number of channels to open proactively
  • joinable_funds_target (float) – fraction of funds that will be used to join channels opened by other participants
Status Codes:
  • 202 Accepted – The joining of the token network for the token has been started but did not finish yet. Please check again once the related transaction has been mined.
  • 204 No Content – For a successful connection creation
  • 402 Payment Required – If any of the channel deposits fail due to insufficient ETH balance
  • 408 Request Timeout – If a timeout happened during any of the transactions
  • 500 Internal Server Error – Internal Raiden node error
DELETE /api/(version)/connections/(token_address)

Leave a token network. The request will only return once all blockchain calls for closing/settling a channel have completed.

Example Request:

http

DELETE /api/1/connection HTTP/1.1
Host: localhost:5001
Content-Type: application/json

{
    "only_receiving_channels": false
}

curl

curl -i -X DELETE http://localhost:5001/api/1/connection -H 'Content-Type: application/json' --data-raw '{"only_receiving_channels": false}'

wget

wget -S -O- --method=DELETE http://localhost:5001/api/1/connection --header='Content-Type: application/json' --body-data='{"only_receiving_channels": false}'

httpie

echo '{
  "only_receiving_channels": false
}' | http DELETE http://localhost:5001/api/1/connection Content-Type:application/json

python-requests

requests.delete('http://localhost:5001/api/1/connection', headers={'Content-Type': 'application/json'}, json={'only_receiving_channels': False})
Request JSON Object:
 
  • only_receiving_channels (boolean) – Only close and settle channels where your node has received transfers. Defaults to true.

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

[
    "0x41BCBC2fD72a731bcc136Cf6F7442e9C19e9f313",
    "0x5A5f458F6c1a034930E45dC9a64B99d7def06D7E",
    "0x8942c06FaA74cEBFf7d55B79F9989AdfC85C6b85"
]

The response is a list with the addresses of all closed channels.

Status Codes:

Note

The default behavior to close and settle only receiving channels is safe from an accounting point of view since deposits can’t be lost and provides for the fastest and cheapest way to leave a token network when you want to shut down your node.

If the default behaviour is not desired and the goal is to leave all channels irrespective of having received transfers or not then you should provide as payload to the request only_receiving_channels=false

Transfers

POST /api/(version)/transfers/(token_address)/(target_address)

Initiate a transfer.

The request will only return once the transfer either succeeded or failed. A transfer can fail due to the expiration of a lock, the target being offline, channels on the path to the target not having enough settle_timeout and reveal_timeout in order to allow the transfer to be propagated safely e.t.c

Example Request:

http

POST /api/1/transfers/0x2a65Aca4D5fC5B5C859090a6c34d164135398226/0x61C808D82A3Ac53231750daDc13c777b59310bD9 HTTP/1.1
Host: localhost:5001
Content-Type: application/json

{
    "amount": 200,
    "identifier": 42
}

curl

curl -i -X POST http://localhost:5001/api/1/transfers/0x2a65Aca4D5fC5B5C859090a6c34d164135398226/0x61C808D82A3Ac53231750daDc13c777b59310bD9 -H 'Content-Type: application/json' --data-raw '{"amount": 200, "identifier": 42}'

wget

wget -S -O- http://localhost:5001/api/1/transfers/0x2a65Aca4D5fC5B5C859090a6c34d164135398226/0x61C808D82A3Ac53231750daDc13c777b59310bD9 --header='Content-Type: application/json' --post-data='{"amount": 200, "identifier": 42}'

httpie

echo '{
  "amount": 200,
  "identifier": 42
}' | http POST http://localhost:5001/api/1/transfers/0x2a65Aca4D5fC5B5C859090a6c34d164135398226/0x61C808D82A3Ac53231750daDc13c777b59310bD9 Content-Type:application/json

python-requests

requests.post('http://localhost:5001/api/1/transfers/0x2a65Aca4D5fC5B5C859090a6c34d164135398226/0x61C808D82A3Ac53231750daDc13c777b59310bD9', headers={'Content-Type': 'application/json'}, json={'amount': 200, 'identifier': 42})
Request JSON Object:
 
  • amount (int) – Amount to be transferred
  • identifier (int) – Identifier of the transfer (optional)

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "initiator_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
    "target_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
    "token_address": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226",
    "amount": 200,
    "identifier": 42
}
Status Codes:

Querying Events

Events are kept by the node. Once an event endpoint is queried the relevant events from either the beginning of time or the given block are returned.

Events are queried by two different endpoints depending on whether they are related to a specific channel or not.

All events can be filtered down by providing the query string arguments from_block and/or to_block to query only a events from a limited range of blocks. The block number argument needs to be in the range of 0 to UINT64_MAX. Any blocknumber outside this range will be rejected.

GET /api/(version)/events/network

Query for registry network events.

Note

The network registry used is the default registry. The default registry is preconfigured and can be edited from the raiden configuration file.

Example Request:

http

GET /api/1/events/network HTTP/1.1
Host: localhost:5001

curl

curl -i http://localhost:5001/api/1/events/network

wget

wget -S -O- http://localhost:5001/api/1/events/network

httpie

http http://localhost:5001/api/1/events/network

python-requests

requests.get('http://localhost:5001/api/1/events/network')

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "event_type": "TokenAdded",
        "token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
        "channel_manager_address": "0xC0ea08A2d404d3172d2AdD29A45be56dA40e2949"
    }, {
        "event_type": "TokenAdded",
        "token_address": "0x91337A300e0361BDDb2e377DD4e88CCB7796663D",
        "channel_manager_address": "0xC0ea08A2d404d3172d2AdD29A45be56dA40e2949"
    }
]
Status Codes:
GET /api/(version)/events/tokens/(token_address)

Query for all new channels opened for a token

Example Request:

http

GET /api/1/events/tokens/0x61C808D82A3Ac53231750daDc13c777b59310bD9 HTTP/1.1
Host: localhost:5001

curl

curl -i http://localhost:5001/api/1/events/tokens/0x61C808D82A3Ac53231750daDc13c777b59310bD9

wget

wget -S -O- http://localhost:5001/api/1/events/tokens/0x61C808D82A3Ac53231750daDc13c777b59310bD9

httpie

http http://localhost:5001/api/1/events/tokens/0x61C808D82A3Ac53231750daDc13c777b59310bD9

python-requests

requests.get('http://localhost:5001/api/1/events/tokens/0x61C808D82A3Ac53231750daDc13c777b59310bD9')

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "event_type": "ChannelNew",
        "settle_timeout": 10,
        "netting_channel": "0xC0ea08A2d404d3172d2AdD29A45be56dA40e2949",
        "participant1": "0x4894A542053248E0c504e3dEF2048c08f73E1CA6",
        "participant2": "0x356857Cd22CBEFccDa4e96AF13b408623473237A"
    }, {
        "event_type": "ChannelNew",
        "settle_timeout": 15,
        "netting_channel": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
        "participant1": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
        "participant2": "0xc7262f1447FCB2f75AB14B2A28DeEd6006eEA95B"
    }
]
Status Codes:
GET /api/(version)/events/channels/(channel_address)

Query for events tied to a specific channel.

Example Request:

http

GET /api/1/events/channels/0x2a65Aca4D5fC5B5C859090a6c34d164135398226?from_block=1337 HTTP/1.1
Host: localhost:5001

curl

curl -i 'http://localhost:5001/api/1/events/channels/0x2a65Aca4D5fC5B5C859090a6c34d164135398226?from_block=1337'

wget

wget -S -O- 'http://localhost:5001/api/1/events/channels/0x2a65Aca4D5fC5B5C859090a6c34d164135398226?from_block=1337'

httpie

http 'http://localhost:5001/api/1/events/channels/0x2a65Aca4D5fC5B5C859090a6c34d164135398226?from_block=1337'

python-requests

requests.get('http://localhost:5001/api/1/events/channels/0x2a65Aca4D5fC5B5C859090a6c34d164135398226?from_block=1337')

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "event_type": "ChannelNewBalance",
        "participant": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
        "balance": 150000,
        "block_number": 54388
    }, {
        "event_type": "TransferUpdated",
        "token_address": "0x91337A300e0361BDDb2e377DD4e88CCB7796663D",
        "channel_manager_address": "0xC0ea08A2d404d3172d2AdD29A45be56dA40e2949"
    }, {
        "event_type": "EventTransferSentSuccess",
        "identifier": 14909067296492875713,
        "block_number": 2226,
        "amount": 7,
        "target": "0xc7262f1447FCB2f75AB14B2A28DeEd6006eEA95B"
    }
]
Status Codes: