Skip to content

Commit 5356475

Browse files
authored
Merge pull request #135 from Virtual-Protocol/docs/yang-update-examples
docs: beautify log
2 parents a517def + 9b19774 commit 5356475

2 files changed

Lines changed: 25 additions & 21 deletions

File tree

examples/acp-base/skip-evaluation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const acpClient = new AcpClient({
145145
- No evaluator agent (skip-evaluation pattern)
146146
- Both agents must be registered and whitelisted on the ACP platform
147147
- Replace `<your-filter-agent-keyword>` with your actual search term
148-
- Replace `<your_schema_field>` and `<your_schema_value>` with actual schema requirements
148+
- Replace `<your-schema-field>` and `<your-schema-value>` with actual schema requirements
149149

150150
## Troubleshooting
151151

src/acpClient.ts

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
IAcpJob,
1919
IAcpJobResponse,
2020
IAcpMemo,
21-
PayableDetails,
2221
} from "./interfaces";
2322
import AcpError from "./acpError";
2423
import { FareAmountBase } from "./acpFare";
@@ -29,9 +28,10 @@ import {
2928
baseSepoliaAcpConfig,
3029
baseSepoliaAcpX402Config,
3130
} from "./configs/acpConfigs";
32-
import { preparePayload, tryParseJson } from "./utils";
31+
import { preparePayload } from "./utils";
3332
import { USDC_TOKEN_ADDRESS } from "./constants";
34-
const { version } = require("../package.json");
33+
34+
const {version} = require("../package.json");
3535

3636
enum SocketEvents {
3737
ROOM_JOINED = "roomJoined",
@@ -370,22 +370,22 @@ class AcpClient {
370370
const createJobPayload =
371371
isV1 || !account
372372
? this.acpContractClient.createJob(
373-
providerAddress,
374-
evaluatorAddress || defaultEvaluatorAddress,
375-
expiredAt,
376-
fareAmount.fare.contractAddress,
377-
fareAmount.amount,
378-
"",
379-
isX402Job,
380-
)
373+
providerAddress,
374+
evaluatorAddress || defaultEvaluatorAddress,
375+
expiredAt,
376+
fareAmount.fare.contractAddress,
377+
fareAmount.amount,
378+
"",
379+
isX402Job,
380+
)
381381
: this.acpContractClient.createJobWithAccount(
382-
account.id,
383-
evaluatorAddress || defaultEvaluatorAddress,
384-
fareAmount.amount,
385-
fareAmount.fare.contractAddress,
386-
expiredAt,
387-
isX402Job,
388-
);
382+
account.id,
383+
evaluatorAddress || defaultEvaluatorAddress,
384+
fareAmount.amount,
385+
fareAmount.fare.contractAddress,
386+
expiredAt,
387+
isX402Job,
388+
);
389389

390390
const { userOpHash } = await this.acpContractClient.handleOperation([
391391
createJobPayload,
@@ -539,8 +539,12 @@ class AcpClient {
539539

540540
if (errors.length > 0) {
541541
console.warn(
542-
`${options?.logPrefix ?? "Skipped"} ${errors.length} malformed job(s)`,
543-
errors.map(e => ({ jobId: e.jobId, message: e.error.message }))
542+
`${options?.logPrefix ?? "Skipped"} ${errors.length} malformed job(s)\n` +
543+
JSON.stringify(
544+
errors.map(e => ({jobId: e.jobId, message: e.error.message})),
545+
null,
546+
2
547+
)
544548
);
545549
}
546550

0 commit comments

Comments
 (0)