four-flap-meme-sdk 1.3.88 → 1.3.90

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.
@@ -89,9 +89,20 @@ export async function getWavebreakBondingCurveInfo(bondingCurveOrMint, connectio
89
89
  const accountInfo = await conn.getAccountInfo(bondingCurveAddress);
90
90
  if (!accountInfo)
91
91
  return null;
92
+ // 检查账户 owner 是否是 Wavebreak 程序
93
+ if (accountInfo.owner.toBase58() !== WAVEBREAK_CONSTANTS.PROGRAM_ID) {
94
+ return null;
95
+ }
92
96
  // 使用 SDK 的解码器解析账户数据
93
- const decoder = sdk.getBondingCurveDecoder();
94
- const data = decoder.decode(accountInfo.data);
97
+ let data;
98
+ try {
99
+ const decoder = sdk.getBondingCurveDecoder();
100
+ data = decoder.decode(accountInfo.data);
101
+ }
102
+ catch (decodeError) {
103
+ // 解码失败,说明不是有效的 Wavebreak bonding curve 账户
104
+ return null;
105
+ }
95
106
  // 构建价格曲线
96
107
  const priceCurve = {
97
108
  startPrice: data.startPrice,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.3.88",
3
+ "version": "1.3.90",
4
4
  "description": "SDK for Flap bonding curve, four.meme TokenManager, and Solana DEX",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",