@pioneer-platform/maya-network 8.13.21 → 8.15.0

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/maya-network@8.13.21 build /Users/highlander/WebstormProjects/keepkey-stack/projects/pioneer/modules/coins/mayachain/mayachain-network
3
+ > @pioneer-platform/maya-network@8.15.0 build /Users/highlander/WebstormProjects/keepkey-stack/projects/pioneer/modules/coins/mayachain/mayachain-network
4
4
  > tsc -p .
5
5
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @pioneer-platform/maya-network
2
2
 
3
+ ## 8.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat(monorepo): production release preparation with strict TypeScript and enhanced swap functionality
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @pioneer-platform/pioneer-nodes@8.31.0
13
+
14
+ ## 8.14.0
15
+
16
+ ### Minor Changes
17
+
18
+ - feat(pioneer-client): add client-side host override for staging/blue testing
19
+
20
+ ### Patch Changes
21
+
22
+ - @pioneer-platform/pioneer-nodes@8.30.4
23
+
24
+ ## 8.13.23
25
+
26
+ ### Patch Changes
27
+
28
+ - chore: chore: - Services (discovery-service, watchtower)
29
+
30
+ ## 8.13.22
31
+
32
+ ### Patch Changes
33
+
34
+ - fa09397: chore: - Services (discovery-service, watchtower)
35
+
3
36
  ## 8.13.21
4
37
 
5
38
  ### Patch Changes
package/lib/index.js CHANGED
@@ -4,6 +4,14 @@
4
4
 
5
5
  Migrated from direct node calls to ShapeShift Unchained API
6
6
  API Documentation: https://api.mayachain.shapeshift.com/swagger
7
+
8
+ public nodes for reference TODO add to pioneer-nodes
9
+ https://mayanode.mayachain.info/
10
+ https://tendermint.mayachain.info/
11
+ https://www.explorer.mayachain.info/dashboard
12
+ https://midgard.mayachain.info/
13
+
14
+
7
15
  */
8
16
  var __assign = (this && this.__assign) || function () {
9
17
  __assign = Object.assign || function(t) {
@@ -504,11 +512,12 @@ var get_txs_by_address = function (address_1, cursor_1) {
504
512
  };
505
513
  var get_transaction = function (txid) {
506
514
  return __awaiter(this, void 0, void 0, function () {
507
- var tag, _i, MAYA_NODES_1, nodeUrl, result, e_8, errorMsg;
515
+ var tag, normalizedTxid, _i, MAYA_NODES_1, nodeUrl, result, e_8, errorMsg;
508
516
  return __generator(this, function (_a) {
509
517
  switch (_a.label) {
510
518
  case 0:
511
519
  tag = TAG + " | get_transaction | ";
520
+ normalizedTxid = txid.replace(/^0x/i, '').toUpperCase();
512
521
  _i = 0, MAYA_NODES_1 = MAYA_NODES;
513
522
  _a.label = 1;
514
523
  case 1:
@@ -520,7 +529,7 @@ var get_transaction = function (txid) {
520
529
  log.info(tag, "Trying to fetch tx from: ".concat(nodeUrl));
521
530
  return [4 /*yield*/, axiosInstance({
522
531
  method: 'GET',
523
- url: "".concat(nodeUrl, "/cosmos/tx/v1beta1/txs/").concat(txid),
532
+ url: "".concat(nodeUrl, "/mayachain/tx/status/").concat(normalizedTxid),
524
533
  timeout: 8000
525
534
  })];
526
535
  case 3:
@@ -544,7 +553,7 @@ var get_transaction = function (txid) {
544
553
  };
545
554
  var broadcast_transaction = function (tx) {
546
555
  return __awaiter(this, void 0, void 0, function () {
547
- var tag, output, payload, result, unchainedError_1, nodeErrors, _i, MAYA_NODES_2, nodeUrl, nodeResult, txResponse, nodeError, nodeError_1, errorTxResponse, nodeErrorMsg;
556
+ var tag, output, payload, result, unchainedError_1, nodeErrors, _i, MAYA_NODES_2, nodeUrl, txBytes, nodeResult, txResponse, nodeError, nodeError_1, errorTxResponse, nodeErrorMsg;
548
557
  var _a, _b, _c, _d, _e, _f;
549
558
  return __generator(this, function (_g) {
550
559
  switch (_g.label) {
@@ -611,11 +620,12 @@ var broadcast_transaction = function (tx) {
611
620
  case 6:
612
621
  _g.trys.push([6, 8, , 9]);
613
622
  log.info(tag, "Trying direct Maya node: ".concat(nodeUrl));
623
+ txBytes = Buffer.from(tx, 'hex').toString('base64');
614
624
  return [4 /*yield*/, axiosInstance({
615
625
  url: "".concat(nodeUrl, "/cosmos/tx/v1beta1/txs"),
616
626
  method: 'POST',
617
627
  data: {
618
- tx_bytes: tx,
628
+ tx_bytes: txBytes,
619
629
  mode: 'BROADCAST_MODE_SYNC'
620
630
  },
621
631
  timeout: 15000 // Increased timeout for direct nodes
@@ -722,7 +732,7 @@ var get_pools = function () {
722
732
  return [4 /*yield*/, axiosInstance({
723
733
  method: 'GET',
724
734
  url: "".concat(MIDGARD_API, "/pools"),
725
- timeout: 5000
735
+ timeout: 30000 // 30 seconds for slower network conditions
726
736
  })];
727
737
  case 2:
728
738
  result = _a.sent();
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@pioneer-platform/maya-network",
3
- "version": "8.13.21",
3
+ "version": "8.15.0",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "dependencies": {
7
+ "axios": "^1.6.0",
7
8
  "axios-retry": "^3.3.1",
8
9
  "bech32": "^1.1.4",
9
10
  "bip32": "^2.0.5",
@@ -18,9 +19,14 @@
18
19
  "secp256k1": "^3.8.0",
19
20
  "ts-node": "^8.10.2",
20
21
  "typescript": "^5.0.4",
21
- "@pioneer-platform/loggerdog": "8.11.0"
22
+ "@pioneer-platform/loggerdog": "8.11.0",
23
+ "@pioneer-platform/pioneer-nodes": "8.31.0"
22
24
  },
23
25
  "gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3",
26
+ "devDependencies": {
27
+ "@types/node": "^18.16.0",
28
+ "typescript": "^5.0.4"
29
+ },
24
30
  "scripts": {
25
31
  "create": "pnpm run build && pnpm run test",
26
32
  "build": "tsc -p .",