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

All unsettled channels

GET

All unsettled channels for a specific token

GET

Info about one of your channels

PUT

Create a channel

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

NameTypeDescription

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"
    }
]

All Unsettled Channels for a Specific Token

GET http://localhost:5001/api/v1/channels/0xEA67...8ec8

Path Parameters

NameTypeDescription

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"
    }
]

Info 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

NameTypeDescription

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"
}

Create a Channel

PUT http://localhost:5001/api/v1/channels

The request will open a channel and return a channel object.

Path Parameters

NameTypeDescription

version

string

Version of the API

Request Body

NameTypeDescription

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"
}

Example 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

NameTypeDescription

version

string

Version of the API

token_address

string

Address of a token

partner_address

string

Address of the partner node

Request Body

NameTypeDescription

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"
}

Example request body:

{
    "state": "closed"
}

Increase Deposit

PATCH http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9

Path Parameters

NameTypeDescription

version

string

Version of the API

token_address

string

Address of a token

partner_address

string

Address of the partner node

Request Body

NameTypeDescription

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"
}

Example request body:

{
    "total_deposit": "100"
}

Withdraw Tokens

PATCH http://localhost:5001/api/v1/channels/0xEA67...8ec8/0x61C8...0bD9

Path Parameters

NameTypeDescription

version

string

Version of the API

token_address

string

Address of a token

partner_address

string

Address of the partner node

Request Body

NameTypeDescription

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"
}

Example 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

NameTypeDescription

version

string

Version of the API

token_address

string

Address of a token

partner_address

string

Address of the partner node

Request Body

NameTypeDescription

reveal_timeout

string

Value for the new reveal timeout

Successfully updated the reveal timeout

Example request body:

{
    "reveal_timeout": "50"
}

Last updated