Metadata-Version: 2.1
Name: aligned-py
Version: 0.1.2
Summary: Aligned-PY is a Python library for interacting with the Aligned layer.
Home-page: https://github.com/broly-labs/aligned-py
License: MIT
Keywords: aligned,network,python,library
Author: Broly Labs
Author-email: khairallah@web3arabs.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: cbor2 (==5.6.5)
Requires-Dist: eth-account (>=0.13.4,<0.14.0)
Requires-Dist: safe-pysha3 (==1.0.4)
Requires-Dist: web3 (==7.4.0)
Requires-Dist: websockets (==13.1)
Project-URL: Documentation, https://docs.alignedlayer.com/
Project-URL: Repository, https://github.com/broly-labs/aligned-py
Description-Content-Type: text/markdown

# Aligned-PY

Aligned-PY is a Python library for interacting with the Aligned layer.

## SDK API Reference

### submit

Submits a proof to the batcher to be verified and returns an aligned verification data struct.

```py
from aligned_py.sdk import submit, Network

async def main():
    result = await submit(
        "BATCHER_URL",
        "NETWORK.NAME",
        "VerificationData",
        "MAX_FEE",
        "WALLET_ACCOUNT",
        "NONCE"
    )
    print(result)
```

### submit_multiple

Submits multiple proofs to the batcher to be verified and returns an aligned verification data array.

```py
from aligned_py.sdk import submit_multiple, Network

async def main():
    result = await submit_multiple(
        "BATCHER_URL",
        "NETWORK.NAME",
        "List[VerificationData]",
        "MAX_FEE",
        "WALLET_ACCOUNT",
        "NONCE"
    )
    print(result)
```

### submit_and_wait_verification

Submits a proof to the batcher to be verified, waits for the verification on ethereum and returns an aligned verification data struct.

```py
from aligned_py.sdk import submit_and_wait_verification, Network
    
async def main():
    result = await submit_multiple(
        "BATCHER_URL",
        "ETH_RPC_URL",
        "NETWORK.NAME",
        "VerificationData",
        "MAX_FEE",
        "WALLET_ACCOUNT",
        "NONCE"
    )
    print(result)
```

### is_proof_verified

Checks if the proof has been verified with Aligned and is included in the batch on-chain.

```py
from aligned_py.sdk import is_proof_verified, Network

def main():    
    verified = is_proof_verified(
        "AlignedVerificationData",
        "NETWORK.NAME",
        "ETH_RPC_URL"
    )
    print(verified)
```

### get_next_nonce

Returns the nonce to use for a given address.

```py
from aligned_py.sdk import get_next_nonce, Network

def main():    
    nonce = get_next_nonce(
        "ETH_RPC_URL",
        "ADDRESS",
        "NETWORK.NAME"
    )
    print(nonce)
```

### get_balance_in_aligned

Queries a User's balance that was deposited in Aligned

```py
from aligned_py.sdk import get_next_nonce, Network

def main():    
    nonce = get_next_nonce(
        "ETH_RPC_URL",
        "ADDRESS",
        "NETWORK.NAME"
    )
    print(nonce)
```


