Tokens

The tokens endpoints are used for registering new tokens and querying information about already registered tokens.

Tokens Resource Overview

HTTP Method

Resource

Description

GET

/api/<version>/tokens

Addresses for all registered tokens

GET

/api/<version>/tokens/<token_address>

Address of token network for a specific token

GET

/api/<version>/tokens/<token_address>/partners

All partner nodes with unsettled channels for a specific token

PUT

/api/<version>/tokens/<token_address>

Register a token

Alderaan Token Registration

For the Alderaan release two tokens will be registered, DAI and WETH.

Tokens Resource Details

get
Addresses for All Registered Tokens

http://localhost:5001/api/v1/tokens
Request
Response
Request
Path Parameters
version
required
string
Version of the API
Response
200: OK
Successful query
[
"0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
"0x61bB630D3B2e8eda0FC1d50F9f958eC02e3969F6"
]
500: Internal Server Error
Internal Raiden node error

get
Address of Token Network for a Specific Token

http://localhost:5001/api/v1/tokens/0xEA67...8ec8
The request will return the token network address for the specified token only if the token is already registered.
Request
Response
Request
Path Parameters
version
required
string
Version of the API
token_address
required
string
Address of a token
Response
200: OK
Successful query
"0x61bB630D3B2e8eda0FC1d50F9f958eC02e3969F6"
404: Not Found
No token network was found for the provided token address

get
All Partner Nodes With Unsettled Channels for a Specific Token

http://localhost:5001/api/v1/tokens/0x61bB...69F6/partners
The value for the "channel" key in the response is a link to the channel resource.
Request
Response
Request
Path Parameters
version
required
string
Version of the API
token_address
required
string
Address of a token
Response
200: OK
Successful query
[
{
"partner_address": "0x2a65aca4d5fc5b5c859090a6c34d164135398226",
"channel": "/api/<version>/channels/0x61C808D82A3Ac53231750daDc13c777b59310bD9/0x2a65aca4d5fc5b5c859090a6c34d164135398226"
}
]
302: Found
If the user accesses the channel link endpoint
404: Not Found
The token does not exist
The token address is not a valid EIP55-encoded Ethereum address
500: Internal Server Error
Internal Raiden node error

put
Register a Token

http://localhost:5001/api/v1/tokens/0xEA67...8ec8
A token needs to be registered for a token network to exist for that specific token.
Request
Response
Request
Path Parameters
version
required
string
Version of the API
token_address
required
string
Address of a token
Response
201: Created
A token network for the specified token has been successfully created
{
"token_network_address": "0xC4F8393fb7971E8B299bC1b302F85BfFB3a1275a"
}
402: Payment Required
Insufficient balance of ETH to pay for the on-chain transactions
404: Not Found
The token address is not valid
409: Conflict
The token has already been registered
The registration transaction failedThe address does not contain code
501: Not Implemented
Registering a token only works on testnet.