edge-core-js 2.2.1 → 2.4.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 +9 -0
- package/android/src/main/assets/edge-core-js/edge-core.js +1 -1
- package/android/src/main/assets/edge-core-js/edge-core.js.map +1 -1
- package/android/src/main/assets/edge-core-js/index.html +25 -0
- package/lib/core/account/account-api.js +2 -2
- package/lib/core/account/account-pixie.js +3 -6
- package/lib/core/account/lobby-api.js +1 -3
- package/lib/core/actions.js +6 -0
- package/lib/core/context/context-pixie.js +47 -2
- package/lib/core/context/info-cache-file.js +18 -0
- package/lib/core/currency/currency-pixie.js +32 -2
- package/lib/core/currency/wallet/currency-wallet-callbacks.js +25 -18
- package/lib/core/currency/wallet/metadata.js +2 -1
- package/lib/core/fake/fake-db.js +3 -3
- package/lib/core/fake/fake-server.js +6 -6
- package/lib/core/fake/fake-world.js +5 -2
- package/lib/core/plugins/plugins-actions.js +6 -3
- package/lib/core/plugins/plugins-selectors.js +1 -1
- package/lib/core/root-reducer.js +21 -2
- package/lib/core/root.js +33 -16
- package/lib/core/storage/storage-actions.js +3 -3
- package/lib/core/swap/swap-api.js +5 -4
- package/lib/flow/types.js +9 -2
- package/lib/io/react-native/native-bridge.js +1 -0
- package/lib/node/index.js +177 -72
- package/lib/types/types.js +7 -0
- package/lib/util/match-json.js +47 -0
- package/package.json +1 -1
- package/src/types/types.ts +9 -2
- package/lib/core/context/context-reducer.js +0 -31
package/src/types/types.ts
CHANGED
|
@@ -163,9 +163,12 @@ export interface EdgeNativeIo {
|
|
|
163
163
|
* All core plugins receive these options at creation time.
|
|
164
164
|
*/
|
|
165
165
|
export interface EdgeCorePluginOptions {
|
|
166
|
-
|
|
166
|
+
/** Load-time options (like API keys) passed into the context */
|
|
167
167
|
initOptions: JsonObject
|
|
168
168
|
|
|
169
|
+
/** Data provided by the info server */
|
|
170
|
+
infoPayload: JsonObject
|
|
171
|
+
|
|
169
172
|
// Access to the world outside the plugin:
|
|
170
173
|
io: EdgeIo
|
|
171
174
|
log: EdgeLog // Plugin-scoped logging
|
|
@@ -543,6 +546,9 @@ export type EdgeConfirmationState =
|
|
|
543
546
|
| 'confirmed'
|
|
544
547
|
// Dropped from the network without confirmations:
|
|
545
548
|
| 'dropped'
|
|
549
|
+
// Confirmed, but failed on-chain execution (exceeded gas limit,
|
|
550
|
+
// smart-contract failure, etc):
|
|
551
|
+
| 'failed'
|
|
546
552
|
// We don't know the chain height yet:
|
|
547
553
|
| 'syncing'
|
|
548
554
|
// No confirmations yet:
|
|
@@ -1034,6 +1040,7 @@ export interface EdgeCurrencyPlugin {
|
|
|
1034
1040
|
walletInfo: EdgeWalletInfo,
|
|
1035
1041
|
opts: EdgeCurrencyEngineOptions
|
|
1036
1042
|
) => Promise<EdgeCurrencyEngine>
|
|
1043
|
+
readonly updateInfoPayload?: (infoPayload: JsonObject) => Promise<void>
|
|
1037
1044
|
|
|
1038
1045
|
// Escape hatch:
|
|
1039
1046
|
readonly otherMethods?: EdgeOtherMethods
|
|
@@ -1311,7 +1318,7 @@ export interface EdgeSwapPlugin {
|
|
|
1311
1318
|
readonly fetchSwapQuote: (
|
|
1312
1319
|
request: EdgeSwapRequest,
|
|
1313
1320
|
userSettings: JsonObject | undefined,
|
|
1314
|
-
opts: { promoCode?: string }
|
|
1321
|
+
opts: { infoPayload: JsonObject; promoCode?: string }
|
|
1315
1322
|
) => Promise<EdgeSwapQuote>
|
|
1316
1323
|
}
|
|
1317
1324
|
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { buildReducer } from 'redux-keto'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const defaultEdgeServers = {
|
|
15
|
-
infoServers: [],
|
|
16
|
-
syncServers: []
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const contextConfig = buildReducer
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
({
|
|
24
|
-
edgeServers(state = defaultEdgeServers, action) {
|
|
25
|
-
if (action.type === 'INIT') {
|
|
26
|
-
const { infoServers, syncServers } = action.payload
|
|
27
|
-
return { infoServers, syncServers }
|
|
28
|
-
}
|
|
29
|
-
return state
|
|
30
|
-
}
|
|
31
|
-
})
|