@exodus/solana-api 3.26.2 → 3.26.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 +18 -0
- package/package.json +2 -2
- package/src/create-unsigned-tx-for-send.js +6 -11
- package/src/tx-log/ws-monitor.js +5 -1
- package/src/ws-api.js +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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.26.4](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.26.3...@exodus/solana-api@3.26.4) (2025-12-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @exodus/solana-api
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.26.3](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.26.2...@exodus/solana-api@3.26.3) (2025-12-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
* fix: solana reduce fee payer sponsorship requests (#7147)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [3.26.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.26.1...@exodus/solana-api@3.26.2) (2025-12-15)
|
|
7
25
|
|
|
8
26
|
**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.26.
|
|
3
|
+
"version": "3.26.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",
|
|
@@ -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": "632c6763bc36bb2a76e60ca1707e99a4d1f66a43",
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
|
|
55
55
|
},
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createUnsignedTx,
|
|
3
|
-
deserializeTransaction,
|
|
4
3
|
findAssociatedTokenAddress,
|
|
5
4
|
parseTxBuffer,
|
|
6
5
|
prepareForSigning,
|
|
@@ -181,20 +180,18 @@ export const createTxFactory = ({ assetClientInterface, api, feePayerClient }) =
|
|
|
181
180
|
...magicEdenParams,
|
|
182
181
|
})
|
|
183
182
|
|
|
183
|
+
unsignedTx.txMeta.stakingParams = stakingParams
|
|
184
|
+
|
|
184
185
|
const resolveUnitConsumed = async () => {
|
|
185
186
|
// this avoids unnecessary simulations. Also the simulation fails with InsufficientFundsForRent when sending all.
|
|
186
187
|
if (asset.name === asset.baseAsset.name && amount && !nft && !method) {
|
|
187
188
|
return 150 + CU_FOR_COMPUTE_BUDGET_INSTRUCTIONS
|
|
188
189
|
}
|
|
189
190
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
})
|
|
195
|
-
const message = transactionForFeeEstimation.txMeta.usedFeePayer
|
|
196
|
-
? deserializeTransaction(transactionForFeeEstimation.txData.transactionBuffer).message
|
|
197
|
-
: prepareForSigning(transactionForFeeEstimation).message
|
|
191
|
+
// Simulate with unsigned transaction. The fee payer service is deterministic -
|
|
192
|
+
// same input always produces same output. Any variance from SetAuthority
|
|
193
|
+
// instructions added by fee payer is covered by computeUnitsMultiplier.
|
|
194
|
+
const { message } = prepareForSigning(unsignedTx)
|
|
198
195
|
|
|
199
196
|
const { unitsConsumed, err } = await api.simulateUnsignedTransaction({
|
|
200
197
|
message,
|
|
@@ -218,8 +215,6 @@ export const createTxFactory = ({ assetClientInterface, api, feePayerClient }) =
|
|
|
218
215
|
unsignedTx.txData.computeUnits = computeUnits
|
|
219
216
|
}
|
|
220
217
|
|
|
221
|
-
unsignedTx.txMeta.stakingParams = stakingParams
|
|
222
|
-
|
|
223
218
|
// we add token account creation fee
|
|
224
219
|
let tokenCreationFee = asset.feeAsset.currency.ZERO
|
|
225
220
|
if (isToken && (!unsignedTx.txData.isAssociatedTokenAccountActive || isExchange)) {
|
package/src/tx-log/ws-monitor.js
CHANGED
|
@@ -114,13 +114,17 @@ export class SolanaWebsocketMonitor extends SolanaClarityMonitor {
|
|
|
114
114
|
|
|
115
115
|
// subscribe to new tokenAccounts
|
|
116
116
|
for (const mintAddress of unknownTokensList) {
|
|
117
|
-
await this.wsApi.accountSubscribe({ owner: address, account: mintAddress })
|
|
118
117
|
const tokenName = this.api.tokens.get(mintAddress)?.name
|
|
119
118
|
if (!tokenName) {
|
|
120
119
|
console.log(`Unknown token mint address: ${mintAddress}`)
|
|
121
120
|
continue
|
|
122
121
|
}
|
|
123
122
|
|
|
123
|
+
const tokenAccountAddress = tokenAccounts.find(
|
|
124
|
+
(acc) => acc.mintAddress === mintAddress
|
|
125
|
+
)?.tokenAccountAddress
|
|
126
|
+
await this.wsApi.accountSubscribe({ owner: address, account: tokenAccountAddress })
|
|
127
|
+
|
|
124
128
|
// update only token balances for known tokens
|
|
125
129
|
const amount = splBalances[mintAddress]
|
|
126
130
|
const newData = {
|
package/src/ws-api.js
CHANGED
|
@@ -186,14 +186,12 @@ export class WsApi {
|
|
|
186
186
|
const mappedTransactions = []
|
|
187
187
|
for (const tx of transactions) {
|
|
188
188
|
// we get the token name using the token.mintAddress
|
|
189
|
-
|
|
190
|
-
if (tx.token && !tokenName)
|
|
191
|
-
tokenName = 'unknown' // unknown token
|
|
192
|
-
}
|
|
189
|
+
const tokenName = tokens.get(tx.token?.mintAddress)?.name
|
|
190
|
+
if (tx.token && !tokenName) continue // skip unknown tokens
|
|
193
191
|
|
|
194
192
|
const assetName = tokenName ?? baseAsset.name
|
|
195
193
|
const asset = assets[assetName]
|
|
196
|
-
if (
|
|
194
|
+
if (!asset) continue // asset not found
|
|
197
195
|
const feeAsset = asset.feeAsset
|
|
198
196
|
|
|
199
197
|
const coinAmount = tx.amount ? asset.currency.baseUnit(tx.amount) : asset.currency.ZERO
|