@pioneer-platform/utxo-network 8.25.4 → 8.27.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.
- package/CHANGELOG.md +22 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +17 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @pioneer-platform/utxo-network
|
|
2
2
|
|
|
3
|
+
## 8.27.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- chore: feat(pioneer-sdk): Add transaction history integration
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @pioneer-platform/blockbook@8.29.0
|
|
13
|
+
|
|
14
|
+
## 8.26.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- feat(pioneer-sdk): Add transaction history integration
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @pioneer-platform/blockbook@8.28.0
|
|
24
|
+
|
|
3
25
|
## 8.25.4
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { FeeRates } from './types/client-types';
|
|
|
3
3
|
export declare const init: (servers: any) => Promise<boolean>;
|
|
4
4
|
export declare const getInfo: (coin: string) => Promise<any>;
|
|
5
5
|
export declare const txsMulti: (coin: string, addresses: any) => Promise<void>;
|
|
6
|
-
export declare const txsByXpub: (coin: string, addresses: any) => Promise<
|
|
6
|
+
export declare const txsByXpub: (coin: string, addresses: any) => Promise<any>;
|
|
7
7
|
export declare const utxosByXpub: (coin: string, xpub: any) => Promise<any>;
|
|
8
8
|
export declare const getPubkeyInfo: (coin: string, xpub: any) => Promise<any>;
|
|
9
9
|
export declare const getBalanceByXpub: (coin: string, xpub: any) => Promise<{
|
package/lib/index.js
CHANGED
|
@@ -248,9 +248,16 @@ const init_network = async function (servers) {
|
|
|
248
248
|
// @TODO
|
|
249
249
|
// const blockbooks = servers.filter((server: { type: string; }) => server.type === 'blockbook');
|
|
250
250
|
// log.debug(tag,"blockbooks: ",blockbooks)
|
|
251
|
-
//
|
|
252
|
-
//
|
|
253
|
-
|
|
251
|
+
// CRITICAL: Initialize blockbook if not already initialized (for standalone/test usage)
|
|
252
|
+
// Check if blockbook has been initialized by checking if it has any URLs configured
|
|
253
|
+
const blockbookUrls = blockbook.getBlockbooks ? blockbook.getBlockbooks() : {};
|
|
254
|
+
if (!blockbookUrls || Object.keys(blockbookUrls).length === 0) {
|
|
255
|
+
log.info(tag, 'Blockbook not initialized - initializing now for transaction history support');
|
|
256
|
+
await blockbook.init();
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
log.debug(tag, 'Blockbook already initialized by server');
|
|
260
|
+
}
|
|
254
261
|
// @TODO
|
|
255
262
|
//load daemon servers
|
|
256
263
|
//load unchained servers
|
|
@@ -653,14 +660,14 @@ let get_transaction = async function (coin, txid, format) {
|
|
|
653
660
|
}
|
|
654
661
|
};
|
|
655
662
|
let get_txs_by_xpub = async function (coin, xpub) {
|
|
656
|
-
let tag = ' | get_txs_by_xpub | ';
|
|
663
|
+
let tag = TAG + ' | get_txs_by_xpub | ';
|
|
657
664
|
try {
|
|
658
|
-
log.debug(tag, "
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
//
|
|
663
|
-
|
|
665
|
+
log.debug(tag, "Getting transactions for xpub: ", xpub.substring(0, 20) + '...');
|
|
666
|
+
// Use blockbook's txsByXpub which uses details=txs to get transaction data
|
|
667
|
+
const xpubData = await blockbook.txsByXpub(coin, xpub);
|
|
668
|
+
log.debug(tag, `Blockbook returned ${xpubData?.transactions?.length || 0} transactions`);
|
|
669
|
+
// Return the transactions array from the xpub data
|
|
670
|
+
return xpubData?.transactions || [];
|
|
664
671
|
}
|
|
665
672
|
catch (e) {
|
|
666
673
|
log.error(tag, stringifyError(e));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/utxo-network",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.27.0",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"build:live": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@pioneer-platform/blockbook": "^8.
|
|
14
|
+
"@pioneer-platform/blockbook": "^8.29.0",
|
|
15
15
|
"@pioneer-platform/loggerdog": "^8.11.0",
|
|
16
16
|
"@pioneer-platform/nodes": "^8.26.2",
|
|
17
17
|
"@pioneer-platform/pioneer-caip": "^9.19.0",
|