Client

Autogenerated documentation.

class raiden_client.Client(endpoint='http://127.0.0.1:5001/', version='v1')[source]
address()[source]

Query your address.

When raiden starts, you choose an ethereum address which will also be your raiden address.

Return type

Dict[str, str]

channel(token_address, partner_address)[source]

Query information about one of your channels.

The channel is specified by the address of the token and the partner’s address. :params: token_address (address) :params: partner_address (address) :rtype: Dict[str, ChannelType] :returns: channel dict

channel_close(token_address, partner_address)[source]

Close channel.

Params

token_address (address)

Params

partner_address (address)

Return type

Dict[str, ChannelType]

Returns

channel

channel_increase_deposit(token_address, partner_address, total_deposit)[source]

Channel increase deposit.

Params

token_address (address)

Params

partner_address (address)

Params

total_deposit (int)

Return type

Dict[str, ChannelType]

Returns

channel

channel_increase_withdraw(token_address, partner_address, total_withdraw)[source]

Channel increase withdraw.

Params

token_address (address)

Params

partner_address (address)

Params

total_withdraw (int)

Return type

Dict[str, ChannelType]

Returns

channel

channel_open(token_address, partner_address, settle_timeout, total_deposit)[source]

Opens (i. e. creates) a channel.

Params

partner_address (address) – The partner we want to open a channel with.

Params

token_address (address) – The token we want to be used in the channel.

Params

total_deposit (int) – Total amount of tokens to be deposited to the channel

Params

settle_timeout (int) – The amount of blocks that the settle timeout should have.

Return type

Dict[str, ChannelType]

Returns

channel

channels(token_address=None)[source]

Get a list of all unsettled channels.

Params

token_address (optional) (str) list of all unsettled channels for the given token address.

Return type

Dict[str, List[ChannelType]]

Returns

List of channels

connection_disconnect(token_address)[source]

Leave a token network.

The request will only return once all blockchain calls for closing/settling a channel have completed. :params: token_address (address)

Return type

Dict[str, Any]

connections()[source]

Query details of all joined token networks.

Return type

Dict[str, List[ConnectionType]]

Returns

dict where each key is a token address for which you have open channels

connections_connect(token_address, funds, initial_channel_target=None, joinable_funds_target=None)[source]

Automatically join a token network.

The request will only return once all blockchain calls for opening and/or depositing to a channel have completed. :params: token_address (address) :params: funds (int) Amount of funding you want to put into the network :params: initial_channel_target (int) (optional) Number of channels to open proactively :params: joinable_funds_target (float) (optional) Fraction of funds to join opened channels :rtype: Dict[str, ConnectionType] :returns: Connection object

property is_connected

Check if raiden node is connected.

Try to get address, if excpetion occured - node is not connected

Return type

bool

mint_tokens(token_address, to, value, contract_method='mintFor')[source]

Mint tokens. This requires the token at token_address to implement a minting method with one of the common interfaces: - mint(address,uint256) - mintFor(uint256,address) - increaseSupply(uint256,address) Depending on the token, it may also be necessary to have minter privilege.

Params

token_address (address)

Params

to (address)

Params

value (int)

Params

contract_method (str) (optional) default=mintFor choices: mint, mintFor, increaseSupply

Return type

Dict[str, str]

Returns

transaction_hash

non_settled_partners(token_address)[source]

Returns a list of all partners with whom you have non-settled channels for a certain token.

Params

token_address (address)

Return type

Dict[str, List[NonSettledPartners]]

Returns

list of NonSettledPartners

payment(token_address, target_address, amount, identifier=None)[source]

Initiate a payment.

Params

token_address (address)

Params

target_address (address)

Params

amount (int) – Amount to be sent to the target

Params

identifier (int) – Identifier of the payment (optional)

Return type

Dict[str, PaymentType]

Returns

payment dict object

payment_events(token_address, target_address)[source]

Query the payment history.

This includes successful (EventPaymentSentSuccess) and failed (EventPaymentSentFailed) sent payments as well as received payments (EventPaymentReceivedSuccess).

Params

token_address (address) (optional) - filter the list of events

Params

target_address (address) (optional) - filter the list of events

Return type

Dict[str, List[PaymentEvent]]

Returns

list of payment events

pending_transfers(token_address=None, partner_address=None)[source]

Returns a list of all transfers that have not been completed yet.

Params

token_address (address) (optional) lime results of pending transfers

Params

partner_address (address) (optional) lime results of pending transfers

Return type

Dict[str, List[PendingTransfer]]

Returns

list of channels

token_register(token_address)[source]

Registers a token. :params: token_address (str) :returns token_network_address (address) – The deployed token networks address.

Return type

Dict[str, str]

tokens(token_address=None)[source]

Returns a list of addresses of all registered tokens.

Params

token_address (address) (optional) Returns the address of token network for the given token

Return type

Dict[str, List[str]]

Returns

list of addresses (or address if toke_address param passed)