Aligned-js is a JavaScript library for interacting with the Aligned layer.
Submits a proof to the batcher to be verified and returns an aligned verification data struct.
import { submit, Network } from "aligned";
async function main() {
const alignedData = await submit(
"BATCHER_URL",
"NETWORK.NAME",
"VerificationData",
"MAX_FEE",
"WALLET_ACCOUNT",
"NONCE"
);
console.log(alignedData);
}
Submits multiple proofs to the batcher to be verified and returns an aligned verification data array.
import { submitMultiple, Network } from "aligned";
async function main() {
const alignedData = await submitMultiple(
"BATCHER_URL",
"NETWORK.NAME",
"VerificationData",
"MAX_FEE",
"WALLET_ACCOUNT",
"NONCE"
);
console.log(alignedData);
}
Submits a proof to the batcher to be verified, waits for the verification on ethereum and returns an aligned verification data struct.
import { submitAndWaitVerification, Network } from "aligned";
async function main() {
const alignedData = await submitAndWaitVerification(
"BATCHER_URL",
"ETH_RPC_API",
"NETWORK.NAME",
"VerificationData",
"MAX_FEE",
"WALLET_ACCOUNT",
"NONCE"
);
console.log(alignedData);
}
Checks if the proof has been verified with Aligned and is included in the batch on-chain.
import { isProofVerified, Network } from "aligned";
async function main() {
const verified = await isProofVerified(
"alignedVerificationData",
"NETWORK.NAME",
"ETH_RPC_API"
);
console.log(verified);
}
Returns the nonce to use for a given address.
import { getNextNonce, Network } from "aligned";
async function main() {
const nonce = await getNextNonce(
"ETH_RPC_API",
"ADDRESS",
"NETWORK.NAME",
);
console.log(nonce);
}
Queries a User's balance that was deposited in Aligned
import { getBalanceInAligned, Network } from "aligned";
async function main() {
const balance = await getNextNonce(
"ADDRESS",
"ETH_RPC_API",
"NETWORK.NAME",
);
console.log(balance);
}
If you consider to contribute to this project please read CONTRIBUTING.md first.
Copyright (c) 2024 Broly Labs
Licensed under the MIT license.