edge-currency-monero 2.1.0 → 2.2.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/CHANGELOG.md +4 -0
- package/lib/MoneroEngine.js +18 -7
- package/lib/moneroInfo.js +2 -1
- package/lib/moneroTypes.js +3 -1
- package/lib/react-native/edge-currency-monero.ts +448 -345
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/lib/MoneroEngine.js
CHANGED
|
@@ -26,6 +26,7 @@ var _biggystring = require('biggystring');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
var _types = require('edge-core-js/types');
|
|
@@ -85,6 +86,7 @@ const PRIMARY_CURRENCY_TOKEN_ID = null
|
|
|
85
86
|
|
|
86
87
|
|
|
87
88
|
|
|
89
|
+
|
|
88
90
|
__init() {this.loginPromise = null}
|
|
89
91
|
|
|
90
92
|
constructor(
|
|
@@ -109,13 +111,6 @@ const PRIMARY_CURRENCY_TOKEN_ID = null
|
|
|
109
111
|
this.walletId = walletInfo.id
|
|
110
112
|
this.currencyInfo = _moneroInfo.currencyInfo
|
|
111
113
|
this.currencyTools = tools
|
|
112
|
-
this.myMoneroApi = new (0, _MyMoneroApi.MyMoneroApi)(tools.cppBridge, {
|
|
113
|
-
apiKey: initOptions.edgeApiKey,
|
|
114
|
-
apiServer: networkInfo.defaultServer,
|
|
115
|
-
fetch: env.io.fetch,
|
|
116
|
-
nettype: networkInfo.nettype
|
|
117
|
-
})
|
|
118
|
-
this.seenTxCheckpoint = _moneroTypes.asSeenTxCheckpoint.call(void 0, opts.seenTxCheckpoint)
|
|
119
114
|
|
|
120
115
|
// this.customTokens = []
|
|
121
116
|
this.timers = {}
|
|
@@ -124,6 +119,22 @@ const PRIMARY_CURRENCY_TOKEN_ID = null
|
|
|
124
119
|
..._moneroInfo.currencyInfo.defaultSettings,
|
|
125
120
|
..._moneroTypes.asMoneroUserSettings.call(void 0, userSettings)
|
|
126
121
|
}
|
|
122
|
+
|
|
123
|
+
this.engineFetch = async (uri, init) => {
|
|
124
|
+
const { networkPrivacy } = this.currentSettings
|
|
125
|
+
return await this.io.fetch(uri, {
|
|
126
|
+
...(networkPrivacy === 'nym' ? { privacy: 'nym' } : {}),
|
|
127
|
+
...init
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
this.myMoneroApi = new (0, _MyMoneroApi.MyMoneroApi)(tools.cppBridge, {
|
|
132
|
+
apiKey: initOptions.edgeApiKey,
|
|
133
|
+
apiServer: networkInfo.defaultServer,
|
|
134
|
+
fetch: this.engineFetch,
|
|
135
|
+
nettype: networkInfo.nettype
|
|
136
|
+
})
|
|
137
|
+
this.seenTxCheckpoint = _moneroTypes.asSeenTxCheckpoint.call(void 0, opts.seenTxCheckpoint)
|
|
127
138
|
if (
|
|
128
139
|
this.currentSettings.enableCustomServers &&
|
|
129
140
|
this.currentSettings.moneroLightwalletServer != null
|
package/lib/moneroInfo.js
CHANGED
package/lib/moneroTypes.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
|
|
14
15
|
var _cleaners = require('cleaners');
|
|
15
16
|
|
|
16
17
|
|
|
@@ -26,7 +27,8 @@ var _cleaners = require('cleaners');
|
|
|
26
27
|
|
|
27
28
|
const asMoneroUserSettings = _cleaners.asObject.call(void 0, {
|
|
28
29
|
enableCustomServers: _cleaners.asMaybe.call(void 0, _cleaners.asBoolean, false),
|
|
29
|
-
moneroLightwalletServer: _cleaners.asMaybe.call(void 0, _cleaners.asString)
|
|
30
|
+
moneroLightwalletServer: _cleaners.asMaybe.call(void 0, _cleaners.asString),
|
|
31
|
+
networkPrivacy: _cleaners.asOptional.call(void 0, _cleaners.asValue.call(void 0, 'none', 'nym'), 'none')
|
|
30
32
|
}); exports.asMoneroUserSettings = asMoneroUserSettings
|
|
31
33
|
|
|
32
34
|
|