@exodus/solana-api 3.13.5 → 3.13.7

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,28 @@
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.13.7](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.13.6...@exodus/solana-api@3.13.7) (2025-03-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+
12
+ * fix: await result in retry (#5113)
13
+
14
+ * fix: SOL getAccountInfo commitment (#5114)
15
+
16
+
17
+
18
+ ## [3.13.6](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.13.5...@exodus/solana-api@3.13.6) (2025-02-17)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+
24
+ * fix: SOL stakeable negative balance (#5059)
25
+
26
+
27
+
6
28
  ## [3.13.5](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.13.4...@exodus/solana-api@3.13.5) (2025-02-04)
7
29
 
8
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "3.13.5",
3
+ "version": "3.13.7",
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",
@@ -27,7 +27,7 @@
27
27
  "@exodus/assets": "^11.0.0",
28
28
  "@exodus/basic-utils": "^3.0.1",
29
29
  "@exodus/currency": "^6.0.1",
30
- "@exodus/fetch": "^1.2.0",
30
+ "@exodus/fetch": "^1.7.3",
31
31
  "@exodus/models": "^12.0.1",
32
32
  "@exodus/simple-retry": "^0.0.6",
33
33
  "@exodus/solana-lib": "^3.9.4",
@@ -40,14 +40,13 @@
40
40
  "make-concurrent": "^4.0.0",
41
41
  "minimalistic-assert": "^1.0.1",
42
42
  "ms": "^2.1.3",
43
- "url-join": "^4.0.0",
44
- "wretch": "^1.5.2"
43
+ "url-join": "^4.0.0"
45
44
  },
46
45
  "devDependencies": {
47
46
  "@exodus/assets-testing": "^1.0.0",
48
47
  "@exodus/solana-web3.js": "^1.63.1-exodus.9-rc3"
49
48
  },
50
- "gitHead": "84efbc1abdb6e85b5250a304cbea2e7d76d11501",
49
+ "gitHead": "710aac6a67806530fc11b56ac73c3ddb7808855a",
51
50
  "bugs": {
52
51
  "url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
53
52
  },
package/src/api.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import createApiCJS from '@exodus/asset-json-rpc'
2
2
  import { memoize } from '@exodus/basic-utils'
3
+ import wretch from '@exodus/fetch/wretch'
3
4
  import { retry } from '@exodus/simple-retry'
4
5
  import {
5
6
  buildRawTransaction,
@@ -18,7 +19,6 @@ import BN from 'bn.js'
18
19
  import lodash from 'lodash'
19
20
  import ms from 'ms'
20
21
  import urljoin from 'url-join'
21
- import wretch from 'wretch'
22
22
 
23
23
  import { Connection } from './connection.js'
24
24
  import { getStakeActivation } from './get-stake-activation/index.js'
@@ -215,9 +215,13 @@ export class Api {
215
215
  const fetchRetry = retry(
216
216
  async () => {
217
217
  try {
218
- return this.rpcCall('getSignaturesForAddress', [address, { until, before, limit }], {
219
- address,
220
- })
218
+ return await this.rpcCall(
219
+ 'getSignaturesForAddress',
220
+ [address, { until, before, limit }],
221
+ {
222
+ address,
223
+ }
224
+ )
221
225
  } catch (error) {
222
226
  if (
223
227
  error.message &&
@@ -833,7 +837,7 @@ export class Api {
833
837
  async getAccountInfo(address, encoding = 'jsonParsed') {
834
838
  const { value } = await this.rpcCall(
835
839
  'getAccountInfo',
836
- [address, { encoding, commitment: 'single' }],
840
+ [address, { encoding, commitment: 'confirmed' }],
837
841
  { address }
838
842
  )
839
843
  return value
@@ -47,7 +47,9 @@ export const getBalancesFactory =
47
47
  const spendable = balanceWithoutStaking.sub(walletReserve).sub(networkReserve).clampLowerZero()
48
48
 
49
49
  // leave enough amount for accountReserve if it's not reserved already
50
- const stakeable = walletReserve.isZero ? spendable.sub(accountReserve) : spendable
50
+ const stakeable = walletReserve.isZero
51
+ ? spendable.sub(accountReserve).clampLowerZero()
52
+ : spendable
51
53
 
52
54
  const staked = locked
53
55
  const unstaking = pending