edge-currency-plugins 3.5.0 → 3.5.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.
@@ -183,6 +183,8 @@ const SERVER_CACHE_FILE = 'serverCache.json'
183
183
  },
184
184
 
185
185
  async refreshServers(updatedCustomServers) {
186
+ const serverList = getSelectedServerList()
187
+
186
188
  let newServers
187
189
  if (serverCache.enableCustomServers) {
188
190
  newServers =
@@ -200,9 +202,17 @@ const SERVER_CACHE_FILE = 'serverCache.json'
200
202
  infoPayloadServers
201
203
  : // Use the default servers from info file as final fallback
202
204
  defaultSettings.blockbookServers
205
+
206
+ // Remove any server that's not included in the internal servers list.
207
+ // This is so we can control removal of poor servers from the
208
+ // info-server in real-time.
209
+ const missingServers = Object.keys(serverList).filter(
210
+ server => !newServers.includes(server)
211
+ )
212
+ serverScores.removeServers(serverList, missingServers)
203
213
  }
204
214
 
205
- serverScores.serverScoresLoad(getSelectedServerList(), newServers)
215
+ serverScores.serverScoresLoad(serverList, newServers)
206
216
  await saveServerCache()
207
217
 
208
218
  // Tell the engines about the new servers:
@@ -343,4 +343,11 @@ const RE_ADDED_SERVER_SCORE = -10
343
343
 
344
344
  return selectedServers
345
345
  }
346
+
347
+ removeServers(servers, serverUrls) {
348
+ for (const serverUrl of serverUrls) {
349
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
350
+ delete servers[serverUrl]
351
+ }
352
+ }
346
353
  } exports.ServerScores = ServerScores;
