Raiden Network
  • What is Raiden?
  • Installation
    • Quick Start
      • Get MetaMask
      • Get an Infura ID
      • Download and run the Raiden Wizard
      • Handle Limitations
    • Starting Raiden Manually
  • Using Raiden on Mainnet
    • Overview
    • Get Whitelisted Tokens
    • Deposit Tokens to the UDC
    • Open a Channel
    • Make a Payment
    • Deposit Tokens
    • View Channel Status
    • Mediation Fees
  • The Raiden Web Interface
    • Overview
    • Navigate the WebUI
    • Join a Token Network
    • Make a Payment
    • Add More Tokens
    • Settle Payments and Close Channels
  • Using Raiden on testnet
    • Quick Start on Görli Testnet
    • Use Custom Token
      • Get Goerli Testnet ETH (GÖETH)
      • Import Custom Token
      • Compile Imported Token Code
      • Deploy Custom Token
  • Raiden API
    • Introduction
    • Resources
      • Address
      • Version
      • Settings
      • Contracts Information
      • Tokens
      • Channels
      • Payments
      • Connections
      • Pending Transfers
      • Shutdown
      • Testing
    • API Tutorial
      • Create a Token Network
      • Open a Channel
      • Deposit Tokens
      • Make a Payment
      • Withdraw Tokens
      • Settle Payments and Close Channels
  • Other
    • Safe Usage
    • Known Issues
    • Glossary
    • v1.0 Documentation
    • Trademark Attributions
Powered by GitBook
On this page
  • Channels Resource Overview
  • Channels Resource Details
  • All Unsettled Channels
  • All Unsettled Channels for a Specific Token
  • Info About One of Your Channels
  • Create a Channel
  • Close a Channel
  • Increase Deposit
  • Withdraw Tokens
  • Update Reveal Timeout

Was this helpful?

  1. Raiden API
  2. Resources

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

Name
Type
Description

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 error

All Unsettled Channels for a Specific Token

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

Path Parameters

Name
Type
Description

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 address
Internal Raiden node error

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

Name
Type
Description

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 exist
Internal Raiden node error

Create a Channel

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

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

Path Parameters

Name
Type
Description

version

string

Version of the API

Request Body

Name
Type
Description

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 incorrect
Insufficient balance of ETH to pay for the on-chain transaction
Some invalid input has been provided, e.g. to low settle_timeout value
Internal Raiden node error

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

Name
Type
Description

version

string

Version of the API

token_address

string

Address of a token

partner_address

string

Address of the partner node

Request Body

Name
Type
Description

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 transactions
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
"total_withdraw" and/or "total_deposit" have been trying to update in the same request
Internal Raiden node error

Example request body:

{
    "state": "closed"
}

Increase Deposit

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

Path Parameters

Name
Type
Description

version

string

Version of the API

token_address

string

Address of a token

partner_address

string

Address of the partner node

Request Body

Name
Type
Description

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 provided
Insufficient balance of ETH to pay for the on-chain transactions
Insufficient token balance for making the desired deposit
The token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum address
The deposit event was not read on time by the Ethereum node
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
Internal Raiden node error

Example request body:

{
    "total_deposit": "100"
}

Withdraw Tokens

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

Path Parameters

Name
Type
Description

version

string

Version of the API

token_address

string

Address of a token

partner_address

string

Address of the partner node

Request Body

Name
Type
Description

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 provided
Insufficient balance of ETH to pay for the on-chain transactions
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
"state" and/or "total_deposit" have been trying to update in the same request
Internal Raiden node error

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

Name
Type
Description

version

string

Version of the API

token_address

string

Address of a token

partner_address

string

Address of the partner node

Request Body

Name
Type
Description

reveal_timeout

string

Value for the new reveal timeout

Successfully updated the reveal timeout

Example request body:

{
    "reveal_timeout": "50"
}
PreviousTokensNextPayments

Last updated 4 years ago

Was this helpful?

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