|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +option java_multiple_files = true; |
| 4 | +option java_package = "io.iohk.atala.prism.protos"; |
| 5 | + |
| 6 | +package io.iohk.atala.prism.protos; |
| 7 | + |
| 8 | +import "status.proto"; |
| 9 | +import "google/protobuf/timestamp.proto"; |
| 10 | + |
| 11 | +/** |
| 12 | + * A request that can be used to check service health. |
| 13 | + * All PRISM services expose an RPC that accepts this message as request. |
| 14 | + */ |
| 15 | +message HealthCheckRequest {} |
| 16 | + |
| 17 | +/** |
| 18 | + * A response that represents service health. |
| 19 | + * Status code 0 with empty response represents a healthy and reachable service, |
| 20 | + * while all other status codes represent issues with the service. |
| 21 | + */ |
| 22 | +message HealthCheckResponse {} |
| 23 | + |
| 24 | +/** |
| 25 | + * Represents a date by its parts (day, month, year). |
| 26 | + */ |
| 27 | +message Date { |
| 28 | + int32 year = 1; // A positive value. |
| 29 | + int32 month = 2; // A value in the [1, 12] range. |
| 30 | + int32 day = 3; // A value in the [1, 31] range (depending on the month, the maximum value might be 28). |
| 31 | +} |
| 32 | + |
| 33 | +/** |
| 34 | + * Represents a time interval between two given timestamps. |
| 35 | + * The message represents a closed interval (i.e. both ends are inclusive and mandatory). |
| 36 | + */ |
| 37 | +message TimeInterval { |
| 38 | + /** |
| 39 | + * The starting timestamp. |
| 40 | + * start_timestamp must be before or equal to end_timestamp. |
| 41 | + */ |
| 42 | + google.protobuf.Timestamp start_timestamp = 1; |
| 43 | + /** |
| 44 | + * The ending timestamp. |
| 45 | + * end_timestamp must be after or equal to start_timestamp. |
| 46 | + */ |
| 47 | + google.protobuf.Timestamp end_timestamp = 2; |
| 48 | +} |
| 49 | + |
| 50 | +/** |
| 51 | + * This enum provides a way for some RPC requests to specify the direction so that the response values are sorted |
| 52 | + * the way you want them to. |
| 53 | + * Note that it specifies the direction only and doesn't say anything about a comparator |
| 54 | + * (e.g. natural order, some RPC-specific order etc). |
| 55 | + */ |
| 56 | +enum SortByDirection { |
| 57 | + SORT_BY_DIRECTION_UNKNOWN = 0; // Nothing provided, each API can define whether to fail or take a default value (commonly ASCENDING). |
| 58 | + SORT_BY_DIRECTION_ASCENDING = 1; // Sort the results in ascending order. |
| 59 | + SORT_BY_DIRECTION_DESCENDING = 2; // Sort the results in descending order. |
| 60 | +} |
| 61 | + |
| 62 | +/** |
| 63 | + * The supported ledger types. Specifies which chain is used for storing transactions. |
| 64 | + */ |
| 65 | +enum Ledger { |
| 66 | + reserved 2; // Removed BITCOIN_TESTNET |
| 67 | + reserved "BITCOIN_TESTNET"; |
| 68 | + reserved 3; // Removed BITCOIN_MAINNET |
| 69 | + reserved "BITCOIN_MAINNET"; |
| 70 | + |
| 71 | + UNKNOWN_LEDGER = 0; // Invalid default value. |
| 72 | + IN_MEMORY = 1; // Store transactions in memory instead of blockchain, used only for development. |
| 73 | + CARDANO_TESTNET = 4; // Cardano testnet, used for testing. |
| 74 | + CARDANO_MAINNET = 5; // Cardano mainnet, used in production. |
| 75 | +} |
| 76 | + |
| 77 | +/** |
| 78 | + * Information about a ledger block. |
| 79 | + * See Ledger documentation for details on which ledgers are possible. |
| 80 | + */ |
| 81 | +message BlockInfo { |
| 82 | + reserved 2; // Removed timestamp_deprecated field |
| 83 | + reserved "timestamp_deprecated"; |
| 84 | + |
| 85 | + int32 number = 1; // Number of the block in the ledger. |
| 86 | + int32 index = 3; // Index of the transaction within the block. |
| 87 | + google.protobuf.Timestamp timestamp = 4; // Timestamp when the block was created. |
| 88 | +} |
| 89 | + |
| 90 | +/** |
| 91 | + * Information about a ledger transaction and the block that the transaction is included in. |
| 92 | + */ |
| 93 | +message TransactionInfo { |
| 94 | + string transaction_id = 1; // Transaction ID. |
| 95 | + Ledger ledger = 2; // Ledger the transaction was published to. |
| 96 | + BlockInfo block = 3; // Block the transaction was included in. |
| 97 | +} |
| 98 | + |
| 99 | +/** |
| 100 | + * The status of an Atala operation. |
| 101 | + */ |
| 102 | +enum OperationStatus { |
| 103 | + UNKNOWN_OPERATION = 0; // The operation hasn't been received by the node service yet. |
| 104 | + PENDING_SUBMISSION = 1; // The transaction containing this operation hasn't been published to the chain yet. |
| 105 | + AWAIT_CONFIRMATION = 2; // The transaction containing this operation has been published to the chain, but hasn't been processed by PRISM yet. |
| 106 | + CONFIRMED_AND_APPLIED = 3; // The operation has been successfully applied to the PRISM. |
| 107 | + CONFIRMED_AND_REJECTED = 4; // The operation has been processed by PRISM, but rejected because of some error. |
| 108 | +} |
| 109 | + |
| 110 | +message AtalaErrorMessage { |
| 111 | + google.rpc.Status status = 1; |
| 112 | +} |
| 113 | + |
| 114 | +message AtalaMessage { |
| 115 | + oneof message { |
| 116 | + AtalaErrorMessage atala_error_message = 9; |
| 117 | + } |
| 118 | +} |
| 119 | + |
| 120 | +message ConnectionsStatusRequest { |
| 121 | + repeated string connection_tokens = 1; |
| 122 | +} |
0 commit comments