예제 #1
0
class ChannelsResourceByChannelAddress(BaseResource):

    patch_schema = ChannelRequestSchema(only=('balance', 'state'), )

    @use_kwargs(patch_schema, locations=('json', ))
    def patch(self, **kwargs):
        return self.rest_api.patch_channel(**kwargs)

    def get(self, **kwargs):
        return self.rest_api.get_channel(**kwargs)
예제 #2
0
class ChannelsResource(BaseResource):

    put_schema = ChannelRequestSchema(exclude=('channel_address', 'state'), )

    def get(self):
        """
        this translates to 'get all channels the node is connected with'
        """
        return self.rest_api.get_channel_list()

    @use_kwargs(put_schema, locations=('json', ))
    def put(self, **kwargs):
        return self.rest_api.open(**kwargs)
예제 #3
0
파일: resources.py 프로젝트: hackur/raiden
class ChannelsResourceByChannelAddress(BaseResource):

    patch_schema = ChannelRequestSchema(
        exclude=('token_address', 'partner_address', 'settle_timeout',
                 'channel_address'), )

    def __init__(self, **kwargs):
        super(ChannelsResourceByChannelAddress, self).__init__(**kwargs)

    @use_kwargs(patch_schema, locations=('json', ))
    def patch(self, **kwargs):
        return self.rest_api.patch_channel(**kwargs)

    def get(self, **kwargs):
        return self.rest_api.get_channel(**kwargs)
예제 #4
0
class ChannelsResourceByChannelAddress(BaseResource):

    patch_schema = ChannelRequestSchema(only=('balance', 'state'), )

    @use_kwargs(patch_schema, locations=('json', ))
    def patch(self, **kwargs):
        return self.rest_api.patch_channel(
            registry_address=self.rest_api.raiden_api.raiden.default_registry.
            address,
            **kwargs,
        )

    def get(self, **kwargs):
        return self.rest_api.get_channel(
            registry_address=self.rest_api.raiden_api.raiden.default_registry.
            address,
            **kwargs,
        )