Comparing version 0.0.2 to 0.0.3
10
index.js
@@ -20,3 +20,3 @@ 'use strict' | ||
this.url = url | ||
this.api = new API(this.url, this.token); | ||
this.api = new API(this.token, this.url); | ||
} | ||
@@ -31,3 +31,3 @@ }; | ||
const method = "/api/user.getHistory" | ||
return fetch(this.token + method + "?access_token=" + this.url) | ||
return fetch(this.url + method + "?access_token=" + this.token) | ||
.then(function (response) { return response.json(); }) | ||
@@ -40,3 +40,3 @@ .catch(function (err) { throw new Error(err) }); | ||
const method = "/api/user.get" | ||
return fetch(this.token + method + "?access_token=" + this.url + dop) | ||
return fetch(this.url + method + "?access_token=" + this.token + dop) | ||
.then(function (response) { return response.json(); }) | ||
@@ -47,3 +47,3 @@ .catch(function (err) { throw new Error(err) }); | ||
const method = "/api/user.getBalance" | ||
return fetch(this.token + method + "?access_token=" + this.url) | ||
return fetch(this.url + method + "?access_token=" + this.token) | ||
.then(function (response) { return response.json(); }) | ||
@@ -56,3 +56,3 @@ .catch(function (err) { throw new Error(err) }); | ||
const method = "/api/user.transfer" | ||
return fetch(this.token + method + "?access_token=" + this.url + '&user_id=' + user_id + '&amount=' + amount) | ||
return fetch(this.url + method + "?access_token=" + this.token + '&user_id=' + user_id + '&amount=' + amount) | ||
.then(function (response) { return response.json(); }) | ||
@@ -59,0 +59,0 @@ .catch(function (err) { throw new Error(err) }); |
{ | ||
"name": "zoziliba", | ||
"description": "Api ", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "", | ||
@@ -6,0 +6,0 @@ "contributors": [], |