Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
project: ['tsconfig.json', 'tsconfig.test.json'],
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', 'import'],
Expand Down Expand Up @@ -32,6 +32,7 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-unused-vars": "off",
"import/no-relative-parent-imports": "error",
},
};
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@nestjs/config": "^3.1.1",
"@nestjs/core": "^10.3.0",
"@nestjs/cqrs": "^11.0.3",
"@nestjs/elasticsearch": "^11.1.0",
"@nestjs/event-emitter": "^3.0.1",
"@nestjs/mapped-types": "*",
"@nestjs/passport": "^10.0.3",
Expand Down
2 changes: 2 additions & 0 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ import { KycGuard } from "./common/guard/kyc.guard";
import { StrategyAuthGuard } from "./core/auth/guards/strategy-auth.guard";
import { GlobalExceptionFilter } from "./common/filters/global-exception.filter";
import { SubmissionVerifierService } from "./blockchain/oracle/submission-verifier.service";
import { SearchModule } from "./search/search.module";
import { LoggingMiddleware } from "./common/middleware/logging.middleware";
import { ProfilingMiddleware } from "./profiling/profiling.middleware";
import { GraphqlGatewayModule } from "./graphql/graphql.module";
Expand Down Expand Up @@ -251,6 +252,7 @@ import { TenantModuleState } from "./modules/registry/entities/tenant-module-sta
ProfilingModule,
EmailModule,
AgentReviewsModule,
SearchModule,
GraphqlGatewayModule,
WebhookModule,
FileUploadModule,
Expand Down
82 changes: 67 additions & 15 deletions src/blockchain/oracle/dto/payload-response.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,95 @@ import { PayloadStatus, PayloadType } from "../entities/signed-payload.entity";
* Response DTO for payload operations
*/
export class PayloadResponseDto {
@ApiProperty({ description: "Unique payload UUID", example: "a1b2c3d4-1234-5678-90ef-ghijklmnopqr" })
@ApiProperty({
description: "Unique payload UUID",
example: "a1b2c3d4-1234-5678-90ef-ghijklmnopqr",
})
id: string;

@ApiProperty({ description: "Type of payload", enum: PayloadType, example: PayloadType.PRICE_FEED })
@ApiProperty({
description: "Type of payload",
enum: PayloadType,
example: PayloadType.PRICE_FEED,
})
payloadType: PayloadType;

@ApiProperty({ description: "Ethereum address that signed this payload", example: "0xAbCd1234567890abcdef1234567890abcdef1234" })
@ApiProperty({
description: "Ethereum address that signed this payload",
example: "0xAbCd1234567890abcdef1234567890abcdef1234",
})
signerAddress: string;

@ApiProperty({ description: "Submission nonce", example: "42" })
nonce: string;

@ApiProperty({ description: "Raw payload data", type: "object", example: { token: "ETH", price: 3200.5 } })
@ApiProperty({
description: "Raw payload data",
type: "object",
example: { token: "ETH", price: 3200.5 },
})
payload: Record<string, any>;

@ApiProperty({ description: "Keccak256 hash of the payload", example: "0xabc123..." })
@ApiProperty({
description: "Keccak256 hash of the payload",
example: "0xabc123...",
})
payloadHash: string;

@ApiProperty({ description: "EIP-712 structured data hash", example: "0xdef456..." })
@ApiProperty({
description: "EIP-712 structured data hash",
example: "0xdef456...",
})
structuredDataHash: string;

@ApiPropertyOptional({ description: "ECDSA signature (0x-prefixed, 132 chars)", nullable: true, example: "0x..." })
@ApiPropertyOptional({
description: "ECDSA signature (0x-prefixed, 132 chars)",
nullable: true,
example: "0x...",
})
signature: string | null;

@ApiProperty({ description: "Payload expiry timestamp" })
expiresAt: Date;

@ApiProperty({ description: "Current submission status", enum: PayloadStatus, example: PayloadStatus.PENDING })
@ApiProperty({
description: "Current submission status",
enum: PayloadStatus,
example: PayloadStatus.PENDING,
})
status: PayloadStatus;

@ApiPropertyOptional({ description: "On-chain transaction hash after submission", nullable: true, example: "0x..." })
@ApiPropertyOptional({
description: "On-chain transaction hash after submission",
nullable: true,
example: "0x...",
})
transactionHash: string | null;

@ApiPropertyOptional({ description: "Block number when confirmed on-chain", nullable: true, example: "18500000" })
@ApiPropertyOptional({
description: "Block number when confirmed on-chain",
nullable: true,
example: "18500000",
})
blockNumber: string | null;

@ApiProperty({ description: "Total number of submission attempts", example: 1 })
@ApiProperty({
description: "Total number of submission attempts",
example: 1,
})
submissionAttempts: number;

@ApiPropertyOptional({ description: "Error message if submission failed", nullable: true })
@ApiPropertyOptional({
description: "Error message if submission failed",
nullable: true,
})
errorMessage: string | null;

@ApiPropertyOptional({ description: "Optional metadata", nullable: true, type: "object" })
@ApiPropertyOptional({
description: "Optional metadata",
nullable: true,
type: "object",
})
metadata: Record<string, any> | null;

@ApiProperty({ description: "Record creation timestamp" })
Expand All @@ -56,9 +102,15 @@ export class PayloadResponseDto {
@ApiProperty({ description: "Record last-updated timestamp" })
updatedAt: Date;

@ApiPropertyOptional({ description: "When submitted to blockchain", nullable: true })
@ApiPropertyOptional({
description: "When submitted to blockchain",
nullable: true,
})
submittedAt: Date | null;

@ApiPropertyOptional({ description: "When confirmed on-chain", nullable: true })
@ApiPropertyOptional({
description: "When confirmed on-chain",
nullable: true,
})
confirmedAt: Date | null;
}
6 changes: 4 additions & 2 deletions src/blockchain/oracle/dto/sign-payload.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ export class SignPayloadDto {
payloadId: string;

@ApiProperty({
description: "Ethereum private key (0x-prefixed, 64 hex chars). NOTE: use client-side signing in production.",
example: "0x4c0883a69102937d6231471b5dbb6e538eba2ef68e5fd63f36fe1ef7e9bb4d7f",
description:
"Ethereum private key (0x-prefixed, 64 hex chars). NOTE: use client-side signing in production.",
example:
"0x4c0883a69102937d6231471b5dbb6e538eba2ef68e5fd63f36fe1ef7e9bb4d7f",
pattern: "^0x[a-fA-F0-9]{64}$",
})
@IsString()
Expand Down
Loading
Loading