0.38.0 • Published 5 days ago
@aztec/accounts v0.38.0
Accounts
Accounts is a client library that provides implementations for some common account flavors. Use it to acquire a Wallet
object that corresponds to an account, and use that together with @aztec/aztec.js
to interact with the network.
Installing
npm install @aztec/accounts
Account types
- Schnorr: Uses an Grumpkin private key with Schnorr signatures for authentication, and a separate Grumpkin private key for encryption. Recommended for most use cases.
- ECDSA: Uses an ECDSA private key for authentication, and a Grumpkin private key for encryption. Recommended for building integrations with Ethereum wallets.
- SingleKey: Uses a single Grumpkin private key for both authentication and encryption. Recommended for testing purposes only.
Usage
Deploy a new account
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
import { GrumpkinPrivateKey } from '@aztec/circuit-types';
const encryptionPrivateKey = GrumpkinPrivateKey.random();
const signingPrivateKey = GrumpkinPrivateKey.random();
const wallet = getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey).waitDeploy();
console.log(`New account deployed at ${wallet.getAddress()}`);
Create a wallet object from an already deployed account
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
const wallet = getSchnorrWallet(pxe, encryptionPrivateKey);
console.log(`Wallet for ${wallet.getAddress()} ready`);
0.38.0
5 days ago
0.37.0
11 days ago
0.36.0
12 days ago
0.35.1
26 days ago
0.35.0
26 days ago
0.34.0
1 month ago
0.33.0
1 month ago
0.32.1
1 month ago
0.32.0
2 months ago
0.31.0
2 months ago
0.30.1
2 months ago
0.30.0
2 months ago
0.29.0
2 months ago
0.28.1
2 months ago
0.28.0
2 months ago
0.27.2
2 months ago
0.27.1
2 months ago
0.27.0
2 months ago
0.26.6
2 months ago
0.26.5
2 months ago
0.26.3
2 months ago
0.26.2
2 months ago
0.26.1
2 months ago
0.24.0
3 months ago
0.23.0
3 months ago
0.22.0
3 months ago
0.21.0
3 months ago
0.20.0
4 months ago
0.19.0
4 months ago
0.18.0
4 months ago
0.17.0
4 months ago