@exodus/solana-api 3.30.10 → 3.30.12
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 +20 -0
- package/package.json +2 -2
- package/src/create-unsigned-tx-for-send.js +27 -8
- package/src/fee-payer.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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.12](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.30.10...@exodus/solana-api@3.30.12) (2026-04-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix(solana-api): use sender-only rent check for Solana undelegate/withdraw (#7797)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [3.30.11](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.30.10...@exodus/solana-api@3.30.11) (2026-04-14)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* fix(solana-api): use sender-only rent check for Solana undelegate/withdraw (#7797)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [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
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "3.30.
|
|
3
|
+
"version": "3.30.12",
|
|
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": "b9d3ed1f39f0337b6be02ef90b37e0646ba9c384",
|
|
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
|
}
|
|
@@ -338,7 +350,14 @@ export const createTxFactory = ({ assetClientInterface, api, feePayerClient }) =
|
|
|
338
350
|
}
|
|
339
351
|
|
|
340
352
|
export const extractTxLogData = async ({ unsignedTx, api }) => {
|
|
341
|
-
|
|
353
|
+
const hasExplicitTxLogData = ['method', 'from', 'to', 'amount'].every(
|
|
354
|
+
(field) => unsignedTx.txData[field] != null
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
if (
|
|
358
|
+
(unsignedTx.txMeta.preferExplicitTxLogFields && hasExplicitTxLogData) ||
|
|
359
|
+
!unsignedTx.txData.transactionBuffer
|
|
360
|
+
) {
|
|
342
361
|
return {
|
|
343
362
|
method: unsignedTx.txData.method,
|
|
344
363
|
from: unsignedTx.txData.from,
|
package/src/fee-payer.js
CHANGED
|
@@ -165,12 +165,20 @@ export const maybeAddFeePayerWithAuth = async ({ unsignedTx, feePayerClient }) =
|
|
|
165
165
|
const sponsoredTransaction = deserializeTransaction(newTransactionBuffer)
|
|
166
166
|
verifyOnlyFeePayerChanged(unsignedTxVersionedTransaction, sponsoredTransaction)
|
|
167
167
|
|
|
168
|
+
// For Jupiter-style swaps, `parseTxBuffer` cannot summarize the swap instructions
|
|
169
|
+
// from the serialized transaction buffer. In that case, allow downstream tx-log
|
|
170
|
+
// generation to use the explicit tx-log fields as a fallback for display only;
|
|
171
|
+
// the verified transaction buffer remains the source of truth.
|
|
172
|
+
const preferExplicitTxLogFields = unsignedTx.txData.method === 'swap'
|
|
173
|
+
|
|
168
174
|
unsignedTxWithFeePayer = {
|
|
169
175
|
txData: {
|
|
176
|
+
...unsignedTx.txData,
|
|
170
177
|
transactionBuffer: newTransactionBuffer,
|
|
171
178
|
},
|
|
172
179
|
txMeta: {
|
|
173
180
|
...unsignedTx.txMeta,
|
|
181
|
+
...(preferExplicitTxLogFields && { preferExplicitTxLogFields: true }),
|
|
174
182
|
feePayerPublicKey: result.feePayerPublicKey,
|
|
175
183
|
sponsorshipRequestId: result.requestId,
|
|
176
184
|
estimatedSponsorCost: result.estimatedCost,
|