@exodus/solana-plugin 1.12.4 → 1.13.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 CHANGED
@@ -3,6 +3,25 @@
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
+ ## [1.13.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.12.5...@exodus/solana-plugin@1.13.0) (2024-08-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * move ME solana monitor to the ME codebase ([#3117](https://github.com/ExodusMovement/assets/issues/3117)) ([6e2b25c](https://github.com/ExodusMovement/assets/commit/6e2b25c15d5c43a775b0ab53792882f69aa5c30d))
12
+
13
+
14
+
15
+ ## [1.12.5](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.12.4...@exodus/solana-plugin@1.12.5) (2024-08-07)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * SOL lint ([#2953](https://github.com/ExodusMovement/assets/issues/2953)) ([3f1b3b8](https://github.com/ExodusMovement/assets/commit/3f1b3b8c9a1544ca7d41ac883c06e465d6928b32))
21
+ * update SOL staking api ([#3121](https://github.com/ExodusMovement/assets/issues/3121)) ([af609fc](https://github.com/ExodusMovement/assets/commit/af609fcec899da4c1a569e973cb1acca89450be6))
22
+
23
+
24
+
6
25
  ## [1.12.4](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.12.3...@exodus/solana-plugin@1.12.4) (2024-06-27)
7
26
 
8
27
  **Note:** Version bump only for package @exodus/solana-plugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-plugin",
3
- "version": "1.12.4",
3
+ "version": "1.13.0",
4
4
  "description": "Exodus internal Solana asset plugin",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -15,14 +15,14 @@
15
15
  "access": "restricted"
16
16
  },
17
17
  "scripts": {
18
- "test": "run -T jest",
18
+ "test": "run -T exodus-test --jest --esbuild",
19
19
  "lint": "run -T eslint .",
20
20
  "lint:fix": "yarn lint --fix"
21
21
  },
22
22
  "dependencies": {
23
23
  "@exodus/assets": "^9.0.1",
24
24
  "@exodus/bip44-constants": "^195.0.0",
25
- "@exodus/solana-api": "^3.8.3",
25
+ "@exodus/solana-api": "^3.10.0",
26
26
  "@exodus/solana-lib": "^3.5.0",
27
27
  "@exodus/solana-meta": "^1.0.7",
28
28
  "@exodus/web3-solana-utils": "^2.0.0",
@@ -39,5 +39,5 @@
39
39
  "type": "git",
40
40
  "url": "git+https://github.com/ExodusMovement/assets.git"
41
41
  },
42
- "gitHead": "8a78b9595437fd8fecc5b08916a98584eabde577"
42
+ "gitHead": "101deb0e348677bb19d301df54c53557a64f80fe"
43
43
  }
@@ -1,42 +1,37 @@
1
1
  import { connectAssetsList } from '@exodus/assets'
2
2
  import bip44Constants from '@exodus/bip44-constants/by-ticker'
3
3
  import {
4
+ createAccountState,
5
+ createAndBroadcastTXFactory,
6
+ getBalancesFactory,
7
+ getUnstakingFee,
8
+ isSolanaRewardsActivityTx,
9
+ SolanaAutoWithdrawMonitor,
10
+ SolanaFeeMonitor,
11
+ SolanaMonitor,
12
+ } from '@exodus/solana-api'
13
+ import {
14
+ createFeeData,
4
15
  createGetKeyIdentifier,
5
16
  getAddressFromPublicKey,
6
17
  getEncodedSecretKey,
7
18
  isValidAddress,
8
19
  prepareForSigning,
9
- signUnsignedTx,
10
- signUnsignedTxWithSigner,
11
20
  signHardware,
12
21
  signMessageNew,
13
- createFeeData,
14
22
  signMessageWithSigner,
23
+ signUnsignedTx,
24
+ signUnsignedTxWithSigner,
15
25
  } from '@exodus/solana-lib'
16
26
  import ms from 'ms'
17
- import {
18
- isSolanaRewardsActivityTx,
19
- getBalancesFactory,
20
- getUnstakingFee,
21
- SolanaMonitor,
22
- SolanaFeeMonitor,
23
- SolanaAutoWithdrawMonitor,
24
- createAccountState,
25
- createAndBroadcastTXFactory,
26
- } from '@exodus/solana-api'
27
+
27
28
  import { createGetBalanceForAddress } from './get-balance-for-address'
28
29
  import { createWeb3API } from './web3'
