@pioneer-platform/changelly-client 8.3.17 → 8.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -0
- package/lib/index.js +24 -0
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -10,5 +10,6 @@ declare function get_currencies(): Promise<any>;
|
|
|
10
10
|
declare function create_transaction(from: string, to: string, address: string, amount: number, extraId?: string): Promise<any>;
|
|
11
11
|
declare function get_min_amount(from: string, to: string): Promise<any>;
|
|
12
12
|
declare function get_exchange_amount(from: string, to: string, amount: number): Promise<any>;
|
|
13
|
+
declare function get_transaction(orderId?: string): Promise<any>;
|
|
13
14
|
declare function get_transactions(limit: number, offset: number, currency?: string, address?: string, extraId?: string): Promise<any>;
|
|
14
15
|
declare function get_status(id: string): Promise<any>;
|
package/lib/index.js
CHANGED
|
@@ -109,6 +109,9 @@ module.exports = {
|
|
|
109
109
|
getExchangeAmountAsync: function (from, to, amount) {
|
|
110
110
|
return get_exchange_amount(from, to, amount);
|
|
111
111
|
},
|
|
112
|
+
getTransactionAsync: function (id) {
|
|
113
|
+
return get_transaction(id);
|
|
114
|
+
},
|
|
112
115
|
getTransactionsAsync: function (limit, offset, currency, address, extraId) {
|
|
113
116
|
return get_transactions(limit, offset, currency, address, extraId);
|
|
114
117
|
},
|
|
@@ -239,6 +242,27 @@ function get_exchange_amount(from, to, amount) {
|
|
|
239
242
|
});
|
|
240
243
|
});
|
|
241
244
|
}
|
|
245
|
+
function get_transaction(orderId) {
|
|
246
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
247
|
+
return __generator(this, function (_a) {
|
|
248
|
+
try {
|
|
249
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
250
|
+
changelly.getTransaction(orderId, function (err, data) {
|
|
251
|
+
if (err)
|
|
252
|
+
reject(err);
|
|
253
|
+
else
|
|
254
|
+
resolve(data);
|
|
255
|
+
});
|
|
256
|
+
})];
|
|
257
|
+
}
|
|
258
|
+
catch (e) {
|
|
259
|
+
console.error(TAG, "get_transactions error:", e);
|
|
260
|
+
throw e;
|
|
261
|
+
}
|
|
262
|
+
return [2 /*return*/];
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
}
|
|
242
266
|
function get_transactions(limit, offset, currency, address, extraId) {
|
|
243
267
|
return __awaiter(this, void 0, void 0, function () {
|
|
244
268
|
return __generator(this, function (_a) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/changelly-client",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.18",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@bithighlander/changelly": "^1.0.
|
|
7
|
+
"@bithighlander/changelly": "^1.0.1",
|
|
8
8
|
"@pioneer-platform/loggerdog": "^8.3.1",
|
|
9
9
|
"@pioneer-platform/pioneer-caip": "^9.2.23",
|
|
10
10
|
"axios": "^1.3.4",
|