Skip to content

Commit 1426956

Browse files
committed
Port get_offers_count
1 parent 9f66e2d commit 1426956

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

chia/wallet/wallet_rpc_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
GetNextAddressResponse,
194194
GetNotifications,
195195
GetNotificationsResponse,
196+
GetOffersCountResponse,
196197
GetPrivateKey,
197198
GetPrivateKeyFormat,
198199
GetPrivateKeyResponse,
@@ -2456,12 +2457,15 @@ async def get_all_offers(self, request: dict[str, Any]) -> EndpointResult:
24562457

24572458
return {"trade_records": result, "offers": offer_values}
24582459

2459-
async def get_offers_count(self, request: dict[str, Any]) -> EndpointResult:
2460+
@marshal
2461+
async def get_offers_count(self, request: Empty) -> GetOffersCountResponse:
24602462
trade_mgr = self.service.wallet_state_manager.trade_manager
24612463

24622464
(total, my_offers_count, taken_offers_count) = await trade_mgr.trade_store.get_trades_count()
24632465

2464-
return {"total": total, "my_offers_count": my_offers_count, "taken_offers_count": taken_offers_count}
2466+
return GetOffersCountResponse(
2467+
total=uint16(total), my_offers_count=uint16(my_offers_count), taken_offers_count=uint16(taken_offers_count)
2468+
)
24652469

24662470
@tx_endpoint(push=True)
24672471
async def cancel_offer(

0 commit comments

Comments
 (0)