dag4.js
Sole engineer on the network's TypeScript SDK, the library apps use to hold keys, sign and send transactions.
50,302 npm downloads a year
// From the dag4.js README
import { dag4 } from '@stardust-collective/dag4';
const pk = dag4.keyStore.generatePrivateKey();
dag4.account.loginPrivateKey(pk);
dag4.account.connect({ networkVersion: '2.0', testnet: true });
const balance = await dag4.network.getAddressBalance(dag4.account.address);
await dag4.account.transferDag('DAGabc123...', 25.551, 0);The problem
Anyone building on Constellation, a blockchain network, from the network's own wallet to exchanges, needed the same pieces: keys, accounts, signing, and calls to the network. Without a shared SDK, each team would write and secure its own.
What I built
dag4.js, the network's TypeScript SDK: 7 npm packages covering keys, wallets, network calls and Ledger signing. The Stargazer wallet runs on it, and it still gets about 50,000 npm downloads a year.
Architecture
- Small packages behind one entry point. Apps import
dag4and get the keystore, account and network APIs; apps that need only one piece, like the keyring, can import it alone. - Hardware signing as its own package. Ledger support lives in
dag4-ledger, so apps without hardware wallets don't carry it.
My role and the team
Sole engineer from the first commit in December 2020 through September 2021. Others have maintained and extended it since.