@pioneer-platform/solana-network 8.25.6 → 8.25.9

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/solana-network@8.25.6 build /Users/highlander/WebstormProjects/keepkey-stack/projects/pioneer/modules/coins/solana/solana-network
3
+ > @pioneer-platform/solana-network@8.25.9 build /Users/highlander/WebstormProjects/keepkey-stack/projects/pioneer/modules/coins/solana/solana-network
4
4
  > tsc -p .
5
5
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @pioneer-platform/solana-network
2
2
 
3
+ ## 8.25.9
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: fix: Redis gzip binary corruption in tx history + SDK transaction loading from vault cache
8
+ - Updated dependencies
9
+ - @pioneer-platform/pioneer-nodes@8.37.9
10
+
11
+ ## 8.25.8
12
+
13
+ ### Patch Changes
14
+
15
+ - fix: Redis gzip binary corruption in tx history + SDK transaction loading from vault cache
16
+ - Updated dependencies
17
+ - @pioneer-platform/pioneer-nodes@8.37.8
18
+
19
+ ## 8.25.7
20
+
21
+ ### Patch Changes
22
+
23
+ - chore: fix: dashboard staleness uses newest fetchedAt instead of oldest
24
+ - Updated dependencies
25
+ - @pioneer-platform/pioneer-nodes@8.37.7
26
+
3
27
  ## 8.25.6
4
28
 
5
29
  ### Patch Changes
