{"_id":"@azerothian/btc-markets-api","_rev":"5-e00ad0c62ecdcf6cf3d15bd2657363af","name":"@azerothian/btc-markets-api","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@azerothian/btc-markets-api","version":"1.0.0","keywords":["BTC Markets","API","exchange","Bitcoin","Ethereum","Bitcoin Cash","Australia","trading"],"author":{"name":"Matthew Mckenzie"},"license":"MIT","_id":"@azerothian/btc-markets-api@1.0.0","maintainers":[{"name":"azerothian","email":"matthew.m.mckenzie@gmail.com"}],"homepage":"https://github.com/azerothian/btc-markets-api#readme","bugs":{"url":"https://github.com/azerothian/btc-markets-api/issues"},"dist":{"shasum":"53c46a048b4a206f0ac676d1021214b590de0a94","tarball":"https://registry.npmjs.org/@azerothian/btc-markets-api/-/btc-markets-api-1.0.0.tgz","integrity":"sha512-bKlORNc0+hRs7VKHDhWP/mW4e7v0ZGbx8f4cL3PMR2UCbHnTshHKusTLSpYze7PdIsiynUeOwD5B2Bds3woDvQ==","signatures":[{"sig":"MEQCIF0MizAmqPS0gKJVGfocVeyKDkfGXdGOPRVwrVyXxHgLAiB5c6BcCE0qsMETvyDturU8DeQVLLMNxiYUfSOkmSsY2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"verbose":false,"testPathIgnorePatterns":["<rootDir>/src/","<rootDir>/node_modules/"]},"main":"build/index.js","_from":".","files":["build/index.js","build/rate-limiter.js"],"_shasum":"53c46a048b4a206f0ac676d1021214b590de0a94","gitHead":"c90d8c0e8b58fb184faeee4063df9a68c220864d","scripts":{"test":"jest","prepublishOnly":"yarn && gulp compile:publish"},"_npmUser":{"name":"azerothian","email":"matthew.m.mckenzie@gmail.com"},"devEngines":{"node":"8.x || 9.x"},"repository":{"url":"git+https://github.com/azerothian/btc-markets-api.git","type":"git"},"_npmVersion":"3.10.6","description":"BTC Markets Rest Client","_nodeVersion":"8.9.0","dependencies":{"node-fetch":"^1.7.3"},"devDependencies":{"gulp":"^3.9.1","jest":"^22.1.1","dotenv":"^4.0.0","eslint":"^4.15.0","gulp-babel":"^8.0.0-beta.0","@babel/core":"^7.0.0-beta.37","gulp-eslint":"^4.0.1","gulp-jsdoc3":"^1.0.1","babel-eslint":"^8.2.1","gulp-sourcemaps":"^2.6.3","@babel/preset-env":"^7.0.0-beta.37","eslint-plugin-jest":"^21.6.2","babel-plugin-autobind-class-methods":"^5.0.1","babel-plugin-transform-class-properties":"^6.24.1"},"_npmOperationalInternal":{"tmp":"tmp/btc-markets-api-1.0.0.tgz_1516207497660_0.6411354306619614","host":"s3://npm-registry-packages"},"directories":{}},"1.1.0":{"name":"@azerothian/btc-markets-api","version":"1.1.0","keywords":["BTC Markets","exchange","Bitcoin","Ethereum","Bitcoin Cash","Australia","trading"],"author":{"name":"Matthew Mckenzie"},"license":"MIT","_id":"@azerothian/btc-markets-api@1.1.0","maintainers":[{"name":"azerothian","email":"matthew.m.mckenzie@gmail.com"}],"homepage":"https://github.com/azerothian/btc-markets-api#readme","bugs":{"url":"https://github.com/azerothian/btc-markets-api/issues"},"dist":{"shasum":"730cd6c53ff93ad94400e4fee177baec7fc38786","tarball":"https://registry.npmjs.org/@azerothian/btc-markets-api/-/btc-markets-api-1.1.0.tgz","integrity":"sha512-YMC0Wl1A4LgVOQHMlFd47ECt3pcShldel5wf/O0n2AeRz0agbHX8Lc4p2Wkh6fC+MQkiukRClWgnGD+BXvHOvw==","signatures":[{"sig":"MEUCIQCP8BG3hYup6PCRahTa+JXzJICvDOG8mB/EdmjSt/rK3wIgWQYzROOYL4K9D9DvwLB3GLxhJiRx9mgzWdikkAE3l/4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"verbose":false,"testPathIgnorePatterns":["<rootDir>/src/","<rootDir>/node_modules/"]},"main":"build/index.js","_from":".","files":["build/index.js"],"_shasum":"730cd6c53ff93ad94400e4fee177baec7fc38786","gitHead":"aab2a6f85eb932d5d4253138fd66e578448d0583","scripts":{"test":"jest","prepublishOnly":"yarn && gulp compile:publish"},"_npmUser":{"name":"azerothian","email":"matthew.m.mckenzie@gmail.com"},"devEngines":{"node":"8.x || 9.x"},"repository":{"url":"git+https://github.com/azerothian/btc-markets-api.git","type":"git"},"_npmVersion":"3.10.6","description":"BTC Markets Rest Client","_nodeVersion":"8.9.0","dependencies":{"node-fetch":"^1.7.3"},"devDependencies":{"gulp":"^3.9.1","jest":"^22.1.1","dotenv":"^4.0.0","eslint":"^4.15.0","gulp-babel":"^8.0.0-beta.0","@babel/core":"^7.0.0-beta.37","gulp-eslint":"^4.0.1","gulp-jsdoc3":"^1.0.1","babel-eslint":"^8.2.1","gulp-sourcemaps":"^2.6.3","@babel/preset-env":"^7.0.0-beta.37","eslint-plugin-jest":"^21.6.2","babel-plugin-autobind-class-methods":"^5.0.1","babel-plugin-transform-class-properties":"^6.24.1"},"_npmOperationalInternal":{"tmp":"tmp/btc-markets-api-1.1.0.tgz_1516241096941_0.3860726458951831","host":"s3://npm-registry-packages"},"directories":{}},"1.2.0":{"name":"@azerothian/btc-markets-api","version":"1.2.0","keywords":["BTC Markets","exchange","Bitcoin","Ethereum","Bitcoin Cash","Australia","trading"],"author":{"name":"Matthew Mckenzie"},"license":"MIT","_id":"@azerothian/btc-markets-api@1.2.0","maintainers":[{"name":"azerothian","email":"matthew.m.mckenzie@gmail.com"}],"homepage":"https://github.com/azerothian/btc-markets-api#readme","bugs":{"url":"https://github.com/azerothian/btc-markets-api/issues"},"dist":{"shasum":"e000ca238023885b209fab1a05fd3253d3df3b37","tarball":"https://registry.npmjs.org/@azerothian/btc-markets-api/-/btc-markets-api-1.2.0.tgz","integrity":"sha512-TfPNNGFytCvlY1BFq7UdC81VoTfy8G1RanNYhVav00XXu9X1GoEXw/TeRoSGX2VcVZKOz+R6jE4XX789/9a5lg==","signatures":[{"sig":"MEQCIH6+NlgRVIPQ9ec1lnCct2kl1unTO5r1meVMiqJYp5kzAiB+omeCt4qyM/v+df6ER6CsBQoOs84ZZMpn3uKzCPK4zw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"verbose":false,"testPathIgnorePatterns":["<rootDir>/src/","<rootDir>/node_modules/"]},"main":"build/index.js","_from":".","files":["build/index.js"],"_shasum":"e000ca238023885b209fab1a05fd3253d3df3b37","gitHead":"e99dbaedbcfba70d2b020ed1da1d1b0e18c31471","scripts":{"test":"jest","publish":"npm publish --access=public","prepublishOnly":"yarn && gulp compile:publish"},"_npmUser":{"name":"azerothian","email":"matthew.m.mckenzie@gmail.com"},"devEngines":{"node":"8.x || 9.x"},"repository":{"url":"git+https://github.com/azerothian/btc-markets-api.git","type":"git"},"_npmVersion":"3.10.6","description":"BTC Markets Rest Client","_nodeVersion":"8.9.0","dependencies":{"node-fetch":"^1.7.3"},"devDependencies":{"gulp":"^3.9.1","jest":"^22.1.1","dotenv":"^4.0.0","eslint":"^4.15.0","gulp-babel":"^8.0.0-beta.0","@babel/core":"^7.0.0-beta.37","gulp-eslint":"^4.0.1","gulp-jsdoc3":"^1.0.1","babel-eslint":"^8.2.1","gulp-sourcemaps":"^2.6.3","@babel/preset-env":"^7.0.0-beta.37","eslint-plugin-jest":"^21.6.2","babel-plugin-autobind-class-methods":"^5.0.1","babel-plugin-transform-class-properties":"^6.24.1"},"_npmOperationalInternal":{"tmp":"tmp/btc-markets-api-1.2.0.tgz_1516496867465_0.42158519104123116","host":"s3://npm-registry-packages"},"directories":{}}},"time":{"created":"2018-01-17T16:44:57.748Z","modified":"2024-07-24T00:23:06.587Z","1.0.0":"2018-01-17T16:44:57.748Z","1.1.0":"2018-01-18T02:04:57.285Z","1.2.0":"2018-01-21T01:07:47.552Z"},"bugs":{"url":"https://github.com/azerothian/btc-markets-api/issues"},"author":{"name":"Matthew Mckenzie"},"license":"MIT","homepage":"https://github.com/azerothian/btc-markets-api#readme","keywords":["BTC Markets","exchange","Bitcoin","Ethereum","Bitcoin Cash","Australia","trading"],"repository":{"url":"git+https://github.com/azerothian/btc-markets-api.git","type":"git"},"description":"BTC Markets Rest Client","maintainers":[{"email":"matthew.m.mckenzie@gmail.com","name":"matthew.m.mckenzie"}],"readme":"BTC Markets Rest Client\r\n===============\r\n\r\nThis is a node.js wrapper for the private and public methods exposed by the [BTC Markets API](https://github.com/BTCMarkets/API).\r\nYou will need have a registered account with [BTC Markets](https://btcmarkets.net) and generated API keys to access the private methods.\r\n\r\nPlease contact support@btcmarkets.net if you are having trouble opening and account or generating an API key. \r\n\r\nFor websocket support see [btc-markets-ws-api](https://www.github.com/azerothian/btc-markets-ws-api)\r\n\r\n### Requirements\r\n\r\n- Nodejs >= 8.9.4\r\n\r\n### Install\r\n\r\n`yarn add @azerothian/btc-markets-api`\r\n\r\n### Documentation\r\n\r\n[Link to Documentation](https://azerothian.github.io/btc-markets-api/)\r\n\r\n### Features\r\n- Single dependency - node-fetch, no need to scan and research multiple dependencies for those with security in mine, (node-fetch has no dependencies)\r\n- Promises - all functions return promises and can be used with all its glory.\r\n- Simple API \r\n\r\n\r\n### Examples\r\n\r\n```js\r\nimport BTCMarkets from \"@azerothian/btc-markets-api\";\r\n(async() => {\r\n  try {\r\n    const client = new BTCMarkets({key: \"\", secret: \"\"});\r\n\r\n    const numberConverter = 100000000;    // one hundred million\r\n\r\n    // get latest prices\r\n    const tickData = await client.getTick(\"BTC\", \"AUD\");\r\n    console.log(`bid ${tickData.bestBid} ask ${tickData.bestAsk} last price ${tickData.lastPrice}`);\r\n\r\n    // get order book\r\n    const orderBook = await client.getOrderBook(\"BTC\", \"AUD\");\r\n    console.log(`${orderBook.asks.length} asks with best ask having price ${orderBook.asks[0][0]} and amount ${orderBook.asks[0][1]}`);\r\n\r\n    // limit buy order for of 0.01 BTC at 230 AUD\r\n    const createLimitedBuyOrder = await client.createOrder(\"BTC\", \"AUD\", 230 * numberConverter, 0.01 * numberConverter, 'Bid', 'Limit', \"10001\");\r\n    console.log(createLimitedBuyOrder);\r\n\r\n    // market sell for 0.0001 BTC\r\n    const sellOrder = await client.createOrder(\"BTC\", \"AUD\", null, 0.0001 * numberConverter, 'Ask', 'Market', null);\r\n    console.log(sellOrder);\r\n\r\n    // cancel two limit orders with id's 123456 and 987654\r\n    const cancelOrders = await client.cancelOrder([123456,987654]);\r\n    console.log(`first order was cancelled ${cancelOrders.responses[0].success}`);\r\n\r\n    const accountBalances = await client.getAccountBalances();\r\n    accountBalances.forEach((account) => {\r\n      console.log(`${account.currency} balance ${account.balance / numberConverter} pending ${account.pendingFunds / numberConverter}`);\r\n    });\r\n\r\n    const tradingFee = client.getTradingFee(\"BTC\", \"AUD\");\r\n    console.log(tradingFee);\r\n  } catch (err) {\r\n      console.log(err);\r\n  }\r\n})();\r\n\r\n```\r\n\r\n### Development\r\n\r\n- We use gulp with babel for source transpiling.\r\n- `npm run test` or `jest` to run test the test cases\r\n- `gulp watch` to monitor and watch for \r\n- To run the private test cases you need to set the following keys in your environment variables or create a `.env` file with the following filled in\r\n```\r\nBTCMKT_KEY=\"\"\r\nBTCMKT_SECRET=\"\"\r\n```\r\n","readmeFilename":"README.md"}