@virtuals-protocol/acp-node 0.3.0-beta.7 → 0.3.0-beta.9
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/dist/index.d.mts +231 -109
- package/dist/index.d.ts +231 -109
- package/dist/index.js +1877 -1381
- package/dist/index.mjs +1879 -1381
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
|
-
import { Address, Chain } from 'viem';
|
|
2
|
+
import { Address, Chain, createPublicClient } from 'viem';
|
|
3
3
|
import * as _aa_sdk_core from '@aa-sdk/core';
|
|
4
4
|
import { Address as Address$1, SmartAccountSigner } from '@aa-sdk/core';
|
|
5
5
|
import { baseSepolia, base } from '@account-kit/infra';
|
|
@@ -9,6 +9,7 @@ import * as _aa_sdk_core_dist_types_actions_smartAccount_signMessage from '@aa-s
|
|
|
9
9
|
import * as _aa_sdk_core_dist_types_actions_smartAccount_checkGasSponsorshipEligibility from '@aa-sdk/core/dist/types/actions/smartAccount/checkGasSponsorshipEligibility';
|
|
10
10
|
import * as viem__types_utils_ccip from 'viem/_types/utils/ccip';
|
|
11
11
|
import * as _account_kit_smart_contracts from '@account-kit/smart-contracts';
|
|
12
|
+
import { ModularAccountV2Client } from '@account-kit/smart-contracts';
|
|
12
13
|
|
|
13
14
|
declare const ACP_ABI: ({
|
|
14
15
|
inputs: never[];
|
|
@@ -176,76 +177,6 @@ declare const ACP_V2_ABI: ({
|
|
|
176
177
|
anonymous?: undefined;
|
|
177
178
|
})[];
|
|
178
179
|
|
|
179
|
-
declare class AcpContractConfig {
|
|
180
|
-
chain: typeof baseSepolia | typeof base;
|
|
181
|
-
contractAddress: Address$1;
|
|
182
|
-
baseFare: Fare;
|
|
183
|
-
alchemyRpcUrl: string;
|
|
184
|
-
acpUrl: string;
|
|
185
|
-
abi: typeof ACP_ABI | typeof ACP_V2_ABI;
|
|
186
|
-
rpcEndpoint?: string | undefined;
|
|
187
|
-
constructor(chain: typeof baseSepolia | typeof base, contractAddress: Address$1, baseFare: Fare, alchemyRpcUrl: string, acpUrl: string, abi: typeof ACP_ABI | typeof ACP_V2_ABI, rpcEndpoint?: string | undefined);
|
|
188
|
-
}
|
|
189
|
-
declare const baseSepoliaAcpConfig: AcpContractConfig;
|
|
190
|
-
declare const baseSepoliaAcpConfigV2: AcpContractConfig;
|
|
191
|
-
declare const baseAcpConfig: AcpContractConfig;
|
|
192
|
-
declare const baseAcpConfigV2: AcpContractConfig;
|
|
193
|
-
|
|
194
|
-
declare enum MemoType {
|
|
195
|
-
MESSAGE = 0,// 0 - Text message
|
|
196
|
-
CONTEXT_URL = 1,// 1 - URL for context
|
|
197
|
-
IMAGE_URL = 2,// 2 - Image URL
|
|
198
|
-
VOICE_URL = 3,// 3 - Voice/audio URL
|
|
199
|
-
OBJECT_URL = 4,// 4 - Object/file URL
|
|
200
|
-
TXHASH = 5,// 5 - Transaction hash reference
|
|
201
|
-
PAYABLE_REQUEST = 6,// 6 - Payment request
|
|
202
|
-
PAYABLE_TRANSFER = 7,// 7 - Direct payment transfer
|
|
203
|
-
PAYABLE_TRANSFER_ESCROW = 8,// 8 - Escrowed payment transfer
|
|
204
|
-
NOTIFICATION = 9,// 9 - Notification
|
|
205
|
-
PAYABLE_NOTIFICATION = 10
|
|
206
|
-
}
|
|
207
|
-
declare enum AcpJobPhases {
|
|
208
|
-
REQUEST = 0,
|
|
209
|
-
NEGOTIATION = 1,
|
|
210
|
-
TRANSACTION = 2,
|
|
211
|
-
EVALUATION = 3,
|
|
212
|
-
COMPLETED = 4,
|
|
213
|
-
REJECTED = 5,
|
|
214
|
-
EXPIRED = 6
|
|
215
|
-
}
|
|
216
|
-
declare enum FeeType {
|
|
217
|
-
NO_FEE = 0,
|
|
218
|
-
IMMEDIATE_FEE = 1,
|
|
219
|
-
DEFERRED_FEE = 2,
|
|
220
|
-
PERCENTAGE_FEE = 3
|
|
221
|
-
}
|
|
222
|
-
interface OperationPayload {
|
|
223
|
-
data: `0x${string}`;
|
|
224
|
-
contractAddress: Address;
|
|
225
|
-
value?: bigint;
|
|
226
|
-
}
|
|
227
|
-
declare abstract class BaseAcpContractClient {
|
|
228
|
-
agentWalletAddress: Address;
|
|
229
|
-
config: AcpContractConfig;
|
|
230
|
-
contractAddress: Address;
|
|
231
|
-
chain: Chain;
|
|
232
|
-
abi: typeof ACP_ABI | typeof ACP_V2_ABI;
|
|
233
|
-
jobCreatedSignature: string;
|
|
234
|
-
constructor(agentWalletAddress: Address, config?: AcpContractConfig);
|
|
235
|
-
abstract handleOperation(operations: OperationPayload[]): Promise<Address>;
|
|
236
|
-
abstract getJobId(hash: Address, clientAddress: Address, providerAddress: Address): Promise<number>;
|
|
237
|
-
get walletAddress(): `0x${string}`;
|
|
238
|
-
createJobWithAccount(accountId: number, evaluatorAddress: Address, budgetBaseUnit: bigint, paymentTokenAddress: Address, expiredAt: Date): OperationPayload;
|
|
239
|
-
createJob(providerAddress: Address, evaluatorAddress: Address, expiredAt: Date, paymentTokenAddress: Address, budgetBaseUnit: bigint, metadata: string): OperationPayload;
|
|
240
|
-
approveAllowance(amountBaseUnit: bigint, paymentTokenAddress?: Address): OperationPayload;
|
|
241
|
-
createPayableMemo(jobId: number, content: string, amountBaseUnit: bigint, recipient: Address, feeAmountBaseUnit: bigint, feeType: FeeType, nextPhase: AcpJobPhases, type: MemoType.PAYABLE_REQUEST | MemoType.PAYABLE_TRANSFER_ESCROW | MemoType.PAYABLE_TRANSFER | MemoType.PAYABLE_NOTIFICATION, expiredAt: Date, token?: Address, secured?: boolean): OperationPayload;
|
|
242
|
-
createMemo(jobId: number, content: string, type: MemoType, isSecured: boolean, nextPhase: AcpJobPhases): OperationPayload;
|
|
243
|
-
signMemo(memoId: number, isApproved: boolean, reason?: string): OperationPayload;
|
|
244
|
-
setBudgetWithPaymentToken(jobId: number, budgetBaseUnit: bigint, paymentTokenAddress?: Address): OperationPayload | undefined;
|
|
245
|
-
updateAccountMetadata(accountId: number, metadata: string): OperationPayload;
|
|
246
|
-
wrapEth(amountBaseUnit: bigint): OperationPayload;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
180
|
declare class AcpAccount {
|
|
250
181
|
contractClient: BaseAcpContractClient;
|
|
251
182
|
id: number;
|
|
@@ -292,6 +223,48 @@ declare class AcpJobOffering {
|
|
|
292
223
|
initiateJob(serviceRequirement: Object | string, evaluatorAddress?: Address, expiredAt?: Date): Promise<number>;
|
|
293
224
|
}
|
|
294
225
|
|
|
226
|
+
declare class AcpJob {
|
|
227
|
+
private acpClient;
|
|
228
|
+
id: number;
|
|
229
|
+
clientAddress: Address;
|
|
230
|
+
providerAddress: Address;
|
|
231
|
+
evaluatorAddress: Address;
|
|
232
|
+
price: number;
|
|
233
|
+
priceTokenAddress: Address;
|
|
234
|
+
memos: AcpMemo[];
|
|
235
|
+
phase: AcpJobPhases;
|
|
236
|
+
context: Record<string, any>;
|
|
237
|
+
contractAddress: Address;
|
|
238
|
+
name: string | undefined;
|
|
239
|
+
requirement: Record<string, any> | string | undefined;
|
|
240
|
+
priceType: PriceType;
|
|
241
|
+
priceValue: number;
|
|
242
|
+
constructor(acpClient: AcpClient, id: number, clientAddress: Address, providerAddress: Address, evaluatorAddress: Address, price: number, priceTokenAddress: Address, memos: AcpMemo[], phase: AcpJobPhases, context: Record<string, any>, contractAddress: Address);
|
|
243
|
+
get acpContractClient(): BaseAcpContractClient;
|
|
244
|
+
get config(): AcpContractConfig;
|
|
245
|
+
get baseFare(): Fare;
|
|
246
|
+
get deliverable(): string | undefined;
|
|
247
|
+
get rejectionReason(): string | undefined;
|
|
248
|
+
get providerAgent(): Promise<AcpAgent | undefined>;
|
|
249
|
+
get clientAgent(): Promise<AcpAgent | undefined>;
|
|
250
|
+
get evaluatorAgent(): Promise<AcpAgent | undefined>;
|
|
251
|
+
get account(): Promise<AcpAccount | null>;
|
|
252
|
+
get latestMemo(): AcpMemo | undefined;
|
|
253
|
+
createRequirement(content: string): Promise<`0x${string}`>;
|
|
254
|
+
createPayableRequirement(content: string, type: MemoType.PAYABLE_REQUEST | MemoType.PAYABLE_TRANSFER_ESCROW, amount: FareAmountBase, recipient: Address, expiredAt?: Date): Promise<`0x${string}`>;
|
|
255
|
+
payAndAcceptRequirement(reason?: string): Promise<`0x${string}`>;
|
|
256
|
+
respond(accept: boolean, reason?: string): Promise<`0x${string}`>;
|
|
257
|
+
accept(reason?: string): Promise<`0x${string}`>;
|
|
258
|
+
reject(reason?: string): Promise<`0x${string}`>;
|
|
259
|
+
rejectPayable(reason: string | undefined, amount: FareAmountBase, expiredAt?: Date): Promise<`0x${string}`>;
|
|
260
|
+
deliver(deliverable: DeliverablePayload): Promise<`0x${string}`>;
|
|
261
|
+
deliverPayable(deliverable: DeliverablePayload, amount: FareAmountBase, expiredAt?: Date): Promise<`0x${string}`>;
|
|
262
|
+
evaluate(accept: boolean, reason?: string): Promise<void>;
|
|
263
|
+
createNotification(content: string): Promise<`0x${string}`>;
|
|
264
|
+
createPayableNotification(content: string, amount: FareAmountBase, expiredAt?: Date): Promise<`0x${string}`>;
|
|
265
|
+
private performX402Payment;
|
|
266
|
+
}
|
|
267
|
+
|
|
295
268
|
type DeliverablePayload = string | Record<string, unknown>;
|
|
296
269
|
/** @deprecated Use DeliverablePayload instead */
|
|
297
270
|
type IDeliverable = DeliverablePayload;
|
|
@@ -322,6 +295,10 @@ declare enum AcpOnlineStatus {
|
|
|
322
295
|
ONLINE = "online",
|
|
323
296
|
OFFLINE = "offline"
|
|
324
297
|
}
|
|
298
|
+
interface IAcpJobX402PaymentDetails {
|
|
299
|
+
isX402: boolean;
|
|
300
|
+
isBudgetReceived: boolean;
|
|
301
|
+
}
|
|
325
302
|
interface IAcpClientOptions {
|
|
326
303
|
acpContractClient: BaseAcpContractClient | BaseAcpContractClient[];
|
|
327
304
|
onNewTask?: (job: AcpJob, memoToSign?: AcpMemo) => void;
|
|
@@ -424,46 +401,164 @@ type ClosePositionPayload = {
|
|
|
424
401
|
type RequestClosePositionPayload = {
|
|
425
402
|
positionId: number;
|
|
426
403
|
};
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
404
|
+
type X402Config = {
|
|
405
|
+
url: string;
|
|
406
|
+
};
|
|
407
|
+
type X402PayableRequirements = {
|
|
408
|
+
x402Version: number;
|
|
409
|
+
error: string;
|
|
410
|
+
accepts: X402Requirement[];
|
|
411
|
+
};
|
|
412
|
+
type X402Requirement = {
|
|
413
|
+
scheme: string;
|
|
414
|
+
network: string;
|
|
415
|
+
maxAmountRequired: string;
|
|
416
|
+
resource: string;
|
|
417
|
+
description: string;
|
|
418
|
+
mimeType: string;
|
|
419
|
+
payTo: Address;
|
|
420
|
+
maxTimeoutSeconds: number;
|
|
421
|
+
asset: Address;
|
|
422
|
+
extra: {
|
|
423
|
+
name: string;
|
|
424
|
+
version: string;
|
|
425
|
+
};
|
|
426
|
+
outputSchema: any;
|
|
427
|
+
};
|
|
428
|
+
type X402PayableRequest = {
|
|
429
|
+
to: Address;
|
|
430
|
+
value: number;
|
|
431
|
+
maxTimeoutSeconds: number;
|
|
432
|
+
asset: Address;
|
|
433
|
+
};
|
|
434
|
+
type X402Payment = {
|
|
435
|
+
encodedPayment: string;
|
|
436
|
+
signature: string;
|
|
437
|
+
message: {
|
|
438
|
+
from: Address;
|
|
439
|
+
to: Address;
|
|
440
|
+
value: string;
|
|
441
|
+
validAfter: string;
|
|
442
|
+
validBefore: string;
|
|
443
|
+
nonce: string;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
type OffChainJob = {
|
|
430
447
|
id: number;
|
|
448
|
+
documentId: string;
|
|
449
|
+
txHash: Address;
|
|
450
|
+
clientId: number;
|
|
451
|
+
providerId: number;
|
|
452
|
+
budget: number;
|
|
453
|
+
createdAt: string;
|
|
454
|
+
updatedAt: string;
|
|
455
|
+
publishedAt: string;
|
|
456
|
+
locale: string | null;
|
|
431
457
|
clientAddress: Address;
|
|
432
458
|
providerAddress: Address;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
priceTokenAddress: Address;
|
|
436
|
-
memos: AcpMemo[];
|
|
459
|
+
evaluators: Address[];
|
|
460
|
+
budgetTxHash: Address | null;
|
|
437
461
|
phase: AcpJobPhases;
|
|
438
|
-
|
|
462
|
+
agentIdPair: string;
|
|
463
|
+
onChainJobId: string;
|
|
464
|
+
summary: string;
|
|
465
|
+
userOpHash: Address | null;
|
|
466
|
+
amountClaimed: number;
|
|
467
|
+
context: Record<string, any> | null;
|
|
468
|
+
expiry: string;
|
|
469
|
+
refundRetryTimes: number;
|
|
470
|
+
additionalFees: number;
|
|
471
|
+
budgetTokenAddress: Address;
|
|
472
|
+
budgetUSD: number;
|
|
473
|
+
amountClaimedUSD: number | null;
|
|
474
|
+
additionalFeesUSD: number | null;
|
|
439
475
|
contractAddress: Address;
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
476
|
+
accountId: number | null;
|
|
477
|
+
x402Nonce: string;
|
|
478
|
+
};
|
|
479
|
+
type X402PaymentResponse = {
|
|
480
|
+
isPaymentRequired: boolean;
|
|
481
|
+
data: X402PayableRequirements;
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
declare class AcpContractConfig {
|
|
485
|
+
chain: typeof baseSepolia | typeof base;
|
|
486
|
+
contractAddress: Address$1;
|
|
487
|
+
baseFare: Fare;
|
|
488
|
+
alchemyRpcUrl: string;
|
|
489
|
+
acpUrl: string;
|
|
490
|
+
abi: typeof ACP_ABI | typeof ACP_V2_ABI;
|
|
491
|
+
rpcEndpoint?: string | undefined;
|
|
492
|
+
x402Config?: X402Config | undefined;
|
|
493
|
+
constructor(chain: typeof baseSepolia | typeof base, contractAddress: Address$1, baseFare: Fare, alchemyRpcUrl: string, acpUrl: string, abi: typeof ACP_ABI | typeof ACP_V2_ABI, rpcEndpoint?: string | undefined, x402Config?: X402Config | undefined);
|
|
494
|
+
}
|
|
495
|
+
declare const baseSepoliaAcpConfig: AcpContractConfig;
|
|
496
|
+
declare const baseSepoliaAcpConfigV2: AcpContractConfig;
|
|
497
|
+
declare const baseAcpConfig: AcpContractConfig;
|
|
498
|
+
declare const baseAcpX402Config: AcpContractConfig;
|
|
499
|
+
declare const baseAcpConfigV2: AcpContractConfig;
|
|
500
|
+
declare const baseAcpX402ConfigV2: AcpContractConfig;
|
|
501
|
+
|
|
502
|
+
declare enum MemoType {
|
|
503
|
+
MESSAGE = 0,// 0 - Text message
|
|
504
|
+
CONTEXT_URL = 1,// 1 - URL for context
|
|
505
|
+
IMAGE_URL = 2,// 2 - Image URL
|
|
506
|
+
VOICE_URL = 3,// 3 - Voice/audio URL
|
|
507
|
+
OBJECT_URL = 4,// 4 - Object/file URL
|
|
508
|
+
TXHASH = 5,// 5 - Transaction hash reference
|
|
509
|
+
PAYABLE_REQUEST = 6,// 6 - Payment request
|
|
510
|
+
PAYABLE_TRANSFER = 7,// 7 - Direct payment transfer
|
|
511
|
+
PAYABLE_TRANSFER_ESCROW = 8,// 8 - Escrowed payment transfer
|
|
512
|
+
NOTIFICATION = 9,// 9 - Notification
|
|
513
|
+
PAYABLE_NOTIFICATION = 10
|
|
514
|
+
}
|
|
515
|
+
declare enum AcpJobPhases {
|
|
516
|
+
REQUEST = 0,
|
|
517
|
+
NEGOTIATION = 1,
|
|
518
|
+
TRANSACTION = 2,
|
|
519
|
+
EVALUATION = 3,
|
|
520
|
+
COMPLETED = 4,
|
|
521
|
+
REJECTED = 5,
|
|
522
|
+
EXPIRED = 6
|
|
523
|
+
}
|
|
524
|
+
declare enum FeeType {
|
|
525
|
+
NO_FEE = 0,
|
|
526
|
+
IMMEDIATE_FEE = 1,
|
|
527
|
+
DEFERRED_FEE = 2,
|
|
528
|
+
PERCENTAGE_FEE = 3
|
|
529
|
+
}
|
|
530
|
+
interface OperationPayload {
|
|
531
|
+
data: `0x${string}`;
|
|
532
|
+
contractAddress: Address;
|
|
533
|
+
value?: bigint;
|
|
534
|
+
}
|
|
535
|
+
declare abstract class BaseAcpContractClient {
|
|
536
|
+
agentWalletAddress: Address;
|
|
537
|
+
config: AcpContractConfig;
|
|
538
|
+
contractAddress: Address;
|
|
539
|
+
chain: Chain;
|
|
540
|
+
abi: typeof ACP_ABI | typeof ACP_V2_ABI;
|
|
541
|
+
jobCreatedSignature: string;
|
|
542
|
+
publicClient: ReturnType<typeof createPublicClient>;
|
|
543
|
+
constructor(agentWalletAddress: Address, config?: AcpContractConfig);
|
|
544
|
+
abstract handleOperation(operations: OperationPayload[]): Promise<Address>;
|
|
545
|
+
abstract getJobId(hash: Address, clientAddress: Address, providerAddress: Address): Promise<number>;
|
|
546
|
+
get walletAddress(): `0x${string}`;
|
|
547
|
+
createJobWithAccount(accountId: number, evaluatorAddress: Address, budgetBaseUnit: bigint, paymentTokenAddress: Address, expiredAt: Date, isX402Job?: boolean): OperationPayload;
|
|
548
|
+
createJob(providerAddress: Address, evaluatorAddress: Address, expiredAt: Date, paymentTokenAddress: Address, budgetBaseUnit: bigint, metadata: string, isX402Job?: boolean): OperationPayload;
|
|
549
|
+
approveAllowance(amountBaseUnit: bigint, paymentTokenAddress?: Address): OperationPayload;
|
|
550
|
+
createPayableMemo(jobId: number, content: string, amountBaseUnit: bigint, recipient: Address, feeAmountBaseUnit: bigint, feeType: FeeType, nextPhase: AcpJobPhases, type: MemoType.PAYABLE_REQUEST | MemoType.PAYABLE_TRANSFER_ESCROW | MemoType.PAYABLE_TRANSFER | MemoType.PAYABLE_NOTIFICATION, expiredAt: Date, token?: Address, secured?: boolean): OperationPayload;
|
|
551
|
+
createMemo(jobId: number, content: string, type: MemoType, isSecured: boolean, nextPhase: AcpJobPhases): OperationPayload;
|
|
552
|
+
signMemo(memoId: number, isApproved: boolean, reason?: string): OperationPayload;
|
|
553
|
+
setBudgetWithPaymentToken(jobId: number, budgetBaseUnit: bigint, paymentTokenAddress?: Address): OperationPayload | undefined;
|
|
554
|
+
updateAccountMetadata(accountId: number, metadata: string): OperationPayload;
|
|
555
|
+
wrapEth(amountBaseUnit: bigint): OperationPayload;
|
|
556
|
+
getX402PaymentDetails(jobId: number): Promise<IAcpJobX402PaymentDetails>;
|
|
557
|
+
abstract updateJobX402Nonce(jobId: number, nonce: string): Promise<OffChainJob>;
|
|
558
|
+
abstract generateX402Payment(payableRequest: X402PayableRequest, requirements: X402PayableRequirements): Promise<X402Payment>;
|
|
559
|
+
abstract performX402Request(url: string, version: string, budget?: string, signature?: string): Promise<X402PaymentResponse>;
|
|
560
|
+
submitTransferWithAuthorization(from: Address, to: Address, value: bigint, validAfter: bigint, validBefore: bigint, nonce: string, signature: string): Promise<OperationPayload[]>;
|
|
561
|
+
abstract getAcpVersion(): string;
|
|
467
562
|
}
|
|
468
563
|
|
|
469
564
|
interface IAcpBrowseAgentsOptions {
|
|
@@ -519,12 +614,27 @@ declare class AcpClient {
|
|
|
519
614
|
getByClientAndProvider(clientAddress: Address, providerAddress: Address, acpContractClient?: BaseAcpContractClient): Promise<AcpAccount | null>;
|
|
520
615
|
}
|
|
521
616
|
|
|
617
|
+
declare class AcpX402 {
|
|
618
|
+
private config;
|
|
619
|
+
private sessionKeyClient;
|
|
620
|
+
private publicClient;
|
|
621
|
+
constructor(config: AcpContractConfig, sessionKeyClient: ModularAccountV2Client, publicClient: ReturnType<typeof createPublicClient>);
|
|
622
|
+
signUpdateJobNonceMessage(jobId: number, nonce: string): Promise<`0x${string}`>;
|
|
623
|
+
updateJobNonce(jobId: number, nonce: string): Promise<OffChainJob>;
|
|
624
|
+
generatePayment(payableRequest: X402PayableRequest, requirements: X402PayableRequirements): Promise<X402Payment>;
|
|
625
|
+
performRequest(url: string, version: string, budget?: string, signature?: string): Promise<{
|
|
626
|
+
isPaymentRequired: boolean;
|
|
627
|
+
data: any;
|
|
628
|
+
}>;
|
|
629
|
+
}
|
|
630
|
+
|
|
522
631
|
declare class AcpContractClient extends BaseAcpContractClient {
|
|
523
632
|
protected MAX_RETRIES: number;
|
|
524
633
|
protected PRIORITY_FEE_MULTIPLIER: number;
|
|
525
634
|
protected MAX_FEE_PER_GAS: number;
|
|
526
635
|
protected MAX_PRIORITY_FEE_PER_GAS: number;
|
|
527
636
|
private _sessionKeyClient;
|
|
637
|
+
private _acpX402;
|
|
528
638
|
constructor(agentWalletAddress: Address$1, config?: AcpContractConfig);
|
|
529
639
|
static build(walletPrivateKey: Address$1, sessionEntityKeyId: number, agentWalletAddress: Address$1, config?: AcpContractConfig): Promise<AcpContractClient>;
|
|
530
640
|
init(privateKey: Address$1, sessionEntityKeyId: number): Promise<void>;
|
|
@@ -8776,14 +8886,19 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8776
8886
|
getAddress: () => Address$1;
|
|
8777
8887
|
} & _aa_sdk_core.BundlerActions & viem.PublicActions>;
|
|
8778
8888
|
};
|
|
8889
|
+
get acpX402(): AcpX402;
|
|
8779
8890
|
private calculateGasFees;
|
|
8780
8891
|
handleOperation(operations: OperationPayload[]): Promise<`0x${string}`>;
|
|
8781
8892
|
getJobId(hash: Address$1, clientAddress: Address$1, providerAddress: Address$1): Promise<number>;
|
|
8782
|
-
createJob(providerAddress: Address$1, evaluatorAddress: Address$1, expireAt: Date, paymentTokenAddress: Address$1, budgetBaseUnit: bigint, metadata: string): OperationPayload;
|
|
8893
|
+
createJob(providerAddress: Address$1, evaluatorAddress: Address$1, expireAt: Date, paymentTokenAddress: Address$1, budgetBaseUnit: bigint, metadata: string, isX402Job?: boolean): OperationPayload;
|
|
8783
8894
|
setBudgetWithPaymentToken(jobId: number, budgetBaseUnit: bigint, paymentTokenAddress?: Address$1): OperationPayload;
|
|
8784
8895
|
createPayableMemo(jobId: number, content: string, amountBaseUnit: bigint, recipient: Address$1, feeAmountBaseUnit: bigint, feeType: FeeType, nextPhase: AcpJobPhases, type: MemoType.PAYABLE_REQUEST | MemoType.PAYABLE_TRANSFER_ESCROW, expiredAt: Date, token?: Address$1, secured?: boolean): OperationPayload;
|
|
8785
|
-
createJobWithAccount(accountId: number, evaluatorAddress: Address$1, budgetBaseUnit: bigint, paymentTokenAddress: Address$1, expiredAt: Date): OperationPayload;
|
|
8896
|
+
createJobWithAccount(accountId: number, evaluatorAddress: Address$1, budgetBaseUnit: bigint, paymentTokenAddress: Address$1, expiredAt: Date, isX402Job?: boolean): OperationPayload;
|
|
8786
8897
|
updateAccountMetadata(accountId: number, metadata: string): OperationPayload;
|
|
8898
|
+
updateJobX402Nonce(jobId: number, nonce: string): Promise<OffChainJob>;
|
|
8899
|
+
generateX402Payment(payableRequest: X402PayableRequest, requirements: X402PayableRequirements): Promise<X402Payment>;
|
|
8900
|
+
performX402Request(url: string, version: string, budget?: string, signature?: string): Promise<X402PaymentResponse>;
|
|
8901
|
+
getAcpVersion(): string;
|
|
8787
8902
|
}
|
|
8788
8903
|
|
|
8789
8904
|
declare function preparePayload(payload: string | object): string;
|
|
@@ -8801,6 +8916,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
8801
8916
|
private MAX_FEE_PER_GAS;
|
|
8802
8917
|
private MAX_PRIORITY_FEE_PER_GAS;
|
|
8803
8918
|
private _sessionKeyClient;
|
|
8919
|
+
private _acpX402;
|
|
8804
8920
|
constructor(jobManagerAddress: Address$1, memoManagerAddress: Address$1, accountManagerAddress: Address$1, agentWalletAddress: Address$1, config?: AcpContractConfig);
|
|
8805
8921
|
static build(walletPrivateKey: Address$1, sessionEntityKeyId: number, agentWalletAddress: Address$1, config?: AcpContractConfig): Promise<AcpContractClientV2>;
|
|
8806
8922
|
init(privateKey: Address$1, sessionEntityKeyId: number): Promise<void>;
|
|
@@ -17052,9 +17168,15 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
17052
17168
|
getAddress: () => Address$1;
|
|
17053
17169
|
} & _aa_sdk_core.BundlerActions & viem.PublicActions>;
|
|
17054
17170
|
};
|
|
17171
|
+
get acpX402(): AcpX402;
|
|
17055
17172
|
private calculateGasFees;
|
|
17056
17173
|
handleOperation(operations: OperationPayload[]): Promise<Address$1>;
|
|
17057
17174
|
getJobId(hash: Address$1, clientAddress: Address$1, providerAddress: Address$1): Promise<number>;
|
|
17175
|
+
updateJobX402Nonce(jobId: number, nonce: string): Promise<OffChainJob>;
|
|
17176
|
+
generateX402Payment(payableRequest: X402PayableRequest, requirements: X402PayableRequirements): Promise<X402Payment>;
|
|
17177
|
+
performX402Request(url: string, version: string, budget?: string, signature?: string): Promise<X402PaymentResponse>;
|
|
17178
|
+
getX402PaymentDetails(jobId: number): Promise<IAcpJobX402PaymentDetails>;
|
|
17179
|
+
getAcpVersion(): string;
|
|
17058
17180
|
}
|
|
17059
17181
|
|
|
17060
|
-
export { ACP_ABI, AcpAgentSort, AcpContractClient, AcpContractClientV2, AcpContractConfig, AcpError, AcpGraduationStatus, AcpJob, AcpJobPhases, AcpMemo, AcpMemoStatus, AcpOnlineStatus, BaseAcpContractClient, type ClosePositionPayload, type DeliverablePayload, Fare, FareAmount, FareBigInt, type FundResponsePayload, type IDeliverable, MemoType, type OpenPositionPayload, PayloadType, PositionDirection, type RequestClosePositionPayload, type ResponseSwapTokenPayload, type SwapTokenPayload, baseAcpConfig, baseAcpConfigV2, baseSepoliaAcpConfig, baseSepoliaAcpConfigV2, AcpClient as default, ethFare, preparePayload, wethFare };
|
|
17182
|
+
export { ACP_ABI, AcpAgentSort, AcpContractClient, AcpContractClientV2, AcpContractConfig, AcpError, AcpGraduationStatus, AcpJob, AcpJobPhases, AcpMemo, AcpMemoStatus, AcpOnlineStatus, BaseAcpContractClient, type ClosePositionPayload, type DeliverablePayload, Fare, FareAmount, FareBigInt, type FundResponsePayload, type IDeliverable, MemoType, type OpenPositionPayload, PayloadType, PositionDirection, type RequestClosePositionPayload, type ResponseSwapTokenPayload, type SwapTokenPayload, baseAcpConfig, baseAcpConfigV2, baseAcpX402Config, baseAcpX402ConfigV2, baseSepoliaAcpConfig, baseSepoliaAcpConfigV2, AcpClient as default, ethFare, preparePayload, wethFare };
|