apiVersion: v1
kind: ConfigMap
metadata:
  name: blockscout-metamask-config
  namespace: besu-network
data:
  # CORS configuration for MetaMask Portfolio
  CORS_ALLOWED_ORIGINS: "https://portfolio.metamask.io,https://metamask.io,https://chainlist.org"
  ENABLE_CORS: "true"
  
  # Token metadata API configuration
  ENABLE_TOKEN_METADATA_API: "true"
  TOKEN_METADATA_CACHE_ENABLED: "true"
  TOKEN_METADATA_CACHE_TTL: "3600"
  
  # Logo serving configuration
  ENABLE_TOKEN_LOGO_SERVING: "true"
  TOKEN_LOGO_BASE_URL: "https://explorer.d-bis.org/images/tokens"
  
  # API rate limiting for Portfolio
  API_RATE_LIMIT_ENABLED: "true"
  API_RATE_LIMIT_PER_MINUTE: "120"
---
# Update Blockscout deployment to use these settings
# Add to Blockscout deployment env:
# - name: CORS_ALLOWED_ORIGINS
#   valueFrom:
#     configMapKeyRef:
#       name: blockscout-metamask-config
#       key: CORS_ALLOWED_ORIGINS
# - name: ENABLE_CORS
#   valueFrom:
#     configMapKeyRef:
#       name: blockscout-metamask-config
#       key: ENABLE_CORS

