Aligned-PY is a Python library for interacting with the Aligned layer.
Submits a proof to the batcher to be verified and returns an aligned verification data struct.
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)
Submits multiple proofs to the batcher to be verified and returns an aligned verification data array.
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)
Submits a proof to the batcher to be verified, waits for the verification on ethereum and returns an aligned verification data struct.
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)
Checks if the proof has been verified with Aligned and is included in the batch on-chain.
from aligned_py.sdk import is_proof_verified, Network
def main():
verified = is_proof_verified(
"AlignedVerificationData",
"NETWORK.NAME",
"ETH_RPC_URL"
)
print(verified)
Returns the nonce to use for a given address.
from aligned_py.sdk import get_next_nonce, Network
def main():
nonce = get_next_nonce(
"ETH_RPC_URL",
"ADDRESS",
"NETWORK.NAME"
)
print(nonce)
Queries a User's balance that was deposited in Aligned
from aligned_py.sdk import get_next_nonce, Network
def main():
balance = get_balance_in_aligned(
"ADDRESS",
"ETH_RPC_URL",
"NETWORK.NAME"
)
print(balance)