@agether/agether 1.3.1 → 1.3.2
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/index.ts +6 -3
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -536,13 +536,14 @@ export default function register(api: any) {
|
|
|
536
536
|
const agentId = client.getAgentId();
|
|
537
537
|
|
|
538
538
|
if (params.refresh) {
|
|
539
|
-
// x402-gated fresh score
|
|
539
|
+
// x402-gated fresh score — account address required for payment
|
|
540
|
+
const accountAddress = await client.getAccountAddress();
|
|
540
541
|
const x402 = new X402Client({
|
|
541
542
|
privateKey: cfg.privateKey,
|
|
542
543
|
rpcUrl: cfg.rpcUrl,
|
|
543
544
|
backendUrl: cfg.backendUrl,
|
|
544
545
|
agentId,
|
|
545
|
-
accountAddress
|
|
546
|
+
accountAddress,
|
|
546
547
|
});
|
|
547
548
|
const result = await x402.get(`${cfg.backendUrl}/score/${agentId}`);
|
|
548
549
|
if (!result.success) return fail(result.error || "Score request failed");
|
|
@@ -613,7 +614,9 @@ export default function register(api: any) {
|
|
|
613
614
|
try {
|
|
614
615
|
agentId = client.getAgentId();
|
|
615
616
|
accountAddress = await client.getAccountAddress();
|
|
616
|
-
} catch {
|
|
617
|
+
} catch (e) {
|
|
618
|
+
console.warn('[agether] x402_pay: getAccountAddress failed, paying from EOA:', e instanceof Error ? e.message : e);
|
|
619
|
+
}
|
|
617
620
|
|
|
618
621
|
const autoDrawEnabled = params.autoDraw === true; // default false — opt-in only
|
|
619
622
|
const x402 = new X402Client({
|