@xchainjs/xchain-utxo-providers 0.2.2 → 0.2.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.
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# XChainJS API UTXO providers Interface
|
|
2
2
|
|
|
3
|
-
A specification for a generalised interface for api providers, to be used by XChainJS implementations. The providers should not have any functionality to generate a key, instead, the `
|
|
3
|
+
A specification for a generalised interface for api providers, to be used by XChainJS implementations. The providers should not have any functionality to generate a key, instead, the `xchain-crypto` library should be used to ensure cross-chain compatible keystores are handled. The providers is only ever passed a master BIP39 phrase, from which a temporary key and address is decoded.
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
package/lib/index.esm.js
CHANGED
|
@@ -632,7 +632,7 @@ class HaskoinProvider {
|
|
|
632
632
|
network: this.haskoinNetwork,
|
|
633
633
|
address,
|
|
634
634
|
});
|
|
635
|
-
const confirmedUnspent = allUnspent.filter((i) => i.block
|
|
635
|
+
const confirmedUnspent = allUnspent.filter((i) => i.block && !i.block.mempool);
|
|
636
636
|
return this.mapUTXOs(confirmedUnspent);
|
|
637
637
|
});
|
|
638
638
|
}
|
|
@@ -994,7 +994,9 @@ class BlockcypherProvider {
|
|
|
994
994
|
unspentOnly,
|
|
995
995
|
});
|
|
996
996
|
//remove duplicates
|
|
997
|
-
const txs =
|
|
997
|
+
const txs = [];
|
|
998
|
+
response.txrefs && txs.push(...response.txrefs.map((i) => i.tx_hash));
|
|
999
|
+
response.unconfirmed_txrefs && txs.push(...response.unconfirmed_txrefs.map((i) => i.tx_hash));
|
|
998
1000
|
const uniqTxs = [...new Set(txs)];
|
|
999
1001
|
const start = offset >= uniqTxs.length ? uniqTxs.length : offset;
|
|
1000
1002
|
const end = offset + limit >= uniqTxs.length ? uniqTxs.length : offset + limit;
|
package/lib/index.js
CHANGED
|
@@ -641,7 +641,7 @@ class HaskoinProvider {
|
|
|
641
641
|
network: this.haskoinNetwork,
|
|
642
642
|
address,
|
|
643
643
|
});
|
|
644
|
-
const confirmedUnspent = allUnspent.filter((i) => i.block
|
|
644
|
+
const confirmedUnspent = allUnspent.filter((i) => i.block && !i.block.mempool);
|
|
645
645
|
return this.mapUTXOs(confirmedUnspent);
|
|
646
646
|
});
|
|
647
647
|
}
|
|
@@ -1003,7 +1003,9 @@ class BlockcypherProvider {
|
|
|
1003
1003
|
unspentOnly,
|
|
1004
1004
|
});
|
|
1005
1005
|
//remove duplicates
|
|
1006
|
-
const txs =
|
|
1006
|
+
const txs = [];
|
|
1007
|
+
response.txrefs && txs.push(...response.txrefs.map((i) => i.tx_hash));
|
|
1008
|
+
response.unconfirmed_txrefs && txs.push(...response.unconfirmed_txrefs.map((i) => i.tx_hash));
|
|
1007
1009
|
const uniqTxs = [...new Set(txs)];
|
|
1008
1010
|
const start = offset >= uniqTxs.length ? uniqTxs.length : offset;
|
|
1009
1011
|
const end = offset + limit >= uniqTxs.length ? uniqTxs.length : offset + limit;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-utxo-providers",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.esm.js",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@xchainjs/xchain-client": "^0.14.
|
|
30
|
+
"@xchainjs/xchain-client": "^0.14.2",
|
|
31
31
|
"@xchainjs/xchain-crypto": "^0.3.0",
|
|
32
|
-
"@xchainjs/xchain-util": "^0.13.
|
|
32
|
+
"@xchainjs/xchain-util": "^0.13.1",
|
|
33
33
|
"axios": "^1.3.6"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@xchainjs/xchain-client": "^0.14.
|
|
36
|
+
"@xchainjs/xchain-client": "^0.14.2",
|
|
37
37
|
"@xchainjs/xchain-crypto": "^0.3.0",
|
|
38
|
-
"@xchainjs/xchain-util": "^0.13.
|
|
38
|
+
"@xchainjs/xchain-util": "^0.13.1",
|
|
39
39
|
"axios": "^1.3.6"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|