Aztec.js
Aztec.js is a library that provides APIs for managing accounts and interacting with contracts on the Aztec network. It communicates with the Private eXecution Environment (PXE) through a PXE implementation, allowing developers to easily register new accounts, deploy contracts, view functions, and send transactions.
Installing
npm install @aztec/aztec.js
Importing
At the top of your JavaScript file, you can import what you need, eg:
import_aztecjs
import {
type AztecAddress,
type AztecNode,
Fr,
type Logger,
type PXE,
type Wallet,
sleep,
} from "@aztec/aztec.js";
import { TokenContract } from "@aztec/noir-contracts.js/Token";
Source code: yarn-project/end-to-end/src/e2e_2_pxes.test.ts#L3-L6
Flow
These are some of the important functions you'll need to use in your Aztec.js: