
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
@lit-protocol/contracts
Advanced tools
A TypeScript utility for fetching and caching Lit Protocol contract ABIs and addresses. This tool maintains consistent contract data formats across the Lit Protocol ecosystem.
A TypeScript utility for fetching and caching Lit Protocol contract ABIs and addresses. This tool maintains consistent contract data formats across the Lit Protocol ecosystem.
flowchart TB
subgraph Main Process
main["main()"] --> procProd["Process Production Networks"]
main --> procDev["Process Development Networks"]
main --> genIndex["Generate Index File"]
main --> summary["Print Network Summary"]
end
subgraph Production Flow
procProd --> |"For each network"| updateProdCache["updateProdCache()"]
updateProdCache --> getProdABIs["getProdContractABIs()"]
updateProdCache --> getLastMod["getLastModified()"]
updateProdCache --> writeCache["Write Cache File"]
end
subgraph Development Flow
procDev --> updateDevCache["updateDevCache()"]
updateDevCache --> getDevABIs["getDevContractABIs()"]
updateDevCache --> getLastMod
updateDevCache --> writeCache
end
subgraph File Generation
genIndex --> |"Generate"| indexTS["dist/index.ts"]
writeCache --> |"Generate"| prodTS["dist/prod/*.ts"]
writeCache --> |"Generate"| devTS["dist/dev/*.ts"]
end
subgraph Configuration
config["Constants & Config"]
networks["Network Definitions"]
contractMap["Contract Name Mappings"]
config --> main
networks --> main
contractMap --> updateProdCache
contractMap --> updateDevCache
end
subgraph GitHub API
getProdABIs --> |"Fetch"| ghAPI["GitHub API"]
getDevABIs --> |"Fetch"| ghAPI
getLastMod --> |"Fetch"| ghAPI
end
style main fill:#f9f,stroke:#333,stroke-width:4px
style ghAPI fill:#b8d4ff,stroke:#333
style config fill:#d4ffb8,stroke:#333
src/
├── config/ # Configuration constants and network definitions
├── services/ # Core business logic services
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
└── index.ts # Main entry point
GH_API_KEY
: GitHub Personal Access Token (required)DEV_BRANCH
: Development branch name (defaults to 'develop')yarn add @lit-protocol/contracts
import { datilDev, datilTest, datil } from "@lit-protocol/contracts";
console.log("datilDev:", datilDev);
console.log("datilTest:", datilTest);
console.log("datil:", datil);
import { develop } from "@lit-protocol/contracts";
console.log("Development contracts:", develop);
Clone the repository
Install dependencies:
yarn install
Set up environment variables:
export GH_API_KEY=your_github_token
export LIT_ABI_SOURCE=prod # or 'dev'
Run the fetcher:
# For default branch
bun run fetch-contracts.ts
# For specific branch
DEV_BRANCH=develop bun run fetch-contracts.ts
MIT
FAQs
To run locally, use the following command:
The npm package @lit-protocol/contracts receives a total of 2,265 weekly downloads. As such, @lit-protocol/contracts popularity was classified as popular.
We found that @lit-protocol/contracts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.