diff --git a/README.md b/README.md index a0d21ac..3f97a50 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,13 @@ To-Do: CHANGELOG: 0.0.3 - Add /contact_info/ and /contact_info/{contact_id} routes +0.0.4 - Add ability to set api endpoint (it needs for user in russia because localbitcoins.com is blocked). Usage: +``` +var lbc = new LBCClient(api_key, api_secret, { + apiUrl: 'https://localbitcoins.net/api' +}); +``` + Credit: Initially inspired by: diff --git a/localbitcoins.js b/localbitcoins.js index 270d6cb..fb11a31 100644 --- a/localbitcoins.js +++ b/localbitcoins.js @@ -3,15 +3,14 @@ var crypto = require('crypto'); var querystring = require('querystring'); -function LBCClient(key, secret, otp) { +function LBCClient(key, secret, opt = {}) { var nonce = new Date() * 1000; var self = this; var config = { - url: 'https://localbitcoins.com/api', + url: opt.apiUrl || 'https://localbitcoins.com/api', key: key, secret: secret, - otp: otp, timeoutMS: 5000 }; diff --git a/package.json b/package.json index 0b34fe4..78f9832 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "localbitcoins-api", - "version": "0.0.3", + "version": "0.0.4", "description": "LocalBitcoins API wrapper for NodeJS", "keywords": [ "localbitcoins",