@exodus/solana-api 3.30.10 → 3.30.11
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 +2 -2
- package/src/create-unsigned-tx-for-send.js +19 -7
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
|
+
## [3.30.11](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.30.10...@exodus/solana-api@3.30.11) (2026-04-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix(solana-api): use sender-only rent check for Solana undelegate/withdraw (#7797)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [3.30.10](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.30.9...@exodus/solana-api@3.30.10) (2026-04-13)
|
|
7
17
|
|
|
8
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "3.30.
|
|
3
|
+
"version": "3.30.11",
|
|
4
4
|
"description": "Transaction monitors, fee monitors, RPC with the blockchain node, and other networking code for Solana",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@exodus/assets-testing": "^1.0.0",
|
|
50
50
|
"@exodus/solana-web3.js": "^1.63.1-exodus.9-rc3"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "a768579908694286d0f969b52412bb09eb0c6d3c",
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
|
|
55
55
|
},
|
|
@@ -315,19 +315,31 @@ export const createTxFactory = ({ assetClientInterface, api, feePayerClient }) =
|
|
|
315
315
|
// differentiate between SOL and Solana token
|
|
316
316
|
let isEnoughForRent = false
|
|
317
317
|
if (asset.name === baseAsset.name && !nft) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
318
|
+
if (['undelegate', 'withdraw'].includes(method)) {
|
|
319
|
+
// get-fees sets `amount` to aggregate stake balances for fee simulation; undelegate /
|
|
320
|
+
// withdraw txs do not debit that amount from the main wallet (see solana-lib
|
|
321
|
+
// Transaction.undelegate / Transaction.withdraw). Only ensure fee + sender rent-exempt min.
|
|
322
|
+
isEnoughForRent = baseAssetBalance.sub(calculatedFee).gte(senderRentExemptAmount)
|
|
323
|
+
} else {
|
|
324
|
+
// sending SOL (transfer, delegate, …)
|
|
325
|
+
const rentExemptValue = await api.getRentExemptionMinAmount(toAddress)
|
|
326
|
+
const rentExemptAmount = baseAsset.currency.baseUnit(rentExemptValue)
|
|
327
|
+
const remaining = baseAssetBalance.sub(calculatedFee).sub(amount).clampLowerZero()
|
|
328
|
+
isEnoughForRent =
|
|
329
|
+
amount.gte(rentExemptAmount) && (remaining.isZero || remaining.gte(rentExemptAmount))
|
|
330
|
+
}
|
|
324
331
|
} else {
|
|
325
332
|
// sending token/nft
|
|
326
333
|
isEnoughForRent = baseAssetBalance.sub(calculatedFee).gte(senderRentExemptAmount)
|
|
327
334
|
}
|
|
328
335
|
|
|
329
336
|
if (!isEnoughForRent) {
|
|
330
|
-
const
|
|
337
|
+
const isSolSendStyleRentCheck =
|
|
338
|
+
asset.name === baseAsset.name && !nft && !['undelegate', 'withdraw'].includes(method)
|
|
339
|
+
const message = isSolSendStyleRentCheck
|
|
340
|
+
? 'Sending SOL amount is too low to cover the rent exemption fee.'
|
|
341
|
+
: 'Not enough SOL to pay the network fee and keep your wallet rent-exempt.'
|
|
342
|
+
const err = new Error(message)
|
|
331
343
|
err.rentExemptAmount = true
|
|
332
344
|
throw err
|
|
333
345
|
}
|