edge-currency-plugins 3.0.1 → 3.0.2
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/android/src/main/assets/edge-currency-plugins/edge-currency-plugins.js +6 -6
- package/lib/common/utxobased/db/Models/ProcessorTransaction.js +1 -0
- package/lib/common/utxobased/db/types.js +4 -0
- package/lib/common/utxobased/engine/UtxoEngine.js +5 -1
- package/lib/common/utxobased/engine/UtxoEngineState.js +2 -1
- package/lib/common/utxobased/network/blockbookApi.js +8 -2
- package/lib/src/common/utxobased/db/types.d.ts +7 -3
- package/lib/src/common/utxobased/keymanager/utxopicker/types.d.ts +1 -1
- package/lib/src/common/utxobased/network/blockbookApi.d.ts +1 -1
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ var _bnjs = require('bn.js'); var _bnjs2 = _interopRequireDefault(_bnjs);
|
|
|
24
24
|
const inputs = otherParams.psbt.inputs.map((input, n) => ({
|
|
25
25
|
amount: input.value.toString(),
|
|
26
26
|
scriptPubkey: Buffer.from(input.scriptPubkey).toString('hex'), // [1]
|
|
27
|
+
sequence: input.sequence,
|
|
27
28
|
n,
|
|
28
29
|
txId: Buffer.from(input.hash).reverse().toString('hex'), // [1]
|
|
29
30
|
outputIndex: input.index
|
|
@@ -155,8 +155,12 @@ var _UtxoWalletTools = require('./UtxoWalletTools');
|
|
|
155
155
|
})
|
|
156
156
|
|
|
157
157
|
// Transaction checks:
|
|
158
|
-
//
|
|
158
|
+
// Must be found
|
|
159
159
|
if (replacedTx == null) return null
|
|
160
|
+
// Must have at least one input with the sequence enabling RBF policy
|
|
161
|
+
if (replacedTx.inputs.every(input => input.sequence > 0xfffffffd))
|
|
162
|
+
return null
|
|
163
|
+
// Must not be confirmed or dropped.
|
|
160
164
|
if (replacedTx.blockHeight !== 0) return null
|
|
161
165
|
|
|
162
166
|
// Double the fee used for the RBF transaction:
|
|
@@ -1332,9 +1332,10 @@ const processTransactionResponse = (
|
|
|
1332
1332
|
})
|
|
1333
1333
|
return {
|
|
1334
1334
|
txId: vin.txid,
|
|
1335
|
-
outputIndex: vin.vout,
|
|
1335
|
+
outputIndex: vin.vout,
|
|
1336
1336
|
n: vin.n,
|
|
1337
1337
|
scriptPubkey,
|
|
1338
|
+
sequence: vin.sequence,
|
|
1338
1339
|
amount: vin.value
|
|
1339
1340
|
}
|
|
1340
1341
|
})
|
|
@@ -87,9 +87,15 @@ var _cleaners = require('cleaners');
|
|
|
87
87
|
vin: _cleaners.asArray.call(void 0,
|
|
88
88
|
_cleaners.asObject.call(void 0, {
|
|
89
89
|
txid: _cleaners.asString,
|
|
90
|
-
sequence
|
|
90
|
+
// Empirically observed omitted sequence is possible for when sequence is zero.
|
|
91
|
+
// Is the case for tx `19ecc679cfc7e71ad616a22bbee96fd5abe8616e4f408f1f5daaf137400ae091`.
|
|
92
|
+
sequence: _cleaners.asOptional.call(void 0, _cleaners.asNumber, 0),
|
|
91
93
|
n: _cleaners.asNumber,
|
|
92
|
-
|
|
94
|
+
// If Blockbook doesn't provide vout, assume 0. Empirically observed
|
|
95
|
+
// case for tx `fefac8c22ba1178df5d7c90b78cc1c203d1a9f5f5506f7b8f6f469fa821c2674`
|
|
96
|
+
// which has no `vout` for input in WebSocket response payload but block
|
|
97
|
+
// will show the input's vout value to be `0`.
|
|
98
|
+
vout: _cleaners.asOptional.call(void 0, _cleaners.asNumber, 0),
|
|
93
99
|
addresses: _cleaners.asArray.call(void 0, asAddress),
|
|
94
100
|
isAddress: _cleaners.asBoolean,
|
|
95
101
|
value: _cleaners.asString,
|
|
@@ -40,10 +40,14 @@ export interface IProcessorTransaction {
|
|
|
40
40
|
}
|
|
41
41
|
export interface ITransactionOutput {
|
|
42
42
|
amount: string;
|
|
43
|
-
scriptPubkey: string;
|
|
44
43
|
n: number;
|
|
44
|
+
scriptPubkey: string;
|
|
45
45
|
}
|
|
46
|
-
export interface ITransactionInput
|
|
47
|
-
|
|
46
|
+
export interface ITransactionInput {
|
|
47
|
+
amount: string;
|
|
48
|
+
n: number;
|
|
48
49
|
outputIndex: number;
|
|
50
|
+
scriptPubkey: string;
|
|
51
|
+
sequence: number;
|
|
52
|
+
txId: string;
|
|
49
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edge-currency-plugins",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
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",
|