@exodus/solana-plugin 1.0.7 → 1.0.8

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.js +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-plugin",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Exodus internal Solana asset plugin",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@exodus/assets": "^9.0.1",
24
24
  "@exodus/bip44-constants": "^195.0.0",
25
- "@exodus/solana-api": "^2.5.28",
25
+ "@exodus/solana-api": "^2.5.29",
26
26
  "@exodus/solana-lib": "^1.7.5",
27
27
  "@exodus/solana-meta": "^1.0.7",
28
28
  "minimalistic-assert": "^1.0.1"
@@ -30,5 +30,5 @@
30
30
  "devDependencies": {
31
31
  "@exodus/assets-testing": "file:../../../__testing__"
32
32
  },
33
- "gitHead": "e46dbfdf19c725e5e7d4aa98a9e0eac913c44ed2"
33
+ "gitHead": "7ec211abf9ccbc6b8bc84440f3bc6da659aebaaf"
34
34
  }
package/src/index.js CHANGED
@@ -12,6 +12,7 @@ import { solana as feeData } from '@exodus/solana-lib/src/fee-data'
12
12
  import assetList from '@exodus/solana-meta'
13
13
  import ms from 'ms'
14
14
  import serverApi, {
15
+ isSolanaRewardsActivityTx,
15
16
  getBalancesFactory,
16
17
  getUnstakingFee,
17
18
  SolanaMonitor,
@@ -67,6 +68,13 @@ const createAsset = ({
67
68
  const createCustomToken = ({ assetId, assetName, ...rest }) =>
68
69
  createToken({ ...rest, name: assetName, mintAddress: assetId })
69
70
 
71
+ const isSmallValueTx = (tx) =>
72
+ !tx.tokens?.length &&
73
+ !isSolanaRewardsActivityTx(tx) &&
74
+ Math.abs(tx.coinAmount.toDefaultNumber()) <= 0.000_000_001
75
+
76
+ const getActivityTxs = ({ txs }) => txs.filter((tx) => !isSmallValueTx(tx))
77
+
70
78
  const features = {
71
79
  accountState: true,
72
80
  customTokens: true,
@@ -76,6 +84,7 @@ const createAsset = ({
76
84
  }
77
85
 
78
86
  const api = {
87
+ getActivityTxs,
79
88
  addressHasHistory: (...args) => serverApi.getAccountInfo(...args).then((acc) => !!acc),
80
89
  broadcastTx: (...args) => serverApi.broadcastTransaction(...args),
81
90
  createAccountState: () => SolanaAccountState,