Goat plugin for JSON-RPC
Project description
JSON-RPC Plugin for GOAT SDK
A plugin for the GOAT SDK that enables making JSON-RPC calls to any blockchain or protocol endpoint supporting the JSON-RPC 2.0 specification.
Installation
# Install the plugin
poetry add goat-sdk-plugin-jsonrpc
# Install optional wallet dependencies for chain-specific operations
poetry add goat-sdk-wallet-evm
poetry add goat-sdk-wallet-solana
Usage
from goat_plugins.jsonrpc import jsonrpc, JSONRpcPluginOptions
# Initialize the plugin for EVM chain
evm_options = JSONRpcPluginOptions(
endpoint="${RPC_PROVIDER_URL}" # Your EVM RPC endpoint
)
evm_plugin = jsonrpc(evm_options)
# Get latest block number on Ethereum
eth_response = await evm_plugin.call({
"method": "eth_blockNumber",
"params": [],
"id": 1,
"jsonrpc": "2.0"
})
# Initialize plugin for Solana
sol_options = JSONRpcPluginOptions(
endpoint="${RPC_PROVIDER_URL}" # Your Solana RPC endpoint
)
sol_plugin = jsonrpc(sol_options)
# Get account info on Solana
sol_response = await sol_plugin.call({
"method": "getAccountInfo",
"params": [
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
{"encoding": "base58"}
],
"id": 1,
"jsonrpc": "2.0"
})
Features
-
Protocol Support:
- JSON-RPC 2.0 specification
- WebSocket connections
- Batch requests
- Error handling
-
Chain Compatibility:
- Ethereum and EVM chains
- Solana
- Any JSON-RPC compatible chain
-
Advanced Features:
- Async implementation
- Request retries
- Rate limiting
- Response validation
-
Integration Support:
- GOAT SDK integration
- LangChain compatibility
- Custom middleware support
- Error event handling
License
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
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 goat_sdk_plugin_jsonrpc-0.1.2.tar.gz.
File metadata
- Download URL: goat_sdk_plugin_jsonrpc-0.1.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.16 Linux/6.8.0-1021-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ceb382a8c984c63b22a119b6a61dacd294d227cb1e2ebc3cadc0bfd96a4ece62
|
|
| MD5 |
6698ce87f4be439cc58219aae5bbb805
|
|
| BLAKE2b-256 |
cbccb1de2787adaaec47e599429ba72ad0f00f117d24cce8a87bdbaacd671f31
|
File details
Details for the file goat_sdk_plugin_jsonrpc-0.1.2-py3-none-any.whl.
File metadata
- Download URL: goat_sdk_plugin_jsonrpc-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.16 Linux/6.8.0-1021-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de9e4b44742d887168e68ccefc1b3a4133632eca51b2e1caa7e6122a6c500fbb
|
|
| MD5 |
f654ec7c21831c40c626965dbadb0b72
|
|
| BLAKE2b-256 |
1c5d7d118454a7b4443bbc03b89d11da693f5811d9f38d1ef53d69f3b9e09809
|