{"_id":"@consensys/linea-ccip-gateway","_rev":"15-e0d7da713bd2bffb3ae6fb862712eff1","name":"@consensys/linea-ccip-gateway","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@consensys/linea-ccip-gateway","version":"1.0.0","author":{"name":"Consensys"},"license":"Apache-2.0","_id":"@consensys/linea-ccip-gateway@1.0.0","maintainers":[{"name":"cxalem1","email":"alejandro.gonzalez-ext@consensys.net"},{"name":"marioac","email":"marioac.dev@gmail.com"},{"name":"becali12","email":"nicula.cristi14@gmail.com"},{"name":"tvila","email":"traian.vila@consensys.net"},{"name":"leo.wang","email":"leo.wang@consensys.net"},{"name":"pmkowalski","email":"patrick.kowalski@consensys.net"},{"name":"victorien-gauch","email":"victorien.gauch@consensys.net"},{"name":"jones.ho","email":"jones.ho@consensys.net"},{"name":"stanleyyuen","email":"stanley.yuen@consensys.net"},{"name":"gustavorssilva","email":"gustavorssilva09@gmail.com"},{"name":"klejeune-consensys","email":"kevin.le-jeune@consensys.net"},{"name":"wantedsystem","email":"amine.harty@consensys.net"},{"name":"chingiz-mardanov","email":"chingiz.mardanov@consensys.net"},{"name":"rizedr","email":"it@consensys.net"}],"dist":{"shasum":"bf76d91af8f7e17b82552de5c3088f853fdd93b1","tarball":"https://registry.npmjs.org/@consensys/linea-ccip-gateway/-/linea-ccip-gateway-1.0.0.tgz","fileCount":22,"integrity":"sha512-cJyWlTrE2ioS/tBo7OOneFmpi4ct3xO+fW0hH9EecPK1m09csvYLaaWpjGZwo/sI/2kAkWID+MZ8hNnuh7lFNA==","signatures":[{"sig":"MEYCIQDd/Ki+tyReEZS9jMwmo1Ygm9Kfoa3w+WpUt65EUWumsgIhAJMTHtjSyrP9MzQM1EfFOs8pd7g+kwE8xZqArByX1jpQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51678},"main":"dist/index.js","gitHead":"86a9e5e492333bd43423baf245f05aecf5ffc47f","scripts":{"test":"hardhat compile && mocha test/testVerifier.spec.ts --timeout 10000 --exit","build":"tsc --project tsconfig.json --module commonjs --skipLibCheck true --outDir ./dist","clean":"rm -fr node_modules dist","start":"node dist/server.js","compile":"hardhat compile"},"_npmUser":{"name":"wantedsystem","email":"amine.harty@consensys.net"},"_npmVersion":"10.5.0","description":"Adapted from [EVM gateway](https://github.com/ensdomains/evmgateway) for fetching data on Linea along with Sparse Merkle Proofs and return it to the L1 callback function.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"chai":"^4.2.0","cors":"^2.8.5","tsdx":"^0.14.1","mocha":"^10.3.0","tslib":"^2.6.2","dotenv":"^16.0.3","eslint":"^8.56.0","ethers":"^6.11.1","express":"^4.19.2","hardhat":"^2.21.0","ts-node":"^10.9.2","winston":"^3.9.0","commander":"^11.0.0","supertest":"^6.3.3","typechain":"^8.2.0","typescript":"^5.4.5","solidity-coverage":"^0.8.1","@ethersproject/abi":"^5.4.7","@typechain/hardhat":"^8.0.0","@ethersproject/bytes":"^5.7.0","@typechain/ethers-v6":"^0.4.0","hardhat-gas-reporter":"^1.0.8","@openzeppelin/contracts":"^4.9.3","@typescript-eslint/parser":"^7.1.0","@chainlink/ccip-read-server":"^0.2.1","@consensys/linea-state-verifier":"^1.0.1","@nomicfoundation/hardhat-ethers":"^3.0.0","@nomicfoundation/hardhat-verify":"^1.0.0","@nomicfoundation/hardhat-toolbox":"^3.0.0","@typescript-eslint/eslint-plugin":"^7.1.0","@nomicfoundation/hardhat-chai-matchers":"^2.0.0","@nomicfoundation/hardhat-network-helpers":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","@types/chai":"^4.2.0","@types/node":"12.0.0","@types/mocha":">=9.1.0","@types/express":"^4.17.18","@types/supertest":"^2.0.14"},"_npmOperationalInternal":{"tmp":"tmp/linea-ccip-gateway_1.0.0_1724421837869_0.8476696450518146","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@consensys/linea-ccip-gateway","version":"1.0.1","author":{"name":"Consensys"},"license":"Apache-2.0","_id":"@consensys/linea-ccip-gateway@1.0.1","maintainers":[{"name":"cxalem1","email":"alejandro.gonzalez-ext@consensys.net"},{"name":"marioac","email":"marioac.dev@gmail.com"},{"name":"becali12","email":"nicula.cristi14@gmail.com"},{"name":"tvila","email":"traian.vila@consensys.net"},{"name":"leo.wang","email":"leo.wang@consensys.net"},{"name":"pmkowalski","email":"patrick.kowalski@consensys.net"},{"name":"victorien-gauch","email":"victorien.gauch@consensys.net"},{"name":"jones.ho","email":"jones.ho@consensys.net"},{"name":"stanleyyuen","email":"stanley.yuen@consensys.net"},{"name":"gustavorssilva","email":"gustavorssilva09@gmail.com"},{"name":"klejeune-consensys","email":"kevin.le-jeune@consensys.net"},{"name":"wantedsystem","email":"amine.harty@consensys.net"},{"name":"chingiz-mardanov","email":"chingiz.mardanov@consensys.net"},{"name":"rizedr","email":"it@consensys.net"}],"dist":{"shasum":"375c213169241c5e28b2e8973ac12cc1c7c5fb85","tarball":"https://registry.npmjs.org/@consensys/linea-ccip-gateway/-/linea-ccip-gateway-1.0.1.tgz","fileCount":46,"integrity":"sha512-xKdlPxdMSKEmM9LPWTMYG0IfEvcqH0uGSpdzczH1tKY6nTWcLV6xea5KvTI2WqqhhuDW5eA+FWuQbOc1wwaECA==","signatures":[{"sig":"MEQCIDrSLgOYnG42U/Zf3ob1Tdk8/sMyrG28HA2ju8KAQePUAiBzCWbYakXciu5eIQ3D/qXTFMhKOSGvUg4b6wZcXVxtCA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101020},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"d716cc9eb99c4d1fc9782f0feb811920278d1d0f","scripts":{"test":"hardhat compile && mocha test/testVerifier.spec.ts --timeout 10000 --exit","build":"tsc --project tsconfig.json --module commonjs --skipLibCheck true --outDir ./dist","clean":"rm -fr node_modules dist","start":"node dist/server.js","compile":"hardhat compile"},"_npmUser":{"name":"wantedsystem","email":"amine.harty@consensys.net"},"_npmVersion":"10.5.0","description":"Adapted from [EVM gateway](https://github.com/ensdomains/evmgateway) for fetching data on Linea along with Sparse Merkle Proofs and return it to the L1 callback function.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"chai":"^4.2.0","cors":"^2.8.5","tsdx":"^0.14.1","mocha":"^10.3.0","tslib":"^2.6.2","dotenv":"^16.0.3","eslint":"^8.56.0","ethers":"^6.11.1","express":"^4.19.2","hardhat":"^2.21.0","ts-node":"^10.9.2","winston":"^3.9.0","commander":"^11.0.0","supertest":"^6.3.3","typechain":"^8.2.0","typescript":"^5.4.5","solidity-coverage":"^0.8.1","@ethersproject/abi":"^5.4.7","@typechain/hardhat":"^8.0.0","@ethersproject/bytes":"^5.7.0","@typechain/ethers-v6":"^0.4.0","hardhat-gas-reporter":"^1.0.8","@openzeppelin/contracts":"^4.9.3","@typescript-eslint/parser":"^7.1.0","@chainlink/ccip-read-server":"^0.2.1","@consensys/linea-state-verifier":"^1.0.1","@nomicfoundation/hardhat-ethers":"^3.0.0","@nomicfoundation/hardhat-verify":"^1.0.0","@nomicfoundation/hardhat-toolbox":"^3.0.0","@typescript-eslint/eslint-plugin":"^7.1.0","@nomicfoundation/hardhat-chai-matchers":"^2.0.0","@nomicfoundation/hardhat-network-helpers":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","@types/chai":"^4.2.0","@types/node":"12.0.0","@types/mocha":">=9.1.0","@types/express":"^4.17.18","@types/supertest":"^2.0.14"},"_npmOperationalInternal":{"tmp":"tmp/linea-ccip-gateway_1.0.1_1724662658306_0.38478659743700305","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-08-23T14:03:57.763Z","modified":"2026-10-02T21:12:45.022Z","1.0.0":"2024-08-23T14:03:58.057Z","1.0.1":"2024-08-26T08:57:38.463Z"},"author":{"name":"Consensys"},"license":"Apache-2.0","description":"Adapted from [EVM gateway](https://github.com/ensdomains/evmgateway) for fetching data on Linea along with Sparse Merkle Proofs and return it to the L1 callback function.","maintainers":[{"email":"gustavorssilva09@gmail.com","name":"gustavorssilva"},{"email":"stanley.yuen@consensys.net","name":"stanleyyuen"},{"email":"jones.ho@consensys.net","name":"jones.ho"},{"email":"it@consensys.net","name":"rizedr"},{"email":"kevin.le-jeune@consensys.net","name":"klejeune-consensys"},{"email":"victorien.gauch@consensys.com","name":"victorien-gauch"},{"email":"amine.harty@consensys.net","name":"wantedsystem"},{"email":"leo.wang@consensys.net","name":"leo.wang"},{"email":"nicula.cristi14@gmail.com","name":"becali12"},{"email":"francesco.andreoli@consensys.net","name":"andreolf"},{"email":"jose.luque@consensys.net","name":"jluque-npm"},{"email":"codefi-infra@consensys.net","name":"consensys-npm"},{"email":"erik.marks@consensys.com","name":"rekmarks-consensys"},{"email":"belelieu.jonathan@consensys.net","name":"consensys_jb"},{"email":"alejandro.gonzalez-ext@consensys.net","name":"cxalem1"}],"readme":"# linea-ccip-gateway\n\nAdapted from [EVM gateway](https://github.com/ensdomains/evmgateway) for fetching data on Linea along with Sparse Merkle Proofs and return it to the L1 callback function.\n\n## Start dev env\n\n```shell\ncp .env.example .env\npnpm i\npnpm build\npnpm start\n```\n\n## Build\n\n```shell\npnpm build\n```\n\n### Tests\n\n```shell\npnpm i\npnpm compile\npnpm test\n```\n\n## Example of how to use CCIP-Read using EtherJs\n\nThis example demonstrates how to use CCIP-Read using EtherJs to call a contract that implements the protocol.\n\n### Interacting with the `TestL1` Contract Using CCIP-Read\n\nTo interact with the `TestL1` contract using the CCIP-Read protocol, follow these steps:\n\n#### Prerequisites\n\nBefore running the script, ensure that you have the necessary environment variables set up in your `.env` file:\n\n- **`INFURA_API_KEY`**: Your Infura project ID, which allows you to connect to the Ethereum network via Infura.\n\n#### Adding the Script\n\nCreate a new script file in your project directory at `scripts/testL1.ts` and add the following code:\n\n```js\nimport { ethers } from \"ethers\";\nimport \"dotenv/config\";\n\n// Define the ABI for the getLatest function\nconst getLatestABI = [\n  {\n    inputs: [],\n    name: \"getLatest\",\n    outputs: [\n      {\n        internalType: \"uint256\",\n        name: \"\",\n        type: \"uint256\",\n      },\n    ],\n    stateMutability: \"view\",\n    type: \"function\",\n  },\n];\n\nasync function main() {\n  /* \n  Address of the deployed TestL1 contract on the Sepolia testnet.\n  You can view the contract on Etherscan using the following link:\n  https://sepolia.etherscan.io/address/0xb12038acce44e39dd5b2f59f0f68bbfaac35dd16\n  */\n\n  const testL1Address = \"0xB12038acCE44e39dd5B2f59F0f68bbfAaC35dd16\";\n\n  const provider = new ethers.JsonRpcProvider(\n    `https://sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`\n  );\n\n  const testL1Contract = new ethers.Contract(\n    testL1Address,\n    getLatestABI,\n    provider\n  );\n\n  try {\n    // Call the getLatest function with CCIP read enabled\n    const result = await testL1Contract.getLatest({ enableCcipRead: true });\n    console.log({ result });\n  } catch (error) {\n    console.error({ error });\n  }\n}\n\nmain().catch((error) => {\n  console.error(\"Error in main execution:\", error);\n  process.exitCode = 1;\n});\n```\n\nThis script connects to the Sepolia testnet and calls the `getLatest` function of the `TestL1` contract, demonstrating how to enable and use the CCIP-Read functionality.\n\n#### Running the Script\n\nTo execute the script, follow these steps:\n\n1.  **Open a terminal** and navigate to the root directory of your project.\n\n2.  **Run the script using Hardhat** with the following command:\n\n```shell\nnpx hardhat run scripts/testL1.ts --network sepolia\n```\n\n- This command will launch the `testL1.ts` script, which interacts with the `TestL1` contract deployed on the Sepolia network.\n- The script demonstrates the usage of Chainlink's CCIP-Read protocol to fetch and verify off-chain data using a Sparse Merkle Proof.\n\n#### What the Script Does\n\n- **Connects to the Sepolia Network**: Utilizes Infura as the provider to connect to the Ethereum Sepolia testnet.\n- **Interacts with the Contract**: Calls the `getLatest` function on the `TestL1` contract, showcasing how to enable and leverage CCIP-Read capabilities.\n- **Handles Off-Chain Data**: Demonstrates the retrieval and verification of off-chain data, integrating it back into the on-chain environment using CCIP.\n\nThis example provides a practical demonstration of how to set up and utilize the CCIP-Read protocol within a dApp, highlighting the benefits of off-chain data fetching and proof verification.\n","readmeFilename":"README.md"}