Skip to content

Conversation

@Yek666
Copy link

@Yek666 Yek666 commented Sep 30, 2025

transferencia

Purpose

Describe the intention of the changes being proposed. What problem does it solve or functionality does it add?

Does this introduce a breaking change?

When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.

[ ] Yes
[ ] No

Does this require changes to learn.microsoft.com docs or modules?

which includes deployment, settings and usage instructions.

[ ] Yes
[ ] No

Type of change

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

Copy link
Author

@Yek666 Yek666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import React, { useState } from 'react';
import { View, TextInput, Button, Text } from 'react-native';
import { ethers } from 'ethers';
import { useWalletConnect, withWalletConnect } from '@walletconnect/react-native-dapp';
import 'react-native-url-polyfill/auto';

const USDT_CONTRACT = '0xdAC17F958D2ee523a2206206994597C13D831ec7';
const ABI = ['function transfer(address to, uint amount) public returns (bool)'];

function App() {
const connector = useWalletConnect();
const [amount, setAmount] = useState('');
const [destination, setDestination] = useState('');
const [hash, setHash] = useState('');
const [status, setStatus] = useState('');

const transferUSDT = async () => {
try {
const provider = new ethers.providers.Web3Provider(connector);
const signer = provider.getSigner();
const contract = new ethers.Contract(USDT_CONTRACT, ABI, signer);
const amountInUnits = ethers.BigNumber.from(amount).mul(ethers.BigNumber.from('1000000'));
const tx = await contract.transfer(destination, amountInUnits);
setHash(tx.hash);
setStatus('Transacción enviada. Verificando...');
verifyTransaction(tx.hash);
} catch (err) {
setStatus(Error: ${err.message});
}
};

const verifyTransaction = async (hash) => {
const url = https://api.etherscan.io/api?module=transaction&action=gettxreceiptstatus&txhash=${hash}&apikey=TU_API_KEY;
for (let i = 0; i < 10; i++) {
const res = await fetch(url);
const data = await res.json();
if (data.result?.status === '1') {
setStatus('✅ Confirmada en blockchain');
return;
}
await new Promise(r => setTimeout(r, 10000));
}
setStatus('⚠️ No confirmada aún');
};

return (
<View style={{ padding: 20 }}>
{!connector.connected ? (
<Button title="Conectar MetaMask" onPress={() => connector.connect()} />
) : (
<>



Hash: {hash}
{status}
</>
)}

);
}

export default withWalletConnect(App, {
redirectUrl: Platform.OS === 'web' ? window.location.origin : 'yourappscheme://',
storageOptions: {
asyncStorage: null,
},
});

import TransferForm from './TransferForm';

function App() {
  return (
      <div className="App">
            <TransferForm />
                </div>
                  );
                  }

                  export default App;
Copy link
Author

@Yek666 Yek666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InputField (1).css

Copy link
Author

@Yek666 Yek666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
"expo": {
"name": "WorldcoinTransfer",
"slug": "worldcoin-transfer",
"scheme": "worldcointransfer",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"android": {
"package": "com.eduar.worldcointransfer"
}
}
}

@leestott leestott closed this Sep 30, 2025
Copy link
Author

@Yek666 Yek666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require('dotenv').config();
const TelegramBot = require('node-telegram-bot-api');
const bot = new TelegramBot(process.env.TELEGRAM_TOKEN, { polling: true });

const { escanearTON } = require('./embalada-ton');
const { consultarSaldo } = require('./embalada-mercadopago');
const { consultarMovimientos } = require('./embalada-bbva');
const { validarIngreso } = require('./embalada-validacion');
const PDFDocument = require('pdfkit');
const fs = require('fs');

// /hola
bot.onText(//hola/, (msg) => {
bot.sendMessage(msg.chat.id, '👋 Hola Eduar, el bot está vivo.');
});

// /estado_all
bot.onText(//estado_all/, async (msg) => {
const chatId = msg.chat.id;
try {
const datosTON = await escanearTON(process.env.TON_ADDRESS);
const saldoMP = await consultarSaldo();
const movimientosBBVA = await consultarMovimientos();
const ultimosBBVA = movimientosBBVA.slice(0, 3).map(m => • ${m.amount} ${m.currency} - ${m.description}).join('\n');

bot.sendMessage(chatId, `📊 Estado Consolidado

🔹 TON Wallet
Balance: ${datosTON.balanceTON} TON
Transacciones: ${datosTON.transacciones.length}

🔹 Mercado Pago
Saldo disponible: $${saldoMP.available_balance}

🔹 BBVA
Últimos movimientos:
${ultimosBBVA}`);
} catch (err) {
bot.sendMessage(chatId, '❌ Error en /estado_all: ' + err.message);
}
});

// /validar_ingreso
bot.onText(//validar_ingreso (.+)/, (msg, match) => {
const chatId = msg.chat.id;
const [origen, monto, ...comentarioArr] = match[1].split(' ');
const comentario = comentarioArr.join(' ');
const alertas = validarIngreso({ origen, monto: parseFloat(monto), comentario });
if (alertas.length === 0) {
bot.sendMessage(chatId, '✅ Ingreso validado correctamente');
} else {
bot.sendMessage(chatId, 🚨 Alertas detectadas:\n${alertas.join('\n')});
}
});

// /exportar_all_pdf
bot.onText(//exportar_all_pdf/, async (msg) => {
const chatId = msg.chat.id;
try {
const datosTON = await escanearTON(process.env.TON_ADDRESS);
const saldoMP = await consultarSaldo();
const movimientosBBVA = await consultarMovimientos();

const doc = new PDFDocument();
const filename = `estado_all_${Date.now()}.pdf`;
doc.pipe(fs.createWriteStream(filename));

doc.fontSize(20).text('📊 Informe Consolidado de Activos', { align: 'center' });
doc.moveDown();

doc.fontSize(16).text('🔹 TON Wallet');
doc.fontSize(12).text(`Dirección: ${datosTON.direccion}`);
doc.text(`Balance: ${datosTON.balanceTON} TON`);
doc.text(`Tokens: ${JSON.stringify(datosTON.tokens)}`);
doc.moveDown();
doc.text('Últimas transacciones:');
datosTON.transacciones.slice(0, 5).forEach(tx => {
  doc.text(`• ${JSON.stringify(tx)}`);
});
doc.moveDown();

doc.fontSize(16).text('🔹 Mercado Pago');
doc.fontSize(12).text(`Saldo disponible: $${saldoMP.available_balance}`);
doc.moveDown();

doc.fontSize(16).text('🔹 BBVA');
movimientosBBVA.slice(0, 5).forEach(m => {
  doc.fontSize(12).text(`• ${m.amount} ${m.currency} - ${m.description}`);
});

doc.end();

doc.on('finish', async () => {
  await bot.sendDocument(chatId, { source: filename });
  fs.unlinkSync(filename);
});

} catch (err) {
bot.sendMessage(chatId, '❌ Error exportando PDF: ' + err.message);
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants