@exodus/solana-api 3.21.0 → 3.22.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 +20 -0
- package/package.json +2 -2
- package/src/api.js +5 -0
- package/src/create-unsigned-tx-for-send.js +1 -1
- package/src/get-fees.js +8 -5
- package/src/rpc-api.js +5 -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.22.1](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.22.0...@exodus/solana-api@3.22.1) (2025-10-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: address has history method (#6764)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [3.22.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.21.0...@exodus/solana-api@3.22.0) (2025-10-15)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* feat: solana update fee as zero with usedFeePayer (#6702)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [3.21.0](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.20.10...@exodus/solana-api@3.21.0) (2025-10-14)
|
|
7
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.1",
|
|
4
4
|
"description": "Transaction monitors, fee monitors, RPC with the blockchain node, and other networking code for Solana",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@exodus/assets-testing": "^1.0.0",
|
|
50
50
|
"@exodus/solana-web3.js": "^1.63.1-exodus.9-rc3"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "b52c267c62e177cb49b1d932ad971679c2231a53",
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
|
|
55
55
|
},
|
package/src/api.js
CHANGED
|
@@ -1038,6 +1038,11 @@ export class Api {
|
|
|
1038
1038
|
return value
|
|
1039
1039
|
}
|
|
1040
1040
|
|
|
1041
|
+
async addressHasHistory(address) {
|
|
1042
|
+
const value = await this.getAccountInfo(address)
|
|
1043
|
+
return !!value?.data
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1041
1046
|
async isSpl(address) {
|
|
1042
1047
|
const { owner } = await this.getAccountInfo(address)
|
|
1043
1048
|
return [TOKEN_PROGRAM_ID.toBase58(), TOKEN_2022_PROGRAM_ID.toBase58()].includes(owner)
|
|
@@ -51,7 +51,7 @@ export const createTxFactory = ({ assetClientInterface, api, feePayerClient }) =
|
|
|
51
51
|
creators,
|
|
52
52
|
// </MagicEden>
|
|
53
53
|
isExchange,
|
|
54
|
-
useFeePayer,
|
|
54
|
+
useFeePayer = true,
|
|
55
55
|
}) => {
|
|
56
56
|
assert(asset, 'asset is required')
|
|
57
57
|
assert(walletAccount, 'walletAccount is required')
|
package/src/get-fees.js
CHANGED
|
@@ -19,12 +19,10 @@ export const getFeeAsyncFactory = ({ createTx }) => {
|
|
|
19
19
|
|
|
20
20
|
if (providedUnsignedTx) {
|
|
21
21
|
unsignedTx = providedUnsignedTx
|
|
22
|
-
fee = asset.feeAsset.currency.baseUnit(unsignedTx.txMeta.fee)
|
|
23
22
|
} else {
|
|
24
23
|
if (['delegate', 'undelegate', 'withdraw'].includes(method)) {
|
|
25
24
|
assert(stakingInfo, 'stakingInfo is required for staking txs')
|
|
26
25
|
assert(rest.fromAddress, 'fromAddress is required for staking txs')
|
|
27
|
-
assert(feeData, 'feeData is required for staking txs')
|
|
28
26
|
|
|
29
27
|
// staking params
|
|
30
28
|
rest.method = method
|
|
@@ -59,16 +57,21 @@ export const getFeeAsyncFactory = ({ createTx }) => {
|
|
|
59
57
|
toAddress: toAddress ?? rest.fromAddress,
|
|
60
58
|
...rest,
|
|
61
59
|
})
|
|
62
|
-
|
|
63
|
-
fee = asset.feeAsset.currency.baseUnit(unsignedTx.txMeta.fee)
|
|
64
60
|
} catch (err) {
|
|
65
61
|
console.log('error computing right SOL fee:', err)
|
|
66
62
|
// simulating a tx will fail if the user has not enough balance
|
|
67
63
|
// we fallback to a default fee (but we could leave some dust)
|
|
68
|
-
fee = asset.feeAsset.currency.defaultUnit(DEFAULT_SAFE_FEE)
|
|
69
64
|
}
|
|
70
65
|
}
|
|
71
66
|
|
|
67
|
+
if (unsignedTx?.txMeta?.fee) {
|
|
68
|
+
fee = unsignedTx.txMeta.usedFeePayer
|
|
69
|
+
? asset.feeAsset.currency.ZERO
|
|
70
|
+
: asset.feeAsset.currency.baseUnit(unsignedTx.txMeta.fee)
|
|
71
|
+
} else {
|
|
72
|
+
fee = asset.feeAsset.currency.defaultUnit(DEFAULT_SAFE_FEE)
|
|
73
|
+
}
|
|
74
|
+
|
|
72
75
|
return { fee, unsignedTx }
|
|
73
76
|
}
|
|
74
77
|
}
|
package/src/rpc-api.js
CHANGED
|
@@ -196,6 +196,11 @@ export class RpcApi {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
async addressHasHistory(address) {
|
|
200
|
+
const value = await this.getAccountInfo(address)
|
|
201
|
+
return !!value?.data
|
|
202
|
+
}
|
|
203
|
+
|
|
199
204
|
async getTokenFeeBasisPoints(address) {
|
|
200
205
|
// only for token-2022
|
|
201
206
|
const value = await this.getAccountInfo(address)
|