@@ -4,9 +4,7 @@ option go_package = "github.com/code-payments/code-protobuf-api/generated/go/mes
44option java_package = "com.codeinc.opencode.gen.messaging.v1" ;
55option objc_class_prefix = "CPBMessagingV1" ;
66import "common/v1/model.proto" ;
7- import "transaction/v2/transaction_service.proto" ;
87
9- import "google/protobuf/timestamp.proto" ;
108service Messaging {
119 // OpenMessageStream opens a stream of messages. Messages are routed using the
1210 // public key of a rendezvous keypair derived by both the sender and the
@@ -24,24 +22,6 @@ service Messaging {
2422 // 3. The payment recipient scans the code and uses SendMessage to send their account ID
2523 // back to the sender via the rendezvous public key.
2624 // 4. The payment sender receives the message, submits the intent, and closes the stream.
27- //
28- // For receiving a bill of requested value, the expected flow is as follows:
29- // 1. The payment recipient uses SendMessage to send their account ID and payment amount to
30- // the sender via the rendezvous public key, which is derived by using sha256(scan payload)
31- // as the keypair seed.
32- // 2. The payment recipient calls OpenMessageStream on the rendezvous public key to listen
33- // for status messages generated by client/server. It must ignore the original message it sent
34- // as part of step 1.
35- // 3. The payment recipient creates a payment request scan code
36- // 4. The payment sender calls PollMessages on the rendezvous public key. This is ok because
37- // we know the message exists per step 1, and doesn't actually incur a long poll. This is a
38- // required hack because we don't have the infrastructure in place to allow multiple listens
39- // on the same stream, and the recipient needs real-time status updates.
40- // 5. The payment sender receives the message (any status messages are ignored), and submits the
41- // intent.
42- // 6. The payment recipient observes status message (eg. IntentSubmitted, ClientRejectedPayment,
43- // WebhookCalled) for payment state.
44- // 7. The payment recipient closes the stream once the payment hits a terminal state, or times out.
4525 rpc OpenMessageStream (OpenMessageStreamRequest ) returns (stream OpenMessageStreamResponse );
4626 // OpenMessageStreamWithKeepAlive is like OpenMessageStream, but enables a ping/pong
4727 // keepalive to determine the health of the stream at both the client and server.
@@ -158,82 +138,6 @@ message RequestToGrabBill {
158138 // payment should be sent.
159139 common.v1.SolanaAccountId requestor_account = 1 ;
160140}
161- // Request that a bill of a requested value is created and sent to the requested
162- // address.
163- //
164- // This message type is only initiated by clients.
165- message RequestToReceiveBill {
166- // Requestor is the virtual core mint token account on the VM to which a
167- // payment should be sent.
168- common.v1.SolanaAccountId requestor_account = 1 ;
169- // The exchange data for the requested bill value.
170- oneof exchange_data {
171- // An exact amount of core mint tokens. Payment is guaranteed to transfer the specified
172- // quarks in the requested currency and exchange rate.
173- //
174- // Only supports the core mint account. Use exchange_data.partial for fiat amounts.
175- transaction.v2.ExchangeData exact = 2 ;
176- // Fiat amount request. The amount of core mint tokens are determined at
177- // time of payment with a recent exchange rate provided by the paying client
178- // and validated by server.
179- //
180- // Only supports fiat amounts. Use exchange_data.exact for the core mint account.
181- transaction.v2.ExchangeDataWithoutRate partial = 3 ;
182- }
183- //
184- // Optional fields below to identify a domain requesting to receive a bill.
185- // Verification of the domain is optional. When verified, clients can establish
186- // relationships and third parties will by able to identify users with that
187- // account after payment is made.
188- //
189- // Note on field requirements:
190- // - Verified: All of domain, verifier, signature and rendezvous_key are required
191- // - Unverified: Only domain is requried
192- //
193- // The third-party's domain name, which is its primary identifier. Server
194- // guarantees to perform domain verification against the verifier account.
195- common.v1.Domain domain = 4 ;
196- // Owner account owned by the third party used in domain verification.
197- common.v1.SolanaAccountId verifier = 5 ;
198- // Signature of this message using the verifier private key, which in addition
199- // to domain verification, authenticates the third party.
200- common.v1.Signature signature = 6 ;
201- // Rendezvous key to avoid replay attacks
202- RendezvousKey rendezvous_key = 7 ;
203- // Additional fee payments splitting the requested amount. This is in addition
204- // to the hard-coded Code $0.01 USD fee.
205- repeated transaction.v2.AdditionalFeePayment additional_fees = 8 ;
206- }
207- // A status update on a stream to indicate a scan code was scanned. This can appear
208- // multiple times for the same stream.
209- //
210- // This message type is only initiated by client
211- message CodeScanned {
212- // Timestamp the client scanned the code
213- google.protobuf.Timestamp timestamp = 1 ;
214- }
215- // Payment is rejected by the client
216- //
217- // This message type is only initiated by clients
218- message ClientRejectedPayment {
219- common.v1.IntentId intent_id = 1 ;
220- }
221- // Intent was submitted via SubmitIntent
222- //
223- // This message type is only initiated by server
224- message IntentSubmitted {
225- common.v1.IntentId intent_id = 1 ;
226- // Metadata is available for intents where it can be safely propagated publicly.
227- // Anything else requires an additional authenticated RPC call (eg. login).
228- transaction.v2.Metadata metadata = 2 ;
229- }
230- // Webhook was successfully called
231- //
232- // This message type is only initiated by server
233- message WebhookCalled {
234- // Estimated time webhook was received
235- google.protobuf.Timestamp timestamp = 1 ;
236- }
237141message Message {
238142 // MessageId is the Id of the message. This ID is generated by the
239143 // server, and will _always_ be set when receiving a message.
@@ -252,16 +156,13 @@ message Message {
252156 // Section: Cash
253157 //
254158 RequestToGrabBill request_to_grab_bill = 2 ;
255- //
256- // Section: Payment Requests
257- //
258- RequestToReceiveBill request_to_receive_bill = 5 ;
259- CodeScanned code_scanned = 6 ;
260- ClientRejectedPayment client_rejected_payment = 7 ;
261- IntentSubmitted intent_submitted = 8 ;
262- WebhookCalled webhook_called = 9 ;
263159 }
264160 reserved 4 ; // Deprecated AirdropReceived field
161+ reserved 5 ; // Deprecated RequestToReceiveBill field
162+ reserved 6 ; // Deprecated CodeScanned field
163+ reserved 7 ; // Deprecated ClientRejectedPayment field
164+ reserved 8 ; // Deprecated IntentSubmitted field
165+ reserved 9 ; // Deprecated WebhookCalled field
265166 reserved 10 ; // Deprecated RequestToLogin field
266167 reserved 11 ; // Deprecated LoginAttempt field
267168 reserved 12 ; // Deprecated ClientRejectedLogin field
0 commit comments