@exodus/headless 2.0.0-alpha.67 → 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 +10 -0
- package/package.json +3 -3
- package/src/index.js +1 -1
- package/src/features/blockchain-metadata/api.js +0 -23
- package/src/features/blockchain-metadata/index.js +0 -20
- package/src/features/blockchain-metadata/plugin.js +0 -31
- package/src/features/blockchain-metadata/utils.js +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
|
|
6
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)
|
|
7
17
|
|
|
8
18
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/headless",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
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": "^
|
|
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",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"nock": "^13.3.1",
|
|
91
91
|
"p-defer": "^4.0.0"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "c6b392bf753bee6a7269992e5898ff067dc32b9c"
|
|
94
94
|
}
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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'
|
|
5
6
|
import restoreProgressTracker from '@exodus/restore-progress-tracker'
|
|
@@ -11,7 +12,6 @@ import attachAtoms from './atoms/attach'
|
|
|
11
12
|
import { atomsToAttach } from './constants'
|
|
12
13
|
import availableAssets from './features/available-assets'
|
|
13
14
|
import balances from './features/balances'
|
|
14
|
-
import blockchainMetadata from './features/blockchain-metadata'
|
|
15
15
|
import enabledAssets from './features/enabled-assets'
|
|
16
16
|
import featureFlags from './features/feature-flags'
|
|
17
17
|
import fees from './features/fees'
|
|
@@ -1,23 +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
|
-
// eslint-disable-next-line @exodus/export-default/named
|
|
18
|
-
export default {
|
|
19
|
-
id: 'createBlockchainMetadataApi',
|
|
20
|
-
type: 'api',
|
|
21
|
-
factory: createBlockchainMetadataApi,
|
|
22
|
-
dependencies: ['blockchainMetadata'],
|
|
23
|
-
}
|
|
@@ -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,31 +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
|
-
// eslint-disable-next-line @exodus/export-default/named
|
|
26
|
-
export default {
|
|
27
|
-
id: 'blockchainLifecyclePlugin',
|
|
28
|
-
type: 'plugin',
|
|
29
|
-
factory: blockchainLifecyclePlugin,
|
|
30
|
-
dependencies: ['blockchainMetadata', 'port'],
|
|
31
|
-
}
|
|
@@ -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
|
-
}
|