@exodus/solana-api 3.24.1 → 3.25.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 +10 -0
- package/package.json +2 -2
- package/src/create-unsigned-tx-for-send.js +25 -22
- package/src/get-fees.js +4 -4
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.25.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.24.1...@exodus/solana-api@3.25.0) (2025-10-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: Solana skip rent validation when usedFeePayer and update fee check logic (#6797)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [3.24.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.24.0...@exodus/solana-api@3.24.1) (2025-10-29)
|
|
7
17
|
|
|
8
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.0",
|
|
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": "747fdeb31c49ca85b21904d406a589c06a3bc101",
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
|
|
55
55
|
},
|
|
@@ -296,36 +296,39 @@ export const createTxFactory = ({ assetClientInterface, api, feePayerClient }) =
|
|
|
296
296
|
)
|
|
297
297
|
.add(tokenCreationFee)
|
|
298
298
|
|
|
299
|
-
// serialization friendlier
|
|
300
299
|
unsignedTx.txMeta.fee = fee.toBaseNumber()
|
|
301
300
|
|
|
302
|
-
const rentExemptValue = await api.getRentExemptionMinAmount(toAddress)
|
|
303
|
-
const rentExemptAmount = baseAsset.currency.baseUnit(rentExemptValue)
|
|
304
|
-
|
|
305
|
-
// differentiate between SOL and Solana token
|
|
306
|
-
let isEnoughForRent = false
|
|
307
|
-
if (asset.name === baseAsset.name && !nft) {
|
|
308
|
-
// sending SOL
|
|
309
|
-
isEnoughForRent = amount.gte(rentExemptAmount)
|
|
310
|
-
} else {
|
|
311
|
-
// sending token/nft
|
|
312
|
-
const baseAssetBalance = await api.getBalance(fromAddress)
|
|
313
|
-
isEnoughForRent = baseAsset.currency
|
|
314
|
-
.baseUnit(baseAssetBalance)
|
|
315
|
-
.sub(fee || asset.feeAsset.currency.ZERO)
|
|
316
|
-
.gte(rentExemptAmount)
|
|
317
|
-
}
|
|
318
|
-
|
|
319
301
|
const tx = await maybeAddFeePayerWithAuth({
|
|
320
302
|
unsignedTx,
|
|
321
303
|
feePayerClient,
|
|
322
304
|
enableFeePayer: feeData.enableFeePayer,
|
|
323
305
|
})
|
|
324
306
|
|
|
325
|
-
if (
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
307
|
+
if (tx.txMeta.usedFeePayer) {
|
|
308
|
+
tx.txMeta.fee = asset.feeAsset.currency.ZERO
|
|
309
|
+
} else {
|
|
310
|
+
const rentExemptValue = await api.getRentExemptionMinAmount(toAddress)
|
|
311
|
+
const rentExemptAmount = baseAsset.currency.baseUnit(rentExemptValue)
|
|
312
|
+
|
|
313
|
+
// differentiate between SOL and Solana token
|
|
314
|
+
let isEnoughForRent = false
|
|
315
|
+
if (asset.name === baseAsset.name && !nft) {
|
|
316
|
+
// sending SOL
|
|
317
|
+
isEnoughForRent = amount.gte(rentExemptAmount)
|
|
318
|
+
} else {
|
|
319
|
+
// sending token/nft
|
|
320
|
+
const baseAssetBalance = await api.getBalance(fromAddress)
|
|
321
|
+
isEnoughForRent = baseAsset.currency
|
|
322
|
+
.baseUnit(baseAssetBalance)
|
|
323
|
+
.sub(fee || asset.feeAsset.currency.ZERO)
|
|
324
|
+
.gte(rentExemptAmount)
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (!isEnoughForRent) {
|
|
328
|
+
const err = new Error('Sending SOL amount is too low to cover the rent exemption fee.')
|
|
329
|
+
err.rentExemptAmount = true
|
|
330
|
+
throw err
|
|
331
|
+
}
|
|
329
332
|
}
|
|
330
333
|
|
|
331
334
|
return tx
|
package/src/get-fees.js
CHANGED
|
@@ -64,15 +64,15 @@ export const getFeeAsyncFactory = ({ createTx }) => {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
if (unsignedTx?.txMeta?.fee) {
|
|
67
|
+
if (unsignedTx?.txMeta?.fee === undefined) {
|
|
68
|
+
fee = asset.feeAsset.currency.defaultUnit(DEFAULT_SAFE_FEE)
|
|
69
|
+
} else {
|
|
68
70
|
fee = unsignedTx.txMeta.usedFeePayer
|
|
69
71
|
? asset.feeAsset.currency.ZERO
|
|
70
72
|
: asset.feeAsset.currency.baseUnit(unsignedTx.txMeta.fee)
|
|
71
|
-
} else {
|
|
72
|
-
fee = asset.feeAsset.currency.defaultUnit(DEFAULT_SAFE_FEE)
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
return { fee, unsignedTx }
|
|
75
|
+
return { fee, unsignedTx, usedFeePayer: unsignedTx?.txMeta?.usedFeePayer }
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|