@exodus/solana-api 1.2.10 → 1.2.12

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.js +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "Exodus internal Solana asset API wrapper",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -14,12 +14,12 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@exodus/asset-json-rpc": "^1.0.0",
17
- "@exodus/solana-lib": "^1.2.10",
17
+ "@exodus/solana-lib": "^1.2.12",
18
18
  "lodash": "^4.17.11",
19
19
  "wretch": "^1.5.2"
20
20
  },
21
21
  "devDependencies": {
22
22
  "node-fetch": "~1.6.3"
23
23
  },
24
- "gitHead": "9ea01d6b464b1a6a23e49f3634b9e661e755efc8"
24
+ "gitHead": "41e9ea0fdbade75891e954ea56d83a983f18c6ae"
25
25
  }
package/src/index.js CHANGED
@@ -121,10 +121,13 @@ class Api {
121
121
  if (txDetail === null) return
122
122
 
123
123
  const timestamp = txDetail.blockTime * 1000
124
+ const parsedTx = Api.parseTransaction(address, txDetail, tokenAccountsByOwner)
125
+ if (!parsedTx.from) return // cannot parse it
126
+
124
127
  transactions.push({
125
128
  timestamp,
126
129
  date: new Date(timestamp),
127
- ...Api.parseTransaction(address, txDetail, tokenAccountsByOwner),
130
+ ...parsedTx,
128
131
  })
129
132
  })
130
133
  } catch (err) {
@@ -402,7 +405,7 @@ class Api {
402
405
  accounts[addr].canWithdraw = state === 'inactive'
403
406
  accounts[addr].stake = Number(accounts[addr].stake) || 0 // active staked amount
404
407
  totalStake += accounts[addr].stake
405
- locked += accounts[addr].canWithdraw ? 0 : lamports
408
+ locked += ['active', 'activating'].includes(accounts[addr].state) ? lamports : 0
406
409
  withdrawable += accounts[addr].canWithdraw ? lamports : 0
407
410
  pending += accounts[addr].isDeactivating ? lamports : 0
408
411
  }