edge-currency-plugins 3.8.7 → 3.8.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.
@@ -1354,30 +1354,44 @@ const processTransactionResponse = (
1354
1354
  return {
1355
1355
  amount: outputTotalValue,
1356
1356
  n: 0,
1357
- outputIndex: 4294967295,
1357
+ // UINT32_MAX value, as a coinbase has no previous outpoint
1358
+ outputIndex: 0xffffffff,
1358
1359
  scriptPubkey: '', // Maybe there's a bogus scriptPubkey we can use here?
1359
1360
  sequence: vin.sequence,
1360
1361
  txId: '0000000000000000000000000000000000000000000000000000000000000000'
1361
1362
  }
1362
1363
  }
1363
1364
 
1364
- if (vin.txid == null) {
1365
- throw new Error(`Unexpected null txid when processing transaction inputs`)
1366
- }
1367
-
1368
- const scriptPubkey =
1365
+ let scriptPubkey = 'unknown'
1366
+ try {
1369
1367
  // Note: Blockbook has empirically not sent a hex value as the
1370
1368
  // scriptPubkey for vins. If we discover this to be changed for some
1371
1369
  // cases, we may want to use the `hex` field as an optimization.
1372
- _cleaners.asMaybe.call(void 0,
1373
- raw => _utils3.validScriptPubkeyFromAddress.call(void 0, raw),
1374
- 'unknown'
1375
- )({
1370
+ scriptPubkey = _utils3.validScriptPubkeyFromAddress.call(void 0, {
1376
1371
  address: vin.addresses[0],
1377
1372
  coin: common.pluginInfo.coinInfo.name
1378
1373
  })
1374
+ } catch (error) {
1375
+ common.log.warn(
1376
+ `failed to get scriptPubkey from address ${vin.addresses[0]}: `,
1377
+ error
1378
+ )
1379
+ }
1380
+
1381
+ // Some inputs may not have a txid in addition to coinbase inputs, such as
1382
+ // private transaction inputs from privacy chains (e.g. SparkSpend inputs in FIRO).
1383
+ // Warning: Because the engine doesn't support private transactions, or any
1384
+ // transaction outputs that wouldn't have a txid as their input in the spend transaction,
1385
+ // we can safely assume an all-zero txid for these inputs.
1386
+ // If we're to ever support private transaction spends, then this wouldn't
1387
+ // be safe to assume as "our own input" because it wouldn't remove the UTXO
1388
+ // from the DataLayer properly.
1389
+ const txId =
1390
+ _nullishCoalesce(vin.txid, () => (
1391
+ '0000000000000000000000000000000000000000000000000000000000000000'))
1392
+
1379
1393
  return {
1380
- txId: vin.txid,
1394
+ txId,
1381
1395
  outputIndex: vin.vout,
1382
1396
  n: vin.n,
1383
1397
  scriptPubkey,
@@ -34,7 +34,7 @@ const currencyInfo = {
34
34
  ..._commonInfo.legacyMemoInfo,
35
35
  defaultSettings: {
36
36
  customFeeSettings: ['satPerByte'],
37
- blockbookServers: ['wss://pivx-wusa1.edge.app', 'wss://zkbitcoin.com'],
37
+ blockbookServers: ['wss://pivx-eusa1.edge.app', 'wss://zkbitcoin.com'],
38
38
  enableCustomServers: false
39
39
  },
40
40
  displayName: 'PIVX',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-currency-plugins",
3
- "version": "3.8.7",
3
+ "version": "3.8.9",
4
4
  "description": "Edge currency plugins to fetch and process wallet accounts, balances and transactions.",
5
5
  "homepage": "https://edge.app/",
6
6
  "repository": "https://github.com/EdgeApp/edge-currency-plugins",