@exodus/solana-api 3.7.2 → 3.8.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,24 @@
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.8.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.8.0...@exodus/solana-api@3.8.1) (2024-06-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * solana transaction simulation ([#2661](https://github.com/ExodusMovement/assets/issues/2661)) ([b97ad7e](https://github.com/ExodusMovement/assets/commit/b97ad7e955526c9421f98e5618aa80e585717bcd))
12
+
13
+
14
+
15
+ ## [3.8.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.7.2...@exodus/solana-api@3.8.0) (2024-06-20)
16
+
17
+
18
+ ### Features
19
+
20
+ * **solana:** Add pending to stake balance ([#2632](https://github.com/ExodusMovement/assets/issues/2632)) ([6a4973a](https://github.com/ExodusMovement/assets/commit/6a4973a33c5ba482d786a3fd5656107110dcf929))
21
+
22
+
23
+
6
24
  ## [3.7.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.7.1...@exodus/solana-api@3.7.2) (2024-06-19)
7
25
 
8
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "3.7.2",
3
+ "version": "3.8.1",
4
4
  "description": "Exodus internal Solana asset API wrapper",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -46,7 +46,7 @@
46
46
  "@exodus/assets-testing": "^1.0.0",
47
47
  "@solana/web3.js": "^1.91.8"
48
48
  },
49
- "gitHead": "a2436f7a26e5d0e3baa55be3730eaf31745a82c6",
49
+ "gitHead": "6807b8a6b3edc6ef8bd51a55976637b882ea3416",
50
50
  "bugs": {
51
51
  "url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
52
52
  },
@@ -28,6 +28,7 @@ export const createAccountState = ({ assetList }) => {
28
28
  locked: asset.currency.defaultUnit(0),
29
29
  withdrawable: asset.currency.defaultUnit(0),
30
30
  pending: asset.currency.defaultUnit(0),
31
+ activating: asset.currency.defaultUnit(0),
31
32
  earned: asset.currency.defaultUnit(0),
32
33
  accounts: {}, // stake accounts
33
34
  },
package/src/api.js CHANGED
@@ -839,6 +839,7 @@ export class Api {
839
839
  const accounts = {}
840
840
  let totalStake = 0
841
841
  let locked = 0
842
+ let activating = 0
842
843
  let withdrawable = 0
843
844
  let pending = 0
844
845
  for (const entry of res) {
@@ -859,11 +860,12 @@ export class Api {
859
860
  accounts[addr].stake = Number(accounts[addr].stake) || 0 // active staked amount
860
861
  totalStake += accounts[addr].stake
861
862
  locked += ['active', 'activating'].includes(accounts[addr].state) ? lamports : 0
863
+ activating += accounts[addr].state === 'activating' ? lamports : 0
862
864
  withdrawable += accounts[addr].canWithdraw ? lamports : 0
863
865
  pending += accounts[addr].isDeactivating ? lamports : 0
864
866
  }
865
867
 
866
- return { accounts, totalStake, locked, withdrawable, pending }
868
+ return { accounts, totalStake, locked, withdrawable, pending, activating }
867
869
  }
868
870
 
869
871
  async getRewards(stakingAddresses = []) {
@@ -18,6 +18,7 @@ export const getStakingInfo = (accountMem) => {
18
18
  staking: accountMem.staking,
19
19
  isDelegating: accountMem.isDelegating,
20
20
  locked: accountMem.locked,
21
+ activating: accountMem.activating,
21
22
  withdrawable: accountMem.withdrawable,
22
23
  pending: accountMem.pending,
23
24
  accounts: accountMem.accounts,
@@ -324,6 +324,7 @@ export class SolanaMonitor extends BaseMonitor {
324
324
  ['active', 'activating', 'inactive'].includes(state)
325
325
  ), // true if at least 1 account is delegating
326
326
  locked: this.asset.currency.baseUnit(stakingInfo.locked).toDefault(),
327
+ activating: this.asset.currency.baseUnit(stakingInfo.activating),
327
328
  withdrawable: this.asset.currency.baseUnit(stakingInfo.withdrawable).toDefault(),
328
329
  pending: this.asset.currency.baseUnit(stakingInfo.pending).toDefault(), // still undelegating (not yet available for withdraw)
329
330
  earned: this.asset.currency.baseUnit(rewards).toDefault(),
package/src/tx-send.js CHANGED
@@ -153,7 +153,7 @@ export const createAndBroadcastTXFactory =
153
153
  }
154
154
 
155
155
  const { unitsConsumed: computeUnits } = await api.simulateUnsignedTransaction({
156
- message: transactionForFeeEstimation.compileMessage(),
156
+ message: transactionForFeeEstimation.message,
157
157
  })
158
158
 
159
159
  unsignedTransaction.txData.priorityFee = priorityFee