@pioneer-platform/chainflip-client 0.0.5 → 0.0.7
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 +12 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -86,6 +86,11 @@ const get_quote = function (quote) {
|
|
|
86
86
|
if (!networkSupport.includes(caipToNetworkId(quote.sellAsset))) {
|
|
87
87
|
throw new Error("unsupported sellAsset");
|
|
88
88
|
}
|
|
89
|
+
output.sellAsset = {};
|
|
90
|
+
output.sellAsset.caip = quote.sellAsset;
|
|
91
|
+
output.sellAmount = quote.sellAmount;
|
|
92
|
+
output.buyAsset = {};
|
|
93
|
+
output.buyAsset.caip = quote.buyAsset;
|
|
89
94
|
let chainSell = NetworkIdToChain[caipToNetworkId(quote.sellAsset)];
|
|
90
95
|
let chainBuy = NetworkIdToChain[caipToNetworkId(quote.buyAsset)];
|
|
91
96
|
log.info(tag, "chainSell: ", chainSell);
|
|
@@ -129,13 +134,13 @@ const get_quote = function (quote) {
|
|
|
129
134
|
const data = {
|
|
130
135
|
"0": {
|
|
131
136
|
"json": {
|
|
132
|
-
"srcChain":
|
|
133
|
-
"destChain":
|
|
134
|
-
"srcAsset":
|
|
135
|
-
"destAsset":
|
|
136
|
-
"amount":
|
|
137
|
+
"srcChain": longNameSell,
|
|
138
|
+
"destChain": longNameBuy,
|
|
139
|
+
"srcAsset": chainSell,
|
|
140
|
+
"destAsset": chainBuy,
|
|
141
|
+
"amount": responseQuote.data.egressAmount,
|
|
137
142
|
"quote": responseQuote.data,
|
|
138
|
-
"destAddress":
|
|
143
|
+
"destAddress": quote.recipientAddress,
|
|
139
144
|
}
|
|
140
145
|
}
|
|
141
146
|
};
|
|
@@ -162,6 +167,7 @@ const get_quote = function (quote) {
|
|
|
162
167
|
log.info(tag, "result: ", result);
|
|
163
168
|
output.id = result.id;
|
|
164
169
|
output.source = 'chainflip';
|
|
170
|
+
output.inboundAddress = result.depositAddress;
|
|
165
171
|
output.estimatedExpiryTime = result.estimatedExpiryTime;
|
|
166
172
|
let tx = {
|
|
167
173
|
type: "transfer",
|