{"_id":"@apefinance/apes-data","_rev":"1-1f4d989e23c25a530bf741169a3a789f","name":"@apefinance/apes-data","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@apefinance/apes-data","license":"MIT","version":"0.1.0","author":{"name":"APE Finance"},"main":"index","scripts":{"lint":"eslint .","pack":"webpack --mode production","prepublish":"npm run pack"},"dependencies":{"bluebird":"^3.7.2","commander":"6.1.0","csv-stringify":"5.3.3","date-fns":"^2.17.0","graph-results-pager":"git+https://github.com/LufyCZ/graph-results-pager.git","graphql":"14.5.8","graphql-request":"^3.4.0","isomorphic-ws":"^4.0.1","node-fetch":"2.6.0","subscriptions-transport-ws":"0.9.16","ws":"7.2.0"},"devDependencies":{"eslint":"5.16.0","eslint-config-prettier":"4.3.0","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.0","prettier":"1.17.1","ts-node":"^9.1.1","typescript":"^4.1.3","webpack":"4.41.2","webpack-cli":"3.3.9"},"gitHead":"71e48df98bbce73309960cfba745dafd66b29041","description":"This is a collection of utilities to query ApeFinance data from Ethereum. This data has been indexed by the Graph via the subgraph the ApeFinance team maintains.","_id":"@apefinance/apes-data@0.1.0","_nodeVersion":"16.1.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-YgtaaZnwF5tWo4c3stLGui1WwBoSlgz+l6h5X2enPRPsCis7fLzDNBatnlig1FyVNEXdRyuYZfq2Rrrgj9YoCw==","shasum":"29db34f19dbb7915fe13174c63b47b0099edcf60","tarball":"https://registry.npmjs.org/@apefinance/apes-data/-/apes-data-0.1.0.tgz","fileCount":42,"unpackedSize":138872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1hhwCRA9TVsSAnZWagAAVg0P/0CxTEYYMh0/Ys0VhqKd\nZFoHJrkKW7sPgDWplQTucUczrJwLmZ+pHwzA35N4xT4L0ndZH9MzUoWul8b8\nKkL/FAoHJ17OJCJBF/tk0GNECRSFp7kiBaOLaV1yK3IUPckfmA26DD2RKsxb\nBKTd4Svjy4JU1FMFluYQEJ+dizLwEjvG1b8dXQYK10ENvFqUXPDp9HTcSEG/\nxSFo6HWfT6kcMJjhSK/uAHVwkmE9vwcqNStPJwwvK+D2OLa87lsUCTJ6+NCj\ne4i1pTkDPfScsZR9ppxqyuSN96G+SLxDOdNMKhDa1sPsPRDstQh4L42i5snT\nok5jqWdk4czjUIgreI1C7EqE75F0NPBd8jkyAHKtHPloif73W6W+rnkCkRBF\nzvJPS9ctEnpX18GC/PinuEgqZvWtEFmXBaOzsTu7aAt7BCPRQGsV53XLokMC\n2ccYwYf+7f5icpcaOoPYy3RiqtXFxo8ESEU3WpbmLY8DEysQd7Ne1+VDNPvX\nbTsLKySicdEyq/GYW68WJqjWL+OXSR2N0WOhuTSjjcN3MqXxfVsYE6TRoMIp\noAksYx+A9TtS5Zuqt3gisAPaldjddEM0/IddWaSSba046PODixyWgMCd8zAo\nOkzvemoHd9c7UWkcZV0UOeIKrfg6RQiIXKO5bv84JZCY6uYv2PF9jLt5lI81\n8gy5\r\n=9LQU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYowIrHnDcpxDzh9xsFbg8ow4KfPT82MTKYu/yQkUOtAIhANhxFYVTQP70HqlcSscveLLilIzc3jr+OwWaedwTHbGi"}]},"_npmUser":{"name":"alexysav","email":"techstream.pro@gmail.com"},"directories":{},"maintainers":[{"name":"alexysav","email":"techstream.pro@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apes-data_0.1.0_1624643696340_0.3071914569721037"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-25T17:54:55.960Z","0.1.0":"2021-06-25T17:54:56.529Z","modified":"2022-04-04T14:32:41.670Z"},"maintainers":[{"name":"alexysav","email":"techstream.pro@gmail.com"}],"description":"This is a collection of utilities to query ApeFinance data from Ethereum. This data has been indexed by the Graph via the subgraph the ApeFinance team maintains.","author":{"name":"APE Finance"},"license":"MIT","readme":"# sushi-data\n\nThis is a collection of utilities to query ApeFinance data from Ethereum. This\ndata has been indexed by the Graph via the subgraph the ApeFinance team maintains.\n\n## Supported Queries\n\nThe below all return a Promise that resolves with the requested results.\n\n1. `sushi.priceUSD({¹})` Gets USD price of Apes.\n2. `sushi.priceETH({¹})` Gets ETH price of Apes.\n3. `blocks.latestBlock()` Gets the latest block.\n4. `blocks.getBlock({¹})` Gets data for the specified block.\n5. `charts.factory()` Gets data for the ApeFinance factory broken down daily + weekly.\n6. `charts.tokenHourly({token_address, startTime?})` Gets data for specified token broken down hourly.\n7. `charts.tokenDaily({token_address})` Gets data for specified token broken down daily.\n8. `charts.pairHourly({pair_address, startTime?})` Gets data for specified pair broken down hourly.\n9. `charts.pairDaily({pair_address})` Gets data for specified pair broken down daily.\n10. `exchange.token({¹, token_address})` Gets data for specified token.\n11. `exchange.token24h({¹, token_address})` Gets 24h data for specified token.\n12. `exchange.tokenHourData({², token_address})` Gets hourly data for specified token.\n13. `exchange.tokenDayData({², token_address})` Gets daily data for specified token.\n14. `exchange.tokens({¹})` Gets data for all tokens.\n15. `exchange.tokens24h({¹})` Gets 24h data for all tokens.\n16. `exchange.pair({¹, pair_address})` Gets data for specified pair.\n17. `exchange.pair24h({¹, pair_address})` Gets 24h data for specified pair.\n18. `exchange.pairHourData({², pair_address})` Gets hourly data for specified pair.\n19. `exchange.pairDayData({{², pair_address})` Gets daily data for specified pair.\n20. `exchange.pairs({¹, [pair_addresses]?})` Gets data for all / specified pairs.\n21. `exchange.pairs24h({¹})` Gets 24h data for all pairs.\n22. `exchange.ethPrice({¹})` Gets USD price of ETH.\n23. `exchange.ethPriceHourly({²})` Gets USD price of ETH broken down hourly.\n24. `exchange.factory({¹})` Gets all data for the ApeFinance factory.\n25. `exchange.dayData({²})` Gets data for the ApeFinance factory broken down by day.\n26. `exchange.twentyFourHourData({¹})` Gets 24h data for the ApeFinance factory.\n27. `exchange_v1.userHistory({², user_address})` Gets LP history for specified user.\n28. `exchange_v1.userPositions({¹, user_address})` Gets LP positions for specified user.\n29. `masterchef.info({¹})` Gets MasterChef contract info.\n30. `masterchef.pool({¹, pool_id, pool_address})` Gets pool info, either by pool id or by pool address.\n31. `masterchef.pools({¹})` Gets pool info for all pools in MasterChef.\n32. `masterchef.user({¹, user_address})` Gets user's data for all of the user's pools.\n33. `masterchef.users({¹})` Gets all users and data for all of the users' pools.\n34. `masterchef.apys({¹})` Gets pool info for all pools in MasterChef including APYs.\n35. `masterchef.apys24h({¹})` Gets 24h pool info for all pools in MasterChef including APYs.\n36. `exchange.stakedValue({¹, token_address})` Get pricing info for MasterChef pool.\n37. `bar.info({¹})` Gets ApesBar contract info.\n38. `bar.user({¹, user_address})` Gets ApesBar data for specified user.\n39. `maker.info({¹})` Gets ApesMaker contract info.\n40. `maker.servings({²})` Gets past servings to the bar.\n41. `maker.servers({¹})` Gets servers that have served Apes to the bar.\n42. `maker.pendingServings({¹})` Gets data on the servings ready to be served to the bar.\n43. `timelock.queuedTxs({²})` Gets queued Timelock transactions.\n44. `timelock.canceledTxs({²})` Gets canceled Timelock transactions.\n45. `timelock.executedTxs({²})` Gets executed Timelock transactions.\n46. `timelock.allTxs({²})` Gets all Timelock transactions.\n47. `lockup.user({¹, user_address})` Gets lockup data for specified user.\n48. `bentobox.clones({masterAddress, chainId})` Gets Clone contracts for specified master contract.\n\n¹ `{block, timestamp}` Supports fetching at a specific block / UNIX timestamp.    \n² `{minBlock, maxBlock, minTimestamp, maxTimestamp}` Supports fetching in a specific timeframe.\n\n## Supported Subscriptions\nThe below all return an Observable that when subscribed to with an object.\n\n1. `sushi.observePriceETH()` Gets an observable of the current ETH price of Apes.\n2. `blocks.observeLatestBlock()` Gets an observable of the latest block.\n3. `exchange.observeToken({token_address})` Gets an observable for specified token.\n4. `exchange.observeTokens()` Gets an observable for the top 1000 tokens (by volume in USD).\n5. `exchange.observePair({pair_address})` Gets an observable for specified pair.\n6. `exchange.observePairs()` Gets an observable for the top 1000 pairs (by liquidity in USD).\n7. `exchange.observeEthPrice()` Gets an observable for the current USD price of ETH.\n8. `exchange.observeFactory()` Gets an observable for the ApeFinance factory.\n9. `bar.observeInfo()` Gets an observable for ApesBar contract info.\n10. `maker.observePendingServings()` Gets an observable for pending servings.\n\n## Timeseries\n\n`sushiData.timeseries({blocks = [], timestamps = [], target = targetFunction}, {targetArguments})` Returns an array of queries. Blocks / timestamps are arrays of the blocks / timestamps to query (choose one). The target is the target function, the target arguments are the arguments for the target. See example below\n\n## Example\n\n```javascript\nconst sushiData = require('@apefinance/sushi-data'); // common js\n// or\nimport sushiData from '@apefinance/sushi-data'; // es modules\n\n// query and log resolved results\nsushiData.masterchef\n  .pools({block: 11223344})\n  .then(pools => console.log(pools))\n\nsushiData.timelock\n  .allTxs({minTimestamp: 1605239738, maxTimestamp: 1608239738})\n  .then(txs => console.log(txs))\n\nsushiData.bar\n  .user({user_address: '0x6684977bbed67e101bb80fc07fccfba655c0a64f'})\n  .then(user => console.log(user))\n\nsushiData.exchange\n  .observePairs()\n  .subscribe({next: (pairs) => console.log(pairs), error: (err) => console.log(err)})\n\nsushiData\n  .timeseries({blocks: [11407623, 11507623, 11607623], target: sushiData.exchange.pair}, {pair_address: \"0x795065dCc9f64b5614C407a6EFDC400DA6221FB0\"})\n```\n","readmeFilename":"README.md"}