@exodus/solana-api 3.20.3 → 3.20.4
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 +12 -0
- package/package.json +3 -3
- package/src/create-unsigned-tx-for-send.js +18 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.20.4](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.20.3...@exodus/solana-api@3.20.4) (2025-07-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: add token creation fee for new token account (#5977)
|
|
13
|
+
|
|
14
|
+
* fix: remove unused gradientCoords from meta and validation (#5937)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [3.20.3](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.20.2...@exodus/solana-api@3.20.3) (2025-06-25)
|
|
7
19
|
|
|
8
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "3.20.
|
|
3
|
+
"version": "3.20.4",
|
|
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",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"url-join": "^4.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@exodus/asset": "^2.0.
|
|
45
|
+
"@exodus/asset": "^2.0.3",
|
|
46
46
|
"@exodus/assets-testing": "^1.0.0",
|
|
47
47
|
"@exodus/solana-web3.js": "^1.63.1-exodus.9-rc3"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "3ce3cad33597f430b7c215fced6d19344fc05c69",
|
|
50
50
|
"bugs": {
|
|
51
51
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
|
|
52
52
|
},
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import assert from 'minimalistic-assert'
|
|
13
13
|
|
|
14
14
|
const CU_FOR_COMPUTE_BUDGET_INSTRUCTIONS = 300
|
|
15
|
+
const TOKEN_ACCOUNT_CREATION_SIZE = 165 // size of the token account
|
|
15
16
|
|
|
16
17
|
export const createUnsignedTxForSend = async ({
|
|
17
18
|
api,
|
|
@@ -47,6 +48,7 @@ export const createUnsignedTxForSend = async ({
|
|
|
47
48
|
metadataAddress,
|
|
48
49
|
creators,
|
|
49
50
|
// </MagicEden>
|
|
51
|
+
isExchange,
|
|
50
52
|
}) => {
|
|
51
53
|
assert(api, 'api is required')
|
|
52
54
|
assert(asset, 'asset is required')
|
|
@@ -199,12 +201,22 @@ export const createUnsignedTxForSend = async ({
|
|
|
199
201
|
|
|
200
202
|
unsignedTx.txMeta.stakingParams = stakingParams
|
|
201
203
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
.
|
|
207
|
-
|
|
204
|
+
// we add token account creation fee
|
|
205
|
+
let tokenCreationFee = asset.feeAsset.currency.ZERO
|
|
206
|
+
if (isToken && (!unsignedTx.txData.isAssociatedTokenAccountActive || isExchange)) {
|
|
207
|
+
tokenCreationFee = asset.feeAsset.currency.baseUnit(
|
|
208
|
+
await api.getMinimumBalanceForRentExemption(TOKEN_ACCOUNT_CREATION_SIZE)
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const fee = feeData.baseFee
|
|
213
|
+
.add(
|
|
214
|
+
asset.feeAsset.currency
|
|
215
|
+
.baseUnit(unsignedTx.txData.priorityFee ?? 0)
|
|
216
|
+
.mul(unsignedTx.txData.computeUnits ?? 0)
|
|
217
|
+
.div(1_000_000) // micro lamports to lamports
|
|
218
|
+
)
|
|
219
|
+
.add(tokenCreationFee)
|
|
208
220
|
|
|
209
221
|
// serialization friendlier
|
|
210
222
|
unsignedTx.txMeta.fee = fee.toBaseNumber()
|