@exodus/solana-plugin 1.29.0 → 1.29.2
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 +3 -3
- package/src/create-asset.js +5 -3
- package/src/send-validations.js +16 -11
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.29.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.29.1...@exodus/solana-plugin@1.29.2) (2025-12-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: use proper keyidentifier in signHardware (#7140)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.29.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.29.0...@exodus/solana-plugin@1.29.1) (2025-12-18)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* fix: check sender rent when sending SPL tokens (#7128)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [1.29.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-plugin@1.28.2...@exodus/solana-plugin@1.29.0) (2025-12-08)
|
|
7
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-plugin",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.2",
|
|
4
4
|
"description": "Solana plugin for Exodus SDK powered wallets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@exodus/i18n-dummy": "^1.0.0",
|
|
29
29
|
"@exodus/send-validation-model": "^1.0.0",
|
|
30
30
|
"@exodus/solana-api": "^3.26.0",
|
|
31
|
-
"@exodus/solana-lib": "^3.
|
|
31
|
+
"@exodus/solana-lib": "^3.18.3",
|
|
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": "eefb54e97a3e8146a79972c099396648d703fd9f"
|
|
48
48
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
createFeeData,
|
|
18
18
|
createGetKeyIdentifier,
|
|
19
|
+
createSignHardwareFactory,
|
|
19
20
|
getAddressFromPublicKey,
|
|
20
21
|
getEncodedSecretKey,
|
|
21
22
|
isValidAddress,
|
|
22
23
|
prepareForSigning,
|
|
23
|
-
signHardware,
|
|
24
24
|
signMessageNew,
|
|
25
25
|
signMessageWithSigner,
|
|
26
26
|
signUnsignedTx,
|
|
@@ -169,6 +169,8 @@ export const createSolanaAssetFactory =
|
|
|
169
169
|
|
|
170
170
|
const defaultAddressPath = 'm/0/0'
|
|
171
171
|
|
|
172
|
+
const getKeyIdentifier = createGetKeyIdentifier({ bip44, assetName: base.name })
|
|
173
|
+
|
|
172
174
|
const getFee = ({ asset, feeData }) => {
|
|
173
175
|
const priorityFee = feeData.priorityFee ?? 0
|
|
174
176
|
// NOTE: fee is bumped via remote config, eventually fee = feeData.fee + (priorityFee * unitsConsumed * feeData.computeUnitsMultiplier)
|
|
@@ -223,7 +225,7 @@ export const createSolanaAssetFactory =
|
|
|
223
225
|
getFeeAsync,
|
|
224
226
|
getFeeData: () => feeData,
|
|
225
227
|
getSupportedPurposes: () => [44],
|
|
226
|
-
getKeyIdentifier
|
|
228
|
+
getKeyIdentifier,
|
|
227
229
|
getSendValidations: () => sendValidations,
|
|
228
230
|
getTokens: () =>
|
|
229
231
|
Object.values(assets)
|
|
@@ -236,7 +238,7 @@ export const createSolanaAssetFactory =
|
|
|
236
238
|
signer
|
|
237
239
|
? signUnsignedTxWithSigner(unsignedTx, signer)
|
|
238
240
|
: signUnsignedTx(unsignedTx, privateKey),
|
|
239
|
-
signHardware,
|
|
241
|
+
signHardware: createSignHardwareFactory({ getKeyIdentifier }),
|
|
240
242
|
signMessage: ({ privateKey, signer, message }) =>
|
|
241
243
|
signer
|
|
242
244
|
? signMessageWithSigner({ signer, message })
|
package/src/send-validations.js
CHANGED
|
@@ -86,6 +86,7 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
86
86
|
isEnoughForRent = sendAmount.gte(rentExemptAmount)
|
|
87
87
|
} else {
|
|
88
88
|
// sending token
|
|
89
|
+
// check destination address rent exemption
|
|
89
90
|
isEnoughForRent = baseAssetBalance
|
|
90
91
|
.sub(fees?.fee || asset.feeAsset.currency.ZERO)
|
|
91
92
|
.gte(rentExemptAmount)
|
|
@@ -95,7 +96,7 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
95
96
|
},
|
|
96
97
|
priority: PRIORITY_LEVELS.MIDDLE,
|
|
97
98
|
|
|
98
|
-
getMessage: () => t(`
|
|
99
|
+
getMessage: () => t(`SOL amount too low. Keep at least 0.0025 SOL to cover network fees.`), // hardcoded rent exempt amount, will be refactored once we have a better solution to return async calls
|
|
99
100
|
|
|
100
101
|
field: FIELDS.ADDRESS,
|
|
101
102
|
})
|
|
@@ -109,19 +110,20 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
109
110
|
asset,
|
|
110
111
|
sendAmount,
|
|
111
112
|
fees,
|
|
112
|
-
|
|
113
|
+
baseAssetBalance,
|
|
113
114
|
fromWalletAccount,
|
|
114
115
|
}) => {
|
|
115
|
-
if (
|
|
116
|
-
!sendAmount ||
|
|
117
|
-
asset.name !== assetName ||
|
|
118
|
-
!fees ||
|
|
119
|
-
!spendableBalance ||
|
|
120
|
-
!fromWalletAccount
|
|
121
|
-
) {
|
|
116
|
+
if (!sendAmount || !fees || !baseAssetBalance || !fromWalletAccount) {
|
|
122
117
|
return
|
|
123
118
|
}
|
|
124
119
|
|
|
120
|
+
let sendingSolAmount = sendAmount
|
|
121
|
+
if (asset.name !== asset.baseAsset.name) {
|
|
122
|
+
// sending Token
|
|
123
|
+
sendingSolAmount = asset.feeAsset.currency.ZERO
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// for the sender address
|
|
125
127
|
const accountState = await assetClientInterface.getAccountState({
|
|
126
128
|
assetName,
|
|
127
129
|
walletAccount: fromWalletAccount.toString(),
|
|
@@ -132,11 +134,14 @@ const sendValidationsFactory = ({ api, assetName, assetClientInterface }) => {
|
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
const rentExemptAmount = accountState.rentExemptAmount
|
|
135
|
-
|
|
137
|
+
|
|
138
|
+
const remaining = baseAssetBalance
|
|
139
|
+
.sub(fees?.fee || asset.feeAsset.currency.ZERO)
|
|
140
|
+
.sub(sendingSolAmount)
|
|
136
141
|
|
|
137
142
|
if (!remaining.isZero && remaining.lt(rentExemptAmount)) {
|
|
138
143
|
return t(
|
|
139
|
-
`You can either leave a zero balance, which will close your SOL account, or maintain a minimum balance of ${
|
|
144
|
+
`You can either leave a zero balance, which will close your SOL account, or maintain a minimum balance of ${rentExemptAmount.toDefaultString()} ${asset.displayTicker} to keep it active.`
|
|
140
145
|
)
|
|
141
146
|
}
|
|
142
147
|
},
|