@exodus/solana-lib 3.13.0 → 3.14.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,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.14.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.14.0...@exodus/solana-lib@3.14.1) (2025-10-28)
7
+
8
+ **Note:** Version bump only for package @exodus/solana-lib
9
+
10
+
11
+
12
+
13
+
14
+ ## [3.14.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.13.0...@exodus/solana-lib@3.14.0) (2025-10-27)
15
+
16
+
17
+ ### Features
18
+
19
+
20
+ * feat: SOL agent accounts (#6757)
21
+
22
+
23
+
6
24
  ## [3.13.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.12.2...@exodus/solana-lib@3.13.0) (2025-10-14)
7
25
 
8
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-lib",
3
- "version": "3.13.0",
3
+ "version": "3.14.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",
@@ -47,5 +47,5 @@
47
47
  "type": "git",
48
48
  "url": "git+https://github.com/ExodusMovement/assets.git"
49
49
  },
50
- "gitHead": "5acad66ba9ec02ffaee656516f72a24ff8a247fb"
50
+ "gitHead": "7b513ef03729247625713c4b6ee7deb2eb9358ac"
51
51
  }
@@ -0,0 +1,47 @@
1
+ import { TOKEN_PROGRAM_ID } from '../constants.js'
2
+ import { findAssociatedTokenAddress } from '../encode.js'
3
+ import { PublicKey, Transaction as SolanaWeb3Transaction } from '../vendor/index.js'
4
+ import { Token, U64 } from './spl-token.js'
5
+ import { createAssociatedTokenAccount } from './tokenTransfer.js'
6
+
7
+ const MAX_U64 = new U64('ffffffffffffffff', 'hex')
8
+
9
+ export const createAgentTokenInitTx = ({
10
+ agentWalletAddress,
11
+ feePayerWalletAddress,
12
+ tokenMintAddress,
13
+ recentBlockhash,
14
+ delegateAccount,
15
+ }) => {
16
+ const createATAInstruction = createAssociatedTokenAccount(
17
+ feePayerWalletAddress,
18
+ tokenMintAddress,
19
+ agentWalletAddress,
20
+ TOKEN_PROGRAM_ID.toBase58()
21
+ )
22
+
23
+ const agentTokenAccount = findAssociatedTokenAddress(
24
+ agentWalletAddress,
25
+ tokenMintAddress,
26
+ TOKEN_PROGRAM_ID.toBase58()
27
+ )
28
+
29
+ const approveInstruction = Token.createApproveInstruction(
30
+ TOKEN_PROGRAM_ID,
31
+ new PublicKey(agentTokenAccount),
32
+ new PublicKey(delegateAccount),
33
+ new PublicKey(agentWalletAddress),
34
+ [],
35
+ MAX_U64
36
+ )
37
+
38
+ const transaction = new SolanaWeb3Transaction({
39
+ recentBlockhash,
40
+ feePayer: new PublicKey(feePayerWalletAddress),
41
+ })
42
+
43
+ transaction.add(createATAInstruction)
44
+ transaction.add(approveInstruction)
45
+
46
+ return transaction
47
+ }
@@ -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/index.js CHANGED
@@ -15,3 +15,4 @@ export {
15
15
  export { default as Transaction } from './transaction.js'
16
16
  export { U64, Token } from './helpers/spl-token.js'
17
17
  export { createGetKeyIdentifier, getSupportedPurposes } from './key-identifier.js'
18
+ export { createAgentTokenInitTx } from './helpers/create-agent-token-init-tx.js'