Documentación

Guía del proyecto Bitpanda Explorer

Estructura del Proyecto
BitpandaExplorer/
├── Program.cs            # Punto de entrada + DI
├── Controllers/          # Controladores MVC
│   ├── HomeController    # Dashboard + Settings
│   ├── TickerController  # Precios (público)
│   ├── WalletsController # Wallets (privado)
│   ├── TradesController  # Trades
│   └── TransactionsController
├── Models/               # Modelos de datos
│   ├── Ticker/          
│   ├── Wallet/          
│   ├── Trade/           
│   └── Transaction/     
├── Services/             # Lógica de negocio
│   ├── IBitpandaService # Interfaz
│   └── BitpandaService  # Implementación
└── Views/                # Vistas Razor
Conceptos Clave
1. Dependency Injection

Los servicios se registran en Program.cs y se inyectan en constructores:

// Registro en Program.cs
builder.Services.AddSingleton<IBitpandaService, BitpandaService>();

// Inyección en Controller
public HomeController(IBitpandaService service)
{
    _service = service;
}
2. Async/Await

Operaciones asíncronas para no bloquear threads:

public async Task<IActionResult> Index()
{
    var data = await _service.GetTickerAsync();
    return View(data);
}
3. Patrón MVC
  • Model: Datos (clases en /Models)
  • View: Presentación (.cshtml)
  • Controller: Lógica de peticiones
4. Interfaces

Definen contratos que las implementaciones deben cumplir:

public interface IBitpandaService
{
    Task<TickerViewModel> GetTickerAsync();
}

public class BitpandaService : IBitpandaService
{
    // Implementación...
}
API de Bitpanda
Endpoint Auth Descripción
GET /ticker Público Precios actuales
GET /wallets API Key Wallets crypto
GET /fiatwallets API Key Wallets fiat
GET /trades API Key Historial trades
GET /wallets/transactions API Key Transacciones

Base URL: https://api.bitpanda.com/v1
Auth Header: X-Api-Key: YOUR_KEY
Docs: developers.bitpanda.com