edge-currency-plugins 3.8.11 → 3.10.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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
|
var _memlet = require('memlet');
|
|
4
4
|
|
|
@@ -9,6 +9,7 @@ var _memlet = require('memlet');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
|
|
12
13
|
var _ServerScores = require('./ServerScores');
|
|
13
14
|
|
|
14
15
|
|
|
@@ -56,6 +57,43 @@ const SERVER_CACHE_FILE = 'serverCache.json'
|
|
|
56
57
|
function makePluginState(settings) {
|
|
57
58
|
const { defaultSettings, log, pluginDisklet, pluginId } = settings
|
|
58
59
|
|
|
60
|
+
const sanitizeServerUri = (uri) => {
|
|
61
|
+
// `dumpData()` is often copied into support logs.
|
|
62
|
+
// Strip anything that might accidentally contain credentials/tokens.
|
|
63
|
+
// Keep scheme/host/path, but drop username/password + query/hash.
|
|
64
|
+
// Avoid using the global `URL` class since it is not guaranteed to exist
|
|
65
|
+
// in all runtime environments.
|
|
66
|
+
const noQueryHash = uri.split(/[?#]/)[0]
|
|
67
|
+
return noQueryHash.replace(
|
|
68
|
+
/^([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)([^@/]*@)(.*)$/,
|
|
69
|
+
'$1$3'
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const sanitizeServerList = (serverList) => {
|
|
74
|
+
const out = {}
|
|
75
|
+
|
|
76
|
+
for (const [serverUri, serverInfo] of Object.entries(serverList)) {
|
|
77
|
+
const sanitizedUri = sanitizeServerUri(serverUri)
|
|
78
|
+
const sanitizedInfo = {
|
|
79
|
+
...serverInfo,
|
|
80
|
+
serverUrl: sanitizeServerUri(serverInfo.serverUrl)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// In case sanitization causes collisions (ex: query string removed),
|
|
84
|
+
// preserve all entries by suffixing the key.
|
|
85
|
+
if (out[sanitizedUri] == null) {
|
|
86
|
+
out[sanitizedUri] = sanitizedInfo
|
|
87
|
+
} else {
|
|
88
|
+
let i = 2
|
|
89
|
+
while (out[`${sanitizedUri}#${i}`] != null) i++
|
|
90
|
+
out[`${sanitizedUri}#${i}`] = sanitizedInfo
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return out
|
|
95
|
+
}
|
|
96
|
+
|
|
59
97
|
let engines = []
|
|
60
98
|
const memlet = _memlet.makeMemlet.call(void 0, pluginDisklet)
|
|
61
99
|
|
|
@@ -137,8 +175,18 @@ const SERVER_CACHE_FILE = 'serverCache.json'
|
|
|
137
175
|
},
|
|
138
176
|
|
|
139
177
|
dumpData() {
|
|
178
|
+
const selectedServerList = getSelectedServerList()
|
|
179
|
+
const infoServers = Object.keys(
|
|
180
|
+
_nullishCoalesce(_optionalChain([instance, 'access', _ => _.infoPayload, 'optionalAccess', _2 => _2.blockbookServers]), () => ( {}))
|
|
181
|
+
).map(sanitizeServerUri)
|
|
182
|
+
|
|
140
183
|
return {
|
|
141
|
-
'pluginState.servers_':
|
|
184
|
+
'pluginState.servers_': sanitizeServerList(selectedServerList),
|
|
185
|
+
infoServers,
|
|
186
|
+
customServers: Object.keys(serverCache.customServers).map(
|
|
187
|
+
sanitizeServerUri
|
|
188
|
+
),
|
|
189
|
+
enableCustomServers: serverCache.enableCustomServers
|
|
142
190
|
}
|
|
143
191
|
},
|
|
144
192
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edge-currency-plugins",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
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",
|
|
@@ -50,20 +50,20 @@
|
|
|
50
50
|
"bip39": "^3.0.2",
|
|
51
51
|
"bitcoinjs-message": "^2.2.0",
|
|
52
52
|
"blake-hash": "^2.0.0",
|
|
53
|
-
"bn.js": "^5.
|
|
53
|
+
"bn.js": "^5.2.3",
|
|
54
54
|
"bs58": "^4.0.1",
|
|
55
55
|
"bs58grscheck": "^2.1.2",
|
|
56
56
|
"bs58smartcheck": "^2.0.4",
|
|
57
57
|
"cleaners": "^0.3.17",
|
|
58
58
|
"disklet": "^0.4.5",
|
|
59
|
-
"ecpair": "
|
|
59
|
+
"ecpair": "npm:@edge.app/ecpair@2.1.0-edge.1",
|
|
60
60
|
"edge-sync-client": "^0.2.7",
|
|
61
61
|
"memlet": "^0.1.7",
|
|
62
62
|
"uri-js": "^4.4.0",
|
|
63
63
|
"url-parse": "^1.5.2",
|
|
64
64
|
"wif-smart": "^2.0.0",
|
|
65
65
|
"wifgrs": "^2.0.6",
|
|
66
|
-
"ws": "^7.
|
|
66
|
+
"ws": "^7.5.10"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@sucrase/webpack-loader": "^2.0.0",
|
|
@@ -84,11 +84,14 @@
|
|
|
84
84
|
"@types/ws": "^7.2.6",
|
|
85
85
|
"@typescript-eslint/eslint-plugin": "^4.8.2",
|
|
86
86
|
"@typescript-eslint/parser": "^4.8.2",
|
|
87
|
-
"
|
|
87
|
+
"assert": "^2.1.0",
|
|
88
|
+
"base-x": "^4.0.1",
|
|
89
|
+
"buffer": "^6.0.3",
|
|
88
90
|
"chai": "^4.2.0",
|
|
89
91
|
"chai-as-promised": "^7.1.1",
|
|
92
|
+
"crypto-browserify": "^3.12.1",
|
|
90
93
|
"edge-core-js": "^2.24.0",
|
|
91
|
-
"esbuild-loader": "^4.
|
|
94
|
+
"esbuild-loader": "^4.3.0",
|
|
92
95
|
"eslint": "^7.14.0",
|
|
93
96
|
"eslint-config-standard-kit": "0.15.1",
|
|
94
97
|
"eslint-plugin-import": "^2.22.1",
|
|
@@ -97,28 +100,43 @@
|
|
|
97
100
|
"eslint-plugin-prettier": "^3.1.4",
|
|
98
101
|
"eslint-plugin-promise": "^4.2.1",
|
|
99
102
|
"eslint-plugin-simple-import-sort": "^6.0.1",
|
|
103
|
+
"https-browserify": "^1.0.0",
|
|
100
104
|
"husky": "^7.0.4",
|
|
101
105
|
"jsonfile": "^6.1.0",
|
|
102
106
|
"lint-staged": "^10.5.3",
|
|
103
|
-
"mocha": "^
|
|
104
|
-
"mocha-junit-reporter": "^2.0
|
|
107
|
+
"mocha": "^10.6.0",
|
|
108
|
+
"mocha-junit-reporter": "^2.1.0",
|
|
105
109
|
"mocha-multi-reporters": "^1.5.1",
|
|
106
110
|
"mochawesome": "^7.0.1",
|
|
107
111
|
"node-fetch": "2.x",
|
|
108
|
-
"nodemon": "^
|
|
112
|
+
"nodemon": "^3.0.0",
|
|
109
113
|
"npm-run-all": "^4.1.5",
|
|
110
114
|
"nyc": "^15.1.0",
|
|
111
|
-
"
|
|
115
|
+
"os-browserify": "^0.3.0",
|
|
116
|
+
"parcel": "^2.0.0",
|
|
112
117
|
"patch-package": "^8.0.0",
|
|
118
|
+
"path-browserify": "^1.0.1",
|
|
113
119
|
"prettier": "^2.2.0",
|
|
120
|
+
"process": "^0.11.10",
|
|
114
121
|
"request": "^2.88.2",
|
|
115
122
|
"rimraf": "^3.0.2",
|
|
123
|
+
"stream-browserify": "^3.0.0",
|
|
124
|
+
"stream-http": "^3.2.0",
|
|
116
125
|
"sucrase": "^3.12.1",
|
|
117
126
|
"typescript": "^4.1.2",
|
|
118
|
-
"
|
|
127
|
+
"url": "^0.11.4",
|
|
128
|
+
"vm-browserify": "^1.1.2",
|
|
129
|
+
"webpack": "^5.104.1",
|
|
119
130
|
"webpack-cli": "^5.1.4",
|
|
120
|
-
"webpack-dev-server": "^5.
|
|
131
|
+
"webpack-dev-server": "^5.2.4",
|
|
121
132
|
"wif": "^2.0.6"
|
|
122
133
|
},
|
|
134
|
+
"overrides": {
|
|
135
|
+
"get-func-name": "2.0.2",
|
|
136
|
+
"groestl-hash-js": "npm:@edge.app/groestl-hash-js@1.0.0-edge.1",
|
|
137
|
+
"wifgrs": {
|
|
138
|
+
"bs58grscheck": "npm:@edge.app/bs58grscheck@2.1.2-edge.1"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
123
141
|
"react-native": "./lib/react-native.js"
|
|
124
142
|
}
|