edge-currency-plugins 2.6.2 → 3.0.1
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/README.md +61 -2
- package/android/build.gradle +45 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/assets/edge-currency-plugins/669.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-plugins/edge-currency-plugins.js +76 -0
- package/android/src/main/java/app/edge/reactnative/currencyplugins/EdgeCurrencyPluginsModule.java +26 -0
- package/android/src/main/java/app/edge/reactnative/currencyplugins/EdgeCurrencyPluginsPackage.java +24 -0
- package/edge-currency-plugins.d.ts +34 -0
- package/edge-currency-plugins.podspec +28 -0
- package/ios/EdgeCurrencyPluginsModule.m +4 -0
- package/ios/EdgeCurrencyPluginsModule.swift +20 -0
- package/ios/edge-currency-plugins.xcodeproj/project.pbxproj +1 -0
- package/lib/common/constants.js +1 -2
- package/lib/common/plugin/CurrencyPlugin.js +17 -1
- package/lib/common/utxobased/db/Models/ProcessorTransaction.js +3 -2
- package/lib/common/utxobased/db/Processor.js +5 -0
- package/lib/common/utxobased/engine/ServerStates.js +159 -28
- package/lib/common/utxobased/engine/UtxoEngine.js +3 -2
- package/lib/common/utxobased/engine/UtxoEngineState.js +66 -72
- package/lib/common/utxobased/engine/types.js +3 -1
- package/lib/common/utxobased/info/bitcoin.js +1 -6
- package/lib/common/utxobased/info/bitcoincash.js +1 -6
- package/lib/common/utxobased/info/bitcoincashtestnet.js +0 -5
- package/lib/common/utxobased/info/bitcoinsv.js +0 -5
- package/lib/common/utxobased/info/bitcointestnet.js +0 -5
- package/lib/common/utxobased/info/dash.js +1 -1
- package/lib/common/utxobased/info/digibyte.js +1 -1
- package/lib/common/utxobased/info/feathercoin.js +0 -5
- package/lib/common/utxobased/info/groestlcoin.js +1 -1
- package/lib/common/utxobased/info/litecoin.js +1 -6
- package/lib/common/utxobased/info/zcoin.js +6 -5
- package/lib/common/utxobased/keymanager/keymanager.js +1 -1
- package/lib/common/utxobased/keymanager/types.js +2 -1
- package/lib/common/utxobased/network/Blockbook.js +178 -105
- package/lib/common/utxobased/network/BlockbookElectrum.js +216 -0
- package/lib/common/utxobased/network/Socket.js +130 -66
- package/lib/common/utxobased/network/blockbookApi.js +6 -6
- package/lib/common/utxobased/network/electrumApi.js +203 -0
- package/lib/{types.js → declare-modules.d.js} +2 -0
- package/lib/index.js +7 -3
- package/lib/react-native.js +26 -0
- package/lib/src/common/constants.d.ts +0 -1
- package/lib/src/common/utxobased/db/Processor.d.ts +6 -1
- package/lib/src/common/utxobased/engine/ServerStates.d.ts +8 -0
- package/lib/src/common/utxobased/engine/UtxoEngineState.d.ts +1 -4
- package/lib/src/common/utxobased/keymanager/types.d.ts +3 -3
- package/lib/src/common/utxobased/network/Blockbook.d.ts +20 -7
- package/lib/src/common/utxobased/network/BlockbookElectrum.d.ts +25 -0
- package/lib/src/common/utxobased/network/Socket.d.ts +11 -0
- package/lib/src/common/utxobased/network/blockbookApi.d.ts +2 -16
- package/lib/src/common/utxobased/network/electrumApi.d.ts +90 -0
- package/lib/src/index.d.ts +5 -1
- package/lib/src/react-native.d.ts +10 -0
- package/lib/test/utils.d.ts +4 -0
- package/package.json +24 -11
- package/lib/src/types.d.ts +0 -6
|
@@ -39,10 +39,6 @@ var _keymanager = require('../keymanager/keymanager');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var _blockbookApi = require('../network/blockbookApi');
|
|
46
42
|
var _Deferred = require('../network/Deferred'); var _Deferred2 = _interopRequireDefault(_Deferred);
|
|
47
43
|
|
|
48
44
|
var _awaitlock = require('./await-lock'); var _awaitlock2 = _interopRequireDefault(_awaitlock);
|
|
@@ -158,19 +154,19 @@ var _utils3 = require('./utils');
|
|
|
158
154
|
|
|
159
155
|
// We expect the total number of progress updates to equal the number of
|
|
160
156
|
// addresses multiplied the number of processes per address.
|
|
161
|
-
const
|
|
157
|
+
const expectedProcessCount =
|
|
162
158
|
Object.keys(taskCache.addressSubscribeCache).length * processesPerAddress
|
|
163
159
|
|
|
164
160
|
// Increment the processed count
|
|
165
161
|
processedCount = processedCount + 1
|
|
166
162
|
|
|
167
163
|
// If we have no addresses, we should not have not yet began processing.
|
|
168
|
-
if (
|
|
164
|
+
if (expectedProcessCount === 0) throw new Error('No addresses to process')
|
|
169
165
|
|
|
170
|
-
const percent = processedCount /
|
|
166
|
+
const percent = processedCount / expectedProcessCount
|
|
171
167
|
if (percent - processedPercent > _constants.CACHE_THROTTLE || percent === 1) {
|
|
172
168
|
log(
|
|
173
|
-
`processed changed, percent: ${percent}, processedCount: ${processedCount}, totalCount: ${
|
|
169
|
+
`processed changed, percent: ${percent}, processedCount: ${processedCount}, totalCount: ${expectedProcessCount}`
|
|
174
170
|
)
|
|
175
171
|
processedPercent = percent
|
|
176
172
|
emitter.emit(_EngineEmitter.EngineEvent.ADDRESSES_CHECKED, percent)
|
|
@@ -204,14 +200,9 @@ var _utils3 = require('./utils');
|
|
|
204
200
|
lock
|
|
205
201
|
}
|
|
206
202
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
) => {
|
|
211
|
-
return await exports.pickNextTask.call(void 0, { ...commonArgs, uri })
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
serverStates.setPickNextTaskCB(pickNextTaskCB)
|
|
203
|
+
serverStates.setPickNextTaskCB(async serverUri => {
|
|
204
|
+
return await exports.pickNextTask.call(void 0, commonArgs, serverUri)
|
|
205
|
+
})
|
|
215
206
|
|
|
216
207
|
let running = false
|
|
217
208
|
const run = async () => {
|
|
@@ -711,15 +702,11 @@ const addToAddressTransactionCache = async (
|
|
|
711
702
|
])
|
|
712
703
|
}; exports.transactionChanged = transactionChanged
|
|
713
704
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
705
|
const pickNextTask = async (
|
|
719
|
-
args
|
|
720
|
-
|
|
706
|
+
args,
|
|
707
|
+
serverUri
|
|
721
708
|
) => {
|
|
722
|
-
const { pluginInfo, taskCache,
|
|
709
|
+
const { pluginInfo, taskCache, serverStates } = args
|
|
723
710
|
|
|
724
711
|
const {
|
|
725
712
|
addressSubscribeCache,
|
|
@@ -738,12 +725,12 @@ const addToAddressTransactionCache = async (
|
|
|
738
725
|
**/
|
|
739
726
|
const needsTxSpecific = pluginInfo.engineInfo.txSpecificHandling != null
|
|
740
727
|
|
|
741
|
-
const serverState = serverStates.getServerState(
|
|
728
|
+
const serverState = serverStates.getServerState(serverUri)
|
|
742
729
|
if (serverState == null) return
|
|
743
730
|
|
|
744
731
|
// subscribe all servers to new blocks
|
|
745
732
|
if (serverState.blockSubscriptionStatus === 'unsubscribed') {
|
|
746
|
-
serverStates.watchBlocks(
|
|
733
|
+
serverStates.watchBlocks(serverUri)
|
|
747
734
|
return true
|
|
748
735
|
}
|
|
749
736
|
|
|
@@ -780,7 +767,7 @@ const addToAddressTransactionCache = async (
|
|
|
780
767
|
purposeType === _keymanager.BIP43PurposeTypeEnum.ReplayProtection
|
|
781
768
|
) {
|
|
782
769
|
// if we do need to make a network call, check with the serverState
|
|
783
|
-
if (!serverStates.serverCanGetTx(
|
|
770
|
+
if (!serverStates.serverCanGetTx(serverUri, utxo.txid)) return
|
|
784
771
|
}
|
|
785
772
|
state.processing = true
|
|
786
773
|
_utils.removeItem.call(void 0, rawUtxoCache, utxoId)
|
|
@@ -788,6 +775,7 @@ const addToAddressTransactionCache = async (
|
|
|
788
775
|
...args,
|
|
789
776
|
...state,
|
|
790
777
|
address: state.address,
|
|
778
|
+
serverUri,
|
|
791
779
|
utxo,
|
|
792
780
|
id: `${utxo.txid}_${utxo.vout}`
|
|
793
781
|
})
|
|
@@ -798,7 +786,10 @@ const addToAddressTransactionCache = async (
|
|
|
798
786
|
// Loop to process addresses to utxos
|
|
799
787
|
for (const [address, state] of Object.entries(addressUtxoCache)) {
|
|
800
788
|
// Check if we need to fetch address UTXOs
|
|
801
|
-
if (
|
|
789
|
+
if (
|
|
790
|
+
!state.processing &&
|
|
791
|
+
serverStates.serverCanGetAddress(serverUri, address)
|
|
792
|
+
) {
|
|
802
793
|
state.processing = true
|
|
803
794
|
|
|
804
795
|
_utils.removeItem.call(void 0, addressUtxoCache, address)
|
|
@@ -807,7 +798,8 @@ const addToAddressTransactionCache = async (
|
|
|
807
798
|
const wsTask = await processAddressUtxos({
|
|
808
799
|
...args,
|
|
809
800
|
...state,
|
|
810
|
-
address
|
|
801
|
+
address,
|
|
802
|
+
serverUri
|
|
811
803
|
})
|
|
812
804
|
wsTask.deferred.promise
|
|
813
805
|
.then(() => {
|
|
@@ -826,12 +818,12 @@ const addToAddressTransactionCache = async (
|
|
|
826
818
|
if (Object.keys(addressSubscribeCache).length > 0) {
|
|
827
819
|
// These are addresses to which the server has not subscribed
|
|
828
820
|
const newAddresses = []
|
|
829
|
-
const blockHeight = serverStates.getBlockHeight(
|
|
821
|
+
const blockHeight = serverStates.getBlockHeight(serverUri)
|
|
830
822
|
|
|
831
823
|
// Loop each address in the cache
|
|
832
824
|
for (const [address, state] of Object.entries(addressSubscribeCache)) {
|
|
833
825
|
const isAddressNewlySubscribed = !serverStates.serverIsAwareOfAddress(
|
|
834
|
-
|
|
826
|
+
serverUri,
|
|
835
827
|
address
|
|
836
828
|
)
|
|
837
829
|
|
|
@@ -864,7 +856,7 @@ const addToAddressTransactionCache = async (
|
|
|
864
856
|
|
|
865
857
|
// Subscribe to any new addresses
|
|
866
858
|
if (newAddresses.length > 0) {
|
|
867
|
-
serverStates.watchAddresses(
|
|
859
|
+
serverStates.watchAddresses(serverUri, newAddresses)
|
|
868
860
|
return true
|
|
869
861
|
}
|
|
870
862
|
}
|
|
@@ -875,12 +867,13 @@ const addToAddressTransactionCache = async (
|
|
|
875
867
|
for (const [txId, state] of Object.entries(
|
|
876
868
|
updateTransactionSpecificCache
|
|
877
869
|
)) {
|
|
878
|
-
if (!state.processing && serverStates.serverCanGetTx(
|
|
870
|
+
if (!state.processing && serverStates.serverCanGetTx(serverUri, txId)) {
|
|
879
871
|
hasProcessedAtLeastOnce = true
|
|
880
872
|
state.processing = true
|
|
881
873
|
_utils.removeItem.call(void 0, updateTransactionSpecificCache, txId)
|
|
882
874
|
const updateTransactionSpecificTask = updateTransactionsSpecific({
|
|
883
875
|
...args,
|
|
876
|
+
serverUri,
|
|
884
877
|
txId
|
|
885
878
|
})
|
|
886
879
|
// once resolved, add the txid to the server cache
|
|
@@ -904,14 +897,15 @@ const addToAddressTransactionCache = async (
|
|
|
904
897
|
if (Object.keys(updateTransactionCache).length > 0) {
|
|
905
898
|
let hasProcessedAtLeastOnce = false
|
|
906
899
|
for (const [txId, state] of Object.entries(updateTransactionCache)) {
|
|
907
|
-
if (!state.processing && serverStates.serverCanGetTx(
|
|
900
|
+
if (!state.processing && serverStates.serverCanGetTx(serverUri, txId)) {
|
|
908
901
|
hasProcessedAtLeastOnce = true
|
|
909
902
|
state.processing = true
|
|
910
903
|
_utils.removeItem.call(void 0, updateTransactionCache, txId)
|
|
911
904
|
const updateTransactionTask = updateTransactions({
|
|
912
905
|
...args,
|
|
913
|
-
|
|
914
|
-
needsTxSpecific
|
|
906
|
+
serverUri,
|
|
907
|
+
needsTxSpecific,
|
|
908
|
+
txId
|
|
915
909
|
})
|
|
916
910
|
// once resolved, add the txid to the server cache
|
|
917
911
|
updateTransactionTask.deferred.promise
|
|
@@ -932,7 +926,10 @@ const addToAddressTransactionCache = async (
|
|
|
932
926
|
|
|
933
927
|
// loop to get and process transaction history of single addresses, triggers setLookAhead
|
|
934
928
|
for (const [address, state] of Object.entries(addressTransactionCache)) {
|
|
935
|
-
if (
|
|
929
|
+
if (
|
|
930
|
+
!state.processing &&
|
|
931
|
+
serverStates.serverCanGetAddress(serverUri, address)
|
|
932
|
+
) {
|
|
936
933
|
state.processing = true
|
|
937
934
|
|
|
938
935
|
_utils.removeItem.call(void 0, addressTransactionCache, address)
|
|
@@ -942,7 +939,8 @@ const addToAddressTransactionCache = async (
|
|
|
942
939
|
...args,
|
|
943
940
|
addressTransactionState: state,
|
|
944
941
|
address,
|
|
945
|
-
needsTxSpecific
|
|
942
|
+
needsTxSpecific,
|
|
943
|
+
serverUri
|
|
946
944
|
})
|
|
947
945
|
wsTask.deferred.promise
|
|
948
946
|
.then(() => {
|
|
@@ -962,6 +960,7 @@ const addToAddressTransactionCache = async (
|
|
|
962
960
|
|
|
963
961
|
|
|
964
962
|
|
|
963
|
+
|
|
965
964
|
const updateTransactionsSpecific = (
|
|
966
965
|
args
|
|
967
966
|
) => {
|
|
@@ -969,9 +968,10 @@ const updateTransactionsSpecific = (
|
|
|
969
968
|
walletInfo,
|
|
970
969
|
emitter,
|
|
971
970
|
walletTools,
|
|
972
|
-
txId,
|
|
973
971
|
pluginInfo,
|
|
974
972
|
processor,
|
|
973
|
+
serverUri,
|
|
974
|
+
txId,
|
|
975
975
|
taskCache
|
|
976
976
|
} = args
|
|
977
977
|
const deferred = new _Deferred2.default()
|
|
@@ -1006,10 +1006,12 @@ const updateTransactionsSpecific = (
|
|
|
1006
1006
|
args.log('error in updateTransactionsSpecific:', err)
|
|
1007
1007
|
taskCache.updateTransactionSpecificCache[txId] = { processing: false }
|
|
1008
1008
|
})
|
|
1009
|
-
|
|
1010
|
-
|
|
1009
|
+
|
|
1010
|
+
return args.serverStates.transactionSpecialQueryTask(
|
|
1011
|
+
serverUri,
|
|
1012
|
+
txId,
|
|
1011
1013
|
deferred
|
|
1012
|
-
|
|
1014
|
+
)
|
|
1013
1015
|
}
|
|
1014
1016
|
|
|
1015
1017
|
|
|
@@ -1017,6 +1019,7 @@ const updateTransactionsSpecific = (
|
|
|
1017
1019
|
|
|
1018
1020
|
|
|
1019
1021
|
|
|
1022
|
+
|
|
1020
1023
|
const updateTransactions = (
|
|
1021
1024
|
args
|
|
1022
1025
|
) => {
|
|
@@ -1028,6 +1031,7 @@ const updateTransactions = (
|
|
|
1028
1031
|
needsTxSpecific,
|
|
1029
1032
|
pluginInfo,
|
|
1030
1033
|
processor,
|
|
1034
|
+
serverUri,
|
|
1031
1035
|
taskCache
|
|
1032
1036
|
} = args
|
|
1033
1037
|
const deferred = new _Deferred2.default()
|
|
@@ -1077,10 +1081,8 @@ const updateTransactions = (
|
|
|
1077
1081
|
args.log('error in updateTransactions:', err)
|
|
1078
1082
|
taskCache.updateTransactionCache[txId] = { processing: false }
|
|
1079
1083
|
})
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
deferred
|
|
1083
|
-
}
|
|
1084
|
+
|
|
1085
|
+
return args.serverStates.transactionQueryTask(serverUri, txId, deferred)
|
|
1084
1086
|
}
|
|
1085
1087
|
|
|
1086
1088
|
|
|
@@ -1215,12 +1217,9 @@ const processAddressTransactions = async (
|
|
|
1215
1217
|
walletTools,
|
|
1216
1218
|
taskCache,
|
|
1217
1219
|
pluginState,
|
|
1218
|
-
|
|
1220
|
+
serverUri
|
|
1219
1221
|
} = args
|
|
1220
1222
|
const { page = 1, blockHeight } = addressTransactionState
|
|
1221
|
-
const {
|
|
1222
|
-
engineInfo: { asBlockbookAddress }
|
|
1223
|
-
} = pluginInfo
|
|
1224
1223
|
const addressTransactionCache = taskCache.addressTransactionCache
|
|
1225
1224
|
|
|
1226
1225
|
const scriptPubkey = walletTools.addressToScriptPubkey(address)
|
|
@@ -1233,7 +1232,7 @@ const processAddressTransactions = async (
|
|
|
1233
1232
|
const deferred = new _Deferred2.default()
|
|
1234
1233
|
deferred.promise
|
|
1235
1234
|
.then(async (value) => {
|
|
1236
|
-
pluginState.serverScoreUp(
|
|
1235
|
+
pluginState.serverScoreUp(serverUri, Date.now() - queryTime)
|
|
1237
1236
|
const { transactions = [], txs, unconfirmedTxs, totalPages } = value
|
|
1238
1237
|
|
|
1239
1238
|
// If address is used and previously not marked as used, mark as used.
|
|
@@ -1297,15 +1296,15 @@ const processAddressTransactions = async (
|
|
|
1297
1296
|
addressTransactionCache[address] = addressTransactionState
|
|
1298
1297
|
})
|
|
1299
1298
|
|
|
1300
|
-
return
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1299
|
+
return args.serverStates.addressQueryTask(
|
|
1300
|
+
serverUri,
|
|
1301
|
+
address,
|
|
1302
|
+
{
|
|
1303
|
+
lastQueriedBlockHeight: addressData.lastQueriedBlockHeight,
|
|
1305
1304
|
page
|
|
1306
|
-
}
|
|
1305
|
+
},
|
|
1307
1306
|
deferred
|
|
1308
|
-
|
|
1307
|
+
)
|
|
1309
1308
|
}
|
|
1310
1309
|
|
|
1311
1310
|
|
|
@@ -1386,19 +1385,15 @@ const processAddressUtxos = async (
|
|
|
1386
1385
|
processor,
|
|
1387
1386
|
taskCache,
|
|
1388
1387
|
path,
|
|
1389
|
-
pluginInfo,
|
|
1390
1388
|
pluginState,
|
|
1391
|
-
|
|
1389
|
+
serverUri
|
|
1392
1390
|
} = args
|
|
1393
|
-
const {
|
|
1394
|
-
engineInfo: { asBlockbookAddress }
|
|
1395
|
-
} = pluginInfo
|
|
1396
1391
|
const { addressUtxoCache, rawUtxoCache, processorUtxoCache } = taskCache
|
|
1397
1392
|
const queryTime = Date.now()
|
|
1398
1393
|
const deferred = new _Deferred2.default()
|
|
1399
1394
|
deferred.promise
|
|
1400
1395
|
.then(async (utxos) => {
|
|
1401
|
-
pluginState.serverScoreUp(
|
|
1396
|
+
pluginState.serverScoreUp(serverUri, Date.now() - queryTime)
|
|
1402
1397
|
const scriptPubkey = walletTools.addressToScriptPubkey(address)
|
|
1403
1398
|
const addressData = await processor.fetchAddress(scriptPubkey)
|
|
1404
1399
|
if (addressData == null || addressData.path == null) {
|
|
@@ -1430,10 +1425,7 @@ const processAddressUtxos = async (
|
|
|
1430
1425
|
}
|
|
1431
1426
|
})
|
|
1432
1427
|
|
|
1433
|
-
return
|
|
1434
|
-
..._blockbookApi.addressUtxosMessage.call(void 0, address, asBlockbookAddress),
|
|
1435
|
-
deferred
|
|
1436
|
-
}
|
|
1428
|
+
return args.serverStates.utxoListQueryTask(serverUri, address, deferred)
|
|
1437
1429
|
}
|
|
1438
1430
|
|
|
1439
1431
|
|
|
@@ -1561,7 +1553,7 @@ const processRawUtxo = async (
|
|
|
1561
1553
|
taskCache,
|
|
1562
1554
|
requiredCount,
|
|
1563
1555
|
pluginState,
|
|
1564
|
-
|
|
1556
|
+
serverUri,
|
|
1565
1557
|
log
|
|
1566
1558
|
} = args
|
|
1567
1559
|
const { rawUtxoCache, processorUtxoCache } = taskCache
|
|
@@ -1613,7 +1605,7 @@ const processRawUtxo = async (
|
|
|
1613
1605
|
const deferred = new _Deferred2.default()
|
|
1614
1606
|
deferred.promise
|
|
1615
1607
|
.then((txResponse) => {
|
|
1616
|
-
pluginState.serverScoreUp(
|
|
1608
|
+
pluginState.serverScoreUp(serverUri, Date.now() - queryTime)
|
|
1617
1609
|
const processedTx = processTransactionResponse({
|
|
1618
1610
|
...args,
|
|
1619
1611
|
txResponse
|
|
@@ -1634,10 +1626,12 @@ const processRawUtxo = async (
|
|
|
1634
1626
|
requiredCount
|
|
1635
1627
|
}
|
|
1636
1628
|
})
|
|
1637
|
-
|
|
1638
|
-
|
|
1629
|
+
|
|
1630
|
+
return args.serverStates.transactionQueryTask(
|
|
1631
|
+
serverUri,
|
|
1632
|
+
utxo.txid,
|
|
1639
1633
|
deferred
|
|
1640
|
-
|
|
1634
|
+
)
|
|
1641
1635
|
} else {
|
|
1642
1636
|
script = tx.hex
|
|
1643
1637
|
}
|
|
@@ -42,13 +42,15 @@ var _types3 = require('../../plugin/types');
|
|
|
42
42
|
publicAddress: _cleaners.asString
|
|
43
43
|
}); exports.asUtxoSignMessageOtherParams = asUtxoSignMessageOtherParams
|
|
44
44
|
|
|
45
|
+
const asOutputSort = _cleaners.asValue.call(void 0, 'bip69', 'targets')
|
|
46
|
+
|
|
45
47
|
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
const asUtxoSpendInfoOtherParams = _cleaners.asObject.call(void 0, {
|
|
49
51
|
enableRbf: _cleaners.asOptional.call(void 0, _cleaners.asBoolean),
|
|
50
52
|
forceChangeAddress: _cleaners.asOptional.call(void 0, _cleaners.asString),
|
|
51
|
-
outputSort: _cleaners.asOptional.call(void 0,
|
|
53
|
+
outputSort: _cleaners.asOptional.call(void 0, asOutputSort, 'bip69'),
|
|
52
54
|
txOptions: _cleaners.asOptional.call(void 0, _types3.asTxOptions),
|
|
53
55
|
utxoSourceAddress: _cleaners.asOptional.call(void 0, _cleaners.asString)
|
|
54
56
|
}); exports.asUtxoSpendInfoOtherParams = asUtxoSpendInfoOtherParams
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _constants = require('../../constants');
|
|
4
3
|
|
|
5
4
|
var _maximumFeeRateCalculator = require('../../plugin/util/maximumFeeRateCalculator');
|
|
6
5
|
|
|
@@ -23,10 +22,6 @@ const currencyInfo = {
|
|
|
23
22
|
addressExplorer: 'https://blockchair.com/bitcoin/address/%s',
|
|
24
23
|
transactionExplorer: 'https://blockchair.com/bitcoin/transaction/%s',
|
|
25
24
|
|
|
26
|
-
// Images:
|
|
27
|
-
symbolImage: `${_constants.IMAGE_SERVER_URL}/bitcoin-logo-solo-64.png`,
|
|
28
|
-
symbolImageDarkMono: `${_constants.IMAGE_SERVER_URL}/bitcoin-logo-solo-64.png`,
|
|
29
|
-
|
|
30
25
|
denominations: [
|
|
31
26
|
{ name: 'BTC', multiplier: '100000000', symbol: '₿' },
|
|
32
27
|
{ name: 'mBTC', multiplier: '100000', symbol: 'm₿' },
|
|
@@ -54,7 +49,7 @@ const engineInfo = {
|
|
|
54
49
|
serverConfigs: [
|
|
55
50
|
{
|
|
56
51
|
type: 'blockbook-nownode',
|
|
57
|
-
uris: ['btcbook.nownodes.io']
|
|
52
|
+
uris: ['https://btcbook.nownodes.io']
|
|
58
53
|
}
|
|
59
54
|
],
|
|
60
55
|
formats: ['bip49', 'bip84', 'bip44', 'bip32'],
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
var _cleaners = require('cleaners');
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var _constants = require('../../constants');
|
|
6
5
|
|
|
7
6
|
var _maximumFeeRateCalculator = require('../../plugin/util/maximumFeeRateCalculator');
|
|
8
7
|
|
|
@@ -26,10 +25,6 @@ const currencyInfo = {
|
|
|
26
25
|
transactionExplorer: 'https://blockchair.com/bitcoin-cash/transaction/%s',
|
|
27
26
|
xpubExplorer: 'https://bch1.trezor.io/xpub/%s',
|
|
28
27
|
|
|
29
|
-
// Images:
|
|
30
|
-
symbolImage: `${_constants.IMAGE_SERVER_URL}/bitcoincash-logo-solo-64.png`,
|
|
31
|
-
symbolImageDarkMono: `${_constants.IMAGE_SERVER_URL}/bitcoincash-logo-solo-64.png`,
|
|
32
|
-
|
|
33
28
|
denominations: [
|
|
34
29
|
{ name: 'BCH', multiplier: '100000000', symbol: '₿' },
|
|
35
30
|
{ name: 'mBCH', multiplier: '100000', symbol: 'm₿' },
|
|
@@ -56,7 +51,7 @@ const engineInfo = {
|
|
|
56
51
|
serverConfigs: [
|
|
57
52
|
{
|
|
58
53
|
type: 'blockbook-nownode',
|
|
59
|
-
uris: ['bchbook.nownodes.io']
|
|
54
|
+
uris: ['https://bchbook.nownodes.io']
|
|
60
55
|
}
|
|
61
56
|
],
|
|
62
57
|
formats: ['bip44', 'bip32'],
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _altcoinjs = require('altcoin-js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var _constants = require('../../constants');
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
|
|
@@ -24,10 +23,6 @@ const currencyInfo = {
|
|
|
24
23
|
transactionExplorer: 'https://blockchair.com/bitcoin-cash/transaction/%s',
|
|
25
24
|
xpubExplorer: 'https://blockchair.com/bitcoin-cash/xpub/%s',
|
|
26
25
|
|
|
27
|
-
// Images:
|
|
28
|
-
symbolImage: `${_constants.IMAGE_SERVER_URL}/bitcoincash-logo-solo-64.png`,
|
|
29
|
-
symbolImageDarkMono: `${_constants.IMAGE_SERVER_URL}/bitcoincash-logo-solo-64.png`,
|
|
30
|
-
|
|
31
26
|
denominations: [
|
|
32
27
|
{ name: 'TBCH', multiplier: '100000000', symbol: '₿' },
|
|
33
28
|
{ name: 'mTBCH', multiplier: '100000', symbol: 'm₿' },
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
var _cleaners = require('cleaners');
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var _constants = require('../../constants');
|
|
6
5
|
|
|
7
6
|
var _maximumFeeRateCalculator = require('../../plugin/util/maximumFeeRateCalculator');
|
|
8
7
|
|
|
@@ -29,10 +28,6 @@ const currencyInfo = {
|
|
|
29
28
|
addressExplorer: 'https://whatsonchain.com/address/%s',
|
|
30
29
|
transactionExplorer: 'https://whatsonchain.com/tx/%s',
|
|
31
30
|
|
|
32
|
-
// Images:
|
|
33
|
-
symbolImage: `${_constants.IMAGE_SERVER_URL}/bitcoinsv-logo-solo-64.png`,
|
|
34
|
-
symbolImageDarkMono: `${_constants.IMAGE_SERVER_URL}/bitcoinsv-logo-solo-64.png`,
|
|
35
|
-
|
|
36
31
|
denominations: [
|
|
37
32
|
{ name: 'BSV', multiplier: '100000000', symbol: '₿' },
|
|
38
33
|
{ name: 'mBSV', multiplier: '100000', symbol: 'm₿' },
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _constants = require('../../constants');
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
|
|
@@ -22,10 +21,6 @@ var _commonInfo = require('./commonInfo');
|
|
|
22
21
|
addressExplorer: 'https://blockchair.com/bitcoin/testnet/address/%s',
|
|
23
22
|
transactionExplorer: 'https://blockchair.com/bitcoin/testnet/transaction/%s',
|
|
24
23
|
|
|
25
|
-
// Images:
|
|
26
|
-
symbolImage: `${_constants.IMAGE_SERVER_URL}/bitcoin-logo-solo-64.png`,
|
|
27
|
-
symbolImageDarkMono: `${_constants.IMAGE_SERVER_URL}/bitcoin-logo-solo-64.png`,
|
|
28
|
-
|
|
29
24
|
denominations: [
|
|
30
25
|
{ name: 'TESTBTC', multiplier: '100000000', symbol: '₿' },
|
|
31
26
|
{ name: 'mTESTBTC', multiplier: '100000', symbol: 'm₿' },
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _constants = require('../../constants');
|
|
4
3
|
|
|
5
4
|
var _maximumFeeRateCalculator = require('../../plugin/util/maximumFeeRateCalculator');
|
|
6
5
|
|
|
@@ -22,10 +21,6 @@ var _commonInfo = require('./commonInfo');
|
|
|
22
21
|
blockExplorer: 'https://fsight.chain.tips/block/%s',
|
|
23
22
|
transactionExplorer: 'https://fsight.chain.tips/tx/%s',
|
|
24
23
|
|
|
25
|
-
// Images:
|
|
26
|
-
symbolImage: `${_constants.IMAGE_SERVER_URL}/feathercoin-logo-solo-64.png`,
|
|
27
|
-
symbolImageDarkMono: `${_constants.IMAGE_SERVER_URL}/feathercoin-logo-solo-64.png`,
|
|
28
|
-
|
|
29
24
|
denominations: [
|
|
30
25
|
{ name: 'FTC', multiplier: '100000000', symbol: 'F' },
|
|
31
26
|
{ name: 'mFTC', multiplier: '100000', symbol: 'mF' }
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _constants = require('../../constants');
|
|
4
3
|
|
|
5
4
|
var _maximumFeeRateCalculator = require('../../plugin/util/maximumFeeRateCalculator');
|
|
6
5
|
|
|
@@ -23,10 +22,6 @@ var _commonInfo = require('./commonInfo');
|
|
|
23
22
|
addressExplorer: 'https://blockchair.com/litecoin/address/%s',
|
|
24
23
|
transactionExplorer: 'https://blockchair.com/litecoin/transaction/%s',
|
|
25
24
|
|
|
26
|
-
// Images:
|
|
27
|
-
symbolImage: `${_constants.IMAGE_SERVER_URL}/litecoin-logo-solo-64.png`,
|
|
28
|
-
symbolImageDarkMono: `${_constants.IMAGE_SERVER_URL}/litecoin-logo-solo-64.png`,
|
|
29
|
-
|
|
30
25
|
denominations: [
|
|
31
26
|
{ name: 'LTC', multiplier: '100000000', symbol: 'Ł' },
|
|
32
27
|
{ name: 'mLTC', multiplier: '100000', symbol: 'mŁ' }
|
|
@@ -52,7 +47,7 @@ var _commonInfo = require('./commonInfo');
|
|
|
52
47
|
serverConfigs: [
|
|
53
48
|
{
|
|
54
49
|
type: 'blockbook-nownode',
|
|
55
|
-
uris: ['ltcbook.nownodes.io']
|
|
50
|
+
uris: ['https://ltcbook.nownodes.io']
|
|
56
51
|
}
|
|
57
52
|
],
|
|
58
53
|
formats: ['bip49', 'bip84', 'bip44', 'bip32'],
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _constants = require('../../constants');
|
|
4
3
|
|
|
5
4
|
var _maximumFeeRateCalculator = require('../../plugin/util/maximumFeeRateCalculator');
|
|
6
5
|
|
|
@@ -22,10 +21,6 @@ var _commonInfo = require('./commonInfo');
|
|
|
22
21
|
blockExplorer: 'https://insight.zcoin.io/block/%s',
|
|
23
22
|
transactionExplorer: 'https://insight.zcoin.io/tx/%s',
|
|
24
23
|
|
|
25
|
-
// Images:
|
|
26
|
-
symbolImage: `${_constants.IMAGE_SERVER_URL}/zcoin-logo-solo-64.png`,
|
|
27
|
-
symbolImageDarkMono: `${_constants.IMAGE_SERVER_URL}/zcoin-logo-solo-64.png`,
|
|
28
|
-
|
|
29
24
|
denominations: [
|
|
30
25
|
{ name: 'FIRO', multiplier: '100000000', symbol: 'ƒ' },
|
|
31
26
|
{ name: 'mFIRO', multiplier: '100000', symbol: 'mƒ' }
|
|
@@ -42,6 +37,12 @@ var _commonInfo = require('./commonInfo');
|
|
|
42
37
|
}; exports.currencyInfo = currencyInfo
|
|
43
38
|
|
|
44
39
|
const engineInfo = {
|
|
40
|
+
serverConfigs: [
|
|
41
|
+
{
|
|
42
|
+
type: 'blockbook-nownode',
|
|
43
|
+
uris: ['https://firobook.nownodes.io']
|
|
44
|
+
}
|
|
45
|
+
],
|
|
45
46
|
formats: ['bip44', 'bip32'],
|
|
46
47
|
uriPrefix: 'firo',
|
|
47
48
|
gapLimit: 10,
|
|
@@ -1078,7 +1078,7 @@ const wifToPrivateKeyEncodingInternal = (
|
|
|
1078
1078
|
// This is how much fee is needed to validate the spend
|
|
1079
1079
|
const feeDelta = result.fee - (inputsValue - targetsValue)
|
|
1080
1080
|
throw new (0, _types9.InsufficientFundsErrorPlus)({
|
|
1081
|
-
|
|
1081
|
+
tokenId: null,
|
|
1082
1082
|
networkFee: result.fee.toString(),
|
|
1083
1083
|
networkFeeShortage: feeDelta.toString()
|
|
1084
1084
|
})
|
|
@@ -8,9 +8,10 @@ var _types = require('edge-core-js/types');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
|
|
11
12
|
class InsufficientFundsErrorPlus extends _types.InsufficientFundsError {
|
|
12
13
|
|
|
13
|
-
constructor(opts
|
|
14
|
+
constructor(opts) {
|
|
14
15
|
super(opts)
|
|
15
16
|
const { networkFeeShortage } = opts
|
|
16
17
|
this.networkFeeShortage = networkFeeShortage
|