Skip to content

Commit 89b6919

Browse files
committed
Port get_offers_count
1 parent 84da072 commit 89b6919

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,
@@ -2453,12 +2454,15 @@ async def get_all_offers(self, request: dict[str, Any]) -> EndpointResult:
24532454

24542455
return {"trade_records": result, "offers": offer_values}
24552456

2456-
async def get_offers_count(self, request: dict[str, Any]) -> EndpointResult:
2457+
@marshal
2458+
async def get_offers_count(self, request: Empty) -> GetOffersCountResponse:
24572459
trade_mgr = self.service.wallet_state_manager.trade_manager
24582460

24592461
(total, my_offers_count, taken_offers_count) = await trade_mgr.trade_store.get_trades_count()
24602462

2461-
return {"total": total, "my_offers_count": my_offers_count, "taken_offers_count": taken_offers_count}
2463+
return GetOffersCountResponse(
2464+
total=uint16(total), my_offers_count=uint16(my_offers_count), taken_offers_count=uint16(taken_offers_count)
2465+
)
24622466

24632467
@tx_endpoint(push=True)
24642468
async def cancel_offer(

0 commit comments

Comments
 (0)