edge-currency-plugins 1.3.5 → 1.3.7
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.
|
@@ -550,15 +550,21 @@ var _utils = require('./utils');
|
|
|
550
550
|
return await Promise.all(
|
|
551
551
|
psbt.inputs.map(async ({ hash, index }) => {
|
|
552
552
|
const txid = Buffer.from(hash).reverse().toString('hex')
|
|
553
|
+
const utxoId = `${txid}_${index}`
|
|
553
554
|
|
|
554
555
|
const [utxo] = await processor.fetchUtxos({
|
|
555
|
-
utxoIds: [
|
|
556
|
+
utxoIds: [utxoId]
|
|
556
557
|
})
|
|
557
558
|
if (utxo == null) throw new Error('Invalid UTXO')
|
|
558
559
|
|
|
559
560
|
const address = await processor.fetchAddress(utxo.scriptPubkey)
|
|
560
|
-
if (
|
|
561
|
-
throw new Error(
|
|
561
|
+
if (address == null) {
|
|
562
|
+
throw new Error(`Address for UTXO ${utxoId} not found`)
|
|
563
|
+
}
|
|
564
|
+
if (address.path == null)
|
|
565
|
+
throw new Error(
|
|
566
|
+
`Invalid scriptPubkey ${address.scriptPubkey}; Missing path`
|
|
567
|
+
)
|
|
562
568
|
|
|
563
569
|
const privateKey = walletTools.getPrivateKey({
|
|
564
570
|
path: address.path,
|
|
@@ -581,7 +587,7 @@ var _utils = require('./utils');
|
|
|
581
587
|
transaction.signedTx = signedTx.hex
|
|
582
588
|
|
|
583
589
|
const { paymentProtocolInfo } =
|
|
584
|
-
_nullishCoalesce(_optionalChain([transaction, 'access',
|
|
590
|
+
_nullishCoalesce(_optionalChain([transaction, 'access', _15 => _15.otherParams, 'optionalAccess', _16 => _16.edgeSpendInfo, 'optionalAccess', _17 => _17.otherParams]), () => ( {}))
|
|
585
591
|
if (paymentProtocolInfo != null) {
|
|
586
592
|
const payment = _paymentRequest.createPayment.call(void 0,
|
|
587
593
|
transaction.signedTx,
|
|
@@ -712,7 +718,7 @@ var _utils = require('./utils');
|
|
|
712
718
|
) => {
|
|
713
719
|
const scriptPubkey = walletTools.addressToScriptPubkey(address)
|
|
714
720
|
const processorAddress = await processor.fetchAddress(scriptPubkey)
|
|
715
|
-
if (_optionalChain([processorAddress, 'optionalAccess',
|
|
721
|
+
if (_optionalChain([processorAddress, 'optionalAccess', _18 => _18.path]) == null) {
|
|
716
722
|
throw new Error('Missing address to sign with')
|
|
717
723
|
}
|
|
718
724
|
const privateKey = asMaybeCurrencyPrivateKey(sensitiveWalletInfo.keys)
|
|
@@ -728,7 +734,7 @@ var _utils = require('./utils');
|
|
|
728
734
|
})
|
|
729
735
|
|
|
730
736
|
const signature = await walletTools.signMessageBase64({
|
|
731
|
-
path: _optionalChain([processorAddress, 'optionalAccess',
|
|
737
|
+
path: _optionalChain([processorAddress, 'optionalAccess', _19 => _19.path]),
|
|
732
738
|
message,
|
|
733
739
|
xprivKeys
|
|
734
740
|
})
|
|
@@ -291,7 +291,7 @@ var _utils3 = require('./utils');
|
|
|
291
291
|
})
|
|
292
292
|
if (processorAddress == null) {
|
|
293
293
|
throw new Error(
|
|
294
|
-
|
|
294
|
+
`Missing processor address ${format} ${branch} ${addressIndex} during initialization`
|
|
295
295
|
)
|
|
296
296
|
}
|
|
297
297
|
const { address } = walletTools.scriptPubkeyToAddress({
|
|
@@ -10,7 +10,7 @@ var _types3 = require('./types');
|
|
|
10
10
|
var _windowWS = require('./windowWS');
|
|
11
11
|
|
|
12
12
|
const TIMER_SLACK = 500
|
|
13
|
-
const KEEP_ALIVE_MS =
|
|
13
|
+
const KEEP_ALIVE_MS = 50000 // interval at which we keep the connection alive
|
|
14
14
|
const WAKE_UP_MS = 5000 // interval at which we wakeUp and potentially onQueueSpace
|
|
15
15
|
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edge-currency-plugins",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"description": "Edge currency plugins to fetch and process wallet accounts, balances and transactions.",
|
|
5
5
|
"repository": "https://github.com/EdgeApp/edge-currency-plugins",
|
|
6
6
|
"license": "MIT",
|