From 75801033d52d8ef4687b770646673fe0362ab77d Mon Sep 17 00:00:00 2001 From: Alx Date: Wed, 22 Aug 2018 19:43:20 +0300 Subject: [PATCH 1/4] Add ability to set api endpoint --- localbitcoins.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 }; From aa0331c5d289812c51d486659934f9a03fb91379 Mon Sep 17 00:00:00 2001 From: Alx Date: Wed, 22 Aug 2018 19:44:47 +0300 Subject: [PATCH 2/4] Update version According to "Add ability to set api endpoint" feature --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From 101733a02aa175d78ee43d745df59b61359c5089 Mon Sep 17 00:00:00 2001 From: Alx Date: Wed, 22 Aug 2018 19:47:27 +0300 Subject: [PATCH 3/4] Update README CHANGELOG for version 0.0.4 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a0d21ac..a9aaf3d 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,12 @@ 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: From 8a84d83b52803c2e5a16fec0fda44be87f3cecc2 Mon Sep 17 00:00:00 2001 From: Alx Date: Wed, 22 Aug 2018 19:49:17 +0300 Subject: [PATCH 4/4] FIx README newline for 0.0.4 version --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a9aaf3d..3f97a50 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ 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, {