decharge-scout 2.5.1 → 2.5.5
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/index.js +4 -4
- package/package.json +1 -1
- package/src/oracle.js +6 -1
package/index.js
CHANGED
|
@@ -347,7 +347,7 @@ async function runQueryCycle(wallet, agentName, location, options) {
|
|
|
347
347
|
headers: { 'Content-Type': 'application/json' },
|
|
348
348
|
body: JSON.stringify({
|
|
349
349
|
...submissionData,
|
|
350
|
-
wallet:
|
|
350
|
+
wallet: wallet, // wallet parameter from runQueryCycle
|
|
351
351
|
run_number: totalRuns
|
|
352
352
|
})
|
|
353
353
|
});
|
|
@@ -373,8 +373,8 @@ async function runQueryCycle(wallet, agentName, location, options) {
|
|
|
373
373
|
const bonusPoints = savings > 15 ? 2 : 0; // Bonus for good savings
|
|
374
374
|
const totalPointsEarned = basePoints + bonusPoints;
|
|
375
375
|
|
|
376
|
-
awardPoints(
|
|
377
|
-
const currentPoints = getPoints(
|
|
376
|
+
awardPoints(wallet, totalPointsEarned);
|
|
377
|
+
const currentPoints = getPoints(wallet);
|
|
378
378
|
|
|
379
379
|
console.log(chalk.magenta(`\n⭐ Earned ${totalPointsEarned} points! (${basePoints} base${bonusPoints > 0 ? ` + ${bonusPoints} bonus` : ''})`));
|
|
380
380
|
console.log(chalk.magenta(`⭐ Total Points: ${currentPoints}`));
|
|
@@ -383,7 +383,7 @@ async function runQueryCycle(wallet, agentName, location, options) {
|
|
|
383
383
|
if (options.premium && totalRuns % 3 === 0) {
|
|
384
384
|
console.log(chalk.yellow('\n🔒 Premium Feature Available!'));
|
|
385
385
|
try {
|
|
386
|
-
const premiumData = await purchasePremiumData(
|
|
386
|
+
const premiumData = await purchasePremiumData(wallet);
|
|
387
387
|
console.log(chalk.green(`Premium forecast data: ${JSON.stringify(premiumData)}`));
|
|
388
388
|
} catch (error) {
|
|
389
389
|
console.log(chalk.red(`Premium purchase failed: ${error.message}`));
|
package/package.json
CHANGED
package/src/oracle.js
CHANGED
|
@@ -19,18 +19,23 @@ import crypto from 'crypto';
|
|
|
19
19
|
*/
|
|
20
20
|
export async function submitToOracle(wallet, submissionData) {
|
|
21
21
|
try {
|
|
22
|
+
console.log(`[DEBUG] submitToOracle called with wallet type: ${typeof wallet}, value: ${wallet}`);
|
|
23
|
+
|
|
22
24
|
const connection = getConnection();
|
|
23
25
|
|
|
24
26
|
// Handle both wallet object and wallet address string
|
|
25
27
|
let publicKey;
|
|
26
28
|
if (typeof wallet === 'string') {
|
|
27
29
|
// wallet is a base58 address string
|
|
30
|
+
console.log(`[DEBUG] Converting string address to PublicKey: ${wallet}`);
|
|
28
31
|
publicKey = new PublicKey(wallet);
|
|
32
|
+
console.log(`[DEBUG] PublicKey created successfully: ${publicKey ? publicKey.toBase58() : 'UNDEFINED'}`);
|
|
29
33
|
} else if (wallet?.publicKey) {
|
|
30
34
|
// wallet is a Keypair or wallet object
|
|
31
35
|
publicKey = wallet.publicKey;
|
|
36
|
+
console.log(`[DEBUG] Using wallet.publicKey: ${publicKey ? publicKey.toBase58() : 'UNDEFINED'}`);
|
|
32
37
|
} else {
|
|
33
|
-
throw new Error(
|
|
38
|
+
throw new Error(`Invalid wallet parameter: expected string address or wallet object, got ${typeof wallet}`);
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
// Check wallet balance first
|