near-langchain-event-listener
LangChain tools for monitoring NEAR blockchain events with account subscriptions, event-type filtering, parsed event payloads, callback triggering, and reliable RPC reconnection.
Features
- Subscribe to account-level events
- Filter by event type (
transfer,function_call,event_json,receipt_log) - Advanced
EVENT_JSONfiltering (event_json:ft_transfer,event_json:nep141:ft_transfer) - Parse event data from transactions and
EVENT_JSONlogs - Trigger HTTP callbacks for matched events
- Retry and endpoint failover for resilient RPC access
Installation
pip install near-langchain-event-listener
Quick Start (LangChain)
import json
from near_langchain_event_listener import get_near_event_listener_tools
tools = {tool.name: tool for tool in get_near_event_listener_tools()}
sub = json.loads(tools["near_event_subscribe_account"].invoke({
"account_id": "example.near",
"event_types": ["transfer", "function_call"],
"callback_url": "https://example.com/callback"
}))
print(sub["subscription_id"])
poll = json.loads(tools["near_event_poll"].invoke({
"network": "mainnet",
"max_blocks": 10,
"max_events": 100
}))
print(poll["matched_events"])
Tool Names
near_event_subscribe_accountnear_event_unsubscribenear_event_list_subscriptionsnear_event_listener_statusnear_event_poll
API Notes
- Subscriptions are in-memory state by default.
- First poll starts at current head block to avoid large historical backfill.
- Callback delivery uses HTTP POST and retries on failure.
- RPC reconnection uses multiple endpoints and retry backoff.
- Callback URLs are validated (
http://orhttps://).
Development
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
pytest -q
License
MIT
Metadata
Release files for near-langchain-event-listener 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| near_langchain_event_listener-0.1.1.tar.gz | 8.4 kB | Without provenance | Details for near_langchain_event_listener-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| near_langchain_event_listener-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for near_langchain_event_listener-0.1.1-py3-none-any.whl |
Total release size: 18.6 kB
Release files / near_langchain_event_listener-0.1.1.tar.gz
| Download URL | near_langchain_event_listener-0.1.1.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
226253fccde0e723b7a68b2ea58ec186540795ca7f73f02aea36b9caad2232c7
|
|
BLAKE2b-256 checksum How to use checksums |
884a970920593ca05568cfefe091fe28a6dd366f1c9aee83f4f89ca17a711d3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / near_langchain_event_listener-0.1.1-py3-none-any.whl
| Download URL | near_langchain_event_listener-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
719b8b94fbea2618c1cbf48570b007d73612bb302486548a4b9789032a9c8b86
|
|
BLAKE2b-256 checksum How to use checksums |
df6031994fe675e69f9e3b6583a2b117b86a7d04dfaa2864f2502436960dcd40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for near-langchain-event-listener 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.