edge-currency-plugins 2.4.0 → 2.4.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.
@@ -65,7 +65,7 @@ var _processMempoolSpaceFees = require('./processMempoolSpaceFees');
65
65
  const edgeFees = await fetchFees({
66
66
  ...common,
67
67
  uri: `${_constants.INFO_SERVER_URI}/v1/networkFees/${currencyInfo.pluginId}`,
68
- cleaner: _cleaners.asMaybe.call(void 0, _types3.asFeeInfo, null)
68
+ cleaner: _cleaners.asMaybe.call(void 0, _types3.asFeeInfo.call(void 0, feeInfo), null)
69
69
  })
70
70
  Object.assign(feeInfo, edgeFees)
71
71
  await updateVendorFees()
@@ -122,7 +122,7 @@ const fetchCachedFees = async (
122
122
  fallback
123
123
  ) => {
124
124
  const data = await memlet.getJson(_constants.FEES_PATH).catch(() => undefined)
125
- const feeSettings = _cleaners.asMaybe.call(void 0, _types3.asFeeInfo, fallback)(data)
125
+ const feeSettings = _cleaners.asMaybe.call(void 0, _types3.asFeeInfo.call(void 0, fallback), fallback)(data)
126
126
  return feeSettings
127
127
  }
128
128
 
@@ -1,4 +1,4 @@
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; } }
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; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
4
 
@@ -161,21 +161,28 @@ var _cleaners = require('cleaners');
161
161
 
162
162
 
163
163
 
164
- const asFeeInfo = _cleaners.asObject({
165
- ...exports.asFeeRates.shape,
164
+ const asFeeInfo = (fallback) =>
165
+ _cleaners.asObject({
166
+ ...exports.asFeeRates.shape,
166
167
 
167
- lowFeeFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString),
168
- standardFeeLowFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString),
169
- standardFeeHighFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString),
170
- highFeeFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString),
168
+ lowFeeFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString, _optionalChain([fallback, 'optionalAccess', _ => _.lowFeeFudgeFactor])),
169
+ standardFeeLowFudgeFactor: _cleaners.asMaybe.call(void 0,
170
+ _cleaners.asString,
171
+ _optionalChain([fallback, 'optionalAccess', _2 => _2.standardFeeLowFudgeFactor])
172
+ ),
173
+ standardFeeHighFudgeFactor: _cleaners.asMaybe.call(void 0,
174
+ _cleaners.asString,
175
+ _optionalChain([fallback, 'optionalAccess', _3 => _3.standardFeeHighFudgeFactor])
176
+ ),
177
+ highFeeFudgeFactor: _cleaners.asMaybe.call(void 0, _cleaners.asString, _optionalChain([fallback, 'optionalAccess', _4 => _4.highFeeFudgeFactor])),
171
178
 
172
- // The amount of satoshis which will be charged the standardFeeLow
173
- standardFeeLowAmount: _cleaners.asString,
174
- // The amount of satoshis which will be charged the standardFeeHigh
175
- standardFeeHighAmount: _cleaners.asString,
176
- // A safe-guard for any potential software bugs:
177
- maximumFeeRate: _cleaners.asOptional.call(void 0, _cleaners.asString)
178
- }); exports.asFeeInfo = asFeeInfo
179
+ // The amount of satoshis which will be charged the standardFeeLow
180
+ standardFeeLowAmount: _cleaners.asString,
181
+ // The amount of satoshis which will be charged the standardFeeHigh
182
+ standardFeeHighAmount: _cleaners.asString,
183
+ // A safe-guard for any potential software bugs:
184
+ maximumFeeRate: _cleaners.asOptional.call(void 0, _cleaners.asString, _optionalChain([fallback, 'optionalAccess', _5 => _5.maximumFeeRate]))
185
+ }).withRest; exports.asFeeInfo = asFeeInfo
179
186
 
180
187
 
181
188
 
@@ -117,7 +117,7 @@ export declare type FeeInfo = FeeRates & {
117
117
  standardFeeHighAmount: string;
118
118
  maximumFeeRate?: string;
119
119
  };
120
- export declare const asFeeInfo: import("cleaners").ObjectCleaner<FeeInfo>;
120
+ export declare const asFeeInfo: (fallback?: FeeInfo | undefined) => Cleaner<FeeInfo>;
121
121
  export interface EngineConfig {
122
122
  walletInfo: EdgeWalletInfo;
123
123
  pluginInfo: PluginInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-currency-plugins",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
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",