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

@aztec/aztec.js

Package Overview
Dependencies
Maintainers
6
Versions
160
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 tool that provides APIs for interacting with contracts on the Aztec network. It communicates with the [AztecRPCServer](../aztec-rpc/) through an AztecRPCClient implementation, allowing developers to easily deploy contracts, view functions, a

  • 0.1.0-alpha14
  • npm
  • Socket score

Version published
Weekly downloads
658
decreased by-18.67%
Maintainers
6
Weekly downloads
 
Created
Source

Aztec.js

Aztec.js is a tool that provides APIs for interacting with contracts on the Aztec network. It communicates with the AztecRPCServer through an AztecRPCClient implementation, allowing developers to easily deploy contracts, view functions, and send transactions.

Usage

Deploy a contract
import { ContractDeployer } from '@aztec/aztec.js';

const deployer = new ContractDeployer(contractAbi, aztecRpcServer);
const tx = deployer.deploy(constructorArgs[0], constructorArgs[1]).send();
await tx.isMined();
console.log('Contract deployed!');

const receipt = await tx.getReceipt();
console.log(`Contract address: ${receipt.contractAddress}`);
Send a transaction
import { Contract } from '@aztec/aztec.js';

const contract = new Contract(contractAddress, contractAbi, aztecRpcServer);
const tx = contract.methods
    .transfer(amount, recipientAddress))
    .send({ from: senderAddress });
await tx.isMined();
console.log(`Transferred ${amount} to ${recipientAddress}!`);
Call a view function
import { Contract } from '@aztec/aztec.js';

const contract = new Contract(contractAddress, contractAbi, aztecRpcServer);
const [balance] = contract.methods
    .getBalance(accountPublicKey))
    .view({ from: accountAddress });
console.log(`Account balance: ${balance}.`);

FAQs

Package last updated on 09 Jul 2023

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