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.
- package/lib/common/utxobased/engine/UtxoEngineProcessor.js +6 -1
- package/lib/common/utxobased/network/blockbookApi.js +22 -37
- package/lib/src/common/utxobased/network/blockbookApi.d.ts +6 -8
- package/package.json +1 -1
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/assets/edge-currency-plugins/669.chunk.js +0 -1
- package/android/src/main/assets/edge-currency-plugins/edge-currency-plugins.js +0 -78
- package/android/src/main/java/app/edge/reactnative/currencyplugins/EdgeCurrencyPluginsModule.java +0 -26
- package/android/src/main/java/app/edge/reactnative/currencyplugins/EdgeCurrencyPluginsPackage.java +0 -24
|
@@ -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 (
|
|
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.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
32
|
-
isAddress: true;
|
|
31
|
+
isAddress: boolean;
|
|
33
32
|
n: number;
|
|
34
33
|
sequence: number;
|
|
35
|
-
txid
|
|
34
|
+
txid?: string;
|
|
36
35
|
value: string;
|
|
37
36
|
vout: number;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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.
|
|
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",
|