From 0195ffc9fab2565ce241d7e84bc52da56e808554 Mon Sep 17 00:00:00 2001 From: Zuhwa Date: Wed, 31 Dec 2025 16:09:22 +0800 Subject: [PATCH 1/3] Skip x402 payment for zero budget --- src/acpJob.ts | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/acpJob.ts b/src/acpJob.ts index 37858f7..e963001 100644 --- a/src/acpJob.ts +++ b/src/acpJob.ts @@ -160,7 +160,8 @@ class AcpJob { } const feeAmount = new FareAmount(0, this.acpContractClient.config.baseFare); - const isPercentagePricing: boolean = this.priceType === PriceType.PERCENTAGE; + const isPercentagePricing: boolean = + this.priceType === PriceType.PERCENTAGE; operations.push( this.acpContractClient.createPayableMemo( @@ -171,9 +172,7 @@ class AcpJob { isPercentagePricing ? BigInt(Math.round(this.priceValue * 10000)) // convert to basis points : feeAmount.amount, - isPercentagePricing - ? FeeType.PERCENTAGE_FEE - : FeeType.NO_FEE, + isPercentagePricing ? FeeType.PERCENTAGE_FEE : FeeType.NO_FEE, AcpJobPhases.TRANSACTION, type, expiredAt, @@ -241,11 +240,13 @@ class AcpJob { ) ); - const x402PaymentDetails = - await this.acpContractClient.getX402PaymentDetails(this.id); + if (this.price > 0) { + const x402PaymentDetails = + await this.acpContractClient.getX402PaymentDetails(this.id); - if (x402PaymentDetails.isX402) { - await this.performX402Payment(this.price); + if (x402PaymentDetails.isX402) { + await this.performX402Payment(this.price); + } } return await this.acpContractClient.handleOperation(operations); @@ -371,7 +372,8 @@ class AcpJob { ); const feeAmount = new FareAmount(0, this.acpContractClient.config.baseFare); - const isPercentagePricing: boolean = this.priceType === PriceType.PERCENTAGE && !skipFee; + const isPercentagePricing: boolean = + this.priceType === PriceType.PERCENTAGE && !skipFee; operations.push( this.acpContractClient.createPayableMemo( @@ -382,9 +384,7 @@ class AcpJob { isPercentagePricing ? BigInt(Math.round(this.priceValue * 10000)) // convert to basis points : feeAmount.amount, - isPercentagePricing - ? FeeType.PERCENTAGE_FEE - : FeeType.NO_FEE, + isPercentagePricing ? FeeType.PERCENTAGE_FEE : FeeType.NO_FEE, AcpJobPhases.COMPLETED, MemoType.PAYABLE_TRANSFER, expiredAt, @@ -437,7 +437,8 @@ class AcpJob { ); const feeAmount = new FareAmount(0, this.acpContractClient.config.baseFare); - const isPercentagePricing: boolean = this.priceType === PriceType.PERCENTAGE && !skipFee; + const isPercentagePricing: boolean = + this.priceType === PriceType.PERCENTAGE && !skipFee; operations.push( this.acpContractClient.createPayableMemo( @@ -448,9 +449,7 @@ class AcpJob { isPercentagePricing ? BigInt(Math.round(this.priceValue * 10000)) // convert to basis points : feeAmount.amount, - isPercentagePricing - ? FeeType.PERCENTAGE_FEE - : FeeType.NO_FEE, + isPercentagePricing ? FeeType.PERCENTAGE_FEE : FeeType.NO_FEE, AcpJobPhases.COMPLETED, MemoType.PAYABLE_NOTIFICATION, expiredAt, From e2539dfc1b00d1bb4cebbeb28214fb18916224fd Mon Sep 17 00:00:00 2001 From: Celeste Ang Date: Mon, 5 Jan 2026 21:38:58 +0900 Subject: [PATCH 2/3] fix: change example to use 5min default expiry SLA --- examples/acp-base/skip-evaluation/buyer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/acp-base/skip-evaluation/buyer.ts b/examples/acp-base/skip-evaluation/buyer.ts index b631944..e23a105 100644 --- a/examples/acp-base/skip-evaluation/buyer.ts +++ b/examples/acp-base/skip-evaluation/buyer.ts @@ -70,7 +70,7 @@ async function buyer() { "": "", }, undefined, // evaluator address, undefined fallback to empty address - skip-evaluation - new Date(Date.now() + 1000 * 60 * 3.1) // job expiry duration, minimum 3 minutes + new Date(Date.now() + 1000 * 60 * 5) // job expiry duration, minimum 5 minutes ); console.log(`Job ${jobId} initiated`); From 22f56ba56407e062021bca8d9e4d32c302df3828 Mon Sep 17 00:00:00 2001 From: Celeste Ang Date: Mon, 5 Jan 2026 21:45:38 +0900 Subject: [PATCH 3/3] bump to 0.3.0-beta.17 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8decc20..b789c30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@virtuals-protocol/acp-node", - "version": "0.3.0-beta.16", + "version": "0.3.0-beta.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@virtuals-protocol/acp-node", - "version": "0.3.0-beta.16", + "version": "0.3.0-beta.17", "license": "ISC", "dependencies": { "@aa-sdk/core": "^4.73.0", diff --git a/package.json b/package.json index 4526817..e18fdf3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@virtuals-protocol/acp-node", - "version": "0.3.0-beta.16", + "version": "0.3.0-beta.17", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts",