File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -733,6 +733,27 @@ def user_rate_limit(self, user: str) -> Any:
733733 def query_spot_deploy_auction_status (self , user : str ) -> Any :
734734 return self .post ("/info" , {"type" : "spotDeployState" , "user" : user })
735735
736+ def extra_agents (self , user : str ) -> Any :
737+ """Retrieve extra agents associated with a user.
738+
739+ POST /info
740+
741+ Args:
742+ user (str): Onchain address in 42-character hexadecimal format;
743+ e.g. 0x0000000000000000000000000000000000000000.
744+
745+ Returns:
746+ [
747+ {
748+ "name": str,
749+ "address": str,
750+ "validUntil": int
751+ },
752+ ...
753+ ]
754+ """
755+ return self .post ("/info" , {"type" : "extraAgents" , "user" : user })
756+
736757 def _remap_coin_subscription (self , subscription : Subscription ) -> None :
737758 if (
738759 subscription ["type" ] == "l2Book"
Original file line number Diff line number Diff line change @@ -244,3 +244,16 @@ def test_delegator_history():
244244 assert "delta" in event , "Each event should have a 'delta' field"
245245 assert "hash" in event , "Each event should have a transaction 'hash'"
246246 assert "time" in event , "Each event should have a 'time' field"
247+
248+
249+ @pytest .mark .vcr ()
250+ def test_extra_agents ():
251+ info = Info (skip_ws = True , meta = TEST_META , spot_meta = TEST_SPOT_META )
252+ response = info .extra_agents (user = "0xd42f2bB0e06455eDB652e27b7374FC2bDa8448ee" )
253+ assert isinstance (response , list ), "The response should be a list"
254+ # Extra agents should contain agent information
255+ if len (response ) > 0 :
256+ agent = response [0 ]
257+ assert "name" in agent , "Each agent should have a 'name' field"
258+ assert "address" in agent , "Each agent should have an 'address' field"
259+ assert "validUntil" in agent , "Each agent should have a 'validUntil' field"
You can’t perform that action at this time.
0 commit comments