55/// See the `DipsService.CancelAgreement` method.
66#[ derive( Clone , PartialEq , :: prost:: Message ) ]
77pub struct CancelAgreementRequest {
8- /// / The ID of the agreement to cancel.
9- #[ prost( bytes = "vec" , tag = "1" ) ]
10- pub agreement_id : :: prost:: alloc:: vec:: Vec < u8 > ,
11- /// / The signature of the message.
12- #[ prost( bytes = "vec" , tag = "99" ) ]
13- pub signature : :: prost:: alloc:: vec:: Vec < u8 > ,
8+ #[ prost( uint64, tag = "1" ) ]
9+ pub version : u64 ,
10+ /// / a signed ERC-712 message cancelling an agreement
11+ #[ prost( bytes = "vec" , tag = "2" ) ]
12+ pub signed_cancellation : :: prost:: alloc:: vec:: Vec < u8 > ,
1413}
1514/// *
1615/// A response to a request to cancel an _indexing agreement_.
1716///
1817/// See the `DipsService.CancelAgreement` method.
1918///
20- /// Empty message
19+ /// / Empty response, eventually we may add custom status codes
2120#[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
2221pub struct CancelAgreementResponse { }
2322/// *
24- /// A request to report the progress of an _indexing agreement_.
23+ /// A request to collect payment _indexing agreement_.
2524///
26- /// See the `DipsService.ReportProgress ` method.
25+ /// See the `DipsService.CollectPayment ` method.
2726#[ derive( Clone , PartialEq , :: prost:: Message ) ]
28- pub struct ReportProgressRequest {
29- /// / The ID of the agreement to report progress for.
30- #[ prost( bytes = "vec" , tag = "1" ) ]
31- pub agreement_id : :: prost:: alloc:: vec:: Vec < u8 > ,
32- /// / The signature of the message.
33- #[ prost( bytes = "vec" , tag = "99" ) ]
34- pub signature : :: prost:: alloc:: vec:: Vec < u8 > ,
27+ pub struct CollectPaymentRequest {
28+ #[ prost( uint64, tag = "1" ) ]
29+ pub version : u64 ,
30+ #[ prost( bytes = "vec" , tag = "2" ) ]
31+ pub signed_collection : :: prost:: alloc:: vec:: Vec < u8 > ,
3532}
3633/// *
37- /// A response to a request to report the progress of an _indexing agreement_.
34+ /// A response to a request to collect payment for an _indexing agreement_.
3835///
39- /// See the `DipsService.ReportProgress` method.
40- ///
41- /// TODO(LNSD): Add fields to the message
42- #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
43- pub struct ReportProgressResponse { }
36+ /// See the `DipsService.CollectAgreement` method.
37+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
38+ pub struct CollectPaymentResponse {
39+ #[ prost( uint64, tag = "1" ) ]
40+ pub version : u64 ,
41+ #[ prost( enumeration = "CollectPaymentStatus" , tag = "2" ) ]
42+ pub status : i32 ,
43+ #[ prost( bytes = "vec" , tag = "3" ) ]
44+ pub tap_receipt : :: prost:: alloc:: vec:: Vec < u8 > ,
45+ }
46+ /// *
47+ /// The status on response to collect an _indexing agreement_.
48+ #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
49+ #[ repr( i32 ) ]
50+ pub enum CollectPaymentStatus {
51+ /// / The payment request was accepted.
52+ Accept = 0 ,
53+ /// / The payment request was done before min epochs passed
54+ ErrTooEarly = 1 ,
55+ /// / The payment request was done after max epochs passed
56+ ErrTooLate = 2 ,
57+ /// / The payment request is for too large an amount
58+ ErrAmountOutOfBounds = 3 ,
59+ /// / Something else went terribly wrong
60+ ErrUnknown = 99 ,
61+ }
62+ impl CollectPaymentStatus {
63+ /// String value of the enum field names used in the ProtoBuf definition.
64+ ///
65+ /// The values are not transformed in any way and thus are considered stable
66+ /// (if the ProtoBuf definition does not change) and safe for programmatic use.
67+ pub fn as_str_name ( & self ) -> & ' static str {
68+ match self {
69+ Self :: Accept => "ACCEPT" ,
70+ Self :: ErrTooEarly => "ERR_TOO_EARLY" ,
71+ Self :: ErrTooLate => "ERR_TOO_LATE" ,
72+ Self :: ErrAmountOutOfBounds => "ERR_AMOUNT_OUT_OF_BOUNDS" ,
73+ Self :: ErrUnknown => "ERR_UNKNOWN" ,
74+ }
75+ }
76+ /// Creates an enum from field names used in the ProtoBuf definition.
77+ pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
78+ match value {
79+ "ACCEPT" => Some ( Self :: Accept ) ,
80+ "ERR_TOO_EARLY" => Some ( Self :: ErrTooEarly ) ,
81+ "ERR_TOO_LATE" => Some ( Self :: ErrTooLate ) ,
82+ "ERR_AMOUNT_OUT_OF_BOUNDS" => Some ( Self :: ErrAmountOutOfBounds ) ,
83+ "ERR_UNKNOWN" => Some ( Self :: ErrUnknown ) ,
84+ _ => None ,
85+ }
86+ }
87+ }
4488/// Generated client implementations.
4589pub mod dips_service_client {
4690 #![ allow(
@@ -167,15 +211,15 @@ pub mod dips_service_client {
167211 self . inner . unary ( req, path, codec) . await
168212 }
169213 /// *
170- /// Report the progress of an _indexing agreement_.
214+ /// Collect payment for an _indexing agreement_.
171215 ///
172216 /// This method allows the indexer to report the work completed to the DIPs gateway
173217 /// and receive payment for the indexing work done.
174- pub async fn report_progress (
218+ pub async fn collect_payment (
175219 & mut self ,
176- request : impl tonic:: IntoRequest < super :: ReportProgressRequest > ,
220+ request : impl tonic:: IntoRequest < super :: CollectPaymentRequest > ,
177221 ) -> std:: result:: Result <
178- tonic:: Response < super :: ReportProgressResponse > ,
222+ tonic:: Response < super :: CollectPaymentResponse > ,
179223 tonic:: Status ,
180224 > {
181225 self . inner
@@ -188,14 +232,14 @@ pub mod dips_service_client {
188232 } ) ?;
189233 let codec = tonic:: codec:: ProstCodec :: default ( ) ;
190234 let path = http:: uri:: PathAndQuery :: from_static (
191- "/graphprotocol.gateway.dips.DipsService/ReportProgress " ,
235+ "/graphprotocol.gateway.dips.DipsService/CollectPayment " ,
192236 ) ;
193237 let mut req = request. into_request ( ) ;
194238 req. extensions_mut ( )
195239 . insert (
196240 GrpcMethod :: new (
197241 "graphprotocol.gateway.dips.DipsService" ,
198- "ReportProgress " ,
242+ "CollectPayment " ,
199243 ) ,
200244 ) ;
201245 self . inner . unary ( req, path, codec) . await
0 commit comments