@exodus/solana-plugin 1.24.2 → 1.24.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 +20 -0
- package/package.json +2 -2
- package/src/create-asset.js +8 -3
- package/src/send-validations.js +6 -24
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.24.4](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.24.3...@exodus/solana-plugin@1.24.4) (2025-09-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: simplify solana address type validation (#6474)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.24.3](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.24.2...@exodus/solana-plugin@1.24.3) (2025-09-16)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* fix: solana asset name perf (#6467)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [1.24.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.24.1...@exodus/solana-plugin@1.24.2) (2025-09-15)
|
|
7
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-plugin",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.4",
|
|
4
4
|
"description": "Solana plugin for Exodus SDK powered wallets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"type": "git",
|
|
44
44
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "90c85c31ff9bff8c11a0873592d4ed8184bd4145"
|
|
47
47
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -54,8 +54,8 @@ export const createSolanaAssetFactory =
|
|
|
54
54
|
} = {}) => {
|
|
55
55
|
const assets = connectAssetsList(assetList)
|
|
56
56
|
|
|
57
|
-
const
|
|
58
|
-
const
|
|
57
|
+
const { name: baseAssetName } = assetList.find((asset) => asset.baseAssetName === asset.name)
|
|
58
|
+
const base = assets[baseAssetName]
|
|
59
59
|
|
|
60
60
|
const smallTxAmount = base.currency.defaultUnit('0.00005')
|
|
61
61
|
const accountReserve = base.currency.defaultUnit(
|
|
@@ -152,7 +152,12 @@ export const createSolanaAssetFactory =
|
|
|
152
152
|
|
|
153
153
|
const getFeeAsync = getFeeAsyncFactory({ api: serverApi })
|
|
154
154
|
|
|
155
|
-
const sendValidations = sendValidationsFactory({
|
|
155
|
+
const sendValidations = sendValidationsFactory({
|
|
156
|
+
api: serverApi,
|
|
157
|
+
assetName: baseAssetName,
|
|
158
|
+
assetClientInterface,
|
|
159
|
+
})
|
|
160
|
+
|
|
156
161
|
const api = {
|
|
157
162
|
getActivityTxs,
|
|
158
163
|
addressHasHistory: (...args) => serverApi.getAccountInfo(...args).then((acc) => !!acc),
|
package/src/send-validations.js
CHANGED
|
@@ -28,16 +28,16 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
28
28
|
field: FIELDS.ADDRESS,
|
|
29
29
|
priority: PRIORITY_LEVELS.BASE,
|
|
30
30
|
validateAndGetMessage: async ({ asset, destinationAddress }) => {
|
|
31
|
-
if (
|
|
31
|
+
if (!destinationAddress) {
|
|
32
32
|
return
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const addressDetails = await getAccountInfoCached(destinationAddress)
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
36
|
+
if (addressDetails.addressType === 'token') {
|
|
37
|
+
return t(
|
|
38
|
+
`The Solana network doesn't allow sending ${asset.displayTicker} to a Token Account address.`
|
|
39
|
+
)
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
return t('Destination address is for a different token type.')
|
|
41
41
|
},
|
|
42
42
|
})
|
|
43
43
|
|
|
@@ -67,23 +67,6 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
67
67
|
},
|
|
68
68
|
})
|
|
69
69
|
|
|
70
|
-
const solanaAddressValidator = createValidator({
|
|
71
|
-
id: 'SOLANA_ADDRESS',
|
|
72
|
-
type: VALIDATION_TYPES.ERROR,
|
|
73
|
-
priority: PRIORITY_LEVELS.MIDDLE,
|
|
74
|
-
field: FIELDS.ADDRESS,
|
|
75
|
-
validateAndGetMessage: async ({ asset, destinationAddress }) => {
|
|
76
|
-
if (asset.name !== assetName || !destinationAddress) {
|
|
77
|
-
return
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const addressDetails = await getAccountInfoCached(destinationAddress)
|
|
81
|
-
if (addressDetails.addressType === 'token') {
|
|
82
|
-
return t(`The Solana network doesn't allow sending SOL to a Token Account address.`)
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
})
|
|
86
|
-
|
|
87
70
|
const solanaRentExemptAmountValidator = createValidator({
|
|
88
71
|
id: 'SOL_RENT_EXEMPT_AMOUNT',
|
|
89
72
|
type: VALIDATION_TYPES.ERROR,
|
|
@@ -141,7 +124,7 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
141
124
|
|
|
142
125
|
const accountState = await assetClientInterface.getAccountState({
|
|
143
126
|
assetName,
|
|
144
|
-
walletAccount: fromWalletAccount,
|
|
127
|
+
walletAccount: fromWalletAccount.toString(),
|
|
145
128
|
})
|
|
146
129
|
|
|
147
130
|
if (!accountState?.rentExemptAmount) {
|
|
@@ -170,7 +153,6 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
170
153
|
})
|
|
171
154
|
return [
|
|
172
155
|
solanaAddressTypeValidator,
|
|
173
|
-
solanaAddressValidator,
|
|
174
156
|
solanaMintAddressValidator,
|
|
175
157
|
solanaRentExemptAmountValidator,
|
|
176
158
|
solanaPayValidator,
|