@exodus/headless 2.0.0-alpha.66 → 2.0.0-alpha.68

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 CHANGED
@@ -3,6 +3,22 @@
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.68](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.67...@exodus/headless@2.0.0-alpha.68) (2023-07-13)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ - blockchainMetadata atoms (#2118)
11
+
12
+ ### Features
13
+
14
+ - blockchainMetadata atoms ([#2118](https://github.com/ExodusMovement/exodus-hydra/issues/2118)) ([e555286](https://github.com/ExodusMovement/exodus-hydra/commit/e555286189dd34ee12b3d133063f4bc24579595c))
15
+
16
+ ## [2.0.0-alpha.67](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.66...@exodus/headless@2.0.0-alpha.67) (2023-07-13)
17
+
18
+ ### Features
19
+
20
+ - use restore-progress-plugin ([#2499](https://github.com/ExodusMovement/exodus-hydra/issues/2499)) ([618f6ea](https://github.com/ExodusMovement/exodus-hydra/commit/618f6ea139e8e1c702a1a7d6af020b89c68e7d1d))
21
+
6
22
  ## [2.0.0-alpha.66](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.65...@exodus/headless@2.0.0-alpha.66) (2023-07-11)
7
23
 
8
24
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.66",
3
+ "version": "2.0.0-alpha.68",
4
4
  "description": "The platform-agnostic Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "main": "src/index.js",
@@ -32,7 +32,7 @@
32
32
  "@exodus/available-assets": "^2.0.2",
33
33
  "@exodus/balances": "^6.0.1",
34
34
  "@exodus/basic-utils": "^2.0.0",
35
- "@exodus/blockchain-metadata": "^8.1.0",
35
+ "@exodus/blockchain-metadata": "^9.0.0",
36
36
  "@exodus/config": "^7.0.0",
37
37
  "@exodus/dependency-injection": "^2.0.0",
38
38
  "@exodus/dependency-preprocessors": "^2.8.2",
@@ -49,6 +49,7 @@
49
49
  "@exodus/module": "^1.0.0",
50
50
  "@exodus/nfts": "^2.1.1",
51
51
  "@exodus/rates-monitor": "^2.0.1",
52
+ "@exodus/restore-progress-tracker": "^2.0.0",
52
53
  "@exodus/wallet": "^6.3.0",
53
54
  "@exodus/wallet-accounts": "^10.1.0",
54
55
  "@exodus/wallet-compatibility-modes": "^2.0.0",
@@ -72,7 +73,7 @@
72
73
  "@exodus/kyc": "^4.0.0",
73
74
  "@exodus/models": "^8.11.1",
74
75
  "@exodus/personal-notes": "^3.3.0",
75
- "@exodus/referrals": "^6.1.0",
76
+ "@exodus/referrals": "^6.2.0",
76
77
  "@exodus/solana-lib": "^1.3.11",
77
78
  "@exodus/solana-meta": "^1.0.2",
78
79
  "@exodus/storage-encrypted": "^1.1.2",
@@ -89,5 +90,5 @@
89
90
  "nock": "^13.3.1",
90
91
  "p-defer": "^4.0.0"
91
92
  },
92
- "gitHead": "256c443f5127255391693d9e4c8c1673ac4f0b52"
93
+ "gitHead": "c6b392bf753bee6a7269992e5898ff067dc32b9c"
93
94
  }
@@ -29,6 +29,7 @@ const createBaseAssetNamesToMonitorAtom = ({
29
29
  })
30
30
  }
31
31
 
32
+ // eslint-disable-next-line @exodus/export-default/named
32
33
  export default {
33
34
  id: 'baseAssetNamesToMonitorAtom',
34
35
  type: 'atom',
package/src/constants.js CHANGED
@@ -16,6 +16,7 @@ export const atomsToAttach = [
16
16
  'referralsAtom',
17
17
  'topMoversAtom',
18
18
  'walletAccountsAtom',
19
+ 'restoringAssetsAtom',
19
20
  ]
20
21
 
21
22
  export const LifecycleHook = Object.freeze({
@@ -10,6 +10,7 @@ const enabledAssetsApi = ({ enabledAssets, assetsModule }) => ({
10
10
  },
11
11
  })
12
12
 
13
+ // eslint-disable-next-line @exodus/export-default/named
13
14
  export default {
14
15
  id: 'enabledAssetsApi',
15
16
  type: 'api',
@@ -10,6 +10,7 @@ const createEnabledAssetsLifecyclePlugin = ({ enabledAssets }) => {
10
10
  return { onUnlock, onClear }
11
11
  }
12
12
 
13
+ // eslint-disable-next-line @exodus/export-default/named
13
14
  export default {
14
15
  id: 'enabledAssetsLifecyclePlugin',
15
16
  type: 'plugin',
@@ -6,6 +6,7 @@ const featureFlagsApi = ({ featureFlagAtoms }) => ({
6
6
  },
7
7
  })
8
8
 
9
+ // eslint-disable-next-line @exodus/export-default/named
9
10
  export default {
10
11
  id: 'featureFlagsApi',
11
12
  type: 'api',
@@ -10,6 +10,7 @@ const createFeatureFlagsLifecyclePlugin = ({ featureFlags }) => {
10
10
  return { onStart, onClear }
11
11
  }
12
12
 
13
+ // eslint-disable-next-line @exodus/export-default/named
13
14
  export default {
14
15
  id: 'featureFlagsLifecyclePlugin',
15
16
  type: 'plugin',
@@ -9,6 +9,7 @@ const createFeesLifecyclePlugin = ({ feeMonitors, port }) => {
9
9
  return { onUnlock }
10
10
  }
11
11
 
12
+ // eslint-disable-next-line @exodus/export-default/named
12
13
  export default {
13
14
  id: 'feesLifecyclePlugin',
14
15
  type: 'plugin',
@@ -6,6 +6,7 @@ const createGeolocationLifecyclePlugin = ({ geolocationMonitor }) => {
6
6
  return { onStart }
7
7
  }
8
8
 
9
+ // eslint-disable-next-line @exodus/export-default/named
9
10
  export default {
10
11
  id: 'geolocationLifecyclePlugin',
11
12
  type: 'plugin',
@@ -5,6 +5,7 @@ const localeApi = ({ languageAtom, currencyAtom }) => ({
5
5
  },
6
6
  })
7
7
 
8
+ // eslint-disable-next-line @exodus/export-default/named
8
9
  export default {
9
10
  id: 'localeApi',
10
11
  type: 'api',
@@ -6,6 +6,7 @@ const localePlugin = ({ languageAtom }) => {
6
6
  return { onClear }
7
7
  }
8
8
 
9
+ // eslint-disable-next-line @exodus/export-default/named
9
10
  export default {
10
11
  id: 'localeLifecyclePlugin',
11
12
  type: 'plugin',
@@ -5,6 +5,7 @@ const createNftsApi = ({ nfts, nftsMonitor }) => ({
5
5
  },
6
6
  })
7
7
 
8
+ // eslint-disable-next-line @exodus/export-default/named
8
9
  export default {
9
10
  id: 'createNftsApi',
10
11
  type: 'api',
@@ -15,6 +15,7 @@ const nftsLifecyclePlugin = ({ nfts, nftsMonitor, port }) => {
15
15
  return { onUnlock, onClear }
16
16
  }
17
17
 
18
+ // eslint-disable-next-line @exodus/export-default/named
18
19
  export default {
19
20
  id: 'nftsLifecyclePlugin',
20
21
  type: 'plugin',
@@ -6,6 +6,7 @@ const pricingApi = ({ pricingClient }) => ({
6
6
  },
7
7
  })
8
8
 
9
+ // eslint-disable-next-line @exodus/export-default/named
9
10
  export default {
10
11
  id: 'pricingApi',
11
12
  type: 'api',
@@ -4,6 +4,7 @@ const ratesApi = ({ ratesMonitor }) => ({
4
4
  },
5
5
  })
6
6
 
7
+ // eslint-disable-next-line @exodus/export-default/named
7
8
  export default {
8
9
  id: 'ratesApi',
9
10
  type: 'api',
@@ -9,6 +9,7 @@ const createRatesLifecyclePlugin = ({ ratesMonitor, port }) => {
9
9
  return { onUnlock }
10
10
  }
11
11
 
12
+ // eslint-disable-next-line @exodus/export-default/named
12
13
  export default {
13
14
  id: 'ratesLifecyclePlugin',
14
15
  type: 'plugin',
@@ -5,6 +5,7 @@ const createRemoteConfigApi = ({ remoteConfig }) => ({
5
5
  },
6
6
  })
7
7
 
8
+ // eslint-disable-next-line @exodus/export-default/named
8
9
  export default {
9
10
  id: 'createRemoteConfigApi',
10
11
  type: 'api',
@@ -12,6 +12,7 @@ const remoteConfigLifecyclePlugin = ({ remoteConfig, port }) => {
12
12
  return { onUnlock, onStart }
13
13
  }
14
14
 
15
+ // eslint-disable-next-line @exodus/export-default/named
15
16
  export default {
16
17
  id: 'remoteConfigLifecyclePlugin',
17
18
  type: 'plugin',
package/src/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import addressProvider from '@exodus/address-provider'
2
2
  import { pick } from '@exodus/basic-utils'
3
+ import blockchainMetadata from '@exodus/blockchain-metadata'
3
4
  import keychain from '@exodus/keychain'
4
5
  import marketHistory from '@exodus/market-history'
6
+ import restoreProgressTracker from '@exodus/restore-progress-tracker'
5
7
  import wallet from '@exodus/wallet'
6
8
  import walletAccounts from '@exodus/wallet-accounts'
7
9
 
@@ -10,7 +12,6 @@ import attachAtoms from './atoms/attach'
10
12
  import { atomsToAttach } from './constants'
11
13
  import availableAssets from './features/available-assets'
12
14
  import balances from './features/balances'
13
- import blockchainMetadata from './features/blockchain-metadata'
14
15
  import enabledAssets from './features/enabled-assets'
15
16
  import featureFlags from './features/feature-flags'
16
17
  import fees from './features/fees'
@@ -44,6 +45,7 @@ const createExodus = ({ adapters, config, port }) => {
44
45
  ioc.use(locale())
45
46
  ioc.use(nfts())
46
47
  ioc.use(addressProvider({ config: config.addressProvider }))
48
+ ioc.use(restoreProgressTracker())
47
49
 
48
50
  ioc.register({ definition: { id: 'port', type: 'port', factory: () => port } })
49
51
 
@@ -78,7 +80,9 @@ const createExodus = ({ adapters, config, port }) => {
78
80
 
79
81
  application.on('restore', () => port.emit('restore'))
80
82
 
81
- application.on('restore-completed', () => port.emit('restore-completed'))
83
+ application.on('restore-completed', () => {
84
+ port.emit('restore-completed')
85
+ })
82
86
 
83
87
  application.on('change-passphrase', () => port.emit('passphrase-changed'))
84
88
 
@@ -12,6 +12,7 @@ const createUnlockEncryptedStorage = ({ keychain }) => {
12
12
  }
13
13
  }
14
14
 
15
+ // eslint-disable-next-line @exodus/export-default/named
15
16
  export default {
16
17
  id: 'unlockEncryptedStorage',
17
18
  type: 'module',
@@ -1,22 +0,0 @@
1
- const createBlockchainMetadataApi = ({ blockchainMetadata }) => ({
2
- blockchainMetadata: {
3
- getTxLog: blockchainMetadata.getTxLog,
4
- getLoadedTxLogs: blockchainMetadata.getLoadedTxLogs,
5
- updateTxs: blockchainMetadata.updateTxs,
6
- overwriteTxs: blockchainMetadata.overwriteTxs,
7
- clearTxs: blockchainMetadata.clearTxs,
8
- removeTxs: blockchainMetadata.removeTxs,
9
- getAccountState: blockchainMetadata.getAccountState,
10
- getLoadedAccountStates: blockchainMetadata.getLoadedAccountStates,
11
- updateAccountState: blockchainMetadata.updateAccountState,
12
- removeAccountState: blockchainMetadata.removeAccountState,
13
- batch: blockchainMetadata.batch,
14
- },
15
- })
16
-
17
- export default {
18
- id: 'createBlockchainMetadataApi',
19
- type: 'api',
20
- factory: createBlockchainMetadataApi,
21
- dependencies: ['blockchainMetadata'],
22
- }
@@ -1,20 +0,0 @@
1
- import blockchainMetadataDefinition from '@exodus/blockchain-metadata/module'
2
-
3
- import blockchainMetadataApiDefinition from './api'
4
- import blockchainMetadataPluginDefinition from './plugin'
5
-
6
- const blockchainMetadata = () => {
7
- return {
8
- id: 'blockchainMetadata',
9
- definitions: [
10
- {
11
- definition: blockchainMetadataDefinition,
12
- storage: { namespace: ['blockchain', 'v1'] },
13
- },
14
- { definition: blockchainMetadataPluginDefinition },
15
- { definition: blockchainMetadataApiDefinition },
16
- ],
17
- }
18
- }
19
-
20
- export default blockchainMetadata
@@ -1,30 +0,0 @@
1
- import { createLoadWalletAccountsHandler } from './utils'
2
-
3
- const blockchainLifecyclePlugin = ({ blockchainMetadata, port }) => {
4
- const handleLoadWalletAccounts = createLoadWalletAccountsHandler({ blockchainMetadata, port })
5
-
6
- blockchainMetadata.on('load-wallet-accounts', handleLoadWalletAccounts)
7
-
8
- blockchainMetadata.on('tx-logs-update', (payload) => port.emit('tx-logs-update', payload))
9
-
10
- blockchainMetadata.on('account-states-update', (payload) =>
11
- port.emit('account-states-update', payload)
12
- )
13
-
14
- const onUnlock = async () => {
15
- await blockchainMetadata.load()
16
- }
17
-
18
- const onClear = async () => {
19
- await blockchainMetadata.clear()
20
- }
21
-
22
- return { onUnlock, onClear }
23
- }
24
-
25
- export default {
26
- id: 'blockchainLifecyclePlugin',
27
- type: 'plugin',
28
- factory: blockchainLifecyclePlugin,
29
- dependencies: ['blockchainMetadata', 'port'],
30
- }
@@ -1,11 +0,0 @@
1
- export function createLoadWalletAccountsHandler({ port, blockchainMetadata }) {
2
- return async () => {
3
- const [txLogs, accountStates] = await Promise.all([
4
- blockchainMetadata.getLoadedTxLogs(),
5
- blockchainMetadata.getLoadedAccountStates(),
6
- ])
7
-
8
- port.emit('tx-logs', txLogs)
9
- port.emit('account-states', accountStates)
10
- }
11
- }