@exodus/solana-lib 3.11.2 → 3.12.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 +16 -0
- package/package.json +4 -4
- package/src/helpers/spl-token-2022.js +8 -3
- package/src/key-identifier.js +1 -0
- package/src/msg/sign-message.js +2 -2
- package/src/transaction.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.12.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.11.2...@exodus/solana-lib@3.12.0) (2025-09-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: use trezor compatibility mode for solana (#6564)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
* fix: don't use Sync methods in async (#5682)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [3.11.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.11.1...@exodus/solana-lib@3.11.2) (2025-05-05)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @exodus/solana-lib
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-lib",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"description": "Solana utils, such as for cryptography, address encoding/decoding, transaction building, etc.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"minimalistic-assert": "^1.0.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
+
"@exodus/bip39": "^1.0.1",
|
|
36
37
|
"@exodus/key-identifier": "^1.3.0",
|
|
37
38
|
"@exodus/keychain": "^7.3.0",
|
|
38
|
-
"@exodus/solana-meta": "^2.0.0"
|
|
39
|
-
"bip39": "^2.6.0"
|
|
39
|
+
"@exodus/solana-meta": "^2.0.0"
|
|
40
40
|
},
|
|
41
41
|
"bugs": {
|
|
42
42
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-lib"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"type": "git",
|
|
47
47
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "50814bd63872e287b650e161010e77be15b7994e"
|
|
50
50
|
}
|
|
@@ -118,10 +118,13 @@ export function decodeTransferCheckedWithFeeInstruction(
|
|
|
118
118
|
instruction, // TransactionInstruction
|
|
119
119
|
programId // PublicKey
|
|
120
120
|
) {
|
|
121
|
-
if (!instruction.programId.equals(programId))
|
|
121
|
+
if (!instruction.programId.equals(programId)) {
|
|
122
122
|
throw new Error('TokenInvalidInstructionProgramError')
|
|
123
|
-
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (instruction.data.length !== transferCheckedWithFeeInstructionData.span) {
|
|
124
126
|
throw new Error('TokenInvalidInstructionDataError')
|
|
127
|
+
}
|
|
125
128
|
|
|
126
129
|
const {
|
|
127
130
|
keys: { source, mint, destination, authority, signers },
|
|
@@ -130,8 +133,10 @@ export function decodeTransferCheckedWithFeeInstruction(
|
|
|
130
133
|
if (
|
|
131
134
|
data.instruction !== TokenInstruction.TransferFeeExtension ||
|
|
132
135
|
data.transferFeeInstruction !== TransferFeeInstruction.TransferCheckedWithFee
|
|
133
|
-
)
|
|
136
|
+
) {
|
|
134
137
|
throw new Error('TokenInvalidInstructionTypeError')
|
|
138
|
+
}
|
|
139
|
+
|
|
135
140
|
if (!mint) throw new Error('TokenInvalidInstructionKeysError')
|
|
136
141
|
|
|
137
142
|
return {
|
package/src/key-identifier.js
CHANGED
package/src/msg/sign-message.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { signDetached } from '@exodus/crypto/curve25519'
|
|
2
2
|
import assert from 'minimalistic-assert'
|
|
3
3
|
|
|
4
4
|
import { assertValidMessage } from './validation.js'
|
|
@@ -11,5 +11,5 @@ export const signMessageNew = async ({ privateKey, message }) => {
|
|
|
11
11
|
`privateKey is not a Buffer or Uint8Array`
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
-
return
|
|
14
|
+
return signDetached({ message: rawMessage, privateKey, format: 'buffer' })
|
|
15
15
|
}
|
package/src/transaction.js
CHANGED
|
@@ -167,8 +167,9 @@ class Tx {
|
|
|
167
167
|
if (!rawTokenProgram) throw new Error('Cannot detect token program')
|
|
168
168
|
const tokenProgram = new PublicKey(rawTokenProgram).toBase58()
|
|
169
169
|
// crete account instruction
|
|
170
|
-
if (isSOLaddress && !isAssociatedTokenAccountActive)
|
|
170
|
+
if (isSOLaddress && !isAssociatedTokenAccountActive) {
|
|
171
171
|
this.transaction.add(createAssociatedTokenAccount(from, tokenMintAddress, to, tokenProgram))
|
|
172
|
+
}
|
|
172
173
|
|
|
173
174
|
let amountLeft = amount
|
|
174
175
|
let amountToSend
|