@exodus/headless 2.0.0-alpha.55 → 2.0.0-alpha.56
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 +24 -0
- package/package.json +5 -5
- package/src/application.js +3 -3
- package/src/index.js +6 -6
- package/src/modules/ab-testing/api.js +0 -13
- package/src/modules/ab-testing/index.js +0 -26
- package/src/modules/ab-testing/plugin.js +0 -21
- package/src/modules/address-provider/api.js +0 -14
- package/src/modules/address-provider/index.js +0 -15
- package/src/modules/apy-rates/index.js +0 -20
- package/src/modules/apy-rates/plugin.js +0 -14
- package/src/modules/crypto-news/index.js +0 -20
- package/src/modules/crypto-news/plugin.js +0 -17
- package/src/modules/kyc/api.js +0 -14
- package/src/modules/kyc/index.js +0 -19
- package/src/modules/kyc/plugin.js +0 -21
- package/src/modules/top-movers/index.js +0 -23
- package/src/modules/top-movers/plugin.js +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.0-alpha.56](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.55...@exodus/headless@2.0.0-alpha.56) (2023-06-30)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- export feature definition from ab-testing (#2161)
|
|
11
|
+
- export feature definition from top-movers (#2165)
|
|
12
|
+
- export feature definition from kyc (#2167)
|
|
13
|
+
- export feature definition from crypto-news (#2163)
|
|
14
|
+
- export feature definition from apy-rates (#2162)
|
|
15
|
+
- export feature definition from address-provider (#2155)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- export feature definition from ab-testing ([#2161](https://github.com/ExodusMovement/exodus-hydra/issues/2161)) ([e773c68](https://github.com/ExodusMovement/exodus-hydra/commit/e773c68ec6581cad508d8b7bd3d096edaa7878ef))
|
|
20
|
+
- export feature definition from address-provider ([#2155](https://github.com/ExodusMovement/exodus-hydra/issues/2155)) ([a4f8da3](https://github.com/ExodusMovement/exodus-hydra/commit/a4f8da39400bac23f3d84afdb56315b5a8a37567))
|
|
21
|
+
- export feature definition from apy-rates ([#2162](https://github.com/ExodusMovement/exodus-hydra/issues/2162)) ([693a953](https://github.com/ExodusMovement/exodus-hydra/commit/693a953cad357b60aabeb66edc95a60bacbaf6b5))
|
|
22
|
+
- export feature definition from crypto-news ([#2163](https://github.com/ExodusMovement/exodus-hydra/issues/2163)) ([fd46794](https://github.com/ExodusMovement/exodus-hydra/commit/fd46794de45fed3ed574fb47efe6f8256dceea4f))
|
|
23
|
+
- export feature definition from kyc ([#2167](https://github.com/ExodusMovement/exodus-hydra/issues/2167)) ([b655a26](https://github.com/ExodusMovement/exodus-hydra/commit/b655a26539decfd3fe4f219505eaace2c26a2e97))
|
|
24
|
+
- export feature definition from top-movers ([#2165](https://github.com/ExodusMovement/exodus-hydra/issues/2165)) ([b9183fa](https://github.com/ExodusMovement/exodus-hydra/commit/b9183fae78b521f0275d2fcab42ea6f1790aca94))
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
- delete backups when restart due to forgot passphrase ([#2144](https://github.com/ExodusMovement/exodus-hydra/issues/2144)) ([ba48906](https://github.com/ExodusMovement/exodus-hydra/commit/ba4890613b08f77986c74a4870fe29870f481233))
|
|
29
|
+
|
|
6
30
|
## [2.0.0-alpha.55](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.54...@exodus/headless@2.0.0-alpha.55) (2023-06-28)
|
|
7
31
|
|
|
8
32
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/headless",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
4
|
-
"description": "The
|
|
5
|
-
"author": "Exodus Movement Inc",
|
|
3
|
+
"version": "2.0.0-alpha.56",
|
|
4
|
+
"description": "The platform-agnostic Exodus wallet SDK",
|
|
5
|
+
"author": "Exodus Movement Inc.",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@exodus/ab-testing": "^5.1.2",
|
|
30
|
-
"@exodus/address-provider": "^4.
|
|
30
|
+
"@exodus/address-provider": "^4.2.0",
|
|
31
31
|
"@exodus/apy-rates": "^2.1.1",
|
|
32
32
|
"@exodus/atoms": "^5.2.0",
|
|
33
33
|
"@exodus/auto-enable-assets-plugin": "^4.0.1",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"nock": "^13.3.1",
|
|
90
90
|
"p-defer": "^4.0.0"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "1018fd8f756ac929a2d039130facd892d78b2071"
|
|
93
93
|
}
|
package/src/application.js
CHANGED
|
@@ -158,7 +158,7 @@ class Application extends ExodusModule {
|
|
|
158
158
|
|
|
159
159
|
const walletExists = await this.#wallet.exists()
|
|
160
160
|
|
|
161
|
-
const { forceRestart, ...wallet } = opts
|
|
161
|
+
const { forceRestart, forgotPassphrase, ...wallet } = opts
|
|
162
162
|
|
|
163
163
|
await this.#wallet.import(wallet)
|
|
164
164
|
|
|
@@ -251,9 +251,9 @@ class Application extends ExodusModule {
|
|
|
251
251
|
this._logger.log('passphrase changed')
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
delete = async () => {
|
|
254
|
+
delete = async ({ forgotPassphrase } = {}) => {
|
|
255
255
|
await this.#storage.set(DELETE_FLAG, true)
|
|
256
|
-
await this.fire(Hook.Restart, { reason: 'delete' })
|
|
256
|
+
await this.fire(Hook.Restart, { reason: 'delete', forgotPassphrase })
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
changeLockTimer = async ({ ttl }) => {
|
package/src/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
+
import abTesting from '@exodus/ab-testing'
|
|
2
|
+
import addressProvider from '@exodus/address-provider'
|
|
3
|
+
import apyRates from '@exodus/apy-rates'
|
|
1
4
|
import { pick } from '@exodus/basic-utils'
|
|
5
|
+
import cryptoNews from '@exodus/crypto-news-monitor'
|
|
6
|
+
import kyc from '@exodus/kyc'
|
|
7
|
+
import topMovers from '@exodus/top-movers-monitor'
|
|
2
8
|
|
|
3
9
|
import createApi from './api'
|
|
4
10
|
import attachAtoms from './atoms/attach'
|
|
5
11
|
import { atomsToAttach } from './constants'
|
|
6
12
|
import createIOC from './ioc'
|
|
7
|
-
import abTesting from './modules/ab-testing'
|
|
8
|
-
import addressProvider from './modules/address-provider'
|
|
9
|
-
import apyRates from './modules/apy-rates'
|
|
10
13
|
import balances from './modules/balances'
|
|
11
14
|
import blockchainMetadata from './modules/blockchain-metadata'
|
|
12
15
|
import connectedOrigins from './modules/connected-origins'
|
|
13
|
-
import cryptoNews from './modules/crypto-news'
|
|
14
16
|
import enabledAssets from './modules/enabled-assets'
|
|
15
17
|
import featureFlags from './modules/feature-flags'
|
|
16
18
|
import fees from './modules/fees'
|
|
17
19
|
import fiatBalances from './modules/fiat-balances'
|
|
18
20
|
import geolocation from './modules/geolocation'
|
|
19
|
-
import kyc from './modules/kyc'
|
|
20
21
|
import locale from './modules/locale'
|
|
21
22
|
import marketHistory from './modules/market-history'
|
|
22
23
|
import nfts from './modules/nfts'
|
|
23
24
|
import pricing from './modules/pricing'
|
|
24
25
|
import rates from './modules/rates'
|
|
25
26
|
import remoteConfig from './modules/remote-config'
|
|
26
|
-
import topMovers from './modules/top-movers'
|
|
27
27
|
import wallet from './modules/wallet'
|
|
28
28
|
import walletAccounts from './modules/wallet-accounts'
|
|
29
29
|
import attachPlugins from './plugins/attach'
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const abTestingApi = ({ abTesting }) => ({
|
|
2
|
-
abTesting: {
|
|
3
|
-
trackEvent: abTesting.trackEvent,
|
|
4
|
-
updateVariant: abTesting.updateVariant,
|
|
5
|
-
},
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
id: 'abTestingApi',
|
|
10
|
-
type: 'api',
|
|
11
|
-
factory: abTestingApi,
|
|
12
|
-
dependencies: ['abTesting'],
|
|
13
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { abTestingAtomDefinition } from '@exodus/ab-testing/atoms'
|
|
2
|
-
import abTestingDefinition from '@exodus/ab-testing/module'
|
|
3
|
-
|
|
4
|
-
import abTestingApiDefinition from './api'
|
|
5
|
-
import abTestingPluginDefinition from './plugin'
|
|
6
|
-
|
|
7
|
-
const abTesting = () => {
|
|
8
|
-
return {
|
|
9
|
-
id: 'abTesting',
|
|
10
|
-
definitions: [
|
|
11
|
-
{
|
|
12
|
-
definition: abTestingAtomDefinition,
|
|
13
|
-
storage: { namespace: 'abTesting' },
|
|
14
|
-
aliases: [{ implementationId: 'unsafeStorage', interfaceId: 'storage' }],
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
definition: abTestingDefinition,
|
|
18
|
-
writesAtoms: ['abTestingAtom'],
|
|
19
|
-
},
|
|
20
|
-
{ definition: abTestingPluginDefinition },
|
|
21
|
-
{ definition: abTestingApiDefinition },
|
|
22
|
-
],
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default abTesting
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const abTestingLifecyclePlugin = ({ abTesting, featureFlagAtoms }) => {
|
|
2
|
-
const onStart = async () => {
|
|
3
|
-
featureFlagAtoms.abTesting?.get().then(({ isOn }) => {
|
|
4
|
-
if (!isOn) return
|
|
5
|
-
abTesting.load()
|
|
6
|
-
})
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const onClear = async () => {
|
|
10
|
-
await abTesting.clear()
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return { onStart, onClear }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
id: 'abTestingLifecyclePlugin',
|
|
18
|
-
type: 'plugin',
|
|
19
|
-
factory: abTestingLifecyclePlugin,
|
|
20
|
-
dependencies: ['abTesting', 'featureFlagAtoms'],
|
|
21
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const createAddressProviderApi = ({ addressProvider }) => ({
|
|
2
|
-
addressProvider: {
|
|
3
|
-
getAddress: addressProvider.getAddress.bind(addressProvider),
|
|
4
|
-
getSupportedPurposes: addressProvider.getSupportedPurposes.bind(addressProvider),
|
|
5
|
-
getReceiveAddress: addressProvider.getReceiveAddress.bind(addressProvider),
|
|
6
|
-
},
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
id: 'addressProviderApi',
|
|
11
|
-
type: 'api',
|
|
12
|
-
factory: createAddressProviderApi,
|
|
13
|
-
dependencies: ['addressProvider'],
|
|
14
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import createAddressProviderDependencies from '@exodus/address-provider'
|
|
2
|
-
|
|
3
|
-
import { withType } from '../../dependencies/utils'
|
|
4
|
-
import addressProviderApi from './api'
|
|
5
|
-
|
|
6
|
-
const addressProvider = ({ config }) => {
|
|
7
|
-
const dependencies = createAddressProviderDependencies(config).map(withType('module'))
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
id: 'addressProvider',
|
|
11
|
-
definitions: [...dependencies, { definition: addressProviderApi }],
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default addressProvider
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { apyRatesAtomDefinition } from '@exodus/apy-rates/atoms'
|
|
2
|
-
import apyRatesMonitorDefinition from '@exodus/apy-rates/monitor'
|
|
3
|
-
|
|
4
|
-
import apyRatesPlugin from './plugin'
|
|
5
|
-
|
|
6
|
-
const apyRates = () => {
|
|
7
|
-
return {
|
|
8
|
-
id: 'apyRates',
|
|
9
|
-
definitions: [
|
|
10
|
-
{
|
|
11
|
-
definition: apyRatesMonitorDefinition,
|
|
12
|
-
writesAtoms: ['apyRatesAtom'],
|
|
13
|
-
},
|
|
14
|
-
{ definition: apyRatesAtomDefinition },
|
|
15
|
-
{ definition: apyRatesPlugin },
|
|
16
|
-
],
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default apyRates
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const createApyRatesLifecyclePlugin = ({ apyRatesMonitor }) => {
|
|
2
|
-
const onUnlock = () => {
|
|
3
|
-
apyRatesMonitor.start()
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
return { onUnlock }
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
id: 'apyRatesLifecyclePlugin',
|
|
11
|
-
type: 'plugin',
|
|
12
|
-
factory: createApyRatesLifecyclePlugin,
|
|
13
|
-
dependencies: ['apyRatesMonitor'],
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { cryptoNewsAtomDefinition } from '@exodus/crypto-news-monitor/atoms'
|
|
2
|
-
import cryptoNewsMonitorDefinition from '@exodus/crypto-news-monitor/monitor'
|
|
3
|
-
|
|
4
|
-
import cryptoNewsPluginDefinition from './plugin'
|
|
5
|
-
|
|
6
|
-
const cryptoNews = () => {
|
|
7
|
-
return {
|
|
8
|
-
id: 'cryptoNews',
|
|
9
|
-
definitions: [
|
|
10
|
-
{ definition: cryptoNewsAtomDefinition },
|
|
11
|
-
{
|
|
12
|
-
definition: cryptoNewsMonitorDefinition,
|
|
13
|
-
writesAtoms: ['cryptoNewsAtom'],
|
|
14
|
-
},
|
|
15
|
-
{ definition: cryptoNewsPluginDefinition },
|
|
16
|
-
],
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default cryptoNews
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const cryptoNewsPlugin = ({ cryptoNewsMonitor, featureFlagAtoms }) => {
|
|
2
|
-
const onUnlock = () => {
|
|
3
|
-
featureFlagAtoms.cryptoNews?.get().then(({ isOn }) => {
|
|
4
|
-
if (!isOn) return
|
|
5
|
-
cryptoNewsMonitor.start()
|
|
6
|
-
})
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return { onUnlock }
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
id: 'cryptoNewsLifecyclePlugin',
|
|
14
|
-
type: 'plugin',
|
|
15
|
-
factory: cryptoNewsPlugin,
|
|
16
|
-
dependencies: ['cryptoNewsMonitor', 'featureFlagAtoms'],
|
|
17
|
-
}
|
package/src/modules/kyc/api.js
DELETED
package/src/modules/kyc/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { kycAtomDefinition } from '@exodus/kyc/atoms'
|
|
2
|
-
import kycDefinition from '@exodus/kyc/module'
|
|
3
|
-
|
|
4
|
-
import kycApi from './api'
|
|
5
|
-
import kycPlugin from './plugin'
|
|
6
|
-
|
|
7
|
-
const kyc = () => {
|
|
8
|
-
return {
|
|
9
|
-
id: 'kyc',
|
|
10
|
-
definitions: [
|
|
11
|
-
{ definition: kycAtomDefinition },
|
|
12
|
-
{ definition: kycDefinition, writesAtoms: ['kycAtom'] },
|
|
13
|
-
{ definition: kycPlugin },
|
|
14
|
-
{ definition: kycApi },
|
|
15
|
-
],
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default kyc
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const kycPlugin = ({ kyc, featureFlagAtoms }) => {
|
|
2
|
-
const onUnlock = () => {
|
|
3
|
-
featureFlagAtoms.referrals?.get().then(({ isOn }) => {
|
|
4
|
-
if (!isOn) return
|
|
5
|
-
kyc.load()
|
|
6
|
-
})
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const onUnload = () => {
|
|
10
|
-
kyc.stop()
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return { onUnlock, onUnload }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
id: 'kycLifecyclePlugin',
|
|
18
|
-
type: 'plugin',
|
|
19
|
-
factory: kycPlugin,
|
|
20
|
-
dependencies: ['kyc', 'featureFlagAtoms'],
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { topMoversAtomDefinition } from '@exodus/top-movers-monitor/atoms'
|
|
2
|
-
import localTopMoversMonitorDefinition from '@exodus/top-movers-monitor/monitor/local'
|
|
3
|
-
import remoteTopMoversMonitorDefinition from '@exodus/top-movers-monitor/monitor/remote'
|
|
4
|
-
|
|
5
|
-
import topMoversPlugin from './plugin'
|
|
6
|
-
|
|
7
|
-
const topMovers = ({ config }) => {
|
|
8
|
-
return {
|
|
9
|
-
id: 'topMovers',
|
|
10
|
-
definitions: [
|
|
11
|
-
{ definition: topMoversAtomDefinition },
|
|
12
|
-
{
|
|
13
|
-
definition: config.computeLocally
|
|
14
|
-
? localTopMoversMonitorDefinition
|
|
15
|
-
: remoteTopMoversMonitorDefinition,
|
|
16
|
-
writesAtoms: ['topMoversAtom'],
|
|
17
|
-
},
|
|
18
|
-
{ definition: topMoversPlugin },
|
|
19
|
-
],
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default topMovers
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const createTopMoversLifecyclePlugin = ({ topMoversMonitor, featureFlagAtoms }) => {
|
|
2
|
-
const onUnlock = () => {
|
|
3
|
-
featureFlagAtoms.topMovers?.get().then(({ isOn }) => {
|
|
4
|
-
if (!isOn) return
|
|
5
|
-
topMoversMonitor.start()
|
|
6
|
-
})
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return { onUnlock }
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
id: 'topMoversLifecyclePlugin',
|
|
14
|
-
type: 'plugin',
|
|
15
|
-
factory: createTopMoversLifecyclePlugin,
|
|
16
|
-
dependencies: ['topMoversMonitor', 'featureFlagAtoms'],
|
|
17
|
-
}
|