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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fastlane-labs/atlas-config

v0.1.3

Published

A configuration package for Atlas Protocol

Downloads

78

Readme

@fastlane-labs/atlas-config

A configuration package for Atlas Protocol, providing essential chain configuration data for EVM networks. This package is designed to be used in conjunction with the atlas-sdk and contains all relevant smart contract addresses for the Atlas protocol.

Installation

Install the package using npm:

npm install @fastlane-labs/atlas-config
yarn add @fastlane-labs/atlas-config

Usage

Import and use the configuration data in your TypeScript or JavaScript project

import { chainConfig, getChainConfig, getAllChainConfigs, getSupportedChainIds, mergeChainConfigs } from '@fastlane-labs/atlas-config';

Access the entire chain configuration

console.log(chainConfig);

Get configuration for a specific chain (e.g., Polygon mainnet)

const polygonConfig = getChainConfig(137);
console.log(polygonConfig);

Attempting to get configuration for an unknown chain will throw an error

try {
  const unknownConfig = getChainConfig(999999);
} catch (error) {
  console.error(error); // "Chain configuration not found for chainId: 999999"
}

Get all chain configurations

const allConfigs = getAllChainConfigs();
console.log(allConfigs);

Get supported chain IDs

const supportedChainIds = getSupportedChainIds();
console.log(supportedChainIds);

Merge provided chain configurations with existing ones

const additionalConfig = {
  137: {
    contracts: {
      atlas: { address: '0x1234567890123456789012345678901234567890' }
    }
  },
  999999: {
    contracts: {
      atlas: { address: '0x0987654321098765432109876543210987654321' },
      atlasVerification: { address: '0x0987654321098765432109876543210987654321' },
      sorter: { address: '0x0987654321098765432109876543210987654321' },
      simulator: { address: '0x0987654321098765432109876543210987654321' },
      multicall3: { address: '0x0987654321098765432109876543210987654321' }
    },
    eip712Domain: {
      name: 'New Chain',
      version: '1',
      chainId: 999999,
      verifyingContract: '0x1111111111111111111111111111111111111111'
    }
  }
};

const mergedConfigs = mergeChainConfigs(additionalConfig);
console.log(mergedConfigs);

## Configuration Structure

The `ChainConfig` interface describes the structure of the configuration for each supported chain:

```typescript
interface ChainConfig {
  contracts: {
    atlas: object;
    atlasVerification: object;
    sorter: object;
    simulator: object;
    multicall3: object;
  };
  eip712Domain: {
    name: string;
    version: string;
    chainId: number;
    verifyingContract: string;
  };
}

Supported Chains

This package includes configurations for various Ethereum networks. Use the getChainConfig function with the appropriate chain ID to retrieve the configuration for a specific network.

Mainnets

  • Polygon (Chain ID: 137)
  • Base (Chain ID: 8453)
  • Arbitrum (Chain ID: 42161)

Testnets

  • Ethereum Sepolia (Chain ID: 11155111)
  • Polygon Amoy (Chain ID: 80002)

Each chain configuration includes contract addresses and EIP-712 domain information specific to that network. Use the appropriate chain ID when calling getChainConfig() to retrieve the configuration for your desired network.

Integration with atlas-sdk

This configuration package is designed to work seamlessly with the Atlas Typescript SDK. It provides all the necessary smart contract addresses and network-specific information required for interacting with the Atlas protocol.

Contributing

If you'd like to contribute to this project, please submit a pull request or open an issue on our GitHub repository.

License

This project is licensed under the MIT License.

Support

For questions, issues, or feature requests, please open an issue on our GitHub repository or contact our support team at [email protected].

Disclaimer

This package is part of the Atlas protocol ecosystem. Make sure to use it in conjunction with other Atlas-related packages and follow best practices for blockchain development and security.