|
1 | | -import { ApiExtraModels, ApiProperty, getSchemaPath } from '@nestjs/swagger'; |
| 1 | +import { |
| 2 | + ApiExtraModels, |
| 3 | + ApiProperty, |
| 4 | + getSchemaPath, |
| 5 | + OmitType, |
| 6 | +} from '@nestjs/swagger'; |
2 | 7 | import { PerpTradesSide } from '../../enums/perp.enum'; |
3 | 8 | import { |
4 | 9 | ActiveAssetPerpEvent, |
| 10 | + ActiveAssetsPerpEvent, |
5 | 11 | ActiveSpotAssetPerpEvent, |
| 12 | + ActiveSpotAssetsPerpEvent, |
6 | 13 | L2BookPerpEvent, |
7 | 14 | TradesPerpEvent, |
8 | 15 | } from './request'; |
| 16 | +import { PerpCoinExtendedSlim, PerpSpotCoinExtendedSlim } from './coins'; |
| 17 | +import { MarginTable } from './margin-table'; |
9 | 18 |
|
10 | 19 | export class L2BookPerpResponseSingle { |
11 | 20 | @ApiProperty() |
@@ -96,15 +105,41 @@ export class ActivePerpAssetCtx extends AssetCtxCommon { |
96 | 105 | impactTxs!: string[]; |
97 | 106 | } |
98 | 107 |
|
| 108 | +export class ActivePerpAssetCtxFull extends ActivePerpAssetCtx { |
| 109 | + @ApiProperty() |
| 110 | + maxLeverage!: number; |
| 111 | + |
| 112 | + @ApiProperty() |
| 113 | + marginTableId!: number; |
| 114 | +} |
| 115 | + |
| 116 | +export class ActivePerpAssetCtxHydrated extends OmitType( |
| 117 | + ActivePerpAssetCtxFull, |
| 118 | + ['marginTableId'] as const, |
| 119 | +) { |
| 120 | + marginTable!: MarginTable; |
| 121 | +} |
| 122 | + |
99 | 123 | export class ActiveSpotAssetPerpResponse extends ActiveSpotAssetPerpEvent { |
100 | 124 | @ApiProperty() |
101 | 125 | ctx!: ActiveSpotAssetCtx; |
102 | 126 | } |
| 127 | + |
103 | 128 | export class ActiveAssetPerpResponse extends ActiveAssetPerpEvent { |
104 | 129 | @ApiProperty() |
105 | 130 | ctx!: ActivePerpAssetCtx; |
106 | 131 | } |
107 | 132 |
|
| 133 | +export class ActiveSpotAssetsPerpResponse extends ActiveSpotAssetsPerpEvent { |
| 134 | + @ApiProperty() |
| 135 | + tokens!: PerpSpotCoinExtendedSlim[]; |
| 136 | +} |
| 137 | + |
| 138 | +export class ActiveAssetsPerpResponse extends ActiveAssetsPerpEvent { |
| 139 | + @ApiProperty() |
| 140 | + tokens!: PerpCoinExtendedSlim[]; |
| 141 | +} |
| 142 | + |
108 | 143 | @ApiExtraModels( |
109 | 144 | L2BookPerpResponse, |
110 | 145 | TradesPerpResponse, |
|
0 commit comments