@exodus/solana-api 3.21.0 → 3.22.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 +1 -1
- package/src/get-fees.js +8 -5
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.22.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.21.0...@exodus/solana-api@3.22.0) (2025-10-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: solana update fee as zero with usedFeePayer (#6702)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [3.21.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.20.10...@exodus/solana-api@3.21.0) (2025-10-14)
|
|
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.22.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": "5b5f2c1945d66ef1f0481e1822afc730dc5261d4",
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
|
|
55
55
|
},
|
|
@@ -51,7 +51,7 @@ export const createTxFactory = ({ assetClientInterface, api, feePayerClient }) =
|
|
|
51
51
|
creators,
|
|
52
52
|
// </MagicEden>
|
|
53
53
|
isExchange,
|
|
54
|
-
useFeePayer,
|
|
54
|
+
useFeePayer = true,
|
|
55
55
|
}) => {
|
|
56
56
|
assert(asset, 'asset is required')
|
|
57
57
|
assert(walletAccount, 'walletAccount is required')
|
package/src/get-fees.js
CHANGED
|
@@ -19,12 +19,10 @@ export const getFeeAsyncFactory = ({ createTx }) => {
|
|
|
19
19
|
|
|
20
20
|
if (providedUnsignedTx) {
|
|
21
21
|
unsignedTx = providedUnsignedTx
|
|
22
|
-
fee = asset.feeAsset.currency.baseUnit(unsignedTx.txMeta.fee)
|
|
23
22
|
} else {
|
|
24
23
|
if (['delegate', 'undelegate', 'withdraw'].includes(method)) {
|
|
25
24
|
assert(stakingInfo, 'stakingInfo is required for staking txs')
|
|
26
25
|
assert(rest.fromAddress, 'fromAddress is required for staking txs')
|
|
27
|
-
assert(feeData, 'feeData is required for staking txs')
|
|
28
26
|
|
|
29
27
|
// staking params
|
|
30
28
|
rest.method = method
|
|
@@ -59,16 +57,21 @@ export const getFeeAsyncFactory = ({ createTx }) => {
|
|
|
59
57
|
toAddress: toAddress ?? rest.fromAddress,
|
|
60
58
|
...rest,
|
|
61
59
|
})
|
|
62
|
-
|
|
63
|
-
fee = asset.feeAsset.currency.baseUnit(unsignedTx.txMeta.fee)
|
|
64
60
|
} catch (err) {
|
|
65
61
|
console.log('error computing right SOL fee:', err)
|
|
66
62
|
// simulating a tx will fail if the user has not enough balance
|
|
67
63
|
// we fallback to a default fee (but we could leave some dust)
|
|
68
|
-
fee = asset.feeAsset.currency.defaultUnit(DEFAULT_SAFE_FEE)
|
|
69
64
|
}
|
|
70
65
|
}
|
|
71
66
|
|
|
67
|
+
if (unsignedTx?.txMeta?.fee) {
|
|
68
|
+
fee = unsignedTx.txMeta.usedFeePayer
|
|
69
|
+
? asset.feeAsset.currency.ZERO
|
|
70
|
+
: asset.feeAsset.currency.baseUnit(unsignedTx.txMeta.fee)
|
|
71
|
+
} else {
|
|
72
|
+
fee = asset.feeAsset.currency.defaultUnit(DEFAULT_SAFE_FEE)
|
|
73
|
+
}
|
|
74
|
+
|
|
72
75
|
return { fee, unsignedTx }
|
|
73
76
|
}
|
|
74
77
|
}
|