@@ -32,7 +32,7 @@ var _commonInfo = require('./commonInfo');
32
32
  defaultSettings: {
33
33
  customFeeSettings: ['satPerByte'],
34
34
  blockbookServers: [
35
- 'wss://blockbook.firo.org',
35
+ // 'wss://blockbook.firo.org',
36
36
  'wss://firo-wusa1.edge.app',
37
37
  'wss://firo.nownodes.io/wss/%{nowNodesApiKey}'
38
38
  ],
@@ -58,5 +58,6 @@ export declare class ServerScores {
58
58
  serverScoreDown(servers: ServerList, serverUrl: string, changeScore?: number): void;
59
59
  setResponseTime(servers: ServerList, serverUrl: string, responseTimeMilliseconds: number): void;
60
60
  getServers(servers: ServerList, numServersWanted: number, includePatterns?: Array<string | RegExp>): string[];
61
+ removeServers(servers: ServerList, serverUrls: string[]): void;
61
62
  }
62
63
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-currency-plugins",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
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",
package/lib/bch.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
-
3
- var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
4
- var _bitcoincash = require('./common/utxobased/info/bitcoincash');
5
-
6
- const plugin = (options) =>
7
- _CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _bitcoincash.info)
8
-
9
- if (typeof window !== 'undefined') {
10
- _optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
11
- [_bitcoincash.info.currencyInfo.pluginId]: plugin
12
- })])
13
- }
14
-
15
- exports. default = plugin
package/lib/bsv.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
-
3
- var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
4
- var _bitcoinsv = require('./common/utxobased/info/bitcoinsv');
5
-
6
- const plugin = (options) =>
7
- _CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _bitcoinsv.info)
8
-
9
- if (typeof window !== 'undefined') {
10
- _optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
11
- [_bitcoinsv.info.currencyInfo.pluginId]: plugin
12
- })])
13
- }
14
-
15
- exports. default = plugin
package/lib/btc.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
-
3
- var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
4
- var _bitcoin = require('./common/utxobased/info/bitcoin');
5
-
6
- const plugin = (options) =>
7
- _CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _bitcoin.info)
8
-
9
- if (typeof window !== 'undefined') {
10
- _optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
11
- [_bitcoin.info.currencyInfo.pluginId]: plugin
12
- })])
13
- }
14
-
15
- exports. default = plugin
package/lib/firo.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
-
3
- var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
4
- var _zcoin = require('./common/utxobased/info/zcoin');
5
-
6
- const plugin = (options) =>
7
- _CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _zcoin.info)
8
-
9
- if (typeof window !== 'undefined') {
10
- _optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
11
- [_zcoin.info.currencyInfo.pluginId]: plugin
12
- })])
13
- }
14
-
15
- exports. default = plugin
package/lib/ftc.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
-
3
- var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
4
- var _feathercoin = require('./common/utxobased/info/feathercoin');
5
-
6
- const plugin = (options) =>
7
- _CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _feathercoin.info)
8
-
9
- if (typeof window !== 'undefined') {
10
- _optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
11
- [_feathercoin.info.currencyInfo.pluginId]: plugin
12
- })])
13
- }
14
-
15
- exports. default = plugin
package/lib/ltc.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
-
3
- var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
4
- var _litecoin = require('./common/utxobased/info/litecoin');
5
-
6
- const plugin = (options) =>
7
- _CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _litecoin.info)
8
-
9
- if (typeof window !== 'undefined') {
10
- _optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
11
- [_litecoin.info.currencyInfo.pluginId]: plugin
12
- })])
13
- }
14
-
15
- exports. default = plugin
package/lib/src/bch.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types';
2
- declare const plugin: (options: EdgeCorePluginOptions) => EdgeCurrencyPlugin;
3
- export default plugin;
package/lib/src/bsv.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types';
2
- declare const plugin: (options: EdgeCorePluginOptions) => EdgeCurrencyPlugin;
3
- export default plugin;
package/lib/src/btc.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types';
2
- declare const plugin: (options: EdgeCorePluginOptions) => EdgeCurrencyPlugin;
3
- export default plugin;
package/lib/src/firo.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types';
2
- declare const plugin: (options: EdgeCorePluginOptions) => EdgeCurrencyPlugin;
3
- export default plugin;
package/lib/src/ftc.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types';
2
- declare const plugin: (options: EdgeCorePluginOptions) => EdgeCurrencyPlugin;
3
- export default plugin;
package/lib/src/ltc.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types';
2
- declare const plugin: (options: EdgeCorePluginOptions) => EdgeCurrencyPlugin;
3
- export default plugin;
package/lib/src/tbch.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types';
2
- declare const plugin: (options: EdgeCorePluginOptions) => EdgeCurrencyPlugin;
3
- export default plugin;
package/lib/src/tbtc.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types';
2
- declare const plugin: (options: EdgeCorePluginOptions) => EdgeCurrencyPlugin;
3
- export default plugin;
package/lib/src/tbtg.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types';
2
- declare const plugin: (options: EdgeCorePluginOptions) => EdgeCurrencyPlugin;
3
- export default plugin;
package/lib/tbch.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
-
3
- var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
4
- var _bitcoincashtestnet = require('./common/utxobased/info/bitcoincashtestnet');
5
-
6
- const plugin = (options) =>
7
- _CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _bitcoincashtestnet.info)
8
-
9
- if (typeof window !== 'undefined') {
10
- _optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
11
- [_bitcoincashtestnet.info.currencyInfo.pluginId]: plugin
12
- })])
13
- }
14
-
15
- exports. default = plugin
package/lib/tbtc.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
-
3
- var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
4
- var _bitcointestnet = require('./common/utxobased/info/bitcointestnet');
5
-
6
- const plugin = (options) =>
7
- _CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _bitcointestnet.info)
8
-
9
- if (typeof window !== 'undefined') {
10
- _optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
11
- [_bitcointestnet.info.currencyInfo.pluginId]: plugin
12
- })])
13
- }
14
-
15
- exports. default = plugin
package/lib/tbtg.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
-
3
- var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
4
- var _bitcoingoldtestnet = require('./common/utxobased/info/bitcoingoldtestnet');
5
-
6
- const plugin = (options) =>
7
- _CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _bitcoingoldtestnet.info)
8
-
9
- if (typeof window !== 'undefined') {
10
- _optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
11
- [_bitcoingoldtestnet.info.currencyInfo.pluginId]: plugin
12
- })])
13
- }
14
-
15
- exports. default = plugin