@exodus/solana-lib 3.12.2 → 3.14.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 +20 -0
- package/package.json +4 -3
- package/src/fee-data/index.js +1 -0
- package/src/helpers/create-agent-token-init-tx.js +47 -0
- package/src/index.js +1 -0
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
|
+
## [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
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: SOL agent accounts (#6757)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [3.13.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.12.2...@exodus/solana-lib@3.13.0) (2025-10-14)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* feat: integrate Solana fee payer service (#6615)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [3.12.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-lib@3.12.1...@exodus/solana-lib@3.12.2) (2025-09-29)
|
|
7
27
|
|
|
8
28
|
**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.14.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",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"author": "Exodus Movement, Inc.",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"publishConfig": {
|
|
15
|
-
"access": "public"
|
|
15
|
+
"access": "public",
|
|
16
|
+
"provenance": false
|
|
16
17
|
},
|
|
17
18
|
"scripts": {
|
|
18
19
|
"test": "run -T exodus-test --jest",
|
|
@@ -46,5 +47,5 @@
|
|
|
46
47
|
"type": "git",
|
|
47
48
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
48
49
|
},
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "a5882a43d39ef9455f25523d20ed3060b40eb1a8"
|
|
50
51
|
}
|
package/src/fee-data/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export const createFeeData = ({ asset }) =>
|
|
|
8
8
|
priorityFee: 1_000_000,
|
|
9
9
|
fuelThreshold: `0.000015 ${asset.ticker}`,
|
|
10
10
|
computeUnitsMultiplier: 1, // compute units buffer, increasing to > 1 can cause Dust issues.
|
|
11
|
+
enableFeePayer: false,
|
|
11
12
|
},
|
|
12
13
|
mainKey: 'fee',
|
|
13
14
|
currency: asset.currency,
|
|
@@ -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
|
+
}
|
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'
|