29
- import { MeSolanaMonitor } from '@exodus/solana-api/src/tx-log/me-solana-monitor'
30
30
 
31
31
  const DEFAULT_ACCOUNT_RESERVE = 0.01
32
32
  const DEFAULT_LOW_BALANCE = 0.01
33
33
  const DEFAULT_MIN_STAKING_AMOUNT = 0.01
34
34
 
35
- const MonitorType = {
36
- DEFAULT: 'default',
37
- ME: 'meMonitor',
38
- }
39
-
40
35
  export const createSolanaAssetFactory =
41
36
  ({ assetList, serverApi, isTestnet = false }) =>
42
37
  ({
@@ -52,7 +47,6 @@ export const createSolanaAssetFactory =
52
47
  ticksBetweenStakeFetches,
53
48
  txsLimit,
54
49
  signWithSigner = true,
55
- monitorType = MonitorType.DEFAULT,
56
50
  } = {},
57
51
  overrideCallback = ({ asset }) => asset,
58
52
  } = {}) => {
@@ -125,7 +119,7 @@ export const createSolanaAssetFactory =
125
119
  }
126
120
 
127
121
  const assetStakingApi = {
128
- isStaking: ({ accountState }) => accountState.mem.isDelegating,
122
+ isStaking: ({ accountState }) => accountState.stakingInfo.isDelegating,
129
123
  }
130
124
 
131
125
  const SolanaAccountState = createAccountState({ assetList })
@@ -139,25 +133,15 @@ export const createSolanaAssetFactory =
139
133
  createAccountState: () => SolanaAccountState,
140
134
  createFeeMonitor: (args) => new SolanaFeeMonitor({ ...args, api: serverApi }),
141
135
  createHistoryMonitor: (args) =>
142
- monitorType === MonitorType.ME
143
- ? new MeSolanaMonitor({
144
- interval: monitorInterval,
145
- ticksBetweenHistoryFetches,
146
- ticksBetweenStakeFetches,
147
- includeUnparsed,
148
- api: serverApi,
149
- txsLimit,
150
- ...args,
151
- })
152
- : new SolanaMonitor({
153
- interval: monitorInterval,
154
- ticksBetweenHistoryFetches,
155
- ticksBetweenStakeFetches,
156
- includeUnparsed,
157
- api: serverApi,
158
- txsLimit,
159
- ...args,
160
- }),
136
+ new SolanaMonitor({
137
+ interval: monitorInterval,
138
+ ticksBetweenHistoryFetches,
139
+ ticksBetweenStakeFetches,
140
+ includeUnparsed,
141
+ api: serverApi,
142
+ txsLimit,
143
+ ...args,
144
+ }),
161
145
  createToken: (tokenDef) =>
162
146
  tokenDef.isBuiltIn ? createToken(tokenDef) : createCustomToken(tokenDef),
163
147
  defaultAddressPath,
@@ -210,5 +194,20 @@ export const createSolanaAssetFactory =
210
194
  new SolanaAutoWithdrawMonitor({ ...args, assetClientInterface }),
211
195
  }
212
196
 
213
- return overrideCallback({ asset: fullAsset })
197
+ return overrideCallback({
198
+ asset: fullAsset,
199
+ config: {
200
+ stakingFeatureAvailable,
201
+ includeUnparsed,
202
+ monitorInterval,
203
+ defaultAccountReserve,
204
+ defaultLowBalance,
205
+ defaultMinStakingAmount,
206
+ ticksBetweenHistoryFetches,
207
+ ticksBetweenStakeFetches,
208
+ txsLimit,
209
+ signWithSigner,
210
+ },
211
+ serverApi,
212
+ })
214
213
  }
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import assetList from '@exodus/solana-meta'
2
1
  import serverApi from '@exodus/solana-api'
2
+ import assetList from '@exodus/solana-meta'
3
3
 
4
4
  import { createSolanaAssetFactory } from './create-asset'
5
5
 
@@ -1,8 +1,8 @@
1
- import assert from 'minimalistic-assert'
2
1
  import {
3
2
  createSimulateTransactions as createSimulateSolanaTransactions,
4
3
  deserializeTransactionBytes,
5
4
  } from '@exodus/web3-solana-utils'
5
+ import assert from 'minimalistic-assert'
6
6
 
7
7
  // This function accepts either a list of transactions created by a wallet (unsignedTxs) or a web3 transaction (transactionBuffers).
8
8
  export const createSimulateTransactions = ({ asset, assetClientInterface, prepareForSigning }) => {