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-contracts

v12.0.0

Published

List of DLibrary contracts deployed

Downloads

376

Readme

@the_library/web3-contracts

This package contains the official deployed smart contract addresses, base configurations, and brand mappings endorsed by dsafe.us for the decentralized D-Library project located at https://datapond.earth.

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 contract addresses 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 ensures the permanence, provenance, and anti-enclosure integrity of the public library.


🚀 Getting Started for Junior Developers

Welcome to the D-Library Web3 ecosystem! This package serves as the "Address Book" and "Brand Guide" for the entire platform.

Instead of manually copying and pasting contract addresses from block explorers, you use this package (alongside @the_library/web3-registry-addresses) to securely and programmatically load the correct, certified smart contracts into your frontend application (like Vue.js or React).

1. Getting Supported Techs and Brands

Instead of hardcoding the list of supported blockchains in your UI, you can dynamically generate it using our built-in configuration utilities. This ensures your UI is always up to date when new chains are added to the ecosystem.

import { brandsWithNetwork, BrandWithNetworks } from '@the_library/web3-contracts';

// This returns a structured array of all supported brands (e.g., TRON, CORE)
// along with their specific networks (Mainnet, Testnet, etc.)
const supportedBrands: BrandWithNetworks[] = brandsWithNetwork();

// Example: Iterating through for a Vue dropdown or UI component
// You can use these properties directly in Vue using `v-for="brand in supportedBrands"`
supportedBrands.forEach(brand => {
    console.log(`Brand: ${brand.name.en} (${brand.tech})`);
    
    brand.networks.forEach(network => {
        console.log(` - Network: ${network.name} (Chain ID: ${network.chainId})`);
    });
});

2. Browser Caching Architecture

Because blockchain nodes can be slow to query, we utilize a dynamic, cached architecture specifically designed for browsers.

Here is how the API flows:

  1. Our codebase queries a master "AddressRegistry" on the blockchain.
  2. The Registry provides the latest URLs for the smart contract ABIs (application binary interfaces) securely hosted on the Arweave Permaweb.
  3. It downloads these ABIs and strictly caches them inside your Browser's localStorage for 24 hours.

This means the very first page load of your application might take a few seconds to sync from the blockchain, but all subsequent visits that day are incredibly fast because the ABIs are loaded directly from local browser storage!

3. Initializing & Loading Smart Contracts (D-CODE Booting)

Here is a full code sample demonstrating how to iterate through the entire supported ecosystem, boot up the registry caching engine, and prepare the contracts for use in your frontend:

(Note: We use the registryAddressLoader from the sibling package to execute the Initialize command)

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

/**
 * Initializes all endorsed D-Code contracts and syncs them to localStorage.
 * Call this function during your app's boot phase (e.g., in `main.ts` or Vue's `onMounted`).
 */
const initializeDCodeContracts = async () => {
    console.log("Starting D-Code Smart Contract Initialization...");

    // Iterate over all endorsed technologies (e.g., 'evm', 'tron')
    for (const tech of Object.keys(config)) {
        
        // Iterate over all official network configurations for that tech
        for (const chainId of Object.keys(config[tech as keyof typeof config])) {
            const networkConfig = config[tech as keyof typeof config][chainId];
            console.log(`Booting ${tech.toUpperCase()} Network: ${networkConfig.name}...`);

            try {
                // 1. Instantiate the Read-Only API for this specific network architecture
                const registryApi = tech === 'evm' 
                    ? new EvmRegistryReadAPI(networkConfig) 
                    : new TronRegistryReadAPI(networkConfig);

                // 2. Initialize the caching loader. 
                // This checks localStorage first. If expired/empty, it performs a Full Sync from Arweave.
                const resolvedAddresses = await registryAddressLoader.Initialize(
                    tech as any,
                    chainId,
                    registryApi
                );

                console.log(`Successfully cached ${Object.keys(resolvedAddresses).length} contracts for ${networkConfig.name}`);
            } catch (error) {
                console.error(`Failed to initialize D-Code registry for ${networkConfig.name}:`, error);
            }
        }
    }
    
    console.log("All D-Code contracts initialized and ready for frontend usage!");
}

By utilizing these precise APIs, you abstract away the complexity of raw blockchain RPC calls and guarantee that your frontend is always correctly resolving the authentic D-SAFE ecosystem without violating the open sovereign license!


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