class AssetMovementsResource(BaseResource): get_schema = TimerangeLocationCacheQuerySchema() @use_kwargs(get_schema, location='json_and_query') def get( self, from_timestamp: Timestamp, to_timestamp: Timestamp, location: Optional[Location], async_query: bool, only_cache: bool, ) -> Response: return self.rest_api.get_asset_movements( from_timestamp=from_timestamp, to_timestamp=to_timestamp, location=location, async_query=async_query, only_cache=only_cache, )
class TradesResource(BaseResource): get_schema = TimerangeLocationCacheQuerySchema() put_schema = TradeSchema() patch_schema = TradePatchSchema() delete_schema = TradeDeleteSchema() @use_kwargs(get_schema, location='json_and_query') def get( self, from_timestamp: Timestamp, to_timestamp: Timestamp, location: Optional[Location], async_query: bool, only_cache: bool, ) -> Response: return self.rest_api.get_trades( from_ts=from_timestamp, to_ts=to_timestamp, location=location, async_query=async_query, only_cache=only_cache, ) @use_kwargs(put_schema, location='json') def put( self, timestamp: Timestamp, location: Location, base_asset: Asset, quote_asset: Asset, trade_type: TradeType, amount: AssetAmount, rate: Price, fee: Optional[Fee], fee_currency: Optional[Asset], link: Optional[str], notes: Optional[str], ) -> Response: return self.rest_api.add_trade( timestamp=timestamp, location=location, base_asset=base_asset, quote_asset=quote_asset, trade_type=trade_type, amount=amount, rate=rate, fee=fee, fee_currency=fee_currency, link=link, notes=notes, ) @use_kwargs(patch_schema, location='json') def patch( self, trade_id: str, timestamp: Timestamp, location: Location, base_asset: Asset, quote_asset: Asset, trade_type: TradeType, amount: AssetAmount, rate: Price, fee: Optional[Fee], fee_currency: Optional[Asset], link: Optional[str], notes: Optional[str], ) -> Response: return self.rest_api.edit_trade( trade_id=trade_id, timestamp=timestamp, location=location, base_asset=base_asset, quote_asset=quote_asset, trade_type=trade_type, amount=amount, rate=rate, fee=fee, fee_currency=fee_currency, link=link, notes=notes, ) @use_kwargs(delete_schema, location='json') def delete(self, trade_id: str) -> Response: return self.rest_api.delete_trade(trade_id=trade_id)