{"id":37279990,"url":"https://github.com/tron-energy-market/tronzap-sdk-python","last_synced_at":"2026-03-04T14:01:08.470Z","repository":{"id":285766523,"uuid":"959161557","full_name":"tron-energy-market/tronzap-sdk-python","owner":"tron-energy-market","description":"Tron Energy Rental - Python SDK for TronZap API","archived":false,"fork":false,"pushed_at":"2025-12-11T13:14:21.000Z","size":81,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-10T22:33:09.684Z","etag":null,"topics":["blockchain","buy-energy","buy-tron-energy","buy-trx-energy","tron-api","tron-blockchain","tron-energy","tron-energy-api","tron-energy-leasing","tronlink","trx-energy","trx-energy-rental"],"latest_commit_sha":null,"homepage":"https://tronzap.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tron-energy-market.png","metadata":{"files":{"readme":"README.es.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-02T11:14:29.000Z","updated_at":"2025-12-11T13:14:08.000Z","dependencies_parsed_at":"2025-04-02T15:44:32.311Z","dependency_job_id":null,"html_url":"https://github.com/tron-energy-market/tronzap-sdk-python","commit_stats":null,"previous_names":["tron-energy-market/tronzap-sdk-python"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tron-energy-market/tronzap-sdk-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tron-energy-market%2Ftronzap-sdk-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tron-energy-market%2Ftronzap-sdk-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tron-energy-market%2Ftronzap-sdk-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tron-energy-market%2Ftronzap-sdk-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tron-energy-market","download_url":"https://codeload.github.com/tron-energy-market/tronzap-sdk-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tron-energy-market%2Ftronzap-sdk-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30082995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T13:22:36.021Z","status":"ssl_error","status_checked_at":"2026-03-04T13:20:45.750Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","buy-energy","buy-tron-energy","buy-trx-energy","tron-api","tron-blockchain","tron-energy","tron-energy-api","tron-energy-leasing","tronlink","trx-energy","trx-energy-rental"],"created_at":"2026-01-16T02:12:13.496Z","updated_at":"2026-03-04T14:01:08.348Z","avatar_url":"https://github.com/tron-energy-market.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TronZap SDK para Python\n\n[English](https://github.com/tron-energy-market/tronzap-sdk-python/blob/main/README.md) | **[Español](https://github.com/tron-energy-market/tronzap-sdk-python/blob/main/README.es.md)** | [Português](https://github.com/tron-energy-market/tronzap-sdk-python/blob/main/README.pt-br.md) | [Русский](https://github.com/tron-energy-market/tronzap-sdk-python/blob/main/README.ru.md)\n\nSDK oficial en Python para la API de TronZap.\nEste SDK permite integrar fácilmente los servicios de TronZap para alquilar energía TRON.\n\nTronZap.com permite [comprar energía TRON](https://tronzap.com/), reduciendo significativamente las comisiones en transferencias de USDT (TRC20).\n\n👉 [Regístrate para obtener una clave API](https://tronzap.com) para comenzar a usar la API de TronZap e integrarla a través del SDK.\n\n## Instalación\n\n```bash\npip install tronzap-sdk\n```\n\n## Inicio Rápido\n\n```python\nfrom tronzap_sdk import Client\n\n# Inicializar el cliente\nclient = Client(\n    api_token=\"tu_api_token\",\n    api_secret=\"tu_api_secret\"\n)\n\n# Obtener servicios disponibles\nservices = client.get_services()\nprint(services)\n\n# Obtener saldo de la cuenta\nbalance = client.get_balance()\nprint(balance)\n\n# Estimar costo de energía para transferencia USDT\nestimate = client.estimate_energy('DIRECCION_ORIGEN_TRX', 'DIRECCION_DESTINO_TRX', 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t')\nprint(estimate)\n\n# Calcular costo de energía\ncalculation = client.calculate(\n    address=\"DIRECCION_BILLETERA_TRON\",\n    energy=65150  # Cantidad recomendada para transferencias USDT\n)\nprint(calculation)\n\n# Crear transacción de energía\ntransaction = client.create_energy_transaction(\n    address=\"DIRECCION_BILLETERA_TRON\",\n    energy_amount=65150, # Desde 60000\n    duration=1, # Valores posibles 1 o 24 horas\n    activate_address=True  # Si la dirección necesita activación\n)\nprint(transaction)\n\n# Comprar ancho de banda\nbandwidth = client.create_bandwidth_transaction(\n    address=\"DIRECCION_BILLETERA_TRON\",\n    amount=1000,\n    external_id=\"bandwidth-1\"\n)\nprint(bandwidth)\n\n# Verificar estado de la transacción\nstatus = client.check_transaction(id=\"ID_TRANSACCION\")\nprint(status)\n\n# Crear chequeo AML\naml_check = client.create_aml_check(\n    type=\"address\",\n    network=\"TRX\",\n    address=\"TXYZ1234567890EXAMPLEADDRESS\"\n)\nprint(aml_check)\n\n# Verificar estado AML\naml_status = client.check_aml_status(id=aml_check[\"id\"])\nprint(aml_status)\n\n# Obtener información de recarga directa\nrecharge_info = client.get_direct_recharge_info()\nprint(recharge_info)\n```\n\n## Características\n\n- Obtener servicios disponibles\n- Obtener servicios AML\n- Obtener saldo de la cuenta\n- Calcular costo de energía\n- Crear transacciones de activación de dirección\n- Crear transacciones de compra de energía\n- Crear transacciones de compra de ancho de banda\n- Crear y seguir chequeos AML\n- Verificar estado de transacciones\n- Obtener información de recarga directa\n\n## Requisitos\n\n- Python 3.7 o superior\n- requests \u003e= 2.25.0\n\n## Manejo de Errores\n\nEl SDK utiliza una jerarquía de excepciones para un manejo preciso de errores:\n\n```\nTronZapException\n├── ApiException             — errores a nivel de API (code != 0 en la respuesta)\n├── NetworkException         — errores de red/conectividad\n│   ├── ConnectionException  — no se pudo conectar al servidor\n│   ├── TimeoutException     — tiempo de espera agotado\n│   └── SslException         — errores SSL/TLS\n└── HttpException            — respuestas HTTP no 2xx\n    ├── RateLimitException   — HTTP 429 Too Many Requests\n    ├── UnauthorizedException — HTTP 401/403\n    └── ServerException      — errores HTTP 5xx\n```\n\n### Ejemplo\n\n```python\nfrom tronzap_sdk import Client\nfrom tronzap_sdk.exceptions import (\n    ApiException,\n    ConnectionException,\n    HttpException,\n    NetworkException,\n    RateLimitException,\n    ServerException,\n    SslException,\n    TimeoutException,\n    TronZapException,\n    UnauthorizedException,\n    ErrorCode,\n)\n\nclient = Client(api_token=\"tu_api_token\", api_secret=\"tu_api_secret\")\n\ntry:\n    transaction = client.create_energy_transaction(\"TRX_ADDRESS\", 65000, 1)\nexcept ApiException as e:\n    # Error a nivel de API (parámetros inválidos, fondos insuficientes, etc.)\n    print(f\"Error API [{e.code}]: {e.message}\")\n\n    # Clave alias del error, p.ej. \"invalid_tron_address\" o \"invalid_tron_address.from_address\"\n    if e.error_key:\n        print(f\"Clave de error: {e.error_key}\")\n\n    if e.code == ErrorCode.INVALID_TRON_ADDRESS:\n        print(\"Revisa el formato de la dirección TRON.\")\nexcept RateLimitException:\n    print(\"Demasiadas solicitudes. Reduce la frecuencia.\")\nexcept UnauthorizedException:\n    print(\"Token API o firma inválidos.\")\nexcept ServerException as e:\n    print(f\"Error del servidor TronZap [{e.status_code}].\")\nexcept HttpException as e:\n    print(f\"Error HTTP [{e.status_code}]: {e.message}\")\nexcept TimeoutException:\n    print(\"Tiempo de espera agotado.\")\nexcept SslException as e:\n    print(f\"Error SSL: {e.message}\")\nexcept ConnectionException as e:\n    print(f\"Error de conexión: {e.message}\")\nexcept NetworkException as e:\n    print(f\"Error de red: {e.message}\")\nexcept TronZapException as e:\n    print(f\"Error [{e.code}]: {e.message}\")\n```\n\n### Códigos de Error\n\n| Código | Constante                        | Descripción |\n|--------|----------------------------------|-------------|\n| 1      | `AUTH_ERROR`                    | Error de autenticación – Token API o firma inválida |\n| 2      | `INVALID_SERVICE_OR_PARAMS`    | Servicio o parámetros inválidos |\n| 5      | `WALLET_NOT_FOUND`             | Cartera interna no encontrada. Contacte con soporte. |\n| 6      | `INSUFFICIENT_FUNDS`           | Fondos insuficientes |\n| 10     | `INVALID_TRON_ADDRESS`         | Dirección TRON inválida |\n| 11     | `INVALID_ENERGY_AMOUNT`        | Cantidad de energía inválida |\n| 12     | `INVALID_DURATION`             | Duración inválida |\n| 20     | `TRANSACTION_NOT_FOUND`        | Transacción no encontrada |\n| 24     | `ADDRESS_NOT_ACTIVATED`        | Dirección no activada |\n| 25     | `ADDRESS_ALREADY_ACTIVATED`    | La dirección ya está activada |\n| 30     | `AML_CHECK_NOT_FOUND`          | Chequeo AML no encontrado |\n| 35     | `SERVICE_NOT_AVAILABLE`        | Servicio no disponible |\n| 500    | `INTERNAL_SERVER_ERROR`        | Error interno del servidor – Contacta con soporte |\n\n\n## Soporte\n\nPara soporte, contáctanos en Telegram: [@tronzap_bot](https://t.me/tronzap_bot)\n\n## Licencia\n\nEste proyecto está licenciado bajo la Licencia MIT - ver el archivo [LICENSE](LICENSE) para más detalles.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftron-energy-market%2Ftronzap-sdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftron-energy-market%2Ftronzap-sdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftron-energy-market%2Ftronzap-sdk-python/lists"}