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")
}
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) {
throw new Error("swap quote not found")
}

View file

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