edge-currency-plugins 3.5.1 → 3.5.3

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.
@@ -168,6 +168,7 @@ var _utils3 = require('./utils');
168
168
  `processed changed, percent: ${percent}, processedCount: ${processedCount}, totalCount: ${expectedProcessCount}`
169
169
  )
170
170
  processedPercent = percent
171
+ common.updateSeenTxCheckpoint()
171
172
  emitter.emit(_EngineEmitter.EngineEvent.ADDRESSES_CHECKED, percent)
172
173
  }
173
174
  }
@@ -1327,7 +1328,7 @@ const processTransactionResponse = (
1327
1328
 
1328
1329
  const inputs = txResponse.vin.map(vin => {
1329
1330
  // Handle coinbase input
1330
- if (!vin.isAddress) {
1331
+ if (vin.coinbase != null) {
1331
1332
  return {
1332
1333
  amount: outputTotalValue,
1333
1334
  n: 0,
@@ -1338,6 +1339,10 @@ const processTransactionResponse = (
1338
1339
  }
1339
1340
  }
1340
1341
 
1342
+ if (vin.txid == null) {
1343
+ throw new Error(`Unexpected null txid when processing transaction inputs`)
1344
+ }
1345
+
1341
1346
  const scriptPubkey =
1342
1347
  // Note: Blockbook has empirically not sent a hex value as the
1343
1348
  // scriptPubkey for vins. If we discover this to be changed for some
@@ -9,8 +9,6 @@
9
9
 
10
10
 
11
11
 
12
-
13
-
14
12
  var _cleaners = require('cleaners');
15
13
 
16
14
  /**
@@ -73,11 +71,6 @@ var _cleaners = require('cleaners');
73
71
 
74
72
 
75
73
 
76
-
77
-
78
-
79
-
80
-
81
74
 
82
75
 
83
76
 
@@ -95,36 +88,28 @@ var _cleaners = require('cleaners');
95
88
  blockTime: _cleaners.asNumber,
96
89
  fees: _cleaners.asString,
97
90
  vin: _cleaners.asArray.call(void 0,
98
- _cleaners.asEither.call(void 0,
99
- // Address input:
100
- _cleaners.asObject.call(void 0, {
101
- addresses: _cleaners.asArray.call(void 0, asAddress),
102
- // `isAddress` is a boolean flag that indicates whether the input is an address.
103
- // And therefore has `addresses` field. If `isAddress` is false, then the input is likely a coinbase input.
104
- isAddress: _cleaners.asValue.call(void 0, true),
105
- // This is the index of the input. Not to be confused with the index of the previous output (vout).
106
- n: _cleaners.asNumber,
107
- // Empirically observed omitted sequence is possible for when sequence is zero.
108
- // Is the case for tx `19ecc679cfc7e71ad616a22bbee96fd5abe8616e4f408f1f5daaf137400ae091`.
109
- sequence: _cleaners.asOptional.call(void 0, _cleaners.asNumber, 0),
110
- txid: _cleaners.asString,
111
- value: _cleaners.asString,
112
- // If Blockbook doesn't provide vout, assume 0. Empirically observed
113
- // case for tx `fefac8c22ba1178df5d7c90b78cc1c203d1a9f5f5506f7b8f6f469fa821c2674`
114
- // which has no `vout` for input in WebSocket response payload but block
115
- // will show the input's vout value to be `0`.
116
- vout: _cleaners.asOptional.call(void 0, _cleaners.asNumber, 0),
117
- hex: _cleaners.asOptional.call(void 0, _cleaners.asString)
118
- }),
119
- // Coinbase input:
120
- _cleaners.asObject.call(void 0, {
121
- // Coinbase input is a string of hex data (see example c6e617656b7b6d9fdcf8800fb5370479e5aceea4b6fe2fd74bd7bb0f3f2c64db)
122
- coinbase: _cleaners.asString,
123
- isAddress: _cleaners.asValue.call(void 0, false),
124
- n: _cleaners.asNumber,
125
- sequence: _cleaners.asNumber
126
- })
127
- )
91
+ _cleaners.asObject.call(void 0, {
92
+ addresses: _cleaners.asOptional.call(void 0, _cleaners.asArray.call(void 0, _cleaners.asString), () => []),
93
+ // `isAddress` is a boolean flag that indicates whether the input is an address.
94
+ // And therefore has `addresses` field. If `isAddress` is false, then the input is likely a coinbase input.
95
+ isAddress: _cleaners.asBoolean,
96
+ // This is the index of the input. Not to be confused with the index of the previous output (vout).
97
+ n: _cleaners.asNumber,
98
+ // Empirically observed omitted sequence is possible for when sequence is zero.
99
+ // Is the case for tx `19ecc679cfc7e71ad616a22bbee96fd5abe8616e4f408f1f5daaf137400ae091`.
100
+ sequence: _cleaners.asOptional.call(void 0, _cleaners.asNumber, 0),
101
+ txid: _cleaners.asOptional.call(void 0, _cleaners.asString),
102
+ value: _cleaners.asOptional.call(void 0, _cleaners.asString, '0'),
103
+ // If Blockbook doesn't provide vout, assume 0. Empirically observed
104
+ // case for tx `fefac8c22ba1178df5d7c90b78cc1c203d1a9f5f5506f7b8f6f469fa821c2674`
105
+ // which has no `vout` for input in WebSocket response payload but block
106
+ // will show the input's vout value to be `0`.
107
+ vout: _cleaners.asOptional.call(void 0, _cleaners.asNumber, 0),
108
+ coinbase: _cleaners.asOptional.call(void 0, _cleaners.asString),
109
+ isOwn: _cleaners.asOptional.call(void 0, _cleaners.asBoolean),
110
+ hex: _cleaners.asOptional.call(void 0, _cleaners.asString),
111
+ asm: _cleaners.asOptional.call(void 0, _cleaners.asString)
112
+ })
128
113
  ),
129
114
  vout: _cleaners.asArray.call(void 0,
130
115
  _cleaners.asObject.call(void 0, {
@@ -28,18 +28,16 @@ export interface BlockbookTransaction {
28
28
  fees: string;
29
29
  vin: Array<{
30
30
  addresses: string[];
31
- hex?: string;
32
- isAddress: true;
31
+ isAddress: boolean;
33
32
  n: number;
34
33
  sequence: number;
35
- txid: string;
34
+ txid?: string;
36
35
  value: string;
37
36
  vout: number;
38
- } | {
39
- coinbase: string;
40
- isAddress: false;
41
- n: number;
42
- sequence: number;
37
+ coinbase?: string;
38
+ isOwn?: boolean;
39
+ hex?: string;
40
+ asm?: string;
43
41
  }>;
44
42
  vout: Array<{
45
43
  n: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-currency-plugins",
3
- "version": "3.5.1",
3
+ "version": "3.5.3",
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",
@@ -1,2 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
- </manifest>