package/lib/index.js CHANGED
@@ -233,6 +233,16 @@ module.exports = {
233
233
  estimateFee: function () {
234
234
  return estimate_fee();
235
235
  },
236
+ /**
237
+ * Get transaction history for an address
238
+ * @param address - Solana public key (base58)
239
+ * @param limit - Number of transactions to fetch (default 20)
240
+ * @returns Array of transaction objects
241
+ */
242
+ getTransactions: function (address, limit) {
243
+ if (limit === void 0) { limit = 20; }
244
+ return get_transactions(address, limit);
245
+ },
236
246
  /**
237
247
  * Get SPL token balances for an address
238
248
  * @param address - Solana public key (base58)
@@ -574,9 +584,100 @@ function estimate_fee() {
574
584
  });
575
585
  });
576
586
  }
587
+ function get_transactions(address_1) {
588
+ return __awaiter(this, arguments, void 0, function (address, limit) {
589
+ var tag, sigResponse, signatures, transactions, _i, signatures_1, sig, txResponse, tx, txErr_1, e_9;
590
+ if (limit === void 0) { limit = 20; }
591
+ return __generator(this, function (_a) {
592
+ switch (_a.label) {
593
+ case 0:
594
+ tag = TAG + " | get_transactions | ";
595
+ _a.label = 1;
596
+ case 1:
597
+ _a.trys.push([1, 9, , 10]);
598
+ log.debug(tag, "Getting transactions for:", address);
599
+ return [4 /*yield*/, axios({
600
+ url: rpcUrl,
601
+ method: 'POST',
602
+ headers: getHeaders(),
603
+ data: {
604
+ "jsonrpc": "2.0",
605
+ "id": 1,
606
+ "method": "getSignaturesForAddress",
607
+ "params": [
608
+ address,
609
+ { "limit": limit }
610
+ ]
611
+ }
612
+ })];
613
+ case 2:
614
+ sigResponse = _a.sent();
615
+ if (!sigResponse.data || !sigResponse.data.result) {
616
+ log.warn(tag, "No signatures found for address");
617
+ return [2 /*return*/, []];
618
+ }
619
+ signatures = sigResponse.data.result;
620
+ log.debug(tag, "Found ".concat(signatures.length, " signatures, fetching details..."));
621
+ transactions = [];
622
+ _i = 0, signatures_1 = signatures;
623
+ _a.label = 3;
624
+ case 3:
625
+ if (!(_i < signatures_1.length)) return [3 /*break*/, 8];
626
+ sig = signatures_1[_i];
627
+ _a.label = 4;
628
+ case 4:
629
+ _a.trys.push([4, 6, , 7]);
630
+ return [4 /*yield*/, axios({
631
+ url: rpcUrl,
632
+ method: 'POST',
633
+ headers: getHeaders(),
634
+ data: {
635
+ "jsonrpc": "2.0",
636
+ "id": 1,
637
+ "method": "getTransaction",
638
+ "params": [
639
+ sig.signature,
640
+ { "encoding": "jsonParsed", "maxSupportedTransactionVersion": 0 }
641
+ ]
642
+ }
643
+ })];
644
+ case 5:
645
+ txResponse = _a.sent();
646
+ if (txResponse.data && txResponse.data.result) {
647
+ tx = txResponse.data.result;
648
+ transactions.push({
649
+ signature: sig.signature,
650
+ slot: tx.slot,
651
+ blockTime: tx.blockTime,
652
+ err: sig.err,
653
+ memo: sig.memo,
654
+ meta: tx.meta,
655
+ transaction: tx.transaction
656
+ });
657
+ }
658
+ return [3 /*break*/, 7];
659
+ case 6:
660
+ txErr_1 = _a.sent();
661
+ log.warn(tag, "Failed to fetch tx ".concat(sig.signature, ": ").concat(txErr_1.message));
662
+ return [3 /*break*/, 7];
663
+ case 7:
664
+ _i++;
665
+ return [3 /*break*/, 3];
666
+ case 8:
667
+ log.debug(tag, "Retrieved ".concat(transactions.length, " full transactions"));
668
+ return [2 /*return*/, transactions];
669
+ case 9:
670
+ e_9 = _a.sent();
671
+ log.error(tag, "Error getting transactions:", e_9.message);
672
+ return [2 /*return*/, []];
673
+ case 10: return [2 /*return*/];
674
+ }
675
+ });
676
+ });
677
+ }
577
678
  function get_token_balances(address) {
578
679
  return __awaiter(this, void 0, void 0, function () {
579
- var tag, response, tokenAccounts, e_9;
680
+ var tag, response, tokenAccounts, e_10;
580
681
  return __generator(this, function (_a) {
581
682
  switch (_a.label) {
582
683
  case 0:
@@ -618,8 +719,8 @@ function get_token_balances(address) {
618
719
  }
619
720
  return [2 /*return*/, []];
620
721
  case 3:
621
- e_9 = _a.sent();
622
- log.error(tag, "Error getting token balances:", e_9.message);
722
+ e_10 = _a.sent();
723
+ log.error(tag, "Error getting token balances:", e_10.message);
623
724
  return [2 /*return*/, []];
624
725
  case 4: return [2 /*return*/];
625
726
  }
@@ -628,7 +729,7 @@ function get_token_balances(address) {
628
729
  }
629
730
  function get_block_height() {
630
731
  return __awaiter(this, void 0, void 0, function () {
631
- var tag, response, blockHeight, e_10;
732
+ var tag, response, blockHeight, e_11;
632
733
  return __generator(this, function (_a) {
633
734
  switch (_a.label) {
634
735
  case 0:
@@ -657,9 +758,9 @@ function get_block_height() {
657
758
  }
658
759
  throw new Error("Failed to get block height");
659
760
  case 3:
660
- e_10 = _a.sent();
661
- log.error(tag, "Error getting block height:", e_10.message);
662
- throw e_10;
761
+ e_11 = _a.sent();
762
+ log.error(tag, "Error getting block height:", e_11.message);
763
+ throw e_11;
663
764
  case 4: return [2 /*return*/];
664
765
  }
665
766
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/solana-network",
3
- "version": "8.25.6",
3
+ "version": "8.25.9",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "description": "Pioneer Platform Solana Network module",
@@ -14,8 +14,8 @@
14
14
  "@solana/web3.js": "^1.95.0",
15
15
  "axios": "^1.6.0",
16
16
  "dotenv": "^16.0.0",
17
- "@pioneer-platform/pioneer-nodes": "8.37.6",
18
- "@pioneer-platform/loggerdog": "8.11.0"
17
+ "@pioneer-platform/loggerdog": "8.11.0",
18
+ "@pioneer-platform/pioneer-nodes": "8.37.9"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "^18.16.0",