@pioneer-platform/blockbook 8.12.8 → 8.12.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @pioneer-platform/blockbook
2
2
 
3
+ ## 8.12.9
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(blockbook): Add dgub to xpub conversion for DGB
8
+
3
9
  ## 8.12.8
4
10
 
5
11
  ### Patch Changes
package/lib/index.js CHANGED
@@ -680,7 +680,7 @@ var get_transaction = function (coin, txid) {
680
680
  // Enhanced UTXO function with priority-based sequential failover
681
681
  var get_utxos_by_xpub = function (coin, xpub) {
682
682
  return __awaiter(this, void 0, void 0, function () {
683
- var tag, symbol, isBitcoin, nodes_3, activeNodes, i, node, startTime, url, body, resp, responseTime, error_2, responseTime, errorMessage, e_9;
683
+ var tag, symbol, isBitcoin, b58, data, payload, xpubPrefix, convertedData, convertedXpub, nodes_3, activeNodes, i, node, startTime, url, body, resp, responseTime, error_2, responseTime, errorMessage, e_9;
684
684
  var _a;
685
685
  return __generator(this, function (_b) {
686
686
  switch (_b.label) {
@@ -691,6 +691,25 @@ var get_utxos_by_xpub = function (coin, xpub) {
691
691
  _b.label = 1;
692
692
  case 1:
693
693
  _b.trys.push([1, 8, , 9]);
694
+ // Convert dgub to xpub for DGB (NowNodes blockbook doesn't accept dgub format)
695
+ if (symbol === 'DGB' && xpub.startsWith('dgub')) {
696
+ b58 = require('bs58');
697
+ try {
698
+ data = b58.decode(xpub);
699
+ payload = data.slice(4);
700
+ xpubPrefix = Buffer.from('0488b21e', 'hex');
701
+ convertedData = Buffer.concat([xpubPrefix, payload]);
702
+ convertedXpub = b58.encode(convertedData);
703
+ log.info(tag, "Converting DGB dgub to xpub format for blockbook compatibility");
704
+ log.info(tag, "Original: ".concat(xpub.substring(0, 20), "..."));
705
+ log.info(tag, "Converted: ".concat(convertedXpub.substring(0, 20), "..."));
706
+ xpub = convertedXpub;
707
+ }
708
+ catch (conversionError) {
709
+ log.error(tag, 'Failed to convert dgub to xpub:', conversionError);
710
+ // Continue with original xpub and let blockbook handle it
711
+ }
712
+ }
694
713
  nodes_3 = BLOCKBOOK_NODES[symbol];
695
714
  if (isBitcoin)
696
715
  log.info(tag, '🔍 [BITCOIN BLOCKBOOK] Starting UTXO query for xpub:', xpub.substring(0, 20) + '...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/blockbook",
3
- "version": "8.12.8",
3
+ "version": "8.12.9",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {