diff --git a/core-rust/core-api-server/core-api-schema.yaml b/core-rust/core-api-server/core-api-schema.yaml index 6bfd4b2068..4e7b86e18a 100644 --- a/core-rust/core-api-server/core-api-schema.yaml +++ b/core-rust/core-api-server/core-api-schema.yaml @@ -147,7 +147,7 @@ tags: User transactions are formed of a core "intent", which is then signed by 0+ signatories, before being notarized. The output is called a notarized payload. It is this notarized transaction payload which is submitted to the network. - + For most users, this construction process will generally happen in their Radix Wallet. If you wish to construct transactions programmatically or offline, you will need to integrate the Radix Engine Toolkit into your application for construction and finalization. @@ -171,7 +171,7 @@ tags: ## State Model The Radix Engine State Model can be thought of as a forest of state sub-trees. - A state sub-tree consists of "entities". These entities have an ID, and 0 or more "substates" at keys underneath them. + A state sub-tree consists of "entities". These entities have an ID, and 0 or more "substates" at keys underneath them. These substates are typed, and can own other entities, forming a tree of ownership. Each state sub-tree has a root entity, and a single Bech32M Global Address, with a human-readable-prefix (and prefix byte) matching the root entity type. @@ -181,7 +181,7 @@ tags: - name: Construction x-displayName: Transaction Construction x-traitTag: true # Don't display endpoints under this tag - description: | + description: | To construct and submit a transaction using the LTS endpoints: * Query `/lts/transaction/construction` to retrieve the current epoch (according to your node). @@ -840,13 +840,13 @@ paths: 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. @@ -858,7 +858,7 @@ paths: * 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 @@ -1611,7 +1611,7 @@ components: maximum: 4294967295 description: | An integer between `0` and `2^32 - 1`, chosen to allow a unique intent to be created (to enable submitting an otherwise identical/duplicate intent). - + As of Cuttlefish and V2 transaction models, this is now referred to in documentation as the `intent_discriminator`. notary_public_key: $ref: "#/components/schemas/PublicKey" @@ -2650,7 +2650,7 @@ components: type: string description: | A decimal string-encoded 64-bit signed integer, marking the unix timestamp in seconds. - + Note: this field accurately represents the full range of possible on-ledger values (i.e. `-2^63 <= seconds < 2^63`). This is contrary to the `InstantMs` type used in other places of this API. @@ -2660,7 +2660,7 @@ components: The RFC 3339 / ISO 8601 string representation of the timestamp. Will always use "Z" (denoting UTC) and a second-precision (i.e. *skipping* the `.000` milliseconds part). E.g.: `2023-01-26T18:30:09Z`. - + Note: This field will *not* be present if the actual on-ledger `unix_timestamp_seconds` value is outside the basic range supported by the RFC 3339 / ISO 8601 standard, which starts at year 1583 (i.e. the beginning of the Gregorian calendar) and ends at year @@ -5663,8 +5663,8 @@ components: effective_epoch_start: description: | The effective time the epoch started. A drift-free measure, used to work out when the - epoch should ideally end. - + epoch should ideally end. + Note: in abnormal cases (e.g. Byzantine network quorum), this on-ledger field may be set to an arbitrary, extreme value allowed by 64-bit signed integer. The API will still clamp the timestamp to `0 <= ms <= 100000000000000 (== 10^14)`, which translates to @@ -5675,7 +5675,7 @@ components: The actual time the epoch started. Not used by any logic, but the difference between this and the effective start gives a measure of the time it took for the end-of-epoch to be noticed. - + Note: in abnormal cases (e.g. Byzantine network quorum), this on-ledger field may be set to an arbitrary, extreme value allowed by 64-bit signed integer. The API will still clamp the timestamp to `0 <= ms <= 100000000000000 (== 10^14)`, which translates to @@ -5794,7 +5794,7 @@ components: description: | The latest round proposer's timestamp. An honest quorum of validators keeps this aligned with wall-clock time, and non-decreasing. - + Note: in abnormal cases (e.g. Byzantine network quorum), this on-ledger field may be set to an arbitrary, extreme value allowed by 64-bit signed integer. The API will still clamp the timestamp to `0 <= ms <= 100000000000000 (== 10^14)`, which translates to @@ -6241,7 +6241,7 @@ components: description: | The latest round proposer's timestamp (rounded down to the current minute). This is provided so that the client can detect if the node is synced up or not. - + Note: in abnormal cases (e.g. Byzantine network quorum), this on-ledger field may be set to an arbitrary, extreme value allowed by 64-bit signed integer. The API will still clamp the timestamp to `0 <= ms <= 100000000000000 (== 10^14)`, which translates to @@ -6783,7 +6783,7 @@ components: description: | If present, this field indicates the entity contributed to the payment of the fee. The change in balance will always be negative. - NOTE: This property is deprecated but kept for backwards compatibility. This entry is duplicated in + NOTE: This property is deprecated but kept for backwards compatibility. This entry is duplicated in `fee_balance_changes`. fee_balance_changes: type: array @@ -8042,7 +8042,7 @@ components: properties: radix_engine_toolkit_receipt: type: boolean - description: | + description: | This flag controls whether the preview response will include a Radix Engine Toolkit serializable receipt or not. If not provided, this defaults to `false` and no toolkit receipt is provided in the response. @@ -8052,7 +8052,6 @@ components: - at_ledger_state - encoded_receipt - receipt - - instruction_resource_changes - logs properties: at_ledger_state: @@ -8060,13 +8059,13 @@ components: description: A summarized state of the ledger on top of which the preview was performed. encoded_receipt: type: string - description: | + description: | The hex-sbor-encoded receipt. - This field is deprecated and will be removed from the API with the release of the next - protocol update, cuttlefish. This field was provided primarily for use with the Radix - Engine Toolkit and its execution summary functionality. If you still wish to use this - functionality update your Radix Engine Toolkit and use the receipt provided in the + This field is deprecated and will be removed from the API with the release of the next + protocol update, cuttlefish. This field was provided primarily for use with the Radix + Engine Toolkit and its execution summary functionality. If you still wish to use this + functionality update your Radix Engine Toolkit and use the receipt provided in the `radix_engine_toolkit_receipt` field of this response. deprecated: true receipt: @@ -8077,17 +8076,24 @@ components: An optional field which is only provided if the `radix_engine_toolkit_receipt` flag is set to true when requesting a transaction preview from the API. - This receipt is primarily intended for use with the toolkit and may contain information - that is already available in the receipt provided in the `receipt` field of this + This receipt is primarily intended for use with the toolkit and may contain information + that is already available in the receipt provided in the `receipt` field of this response. - A typical client of this API is not expected to use this receipt. The primary clients - this receipt is intended for is the Radix wallet or any client that needs to perform + A typical client of this API is not expected to use this receipt. The primary clients + this receipt is intended for is the Radix wallet or any client that needs to perform execution summaries on their transactions. instruction_resource_changes: type: array + description: | + This object holds changes in resource balances for all vaults within affected + accounts/components for each instruction. + + This field is deprecated (and not required) as of the Dugong release and may be removed + from the API in the future. items: $ref: "#/components/schemas/InstructionResourceChanges" + deprecated: true logs: type: array items: @@ -8117,7 +8123,7 @@ components: description: | If enabled, each manifest processor's auth zone will be given a simulated proof of every signature, which can be used to pass signature access rules. - + This can be used to preview transactions even if the required signatures are not known ahead of time. @@ -8130,7 +8136,7 @@ components: If enabled, the various runtime epoch-related verifications are skipped: - The `start_epoch_inclusive` and `end_epoch_exclusive` parameters, if specified, are ignored. - The duplicate intent checks (which rely on the expiry epoch) are also ignored. - + However, if the start and end epoch are provided, they must still be statically valid. We recommend using a value of `start_epoch_inclusive = 1` and `end_epoch_exclusive = 2` in this case. @@ -8138,13 +8144,13 @@ components: disable_auth_checks: description: | If enabled, all authorization checks are skipped during execution. - + This could be used to e.g.: * Preview protocol update style transactions. * Mint resources for previewing trades with resources you don't own. If doing this, be warned: only resources which were potentially mintable/burnable at creation time will be mintable/burnable, due to feature flags on the resource. - + Warning: this mode of operation is quite a departure from normal operation: * Calculated fees will likely be lower than a standard execution. * This mode can subtly break invariants some dApp code might rely on, or result in unexpected @@ -8179,19 +8185,19 @@ components: properties: core_api_receipt: type: boolean - description: | + description: | This flag controls whether the preview response will include a Core API receipt or not. If not provided, this defaults to `false` and no core api receipt is provided in the response. radix_engine_toolkit_receipt: type: boolean - description: | + description: | This flag controls whether the preview response will include a Radix Engine Toolkit serializable receipt or not. If not provided, this defaults to `false` and no toolkit receipt is provided in the response. logs: type: boolean - description: | + description: | This flag controls whether the preview response will include execution logs. If not provided, this defaults to `false` and no logs will be provided in the response. PreviewTransactionType: @@ -8260,12 +8266,12 @@ components: An optional field which is only provided if the `radix_engine_toolkit_receipt` flag is set to true in the `options` property of the request. - This receipt is primarily intended for use with the toolkit and may contain information - that is already available in the receipt provided in the `receipt` field of this + This receipt is primarily intended for use with the toolkit and may contain information + that is already available in the receipt provided in the `receipt` field of this response. - A typical client of this API is not expected to use this receipt. The primary clients - this receipt is intended for is the Radix wallet or any client that needs to perform + A typical client of this API is not expected to use this receipt. The primary clients + this receipt is intended for is the Radix wallet or any client that needs to perform execution summaries on their transactions. logs: type: array @@ -8938,7 +8944,7 @@ components: $ref: '#/components/schemas/InstantMs' description: | The round proposer's timestamp. - + Note: in abnormal cases (e.g. Byzantine network quorum), this on-ledger field may be set to an arbitrary, extreme value allowed by 64-bit signed integer. The API will still clamp the timestamp to `0 <= ms <= 100000000000000 (== 10^14)`, which translates to diff --git a/core-rust/core-api-server/src/core_api/conversions/lts.rs b/core-rust/core-api-server/src/core_api/conversions/lts.rs index 4375cfd67d..4c699491ed 100644 --- a/core-rust/core-api-server/src/core_api/conversions/lts.rs +++ b/core-rust/core-api-server/src/core_api/conversions/lts.rs @@ -171,7 +171,7 @@ fn resolve_fungible_balance_changes( // First - calculate the deprecated/duplicated total balance change let deprecated_fee_payment_balance_change = fee_payment_computation .fee_balance_changes - .get(&entity) + .get(entity) .map(|fee_changes| { let total_fee_payment_balance_change = fee_changes .iter() @@ -194,11 +194,11 @@ fn resolve_fungible_balance_changes( .transpose()? .flatten(); output.push(models::LtsEntityFungibleBalanceChanges { - entity_address: to_api_global_address(context, &entity)?, + entity_address: to_api_global_address(context, entity)?, fee_balance_change: deprecated_fee_payment_balance_change, fee_balance_changes: fee_payment_computation .fee_balance_changes - .get(&entity) + .get(entity) .map(|fee_balance_changes| { fee_balance_changes .iter() @@ -219,7 +219,7 @@ fn resolve_fungible_balance_changes( .unwrap_or_default(), non_fee_balance_changes: fee_payment_computation .non_fee_balance_changes - .get(&entity) + .get(entity) .map(|non_fee_balance_changes| { non_fee_balance_changes .iter() diff --git a/core-rust/core-api-server/src/core_api/generated/models/transaction_preview_response.rs b/core-rust/core-api-server/src/core_api/generated/models/transaction_preview_response.rs index 9c42a6ec69..7a28a0f97e 100644 --- a/core-rust/core-api-server/src/core_api/generated/models/transaction_preview_response.rs +++ b/core-rust/core-api-server/src/core_api/generated/models/transaction_preview_response.rs @@ -15,28 +15,29 @@ pub struct TransactionPreviewResponse { #[serde(rename = "at_ledger_state")] pub at_ledger_state: Box, - /// The hex-sbor-encoded receipt. This field is deprecated and will be removed from the API with the release of the next protocol update, cuttlefish. This field was provided primarily for use with the Radix Engine Toolkit and its execution summary functionality. If you still wish to use this functionality update your Radix Engine Toolkit and use the receipt provided in the `radix_engine_toolkit_receipt` field of this response. + /// The hex-sbor-encoded receipt. This field is deprecated and will be removed from the API with the release of the next protocol update, cuttlefish. This field was provided primarily for use with the Radix Engine Toolkit and its execution summary functionality. If you still wish to use this functionality update your Radix Engine Toolkit and use the receipt provided in the `radix_engine_toolkit_receipt` field of this response. #[serde(rename = "encoded_receipt")] pub encoded_receipt: String, #[serde(rename = "receipt")] pub receipt: Box, - /// An optional field which is only provided if the `radix_engine_toolkit_receipt` flag is set to true when requesting a transaction preview from the API. This receipt is primarily intended for use with the toolkit and may contain information that is already available in the receipt provided in the `receipt` field of this response. A typical client of this API is not expected to use this receipt. The primary clients this receipt is intended for is the Radix wallet or any client that needs to perform execution summaries on their transactions. + /// An optional field which is only provided if the `radix_engine_toolkit_receipt` flag is set to true when requesting a transaction preview from the API. This receipt is primarily intended for use with the toolkit and may contain information that is already available in the receipt provided in the `receipt` field of this response. A typical client of this API is not expected to use this receipt. The primary clients this receipt is intended for is the Radix wallet or any client that needs to perform execution summaries on their transactions. #[serde(rename = "radix_engine_toolkit_receipt", skip_serializing_if = "Option::is_none")] pub radix_engine_toolkit_receipt: Option, - #[serde(rename = "instruction_resource_changes")] - pub instruction_resource_changes: Vec, + /// This object holds changes in resource balances for all vaults within affected accounts/components for each instruction. This field is deprecated (and not required) as of the Dugong release and may be removed from the API in the future. + #[serde(rename = "instruction_resource_changes", skip_serializing_if = "Option::is_none")] + pub instruction_resource_changes: Option>, #[serde(rename = "logs")] pub logs: Vec, } impl TransactionPreviewResponse { - pub fn new(at_ledger_state: crate::core_api::generated::models::LedgerStateSummary, encoded_receipt: String, receipt: crate::core_api::generated::models::TransactionReceipt, instruction_resource_changes: Vec, logs: Vec) -> TransactionPreviewResponse { + pub fn new(at_ledger_state: crate::core_api::generated::models::LedgerStateSummary, encoded_receipt: String, receipt: crate::core_api::generated::models::TransactionReceipt, logs: Vec) -> TransactionPreviewResponse { TransactionPreviewResponse { at_ledger_state: Box::new(at_ledger_state), encoded_receipt, receipt: Box::new(receipt), radix_engine_toolkit_receipt: None, - instruction_resource_changes, + instruction_resource_changes: None, logs, } } diff --git a/core-rust/core-api-server/src/core_api/handlers/transaction_preview.rs b/core-rust/core-api-server/src/core_api/handlers/transaction_preview.rs index b09e68ee34..c9ddb2ea89 100644 --- a/core-rust/core-api-server/src/core_api/handlers/transaction_preview.rs +++ b/core-rust/core-api-server/src/core_api/handlers/transaction_preview.rs @@ -155,7 +155,7 @@ fn to_api_response( ), )?), radix_engine_toolkit_receipt: toolkit_receipt, - instruction_resource_changes, + instruction_resource_changes: Some(instruction_resource_changes), logs, } } @@ -168,7 +168,7 @@ fn to_api_response( reject_result, )?), radix_engine_toolkit_receipt: toolkit_receipt, - instruction_resource_changes: vec![], + instruction_resource_changes: Some(vec![]), logs: vec![], }, TransactionResult::Abort(_) => { diff --git a/core-rust/mesh-api-server/src/mesh_api/conversions/addressing.rs b/core-rust/mesh-api-server/src/mesh_api/conversions/addressing.rs index 5cfef52e9c..911aa7a499 100644 --- a/core-rust/mesh-api-server/src/mesh_api/conversions/addressing.rs +++ b/core-rust/mesh-api-server/src/mesh_api/conversions/addressing.rs @@ -114,7 +114,7 @@ pub fn extract_radix_account_address_from_account_identifier( ) -> Result { if account_identifier.sub_account.is_some() { return Err(ExtractionError::InvalidAccount { - message: format!("Sub accounts not supported"), + message: "Sub accounts not supported".to_string(), }); } let component_address = diff --git a/core-rust/mesh-api-server/src/mesh_api/conversions/operations.rs b/core-rust/mesh-api-server/src/mesh_api/conversions/operations.rs index 4187392e0a..fe72aaee54 100644 --- a/core-rust/mesh-api-server/src/mesh_api/conversions/operations.rs +++ b/core-rust/mesh-api-server/src/mesh_api/conversions/operations.rs @@ -115,7 +115,7 @@ pub fn to_mesh_api_operations( for entity in &fee_payment_computation.relevant_entities { if entity.is_account() { if let Some(fee_balance_changes) = - fee_payment_computation.fee_balance_changes.get(&entity) + fee_payment_computation.fee_balance_changes.get(entity) { for amount in fee_balance_changes .iter() @@ -139,7 +139,7 @@ pub fn to_mesh_api_operations( } if let Some(non_fee_balance_changes) = - fee_payment_computation.non_fee_balance_changes.get(&entity) + fee_payment_computation.non_fee_balance_changes.get(entity) { for (resource_address, amount) in non_fee_balance_changes { let operation = to_mesh_api_operation_no_fee( @@ -196,7 +196,7 @@ pub fn to_mesh_api_operations_from_instructions_v1( while next_index < instructions.len() { let mut instruction = &instructions[next_index]; - next_index = next_index + 1; + next_index += 1; match instruction { InstructionV1::CallMethod(CallMethod { address: DynamicGlobalAddress::Static(global_address), @@ -227,7 +227,7 @@ pub fn to_mesh_api_operations_from_instructions_v1( None, global_address, resource_adddress, - -input.amount.clone(), + -input.amount, )?); withdraw_input = Some((*resource_adddress, input.amount)); } @@ -266,7 +266,7 @@ pub fn to_mesh_api_operations_from_instructions_v1( amount, }) if next_index < instructions.len() => { instruction = &instructions[next_index]; - next_index = next_index + 1; + next_index += 1; match instruction { InstructionV1::CallMethod(CallMethod { diff --git a/core-rust/mesh-api-server/src/mesh_api/errors.rs b/core-rust/mesh-api-server/src/mesh_api/errors.rs index 148b7139b8..03c0c86d69 100644 --- a/core-rust/mesh-api-server/src/mesh_api/errors.rs +++ b/core-rust/mesh-api-server/src/mesh_api/errors.rs @@ -223,7 +223,7 @@ pub(crate) fn assert_matching_network( ); } else if network_identifier.sub_network_identifier.is_some() { return Err(ResponseError::from(ApiError::InvalidNetwork) - .with_details(format!("Invalid network - subnetworks not supported",))); + .with_details("Invalid network - subnetworks not supported".to_string())); } Ok(()) } diff --git a/core-rust/mesh-api-server/src/mesh_api/handlers/account_balance.rs b/core-rust/mesh-api-server/src/mesh_api/handlers/account_balance.rs index 71bc911777..31c07427b0 100644 --- a/core-rust/mesh-api-server/src/mesh_api/handlers/account_balance.rs +++ b/core-rust/mesh-api-server/src/mesh_api/handlers/account_balance.rs @@ -113,11 +113,11 @@ fn get_all_balances<'a>( .into_iter() .map(|(resource_address, balance)| { let currency = to_mesh_api_currency_from_resource_address( - &mapping_context, + mapping_context, database, &resource_address, )?; - Ok(to_mesh_api_amount(balance, currency)?) + to_mesh_api_amount(balance, currency) }) .collect::, MappingError>>() } @@ -129,7 +129,7 @@ fn get_requested_balances( resource_addresses: &[ResourceAddress], ) -> Result, ResponseError> { resource_addresses - .into_iter() + .iter() .map(|resource_address| { let balance = { let encoded_key = scrypto_encode(resource_address).expect("Impossible Case!"); @@ -160,9 +160,9 @@ fn get_requested_balances( }; let currency = to_mesh_api_currency_from_resource_address( - &mapping_context, + mapping_context, database, - &resource_address, + resource_address, )?; Ok(to_mesh_api_amount(balance, currency)?) }) diff --git a/core-rust/mesh-api-server/src/mesh_api/handlers/mempool_transaction.rs b/core-rust/mesh-api-server/src/mesh_api/handlers/mempool_transaction.rs index 949ff1caa9..23de3fe6d8 100644 --- a/core-rust/mesh-api-server/src/mesh_api/handlers/mempool_transaction.rs +++ b/core-rust/mesh-api-server/src/mesh_api/handlers/mempool_transaction.rs @@ -28,10 +28,10 @@ pub(crate) async fn handle_mempool_transaction( )), ); } else { - payload_hashes.get(0).unwrap() + payload_hashes.first().unwrap() }; - let user_transaction = match mempool.get_mempool_payload(¬arized_transaction_hash) { + let user_transaction = match mempool.get_mempool_payload(notarized_transaction_hash) { Some(transaction) => { // Transaction is known to be executable, so it is safe to unwrap here transaction.raw.into_typed().unwrap() @@ -53,7 +53,7 @@ pub(crate) async fn handle_mempool_transaction( UserTransaction::V2(_) => { return Err(ResponseError::from(ApiError::InvalidTransaction) - .with_details(format!("Transaction V2 not supported"))) + .with_details("Transaction V2 not supported".to_string())) } }; diff --git a/core/src/test-core/java/com/radixdlt/api/core/generated/models/TransactionPreviewResponse.java b/core/src/test-core/java/com/radixdlt/api/core/generated/models/TransactionPreviewResponse.java index 6545e61892..ffca0a96af 100644 --- a/core/src/test-core/java/com/radixdlt/api/core/generated/models/TransactionPreviewResponse.java +++ b/core/src/test-core/java/com/radixdlt/api/core/generated/models/TransactionPreviewResponse.java @@ -59,7 +59,7 @@ public class TransactionPreviewResponse { private Object radixEngineToolkitReceipt; public static final String JSON_PROPERTY_INSTRUCTION_RESOURCE_CHANGES = "instruction_resource_changes"; - private List instructionResourceChanges = new ArrayList<>(); + private List instructionResourceChanges = null; public static final String JSON_PROPERTY_LOGS = "logs"; private List logs = new ArrayList<>(); @@ -99,13 +99,13 @@ public TransactionPreviewResponse encodedReceipt(String encodedReceipt) { } /** - * The hex-sbor-encoded receipt. This field is deprecated and will be removed from the API with the release of the next protocol update, cuttlefish. This field was provided primarily for use with the Radix Engine Toolkit and its execution summary functionality. If you still wish to use this functionality update your Radix Engine Toolkit and use the receipt provided in the `radix_engine_toolkit_receipt` field of this response. + * The hex-sbor-encoded receipt. This field is deprecated and will be removed from the API with the release of the next protocol update, cuttlefish. This field was provided primarily for use with the Radix Engine Toolkit and its execution summary functionality. If you still wish to use this functionality update your Radix Engine Toolkit and use the receipt provided in the `radix_engine_toolkit_receipt` field of this response. * @return encodedReceipt * @deprecated **/ @Deprecated @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The hex-sbor-encoded receipt. This field is deprecated and will be removed from the API with the release of the next protocol update, cuttlefish. This field was provided primarily for use with the Radix Engine Toolkit and its execution summary functionality. If you still wish to use this functionality update your Radix Engine Toolkit and use the receipt provided in the `radix_engine_toolkit_receipt` field of this response. ") + @ApiModelProperty(required = true, value = "The hex-sbor-encoded receipt. This field is deprecated and will be removed from the API with the release of the next protocol update, cuttlefish. This field was provided primarily for use with the Radix Engine Toolkit and its execution summary functionality. If you still wish to use this functionality update your Radix Engine Toolkit and use the receipt provided in the `radix_engine_toolkit_receipt` field of this response. ") @JsonProperty(JSON_PROPERTY_ENCODED_RECEIPT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -153,11 +153,11 @@ public TransactionPreviewResponse radixEngineToolkitReceipt(Object radixEngineTo } /** - * An optional field which is only provided if the `radix_engine_toolkit_receipt` flag is set to true when requesting a transaction preview from the API. This receipt is primarily intended for use with the toolkit and may contain information that is already available in the receipt provided in the `receipt` field of this response. A typical client of this API is not expected to use this receipt. The primary clients this receipt is intended for is the Radix wallet or any client that needs to perform execution summaries on their transactions. + * An optional field which is only provided if the `radix_engine_toolkit_receipt` flag is set to true when requesting a transaction preview from the API. This receipt is primarily intended for use with the toolkit and may contain information that is already available in the receipt provided in the `receipt` field of this response. A typical client of this API is not expected to use this receipt. The primary clients this receipt is intended for is the Radix wallet or any client that needs to perform execution summaries on their transactions. * @return radixEngineToolkitReceipt **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An optional field which is only provided if the `radix_engine_toolkit_receipt` flag is set to true when requesting a transaction preview from the API. This receipt is primarily intended for use with the toolkit and may contain information that is already available in the receipt provided in the `receipt` field of this response. A typical client of this API is not expected to use this receipt. The primary clients this receipt is intended for is the Radix wallet or any client that needs to perform execution summaries on their transactions. ") + @ApiModelProperty(value = "An optional field which is only provided if the `radix_engine_toolkit_receipt` flag is set to true when requesting a transaction preview from the API. This receipt is primarily intended for use with the toolkit and may contain information that is already available in the receipt provided in the `receipt` field of this response. A typical client of this API is not expected to use this receipt. The primary clients this receipt is intended for is the Radix wallet or any client that needs to perform execution summaries on their transactions. ") @JsonProperty(JSON_PROPERTY_RADIX_ENGINE_TOOLKIT_RECEIPT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -179,18 +179,23 @@ public TransactionPreviewResponse instructionResourceChanges(List(); + } this.instructionResourceChanges.add(instructionResourceChangesItem); return this; } /** - * Get instructionResourceChanges + * This object holds changes in resource balances for all vaults within affected accounts/components for each instruction. This field is deprecated (and not required) as of the Dugong release and may be removed from the API in the future. * @return instructionResourceChanges + * @deprecated **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @Deprecated + @javax.annotation.Nullable + @ApiModelProperty(value = "This object holds changes in resource balances for all vaults within affected accounts/components for each instruction. This field is deprecated (and not required) as of the Dugong release and may be removed from the API in the future. ") @JsonProperty(JSON_PROPERTY_INSTRUCTION_RESOURCE_CHANGES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getInstructionResourceChanges() { return instructionResourceChanges; @@ -198,7 +203,7 @@ public List getInstructionResourceChanges() { @JsonProperty(JSON_PROPERTY_INSTRUCTION_RESOURCE_CHANGES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstructionResourceChanges(List instructionResourceChanges) { this.instructionResourceChanges = instructionResourceChanges; } diff --git a/sdk/typescript/lib/generated/models/TransactionPreviewResponse.ts b/sdk/typescript/lib/generated/models/TransactionPreviewResponse.ts index e786815111..252351750e 100644 --- a/sdk/typescript/lib/generated/models/TransactionPreviewResponse.ts +++ b/sdk/typescript/lib/generated/models/TransactionPreviewResponse.ts @@ -53,10 +53,10 @@ export interface TransactionPreviewResponse { /** * The hex-sbor-encoded receipt. * - * This field is deprecated and will be removed from the API with the release of the next - * protocol update, cuttlefish. This field was provided primarily for use with the Radix - * Engine Toolkit and its execution summary functionality. If you still wish to use this - * functionality update your Radix Engine Toolkit and use the receipt provided in the + * This field is deprecated and will be removed from the API with the release of the next + * protocol update, cuttlefish. This field was provided primarily for use with the Radix + * Engine Toolkit and its execution summary functionality. If you still wish to use this + * functionality update your Radix Engine Toolkit and use the receipt provided in the * `radix_engine_toolkit_receipt` field of this response. * @type {string} * @memberof TransactionPreviewResponse @@ -73,23 +73,28 @@ export interface TransactionPreviewResponse { * An optional field which is only provided if the `radix_engine_toolkit_receipt` * flag is set to true when requesting a transaction preview from the API. * - * This receipt is primarily intended for use with the toolkit and may contain information - * that is already available in the receipt provided in the `receipt` field of this + * This receipt is primarily intended for use with the toolkit and may contain information + * that is already available in the receipt provided in the `receipt` field of this * response. * - * A typical client of this API is not expected to use this receipt. The primary clients - * this receipt is intended for is the Radix wallet or any client that needs to perform + * A typical client of this API is not expected to use this receipt. The primary clients + * this receipt is intended for is the Radix wallet or any client that needs to perform * execution summaries on their transactions. * @type {object} * @memberof TransactionPreviewResponse */ radix_engine_toolkit_receipt?: object; /** + * This object holds changes in resource balances for all vaults within affected + * accounts/components for each instruction. * + * This field is deprecated (and not required) as of the Dugong release and may be removed + * from the API in the future. * @type {Array} * @memberof TransactionPreviewResponse + * @deprecated */ - instruction_resource_changes: Array; + instruction_resource_changes?: Array; /** * * @type {Array} @@ -106,7 +111,6 @@ export function instanceOfTransactionPreviewResponse(value: object): boolean { isInstance = isInstance && "at_ledger_state" in value; isInstance = isInstance && "encoded_receipt" in value; isInstance = isInstance && "receipt" in value; - isInstance = isInstance && "instruction_resource_changes" in value; isInstance = isInstance && "logs" in value; return isInstance; @@ -126,7 +130,7 @@ export function TransactionPreviewResponseFromJSONTyped(json: any, ignoreDiscrim 'encoded_receipt': json['encoded_receipt'], 'receipt': TransactionReceiptFromJSON(json['receipt']), 'radix_engine_toolkit_receipt': !exists(json, 'radix_engine_toolkit_receipt') ? undefined : json['radix_engine_toolkit_receipt'], - 'instruction_resource_changes': ((json['instruction_resource_changes'] as Array).map(InstructionResourceChangesFromJSON)), + 'instruction_resource_changes': !exists(json, 'instruction_resource_changes') ? undefined : ((json['instruction_resource_changes'] as Array).map(InstructionResourceChangesFromJSON)), 'logs': ((json['logs'] as Array).map(TransactionPreviewResponseLogsInnerFromJSON)), }; } @@ -144,7 +148,7 @@ export function TransactionPreviewResponseToJSON(value?: TransactionPreviewRespo 'encoded_receipt': value.encoded_receipt, 'receipt': TransactionReceiptToJSON(value.receipt), 'radix_engine_toolkit_receipt': value.radix_engine_toolkit_receipt, - 'instruction_resource_changes': ((value.instruction_resource_changes as Array).map(InstructionResourceChangesToJSON)), + 'instruction_resource_changes': value.instruction_resource_changes === undefined ? undefined : ((value.instruction_resource_changes as Array).map(InstructionResourceChangesToJSON)), 'logs': ((value.logs as Array).map(TransactionPreviewResponseLogsInnerToJSON)), }; }