@exodus/solana-api 3.11.5 → 3.11.7
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.11.7](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.11.6...@exodus/solana-api@3.11.7) (2024-11-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* prevent invalid account owner ([#4485](https://github.com/ExodusMovement/assets/issues/4485)) ([ca9474c](https://github.com/ExodusMovement/assets/commit/ca9474c79ff81d120fcecc9e9c4087f594f45845))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [3.11.6](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.11.5...@exodus/solana-api@3.11.6) (2024-10-24)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* clean SOL stake activation ([#4358](https://github.com/ExodusMovement/assets/issues/4358)) ([f57a84d](https://github.com/ExodusMovement/assets/commit/f57a84d2b233c58dd100deba82c11d8225ec12d6))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [3.11.5](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.11.4...@exodus/solana-api@3.11.5) (2024-10-24)
|
|
7
25
|
|
|
8
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.7",
|
|
4
4
|
"description": "Exodus internal Solana asset API wrapper",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@exodus/assets-testing": "^1.0.0",
|
|
48
48
|
"@exodus/solana-web3.js": "^1.63.1-exodus.9-rc3"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "451a0342feffa7ab7dbea8ff7f8e224cbd55c31b",
|
|
51
51
|
"bugs": {
|
|
52
52
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
|
|
53
53
|
},
|
|
@@ -15,7 +15,7 @@ function getStakeAndActivating(
|
|
|
15
15
|
targetEpoch, // number
|
|
16
16
|
stakeHistory // StakeHistoryEntry[]
|
|
17
17
|
) {
|
|
18
|
-
if (
|
|
18
|
+
if (delegation.activationEpoch === delegation.deactivationEpoch) {
|
|
19
19
|
// activated but instantly deactivated; no stake at all regardless of target_epoch
|
|
20
20
|
return {
|
|
21
21
|
effective: 0,
|
|
@@ -31,7 +31,7 @@ function getStakeAndActivating(
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
if (targetEpoch <
|
|
34
|
+
if (targetEpoch < delegation.activationEpoch) {
|
|
35
35
|
// not yet enabled
|
|
36
36
|
return {
|
|
37
37
|
effective: 0,
|
|
@@ -39,7 +39,7 @@ function getStakeAndActivating(
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
let currentEpoch =
|
|
42
|
+
let currentEpoch = delegation.activationEpoch
|
|
43
43
|
let entry = getStakeHistoryEntry(currentEpoch, stakeHistory)
|
|
44
44
|
if (entry !== null) {
|
|
45
45
|
// target_epoch > self.activation_epoch
|
|
@@ -60,7 +60,7 @@ function getStakeAndActivating(
|
|
|
60
60
|
break
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
if (currentEpoch >= targetEpoch || currentEpoch >=
|
|
63
|
+
if (currentEpoch >= targetEpoch || currentEpoch >= delegation.deactivationEpoch) {
|
|
64
64
|
break
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -82,10 +82,9 @@ function getStakeAndActivating(
|
|
|
82
82
|
|
|
83
83
|
export function getStakeActivatingAndDeactivating(delegation, targetEpoch, stakeHistory) {
|
|
84
84
|
const { effective, activating } = getStakeAndActivating(delegation, targetEpoch, stakeHistory)
|
|
85
|
-
const deactivationEpoch = Number(delegation.deactivationEpoch)
|
|
86
85
|
|
|
87
86
|
// then de-activate some portion if necessary
|
|
88
|
-
if (targetEpoch < deactivationEpoch) {
|
|
87
|
+
if (targetEpoch < delegation.deactivationEpoch) {
|
|
89
88
|
return {
|
|
90
89
|
effective,
|
|
91
90
|
activating,
|
|
@@ -93,7 +92,7 @@ export function getStakeActivatingAndDeactivating(delegation, targetEpoch, stake
|
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
|
|
96
|
-
if (targetEpoch === deactivationEpoch) {
|
|
95
|
+
if (targetEpoch === Number(delegation.deactivationEpoch)) {
|
|
97
96
|
// can only deactivate what's activated
|
|
98
97
|
return {
|
|
99
98
|
effective,
|
|
@@ -102,7 +101,7 @@ export function getStakeActivatingAndDeactivating(delegation, targetEpoch, stake
|
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
let currentEpoch = deactivationEpoch
|
|
104
|
+
let currentEpoch = delegation.deactivationEpoch
|
|
106
105
|
let entry = getStakeHistoryEntry(currentEpoch, stakeHistory)
|
|
107
106
|
if (entry !== null) {
|
|
108
107
|
// target_epoch > self.activation_epoch
|
|
@@ -35,8 +35,9 @@ export class SolanaAutoWithdrawMonitor {
|
|
|
35
35
|
|
|
36
36
|
if (!Array.isArray(this.cursors[walletAccount])) this.cursors[walletAccount] = []
|
|
37
37
|
const cursorChanged = !this.cursors[walletAccount].includes(cursor)
|
|
38
|
+
const performedWithdraw = this.cursors[walletAccount].length > 0
|
|
38
39
|
|
|
39
|
-
if (loaded && cursorChanged && withdrawable.isPositive) {
|
|
40
|
+
if (loaded && cursorChanged && withdrawable.isPositive && !performedWithdraw) {
|
|
40
41
|
this.cursors[walletAccount].push(cursor)
|
|
41
42
|
try {
|
|
42
43
|
const txIds = await this.tryWithdraw({ accountState, walletAccount })
|