@pioneer-platform/chainflip-client 0.0.3 → 0.0.4
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.js +20 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -37,6 +37,26 @@ module.exports = {
|
|
|
37
37
|
getQuote: function (quote) {
|
|
38
38
|
return get_quote(quote);
|
|
39
39
|
},
|
|
40
|
+
lookupTx: function (quoteId) {
|
|
41
|
+
return get_quote_info(quoteId);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
const get_quote_info = function (quoteId) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
let tag = TAG + " | get_quote_info | ";
|
|
47
|
+
try {
|
|
48
|
+
let output = {};
|
|
49
|
+
// Make a GET request using Axios
|
|
50
|
+
const response = yield axios.get(`https://chainflip-swap.chainflip.io/swaps/${quoteId}`);
|
|
51
|
+
// Assuming the response data is what you want to use
|
|
52
|
+
output.data = response.data;
|
|
53
|
+
return output;
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
console.error(tag, "e: ", e);
|
|
57
|
+
throw e;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
40
60
|
};
|
|
41
61
|
const get_quote = function (quote) {
|
|
42
62
|
return __awaiter(this, void 0, void 0, function* () {
|