From 4d152b1cff622265d0be6ee5b7eac36db52d65a6 Mon Sep 17 00:00:00 2001 From: julihidalgo <102550772+julihidalgo@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:37:04 -0300 Subject: [PATCH] Update stellar.ts --- src/service/blockchains/stellar.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/service/blockchains/stellar.ts b/src/service/blockchains/stellar.ts index 315e500..ec4c296 100644 --- a/src/service/blockchains/stellar.ts +++ b/src/service/blockchains/stellar.ts @@ -62,14 +62,15 @@ export async function getBalance( */ export let paymentDone: PaymentDone - -export let paymentRealized:boolean +export let pagoProcess:boolean +export let paymentRealized:string export async function createPayment( monto: number, payer: User, beneficiary: string, assetCode: AssetCodes = AssetCodes.XLM, ) { + paymentRealized="proceso" try { let sourceKeys = await StellarSdk.Keypair.fromSecret(payer.privKey); let sourceAcount = await server.loadAccount(payer.pubKey); @@ -94,14 +95,16 @@ export async function createPayment( pruebaArmada.sign(sourceKeys); const pruebaTerminada = await server.submitTransaction(pruebaArmada); console.log(pruebaTerminada); - paymentRealized=true + paymentRealized="hecho" paymentDone ={ amount:monto, destination: beneficiary, }; + pagoProcess=false } catch (err) { console.log('No se pudo completar la transacción'); - paymentRealized=false + paymentRealized="fallido" + pagoProcess=false } }