{"_id":"@bel2labs/sdk","name":"@bel2labs/sdk","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@bel2labs/sdk","version":"0.0.1","repository":{"type":"git","url":"git@github-bel2:BeL2Labs/bel2-sdk-typescript.git"},"author":{"name":"BeL2Labs"},"license":"MIT","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"build":"rollup -c && tsc --emitDeclarationOnly","typechain:ethers:v5":"typechain --target=ethers-v5 --out-dir src/contracts/ethersv5/types 'src/contracts/abi/*.json'","typechain:ethers:v6":"typechain --target=ethers-v6 --out-dir src/contracts/ethersv6/types 'src/contracts/abi/*.json'","typechain":"yarn typechain:ethers:v6 && yarn typechain:ethers:v5","prepublishOnly":"yarn build"},"devDependencies":{"@rollup/plugin-alias":"^5.1.0","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@typechain/ethers-v5":"^11.1.2","@typechain/ethers-v6":"^0.5.1","@types/react":"^18.3.3","react":"^18.3.1","rollup":"^4.18.0","rollup-plugin-typescript2":"^0.36.0","typechain":"^8.3.2","typescript":"^5.5.3"},"dependencies":{"@ethersproject/providers":"^5.7.2","axios":"^1.7.2","ethersv5":"npm:ethers@5","ethersv6":"npm:ethers@6","merkletreejs":"^0.4.0","rxjs":"^7.8.1"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"description":"## Installation","_id":"@bel2labs/sdk@0.0.1","dist":{"shasum":"709b4f47256805e4070be63296564c7aa5ca8023","integrity":"sha512-pQX/Oz44buC3Wq5nqJwhngYDh8PsX3k5gqkvCyr5dDVtWlfkZP9kySd2jcP8z1Zsol1rZ4Wu9Qy33MeyCpoieQ==","tarball":"https://registry.npmjs.org/@bel2labs/sdk/-/sdk-0.0.1.tgz","fileCount":82,"unpackedSize":381273,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAqiyBOivJ9V0hGsq4orDm7FAsPX9rAv84bjpSm17hiwIgMVoaUd2R0N6FZxigyk3pd9UpFiNcOpxw/NYXmMfQUM4="}]},"_npmUser":{"name":"proctarelastos","email":"proctar.elastos@gmail.com"},"directories":{},"maintainers":[{"name":"raozhiming","email":"raozhiming@msn.com"},{"name":"proctarelastos","email":"proctar.elastos@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.0.1_1720675513507_0.0435389585099184"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-11T05:25:13.412Z","0.0.1":"2024-07-11T05:25:13.681Z","modified":"2024-07-11T05:25:13.978Z"},"maintainers":[{"name":"raozhiming","email":"raozhiming@msn.com"},{"name":"proctarelastos","email":"proctar.elastos@gmail.com"}],"description":"## Installation","repository":{"type":"git","url":"git@github-bel2:BeL2Labs/bel2-sdk-typescript.git"},"author":{"name":"BeL2Labs"},"license":"MIT","readme":"# BeL2 SDK\n\n## Installation\n\n`yarn add @bel2labs/sdk`\n\n## Modules\n\n- ZKP: ZK Proofs for bitcoin transactions\n\n## Supported interfaces\n\nThis library abstracts various versions of popular EVM providers for convenience.\n\n- ethers v6\n- ethers v5\n\n## The ZKP module\n\n### Workflow\n\n- A bitcoin transaction is published. Either a regular transfer, or a more complex script.\n- An EVM contract, or directly a dApp, requests the ZKP contract to generate the proof for the transaction. For this, it submits a set of mandatory values about the bitcoin transaction, so that BeL2 can verify it.\n- The BeL2 ZKP service produces the cairo proof and makes it availabiel from EVM smart contracts to verify.\n\n### Submitting a proof from a contract\n\nThis topic is not covered by this SDK. Please refer to [doc of zkp contract].\n\n### Submitting a proof from a client app or web service\n\nSee `samples` folder for full code\n\n#### Ethers v6 quickstart\n\n```typescript\nimport { ZKP } from \"@bel2labs/sdk\";\nimport { ethers } from 'ethers';\n\nconst verification = await ZKP.EthersV6.TransactionVerification.create(txId, 20);\nif (!verification.isSubmitted()) {\n  const provider = new ethers.BrowserProvider(window.ethereum);\n  const signer = await provider.getSigner();\n\n  verification.status$.subscribe((status) => {\n    console.log(\"New status:\", status);\n  });\n\n  const response = await verification.submitVerificationRequest(signer);\n}\n```\n\n## Contribute / Development\n\nSee [Development](docs/development.md)\n","readmeFilename":"README.md"}