@exodus/solana-api 3.20.1 → 3.20.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,14 @@
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.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.20.1...@exodus/solana-api@3.20.2) (2025-06-17)
7
+
8
+ **Note:** Version bump only for package @exodus/solana-api
9
+
10
+
11
+
12
+
13
+
6
14
  ## [3.20.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.20.0...@exodus/solana-api@3.20.1) (2025-06-11)
7
15
 
8
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "3.20.1",
3
+ "version": "3.20.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": "8302af88cf085350c4c0149ab5e581e8297c548b",
49
+ "gitHead": "e2dffb7c0eaca3832d0cccae123955903071bb36",
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
@@ -1105,20 +1105,16 @@ export class Api {
1105
1105
  return { accounts, totalStake, locked, withdrawable, pending, activating }
1106
1106
  }
1107
1107
 
1108
- async getRewards(stakingAddresses = []) {
1109
- if (stakingAddresses.length === 0) return 0
1108
+ async getRewards(address) {
1109
+ if (Array.isArray(address)) throw new Error('getRewards does not support multiple addresses')
1110
1110
 
1111
1111
  // custom endpoint!
1112
- const rewards = await this.request('rewards')
1113
- .post({ addresses: stakingAddresses })
1114
- .error(500, () => ({})) // addresses not found
1115
- .error(400, () => ({}))
1112
+ const { rewards } = await this.request('everstake-rewards') // proxied
1113
+ .post({ address })
1116
1114
  .json()
1117
1115
 
1118
- // sum rewards for all addresses
1119
- return Object.values(rewards).reduce((total, x) => {
1120
- return total + x
1121
- }, 0)
1116
+ // sum rewards for all epochs
1117
+ return rewards || 0
1122
1118
  }
1123
1119
 
1124
1120
  async getProgramAccounts(programId, config) {
@@ -368,13 +368,7 @@ export class SolanaMonitor extends BaseMonitor {
368
368
 
369
369
  async getStakingInfo({ address, walletAccount }) {
370
370
  const stakingInfo = await this.api.getStakeAccountsInfo(address)
371
- const stakingAddresses = await this.getStakingAddressesFromTxLog({
372
- assetName: this.asset.name,
373
- walletAccount,
374
- })
375
- // merge current and old staking addresses
376
- const allStakingAddresses = _.uniq([...Object.keys(stakingInfo.accounts), ...stakingAddresses])
377
- const rewards = await this.api.getRewards(allStakingAddresses)
371
+ const rewards = await this.api.getRewards(address)
378
372
 
379
373
  return {
380
374
  loaded: true,