diff --git a/src/modules/accounts/dto/create-account.dto.ts b/src/modules/accounts/dto/create-account.dto.ts index 717d893..ab34fc4 100644 --- a/src/modules/accounts/dto/create-account.dto.ts +++ b/src/modules/accounts/dto/create-account.dto.ts @@ -50,11 +50,11 @@ export class CreateAccountDto { @ApiProperty({ example: 2592000, - description: 'Expiry in seconds (1 hour - 30 days)', + description: 'Expiry in seconds (1 hour - 90 days)', }) @IsNumber() @Min(3600) // 1 hour - @Max(2592000) // 30 days + @Max(7776000) // 90 days expiresIn: number; @ApiProperty({ example: { userId: 'user_123' }, required: false }) diff --git a/src/modules/stellar/stellar.service.ts b/src/modules/stellar/stellar.service.ts index 95a971e..632c35c 100644 --- a/src/modules/stellar/stellar.service.ts +++ b/src/modules/stellar/stellar.service.ts @@ -117,6 +117,12 @@ export class StellarService { // Step 2: Initialize the Soroban contract with restrictions const expiryLedger = await this.toExpiryLedger(params.expiresIn); + this.logger.log( + `Expiry conversion: expiresIn=${params.expiresIn}s → expiryLedger=${expiryLedger} ` + + `(currentLedger=${Math.round(expiryLedger - Math.ceil(params.expiresIn / 5) - EXPIRY_BUFFER_LEDGERS)}, ` + + `offset=${expiryLedger - Math.round(expiryLedger - Math.ceil(params.expiresIn / 5) - EXPIRY_BUFFER_LEDGERS)} ledgers)`, + ); + const contract = new StellarSdk.Contract(params.contractId); const sourceAccount = await this.sorobanServer.getAccount( fundingKeypair.publicKey(),