TypeScript SDK for Aztec Node JSON-RPC API.
pnpm add @dashtec/aztec-rpc-sdk
# or install from GitHub
pnpm add github:DashNode-Org/aztec-rpc-sdkimport { createAztecRpcClient, createAztecMethods } from '@dashtec/aztec-rpc-sdk';
const client = createAztecRpcClient({
url: 'http://localhost:8080',
timeout: 30000,
retries: 3,
});
const aztec = createAztecMethods(client);
// Node info
const info = await aztec.getNodeInfo();
console.log(info.nodeVersion, info.l1ChainId);
// Block queries
const blockNumber = await aztec.getBlockNumber();
const block = await aztec.getBlock(blockNumber);
const tips = await aztec.getL2Tips();
// Validator stats
const stats = await aztec.getValidatorsStats();
const validatorStats = await aztec.getValidatorStats('0x...');
// Logs (use filter object)
const logs = await aztec.getPrivateLogs({
fromBlock: 16190,
toBlock: 16195,
afterLog: null,
});isReady()- Check if node is readygetNodeInfo()- Get node info (version, chainId, contracts)getNodeVersion()- Get node version stringgetVersion()- Get protocol versiongetChainId()- Get L1 chain IDgetL1ContractAddresses()- Get L1 contract addressesgetProtocolContractAddresses()- Get protocol contract addressesgetEncodedEnr()- Get ENRgetCurrentBaseFees()- Get current gas fees
getBlockNumber()- Get latest block numbergetProvenBlockNumber()- Get proven block numbergetL2Tips()- Get L2 tips (latest, proven, finalized)getBlock(blockNumber)- Get block by numbergetBlocks(from, limit)- Get blocks by rangegetBlockHeader(blockNumber)- Get block header
getWorldStateSyncStatus()- Get sync statusgetPublicStorageAt(address, slot)- Get public storage
getValidatorsStats()- Get all validators statsgetValidatorStats(address)- Get single validator stats
getTxReceipt(txHash)- Get transaction receiptgetTxEffect(txHash)- Get transaction effectgetTxByHash(txHash)- Get transaction by hashgetPendingTxs()- Get pending transactionsgetPendingTxCount()- Get pending tx count
getContractClass(classId)- Get contract classgetContract(address)- Get contract instance
getPrivateLogs(filter)- Get private logsgetPublicLogs(filter)- Get public logsgetContractClassLogs(filter)- Get contract class logs
- Add missing methods from API reference:
-
node_sendTx -
node_isValidTx -
node_simulatePublicCalls -
node_findLeavesIndexes -
node_getNullifierSiblingPath -
node_getNoteHashSiblingPath -
node_getArchiveSiblingPath -
node_getPublicDataSiblingPath -
node_getNullifierMembershipWitness -
node_getLowNullifierMembershipWitness -
node_getPublicDataWitness -
node_getArchiveMembershipWitness -
node_getNoteHashMembershipWitness -
node_getL1ToL2MessageMembershipWitness -
node_getL1ToL2MessageBlock -
node_isL1ToL2MessageSynced -
node_getL2ToL1Messages -
node_getLogsByTags -
node_registerContractFunctionSignatures -
node_getAllowedPublicSetup -
nodeAdmin_*methods
-
- Add proper types for remaining
unknownreturn types - Verify
getPublicStorageAtparameter format - Add unit tests
- Add integration tests against testnet
- Publish to npm
# Build
pnpm build
# Type check
pnpm typecheck
# Sync to dedicated repo
pnpm sdk:push # from monorepo rootMIT