{"_id":"@alexastrabit/curve-api","_rev":"5-58bf321075730d081ff5690a5076b826","name":"@alexastrabit/curve-api","dist-tags":{"latest":"2.52.36"},"versions":{"2.52.3":{"name":"@alexastrabit/curve-api","version":"2.52.3","description":"JavaScript library for curve.fi","main":"lib/index.js","author":{"name":"Macket"},"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/curvefi/curve-js.git"},"bugs":{"url":"https://github.com/curvefi/curve-js/issues"},"scripts":{"build":"rm -rf lib && tsc -p tsconfig.build.json"},"devDependencies":{"@types/chai":"^4.3.4","@types/memoizee":"^0.4.7","@types/mocha":"^10.0.1","@types/node":"^14.14.37","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.20.0","babel-eslint":"^10.1.0","chai":"^4.3.7","eslint":"^7.32.0","mocha":"^10.2.0","typescript":"^4.5.2","vue-eslint-parser":"^7.6.0"},"dependencies":{"axios":"^0.21.1","bignumber.js":"^9.0.1","ethcall":"^6.0.2","ethers":"^6.7.0","memoizee":"^0.4.15"},"types":"./lib/index.d.ts","gitHead":"631cd76e3474045ee448484c520a4b734c02dae0","homepage":"https://github.com/curvefi/curve-js#readme","_id":"@alexastrabit/curve-api@2.52.3","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-30CoPGGFQ+cujZlIge6LjcgdJPrCfgJxT3Lv/Zh3nDta8Slqncv+7xsTbxR8WhxAUckcBE8QLrMePnqs9scMPw==","shasum":"42c480845f95114999abf31d1fdcde74ea07bb1b","tarball":"https://registry.npmjs.org/@alexastrabit/curve-api/-/curve-api-2.52.3.tgz","fileCount":319,"unpackedSize":3878933,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICe7okyFQIXh70AkarTLRiRzCVR+XcSzXwBh7xxSozn1AiBqZrZ8UWMe9EpGAr4AkQWz94aj5mOAEWc5ApZSBzK37w=="}]},"_npmUser":{"name":"alexastrabit","email":"alexander@astrabit.io"},"directories":{},"maintainers":[{"name":"alexastrabit","email":"alexander@astrabit.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/curve-api_2.52.3_1701289672835_0.5928507411191435"},"_hasShrinkwrap":false},"2.52.31":{"name":"@alexastrabit/curve-api","version":"2.52.31","description":"JavaScript library for curve.fi","main":"lib/index.js","author":{"name":"Macket"},"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/curvefi/curve-js.git"},"bugs":{"url":"https://github.com/curvefi/curve-js/issues"},"scripts":{"build":"rm -rf lib && tsc -p tsconfig.build.json"},"devDependencies":{"@types/chai":"^4.3.4","@types/memoizee":"^0.4.7","@types/mocha":"^10.0.1","@types/node":"^14.14.37","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.20.0","babel-eslint":"^10.1.0","chai":"^4.3.7","eslint":"^7.32.0","mocha":"^10.2.0","typescript":"^4.5.2","vue-eslint-parser":"^7.6.0"},"dependencies":{"axios":"^0.21.1","bignumber.js":"^9.0.1","ethcall":"^6.0.2","ethers":"^6.7.0","memoizee":"^0.4.15"},"types":"./lib/index.d.ts","gitHead":"631cd76e3474045ee448484c520a4b734c02dae0","homepage":"https://github.com/curvefi/curve-js#readme","_id":"@alexastrabit/curve-api@2.52.31","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-Ndg/rMgEt7q4ERr8lgZeOHLlVrgTwGmMpszZXD6zVKfqKkijiImfRvMZCswdRQQ6cfsTbbdXe9FvQw7/6E/+tg==","shasum":"28ff8032027b2fcbb74b14f3926bd46f76274960","tarball":"https://registry.npmjs.org/@alexastrabit/curve-api/-/curve-api-2.52.31.tgz","fileCount":319,"unpackedSize":3497706,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPeE2a11mWa8FzyywqbP2tTnS4OAZapMqRCnaVMMU6PwIgLvXaQ4oWzxhqok1eRgfPb9JT857JObC+3rmLES6FFAw="}]},"_npmUser":{"name":"alexastrabit","email":"alexander@astrabit.io"},"directories":{},"maintainers":[{"name":"alexastrabit","email":"alexander@astrabit.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/curve-api_2.52.31_1701290260137_0.8862001257856822"},"_hasShrinkwrap":false},"2.52.32":{"name":"@alexastrabit/curve-api","version":"2.52.32","description":"JavaScript library for curve.fi","main":"lib/index.js","author":{"name":"Macket"},"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/alexastrabit/curve-js.git"},"bugs":{"url":"https://github.com/alexastrabit/curve-js/issues"},"scripts":{"build":"rm -rf lib && tsc -p tsconfig.build.json"},"devDependencies":{"@types/chai":"^4.3.4","@types/memoizee":"^0.4.7","@types/mocha":"^10.0.1","@types/node":"^14.14.37","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.20.0","babel-eslint":"^10.1.0","chai":"^4.3.7","eslint":"^7.32.0","mocha":"^10.2.0","typescript":"^4.5.2","vue-eslint-parser":"^7.6.0"},"dependencies":{"axios":"^0.21.1","bignumber.js":"^9.0.1","ethcall":"^6.0.2","ethers":"^6.7.0","memoizee":"^0.4.15"},"types":"./lib/index.d.ts","gitHead":"631cd76e3474045ee448484c520a4b734c02dae0","homepage":"https://github.com/alexastrabit/curve-js#readme","_id":"@alexastrabit/curve-api@2.52.32","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-3PMnNo8+wXZ4SbLV/Duq5iVhRVGQ+wjJNpT2hhe4yNfnR6/38mayJssQCAwkEBIQhmuzc653fnPuM5mdq61Zwg==","shasum":"f1ecdfc1821ede0134a24c20c0186a94e700adc8","tarball":"https://registry.npmjs.org/@alexastrabit/curve-api/-/curve-api-2.52.32.tgz","fileCount":319,"unpackedSize":3497716,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCytXi1ejo6EPgCiQKJpqyFYf+Vt3cZ5/3+JdxUSJQEvwIhAPy7O+OWLl2fRBLJjGOhwyd69VaU/af8ZM2IIPCnt2Vt"}]},"_npmUser":{"name":"alexastrabit","email":"alexander@astrabit.io"},"directories":{},"maintainers":[{"name":"alexastrabit","email":"alexander@astrabit.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/curve-api_2.52.32_1701290981603_0.544248832547942"},"_hasShrinkwrap":false},"2.52.34":{"name":"@alexastrabit/curve-api","version":"2.52.34","description":"JavaScript library for curve.fi","main":"lib/index.js","author":{"name":"Macket"},"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/alexastrabit/curve-js.git"},"bugs":{"url":"https://github.com/alexastrabit/curve-js/issues"},"scripts":{"build":"rm -rf lib && tsc -p tsconfig.build.json"},"devDependencies":{"@types/chai":"^4.3.4","@types/memoizee":"^0.4.7","@types/mocha":"^10.0.1","@types/node":"^14.14.37","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.20.0","babel-eslint":"^10.1.0","chai":"^4.3.7","eslint":"^7.32.0","mocha":"^10.2.0","typescript":"^4.5.2","vue-eslint-parser":"^7.6.0"},"dependencies":{"axios":"^0.21.1","bignumber.js":"^9.0.1","ethcall":"^6.0.2","ethers":"^6.7.0","memoizee":"^0.4.15"},"types":"./lib/index.d.ts","gitHead":"631cd76e3474045ee448484c520a4b734c02dae0","homepage":"https://github.com/alexastrabit/curve-js#readme","_id":"@alexastrabit/curve-api@2.52.34","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-5xGzlVULZeT8Wp4seyMVMnm+ssglmMWrIcfuHWc5sW73/48EX/er2wafYtJcZ+8ZibIxHY3klUKfIN5xGKWmOw==","shasum":"bcf0024e5772cfd379a851272c1aec7547e1debc","tarball":"https://registry.npmjs.org/@alexastrabit/curve-api/-/curve-api-2.52.34.tgz","fileCount":319,"unpackedSize":3559174,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBzuj/Up0G3wKnqMWPCV50/ixk1V+RqZGh8AyhMTm7//AiEAzgSCrgEzMR7Qw29okFTg8FyNqViuDlCIQKqc9OHYa5U="}]},"_npmUser":{"name":"alexastrabit","email":"alexander@astrabit.io"},"directories":{},"maintainers":[{"name":"alexastrabit","email":"alexander@astrabit.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/curve-api_2.52.34_1701291327363_0.03600211306014689"},"_hasShrinkwrap":false},"2.52.35":{"name":"@alexastrabit/curve-api","version":"2.52.35","description":"JavaScript library for curve.fi","main":"lib/index.js","author":{"name":"Macket"},"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/alexastrabit/curve-js.git"},"bugs":{"url":"https://github.com/alexastrabit/curve-js/issues"},"scripts":{"build":"rm -rf lib && tsc -p tsconfig.build.json"},"type":"commonjs","devDependencies":{"@types/chai":"^4.3.4","@types/memoizee":"^0.4.7","@types/mocha":"^10.0.1","@types/node":"^14.14.37","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.20.0","babel-eslint":"^10.1.0","chai":"^4.3.7","eslint":"^7.32.0","mocha":"^10.2.0","typescript":"^4.5.2","vue-eslint-parser":"^7.6.0"},"dependencies":{"axios":"^0.21.1","bignumber.js":"^9.0.1","ethcall":"^6.0.2","ethers":"^6.7.0","memoizee":"^0.4.15"},"types":"./lib/index.d.ts","gitHead":"631cd76e3474045ee448484c520a4b734c02dae0","homepage":"https://github.com/alexastrabit/curve-js#readme","_id":"@alexastrabit/curve-api@2.52.35","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-uGVYazoFTrpeXjzHqHw6aPDO2jlW90YC30n0wucCmtvBtea4SPpkhDvgccwe2sMiM6B7GWPCCIVELjzB2uN0Tg==","shasum":"5ca978fc8e45c8018dd23b5ad4b076d962fc3c55","tarball":"https://registry.npmjs.org/@alexastrabit/curve-api/-/curve-api-2.52.35.tgz","fileCount":318,"unpackedSize":3529279,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAYoXeXXyTo1gwvCiUmivKx9U0OcPsx15qAsYXJV+5lwIgK4AXnU9bn9JL8tA2KM5uO4dI4/IUTBGzaCgpH2CADN8="}]},"_npmUser":{"name":"alexastrabit","email":"alexander@astrabit.io"},"directories":{},"maintainers":[{"name":"alexastrabit","email":"alexander@astrabit.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/curve-api_2.52.35_1701291739785_0.48293886479960335"},"_hasShrinkwrap":false},"2.52.36":{"name":"@alexastrabit/curve-api","version":"2.52.36","description":"JavaScript library for curve.fi","main":"lib/index.js","author":{"name":"Macket"},"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/alexastrabit/curve-js.git"},"bugs":{"url":"https://github.com/alexastrabit/curve-js/issues"},"scripts":{"build":"rm -rf lib && tsc -p tsconfig.build.json","babel":"babel --plugins @babel/plugin-transform-modules-commonjs lib/index.js","rollup":"rollup convert.js --format cjs --file bundle.js","run":"ts-node test.ts"},"type":"commonjs","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/plugin-transform-modules-commonjs":"^7.23.3","@types/chai":"^4.3.4","@types/memoizee":"^0.4.7","@types/mocha":"^10.0.1","@types/node":"^14.14.37","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.20.0","babel-eslint":"^10.1.0","chai":"^4.3.7","eslint":"^7.32.0","mocha":"^10.2.0","rollup":"^4.6.0","ts-node":"^10.9.1","typescript":"^4.5.2","vue-eslint-parser":"^7.6.0"},"dependencies":{"@alexastrabit/ethcall":"^6.0.21","axios":"^0.21.1","bignumber.js":"^9.0.1","ethcall":"^6.0.2","ethers":"^6.7.0","memoizee":"^0.4.15"},"types":"./lib/index.d.ts","gitHead":"631cd76e3474045ee448484c520a4b734c02dae0","homepage":"https://github.com/alexastrabit/curve-js#readme","_id":"@alexastrabit/curve-api@2.52.36","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-D7mpw/zambJEMUe6NPl0QtO6p/ZqXZ9TN55wtxw7J6JAuFNpNCsBBUHiszmCVY+ShdvUySMGaVkXkg6FPAraJg==","shasum":"f853ea46bf2f53765f24d482c6bc51e1808c69e0","tarball":"https://registry.npmjs.org/@alexastrabit/curve-api/-/curve-api-2.52.36.tgz","fileCount":324,"unpackedSize":3543695,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBaWkfkjfReoCk8iwCnJZa3OYPUT6NYrQU8VizMfQhA3AiEApKU2rTwOZqBVgKixhZluQzlmy2EPreTasUk5WzZq7/s="}]},"_npmUser":{"name":"alexastrabit","email":"alexander@astrabit.io"},"directories":{},"maintainers":[{"name":"alexastrabit","email":"alexander@astrabit.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/curve-api_2.52.36_1701336894595_0.18343968405003275"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-29T20:27:52.748Z","2.52.3":"2023-11-29T20:27:53.073Z","modified":"2023-11-30T09:34:55.011Z","2.52.31":"2023-11-29T20:37:40.489Z","2.52.32":"2023-11-29T20:49:41.852Z","2.52.34":"2023-11-29T20:55:27.588Z","2.52.35":"2023-11-29T21:02:20.010Z","2.52.36":"2023-11-30T09:34:54.843Z"},"maintainers":[{"name":"alexastrabit","email":"alexander@astrabit.io"}],"description":"JavaScript library for curve.fi","homepage":"https://github.com/alexastrabit/curve-js#readme","repository":{"type":"git","url":"git+https://github.com/alexastrabit/curve-js.git"},"author":{"name":"Macket"},"bugs":{"url":"https://github.com/alexastrabit/curve-js/issues"},"license":"MIT","readme":"# Curve JS\n\n## Setup\n\nInstall from npm:\n\n`npm install @curvefi/api`\n\n## Init\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    // 1. Dev\n    await curve.init('JsonRpc', {url: 'http://localhost:8545/', privateKey: ''}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0, chainId: 1 });\n    // OR\n    await curve.init('JsonRpc', {}, {}); // In this case JsonRpc url, privateKey, fee data and chainId will be specified automatically\n\n    // 2. Infura\n    await curve.init(\"Infura\", { network: \"homestead\", apiKey: <INFURA_KEY> }, { chainId: 1 });\n    \n    // 3. Web3 provider\n    await curve.init('Web3', { externalProvider: <WEB3_PROVIDER> }, { chainId: 1 });\n    \n    // Fetch factory pools\n    await curve.factory.fetchPools();\n    await curve.crvUSDFactory.fetchPools();\n    await curve.EYWAFactory.fetchPools();\n    await curve.cryptoFactory.fetchPools();\n    await curve.tricryptoFactory.fetchPools();\n})()\n```\n**Note 1.** ```chainId``` parameter is optional, but you must specify it in the case you use Metamask on localhost network, because Metamask has that [bug](https://hardhat.org/metamask-issue.html)\n\n**Note 2.** Web3 init requires the address. Therefore, it can be initialized only after receiving the address.\n\n**Wrong ❌️**\n```tsx\nimport type { FunctionComponent } from 'react'\nimport { useState, useMemo } from 'react'\nimport { providers } from 'ethers'\nimport Onboard from 'bnc-onboard'\nimport type { Wallet } from 'bnc-onboard/dist/src/interfaces'\nimport curve from '@curvefi/api'\n\n    ...\n\nconst WalletProvider: FunctionComponent = ({ children }) => {\n    const [wallet, setWallet] = useState<Wallet>()\n    const [provider, setProvider] = useState<providers.Web3Provider>()\n    const [address, setAddress] = useState<string>()\n\n    const networkId = 1\n\n    const onboard = useMemo(\n        () =>\n            Onboard({\n                dappId: DAPP_ID,\n                networkId,\n\n                subscriptions: {\n                    address: (address) => {\n                        setAddress(address)\n                    },\n\n                    wallet: (wallet) => {\n                        setWallet(wallet)\n                        if (wallet.provider) {\n                            curve.init(\"Web3\", { externalProvider: wallet.provider }, { chainId: networkId })\n                        }\n                    },\n                },\n                walletSelect: {\n                    wallets: wallets,\n                },\n            }),\n        []\n    )\n\n    ...\n```\n\n**Right ✔️**\n```tsx\nimport type { FunctionComponent } from 'react'\nimport { useState, useMemo, useEffect } from 'react'\nimport { providers } from 'ethers'\nimport Onboard from 'bnc-onboard'\nimport type { Wallet } from 'bnc-onboard/dist/src/interfaces'\nimport curve from '@curvefi/api'\n\n    ...\n\nconst WalletProvider: FunctionComponent = ({ children }) => {\n    const [wallet, setWallet] = useState<Wallet>()\n    const [provider, setProvider] = useState<providers.Web3Provider>()\n    const [address, setAddress] = useState<string>()\n\n    const networkId = 1\n\n    const onboard = useMemo(\n        () =>\n            Onboard({\n                dappId: DAPP_ID,\n                networkId,\n\n                subscriptions: {\n                    address: (address) => {\n                        setAddress(address)\n                    },\n\n                    wallet: (wallet) => {\n                        setWallet(wallet)\n                    },\n                },\n                walletSelect: {\n                    wallets: wallets,\n                },\n            }),\n        []\n    )\n\n    useEffect(() => {\n        if (address && wallet?.provider) {\n            curve.init(\"Web3\", { externalProvider: wallet.provider }, { chainId: networkId })\n        }\n    }, [address, wallet?.provider]);\n\n    ...\n```\n\n## Notes\n- 1 Amounts can be passed in args either as numbers or strings.\n- 2 depositOrWithdraw**Bonus** and swap**PriceImpact** methods return %, e. g. 0 < bonus/priceImpact <= 100\n- 3 Slippage arg should be passed as %, e. g. 0 < slippage <= 100\n\n\n\n## General methods\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.getTVL();\n    // 7870819849.685552\n    await curve.getVolume();\n    // {\n    //     totalVolume: 514893871.3481678,\n    //     cryptoVolume: 162757004.96876568,\n    //     cryptoShare: 31.609815930147377\n    // }\n\n    const balances1 = await curve.getBalances(['DAI', 'sUSD']);\n    // OR const balances1 = await curve.getBalances(['0x6B175474E89094C44Da98b954EedeAC495271d0F', '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51']);\n    console.log(balances1);\n    // [ '10000.0', '0.0' ]\n\n    // You can specify addresses\n    const balances2 = await curve.getBalances(['aDAI', 'aSUSD'], \"0x0063046686E46Dc6F15918b61AE2B121458534a5\", \"0x66aB6D9362d4F35596279692F0251Db635165871\");\n    // OR const balances2 = await curve.getBalances(['0x028171bCA77440897B824Ca71D1c56caC55b68A3', '0x6c5024cd4f8a59110119c56f8933403a539555eb'], [\"0x0063046686E46Dc6F15918b61AE2B121458534a5\", \"0x66aB6D9362d4F35596279692F0251Db635165871\"]);\n    console.log(balances2);\n    // {\n    //     '0x0063046686E46Dc6F15918b61AE2B121458534a5': [ '0.0', '0.0' ],\n    //     '0x66aB6D9362d4F35596279692F0251Db635165871': [ '0.0', '0.0' ]\n    // }\n\n    \n    const spender = \"0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7\" // 3pool swap address\n\n    await curve.getAllowance([\"DAI\", \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\"], curve.signerAddress, spender);\n    // [ '0.0', '0.0' ]\n    await curve.hasAllowance([\"DAI\", \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\"], ['1000', '1000'], curve.signerAddress, spender);\n    // false\n    await curve.ensureAllowance([\"DAI\", \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\"], ['1000', '1000'], spender);\n    // [\n    //     '0xb0cada2a2983dc0ed85a26916d32b9caefe45fecde47640bd7d0e214ff22aed3',\n    //     '0x00ea7d827b3ad50ce933e96c579810cd7e70d66a034a86ec4e1e10005634d041'\n    // ]\n})()\n```\n\n## Pools\n\n### Available pools\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    await curve.factory.fetchPools();\n    await curve.crvUSDFactory.fetchPools();\n    await curve.EYWAFactory.fetchPools();\n    await curve.cryptoFactory.fetchPools();\n    await curve.tricryptoFactory.fetchPools();\n\n    curve.getMainPoolList();\n    // [\n    //     'compound', 'usdt',    'y',          'busd',\n    //     'susd',     'pax',     'ren',        'sbtc',\n    //     'hbtc',     '3pool',   'gusd',       'husd',\n    //     'usdk',     'usdn',    'musd',       'rsv',\n    //     'tbtc',     'dusd',    'pbtc',       'bbtc',\n    //     'obtc',     'seth',    'eurs',       'ust',\n    //     'aave',     'steth',   'saave',      'ankreth',\n    //     'usdp',     'ib',      'link',       'tusd',\n    //     'frax',     'lusd',    'busdv2',     'reth',\n    //     'alusd',    'mim',     'tricrypto2', 'eurt',\n    //     'eurtusd',  'eursusd', 'crveth',     'rai',\n    //     'cvxeth',   'xautusd', 'spelleth',   'teth',\n    //     '2pool',    '4pool'\n    // ]\n    \n    curve.factory.getPoolList();\n    // [\n    //     'factory-v2-0',   'factory-v2-2',   'factory-v2-3',   'factory-v2-4',\n    //     'factory-v2-5',   'factory-v2-6',   'factory-v2-7',   'factory-v2-8',\n    //     'factory-v2-9',   'factory-v2-10',  'factory-v2-11',  'factory-v2-14',\n    //     'factory-v2-15',  'factory-v2-17',  'factory-v2-18',  'factory-v2-19',\n    //     'factory-v2-21',  'factory-v2-22',  'factory-v2-23',  'factory-v2-24',\n    //     'factory-v2-25',  'factory-v2-26',  'factory-v2-27',  'factory-v2-28',\n    //     'factory-v2-29',  'factory-v2-30',  'factory-v2-31',  'factory-v2-32',\n    //     'factory-v2-33',  'factory-v2-34',  'factory-v2-35',  'factory-v2-36',\n    //     'factory-v2-37',  'factory-v2-38',  'factory-v2-39',  'factory-v2-40',\n    //     'factory-v2-41',  'factory-v2-42',  'factory-v2-43',  'factory-v2-44',\n    //     'factory-v2-45',  'factory-v2-46',  'factory-v2-47',  'factory-v2-48',\n    //     'factory-v2-49',  'factory-v2-50',  'factory-v2-51',  'factory-v2-52',\n    //     'factory-v2-53',  'factory-v2-54',  'factory-v2-55',  'factory-v2-56',\n    //     'factory-v2-57',  'factory-v2-58',  'factory-v2-59',  'factory-v2-60',\n    //     'factory-v2-61',  'factory-v2-62',  'factory-v2-63',  'factory-v2-64',\n    //     'factory-v2-65',  'factory-v2-66',  'factory-v2-67',  'factory-v2-68',\n    //     'factory-v2-69',  'factory-v2-70',  'factory-v2-71',  'factory-v2-72',\n    //     'factory-v2-73',  'factory-v2-74',  'factory-v2-75',  'factory-v2-76',\n    //     'factory-v2-77',  'factory-v2-78',  'factory-v2-79',  'factory-v2-80',\n    //     'factory-v2-81',  'factory-v2-82',  'factory-v2-83',  'factory-v2-84',\n    //     'factory-v2-85',  'factory-v2-86',  'factory-v2-87',  'factory-v2-88',\n    //     'factory-v2-89',  'factory-v2-90',  'factory-v2-91',  'factory-v2-92',\n    //     'factory-v2-93',  'factory-v2-94',  'factory-v2-95',  'factory-v2-96',\n    //     'factory-v2-97',  'factory-v2-98',  'factory-v2-99',  'factory-v2-100',\n    //     'factory-v2-101', 'factory-v2-102', 'factory-v2-103', 'factory-v2-104',\n    //     ... 27 more items\n    // ]\n\n    curve.crvUSDFactory.getPoolList();\n    // ['factory-crvusd-0',  'factory-crvusd-1',  'factory-crvusd-2', 'factory-crvusd-3']\n\n    // On Fantom network\n    curve.EYWAFactory.getPoolList();\n    // ['factory-eywa-0',  'factory-eywa-1',  'factory-eywa-2', 'factory-eywa-3']\n    \n    curve.cryptoFactory.getPoolList();\n    // [\n    //     'factory-crypto-0',  'factory-crypto-1',  'factory-crypto-2',\n    //     'factory-crypto-3',  'factory-crypto-4',  'factory-crypto-5',\n    //     'factory-crypto-6',  'factory-crypto-7',  'factory-crypto-8',\n    //     'factory-crypto-9',  'factory-crypto-10', 'factory-crypto-11',\n    //     'factory-crypto-12', 'factory-crypto-13', 'factory-crypto-14',\n    //     'factory-crypto-15', 'factory-crypto-16', 'factory-crypto-17',\n    //     'factory-crypto-18', 'factory-crypto-19', 'factory-crypto-20',\n    //     'factory-crypto-21', 'factory-crypto-22', 'factory-crypto-23',\n    //     'factory-crypto-24', 'factory-crypto-25', 'factory-crypto-26',\n    //     'factory-crypto-27', 'factory-crypto-28', 'factory-crypto-29',\n    //     'factory-crypto-30', 'factory-crypto-31', 'factory-crypto-32',\n    //     'factory-crypto-33', 'factory-crypto-34', 'factory-crypto-35',\n    //     'factory-crypto-36', 'factory-crypto-37', 'factory-crypto-38',\n    //     'factory-crypto-39', 'factory-crypto-40', 'factory-crypto-41',\n    //     'factory-crypto-42', 'factory-crypto-43', 'factory-crypto-44',\n    //     'factory-crypto-45', 'factory-crypto-46', 'factory-crypto-47',\n    //     'factory-crypto-48', 'factory-crypto-49', 'factory-crypto-50',\n    //     'factory-crypto-51', 'factory-crypto-52', 'factory-crypto-53',\n    //     'factory-crypto-54', 'factory-crypto-55', 'factory-crypto-56',\n    //     'factory-crypto-57', 'factory-crypto-58', 'factory-crypto-59',\n    //     'factory-crypto-60', 'factory-crypto-61', 'factory-crypto-62'\n    // ]\n\n    curve.tricryptoFactory.getPoolList();\n    // ['factory-tricrypto-0', 'factory-tricrypto-1']\n\n    curve.getPoolList();\n    // [\n    //     'compound',      'usdt',          'y',             'busd',\n    //     'susd',          'pax',           'ren',           'sbtc',\n    //     'hbtc',          '3pool',         'gusd',          'husd',\n    //     'usdk',          'usdn',          'musd',          'rsv',\n    //     'tbtc',          'dusd',          'pbtc',          'bbtc',\n    //     'obtc',          'seth',          'eurs',          'ust',\n    //     'aave',          'steth',         'saave',         'ankreth',\n    //     'usdp',          'ib',            'link',          'tusd',\n    //     'frax',          'lusd',          'busdv2',        'reth',\n    //     'alusd',         'mim',           'tricrypto2',    'eurt',\n    //     'eurtusd',       'eursusd',       'crveth',        'rai',\n    //     'cvxeth',        'xautusd',       'spelleth',      'teth',\n    //     '2pool',         '4pool',         'fraxusdc',      'euroc',\n    //     'frxeth',        'sbtc2',         'fraxusdp',      'wbeth',\n    //     'factory-v2-2',  'factory-v2-3',  'factory-v2-5',  'factory-v2-7',\n    //     'factory-v2-9',  'factory-v2-10', 'factory-v2-11', 'factory-v2-14',\n    //     'factory-v2-21', 'factory-v2-22', 'factory-v2-23', 'factory-v2-24',\n    //     'factory-v2-25', 'factory-v2-27', 'factory-v2-28', 'factory-v2-29',\n    //     'factory-v2-30', 'factory-v2-31', 'factory-v2-32', 'factory-v2-33',\n    //     'factory-v2-34', 'factory-v2-35', 'factory-v2-37', 'factory-v2-38',\n    //     'factory-v2-41', 'factory-v2-42', 'factory-v2-43', 'factory-v2-44',\n    //     'factory-v2-45', 'factory-v2-47', 'factory-v2-48', 'factory-v2-49',\n    //     'factory-v2-50', 'factory-v2-51', 'factory-v2-52', 'factory-v2-53',\n    //     'factory-v2-55', 'factory-v2-56', 'factory-v2-57', 'factory-v2-58',\n    //     'factory-v2-59', 'factory-v2-60', 'factory-v2-61', 'factory-v2-62',\n    //     ... 493 more items\n    // ]\n})()\n````\n\n### Pool fields\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    await curve.factory.fetchPools();\n    await curve.crvUSDFactory.fetchPools();\n    await curve.EYWAFactory.fetchPools();\n    await curve.cryptoFactory.fetchPools();\n    await curve.tricryptoFactory.fetchPools();\n\n    const pool = curve.getPool('factory-v2-11');\n\n    pool.id;\n    // factory-v2-11\n    pool.name;\n    // FEI Metapool\n    pool.fullName;\n    // Curve.fi Factory USD Metapool: FEI Metapool\n    pool.symbol;\n    // FEI3CRV3CRV-f\n    pool.referenceAsset;\n    // USD\n    pool.address;\n    // 0x06cb22615ba53e60d67bf6c341a0fd5e718e1655\n    pool.lpToken;\n    // 0x06cb22615ba53e60d67bf6c341a0fd5e718e1655\n    pool.gauge;\n    // 0xdc69d4cb5b86388fff0b51885677e258883534ae\n    pool.zap;\n    // 0xa79828df1850e8a3a3064576f380d90aecdd3359\n    pool.sRewardContract;\n    // null\n    pool.rewardContract;\n    // null\n    pool.isPlain;\n    // false\n    pool.isLending;\n    // false\n    pool.isMeta;\n    // true\n    pool.isCrypto;\n    // false\n    pool.isFake;\n    // false\n    pool.isFactory;\n    // true\n    pool.basePool;\n    // 3pool\n    pool.underlyingCoins;\n    // [ 'FEI', 'DAI', 'USDC', 'USDT' ]\n    pool.wrappedCoins;\n    // [ 'FEI', '3Crv' ]\n    pool.underlyingCoinAddresses;\n    // [\n    //     '0x956f47f50a910163d8bf957cf5846d573e7f87ca',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7'\n    // ]\n    pool.wrappedCoinAddresses;\n    // [\n    //     '0x956f47f50a910163d8bf957cf5846d573e7f87ca',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490'\n    // ]\n    pool.underlyingDecimals;\n    // [ 18, 18, 6, 6 ]\n    pool.wrappedDecimals;\n    // [ 18, 18 ]\n    pool.useLending;\n    // [ false, false, false, false ]\n    pool.inApi;\n    // true\n    pool.isGaugeKilled;\n    // false\n    pool.gaugeStatus;\n    // null OR\n    //{\n    //      rewardsNeedNudging: false,\n    //      areCrvRewardsStuckInBridge: false,\n    //\n    // }\n})()\n````\n\n### Wallet balances for pool\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    \n    const saave = curve.getPool('saave');\n    \n    // 1. Current address (signer) balances\n\n    await saave.wallet.balances();\n    // {\n    //     lpToken: '0.0',\n    //     gauge: '0.0',\n    //     '0x6B175474E89094C44Da98b954EedeAC495271d0F': '10000.0',\n    //     '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51': '10000.0',\n    //     '0x028171bCA77440897B824Ca71D1c56caC55b68A3': '10000.00017727177059715',\n    //     '0x6c5024cd4f8a59110119c56f8933403a539555eb': '10000.000080108429034461'\n    // }\n\n\n    await saave.wallet.lpTokenBalances();\n    // { lpToken: '0.0', gauge: '0.0' }\n\n    await saave.wallet.underlyingCoinBalances();\n    // {\n    //     '0x6B175474E89094C44Da98b954EedeAC495271d0F': '10000.0',\n    //     '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51': '10000.0'\n    // }\n\n    await saave.wallet.wrappedCoinBalances();\n    // {\n    //     '0x028171bCA77440897B824Ca71D1c56caC55b68A3': '10000.00017727177059715',\n    //     '0x6c5024cd4f8a59110119c56f8933403a539555eb': '10000.000080108429034461'\n    // }\n\n    await saave.wallet.allCoinBalances();\n    // {\n    //     '0x6B175474E89094C44Da98b954EedeAC495271d0F': '10000.0',\n    //     '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51': '10000.0',\n    //     '0x028171bCA77440897B824Ca71D1c56caC55b68A3': '10000.00017727177059715',\n    //     '0x6c5024cd4f8a59110119c56f8933403a539555eb': '10000.000080108429034461'\n    // }\n\n\n    // 2. For every method above you can specify the address\n    \n    await saave.wallet.balances(\"0x0063046686E46Dc6F15918b61AE2B121458534a5\");\n    // {\n    //     lpToken: '0.0',\n    //     gauge: '0.0',\n    //     '0x6B175474E89094C44Da98b954EedeAC495271d0F': '0.0',\n    //     '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51': '0.0',\n    //     '0x028171bCA77440897B824Ca71D1c56caC55b68A3': '0.0',\n    //     '0x6c5024cd4f8a59110119c56f8933403a539555eb': '0.0'\n    // }\n\n    // Or several addresses\n    await saave.wallet.balances(\"0x0063046686E46Dc6F15918b61AE2B121458534a5\", \"0x66aB6D9362d4F35596279692F0251Db635165871\");\n    // {\n    //     '0x0063046686E46Dc6F15918b61AE2B121458534a5': {\n    //         lpToken: '0.0',\n    //         gauge: '0.0',\n    //         '0x6B175474E89094C44Da98b954EedeAC495271d0F': '0.0',\n    //         '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51': '0.0',\n    //         '0x028171bCA77440897B824Ca71D1c56caC55b68A3': '0.0',\n    //         '0x6c5024cd4f8a59110119c56f8933403a539555eb': '0.0'\n    //     },\n    //     '0x66aB6D9362d4F35596279692F0251Db635165871': {\n    //         lpToken: '0.0',\n    //         gauge: '0.0',\n    //         '0x6B175474E89094C44Da98b954EedeAC495271d0F': '10000.0',\n    //         '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51': '10000.0',\n    //         '0x028171bCA77440897B824Ca71D1c56caC55b68A3': '10000.00017727177059715',\n    //         '0x6c5024cd4f8a59110119c56f8933403a539555eb': '10000.000080108429034461'\n    //     }\n    // }\n})()\n```\n\n### Stats\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    \n    \n    // --- COMPOUND ---\n\n    const compound = curve.getPool('compound');\n    \n    await compound.stats.parameters();\n    // {\n    //     lpTokenSupply: '66658430.461661546713781772',\n    //     virtualPrice: '1.107067773320466717',\n    //     fee: '0.04',\n    //     adminFee: '0.02',\n    //     A: '4500',\n    //     future_A: '4500',\n    //     initial_A: undefined,\n    //     future_A_time: undefined,\n    //     initial_A_time: undefined,\n    //     gamma: undefined\n    // }\n    \n    await compound.stats.underlyingBalances();\n    // [ '66625943.103442629270215258', '33124832.500932' ]\n    \n    await compound.stats.wrappedBalances();\n    // [ '3026076723.05777297', '1464830413.37972924' ]\n\n    await compound.stats.totalLiquidity();\n    // 99836271.3031733\n\n    // --- STETH ---\n    \n    const steth = curve.getPool('steth');\n    \n    await steth.stats.volume();\n    // 174737430.35185483\n\n    await steth.stats.baseApy();\n    // { day: '3.1587592896017647', week: '2.6522145719060752' } (as %)\n    \n    await steth.stats.tokenApy();\n    // [ '0.5918', '1.4796' ] (as %)\n    \n    await steth.stats.rewardsApy();\n    // [\n    //     {\n    //         gaugeAddress: '0x182b723a58739a9c974cfdb385ceadb237453c28',\n    //         tokenAddress: '0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32',\n    //         tokenPrice: 1.023,\n    //         name: 'Lido DAO Token',\n    //         symbol: 'LDO',\n    //         decimals: '18',\n    //         apy: 2.6446376845647155 (as %)\n    //     }\n    // ]\n    \n})()\n````\n\n### Deposit\n```ts\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n\n    const pool = curve.getPool('mim');\n\n    \n    // --- UNDERLYING ---\n\n    \n    await pool.wallet.underlyingCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '10000.0',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '10000.0',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '10000.0',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '10000.0',\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '0.0', gauge: '0.0' }\n\n    await pool.depositBalancedAmounts();\n    // [\n    //     '10000.000000000000000000',\n    //     '785.167649368248476094',\n    //     '771.263652',\n    //     '2234.662927'\n    // ]\n    await pool.depositExpected([100, 100, 100, 100]);\n    // 397.546626854200557344\n    await pool.depositBonus([100, 100, 100, 100]);\n    // 0.04489060058668274\n    await pool.depositIsApproved([100, 100, 100, 100]);\n    // false\n    await pool.depositApprove([100, 100, 100, 100]);\n    // [\n    //     '0xd3bb4266a9004b4c42d41984d65cce65050a216564dcefa852bbe29f0466bc32',\n    //     '0xb2e67fb6cc0d4cef18e918bccf85248a30aa5c318220e8c3887f5f936599e639',\n    //     '0x6d523d348ef1dc24e4a61830476f3c5e4450e8e2c91d903f9e0272efc73f5af8',\n    //     '0xe2c7bd884b91011791d0e979b9511ca035efee60a5c23b7f5623d490250ca4b2'\n    // ]\n    await pool.deposit(['100', '100', '100', '100'], 0.1); // slippage = 0.1 %\n    // 0x8202a2fd645d6b9bc2c6f47aa3475d61bcfd5905def125e8287cb47f3f86db75\n    \n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9900.0',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9900.0',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9900.0',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '9900.0',\n    // }\n    // { lpToken: '397.465346370726773487', gauge: '0.0' }\n    \n    \n    // --- WRAPPED ---\n    \n    \n    await pool.wallet.wrappedCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9900.0',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '100000.0'\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '397.465346370726773487', gauge: '0.0' }\n    \n    await pool.depositWrappedBalancedAmounts();\n    // [ '9900.000000000000000000', '3674.037213475177850341' ]\n    await pool.depositWrappedExpected(['100', '100']);\n    // 200.853415578798484973\n    await pool.depositWrappedBonus([100, 100]);\n    // 0.5057286575144729\n    await pool.depositWrappedIsApproved([100, 100]);\n    // false\n    await pool.depositWrappedApprove([100, 100]);\n    // [\n    //     '0xe8eb519833d417dcd8da1ee3c4fcadf30dece560b7e1977a5f78c995f8e72b4b',\n    //     '0xd7d02b26a052f755bed033a880745ff58775d4668d7620042b6e5973e90ba574'\n    // ]\n    await pool.depositWrapped([100, 100], 0.1); // slippage = 0.1 %\n    // 0x78b943a9a1082cd07ddb0225b070e934740448bfa10444b00cd00e7368ad0601\n    \n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9800.0',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '99900.0'\n    // }\n    // { lpToken: '598.300246031617065027', gauge: '0.0' }\n})()\n```\n\n### Staking\n```ts\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0 });\n\n    const pool = curve.getPool('mim');\n    \n    const balances = await pool.wallet.lpTokenBalances() as IDict<string>;\n    // { lpToken: '598.300246031617065027', gauge: '0.0' }\n    \n    await pool.stakeIsApproved(balances.lpToken);\n    // false\n    await pool.stakeApprove(balances.lpToken);\n    // [\n    //     '0x9d5011800bb4afe82b3a97a56a55762f11b5e999c1de908f38a66f7425c0b0d0'\n    // ]\n    await pool.stake(balances.lpToken);\n    // 0xf884b798be15295f090476eb9d13c46d09d8c05dc0e05d822a34120fa641f645\n\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '0.0', gauge: '598.300246031617065027' }\n    \n    await pool.unstake(balances.lpToken);\n    // 0x802b96921f2fabb433e02489315850a81c1a2e180cd05d84a6d71ce9fc624020\n\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '598.300246031617065027', gauge: '0.0' }\n})()\n```\n\n### Withdraw\n```ts\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n\n    const pool = curve.getPool('mim');\n\n    // --- UNDERLYING ---\n\n    await pool.wallet.underlyingCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9800.0',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9900.0',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9900.0',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '9900.0'\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '598.300246031617065027', gauge: '0.0' }\n\n    await pool.withdrawExpected(10);\n    // [\n    //     '7.299072252784503555',\n    //     '0.573101727634383933',\n    //     '0.562953',\n    //     '1.631103'\n    // ]\n    await pool.withdrawIsApproved(10);\n    // false\n    await pool.withdrawApprove(10);\n    // [\n    //     '0xbc72529f860eab00ae6e72234a68c48c9bfa8e093813ecf6796d46de419badca'\n    // ]\n    await pool.withdraw('10', 0.1); // slippage = 0.1 %\n    // 0x4dc3add45566e0f3404c2fa0b7aa27203688833ffbe9b985f36bf785d19e4fad\n\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9807.299072252784503555',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9900.573101727634383932',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9900.562953',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '9901.631102'\n    // }\n    // { lpToken: '588.300246031617065027', gauge: '0.0' }\n\n    // --- WRAPPED ---\n\n    await pool.wallet.wrappedCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9807.299072252784503555',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '99900.0'\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '588.300246031617065027', gauge: '0.0' }\n\n    await pool.withdrawWrappedExpected('10');\n    // [ '7.299072252784503555', '2.708796226980363129' ]\n    await pool.withdrawWrapped(10); // slippage = 0.5 % by default\n    // 0x61f7b602bc52d20fdf473c8dd8cbea12f11918fdbd74c496235887c70321395a\n    \n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9814.59814450556900711',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '99902.708796226980363129'\n    // }\n    // { lpToken: '578.300246031617065027', gauge: '0.0' }\n})()\n```\n\n### Withdraw imbalance\n```ts\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n\n    const pool = curve.getPool('mim');\n\n    // --- UNDERLYING ---\n\n    await pool.wallet.underlyingCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9814.59814450556900711',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9900.573101727634383932',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9900.562953',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '9901.631102'\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '578.300246031617065027', gauge: '0.0' }\n\n    await pool.withdrawImbalanceExpected(['10', '10', '10', '10']);\n    // 39.754662629184493064\n    await pool.withdrawImbalanceBonus(['10', '10', '10', '10']);\n    // -0.04487324436377509\n    await pool.withdrawImbalanceIsApproved(['10', '10', '10', '10']);\n    // true\n    await pool.withdrawImbalanceApprove(['10', '10', '10', '10']);\n    // []\n    await pool.withdrawImbalance(['10', '10', '10', '10'], 0.1); // slippage = 0.1 %\n    // 0xfba4dfb47cd5692ef01608e7b04439ec211cb28430b488e60fee5cadb77ac321\n\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9824.59814450556900711',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9910.573101727634383932',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9910.562953',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '9911.631102'\n    // }\n    // { lpToken: '538.537454267261447723', gauge: '0.0' }\n\n    // --- WRAPPED ---\n\n    await pool.wallet.wrappedCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9824.59814450556900711',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '99902.708796226980363129'\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '538.537454267261447723', gauge: '0.0' }\n\n    await pool.withdrawImbalanceWrappedExpected(['10', '10']);\n    // 20.085341556879117658\n    await pool.withdrawImbalanceWrappedBonus(['10', '10']);\n    // -0.5031837243343519\n    await pool.withdrawImbalanceWrapped(['10', '10'], 0.1); // slippage = 0.1 %\n    // 0xb9e6174695152d7dbe274fec969ffd2d62c994cdbf58455e9954cddd0a8f7189\n\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9834.59814450556900711',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '99912.708796226980363129'\n    // }\n    // { lpToken: '518.450261119283204342', gauge: '0.0' }\n})()\n```\n\n### Withdraw one coin\n```ts\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n\n    const pool = curve.getPool('mim');\n\n    \n    // --- UNDERLYING ---\n\n    \n    await pool.wallet.underlyingCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9834.59814450556900711',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9910.573101727634383932',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9910.562953',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '9911.631102'\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '518.450261119283204342', gauge: '0.0' }\n\n    const underlyingExpected = await pool.withdrawOneCoinExpected(10, 'DAI');\n    // OR const underlyingExpected = await pool.withdrawOneCoinExpected('10', '0x6B175474E89094C44Da98b954EedeAC495271d0F');\n    // OR const underlyingExpected = await pool.withdrawOneCoinExpected('10', 1);\n    console.log(underlyingExpected);\n    // 10.053583529099204888\n    await pool.withdrawOneCoinBonus(10, 'DAI');\n    // -0.1256449500769996\n    await pool.withdrawOneCoinIsApproved(10);\n    // true\n    await pool.withdrawOneCoinApprove(10);\n    // []\n    const underlyingTx = await pool.withdrawOneCoin(10, 'DAI', 0.1);\n    // OR const underlyingTx = await pool.withdrawOneCoin('10', '0x6B175474E89094C44Da98b954EedeAC495271d0F');\n    // OR const underlyingTx = await pool.withdrawOneCoin('10', 1);\n    console.log(underlyingTx);\n    //0x5b4c5ec49f53719b5440355439a2cad445935895b5c1034ae6092ebbe17f0328\n\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9834.59814450556900711',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9920.62668525673358882',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9910.562953',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '9911.631102'\n    // }\n    // { lpToken: '508.450261119283204342', gauge: '0.0' }\n\n    \n    // --- WRAPPED ---\n\n    \n    await pool.wallet.wrappedCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9834.59814450556900711',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '99912.708796226980363129'\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '508.450261119283204342', gauge: '0.0' }\n\n    const wrappedExpected = await pool.withdrawOneCoinWrappedExpected('10', 'MIM');\n    // OR const wrappedExpected = await pool.withdrawOneCoinWrappedExpected('10', '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3');\n    // OR const wrappedExpected = await pool.withdrawOneCoinWrappedExpected('10', 0);\n    console.log(wrappedExpected)\n    // 10.066854269984687383\n    await pool.withdrawOneCoinWrappedBonus(10, 'MIM');\n    // 0.5893939242941038\n    const wrappedTx = await pool.withdrawOneCoinWrapped('10', 'MIM', 0.1);\n    // OR await pool.withdrawOneCoinWrapped('10', '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3');\n    // OR await pool.withdrawOneCoinWrapped('10', 0);\n    console.log(wrappedTx);\n    // 0xf82af519a3e4f0743c89fd1e93982934f1a2dde721221b00dd474f6b0a24f7f2\n\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9844.664998775553694493',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '99912.708796226980363129'\n    // }\n    // { lpToken: '498.450261119283204342', gauge: '0.0' }\n})()\n```\n\n### Swap\n```ts\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n\n    const pool = curve.getPool('mim');\n\n    \n    // --- UNDERLYING ---\n\n    \n    await pool.wallet.underlyingCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9844.882755243317396535',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9930.611305190224186298',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9910.562953',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '9911.631102'\n    // }\n\n    const underlyingExpected = await pool.swapExpected('MIM','DAI', 10);\n    // OR const underlyingExpected = await pool.swapExpected('0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '10');\n    // OR const underlyingExpected = await pool.swapExpected(0, 1, '10');\n    console.log(underlyingExpected);\n    // 9.984619933234026875\n    const underlyingRequired = await pool.swapRequired('MIM', 'DAI', 10);\n    // OR const underlyingRequired = await pool.swapRequired('0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '10');\n    // OR const underlyingRequired = await pool.swapRequired(0, 1, '10');\n    console.log(underlyingRequired);\n    //10.049378645129545758\n    const underlyingPriceImpact = await pool.swapPriceImpact('MIM','DAI', 10);\n    // OR const underlyingPriceImpact = await pool.swapPriceImpact('0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '10');\n    // OR const underlyingPriceImpact = await pool.swapPriceImpact(0, 1, '10');\n    console.log(underlyingPriceImpact);\n    // 0.000026 (as %)\n    await pool.swapIsApproved('MIM', 10);\n    // true\n    await pool.swapApprove('MIM', 10);\n    // []\n    const swapTx = await pool.swap('MIM','DAI', 10, 0.1);\n    // OR const swapTx = await pool.swap('0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '10');\n    // OR const swapTx = await pool.swap(0, 1, 10);\n    console.log(swapTx);\n    // 0xbcd0d1248e6a8571c2a45d4f7095bc1fece479b6e87219cdd7d239c4e1e0ca32\n\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9834.882755243317396535',\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9940.595925123458213173',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9910.562953',\n    //     '0xdac17f958d2ee523a2206206994597c13d831ec7': '9911.631102'\n    // }\n\n    \n    // --- WRAPPED ---\n\n    \n    await pool.wallet.wrappedCoinBalances();\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9834.882755243317396535',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '99902.708796226980363129'\n    // }\n\n    const wrappedExpected = await pool.swapWrappedExpected('3crv','MIM', 10);\n    // OR const wrappedExpected = await pool.swapWrappedExpected('0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490', '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3', '10');\n    // OR const wrappedExpected = await pool.swapWrappedExpected(1, 0, '10');\n    console.log(wrappedExpected);\n    // 10.217756467720521951\n    const wrappedRequired = await pool.swapWrappedRequired('3crv', 'MIM', 10);\n    // OR const wrappedRequired = await pool.swapWrappedRequired('0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490', '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3', '10');\n    // OR const wrappedRequired = await pool.swapWrappedRequired(1, 0, '10');\n    console.log(wrappedRequired);\n    //9.702940994847188442\n    const wrappedPriceImpact = await pool.swapWrappedPriceImpact('3crv','MIM', 10);\n    // OR const wrappedPriceImpact = await pool.swapWrappedPriceImpact('0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490', '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3', '10');\n    // OR const wrappedPriceImpact = await pool.swapWrappedPriceImpact(1, 0, '10');\n    console.log(wrappedPriceImpact);\n    // 0.000081 (as %)\n    await pool.swapWrappedIsApproved('3crv', 10);\n    // true\n    await pool.swapWrappedApprove('3crv', 10);\n    // []\n    const swapWrappedTx = await pool.swapWrapped('3crv','MIM', 10, 0.1);\n    // OR const swapWrappedTx = await pool.swapWrapped('0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490', '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3', '10');\n    // OR const swapWrappedTx = await pool.swapWrapped(1, 0, '10');\n    console.log(swapWrappedTx);\n    // 0x59ff5e44f083b57a1f612c1ad5ac7d3fe68b4c753ddd6400ab8bd6437485288c\n\n    // {\n    //     '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3': '9845.100511711037918486',\n    //     '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490': '99892.708796226980363129'\n    // }\n})()\n```\n\n### Deposit & Stake\n```ts\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    \n    curve.hasDepositAndStake()\n    // true\n    \n    const pool = curve.getPool('compound');\n    const amounts = [1000, 1000];\n\n    \n    // --- UNDERLYING ---\n    \n    \n    await pool.wallet.underlyingCoinBalances();\n    // {\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '10000.0',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '10000.0',\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '0.0', gauge: '0.0' }\n    \n    await pool.depositAndStakeExpected(amounts);\n    // 1820.604572902286288394\n    await pool.depositAndStakeBonus(amounts);\n    // 0.0030482584681188\n    await pool.depositAndStakeIsApproved(amounts);\n    // false\n    await pool.depositAndStakeApprove(amounts);\n    // [\n    //     '0xb363c95fb8e63f724d6a05dfa756ede38132ce3fc8faf80306d925856996669c',\n    //     '0x53d01fd54fb607091c67f8b39ff9e2e7670396d831b856b1979caaa6ac6ea37b',\n    //     '0xd69ca27c30fa6e5ba927d0382987f142895481710439dae358a1daeeb01c7248'\n    // ]\n    await pool.depositAndStake(amounts);\n    // 0x3ec53842120be75f51e907803da844f4d3e8435766e0c25a40700085ed5b56c4\n\n    // {\n    //     '0x6b175474e89094c44da98b954eedeac495271d0f': '9000.0',\n    //     '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': '9000.0',\n    // }\n    // { lpToken: '0.0', gauge: '1820.556829935710883568' }\n\n    \n    // --- WRAPPED ---\n    \n    \n    await pool.wallet.wrappedCoinBalances();\n    // {\n    //     '0x5d3a536e4d6dbd6114cc1ead35777bab948e3643': '10000.0',\n    //     '0x39aa39c021dfbae8fac545936693ac917d5e7563': '10000.0'\n    // }\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '0.0', gauge: '1820.556829935710883568' }\n\n    await pool.depositAndStakeWrappedExpected(amounts);\n    // 40.328408669183101673\n    await pool.depositAndStakeWrappedBonus(amounts);\n    // 0.46040576921447873\n    await pool.depositAndStakeWrappedIsApproved(amounts);\n    // false\n    await pool.depositAndStakeWrappedApprove(amounts);\n    // [\n    //     '0x53035c46f877ed4d156aff5aee0f8e04c0e0701e40651e9e55f41976919b093d',\n    //     '0x4743386669a6a21fbe09805ae50e281db22cf518d681ee1e5d0f81a1d761e79b',\n    //     '0x8580b6bd88dfd0eeab77480e50d82ba14922fd4b431b0123a7ac425236e1db3a'\n    // ]\n    await pool.depositAndStakeWrapped(amounts);\n    // 0xdb73e3176ab876806f99f71d70ad6ee93d7a865c15faa062ebaba2011b94b315\n\n    // {\n    //     '0x5d3a536e4d6dbd6114cc1ead35777bab948e3643': '9000.0',\n    //     '0x39aa39c021dfbae8fac545936693ac917d5e7563': '9000.0'\n    // }\n    // { lpToken: '0.0', gauge: '1860.884096082215274556' }\n})();\n```\n\n\n## Router\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    await curve.factory.fetchPools();\n    await curve.crvUSDFactory.fetchPools();\n    await curve.EYWAFactory.fetchPools();\n    await curve.cryptoFactory.fetchPools();\n    await curve.tricryptoFactory.fetchPools();\n\n    curve.hasRouter();\n    // true\n\n    await curve.getBalances(['DAI', 'CRV']);\n    // [ '9900.0', '100049.744832225238317557' ]\n\n    const { route, output } = await curve.router.getBestRouteAndOutput('DAI', 'CRV', '1000');\n    // OR await curve.router.getBestRouteAndOutput('0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xD533a949740bb3306d119CC777fa900bA034cd52', '1000');\n    const expected = await curve.router.expected('DAI', 'CRV', '1000');\n    // OR await curve.router.expected('0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xD533a949740bb3306d119CC777fa900bA034cd52', '1000');\n    const required = await curve.router.required('DAI', 'CRV', expected);\n    // OR await curve.router.required('0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xD533a949740bb3306d119CC777fa900bA034cd52', expected);\n    const priceImpact = await curve.router.priceImpact('DAI', 'CRV', '1000');\n    // OR await curve.router.priceImpact('0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xD533a949740bb3306d119CC777fa900bA034cd52', '1000');\n    const args = curve.router.getArgs(route);\n\n    console.log(route, output, expected, required, priceImpact, args);\n    // route = [\n    //     {\n    //         poolId: 'mim',\n    //         swapAddress: '0x5a6a4d54456819380173272a5e8e9b9904bdf41b',\n    //         inputCoinAddress: '0x6b175474e89094c44da98b954eedeac495271d0f',\n    //         outputCoinAddress: '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3',\n    //         swapParams: [ 1, 0, 2, 1, 4 ],\n    //         poolAddress: '0x5a6a4d54456819380173272a5e8e9b9904bdf41b',\n    //         basePool: '0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7',\n    //         baseToken: '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490',\n    //         secondBasePool: '0x0000000000000000000000000000000000000000',\n    //         secondBaseToken: '0x0000000000000000000000000000000000000000'\n    //     },\n    //     {\n    //         poolId: 'factory-crvusd-6',\n    //         swapAddress: '0xbe426b0f37c112dd20d5866769c8034171567b31',\n    //         inputCoinAddress: '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3',\n    //         outputCoinAddress: '0xf939e0a03fb07f59a73314e73794be0e57ac1b4e',\n    //         swapParams: [ 0, 1, 1, 1, 2 ],\n    //         poolAddress: '0xbe426b0f37c112dd20d5866769c8034171567b31',\n    //         basePool: '0x0000000000000000000000000000000000000000',\n    //         baseToken: '0x0000000000000000000000000000000000000000',\n    //         secondBasePool: '0x0000000000000000000000000000000000000000',\n    //         secondBaseToken: '0x0000000000000000000000000000000000000000'\n    //     },\n    //     {\n    //         poolId: 'factory-tricrypto-4',\n    //         swapAddress: '0x4ebdf703948ddcea3b11f675b4d1fba9d2414a14',\n    //         inputCoinAddress: '0xf939e0a03fb07f59a73314e73794be0e57ac1b4e',\n    //         outputCoinAddress: '0xd533a949740bb3306d119cc777fa900ba034cd52',\n    //         swapParams: [ 0, 2, 1, 3, 3 ],\n    //         poolAddress: '0x4ebdf703948ddcea3b11f675b4d1fba9d2414a14',\n    //         basePool: '0x0000000000000000000000000000000000000000',\n    //         baseToken: '0x0000000000000000000000000000000000000000',\n    //         secondBasePool: '0x0000000000000000000000000000000000000000',\n    //         secondBaseToken: '0x0000000000000000000000000000000000000000'\n    //     }\n    // ]\n    // \n    // output = expected = 2359.161199223806107003\n    // required = 999.898950158673335108\n    // priceImpact = 0.158012 %\n    //\n    // args = {\n    //     _route: [\n    //         '0x6b175474e89094c44da98b954eedeac495271d0f',\n    //         '0x5a6a4d54456819380173272a5e8e9b9904bdf41b',\n    //         '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3',\n    //         '0xbe426b0f37c112dd20d5866769c8034171567b31',\n    //         '0xf939e0a03fb07f59a73314e73794be0e57ac1b4e',\n    //         '0x4ebdf703948ddcea3b11f675b4d1fba9d2414a14',\n    //         '0xd533a949740bb3306d119cc777fa900ba034cd52',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000'\n    //     ],\n    //         _swapParams: [\n    //         [ 1, 0, 2, 1, 4 ],\n    //         [ 0, 1, 1, 1, 2 ],\n    //         [ 0, 2, 1, 3, 3 ],\n    //         [ 0, 0, 0, 0, 0 ],\n    //         [ 0, 0, 0, 0, 0 ]\n    //     ],\n    //         _pools: [\n    //         '0x5a6a4d54456819380173272a5e8e9b9904bdf41b',\n    //         '0xbe426b0f37c112dd20d5866769c8034171567b31',\n    //         '0x4ebdf703948ddcea3b11f675b4d1fba9d2414a14',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000'\n    //     ],\n    //         _basePools: [\n    //         '0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000'\n    //     ],\n    //         _baseTokens: [\n    //         '0x6c3f90f043a72fa612cbac8115ee7e52bde6e490',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000'\n    //     ],\n    //         _secondBasePools: [\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000'\n    //     ],\n    //         _secondBaseTokens: [\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000',\n    //         '0x0000000000000000000000000000000000000000'\n    //     ]\n    // }\n\n\n    await curve.router.isApproved('DAI', 1000);\n    // false\n    await curve.router.approve('DAI', 1000);\n    // [\n    //     '0xc111e471715ae6f5437e12d3b94868a5b6542cd7304efca18b5782d315760ae5'\n    // ]\n    const swapTx = await curve.router.swap('DAI', 'CRV', '1000');\n    // OR const swapTx = await curve.router.swap('0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xD533a949740bb3306d119CC777fa900bA034cd52', '1000');\n    console.log(swapTx.hash);\n    // 0xc7ba1d60871c0295ac5471bb602c37ec0f00a71543b3a041308ebd91833f26ba\n    const swappedAmount = await curve.router.getSwappedAmount(swapTx, 'CRV');\n    // 1573.668171170839785062\n\n    await curve.getBalances(['DAI', 'CRV']);\n    // [ '8900.0', '100428.626463428100672494' ]\n})()\n```\n\n## Boosting\n\n### Lock\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n\n    await curve.boosting.getCrv();\n    // 100000.0\n    await curve.boosting.getLockedAmountAndUnlockTime();\n    // { lockedAmount: '0.0', unlockTime: 0 }\n    await curve.boosting.getVeCrv();\n    // 0.0\n    await curve.boosting.getVeCrvPct();\n    // 0.000000000000000000\n\n    curve.boosting.isApproved(1000);\n    // false \n    curve.boosting.approve(1000);\n    // [\n    //     '0x07f6daedb705446cb56ab42c18ba9ec5302ef5ed9c7ef0bb5c3c92493abcfc79'\n    // ]\n    \n    curve.boosting.calcUnlockTime(365);  // now (by default) + 365 days, rounded down by WEEK\n    // 1657152000000\n    await curve.boosting.createLock(1000, 365);\n    // 99000.0 CRV\n    // { lockedAmount: '1000.0', unlockTime: 1657152000000 }\n    // 248.193183980208499221\n    // 0.000006190640156035\n\n    await curve.boosting.increaseAmount('500');\n    // 98500.0 CRV\n    // { lockedAmount: '1500.0', unlockTime: 1657152000000 }\n    // 372.289692732093137414 veCRV\n    // 0.000009285953543912 veCRV %\n\n    const { unlockTime: currentUnlockTime } = await curve.boosting.getLockedAmountAndUnlockTime();\n    curve.boosting.calcUnlockTime(365, currentUnlockTime);  // currentUnlockTime + 365 days, rounded down by WEEK\n    // 1688601600000\n    await curve.boosting.increaseUnlockTime(365);\n    // 98500.0 CRV\n    // { lockedAmount: '1500.0', unlockTime: 1688601600000 }\n    // 746.262271689452535192 veCRV\n    // 0.000018613852077810 veCRV %\n})()\n```\n### Claim fees\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {});\n\n    await curve.getBalances(['3crv']);\n    // ['0.0']\n    await curve.boosting.claimableFees();\n    // 1.30699696445248888\n\n    await curve.boosting.claimFees();\n\n    await curve.getBalances(['3crv']);\n    // ['1.30699696445248888']\n    await curve.boosting.claimableFees();\n    // 0.0\n})()\n```\n### Sidechain\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n\n    // --- SIDECHAIN ---\n\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n\n    await curve.boosting.sidechain.lastEthBlock();\n    // 16931944\n    \n    await curve.boosting.sidechain.getAnycallBalance();\n    // 0.033837278711248954\n    await curve.boosting.sidechain.topUpAnycall(0.1);\n    await curve.boosting.sidechain.getAnycallBalance();\n    // 0.133837278711248954\n\n\n    // --- MAINNET (ETHEREUM) ---\n\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    await curve.boosting.sidechain.lastBlockSent(137); // Polygon\n    // 17038505\n    const blockToSend = await curve.boosting.sidechain.blockToSend();  // currentBlock - 128\n    // 17377005\n    await curve.boosting.sidechain.sendBlockhash(blockToSend, 137); // Polygon\n\n    // --- SIDECHAIN ---\n    \n    // Wait until blockhash is delivered\n    \n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    const lastEthBlock = await curve.boosting.sidechain.lastEthBlock();\n    // 17377005\n    await curve.boosting.sidechain.submitProof(lastEthBlock, \"0x33A4622B82D4c04a53e170c638B944ce27cffce3\");\n})()\n```\n\n\n## CRV. Profit, claim, boosting\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0 });\n\n    const pool = curve.getPool('compound');\n\n    await pool.depositAndStake([1000, 1000]);\n    await pool.crvProfit();\n    // {\n    //     day: '0.01861607837347995222',\n    //     week: '0.13031254861435966551',\n    //     month: '0.55848235120439856649',\n    //     year: '6.79486860632018255891',\n    //     token: '0xd533a949740bb3306d119cc777fa900ba034cd52',\n    //     symbol: 'CRV',\n    //     price: 0.978134\n    // }\n    await pool.stats.tokenApy();\n    // [ '0.3324', '0.8309' ]\n    await pool.userCrvApy();\n    // 0.3324\n    await pool.boost();\n    // 1.0\n\n    await curve.boosting.createLock(10000, 365 * 4);\n    await pool.depositAndStake([1000, 1000]);\n    // crvProfit = {\n    //     day: '0.05703837081508656944',\n    //     week: '0.39926859570560598606',\n    //     month: '1.7111511244525970831',\n    //     year: '20.81900534750659784443',\n    //     token: '0xd533a949740bb3306d119cc777fa900ba034cd52',\n    //     symbol: 'CRV',\n    //     price: 0.978134\n    // }\n    //\n    // currentApy = 0.5092\n    // boost = 1.532\n\n    await pool.wallet.lpTokenBalances();\n    // { lpToken: '0.0', gauge: '3610.795806899650569624' }\n    await pool.maxBoostedStake();\n    // 1281.660714834072909477\n\n    // ------ Wait some time... ------\n    await pool.claimableCrv();\n    // 0.4085482040149887\n    await pool.claimCrv();\n    // claimableCrv = 0.0\n})()\n```\n\n## Rewards. Profit and claim\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    \n    const pool = curve.getPool('susd');\n\n    await pool.rewardTokens();\n    // [\n    //     {\n    //         token: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f',\n    //         symbol: 'SNX',\n    //         decimals: 18\n    //     }\n    // ]\n    await pool.depositAndStake([1000, 1000, 1000, 1000]);\n    await pool.rewardsProfit();\n    // [\n    //     {\n    //         day: '0.02387645750842563304',\n    //         week: '0.16713520255897943129',\n    //         month: '0.71629372525276899123',\n    //         year: '8.71490699057535605995',\n    //         token: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f',\n    //         symbol: 'SNX',\n    //         price: 2.61\n    //     }\n    // ]\n    \n    // ------ Wait some time... ------\n    \n    await pool.claimableRewards();\n    // [\n    //     {\n    //         token: '0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F',\n    //         symbol: 'SNX',\n    //         amount: '0.000596325465987726'\n    //     }\n    // ]\n    await pool.claimRewards();\n    // claimableRewards = [\n    //     {\n    //         token: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f',\n    //         symbol: 'SNX',\n    //         amount: '0.0'\n    //     }\n    // ]\n})()\n```\n## User balances, base profit and share\n```ts\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0 });\n\n    const pool = curve.getPool('frax');\n\n    await pool.deposit([1000, 1000, 1000, 1000]);\n    // { lpToken: '3967.761942945398518479', gauge: '0.0' }\n    await pool.stake(2000);\n    // { lpToken: '1967.761942945398518479', gauge: '2000.0' }\n\n    await pool.userBalances();\n    // [\n    //     '2489.266644542275414077',\n    //     '276.21290758040371998',\n    //     '280.160024',\n    //     '955.058471'\n    // ]\n    await pool.userWrappedBalances();\n    // [ '2489.266644542275414077', '1479.135765218522838249' ]\n    await pool.userLiquidityUSD();\n    // 4003.16466431\n    await pool.baseProfit();\n    // {\n    //     day: '0.01476134356908610233',\n    //     week: '0.1036132769753159106',\n    //     month: '0.44899086689303561258',\n    //     year: '5.38789040271642735101374407'\n    // }\n    await pool.userShare();\n    // {\n    //     lpUser: '3967.761942945398518479',\n    //     lpTotal: '1124490985.047288488832152598',\n    //     lpShare: '0.000352849600015116',\n    //     gaugeUser: '2000.0',\n    //     gaugeTotal: '1123703753.306098922471106555',\n    //     gaugeShare: '0.000177982853053192'\n    // }\n})()\n````\n\n## Gas estimation\nEvery non-constant method has corresponding gas estimation method. Rule: ```obj.method -> obj.estimateGas.method```\n\n**Examples**\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0 });\n    \n    const spender = \"0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7\" // 3pool swap address\n    await curve.estimateGas.ensureAllowance([\"DAI\", \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\"], [1000, 1000], spender);\n    // 94523\n    \n    const pool = curve.getPool('usdn');\n    await pool.estimateGas.depositApprove([\"1000\", \"1000\", \"1000\", \"1000\"]);\n    // 186042\n    await pool.estimateGas.deposit([\"1000\", \"1000\", \"1000\", \"1000\"]);\n    // 679238\n    \n    await curve.router.estimateGas.swap('DAI', \"WBTC\", \"1000\");\n    // 476904\n    await curve.boosting.estimateGas.createLock('1000', 365);\n    // 324953\n})()\n```\n\n## Gas estimation L2\n\n**Only for OPTIMISM and BASE!**\n\nArbitrium is also L2 network, but for estimateGas should use default method `estimateGas`, which return `Number`.\n\nFor L2 networks `estimateGas` return array `[L2GasUsed, L1GasUsed]`, where `L2GasUsed` -  gas estimate for execution transaction in current L2 network, and `L1GasUsed` - gas estimate for data storage in parent L1 network.\n\nGas Price in L1 is required to calculate the fee.\nYou can use `getGasPriceFromL1` for get Gas Price in L1.\n````ts\n const L1GasPrice = await curve.getGasPriceFromL1()\n // 23348207475\n````\n\n**Calculate fee**\n`fee = L2GasUsed*L2GasPrice + L1GasUsed*L1GasPrice`\n\nFor OP and Base networks you can get `L2GasPrice` from `curve.getGasPriceFromL2`\n````ts\n const L2GasPrice = await curve.getGasPriceFromL2()\n // 13161051\n````\n\n\n## Factory\n\n### Fetch new pools from blockchain\n\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0 });\n\n    // Fetch pools from api (if false arg is not passed)\n    await curve.factory.fetchPools();\n    await curve.cryptoFactory.fetchPools();\n    await curve.tricryptoFactory.fetchPools();\n\n    // Fetch very new pools (that haven't been added to api yet) from blockchain\n    await curve.factory.fetchNewPools();\n    // [ 'factory-v2-285' ]\n    await curve.cryptoFactory.fetchNewPools();\n    // [ 'factory-crypto-232' ]\n    await curve.tricryptoFactory.fetchNewPools();\n    // [ 'factory-tricrypto-2' ]\n})()\n```\n\n### Deploy stable plain pool\n\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0 });\n\n    const coins = [\n        \"0x1456688345527bE1f37E9e627DA0837D6f08C925\", // USDP\n        \"0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3\", // MIM\n        \"0x5f98805A4E8be255a32880FDeC7F6728C6568bA0\", // LUSD\n    ];\n\n    // Deploy pool\n    \n    const deployPoolTx = await curve.factory.deployPlainPool('Test pool', 'TST', coins, 200, 0.1, 0, 1);\n    // {\n    //     hash: '0xb84206f6a17488459d8dfc9a9f41ae89c71d1920b7aa87ad2eefd3171ba5166c',\n    //     type: 0,\n    //     accessList: null,\n    //     blockHash: '0xf1c7d05a7cebfe2331cca0e8ce0e7b45aac2097934a23c73f6e0b16fac0a9b5f',\n    //     blockNumber: 15839419,\n    //     transactionIndex: 0,\n    //     confirmations: 1,\n    //     from: '0x66aB6D9362d4F35596279692F0251Db635165871',\n    //     gasPrice: BigNumber { _hex: '0x00', _isBigNumber: true },\n    //     gasLimit: BigNumber { _hex: '0x1037c4', _isBigNumber: true },\n    //     to: '0xB9fC157394Af804a3578134A6585C0dc9cc990d4',\n    //         value: BigNumber { _hex: '0x00', _isBigNumber: true },\n    //     nonce: 12,\n    //         data: '0x52f2db69000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000001456688345527be1f37e9e627da0837d6f08c92500000000000000000000000099d8a9c45b2eca8864373a26d1459e3dff1e17f30000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000009896800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000095465737420706f6f6c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035453540000000000000000000000000000000000000000000000000000000000',\n    //     r: '0x0f8f0277c982e1cf3153fd5a63a104a0338bf907fdb270589dc847c6f4b6600d',\n    //     s: '0x32e2f279f759673e5254b893539cfe1258338f177e892b46e1edb7b73e869a3d',\n    //     v: 38,\n    //     creates: null,\n    //     chainId: 1,\n    //     wait: [Function (anonymous)]\n    // }\n    const poolAddress = await curve.factory.getDeployedPlainPoolAddress(deployPoolTx);\n    // 0xa77b5d170f3aec2f72ca06490a7b9383a70ae5eb\n\n    // Deploy gauge\n    \n    console.log(curve.factory.gaugeImplementation());\n    // 0x5aE854b098727a9f1603A1E21c50D52DC834D846\n    \n    const deployGaugeTx = await curve.factory.deployGauge(poolAddress);\n    // {\n    //     hash: '0x8bb0eb63430e6c522c30922a833fee263816ebc0f30367d53ecfe52e17b7c3a0',\n    //     type: 0,\n    //     accessList: null,\n    //     ...\n    // }\n    const gaugeAddress = await curve.factory.getDeployedGaugeAddress(deployGaugeTx);\n    // 0x1400e08f1d9f5bc90ae19acd4bf81beabc9e79de\n\n    // Deposit & Stake\n\n    const poolId = await curve.factory.fetchRecentlyDeployedPool(poolAddress);\n    // factory-v2-221\n    const pool = curve.getPool(poolId);\n\n    await pool.depositAndStake([10, 10, 10]); // Initial amounts for stable pool must be equal\n    const balances = await pool.stats.underlyingBalances();\n    // [ '10.0', '10.0', '10.0' ]\n})()\n```\n\n### Deploy stable-ng plain pool\n\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0 });\n\n    const coins = [\n        \"0xae7ab96520de3a18e5e111b5eaab095312d7fe84\", // stETH\n        \"0xac3e018457b222d93114458476f3e3416abbe38f\", // sfrxETH\n    ];\n\n    //0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626\n    const assetTypes = [2, 1] as Array<0 | 1 | 2 | 3>;\n\n    const oracleAddresses = [\n        '0x0000000000000000000000000000000000000000',\n        '0xac3e018457b222d93114458476f3e3416abbe38f',\n    ];\n\n    const methodNames = [\n        '',\n        'pricePerShare',\n    ];\n    // OR \n    //const methodNames = [\n    //  '0x00000000',\n    //  'pricePerShare',\n    //];\n    \n    \n    // Deploy pool\n    \n    const deployPoolTx = await curve.stableNgFactory.deployPlainPool('Test pool', 'test', coins, 5, 0.05, 5, assetTypes, 0, 600, oracleAddresses, methodNames);\n    // {\n    //     accessList:null\n    //     blockHash: \"0x981c86a28d1e4a675dae3e14868d62683c02c7906082ba78f5304a45cfd55c38\"\n    //     blockNumber: 18628729\n    //     chainId: 1n\n    //     data: \"0x5bcd3d83000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000004c4b40000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000002580000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000095465737420706f6f6c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000474657374000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84000000000000000000000000ac3e018457b222d93114458476f3e3416abbe38f00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000d8a452bc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ac3e018457b222d93114458476f3e3416abbe38f\"\n    //     from: \"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\"\n    //     gasLimit: 7046085n\n    //     gasPrice: 0n\n    //     hash: \"0xcbd866d6c4c6294b33d5797bdbf5666aad99a4f7fd461f472aeb95121929242b\"\n    //     index: undefined\n    //     maxFeePerGas: null\n    //     maxPriorityFeePerGas: null\n    //     nonce: 565\n    //     to: \"0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf\"\n    //     type: 0\n    //     value: 0n\n    // }\n    \n    const poolAddress = await curve.stableNgFactory.getDeployedPlainPoolAddress(deployPoolTx);\n    // 0x0816bc9ced716008c88bb8940c297e9c9167755e\n})()\n```\n\n### Deploy stable meta pool\n\n```ts\nimport curve from \"@curvefi/api\";\n\n(async () => {\n    await curve.init('JsonRpc', {}, { gasPrice: 0 });\n\n    const basePool = \"0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7\";  // 3pool address\n    const coin = \"0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3\"; // MIM\n\n    // Deploy pool\n    \n    const deployPoolTx = await curve.factory.deployMetaPool(basePool, 'Test pool', 'TST', coin, 200, 0.1, 0);\n    // {\n    //     hash: '0xac49dead008ccc04988e513a8502dea35bad721b0c79fa1503054541ee51ea90',\n    //     type: 0,\n    //     accessList: null,\n    //     ...\n    // }\n    const poolAddress = await curve.factory.getDeployedMetaPoolAddress(deployPoolTx);\n    // 0xd87f26c2f658657779e452dd043df9b2751ae7c4\n\n    // Deploy gauge\n\n    console.log(curve.factory.gaugeImplementation());\n    // 0x5aE854b098727a9f1603A1E21c50D52DC834D846\n    \n    const deployGaugeTx = await curve.factory.deployGauge(poolAddress);\n    // {\n    //     hash: '0x37a53a08d6c71095de8c25bcd4a01b39beec35990f77c7b98355bd064511541f',\n    //     type: 0,\n    //     accessList: null,\n    //     ...\n    // }\n\n    const gaugeAddress = await curve.factory.getDeployedGaugeAddress(deployGaugeTx);\n    // 0x326290a1b0004eee78fa6ed4f1d8f4b2523ab669\n\n    // Get created pool\n\n    const poolId = await curve.factory.fetchRecentlyDeployedPool(poolAddress);\n    // factory-v2-222\n    const pool = curve.getPool(poolId);\n\n    // Deposit & Stake Wrapped\n    \n    await pool.depositAndStakeWrapped([10, 10]); // Initial wrapped amounts for stable metapool must be equal\n    const balances = await pool.stats.wrappedBalances();\n    // [ '10.0', '10.0' ]\n\n    // Or deposit & Stake Underlying\n\n    // const amounts = pool.metaUnderlyingSeedAmounts(30);\n    // [ '30', '10.000000000000000000', '10.000000', '10.000000' ]\n    // await pool.depositAndStake(amounts);\n    // [ '30.0', '9.27202178556044","readmeFilename":"README.md"}