{"_id":"@antonyip/money-legos","_rev":"1-88eaeaa78b2937f0be03c99f80dabf86","name":"@antonyip/money-legos","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@antonyip/money-legos","version":"1.0.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/antonyip/money-legos.git"},"author":{"name":"Adrian Li","email":"li.adrianmc@gmail.com"},"license":"MIT","scripts":{"clean":"rm -rf dist","build":"yarn clean && tsc --declaration && cp package.json dist && cp README.md dist","postbuild":"copyfiles --verbose -u 1 src/**/*.sol dist","build:docs":"embedme docs/* && yarn build && node scripts/genAddrMainnetOverview.js > docs/overview_mainnet_address.md","serve:docs":"docsify serve ./docs","test":"jest --verbose","link":"yarn build && cd dist && npm link","prepublishOnly":"echo \"Error: Don't run 'npm publish' in root. Use 'npm run dist' instead.\" && exit 1","dist":"cd dist && npm publish --ignore-scripts --access public"},"devDependencies":{"@types/jest":"^25.2.1","@types/node":"^13.13.0","copyfiles":"^2.2.0","docsify-cli":"^4.4.0","dotenv":"^8.2.0","embedme":"^1.21.0","ethers":"^4.0.46","ganache-core":"^2.10.2","jest":"^25.3.0","json2md":"^1.7.0","ts-jest":"^25.3.1","typescript":"^3.8.3"},"prettier":{"trailingComma":"all"},"keywords":["ethereum","abi","defi","defi addresses","defi abi","ethereum abi","ethereum address","money-legos"],"dependencies":{"@openzeppelin/contracts":"^2.5.0"},"description":"[![circleci](https://badgen.net/circleci/github/studydefi/money-legos)](https://app.circleci.com/pipelines/github/studydefi/money-legos) [![npm](https://badgen.net/npm/v/@studydefi/money-legos)](https://www.npmjs.com/package/@studydefi/money-legos) ![type","bugs":{"url":"https://github.com/antonyip/money-legos/issues"},"homepage":"https://github.com/antonyip/money-legos#readme","_id":"@antonyip/money-legos@1.0.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-N3p3+poQibB6o/5rMssqi/hjrxtALqkXybU1yFJFWJo/spAxWObeOvH0Tc6W1K4xB2m816HdlK9u/K4lTE+SgA==","shasum":"d90c0e8c1706842544978eca244bc7592583e161","tarball":"https://registry.npmjs.org/@antonyip/money-legos/-/money-legos-1.0.0.tgz","fileCount":223,"unpackedSize":2147229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFEnqCRA9TVsSAnZWagAAusoP/jcngXonkKwiI/gJGWz7\nm3Qx5G4Y8rYSaq7/A9jINzeXeUrIFyAMf4sIVveigYsBB87oLf40qlHkT8Aq\nQL680G5Yg57tL+a4OF2B1xnomznaEUehgzF34tEvrMhLMMC2FBbGVNJU/AGV\nCKUchE6z09ZLHC0AQbH1yPlvzjAv8S3K8bKahVohfzLceayT6NW6fKMJbS9g\nnqpM/89M8E8rdGKsPgIX+URowuzAFhDwkKUTJcFmqDFMP+4XCmIan0wf4R0H\nFufvtMC9KLPOMalpdWH+VVofx/H6iMckXUEllX/TCTPBCK/UA34DTy5FI3PF\nJvVZbgRT4i3XpmDFaAmuHt3PqGmAK+64RrXF93wY2ZZc7Votz/K0zczp5FDs\nJuj5iI4V2kstHDmkaBNBkCHNL2TnxD/6BcFX0aF9bP/fFhtgdargoNOYO7i8\netVwR2QiJnnlJXLHMJfIfuUKzeXzfg22ILeTbhvifCYyO/ZBPxYOasKteM1h\nCYG30LAySg1e2IV6Mg1DizoGwQKF+CiHr21Pk4XOaq3QhCq4jUvAJMBsLmpl\n8WUiT2IuTOSkaQwQljwChSNHkAnmGfI0hUxGy0zQeV5do+j15RMwLB1r1jBC\n+jNmGPoZNSysWU1YNw4t/Vj2Q1sP78RMohdacKT/E2BuECfTLpd05HU/8Hx9\nH0wV\r\n=nUPr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+GhLQGo8m/TH+496gcYAyyk03+zsLgmZ98QtZqcy7DAIhAOwv53edEquyBWpfkqVlAGWIoxMhXrjKscOcNkFuvLAr"}]},"_npmUser":{"name":"antonyip","email":"anton_yip@hotmail.com"},"directories":{},"maintainers":[{"name":"antonyip","email":"anton_yip@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/money-legos_1.0.0_1628719594575_0.07204799766650871"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-11T22:06:34.519Z","1.0.0":"2021-08-11T22:06:34.758Z","modified":"2022-04-04T14:23:29.221Z"},"maintainers":[{"name":"antonyip","email":"anton_yip@hotmail.com"}],"description":"[![circleci](https://badgen.net/circleci/github/studydefi/money-legos)](https://app.circleci.com/pipelines/github/studydefi/money-legos) [![npm](https://badgen.net/npm/v/@studydefi/money-legos)](https://www.npmjs.com/package/@studydefi/money-legos) ![type","homepage":"https://github.com/antonyip/money-legos#readme","keywords":["ethereum","abi","defi","defi addresses","defi abi","ethereum abi","ethereum address","money-legos"],"repository":{"type":"git","url":"git+ssh://git@github.com/antonyip/money-legos.git"},"author":{"name":"Adrian Li","email":"li.adrianmc@gmail.com"},"bugs":{"url":"https://github.com/antonyip/money-legos/issues"},"license":"MIT","readme":"# money-legos\n\n[![circleci](https://badgen.net/circleci/github/studydefi/money-legos)](https://app.circleci.com/pipelines/github/studydefi/money-legos)\n[![npm](https://badgen.net/npm/v/@studydefi/money-legos)](https://www.npmjs.com/package/@studydefi/money-legos)\n![types](https://badgen.net/npm/types/@studydefi/money-legos)\n![minzip](https://badgen.net/bundlephobia/minzip/@studydefi/money-legos)\n\n![legos autocomplete](./assets/legos-autocomplete.gif)\n\n> Get **ABIs**, **Addresses**, and **Solidity Interfaces** to popular DeFi protocols\n\n**Now with Typescript-powered autocomplete!**\n\n`money-legos` is an NPM package that provides you with the **mainnet addresses**, **ABIs**, and **Solidity interfaces** for popular DeFi protocols.\n\n### Click [here](https://money-legos.studydefi.com/) for docs and visit our Discord [here](https://discord.gg/rBr3U32)!\n\nProtocols supported:\n\n- AAVE\n- Compound\n- Curve Finance\n- DappSys\n- DyDx\n- ERC20\n- Idle V3\n- Kyber.Network\n- MakerDAO\n- OneSplit\n- UMA Protocol\n- Uniswap v1\n- Synthetix\n- Balancer\n- mStable\n- Uniswap v2\n- BadgerDAO\n\nImporting specific protocols is also supported:\n\n<img src=\"./assets/weight.png\" alt=\"size\" width=\"540\">\n\n## Install\n\n```bash\nnpm install @antonyip/money-legos\n```\n\n## Usage\n\n### JavaScript\n\n```javascript\nimport { legos } from \"@studydefi/money-legos\";\n\n// access ABIs and addresses\nlegos.erc20.abi;\nlegos.erc20.dai.address;\n\n// of many popular DeFi protocols\nlegos.uniswap.factory.abi;\nlegos.uniswap.factory.address;\n\n// import only the protocol you are interested in\nimport uniswap from \"@studydefi/money-legos/uniswap\";\n\nuniswap.factory.abi;\nuniswap.factory.address;\n```\n\n### Solidity\n\n```solidity\npragma solidity ^0.5.0;\n\nimport \"@studydefi/money-legos/onesplit/contracts/IOneSplit.sol\";\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n\ncontract OneSplitSwapper {\n    // Uniswap Mainnet factory address\n    address constant OneSplitAddress = 0xC586BeF4a0992C495Cf22e1aeEE4E446CECDee0E;\n\n    function _swap(address from, address to, uint256 amountWei) internal {\n        IERC20 fromIERC20 = IERC20(from);\n        IERC20 toIERC20 = IERC20(to);\n\n        (uint256 returnAmount, uint256[] memory distribution) = IOneSplit(\n            OneSplitAddress\n        ).getExpectedReturn(\n            fromIERC20,\n            toIERC20,\n            amountWei,\n            10,\n            0\n        );\n\n        IOneSplit(OneSplitAddress).swap(\n            fromIERC20,\n            toIERC20,\n            amountWei,\n            returnAmount,\n            distribution,\n            0\n        );\n    }\n}\n```\n","readmeFilename":"README.md"}