@exodus/solana-api 3.14.0 → 3.14.2

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 CHANGED
@@ -3,6 +3,26 @@
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.14.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.14.1...@exodus/solana-api@3.14.2) (2025-03-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+
12
+ * fix: NFT tx amount (#5237)
13
+
14
+
15
+
16
+ ## [3.14.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.14.0...@exodus/solana-api@3.14.1) (2025-03-11)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+
22
+ * fix: prevent SOL invalid account owner error (#5187)
23
+
24
+
25
+
6
26
  ## [3.14.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.13.7...@exodus/solana-api@3.14.0) (2025-03-10)
7
27
 
8
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "3.14.0",
3
+ "version": "3.14.2",
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",
@@ -46,7 +46,7 @@
46
46
  "@exodus/assets-testing": "^1.0.0",
47
47
  "@exodus/solana-web3.js": "^1.63.1-exodus.9-rc3"
48
48
  },
49
- "gitHead": "0ad4bff46edd70ed69c9351d682d36b3436dbd1f",
49
+ "gitHead": "8ceb21b35e59dd7c7d4db2035ccba873d889464a",
50
50
  "bugs": {
51
51
  "url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
52
52
  },
package/src/api.js CHANGED
@@ -481,6 +481,7 @@ export class Api {
481
481
  const lamports = Number(lodash.get(ix, 'parsed.info.lamports', 0))
482
482
  if (solanaTransferTx) {
483
483
  solanaTransferTx.lamports += lamports
484
+ solanaTransferTx.amount = solanaTransferTx.lamports
484
485
  if (!Array.isArray(solanaTransferTx.to)) {
485
486
  solanaTransferTx.data = {
486
487
  sent: [
@@ -502,6 +503,7 @@ export class Api {
502
503
  from: source,
503
504
  to: [destination],
504
505
  lamports,
506
+ amount: lamports,
505
507
  data: {
506
508
  sent: [
507
509
  {
@@ -22,29 +22,38 @@ export class SolanaAutoWithdrawMonitor {
22
22
 
23
23
  async tick() {
24
24
  const walletAccounts = await this.aci.getWalletAccounts({ assetName: this.assetName })
25
- await Promise.all(walletAccounts.map((walletAccount) => this._tick({ walletAccount })))
25
+ for (const walletAccount of walletAccounts) {
26
+ await this._tick({ walletAccount })
27
+ }
26
28
  }
27
29
 
28
30
  async _tick({ walletAccount }) {
29
- const accountState = await this.aci.getAccountState({
30
- assetName: this.assetName,
31
- walletAccount,
32
- })
33
- const { cursor, stakingInfo } = accountState
34
- const { loaded, withdrawable } = stakingInfo
31
+ this.processing = this.processing || new Set()
32
+ if (this.processing.has(walletAccount)) return
33
+ this.processing.add(walletAccount)
34
+
35
+ try {
36
+ const accountState = await this.aci.getAccountState({
37
+ assetName: this.assetName,
38
+ walletAccount,
39
+ })
40
+ const { cursor, stakingInfo } = accountState
41
+ const { loaded, withdrawable } = stakingInfo
35
42
 
36
- if (!Array.isArray(this.cursors[walletAccount])) this.cursors[walletAccount] = []
37
- const cursorChanged = !this.cursors[walletAccount].includes(cursor)
38
- const performedWithdraw = this.cursors[walletAccount].length > 0
43
+ if (!Array.isArray(this.cursors[walletAccount])) this.cursors[walletAccount] = []
44
+ const cursorChanged = !this.cursors[walletAccount].includes(cursor)
39
45
 
40
- if (loaded && cursorChanged && withdrawable.isPositive && !performedWithdraw) {
41
- this.cursors[walletAccount].push(cursor)
42
- try {
43
- const txIds = await this.tryWithdraw({ accountState, walletAccount })
44
- this.cursors[walletAccount].push(...txIds)
45
- } catch (e) {
46
- console.log('solana auto withdraw error:', e)
46
+ if (loaded && cursorChanged && withdrawable.isPositive) {
47
+ this.cursors[walletAccount].push(cursor)
48
+ try {
49
+ const txIds = await this.tryWithdraw({ accountState, walletAccount })
50
+ this.cursors[walletAccount].push(...txIds)
51
+ } catch (e) {
52
+ console.log('solana auto withdraw error:', e)
53
+ }
47
54
  }
55
+ } finally {
56
+ this.processing.delete(walletAccount)
48
57
  }
49
58
  }
50
59