edge-currency-plugins 2.2.0 → 2.3.0
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/constants.js +1 -1
- package/lib/common/fees/calcMinerFeePerByte.js +28 -16
- package/lib/common/fees/makeFees.js +4 -2
- package/lib/common/fees/processInfoServerFees.js +2 -16
- package/lib/common/fees/processMempoolSpaceFees.js +12 -4
- package/lib/common/plugin/types.js +13 -0
- package/lib/common/utxobased/info/badcoin.js +5 -0
- package/lib/common/utxobased/info/bitcoin.js +5 -0
- package/lib/common/utxobased/info/bitcoincash.js +6 -1
- package/lib/common/utxobased/info/bitcoincashtestnet.js +5 -0
- package/lib/common/utxobased/info/bitcoingold.js +5 -0
- package/lib/common/utxobased/info/bitcoingoldtestnet.js +5 -0
- package/lib/common/utxobased/info/bitcoinsv.js +5 -0
- package/lib/common/utxobased/info/bitcointestnet.js +5 -0
- package/lib/common/utxobased/info/dash.js +5 -0
- package/lib/common/utxobased/info/digibyte.js +5 -0
- package/lib/common/utxobased/info/dogecoin.js +5 -0
- package/lib/common/utxobased/info/eboost.js +5 -0
- package/lib/common/utxobased/info/feathercoin.js +5 -0
- package/lib/common/utxobased/info/groestlcoin.js +5 -0
- package/lib/common/utxobased/info/litecoin.js +5 -0
- package/lib/common/utxobased/info/qtum.js +5 -0
- package/lib/common/utxobased/info/ravencoin.js +5 -0
- package/lib/common/utxobased/info/smartcash.js +5 -0
- package/lib/common/utxobased/info/ufo.js +5 -0
- package/lib/common/utxobased/info/vertcoin.js +5 -0
- package/lib/common/utxobased/info/zcoin.js +5 -0
- package/lib/src/common/constants.d.ts +1 -1
- package/lib/src/common/fees/processMempoolSpaceFees.d.ts +0 -6
- package/lib/src/common/plugin/types.d.ts +4 -0
- package/lib/src/util/filterUndefined.d.ts +1 -0
- package/lib/util/filterUndefined.js +15 -0
- package/package.json +3 -3
package/lib/common/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); const IMAGE_SERVER_URL = 'https://content.edge.app'; exports.IMAGE_SERVER_URL = IMAGE_SERVER_URL
|
|
2
|
-
const INFO_SERVER_URI = 'https://info1.
|
|
2
|
+
const INFO_SERVER_URI = 'https://info1.edge.app'; exports.INFO_SERVER_URI = INFO_SERVER_URI
|
|
3
3
|
|
|
4
4
|
// Fees
|
|
5
5
|
const FEES_PATH = 'fees.json'; exports.FEES_PATH = FEES_PATH
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _biggystring = require('biggystring');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -19,36 +19,48 @@
|
|
|
19
19
|
networkFeeOption,
|
|
20
20
|
customNetworkFee
|
|
21
21
|
) => {
|
|
22
|
+
const {
|
|
23
|
+
highFeeFudgeFactor = '1',
|
|
24
|
+
lowFeeFudgeFactor = '1',
|
|
25
|
+
standardFeeHighAmount,
|
|
26
|
+
standardFeeHighFudgeFactor = '1',
|
|
27
|
+
standardFeeLowAmount,
|
|
28
|
+
standardFeeLowFudgeFactor = '1'
|
|
29
|
+
} = fees
|
|
30
|
+
let { highFee, lowFee, standardFeeHigh, standardFeeLow } = fees
|
|
31
|
+
|
|
32
|
+
highFee = _biggystring.round.call(void 0, _biggystring.mul.call(void 0, highFee, highFeeFudgeFactor), 0)
|
|
33
|
+
lowFee = _biggystring.round.call(void 0, _biggystring.mul.call(void 0, lowFee, lowFeeFudgeFactor), 0)
|
|
34
|
+
standardFeeHigh = _biggystring.round.call(void 0, _biggystring.mul.call(void 0, standardFeeHigh, standardFeeHighFudgeFactor), 0)
|
|
35
|
+
standardFeeLow = _biggystring.round.call(void 0, _biggystring.mul.call(void 0, standardFeeLow, standardFeeLowFudgeFactor), 0)
|
|
36
|
+
|
|
22
37
|
switch (networkFeeOption) {
|
|
23
38
|
case 'low':
|
|
24
|
-
return
|
|
39
|
+
return lowFee
|
|
25
40
|
|
|
26
41
|
case 'standard': {
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
42
|
+
if (_biggystring.gte.call(void 0, nativeAmount, standardFeeHighAmount)) {
|
|
43
|
+
return standardFeeHigh
|
|
29
44
|
}
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
45
|
+
if (_biggystring.lte.call(void 0, nativeAmount, standardFeeLowAmount)) {
|
|
46
|
+
return standardFeeLow
|
|
32
47
|
}
|
|
33
48
|
|
|
34
49
|
// Scale the fee by the amount the user is sending scaled between standardFeeLowAmount and standardFeeHighAmount
|
|
35
|
-
const lowHighAmountDiff =
|
|
36
|
-
|
|
37
|
-
fees.standardFeeLowAmount
|
|
38
|
-
)
|
|
39
|
-
const lowHighFeeDiff = bs.sub(fees.standardFeeHigh, fees.standardFeeLow)
|
|
50
|
+
const lowHighAmountDiff = _biggystring.sub.call(void 0, standardFeeHighAmount, standardFeeLowAmount)
|
|
51
|
+
const lowHighFeeDiff = _biggystring.sub.call(void 0, standardFeeHigh, standardFeeLow)
|
|
40
52
|
|
|
41
53
|
// How much above the lowFeeAmount is the user sending
|
|
42
|
-
const amountDiffFromLow =
|
|
54
|
+
const amountDiffFromLow = _biggystring.sub.call(void 0, nativeAmount, standardFeeLowAmount)
|
|
43
55
|
|
|
44
56
|
// Add this much to the low fee = (amountDiffFromLow * lowHighFeeDiff) / lowHighAmountDiff)
|
|
45
|
-
const temp1 =
|
|
46
|
-
const addFeeToLow =
|
|
47
|
-
return
|
|
57
|
+
const temp1 = _biggystring.mul.call(void 0, amountDiffFromLow, lowHighFeeDiff)
|
|
58
|
+
const addFeeToLow = _biggystring.div.call(void 0, temp1, lowHighAmountDiff)
|
|
59
|
+
return _biggystring.add.call(void 0, standardFeeLow, addFeeToLow)
|
|
48
60
|
}
|
|
49
61
|
|
|
50
62
|
case 'high':
|
|
51
|
-
return
|
|
63
|
+
return highFee
|
|
52
64
|
|
|
53
65
|
case 'custom':
|
|
54
66
|
if (customNetworkFee == null || customNetworkFee === '0') {
|
|
@@ -9,6 +9,7 @@ var _cleaners = require('cleaners');
|
|
|
9
9
|
|
|
10
10
|
var _memlet = require('memlet');
|
|
11
11
|
|
|
12
|
+
var _filterUndefined = require('../../util/filterUndefined');
|
|
12
13
|
var _constants = require('../constants');
|
|
13
14
|
|
|
14
15
|
|
|
@@ -57,7 +58,8 @@ var _processMempoolSpaceFees = require('./processMempoolSpaceFees');
|
|
|
57
58
|
...common,
|
|
58
59
|
mempoolSpaceFeeInfoServer: engineInfo.mempoolSpaceFeeInfoServer
|
|
59
60
|
})
|
|
60
|
-
|
|
61
|
+
const cleanedVendorFees = _filterUndefined.removeUndefined.call(void 0, _nullishCoalesce(vendorFees, () => ( {})))
|
|
62
|
+
Object.assign(fees, cleanedVendorFees)
|
|
61
63
|
timestamp = Date.now()
|
|
62
64
|
|
|
63
65
|
await cacheFees(memlet, fees)
|
|
@@ -67,7 +69,7 @@ var _processMempoolSpaceFees = require('./processMempoolSpaceFees');
|
|
|
67
69
|
async start() {
|
|
68
70
|
const edgeFees = await fetchFees({
|
|
69
71
|
...common,
|
|
70
|
-
uri: `${_constants.INFO_SERVER_URI}/networkFees/${currencyInfo.pluginId}`,
|
|
72
|
+
uri: `${_constants.INFO_SERVER_URI}/v1/networkFees/${currencyInfo.pluginId}`,
|
|
71
73
|
processor: _processInfoServerFees.processInfoServerFees
|
|
72
74
|
})
|
|
73
75
|
Object.assign(fees, edgeFees)
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const asInfoServerFees = _cleaners.asObject({
|
|
6
|
-
lowFee: _cleaners.asString,
|
|
7
|
-
standardFeeLow: _cleaners.asString,
|
|
8
|
-
standardFeeHigh: _cleaners.asString,
|
|
9
|
-
highFee: _cleaners.asString,
|
|
10
|
-
|
|
11
|
-
// The amount of satoshis which will be charged the standardFeeLow
|
|
12
|
-
standardFeeLowAmount: _cleaners.asString,
|
|
13
|
-
// The amount of satoshis which will be charged the standardFeeHigh
|
|
14
|
-
standardFeeHighAmount: _cleaners.asString
|
|
15
|
-
})
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _types = require('../plugin/types');
|
|
16
2
|
|
|
17
3
|
/**
|
|
18
4
|
* Processes the fee object from Edge Info Server
|
|
@@ -23,7 +9,7 @@ const asInfoServerFees = _cleaners.asObject({
|
|
|
23
9
|
fees
|
|
24
10
|
) => {
|
|
25
11
|
try {
|
|
26
|
-
return
|
|
12
|
+
return _types.asSimpleFeeSettings.call(void 0, fees)
|
|
27
13
|
} catch (e) {
|
|
28
14
|
return null
|
|
29
15
|
}
|
|
@@ -16,6 +16,10 @@ var _constants = require('../constants');
|
|
|
16
16
|
* @param fees
|
|
17
17
|
* @returns Partial<FeeRates>
|
|
18
18
|
*/
|
|
19
|
+
|
|
20
|
+
const STANDARD_FEE_HIGH_MULTIPLIER = 1.3
|
|
21
|
+
const HIGH_FEE_MULTIPLIER = 2
|
|
22
|
+
|
|
19
23
|
const processMempoolSpaceFees = (fees) => {
|
|
20
24
|
let mempoolFees
|
|
21
25
|
try {
|
|
@@ -24,10 +28,14 @@ var _constants = require('../constants');
|
|
|
24
28
|
return null
|
|
25
29
|
}
|
|
26
30
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
+
const { fastestFee, halfHourFee } = mempoolFees
|
|
32
|
+
|
|
33
|
+
const lowFee = halfHourFee.toString()
|
|
34
|
+
const standardFeeLow = fastestFee.toString()
|
|
35
|
+
const standardFeeHigh = Math.round(
|
|
36
|
+
fastestFee * STANDARD_FEE_HIGH_MULTIPLIER
|
|
37
|
+
).toString()
|
|
38
|
+
const highFee = Math.round(fastestFee * HIGH_FEE_MULTIPLIER).toString()
|
|
31
39
|
|
|
32
40
|
return {
|
|
33
41
|
lowFee: bs.max(lowFee, _constants.LOW_FEE.toString()),
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
3
10
|
var _cleaners = require('cleaners');
|
|
4
11
|
|
|
5
12
|
|
|
@@ -147,6 +154,12 @@ var _cleaners = require('cleaners');
|
|
|
147
154
|
|
|
148
155
|
const asSimpleFeeSettings = _cleaners.asObject.call(void 0, {
|
|
149
156
|
...exports.asFeeRates.shape,
|
|
157
|
+
|
|
158
|
+
lowFeeFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString),
|
|
159
|
+
standardFeeLowFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString),
|
|
160
|
+
standardFeeHighFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString),
|
|
161
|
+
highFeeFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString),
|
|
162
|
+
|
|
150
163
|
standardFeeLowAmount: _cleaners.asString,
|
|
151
164
|
standardFeeHighAmount: _cleaners.asString
|
|
152
165
|
}); exports.asSimpleFeeSettings = asSimpleFeeSettings
|
|
@@ -44,6 +44,11 @@ const engineInfo = {
|
|
|
44
44
|
defaultFee: 500000,
|
|
45
45
|
feeUpdateInterval: 60000,
|
|
46
46
|
simpleFeeSettings: {
|
|
47
|
+
lowFeeFudgeFactor: undefined,
|
|
48
|
+
standardFeeLowFudgeFactor: undefined,
|
|
49
|
+
standardFeeHighFudgeFactor: undefined,
|
|
50
|
+
highFeeFudgeFactor: undefined,
|
|
51
|
+
|
|
47
52
|
highFee: '300',
|
|
48
53
|
lowFee: '100',
|
|
49
54
|
standardFeeLow: '150',
|
|
@@ -60,6 +60,11 @@ const engineInfo = {
|
|
|
60
60
|
feeUpdateInterval: 60000,
|
|
61
61
|
mempoolSpaceFeeInfoServer: 'https://mempool.space/api/v1/fees/recommended',
|
|
62
62
|
simpleFeeSettings: {
|
|
63
|
+
lowFeeFudgeFactor: undefined,
|
|
64
|
+
standardFeeLowFudgeFactor: undefined,
|
|
65
|
+
standardFeeHighFudgeFactor: undefined,
|
|
66
|
+
highFeeFudgeFactor: undefined,
|
|
67
|
+
|
|
63
68
|
highFee: '150',
|
|
64
69
|
lowFee: '20',
|
|
65
70
|
standardFeeLow: '50',
|
|
@@ -56,11 +56,16 @@ const currencyInfo = {
|
|
|
56
56
|
|
|
57
57
|
const engineInfo = {
|
|
58
58
|
formats: ['bip44', 'bip32'],
|
|
59
|
-
forks: ['bitcoinsv'
|
|
59
|
+
forks: [], // 'bitcoinsv' is currently disabled, so not included in the forks
|
|
60
60
|
gapLimit: 10,
|
|
61
61
|
defaultFee: 10000,
|
|
62
62
|
feeUpdateInterval: 60000,
|
|
63
63
|
simpleFeeSettings: {
|
|
64
|
+
lowFeeFudgeFactor: undefined,
|
|
65
|
+
standardFeeLowFudgeFactor: undefined,
|
|
66
|
+
standardFeeHighFudgeFactor: undefined,
|
|
67
|
+
highFeeFudgeFactor: undefined,
|
|
68
|
+
|
|
64
69
|
highFee: '20',
|
|
65
70
|
lowFee: '3',
|
|
66
71
|
standardFeeLow: '5',
|
|
@@ -46,6 +46,11 @@ const engineInfo = {
|
|
|
46
46
|
defaultFee: 10000,
|
|
47
47
|
feeUpdateInterval: 60000,
|
|
48
48
|
simpleFeeSettings: {
|
|
49
|
+
lowFeeFudgeFactor: undefined,
|
|
50
|
+
standardFeeLowFudgeFactor: undefined,
|
|
51
|
+
standardFeeHighFudgeFactor: undefined,
|
|
52
|
+
highFeeFudgeFactor: undefined,
|
|
53
|
+
|
|
49
54
|
highFee: '20',
|
|
50
55
|
lowFee: '3',
|
|
51
56
|
standardFeeLow: '5',
|
|
@@ -52,6 +52,11 @@ const engineInfo = {
|
|
|
52
52
|
defaultFee: 1000,
|
|
53
53
|
feeUpdateInterval: 60000,
|
|
54
54
|
simpleFeeSettings: {
|
|
55
|
+
lowFeeFudgeFactor: undefined,
|
|
56
|
+
standardFeeLowFudgeFactor: undefined,
|
|
57
|
+
standardFeeHighFudgeFactor: undefined,
|
|
58
|
+
highFeeFudgeFactor: undefined,
|
|
59
|
+
|
|
55
60
|
highFee: '200',
|
|
56
61
|
lowFee: '10',
|
|
57
62
|
standardFeeLow: '15',
|
|
@@ -38,6 +38,11 @@ const engineInfo = {
|
|
|
38
38
|
defaultFee: 1000,
|
|
39
39
|
feeUpdateInterval: 60000,
|
|
40
40
|
simpleFeeSettings: {
|
|
41
|
+
lowFeeFudgeFactor: undefined,
|
|
42
|
+
standardFeeLowFudgeFactor: undefined,
|
|
43
|
+
standardFeeHighFudgeFactor: undefined,
|
|
44
|
+
highFeeFudgeFactor: undefined,
|
|
45
|
+
|
|
41
46
|
highFee: '200',
|
|
42
47
|
lowFee: '10',
|
|
43
48
|
standardFeeLow: '15',
|
|
@@ -58,6 +58,11 @@ const engineInfo = {
|
|
|
58
58
|
defaultFee: 10000,
|
|
59
59
|
feeUpdateInterval: 60000,
|
|
60
60
|
simpleFeeSettings: {
|
|
61
|
+
lowFeeFudgeFactor: undefined,
|
|
62
|
+
standardFeeLowFudgeFactor: undefined,
|
|
63
|
+
standardFeeHighFudgeFactor: undefined,
|
|
64
|
+
highFeeFudgeFactor: undefined,
|
|
65
|
+
|
|
61
66
|
highFee: '20',
|
|
62
67
|
lowFee: '3',
|
|
63
68
|
standardFeeLow: '5',
|
|
@@ -54,6 +54,11 @@ var _commonInfo = require('./commonInfo');
|
|
|
54
54
|
feeUpdateInterval: 60000,
|
|
55
55
|
mempoolSpaceFeeInfoServer: 'https://mempool.space/api/v1/fees/recommended',
|
|
56
56
|
simpleFeeSettings: {
|
|
57
|
+
lowFeeFudgeFactor: undefined,
|
|
58
|
+
standardFeeLowFudgeFactor: undefined,
|
|
59
|
+
standardFeeHighFudgeFactor: undefined,
|
|
60
|
+
highFeeFudgeFactor: undefined,
|
|
61
|
+
|
|
57
62
|
highFee: '150',
|
|
58
63
|
lowFee: '20',
|
|
59
64
|
standardFeeLow: '50',
|
|
@@ -53,6 +53,11 @@ const engineInfo = {
|
|
|
53
53
|
defaultFee: 10000,
|
|
54
54
|
feeUpdateInterval: 60000,
|
|
55
55
|
simpleFeeSettings: {
|
|
56
|
+
lowFeeFudgeFactor: undefined,
|
|
57
|
+
standardFeeLowFudgeFactor: undefined,
|
|
58
|
+
standardFeeHighFudgeFactor: undefined,
|
|
59
|
+
highFeeFudgeFactor: undefined,
|
|
60
|
+
|
|
56
61
|
highFee: '300',
|
|
57
62
|
lowFee: '100',
|
|
58
63
|
standardFeeLow: '150',
|
|
@@ -45,6 +45,11 @@ const engineInfo = {
|
|
|
45
45
|
defaultFee: 1000,
|
|
46
46
|
feeUpdateInterval: 60000,
|
|
47
47
|
simpleFeeSettings: {
|
|
48
|
+
lowFeeFudgeFactor: undefined,
|
|
49
|
+
standardFeeLowFudgeFactor: undefined,
|
|
50
|
+
standardFeeHighFudgeFactor: undefined,
|
|
51
|
+
highFeeFudgeFactor: undefined,
|
|
52
|
+
|
|
48
53
|
highFee: '150',
|
|
49
54
|
lowFee: '20',
|
|
50
55
|
standardFeeLow: '50',
|
|
@@ -49,6 +49,11 @@ const engineInfo = {
|
|
|
49
49
|
defaultFee: 1000,
|
|
50
50
|
feeUpdateInterval: 10000,
|
|
51
51
|
simpleFeeSettings: {
|
|
52
|
+
lowFeeFudgeFactor: undefined,
|
|
53
|
+
standardFeeLowFudgeFactor: undefined,
|
|
54
|
+
standardFeeHighFudgeFactor: undefined,
|
|
55
|
+
highFeeFudgeFactor: undefined,
|
|
56
|
+
|
|
52
57
|
highFee: '526316',
|
|
53
58
|
lowFee: '526316',
|
|
54
59
|
standardFeeLow: '526316',
|
|
@@ -44,6 +44,11 @@ const engineInfo = {
|
|
|
44
44
|
defaultFee: 500000,
|
|
45
45
|
feeUpdateInterval: 60000,
|
|
46
46
|
simpleFeeSettings: {
|
|
47
|
+
lowFeeFudgeFactor: undefined,
|
|
48
|
+
standardFeeLowFudgeFactor: undefined,
|
|
49
|
+
standardFeeHighFudgeFactor: undefined,
|
|
50
|
+
highFeeFudgeFactor: undefined,
|
|
51
|
+
|
|
47
52
|
highFee: '300',
|
|
48
53
|
lowFee: '100',
|
|
49
54
|
standardFeeLow: '150',
|
|
@@ -49,6 +49,11 @@ var _commonInfo = require('./commonInfo');
|
|
|
49
49
|
defaultFee: 1000,
|
|
50
50
|
feeUpdateInterval: 60000,
|
|
51
51
|
simpleFeeSettings: {
|
|
52
|
+
lowFeeFudgeFactor: undefined,
|
|
53
|
+
standardFeeLowFudgeFactor: undefined,
|
|
54
|
+
standardFeeHighFudgeFactor: undefined,
|
|
55
|
+
highFeeFudgeFactor: undefined,
|
|
56
|
+
|
|
52
57
|
highFee: '1200',
|
|
53
58
|
lowFee: '400',
|
|
54
59
|
standardFeeLow: '600',
|
|
@@ -50,6 +50,11 @@ const engineInfo = {
|
|
|
50
50
|
defaultFee: 100000,
|
|
51
51
|
feeUpdateInterval: 60000,
|
|
52
52
|
simpleFeeSettings: {
|
|
53
|
+
lowFeeFudgeFactor: undefined,
|
|
54
|
+
standardFeeLowFudgeFactor: undefined,
|
|
55
|
+
standardFeeHighFudgeFactor: undefined,
|
|
56
|
+
highFeeFudgeFactor: undefined,
|
|
57
|
+
|
|
53
58
|
highFee: '150',
|
|
54
59
|
lowFee: '20',
|
|
55
60
|
standardFeeLow: '50',
|
|
@@ -56,6 +56,11 @@ var _commonInfo = require('./commonInfo');
|
|
|
56
56
|
defaultFee: 50000,
|
|
57
57
|
feeUpdateInterval: 60000,
|
|
58
58
|
simpleFeeSettings: {
|
|
59
|
+
lowFeeFudgeFactor: undefined,
|
|
60
|
+
standardFeeLowFudgeFactor: undefined,
|
|
61
|
+
standardFeeHighFudgeFactor: undefined,
|
|
62
|
+
highFeeFudgeFactor: undefined,
|
|
63
|
+
|
|
59
64
|
highFee: '300',
|
|
60
65
|
lowFee: '100',
|
|
61
66
|
standardFeeLow: '150',
|
|
@@ -41,6 +41,11 @@ const engineInfo = {
|
|
|
41
41
|
defaultFee: 1000,
|
|
42
42
|
feeUpdateInterval: 60000,
|
|
43
43
|
simpleFeeSettings: {
|
|
44
|
+
lowFeeFudgeFactor: undefined,
|
|
45
|
+
standardFeeLowFudgeFactor: undefined,
|
|
46
|
+
standardFeeHighFudgeFactor: undefined,
|
|
47
|
+
highFeeFudgeFactor: undefined,
|
|
48
|
+
|
|
44
49
|
highFee: '1000',
|
|
45
50
|
lowFee: '400',
|
|
46
51
|
standardFeeLow: '450',
|
|
@@ -41,6 +41,11 @@ const engineInfo = {
|
|
|
41
41
|
defaultFee: 1000,
|
|
42
42
|
feeUpdateInterval: 60000,
|
|
43
43
|
simpleFeeSettings: {
|
|
44
|
+
lowFeeFudgeFactor: undefined,
|
|
45
|
+
standardFeeLowFudgeFactor: undefined,
|
|
46
|
+
standardFeeHighFudgeFactor: undefined,
|
|
47
|
+
highFeeFudgeFactor: undefined,
|
|
48
|
+
|
|
44
49
|
highFee: '150',
|
|
45
50
|
lowFee: '20',
|
|
46
51
|
standardFeeLow: '50',
|
|
@@ -47,6 +47,11 @@ const engineInfo = {
|
|
|
47
47
|
defaultFee: 100000,
|
|
48
48
|
feeUpdateInterval: 60000,
|
|
49
49
|
simpleFeeSettings: {
|
|
50
|
+
lowFeeFudgeFactor: undefined,
|
|
51
|
+
standardFeeLowFudgeFactor: undefined,
|
|
52
|
+
standardFeeHighFudgeFactor: undefined,
|
|
53
|
+
highFeeFudgeFactor: undefined,
|
|
54
|
+
|
|
50
55
|
highFee: '1500',
|
|
51
56
|
lowFee: '200',
|
|
52
57
|
standardFeeLow: '500',
|
|
@@ -44,6 +44,11 @@ const engineInfo = {
|
|
|
44
44
|
defaultFee: 50000,
|
|
45
45
|
feeUpdateInterval: 60000,
|
|
46
46
|
simpleFeeSettings: {
|
|
47
|
+
lowFeeFudgeFactor: undefined,
|
|
48
|
+
standardFeeLowFudgeFactor: undefined,
|
|
49
|
+
standardFeeHighFudgeFactor: undefined,
|
|
50
|
+
highFeeFudgeFactor: undefined,
|
|
51
|
+
|
|
47
52
|
highFee: '2250',
|
|
48
53
|
lowFee: '1000',
|
|
49
54
|
standardFeeLow: '1100',
|
|
@@ -51,6 +51,11 @@ const engineInfo = {
|
|
|
51
51
|
defaultFee: 1000,
|
|
52
52
|
feeUpdateInterval: 60000,
|
|
53
53
|
simpleFeeSettings: {
|
|
54
|
+
lowFeeFudgeFactor: undefined,
|
|
55
|
+
standardFeeLowFudgeFactor: undefined,
|
|
56
|
+
standardFeeHighFudgeFactor: undefined,
|
|
57
|
+
highFeeFudgeFactor: undefined,
|
|
58
|
+
|
|
54
59
|
highFee: '150',
|
|
55
60
|
lowFee: '20',
|
|
56
61
|
standardFeeLow: '50',
|
|
@@ -50,6 +50,11 @@ var _commonInfo = require('./commonInfo');
|
|
|
50
50
|
defaultFee: 1000,
|
|
51
51
|
feeUpdateInterval: 60000,
|
|
52
52
|
simpleFeeSettings: {
|
|
53
|
+
lowFeeFudgeFactor: undefined,
|
|
54
|
+
standardFeeLowFudgeFactor: undefined,
|
|
55
|
+
standardFeeHighFudgeFactor: undefined,
|
|
56
|
+
highFeeFudgeFactor: undefined,
|
|
57
|
+
|
|
53
58
|
highFee: '150',
|
|
54
59
|
lowFee: '20',
|
|
55
60
|
standardFeeLow: '50',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const IMAGE_SERVER_URL = "https://content.edge.app";
|
|
2
|
-
export declare const INFO_SERVER_URI = "https://info1.
|
|
2
|
+
export declare const INFO_SERVER_URI = "https://info1.edge.app";
|
|
3
3
|
export declare const FEES_PATH = "fees.json";
|
|
4
4
|
export declare const MAX_FEE = 999999999;
|
|
5
5
|
export declare const LOW_FEE = 2;
|
|
@@ -4,10 +4,4 @@ export declare const asMempoolSpaceFees: import("cleaners").ObjectCleaner<{
|
|
|
4
4
|
halfHourFee: number;
|
|
5
5
|
hourFee: number;
|
|
6
6
|
}>;
|
|
7
|
-
/**
|
|
8
|
-
* Calculates the FeeRates object from MempoolSpace
|
|
9
|
-
* Sets the minimum of LOW_FEE on all fee levels
|
|
10
|
-
* @param fees
|
|
11
|
-
* @returns Partial<FeeRates>
|
|
12
|
-
*/
|
|
13
7
|
export declare const processMempoolSpaceFees: (fees: unknown) => FeeRates | null;
|
|
@@ -110,6 +110,10 @@ export declare const asFeeRates: import("cleaners").ObjectCleaner<{
|
|
|
110
110
|
}>;
|
|
111
111
|
export declare type SimpleFeeSettings = ReturnType<typeof asSimpleFeeSettings>;
|
|
112
112
|
export declare const asSimpleFeeSettings: import("cleaners").ObjectCleaner<{
|
|
113
|
+
lowFeeFudgeFactor: string | undefined;
|
|
114
|
+
standardFeeLowFudgeFactor: string | undefined;
|
|
115
|
+
standardFeeHighFudgeFactor: string | undefined;
|
|
116
|
+
highFeeFudgeFactor: string | undefined;
|
|
113
117
|
standardFeeLowAmount: string;
|
|
114
118
|
standardFeeHighAmount: string;
|
|
115
119
|
lowFee: string;
|
|
@@ -2,3 +2,18 @@
|
|
|
2
2
|
const filterUndefined = (values) => {
|
|
3
3
|
return values.filter(value => value !== undefined)
|
|
4
4
|
}; exports.filterUndefined = filterUndefined
|
|
5
|
+
|
|
6
|
+
const removeUndefined = (
|
|
7
|
+
obj
|
|
8
|
+
) => {
|
|
9
|
+
const result = {}
|
|
10
|
+
|
|
11
|
+
for (const key in obj) {
|
|
12
|
+
if (obj[key] !== undefined) {
|
|
13
|
+
// We need to assure TypeScript that the key indeed exists on T
|
|
14
|
+
result[key ] = obj[key]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return result
|
|
19
|
+
}; exports.removeUndefined = removeUndefined
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edge-currency-plugins",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Edge currency plugins to fetch and process wallet accounts, balances and transactions.",
|
|
5
5
|
"repository": "https://github.com/EdgeApp/edge-currency-plugins",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"altcoin-js": "^1.0.0",
|
|
38
38
|
"async-mutex": "^0.2.6",
|
|
39
39
|
"baselet": "^0.2.4",
|
|
40
|
-
"biggystring": "^4.
|
|
40
|
+
"biggystring": "^4.1.3",
|
|
41
41
|
"bip32": "^2.0.5",
|
|
42
42
|
"bip32grs": "^2.0.5",
|
|
43
43
|
"bip39": "^3.0.2",
|
|
@@ -107,4 +107,4 @@
|
|
|
107
107
|
"typescript": "^4.1.2",
|
|
108
108
|
"wif": "^2.0.6"
|
|
109
109
|
}
|
|
110
|
-
}
|
|
110
|
+
}
|