@exodus/solana-api 3.20.1 → 3.20.3
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 +20 -0
- package/package.json +2 -2
- package/src/api.js +6 -10
- package/src/create-unsigned-tx-for-send.js +4 -0
- package/src/index.js +1 -0
- package/src/tx-log/solana-monitor.js +1 -7
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.20.3](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.20.2...@exodus/solana-api@3.20.3) (2025-06-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: SOL add multi-dex swap tests (#5927)
|
|
13
|
+
|
|
14
|
+
* fix: SOL move funds (#5935)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [3.20.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.20.1...@exodus/solana-api@3.20.2) (2025-06-17)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @exodus/solana-api
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [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
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "3.20.
|
|
3
|
+
"version": "3.20.3",
|
|
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": "
|
|
49
|
+
"gitHead": "a5721f9708d787604715c4dba1f0ab16a683d7c4",
|
|
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(
|
|
1109
|
-
if (
|
|
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({
|
|
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
|
|
1119
|
-
return
|
|
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) {
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
TOKEN_PROGRAM_ID,
|
|
10
10
|
verifyOnlyFeePayerChanged,
|
|
11
11
|
} from '@exodus/solana-lib'
|
|
12
|
+
import assert from 'minimalistic-assert'
|
|
12
13
|
|
|
13
14
|
const CU_FOR_COMPUTE_BUDGET_INSTRUCTIONS = 300
|
|
14
15
|
|
|
@@ -47,6 +48,9 @@ export const createUnsignedTxForSend = async ({
|
|
|
47
48
|
creators,
|
|
48
49
|
// </MagicEden>
|
|
49
50
|
}) => {
|
|
51
|
+
assert(api, 'api is required')
|
|
52
|
+
assert(asset, 'asset is required')
|
|
53
|
+
assert(feeData, 'feeData is required')
|
|
50
54
|
let tokenParams = Object.create(null)
|
|
51
55
|
const baseAsset = asset.baseAsset
|
|
52
56
|
|
package/src/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { createAndBroadcastTXFactory } from './tx-send.js'
|
|
|
17
17
|
export { getBalancesFactory } from './get-balances.js'
|
|
18
18
|
export { getFeeAsyncFactory } from './get-fees.js'
|
|
19
19
|
export { stakingProviderClientFactory } from './staking-provider-client.js'
|
|
20
|
+
export { createUnsignedTxForSend } from './create-unsigned-tx-for-send.js'
|
|
20
21
|
|
|
21
22
|
// These are not the same asset objects as the wallet creates, so they should never be returned to the wallet.
|
|
22
23
|
// Initially this may be violated by the Solana code until the first monitor tick updates assets with setTokens()
|
|
@@ -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
|
|
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,
|