@pioneer-platform/mayachain-client 0.0.22 → 0.0.24
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 +11 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
@@ -118,7 +118,7 @@ function quoteFromPool(sellAmount, assetPoolAmount, runePoolAmount, maxSlippage)
|
|
118
118
|
}
|
119
119
|
var get_quote = function (quote) {
|
120
120
|
return __awaiter(this, void 0, void 0, function () {
|
121
|
-
var tag, output, pools, poolIn, poolOut, BaseDecimal_1, asset, DECIMALS, BASE_UNIT, sellAmountInBaseUnits, quoteFromNode, URL_1, amountOutMin, inboundAddress, amountOutEstimated, memoInput, memo, tx, e_1;
|
121
|
+
var tag, output, pools, poolIn, poolOut, BaseDecimal_1, asset, DECIMALS, BASE_UNIT, sellAmountInBaseUnits, quoteFromNode, URL_1, amountOutMin, inboundAddress, amountOutEstimated, memoInput, memo, type, chain, tx, e_1;
|
122
122
|
return __generator(this, function (_a) {
|
123
123
|
switch (_a.label) {
|
124
124
|
case 0:
|
@@ -212,12 +212,20 @@ var get_quote = function (quote) {
|
|
212
212
|
};
|
213
213
|
memo = createMemo(memoInput);
|
214
214
|
log.info(tag, "memo: ", memo);
|
215
|
+
type = void 0;
|
216
|
+
chain = quote.sellAsset.split(".")[0];
|
217
|
+
if (chain == "THOR" || chain == "MAYA") {
|
218
|
+
type = 'deposit';
|
219
|
+
}
|
220
|
+
else {
|
221
|
+
type = 'transfer';
|
222
|
+
}
|
215
223
|
tx = {
|
216
|
-
type:
|
224
|
+
type: type,
|
217
225
|
chain: ChainToNetworkId[quote.sellAsset.split(".")[0]],
|
218
226
|
txParams: {
|
219
227
|
senderAddress: quote.senderAddress,
|
220
|
-
recipientAddress:
|
228
|
+
recipientAddress: quoteFromNode.inbound_address,
|
221
229
|
amount: quote.sellAmount,
|
222
230
|
token: quote.sellAsset.split(".")[1],
|
223
231
|
memo: memo
|