Channels

The channels endpoints allow you to open channels with other Raiden nodes as well as closing channels, querying them for information and making deposits or withdrawals.

Channels Resource Overview

HTTP Method

Resource

Description

GET

/api/<version>/channels

All unsettled channels

GET

/api/<version>/channels/<token_address>

All unsettled channels for a specific token

GET

/api/<version>/channels/<token_address>/<partner_address>

Info about one of your channels

PUT

/api/<version>/channels

Create a channel

PATCH

/api/<version>/channels/<token_address>/<partner_address>

Close a channel, increase deposit, withdraw tokens or update reveal timeout

Alderaan Deposit Limits

The maximum deposits per token and node for Alderaan are:

  • DAI

    The deposit limit is 1000 worth of DAI per channel participant making the maximum amount of DAI 2000 per channel.

  • WETH

    Details on the deposit limit for WETH will be added soon.

Channels Resource Details

get
All Unsettled Channels

http://localhost:5001/api/v1/channels
Request
Response
Path Parameters
version
required
string
Version of the API
200: OK
Successful query
[
{
"token_network_address": "0xE5637F0103794C7e05469A9964E4563089a5E6f2",
"channel_identifier": 20,
"partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"balance": 25000000,
"total_deposit": 35000000,
"total_withdraw": 5000000,
"state": "opened",
"settle_timeout": 100,
"reveal_timeout": 30
}
]
500: Internal Server Error
Internal Raiden node error

get
All Unsettled Channels for a Specific Token

http://localhost:5001/api/v1/channels/0xEA67...8ec8
Request
Response
Path Parameters
version
required
string
Version of the API
token_address
required
string
Address of a token
200: OK
Successfull query
[
{
"token_network_address": "0xE5637F0103794C7e05469A9964E4563089a5E6f2",
"channel_identifier": 20,
"partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"balance": 25000000,
"total_deposit": 35000000,
"total_withdraw": 5000000,
"state": "opened",
"settle_timeout": 100,
"reveal_timeout": 30
}
]
404: Not Found
The token address is not a valid EIP55-encoded Ethereum address
500: Internal Server Error
Internal Raiden node error

get
Info About One of Your Channels

http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9
The channel is specified by the address of a token and the address of the partner node which the channel is opened with.
Request
Response
Path Parameters
version
required
string
Version of the API
token_address
required
string
Address of a token
partner_address
required
string
Address of the partner node
200: OK
Successful query
{
"token_network_address": "0xE5637F0103794C7e05469A9964E4563089a5E6f2",
"channel_identifier": 20,
"partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"balance": 25000000,
"total_deposit": 35000000,
"total_withdraw": 5000000,
"state": "opened",
"settle_timeout": 100,
"reveal_timeout": 30
}
404: Not Found
The token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum address
The channel does not exist
500: Internal Server Error
Internal Raiden node error

put
Create a Channel

http://localhost:5001/api/v1/channels
The request will open a channel and return a channel object.
Request
Response
Path Parameters
version
required
string
Version of the API
Body Parameters
reveal_timeout
required
integer
Value for the reveal timeout
partner_address
required
string
Address of the partner node with whom we're opening the channel
token_address
required
string
Address of the token to be used in the channel
total_deposit
required
integer
Amount of tokens to be deposited into the channel
settle_timeout
required
integer
The number of blocks after which a channel can be settled
201: Created
Channel successfully created
{
"token_network_address": "0xE5637F0103794C7e05469A9964E4563089a5E6f2",
"channel_identifier": 20,
"partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"balance": 25000000,
"total_deposit": 35000000,
"total_withdraw": 0,
"state": "opened",
"settle_timeout": 500,
"reveal_timeout": 30
}
400: Bad Request
The provided JSON is in some way incorrect
402: Payment Required
Insufficient balance of ETH to pay for the on-chain transaction
408: Request Time-out
The deposit event was not read on time by the Ethereum node
409: Conflict
Some invalid input has been provided, e.g. to low settle_timeout value
500: Internal Server Error
Internal Raiden node error

Example request body:

{
"partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"total_deposit": 35000000,
"settle_timeout": 500,
"reveal_timeout": 50
}

patch
Close a Channel

http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9
Request
Response
Path Parameters
version
required
string
Version of the API
token_address
required
string
Address of a token
partner_address
required
string
Address of the partner node
Body Parameters
state
required
string
Can only be set to "closed"
200: OK
Successfully closed channel
{
"token_network_address": "0xE5637F0103794C7e05469A9964E4563089a5E6f2",
"channel_identifier": 20,
"partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"balance": 25000000,
"total_deposit": 35000000,
"total_withdraw": 5000000,
"state": "closed",
"settle_timeout": 500,
"reveal_timeout": 30
}
400: Bad Request
The provided JSON is in some way incorrect
"state" has not been provided or doesn't have the valid value "closed"
402: Payment Required
Insufficient balance of ETH to pay for the on-chain transactions
404: Not Found
The token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum address
409: Conflict
The channel does not exist
"total_withdraw" and/or "total_deposit" have been trying to update in the same request
500: Internal Server Error
Internal Raiden node error

Example request body:

{
"state": "closed"
}

patch
Increase Deposit

http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9
Request
Response
Path Parameters
version
required
string
Version of the API
token_address
required
string
Address of a token
partner_address
required
string
Address of the partner node
Body Parameters
total_deposit
required
integer
Amount of tokens for increasing the total deposit
200: OK
Successfully increased the deposit
{
"token_network_address": "0xE5637F0103794C7e05469A9964E4563089a5E6f2",
"channel_identifier": 20,
"partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"balance": 25000000,
"total_deposit": 35000000,
"total_withdraw": 5000000,
"state": "closed",
"settle_timeout": 500,
"reveal_timeout": 30
}
400: Bad Request
The provided JSON is in some way incorrect
"total_deposit" has not been provided
402: Payment Required
Insufficient balance of ETH to pay for the on-chain transactions
Insufficient token balance for making the desired deposit
404: Not Found
The token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum address
408: Request Time-out
The deposit event was not read on time by the Ethereum node
409: Conflict
The channel does not exist"state" and/or "total_withdraw" have been trying to update in the same request
The amount of deposited tokens is lower than the current on-chain token balance in the channel
The amount of deposited tokens is higher than the allowed limit
500: Internal Server Error
Internal Raiden node error

Example request body:

{
"total_deposit": 100
}

patch
Withdraw Tokens

http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9
Request
Response
Path Parameters
version
required
string
Version of the API
token_address
required
string
Address of a token
partner_address
required
string
Address of the partner node
Body Parameters
total_withdraw
required
integer
Amount of tokens to withdraw
200: OK
Successfully withdrawn tokens
{
"token_network_address": "0xE5637F0103794C7e05469A9964E4563089a5E6f2",
"channel_identifier": 20,
"partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"balance": 25000000,
"total_deposit": 35000000,
"total_withdraw": 5000000,
"state": "closed",
"settle_timeout": 500,
"reveal_timeout": 30
}
400: Bad Request
The provided JSON is in some way incorrect
"total_withdraw" has not been provided
402: Payment Required
Insufficient balance of ETH to pay for the on-chain transactions
404: Not Found
The token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum address
409: Conflict
The channel does not exist
"state" and/or "total_deposit" have been trying to update in the same request
500: Internal Server Error
Internal Raiden node error

Example request body:

{
"total_withdraw": 50
}

patch
Update Reveal Timeout

http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9
This request will update the number of blocks that are allowed between setting a hashlock and the revealing of the related secret.
Request
Response
Path Parameters
version
required
string
Version of the API
token_address
required
string
Address of a token
partner_address
required
string
Address of the partner node
Body Parameters
reveal_timeout
required
integer
Value for the new reveal timeout
200: OK
Successfully updated the reveal timeout

Example request body:

{
"reveal_timeout": 50
}