transaction_envelope.proto 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. syntax = "proto3";
  2. package pyth_lazer;
  3. import "google/protobuf/timestamp.proto";
  4. import "pyth_lazer_transaction.proto";
  5. // Envelope containing signed transaction and context attached by Pyth Lazer.
  6. // Created by Pyth Lazer Relayers, which also generate and attach the context.
  7. message TransactionEnvelope {
  8. // [required] signed transaction encoded with protobuf
  9. optional SignedLazerTransaction signed_transaction = 1;
  10. // [required] context attached by pyth lazer relayer
  11. optional PayloadContext payload_context = 2;
  12. }
  13. // Context attached by Pyth Lazer Relayer containing information necessary for processing transaction.
  14. // Has different context data depending on the type of transaction.
  15. // Submitted over Message Queue to be read by rest of Pyth Lazer service.
  16. message PayloadContext {
  17. // [required] timestamp wwhen relayer received the signed transaction
  18. optional google.protobuf.Timestamp relayer_receive_timestamp = 1;
  19. // [required] context set based on type of transaction
  20. oneof context {
  21. PublisherUpdateContext publisher_update_context = 2;
  22. }
  23. }
  24. // Context contains status of each feed update found in transaction
  25. message PublisherUpdateContext {
  26. // [required] ID of publisher based on the access token used to connect
  27. optional uint32 publisher_id = 1;
  28. // [required] context for each feed update
  29. // must exactly match length and order of feed updates
  30. // order of updates are preserved between encoding/decoding
  31. repeated FeedUpdateContext feed_update_context = 2;
  32. }
  33. // State for each feed update.
  34. // Each feed update is validated and may be marked as rejected by Relayer.
  35. message FeedUpdateContext {
  36. // [required] status of feed update
  37. oneof status {
  38. Accepted accepted = 1;
  39. Rejected rejected = 2;
  40. }
  41. }
  42. // Accepted publisher update
  43. message Accepted {}
  44. // Rejected publisher update and its reason for being rejected
  45. message Rejected {
  46. // [required] reason for rejection
  47. RejectReason reject_reason = 1;
  48. }
  49. // The reasons that a publisher update might be rejected for
  50. enum RejectReason {
  51. InvalidTimestamp = 0;
  52. PriceDeviation = 1;
  53. PriceOverflow = 2;
  54. InvalidFeedId = 3;
  55. MissingFields = 4;
  56. InactiveFeedId = 5;
  57. }