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
PATCH
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
All Unsettled Channels
GET http://localhost:5001/api/v1/channels
Path Parameters
version
string
Version of the API
[
{
"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"
}
]Internal Raiden node errorAll Unsettled Channels for a Specific Token
GET http://localhost:5001/api/v1/channels/0xEA67...8ec8
Path Parameters
version
string
Version of the API
token_address
string
Address of a token
[
{
"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"
}
]The token address is not a valid EIP55-encoded Ethereum addressInternal Raiden node errorInfo About One of Your Channels
GET 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.
Path Parameters
version
string
Version of the API
token_address
string
Address of a token
partner_address
string
Address of the partner node
{
"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"
}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 existInternal Raiden node errorCreate a Channel
PUT http://localhost:5001/api/v1/channels
The request will open a channel and return a channel object.
Path Parameters
version
string
Version of the API
Request Body
reveal_timeout
string
Value for the reveal timeout
partner_address
string
Address of the partner node with whom we're opening the channel
token_address
string
Address of the token to be used in the channel
total_deposit
string
Amount of tokens to be deposited into the channel
settle_timeout
string
The number of blocks after which a channel can be settled
{
"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"
}The provided JSON is in some way incorrectInsufficient balance of ETH to pay for the on-chain transactionSome invalid input has been provided, e.g. to low settle_timeout valueInternal Raiden node errorExample request body:
{
"partner_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
"token_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"total_deposit": "35000000",
"settle_timeout": "500",
"reveal_timeout": "50"
}Close a Channel
PATCH http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9
Path Parameters
version
string
Version of the API
token_address
string
Address of a token
partner_address
string
Address of the partner node
Request Body
state
string
Can only be set to "closed"
{
"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"
}The provided JSON is in some way incorrect
"state" has not been provided or doesn't have the valid value "closed"Insufficient balance of ETH to pay for the on-chain transactionsThe token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum addressThe channel does not exist
"total_withdraw" and/or "total_deposit" have been trying to update in the same requestInternal Raiden node errorExample request body:
{
"state": "closed"
}Increase Deposit
PATCH http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9
Path Parameters
version
string
Version of the API
token_address
string
Address of a token
partner_address
string
Address of the partner node
Request Body
total_deposit
string
Amount of tokens for increasing the total 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"
}The provided JSON is in some way incorrect
"total_deposit" has not been providedInsufficient balance of ETH to pay for the on-chain transactions
Insufficient token balance for making the desired depositThe token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum addressThe deposit event was not read on time by the Ethereum nodeThe 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 limitInternal Raiden node errorExample request body:
{
"total_deposit": "100"
}Withdraw Tokens
PATCH http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9
Path Parameters
version
string
Version of the API
token_address
string
Address of a token
partner_address
string
Address of the partner node
Request Body
total_withdraw
string
Amount of tokens to withdraw
{
"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"
}The provided JSON is in some way incorrect
"total_withdraw" has not been providedInsufficient balance of ETH to pay for the on-chain transactionsThe token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum addressThe channel does not exist
"state" and/or "total_deposit" have been trying to update in the same requestInternal Raiden node errorExample request body:
{
"total_withdraw": "50"
}Update Reveal Timeout
PATCH 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.
Path Parameters
version
string
Version of the API
token_address
string
Address of a token
partner_address
string
Address of the partner node
Request Body
reveal_timeout
string
Value for the new reveal timeout
Successfully updated the reveal timeoutExample request body:
{
"reveal_timeout": "50"
}Last updated
Was this helpful?