Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aztec/aztec.js

Package Overview
Dependencies
Maintainers
0
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aztec/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)](https://docs.aztec.network/reference/aztecjs/pxe) through a `PXE` implementa

  • 0.67.0
  • npm
  • Socket score

Version published
Weekly downloads
504
decreased by-13.4%
Maintainers
0
Weekly downloads
 
Created
Source

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

Usage

Use the @aztec/accounts package in order to create and manage accounts, and acquire a Wallet object needed to send transactions and interact with the network.

Deploy a contract

import { Contract } from '@aztec/aztec.js';

const contract = await Contract.deploy(wallet, MyContractArtifact, [...constructorArgs])
  .send()
  .deployed();
console.log(`Contract deployed at ${contract.address}`);

Send a transaction

import { Contract } from '@aztec/aztec.js';

const contract = await Contract.at(contractAddress, MyContractArtifact, wallet);
const tx = await contract.methods.transfer(amount, recipientAddress).send().wait();
console.log(`Transferred ${amount} to ${recipientAddress} on block ${tx.blockNumber}`);

Simulate a function

import { Contract } from '@aztec/aztec.js';

const contract = await Contract.at(contractAddress, MyContractArtifact, wallet);
const balance = await contract.methods.get_balance(wallet.getAddress()).simulate();
console.log(`Account balance is ${balance}`);

FAQs

Package last updated on 13 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc