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
161
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-alpha46
  • npm
  • Socket score

Version published
Weekly downloads
365
decreased by-28.15%
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();
// wait for tx to be mined
const receipt = await tx.wait();
console.log(`Contract deployed at ${receipt.contractAddress}`);
Send a transaction
import { Contract } from '@aztec/aztec.js';

const contract = await Contract.at(contractAddress, contractAbi, aztecRpcServer);
const tx = contract.methods
    .transfer(amount, recipientAddress)
    .send({ origin: senderAddress });

// wait for tx to be mined
await tx.wait();
console.log(`Transferred ${amount} to ${recipientAddress}!`);
Call a view function
import { Contract } from '@aztec/aztec.js';

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

FAQs

Package last updated on 24 Aug 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