@exodus/solana-plugin 1.30.5 → 1.32.0
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 +20 -0
- package/package.json +4 -4
- package/src/create-asset.js +10 -0
- package/src/send-validations.js +32 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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.32.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.31.0...@exodus/solana-plugin@1.32.0) (2026-02-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat(solana): add getDelegatedAddresses to full asset (#7377)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.31.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.30.5...@exodus/solana-plugin@1.31.0) (2026-02-02)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* feat(solana): reintroduce solana SPL delegation (#7353)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [1.30.5](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.30.4...@exodus/solana-plugin@1.30.5) (2026-01-21)
|
|
7
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"description": "Solana plugin for Exodus SDK powered wallets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"@exodus/bip44-constants": "^195.0.0",
|
|
28
28
|
"@exodus/i18n-dummy": "^1.0.0",
|
|
29
29
|
"@exodus/send-validation-model": "^1.0.0",
|
|
30
|
-
"@exodus/solana-api": "^3.
|
|
31
|
-
"@exodus/solana-lib": "^3.
|
|
30
|
+
"@exodus/solana-api": "^3.29.0",
|
|
31
|
+
"@exodus/solana-lib": "^3.20.1",
|
|
32
32
|
"@exodus/solana-meta": "^2.3.1",
|
|
33
33
|
"@exodus/web3-solana-utils": "^2.9.0",
|
|
34
34
|
"minimalistic-assert": "^1.0.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"type": "git",
|
|
45
45
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "d844d6fa5e5eec3c7b279ee5317f676357eb82b2"
|
|
48
48
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
createAccountState,
|
|
7
7
|
createAndBroadcastTXFactory,
|
|
8
8
|
createInitAgentWalletFactory,
|
|
9
|
+
createTokenDelegationFactory,
|
|
9
10
|
createTxFactory,
|
|
10
11
|
feePayerClientFactory,
|
|
11
12
|
getBalancesFactory,
|
|
@@ -194,6 +195,12 @@ export const createSolanaAssetFactory =
|
|
|
194
195
|
assetClientInterface,
|
|
195
196
|
})
|
|
196
197
|
|
|
198
|
+
const { approveDelegation, revokeDelegation, getDelegatedAddresses } =
|
|
199
|
+
createTokenDelegationFactory({
|
|
200
|
+
api: defaultApi,
|
|
201
|
+
assetClientInterface,
|
|
202
|
+
})
|
|
203
|
+
|
|
197
204
|
const createHistoryMonitor = createHistoryMonitorFactory({
|
|
198
205
|
monitorType,
|
|
199
206
|
assetClientInterface,
|
|
@@ -258,11 +265,14 @@ export const createSolanaAssetFactory =
|
|
|
258
265
|
address,
|
|
259
266
|
keys,
|
|
260
267
|
api,
|
|
268
|
+
approveDelegation,
|
|
261
269
|
bip44,
|
|
262
270
|
accountReserve,
|
|
271
|
+
getDelegatedAddresses,
|
|
263
272
|
initAgentWallet,
|
|
264
273
|
lowBalance,
|
|
265
274
|
MIN_STAKING_AMOUNT,
|
|
275
|
+
revokeDelegation,
|
|
266
276
|
serverApi: defaultApi,
|
|
267
277
|
}
|
|
268
278
|
|
package/src/send-validations.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { memoizeLruCache } from '@exodus/asset-lib'
|
|
2
2
|
import { t } from '@exodus/i18n-dummy'
|
|
3
3
|
import sendValidationModel from '@exodus/send-validation-model'
|
|
4
|
+
import { EXOD_SHARES_MINT_ADDRESS } from '@exodus/solana-lib'
|
|
4
5
|
import ms from 'ms'
|
|
5
6
|
|
|
6
7
|
const { createValidator, FIELDS, PRIORITY_LEVELS, VALIDATION_TYPES } = sendValidationModel
|
|
7
8
|
|
|
9
|
+
const isExodusSharesAsset = (asset) => asset?.mintAddress === EXOD_SHARES_MINT_ADDRESS
|
|
10
|
+
|
|
8
11
|
const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
9
12
|
const getAccountInfoCached = memoizeLruCache(
|
|
10
13
|
async (destinationAddress) => {
|
|
@@ -147,6 +150,34 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
147
150
|
},
|
|
148
151
|
}
|
|
149
152
|
|
|
153
|
+
const solanaAddressWhitelisted = {
|
|
154
|
+
id: 'SOL_ADDRESS_WHITELISTED',
|
|
155
|
+
type: VALIDATION_TYPES.ERROR,
|
|
156
|
+
priority: PRIORITY_LEVELS.MIDDLE,
|
|
157
|
+
field: FIELDS.ADDRESS,
|
|
158
|
+
link: 'https://www.exodus.com/support/en/articles/12582935-how-do-i-tokenize-my-shares-on-solana-through-superstate#h_4d4e1b25f1',
|
|
159
|
+
validateAndGetMessage: async ({ asset, destinationAddress }) => {
|
|
160
|
+
if (
|
|
161
|
+
asset.assetType !== 'SOLANA_TOKEN' ||
|
|
162
|
+
!isExodusSharesAsset(asset) ||
|
|
163
|
+
!destinationAddress.trim() ||
|
|
164
|
+
!asset.baseAsset?.address?.validate ||
|
|
165
|
+
!(await asset.baseAsset.address.validate(destinationAddress))
|
|
166
|
+
) {
|
|
167
|
+
return
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (
|
|
171
|
+
!(await asset.baseAsset.api.isWhitelisted({
|
|
172
|
+
address: destinationAddress,
|
|
173
|
+
tokenMintAddress: EXOD_SHARES_MINT_ADDRESS,
|
|
174
|
+
}))
|
|
175
|
+
) {
|
|
176
|
+
return t('EXOD can only be sent to an address that belongs to a Superstate user.')
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
}
|
|
180
|
+
|
|
150
181
|
const solanaPayValidator = createValidator({
|
|
151
182
|
id: 'SOLANA_PAY',
|
|
152
183
|
type: VALIDATION_TYPES.ERROR,
|
|
@@ -160,6 +191,7 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
160
191
|
solanaAddressTypeValidator,
|
|
161
192
|
solanaMintAddressValidator,
|
|
162
193
|
solanaRentExemptAmountValidator,
|
|
194
|
+
solanaAddressWhitelisted,
|
|
163
195
|
solanaPayValidator,
|
|
164
196
|
solanaRentExemptAmountSenderValidator,
|
|
165
197
|
]
|