@exodus/solana-api 3.9.0 → 3.9.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 CHANGED
@@ -3,6 +3,15 @@
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.9.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.9.0...@exodus/solana-api@3.9.1) (2024-07-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **solana:** harden objects against prototype pollution ([#2838](https://github.com/ExodusMovement/assets/issues/2838)) ([3374c58](https://github.com/ExodusMovement/assets/commit/3374c58de898aa38f96d6a4e30bc1fec3b48c691))
12
+
13
+
14
+
6
15
  ## [3.9.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.8.3...@exodus/solana-api@3.9.0) (2024-07-08)
7
16
 
8
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "description": "Exodus internal Solana asset API wrapper",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -47,7 +47,7 @@
47
47
  "@exodus/assets-testing": "^1.0.0",
48
48
  "@solana/web3.js": "^1.91.8"
49
49
  },
50
- "gitHead": "4690c7dc577330b5d317d762972343660111495d",
50
+ "gitHead": "054951dbfb7fb897b4b072e35fd5601920393b71",
51
51
  "bugs": {
52
52
  "url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
53
53
  },
@@ -16,7 +16,7 @@ export const createAccountState = ({ assetList }) => {
16
16
  static defaults = {
17
17
  cursor: '',
18
18
  balance: asset.currency.ZERO,
19
- tokenBalances: {},
19
+ tokenBalances: Object.create(null),
20
20
  mem: {
21
21
  loaded: false,
22
22
  staking: {
@@ -30,7 +30,7 @@ export const createAccountState = ({ assetList }) => {
30
30
  pending: asset.currency.defaultUnit(0),
31
31
  activating: asset.currency.defaultUnit(0),
32
32
  earned: asset.currency.defaultUnit(0),
33
- accounts: {}, // stake accounts
33
+ accounts: Object.create(null), // stake accounts
34
34
  },
35
35
  }
36
36
 
@@ -46,7 +46,7 @@ export const createAccountState = ({ assetList }) => {
46
46
  assets[assetName]
47
47
  ? Object.assign(r, { [assetName]: parseBalance(tokenBalance, assets[assetName]) })
48
48
  : r,
49
- {}
49
+ Object.create(null)
50
50
  ),
51
51
  }
52
52
  }
@@ -1,7 +1,8 @@
1
- import { SolanaMonitor } from './solana-monitor'
2
- import wretch from 'wretch'
3
1
  import urljoin from 'url-join'
2
+ import wretch from 'wretch'
3
+
4
4
  import fetchFlagrEvaluation from './me-flagr'
5
+ import { SolanaMonitor } from './solana-monitor'
5
6
 
6
7
  const FLAGR_KEY = 'sol-balance-api'
7
8
  const SOL_NATIVE = '11111111111111111111111111111111'
@@ -71,7 +72,7 @@ export class MeSolanaMonitor extends SolanaMonitor {
71
72
 
72
73
  const account = {
73
74
  balance: this.asset.currency.ZERO,
74
- tokenBalances: {},
75
+ tokenBalances: Object.create(null),
75
76
  }
76
77
  const tokenAccounts = []
77
78
 
@@ -97,7 +98,9 @@ export class MeSolanaMonitor extends SolanaMonitor {
97
98
 
98
99
  if (tokens.get(mintAddress)) {
99
100
  const tokenKey = token.name
100
- account.tokenBalances[tokenKey] = token.currency.baseUnit(balance.rawBalance)
101
+ Object.defineProperty(account.tokenBalances, tokenKey, {
102
+ value: token.currency.baseUnit(balance.rawBalance),
103
+ })
101
104
  }
102
105
 
103
106
  const tokenAccount = {