Skip to content

Commit

Permalink
fix description in changelog and yaml.
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelPawelec-RDX committed Dec 17, 2024
1 parent da62e6d commit 2575ac4
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 49 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Release built: _not released yet_

### API Changes
- Two new filters to `/stream/transactions` endpoint.
- `transaction_status_filter` - Allows filtering by transaction status (`Successful`,`Failed`, `All`). Defaults to `All`.
- `balance_change_resources_filter` - Allows specifying an array of resources. If specified, the response will contain transactions which included non-fee related balance changes for all resources.
- New filters are supported on the `/stream/transactions` endpoint:
- `transaction_status_filter` - Allows filtering by the transaction commit status (`Success`,`Failure`, `All`). Defaults to `All`.
- `balance_change_resources_filter` - Allows filtering to transactions which included non-fee related balance changes for all provided resources. Defaults to `[]`. We recommend integrators use this instead of the `manifest_resources_filter` in most instances.

### Database changes
- New entries added to the `ledger_transaction_markers` table for each resource whose balance (excluding fee-related changes) was modified in a transaction. Each resource balance change will be represented by an entry with the `resource_balance_change` discriminator and the resource's `entity_id`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace RadixDlt.NetworkGateway.Abstractions.Model;

public enum LedgerTransactionStatusFilter
{
Successful,
Failed,
Success,
Failure,
All,
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ public DefaultTransactionHandler(

var statusFilter = request.TransactionStatusFilter switch
{
GatewayModel.StreamTransactionsRequest.TransactionStatusFilterEnum.Successful => LedgerTransactionStatusFilter.Successful,
GatewayModel.StreamTransactionsRequest.TransactionStatusFilterEnum.Failed => LedgerTransactionStatusFilter.Failed,
GatewayModel.StreamTransactionsRequest.TransactionStatusFilterEnum.Success => LedgerTransactionStatusFilter.Success,
GatewayModel.StreamTransactionsRequest.TransactionStatusFilterEnum.Failure => LedgerTransactionStatusFilter.Failure,
_ => LedgerTransactionStatusFilter.All,
};

Expand Down
16 changes: 10 additions & 6 deletions src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ tags:
* `manifest_accounts_deposited_into_filter` - Similar to withdrawn, but will return only transactions with a manifest containing deposits to the given accounts.
* `manifest_resources_filter` - Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage).
* `manifest_resources_filter` - Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage). We recommend that integrators use `balance_change_resources_filter` in most cases, as it also captures resource changes that are not specified in the manifest.
* `manifest_badges_presented_filter` - Allows specifying array of badge resource addresses. If specified, the response will contain only transactions where the given badges were presented.
Expand All @@ -635,6 +635,10 @@ tags:
* `events_filter` - Filters the transaction stream to transactions which emitted at least one event matching each filter (each filter can be satisfied by a different event). Currently *only* deposit and withdrawal events emitted by an internal vault entity are tracked. For the purpose of filtering, the emitter address is replaced by the global ancestor of the emitter, for example, the top-level account / component which contains the vault which emitted the event.
* `balance_change_resources_filter` - Allows filtering to transactions which included non-fee related balance changes for all provided resources. Defaults to `[]`. We recommend that integrators use this instead of the `manifest_resources_filter` in most cases, as it also captures resource changes that are not specified in the manifest.
* `transaction_status_filter` - Allows filtering by the transaction commit status (`Success`,`Failure`, `All`). Defaults to `All`.
Each filter is a complex object where you can specify:
- `event` (required) - the event tag. Currently only the following tags are supported:
* `{"event": "Withdrawal"}` - Filters to "Withdraw" events from fungible and non-fungible vaults
Expand Down Expand Up @@ -4317,7 +4321,7 @@ components:
items:
$ref: "#/components/schemas/Address"
manifest_resources_filter:
description: Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage).
description: Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage). We recommend that integrators use `balance_change_resources_filter` in most cases, as it also captures resource changes that are not specified in the manifest.
type: array
items:
$ref: "#/components/schemas/Address"
Expand Down Expand Up @@ -4358,17 +4362,17 @@ components:
items:
$ref: "#/components/schemas/Address"
balance_change_resources_filter:
description: Allows specifying an array of resources. If specified, the response will contain transactions which included non-fee related balance changes for all resources.
description: Allows filtering to transactions which included non-fee related balance changes for all provided resources. Defaults to `[]`. We recommend that integrators use this instead of the `manifest_resources_filter` in most cases, as it also captures resource changes that are not specified in the manifest.
type: array
items:
$ref: "#/components/schemas/Address"
transaction_status_filter:
description: Allows filtering by transaction status. Defaults to `All`.
description: Allows filtering by the transaction commit status (`Success`,`Failure`, `All`). Defaults to `All`.
type: string
default: All
enum:
- Successful
- Failed
- Success
- Failure
- All
order:
description: Configures the order of returned result set. Defaults to `desc`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,23 @@ public enum KindFilterEnum
[DataMember(Name = "kind_filter", EmitDefaultValue = true)]
public KindFilterEnum? KindFilter { get; set; }
/// <summary>
/// Allows filtering by transaction status. Defaults to &#x60;All&#x60;.
/// Allows filtering by the transaction commit status (&#x60;Success&#x60;,&#x60;Failure&#x60;, &#x60;All&#x60;). Defaults to &#x60;All&#x60;.
/// </summary>
/// <value>Allows filtering by transaction status. Defaults to &#x60;All&#x60;.</value>
/// <value>Allows filtering by the transaction commit status (&#x60;Success&#x60;,&#x60;Failure&#x60;, &#x60;All&#x60;). Defaults to &#x60;All&#x60;.</value>
[JsonConverter(typeof(StringEnumConverter))]
public enum TransactionStatusFilterEnum
{
/// <summary>
/// Enum Successful for value: Successful
/// Enum Success for value: Success
/// </summary>
[EnumMember(Value = "Successful")]
Successful = 1,
[EnumMember(Value = "Success")]
Success = 1,

/// <summary>
/// Enum Failed for value: Failed
/// Enum Failure for value: Failure
/// </summary>
[EnumMember(Value = "Failed")]
Failed = 2,
[EnumMember(Value = "Failure")]
Failure = 2,

/// <summary>
/// Enum All for value: All
Expand All @@ -158,9 +158,9 @@ public enum TransactionStatusFilterEnum


/// <summary>
/// Allows filtering by transaction status. Defaults to &#x60;All&#x60;.
/// Allows filtering by the transaction commit status (&#x60;Success&#x60;,&#x60;Failure&#x60;, &#x60;All&#x60;). Defaults to &#x60;All&#x60;.
/// </summary>
/// <value>Allows filtering by transaction status. Defaults to &#x60;All&#x60;.</value>
/// <value>Allows filtering by the transaction commit status (&#x60;Success&#x60;,&#x60;Failure&#x60;, &#x60;All&#x60;). Defaults to &#x60;All&#x60;.</value>
[DataMember(Name = "transaction_status_filter", EmitDefaultValue = true)]
public TransactionStatusFilterEnum? TransactionStatusFilter { get; set; }
/// <summary>
Expand Down Expand Up @@ -202,15 +202,15 @@ public enum OrderEnum
/// <param name="manifestAccountsWithdrawnFromFilter">Allows specifying an array of account addresses. If specified, the response will contain only transactions with a manifest containing withdrawals from the given accounts..</param>
/// <param name="manifestAccountsDepositedIntoFilter">Similar to &#x60;manifest_accounts_withdrawn_from_filter&#x60;, but will return only transactions with a manifest containing deposits to the given accounts..</param>
/// <param name="manifestBadgesPresentedFilter">Allows specifying array of badge resource addresses. If specified, the response will contain only transactions where the given badges were presented..</param>
/// <param name="manifestResourcesFilter">Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage)..</param>
/// <param name="manifestResourcesFilter">Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage). We recommend that integrators use &#x60;balance_change_resources_filter&#x60; in most cases, as it also captures resource changes that are not specified in the manifest..</param>
/// <param name="affectedGlobalEntitiesFilter">Allows specifying an array of global addresses. If specified, the response will contain transactions that affected all of the given global entities. A global entity is marked as \&quot;affected\&quot; by a transaction if any of its state (or its descendents&#39; state) was modified as a result of the transaction. For performance reasons consensus manager and transaction tracker are excluded from that filter..</param>
/// <param name="eventsFilter">Filters the transaction stream to transactions which emitted at least one event matching each filter (each filter can be satisfied by a different event). Currently *only* deposit and withdrawal events emitted by an internal vault entity are tracked. For the purpose of filtering, the emitter address is replaced by the global ancestor of the emitter, for example, the top-level account / component which contains the vault which emitted the event..</param>
/// <param name="accountsWithManifestOwnerMethodCalls">Allows specifying an array of account addresses. If specified, the response will contain only transactions that, for all specified accounts, contain manifest method calls to that account which require the owner role. See the [account docs](https://docs.radixdlt.com/docs/account) for more information..</param>
/// <param name="accountsWithoutManifestOwnerMethodCalls">Allows specifying an array of account addresses. If specified, the response will contain only transactions that, for all specified accounts, do NOT contain manifest method calls to that account which require owner role. See the [account docs](https://docs.radixdlt.com/docs/account) for more information..</param>
/// <param name="manifestClassFilter">manifestClassFilter.</param>
/// <param name="eventGlobalEmittersFilter">Allows specifying an array of global addresses. If specified, the response will contain transactions in which all entities emitted events. If an event was published by an internal entity, it is going to be indexed as it is a global ancestor. For performance reasons events published by consensus manager and native XRD resource are excluded from that filter..</param>
/// <param name="balanceChangeResourcesFilter">Allows specifying an array of resources. If specified, the response will contain transactions which included non-fee related balance changes for all resources..</param>
/// <param name="transactionStatusFilter">Allows filtering by transaction status. Defaults to &#x60;All&#x60;. (default to TransactionStatusFilterEnum.All).</param>
/// <param name="balanceChangeResourcesFilter">Allows filtering to transactions which included non-fee related balance changes for all provided resources. Defaults to &#x60;[]&#x60;. We recommend that integrators use this instead of the &#x60;manifest_resources_filter&#x60; in most cases, as it also captures resource changes that are not specified in the manifest..</param>
/// <param name="transactionStatusFilter">Allows filtering by the transaction commit status (&#x60;Success&#x60;,&#x60;Failure&#x60;, &#x60;All&#x60;). Defaults to &#x60;All&#x60;. (default to TransactionStatusFilterEnum.All).</param>
/// <param name="order">Configures the order of returned result set. Defaults to &#x60;desc&#x60;..</param>
/// <param name="optIns">optIns.</param>
public StreamTransactionsRequest(LedgerStateSelector atLedgerState = default(LedgerStateSelector), LedgerStateSelector fromLedgerState = default(LedgerStateSelector), string cursor = default(string), int? limitPerPage = default(int?), KindFilterEnum? kindFilter = default(KindFilterEnum?), List<string> manifestAccountsWithdrawnFromFilter = default(List<string>), List<string> manifestAccountsDepositedIntoFilter = default(List<string>), List<string> manifestBadgesPresentedFilter = default(List<string>), List<string> manifestResourcesFilter = default(List<string>), List<string> affectedGlobalEntitiesFilter = default(List<string>), List<StreamTransactionsRequestEventFilterItem> eventsFilter = default(List<StreamTransactionsRequestEventFilterItem>), List<string> accountsWithManifestOwnerMethodCalls = default(List<string>), List<string> accountsWithoutManifestOwnerMethodCalls = default(List<string>), StreamTransactionsRequestAllOfManifestClassFilter manifestClassFilter = default(StreamTransactionsRequestAllOfManifestClassFilter), List<string> eventGlobalEmittersFilter = default(List<string>), List<string> balanceChangeResourcesFilter = default(List<string>), TransactionStatusFilterEnum? transactionStatusFilter = TransactionStatusFilterEnum.All, OrderEnum? order = default(OrderEnum?), TransactionDetailsOptIns optIns = default(TransactionDetailsOptIns))
Expand Down Expand Up @@ -284,9 +284,9 @@ public enum OrderEnum
public List<string> ManifestBadgesPresentedFilter { get; set; }

/// <summary>
/// Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage).
/// Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage). We recommend that integrators use &#x60;balance_change_resources_filter&#x60; in most cases, as it also captures resource changes that are not specified in the manifest.
/// </summary>
/// <value>Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage).</value>
/// <value>Allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage). We recommend that integrators use &#x60;balance_change_resources_filter&#x60; in most cases, as it also captures resource changes that are not specified in the manifest.</value>
[DataMember(Name = "manifest_resources_filter", EmitDefaultValue = true)]
public List<string> ManifestResourcesFilter { get; set; }

Expand Down Expand Up @@ -332,9 +332,9 @@ public enum OrderEnum
public List<string> EventGlobalEmittersFilter { get; set; }

/// <summary>
/// Allows specifying an array of resources. If specified, the response will contain transactions which included non-fee related balance changes for all resources.
/// Allows filtering to transactions which included non-fee related balance changes for all provided resources. Defaults to &#x60;[]&#x60;. We recommend that integrators use this instead of the &#x60;manifest_resources_filter&#x60; in most cases, as it also captures resource changes that are not specified in the manifest.
/// </summary>
/// <value>Allows specifying an array of resources. If specified, the response will contain transactions which included non-fee related balance changes for all resources.</value>
/// <value>Allows filtering to transactions which included non-fee related balance changes for all provided resources. Defaults to &#x60;[]&#x60;. We recommend that integrators use this instead of the &#x60;manifest_resources_filter&#x60; in most cases, as it also captures resource changes that are not specified in the manifest.</value>
[DataMember(Name = "balance_change_resources_filter", EmitDefaultValue = true)]
public List<string> BalanceChangeResourcesFilter { get; set; }

Expand Down
Loading

0 comments on commit 2575ac4

Please sign in to comment.