@exodus/solana-api 2.0.3 → 2.0.5

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "Exodus internal Solana asset API wrapper",
5
5
  "main": "src/index.js",
6
6
  "files": [
7
7
  "src/",
8
- "!src/__tests__"
8
+ "!src/**/__tests__"
9
9
  ],
10
10
  "author": "Exodus",
11
11
  "license": "ISC",
@@ -14,14 +14,18 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@exodus/asset-json-rpc": "^1.0.0",
17
+ "@exodus/asset-lib": "^3.6.0",
18
+ "@exodus/assets": "^8.0.68",
19
+ "@exodus/assets-base": "^8.0.139",
20
+ "@exodus/models": "^8.7.2",
17
21
  "@exodus/nfts-core": "^0.5.0",
18
- "@exodus/solana-lib": "^1.3.8",
22
+ "@exodus/solana-lib": "^1.3.10",
19
23
  "lodash": "^4.17.11",
20
24
  "url-join": "4.0.0",
21
25
  "wretch": "^1.5.2"
22
26
  },
23
27
  "devDependencies": {
24
- "node-fetch": "~1.6.3"
28
+ "node-fetch": "~2.6.0"
25
29
  },
26
- "gitHead": "a0fdfde1511f31373bc94c8cd12c8bee22757876"
30
+ "gitHead": "c15c374eaf769d76288023a8573b3b120d8922b0"
27
31
  }
@@ -0,0 +1,32 @@
1
+ import assets from '@exodus/assets'
2
+ import { AccountState } from '@exodus/models'
3
+
4
+ const asset = assets.solana
5
+ const solTokens = Object.values(assets).filter((asset) => asset.assetType === 'SOLANA_TOKEN')
6
+
7
+ export class SolanaAccountState extends AccountState {
8
+ static defaults = {
9
+ cursor: '',
10
+ balance: asset.currency.ZERO,
11
+ tokenBalances: {},
12
+ mem: {
13
+ loaded: false,
14
+ staking: {
15
+ // remote-config data
16
+ enabled: true,
17
+ pool: null,
18
+ },
19
+ isDelegating: false,
20
+ locked: asset.currency.defaultUnit(0),
21
+ withdrawable: asset.currency.defaultUnit(0),
22
+ pending: asset.currency.defaultUnit(0),
23
+ earned: asset.currency.defaultUnit(0),
24
+ accounts: {}, // stake accounts
25
+ },
26
+ }
27
+ static _tokens = [asset, ...solTokens] // deprecated - will be removed
28
+
29
+ static _postParse(data) {
30
+ return { ...data, tokenBalances: {} }
31
+ }
32
+ }