algorand-x402-client
Python Indexer client that wraps AlgoKit Utils and py-algorand-sdk IndexerClient:
| Backend | Default origin | Auth | Data |
|---|---|---|---|
.free |
Nodely / AlgoNode (AlgoKit getAlgoNodeConfig) |
none | full archival Indexer v2 |
.paid |
https://api.algorand-indexer.xyz |
x402 USDC (exact / AVM) |
private full Indexer (genesis → tip) |
The library does not reimplement Indexer REST. It injects HTTP under the official
IndexerClient so lookups, searches, and pagination stay upstream.
Paid and free backends share the same Indexer contract (complete history). They differ by billing and rate limits. There is no silent “try Nodely, then pay” default — that would spend USDC on 429s.
Install
Python 3.10+:
pip install algorand-x402-client
# or: uv add algorand-x402-client
Usage
import os
from algorand_x402_client import Payer, configure_logging, create_algorand_indexer, get_logger
configure_logging() # stderr + algorand-x402-client.log
logger = get_logger(__name__)
indexer_client = create_algorand_indexer(
"mainnet",
payer=Payer(mnemonic=os.environ["BUYER_MNEMONIC"]), # omit for free-only
)
# Nodely — never sends PAYMENT-SIGNATURE, never spends USDC
account = indexer_client.free.account_info("JRG3CUVOFK3YJK3QDD4IOWKMHHRCWVTEMUSYKDN7U73FQO5ZYTCC7CEBRQ")
# x402 gateway — HTTP 402 → sign USDC → retry (search tier is $0.0001)
paid = indexer_client.paid.account_info("JRG3CUVOFK3YJK3QDD4IOWKMHHRCWVTEMUSYKDN7U73FQO5ZYTCC7CEBRQ")
logger.info("gateway network=%s", indexer_client.gateway.health()["network"])
indexer_client.close()
indexer_client.free / indexer_client.paid are py-algorand-sdk IndexerClients
(health(), account_info(), search_transactions(), …).
indexer_client.algorand_free is AlgorandClient.from_clients with Nodely algod + the free Indexer.
Payer must be opted into USDC: MainNet 31566704, TestNet 10458941. Default
max payment is 10_000 microUSDC ($0.01).
Environment: BUYER_MNEMONIC, X402_BASE_URL, X402_NETWORK, ALGORAND_X402_LOG_FILE.
Docs
- Repository: https://github.com/thecryptomie/algorand-x402-client
- Gateway health: https://api.algorand-indexer.xyz/health
- OpenAPI: https://api.algorand-indexer.xyz/openapi.json
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file algorand_x402_client-0.1.0.tar.gz.
File metadata
- Download URL: algorand_x402_client-0.1.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0aa370e9852f2afb8d85754892613f46c39b9171ef37ec4a55e16c9277ce4d07
|
|
| MD5 |
91c91b520cfdc64c491e72baaf58a54f
|
|
| BLAKE2b-256 |
7aee3ef94fd8515a17933f3acdf01d8f64453becf3dc71e6df67652cc88217e8
|
Provenance
The following attestation bundles were made for algorand_x402_client-0.1.0.tar.gz:
Publisher:
release.yml on thecryptomie/algorand-x402-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
algorand_x402_client-0.1.0.tar.gz -
Subject digest:
0aa370e9852f2afb8d85754892613f46c39b9171ef37ec4a55e16c9277ce4d07 - Sigstore transparency entry: 2646145183
- Sigstore integration time:
-
Permalink:
thecryptomie/algorand-x402-client@11782e8a7e5b9f7190fe46ba37bccee9063cc461 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/thecryptomie
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@11782e8a7e5b9f7190fe46ba37bccee9063cc461 -
Trigger Event:
push
-
Statement type:
File details
Details for the file algorand_x402_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: algorand_x402_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fec188b9920abef9c3d5d04223f61a4e61ba53dc0b9ac7ac686aa2d15dfdad7c
|
|
| MD5 |
14f337c1009d5d641c131ca071a2cb0c
|
|
| BLAKE2b-256 |
17b5e4416b5f5dbff15aec12ffe14a92b218792880e893772c1c2f80e6612c3e
|
Provenance
The following attestation bundles were made for algorand_x402_client-0.1.0-py3-none-any.whl:
Publisher:
release.yml on thecryptomie/algorand-x402-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
algorand_x402_client-0.1.0-py3-none-any.whl -
Subject digest:
fec188b9920abef9c3d5d04223f61a4e61ba53dc0b9ac7ac686aa2d15dfdad7c - Sigstore transparency entry: 2646145479
- Sigstore integration time:
-
Permalink:
thecryptomie/algorand-x402-client@11782e8a7e5b9f7190fe46ba37bccee9063cc461 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/thecryptomie
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@11782e8a7e5b9f7190fe46ba37bccee9063cc461 -
Trigger Event:
push
-
Statement type: