@exodus/solana-lib 3.14.0 → 3.15.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 +18 -0
- package/package.json +2 -2
- package/src/helpers/spl-token-2022.js +1 -1
- package/src/transaction.js +17 -1
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
|
+
## [3.15.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.14.1...@exodus/solana-lib@3.15.0) (2025-10-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: track delegated addresses for solana (#6796)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [3.14.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.14.0...@exodus/solana-lib@3.14.1) (2025-10-28)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package @exodus/solana-lib
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [3.14.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.13.0...@exodus/solana-lib@3.14.0) (2025-10-27)
|
|
7
25
|
|
|
8
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-lib",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.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",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"type": "git",
|
|
48
48
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "c29184f952c3131b60ffe91fd73f778085f00fca"
|
|
51
51
|
}
|
|
@@ -88,7 +88,7 @@ export function createTransferCheckedWithFeeInstruction(
|
|
|
88
88
|
{
|
|
89
89
|
instruction: TokenInstruction.TransferFeeExtension,
|
|
90
90
|
transferFeeInstruction: TransferFeeInstruction.TransferCheckedWithFee,
|
|
91
|
-
amount: new U64(amount).toBuffer(),
|
|
91
|
+
amount: new U64(amount.toString()).toBuffer(),
|
|
92
92
|
decimals,
|
|
93
93
|
fee: new U64(fee).toBuffer(),
|
|
94
94
|
},
|
package/src/transaction.js
CHANGED
|
@@ -173,7 +173,14 @@ class Tx {
|
|
|
173
173
|
let amountLeft = new BN(amount)
|
|
174
174
|
let amountToSend
|
|
175
175
|
let isNotEnoughBalance = false
|
|
176
|
-
for (let {
|
|
176
|
+
for (let {
|
|
177
|
+
mintAddress,
|
|
178
|
+
tokenAccountAddress,
|
|
179
|
+
balance,
|
|
180
|
+
decimals,
|
|
181
|
+
isDelegated,
|
|
182
|
+
delegatedAmount,
|
|
183
|
+
} of fromTokenAddresses) {
|
|
177
184
|
// need to add more of this instruction until we reach the desired balance (amount) to send
|
|
178
185
|
assert(mintAddress === tokenMintAddress, `Got unexpected mintAddress ${mintAddress}`)
|
|
179
186
|
|
|
@@ -181,6 +188,15 @@ class Tx {
|
|
|
181
188
|
if (amountLeft.isZero()) break
|
|
182
189
|
|
|
183
190
|
balance = new BN(balance)
|
|
191
|
+
|
|
192
|
+
// For delegated accounts, limit transfer amount to delegated amount
|
|
193
|
+
if (isDelegated) {
|
|
194
|
+
const maxDelegated = new BN(delegatedAmount || '0')
|
|
195
|
+
if (balance.gt(maxDelegated)) {
|
|
196
|
+
balance = maxDelegated
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
184
200
|
if (balance.gte(amountLeft)) {
|
|
185
201
|
amountToSend = amountLeft
|
|
186
202
|
amountLeft = new BN(0)
|