44import sentinel_protobuf .sentinel .session .v2 .querier_pb2 as sentinel_session_v2_querier_pb2
55import sentinel_protobuf .sentinel .session .v2 .querier_pb2_grpc as sentinel_session_v2_querier_pb2_grpc
66import sentinel_protobuf .sentinel .session .v2 .msg_pb2 as msg_pb2
7- import sentinel_protobuf .sentinel .session .v2 .proof_pb2 as proof_pb2
7+
8+ from sentinel_protobuf .sentinel .session .v2 .proof_pb2 import Proof
9+ from sentinel_protobuf .sentinel .types .v1 .bandwidth_pb2 import Bandwidth
10+ from google .protobuf .duration_pb2 import Duration
811
912from sentinel_sdk .querier .querier import Querier
1013from sentinel_sdk .transactor .transactor import Transactor
@@ -80,7 +83,7 @@ def QuerySessionsForSubscription(
8083 id = subscription_id ,
8184 pagination = pagination ,
8285 )
83-
86+
8487 def StartSession (self , address : str , session_id : int , tx_params : TxParams = TxParams ()):
8588 msg = msg_pb2 .MsgStartRequest (
8689 frm = self ._account .address ,
@@ -97,10 +100,17 @@ def EndSession(self, session_id: int, rating: int, tx_params: TxParams = TxParam
97100 )
98101 return self .transaction ([msg ], tx_params )
99102
100- def UpdateDetails (self , proof : proof_pb2 . Proof , signature : bytes , tx_params : TxParams = TxParams ()):
103+ def UpdateDetails (self , proof : Proof , signature : bytes , tx_params : TxParams = TxParams ()):
101104 msg = msg_pb2 .MsgUpdateDetailsRequest (
102105 frm = self ._account .address ,
103106 proof = proof ,
104107 signature = signature ,
105108 )
106- return self .transaction ([msg ], tx_params )
109+ return self .transaction ([msg ], tx_params )
110+
111+ def Proof (self , session_id : int , bandwidth : Bandwidth , duration : Duration ) -> Proof :
112+ return Proof (
113+ id = session_id ,
114+ bandwidth = bandwidth ,
115+ duration = duration
116+ )
0 commit comments