FF
FRANKFOX

dag4.js

Constellation Network · Dec 2020 – Sep 2021

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

Apps: Stargazer wallet, exchanges, tools dag4 core keystore keyring wallet network ledger Constellation Ledger device

My role and the team

Sole engineer from the first commit in December 2020 through September 2021. Others have maintained and extended it since.