@exodus/solana-api 3.30.0 → 3.30.1
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 +2 -2
- package/src/api.js +8 -2
- package/src/fee-payer.js +25 -12
- package/src/tx-log/clarity-monitor.js +2 -1
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.30.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.30.0...@exodus/solana-api@3.30.1) (2026-03-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix(solana-api): add RPC concurrency limit and fix historyCursor loss on error (#7550)
|
|
13
|
+
|
|
14
|
+
* fix(solana-api): improve fetchival error handling in fee payer client (#7570)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [3.30.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.29.6...@exodus/solana-api@3.30.0) (2026-03-10)
|
|
7
19
|
|
|
8
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "3.30.
|
|
3
|
+
"version": "3.30.1",
|
|
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": "51cc10fa866ae472882aa09353e2425bc7d7031f",
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
|
|
55
55
|
},
|
package/src/api.js
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
TOKEN_PROGRAM_ID,
|
|
20
20
|
} from '@exodus/solana-lib'
|
|
21
21
|
import lodash from 'lodash'
|
|
22
|
+
import makeConcurrent from 'make-concurrent'
|
|
22
23
|
import ms from 'ms'
|
|
23
24
|
import urljoin from 'url-join'
|
|
24
25
|
|
|
@@ -41,6 +42,8 @@ const errorMessagesToRetry = [
|
|
|
41
42
|
'Failed to query long-term storage; please try again',
|
|
42
43
|
]
|
|
43
44
|
|
|
45
|
+
const TX_DETAIL_FETCH_CONCURRENCY = 10
|
|
46
|
+
|
|
44
47
|
// Tokens + SOL api support
|
|
45
48
|
export class Api {
|
|
46
49
|
constructor({ rpcUrl, wsUrl, assets, txsLimit }) {
|
|
@@ -230,8 +233,11 @@ export class Api {
|
|
|
230
233
|
let txsId = txsResultsByAccount.flat() // merge arrays
|
|
231
234
|
txsId = lodash.uniqBy(txsId, 'signature')
|
|
232
235
|
|
|
233
|
-
// get txs details
|
|
234
|
-
const
|
|
236
|
+
// get txs details with concurrency limit to avoid overwhelming the RPC server
|
|
237
|
+
const fetchWithLimit = makeConcurrent((signature) => this.getTransactionById(signature), {
|
|
238
|
+
concurrency: TX_DETAIL_FETCH_CONCURRENCY,
|
|
239
|
+
})
|
|
240
|
+
const txsDetails = await Promise.all(txsId.map((tx) => fetchWithLimit(tx.signature)))
|
|
235
241
|
txsDetails.forEach((txDetail) => {
|
|
236
242
|
if (!txDetail) return
|
|
237
243
|
|
package/src/fee-payer.js
CHANGED
|
@@ -64,14 +64,30 @@ export const feePayerClientFactory = ({
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
try {
|
|
68
|
+
return await fetchival(`${feePayerApiUrl}/transactions/sponsor`, {
|
|
69
|
+
mode: 'cors',
|
|
70
|
+
cache: 'no-cache',
|
|
71
|
+
timeout: ms('10s'),
|
|
72
|
+
headers,
|
|
73
|
+
}).post({
|
|
74
|
+
transaction: encodedTransaction,
|
|
75
|
+
})
|
|
76
|
+
} catch (err) {
|
|
77
|
+
let nerr = err
|
|
78
|
+
if (err.response) {
|
|
79
|
+
try {
|
|
80
|
+
const data = await err.response.text()
|
|
81
|
+
nerr = new Error(`${err.response.status}: ${data}`)
|
|
82
|
+
} catch {}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (err.response?.status) {
|
|
86
|
+
nerr.status = err.response.status
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
throw nerr
|
|
90
|
+
}
|
|
75
91
|
}
|
|
76
92
|
|
|
77
93
|
/**
|
|
@@ -84,10 +100,7 @@ export const feePayerClientFactory = ({
|
|
|
84
100
|
try {
|
|
85
101
|
response = await makeSponsorRequest({ encodedTransaction })
|
|
86
102
|
} catch (error) {
|
|
87
|
-
if (
|
|
88
|
-
requireAuthentication &&
|
|
89
|
-
(error.response?.status === 401 || error.response?.status === 403)
|
|
90
|
-
) {
|
|
103
|
+
if (requireAuthentication && (error.status === 401 || error.status === 403)) {
|
|
91
104
|
console.warn('Authentication failed, retrying...')
|
|
92
105
|
if (authClient) {
|
|
93
106
|
await authClient._authenticate()
|
|
@@ -246,7 +246,8 @@ export class SolanaClarityMonitor extends BaseMonitor {
|
|
|
246
246
|
error,
|
|
247
247
|
})
|
|
248
248
|
|
|
249
|
-
|
|
249
|
+
// Preserve cursor on transient errors so fetching retries on the next tick
|
|
250
|
+
return { transactions: [], historyCursor }
|
|
250
251
|
}
|
|
251
252
|
}
|
|
252
253
|
|