LangChain BaseTool for estimating and deploying NEAR smart contracts
Project description
near-langchain-contract-deployer
LangChain BaseTool that estimates and deploys NEAR smart contracts.
Tool Class (as requested)
class NEARContractDeployer(BaseTool):
name = "near_contract_deployer"
description = """Deploy smart contracts to NEAR Protocol - the lowest-cost
blockchain for contract deployment. Typical cost: $0.01-0.10"""
Features
- Build deployment plan from a local
.wasmfile - Estimate NEAR deployment fee in NEAR and USD
- Estimate Ethereum equivalent deployment cost (for comparison)
- Optional live deployment to NEAR via signed transaction (
broadcast_tx_commit) - Clear machine-readable and human-readable errors
Install
pip install near-langchain-contract-deployer
Quick Use
from near_langchain_contract_deployer import NEARContractDeployer
tool = NEARContractDeployer()
print(tool.invoke({
"contract_path": "./contract.wasm",
"account_id": "my-contract.testnet",
"network": "testnet",
"dry_run": True
}))
For live deployment set dry_run=False and pass private_key.
Notes
- Deployment requires a valid full-access key for
account_id(orsigner_id) on selected network. - Dry-run mode does not send transactions.
Development
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
pytest -q
License
MIT
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 near_langchain_contract_deployer-0.1.0.tar.gz.
File metadata
- Download URL: near_langchain_contract_deployer-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2a34d704df9423718ea174fc6e694b73e7985815fb113c9da2cd4754e937b9b
|
|
| MD5 |
94010c87b2def5cd65dbfe0782e3d9f8
|
|
| BLAKE2b-256 |
f4e1baaf699a622d91477718b6522a3ae28087e7c846750d4df81bd1c944f437
|
File details
Details for the file near_langchain_contract_deployer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: near_langchain_contract_deployer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52ebcb40cdcdab4636f8e80df0448c39efe2fe4685888f1ea00b6c2af4569c2b
|
|
| MD5 |
ac2094f8236e5fa766f9097d09ecaec7
|
|
| BLAKE2b-256 |
880083b86f1b104c1d373c523d8fa26ad145a6ebf77bba24dbc2c86e7b2bd8fc
|