def get_tokens_list(self, registry_address): raiden_service_result = self.raiden_api.get_tokens_list( registry_address) assert isinstance(raiden_service_result, list) tokens_list = AddressList(raiden_service_result) result = self.address_list_schema.dump(tokens_list) return api_response(result=checksummed_response_list(result.data))
def leave(self, token_address, only_receiving): closed_channels = self.raiden_api.leave_token_network( token_address, only_receiving) closed_channels = [ channel.channel_address for channel in closed_channels ] channel_addresses_list = AddressList(closed_channels) result = self.address_list_schema.dump(channel_addresses_list) return api_response(result=result.data)
def get_tokens_list(self, registry_address: typing.PaymentNetworkID): log.debug( 'Getting token list', registry_address=registry_address, ) raiden_service_result = self.raiden_api.get_tokens_list(registry_address) assert isinstance(raiden_service_result, list) tokens_list = AddressList(raiden_service_result) result = self.address_list_schema.dump(tokens_list) return api_response(result=result.data)
def leave(self, registry_address, token_address, only_receiving): closed_channels = self.raiden_api.token_network_leave( registry_address, token_address, only_receiving, ) closed_channels = [channel_state.identifier for channel_state in closed_channels] channel_addresses_list = AddressList(closed_channels) result = self.address_list_schema.dump(channel_addresses_list) return api_response(result=checksummed_response_dict(result.data))
def get_tokens_list(self): raiden_service_result = self.raiden_api.get_tokens_list() assert isinstance(raiden_service_result, list) tokens_list = AddressList(raiden_service_result) result = self.address_list_schema.dump(tokens_list) return api_response(result=result.data)