@@ -40,8 +40,51 @@ pub struct CollectPaymentResponse {
4040 pub version : u64 ,
4141 #[ prost( enumeration = "CollectPaymentStatus" , tag = "2" ) ]
4242 pub status : i32 ,
43- #[ prost( bytes = "vec" , tag = "3" ) ]
44- pub tap_receipt : :: prost:: alloc:: vec:: Vec < u8 > ,
43+ /// Receipt ID for polling
44+ #[ prost( string, tag = "3" ) ]
45+ pub receipt_id : :: prost:: alloc:: string:: String ,
46+ /// Payment amount in GRT
47+ #[ prost( string, tag = "4" ) ]
48+ pub amount : :: prost:: alloc:: string:: String ,
49+ /// Initial status: "PENDING"
50+ #[ prost( string, tag = "5" ) ]
51+ pub payment_status : :: prost:: alloc:: string:: String ,
52+ }
53+ /// *
54+ /// A request to get receipt status by ID.
55+ ///
56+ /// See the `GatewayDipsService.GetReceiptById` method.
57+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
58+ pub struct GetReceiptByIdRequest {
59+ #[ prost( uint64, tag = "1" ) ]
60+ pub version : u64 ,
61+ #[ prost( string, tag = "2" ) ]
62+ pub receipt_id : :: prost:: alloc:: string:: String ,
63+ }
64+ /// *
65+ /// A response containing the receipt status.
66+ ///
67+ /// See the `GatewayDipsService.GetReceiptById` method.
68+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
69+ pub struct GetReceiptByIdResponse {
70+ #[ prost( uint64, tag = "1" ) ]
71+ pub version : u64 ,
72+ #[ prost( string, tag = "2" ) ]
73+ pub receipt_id : :: prost:: alloc:: string:: String ,
74+ /// "PENDING" | "SUBMITTED" | "FAILED"
75+ #[ prost( string, tag = "3" ) ]
76+ pub status : :: prost:: alloc:: string:: String ,
77+ /// Present when SUBMITTED
78+ #[ prost( string, tag = "4" ) ]
79+ pub transaction_hash : :: prost:: alloc:: string:: String ,
80+ /// Present when FAILED
81+ #[ prost( string, tag = "5" ) ]
82+ pub error_message : :: prost:: alloc:: string:: String ,
83+ #[ prost( string, tag = "6" ) ]
84+ pub amount : :: prost:: alloc:: string:: String ,
85+ /// ISO timestamp when SUBMITTED
86+ #[ prost( string, tag = "7" ) ]
87+ pub payment_submitted_at : :: prost:: alloc:: string:: String ,
4588}
4689/// *
4790/// The status on response to collect an _indexing agreement_.
@@ -244,6 +287,40 @@ pub mod gateway_dips_service_client {
244287 ) ;
245288 self . inner . unary ( req, path, codec) . await
246289 }
290+ /// *
291+ /// Get the status of a payment receipt by ID.
292+ ///
293+ /// This method allows the indexer to poll for the status of a previously
294+ /// initiated payment collection.
295+ pub async fn get_receipt_by_id (
296+ & mut self ,
297+ request : impl tonic:: IntoRequest < super :: GetReceiptByIdRequest > ,
298+ ) -> std:: result:: Result <
299+ tonic:: Response < super :: GetReceiptByIdResponse > ,
300+ tonic:: Status ,
301+ > {
302+ self . inner
303+ . ready ( )
304+ . await
305+ . map_err ( |e| {
306+ tonic:: Status :: unknown (
307+ format ! ( "Service was not ready: {}" , e. into( ) ) ,
308+ )
309+ } ) ?;
310+ let codec = tonic:: codec:: ProstCodec :: default ( ) ;
311+ let path = http:: uri:: PathAndQuery :: from_static (
312+ "/graphprotocol.gateway.dips.GatewayDipsService/GetReceiptById" ,
313+ ) ;
314+ let mut req = request. into_request ( ) ;
315+ req. extensions_mut ( )
316+ . insert (
317+ GrpcMethod :: new (
318+ "graphprotocol.gateway.dips.GatewayDipsService" ,
319+ "GetReceiptById" ,
320+ ) ,
321+ ) ;
322+ self . inner . unary ( req, path, codec) . await
323+ }
247324 }
248325}
249326/// Generated server implementations.
@@ -283,6 +360,18 @@ pub mod gateway_dips_service_server {
283360 tonic:: Response < super :: CollectPaymentResponse > ,
284361 tonic:: Status ,
285362 > ;
363+ /// *
364+ /// Get the status of a payment receipt by ID.
365+ ///
366+ /// This method allows the indexer to poll for the status of a previously
367+ /// initiated payment collection.
368+ async fn get_receipt_by_id (
369+ & self ,
370+ request : tonic:: Request < super :: GetReceiptByIdRequest > ,
371+ ) -> std:: result:: Result <
372+ tonic:: Response < super :: GetReceiptByIdResponse > ,
373+ tonic:: Status ,
374+ > ;
286375 }
287376 #[ derive( Debug ) ]
288377 pub struct GatewayDipsServiceServer < T > {
@@ -452,6 +541,55 @@ pub mod gateway_dips_service_server {
452541 } ;
453542 Box :: pin ( fut)
454543 }
544+ "/graphprotocol.gateway.dips.GatewayDipsService/GetReceiptById" => {
545+ #[ allow( non_camel_case_types) ]
546+ struct GetReceiptByIdSvc < T : GatewayDipsService > ( pub Arc < T > ) ;
547+ impl <
548+ T : GatewayDipsService ,
549+ > tonic:: server:: UnaryService < super :: GetReceiptByIdRequest >
550+ for GetReceiptByIdSvc < T > {
551+ type Response = super :: GetReceiptByIdResponse ;
552+ type Future = BoxFuture <
553+ tonic:: Response < Self :: Response > ,
554+ tonic:: Status ,
555+ > ;
556+ fn call (
557+ & mut self ,
558+ request : tonic:: Request < super :: GetReceiptByIdRequest > ,
559+ ) -> Self :: Future {
560+ let inner = Arc :: clone ( & self . 0 ) ;
561+ let fut = async move {
562+ <T as GatewayDipsService >:: get_receipt_by_id (
563+ & inner,
564+ request,
565+ )
566+ . await
567+ } ;
568+ Box :: pin ( fut)
569+ }
570+ }
571+ let accept_compression_encodings = self . accept_compression_encodings ;
572+ let send_compression_encodings = self . send_compression_encodings ;
573+ let max_decoding_message_size = self . max_decoding_message_size ;
574+ let max_encoding_message_size = self . max_encoding_message_size ;
575+ let inner = self . inner . clone ( ) ;
576+ let fut = async move {
577+ let method = GetReceiptByIdSvc ( inner) ;
578+ let codec = tonic:: codec:: ProstCodec :: default ( ) ;
579+ let mut grpc = tonic:: server:: Grpc :: new ( codec)
580+ . apply_compression_config (
581+ accept_compression_encodings,
582+ send_compression_encodings,
583+ )
584+ . apply_max_message_size_config (
585+ max_decoding_message_size,
586+ max_encoding_message_size,
587+ ) ;
588+ let res = grpc. unary ( method, req) . await ;
589+ Ok ( res)
590+ } ;
591+ Box :: pin ( fut)
592+ }
455593 _ => {
456594 Box :: pin ( async move {
457595 let mut response = http:: Response :: new (
0 commit comments