decharge-scout 2.5.1 → 2.5.4
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/package.json +1 -1
- package/src/oracle.js +6 -1
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
|