@exodus/solana-api 3.20.2 → 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 +24 -0
- package/package.json +3 -3
- package/src/create-unsigned-tx-for-send.js +22 -6
- package/src/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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
|
+
|
|
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)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
* fix: SOL add multi-dex swap tests (#5927)
|
|
25
|
+
|
|
26
|
+
* fix: SOL move funds (#5935)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [3.20.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.20.1...@exodus/solana-api@3.20.2) (2025-06-17)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @exodus/solana-api
|
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
|
},
|
|
@@ -9,8 +9,10 @@ import {
|
|
|
9
9
|
TOKEN_PROGRAM_ID,
|
|
10
10
|
verifyOnlyFeePayerChanged,
|
|
11
11
|
} from '@exodus/solana-lib'
|
|
12
|
+
import assert from 'minimalistic-assert'
|
|
12
13
|
|
|
13
14
|
const CU_FOR_COMPUTE_BUDGET_INSTRUCTIONS = 300
|
|
15
|
+
const TOKEN_ACCOUNT_CREATION_SIZE = 165 // size of the token account
|
|
14
16
|
|
|
15
17
|
export const createUnsignedTxForSend = async ({
|
|
16
18
|
api,
|
|
@@ -46,7 +48,11 @@ export const createUnsignedTxForSend = async ({
|
|
|
46
48
|
metadataAddress,
|
|
47
49
|
creators,
|
|
48
50
|
// </MagicEden>
|
|
51
|
+
isExchange,
|
|
49
52
|
}) => {
|
|
53
|
+
assert(api, 'api is required')
|
|
54
|
+
assert(asset, 'asset is required')
|
|
55
|
+
assert(feeData, 'feeData is required')
|
|
50
56
|
let tokenParams = Object.create(null)
|
|
51
57
|
const baseAsset = asset.baseAsset
|
|
52
58
|
|
|
@@ -195,12 +201,22 @@ export const createUnsignedTxForSend = async ({
|
|
|
195
201
|
|
|
196
202
|
unsignedTx.txMeta.stakingParams = stakingParams
|
|
197
203
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
.
|
|
203
|
-
|
|
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)
|
|
204
220
|
|
|
205
221
|
// serialization friendlier
|
|
206
222
|
unsignedTx.txMeta.fee = fee.toBaseNumber()
|
package/src/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { createAndBroadcastTXFactory } from './tx-send.js'
|
|
|
17
17
|
export { getBalancesFactory } from './get-balances.js'
|
|
18
18
|
export { getFeeAsyncFactory } from './get-fees.js'
|
|
19
19
|
export { stakingProviderClientFactory } from './staking-provider-client.js'
|
|
20
|
+
export { createUnsignedTxForSend } from './create-unsigned-tx-for-send.js'
|
|
20
21
|
|
|
21
22
|
// These are not the same asset objects as the wallet creates, so they should never be returned to the wallet.
|
|
22
23
|
// Initially this may be violated by the Solana code until the first monitor tick updates assets with setTokens()
|