From 5bf7b2e289131fb61bfef612bad72f170fd2b272 Mon Sep 17 00:00:00 2001 From: David Edey Date: Wed, 24 Jan 2024 04:18:16 +0000 Subject: [PATCH 1/4] feature: Add `/stream/proofs` to Core API --- .../core-api-server/core-api-schema.yaml | 337 +++++++++++++++--- .../scripts/generate-openapi-server.py | 2 + .../src/core_api/conversions/errors.rs | 5 + .../src/core_api/conversions/mod.rs | 2 + .../src/core_api/conversions/pagination.rs | 83 +++++ .../core-api-server/src/core_api/errors.rs | 17 + .../models/epoch_end_ledger_proof.rs | 31 ++ .../generated/models/error_response.rs | 14 + .../generated/models/error_response_type.rs | 3 + .../generated/models/ledger_header.rs | 4 + .../src/core_api/generated/models/mod.rs | 42 ++- .../models/stream_proofs_error_details.rs | 31 ++ ...r_details_requested_epoch_out_of_bounds.rs | 32 ++ ...ls_requested_epoch_out_of_bounds_all_of.rs | 29 ++ ...s_requested_state_version_out_of_bounds.rs | 31 ++ ...ted_state_version_out_of_bounds_all_of.rs} | 8 +- .../stream_proofs_error_details_type.rs | 39 ++ .../models/stream_proofs_error_response.rs | 43 +++ .../stream_proofs_error_response_all_of.rs | 28 ++ .../generated/models/stream_proofs_filter.rs | 47 +++ .../models/stream_proofs_filter_all.rs | 32 ++ .../models/stream_proofs_filter_all_all_of.rs | 29 ++ .../models/stream_proofs_filter_new_epochs.rs | 32 ++ .../stream_proofs_filter_new_epochs_all_of.rs | 29 ++ ...proofs_filter_protocol_update_execution.rs | 36 ++ ...filter_protocol_update_execution_all_of.rs | 33 ++ ..._filter_protocol_update_initializations.rs | 32 ++ .../models/stream_proofs_filter_type.rs | 45 +++ .../generated/models/stream_proofs_request.rs | 42 +++ .../models/stream_proofs_response.rs | 33 ++ .../models/stream_transactions_response.rs | 2 +- .../src/core_api/handlers/mod.rs | 2 + .../src/core_api/handlers/stream_proofs.rs | 211 +++++++++++ .../core_api/handlers/stream_transactions.rs | 5 + .../core-api-server/src/core_api/server.rs | 1 + .../src/protocol/protocol_state.rs | 2 +- core-rust/state-manager/src/store/rocks_db.rs | 16 +- core-rust/state-manager/src/store/traits.rs | 7 +- .../api/core/generated/api/LtsApi.java | 2 +- .../api/core/generated/api/StreamApi.java | 83 ++++- .../generated/models/BasicErrorResponse.java | 3 + .../generated/models/EpochEndLedgerProof.java | 146 ++++++++ .../core/generated/models/ErrorResponse.java | 5 + .../generated/models/ErrorResponseType.java | 4 +- .../core/generated/models/LedgerHeader.java | 38 +- .../LtsTransactionSubmitErrorResponse.java | 3 + ...edStateVersionOutOfBoundsErrorDetails.java | 2 +- .../models/StreamProofsErrorDetails.java | 140 ++++++++ ...ErrorDetailsRequestedEpochOutOfBounds.java | 142 ++++++++ ...DetailsRequestedEpochOutOfBoundsAllOf.java | 113 ++++++ ...tailsRequestedStateVersionOutOfBounds.java | 142 ++++++++ ...equestedStateVersionOutOfBoundsAllOf.java} | 18 +- .../models/StreamProofsErrorDetailsType.java | 61 ++++ .../models/StreamProofsErrorResponse.java | 150 ++++++++ .../StreamProofsErrorResponseAllOf.java | 112 ++++++ .../generated/models/StreamProofsFilter.java | 150 ++++++++ .../models/StreamProofsFilterAll.java | 148 ++++++++ .../models/StreamProofsFilterAllAllOf.java | 113 ++++++ .../models/StreamProofsFilterNewEpochs.java | 148 ++++++++ .../StreamProofsFilterNewEpochsAllOf.java | 113 ++++++ ...amProofsFilterProtocolUpdateExecution.java | 180 ++++++++++ ...ofsFilterProtocolUpdateExecutionAllOf.java | 145 ++++++++ ...fsFilterProtocolUpdateInitializations.java | 148 ++++++++ .../models/StreamProofsFilterType.java | 65 ++++ .../generated/models/StreamProofsRequest.java | 209 +++++++++++ .../models/StreamProofsResponse.java | 151 ++++++++ .../StreamTransactionsErrorResponse.java | 3 + .../models/StreamTransactionsResponse.java | 4 +- .../TransactionSubmitErrorResponse.java | 3 + .../lib/generated/.openapi-generator/FILES | 24 +- sdk/typescript/lib/generated/apis/LTSApi.ts | 6 +- .../lib/generated/apis/StreamApi.ts | 54 ++- .../generated/models/EpochEndLedgerProof.ts | 82 +++++ .../lib/generated/models/ErrorResponse.ts | 13 +- .../lib/generated/models/ErrorResponseType.ts | 3 +- .../lib/generated/models/LedgerHeader.ts | 8 + .../models/StreamProofsErrorDetails.ts | 72 ++++ .../models/StreamProofsErrorDetailsBase.ts | 73 ++++ ...fsErrorDetailsRequestedEpochOutOfBounds.ts | 87 +++++ ...orDetailsRequestedEpochOutOfBoundsAllOf.ts | 86 +++++ ...DetailsRequestedStateVersionOutOfBounds.ts | 85 +++++ ...sRequestedStateVersionOutOfBoundsAllOf.ts} | 26 +- .../models/StreamProofsErrorDetailsType.ts | 38 ++ .../models/StreamProofsErrorResponse.ts | 117 ++++++ .../models/StreamProofsErrorResponseAllOf.ts | 90 +++++ .../generated/models/StreamProofsFilter.ts | 94 +++++ .../generated/models/StreamProofsFilterAll.ts | 84 +++++ .../models/StreamProofsFilterAllAllOf.ts | 83 +++++ .../models/StreamProofsFilterBase.ts | 73 ++++ .../models/StreamProofsFilterNewEpochs.ts | 84 +++++ .../StreamProofsFilterNewEpochsAllOf.ts | 83 +++++ ...reamProofsFilterProtocolUpdateExecution.ts | 92 +++++ ...roofsFilterProtocolUpdateExecutionAllOf.ts | 91 +++++ ...oofsFilterProtocolUpdateInitializations.ts | 84 +++++ ...ilterProtocolUpdateInitializationsAllOf.ts | 83 +++++ .../models/StreamProofsFilterType.ts | 40 +++ .../generated/models/StreamProofsRequest.ts | 100 ++++++ .../generated/models/StreamProofsResponse.ts | 83 +++++ .../models/StreamTransactionsResponse.ts | 2 +- sdk/typescript/lib/generated/models/index.ts | 24 +- 100 files changed, 6030 insertions(+), 95 deletions(-) create mode 100644 core-rust/core-api-server/src/core_api/conversions/pagination.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/epoch_end_ledger_proof.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_epoch_out_of_bounds.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_epoch_out_of_bounds_all_of.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_state_version_out_of_bounds.rs rename core-rust/core-api-server/src/core_api/generated/models/{requested_state_version_out_of_bounds_error_details_all_of.rs => stream_proofs_error_details_requested_state_version_out_of_bounds_all_of.rs} (86%) create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_type.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_response.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_response_all_of.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs_all_of.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_initializations.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_type.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_request.rs create mode 100644 core-rust/core-api-server/src/core_api/generated/models/stream_proofs_response.rs create mode 100644 core-rust/core-api-server/src/core_api/handlers/stream_proofs.rs create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/EpochEndLedgerProof.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetails.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBounds.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.java rename core/src/test-core/java/com/radixdlt/api/core/generated/models/{RequestedStateVersionOutOfBoundsErrorDetailsAllOf.java => StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.java} (81%) create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsType.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorResponse.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorResponseAllOf.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilter.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochsAllOf.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterType.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsRequest.java create mode 100644 core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsResponse.java create mode 100644 sdk/typescript/lib/generated/models/EpochEndLedgerProof.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsErrorDetails.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsErrorDetailsBase.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBounds.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.ts rename sdk/typescript/lib/generated/models/{RequestedStateVersionOutOfBoundsErrorDetailsAllOf.ts => StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.ts} (65%) create mode 100644 sdk/typescript/lib/generated/models/StreamProofsErrorDetailsType.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsErrorResponse.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsErrorResponseAllOf.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilter.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterBase.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochs.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochsAllOf.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializations.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializationsAllOf.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsFilterType.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsRequest.ts create mode 100644 sdk/typescript/lib/generated/models/StreamProofsResponse.ts diff --git a/core-rust/core-api-server/core-api-schema.yaml b/core-rust/core-api-server/core-api-schema.yaml index 658be4d15e..33de24b2d8 100644 --- a/core-rust/core-api-server/core-api-schema.yaml +++ b/core-rust/core-api-server/core-api-schema.yaml @@ -262,13 +262,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TransactionSubmitErrorResponse" + $ref: "#/components/schemas/LtsTransactionSubmitErrorResponse" '500': description: Server error content: application/json: schema: - $ref: "#/components/schemas/TransactionSubmitErrorResponse" + $ref: "#/components/schemas/LtsTransactionSubmitErrorResponse" "/lts/transaction/status": post: summary: Get Transaction Status @@ -788,6 +788,67 @@ paths: ################## # Stream Sub-API # ################## + "/stream/proofs": + post: + summary: Stream Proofs + description: | + Returns a stream of proofs committed to the node's ledger. + + NOTE: This endpoint may return different results on different nodes: + * Each node may persist different subset of signatures on a given proofs, as long as enough + of the validator set has signed. + * Inside an epoch, different nodes may receive and persist / keep different proofs, subject to + constraints on gaps between proofs. + + Proofs during an epoch can also be garbage collected by the node after the fact. Therefore + proofs may disappear from this stream. + + Some proofs (such as during genesis and protocol update enactment) are created on a node and don't + include signatures. + + This stream accepts four different options in the request: + * All proofs forward (from state version) + * All end-of-epoch proofs (from epoch number) + * All end-of-epoch proofs triggering a protocol update + * All node-injected proofs enacting genesis or a protocol update (for protocol update name, from state version) + + The end-of-epoch proofs can be used to "trustlessly" verify the validator set for a given epoch. + By tracking the fact that validators for epoch N sign the next validator set for epoch N + 1, + this chain of proofs can be used to provide proof of the current validator set from a hardcoded + start. + + When a validator set is known for a given epoch, this can be used to verify the various transaction + hash trees in the epoch, and to prove other data. + + NOTE: This endpoint was built after agreeing the new Radix convention for paged APIs. Its models + therefore follow the new convention, rather than attempting to align with existing loose Core API conventions. + tags: + - Stream + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/StreamProofsRequest" + responses: + '200': + description: Stream proofs response + content: + application/json: + schema: + $ref: "#/components/schemas/StreamProofsResponse" + '400': + description: Client error + content: + application/json: + schema: + $ref: "#/components/schemas/StreamProofsErrorResponse" + '500': + description: Server error + content: + application/json: + schema: + $ref: "#/components/schemas/StreamProofsErrorResponse" "/stream/transactions": post: summary: Get Committed Transactions @@ -813,13 +874,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/BasicErrorResponse" + $ref: "#/components/schemas/StreamTransactionsErrorResponse" '500': description: Server error content: application/json: schema: - $ref: "#/components/schemas/BasicErrorResponse" + $ref: "#/components/schemas/StreamTransactionsErrorResponse" ################# # State Sub-API # ################# @@ -1184,6 +1245,54 @@ components: previous: description: Whether to return the previous substate value for updates and deletes (default false) type: boolean +############################################ +# GENERAL / SHARED MODELS - General Models # +############################################ + ErrorResponseType: + type: string + enum: + - Basic + - TransactionSubmit + - LtsTransactionSubmit + - StreamTransactions + - StreamProofs + ErrorResponse: + type: object + discriminator: + propertyName: error_type + mapping: + # NOTE: These need to match ErrorResponseType + Basic: "#/components/schemas/BasicErrorResponse" + TransactionSubmit: "#/components/schemas/TransactionSubmitErrorResponse" + LtsTransactionSubmit: "#/components/schemas/LtsTransactionSubmitErrorResponse" + StreamTransactions: "#/components/schemas/StreamTransactionsErrorResponse" + StreamProofs: "#/components/schemas/StreamProofsErrorResponse" + required: + - error_type + - code + - message + properties: + error_type: + $ref: "#/components/schemas/ErrorResponseType" + code: + type: integer + description: A numeric code corresponding to the given HTTP error code. + message: + description: A human-readable error message. + type: string + trace_id: + description: A GUID to be used when reporting errors, to allow correlation with the Core API's error logs, in the case where the Core API details are hidden. + type: string + BasicErrorResponse: + allOf: + - $ref: "#/components/schemas/ErrorResponse" + - type: object + ContinuationToken: + type: string + description: | + A continuation token is returned if and only if there are further non-empty pages of items currently available. + The token can be provided in a following request to fetch the next page of results. + The filter and sort should not be changed when re-using the continuation token. ########################################################### # GENERAL / SHARED MODELS - General / Numeric / Utilities # ########################################################### @@ -1632,43 +1741,6 @@ components: Whether the intent was committed in a transaction with the same payload. This is a convenience field, which can also be computed using `payload_hash` by a client knowing the payload of the submitted transaction. - ErrorResponseType: - type: string - enum: - - Basic - - TransactionSubmit - - LtsTransactionSubmit - - StreamTransactions - ErrorResponse: - type: object - discriminator: - propertyName: error_type - mapping: - # NOTE: These need to match ErrorResponseType - Basic: "#/components/schemas/BasicErrorResponse" - TransactionSubmit: "#/components/schemas/TransactionSubmitErrorResponse" - LtsTransactionSubmit: "#/components/schemas/LtsTransactionSubmitErrorResponse" - StreamTransactions: "#/components/schemas/StreamTransactionsErrorResponse" - required: - - error_type - - code - - message - properties: - error_type: - $ref: "#/components/schemas/ErrorResponseType" - code: - type: integer - description: A numeric code corresponding to the given HTTP error code. - message: - description: A human-readable error message. - type: string - trace_id: - description: A GUID to be used when reporting errors, to allow correlation with the Core API's error logs, in the case where the Core API details are hidden. - type: string - BasicErrorResponse: - allOf: - - $ref: "#/components/schemas/ErrorResponse" - - type: object ###################################### # GENERAL / SHARED MODELS - Receipts # ###################################### @@ -7072,6 +7144,184 @@ components: type: string message: type: string +############################ +# REQUEST: /stream/proofs # +########################### + StreamProofsRequest: + description: | + A request to retrieve a sublist of proofs. + type: object + required: + - network + - filter + properties: + network: + $ref: "#/components/schemas/NetworkIdentifier" + filter: + $ref: "#/components/schemas/StreamProofsFilter" + max_page_size: + description: If specified, the maximum number of proofs that will be returned. + type: integer + continuation_token: + $ref: "#/components/schemas/ContinuationToken" + StreamProofsFilterType: + type: string + enum: + - All + - NewEpochs + - ProtocolUpdateTriggers + - ProtocolUpdateExecution + StreamProofsFilter: + type: object + required: + - type + properties: + type: + $ref: "#/components/schemas/StreamProofsFilterType" + discriminator: + propertyName: type + mapping: + # NOTE: These need to match StreamProofsFilterType + All: '#/components/schemas/StreamProofsFilterAll' + NewEpochs: '#/components/schemas/StreamProofsFilterNewEpochs' + ProtocolUpdateInitializations: '#/components/schemas/StreamProofsFilterProtocolUpdateInitializations' + ProtocolUpdateExecution: '#/components/schemas/StreamProofsFilterProtocolUpdateExecution' + StreamProofsFilterAll: + allOf: + - $ref: "#/components/schemas/StreamProofsFilter" + - type: object + properties: + from_state_version: + type: integer + format: int64 + minimum: 0 + maximum: 10000000000 + description: + An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. + If empty, it starts from 0. + StreamProofsFilterNewEpochs: + allOf: + - $ref: "#/components/schemas/StreamProofsFilter" + - type: object + properties: + from_epoch: + type: integer + format: int64 + minimum: 0 + maximum: 10000000000 + description: + An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. + If empty, it starts from the first epoch proof after genesis. + The network status endpoint can be used to find the current epoch. + StreamProofsFilterProtocolUpdateInitializations: + allOf: + - $ref: "#/components/schemas/StreamProofsFilter" + - type: object + properties: + from_state_version: + type: integer + format: int64 + minimum: 0 + maximum: 10000000000 + description: + An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. + If empty, it starts from 0. + StreamProofsFilterProtocolUpdateExecution: + allOf: + - $ref: "#/components/schemas/StreamProofsFilter" + - type: object + properties: + protocol_version: + type: string + description: | + The protocol version name to filter to. This can be returned from looking at the protocol updates. + from_state_version: + type: integer + format: int64 + minimum: 0 + maximum: 10000000000 + description: + An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. + If empty, it starts from 0. + StreamProofsResponse: + type: object + required: + - page + properties: + page: + description: A page of ledger proofs stored by this node. + type: array + items: + $ref: "#/components/schemas/LedgerProof" + continuation_token: + $ref: "#/components/schemas/ContinuationToken" + StreamProofsErrorResponse: + allOf: + - $ref: "#/components/schemas/ErrorResponse" + - type: object + properties: + details: + $ref: "#/components/schemas/StreamProofsErrorDetails" + StreamProofsErrorDetailsType: + type: string + enum: + - RequestedStateVersionOutOfBounds + - RequestedEpochOutOfBounds + StreamProofsErrorDetails: + type: object + required: + - type + properties: + type: + $ref: "#/components/schemas/StreamProofsErrorDetailsType" + discriminator: + propertyName: type + mapping: + # NOTE: These need to match StreamProofsErrorDetailsType + RequestedStateVersionOutOfBounds: '#/components/schemas/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds' + RequestedEpochOutOfBounds: '#/components/schemas/StreamProofsErrorDetailsRequestedEpochOutOfBounds' + StreamProofsErrorDetailsRequestedStateVersionOutOfBounds: + allOf: + - $ref: "#/components/schemas/StreamProofsErrorDetails" + - type: object + required: + - max_ledger_state_version + properties: + max_ledger_state_version: + $ref: "#/components/schemas/StateVersion" + description: | + The maximum state version currently committed on this node's ledger. + *Note on the bounds:* the requested `from_state_version` cannot be greater than + `max_ledger_state_version + 1`. Any greater requested value triggers this error. + StreamProofsErrorDetailsRequestedEpochOutOfBounds: + allOf: + - $ref: "#/components/schemas/StreamProofsErrorDetails" + - type: object + required: + - max_ledger_epoch + properties: + max_ledger_epoch: + type: integer + format: int64 + minimum: 0 + maximum: 10000000000 + description: | + The maximum completed epoch committed to this node's ledger. + *Note on the bounds:* the requested `from_epoch` cannot be greater than + `max_ledger_epoch + 1`. Any greater requested value triggers this error. + EpochEndLedgerProof: + type: object + required: + - end_of_epoch + - ledger_proof + properties: + end_of_epoch: + type: integer + format: int64 + minimum: 0 + maximum: 10000000000 + ledger_proof: + $ref: "#/components/schemas/LedgerProof" ################################# # REQUEST: /stream/transactions # ################################# @@ -7125,7 +7375,7 @@ components: format: int32 minimum: 0 maximum: 10000 - description: An integer between `0` and `10000`, giving the total count of transactions in the returned response + description: An integer between `0` and `10000`, giving the total count of proofs in the returned response max_ledger_state_version: $ref: "#/components/schemas/StateVersion" description: The maximum state version currently committed on this node's ledger. @@ -7328,6 +7578,9 @@ components: description: An integer between `0` and `10^14`, marking the proposer timestamp in ms. next_epoch: $ref: "#/components/schemas/NextEpoch" + next_protocol_version: + type: string + description: If present, indicates that this proof triggers the enactment of the given protocol version. TimestampedValidatorSignature: type: object required: diff --git a/core-rust/core-api-server/scripts/generate-openapi-server.py b/core-rust/core-api-server/scripts/generate-openapi-server.py index 6345cd38bc..6dbd4581f4 100755 --- a/core-rust/core-api-server/scripts/generate-openapi-server.py +++ b/core-rust/core-api-server/scripts/generate-openapi-server.py @@ -146,6 +146,8 @@ def fix_for_enum_not_implementing_default(file_path, type_name): fix_for_enum_not_implementing_default(file_path, "ObjectSubstateTypeReference") fix_for_enum_not_implementing_default(file_path, "GenericSubstitution") fix_for_enum_not_implementing_default(file_path, "LedgerProofOrigin") + fix_for_enum_not_implementing_default(file_path, "StreamProofsErrorDetails") + fix_for_enum_not_implementing_default(file_path, "StreamProofsFilter") logging.info("Successfully fixed up rust models.") diff --git a/core-rust/core-api-server/src/core_api/conversions/errors.rs b/core-rust/core-api-server/src/core_api/conversions/errors.rs index 2a63b60f72..9e8abea0d3 100644 --- a/core-rust/core-api-server/src/core_api/conversions/errors.rs +++ b/core-rust/core-api-server/src/core_api/conversions/errors.rs @@ -105,6 +105,7 @@ pub enum ExtractionError { InvalidSignature, InvalidPublicKey, InvalidHash, + InvalidContinuationToken(DecodeError), InvalidTransaction(TransactionValidationError), InvalidAddress, InvalidNonFungibleId(ParseNonFungibleLocalIdError), @@ -112,6 +113,10 @@ pub enum ExtractionError { expected: NonFungibleIdType, actual: NonFungibleIdType, }, + InvalidSize { + min: usize, + max: usize, + }, } impl ExtractionError { diff --git a/core-rust/core-api-server/src/core_api/conversions/mod.rs b/core-rust/core-api-server/src/core_api/conversions/mod.rs index 65c005cbcb..e117ec92b2 100644 --- a/core-rust/core-api-server/src/core_api/conversions/mod.rs +++ b/core-rust/core-api-server/src/core_api/conversions/mod.rs @@ -6,6 +6,7 @@ mod hashes; mod keys_and_sigs; mod lts; mod numerics; +mod pagination; mod receipt; mod substates; @@ -17,5 +18,6 @@ pub use hashes::*; pub use keys_and_sigs::*; pub use lts::*; pub use numerics::*; +pub use pagination::*; pub use receipt::*; pub use substates::*; diff --git a/core-rust/core-api-server/src/core_api/conversions/pagination.rs b/core-rust/core-api-server/src/core_api/conversions/pagination.rs new file mode 100644 index 0000000000..8f7e87ebea --- /dev/null +++ b/core-rust/core-api-server/src/core_api/conversions/pagination.rs @@ -0,0 +1,83 @@ +use radix_engine::types::*; + +use crate::core_api::*; + +pub struct SizeRange { + pub min: usize, + pub default: usize, + pub max: usize, +} + +pub fn extract_valid_size( + provided: Option, + size_range: SizeRange, +) -> Result { + let SizeRange { min, default, max } = size_range; + match provided { + Some(provided) => { + if provided < 0 { + None + } else { + let provided = provided as usize; + if provided < min || provided > max { + None + } else { + Some(provided) + } + } + } + None => Some(default), + } + .ok_or(ExtractionError::InvalidSize { min, max }) +} + +pub fn extract_continuation_token( + continuation_token: Option, +) -> Result, ExtractionError> { + let Some(continuation_token) = continuation_token else { + return Ok(None); + }; + let bytes = from_hex(continuation_token)?; + let id = scrypto_decode::(&bytes).map_err(ExtractionError::InvalidContinuationToken)?; + Ok(Some(id)) +} + +pub fn to_api_continuation_token( + id_of_start_of_next_page: Option<&T>, +) -> Option { + id_of_start_of_next_page.map(|id| to_hex(scrypto_encode(id).unwrap())) +} + +pub fn optional_max(value: T, option: Option) -> T { + match option { + Some(value_2) => value.max(value_2), + None => value, + } +} + +/// Returns a page and a continuation token, representing the id of the item at the start of the next page +pub fn to_api_page( + iter: &mut dyn Iterator, + page_size: usize, + to_api_item_model: impl Fn(Item) -> Result, + to_id_for_continuation_token: impl Fn(&Item) -> ContinuationToken, +) -> Result<(Vec, Option), MappingError> { + let (page, id_of_start_of_next_page) = iter + .take(page_size + 1) + .enumerate() + .try_fold::<_, _, Result<_, MappingError>>( + (Vec::with_capacity(page_size), None), + |(mut page, mut id_of_start_of_next_page), (index, item)| { + if index < page_size { + page.push(to_api_item_model(item)?); + } else { + id_of_start_of_next_page = Some(to_id_for_continuation_token(&item)); + } + Ok((page, id_of_start_of_next_page)) + }, + )?; + Ok(( + page, + to_api_continuation_token(id_of_start_of_next_page.as_ref()), + )) +} diff --git a/core-rust/core-api-server/src/core_api/errors.rs b/core-rust/core-api-server/src/core_api/errors.rs index dd45eace4b..4deba49e2d 100644 --- a/core-rust/core-api-server/src/core_api/errors.rs +++ b/core-rust/core-api-server/src/core_api/errors.rs @@ -3,6 +3,7 @@ use axum::{ response::{IntoResponse, Response}, Json, }; +use models::stream_proofs_error_details::StreamProofsErrorDetails; use std::any::Any; use hyper::StatusCode; @@ -89,6 +90,22 @@ impl ErrorDetails for StreamTransactionsErrorDetails { } } +impl ErrorDetails for StreamProofsErrorDetails { + fn to_error_response( + details: Option, + code: i32, + message: String, + trace_id: Option, + ) -> models::ErrorResponse { + models::ErrorResponse::StreamProofsErrorResponse { + code, + message, + trace_id, + details: details.map(Box::new), + } + } +} + #[derive(Debug, Clone)] pub(crate) struct InternalServerErrorResponseForPanic; diff --git a/core-rust/core-api-server/src/core_api/generated/models/epoch_end_ledger_proof.rs b/core-rust/core-api-server/src/core_api/generated/models/epoch_end_ledger_proof.rs new file mode 100644 index 0000000000..b24c401811 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/epoch_end_ledger_proof.rs @@ -0,0 +1,31 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct EpochEndLedgerProof { + #[serde(rename = "end_of_epoch")] + pub end_of_epoch: i64, + #[serde(rename = "ledger_proof")] + pub ledger_proof: Box, +} + +impl EpochEndLedgerProof { + pub fn new(end_of_epoch: i64, ledger_proof: crate::core_api::generated::models::LedgerProof) -> EpochEndLedgerProof { + EpochEndLedgerProof { + end_of_epoch, + ledger_proof: Box::new(ledger_proof), + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/error_response.rs b/core-rust/core-api-server/src/core_api/generated/models/error_response.rs index 23508a42b2..ed0f13e3db 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/error_response.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/error_response.rs @@ -39,6 +39,20 @@ pub enum ErrorResponse { #[serde(rename = "details", skip_serializing_if = "Option::is_none")] details: Option>, }, + #[serde(rename="StreamProofs")] + StreamProofsErrorResponse { + /// A numeric code corresponding to the given HTTP error code. + #[serde(rename = "code")] + code: i32, + /// A human-readable error message. + #[serde(rename = "message")] + message: String, + /// A GUID to be used when reporting errors, to allow correlation with the Core API's error logs, in the case where the Core API details are hidden. + #[serde(rename = "trace_id", skip_serializing_if = "Option::is_none")] + trace_id: Option, + #[serde(rename = "details", skip_serializing_if = "Option::is_none")] + details: Option>, + }, #[serde(rename="StreamTransactions")] StreamTransactionsErrorResponse { /// A numeric code corresponding to the given HTTP error code. diff --git a/core-rust/core-api-server/src/core_api/generated/models/error_response_type.rs b/core-rust/core-api-server/src/core_api/generated/models/error_response_type.rs index 9a0f57e6f8..a2b8b487ee 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/error_response_type.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/error_response_type.rs @@ -20,6 +20,8 @@ pub enum ErrorResponseType { LtsTransactionSubmit, #[serde(rename = "StreamTransactions")] StreamTransactions, + #[serde(rename = "StreamProofs")] + StreamProofs, } @@ -30,6 +32,7 @@ impl ToString for ErrorResponseType { Self::TransactionSubmit => String::from("TransactionSubmit"), Self::LtsTransactionSubmit => String::from("LtsTransactionSubmit"), Self::StreamTransactions => String::from("StreamTransactions"), + Self::StreamProofs => String::from("StreamProofs"), } } } diff --git a/core-rust/core-api-server/src/core_api/generated/models/ledger_header.rs b/core-rust/core-api-server/src/core_api/generated/models/ledger_header.rs index 86f181898f..fcbbc06d17 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/ledger_header.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/ledger_header.rs @@ -31,6 +31,9 @@ pub struct LedgerHeader { pub proposer_timestamp_ms: i64, #[serde(rename = "next_epoch", skip_serializing_if = "Option::is_none")] pub next_epoch: Option>, + /// If present, indicates that this proof triggers the enactment of the given protocol version. + #[serde(rename = "next_protocol_version", skip_serializing_if = "Option::is_none")] + pub next_protocol_version: Option, } impl LedgerHeader { @@ -43,6 +46,7 @@ impl LedgerHeader { consensus_parent_round_timestamp_ms, proposer_timestamp_ms, next_epoch: None, + next_protocol_version: None, } } } diff --git a/core-rust/core-api-server/src/core_api/generated/models/mod.rs b/core-rust/core-api-server/src/core_api/generated/models/mod.rs index 57e42f2753..58d7de9f7a 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/mod.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/mod.rs @@ -246,6 +246,8 @@ pub mod entity_type; pub use self::entity_type::EntityType; pub mod epoch_change_condition; pub use self::epoch_change_condition::EpochChangeCondition; +pub mod epoch_end_ledger_proof; +pub use self::epoch_end_ledger_proof::EpochEndLedgerProof; pub mod epoch_round; pub use self::epoch_round::EpochRound; pub mod error_response; @@ -828,8 +830,6 @@ pub mod remote_generic_substitution_all_of; pub use self::remote_generic_substitution_all_of::RemoteGenericSubstitutionAllOf; pub mod requested_state_version_out_of_bounds_error_details; pub use self::requested_state_version_out_of_bounds_error_details::RequestedStateVersionOutOfBoundsErrorDetails; -pub mod requested_state_version_out_of_bounds_error_details_all_of; -pub use self::requested_state_version_out_of_bounds_error_details_all_of::RequestedStateVersionOutOfBoundsErrorDetailsAllOf; pub mod require_proof_rule; pub use self::require_proof_rule::RequireProofRule; pub mod require_proof_rule_all_of; @@ -988,6 +988,44 @@ pub mod static_blueprint_payload_def_all_of; pub use self::static_blueprint_payload_def_all_of::StaticBlueprintPayloadDefAllOf; pub mod static_role_definition_auth_template; pub use self::static_role_definition_auth_template::StaticRoleDefinitionAuthTemplate; +pub mod stream_proofs_error_details; +pub use self::stream_proofs_error_details::StreamProofsErrorDetails; +pub mod stream_proofs_error_details_requested_epoch_out_of_bounds; +pub use self::stream_proofs_error_details_requested_epoch_out_of_bounds::StreamProofsErrorDetailsRequestedEpochOutOfBounds; +pub mod stream_proofs_error_details_requested_epoch_out_of_bounds_all_of; +pub use self::stream_proofs_error_details_requested_epoch_out_of_bounds_all_of::StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf; +pub mod stream_proofs_error_details_requested_state_version_out_of_bounds; +pub use self::stream_proofs_error_details_requested_state_version_out_of_bounds::StreamProofsErrorDetailsRequestedStateVersionOutOfBounds; +pub mod stream_proofs_error_details_requested_state_version_out_of_bounds_all_of; +pub use self::stream_proofs_error_details_requested_state_version_out_of_bounds_all_of::StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf; +pub mod stream_proofs_error_details_type; +pub use self::stream_proofs_error_details_type::StreamProofsErrorDetailsType; +pub mod stream_proofs_error_response; +pub use self::stream_proofs_error_response::StreamProofsErrorResponse; +pub mod stream_proofs_error_response_all_of; +pub use self::stream_proofs_error_response_all_of::StreamProofsErrorResponseAllOf; +pub mod stream_proofs_filter; +pub use self::stream_proofs_filter::StreamProofsFilter; +pub mod stream_proofs_filter_all; +pub use self::stream_proofs_filter_all::StreamProofsFilterAll; +pub mod stream_proofs_filter_all_all_of; +pub use self::stream_proofs_filter_all_all_of::StreamProofsFilterAllAllOf; +pub mod stream_proofs_filter_new_epochs; +pub use self::stream_proofs_filter_new_epochs::StreamProofsFilterNewEpochs; +pub mod stream_proofs_filter_new_epochs_all_of; +pub use self::stream_proofs_filter_new_epochs_all_of::StreamProofsFilterNewEpochsAllOf; +pub mod stream_proofs_filter_protocol_update_execution; +pub use self::stream_proofs_filter_protocol_update_execution::StreamProofsFilterProtocolUpdateExecution; +pub mod stream_proofs_filter_protocol_update_execution_all_of; +pub use self::stream_proofs_filter_protocol_update_execution_all_of::StreamProofsFilterProtocolUpdateExecutionAllOf; +pub mod stream_proofs_filter_protocol_update_initializations; +pub use self::stream_proofs_filter_protocol_update_initializations::StreamProofsFilterProtocolUpdateInitializations; +pub mod stream_proofs_filter_type; +pub use self::stream_proofs_filter_type::StreamProofsFilterType; +pub mod stream_proofs_request; +pub use self::stream_proofs_request::StreamProofsRequest; +pub mod stream_proofs_response; +pub use self::stream_proofs_response::StreamProofsResponse; pub mod stream_transactions_error_details; pub use self::stream_transactions_error_details::StreamTransactionsErrorDetails; pub mod stream_transactions_error_details_type; diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details.rs new file mode 100644 index 0000000000..4dbdc08f80 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details.rs @@ -0,0 +1,31 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(tag = "type")] +pub enum StreamProofsErrorDetails { + #[serde(rename="RequestedEpochOutOfBounds")] + StreamProofsErrorDetailsRequestedEpochOutOfBounds { + /// The maximum completed epoch committed to this node's ledger. *Note on the bounds:* the requested `from_epoch` cannot be greater than `max_ledger_epoch + 1`. Any greater requested value triggers this error. + #[serde(rename = "max_ledger_epoch")] + max_ledger_epoch: i64, + }, + #[serde(rename="RequestedStateVersionOutOfBounds")] + StreamProofsErrorDetailsRequestedStateVersionOutOfBounds { + #[serde(rename = "max_ledger_state_version")] + max_ledger_state_version: i64, + }, +} + + + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_epoch_out_of_bounds.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_epoch_out_of_bounds.rs new file mode 100644 index 0000000000..886dba0283 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_epoch_out_of_bounds.rs @@ -0,0 +1,32 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsErrorDetailsRequestedEpochOutOfBounds { + #[serde(rename = "type")] + pub _type: crate::core_api::generated::models::StreamProofsErrorDetailsType, + /// The maximum completed epoch committed to this node's ledger. *Note on the bounds:* the requested `from_epoch` cannot be greater than `max_ledger_epoch + 1`. Any greater requested value triggers this error. + #[serde(rename = "max_ledger_epoch")] + pub max_ledger_epoch: i64, +} + +impl StreamProofsErrorDetailsRequestedEpochOutOfBounds { + pub fn new(_type: crate::core_api::generated::models::StreamProofsErrorDetailsType, max_ledger_epoch: i64) -> StreamProofsErrorDetailsRequestedEpochOutOfBounds { + StreamProofsErrorDetailsRequestedEpochOutOfBounds { + _type, + max_ledger_epoch, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_epoch_out_of_bounds_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_epoch_out_of_bounds_all_of.rs new file mode 100644 index 0000000000..00d9cdeda9 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_epoch_out_of_bounds_all_of.rs @@ -0,0 +1,29 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf { + /// The maximum completed epoch committed to this node's ledger. *Note on the bounds:* the requested `from_epoch` cannot be greater than `max_ledger_epoch + 1`. Any greater requested value triggers this error. + #[serde(rename = "max_ledger_epoch")] + pub max_ledger_epoch: i64, +} + +impl StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf { + pub fn new(max_ledger_epoch: i64) -> StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf { + StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf { + max_ledger_epoch, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_state_version_out_of_bounds.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_state_version_out_of_bounds.rs new file mode 100644 index 0000000000..9b3a94d1ff --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_state_version_out_of_bounds.rs @@ -0,0 +1,31 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsErrorDetailsRequestedStateVersionOutOfBounds { + #[serde(rename = "type")] + pub _type: crate::core_api::generated::models::StreamProofsErrorDetailsType, + #[serde(rename = "max_ledger_state_version")] + pub max_ledger_state_version: i64, +} + +impl StreamProofsErrorDetailsRequestedStateVersionOutOfBounds { + pub fn new(_type: crate::core_api::generated::models::StreamProofsErrorDetailsType, max_ledger_state_version: i64) -> StreamProofsErrorDetailsRequestedStateVersionOutOfBounds { + StreamProofsErrorDetailsRequestedStateVersionOutOfBounds { + _type, + max_ledger_state_version, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/requested_state_version_out_of_bounds_error_details_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_state_version_out_of_bounds_all_of.rs similarity index 86% rename from core-rust/core-api-server/src/core_api/generated/models/requested_state_version_out_of_bounds_error_details_all_of.rs rename to core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_state_version_out_of_bounds_all_of.rs index d8e9ae959c..d0bbefb882 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/requested_state_version_out_of_bounds_error_details_all_of.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_requested_state_version_out_of_bounds_all_of.rs @@ -12,14 +12,14 @@ #[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] -pub struct RequestedStateVersionOutOfBoundsErrorDetailsAllOf { +pub struct StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf { #[serde(rename = "max_ledger_state_version")] pub max_ledger_state_version: i64, } -impl RequestedStateVersionOutOfBoundsErrorDetailsAllOf { - pub fn new(max_ledger_state_version: i64) -> RequestedStateVersionOutOfBoundsErrorDetailsAllOf { - RequestedStateVersionOutOfBoundsErrorDetailsAllOf { +impl StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf { + pub fn new(max_ledger_state_version: i64) -> StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf { + StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf { max_ledger_state_version, } } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_type.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_type.rs new file mode 100644 index 0000000000..1bb1b01813 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_details_type.rs @@ -0,0 +1,39 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, serde::Serialize, serde::Deserialize)] +pub enum StreamProofsErrorDetailsType { + #[serde(rename = "RequestedStateVersionOutOfBounds")] + RequestedStateVersionOutOfBounds, + #[serde(rename = "RequestedEpochOutOfBounds")] + RequestedEpochOutOfBounds, + +} + +impl ToString for StreamProofsErrorDetailsType { + fn to_string(&self) -> String { + match self { + Self::RequestedStateVersionOutOfBounds => String::from("RequestedStateVersionOutOfBounds"), + Self::RequestedEpochOutOfBounds => String::from("RequestedEpochOutOfBounds"), + } + } +} + +impl Default for StreamProofsErrorDetailsType { + fn default() -> StreamProofsErrorDetailsType { + Self::RequestedStateVersionOutOfBounds + } +} + + + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_response.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_response.rs new file mode 100644 index 0000000000..361d90e412 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_response.rs @@ -0,0 +1,43 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsErrorResponse { + #[serde(rename = "error_type")] + pub error_type: crate::core_api::generated::models::ErrorResponseType, + /// A numeric code corresponding to the given HTTP error code. + #[serde(rename = "code")] + pub code: i32, + /// A human-readable error message. + #[serde(rename = "message")] + pub message: String, + /// A GUID to be used when reporting errors, to allow correlation with the Core API's error logs, in the case where the Core API details are hidden. + #[serde(rename = "trace_id", skip_serializing_if = "Option::is_none")] + pub trace_id: Option, + #[serde(rename = "details", skip_serializing_if = "Option::is_none")] + pub details: Option>, +} + +impl StreamProofsErrorResponse { + pub fn new(error_type: crate::core_api::generated::models::ErrorResponseType, code: i32, message: String) -> StreamProofsErrorResponse { + StreamProofsErrorResponse { + error_type, + code, + message, + trace_id: None, + details: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_response_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_response_all_of.rs new file mode 100644 index 0000000000..e712e79039 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_error_response_all_of.rs @@ -0,0 +1,28 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsErrorResponseAllOf { + #[serde(rename = "details", skip_serializing_if = "Option::is_none")] + pub details: Option>, +} + +impl StreamProofsErrorResponseAllOf { + pub fn new() -> StreamProofsErrorResponseAllOf { + StreamProofsErrorResponseAllOf { + details: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs new file mode 100644 index 0000000000..3e61b42498 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs @@ -0,0 +1,47 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(tag = "type")] +pub enum StreamProofsFilter { + #[serde(rename="All")] + StreamProofsFilterAll { + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] + from_state_version: Option, + }, + #[serde(rename="NewEpochs")] + StreamProofsFilterNewEpochs { + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + #[serde(rename = "from_epoch", skip_serializing_if = "Option::is_none")] + from_epoch: Option, + }, + #[serde(rename="ProtocolUpdateExecution")] + StreamProofsFilterProtocolUpdateExecution { + /// The protocol version name to filter to. This can be returned from looking at the protocol updates. + #[serde(rename = "protocol_version", skip_serializing_if = "Option::is_none")] + protocol_version: Option, + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] + from_state_version: Option, + }, + #[serde(rename="ProtocolUpdateInitializations")] + StreamProofsFilterProtocolUpdateInitializations { + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] + from_state_version: Option, + }, +} + + + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs new file mode 100644 index 0000000000..245f56fe9e --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs @@ -0,0 +1,32 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsFilterAll { + #[serde(rename = "type")] + pub _type: crate::core_api::generated::models::StreamProofsFilterType, + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] + pub from_state_version: Option, +} + +impl StreamProofsFilterAll { + pub fn new(_type: crate::core_api::generated::models::StreamProofsFilterType) -> StreamProofsFilterAll { + StreamProofsFilterAll { + _type, + from_state_version: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs new file mode 100644 index 0000000000..875d0c1436 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs @@ -0,0 +1,29 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsFilterAllAllOf { + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] + pub from_state_version: Option, +} + +impl StreamProofsFilterAllAllOf { + pub fn new() -> StreamProofsFilterAllAllOf { + StreamProofsFilterAllAllOf { + from_state_version: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs.rs new file mode 100644 index 0000000000..7ee749a690 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs.rs @@ -0,0 +1,32 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsFilterNewEpochs { + #[serde(rename = "type")] + pub _type: crate::core_api::generated::models::StreamProofsFilterType, + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + #[serde(rename = "from_epoch", skip_serializing_if = "Option::is_none")] + pub from_epoch: Option, +} + +impl StreamProofsFilterNewEpochs { + pub fn new(_type: crate::core_api::generated::models::StreamProofsFilterType) -> StreamProofsFilterNewEpochs { + StreamProofsFilterNewEpochs { + _type, + from_epoch: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs_all_of.rs new file mode 100644 index 0000000000..401414c3d1 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs_all_of.rs @@ -0,0 +1,29 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsFilterNewEpochsAllOf { + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + #[serde(rename = "from_epoch", skip_serializing_if = "Option::is_none")] + pub from_epoch: Option, +} + +impl StreamProofsFilterNewEpochsAllOf { + pub fn new() -> StreamProofsFilterNewEpochsAllOf { + StreamProofsFilterNewEpochsAllOf { + from_epoch: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs new file mode 100644 index 0000000000..9ede9667fa --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs @@ -0,0 +1,36 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsFilterProtocolUpdateExecution { + #[serde(rename = "type")] + pub _type: crate::core_api::generated::models::StreamProofsFilterType, + /// The protocol version name to filter to. This can be returned from looking at the protocol updates. + #[serde(rename = "protocol_version", skip_serializing_if = "Option::is_none")] + pub protocol_version: Option, + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] + pub from_state_version: Option, +} + +impl StreamProofsFilterProtocolUpdateExecution { + pub fn new(_type: crate::core_api::generated::models::StreamProofsFilterType) -> StreamProofsFilterProtocolUpdateExecution { + StreamProofsFilterProtocolUpdateExecution { + _type, + protocol_version: None, + from_state_version: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs new file mode 100644 index 0000000000..57b3dca31d --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs @@ -0,0 +1,33 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsFilterProtocolUpdateExecutionAllOf { + /// The protocol version name to filter to. This can be returned from looking at the protocol updates. + #[serde(rename = "protocol_version", skip_serializing_if = "Option::is_none")] + pub protocol_version: Option, + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] + pub from_state_version: Option, +} + +impl StreamProofsFilterProtocolUpdateExecutionAllOf { + pub fn new() -> StreamProofsFilterProtocolUpdateExecutionAllOf { + StreamProofsFilterProtocolUpdateExecutionAllOf { + protocol_version: None, + from_state_version: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_initializations.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_initializations.rs new file mode 100644 index 0000000000..cdb11da84c --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_initializations.rs @@ -0,0 +1,32 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsFilterProtocolUpdateInitializations { + #[serde(rename = "type")] + pub _type: crate::core_api::generated::models::StreamProofsFilterType, + /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] + pub from_state_version: Option, +} + +impl StreamProofsFilterProtocolUpdateInitializations { + pub fn new(_type: crate::core_api::generated::models::StreamProofsFilterType) -> StreamProofsFilterProtocolUpdateInitializations { + StreamProofsFilterProtocolUpdateInitializations { + _type, + from_state_version: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_type.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_type.rs new file mode 100644 index 0000000000..41a78a3388 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_type.rs @@ -0,0 +1,45 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, serde::Serialize, serde::Deserialize)] +pub enum StreamProofsFilterType { + #[serde(rename = "All")] + All, + #[serde(rename = "NewEpochs")] + NewEpochs, + #[serde(rename = "ProtocolUpdateTriggers")] + ProtocolUpdateTriggers, + #[serde(rename = "ProtocolUpdateExecution")] + ProtocolUpdateExecution, + +} + +impl ToString for StreamProofsFilterType { + fn to_string(&self) -> String { + match self { + Self::All => String::from("All"), + Self::NewEpochs => String::from("NewEpochs"), + Self::ProtocolUpdateTriggers => String::from("ProtocolUpdateTriggers"), + Self::ProtocolUpdateExecution => String::from("ProtocolUpdateExecution"), + } + } +} + +impl Default for StreamProofsFilterType { + fn default() -> StreamProofsFilterType { + Self::All + } +} + + + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_request.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_request.rs new file mode 100644 index 0000000000..5e60107589 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_request.rs @@ -0,0 +1,42 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + +/// StreamProofsRequest : A request to retrieve a sublist of proofs. + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsRequest { + /// The logical name of the network + #[serde(rename = "network")] + pub network: String, + #[serde(rename = "filter")] + pub filter: Option, // Using Option permits Default trait; Will always be Some in normal use + /// If specified, the maximum number of proofs that will be returned. + #[serde(rename = "max_page_size", skip_serializing_if = "Option::is_none")] + pub max_page_size: Option, + /// A continuation token is returned if and only if there are further non-empty pages of items currently available. The token can be provided in a following request to fetch the next page of results. The filter and sort should not be changed when re-using the continuation token. + #[serde(rename = "continuation_token", skip_serializing_if = "Option::is_none")] + pub continuation_token: Option, +} + +impl StreamProofsRequest { + /// A request to retrieve a sublist of proofs. + pub fn new(network: String, filter: crate::core_api::generated::models::StreamProofsFilter) -> StreamProofsRequest { + StreamProofsRequest { + network, + filter: Option::Some(filter), + max_page_size: None, + continuation_token: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_response.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_response.rs new file mode 100644 index 0000000000..ec5c865f42 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_response.rs @@ -0,0 +1,33 @@ +/* + * Radix Core API - Babylon + * + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] +pub struct StreamProofsResponse { + /// A page of ledger proofs stored by this node. + #[serde(rename = "page")] + pub page: Vec, + /// A continuation token is returned if and only if there are further non-empty pages of items currently available. The token can be provided in a following request to fetch the next page of results. The filter and sort should not be changed when re-using the continuation token. + #[serde(rename = "continuation_token", skip_serializing_if = "Option::is_none")] + pub continuation_token: Option, +} + +impl StreamProofsResponse { + pub fn new(page: Vec) -> StreamProofsResponse { + StreamProofsResponse { + page, + continuation_token: None, + } + } +} + + diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_transactions_response.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_transactions_response.rs index 1da1757340..e0bde27665 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_transactions_response.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_transactions_response.rs @@ -17,7 +17,7 @@ pub struct StreamTransactionsResponse { pub previous_state_identifiers: Option>, #[serde(rename = "from_state_version")] pub from_state_version: i64, - /// An integer between `0` and `10000`, giving the total count of transactions in the returned response + /// An integer between `0` and `10000`, giving the total count of proofs in the returned response #[serde(rename = "count")] pub count: i32, #[serde(rename = "max_ledger_state_version")] diff --git a/core-rust/core-api-server/src/core_api/handlers/mod.rs b/core-rust/core-api-server/src/core_api/handlers/mod.rs index 90741cdf0d..2a19715b12 100644 --- a/core-rust/core-api-server/src/core_api/handlers/mod.rs +++ b/core-rust/core-api-server/src/core_api/handlers/mod.rs @@ -13,6 +13,7 @@ mod state_validator; mod status_network_configuration; mod status_network_status; mod status_scenarios; +mod stream_proofs; mod stream_transactions; mod transaction_callpreview; mod transaction_parse; @@ -34,6 +35,7 @@ pub(crate) use state_validator::*; pub(crate) use status_network_configuration::*; pub(crate) use status_network_status::*; pub(crate) use status_scenarios::*; +pub(crate) use stream_proofs::*; pub(crate) use stream_transactions::*; pub(crate) use transaction_callpreview::*; pub(crate) use transaction_parse::*; diff --git a/core-rust/core-api-server/src/core_api/handlers/stream_proofs.rs b/core-rust/core-api-server/src/core_api/handlers/stream_proofs.rs new file mode 100644 index 0000000000..eb479b8822 --- /dev/null +++ b/core-rust/core-api-server/src/core_api/handlers/stream_proofs.rs @@ -0,0 +1,211 @@ +use crate::core_api::*; + +use state_manager::store::{traits::*, StateManagerDatabase}; +use state_manager::{LedgerProof, LedgerProofOrigin, StateVersion}; + +use transaction::prelude::*; + +#[tracing::instrument(skip(state))] +pub(crate) async fn handle_stream_proofs( + state: State, + Json(request): Json, +) -> Result, ResponseError> { + assert_matching_network(&request.network, &state.network)?; + let mapping_context = MappingContext::new(&state.network); + + let filter = request + .filter + .ok_or_else(|| client_error("filter must be present"))?; + + let page_size = extract_valid_size( + request.max_page_size, + SizeRange { + min: 1, + default: 20, + max: 100, + }, + ) + .map_err(|err| err.into_response_error("max_page_size"))?; + + let continue_from_state_version = + extract_continuation_token::(request.continuation_token) + .map_err(|err| err.into_response_error("continuation_token"))?; + + let database = state.state_manager.database.read_current(); + + use models::StreamProofsFilter::*; + let mut proofs_iter = match filter { + StreamProofsFilterAll { from_state_version } => iterate_all_proofs( + &database, + continue_from_state_version, + extract_from_state_version(&database, from_state_version)?, + ), + StreamProofsFilterNewEpochs { from_epoch } => iterate_end_of_epoch_proofs( + &database, + continue_from_state_version, + extract_from_epoch(&mapping_context, &database, from_epoch)?, + ), + StreamProofsFilterProtocolUpdateInitializations { from_state_version } => { + iterate_protocol_update_initialization_proofs( + &database, + continue_from_state_version, + extract_from_state_version(&database, from_state_version)?, + ) + } + StreamProofsFilterProtocolUpdateExecution { + from_state_version, + protocol_version, + } => iterate_protocol_update_execution_proofs( + &database, + continue_from_state_version, + extract_from_state_version(&database, from_state_version)?, + protocol_version, + ), + }?; + + let (page, continuation_token) = to_api_page( + &mut proofs_iter, + page_size, + |proof| handlers::to_api_ledger_proof(&mapping_context, proof), + |proof| proof.ledger_header.state_version, + )?; + + Ok(Json(models::StreamProofsResponse { + page, + continuation_token, + })) +} + +fn iterate_all_proofs<'a>( + database: &'a StateManagerDatabase, + continue_from_state_version: Option, + from_state_version: StateVersion, +) -> Result< + Box + 'a>, + ResponseError, +> { + let start = optional_max(from_state_version, continue_from_state_version); + + Ok(database.get_proof_iter(start)) +} + +fn iterate_end_of_epoch_proofs<'a>( + database: &'a StateManagerDatabase, + continue_from_state_version: Option, + from_epoch: Epoch, +) -> Result< + Box + 'a>, + ResponseError, +> { + let continuation_next_epoch = match continue_from_state_version { + Some(state_version) => match database.get_proof_iter(state_version).next() { + Some(proof) => Some(proof.ledger_header.epoch.next().unwrap()), + None => Err(client_error("continuation_token is not valid"))?, + }, + None => None, + }; + + let start = optional_max(from_epoch, continuation_next_epoch); + + Ok(database.get_next_epoch_proof_iter(start)) +} + +fn iterate_protocol_update_initialization_proofs<'a>( + database: &'a StateManagerDatabase, + continue_from_state_version: Option, + from_state_version: StateVersion, +) -> Result< + Box + 'a>, + ResponseError, +> { + let start = optional_max(from_state_version, continue_from_state_version); + + Ok(database.get_protocol_update_init_proof_iter(start)) +} + +fn iterate_protocol_update_execution_proofs<'a>( + database: &'a StateManagerDatabase, + continue_from_state_version: Option, + from_state_version: StateVersion, + protocol_version: Option, +) -> Result< + Box + 'a>, + ResponseError, +> { + let start = optional_max(from_state_version, continue_from_state_version); + + let iter = database.get_protocol_update_execution_proof_iter(start); + + Ok(match protocol_version { + Some(protocol_version) => Box::new(iter.filter(move |proof| { + let LedgerProofOrigin::ProtocolUpdate { + protocol_version_name, + .. + } = &proof.origin + else { + return false; + }; + protocol_version_name.as_str() == protocol_version.as_str() + })), + None => iter, + }) +} + +fn extract_from_state_version( + database: &StateManagerDatabase, + from_state_version: Option, +) -> Result> { + let Some(from_state_version) = from_state_version else { + return Ok(StateVersion::pre_genesis()); + }; + + let from_state_version = extract_api_state_version(from_state_version) + .map_err(|err| err.into_response_error("from_state_version"))?; + + let max_state_version = database.max_state_version(); + + // Allow requesting 1 past the end for good UX when streaming + if from_state_version >= max_state_version.next().unwrap() { + Err(detailed_error( + StatusCode::BAD_REQUEST, + "from_state_version is past the end of the ledger", + models::StreamProofsErrorDetails::StreamProofsErrorDetailsRequestedStateVersionOutOfBounds { + max_ledger_state_version: to_api_state_version(max_state_version)?, + } + ))?; + } + + Ok(from_state_version) +} + +fn extract_from_epoch( + mapping_context: &MappingContext, + database: &StateManagerDatabase, + from_epoch: Option, +) -> Result> { + let Some(from_epoch) = from_epoch else { + return Ok(Epoch::zero()); + }; + + let from_epoch = + extract_api_epoch(from_epoch).map_err(|err| err.into_response_error("from_epoch"))?; + + let max_new_epoch = database + .max_completed_epoch() + .unwrap_or(Epoch::zero()) + .next() + .unwrap(); + + // Allow requesting 1 past the end for good UX when streaming + if from_epoch >= max_new_epoch.next().unwrap() { + Err(detailed_error( + StatusCode::BAD_REQUEST, + "from_epoch is past the end of the ledger", + models::StreamProofsErrorDetails::StreamProofsErrorDetailsRequestedEpochOutOfBounds { + max_ledger_epoch: to_api_epoch(mapping_context, max_new_epoch)?, + }, + ))?; + } + + Ok(from_epoch) +} diff --git a/core-rust/core-api-server/src/core_api/handlers/stream_transactions.rs b/core-rust/core-api-server/src/core_api/handlers/stream_transactions.rs index 1a98681ae9..8f7485c503 100644 --- a/core-rust/core-api-server/src/core_api/handlers/stream_transactions.rs +++ b/core-rust/core-api-server/src/core_api/handlers/stream_transactions.rs @@ -253,6 +253,10 @@ pub fn to_api_ledger_header( } None => None, }; + let next_protocol_version = ledger_header + .next_protocol_version + .map(|version| version.to_string()); + Ok(models::LedgerHeader { epoch: to_api_epoch(mapping_context, ledger_header.epoch)?, round: to_api_round(ledger_header.round)?, @@ -267,6 +271,7 @@ pub fn to_api_ledger_header( consensus_parent_round_timestamp_ms: ledger_header.consensus_parent_round_timestamp_ms, proposer_timestamp_ms: ledger_header.proposer_timestamp_ms, next_epoch, + next_protocol_version, }) } diff --git a/core-rust/core-api-server/src/core_api/server.rs b/core-rust/core-api-server/src/core_api/server.rs index 03732c06e8..425b3ca1a9 100644 --- a/core-rust/core-api-server/src/core_api/server.rs +++ b/core-rust/core-api-server/src/core_api/server.rs @@ -171,6 +171,7 @@ pub async fn create_server( post(handle_transaction_callpreview), ) // Stream Sub-API + .route("/stream/proofs", post(handle_stream_proofs)) .route("/stream/transactions", post(handle_stream_transactions)) // State Sub-API .route( diff --git a/core-rust/state-manager/src/protocol/protocol_state.rs b/core-rust/state-manager/src/protocol/protocol_state.rs index 60be37c6f6..2e879fd34b 100644 --- a/core-rust/state-manager/src/protocol/protocol_state.rs +++ b/core-rust/state-manager/src/protocol/protocol_state.rs @@ -458,7 +458,7 @@ pub fn epoch_change_iter<'s, S: IterableProofStore + QueryableTransactionStore>( store: &'s S, from_epoch: Epoch, ) -> Box + 's> { - let epoch_iter = store.get_epoch_proof_iter(from_epoch); + let epoch_iter = store.get_next_epoch_proof_iter(from_epoch); Box::new(epoch_iter.map(|epoch_proof| { let next_epoch = epoch_proof .ledger_header diff --git a/core-rust/state-manager/src/store/rocks_db.rs b/core-rust/state-manager/src/store/rocks_db.rs index 853b951456..f0f7c8db4a 100644 --- a/core-rust/state-manager/src/store/rocks_db.rs +++ b/core-rust/state-manager/src/store/rocks_db.rs @@ -212,7 +212,7 @@ impl VersionedCf for LedgerProofsCf { type VersionedValue = VersionedLedgerProof; } -/// Ledger proofs of epochs. +/// Ledger proofs of new epochs - i.e. the proofs which trigger the given `next_epoch`. /// Schema: `Epoch.to_bytes()` -> `scrypto_encode(VersionedLedgerProof)` /// Note: This duplicates a small subset of [`LedgerProofsCf`]'s values. struct EpochLedgerProofsCf; @@ -1111,7 +1111,7 @@ impl IterableProofStore for RocksDBStore { ) } - fn get_epoch_proof_iter( + fn get_next_epoch_proof_iter( &self, from_epoch: Epoch, ) -> Box + '_> { @@ -1134,6 +1134,18 @@ impl IterableProofStore for RocksDBStore { .map(|(_, proof)| proof), ) } + + fn get_protocol_update_execution_proof_iter( + &self, + from_state_version: StateVersion, + ) -> Box + '_> { + Box::new( + self.open_db_context() + .cf(ProtocolUpdateExecutionLedgerProofsCf) + .iterate_from(&from_state_version, Direction::Forward) + .map(|(_, proof)| proof), + ) + } } impl QueryableProofStore for RocksDBStore { diff --git a/core-rust/state-manager/src/store/traits.rs b/core-rust/state-manager/src/store/traits.rs index 7e27f8e4b9..8af821954c 100644 --- a/core-rust/state-manager/src/store/traits.rs +++ b/core-rust/state-manager/src/store/traits.rs @@ -307,7 +307,7 @@ pub mod proofs { from_state_version: StateVersion, ) -> Box + '_>; - fn get_epoch_proof_iter( + fn get_next_epoch_proof_iter( &self, from_epoch: Epoch, ) -> Box + '_>; @@ -316,6 +316,11 @@ pub mod proofs { &self, from_state_version: StateVersion, ) -> Box + '_>; + + fn get_protocol_update_execution_proof_iter( + &self, + from_state_version: StateVersion, + ) -> Box + '_>; } #[enum_dispatch] diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/api/LtsApi.java b/core/src/test-core/java/com/radixdlt/api/core/generated/api/LtsApi.java index 8c4cabf4da..f9338a67e5 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/api/LtsApi.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/api/LtsApi.java @@ -32,9 +32,9 @@ import com.radixdlt.api.core.generated.models.LtsTransactionConstructionResponse; import com.radixdlt.api.core.generated.models.LtsTransactionStatusRequest; import com.radixdlt.api.core.generated.models.LtsTransactionStatusResponse; +import com.radixdlt.api.core.generated.models.LtsTransactionSubmitErrorResponse; import com.radixdlt.api.core.generated.models.LtsTransactionSubmitRequest; import com.radixdlt.api.core.generated.models.LtsTransactionSubmitResponse; -import com.radixdlt.api.core.generated.models.TransactionSubmitErrorResponse; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/api/StreamApi.java b/core/src/test-core/java/com/radixdlt/api/core/generated/api/StreamApi.java index 92e42dc737..4af52a54eb 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/api/StreamApi.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/api/StreamApi.java @@ -17,7 +17,10 @@ import com.radixdlt.api.core.generated.client.ApiResponse; import com.radixdlt.api.core.generated.client.Pair; -import com.radixdlt.api.core.generated.models.BasicErrorResponse; +import com.radixdlt.api.core.generated.models.StreamProofsErrorResponse; +import com.radixdlt.api.core.generated.models.StreamProofsRequest; +import com.radixdlt.api.core.generated.models.StreamProofsResponse; +import com.radixdlt.api.core.generated.models.StreamTransactionsErrorResponse; import com.radixdlt.api.core.generated.models.StreamTransactionsRequest; import com.radixdlt.api.core.generated.models.StreamTransactionsResponse; @@ -76,6 +79,84 @@ private String formatExceptionMessage(String operationId, int statusCode, String return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Stream Proofs + * Returns a stream of proofs committed to the node's ledger. NOTE: This endpoint may return different results on different nodes: * Each node may persist different subset of signatures on a given proofs, as long as enough of the validator set has signed. * Inside an epoch, different nodes may receive and persist / keep different proofs, subject to constraints on gaps between proofs. Proofs during an epoch can also be garbage collected by the node after the fact. Therefore proofs may disappear from this stream. Some proofs (such as during genesis and protocol update enactment) are created on a node and don't include signatures. This stream accepts four different options in the request: * All proofs forward (from state version) * All end-of-epoch proofs (from epoch number) * All end-of-epoch proofs triggering a protocol update * All node-injected proofs enacting genesis or a protocol update (for protocol update name, from state version) The end-of-epoch proofs can be used to \"trustlessly\" verify the validator set for a given epoch. By tracking the fact that validators for epoch N sign the next validator set for epoch N + 1, this chain of proofs can be used to provide proof of the current validator set from a hardcoded start. When a validator set is known for a given epoch, this can be used to verify the various transaction hash trees in the epoch, and to prove other data. NOTE: This endpoint was built after agreeing the new Radix convention for paged APIs. Its models therefore follow the new convention, rather than attempting to align with existing loose Core API conventions. + * @param streamProofsRequest (required) + * @return StreamProofsResponse + * @throws ApiException if fails to make API call + */ + public StreamProofsResponse streamProofsPost(StreamProofsRequest streamProofsRequest) throws ApiException { + ApiResponse localVarResponse = streamProofsPostWithHttpInfo(streamProofsRequest); + return localVarResponse.getData(); + } + + /** + * Stream Proofs + * Returns a stream of proofs committed to the node's ledger. NOTE: This endpoint may return different results on different nodes: * Each node may persist different subset of signatures on a given proofs, as long as enough of the validator set has signed. * Inside an epoch, different nodes may receive and persist / keep different proofs, subject to constraints on gaps between proofs. Proofs during an epoch can also be garbage collected by the node after the fact. Therefore proofs may disappear from this stream. Some proofs (such as during genesis and protocol update enactment) are created on a node and don't include signatures. This stream accepts four different options in the request: * All proofs forward (from state version) * All end-of-epoch proofs (from epoch number) * All end-of-epoch proofs triggering a protocol update * All node-injected proofs enacting genesis or a protocol update (for protocol update name, from state version) The end-of-epoch proofs can be used to \"trustlessly\" verify the validator set for a given epoch. By tracking the fact that validators for epoch N sign the next validator set for epoch N + 1, this chain of proofs can be used to provide proof of the current validator set from a hardcoded start. When a validator set is known for a given epoch, this can be used to verify the various transaction hash trees in the epoch, and to prove other data. NOTE: This endpoint was built after agreeing the new Radix convention for paged APIs. Its models therefore follow the new convention, rather than attempting to align with existing loose Core API conventions. + * @param streamProofsRequest (required) + * @return ApiResponse<StreamProofsResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse streamProofsPostWithHttpInfo(StreamProofsRequest streamProofsRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = streamProofsPostRequestBuilder(streamProofsRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("streamProofsPost", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder streamProofsPostRequestBuilder(StreamProofsRequest streamProofsRequest) throws ApiException { + // verify the required parameter 'streamProofsRequest' is set + if (streamProofsRequest == null) { + throw new ApiException(400, "Missing the required parameter 'streamProofsRequest' when calling streamProofsPost"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/stream/proofs"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(streamProofsRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * Get Committed Transactions * Returns the list of committed transactions. diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/BasicErrorResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/BasicErrorResponse.java index eead81cde7..d2302887be 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/BasicErrorResponse.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/BasicErrorResponse.java @@ -29,6 +29,7 @@ import com.radixdlt.api.core.generated.models.ErrorResponse; import com.radixdlt.api.core.generated.models.ErrorResponseType; import com.radixdlt.api.core.generated.models.LtsTransactionSubmitErrorResponse; +import com.radixdlt.api.core.generated.models.StreamProofsErrorResponse; import com.radixdlt.api.core.generated.models.StreamTransactionsErrorResponse; import com.radixdlt.api.core.generated.models.TransactionSubmitErrorResponse; import io.swagger.annotations.ApiModel; @@ -51,6 +52,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = BasicErrorResponse.class, name = "Basic"), @JsonSubTypes.Type(value = LtsTransactionSubmitErrorResponse.class, name = "LtsTransactionSubmit"), + @JsonSubTypes.Type(value = StreamProofsErrorResponse.class, name = "StreamProofs"), @JsonSubTypes.Type(value = StreamTransactionsErrorResponse.class, name = "StreamTransactions"), @JsonSubTypes.Type(value = TransactionSubmitErrorResponse.class, name = "TransactionSubmit"), }) @@ -103,6 +105,7 @@ private String toIndentedString(Object o) { Map> mappings = new HashMap>(); mappings.put("Basic", BasicErrorResponse.class); mappings.put("LtsTransactionSubmit", LtsTransactionSubmitErrorResponse.class); + mappings.put("StreamProofs", StreamProofsErrorResponse.class); mappings.put("StreamTransactions", StreamTransactionsErrorResponse.class); mappings.put("TransactionSubmit", TransactionSubmitErrorResponse.class); mappings.put("BasicErrorResponse", BasicErrorResponse.class); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/EpochEndLedgerProof.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/EpochEndLedgerProof.java new file mode 100644 index 0000000000..bf7b415307 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/EpochEndLedgerProof.java @@ -0,0 +1,146 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.LedgerProof; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * EpochEndLedgerProof + */ +@JsonPropertyOrder({ + EpochEndLedgerProof.JSON_PROPERTY_END_OF_EPOCH, + EpochEndLedgerProof.JSON_PROPERTY_LEDGER_PROOF +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EpochEndLedgerProof { + public static final String JSON_PROPERTY_END_OF_EPOCH = "end_of_epoch"; + private Long endOfEpoch; + + public static final String JSON_PROPERTY_LEDGER_PROOF = "ledger_proof"; + private LedgerProof ledgerProof; + + public EpochEndLedgerProof() { + } + + public EpochEndLedgerProof endOfEpoch(Long endOfEpoch) { + this.endOfEpoch = endOfEpoch; + return this; + } + + /** + * Get endOfEpoch + * minimum: 0 + * maximum: 10000000000 + * @return endOfEpoch + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_END_OF_EPOCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getEndOfEpoch() { + return endOfEpoch; + } + + + @JsonProperty(JSON_PROPERTY_END_OF_EPOCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEndOfEpoch(Long endOfEpoch) { + this.endOfEpoch = endOfEpoch; + } + + + public EpochEndLedgerProof ledgerProof(LedgerProof ledgerProof) { + this.ledgerProof = ledgerProof; + return this; + } + + /** + * Get ledgerProof + * @return ledgerProof + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_LEDGER_PROOF) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LedgerProof getLedgerProof() { + return ledgerProof; + } + + + @JsonProperty(JSON_PROPERTY_LEDGER_PROOF) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLedgerProof(LedgerProof ledgerProof) { + this.ledgerProof = ledgerProof; + } + + + /** + * Return true if this EpochEndLedgerProof object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EpochEndLedgerProof epochEndLedgerProof = (EpochEndLedgerProof) o; + return Objects.equals(this.endOfEpoch, epochEndLedgerProof.endOfEpoch) && + Objects.equals(this.ledgerProof, epochEndLedgerProof.ledgerProof); + } + + @Override + public int hashCode() { + return Objects.hash(endOfEpoch, ledgerProof); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EpochEndLedgerProof {\n"); + sb.append(" endOfEpoch: ").append(toIndentedString(endOfEpoch)).append("\n"); + sb.append(" ledgerProof: ").append(toIndentedString(ledgerProof)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/ErrorResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/ErrorResponse.java index b1a9fa848b..e90906c0f4 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/ErrorResponse.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/ErrorResponse.java @@ -28,6 +28,7 @@ import com.radixdlt.api.core.generated.models.BasicErrorResponse; import com.radixdlt.api.core.generated.models.ErrorResponseType; import com.radixdlt.api.core.generated.models.LtsTransactionSubmitErrorResponse; +import com.radixdlt.api.core.generated.models.StreamProofsErrorResponse; import com.radixdlt.api.core.generated.models.StreamTransactionsErrorResponse; import com.radixdlt.api.core.generated.models.TransactionSubmitErrorResponse; import io.swagger.annotations.ApiModel; @@ -56,6 +57,8 @@ @JsonSubTypes.Type(value = BasicErrorResponse.class, name = "BasicErrorResponse"), @JsonSubTypes.Type(value = LtsTransactionSubmitErrorResponse.class, name = "LtsTransactionSubmit"), @JsonSubTypes.Type(value = LtsTransactionSubmitErrorResponse.class, name = "LtsTransactionSubmitErrorResponse"), + @JsonSubTypes.Type(value = StreamProofsErrorResponse.class, name = "StreamProofs"), + @JsonSubTypes.Type(value = StreamProofsErrorResponse.class, name = "StreamProofsErrorResponse"), @JsonSubTypes.Type(value = StreamTransactionsErrorResponse.class, name = "StreamTransactions"), @JsonSubTypes.Type(value = StreamTransactionsErrorResponse.class, name = "StreamTransactionsErrorResponse"), @JsonSubTypes.Type(value = TransactionSubmitErrorResponse.class, name = "TransactionSubmit"), @@ -235,6 +238,8 @@ private String toIndentedString(Object o) { mappings.put("BasicErrorResponse", BasicErrorResponse.class); mappings.put("LtsTransactionSubmit", LtsTransactionSubmitErrorResponse.class); mappings.put("LtsTransactionSubmitErrorResponse", LtsTransactionSubmitErrorResponse.class); + mappings.put("StreamProofs", StreamProofsErrorResponse.class); + mappings.put("StreamProofsErrorResponse", StreamProofsErrorResponse.class); mappings.put("StreamTransactions", StreamTransactionsErrorResponse.class); mappings.put("StreamTransactionsErrorResponse", StreamTransactionsErrorResponse.class); mappings.put("TransactionSubmit", TransactionSubmitErrorResponse.class); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/ErrorResponseType.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/ErrorResponseType.java index cbd9979be3..17dfda1042 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/ErrorResponseType.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/ErrorResponseType.java @@ -34,7 +34,9 @@ public enum ErrorResponseType { LTSTRANSACTIONSUBMIT("LtsTransactionSubmit"), - STREAMTRANSACTIONS("StreamTransactions"); + STREAMTRANSACTIONS("StreamTransactions"), + + STREAMPROOFS("StreamProofs"); private String value; diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/LedgerHeader.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/LedgerHeader.java index c96cb5dc91..ccd2c8d08e 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/LedgerHeader.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/LedgerHeader.java @@ -39,7 +39,8 @@ LedgerHeader.JSON_PROPERTY_HASHES, LedgerHeader.JSON_PROPERTY_CONSENSUS_PARENT_ROUND_TIMESTAMP_MS, LedgerHeader.JSON_PROPERTY_PROPOSER_TIMESTAMP_MS, - LedgerHeader.JSON_PROPERTY_NEXT_EPOCH + LedgerHeader.JSON_PROPERTY_NEXT_EPOCH, + LedgerHeader.JSON_PROPERTY_NEXT_PROTOCOL_VERSION }) @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class LedgerHeader { @@ -64,6 +65,9 @@ public class LedgerHeader { public static final String JSON_PROPERTY_NEXT_EPOCH = "next_epoch"; private NextEpoch nextEpoch; + public static final String JSON_PROPERTY_NEXT_PROTOCOL_VERSION = "next_protocol_version"; + private String nextProtocolVersion; + public LedgerHeader() { } @@ -259,6 +263,32 @@ public void setNextEpoch(NextEpoch nextEpoch) { } + public LedgerHeader nextProtocolVersion(String nextProtocolVersion) { + this.nextProtocolVersion = nextProtocolVersion; + return this; + } + + /** + * If present, indicates that this proof triggers the enactment of the given protocol version. + * @return nextProtocolVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "If present, indicates that this proof triggers the enactment of the given protocol version.") + @JsonProperty(JSON_PROPERTY_NEXT_PROTOCOL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNextProtocolVersion() { + return nextProtocolVersion; + } + + + @JsonProperty(JSON_PROPERTY_NEXT_PROTOCOL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNextProtocolVersion(String nextProtocolVersion) { + this.nextProtocolVersion = nextProtocolVersion; + } + + /** * Return true if this LedgerHeader object is equal to o. */ @@ -277,12 +307,13 @@ public boolean equals(Object o) { Objects.equals(this.hashes, ledgerHeader.hashes) && Objects.equals(this.consensusParentRoundTimestampMs, ledgerHeader.consensusParentRoundTimestampMs) && Objects.equals(this.proposerTimestampMs, ledgerHeader.proposerTimestampMs) && - Objects.equals(this.nextEpoch, ledgerHeader.nextEpoch); + Objects.equals(this.nextEpoch, ledgerHeader.nextEpoch) && + Objects.equals(this.nextProtocolVersion, ledgerHeader.nextProtocolVersion); } @Override public int hashCode() { - return Objects.hash(epoch, round, stateVersion, hashes, consensusParentRoundTimestampMs, proposerTimestampMs, nextEpoch); + return Objects.hash(epoch, round, stateVersion, hashes, consensusParentRoundTimestampMs, proposerTimestampMs, nextEpoch, nextProtocolVersion); } @Override @@ -296,6 +327,7 @@ public String toString() { sb.append(" consensusParentRoundTimestampMs: ").append(toIndentedString(consensusParentRoundTimestampMs)).append("\n"); sb.append(" proposerTimestampMs: ").append(toIndentedString(proposerTimestampMs)).append("\n"); sb.append(" nextEpoch: ").append(toIndentedString(nextEpoch)).append("\n"); + sb.append(" nextProtocolVersion: ").append(toIndentedString(nextProtocolVersion)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/LtsTransactionSubmitErrorResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/LtsTransactionSubmitErrorResponse.java index 62e95f2327..b1baa6e749 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/LtsTransactionSubmitErrorResponse.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/LtsTransactionSubmitErrorResponse.java @@ -31,6 +31,7 @@ import com.radixdlt.api.core.generated.models.LtsTransactionSubmitErrorDetails; import com.radixdlt.api.core.generated.models.LtsTransactionSubmitErrorResponse; import com.radixdlt.api.core.generated.models.LtsTransactionSubmitErrorResponseAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsErrorResponse; import com.radixdlt.api.core.generated.models.StreamTransactionsErrorResponse; import com.radixdlt.api.core.generated.models.TransactionSubmitErrorResponse; import io.swagger.annotations.ApiModel; @@ -54,6 +55,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = BasicErrorResponse.class, name = "Basic"), @JsonSubTypes.Type(value = LtsTransactionSubmitErrorResponse.class, name = "LtsTransactionSubmit"), + @JsonSubTypes.Type(value = StreamProofsErrorResponse.class, name = "StreamProofs"), @JsonSubTypes.Type(value = StreamTransactionsErrorResponse.class, name = "StreamTransactions"), @JsonSubTypes.Type(value = TransactionSubmitErrorResponse.class, name = "TransactionSubmit"), }) @@ -138,6 +140,7 @@ private String toIndentedString(Object o) { Map> mappings = new HashMap>(); mappings.put("Basic", BasicErrorResponse.class); mappings.put("LtsTransactionSubmit", LtsTransactionSubmitErrorResponse.class); + mappings.put("StreamProofs", StreamProofsErrorResponse.class); mappings.put("StreamTransactions", StreamTransactionsErrorResponse.class); mappings.put("TransactionSubmit", TransactionSubmitErrorResponse.class); mappings.put("LtsTransactionSubmitErrorResponse", LtsTransactionSubmitErrorResponse.class); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/RequestedStateVersionOutOfBoundsErrorDetails.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/RequestedStateVersionOutOfBoundsErrorDetails.java index 5befdd438d..cd8f4db7b1 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/RequestedStateVersionOutOfBoundsErrorDetails.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/RequestedStateVersionOutOfBoundsErrorDetails.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.radixdlt.api.core.generated.models.RequestedStateVersionOutOfBoundsErrorDetails; -import com.radixdlt.api.core.generated.models.RequestedStateVersionOutOfBoundsErrorDetailsAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf; import com.radixdlt.api.core.generated.models.StreamTransactionsErrorDetails; import com.radixdlt.api.core.generated.models.StreamTransactionsErrorDetailsType; import io.swagger.annotations.ApiModel; diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetails.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetails.java new file mode 100644 index 0000000000..13d5aa488e --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetails.java @@ -0,0 +1,140 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsRequestedEpochOutOfBounds; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsRequestedStateVersionOutOfBounds; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.radixdlt.api.core.generated.client.JSON; +/** + * StreamProofsErrorDetails + */ +@JsonPropertyOrder({ + StreamProofsErrorDetails.JSON_PROPERTY_TYPE +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = StreamProofsErrorDetailsRequestedEpochOutOfBounds.class, name = "RequestedEpochOutOfBounds"), + @JsonSubTypes.Type(value = StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class, name = "RequestedStateVersionOutOfBounds"), + @JsonSubTypes.Type(value = StreamProofsErrorDetailsRequestedEpochOutOfBounds.class, name = "StreamProofsErrorDetailsRequestedEpochOutOfBounds"), + @JsonSubTypes.Type(value = StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class, name = "StreamProofsErrorDetailsRequestedStateVersionOutOfBounds"), +}) + +public class StreamProofsErrorDetails { + public static final String JSON_PROPERTY_TYPE = "type"; + private StreamProofsErrorDetailsType type; + + public StreamProofsErrorDetails() { + } + + public StreamProofsErrorDetails type(StreamProofsErrorDetailsType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StreamProofsErrorDetailsType getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(StreamProofsErrorDetailsType type) { + this.type = type; + } + + + /** + * Return true if this StreamProofsErrorDetails object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsErrorDetails streamProofsErrorDetails = (StreamProofsErrorDetails) o; + return Objects.equals(this.type, streamProofsErrorDetails.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsErrorDetails {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("RequestedEpochOutOfBounds", StreamProofsErrorDetailsRequestedEpochOutOfBounds.class); + mappings.put("RequestedStateVersionOutOfBounds", StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class); + mappings.put("StreamProofsErrorDetailsRequestedEpochOutOfBounds", StreamProofsErrorDetailsRequestedEpochOutOfBounds.class); + mappings.put("StreamProofsErrorDetailsRequestedStateVersionOutOfBounds", StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class); + mappings.put("StreamProofsErrorDetails", StreamProofsErrorDetails.class); + JSON.registerDiscriminator(StreamProofsErrorDetails.class, "type", mappings); +} +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBounds.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBounds.java new file mode 100644 index 0000000000..3da3fff287 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBounds.java @@ -0,0 +1,142 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetails; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsRequestedEpochOutOfBounds; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsRequestedStateVersionOutOfBounds; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.radixdlt.api.core.generated.client.JSON; +/** + * StreamProofsErrorDetailsRequestedEpochOutOfBounds + */ +@JsonPropertyOrder({ + StreamProofsErrorDetailsRequestedEpochOutOfBounds.JSON_PROPERTY_MAX_LEDGER_EPOCH +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = StreamProofsErrorDetailsRequestedEpochOutOfBounds.class, name = "RequestedEpochOutOfBounds"), + @JsonSubTypes.Type(value = StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class, name = "RequestedStateVersionOutOfBounds"), +}) + +public class StreamProofsErrorDetailsRequestedEpochOutOfBounds extends StreamProofsErrorDetails { + public static final String JSON_PROPERTY_MAX_LEDGER_EPOCH = "max_ledger_epoch"; + private Long maxLedgerEpoch; + + public StreamProofsErrorDetailsRequestedEpochOutOfBounds() { + } + + public StreamProofsErrorDetailsRequestedEpochOutOfBounds maxLedgerEpoch(Long maxLedgerEpoch) { + this.maxLedgerEpoch = maxLedgerEpoch; + return this; + } + + /** + * The maximum completed epoch committed to this node's ledger. *Note on the bounds:* the requested `from_epoch` cannot be greater than `max_ledger_epoch + 1`. Any greater requested value triggers this error. + * minimum: 0 + * maximum: 10000000000 + * @return maxLedgerEpoch + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The maximum completed epoch committed to this node's ledger. *Note on the bounds:* the requested `from_epoch` cannot be greater than `max_ledger_epoch + 1`. Any greater requested value triggers this error. ") + @JsonProperty(JSON_PROPERTY_MAX_LEDGER_EPOCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getMaxLedgerEpoch() { + return maxLedgerEpoch; + } + + + @JsonProperty(JSON_PROPERTY_MAX_LEDGER_EPOCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMaxLedgerEpoch(Long maxLedgerEpoch) { + this.maxLedgerEpoch = maxLedgerEpoch; + } + + + /** + * Return true if this StreamProofsErrorDetailsRequestedEpochOutOfBounds object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsErrorDetailsRequestedEpochOutOfBounds streamProofsErrorDetailsRequestedEpochOutOfBounds = (StreamProofsErrorDetailsRequestedEpochOutOfBounds) o; + return Objects.equals(this.maxLedgerEpoch, streamProofsErrorDetailsRequestedEpochOutOfBounds.maxLedgerEpoch) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(maxLedgerEpoch, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsErrorDetailsRequestedEpochOutOfBounds {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" maxLedgerEpoch: ").append(toIndentedString(maxLedgerEpoch)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("RequestedEpochOutOfBounds", StreamProofsErrorDetailsRequestedEpochOutOfBounds.class); + mappings.put("RequestedStateVersionOutOfBounds", StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class); + mappings.put("StreamProofsErrorDetailsRequestedEpochOutOfBounds", StreamProofsErrorDetailsRequestedEpochOutOfBounds.class); + JSON.registerDiscriminator(StreamProofsErrorDetailsRequestedEpochOutOfBounds.class, "type", mappings); +} +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.java new file mode 100644 index 0000000000..c03617b297 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.java @@ -0,0 +1,113 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf + */ +@JsonPropertyOrder({ + StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.JSON_PROPERTY_MAX_LEDGER_EPOCH +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf { + public static final String JSON_PROPERTY_MAX_LEDGER_EPOCH = "max_ledger_epoch"; + private Long maxLedgerEpoch; + + public StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf() { + } + + public StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf maxLedgerEpoch(Long maxLedgerEpoch) { + this.maxLedgerEpoch = maxLedgerEpoch; + return this; + } + + /** + * The maximum completed epoch committed to this node's ledger. *Note on the bounds:* the requested `from_epoch` cannot be greater than `max_ledger_epoch + 1`. Any greater requested value triggers this error. + * minimum: 0 + * maximum: 10000000000 + * @return maxLedgerEpoch + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The maximum completed epoch committed to this node's ledger. *Note on the bounds:* the requested `from_epoch` cannot be greater than `max_ledger_epoch + 1`. Any greater requested value triggers this error. ") + @JsonProperty(JSON_PROPERTY_MAX_LEDGER_EPOCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getMaxLedgerEpoch() { + return maxLedgerEpoch; + } + + + @JsonProperty(JSON_PROPERTY_MAX_LEDGER_EPOCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMaxLedgerEpoch(Long maxLedgerEpoch) { + this.maxLedgerEpoch = maxLedgerEpoch; + } + + + /** + * Return true if this StreamProofsErrorDetailsRequestedEpochOutOfBounds_allOf object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf streamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf = (StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf) o; + return Objects.equals(this.maxLedgerEpoch, streamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.maxLedgerEpoch); + } + + @Override + public int hashCode() { + return Objects.hash(maxLedgerEpoch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf {\n"); + sb.append(" maxLedgerEpoch: ").append(toIndentedString(maxLedgerEpoch)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.java new file mode 100644 index 0000000000..afd851ea6b --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.java @@ -0,0 +1,142 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetails; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsRequestedEpochOutOfBounds; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsRequestedStateVersionOutOfBounds; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetailsType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.radixdlt.api.core.generated.client.JSON; +/** + * StreamProofsErrorDetailsRequestedStateVersionOutOfBounds + */ +@JsonPropertyOrder({ + StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.JSON_PROPERTY_MAX_LEDGER_STATE_VERSION +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = StreamProofsErrorDetailsRequestedEpochOutOfBounds.class, name = "RequestedEpochOutOfBounds"), + @JsonSubTypes.Type(value = StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class, name = "RequestedStateVersionOutOfBounds"), +}) + +public class StreamProofsErrorDetailsRequestedStateVersionOutOfBounds extends StreamProofsErrorDetails { + public static final String JSON_PROPERTY_MAX_LEDGER_STATE_VERSION = "max_ledger_state_version"; + private Long maxLedgerStateVersion; + + public StreamProofsErrorDetailsRequestedStateVersionOutOfBounds() { + } + + public StreamProofsErrorDetailsRequestedStateVersionOutOfBounds maxLedgerStateVersion(Long maxLedgerStateVersion) { + this.maxLedgerStateVersion = maxLedgerStateVersion; + return this; + } + + /** + * Get maxLedgerStateVersion + * minimum: 1 + * maximum: 100000000000000 + * @return maxLedgerStateVersion + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_MAX_LEDGER_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getMaxLedgerStateVersion() { + return maxLedgerStateVersion; + } + + + @JsonProperty(JSON_PROPERTY_MAX_LEDGER_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMaxLedgerStateVersion(Long maxLedgerStateVersion) { + this.maxLedgerStateVersion = maxLedgerStateVersion; + } + + + /** + * Return true if this StreamProofsErrorDetailsRequestedStateVersionOutOfBounds object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsErrorDetailsRequestedStateVersionOutOfBounds streamProofsErrorDetailsRequestedStateVersionOutOfBounds = (StreamProofsErrorDetailsRequestedStateVersionOutOfBounds) o; + return Objects.equals(this.maxLedgerStateVersion, streamProofsErrorDetailsRequestedStateVersionOutOfBounds.maxLedgerStateVersion) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(maxLedgerStateVersion, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsErrorDetailsRequestedStateVersionOutOfBounds {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" maxLedgerStateVersion: ").append(toIndentedString(maxLedgerStateVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("RequestedEpochOutOfBounds", StreamProofsErrorDetailsRequestedEpochOutOfBounds.class); + mappings.put("RequestedStateVersionOutOfBounds", StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class); + mappings.put("StreamProofsErrorDetailsRequestedStateVersionOutOfBounds", StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class); + JSON.registerDiscriminator(StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.class, "type", mappings); +} +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/RequestedStateVersionOutOfBoundsErrorDetailsAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.java similarity index 81% rename from core/src/test-core/java/com/radixdlt/api/core/generated/models/RequestedStateVersionOutOfBoundsErrorDetailsAllOf.java rename to core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.java index 7eb52633ed..86fdb01a98 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/RequestedStateVersionOutOfBoundsErrorDetailsAllOf.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.java @@ -28,20 +28,20 @@ /** - * RequestedStateVersionOutOfBoundsErrorDetailsAllOf + * StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf */ @JsonPropertyOrder({ - RequestedStateVersionOutOfBoundsErrorDetailsAllOf.JSON_PROPERTY_MAX_LEDGER_STATE_VERSION + StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.JSON_PROPERTY_MAX_LEDGER_STATE_VERSION }) @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class RequestedStateVersionOutOfBoundsErrorDetailsAllOf { +public class StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf { public static final String JSON_PROPERTY_MAX_LEDGER_STATE_VERSION = "max_ledger_state_version"; private Long maxLedgerStateVersion; - public RequestedStateVersionOutOfBoundsErrorDetailsAllOf() { + public StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf() { } - public RequestedStateVersionOutOfBoundsErrorDetailsAllOf maxLedgerStateVersion(Long maxLedgerStateVersion) { + public StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf maxLedgerStateVersion(Long maxLedgerStateVersion) { this.maxLedgerStateVersion = maxLedgerStateVersion; return this; } @@ -70,7 +70,7 @@ public void setMaxLedgerStateVersion(Long maxLedgerStateVersion) { /** - * Return true if this RequestedStateVersionOutOfBoundsErrorDetails_allOf object is equal to o. + * Return true if this StreamProofsErrorDetailsRequestedStateVersionOutOfBounds_allOf object is equal to o. */ @Override public boolean equals(Object o) { @@ -80,8 +80,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - RequestedStateVersionOutOfBoundsErrorDetailsAllOf requestedStateVersionOutOfBoundsErrorDetailsAllOf = (RequestedStateVersionOutOfBoundsErrorDetailsAllOf) o; - return Objects.equals(this.maxLedgerStateVersion, requestedStateVersionOutOfBoundsErrorDetailsAllOf.maxLedgerStateVersion); + StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf streamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf = (StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf) o; + return Objects.equals(this.maxLedgerStateVersion, streamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.maxLedgerStateVersion); } @Override @@ -92,7 +92,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class RequestedStateVersionOutOfBoundsErrorDetailsAllOf {\n"); + sb.append("class StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf {\n"); sb.append(" maxLedgerStateVersion: ").append(toIndentedString(maxLedgerStateVersion)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsType.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsType.java new file mode 100644 index 0000000000..c3b8abb2b9 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorDetailsType.java @@ -0,0 +1,61 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets StreamProofsErrorDetailsType + */ +public enum StreamProofsErrorDetailsType { + + REQUESTEDSTATEVERSIONOUTOFBOUNDS("RequestedStateVersionOutOfBounds"), + + REQUESTEDEPOCHOUTOFBOUNDS("RequestedEpochOutOfBounds"); + + private String value; + + StreamProofsErrorDetailsType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StreamProofsErrorDetailsType fromValue(String value) { + for (StreamProofsErrorDetailsType b : StreamProofsErrorDetailsType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorResponse.java new file mode 100644 index 0000000000..89c9c494d6 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorResponse.java @@ -0,0 +1,150 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.BasicErrorResponse; +import com.radixdlt.api.core.generated.models.ErrorResponse; +import com.radixdlt.api.core.generated.models.ErrorResponseType; +import com.radixdlt.api.core.generated.models.LtsTransactionSubmitErrorResponse; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetails; +import com.radixdlt.api.core.generated.models.StreamProofsErrorResponse; +import com.radixdlt.api.core.generated.models.StreamProofsErrorResponseAllOf; +import com.radixdlt.api.core.generated.models.StreamTransactionsErrorResponse; +import com.radixdlt.api.core.generated.models.TransactionSubmitErrorResponse; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.radixdlt.api.core.generated.client.JSON; +/** + * StreamProofsErrorResponse + */ +@JsonPropertyOrder({ + StreamProofsErrorResponse.JSON_PROPERTY_DETAILS +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "error_type", // ignore manually set error_type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the error_type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "error_type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = BasicErrorResponse.class, name = "Basic"), + @JsonSubTypes.Type(value = LtsTransactionSubmitErrorResponse.class, name = "LtsTransactionSubmit"), + @JsonSubTypes.Type(value = StreamProofsErrorResponse.class, name = "StreamProofs"), + @JsonSubTypes.Type(value = StreamTransactionsErrorResponse.class, name = "StreamTransactions"), + @JsonSubTypes.Type(value = TransactionSubmitErrorResponse.class, name = "TransactionSubmit"), +}) + +public class StreamProofsErrorResponse extends ErrorResponse { + public static final String JSON_PROPERTY_DETAILS = "details"; + private StreamProofsErrorDetails details; + + public StreamProofsErrorResponse() { + } + + public StreamProofsErrorResponse details(StreamProofsErrorDetails details) { + this.details = details; + return this; + } + + /** + * Get details + * @return details + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StreamProofsErrorDetails getDetails() { + return details; + } + + + @JsonProperty(JSON_PROPERTY_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetails(StreamProofsErrorDetails details) { + this.details = details; + } + + + /** + * Return true if this StreamProofsErrorResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsErrorResponse streamProofsErrorResponse = (StreamProofsErrorResponse) o; + return Objects.equals(this.details, streamProofsErrorResponse.details) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(details, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsErrorResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Basic", BasicErrorResponse.class); + mappings.put("LtsTransactionSubmit", LtsTransactionSubmitErrorResponse.class); + mappings.put("StreamProofs", StreamProofsErrorResponse.class); + mappings.put("StreamTransactions", StreamTransactionsErrorResponse.class); + mappings.put("TransactionSubmit", TransactionSubmitErrorResponse.class); + mappings.put("StreamProofsErrorResponse", StreamProofsErrorResponse.class); + JSON.registerDiscriminator(StreamProofsErrorResponse.class, "error_type", mappings); +} +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorResponseAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorResponseAllOf.java new file mode 100644 index 0000000000..b1030d605a --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsErrorResponseAllOf.java @@ -0,0 +1,112 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsErrorDetails; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * StreamProofsErrorResponseAllOf + */ +@JsonPropertyOrder({ + StreamProofsErrorResponseAllOf.JSON_PROPERTY_DETAILS +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StreamProofsErrorResponseAllOf { + public static final String JSON_PROPERTY_DETAILS = "details"; + private StreamProofsErrorDetails details; + + public StreamProofsErrorResponseAllOf() { + } + + public StreamProofsErrorResponseAllOf details(StreamProofsErrorDetails details) { + this.details = details; + return this; + } + + /** + * Get details + * @return details + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StreamProofsErrorDetails getDetails() { + return details; + } + + + @JsonProperty(JSON_PROPERTY_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetails(StreamProofsErrorDetails details) { + this.details = details; + } + + + /** + * Return true if this StreamProofsErrorResponse_allOf object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsErrorResponseAllOf streamProofsErrorResponseAllOf = (StreamProofsErrorResponseAllOf) o; + return Objects.equals(this.details, streamProofsErrorResponseAllOf.details); + } + + @Override + public int hashCode() { + return Objects.hash(details); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsErrorResponseAllOf {\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilter.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilter.java new file mode 100644 index 0000000000..78836243c3 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilter.java @@ -0,0 +1,150 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; +import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateInitializations; +import com.radixdlt.api.core.generated.models.StreamProofsFilterType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.radixdlt.api.core.generated.client.JSON; +/** + * StreamProofsFilter + */ +@JsonPropertyOrder({ + StreamProofsFilter.JSON_PROPERTY_TYPE +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), + @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "StreamProofsFilterAll"), + @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "StreamProofsFilterNewEpochs"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "StreamProofsFilterProtocolUpdateExecution"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "StreamProofsFilterProtocolUpdateInitializations"), +}) + +public class StreamProofsFilter { + public static final String JSON_PROPERTY_TYPE = "type"; + private StreamProofsFilterType type; + + public StreamProofsFilter() { + } + + public StreamProofsFilter type(StreamProofsFilterType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StreamProofsFilterType getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(StreamProofsFilterType type) { + this.type = type; + } + + + /** + * Return true if this StreamProofsFilter object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsFilter streamProofsFilter = (StreamProofsFilter) o; + return Objects.equals(this.type, streamProofsFilter.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsFilter {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("All", StreamProofsFilterAll.class); + mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); + mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); + mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); + mappings.put("StreamProofsFilterAll", StreamProofsFilterAll.class); + mappings.put("StreamProofsFilterNewEpochs", StreamProofsFilterNewEpochs.class); + mappings.put("StreamProofsFilterProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); + mappings.put("StreamProofsFilterProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); + mappings.put("StreamProofsFilter", StreamProofsFilter.class); + JSON.registerDiscriminator(StreamProofsFilter.class, "type", mappings); +} +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java new file mode 100644 index 0000000000..e7598ef834 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java @@ -0,0 +1,148 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsFilter; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAllAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateInitializations; +import com.radixdlt.api.core.generated.models.StreamProofsFilterType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.radixdlt.api.core.generated.client.JSON; +/** + * StreamProofsFilterAll + */ +@JsonPropertyOrder({ + StreamProofsFilterAll.JSON_PROPERTY_FROM_STATE_VERSION +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), +}) + +public class StreamProofsFilterAll extends StreamProofsFilter { + public static final String JSON_PROPERTY_FROM_STATE_VERSION = "from_state_version"; + private Long fromStateVersion; + + public StreamProofsFilterAll() { + } + + public StreamProofsFilterAll fromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + return this; + } + + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * minimum: 0 + * maximum: 10000000000 + * @return fromStateVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFromStateVersion() { + return fromStateVersion; + } + + + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + } + + + /** + * Return true if this StreamProofsFilterAll object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsFilterAll streamProofsFilterAll = (StreamProofsFilterAll) o; + return Objects.equals(this.fromStateVersion, streamProofsFilterAll.fromStateVersion) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(fromStateVersion, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsFilterAll {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" fromStateVersion: ").append(toIndentedString(fromStateVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("All", StreamProofsFilterAll.class); + mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); + mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); + mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); + mappings.put("StreamProofsFilterAll", StreamProofsFilterAll.class); + JSON.registerDiscriminator(StreamProofsFilterAll.class, "type", mappings); +} +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java new file mode 100644 index 0000000000..edd9884bde --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java @@ -0,0 +1,113 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * StreamProofsFilterAllAllOf + */ +@JsonPropertyOrder({ + StreamProofsFilterAllAllOf.JSON_PROPERTY_FROM_STATE_VERSION +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StreamProofsFilterAllAllOf { + public static final String JSON_PROPERTY_FROM_STATE_VERSION = "from_state_version"; + private Long fromStateVersion; + + public StreamProofsFilterAllAllOf() { + } + + public StreamProofsFilterAllAllOf fromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + return this; + } + + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * minimum: 0 + * maximum: 10000000000 + * @return fromStateVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFromStateVersion() { + return fromStateVersion; + } + + + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + } + + + /** + * Return true if this StreamProofsFilterAll_allOf object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsFilterAllAllOf streamProofsFilterAllAllOf = (StreamProofsFilterAllAllOf) o; + return Objects.equals(this.fromStateVersion, streamProofsFilterAllAllOf.fromStateVersion); + } + + @Override + public int hashCode() { + return Objects.hash(fromStateVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsFilterAllAllOf {\n"); + sb.append(" fromStateVersion: ").append(toIndentedString(fromStateVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java new file mode 100644 index 0000000000..7485a880e6 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java @@ -0,0 +1,148 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsFilter; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; +import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; +import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochsAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateInitializations; +import com.radixdlt.api.core.generated.models.StreamProofsFilterType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.radixdlt.api.core.generated.client.JSON; +/** + * StreamProofsFilterNewEpochs + */ +@JsonPropertyOrder({ + StreamProofsFilterNewEpochs.JSON_PROPERTY_FROM_EPOCH +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), +}) + +public class StreamProofsFilterNewEpochs extends StreamProofsFilter { + public static final String JSON_PROPERTY_FROM_EPOCH = "from_epoch"; + private Long fromEpoch; + + public StreamProofsFilterNewEpochs() { + } + + public StreamProofsFilterNewEpochs fromEpoch(Long fromEpoch) { + this.fromEpoch = fromEpoch; + return this; + } + + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + * minimum: 0 + * maximum: 10000000000 + * @return fromEpoch + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch.") + @JsonProperty(JSON_PROPERTY_FROM_EPOCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFromEpoch() { + return fromEpoch; + } + + + @JsonProperty(JSON_PROPERTY_FROM_EPOCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFromEpoch(Long fromEpoch) { + this.fromEpoch = fromEpoch; + } + + + /** + * Return true if this StreamProofsFilterNewEpochs object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsFilterNewEpochs streamProofsFilterNewEpochs = (StreamProofsFilterNewEpochs) o; + return Objects.equals(this.fromEpoch, streamProofsFilterNewEpochs.fromEpoch) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(fromEpoch, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsFilterNewEpochs {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" fromEpoch: ").append(toIndentedString(fromEpoch)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("All", StreamProofsFilterAll.class); + mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); + mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); + mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); + mappings.put("StreamProofsFilterNewEpochs", StreamProofsFilterNewEpochs.class); + JSON.registerDiscriminator(StreamProofsFilterNewEpochs.class, "type", mappings); +} +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochsAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochsAllOf.java new file mode 100644 index 0000000000..ffd0cefd11 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochsAllOf.java @@ -0,0 +1,113 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * StreamProofsFilterNewEpochsAllOf + */ +@JsonPropertyOrder({ + StreamProofsFilterNewEpochsAllOf.JSON_PROPERTY_FROM_EPOCH +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StreamProofsFilterNewEpochsAllOf { + public static final String JSON_PROPERTY_FROM_EPOCH = "from_epoch"; + private Long fromEpoch; + + public StreamProofsFilterNewEpochsAllOf() { + } + + public StreamProofsFilterNewEpochsAllOf fromEpoch(Long fromEpoch) { + this.fromEpoch = fromEpoch; + return this; + } + + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + * minimum: 0 + * maximum: 10000000000 + * @return fromEpoch + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch.") + @JsonProperty(JSON_PROPERTY_FROM_EPOCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFromEpoch() { + return fromEpoch; + } + + + @JsonProperty(JSON_PROPERTY_FROM_EPOCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFromEpoch(Long fromEpoch) { + this.fromEpoch = fromEpoch; + } + + + /** + * Return true if this StreamProofsFilterNewEpochs_allOf object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsFilterNewEpochsAllOf streamProofsFilterNewEpochsAllOf = (StreamProofsFilterNewEpochsAllOf) o; + return Objects.equals(this.fromEpoch, streamProofsFilterNewEpochsAllOf.fromEpoch); + } + + @Override + public int hashCode() { + return Objects.hash(fromEpoch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsFilterNewEpochsAllOf {\n"); + sb.append(" fromEpoch: ").append(toIndentedString(fromEpoch)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java new file mode 100644 index 0000000000..35cf31a97b --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java @@ -0,0 +1,180 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsFilter; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; +import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecutionAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateInitializations; +import com.radixdlt.api.core.generated.models.StreamProofsFilterType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.radixdlt.api.core.generated.client.JSON; +/** + * StreamProofsFilterProtocolUpdateExecution + */ +@JsonPropertyOrder({ + StreamProofsFilterProtocolUpdateExecution.JSON_PROPERTY_PROTOCOL_VERSION, + StreamProofsFilterProtocolUpdateExecution.JSON_PROPERTY_FROM_STATE_VERSION +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), +}) + +public class StreamProofsFilterProtocolUpdateExecution extends StreamProofsFilter { + public static final String JSON_PROPERTY_PROTOCOL_VERSION = "protocol_version"; + private String protocolVersion; + + public static final String JSON_PROPERTY_FROM_STATE_VERSION = "from_state_version"; + private Long fromStateVersion; + + public StreamProofsFilterProtocolUpdateExecution() { + } + + public StreamProofsFilterProtocolUpdateExecution protocolVersion(String protocolVersion) { + this.protocolVersion = protocolVersion; + return this; + } + + /** + * The protocol version name to filter to. This can be returned from looking at the protocol updates. + * @return protocolVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The protocol version name to filter to. This can be returned from looking at the protocol updates. ") + @JsonProperty(JSON_PROPERTY_PROTOCOL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProtocolVersion() { + return protocolVersion; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocolVersion(String protocolVersion) { + this.protocolVersion = protocolVersion; + } + + + public StreamProofsFilterProtocolUpdateExecution fromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + return this; + } + + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * minimum: 0 + * maximum: 10000000000 + * @return fromStateVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFromStateVersion() { + return fromStateVersion; + } + + + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + } + + + /** + * Return true if this StreamProofsFilterProtocolUpdateExecution object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsFilterProtocolUpdateExecution streamProofsFilterProtocolUpdateExecution = (StreamProofsFilterProtocolUpdateExecution) o; + return Objects.equals(this.protocolVersion, streamProofsFilterProtocolUpdateExecution.protocolVersion) && + Objects.equals(this.fromStateVersion, streamProofsFilterProtocolUpdateExecution.fromStateVersion) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(protocolVersion, fromStateVersion, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsFilterProtocolUpdateExecution {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" protocolVersion: ").append(toIndentedString(protocolVersion)).append("\n"); + sb.append(" fromStateVersion: ").append(toIndentedString(fromStateVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("All", StreamProofsFilterAll.class); + mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); + mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); + mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); + mappings.put("StreamProofsFilterProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); + JSON.registerDiscriminator(StreamProofsFilterProtocolUpdateExecution.class, "type", mappings); +} +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java new file mode 100644 index 0000000000..7a80a38c98 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java @@ -0,0 +1,145 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * StreamProofsFilterProtocolUpdateExecutionAllOf + */ +@JsonPropertyOrder({ + StreamProofsFilterProtocolUpdateExecutionAllOf.JSON_PROPERTY_PROTOCOL_VERSION, + StreamProofsFilterProtocolUpdateExecutionAllOf.JSON_PROPERTY_FROM_STATE_VERSION +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StreamProofsFilterProtocolUpdateExecutionAllOf { + public static final String JSON_PROPERTY_PROTOCOL_VERSION = "protocol_version"; + private String protocolVersion; + + public static final String JSON_PROPERTY_FROM_STATE_VERSION = "from_state_version"; + private Long fromStateVersion; + + public StreamProofsFilterProtocolUpdateExecutionAllOf() { + } + + public StreamProofsFilterProtocolUpdateExecutionAllOf protocolVersion(String protocolVersion) { + this.protocolVersion = protocolVersion; + return this; + } + + /** + * The protocol version name to filter to. This can be returned from looking at the protocol updates. + * @return protocolVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The protocol version name to filter to. This can be returned from looking at the protocol updates. ") + @JsonProperty(JSON_PROPERTY_PROTOCOL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProtocolVersion() { + return protocolVersion; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocolVersion(String protocolVersion) { + this.protocolVersion = protocolVersion; + } + + + public StreamProofsFilterProtocolUpdateExecutionAllOf fromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + return this; + } + + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * minimum: 0 + * maximum: 10000000000 + * @return fromStateVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFromStateVersion() { + return fromStateVersion; + } + + + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + } + + + /** + * Return true if this StreamProofsFilterProtocolUpdateExecution_allOf object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsFilterProtocolUpdateExecutionAllOf streamProofsFilterProtocolUpdateExecutionAllOf = (StreamProofsFilterProtocolUpdateExecutionAllOf) o; + return Objects.equals(this.protocolVersion, streamProofsFilterProtocolUpdateExecutionAllOf.protocolVersion) && + Objects.equals(this.fromStateVersion, streamProofsFilterProtocolUpdateExecutionAllOf.fromStateVersion); + } + + @Override + public int hashCode() { + return Objects.hash(protocolVersion, fromStateVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsFilterProtocolUpdateExecutionAllOf {\n"); + sb.append(" protocolVersion: ").append(toIndentedString(protocolVersion)).append("\n"); + sb.append(" fromStateVersion: ").append(toIndentedString(fromStateVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java new file mode 100644 index 0000000000..1f89fa0f65 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java @@ -0,0 +1,148 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsFilter; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAllAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; +import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateInitializations; +import com.radixdlt.api.core.generated.models.StreamProofsFilterType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.radixdlt.api.core.generated.client.JSON; +/** + * StreamProofsFilterProtocolUpdateInitializations + */ +@JsonPropertyOrder({ + StreamProofsFilterProtocolUpdateInitializations.JSON_PROPERTY_FROM_STATE_VERSION +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), + @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), +}) + +public class StreamProofsFilterProtocolUpdateInitializations extends StreamProofsFilter { + public static final String JSON_PROPERTY_FROM_STATE_VERSION = "from_state_version"; + private Long fromStateVersion; + + public StreamProofsFilterProtocolUpdateInitializations() { + } + + public StreamProofsFilterProtocolUpdateInitializations fromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + return this; + } + + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * minimum: 0 + * maximum: 10000000000 + * @return fromStateVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFromStateVersion() { + return fromStateVersion; + } + + + @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFromStateVersion(Long fromStateVersion) { + this.fromStateVersion = fromStateVersion; + } + + + /** + * Return true if this StreamProofsFilterProtocolUpdateInitializations object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsFilterProtocolUpdateInitializations streamProofsFilterProtocolUpdateInitializations = (StreamProofsFilterProtocolUpdateInitializations) o; + return Objects.equals(this.fromStateVersion, streamProofsFilterProtocolUpdateInitializations.fromStateVersion) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(fromStateVersion, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsFilterProtocolUpdateInitializations {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" fromStateVersion: ").append(toIndentedString(fromStateVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("All", StreamProofsFilterAll.class); + mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); + mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); + mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); + mappings.put("StreamProofsFilterProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); + JSON.registerDiscriminator(StreamProofsFilterProtocolUpdateInitializations.class, "type", mappings); +} +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterType.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterType.java new file mode 100644 index 0000000000..739f540730 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterType.java @@ -0,0 +1,65 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets StreamProofsFilterType + */ +public enum StreamProofsFilterType { + + ALL("All"), + + NEWEPOCHS("NewEpochs"), + + PROTOCOLUPDATETRIGGERS("ProtocolUpdateTriggers"), + + PROTOCOLUPDATEEXECUTION("ProtocolUpdateExecution"); + + private String value; + + StreamProofsFilterType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StreamProofsFilterType fromValue(String value) { + for (StreamProofsFilterType b : StreamProofsFilterType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsRequest.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsRequest.java new file mode 100644 index 0000000000..691437d7e1 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsRequest.java @@ -0,0 +1,209 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.StreamProofsFilter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * A request to retrieve a sublist of proofs. + */ +@ApiModel(description = "A request to retrieve a sublist of proofs. ") +@JsonPropertyOrder({ + StreamProofsRequest.JSON_PROPERTY_NETWORK, + StreamProofsRequest.JSON_PROPERTY_FILTER, + StreamProofsRequest.JSON_PROPERTY_MAX_PAGE_SIZE, + StreamProofsRequest.JSON_PROPERTY_CONTINUATION_TOKEN +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StreamProofsRequest { + public static final String JSON_PROPERTY_NETWORK = "network"; + private String network; + + public static final String JSON_PROPERTY_FILTER = "filter"; + private StreamProofsFilter filter; + + public static final String JSON_PROPERTY_MAX_PAGE_SIZE = "max_page_size"; + private Integer maxPageSize; + + public static final String JSON_PROPERTY_CONTINUATION_TOKEN = "continuation_token"; + private String continuationToken; + + public StreamProofsRequest() { + } + + public StreamProofsRequest network(String network) { + this.network = network; + return this; + } + + /** + * The logical name of the network + * @return network + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "{{network}}", required = true, value = "The logical name of the network") + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNetwork() { + return network; + } + + + @JsonProperty(JSON_PROPERTY_NETWORK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNetwork(String network) { + this.network = network; + } + + + public StreamProofsRequest filter(StreamProofsFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get filter + * @return filter + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_FILTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StreamProofsFilter getFilter() { + return filter; + } + + + @JsonProperty(JSON_PROPERTY_FILTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFilter(StreamProofsFilter filter) { + this.filter = filter; + } + + + public StreamProofsRequest maxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * If specified, the maximum number of proofs that will be returned. + * @return maxPageSize + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "If specified, the maximum number of proofs that will be returned.") + @JsonProperty(JSON_PROPERTY_MAX_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxPageSize() { + return maxPageSize; + } + + + @JsonProperty(JSON_PROPERTY_MAX_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + } + + + public StreamProofsRequest continuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * A continuation token is returned if and only if there are further non-empty pages of items currently available. The token can be provided in a following request to fetch the next page of results. The filter and sort should not be changed when re-using the continuation token. + * @return continuationToken + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A continuation token is returned if and only if there are further non-empty pages of items currently available. The token can be provided in a following request to fetch the next page of results. The filter and sort should not be changed when re-using the continuation token. ") + @JsonProperty(JSON_PROPERTY_CONTINUATION_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContinuationToken() { + return continuationToken; + } + + + @JsonProperty(JSON_PROPERTY_CONTINUATION_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + } + + + /** + * Return true if this StreamProofsRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsRequest streamProofsRequest = (StreamProofsRequest) o; + return Objects.equals(this.network, streamProofsRequest.network) && + Objects.equals(this.filter, streamProofsRequest.filter) && + Objects.equals(this.maxPageSize, streamProofsRequest.maxPageSize) && + Objects.equals(this.continuationToken, streamProofsRequest.continuationToken); + } + + @Override + public int hashCode() { + return Objects.hash(network, filter, maxPageSize, continuationToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsRequest {\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append(" maxPageSize: ").append(toIndentedString(maxPageSize)).append("\n"); + sb.append(" continuationToken: ").append(toIndentedString(continuationToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsResponse.java new file mode 100644 index 0000000000..5fcc0eccc8 --- /dev/null +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsResponse.java @@ -0,0 +1,151 @@ +/* + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node's function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node's current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.radixdlt.api.core.generated.models; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.radixdlt.api.core.generated.models.LedgerProof; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * StreamProofsResponse + */ +@JsonPropertyOrder({ + StreamProofsResponse.JSON_PROPERTY_PAGE, + StreamProofsResponse.JSON_PROPERTY_CONTINUATION_TOKEN +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StreamProofsResponse { + public static final String JSON_PROPERTY_PAGE = "page"; + private List page = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTINUATION_TOKEN = "continuation_token"; + private String continuationToken; + + public StreamProofsResponse() { + } + + public StreamProofsResponse page(List page) { + this.page = page; + return this; + } + + public StreamProofsResponse addPageItem(LedgerProof pageItem) { + this.page.add(pageItem); + return this; + } + + /** + * A page of ledger proofs stored by this node. + * @return page + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A page of ledger proofs stored by this node.") + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getPage() { + return page; + } + + + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPage(List page) { + this.page = page; + } + + + public StreamProofsResponse continuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * A continuation token is returned if and only if there are further non-empty pages of items currently available. The token can be provided in a following request to fetch the next page of results. The filter and sort should not be changed when re-using the continuation token. + * @return continuationToken + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A continuation token is returned if and only if there are further non-empty pages of items currently available. The token can be provided in a following request to fetch the next page of results. The filter and sort should not be changed when re-using the continuation token. ") + @JsonProperty(JSON_PROPERTY_CONTINUATION_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContinuationToken() { + return continuationToken; + } + + + @JsonProperty(JSON_PROPERTY_CONTINUATION_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + } + + + /** + * Return true if this StreamProofsResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StreamProofsResponse streamProofsResponse = (StreamProofsResponse) o; + return Objects.equals(this.page, streamProofsResponse.page) && + Objects.equals(this.continuationToken, streamProofsResponse.continuationToken); + } + + @Override + public int hashCode() { + return Objects.hash(page, continuationToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StreamProofsResponse {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" continuationToken: ").append(toIndentedString(continuationToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsErrorResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsErrorResponse.java index 55cb74caaa..b85d5d1784 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsErrorResponse.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsErrorResponse.java @@ -29,6 +29,7 @@ import com.radixdlt.api.core.generated.models.ErrorResponse; import com.radixdlt.api.core.generated.models.ErrorResponseType; import com.radixdlt.api.core.generated.models.LtsTransactionSubmitErrorResponse; +import com.radixdlt.api.core.generated.models.StreamProofsErrorResponse; import com.radixdlt.api.core.generated.models.StreamTransactionsErrorDetails; import com.radixdlt.api.core.generated.models.StreamTransactionsErrorResponse; import com.radixdlt.api.core.generated.models.StreamTransactionsErrorResponseAllOf; @@ -54,6 +55,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = BasicErrorResponse.class, name = "Basic"), @JsonSubTypes.Type(value = LtsTransactionSubmitErrorResponse.class, name = "LtsTransactionSubmit"), + @JsonSubTypes.Type(value = StreamProofsErrorResponse.class, name = "StreamProofs"), @JsonSubTypes.Type(value = StreamTransactionsErrorResponse.class, name = "StreamTransactions"), @JsonSubTypes.Type(value = TransactionSubmitErrorResponse.class, name = "TransactionSubmit"), }) @@ -138,6 +140,7 @@ private String toIndentedString(Object o) { Map> mappings = new HashMap>(); mappings.put("Basic", BasicErrorResponse.class); mappings.put("LtsTransactionSubmit", LtsTransactionSubmitErrorResponse.class); + mappings.put("StreamProofs", StreamProofsErrorResponse.class); mappings.put("StreamTransactions", StreamTransactionsErrorResponse.class); mappings.put("TransactionSubmit", TransactionSubmitErrorResponse.class); mappings.put("StreamTransactionsErrorResponse", StreamTransactionsErrorResponse.class); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsResponse.java index 65d5361e2c..6c10a65451 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsResponse.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsResponse.java @@ -126,13 +126,13 @@ public StreamTransactionsResponse count(Integer count) { } /** - * An integer between `0` and `10000`, giving the total count of transactions in the returned response + * An integer between `0` and `10000`, giving the total count of proofs in the returned response * minimum: 0 * maximum: 10000 * @return count **/ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An integer between `0` and `10000`, giving the total count of transactions in the returned response") + @ApiModelProperty(required = true, value = "An integer between `0` and `10000`, giving the total count of proofs in the returned response") @JsonProperty(JSON_PROPERTY_COUNT) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/TransactionSubmitErrorResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/TransactionSubmitErrorResponse.java index 153fe85d1b..a5ce060577 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/TransactionSubmitErrorResponse.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/TransactionSubmitErrorResponse.java @@ -29,6 +29,7 @@ import com.radixdlt.api.core.generated.models.ErrorResponse; import com.radixdlt.api.core.generated.models.ErrorResponseType; import com.radixdlt.api.core.generated.models.LtsTransactionSubmitErrorResponse; +import com.radixdlt.api.core.generated.models.StreamProofsErrorResponse; import com.radixdlt.api.core.generated.models.StreamTransactionsErrorResponse; import com.radixdlt.api.core.generated.models.TransactionSubmitErrorDetails; import com.radixdlt.api.core.generated.models.TransactionSubmitErrorResponse; @@ -54,6 +55,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = BasicErrorResponse.class, name = "Basic"), @JsonSubTypes.Type(value = LtsTransactionSubmitErrorResponse.class, name = "LtsTransactionSubmit"), + @JsonSubTypes.Type(value = StreamProofsErrorResponse.class, name = "StreamProofs"), @JsonSubTypes.Type(value = StreamTransactionsErrorResponse.class, name = "StreamTransactions"), @JsonSubTypes.Type(value = TransactionSubmitErrorResponse.class, name = "TransactionSubmit"), }) @@ -138,6 +140,7 @@ private String toIndentedString(Object o) { Map> mappings = new HashMap>(); mappings.put("Basic", BasicErrorResponse.class); mappings.put("LtsTransactionSubmit", LtsTransactionSubmitErrorResponse.class); + mappings.put("StreamProofs", StreamProofsErrorResponse.class); mappings.put("StreamTransactions", StreamTransactionsErrorResponse.class); mappings.put("TransactionSubmit", TransactionSubmitErrorResponse.class); mappings.put("TransactionSubmitErrorResponse", TransactionSubmitErrorResponse.class); diff --git a/sdk/typescript/lib/generated/.openapi-generator/FILES b/sdk/typescript/lib/generated/.openapi-generator/FILES index b7ce3cb119..8c741ffef9 100644 --- a/sdk/typescript/lib/generated/.openapi-generator/FILES +++ b/sdk/typescript/lib/generated/.openapi-generator/FILES @@ -142,6 +142,7 @@ models/EntityModule.ts models/EntityReference.ts models/EntityType.ts models/EpochChangeCondition.ts +models/EpochEndLedgerProof.ts models/EpochRound.ts models/ErrorResponse.ts models/ErrorResponseBase.ts @@ -456,7 +457,6 @@ models/ReferenceType.ts models/RemoteGenericSubstitution.ts models/RemoteGenericSubstitutionAllOf.ts models/RequestedStateVersionOutOfBoundsErrorDetails.ts -models/RequestedStateVersionOutOfBoundsErrorDetailsAllOf.ts models/RequireProofRule.ts models/RequireProofRuleAllOf.ts models/Requirement.ts @@ -542,6 +542,28 @@ models/StateValidatorResponse.ts models/StaticBlueprintPayloadDef.ts models/StaticBlueprintPayloadDefAllOf.ts models/StaticRoleDefinitionAuthTemplate.ts +models/StreamProofsErrorDetails.ts +models/StreamProofsErrorDetailsBase.ts +models/StreamProofsErrorDetailsRequestedEpochOutOfBounds.ts +models/StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.ts +models/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.ts +models/StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.ts +models/StreamProofsErrorDetailsType.ts +models/StreamProofsErrorResponse.ts +models/StreamProofsErrorResponseAllOf.ts +models/StreamProofsFilter.ts +models/StreamProofsFilterAll.ts +models/StreamProofsFilterAllAllOf.ts +models/StreamProofsFilterBase.ts +models/StreamProofsFilterNewEpochs.ts +models/StreamProofsFilterNewEpochsAllOf.ts +models/StreamProofsFilterProtocolUpdateExecution.ts +models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts +models/StreamProofsFilterProtocolUpdateInitializations.ts +models/StreamProofsFilterProtocolUpdateInitializationsAllOf.ts +models/StreamProofsFilterType.ts +models/StreamProofsRequest.ts +models/StreamProofsResponse.ts models/StreamTransactionsErrorDetails.ts models/StreamTransactionsErrorDetailsBase.ts models/StreamTransactionsErrorDetailsType.ts diff --git a/sdk/typescript/lib/generated/apis/LTSApi.ts b/sdk/typescript/lib/generated/apis/LTSApi.ts index 3c14e120df..e7e8006191 100644 --- a/sdk/typescript/lib/generated/apis/LTSApi.ts +++ b/sdk/typescript/lib/generated/apis/LTSApi.ts @@ -30,9 +30,9 @@ import type { LtsTransactionConstructionResponse, LtsTransactionStatusRequest, LtsTransactionStatusResponse, + LtsTransactionSubmitErrorResponse, LtsTransactionSubmitRequest, LtsTransactionSubmitResponse, - TransactionSubmitErrorResponse, } from '../models'; import { BasicErrorResponseFromJSON, @@ -65,12 +65,12 @@ import { LtsTransactionStatusRequestToJSON, LtsTransactionStatusResponseFromJSON, LtsTransactionStatusResponseToJSON, + LtsTransactionSubmitErrorResponseFromJSON, + LtsTransactionSubmitErrorResponseToJSON, LtsTransactionSubmitRequestFromJSON, LtsTransactionSubmitRequestToJSON, LtsTransactionSubmitResponseFromJSON, LtsTransactionSubmitResponseToJSON, - TransactionSubmitErrorResponseFromJSON, - TransactionSubmitErrorResponseToJSON, } from '../models'; export interface LtsStateAccountAllFungibleResourceBalancesPostRequest { diff --git a/sdk/typescript/lib/generated/apis/StreamApi.ts b/sdk/typescript/lib/generated/apis/StreamApi.ts index b357818068..2255794ab7 100644 --- a/sdk/typescript/lib/generated/apis/StreamApi.ts +++ b/sdk/typescript/lib/generated/apis/StreamApi.ts @@ -15,19 +15,32 @@ import * as runtime from '../runtime'; import type { - BasicErrorResponse, + StreamProofsErrorResponse, + StreamProofsRequest, + StreamProofsResponse, + StreamTransactionsErrorResponse, StreamTransactionsRequest, StreamTransactionsResponse, } from '../models'; import { - BasicErrorResponseFromJSON, - BasicErrorResponseToJSON, + StreamProofsErrorResponseFromJSON, + StreamProofsErrorResponseToJSON, + StreamProofsRequestFromJSON, + StreamProofsRequestToJSON, + StreamProofsResponseFromJSON, + StreamProofsResponseToJSON, + StreamTransactionsErrorResponseFromJSON, + StreamTransactionsErrorResponseToJSON, StreamTransactionsRequestFromJSON, StreamTransactionsRequestToJSON, StreamTransactionsResponseFromJSON, StreamTransactionsResponseToJSON, } from '../models'; +export interface StreamProofsPostRequest { + streamProofsRequest: StreamProofsRequest; +} + export interface StreamTransactionsPostRequest { streamTransactionsRequest: StreamTransactionsRequest; } @@ -37,6 +50,41 @@ export interface StreamTransactionsPostRequest { */ export class StreamApi extends runtime.BaseAPI { + /** + * Returns a stream of proofs committed to the node\'s ledger. NOTE: This endpoint may return different results on different nodes: * Each node may persist different subset of signatures on a given proofs, as long as enough of the validator set has signed. * Inside an epoch, different nodes may receive and persist / keep different proofs, subject to constraints on gaps between proofs. Proofs during an epoch can also be garbage collected by the node after the fact. Therefore proofs may disappear from this stream. Some proofs (such as during genesis and protocol update enactment) are created on a node and don\'t include signatures. This stream accepts four different options in the request: * All proofs forward (from state version) * All end-of-epoch proofs (from epoch number) * All end-of-epoch proofs triggering a protocol update * All node-injected proofs enacting genesis or a protocol update (for protocol update name, from state version) The end-of-epoch proofs can be used to \"trustlessly\" verify the validator set for a given epoch. By tracking the fact that validators for epoch N sign the next validator set for epoch N + 1, this chain of proofs can be used to provide proof of the current validator set from a hardcoded start. When a validator set is known for a given epoch, this can be used to verify the various transaction hash trees in the epoch, and to prove other data. NOTE: This endpoint was built after agreeing the new Radix convention for paged APIs. Its models therefore follow the new convention, rather than attempting to align with existing loose Core API conventions. + * Stream Proofs + */ + async streamProofsPostRaw(requestParameters: StreamProofsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.streamProofsRequest === null || requestParameters.streamProofsRequest === undefined) { + throw new runtime.RequiredError('streamProofsRequest','Required parameter requestParameters.streamProofsRequest was null or undefined when calling streamProofsPost.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/stream/proofs`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: StreamProofsRequestToJSON(requestParameters.streamProofsRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => StreamProofsResponseFromJSON(jsonValue)); + } + + /** + * Returns a stream of proofs committed to the node\'s ledger. NOTE: This endpoint may return different results on different nodes: * Each node may persist different subset of signatures on a given proofs, as long as enough of the validator set has signed. * Inside an epoch, different nodes may receive and persist / keep different proofs, subject to constraints on gaps between proofs. Proofs during an epoch can also be garbage collected by the node after the fact. Therefore proofs may disappear from this stream. Some proofs (such as during genesis and protocol update enactment) are created on a node and don\'t include signatures. This stream accepts four different options in the request: * All proofs forward (from state version) * All end-of-epoch proofs (from epoch number) * All end-of-epoch proofs triggering a protocol update * All node-injected proofs enacting genesis or a protocol update (for protocol update name, from state version) The end-of-epoch proofs can be used to \"trustlessly\" verify the validator set for a given epoch. By tracking the fact that validators for epoch N sign the next validator set for epoch N + 1, this chain of proofs can be used to provide proof of the current validator set from a hardcoded start. When a validator set is known for a given epoch, this can be used to verify the various transaction hash trees in the epoch, and to prove other data. NOTE: This endpoint was built after agreeing the new Radix convention for paged APIs. Its models therefore follow the new convention, rather than attempting to align with existing loose Core API conventions. + * Stream Proofs + */ + async streamProofsPost(requestParameters: StreamProofsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.streamProofsPostRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * Returns the list of committed transactions. * Get Committed Transactions diff --git a/sdk/typescript/lib/generated/models/EpochEndLedgerProof.ts b/sdk/typescript/lib/generated/models/EpochEndLedgerProof.ts new file mode 100644 index 0000000000..a297c64ba9 --- /dev/null +++ b/sdk/typescript/lib/generated/models/EpochEndLedgerProof.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { LedgerProof } from './LedgerProof'; +import { + LedgerProofFromJSON, + LedgerProofFromJSONTyped, + LedgerProofToJSON, +} from './LedgerProof'; + +/** + * + * @export + * @interface EpochEndLedgerProof + */ +export interface EpochEndLedgerProof { + /** + * + * @type {number} + * @memberof EpochEndLedgerProof + */ + end_of_epoch: number; + /** + * + * @type {LedgerProof} + * @memberof EpochEndLedgerProof + */ + ledger_proof: LedgerProof; +} + +/** + * Check if a given object implements the EpochEndLedgerProof interface. + */ +export function instanceOfEpochEndLedgerProof(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "end_of_epoch" in value; + isInstance = isInstance && "ledger_proof" in value; + + return isInstance; +} + +export function EpochEndLedgerProofFromJSON(json: any): EpochEndLedgerProof { + return EpochEndLedgerProofFromJSONTyped(json, false); +} + +export function EpochEndLedgerProofFromJSONTyped(json: any, ignoreDiscriminator: boolean): EpochEndLedgerProof { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'end_of_epoch': json['end_of_epoch'], + 'ledger_proof': LedgerProofFromJSON(json['ledger_proof']), + }; +} + +export function EpochEndLedgerProofToJSON(value?: EpochEndLedgerProof | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'end_of_epoch': value.end_of_epoch, + 'ledger_proof': LedgerProofToJSON(value.ledger_proof), + }; +} + diff --git a/sdk/typescript/lib/generated/models/ErrorResponse.ts b/sdk/typescript/lib/generated/models/ErrorResponse.ts index fe8f1333ba..be87dd1d9b 100644 --- a/sdk/typescript/lib/generated/models/ErrorResponse.ts +++ b/sdk/typescript/lib/generated/models/ErrorResponse.ts @@ -26,6 +26,13 @@ import { LtsTransactionSubmitErrorResponseFromJSONTyped, LtsTransactionSubmitErrorResponseToJSON, } from './LtsTransactionSubmitErrorResponse'; +import { + StreamProofsErrorResponse, + instanceOfStreamProofsErrorResponse, + StreamProofsErrorResponseFromJSON, + StreamProofsErrorResponseFromJSONTyped, + StreamProofsErrorResponseToJSON, +} from './StreamProofsErrorResponse'; import { StreamTransactionsErrorResponse, instanceOfStreamTransactionsErrorResponse, @@ -46,7 +53,7 @@ import { * * @export */ -export type ErrorResponse = { error_type: 'Basic' } & BasicErrorResponse | { error_type: 'LtsTransactionSubmit' } & LtsTransactionSubmitErrorResponse | { error_type: 'StreamTransactions' } & StreamTransactionsErrorResponse | { error_type: 'TransactionSubmit' } & TransactionSubmitErrorResponse; +export type ErrorResponse = { error_type: 'Basic' } & BasicErrorResponse | { error_type: 'LtsTransactionSubmit' } & LtsTransactionSubmitErrorResponse | { error_type: 'StreamProofs' } & StreamProofsErrorResponse | { error_type: 'StreamTransactions' } & StreamTransactionsErrorResponse | { error_type: 'TransactionSubmit' } & TransactionSubmitErrorResponse; export function ErrorResponseFromJSON(json: any): ErrorResponse { return ErrorResponseFromJSONTyped(json, false); @@ -61,6 +68,8 @@ export function ErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boole return {...BasicErrorResponseFromJSONTyped(json, true), error_type: 'Basic'}; case 'LtsTransactionSubmit': return {...LtsTransactionSubmitErrorResponseFromJSONTyped(json, true), error_type: 'LtsTransactionSubmit'}; + case 'StreamProofs': + return {...StreamProofsErrorResponseFromJSONTyped(json, true), error_type: 'StreamProofs'}; case 'StreamTransactions': return {...StreamTransactionsErrorResponseFromJSONTyped(json, true), error_type: 'StreamTransactions'}; case 'TransactionSubmit': @@ -82,6 +91,8 @@ export function ErrorResponseToJSON(value?: ErrorResponse | null): any { return BasicErrorResponseToJSON(value); case 'LtsTransactionSubmit': return LtsTransactionSubmitErrorResponseToJSON(value); + case 'StreamProofs': + return StreamProofsErrorResponseToJSON(value); case 'StreamTransactions': return StreamTransactionsErrorResponseToJSON(value); case 'TransactionSubmit': diff --git a/sdk/typescript/lib/generated/models/ErrorResponseType.ts b/sdk/typescript/lib/generated/models/ErrorResponseType.ts index 83f3a28554..d4ac8bab2c 100644 --- a/sdk/typescript/lib/generated/models/ErrorResponseType.ts +++ b/sdk/typescript/lib/generated/models/ErrorResponseType.ts @@ -21,7 +21,8 @@ export const ErrorResponseType = { Basic: 'Basic', TransactionSubmit: 'TransactionSubmit', LtsTransactionSubmit: 'LtsTransactionSubmit', - StreamTransactions: 'StreamTransactions' + StreamTransactions: 'StreamTransactions', + StreamProofs: 'StreamProofs' } as const; export type ErrorResponseType = typeof ErrorResponseType[keyof typeof ErrorResponseType]; diff --git a/sdk/typescript/lib/generated/models/LedgerHeader.ts b/sdk/typescript/lib/generated/models/LedgerHeader.ts index 051d919c46..b7ba47242d 100644 --- a/sdk/typescript/lib/generated/models/LedgerHeader.ts +++ b/sdk/typescript/lib/generated/models/LedgerHeader.ts @@ -74,6 +74,12 @@ export interface LedgerHeader { * @memberof LedgerHeader */ next_epoch?: NextEpoch; + /** + * If present, indicates that this proof triggers the enactment of the given protocol version. + * @type {string} + * @memberof LedgerHeader + */ + next_protocol_version?: string; } /** @@ -108,6 +114,7 @@ export function LedgerHeaderFromJSONTyped(json: any, ignoreDiscriminator: boolea 'consensus_parent_round_timestamp_ms': json['consensus_parent_round_timestamp_ms'], 'proposer_timestamp_ms': json['proposer_timestamp_ms'], 'next_epoch': !exists(json, 'next_epoch') ? undefined : NextEpochFromJSON(json['next_epoch']), + 'next_protocol_version': !exists(json, 'next_protocol_version') ? undefined : json['next_protocol_version'], }; } @@ -127,6 +134,7 @@ export function LedgerHeaderToJSON(value?: LedgerHeader | null): any { 'consensus_parent_round_timestamp_ms': value.consensus_parent_round_timestamp_ms, 'proposer_timestamp_ms': value.proposer_timestamp_ms, 'next_epoch': NextEpochToJSON(value.next_epoch), + 'next_protocol_version': value.next_protocol_version, }; } diff --git a/sdk/typescript/lib/generated/models/StreamProofsErrorDetails.ts b/sdk/typescript/lib/generated/models/StreamProofsErrorDetails.ts new file mode 100644 index 0000000000..ef314a6abb --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsErrorDetails.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { + StreamProofsErrorDetailsRequestedEpochOutOfBounds, + instanceOfStreamProofsErrorDetailsRequestedEpochOutOfBounds, + StreamProofsErrorDetailsRequestedEpochOutOfBoundsFromJSON, + StreamProofsErrorDetailsRequestedEpochOutOfBoundsFromJSONTyped, + StreamProofsErrorDetailsRequestedEpochOutOfBoundsToJSON, +} from './StreamProofsErrorDetailsRequestedEpochOutOfBounds'; +import { + StreamProofsErrorDetailsRequestedStateVersionOutOfBounds, + instanceOfStreamProofsErrorDetailsRequestedStateVersionOutOfBounds, + StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsFromJSON, + StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsFromJSONTyped, + StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsToJSON, +} from './StreamProofsErrorDetailsRequestedStateVersionOutOfBounds'; + +/** + * @type StreamProofsErrorDetails + * + * @export + */ +export type StreamProofsErrorDetails = { type: 'RequestedEpochOutOfBounds' } & StreamProofsErrorDetailsRequestedEpochOutOfBounds | { type: 'RequestedStateVersionOutOfBounds' } & StreamProofsErrorDetailsRequestedStateVersionOutOfBounds; + +export function StreamProofsErrorDetailsFromJSON(json: any): StreamProofsErrorDetails { + return StreamProofsErrorDetailsFromJSONTyped(json, false); +} + +export function StreamProofsErrorDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsErrorDetails { + if ((json === undefined) || (json === null)) { + return json; + } + switch (json['type']) { + case 'RequestedEpochOutOfBounds': + return {...StreamProofsErrorDetailsRequestedEpochOutOfBoundsFromJSONTyped(json, true), type: 'RequestedEpochOutOfBounds'}; + case 'RequestedStateVersionOutOfBounds': + return {...StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsFromJSONTyped(json, true), type: 'RequestedStateVersionOutOfBounds'}; + default: + throw new Error(`No variant of StreamProofsErrorDetails exists with 'type=${json['type']}'`); + } +} + +export function StreamProofsErrorDetailsToJSON(value?: StreamProofsErrorDetails | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + switch (value['type']) { + case 'RequestedEpochOutOfBounds': + return StreamProofsErrorDetailsRequestedEpochOutOfBoundsToJSON(value); + case 'RequestedStateVersionOutOfBounds': + return StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsToJSON(value); + default: + throw new Error(`No variant of StreamProofsErrorDetails exists with 'type=${value['type']}'`); + } + +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsBase.ts b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsBase.ts new file mode 100644 index 0000000000..5ddaefa702 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsBase.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StreamProofsErrorDetailsType } from './StreamProofsErrorDetailsType'; +import { + StreamProofsErrorDetailsTypeFromJSON, + StreamProofsErrorDetailsTypeFromJSONTyped, + StreamProofsErrorDetailsTypeToJSON, +} from './StreamProofsErrorDetailsType'; + +/** + * + * @export + * @interface StreamProofsErrorDetailsBase + */ +export interface StreamProofsErrorDetailsBase { + /** + * + * @type {StreamProofsErrorDetailsType} + * @memberof StreamProofsErrorDetailsBase + */ + type: StreamProofsErrorDetailsType; +} + +/** + * Check if a given object implements the StreamProofsErrorDetailsBase interface. + */ +export function instanceOfStreamProofsErrorDetailsBase(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function StreamProofsErrorDetailsBaseFromJSON(json: any): StreamProofsErrorDetailsBase { + return StreamProofsErrorDetailsBaseFromJSONTyped(json, false); +} + +export function StreamProofsErrorDetailsBaseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsErrorDetailsBase { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': StreamProofsErrorDetailsTypeFromJSON(json['type']), + }; +} + +export function StreamProofsErrorDetailsBaseToJSON(value?: StreamProofsErrorDetailsBase | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': StreamProofsErrorDetailsTypeToJSON(value.type), + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBounds.ts b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBounds.ts new file mode 100644 index 0000000000..6572aa18eb --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBounds.ts @@ -0,0 +1,87 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsErrorDetailsRequestedEpochOutOfBounds + */ +export interface StreamProofsErrorDetailsRequestedEpochOutOfBounds { + /** + * + * @type {string} + * @memberof StreamProofsErrorDetailsRequestedEpochOutOfBounds + */ + type: StreamProofsErrorDetailsRequestedEpochOutOfBoundsTypeEnum; + /** + * The maximum completed epoch committed to this node's ledger. + * *Note on the bounds:* the requested `from_epoch` cannot be greater than + * `max_ledger_epoch + 1`. Any greater requested value triggers this error. + * @type {number} + * @memberof StreamProofsErrorDetailsRequestedEpochOutOfBounds + */ + max_ledger_epoch: number; +} + + +/** + * @export + */ +export const StreamProofsErrorDetailsRequestedEpochOutOfBoundsTypeEnum = { + RequestedEpochOutOfBounds: 'RequestedEpochOutOfBounds' +} as const; +export type StreamProofsErrorDetailsRequestedEpochOutOfBoundsTypeEnum = typeof StreamProofsErrorDetailsRequestedEpochOutOfBoundsTypeEnum[keyof typeof StreamProofsErrorDetailsRequestedEpochOutOfBoundsTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsErrorDetailsRequestedEpochOutOfBounds interface. + */ +export function instanceOfStreamProofsErrorDetailsRequestedEpochOutOfBounds(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "max_ledger_epoch" in value; + + return isInstance; +} + +export function StreamProofsErrorDetailsRequestedEpochOutOfBoundsFromJSON(json: any): StreamProofsErrorDetailsRequestedEpochOutOfBounds { + return StreamProofsErrorDetailsRequestedEpochOutOfBoundsFromJSONTyped(json, false); +} + +export function StreamProofsErrorDetailsRequestedEpochOutOfBoundsFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsErrorDetailsRequestedEpochOutOfBounds { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'max_ledger_epoch': json['max_ledger_epoch'], + }; +} + +export function StreamProofsErrorDetailsRequestedEpochOutOfBoundsToJSON(value?: StreamProofsErrorDetailsRequestedEpochOutOfBounds | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'max_ledger_epoch': value.max_ledger_epoch, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.ts new file mode 100644 index 0000000000..44ff0154c1 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf + */ +export interface StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf { + /** + * The maximum completed epoch committed to this node's ledger. + * *Note on the bounds:* the requested `from_epoch` cannot be greater than + * `max_ledger_epoch + 1`. Any greater requested value triggers this error. + * @type {number} + * @memberof StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf + */ + max_ledger_epoch: number; + /** + * + * @type {string} + * @memberof StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf + */ + type?: StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOfTypeEnum; +} + + +/** + * @export + */ +export const StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOfTypeEnum = { + RequestedEpochOutOfBounds: 'RequestedEpochOutOfBounds' +} as const; +export type StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOfTypeEnum = typeof StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOfTypeEnum[keyof typeof StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOfTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf interface. + */ +export function instanceOfStreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "max_ledger_epoch" in value; + + return isInstance; +} + +export function StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOfFromJSON(json: any): StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf { + return StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOfFromJSONTyped(json, false); +} + +export function StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'max_ledger_epoch': json['max_ledger_epoch'], + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOfToJSON(value?: StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'max_ledger_epoch': value.max_ledger_epoch, + 'type': value.type, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.ts b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.ts new file mode 100644 index 0000000000..7b2621f62a --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBounds.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsErrorDetailsRequestedStateVersionOutOfBounds + */ +export interface StreamProofsErrorDetailsRequestedStateVersionOutOfBounds { + /** + * + * @type {string} + * @memberof StreamProofsErrorDetailsRequestedStateVersionOutOfBounds + */ + type: StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsTypeEnum; + /** + * + * @type {number} + * @memberof StreamProofsErrorDetailsRequestedStateVersionOutOfBounds + */ + max_ledger_state_version: number; +} + + +/** + * @export + */ +export const StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsTypeEnum = { + RequestedStateVersionOutOfBounds: 'RequestedStateVersionOutOfBounds' +} as const; +export type StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsTypeEnum = typeof StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsTypeEnum[keyof typeof StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsErrorDetailsRequestedStateVersionOutOfBounds interface. + */ +export function instanceOfStreamProofsErrorDetailsRequestedStateVersionOutOfBounds(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + isInstance = isInstance && "max_ledger_state_version" in value; + + return isInstance; +} + +export function StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsFromJSON(json: any): StreamProofsErrorDetailsRequestedStateVersionOutOfBounds { + return StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsFromJSONTyped(json, false); +} + +export function StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsErrorDetailsRequestedStateVersionOutOfBounds { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'max_ledger_state_version': json['max_ledger_state_version'], + }; +} + +export function StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsToJSON(value?: StreamProofsErrorDetailsRequestedStateVersionOutOfBounds | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'max_ledger_state_version': value.max_ledger_state_version, + }; +} + diff --git a/sdk/typescript/lib/generated/models/RequestedStateVersionOutOfBoundsErrorDetailsAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.ts similarity index 65% rename from sdk/typescript/lib/generated/models/RequestedStateVersionOutOfBoundsErrorDetailsAllOf.ts rename to sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.ts index b1336d68fa..e502f2458e 100644 --- a/sdk/typescript/lib/generated/models/RequestedStateVersionOutOfBoundsErrorDetailsAllOf.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf.ts @@ -16,48 +16,48 @@ import { exists, mapValues } from '../runtime'; /** * * @export - * @interface RequestedStateVersionOutOfBoundsErrorDetailsAllOf + * @interface StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf */ -export interface RequestedStateVersionOutOfBoundsErrorDetailsAllOf { +export interface StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf { /** * * @type {number} - * @memberof RequestedStateVersionOutOfBoundsErrorDetailsAllOf + * @memberof StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf */ max_ledger_state_version: number; /** * * @type {string} - * @memberof RequestedStateVersionOutOfBoundsErrorDetailsAllOf + * @memberof StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf */ - type?: RequestedStateVersionOutOfBoundsErrorDetailsAllOfTypeEnum; + type?: StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOfTypeEnum; } /** * @export */ -export const RequestedStateVersionOutOfBoundsErrorDetailsAllOfTypeEnum = { +export const StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOfTypeEnum = { RequestedStateVersionOutOfBounds: 'RequestedStateVersionOutOfBounds' } as const; -export type RequestedStateVersionOutOfBoundsErrorDetailsAllOfTypeEnum = typeof RequestedStateVersionOutOfBoundsErrorDetailsAllOfTypeEnum[keyof typeof RequestedStateVersionOutOfBoundsErrorDetailsAllOfTypeEnum]; +export type StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOfTypeEnum = typeof StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOfTypeEnum[keyof typeof StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOfTypeEnum]; /** - * Check if a given object implements the RequestedStateVersionOutOfBoundsErrorDetailsAllOf interface. + * Check if a given object implements the StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf interface. */ -export function instanceOfRequestedStateVersionOutOfBoundsErrorDetailsAllOf(value: object): boolean { +export function instanceOfStreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf(value: object): boolean { let isInstance = true; isInstance = isInstance && "max_ledger_state_version" in value; return isInstance; } -export function RequestedStateVersionOutOfBoundsErrorDetailsAllOfFromJSON(json: any): RequestedStateVersionOutOfBoundsErrorDetailsAllOf { - return RequestedStateVersionOutOfBoundsErrorDetailsAllOfFromJSONTyped(json, false); +export function StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOfFromJSON(json: any): StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf { + return StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOfFromJSONTyped(json, false); } -export function RequestedStateVersionOutOfBoundsErrorDetailsAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): RequestedStateVersionOutOfBoundsErrorDetailsAllOf { +export function StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf { if ((json === undefined) || (json === null)) { return json; } @@ -68,7 +68,7 @@ export function RequestedStateVersionOutOfBoundsErrorDetailsAllOfFromJSONTyped(j }; } -export function RequestedStateVersionOutOfBoundsErrorDetailsAllOfToJSON(value?: RequestedStateVersionOutOfBoundsErrorDetailsAllOf | null): any { +export function StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOfToJSON(value?: StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf | null): any { if (value === undefined) { return undefined; } diff --git a/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsType.ts b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsType.ts new file mode 100644 index 0000000000..4de1d9e69e --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsErrorDetailsType.ts @@ -0,0 +1,38 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const StreamProofsErrorDetailsType = { + RequestedStateVersionOutOfBounds: 'RequestedStateVersionOutOfBounds', + RequestedEpochOutOfBounds: 'RequestedEpochOutOfBounds' +} as const; +export type StreamProofsErrorDetailsType = typeof StreamProofsErrorDetailsType[keyof typeof StreamProofsErrorDetailsType]; + + +export function StreamProofsErrorDetailsTypeFromJSON(json: any): StreamProofsErrorDetailsType { + return StreamProofsErrorDetailsTypeFromJSONTyped(json, false); +} + +export function StreamProofsErrorDetailsTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsErrorDetailsType { + return json as StreamProofsErrorDetailsType; +} + +export function StreamProofsErrorDetailsTypeToJSON(value?: StreamProofsErrorDetailsType | null): any { + return value as any; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsErrorResponse.ts b/sdk/typescript/lib/generated/models/StreamProofsErrorResponse.ts new file mode 100644 index 0000000000..db38bf0ad5 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsErrorResponse.ts @@ -0,0 +1,117 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StreamProofsErrorDetails } from './StreamProofsErrorDetails'; +import { + StreamProofsErrorDetailsFromJSON, + StreamProofsErrorDetailsFromJSONTyped, + StreamProofsErrorDetailsToJSON, +} from './StreamProofsErrorDetails'; + +/** + * + * @export + * @interface StreamProofsErrorResponse + */ +export interface StreamProofsErrorResponse { + /** + * + * @type {string} + * @memberof StreamProofsErrorResponse + */ + error_type: StreamProofsErrorResponseErrorTypeEnum; + /** + * A numeric code corresponding to the given HTTP error code. + * @type {number} + * @memberof StreamProofsErrorResponse + */ + code: number; + /** + * A human-readable error message. + * @type {string} + * @memberof StreamProofsErrorResponse + */ + message: string; + /** + * A GUID to be used when reporting errors, to allow correlation with the Core API's error logs, in the case where the Core API details are hidden. + * @type {string} + * @memberof StreamProofsErrorResponse + */ + trace_id?: string; + /** + * + * @type {StreamProofsErrorDetails} + * @memberof StreamProofsErrorResponse + */ + details?: StreamProofsErrorDetails; +} + + +/** + * @export + */ +export const StreamProofsErrorResponseErrorTypeEnum = { + StreamProofs: 'StreamProofs' +} as const; +export type StreamProofsErrorResponseErrorTypeEnum = typeof StreamProofsErrorResponseErrorTypeEnum[keyof typeof StreamProofsErrorResponseErrorTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsErrorResponse interface. + */ +export function instanceOfStreamProofsErrorResponse(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "error_type" in value; + isInstance = isInstance && "code" in value; + isInstance = isInstance && "message" in value; + + return isInstance; +} + +export function StreamProofsErrorResponseFromJSON(json: any): StreamProofsErrorResponse { + return StreamProofsErrorResponseFromJSONTyped(json, false); +} + +export function StreamProofsErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsErrorResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'error_type': json['error_type'], + 'code': json['code'], + 'message': json['message'], + 'trace_id': !exists(json, 'trace_id') ? undefined : json['trace_id'], + 'details': !exists(json, 'details') ? undefined : StreamProofsErrorDetailsFromJSON(json['details']), + }; +} + +export function StreamProofsErrorResponseToJSON(value?: StreamProofsErrorResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'error_type': value.error_type, + 'code': value.code, + 'message': value.message, + 'trace_id': value.trace_id, + 'details': StreamProofsErrorDetailsToJSON(value.details), + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsErrorResponseAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsErrorResponseAllOf.ts new file mode 100644 index 0000000000..e241ca11dc --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsErrorResponseAllOf.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StreamProofsErrorDetails } from './StreamProofsErrorDetails'; +import { + StreamProofsErrorDetailsFromJSON, + StreamProofsErrorDetailsFromJSONTyped, + StreamProofsErrorDetailsToJSON, +} from './StreamProofsErrorDetails'; + +/** + * + * @export + * @interface StreamProofsErrorResponseAllOf + */ +export interface StreamProofsErrorResponseAllOf { + /** + * + * @type {StreamProofsErrorDetails} + * @memberof StreamProofsErrorResponseAllOf + */ + details?: StreamProofsErrorDetails; + /** + * + * @type {string} + * @memberof StreamProofsErrorResponseAllOf + */ + error_type?: StreamProofsErrorResponseAllOfErrorTypeEnum; +} + + +/** + * @export + */ +export const StreamProofsErrorResponseAllOfErrorTypeEnum = { + StreamProofs: 'StreamProofs' +} as const; +export type StreamProofsErrorResponseAllOfErrorTypeEnum = typeof StreamProofsErrorResponseAllOfErrorTypeEnum[keyof typeof StreamProofsErrorResponseAllOfErrorTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsErrorResponseAllOf interface. + */ +export function instanceOfStreamProofsErrorResponseAllOf(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function StreamProofsErrorResponseAllOfFromJSON(json: any): StreamProofsErrorResponseAllOf { + return StreamProofsErrorResponseAllOfFromJSONTyped(json, false); +} + +export function StreamProofsErrorResponseAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsErrorResponseAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'details': !exists(json, 'details') ? undefined : StreamProofsErrorDetailsFromJSON(json['details']), + 'error_type': !exists(json, 'error_type') ? undefined : json['error_type'], + }; +} + +export function StreamProofsErrorResponseAllOfToJSON(value?: StreamProofsErrorResponseAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'details': StreamProofsErrorDetailsToJSON(value.details), + 'error_type': value.error_type, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilter.ts b/sdk/typescript/lib/generated/models/StreamProofsFilter.ts new file mode 100644 index 0000000000..fb2b644e35 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilter.ts @@ -0,0 +1,94 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { + StreamProofsFilterAll, + instanceOfStreamProofsFilterAll, + StreamProofsFilterAllFromJSON, + StreamProofsFilterAllFromJSONTyped, + StreamProofsFilterAllToJSON, +} from './StreamProofsFilterAll'; +import { + StreamProofsFilterNewEpochs, + instanceOfStreamProofsFilterNewEpochs, + StreamProofsFilterNewEpochsFromJSON, + StreamProofsFilterNewEpochsFromJSONTyped, + StreamProofsFilterNewEpochsToJSON, +} from './StreamProofsFilterNewEpochs'; +import { + StreamProofsFilterProtocolUpdateExecution, + instanceOfStreamProofsFilterProtocolUpdateExecution, + StreamProofsFilterProtocolUpdateExecutionFromJSON, + StreamProofsFilterProtocolUpdateExecutionFromJSONTyped, + StreamProofsFilterProtocolUpdateExecutionToJSON, +} from './StreamProofsFilterProtocolUpdateExecution'; +import { + StreamProofsFilterProtocolUpdateInitializations, + instanceOfStreamProofsFilterProtocolUpdateInitializations, + StreamProofsFilterProtocolUpdateInitializationsFromJSON, + StreamProofsFilterProtocolUpdateInitializationsFromJSONTyped, + StreamProofsFilterProtocolUpdateInitializationsToJSON, +} from './StreamProofsFilterProtocolUpdateInitializations'; + +/** + * @type StreamProofsFilter + * + * @export + */ +export type StreamProofsFilter = { type: 'All' } & StreamProofsFilterAll | { type: 'NewEpochs' } & StreamProofsFilterNewEpochs | { type: 'ProtocolUpdateExecution' } & StreamProofsFilterProtocolUpdateExecution | { type: 'ProtocolUpdateInitializations' } & StreamProofsFilterProtocolUpdateInitializations; + +export function StreamProofsFilterFromJSON(json: any): StreamProofsFilter { + return StreamProofsFilterFromJSONTyped(json, false); +} + +export function StreamProofsFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilter { + if ((json === undefined) || (json === null)) { + return json; + } + switch (json['type']) { + case 'All': + return {...StreamProofsFilterAllFromJSONTyped(json, true), type: 'All'}; + case 'NewEpochs': + return {...StreamProofsFilterNewEpochsFromJSONTyped(json, true), type: 'NewEpochs'}; + case 'ProtocolUpdateExecution': + return {...StreamProofsFilterProtocolUpdateExecutionFromJSONTyped(json, true), type: 'ProtocolUpdateExecution'}; + case 'ProtocolUpdateInitializations': + return {...StreamProofsFilterProtocolUpdateInitializationsFromJSONTyped(json, true), type: 'ProtocolUpdateInitializations'}; + default: + throw new Error(`No variant of StreamProofsFilter exists with 'type=${json['type']}'`); + } +} + +export function StreamProofsFilterToJSON(value?: StreamProofsFilter | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + switch (value['type']) { + case 'All': + return StreamProofsFilterAllToJSON(value); + case 'NewEpochs': + return StreamProofsFilterNewEpochsToJSON(value); + case 'ProtocolUpdateExecution': + return StreamProofsFilterProtocolUpdateExecutionToJSON(value); + case 'ProtocolUpdateInitializations': + return StreamProofsFilterProtocolUpdateInitializationsToJSON(value); + default: + throw new Error(`No variant of StreamProofsFilter exists with 'type=${value['type']}'`); + } + +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts new file mode 100644 index 0000000000..3ae7c6a091 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsFilterAll + */ +export interface StreamProofsFilterAll { + /** + * + * @type {string} + * @memberof StreamProofsFilterAll + */ + type: StreamProofsFilterAllTypeEnum; + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * @type {number} + * @memberof StreamProofsFilterAll + */ + from_state_version?: number; +} + + +/** + * @export + */ +export const StreamProofsFilterAllTypeEnum = { + All: 'All' +} as const; +export type StreamProofsFilterAllTypeEnum = typeof StreamProofsFilterAllTypeEnum[keyof typeof StreamProofsFilterAllTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsFilterAll interface. + */ +export function instanceOfStreamProofsFilterAll(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function StreamProofsFilterAllFromJSON(json: any): StreamProofsFilterAll { + return StreamProofsFilterAllFromJSONTyped(json, false); +} + +export function StreamProofsFilterAllFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterAll { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'from_state_version': !exists(json, 'from_state_version') ? undefined : json['from_state_version'], + }; +} + +export function StreamProofsFilterAllToJSON(value?: StreamProofsFilterAll | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'from_state_version': value.from_state_version, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts new file mode 100644 index 0000000000..dcaccb0e11 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsFilterAllAllOf + */ +export interface StreamProofsFilterAllAllOf { + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * @type {number} + * @memberof StreamProofsFilterAllAllOf + */ + from_state_version?: number; + /** + * + * @type {string} + * @memberof StreamProofsFilterAllAllOf + */ + type?: StreamProofsFilterAllAllOfTypeEnum; +} + + +/** + * @export + */ +export const StreamProofsFilterAllAllOfTypeEnum = { + All: 'All' +} as const; +export type StreamProofsFilterAllAllOfTypeEnum = typeof StreamProofsFilterAllAllOfTypeEnum[keyof typeof StreamProofsFilterAllAllOfTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsFilterAllAllOf interface. + */ +export function instanceOfStreamProofsFilterAllAllOf(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function StreamProofsFilterAllAllOfFromJSON(json: any): StreamProofsFilterAllAllOf { + return StreamProofsFilterAllAllOfFromJSONTyped(json, false); +} + +export function StreamProofsFilterAllAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterAllAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'from_state_version': !exists(json, 'from_state_version') ? undefined : json['from_state_version'], + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function StreamProofsFilterAllAllOfToJSON(value?: StreamProofsFilterAllAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'from_state_version': value.from_state_version, + 'type': value.type, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterBase.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterBase.ts new file mode 100644 index 0000000000..353de9e3e0 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterBase.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StreamProofsFilterType } from './StreamProofsFilterType'; +import { + StreamProofsFilterTypeFromJSON, + StreamProofsFilterTypeFromJSONTyped, + StreamProofsFilterTypeToJSON, +} from './StreamProofsFilterType'; + +/** + * + * @export + * @interface StreamProofsFilterBase + */ +export interface StreamProofsFilterBase { + /** + * + * @type {StreamProofsFilterType} + * @memberof StreamProofsFilterBase + */ + type: StreamProofsFilterType; +} + +/** + * Check if a given object implements the StreamProofsFilterBase interface. + */ +export function instanceOfStreamProofsFilterBase(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function StreamProofsFilterBaseFromJSON(json: any): StreamProofsFilterBase { + return StreamProofsFilterBaseFromJSONTyped(json, false); +} + +export function StreamProofsFilterBaseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterBase { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': StreamProofsFilterTypeFromJSON(json['type']), + }; +} + +export function StreamProofsFilterBaseToJSON(value?: StreamProofsFilterBase | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': StreamProofsFilterTypeToJSON(value.type), + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochs.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochs.ts new file mode 100644 index 0000000000..fe59d9fd8d --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochs.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsFilterNewEpochs + */ +export interface StreamProofsFilterNewEpochs { + /** + * + * @type {string} + * @memberof StreamProofsFilterNewEpochs + */ + type: StreamProofsFilterNewEpochsTypeEnum; + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + * @type {number} + * @memberof StreamProofsFilterNewEpochs + */ + from_epoch?: number; +} + + +/** + * @export + */ +export const StreamProofsFilterNewEpochsTypeEnum = { + NewEpochs: 'NewEpochs' +} as const; +export type StreamProofsFilterNewEpochsTypeEnum = typeof StreamProofsFilterNewEpochsTypeEnum[keyof typeof StreamProofsFilterNewEpochsTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsFilterNewEpochs interface. + */ +export function instanceOfStreamProofsFilterNewEpochs(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function StreamProofsFilterNewEpochsFromJSON(json: any): StreamProofsFilterNewEpochs { + return StreamProofsFilterNewEpochsFromJSONTyped(json, false); +} + +export function StreamProofsFilterNewEpochsFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterNewEpochs { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'from_epoch': !exists(json, 'from_epoch') ? undefined : json['from_epoch'], + }; +} + +export function StreamProofsFilterNewEpochsToJSON(value?: StreamProofsFilterNewEpochs | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'from_epoch': value.from_epoch, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochsAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochsAllOf.ts new file mode 100644 index 0000000000..9d9a4494cb --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochsAllOf.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsFilterNewEpochsAllOf + */ +export interface StreamProofsFilterNewEpochsAllOf { + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + * @type {number} + * @memberof StreamProofsFilterNewEpochsAllOf + */ + from_epoch?: number; + /** + * + * @type {string} + * @memberof StreamProofsFilterNewEpochsAllOf + */ + type?: StreamProofsFilterNewEpochsAllOfTypeEnum; +} + + +/** + * @export + */ +export const StreamProofsFilterNewEpochsAllOfTypeEnum = { + NewEpochs: 'NewEpochs' +} as const; +export type StreamProofsFilterNewEpochsAllOfTypeEnum = typeof StreamProofsFilterNewEpochsAllOfTypeEnum[keyof typeof StreamProofsFilterNewEpochsAllOfTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsFilterNewEpochsAllOf interface. + */ +export function instanceOfStreamProofsFilterNewEpochsAllOf(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function StreamProofsFilterNewEpochsAllOfFromJSON(json: any): StreamProofsFilterNewEpochsAllOf { + return StreamProofsFilterNewEpochsAllOfFromJSONTyped(json, false); +} + +export function StreamProofsFilterNewEpochsAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterNewEpochsAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'from_epoch': !exists(json, 'from_epoch') ? undefined : json['from_epoch'], + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function StreamProofsFilterNewEpochsAllOfToJSON(value?: StreamProofsFilterNewEpochsAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'from_epoch': value.from_epoch, + 'type': value.type, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts new file mode 100644 index 0000000000..baaa051aa5 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts @@ -0,0 +1,92 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsFilterProtocolUpdateExecution + */ +export interface StreamProofsFilterProtocolUpdateExecution { + /** + * + * @type {string} + * @memberof StreamProofsFilterProtocolUpdateExecution + */ + type: StreamProofsFilterProtocolUpdateExecutionTypeEnum; + /** + * The protocol version name to filter to. This can be returned from looking at the protocol updates. + * @type {string} + * @memberof StreamProofsFilterProtocolUpdateExecution + */ + protocol_version?: string; + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * @type {number} + * @memberof StreamProofsFilterProtocolUpdateExecution + */ + from_state_version?: number; +} + + +/** + * @export + */ +export const StreamProofsFilterProtocolUpdateExecutionTypeEnum = { + ProtocolUpdateExecution: 'ProtocolUpdateExecution' +} as const; +export type StreamProofsFilterProtocolUpdateExecutionTypeEnum = typeof StreamProofsFilterProtocolUpdateExecutionTypeEnum[keyof typeof StreamProofsFilterProtocolUpdateExecutionTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsFilterProtocolUpdateExecution interface. + */ +export function instanceOfStreamProofsFilterProtocolUpdateExecution(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function StreamProofsFilterProtocolUpdateExecutionFromJSON(json: any): StreamProofsFilterProtocolUpdateExecution { + return StreamProofsFilterProtocolUpdateExecutionFromJSONTyped(json, false); +} + +export function StreamProofsFilterProtocolUpdateExecutionFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterProtocolUpdateExecution { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'protocol_version': !exists(json, 'protocol_version') ? undefined : json['protocol_version'], + 'from_state_version': !exists(json, 'from_state_version') ? undefined : json['from_state_version'], + }; +} + +export function StreamProofsFilterProtocolUpdateExecutionToJSON(value?: StreamProofsFilterProtocolUpdateExecution | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'protocol_version': value.protocol_version, + 'from_state_version': value.from_state_version, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts new file mode 100644 index 0000000000..9b9c859ab3 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts @@ -0,0 +1,91 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsFilterProtocolUpdateExecutionAllOf + */ +export interface StreamProofsFilterProtocolUpdateExecutionAllOf { + /** + * The protocol version name to filter to. This can be returned from looking at the protocol updates. + * @type {string} + * @memberof StreamProofsFilterProtocolUpdateExecutionAllOf + */ + protocol_version?: string; + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * @type {number} + * @memberof StreamProofsFilterProtocolUpdateExecutionAllOf + */ + from_state_version?: number; + /** + * + * @type {string} + * @memberof StreamProofsFilterProtocolUpdateExecutionAllOf + */ + type?: StreamProofsFilterProtocolUpdateExecutionAllOfTypeEnum; +} + + +/** + * @export + */ +export const StreamProofsFilterProtocolUpdateExecutionAllOfTypeEnum = { + ProtocolUpdateExecution: 'ProtocolUpdateExecution' +} as const; +export type StreamProofsFilterProtocolUpdateExecutionAllOfTypeEnum = typeof StreamProofsFilterProtocolUpdateExecutionAllOfTypeEnum[keyof typeof StreamProofsFilterProtocolUpdateExecutionAllOfTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsFilterProtocolUpdateExecutionAllOf interface. + */ +export function instanceOfStreamProofsFilterProtocolUpdateExecutionAllOf(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function StreamProofsFilterProtocolUpdateExecutionAllOfFromJSON(json: any): StreamProofsFilterProtocolUpdateExecutionAllOf { + return StreamProofsFilterProtocolUpdateExecutionAllOfFromJSONTyped(json, false); +} + +export function StreamProofsFilterProtocolUpdateExecutionAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterProtocolUpdateExecutionAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'protocol_version': !exists(json, 'protocol_version') ? undefined : json['protocol_version'], + 'from_state_version': !exists(json, 'from_state_version') ? undefined : json['from_state_version'], + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function StreamProofsFilterProtocolUpdateExecutionAllOfToJSON(value?: StreamProofsFilterProtocolUpdateExecutionAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'protocol_version': value.protocol_version, + 'from_state_version': value.from_state_version, + 'type': value.type, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializations.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializations.ts new file mode 100644 index 0000000000..e2ab4c6cfd --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializations.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsFilterProtocolUpdateInitializations + */ +export interface StreamProofsFilterProtocolUpdateInitializations { + /** + * + * @type {string} + * @memberof StreamProofsFilterProtocolUpdateInitializations + */ + type: StreamProofsFilterProtocolUpdateInitializationsTypeEnum; + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * @type {number} + * @memberof StreamProofsFilterProtocolUpdateInitializations + */ + from_state_version?: number; +} + + +/** + * @export + */ +export const StreamProofsFilterProtocolUpdateInitializationsTypeEnum = { + ProtocolUpdateInitializations: 'ProtocolUpdateInitializations' +} as const; +export type StreamProofsFilterProtocolUpdateInitializationsTypeEnum = typeof StreamProofsFilterProtocolUpdateInitializationsTypeEnum[keyof typeof StreamProofsFilterProtocolUpdateInitializationsTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsFilterProtocolUpdateInitializations interface. + */ +export function instanceOfStreamProofsFilterProtocolUpdateInitializations(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function StreamProofsFilterProtocolUpdateInitializationsFromJSON(json: any): StreamProofsFilterProtocolUpdateInitializations { + return StreamProofsFilterProtocolUpdateInitializationsFromJSONTyped(json, false); +} + +export function StreamProofsFilterProtocolUpdateInitializationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterProtocolUpdateInitializations { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': json['type'], + 'from_state_version': !exists(json, 'from_state_version') ? undefined : json['from_state_version'], + }; +} + +export function StreamProofsFilterProtocolUpdateInitializationsToJSON(value?: StreamProofsFilterProtocolUpdateInitializations | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'from_state_version': value.from_state_version, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializationsAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializationsAllOf.ts new file mode 100644 index 0000000000..9c47ff53ac --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializationsAllOf.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface StreamProofsFilterProtocolUpdateInitializationsAllOf + */ +export interface StreamProofsFilterProtocolUpdateInitializationsAllOf { + /** + * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * @type {number} + * @memberof StreamProofsFilterProtocolUpdateInitializationsAllOf + */ + from_state_version?: number; + /** + * + * @type {string} + * @memberof StreamProofsFilterProtocolUpdateInitializationsAllOf + */ + type?: StreamProofsFilterProtocolUpdateInitializationsAllOfTypeEnum; +} + + +/** + * @export + */ +export const StreamProofsFilterProtocolUpdateInitializationsAllOfTypeEnum = { + ProtocolUpdateInitializations: 'ProtocolUpdateInitializations' +} as const; +export type StreamProofsFilterProtocolUpdateInitializationsAllOfTypeEnum = typeof StreamProofsFilterProtocolUpdateInitializationsAllOfTypeEnum[keyof typeof StreamProofsFilterProtocolUpdateInitializationsAllOfTypeEnum]; + + +/** + * Check if a given object implements the StreamProofsFilterProtocolUpdateInitializationsAllOf interface. + */ +export function instanceOfStreamProofsFilterProtocolUpdateInitializationsAllOf(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function StreamProofsFilterProtocolUpdateInitializationsAllOfFromJSON(json: any): StreamProofsFilterProtocolUpdateInitializationsAllOf { + return StreamProofsFilterProtocolUpdateInitializationsAllOfFromJSONTyped(json, false); +} + +export function StreamProofsFilterProtocolUpdateInitializationsAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterProtocolUpdateInitializationsAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'from_state_version': !exists(json, 'from_state_version') ? undefined : json['from_state_version'], + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function StreamProofsFilterProtocolUpdateInitializationsAllOfToJSON(value?: StreamProofsFilterProtocolUpdateInitializationsAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'from_state_version': value.from_state_version, + 'type': value.type, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterType.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterType.ts new file mode 100644 index 0000000000..d677feb3b2 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterType.ts @@ -0,0 +1,40 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const StreamProofsFilterType = { + All: 'All', + NewEpochs: 'NewEpochs', + ProtocolUpdateTriggers: 'ProtocolUpdateTriggers', + ProtocolUpdateExecution: 'ProtocolUpdateExecution' +} as const; +export type StreamProofsFilterType = typeof StreamProofsFilterType[keyof typeof StreamProofsFilterType]; + + +export function StreamProofsFilterTypeFromJSON(json: any): StreamProofsFilterType { + return StreamProofsFilterTypeFromJSONTyped(json, false); +} + +export function StreamProofsFilterTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterType { + return json as StreamProofsFilterType; +} + +export function StreamProofsFilterTypeToJSON(value?: StreamProofsFilterType | null): any { + return value as any; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsRequest.ts b/sdk/typescript/lib/generated/models/StreamProofsRequest.ts new file mode 100644 index 0000000000..1b6e3ffa11 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsRequest.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StreamProofsFilter } from './StreamProofsFilter'; +import { + StreamProofsFilterFromJSON, + StreamProofsFilterFromJSONTyped, + StreamProofsFilterToJSON, +} from './StreamProofsFilter'; + +/** + * A request to retrieve a sublist of proofs. + * @export + * @interface StreamProofsRequest + */ +export interface StreamProofsRequest { + /** + * The logical name of the network + * @type {string} + * @memberof StreamProofsRequest + */ + network: string; + /** + * + * @type {StreamProofsFilter} + * @memberof StreamProofsRequest + */ + filter: StreamProofsFilter; + /** + * If specified, the maximum number of proofs that will be returned. + * @type {number} + * @memberof StreamProofsRequest + */ + max_page_size?: number; + /** + * A continuation token is returned if and only if there are further non-empty pages of items currently available. + * The token can be provided in a following request to fetch the next page of results. + * The filter and sort should not be changed when re-using the continuation token. + * @type {string} + * @memberof StreamProofsRequest + */ + continuation_token?: string; +} + +/** + * Check if a given object implements the StreamProofsRequest interface. + */ +export function instanceOfStreamProofsRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "network" in value; + isInstance = isInstance && "filter" in value; + + return isInstance; +} + +export function StreamProofsRequestFromJSON(json: any): StreamProofsRequest { + return StreamProofsRequestFromJSONTyped(json, false); +} + +export function StreamProofsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'network': json['network'], + 'filter': StreamProofsFilterFromJSON(json['filter']), + 'max_page_size': !exists(json, 'max_page_size') ? undefined : json['max_page_size'], + 'continuation_token': !exists(json, 'continuation_token') ? undefined : json['continuation_token'], + }; +} + +export function StreamProofsRequestToJSON(value?: StreamProofsRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'network': value.network, + 'filter': StreamProofsFilterToJSON(value.filter), + 'max_page_size': value.max_page_size, + 'continuation_token': value.continuation_token, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamProofsResponse.ts b/sdk/typescript/lib/generated/models/StreamProofsResponse.ts new file mode 100644 index 0000000000..96e713bc69 --- /dev/null +++ b/sdk/typescript/lib/generated/models/StreamProofsResponse.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Radix Core API - Babylon + * This API is exposed by the Babylon Radix node to give clients access to the Radix Engine, Mempool and State in the node. The default configuration is intended for use by node-runners on a private network, and is not intended to be exposed publicly. Very heavy load may impact the node\'s function. The node exposes a configuration flag which allows disabling certain endpoints which may be problematic, but monitoring is advised. This configuration parameter is `api.core.flags.enable_unbounded_endpoints` / `RADIXDLT_CORE_API_FLAGS_ENABLE_UNBOUNDED_ENDPOINTS`. This API exposes queries against the node\'s current state (see `/lts/state/` or `/state/`), and streams of transaction history (under `/lts/stream/` or `/stream`). If you require queries against snapshots of historical ledger state, you may also wish to consider using the [Gateway API](https://docs-babylon.radixdlt.com/). ## Integration and forward compatibility guarantees Integrators (such as exchanges) are recommended to use the `/lts/` endpoints - they have been designed to be clear and simple for integrators wishing to create and monitor transactions involving fungible transfers to/from accounts. All endpoints under `/lts/` have high guarantees of forward compatibility in future node versions. We may add new fields, but existing fields will not be changed. Assuming the integrating code uses a permissive JSON parser which ignores unknown fields, any additions will not affect existing code. Other endpoints may be changed with new node versions carrying protocol-updates, although any breaking changes will be flagged clearly in the corresponding release notes. All responses may have additional fields added, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. + * + * The version of the OpenAPI document: v1.0.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { LedgerProof } from './LedgerProof'; +import { + LedgerProofFromJSON, + LedgerProofFromJSONTyped, + LedgerProofToJSON, +} from './LedgerProof'; + +/** + * + * @export + * @interface StreamProofsResponse + */ +export interface StreamProofsResponse { + /** + * A page of ledger proofs stored by this node. + * @type {Array} + * @memberof StreamProofsResponse + */ + page: Array; + /** + * A continuation token is returned if and only if there are further non-empty pages of items currently available. + * The token can be provided in a following request to fetch the next page of results. + * The filter and sort should not be changed when re-using the continuation token. + * @type {string} + * @memberof StreamProofsResponse + */ + continuation_token?: string; +} + +/** + * Check if a given object implements the StreamProofsResponse interface. + */ +export function instanceOfStreamProofsResponse(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "page" in value; + + return isInstance; +} + +export function StreamProofsResponseFromJSON(json: any): StreamProofsResponse { + return StreamProofsResponseFromJSONTyped(json, false); +} + +export function StreamProofsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'page': ((json['page'] as Array).map(LedgerProofFromJSON)), + 'continuation_token': !exists(json, 'continuation_token') ? undefined : json['continuation_token'], + }; +} + +export function StreamProofsResponseToJSON(value?: StreamProofsResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'page': ((value.page as Array).map(LedgerProofToJSON)), + 'continuation_token': value.continuation_token, + }; +} + diff --git a/sdk/typescript/lib/generated/models/StreamTransactionsResponse.ts b/sdk/typescript/lib/generated/models/StreamTransactionsResponse.ts index 91664c4da3..d8c46804ca 100644 --- a/sdk/typescript/lib/generated/models/StreamTransactionsResponse.ts +++ b/sdk/typescript/lib/generated/models/StreamTransactionsResponse.ts @@ -51,7 +51,7 @@ export interface StreamTransactionsResponse { */ from_state_version: number; /** - * An integer between `0` and `10000`, giving the total count of transactions in the returned response + * An integer between `0` and `10000`, giving the total count of proofs in the returned response * @type {number} * @memberof StreamTransactionsResponse */ diff --git a/sdk/typescript/lib/generated/models/index.ts b/sdk/typescript/lib/generated/models/index.ts index e97fd949de..0d52ff53b9 100644 --- a/sdk/typescript/lib/generated/models/index.ts +++ b/sdk/typescript/lib/generated/models/index.ts @@ -135,6 +135,7 @@ export * from './EntityModule'; export * from './EntityReference'; export * from './EntityType'; export * from './EpochChangeCondition'; +export * from './EpochEndLedgerProof'; export * from './EpochRound'; export * from './ErrorResponse'; export * from './ErrorResponseBase'; @@ -449,7 +450,6 @@ export * from './ReferenceType'; export * from './RemoteGenericSubstitution'; export * from './RemoteGenericSubstitutionAllOf'; export * from './RequestedStateVersionOutOfBoundsErrorDetails'; -export * from './RequestedStateVersionOutOfBoundsErrorDetailsAllOf'; export * from './RequireProofRule'; export * from './RequireProofRuleAllOf'; export * from './Requirement'; @@ -535,6 +535,28 @@ export * from './StateValidatorResponse'; export * from './StaticBlueprintPayloadDef'; export * from './StaticBlueprintPayloadDefAllOf'; export * from './StaticRoleDefinitionAuthTemplate'; +export * from './StreamProofsErrorDetails'; +export * from './StreamProofsErrorDetailsBase'; +export * from './StreamProofsErrorDetailsRequestedEpochOutOfBounds'; +export * from './StreamProofsErrorDetailsRequestedEpochOutOfBoundsAllOf'; +export * from './StreamProofsErrorDetailsRequestedStateVersionOutOfBounds'; +export * from './StreamProofsErrorDetailsRequestedStateVersionOutOfBoundsAllOf'; +export * from './StreamProofsErrorDetailsType'; +export * from './StreamProofsErrorResponse'; +export * from './StreamProofsErrorResponseAllOf'; +export * from './StreamProofsFilter'; +export * from './StreamProofsFilterAll'; +export * from './StreamProofsFilterAllAllOf'; +export * from './StreamProofsFilterBase'; +export * from './StreamProofsFilterNewEpochs'; +export * from './StreamProofsFilterNewEpochsAllOf'; +export * from './StreamProofsFilterProtocolUpdateExecution'; +export * from './StreamProofsFilterProtocolUpdateExecutionAllOf'; +export * from './StreamProofsFilterProtocolUpdateInitializations'; +export * from './StreamProofsFilterProtocolUpdateInitializationsAllOf'; +export * from './StreamProofsFilterType'; +export * from './StreamProofsRequest'; +export * from './StreamProofsResponse'; export * from './StreamTransactionsErrorDetails'; export * from './StreamTransactionsErrorDetailsBase'; export * from './StreamTransactionsErrorDetailsType'; From 75428c71727fc42e4f3a1b26f79e3114a09978ce Mon Sep 17 00:00:00 2001 From: David Edey Date: Wed, 24 Jan 2024 13:36:04 +0000 Subject: [PATCH 2/4] markups: Fix state version max bound --- .../core-api-server/core-api-schema.yaml | 23 ++++++------------- .../generated/models/stream_proofs_filter.rs | 5 +--- .../models/stream_proofs_filter_all.rs | 1 - .../models/stream_proofs_filter_all_all_of.rs | 1 - .../models/stream_proofs_filter_new_epochs.rs | 2 +- .../stream_proofs_filter_new_epochs_all_of.rs | 2 +- ...proofs_filter_protocol_update_execution.rs | 1 - ...filter_protocol_update_execution_all_of.rs | 1 - ..._filter_protocol_update_initializations.rs | 1 - .../models/StreamProofsFilterAll.java | 8 +++---- .../models/StreamProofsFilterAllAllOf.java | 8 +++---- .../models/StreamProofsFilterNewEpochs.java | 4 ++-- .../StreamProofsFilterNewEpochsAllOf.java | 4 ++-- ...amProofsFilterProtocolUpdateExecution.java | 8 +++---- ...ofsFilterProtocolUpdateExecutionAllOf.java | 8 +++---- ...fsFilterProtocolUpdateInitializations.java | 8 +++---- .../generated/models/StreamProofsFilterAll.ts | 2 +- .../models/StreamProofsFilterAllAllOf.ts | 2 +- .../models/StreamProofsFilterNewEpochs.ts | 2 +- .../StreamProofsFilterNewEpochsAllOf.ts | 2 +- ...reamProofsFilterProtocolUpdateExecution.ts | 2 +- ...roofsFilterProtocolUpdateExecutionAllOf.ts | 2 +- ...oofsFilterProtocolUpdateInitializations.ts | 2 +- ...ilterProtocolUpdateInitializationsAllOf.ts | 2 +- 24 files changed, 42 insertions(+), 59 deletions(-) diff --git a/core-rust/core-api-server/core-api-schema.yaml b/core-rust/core-api-server/core-api-schema.yaml index 33de24b2d8..a96fefb585 100644 --- a/core-rust/core-api-server/core-api-schema.yaml +++ b/core-rust/core-api-server/core-api-schema.yaml @@ -7192,12 +7192,9 @@ components: - type: object properties: from_state_version: - type: integer - format: int64 - minimum: 0 - maximum: 10000000000 + $ref: "#/components/schemas/StateVersion" description: - An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. + The first proof to be returned should be at this state version or above. If empty, it starts from 0. StreamProofsFilterNewEpochs: allOf: @@ -7210,7 +7207,7 @@ components: minimum: 0 maximum: 10000000000 description: - An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. + The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. StreamProofsFilterProtocolUpdateInitializations: @@ -7219,12 +7216,9 @@ components: - type: object properties: from_state_version: - type: integer - format: int64 - minimum: 0 - maximum: 10000000000 + $ref: "#/components/schemas/StateVersion" description: - An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. + The first proof to be returned should be at this state version or above. If empty, it starts from 0. StreamProofsFilterProtocolUpdateExecution: allOf: @@ -7236,12 +7230,9 @@ components: description: | The protocol version name to filter to. This can be returned from looking at the protocol updates. from_state_version: - type: integer - format: int64 - minimum: 0 - maximum: 10000000000 + $ref: "#/components/schemas/StateVersion" description: - An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. + The first proof to be returned should be at this state version or above. If empty, it starts from 0. StreamProofsResponse: type: object diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs index 3e61b42498..49635ae3a9 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs @@ -15,13 +15,12 @@ pub enum StreamProofsFilter { #[serde(rename="All")] StreamProofsFilterAll { - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] from_state_version: Option, }, #[serde(rename="NewEpochs")] StreamProofsFilterNewEpochs { - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + /// The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. #[serde(rename = "from_epoch", skip_serializing_if = "Option::is_none")] from_epoch: Option, }, @@ -30,13 +29,11 @@ pub enum StreamProofsFilter { /// The protocol version name to filter to. This can be returned from looking at the protocol updates. #[serde(rename = "protocol_version", skip_serializing_if = "Option::is_none")] protocol_version: Option, - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] from_state_version: Option, }, #[serde(rename="ProtocolUpdateInitializations")] StreamProofsFilterProtocolUpdateInitializations { - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] from_state_version: Option, }, diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs index 245f56fe9e..aa3740a6ba 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs @@ -15,7 +15,6 @@ pub struct StreamProofsFilterAll { #[serde(rename = "type")] pub _type: crate::core_api::generated::models::StreamProofsFilterType, - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] pub from_state_version: Option, } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs index 875d0c1436..9e532c88e2 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs @@ -13,7 +13,6 @@ #[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] pub struct StreamProofsFilterAllAllOf { - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] pub from_state_version: Option, } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs.rs index 7ee749a690..e7537fcfd6 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs.rs @@ -15,7 +15,7 @@ pub struct StreamProofsFilterNewEpochs { #[serde(rename = "type")] pub _type: crate::core_api::generated::models::StreamProofsFilterType, - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + /// The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. #[serde(rename = "from_epoch", skip_serializing_if = "Option::is_none")] pub from_epoch: Option, } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs_all_of.rs index 401414c3d1..d9f3973b65 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs_all_of.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_new_epochs_all_of.rs @@ -13,7 +13,7 @@ #[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] pub struct StreamProofsFilterNewEpochsAllOf { - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + /// The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. #[serde(rename = "from_epoch", skip_serializing_if = "Option::is_none")] pub from_epoch: Option, } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs index 9ede9667fa..7de37e99ce 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs @@ -18,7 +18,6 @@ pub struct StreamProofsFilterProtocolUpdateExecution { /// The protocol version name to filter to. This can be returned from looking at the protocol updates. #[serde(rename = "protocol_version", skip_serializing_if = "Option::is_none")] pub protocol_version: Option, - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] pub from_state_version: Option, } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs index 57b3dca31d..e0ef48f028 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs @@ -16,7 +16,6 @@ pub struct StreamProofsFilterProtocolUpdateExecutionAllOf { /// The protocol version name to filter to. This can be returned from looking at the protocol updates. #[serde(rename = "protocol_version", skip_serializing_if = "Option::is_none")] pub protocol_version: Option, - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] pub from_state_version: Option, } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_initializations.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_initializations.rs index cdb11da84c..6ad4c38ad8 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_initializations.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_initializations.rs @@ -15,7 +15,6 @@ pub struct StreamProofsFilterProtocolUpdateInitializations { #[serde(rename = "type")] pub _type: crate::core_api::generated::models::StreamProofsFilterType, - /// An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] pub from_state_version: Option, } diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java index e7598ef834..793305493c 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java @@ -70,13 +70,13 @@ public StreamProofsFilterAll fromStateVersion(Long fromStateVersion) { } /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. - * minimum: 0 - * maximum: 10000000000 + * Get fromStateVersion + * minimum: 1 + * maximum: 100000000000000 * @return fromStateVersion **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java index edd9884bde..051f22515a 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java @@ -47,13 +47,13 @@ public StreamProofsFilterAllAllOf fromStateVersion(Long fromStateVersion) { } /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. - * minimum: 0 - * maximum: 10000000000 + * Get fromStateVersion + * minimum: 1 + * maximum: 100000000000000 * @return fromStateVersion **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java index 7485a880e6..b94a77e15e 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java @@ -70,13 +70,13 @@ public StreamProofsFilterNewEpochs fromEpoch(Long fromEpoch) { } /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + * The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. * minimum: 0 * maximum: 10000000000 * @return fromEpoch **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch.") + @ApiModelProperty(value = "The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch.") @JsonProperty(JSON_PROPERTY_FROM_EPOCH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochsAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochsAllOf.java index ffd0cefd11..570a523355 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochsAllOf.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochsAllOf.java @@ -47,13 +47,13 @@ public StreamProofsFilterNewEpochsAllOf fromEpoch(Long fromEpoch) { } /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + * The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. * minimum: 0 * maximum: 10000000000 * @return fromEpoch **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch.") + @ApiModelProperty(value = "The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch.") @JsonProperty(JSON_PROPERTY_FROM_EPOCH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java index 35cf31a97b..c8071c37d7 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java @@ -100,13 +100,13 @@ public StreamProofsFilterProtocolUpdateExecution fromStateVersion(Long fromState } /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. - * minimum: 0 - * maximum: 10000000000 + * Get fromStateVersion + * minimum: 1 + * maximum: 100000000000000 * @return fromStateVersion **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java index 7a80a38c98..a3708478d2 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java @@ -77,13 +77,13 @@ public StreamProofsFilterProtocolUpdateExecutionAllOf fromStateVersion(Long from } /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. - * minimum: 0 - * maximum: 10000000000 + * Get fromStateVersion + * minimum: 1 + * maximum: 100000000000000 * @return fromStateVersion **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java index 1f89fa0f65..d5afbabd48 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java @@ -70,13 +70,13 @@ public StreamProofsFilterProtocolUpdateInitializations fromStateVersion(Long fro } /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. - * minimum: 0 - * maximum: 10000000000 + * Get fromStateVersion + * minimum: 1 + * maximum: 100000000000000 * @return fromStateVersion **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0.") + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FROM_STATE_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts index 3ae7c6a091..ea0083977f 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts @@ -26,7 +26,7 @@ export interface StreamProofsFilterAll { */ type: StreamProofsFilterAllTypeEnum; /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * * @type {number} * @memberof StreamProofsFilterAll */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts index dcaccb0e11..b2df2828f6 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts @@ -20,7 +20,7 @@ import { exists, mapValues } from '../runtime'; */ export interface StreamProofsFilterAllAllOf { /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * * @type {number} * @memberof StreamProofsFilterAllAllOf */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochs.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochs.ts index fe59d9fd8d..9b31b065de 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochs.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochs.ts @@ -26,7 +26,7 @@ export interface StreamProofsFilterNewEpochs { */ type: StreamProofsFilterNewEpochsTypeEnum; /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + * The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. * @type {number} * @memberof StreamProofsFilterNewEpochs */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochsAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochsAllOf.ts index 9d9a4494cb..51b2a21d51 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochsAllOf.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterNewEpochsAllOf.ts @@ -20,7 +20,7 @@ import { exists, mapValues } from '../runtime'; */ export interface StreamProofsFilterNewEpochsAllOf { /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. + * The first proof to be returned should be the proof starting this epoch. If empty, it starts from the first epoch proof after genesis. The network status endpoint can be used to find the current epoch. * @type {number} * @memberof StreamProofsFilterNewEpochsAllOf */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts index baaa051aa5..7d6097233b 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts @@ -32,7 +32,7 @@ export interface StreamProofsFilterProtocolUpdateExecution { */ protocol_version?: string; /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * * @type {number} * @memberof StreamProofsFilterProtocolUpdateExecution */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts index 9b9c859ab3..bd29849fa1 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts @@ -26,7 +26,7 @@ export interface StreamProofsFilterProtocolUpdateExecutionAllOf { */ protocol_version?: string; /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * * @type {number} * @memberof StreamProofsFilterProtocolUpdateExecutionAllOf */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializations.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializations.ts index e2ab4c6cfd..d820f58352 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializations.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializations.ts @@ -26,7 +26,7 @@ export interface StreamProofsFilterProtocolUpdateInitializations { */ type: StreamProofsFilterProtocolUpdateInitializationsTypeEnum; /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * * @type {number} * @memberof StreamProofsFilterProtocolUpdateInitializations */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializationsAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializationsAllOf.ts index 9c47ff53ac..f2d06e8761 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializationsAllOf.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateInitializationsAllOf.ts @@ -20,7 +20,7 @@ import { exists, mapValues } from '../runtime'; */ export interface StreamProofsFilterProtocolUpdateInitializationsAllOf { /** - * An integer between `0` and `10^10`, marking that the first proof to be returned should be at this state version or above. If empty, it starts from 0. + * * @type {number} * @memberof StreamProofsFilterProtocolUpdateInitializationsAllOf */ From 3e2f06fb6d37eee5cb461fcd81f2029d802afa3b Mon Sep 17 00:00:00 2001 From: David Edey Date: Thu, 25 Jan 2024 04:39:26 +0000 Subject: [PATCH 3/4] markups: Fix markups --- .../core-api-server/core-api-schema.yaml | 14 ++++---- .../src/core_api/conversions/pagination.rs | 33 ++++++++++++------- .../src/core_api/generated/models/mod.rs | 8 ++--- .../generated/models/stream_proofs_filter.rs | 7 ++-- ...ter_all.rs => stream_proofs_filter_any.rs} | 8 ++--- ....rs => stream_proofs_filter_any_all_of.rs} | 8 ++--- ...proofs_filter_protocol_update_execution.rs | 2 +- ...filter_protocol_update_execution_all_of.rs | 2 +- .../models/stream_proofs_filter_type.rs | 14 ++++---- .../generated/models/stream_proofs_request.rs | 8 ++--- .../models/stream_transactions_response.rs | 2 +- .../src/core_api/handlers/stream_proofs.rs | 10 +++--- .../generated/models/StreamProofsFilter.java | 13 ++++---- ...terAll.java => StreamProofsFilterAny.java} | 30 ++++++++--------- ...f.java => StreamProofsFilterAnyAllOf.java} | 18 +++++----- .../models/StreamProofsFilterNewEpochs.java | 6 ++-- ...amProofsFilterProtocolUpdateExecution.java | 10 +++--- ...ofsFilterProtocolUpdateExecutionAllOf.java | 4 +-- ...fsFilterProtocolUpdateInitializations.java | 8 ++--- .../models/StreamProofsFilterType.java | 4 +-- .../generated/models/StreamProofsRequest.java | 8 ++--- .../models/StreamTransactionsResponse.java | 4 +-- .../lib/generated/.openapi-generator/FILES | 4 +-- .../generated/models/StreamProofsFilter.ts | 22 ++++++------- ...sFilterAll.ts => StreamProofsFilterAny.ts} | 28 ++++++++-------- ...AllOf.ts => StreamProofsFilterAnyAllOf.ts} | 28 ++++++++-------- .../models/StreamProofsFilterBase.ts | 2 +- ...reamProofsFilterProtocolUpdateExecution.ts | 2 +- ...roofsFilterProtocolUpdateExecutionAllOf.ts | 2 +- .../models/StreamProofsFilterType.ts | 4 +-- .../generated/models/StreamProofsRequest.ts | 5 ++- .../models/StreamTransactionsResponse.ts | 2 +- sdk/typescript/lib/generated/models/index.ts | 4 +-- 33 files changed, 167 insertions(+), 157 deletions(-) rename core-rust/core-api-server/src/core_api/generated/models/{stream_proofs_filter_all.rs => stream_proofs_filter_any.rs} (94%) rename core-rust/core-api-server/src/core_api/generated/models/{stream_proofs_filter_all_all_of.rs => stream_proofs_filter_any_all_of.rs} (93%) rename core/src/test-core/java/com/radixdlt/api/core/generated/models/{StreamProofsFilterAll.java => StreamProofsFilterAny.java} (89%) rename core/src/test-core/java/com/radixdlt/api/core/generated/models/{StreamProofsFilterAllAllOf.java => StreamProofsFilterAnyAllOf.java} (90%) rename sdk/typescript/lib/generated/models/{StreamProofsFilterAll.ts => StreamProofsFilterAny.ts} (77%) rename sdk/typescript/lib/generated/models/{StreamProofsFilterAllAllOf.ts => StreamProofsFilterAnyAllOf.ts} (76%) diff --git a/core-rust/core-api-server/core-api-schema.yaml b/core-rust/core-api-server/core-api-schema.yaml index a96fefb585..8f3dcc0625 100644 --- a/core-rust/core-api-server/core-api-schema.yaml +++ b/core-rust/core-api-server/core-api-schema.yaml @@ -7153,7 +7153,6 @@ components: type: object required: - network - - filter properties: network: $ref: "#/components/schemas/NetworkIdentifier" @@ -7167,12 +7166,13 @@ components: StreamProofsFilterType: type: string enum: - - All + - Any - NewEpochs - - ProtocolUpdateTriggers + - ProtocolUpdateInitializations - ProtocolUpdateExecution StreamProofsFilter: type: object + description: If not provided, defaults to "Any". required: - type properties: @@ -7182,11 +7182,11 @@ components: propertyName: type mapping: # NOTE: These need to match StreamProofsFilterType - All: '#/components/schemas/StreamProofsFilterAll' + Any: '#/components/schemas/StreamProofsFilterAny' NewEpochs: '#/components/schemas/StreamProofsFilterNewEpochs' ProtocolUpdateInitializations: '#/components/schemas/StreamProofsFilterProtocolUpdateInitializations' ProtocolUpdateExecution: '#/components/schemas/StreamProofsFilterProtocolUpdateExecution' - StreamProofsFilterAll: + StreamProofsFilterAny: allOf: - $ref: "#/components/schemas/StreamProofsFilter" - type: object @@ -7228,7 +7228,7 @@ components: protocol_version: type: string description: | - The protocol version name to filter to. This can be returned from looking at the protocol updates. + The protocol version name to filter to. from_state_version: $ref: "#/components/schemas/StateVersion" description: @@ -7366,7 +7366,7 @@ components: format: int32 minimum: 0 maximum: 10000 - description: An integer between `0` and `10000`, giving the total count of proofs in the returned response + description: An integer between `0` and `10000`, giving the total count of transactions in the returned response max_ledger_state_version: $ref: "#/components/schemas/StateVersion" description: The maximum state version currently committed on this node's ledger. diff --git a/core-rust/core-api-server/src/core_api/conversions/pagination.rs b/core-rust/core-api-server/src/core_api/conversions/pagination.rs index 8f7e87ebea..6914db6fbe 100644 --- a/core-rust/core-api-server/src/core_api/conversions/pagination.rs +++ b/core-rust/core-api-server/src/core_api/conversions/pagination.rs @@ -8,29 +8,34 @@ pub struct SizeRange { pub max: usize, } +// Extracts a valid page size as per the API consistency guidelines. pub fn extract_valid_size( provided: Option, size_range: SizeRange, ) -> Result { let SizeRange { min, default, max } = size_range; - match provided { + let valid_size = match provided { Some(provided) => { if provided < 0 { - None + return Err(ExtractionError::InvalidSize { min, max }); + } + let provided = provided as usize; + if provided < min || provided > max { + return Err(ExtractionError::InvalidSize { min, max }); } else { - let provided = provided as usize; - if provided < min || provided > max { - None - } else { - Some(provided) - } + provided } } - None => Some(default), - } - .ok_or(ExtractionError::InvalidSize { min, max }) + None => default, + }; + Ok(valid_size) } +/// Extracts a valid optional continuation token as per the API consistency guidelines. +/// +/// Whilst normally such methods would not take/return an option, this is an active choice +/// to encourage/simplify following of the API guidelines, where a `continuation_token` is always +/// optional. pub fn extract_continuation_token( continuation_token: Option, ) -> Result, ExtractionError> { @@ -42,6 +47,7 @@ pub fn extract_continuation_token( Ok(Some(id)) } +/// Maps a valid optional continuation token as per the API consistency guidelines. pub fn to_api_continuation_token( id_of_start_of_next_page: Option<&T>, ) -> Option { @@ -55,7 +61,10 @@ pub fn optional_max(value: T, option: Option) -> T { } } -/// Returns a page and a continuation token, representing the id of the item at the start of the next page +/// Returns a page and a continuation token from an iterator. +/// +/// This follows the API consistency guidelines, although NOTE that it encodes the continuation token +/// as the id of the item at the *start of the next page*. pub fn to_api_page( iter: &mut dyn Iterator, page_size: usize, diff --git a/core-rust/core-api-server/src/core_api/generated/models/mod.rs b/core-rust/core-api-server/src/core_api/generated/models/mod.rs index 58d7de9f7a..dbae2cdcac 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/mod.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/mod.rs @@ -1006,10 +1006,10 @@ pub mod stream_proofs_error_response_all_of; pub use self::stream_proofs_error_response_all_of::StreamProofsErrorResponseAllOf; pub mod stream_proofs_filter; pub use self::stream_proofs_filter::StreamProofsFilter; -pub mod stream_proofs_filter_all; -pub use self::stream_proofs_filter_all::StreamProofsFilterAll; -pub mod stream_proofs_filter_all_all_of; -pub use self::stream_proofs_filter_all_all_of::StreamProofsFilterAllAllOf; +pub mod stream_proofs_filter_any; +pub use self::stream_proofs_filter_any::StreamProofsFilterAny; +pub mod stream_proofs_filter_any_all_of; +pub use self::stream_proofs_filter_any_all_of::StreamProofsFilterAnyAllOf; pub mod stream_proofs_filter_new_epochs; pub use self::stream_proofs_filter_new_epochs::StreamProofsFilterNewEpochs; pub mod stream_proofs_filter_new_epochs_all_of; diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs index 49635ae3a9..07b853a813 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter.rs @@ -8,13 +8,14 @@ * Generated by: https://openapi-generator.tech */ +/// StreamProofsFilter : If not provided, defaults to \"Any\". #[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] #[serde(tag = "type")] pub enum StreamProofsFilter { - #[serde(rename="All")] - StreamProofsFilterAll { + #[serde(rename="Any")] + StreamProofsFilterAny { #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] from_state_version: Option, }, @@ -26,7 +27,7 @@ pub enum StreamProofsFilter { }, #[serde(rename="ProtocolUpdateExecution")] StreamProofsFilterProtocolUpdateExecution { - /// The protocol version name to filter to. This can be returned from looking at the protocol updates. + /// The protocol version name to filter to. #[serde(rename = "protocol_version", skip_serializing_if = "Option::is_none")] protocol_version: Option, #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_any.rs similarity index 94% rename from core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs rename to core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_any.rs index aa3740a6ba..e70434db7c 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_any.rs @@ -12,16 +12,16 @@ #[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] -pub struct StreamProofsFilterAll { +pub struct StreamProofsFilterAny { #[serde(rename = "type")] pub _type: crate::core_api::generated::models::StreamProofsFilterType, #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] pub from_state_version: Option, } -impl StreamProofsFilterAll { - pub fn new(_type: crate::core_api::generated::models::StreamProofsFilterType) -> StreamProofsFilterAll { - StreamProofsFilterAll { +impl StreamProofsFilterAny { + pub fn new(_type: crate::core_api::generated::models::StreamProofsFilterType) -> StreamProofsFilterAny { + StreamProofsFilterAny { _type, from_state_version: None, } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_any_all_of.rs similarity index 93% rename from core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs rename to core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_any_all_of.rs index 9e532c88e2..8eec55a89c 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_all_all_of.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_any_all_of.rs @@ -12,14 +12,14 @@ #[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] -pub struct StreamProofsFilterAllAllOf { +pub struct StreamProofsFilterAnyAllOf { #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] pub from_state_version: Option, } -impl StreamProofsFilterAllAllOf { - pub fn new() -> StreamProofsFilterAllAllOf { - StreamProofsFilterAllAllOf { +impl StreamProofsFilterAnyAllOf { + pub fn new() -> StreamProofsFilterAnyAllOf { + StreamProofsFilterAnyAllOf { from_state_version: None, } } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs index 7de37e99ce..7b5d65703d 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution.rs @@ -15,7 +15,7 @@ pub struct StreamProofsFilterProtocolUpdateExecution { #[serde(rename = "type")] pub _type: crate::core_api::generated::models::StreamProofsFilterType, - /// The protocol version name to filter to. This can be returned from looking at the protocol updates. + /// The protocol version name to filter to. #[serde(rename = "protocol_version", skip_serializing_if = "Option::is_none")] pub protocol_version: Option, #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs index e0ef48f028..76e9693518 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_protocol_update_execution_all_of.rs @@ -13,7 +13,7 @@ #[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)] pub struct StreamProofsFilterProtocolUpdateExecutionAllOf { - /// The protocol version name to filter to. This can be returned from looking at the protocol updates. + /// The protocol version name to filter to. #[serde(rename = "protocol_version", skip_serializing_if = "Option::is_none")] pub protocol_version: Option, #[serde(rename = "from_state_version", skip_serializing_if = "Option::is_none")] diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_type.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_type.rs index 41a78a3388..0889f80719 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_type.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_filter_type.rs @@ -12,12 +12,12 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, serde::Serialize, serde::Deserialize)] pub enum StreamProofsFilterType { - #[serde(rename = "All")] - All, + #[serde(rename = "Any")] + Any, #[serde(rename = "NewEpochs")] NewEpochs, - #[serde(rename = "ProtocolUpdateTriggers")] - ProtocolUpdateTriggers, + #[serde(rename = "ProtocolUpdateInitializations")] + ProtocolUpdateInitializations, #[serde(rename = "ProtocolUpdateExecution")] ProtocolUpdateExecution, @@ -26,9 +26,9 @@ pub enum StreamProofsFilterType { impl ToString for StreamProofsFilterType { fn to_string(&self) -> String { match self { - Self::All => String::from("All"), + Self::Any => String::from("Any"), Self::NewEpochs => String::from("NewEpochs"), - Self::ProtocolUpdateTriggers => String::from("ProtocolUpdateTriggers"), + Self::ProtocolUpdateInitializations => String::from("ProtocolUpdateInitializations"), Self::ProtocolUpdateExecution => String::from("ProtocolUpdateExecution"), } } @@ -36,7 +36,7 @@ impl ToString for StreamProofsFilterType { impl Default for StreamProofsFilterType { fn default() -> StreamProofsFilterType { - Self::All + Self::Any } } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_request.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_request.rs index 5e60107589..71ba7c439f 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_request.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_proofs_request.rs @@ -17,8 +17,8 @@ pub struct StreamProofsRequest { /// The logical name of the network #[serde(rename = "network")] pub network: String, - #[serde(rename = "filter")] - pub filter: Option, // Using Option permits Default trait; Will always be Some in normal use + #[serde(rename = "filter", skip_serializing_if = "Option::is_none")] + pub filter: Option>, /// If specified, the maximum number of proofs that will be returned. #[serde(rename = "max_page_size", skip_serializing_if = "Option::is_none")] pub max_page_size: Option, @@ -29,10 +29,10 @@ pub struct StreamProofsRequest { impl StreamProofsRequest { /// A request to retrieve a sublist of proofs. - pub fn new(network: String, filter: crate::core_api::generated::models::StreamProofsFilter) -> StreamProofsRequest { + pub fn new(network: String) -> StreamProofsRequest { StreamProofsRequest { network, - filter: Option::Some(filter), + filter: None, max_page_size: None, continuation_token: None, } diff --git a/core-rust/core-api-server/src/core_api/generated/models/stream_transactions_response.rs b/core-rust/core-api-server/src/core_api/generated/models/stream_transactions_response.rs index e0bde27665..1da1757340 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/stream_transactions_response.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/stream_transactions_response.rs @@ -17,7 +17,7 @@ pub struct StreamTransactionsResponse { pub previous_state_identifiers: Option>, #[serde(rename = "from_state_version")] pub from_state_version: i64, - /// An integer between `0` and `10000`, giving the total count of proofs in the returned response + /// An integer between `0` and `10000`, giving the total count of transactions in the returned response #[serde(rename = "count")] pub count: i32, #[serde(rename = "max_ledger_state_version")] diff --git a/core-rust/core-api-server/src/core_api/handlers/stream_proofs.rs b/core-rust/core-api-server/src/core_api/handlers/stream_proofs.rs index eb479b8822..2b04f326df 100644 --- a/core-rust/core-api-server/src/core_api/handlers/stream_proofs.rs +++ b/core-rust/core-api-server/src/core_api/handlers/stream_proofs.rs @@ -13,9 +13,9 @@ pub(crate) async fn handle_stream_proofs( assert_matching_network(&request.network, &state.network)?; let mapping_context = MappingContext::new(&state.network); - let filter = request - .filter - .ok_or_else(|| client_error("filter must be present"))?; + let filter = request.filter.unwrap_or(Box::new(StreamProofsFilterAny { + from_state_version: None, + })); let page_size = extract_valid_size( request.max_page_size, @@ -34,8 +34,8 @@ pub(crate) async fn handle_stream_proofs( let database = state.state_manager.database.read_current(); use models::StreamProofsFilter::*; - let mut proofs_iter = match filter { - StreamProofsFilterAll { from_state_version } => iterate_all_proofs( + let mut proofs_iter = match *filter { + StreamProofsFilterAny { from_state_version } => iterate_all_proofs( &database, continue_from_state_version, extract_from_state_version(&database, from_state_version)?, diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilter.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilter.java index 78836243c3..02dfaeb8d4 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilter.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilter.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAny; import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateInitializations; @@ -37,8 +37,9 @@ import com.radixdlt.api.core.generated.client.JSON; /** - * StreamProofsFilter + * If not provided, defaults to \"Any\". */ +@ApiModel(description = "If not provided, defaults to \"Any\".") @JsonPropertyOrder({ StreamProofsFilter.JSON_PROPERTY_TYPE }) @@ -49,11 +50,11 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterAny.class, name = "Any"), @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), - @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "StreamProofsFilterAll"), + @JsonSubTypes.Type(value = StreamProofsFilterAny.class, name = "StreamProofsFilterAny"), @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "StreamProofsFilterNewEpochs"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "StreamProofsFilterProtocolUpdateExecution"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "StreamProofsFilterProtocolUpdateInitializations"), @@ -135,11 +136,11 @@ private String toIndentedString(Object o) { static { // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); - mappings.put("All", StreamProofsFilterAll.class); + mappings.put("Any", StreamProofsFilterAny.class); mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); - mappings.put("StreamProofsFilterAll", StreamProofsFilterAll.class); + mappings.put("StreamProofsFilterAny", StreamProofsFilterAny.class); mappings.put("StreamProofsFilterNewEpochs", StreamProofsFilterNewEpochs.class); mappings.put("StreamProofsFilterProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); mappings.put("StreamProofsFilterProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAny.java similarity index 89% rename from core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java rename to core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAny.java index 793305493c..47f1c4330f 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAll.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAny.java @@ -26,8 +26,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.radixdlt.api.core.generated.models.StreamProofsFilter; -import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; -import com.radixdlt.api.core.generated.models.StreamProofsFilterAllAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAny; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAnyAllOf; import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateInitializations; @@ -39,10 +39,10 @@ import com.radixdlt.api.core.generated.client.JSON; /** - * StreamProofsFilterAll + * StreamProofsFilterAny */ @JsonPropertyOrder({ - StreamProofsFilterAll.JSON_PROPERTY_FROM_STATE_VERSION + StreamProofsFilterAny.JSON_PROPERTY_FROM_STATE_VERSION }) @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonIgnoreProperties( @@ -51,20 +51,20 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterAny.class, name = "Any"), @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), }) -public class StreamProofsFilterAll extends StreamProofsFilter { +public class StreamProofsFilterAny extends StreamProofsFilter { public static final String JSON_PROPERTY_FROM_STATE_VERSION = "from_state_version"; private Long fromStateVersion; - public StreamProofsFilterAll() { + public StreamProofsFilterAny() { } - public StreamProofsFilterAll fromStateVersion(Long fromStateVersion) { + public StreamProofsFilterAny fromStateVersion(Long fromStateVersion) { this.fromStateVersion = fromStateVersion; return this; } @@ -93,7 +93,7 @@ public void setFromStateVersion(Long fromStateVersion) { /** - * Return true if this StreamProofsFilterAll object is equal to o. + * Return true if this StreamProofsFilterAny object is equal to o. */ @Override public boolean equals(Object o) { @@ -103,8 +103,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - StreamProofsFilterAll streamProofsFilterAll = (StreamProofsFilterAll) o; - return Objects.equals(this.fromStateVersion, streamProofsFilterAll.fromStateVersion) && + StreamProofsFilterAny streamProofsFilterAny = (StreamProofsFilterAny) o; + return Objects.equals(this.fromStateVersion, streamProofsFilterAny.fromStateVersion) && super.equals(o); } @@ -116,7 +116,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class StreamProofsFilterAll {\n"); + sb.append("class StreamProofsFilterAny {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" fromStateVersion: ").append(toIndentedString(fromStateVersion)).append("\n"); sb.append("}"); @@ -137,12 +137,12 @@ private String toIndentedString(Object o) { static { // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); - mappings.put("All", StreamProofsFilterAll.class); + mappings.put("Any", StreamProofsFilterAny.class); mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); - mappings.put("StreamProofsFilterAll", StreamProofsFilterAll.class); - JSON.registerDiscriminator(StreamProofsFilterAll.class, "type", mappings); + mappings.put("StreamProofsFilterAny", StreamProofsFilterAny.class); + JSON.registerDiscriminator(StreamProofsFilterAny.class, "type", mappings); } } diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAnyAllOf.java similarity index 90% rename from core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java rename to core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAnyAllOf.java index 051f22515a..ee56935c57 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAllAllOf.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterAnyAllOf.java @@ -28,20 +28,20 @@ /** - * StreamProofsFilterAllAllOf + * StreamProofsFilterAnyAllOf */ @JsonPropertyOrder({ - StreamProofsFilterAllAllOf.JSON_PROPERTY_FROM_STATE_VERSION + StreamProofsFilterAnyAllOf.JSON_PROPERTY_FROM_STATE_VERSION }) @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StreamProofsFilterAllAllOf { +public class StreamProofsFilterAnyAllOf { public static final String JSON_PROPERTY_FROM_STATE_VERSION = "from_state_version"; private Long fromStateVersion; - public StreamProofsFilterAllAllOf() { + public StreamProofsFilterAnyAllOf() { } - public StreamProofsFilterAllAllOf fromStateVersion(Long fromStateVersion) { + public StreamProofsFilterAnyAllOf fromStateVersion(Long fromStateVersion) { this.fromStateVersion = fromStateVersion; return this; } @@ -70,7 +70,7 @@ public void setFromStateVersion(Long fromStateVersion) { /** - * Return true if this StreamProofsFilterAll_allOf object is equal to o. + * Return true if this StreamProofsFilterAny_allOf object is equal to o. */ @Override public boolean equals(Object o) { @@ -80,8 +80,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - StreamProofsFilterAllAllOf streamProofsFilterAllAllOf = (StreamProofsFilterAllAllOf) o; - return Objects.equals(this.fromStateVersion, streamProofsFilterAllAllOf.fromStateVersion); + StreamProofsFilterAnyAllOf streamProofsFilterAnyAllOf = (StreamProofsFilterAnyAllOf) o; + return Objects.equals(this.fromStateVersion, streamProofsFilterAnyAllOf.fromStateVersion); } @Override @@ -92,7 +92,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class StreamProofsFilterAllAllOf {\n"); + sb.append("class StreamProofsFilterAnyAllOf {\n"); sb.append(" fromStateVersion: ").append(toIndentedString(fromStateVersion)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java index b94a77e15e..c9861da950 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterNewEpochs.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.radixdlt.api.core.generated.models.StreamProofsFilter; -import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAny; import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochsAllOf; import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; @@ -51,7 +51,7 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterAny.class, name = "Any"), @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), @@ -137,7 +137,7 @@ private String toIndentedString(Object o) { static { // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); - mappings.put("All", StreamProofsFilterAll.class); + mappings.put("Any", StreamProofsFilterAny.class); mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java index c8071c37d7..2d648a8234 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecution.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.radixdlt.api.core.generated.models.StreamProofsFilter; -import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAny; import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecutionAllOf; @@ -52,7 +52,7 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterAny.class, name = "Any"), @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), @@ -74,11 +74,11 @@ public StreamProofsFilterProtocolUpdateExecution protocolVersion(String protocol } /** - * The protocol version name to filter to. This can be returned from looking at the protocol updates. + * The protocol version name to filter to. * @return protocolVersion **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The protocol version name to filter to. This can be returned from looking at the protocol updates. ") + @ApiModelProperty(value = "The protocol version name to filter to. ") @JsonProperty(JSON_PROPERTY_PROTOCOL_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -169,7 +169,7 @@ private String toIndentedString(Object o) { static { // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); - mappings.put("All", StreamProofsFilterAll.class); + mappings.put("Any", StreamProofsFilterAny.class); mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java index a3708478d2..265aee874f 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.java @@ -51,11 +51,11 @@ public StreamProofsFilterProtocolUpdateExecutionAllOf protocolVersion(String pro } /** - * The protocol version name to filter to. This can be returned from looking at the protocol updates. + * The protocol version name to filter to. * @return protocolVersion **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The protocol version name to filter to. This can be returned from looking at the protocol updates. ") + @ApiModelProperty(value = "The protocol version name to filter to. ") @JsonProperty(JSON_PROPERTY_PROTOCOL_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java index d5afbabd48..822f83e53a 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterProtocolUpdateInitializations.java @@ -26,8 +26,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.radixdlt.api.core.generated.models.StreamProofsFilter; -import com.radixdlt.api.core.generated.models.StreamProofsFilterAll; -import com.radixdlt.api.core.generated.models.StreamProofsFilterAllAllOf; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAny; +import com.radixdlt.api.core.generated.models.StreamProofsFilterAnyAllOf; import com.radixdlt.api.core.generated.models.StreamProofsFilterNewEpochs; import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateExecution; import com.radixdlt.api.core.generated.models.StreamProofsFilterProtocolUpdateInitializations; @@ -51,7 +51,7 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = StreamProofsFilterAll.class, name = "All"), + @JsonSubTypes.Type(value = StreamProofsFilterAny.class, name = "Any"), @JsonSubTypes.Type(value = StreamProofsFilterNewEpochs.class, name = "NewEpochs"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateExecution.class, name = "ProtocolUpdateExecution"), @JsonSubTypes.Type(value = StreamProofsFilterProtocolUpdateInitializations.class, name = "ProtocolUpdateInitializations"), @@ -137,7 +137,7 @@ private String toIndentedString(Object o) { static { // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); - mappings.put("All", StreamProofsFilterAll.class); + mappings.put("Any", StreamProofsFilterAny.class); mappings.put("NewEpochs", StreamProofsFilterNewEpochs.class); mappings.put("ProtocolUpdateExecution", StreamProofsFilterProtocolUpdateExecution.class); mappings.put("ProtocolUpdateInitializations", StreamProofsFilterProtocolUpdateInitializations.class); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterType.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterType.java index 739f540730..8fe561d07d 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterType.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsFilterType.java @@ -28,11 +28,11 @@ */ public enum StreamProofsFilterType { - ALL("All"), + ANY("Any"), NEWEPOCHS("NewEpochs"), - PROTOCOLUPDATETRIGGERS("ProtocolUpdateTriggers"), + PROTOCOLUPDATEINITIALIZATIONS("ProtocolUpdateInitializations"), PROTOCOLUPDATEEXECUTION("ProtocolUpdateExecution"); diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsRequest.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsRequest.java index 691437d7e1..c1c6a8bc7e 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsRequest.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamProofsRequest.java @@ -90,10 +90,10 @@ public StreamProofsRequest filter(StreamProofsFilter filter) { * Get filter * @return filter **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FILTER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public StreamProofsFilter getFilter() { return filter; @@ -101,7 +101,7 @@ public StreamProofsFilter getFilter() { @JsonProperty(JSON_PROPERTY_FILTER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFilter(StreamProofsFilter filter) { this.filter = filter; } diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsResponse.java index 6c10a65451..65d5361e2c 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsResponse.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/StreamTransactionsResponse.java @@ -126,13 +126,13 @@ public StreamTransactionsResponse count(Integer count) { } /** - * An integer between `0` and `10000`, giving the total count of proofs in the returned response + * An integer between `0` and `10000`, giving the total count of transactions in the returned response * minimum: 0 * maximum: 10000 * @return count **/ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An integer between `0` and `10000`, giving the total count of proofs in the returned response") + @ApiModelProperty(required = true, value = "An integer between `0` and `10000`, giving the total count of transactions in the returned response") @JsonProperty(JSON_PROPERTY_COUNT) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdk/typescript/lib/generated/.openapi-generator/FILES b/sdk/typescript/lib/generated/.openapi-generator/FILES index 8c741ffef9..9a362e4eef 100644 --- a/sdk/typescript/lib/generated/.openapi-generator/FILES +++ b/sdk/typescript/lib/generated/.openapi-generator/FILES @@ -552,8 +552,8 @@ models/StreamProofsErrorDetailsType.ts models/StreamProofsErrorResponse.ts models/StreamProofsErrorResponseAllOf.ts models/StreamProofsFilter.ts -models/StreamProofsFilterAll.ts -models/StreamProofsFilterAllAllOf.ts +models/StreamProofsFilterAny.ts +models/StreamProofsFilterAnyAllOf.ts models/StreamProofsFilterBase.ts models/StreamProofsFilterNewEpochs.ts models/StreamProofsFilterNewEpochsAllOf.ts diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilter.ts b/sdk/typescript/lib/generated/models/StreamProofsFilter.ts index fb2b644e35..345051d3a6 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilter.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilter.ts @@ -13,12 +13,12 @@ */ import { - StreamProofsFilterAll, - instanceOfStreamProofsFilterAll, - StreamProofsFilterAllFromJSON, - StreamProofsFilterAllFromJSONTyped, - StreamProofsFilterAllToJSON, -} from './StreamProofsFilterAll'; + StreamProofsFilterAny, + instanceOfStreamProofsFilterAny, + StreamProofsFilterAnyFromJSON, + StreamProofsFilterAnyFromJSONTyped, + StreamProofsFilterAnyToJSON, +} from './StreamProofsFilterAny'; import { StreamProofsFilterNewEpochs, instanceOfStreamProofsFilterNewEpochs, @@ -46,7 +46,7 @@ import { * * @export */ -export type StreamProofsFilter = { type: 'All' } & StreamProofsFilterAll | { type: 'NewEpochs' } & StreamProofsFilterNewEpochs | { type: 'ProtocolUpdateExecution' } & StreamProofsFilterProtocolUpdateExecution | { type: 'ProtocolUpdateInitializations' } & StreamProofsFilterProtocolUpdateInitializations; +export type StreamProofsFilter = { type: 'Any' } & StreamProofsFilterAny | { type: 'NewEpochs' } & StreamProofsFilterNewEpochs | { type: 'ProtocolUpdateExecution' } & StreamProofsFilterProtocolUpdateExecution | { type: 'ProtocolUpdateInitializations' } & StreamProofsFilterProtocolUpdateInitializations; export function StreamProofsFilterFromJSON(json: any): StreamProofsFilter { return StreamProofsFilterFromJSONTyped(json, false); @@ -57,8 +57,8 @@ export function StreamProofsFilterFromJSONTyped(json: any, ignoreDiscriminator: return json; } switch (json['type']) { - case 'All': - return {...StreamProofsFilterAllFromJSONTyped(json, true), type: 'All'}; + case 'Any': + return {...StreamProofsFilterAnyFromJSONTyped(json, true), type: 'Any'}; case 'NewEpochs': return {...StreamProofsFilterNewEpochsFromJSONTyped(json, true), type: 'NewEpochs'}; case 'ProtocolUpdateExecution': @@ -78,8 +78,8 @@ export function StreamProofsFilterToJSON(value?: StreamProofsFilter | null): any return null; } switch (value['type']) { - case 'All': - return StreamProofsFilterAllToJSON(value); + case 'Any': + return StreamProofsFilterAnyToJSON(value); case 'NewEpochs': return StreamProofsFilterNewEpochsToJSON(value); case 'ProtocolUpdateExecution': diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterAny.ts similarity index 77% rename from sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts rename to sdk/typescript/lib/generated/models/StreamProofsFilterAny.ts index ea0083977f..74db16af65 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterAll.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterAny.ts @@ -16,19 +16,19 @@ import { exists, mapValues } from '../runtime'; /** * * @export - * @interface StreamProofsFilterAll + * @interface StreamProofsFilterAny */ -export interface StreamProofsFilterAll { +export interface StreamProofsFilterAny { /** * * @type {string} - * @memberof StreamProofsFilterAll + * @memberof StreamProofsFilterAny */ - type: StreamProofsFilterAllTypeEnum; + type: StreamProofsFilterAnyTypeEnum; /** * * @type {number} - * @memberof StreamProofsFilterAll + * @memberof StreamProofsFilterAny */ from_state_version?: number; } @@ -37,27 +37,27 @@ export interface StreamProofsFilterAll { /** * @export */ -export const StreamProofsFilterAllTypeEnum = { - All: 'All' +export const StreamProofsFilterAnyTypeEnum = { + Any: 'Any' } as const; -export type StreamProofsFilterAllTypeEnum = typeof StreamProofsFilterAllTypeEnum[keyof typeof StreamProofsFilterAllTypeEnum]; +export type StreamProofsFilterAnyTypeEnum = typeof StreamProofsFilterAnyTypeEnum[keyof typeof StreamProofsFilterAnyTypeEnum]; /** - * Check if a given object implements the StreamProofsFilterAll interface. + * Check if a given object implements the StreamProofsFilterAny interface. */ -export function instanceOfStreamProofsFilterAll(value: object): boolean { +export function instanceOfStreamProofsFilterAny(value: object): boolean { let isInstance = true; isInstance = isInstance && "type" in value; return isInstance; } -export function StreamProofsFilterAllFromJSON(json: any): StreamProofsFilterAll { - return StreamProofsFilterAllFromJSONTyped(json, false); +export function StreamProofsFilterAnyFromJSON(json: any): StreamProofsFilterAny { + return StreamProofsFilterAnyFromJSONTyped(json, false); } -export function StreamProofsFilterAllFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterAll { +export function StreamProofsFilterAnyFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterAny { if ((json === undefined) || (json === null)) { return json; } @@ -68,7 +68,7 @@ export function StreamProofsFilterAllFromJSONTyped(json: any, ignoreDiscriminato }; } -export function StreamProofsFilterAllToJSON(value?: StreamProofsFilterAll | null): any { +export function StreamProofsFilterAnyToJSON(value?: StreamProofsFilterAny | null): any { if (value === undefined) { return undefined; } diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterAnyAllOf.ts similarity index 76% rename from sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts rename to sdk/typescript/lib/generated/models/StreamProofsFilterAnyAllOf.ts index b2df2828f6..cac1209210 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterAllAllOf.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterAnyAllOf.ts @@ -16,47 +16,47 @@ import { exists, mapValues } from '../runtime'; /** * * @export - * @interface StreamProofsFilterAllAllOf + * @interface StreamProofsFilterAnyAllOf */ -export interface StreamProofsFilterAllAllOf { +export interface StreamProofsFilterAnyAllOf { /** * * @type {number} - * @memberof StreamProofsFilterAllAllOf + * @memberof StreamProofsFilterAnyAllOf */ from_state_version?: number; /** * * @type {string} - * @memberof StreamProofsFilterAllAllOf + * @memberof StreamProofsFilterAnyAllOf */ - type?: StreamProofsFilterAllAllOfTypeEnum; + type?: StreamProofsFilterAnyAllOfTypeEnum; } /** * @export */ -export const StreamProofsFilterAllAllOfTypeEnum = { - All: 'All' +export const StreamProofsFilterAnyAllOfTypeEnum = { + Any: 'Any' } as const; -export type StreamProofsFilterAllAllOfTypeEnum = typeof StreamProofsFilterAllAllOfTypeEnum[keyof typeof StreamProofsFilterAllAllOfTypeEnum]; +export type StreamProofsFilterAnyAllOfTypeEnum = typeof StreamProofsFilterAnyAllOfTypeEnum[keyof typeof StreamProofsFilterAnyAllOfTypeEnum]; /** - * Check if a given object implements the StreamProofsFilterAllAllOf interface. + * Check if a given object implements the StreamProofsFilterAnyAllOf interface. */ -export function instanceOfStreamProofsFilterAllAllOf(value: object): boolean { +export function instanceOfStreamProofsFilterAnyAllOf(value: object): boolean { let isInstance = true; return isInstance; } -export function StreamProofsFilterAllAllOfFromJSON(json: any): StreamProofsFilterAllAllOf { - return StreamProofsFilterAllAllOfFromJSONTyped(json, false); +export function StreamProofsFilterAnyAllOfFromJSON(json: any): StreamProofsFilterAnyAllOf { + return StreamProofsFilterAnyAllOfFromJSONTyped(json, false); } -export function StreamProofsFilterAllAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterAllAllOf { +export function StreamProofsFilterAnyAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamProofsFilterAnyAllOf { if ((json === undefined) || (json === null)) { return json; } @@ -67,7 +67,7 @@ export function StreamProofsFilterAllAllOfFromJSONTyped(json: any, ignoreDiscrim }; } -export function StreamProofsFilterAllAllOfToJSON(value?: StreamProofsFilterAllAllOf | null): any { +export function StreamProofsFilterAnyAllOfToJSON(value?: StreamProofsFilterAnyAllOf | null): any { if (value === undefined) { return undefined; } diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterBase.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterBase.ts index 353de9e3e0..f9d5e62685 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterBase.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterBase.ts @@ -21,7 +21,7 @@ import { } from './StreamProofsFilterType'; /** - * + * If not provided, defaults to "Any". * @export * @interface StreamProofsFilterBase */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts index 7d6097233b..d70d483f69 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecution.ts @@ -26,7 +26,7 @@ export interface StreamProofsFilterProtocolUpdateExecution { */ type: StreamProofsFilterProtocolUpdateExecutionTypeEnum; /** - * The protocol version name to filter to. This can be returned from looking at the protocol updates. + * The protocol version name to filter to. * @type {string} * @memberof StreamProofsFilterProtocolUpdateExecution */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts index bd29849fa1..5e291eac44 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterProtocolUpdateExecutionAllOf.ts @@ -20,7 +20,7 @@ import { exists, mapValues } from '../runtime'; */ export interface StreamProofsFilterProtocolUpdateExecutionAllOf { /** - * The protocol version name to filter to. This can be returned from looking at the protocol updates. + * The protocol version name to filter to. * @type {string} * @memberof StreamProofsFilterProtocolUpdateExecutionAllOf */ diff --git a/sdk/typescript/lib/generated/models/StreamProofsFilterType.ts b/sdk/typescript/lib/generated/models/StreamProofsFilterType.ts index d677feb3b2..a44062d5bb 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsFilterType.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsFilterType.ts @@ -18,9 +18,9 @@ * @export */ export const StreamProofsFilterType = { - All: 'All', + Any: 'Any', NewEpochs: 'NewEpochs', - ProtocolUpdateTriggers: 'ProtocolUpdateTriggers', + ProtocolUpdateInitializations: 'ProtocolUpdateInitializations', ProtocolUpdateExecution: 'ProtocolUpdateExecution' } as const; export type StreamProofsFilterType = typeof StreamProofsFilterType[keyof typeof StreamProofsFilterType]; diff --git a/sdk/typescript/lib/generated/models/StreamProofsRequest.ts b/sdk/typescript/lib/generated/models/StreamProofsRequest.ts index 1b6e3ffa11..051a4ee012 100644 --- a/sdk/typescript/lib/generated/models/StreamProofsRequest.ts +++ b/sdk/typescript/lib/generated/models/StreamProofsRequest.ts @@ -37,7 +37,7 @@ export interface StreamProofsRequest { * @type {StreamProofsFilter} * @memberof StreamProofsRequest */ - filter: StreamProofsFilter; + filter?: StreamProofsFilter; /** * If specified, the maximum number of proofs that will be returned. * @type {number} @@ -60,7 +60,6 @@ export interface StreamProofsRequest { export function instanceOfStreamProofsRequest(value: object): boolean { let isInstance = true; isInstance = isInstance && "network" in value; - isInstance = isInstance && "filter" in value; return isInstance; } @@ -76,7 +75,7 @@ export function StreamProofsRequestFromJSONTyped(json: any, ignoreDiscriminator: return { 'network': json['network'], - 'filter': StreamProofsFilterFromJSON(json['filter']), + 'filter': !exists(json, 'filter') ? undefined : StreamProofsFilterFromJSON(json['filter']), 'max_page_size': !exists(json, 'max_page_size') ? undefined : json['max_page_size'], 'continuation_token': !exists(json, 'continuation_token') ? undefined : json['continuation_token'], }; diff --git a/sdk/typescript/lib/generated/models/StreamTransactionsResponse.ts b/sdk/typescript/lib/generated/models/StreamTransactionsResponse.ts index d8c46804ca..91664c4da3 100644 --- a/sdk/typescript/lib/generated/models/StreamTransactionsResponse.ts +++ b/sdk/typescript/lib/generated/models/StreamTransactionsResponse.ts @@ -51,7 +51,7 @@ export interface StreamTransactionsResponse { */ from_state_version: number; /** - * An integer between `0` and `10000`, giving the total count of proofs in the returned response + * An integer between `0` and `10000`, giving the total count of transactions in the returned response * @type {number} * @memberof StreamTransactionsResponse */ diff --git a/sdk/typescript/lib/generated/models/index.ts b/sdk/typescript/lib/generated/models/index.ts index 0d52ff53b9..0bab7c5acf 100644 --- a/sdk/typescript/lib/generated/models/index.ts +++ b/sdk/typescript/lib/generated/models/index.ts @@ -545,8 +545,8 @@ export * from './StreamProofsErrorDetailsType'; export * from './StreamProofsErrorResponse'; export * from './StreamProofsErrorResponseAllOf'; export * from './StreamProofsFilter'; -export * from './StreamProofsFilterAll'; -export * from './StreamProofsFilterAllAllOf'; +export * from './StreamProofsFilterAny'; +export * from './StreamProofsFilterAnyAllOf'; export * from './StreamProofsFilterBase'; export * from './StreamProofsFilterNewEpochs'; export * from './StreamProofsFilterNewEpochsAllOf'; From 99d9926e6d8ffffc384afc149debdf7841daed62 Mon Sep 17 00:00:00 2001 From: David Edey Date: Thu, 25 Jan 2024 04:40:50 +0000 Subject: [PATCH 4/4] tests: Add proof stream test --- .../radixdlt/api/core/ProofStreamTest.java | 259 ++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 core/src/test/java/com/radixdlt/api/core/ProofStreamTest.java diff --git a/core/src/test/java/com/radixdlt/api/core/ProofStreamTest.java b/core/src/test/java/com/radixdlt/api/core/ProofStreamTest.java new file mode 100644 index 0000000000..b26a156991 --- /dev/null +++ b/core/src/test/java/com/radixdlt/api/core/ProofStreamTest.java @@ -0,0 +1,259 @@ +/* Copyright 2021 Radix Publishing Ltd incorporated in Jersey (Channel Islands). + * + * Licensed under the Radix License, Version 1.0 (the "License"); you may not use this + * file except in compliance with the License. You may obtain a copy of the License at: + * + * radixfoundation.org/licenses/LICENSE-v1 + * + * The Licensor hereby grants permission for the Canonical version of the Work to be + * published, distributed and used under or by reference to the Licensor’s trademark + * Radix ® and use of any unregistered trade names, logos or get-up. + * + * The Licensor provides the Work (and each Contributor provides its Contributions) on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, + * MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + * + * Whilst the Work is capable of being deployed, used and adopted (instantiated) to create + * a distributed ledger it is your responsibility to test and validate the code, together + * with all logic and performance of that code under all foreseeable scenarios. + * + * The Licensor does not make or purport to make and hereby excludes liability for all + * and any representation, warranty or undertaking in any form whatsoever, whether express + * or implied, to any entity or person, including any representation, warranty or + * undertaking, as to the functionality security use, value or other characteristics of + * any distributed ledger nor in respect the functioning or value of any tokens which may + * be created stored or transferred using the Work. The Licensor does not warrant that the + * Work or any use of the Work complies with any law or regulation in any territory where + * it may be implemented or used or that it will be appropriate for any specific purpose. + * + * Neither the licensor nor any current or former employees, officers, directors, partners, + * trustees, representatives, agents, advisors, contractors, or volunteers of the Licensor + * shall be liable for any direct or indirect, special, incidental, consequential or other + * losses of any kind, in tort, contract or otherwise (including but not limited to loss + * of revenue, income or profits, or loss of use or data, or loss of reputation, or loss + * of any economic or other opportunity of whatsoever nature or howsoever arising), arising + * out of or in connection with (without limitation of any use, misuse, of any ledger system + * or use made or its functionality or any performance or operation of any code or protocol + * caused by bugs or programming or logic errors or otherwise); + * + * A. any offer, purchase, holding, use, sale, exchange or transmission of any + * cryptographic keys, tokens or assets created, exchanged, stored or arising from any + * interaction with the Work; + * + * B. any failure in a transmission or loss of any token or assets keys or other digital + * artefacts due to errors in transmission; + * + * C. bugs, hacks, logic errors or faults in the Work or any communication; + * + * D. system software or apparatus including but not limited to losses caused by errors + * in holding or transmitting tokens by any third-party; + * + * E. breaches or failure of security including hacker attacks, loss or disclosure of + * password, loss of private key, unauthorised use or misuse of such passwords or keys; + * + * F. any losses including loss of anticipated savings or other benefits resulting from + * use of the Work or any changes to the Work (however implemented). + * + * You are solely responsible for; testing, validating and evaluation of all operation + * logic, functionality, security and appropriateness of using the Work for any commercial + * or non-commercial purpose and for any reproduction or redistribution by You of the + * Work. You assume all risks associated with Your use of the Work and the exercise of + * permissions under this License. + */ + +package com.radixdlt.api.core; + +import static com.radixdlt.harness.predicates.NodesPredicate.allAtOrOverEpoch; +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.common.collect.ImmutableList; +import com.radixdlt.api.DeterministicCoreApiTestBase; +import com.radixdlt.api.core.generated.models.*; +import com.radixdlt.protocol.ProtocolConfig; +import com.radixdlt.protocol.ProtocolUpdateEnactmentCondition; +import com.radixdlt.protocol.ProtocolUpdateTrigger; +import org.junit.Test; + +public class ProofStreamTest extends DeterministicCoreApiTestBase { + @Test + public void test_proof_stream() throws Exception { + final var protocolConfig = + new ProtocolConfig( + ImmutableList.of( + new ProtocolUpdateTrigger( + ProtocolUpdateTrigger.ANEMONE, + ProtocolUpdateEnactmentCondition.unconditionallyAtEpoch(3L)))); + + try (var test = buildRunningServerTestWithProtocolConfig(10, protocolConfig)) { + test.runUntilState(allAtOrOverEpoch(5L)); + + // ================== + // Test the ANY filter + // =================== + var page1Size = 8; + var responseAnyFilterPage1 = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest() + .network(networkLogicalName) + .maxPageSize(page1Size) + .filter(new StreamProofsFilterAny())); + + var page = responseAnyFilterPage1.getPage(); + assertThat(page.size()).isEqualTo(page1Size); + assertThat(page.get(0).getOrigin()).isInstanceOf(GenesisLedgerProofOrigin.class); + assertThat(page.get(0).getLedgerHeader().getStateVersion()).isEqualTo(1); + assertThat(page.get(page1Size - 1).getOrigin()) + .isInstanceOf(ConsensusLedgerProofOrigin.class); + assertThat(page.get(page1Size - 1).getLedgerHeader().getStateVersion()).isEqualTo(page1Size); + + var page2Size = 5; + var responseAnyFilterPage2 = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest() + .network(networkLogicalName) + .maxPageSize(page2Size) + .filter(new StreamProofsFilterAny()) + .continuationToken(responseAnyFilterPage1.getContinuationToken())); + + page = responseAnyFilterPage2.getPage(); + assertThat(page.size()).isEqualTo(page2Size); + assertThat(page.get(0).getLedgerHeader().getStateVersion()).isEqualTo(page1Size + 1); + + var responseAnyFilterOffset7 = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest() + .network(networkLogicalName) + .maxPageSize(1) + .filter(new StreamProofsFilterAny().fromStateVersion(7L))) + .continuationToken(responseAnyFilterPage1.getContinuationToken()); + + page = responseAnyFilterOffset7.getPage(); + assertThat(page.size()).isEqualTo(1); + assertThat(page.get(0).getLedgerHeader().getStateVersion()).isEqualTo(7); + + // ================== + // Test NO filter + // =================== + var responseNoFilterPage1 = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest().network(networkLogicalName).maxPageSize(page1Size)); + + // If this ever fails / flakes, it might be because of the proof gc job running in the + // background + // Which we probably want to disable in tests + assertThat(responseNoFilterPage1) + .usingRecursiveComparison() + .isEqualTo(responseAnyFilterPage1); + + // =================== + // Test the NewEpochs filter + // =================== + var responseNewEpochFilterPage1 = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest() + .network(networkLogicalName) + .maxPageSize(2) + .filter(new StreamProofsFilterNewEpochs())); + + page = responseNewEpochFilterPage1.getPage(); + assertThat(page.size()).isEqualTo(2); + assertThat(page.get(0).getLedgerHeader().getEpoch()).isEqualTo(1); + assertThat(page.get(0).getLedgerHeader().getNextEpoch()).isNotNull(); + assertThat(page.get(0).getLedgerHeader().getNextEpoch().getEpoch()).isEqualTo(2); + assertThat(page.get(1).getLedgerHeader().getNextEpoch()).isNotNull(); + assertThat(page.get(1).getLedgerHeader().getNextEpoch().getEpoch()).isEqualTo(3); + + var responseNewEpochFilterPage2 = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest() + .network(networkLogicalName) + .maxPageSize(1) + .filter(new StreamProofsFilterNewEpochs()) + .continuationToken(responseNewEpochFilterPage1.getContinuationToken())); + + page = responseNewEpochFilterPage2.getPage(); + assertThat(page.size()).isEqualTo(1); + assertThat(page.get(0).getLedgerHeader().getNextEpoch()).isNotNull(); + assertThat(page.get(0).getLedgerHeader().getNextEpoch().getEpoch()).isEqualTo(4); + + var responseNewEpochFilterPageOffset = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest() + .network(networkLogicalName) + .maxPageSize(1) + .filter(new StreamProofsFilterNewEpochs().fromEpoch(3L))); + + page = responseNewEpochFilterPageOffset.getPage(); + assertThat(page.size()).isEqualTo(1); + assertThat(page.get(0).getLedgerHeader().getNextEpoch().getEpoch()).isEqualTo(3); + + // =================== + // Test the ProtocolUpdateInitializations filter + // =================== + var responseUpdateInitializationsFilterPage1 = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest() + .network(networkLogicalName) + .maxPageSize(1) + .filter(new StreamProofsFilterProtocolUpdateInitializations())); + + page = responseUpdateInitializationsFilterPage1.getPage(); + assertThat(page.size()).isEqualTo(1); + assertThat(page.get(0).getLedgerHeader().getNextProtocolVersion()) + .isEqualTo(ProtocolUpdateTrigger.ANEMONE); + assertThat(page.get(0).getLedgerHeader().getNextEpoch()).isNotNull(); + assertThat(page.get(0).getLedgerHeader().getNextEpoch().getEpoch()).isEqualTo(3); + assertThat(page.get(0).getLedgerHeader().getEpoch()).isEqualTo(2); + assertThat(responseUpdateInitializationsFilterPage1.getContinuationToken()).isNull(); + var anenomeTriggerStateVersion = page.get(0).getLedgerHeader().getStateVersion(); + + // =================== + // Test the ProtocolUpdateExecution filter + // =================== + var responseUpdateExecutionFilterPage1 = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest() + .network(networkLogicalName) + .maxPageSize(1) + .filter(new StreamProofsFilterProtocolUpdateExecution())); + + page = responseUpdateExecutionFilterPage1.getPage(); + assertThat(page.size()).isEqualTo(1); + // Before consensus starts in this epoch, the consensus manager is set to epoch N + 1, round 0 + // The proofs should agree + assertThat(page.get(0).getLedgerHeader().getEpoch()).isEqualTo(3); + assertThat(page.get(0).getLedgerHeader().getRound()).isEqualTo(0); + // Anenome consists of 1 transaction batch of length 4 + assertThat(page.get(0).getLedgerHeader().getStateVersion()) + .isEqualTo(anenomeTriggerStateVersion + 4); + assertThat(page.get(0).getOrigin()).isInstanceOf(ProtocolUpdateLedgerProofOrigin.class); + // There's only 1 transaction in anemone + // ...and we're only applying anenome, so there are no further updates + assertThat(responseUpdateExecutionFilterPage1.getContinuationToken()).isNull(); + + var responseUpdateExecutionFilterPage1Filtered = + getStreamApi() + .streamProofsPost( + new StreamProofsRequest() + .network(networkLogicalName) + .maxPageSize(1) + .filter( + new StreamProofsFilterProtocolUpdateExecution() + .protocolVersion(ProtocolUpdateTrigger.ANEMONE))); + + assertThat(responseUpdateExecutionFilterPage1) + .usingRecursiveComparison() + .isEqualTo(responseUpdateExecutionFilterPage1Filtered); + } + } +}