This commit is contained in:
boufni95 2025-12-03 15:40:10 +00:00
parent 338414e3d3
commit bf26e2ba83
2 changed files with 3 additions and 3 deletions

View file

@ -459,7 +459,7 @@ export default class {
throw new Error("request a swap quote before payng an external address") throw new Error("request a swap quote before payng an external address")
} }
const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) const app = await this.storage.applicationStorage.GetApplication(ctx.app_id)
const txSwap = await this.storage.paymentStorage.GetTransactionSwap(req.swap_operation_id) const txSwap = await this.storage.paymentStorage.GetTransactionSwap(req.swap_operation_id, ctx.app_user_id)
if (!txSwap) { if (!txSwap) {
throw new Error("swap quote not found") throw new Error("swap quote not found")
} }

View file

@ -466,8 +466,8 @@ export default class {
return this.dbs.CreateAndSave<TransactionSwap>('TransactionSwap', swap) return this.dbs.CreateAndSave<TransactionSwap>('TransactionSwap', swap)
} }
async GetTransactionSwap(swapOperationId: string, txId?: string) { async GetTransactionSwap(swapOperationId: string, appUserId: string, txId?: string) {
return this.dbs.FindOne<TransactionSwap>('TransactionSwap', { where: { swap_operation_id: swapOperationId, used: false } }, txId) return this.dbs.FindOne<TransactionSwap>('TransactionSwap', { where: { swap_operation_id: swapOperationId, used: false, app_user_id: appUserId } }, txId)
} }
async FinalizeTransactionSwap(swapOperationId: string, txId: string) { async FinalizeTransactionSwap(swapOperationId: string, txId: string) {