@pioneer-platform/changelly-client 8.3.5 → 8.3.6
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 -1
- package/lib/index.js +15 -2
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
var Changelly = require('@bithighlander/changelly');
|
|
39
|
-
var TAG = " |
|
|
39
|
+
var TAG = " | Changelly | ";
|
|
40
40
|
var CHANGELLY_API_KEY = process.env['CHANGELLY_API_KEY'];
|
|
41
41
|
var CHANGELLY_API_SECRET = process.env['CHANGELLY_API_SECRET'];
|
|
42
42
|
if (!CHANGELLY_API_KEY)
|
|
@@ -128,9 +128,22 @@ function create_transaction(from, to, address, amount, extraId) {
|
|
|
128
128
|
quoteMode: "CHANGELLY"
|
|
129
129
|
};
|
|
130
130
|
output.complete = true;
|
|
131
|
-
return [4 /*yield*/,
|
|
131
|
+
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
132
|
+
changelly.createTransaction(from, to, address, amount, extraId, function (err, data) {
|
|
133
|
+
if (err) {
|
|
134
|
+
reject(err);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
resolve(data);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
})];
|
|
132
141
|
case 1:
|
|
133
142
|
data = _a.sent();
|
|
143
|
+
console.log("data:", data);
|
|
144
|
+
data = data.result;
|
|
145
|
+
if (!data)
|
|
146
|
+
throw Error("Failed to create quote@changelly");
|
|
134
147
|
if (!data.payinAddress)
|
|
135
148
|
throw Error("Failed to create quote@changelly");
|
|
136
149
|
if (!data.id)
|