# Wallet Orchestration Service

This service is responsible for:
- wallet generation
- blockchain monitoring
- provider integrations
- transaction broadcasting
- webhook handling

It is NOT responsible for:
- user balances
- accounting
- business ledger logic

## Provider Architecture

Each provider must follow this structure:

providers/
  alchemy/
  blink/
  tokenview/

Each provider should expose:
- client
- webhook handler
- DTOs
- normalization logic

## Deposit Event Standard

All providers must normalize deposits into this shape:

```json
{
  "provider": "",
  "network": "",
  "asset": "",
  "address": "",
  "amount": "",
  "tx_hash": "",
  "reference": "",
  "status": ""
}
```

Laravel should receive normalized payloads only.

## Webhook Rules

Webhook handlers must:
- verify authenticity
- respond quickly
- avoid heavy synchronous processing
- enqueue long-running jobs

## Idempotency

Use:
- tx_hash + log_index
OR
- provider_reference

as unique processing keys.

## Alchemy Rules

Alchemy is used ONLY for:
- RPC
- deposit monitoring
- blockchain queries

Alchemy is NOT used for:
- wallet generation
- custody
- transaction signing

## Blink Rules

Blink is used ONLY for:
- Lightning invoice creation
- Lightning payment monitoring

Lightning deposits are invoice-based, not address-based.