@exodus/solana-lib 3.23.0 → 3.24.1

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 CHANGED
@@ -3,6 +3,32 @@
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.24.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.24.0...@exodus/solana-lib@3.24.1) (2026-05-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+
12
+ * fix(solana-lib): normalize toBufferU64 input so BigInt fees encode correctly (#7913)
13
+
14
+ * fix(solana-lib): preserve editionNonce of 0 in Metadata (#7908)
15
+
16
+ * fix(solana-lib): treat amount: 0 in createApproveInstruction as zero, not MAX_U64 (#7911)
17
+
18
+ * fix(solana-lib): use accountKeys index for isSigner/isWritable in decoded instructions (#7914)
19
+
20
+
21
+
22
+ ## [3.24.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.23.0...@exodus/solana-lib@3.24.0) (2026-04-27)
23
+
24
+
25
+ ### Features
26
+
27
+
28
+ * feat: add MoveFunds API for Solana (#7870)
29
+
30
+
31
+
6
32
  ## [3.23.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.22.5...@exodus/solana-lib@3.23.0) (2026-04-21)
7
33
 
8
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-lib",
3
- "version": "3.23.0",
3
+ "version": "3.24.1",
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",
@@ -49,5 +49,5 @@
49
49
  "type": "git",
50
50
  "url": "git+https://github.com/ExodusMovement/assets.git"
51
51
  },
52
- "gitHead": "a500e7aa96e24bfc673f1bb354eb0f662f7d5d82"
52
+ "gitHead": "0f0b24ec400666686cc4d185b722d1c542b1d10a"
53
53
  }
@@ -38,7 +38,7 @@ export class Metadata {
38
38
  this.data = args.data
39
39
  this.primarySaleHappened = args.primarySaleHappened
40
40
  this.isMutable = args.isMutable
41
- this.editionNonce = args.editionNonce || null
41
+ this.editionNonce = args.editionNonce ?? null
42
42
  }
43
43
  }
44
44
 
@@ -11,7 +11,8 @@ const u64 = (property = 'uint64') => {
11
11
  return BufferLayout.blob(8, property)
12
12
  }
13
13
 
14
- const toBufferU64 = (num) => Buffer.from(new BN(num).toArray('le', 8))
14
+ // bn.js v5 does not accept BigInt; .toString() handles it (and BN/number/string).
15
+ const toBufferU64 = (num) => Buffer.from(new BN(num.toString()).toArray('le', 8))
15
16
 
16
17
  // Extracted from https://github.com/solana-labs/solana-program-library/blob/token-js-v0.4.1/token/js/src/extensions/transferFee/instructions.ts
17
18
 
@@ -90,7 +91,7 @@ export function createTransferCheckedWithFeeInstruction(
90
91
  {
91
92
  instruction: TokenInstruction.TransferFeeExtension,
92
93
  transferFeeInstruction: TransferFeeInstruction.TransferCheckedWithFee,
93
- amount: toBufferU64(amount.toString()),
94
+ amount: toBufferU64(amount),
94
95
  decimals,
95
96
  fee: toBufferU64(fee),
96
97
  },
@@ -20,7 +20,7 @@ export const createApproveInstruction = ({
20
20
  new PublicKey(delegateAddress),
21
21
  new PublicKey(ownerAddress),
22
22
  [],
23
- amount ? new U64(amount) : MAX_U64
23
+ amount === undefined ? MAX_U64 : new U64(amount)
24
24
  )
25
25
  }
26
26
 
package/src/index.js CHANGED
@@ -22,4 +22,9 @@ export {
22
22
  createApproveDelegationTx,
23
23
  createRevokeDelegationTx,
24
24
  } from './helpers/token-delegation.js'
25
- export { createAndSignTxWithMpcKey, getAddressFromMpcKey, isMpcKey } from './mpc.js'
25
+ export {
26
+ createAndSignTxWithMpcKey,
27
+ getAddressFromMpcKey,
28
+ isMpcKey,
29
+ signUnsignedTxWithMpcKey,
30
+ } from './mpc.js'
package/src/mpc.js CHANGED
@@ -51,6 +51,17 @@ export async function createAndSignTxWithMpcKey(input, key) {
51
51
  })
52
52
  }
53
53
 
54
+ export async function signUnsignedTxWithMpcKey(unsignedTx, key) {
55
+ const decoded = bs58.decode(key)
56
+ const publicKey = decoded.slice(32)
57
+ const privateScalar = decoded.slice(0, 32)
58
+
59
+ return signUnsignedTxWithSigner(unsignedTx, {
60
+ getPublicKey: async () => publicKey,
61
+ sign: async ({ data }) => sign(data, privateScalar),
62
+ })
63
+ }
64
+
54
65
  export const getAddressFromMpcKey = (key) => {
55
66
  const decoded = bs58.decode(key)
56
67
  return getAddressFromPublicKey(decoded.slice(32))
@@ -58,10 +58,10 @@ export function getTransactionInstructionsFromMessage(message) {
58
58
  const { accounts, data, programIdIndex } = instruction
59
59
  return {
60
60
  programId: accountKeys[programIdIndex],
61
- keys: accounts.map((account, index) => ({
61
+ keys: accounts.map((account) => ({
62
62
  pubkey: accountKeys[account],
63
- isSigner: message.isAccountSigner(index),
64
- isWritable: message.isAccountWritable(index),
63
+ isSigner: message.isAccountSigner(account),
64
+ isWritable: message.isAccountWritable(account),
65
65
  })),
66
66
  data: bs58.decode(data),
67
67
  }