Metadata-Version: 2.4
Name: near-langchain-contract-deployer
Version: 0.1.0
Summary: LangChain BaseTool for estimating and deploying NEAR smart contracts
Project-URL: Homepage, https://github.com/mastrophot/near-langchain-contract-deployer
Project-URL: Repository, https://github.com/mastrophot/near-langchain-contract-deployer
Project-URL: Issues, https://github.com/mastrophot/near-langchain-contract-deployer/issues
Author-email: Mastrophot <butrikmax@gmail.com>
License: MIT
License-File: LICENSE
Keywords: deploy,langchain,near,python,smart-contract
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: base58>=2.1.1
Requires-Dist: httpx>=0.27.0
Requires-Dist: langchain-core>=0.2.30
Requires-Dist: pydantic>=2.7.0
Requires-Dist: pynacl>=1.5.0
Provides-Extra: dev
Requires-Dist: build>=1.2.2; extra == 'dev'
Requires-Dist: pytest>=8.3.0; extra == 'dev'
Requires-Dist: respx>=0.21.1; extra == 'dev'
Description-Content-Type: text/markdown

# near-langchain-contract-deployer

LangChain `BaseTool` that estimates and deploys NEAR smart contracts.

## Tool Class (as requested)

```python
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 `.wasm` file
- 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

```bash
pip install near-langchain-contract-deployer
```

## Quick Use

```python
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` (or `signer_id`) on selected network.
- Dry-run mode does not send transactions.

## Development

```bash
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
pytest -q
```

## License

MIT
