Skip to content

Commit

Permalink
fix: output the correct tx info type in swagger (#2128)
Browse files Browse the repository at this point in the history
  • Loading branch information
compojoom authored Nov 15, 2024
1 parent 461ba00 commit f90e62d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
} from '@/routes/transactions/entities/transaction-info.entity';

export class CreationTransactionInfo extends TransactionInfo {
@ApiProperty({ enum: [TransactionInfoType.Creation] })
override type = TransactionInfoType.Creation;
@ApiProperty()
creator: AddressInfo;
@ApiProperty()
Expand Down
2 changes: 2 additions & 0 deletions src/routes/transactions/entities/custom-transaction.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
} from '@/routes/transactions/entities/transaction-info.entity';

export class CustomTransactionInfo extends TransactionInfo {
@ApiProperty({ enum: [TransactionInfoType.Custom] })
override type = TransactionInfoType.Custom;
@ApiProperty()
to: AddressInfo;
@ApiProperty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
} from '@/routes/transactions/entities/transaction-info.entity';

export class SettingsChangeTransaction extends TransactionInfo {
@ApiProperty({ enum: [TransactionInfoType.SettingsChange] })
override type = TransactionInfoType.SettingsChange;
@ApiProperty()
dataDecoded: DataDecoded;
@ApiPropertyOptional({ type: SettingsChange, nullable: true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export enum TransferDirection {
}

export class TransferTransactionInfo extends TransactionInfo {
@ApiProperty({ enum: [TransactionInfoType.Transfer] })
override type = TransactionInfoType.Transfer;
@ApiProperty()
sender: AddressInfo;
@ApiProperty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export class SwapTransferTransactionInfo
extends TransactionInfo
implements TransferTransactionInfo, SwapOrderTransactionInfo
{
@ApiProperty({ enum: [TransactionInfoType.SwapTransfer] })
override type = TransactionInfoType.SwapTransfer;

// TransferTransactionInfo properties
@ApiProperty()
sender: AddressInfo;
Expand Down

0 comments on commit f90e62d

Please sign in to comment.