@pioneer-platform/changelly-client 8.3.4 → 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 CHANGED
@@ -1,5 +1,5 @@
1
1
  declare let Changelly: any;
2
- declare const TAG = " | blocknative | ";
2
+ declare const TAG = " | Changelly | ";
3
3
  declare const CHANGELLY_API_KEY: string | undefined;
4
4
  declare const CHANGELLY_API_SECRET: string | undefined;
5
5
  declare let changelly: any;
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 = " | blocknative | ";
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*/, changelly.createTransaction(from, to, address, amount, extraId)];
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)
@@ -144,6 +157,8 @@ function create_transaction(from, to, address, amount, extraId) {
144
157
  memo: data.payinExtraId,
145
158
  }
146
159
  };
160
+ output.tx = tx;
161
+ output.raw = data;
147
162
  return [2 /*return*/, output];
148
163
  case 2:
149
164
  e_1 = _a.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/changelly-client",
3
- "version": "8.3.4",
3
+ "version": "8.3.6",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "dependencies": {