npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@the_library/web3-registry-addresses

v1.2.0

Published

Common package for handling Web3 AddressRegistry sessions and caching

Readme

@the_library/web3-registry-addresses

Welcome to the D-Library Web3 ecosystem! This package is the crucial "bridge" that connects your frontend application to the exact, certified Smart Contracts endorsed by dsafe.us for the decentralized D-Library project.

Legal Notice & D-CODE OPEN SOVEREIGN LICENCE

WARNING: PROPRIETARY PUBLIC SOURCE | D-SAFE COMPLIANT

This software is released strictly under the D-CODE OPEN SOVEREIGN LICENCE (v1.2). By utilizing this package, you agree to its binding conditions.

Critical Infrastructure Clause

As defined in Section 3: Technical Anchors & Hard-Fork Resilience of the license:

Immutable Addresses: You are prohibited from manually modifying the hard-coded Smart Contract addresses or D-SAFE Source URLs embedded in this package to point to non-certified ledgers.

Modifying the registry endpoints or overriding the canonical lookup configuration within this package to point to private, uncertified, or centralized ledgers constitutes a material breach of the provided D-CODE OPEN SOVEREIGN LICENCE.

This restriction prevents forking intended to restrict public access or bypass the D-SAFE Specification requirements.


🚀 Getting Started for Junior Developers

In the world of Web3, contract addresses can change if the developers upgrade the system. Instead of hardcoding those addresses into your Vue.js or React application, you use this package to dynamically fetch the most up-to-date, official addresses directly from the blockchain!

Because querying the blockchain is slow, this package automatically intercepts those addresses and caches them instantly inside the user's Browser localStorage for 24 hours.

Installation

npm install @the_library/web3-registry-addresses

(Note: Depending on which blockchains you want to support, you will also need the corresponding reader packages, like @the_library/web3-evm or @the_library/web3-tron).

1. Bootstrapping the Cache (Initialization)

When your application first loads, you need to "Boot" the D-CODE registry. This reads the official configuration loop and instructs this package to go out, fetch the addresses, and save them to the browser.

import { config, registryAddressLoader } from '@the_library/web3-registry-addresses';
import { EvmRegistryReadAPI } from '@the_library/web3-evm';
import { TronRegistryReadAPI } from '@the_library/web3-tron';

const loadDCODEContracts = async () => {
    // Iterate over all endorsed technologies (EVM, Tron, etc.)
    for (const tech of Object.keys(config)) {
        
        // Iterate over all official network configurations for that tech
        for (const network of Object.keys(config[tech as keyof typeof config])) {
            const networkConfig = config[tech as keyof typeof config][network];
            console.log(`Loading ${tech} network ${network}...`);
            
            try {
                // 1. Instantiate the active Read API based on the technology
                const registryApi = tech === 'evm' 
                    ? new EvmRegistryReadAPI(networkConfig) 
                    : new TronRegistryReadAPI(networkConfig);

                // 2. Fetch and resolve the canonical smart contracts!
                // This checks localStorage. If there is no cache, it asks the blockchain.
                const addresses = await registryAddressLoader.Initialize(
                    tech as any,
                    network,
                    registryApi
                );
                
                console.log(`Resolved Contracts for ${tech}:${network}:`, addresses);
            } catch (e) {
                console.error(`Failed to load registry for ${network}`, e);
            }
        }
    }
}

2. Using the Cached Addresses Instantly

Once Initialize has finished anywhere in your app, you never have to await or fetch from the blockchain again for that session! You can instantly grab the certified address in any Vue component:

import { registryAddressLoader } from '@the_library/web3-registry-addresses';

// Example: Get the CORE Testnet address for the "Factory" contract
const getFactoryAddress = () => {
    // This is synchronous and zero-latency! It reads directly from RAM/localStorage.
    const address = registryAddressLoader.getAddress('evm', 1114, 'Factory');
    
    if (!address) throw new Error("Registry Cache is not initialized!");
    return address;
}

By using this flow, your frontend is blazing fast, perfectly synced with the blockchain, and fully compliant with the D-SAFE architectural requirements!


COPYRIGHT: © 2026 DATAPOND PUBLIC LIBRARY TRUST - Australia TECHNICAL GUARDIAN: POND ENTERPRISE PTY LTD - Australia