@pioneer-platform/mayachain-client 0.24.0 → 0.24.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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @pioneer-platform/mayachain-client@0.24.0 build /Users/highlander/WebstormProjects/keepkey-stack/projects/pioneer/modules/intergrations/mayachain
3
+ > @pioneer-platform/mayachain-client@0.24.4 build /Users/highlander/WebstormProjects/keepkey-stack/projects/pioneer/modules/intergrations/mayachain
4
4
  > tsc -p .
5
5
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # @pioneer-platform/mayachain-client
2
2
 
3
+ ## 0.24.4
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: chore: chore: chore: update test suite and deployment workflow
8
+ - Updated dependencies
9
+ - @pioneer-platform/maya-network@8.20.4
10
+ - @pioneer-platform/pioneer-caip@9.27.4
11
+ - @pioneer-platform/pioneer-coins@9.20.4
12
+
13
+ ## 0.24.3
14
+
15
+ ### Patch Changes
16
+
17
+ - chore: chore: chore: update test suite and deployment workflow
18
+ - Updated dependencies
19
+ - @pioneer-platform/maya-network@8.20.3
20
+ - @pioneer-platform/pioneer-caip@9.27.3
21
+ - @pioneer-platform/pioneer-coins@9.20.3
22
+
23
+ ## 0.24.2
24
+
25
+ ### Patch Changes
26
+
27
+ - chore: chore: update test suite and deployment workflow
28
+ - Updated dependencies
29
+ - @pioneer-platform/maya-network@8.20.2
30
+ - @pioneer-platform/pioneer-caip@9.27.2
31
+ - @pioneer-platform/pioneer-coins@9.20.2
32
+
33
+ ## 0.24.1
34
+
35
+ ### Patch Changes
36
+
37
+ - chore: update test suite and deployment workflow
38
+ - Updated dependencies
39
+ - @pioneer-platform/pioneer-caip@9.27.1
40
+ - @pioneer-platform/pioneer-coins@9.20.1
41
+ - @pioneer-platform/maya-network@8.20.1
42
+
3
43
  ## 0.24.0
4
44
 
5
45
  ### Minor Changes
package/lib/index.js CHANGED
@@ -171,7 +171,7 @@ module.exports = {
171
171
  };
172
172
  var get_quote = function (quote) {
173
173
  return __awaiter(this, void 0, void 0, function () {
174
- var tag, output, pools, BaseDecimal, sellAsset, SELL_DECIMALS, SELL_BASE_UNIT, buyAsset, BUY_DECIMALS, BUY_BASE_UNIT, sellAmountInBaseUnits, quoteFromNode, URL_1, amountOutEstimated, amountOutMin, memoInput, memo, type, tx, inbounds, inbound, tokenAddress, e_1;
174
+ var tag, output, pools, poolIn, poolOut, BaseDecimal, sellAsset, SELL_DECIMALS, SELL_BASE_UNIT, buyAsset, BUY_DECIMALS, BUY_BASE_UNIT, sellAmountInBaseUnits, quoteFromNode, URL_1, amountOutEstimated, amountOutMin, memoInput, memo, type, tx, inbounds, inbound, tokenAddress, e_1;
175
175
  return __generator(this, function (_a) {
176
176
  switch (_a.label) {
177
177
  case 0:
@@ -197,7 +197,31 @@ var get_quote = function (quote) {
197
197
  pools = _a.sent();
198
198
  if (!pools)
199
199
  throw Error("Unable to get pools from network!");
200
- // log.info(tag, "pools: ", pools)
200
+ poolIn = pools.find(function (p) { return p.asset === quote.sellAsset; });
201
+ poolOut = pools.find(function (p) { return p.asset === quote.buyAsset; });
202
+ // Check if pools exist
203
+ if (!poolIn && quote.sellAsset !== 'MAYA.CACAO') {
204
+ log.error(tag, "Pool for sellAsset (".concat(quote.sellAsset, ") not found on MayaChain"));
205
+ throw new Error("Pool for sellAsset (".concat(quote.sellAsset, ") not found on MayaChain."));
206
+ }
207
+ if (!poolOut && quote.buyAsset !== 'MAYA.CACAO') {
208
+ log.error(tag, "Pool for buyAsset (".concat(quote.buyAsset, ") not found on MayaChain"));
209
+ throw new Error("Pool for buyAsset (".concat(quote.buyAsset, ") not found on MayaChain."));
210
+ }
211
+ // Check pool status (must be "available", not "staged" or other statuses)
212
+ if (poolIn && poolIn.status !== 'available') {
213
+ log.error(tag, "Pool for ".concat(quote.sellAsset, " is not available (status: ").concat(poolIn.status, ")"));
214
+ throw new Error("Pool for ".concat(quote.sellAsset, " is currently ").concat(poolIn.status, ". ") +
215
+ "Only pools with status \"available\" can be used for trading. " +
216
+ "Please check https://www.mayaprotocol.com for pool status and try a different asset pair.");
217
+ }
218
+ if (poolOut && poolOut.status !== 'available') {
219
+ log.error(tag, "Pool for ".concat(quote.buyAsset, " is not available (status: ").concat(poolOut.status, ")"));
220
+ throw new Error("Pool for ".concat(quote.buyAsset, " is currently ").concat(poolOut.status, ". ") +
221
+ "Only pools with status \"available\" can be used for trading. " +
222
+ "Please check https://www.mayaprotocol.com for pool status and try a different asset pair.");
223
+ }
224
+ log.info(tag, "✅ Pool validation passed - trading is available");
201
225
  output.meta = {
202
226
  quoteMode: "MAYA_SUPPORTED_TO_MAYA_SUPPORTED"
203
227
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/mayachain-client",
3
- "version": "0.24.0",
3
+ "version": "0.24.4",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "dependencies": {
@@ -9,10 +9,10 @@
9
9
  "rango-sdk": "^0.1.45",
10
10
  "uuidv4": "^6.2.13",
11
11
  "web3": "4.14.0",
12
+ "@pioneer-platform/maya-network": "8.20.4",
12
13
  "@pioneer-platform/loggerdog": "8.11.0",
13
- "@pioneer-platform/pioneer-caip": "9.27.0",
14
- "@pioneer-platform/pioneer-coins": "9.20.0",
15
- "@pioneer-platform/maya-network": "8.20.0"
14
+ "@pioneer-platform/pioneer-caip": "9.27.4",
15
+ "@pioneer-platform/pioneer-coins": "9.20.4"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/jest": "^25.2.3",