@exodus/solana-plugin 1.39.2 → 1.39.4
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 +18 -0
- package/README.md +0 -3
- package/package.json +4 -4
- package/src/create-asset.js +47 -9
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
|
+
## [1.39.4](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.39.3...@exodus/solana-plugin@1.39.4) (2026-06-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: re-introduce MIN_STAKING_AMOUNT constant (#8266)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.39.3](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.39.2...@exodus/solana-plugin@1.39.3) (2026-06-18)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package @exodus/solana-plugin
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [1.39.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.39.1...@exodus/solana-plugin@1.39.2) (2026-05-29)
|
|
7
25
|
|
|
8
26
|
**Note:** Version bump only for package @exodus/solana-plugin
|
package/README.md
CHANGED
|
@@ -28,7 +28,6 @@ import ms from 'ms'
|
|
|
28
28
|
|
|
29
29
|
const DEFAULT_ACCOUNT_RESERVE = 0.01
|
|
30
30
|
const DEFAULT_LOW_BALANCE = 0.01
|
|
31
|
-
const DEFAULT_MIN_STAKING_AMOUNT = 0.01
|
|
32
31
|
|
|
33
32
|
const asset = createAsset({
|
|
34
33
|
assetClientInterface,
|
|
@@ -39,7 +38,6 @@ const asset = createAsset({
|
|
|
39
38
|
shouldUpdateBalanceBeforeHistory: true,
|
|
40
39
|
defaultAccountReserve: DEFAULT_ACCOUNT_RESERVE,
|
|
41
40
|
defaultLowBalance: DEFAULT_LOW_BALANCE,
|
|
42
|
-
defaultMinStakingAmount: DEFAULT_MIN_STAKING_AMOUNT,
|
|
43
41
|
ticksBetweenHistoryFetches,
|
|
44
42
|
ticksBetweenStakeFetches,
|
|
45
43
|
txsLimit,
|
|
@@ -66,7 +64,6 @@ Creates a factory function for creating Solana assets.
|
|
|
66
64
|
- `shouldUpdateBalanceBeforeHistory` (Boolean): Indicates if we should update balance independently from history.
|
|
67
65
|
- `defaultAccountReserve` (Number): Default reserve amount for accounts.
|
|
68
66
|
- `defaultLowBalance` (Number): Default low balance threshold.
|
|
69
|
-
- `defaultMinStakingAmount` (Number): Default minimum staking amount.
|
|
70
67
|
- `ticksBetweenHistoryFetches` (Number): Number of ticks between history fetches.
|
|
71
68
|
- `ticksBetweenStakeFetches` (Number): Number of ticks between stake fetches.
|
|
72
69
|
- `txsLimit` (Number): Limit for the number of transactions.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-plugin",
|
|
3
|
-
"version": "1.39.
|
|
3
|
+
"version": "1.39.4",
|
|
4
4
|
"description": "Solana plugin for Exodus SDK powered wallets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@exodus/bip44-constants": "^195.0.0",
|
|
29
29
|
"@exodus/i18n-dummy": "^1.0.0",
|
|
30
30
|
"@exodus/send-validation-model": "^1.0.0",
|
|
31
|
-
"@exodus/solana-api": "^3.
|
|
32
|
-
"@exodus/solana-lib": "^3.
|
|
31
|
+
"@exodus/solana-api": "^3.35.2",
|
|
32
|
+
"@exodus/solana-lib": "^3.25.0",
|
|
33
33
|
"@exodus/solana-meta": "^2.9.0",
|
|
34
34
|
"@exodus/web3-solana-utils": "^2.9.0",
|
|
35
35
|
"minimalistic-assert": "^1.0.1",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"type": "git",
|
|
46
46
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9ee2c92699b19a44fc86e42bc860bbc51fe644a9"
|
|
49
49
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
createAccountState,
|
|
8
8
|
createAndBroadcastTXFactory,
|
|
9
9
|
createInitAgentWalletFactory,
|
|
10
|
+
createRecoverNestedAccountsFactory,
|
|
10
11
|
createTokenDelegationFactory,
|
|
11
12
|
createTxFactory,
|
|
12
13
|
feePayerClientFactory,
|
|
@@ -40,7 +41,20 @@ import { createWeb3API } from './web3/index.js'
|
|
|
40
41
|
|
|
41
42
|
const DEFAULT_ACCOUNT_RESERVE = 0
|
|
42
43
|
const DEFAULT_LOW_BALANCE = 0.01
|
|
43
|
-
const
|
|
44
|
+
const MIN_STAKING_AMOUNT = '1.003'
|
|
45
|
+
const STAKE_ACCOUNT_SIZE = 200
|
|
46
|
+
|
|
47
|
+
const normalizePositiveIntegerLamports = (value, errorMessage) => {
|
|
48
|
+
if (typeof value === 'number' && Number.isInteger(value) && value > 0) {
|
|
49
|
+
return String(value)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (typeof value === 'string' && /^[1-9]\d*$/.test(value)) {
|
|
53
|
+
return value
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
throw new Error(errorMessage)
|
|
57
|
+
}
|
|
44
58
|
|
|
45
59
|
export const createSolanaAssetFactory =
|
|
46
60
|
({ assetList, rpcUrl, isTestnet = false }) =>
|
|
@@ -55,7 +69,6 @@ export const createSolanaAssetFactory =
|
|
|
55
69
|
shouldUpdateBalanceBeforeHistory = true,
|
|
56
70
|
defaultAccountReserve = DEFAULT_ACCOUNT_RESERVE,
|
|
57
71
|
defaultLowBalance = DEFAULT_LOW_BALANCE,
|
|
58
|
-
defaultMinStakingAmount = DEFAULT_MIN_STAKING_AMOUNT,
|
|
59
72
|
ticksBetweenHistoryFetches,
|
|
60
73
|
ticksBetweenStakeFetches,
|
|
61
74
|
txsLimit,
|
|
@@ -82,10 +95,6 @@ export const createSolanaAssetFactory =
|
|
|
82
95
|
|
|
83
96
|
const lowBalance = base.currency.defaultUnit(defaultLowBalance ?? DEFAULT_LOW_BALANCE)
|
|
84
97
|
|
|
85
|
-
const MIN_STAKING_AMOUNT = base.currency.defaultUnit(
|
|
86
|
-
defaultMinStakingAmount ?? DEFAULT_MIN_STAKING_AMOUNT
|
|
87
|
-
)
|
|
88
|
-
|
|
89
98
|
const address = {
|
|
90
99
|
validate: isValidAddress,
|
|
91
100
|
}
|
|
@@ -181,6 +190,24 @@ export const createSolanaAssetFactory =
|
|
|
181
190
|
|
|
182
191
|
const assetStakingApi = {
|
|
183
192
|
...stakingApi,
|
|
193
|
+
getMinimumDelegation: async () => {
|
|
194
|
+
const [minimumDelegation, stakeAccountRent] = await Promise.all([
|
|
195
|
+
defaultApi.getStakeMinimumDelegation(),
|
|
196
|
+
defaultApi.getMinimumBalanceForRentExemption(STAKE_ACCOUNT_SIZE),
|
|
197
|
+
])
|
|
198
|
+
const minimumDelegationLamports = normalizePositiveIntegerLamports(
|
|
199
|
+
minimumDelegation,
|
|
200
|
+
'Invalid Solana stake minimum delegation'
|
|
201
|
+
)
|
|
202
|
+
const stakeAccountRentLamports = normalizePositiveIntegerLamports(
|
|
203
|
+
stakeAccountRent,
|
|
204
|
+
'Invalid Solana stake account rent'
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
return base.currency
|
|
208
|
+
.baseUnit(minimumDelegationLamports)
|
|
209
|
+
.add(base.currency.baseUnit(stakeAccountRentLamports))
|
|
210
|
+
},
|
|
184
211
|
isStaking: ({ accountState }) => accountState.stakingInfo.isDelegating,
|
|
185
212
|
}
|
|
186
213
|
|
|
@@ -226,6 +253,13 @@ export const createSolanaAssetFactory =
|
|
|
226
253
|
assetClientInterface,
|
|
227
254
|
})
|
|
228
255
|
|
|
256
|
+
const recoverNestedAccounts = createRecoverNestedAccountsFactory({
|
|
257
|
+
api: rpcApi,
|
|
258
|
+
assetClientInterface,
|
|
259
|
+
baseAssetName,
|
|
260
|
+
sendTx,
|
|
261
|
+
})
|
|
262
|
+
|
|
229
263
|
const createHistoryMonitor = createHistoryMonitorFactory({
|
|
230
264
|
monitorType: resolvedMonitorType,
|
|
231
265
|
assetClientInterface,
|
|
@@ -256,7 +290,10 @@ export const createSolanaAssetFactory =
|
|
|
256
290
|
getBalances,
|
|
257
291
|
getDefaultAddressPath: () => defaultAddressPath,
|
|
258
292
|
getFee,
|
|
259
|
-
getFeeAsync
|
|
293
|
+
getFeeAsync: async (...args) => {
|
|
294
|
+
const { unsignedTx, ...rest } = await getFeeAsync(...args)
|
|
295
|
+
return rest
|
|
296
|
+
},
|
|
260
297
|
getFeeData: () => feeData,
|
|
261
298
|
getKeyIdentifier,
|
|
262
299
|
getSendValidations: () => sendValidations,
|
|
@@ -296,9 +333,11 @@ export const createSolanaAssetFactory =
|
|
|
296
333
|
approveDelegation,
|
|
297
334
|
bip44,
|
|
298
335
|
accountReserve,
|
|
336
|
+
findRecoverableNestedAccounts: recoverNestedAccounts.findRecoverableNestedAccounts,
|
|
299
337
|
initAgentWallet,
|
|
300
338
|
lowBalance,
|
|
301
|
-
MIN_STAKING_AMOUNT,
|
|
339
|
+
MIN_STAKING_AMOUNT: base.currency.defaultUnit(MIN_STAKING_AMOUNT),
|
|
340
|
+
recoverNestedAccountFunds: recoverNestedAccounts.recoverNestedAccountFunds,
|
|
302
341
|
revokeDelegation,
|
|
303
342
|
serverApi: defaultApi,
|
|
304
343
|
}
|
|
@@ -312,7 +351,6 @@ export const createSolanaAssetFactory =
|
|
|
312
351
|
shouldUpdateBalanceBeforeHistory,
|
|
313
352
|
defaultAccountReserve,
|
|
314
353
|
defaultLowBalance,
|
|
315
|
-
defaultMinStakingAmount,
|
|
316
354
|
ticksBetweenHistoryFetches,
|
|
317
355
|
ticksBetweenStakeFetches,
|
|
318
356
|
txsLimit,
|