Skip to content

Commit 1294403

Browse files
committed
fix iq6900 plugin breaking
1 parent df5fc8b commit 1294403

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,14 @@ PYTH_MAINNET_HERMES_URL=https://hermes.pyth.network
659659
PYTH_MAINNET_WSS_URL=wss://hermes.pyth.network/ws
660660
PYTH_MAINNET_PYTHNET_URL=https://pythnet.rpcpool.com
661661
PYTH_MAINNET_CONTRACT_REGISTRY=https://pyth.network/developers/price-feed-ids
662-
PYTH_MAINNET_PROGRAM_KEY=FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH
662+
PYTH_MAINNET_PROGRAM_KEY=
663663

664664
# Testnet Network Configuration
665665
PYTH_TESTNET_HERMES_URL=https://hermes.pyth.network
666666
PYTH_TESTNET_WSS_URL=wss://hermes.pyth.network/ws
667667
PYTH_TESTNET_PYTHNET_URL=https://pythnet.rpcpool.com
668668
PYTH_TESTNET_CONTRACT_REGISTRY=https://pyth.network/developers/price-feed-ids#testnet
669-
PYTH_TESTNET_PROGRAM_KEY=FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH
669+
PYTH_TESTNET_PROGRAM_KEY=
670670

671671
# Connection Settings
672672
PYTH_MAX_RETRIES=3

agent/src/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,10 @@ export async function createAgent(
10181018
getSecret(character, "RESERVOIR_API_KEY")
10191019
? createNFTCollectionsPlugin()
10201020
: null,
1021-
getSecret(character, "PYTH_GRANULAR_LOG") ? pythDataPlugin : null,
1022-
1021+
getSecret(character, "PYTH_TESTNET_PROGRAM_KEY") ||
1022+
getSecret(character, "PYTH_MAINNET_PROGRAM_KEY")
1023+
? pythDataPlugin
1024+
: null,
10231025
].filter(Boolean),
10241026
providers: [],
10251027
actions: [],

packages/plugin-iq6900/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "dist/index.d.ts",
77
"dependencies": {
88
"@elizaos/core": "workspace:*",
9-
"@solana/web3.js": "1.95.8"
9+
"@solana/web3.js": "^1.95.8"
1010
},
1111
"devDependencies": {
1212
"tsup": "8.3.5",

packages/plugin-iq6900/src/functions/bringIQData.ts

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { elizaLogger } from "@elizaos/core";
22

33
import { Connection, PublicKey } from "@solana/web3.js";
4-
const network = process.env.IQSOlRPC||"https://api.mainnet-beta.solana.com";
4+
const network = process.env.IQSOlRPC || "https://api.mainnet-beta.solana.com";
55
const stringAddress = process.env.IQ_WALLET_ADDRESS;
66

77
const connection = new Connection(network, "confirmed");
@@ -10,18 +10,14 @@ const iqHost = "https://solanacontractapi.uc.r.appspot.com";
1010

1111
async function fetchDBPDA(): Promise<string> {
1212
try {
13-
if(stringAddress){
13+
if (stringAddress) {
1414
elizaLogger.info("Connecting to Solana...(IQ6900)");
1515
elizaLogger.info("Your Address:" + stringAddress);
1616
const response = await fetch(`${iqHost}/getDBPDA/${stringAddress}`);
1717
const data = await response.json();
1818
if (response.ok) {
1919
return data.DBPDA as string;
20-
} else {
21-
throw new Error(data.error || "Failed to fetch PDA");
2220
}
23-
}else{
24-
return "null";
2521
}
2622
} catch (error) {
2723
console.error("Error fetching PDA:", error);
@@ -160,8 +156,8 @@ async function fetchSignaturesForAddress(
160156
}
161157

162158
async function findRecentJsonSignature(): Promise<string> {
163-
164159
const dbAddress = await fetchDBPDA();
160+
if (!dbAddress) return;
165161
const signatures = await fetchSignaturesForAddress(
166162
new PublicKey(dbAddress)
167163
);
@@ -170,15 +166,14 @@ async function findRecentJsonSignature(): Promise<string> {
170166
const commit = await extractCommitMessage(signature);
171167
if (commit !== "null") return signature;
172168
}
173-
return "null";
169+
return;
174170
}
175171

176172
export async function bringAgentWithWalletAddress() {
177-
178173
const recent = await findRecentJsonSignature();
179-
if (recent === "null") {
174+
if (!recent) {
180175
elizaLogger.error("Cannot found onchain data in this wallet.");
181-
return "null";
176+
return;
182177
}
183178
const result = await bringCode(recent);
184179
const json_string = result.json_data;

pnpm-lock.yaml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)