@exodus/solana-plugin 1.28.2 → 1.29.1
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 +26 -0
- package/package.json +3 -3
- package/src/create-asset-utils.js +13 -1
- package/src/create-asset.js +6 -1
- package/src/send-validations.js +16 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,32 @@
|
|
|
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.29.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.29.0...@exodus/solana-plugin@1.29.1) (2025-12-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: check sender rent when sending SPL tokens (#7128)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.29.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.28.2...@exodus/solana-plugin@1.29.0) (2025-12-08)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* feat: add SOL WS Monitor (#7014)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
* fix: SOL fee payer integration tests (#7058)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
6
32
|
## [1.28.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.28.1...@exodus/solana-plugin@1.28.2) (2025-11-20)
|
|
7
33
|
|
|
8
34
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.1",
|
|
4
4
|
"description": "Solana plugin for Exodus SDK powered wallets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@exodus/bip44-constants": "^195.0.0",
|
|
28
28
|
"@exodus/i18n-dummy": "^1.0.0",
|
|
29
29
|
"@exodus/send-validation-model": "^1.0.0",
|
|
30
|
-
"@exodus/solana-api": "^3.
|
|
30
|
+
"@exodus/solana-api": "^3.26.0",
|
|
31
31
|
"@exodus/solana-lib": "^3.14.0",
|
|
32
32
|
"@exodus/solana-meta": "^2.3.1",
|
|
33
33
|
"@exodus/web3-solana-utils": "^2.9.0",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"type": "git",
|
|
45
45
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a7c66bb84d7c33554b9113092aaa8cbf40993c17"
|
|
48
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SolanaClarityMonitor, SolanaMonitor } from '@exodus/solana-api'
|
|
1
|
+
import { SolanaClarityMonitor, SolanaMonitor, SolanaWebsocketMonitor } from '@exodus/solana-api'
|
|
2
2
|
import assert from 'minimalistic-assert'
|
|
3
3
|
|
|
4
4
|
export const createHistoryMonitorFactory = ({
|
|
@@ -10,6 +10,7 @@ export const createHistoryMonitorFactory = ({
|
|
|
10
10
|
ticksBetweenStakeFetches,
|
|
11
11
|
includeUnparsed,
|
|
12
12
|
api,
|
|
13
|
+
wsApi,
|
|
13
14
|
txsLimit,
|
|
14
15
|
}) => {
|
|
15
16
|
assert(assetClientInterface, 'expected assetClientInterface')
|
|
@@ -20,6 +21,17 @@ export const createHistoryMonitorFactory = ({
|
|
|
20
21
|
return (args) => {
|
|
21
22
|
let monitor
|
|
22
23
|
switch (monitorType) {
|
|
24
|
+
case 'ws-clarity':
|
|
25
|
+
monitor = new SolanaWebsocketMonitor({
|
|
26
|
+
assetClientInterface,
|
|
27
|
+
interval,
|
|
28
|
+
includeUnparsed,
|
|
29
|
+
api,
|
|
30
|
+
wsApi,
|
|
31
|
+
txsLimit,
|
|
32
|
+
...args,
|
|
33
|
+
})
|
|
34
|
+
break
|
|
23
35
|
case 'clarity':
|
|
24
36
|
monitor = new SolanaClarityMonitor({
|
|
25
37
|
assetClientInterface,
|
package/src/create-asset.js
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
getBalancesFactory,
|
|
12
12
|
getFeeAsyncFactory,
|
|
13
13
|
isSolanaRewardsActivityTx,
|
|
14
|
+
WsApi,
|
|
14
15
|
} from '@exodus/solana-api'
|
|
15
16
|
import {
|
|
16
17
|
createFeeData,
|
|
@@ -60,7 +61,10 @@ export const createSolanaAssetFactory =
|
|
|
60
61
|
overrideCallback = ({ asset }) => asset,
|
|
61
62
|
} = {}) => {
|
|
62
63
|
const assets = connectAssetsList(assetList)
|
|
63
|
-
const serverApi =
|
|
64
|
+
const serverApi = ['ws-clarity', 'clarity'].includes(monitorType)
|
|
65
|
+
? new ClarityApi({ assets })
|
|
66
|
+
: new Api({ assets })
|
|
67
|
+
const wsApi = new WsApi({ assets })
|
|
64
68
|
|
|
65
69
|
const { name: baseAssetName } = assetList.find((asset) => asset.baseAssetName === asset.name)
|
|
66
70
|
const base = assets[baseAssetName]
|
|
@@ -197,6 +201,7 @@ export const createSolanaAssetFactory =
|
|
|
197
201
|
ticksBetweenStakeFetches,
|
|
198
202
|
includeUnparsed,
|
|
199
203
|
api: serverApi,
|
|
204
|
+
wsApi,
|
|
200
205
|
txsLimit,
|
|
201
206
|
})
|
|
202
207
|
|
package/src/send-validations.js
CHANGED
|
@@ -86,6 +86,7 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
86
86
|
isEnoughForRent = sendAmount.gte(rentExemptAmount)
|
|
87
87
|
} else {
|
|
88
88
|
// sending token
|
|
89
|
+
// check destination address rent exemption
|
|
89
90
|
isEnoughForRent = baseAssetBalance
|
|
90
91
|
.sub(fees?.fee || asset.feeAsset.currency.ZERO)
|
|
91
92
|
.gte(rentExemptAmount)
|
|
@@ -95,7 +96,7 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
95
96
|
},
|
|
96
97
|
priority: PRIORITY_LEVELS.MIDDLE,
|
|
97
98
|
|
|
98
|
-
getMessage: () => t(`
|
|
99
|
+
getMessage: () => t(`SOL amount too low. Keep at least 0.0025 SOL to cover network fees.`), // hardcoded rent exempt amount, will be refactored once we have a better solution to return async calls
|
|
99
100
|
|
|
100
101
|
field: FIELDS.ADDRESS,
|
|
101
102
|
})
|
|
@@ -109,19 +110,20 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
109
110
|
asset,
|
|
110
111
|
sendAmount,
|
|
111
112
|
fees,
|
|
112
|
-
|
|
113
|
+
baseAssetBalance,
|
|
113
114
|
fromWalletAccount,
|
|
114
115
|
}) => {
|
|
115
|
-
if (
|
|
116
|
-
!sendAmount ||
|
|
117
|
-
asset.name !== assetName ||
|
|
118
|
-
!fees ||
|
|
119
|
-
!spendableBalance ||
|
|
120
|
-
!fromWalletAccount
|
|
121
|
-
) {
|
|
116
|
+
if (!sendAmount || !fees || !baseAssetBalance || !fromWalletAccount) {
|
|
122
117
|
return
|
|
123
118
|
}
|
|
124
119
|
|
|
120
|
+
let sendingSolAmount = sendAmount
|
|
121
|
+
if (asset.name !== asset.baseAsset.name) {
|
|
122
|
+
// sending Token
|
|
123
|
+
sendingSolAmount = asset.feeAsset.currency.ZERO
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// for the sender address
|
|
125
127
|
const accountState = await assetClientInterface.getAccountState({
|
|
126
128
|
assetName,
|
|
127
129
|
walletAccount: fromWalletAccount.toString(),
|
|
@@ -132,11 +134,14 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
const rentExemptAmount = accountState.rentExemptAmount
|
|
135
|
-
|
|
137
|
+
|
|
138
|
+
const remaining = baseAssetBalance
|
|
139
|
+
.sub(fees?.fee || asset.feeAsset.currency.ZERO)
|
|
140
|
+
.sub(sendingSolAmount)
|
|
136
141
|
|
|
137
142
|
if (!remaining.isZero && remaining.lt(rentExemptAmount)) {
|
|
138
143
|
return t(
|
|
139
|
-
`You can either leave a zero balance, which will close your SOL account, or maintain a minimum balance of ${
|
|
144
|
+
`You can either leave a zero balance, which will close your SOL account, or maintain a minimum balance of ${rentExemptAmount.toDefaultString()} ${asset.displayTicker} to keep it active.`
|
|
140
145
|
)
|
|
141
146
|
}
|
|
142
147
|
},
|