Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/common/validators/is-valid-address.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function IsValidAddress(validationOptions?: ValidationOptions) {
const srcChain = (args.object as any).srcChain;

if (srcChain === "stellar") {
return typeof value === "string" && value.length === 56;
return typeof value === "string" && /^G[A-Z2-7]{55}$/.test(value);
}

return typeof value === "string" && /^0x[a-fA-F0-9]{40}$/.test(value);
Expand Down
7 changes: 6 additions & 1 deletion src/intents/dto/list-intents.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ export class ListIntentsDto {
@Max(100)
limit!: number;

@ApiPropertyOptional({ description: "Cursor for the next page of intents" })
@IsOptional()
@IsString()
cursor?: string;

@ApiProperty({ minimum: 0, default: 0, description: "Number of results to skip" })
@IsInt()
@Min(0)
offset!: number;
}
}
5 changes: 5 additions & 0 deletions src/solvers/dto/register-solver.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,9 @@ export class RegisterSolverDto {
@IsArray()
@IsString({ each: true })
supportedTokens!: string[];

@ApiProperty({ description: "Proof-of-control signature for the advertised solver address" })
@IsString()
@IsNotEmpty()
proofSignature!: string;
}
7 changes: 6 additions & 1 deletion src/soroban/account-rate-limit.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ export class AccountRateLimitGuard implements CanActivate {

canActivate(context: ExecutionContext): boolean {
const request = context.switchToHttp().getRequest<Request>();
const ip = (request.headers["x-forwarded-for"] as string) || request.ip || "unknown-ip";
const forwarded = request.headers["x-forwarded-for"];
const trustedForwardedIp =
request.ip === "127.0.0.1" && typeof forwarded === "string"
? forwarded.split(",")[0]?.trim()
: undefined;
const ip = trustedForwardedIp || request.ip || "unknown-ip";
const now = Date.now();

const record = this.requestCounts.get(ip);
Expand Down