@virtuals-protocol/acp-node 0.3.0-beta.2 → 0.3.0-beta.20
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/README.md +53 -46
- package/dist/index.d.mts +405 -260
- package/dist/index.d.ts +405 -260
- package/dist/index.js +3132 -2885
- package/dist/index.mjs +3137 -2887
- package/package.json +18 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
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';
|
|
6
|
+
import * as util from 'util';
|
|
7
|
+
import util__default from 'util';
|
|
6
8
|
import * as viem__types_actions_siwe_verifySiweMessage from 'viem/_types/actions/siwe/verifySiweMessage';
|
|
7
9
|
import * as _aa_sdk_core_dist_types_actions_smartAccount_signTypedData from '@aa-sdk/core/dist/types/actions/smartAccount/signTypedData';
|
|
8
10
|
import * as _aa_sdk_core_dist_types_actions_smartAccount_signMessage from '@aa-sdk/core/dist/types/actions/smartAccount/signMessage';
|
|
9
11
|
import * as _aa_sdk_core_dist_types_actions_smartAccount_checkGasSponsorshipEligibility from '@aa-sdk/core/dist/types/actions/smartAccount/checkGasSponsorshipEligibility';
|
|
10
12
|
import * as viem__types_utils_ccip from 'viem/_types/utils/ccip';
|
|
11
13
|
import * as _account_kit_smart_contracts from '@account-kit/smart-contracts';
|
|
14
|
+
import { ModularAccountV2Client } from '@account-kit/smart-contracts';
|
|
12
15
|
|
|
13
16
|
declare const ACP_ABI: ({
|
|
14
17
|
inputs: never[];
|
|
@@ -176,76 +179,6 @@ declare const ACP_V2_ABI: ({
|
|
|
176
179
|
anonymous?: undefined;
|
|
177
180
|
})[];
|
|
178
181
|
|
|
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
|
-
}
|
|
221
|
-
declare abstract class BaseAcpContractClient {
|
|
222
|
-
agentWalletAddress: Address;
|
|
223
|
-
config: AcpContractConfig;
|
|
224
|
-
contractAddress: Address;
|
|
225
|
-
chain: Chain;
|
|
226
|
-
abi: typeof ACP_ABI | typeof ACP_V2_ABI;
|
|
227
|
-
jobCreatedSignature: string;
|
|
228
|
-
constructor(agentWalletAddress: Address, config?: AcpContractConfig);
|
|
229
|
-
abstract handleOperation(data: `0x${string}`, contractAddress: Address, value?: bigint): Promise<Address>;
|
|
230
|
-
abstract getJobId(hash: Address, clientAddress: Address, providerAddress: Address): Promise<number>;
|
|
231
|
-
get walletAddress(): `0x${string}`;
|
|
232
|
-
createJobWithAccount(accountId: number, providerAddress: Address, evaluatorAddress: Address, budgetBaseUnit: bigint, paymentTokenAddress: Address, expiredAt: Date): Promise<{
|
|
233
|
-
txHash: string;
|
|
234
|
-
jobId: number;
|
|
235
|
-
}>;
|
|
236
|
-
createJob(providerAddress: Address, evaluatorAddress: Address, expiredAt: Date, paymentTokenAddress: Address, budgetBaseUnit: bigint, metadata: string): Promise<{
|
|
237
|
-
txHash: string;
|
|
238
|
-
jobId: number;
|
|
239
|
-
}>;
|
|
240
|
-
approveAllowance(amountBaseUnit: bigint, paymentTokenAddress?: Address): Promise<`0x${string}`>;
|
|
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): Promise<`0x${string}`>;
|
|
242
|
-
createMemo(jobId: number, content: string, type: MemoType, isSecured: boolean, nextPhase: AcpJobPhases): Promise<Address>;
|
|
243
|
-
signMemo(memoId: number, isApproved: boolean, reason?: string): Promise<`0x${string}`>;
|
|
244
|
-
setBudgetWithPaymentToken(jobId: number, budgetBaseUnit: bigint, paymentTokenAddress?: Address): Promise<`0x${string}`>;
|
|
245
|
-
updateAccountMetadata(accountId: number, metadata: string): Promise<`0x${string}`>;
|
|
246
|
-
wrapEth(amountBaseUnit: bigint): Promise<`0x${string}`>;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
182
|
declare class AcpAccount {
|
|
250
183
|
contractClient: BaseAcpContractClient;
|
|
251
184
|
id: number;
|
|
@@ -253,7 +186,7 @@ declare class AcpAccount {
|
|
|
253
186
|
providerAddress: Address;
|
|
254
187
|
metadata: Record<string, any>;
|
|
255
188
|
constructor(contractClient: BaseAcpContractClient, id: number, clientAddress: Address, providerAddress: Address, metadata: Record<string, any>);
|
|
256
|
-
updateMetadata(metadata: Record<string, any>): Promise
|
|
189
|
+
updateMetadata(metadata: Record<string, any>): Promise<OperationPayload>;
|
|
257
190
|
}
|
|
258
191
|
|
|
259
192
|
declare class AcpMemo {
|
|
@@ -267,12 +200,138 @@ declare class AcpMemo {
|
|
|
267
200
|
signedReason?: string | undefined;
|
|
268
201
|
expiry?: Date | undefined;
|
|
269
202
|
payableDetails?: PayableDetails | undefined;
|
|
203
|
+
txHash?: `0x${string}` | undefined;
|
|
204
|
+
signedTxHash?: `0x${string}` | undefined;
|
|
270
205
|
structuredContent: GenericPayload | undefined;
|
|
271
|
-
constructor(contractClient: BaseAcpContractClient, id: number, type: MemoType, content: string, nextPhase: AcpJobPhases, status: AcpMemoStatus, senderAddress: Address, signedReason?: string | undefined, expiry?: Date | undefined, payableDetails?: PayableDetails | undefined);
|
|
206
|
+
constructor(contractClient: BaseAcpContractClient, id: number, type: MemoType, content: string, nextPhase: AcpJobPhases, status: AcpMemoStatus, senderAddress: Address, signedReason?: string | undefined, expiry?: Date | undefined, payableDetails?: PayableDetails | undefined, txHash?: `0x${string}` | undefined, signedTxHash?: `0x${string}` | undefined);
|
|
272
207
|
get payloadType(): PayloadType | undefined;
|
|
273
208
|
getStructuredContent<T>(): GenericPayload<T> | undefined;
|
|
274
|
-
create(jobId: number, isSecured?: boolean): Promise
|
|
275
|
-
sign(approved: boolean, reason?: string): Promise
|
|
209
|
+
create(jobId: number, isSecured?: boolean): Promise<OperationPayload>;
|
|
210
|
+
sign(approved: boolean, reason?: string): Promise<{
|
|
211
|
+
userOpHash: Address;
|
|
212
|
+
txnHash: Address;
|
|
213
|
+
}>;
|
|
214
|
+
[util__default.inspect.custom](): {
|
|
215
|
+
id: number;
|
|
216
|
+
senderAddress: `0x${string}`;
|
|
217
|
+
type: string;
|
|
218
|
+
status: AcpMemoStatus;
|
|
219
|
+
content: string;
|
|
220
|
+
signedReason: string | undefined;
|
|
221
|
+
txHash: `0x${string}` | undefined;
|
|
222
|
+
signedTxHash: `0x${string}` | undefined;
|
|
223
|
+
nextPhase: string;
|
|
224
|
+
expiry: Date | undefined;
|
|
225
|
+
payableDetails: PayableDetails | undefined;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
declare enum PriceType {
|
|
230
|
+
FIXED = "fixed",
|
|
231
|
+
PERCENTAGE = "percentage"
|
|
232
|
+
}
|
|
233
|
+
declare class AcpJobOffering {
|
|
234
|
+
private readonly acpClient;
|
|
235
|
+
private readonly acpContractClient;
|
|
236
|
+
providerAddress: Address;
|
|
237
|
+
name: string;
|
|
238
|
+
price: number;
|
|
239
|
+
priceType: PriceType;
|
|
240
|
+
requirement?: (Object | string) | undefined;
|
|
241
|
+
private ajv;
|
|
242
|
+
constructor(acpClient: AcpClient, acpContractClient: BaseAcpContractClient, providerAddress: Address, name: string, price: number, priceType?: PriceType, requirement?: (Object | string) | undefined);
|
|
243
|
+
initiateJob(serviceRequirement: Object | string, evaluatorAddress?: Address, expiredAt?: Date): Promise<number>;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
declare class AcpJob {
|
|
247
|
+
private acpClient;
|
|
248
|
+
id: number;
|
|
249
|
+
clientAddress: Address;
|
|
250
|
+
providerAddress: Address;
|
|
251
|
+
evaluatorAddress: Address;
|
|
252
|
+
price: number;
|
|
253
|
+
priceTokenAddress: Address;
|
|
254
|
+
memos: AcpMemo[];
|
|
255
|
+
phase: AcpJobPhases;
|
|
256
|
+
context: Record<string, any>;
|
|
257
|
+
contractAddress: Address;
|
|
258
|
+
netPayableAmount?: number | undefined;
|
|
259
|
+
name: string | undefined;
|
|
260
|
+
requirement: Record<string, any> | string | undefined;
|
|
261
|
+
priceType: PriceType;
|
|
262
|
+
priceValue: number;
|
|
263
|
+
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, netPayableAmount?: number | undefined);
|
|
264
|
+
get acpContractClient(): BaseAcpContractClient;
|
|
265
|
+
get config(): AcpContractConfig;
|
|
266
|
+
get baseFare(): Fare;
|
|
267
|
+
get deliverable(): string | undefined;
|
|
268
|
+
get rejectionReason(): string | undefined;
|
|
269
|
+
get providerAgent(): Promise<AcpAgent | undefined>;
|
|
270
|
+
get clientAgent(): Promise<AcpAgent | undefined>;
|
|
271
|
+
get evaluatorAgent(): Promise<AcpAgent | undefined>;
|
|
272
|
+
get account(): Promise<AcpAccount | null>;
|
|
273
|
+
get latestMemo(): AcpMemo | undefined;
|
|
274
|
+
createRequirement(content: string): Promise<{
|
|
275
|
+
userOpHash: Address;
|
|
276
|
+
txnHash: Address;
|
|
277
|
+
}>;
|
|
278
|
+
createPayableRequirement(content: string, type: MemoType.PAYABLE_REQUEST | MemoType.PAYABLE_TRANSFER_ESCROW, amount: FareAmountBase, recipient: Address, expiredAt?: Date): Promise<{
|
|
279
|
+
userOpHash: Address;
|
|
280
|
+
txnHash: Address;
|
|
281
|
+
}>;
|
|
282
|
+
payAndAcceptRequirement(reason?: string): Promise<{
|
|
283
|
+
userOpHash: Address;
|
|
284
|
+
txnHash: Address;
|
|
285
|
+
}>;
|
|
286
|
+
respond(accept: boolean, reason?: string): Promise<{
|
|
287
|
+
userOpHash: Address;
|
|
288
|
+
txnHash: Address;
|
|
289
|
+
}>;
|
|
290
|
+
accept(reason?: string): Promise<{
|
|
291
|
+
userOpHash: Address;
|
|
292
|
+
txnHash: Address;
|
|
293
|
+
}>;
|
|
294
|
+
reject(reason?: string): Promise<{
|
|
295
|
+
userOpHash: Address;
|
|
296
|
+
txnHash: Address;
|
|
297
|
+
}>;
|
|
298
|
+
rejectPayable(reason: string | undefined, amount: FareAmountBase, expiredAt?: Date): Promise<{
|
|
299
|
+
userOpHash: Address;
|
|
300
|
+
txnHash: Address;
|
|
301
|
+
}>;
|
|
302
|
+
deliver(deliverable: DeliverablePayload): Promise<{
|
|
303
|
+
userOpHash: Address;
|
|
304
|
+
txnHash: Address;
|
|
305
|
+
}>;
|
|
306
|
+
deliverPayable(deliverable: DeliverablePayload, amount: FareAmountBase, skipFee?: boolean, expiredAt?: Date): Promise<{
|
|
307
|
+
userOpHash: Address;
|
|
308
|
+
txnHash: Address;
|
|
309
|
+
}>;
|
|
310
|
+
evaluate(accept: boolean, reason?: string): Promise<void>;
|
|
311
|
+
createNotification(content: string): Promise<{
|
|
312
|
+
userOpHash: Address;
|
|
313
|
+
txnHash: Address;
|
|
314
|
+
}>;
|
|
315
|
+
createPayableNotification(content: string, amount: FareAmountBase, skipFee?: boolean, expiredAt?: Date): Promise<{
|
|
316
|
+
userOpHash: Address;
|
|
317
|
+
txnHash: Address;
|
|
318
|
+
}>;
|
|
319
|
+
private performX402Payment;
|
|
320
|
+
[util.inspect.custom](): {
|
|
321
|
+
id: number;
|
|
322
|
+
clientAddress: `0x${string}`;
|
|
323
|
+
providerAddress: `0x${string}`;
|
|
324
|
+
name: string | undefined;
|
|
325
|
+
requirement: string | Record<string, any> | undefined;
|
|
326
|
+
priceType: PriceType;
|
|
327
|
+
priceValue: number;
|
|
328
|
+
priceTokenAddress: `0x${string}`;
|
|
329
|
+
memos: AcpMemo[];
|
|
330
|
+
phase: AcpJobPhases;
|
|
331
|
+
context: Record<string, any>;
|
|
332
|
+
contractAddress: `0x${string}`;
|
|
333
|
+
netPayableAmount: number | undefined;
|
|
334
|
+
};
|
|
276
335
|
}
|
|
277
336
|
|
|
278
337
|
type DeliverablePayload = string | Record<string, unknown>;
|
|
@@ -305,11 +364,16 @@ declare enum AcpOnlineStatus {
|
|
|
305
364
|
ONLINE = "online",
|
|
306
365
|
OFFLINE = "offline"
|
|
307
366
|
}
|
|
367
|
+
interface IAcpJobX402PaymentDetails {
|
|
368
|
+
isX402: boolean;
|
|
369
|
+
isBudgetReceived: boolean;
|
|
370
|
+
}
|
|
308
371
|
interface IAcpClientOptions {
|
|
309
372
|
acpContractClient: BaseAcpContractClient | BaseAcpContractClient[];
|
|
310
373
|
onNewTask?: (job: AcpJob, memoToSign?: AcpMemo) => void;
|
|
311
374
|
onEvaluate?: (job: AcpJob) => void;
|
|
312
375
|
customRpcUrl?: string;
|
|
376
|
+
skipSocketConnection?: boolean;
|
|
313
377
|
}
|
|
314
378
|
type AcpAgent = {
|
|
315
379
|
id: number;
|
|
@@ -326,7 +390,10 @@ type AcpAgent = {
|
|
|
326
390
|
twitterHandle: string;
|
|
327
391
|
jobs: {
|
|
328
392
|
name: string;
|
|
329
|
-
|
|
393
|
+
priceV2: {
|
|
394
|
+
type: PriceType;
|
|
395
|
+
value: number;
|
|
396
|
+
};
|
|
330
397
|
requirement?: Object | string;
|
|
331
398
|
deliverable?: Object | string;
|
|
332
399
|
}[];
|
|
@@ -401,144 +468,172 @@ type ClosePositionPayload = {
|
|
|
401
468
|
positionId: number;
|
|
402
469
|
amount: number;
|
|
403
470
|
};
|
|
404
|
-
type PositionFulfilledPayload = {
|
|
405
|
-
symbol: string;
|
|
406
|
-
amount: number;
|
|
407
|
-
contractAddress: string;
|
|
408
|
-
type: "TP" | "SL" | "CLOSE";
|
|
409
|
-
pnl: number;
|
|
410
|
-
entryPrice: number;
|
|
411
|
-
exitPrice: number;
|
|
412
|
-
};
|
|
413
|
-
type UnfulfilledPositionPayload = {
|
|
414
|
-
symbol: string;
|
|
415
|
-
amount: number;
|
|
416
|
-
contractAddress: string;
|
|
417
|
-
type: "ERROR" | "PARTIAL";
|
|
418
|
-
reason?: string;
|
|
419
|
-
};
|
|
420
471
|
type RequestClosePositionPayload = {
|
|
421
472
|
positionId: number;
|
|
422
473
|
};
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
474
|
+
type X402Config = {
|
|
475
|
+
url: string;
|
|
476
|
+
};
|
|
477
|
+
type X402PayableRequirements = {
|
|
478
|
+
x402Version: number;
|
|
479
|
+
error: string;
|
|
480
|
+
accepts: X402Requirement[];
|
|
481
|
+
};
|
|
482
|
+
type X402Requirement = {
|
|
483
|
+
scheme: string;
|
|
484
|
+
network: string;
|
|
485
|
+
maxAmountRequired: string;
|
|
486
|
+
resource: string;
|
|
487
|
+
description: string;
|
|
488
|
+
mimeType: string;
|
|
489
|
+
payTo: Address;
|
|
490
|
+
maxTimeoutSeconds: number;
|
|
491
|
+
asset: Address;
|
|
492
|
+
extra: {
|
|
493
|
+
name: string;
|
|
494
|
+
version: string;
|
|
495
|
+
};
|
|
496
|
+
outputSchema: any;
|
|
497
|
+
};
|
|
498
|
+
type X402PayableRequest = {
|
|
499
|
+
to: Address;
|
|
500
|
+
value: number;
|
|
501
|
+
maxTimeoutSeconds: number;
|
|
502
|
+
asset: Address;
|
|
503
|
+
};
|
|
504
|
+
type X402Payment = {
|
|
505
|
+
encodedPayment: string;
|
|
506
|
+
signature: string;
|
|
507
|
+
message: {
|
|
508
|
+
from: Address;
|
|
509
|
+
to: Address;
|
|
510
|
+
value: string;
|
|
511
|
+
validAfter: string;
|
|
512
|
+
validBefore: string;
|
|
513
|
+
nonce: string;
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
type OffChainJob = {
|
|
426
517
|
id: number;
|
|
518
|
+
documentId: string;
|
|
519
|
+
txHash: Address;
|
|
520
|
+
clientId: number;
|
|
521
|
+
providerId: number;
|
|
522
|
+
budget: number;
|
|
523
|
+
createdAt: string;
|
|
524
|
+
updatedAt: string;
|
|
525
|
+
publishedAt: string;
|
|
526
|
+
locale: string | null;
|
|
427
527
|
clientAddress: Address;
|
|
428
528
|
providerAddress: Address;
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
priceTokenAddress: Address;
|
|
432
|
-
memos: AcpMemo[];
|
|
529
|
+
evaluators: Address[];
|
|
530
|
+
budgetTxHash: Address | null;
|
|
433
531
|
phase: AcpJobPhases;
|
|
434
|
-
|
|
532
|
+
agentIdPair: string;
|
|
533
|
+
onChainJobId: string;
|
|
534
|
+
summary: string;
|
|
535
|
+
userOpHash: Address | null;
|
|
536
|
+
amountClaimed: number;
|
|
537
|
+
context: Record<string, any> | null;
|
|
538
|
+
expiry: string;
|
|
539
|
+
refundRetryTimes: number;
|
|
540
|
+
additionalFees: number;
|
|
541
|
+
budgetTokenAddress: Address;
|
|
542
|
+
budgetUSD: number;
|
|
543
|
+
amountClaimedUSD: number | null;
|
|
544
|
+
additionalFeesUSD: number | null;
|
|
435
545
|
contractAddress: Address;
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
deliver(deliverable: DeliverablePayload): Promise<`0x${string}`>;
|
|
456
|
-
deliverPayable(deliverable: DeliverablePayload, amount: FareAmountBase, expiredAt?: Date): Promise<`0x${string}`>;
|
|
457
|
-
evaluate(accept: boolean, reason?: string): Promise<void>;
|
|
458
|
-
pay(reason?: string): Promise<`0x${string}`>;
|
|
459
|
-
createNotification(content: string): Promise<`0x${string}`>;
|
|
460
|
-
createPayableNotification(content: string, amount: FareAmountBase, expiredAt?: Date): Promise<`0x${string}`>;
|
|
461
|
-
/**
|
|
462
|
-
* @deprecated The method should not be used
|
|
463
|
-
*/
|
|
464
|
-
openPosition(payload: OpenPositionPayload[], feeAmount: number, expiredAt?: Date, // 3 minutes
|
|
465
|
-
walletAddress?: Address): Promise<`0x${string}`>;
|
|
466
|
-
/**
|
|
467
|
-
* @deprecated The method should not be used
|
|
468
|
-
*/
|
|
469
|
-
swapToken(payload: SwapTokenPayload, decimals: number, feeAmount: number, walletAddress?: Address): Promise<`0x${string}`>;
|
|
470
|
-
/**
|
|
471
|
-
* @deprecated The method should not be used
|
|
472
|
-
*/
|
|
473
|
-
responseSwapToken(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
474
|
-
/**
|
|
475
|
-
* @deprecated The method should not be used
|
|
476
|
-
*/
|
|
477
|
-
transferFunds<T>(payload: GenericPayload<T>, fareAmount: FareAmountBase, walletAddress?: Address, expiredAt?: Date): Promise<`0x${string}`>;
|
|
478
|
-
/**
|
|
479
|
-
* @deprecated The method should not be used
|
|
480
|
-
*/
|
|
481
|
-
responseOpenPosition(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
482
|
-
/**
|
|
483
|
-
* @deprecated The method should not be used
|
|
484
|
-
*/
|
|
485
|
-
closePartialPosition(payload: ClosePositionPayload, expireAt?: Date): Promise<`0x${string}`>;
|
|
486
|
-
/**
|
|
487
|
-
* @deprecated The method should not be used
|
|
488
|
-
*/
|
|
489
|
-
responseClosePartialPosition(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
490
|
-
/**
|
|
491
|
-
* @deprecated The method should not be used
|
|
492
|
-
*/
|
|
493
|
-
requestClosePosition(payload: RequestClosePositionPayload): Promise<`0x${string}`>;
|
|
494
|
-
/**
|
|
495
|
-
* @deprecated The method should not be used
|
|
496
|
-
*/
|
|
497
|
-
responseRequestClosePosition(memoId: number, accept: boolean, payload: ClosePositionPayload, reason?: string, expiredAt?: Date): Promise<`0x${string}` | undefined>;
|
|
498
|
-
/**
|
|
499
|
-
* @deprecated The method should not be used
|
|
500
|
-
*/
|
|
501
|
-
confirmClosePosition(memoId: number, accept: boolean, reason?: string): Promise<void>;
|
|
502
|
-
/**
|
|
503
|
-
* @deprecated The method should not be used
|
|
504
|
-
*/
|
|
505
|
-
positionFulfilled(payload: PositionFulfilledPayload, expiredAt?: Date): Promise<`0x${string}`>;
|
|
506
|
-
/**
|
|
507
|
-
* @deprecated The method should not be used
|
|
508
|
-
*/
|
|
509
|
-
unfulfilledPosition(payload: UnfulfilledPositionPayload, expiredAt?: Date): Promise<`0x${string}`>;
|
|
510
|
-
/**
|
|
511
|
-
* @deprecated The method should not be used
|
|
512
|
-
*/
|
|
513
|
-
responseUnfulfilledPosition(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
514
|
-
/**
|
|
515
|
-
* @deprecated The method should not be used
|
|
516
|
-
*/
|
|
517
|
-
responsePositionFulfilled(memoId: number, accept: boolean, reason: string): Promise<`0x${string}`>;
|
|
518
|
-
/**
|
|
519
|
-
* @deprecated The method should not be used
|
|
520
|
-
*/
|
|
521
|
-
closeJob(message?: string): Promise<`0x${string}`>;
|
|
522
|
-
/**
|
|
523
|
-
* @deprecated The method should not be used
|
|
524
|
-
*/
|
|
525
|
-
responseCloseJob(memoId: number, accept: boolean, fulfilledPositions: PositionFulfilledPayload[], reason?: string, expiredAt?: Date): Promise<`0x${string}` | undefined>;
|
|
526
|
-
/**
|
|
527
|
-
* @deprecated The method should not be used
|
|
528
|
-
*/
|
|
529
|
-
confirmJobClosure(memoId: number, accept: boolean, reason?: string): Promise<void>;
|
|
546
|
+
accountId: number | null;
|
|
547
|
+
x402Nonce: string;
|
|
548
|
+
};
|
|
549
|
+
type X402PaymentResponse = {
|
|
550
|
+
isPaymentRequired: boolean;
|
|
551
|
+
data: X402PayableRequirements;
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
declare class AcpContractConfig {
|
|
555
|
+
chain: typeof baseSepolia | typeof base;
|
|
556
|
+
contractAddress: Address$1;
|
|
557
|
+
baseFare: Fare;
|
|
558
|
+
alchemyRpcUrl: string;
|
|
559
|
+
acpUrl: string;
|
|
560
|
+
abi: typeof ACP_ABI | typeof ACP_V2_ABI;
|
|
561
|
+
maxRetries: number;
|
|
562
|
+
rpcEndpoint?: string | undefined;
|
|
563
|
+
x402Config?: X402Config | undefined;
|
|
564
|
+
constructor(chain: typeof baseSepolia | typeof base, contractAddress: Address$1, baseFare: Fare, alchemyRpcUrl: string, acpUrl: string, abi: typeof ACP_ABI | typeof ACP_V2_ABI, maxRetries: number, rpcEndpoint?: string | undefined, x402Config?: X402Config | undefined);
|
|
530
565
|
}
|
|
566
|
+
declare const baseSepoliaAcpConfig: AcpContractConfig;
|
|
567
|
+
declare const baseSepoliaAcpConfigV2: AcpContractConfig;
|
|
568
|
+
declare const baseAcpConfig: AcpContractConfig;
|
|
569
|
+
declare const baseAcpX402Config: AcpContractConfig;
|
|
570
|
+
declare const baseAcpConfigV2: AcpContractConfig;
|
|
571
|
+
declare const baseAcpX402ConfigV2: AcpContractConfig;
|
|
531
572
|
|
|
532
|
-
declare
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
573
|
+
declare enum MemoType {
|
|
574
|
+
MESSAGE = 0,// 0 - Text message
|
|
575
|
+
CONTEXT_URL = 1,// 1 - URL for context
|
|
576
|
+
IMAGE_URL = 2,// 2 - Image URL
|
|
577
|
+
VOICE_URL = 3,// 3 - Voice/audio URL
|
|
578
|
+
OBJECT_URL = 4,// 4 - Object/file URL
|
|
579
|
+
TXHASH = 5,// 5 - Transaction hash reference
|
|
580
|
+
PAYABLE_REQUEST = 6,// 6 - Payment request
|
|
581
|
+
PAYABLE_TRANSFER = 7,// 7 - Direct payment transfer
|
|
582
|
+
PAYABLE_TRANSFER_ESCROW = 8,// 8 - Escrowed payment transfer
|
|
583
|
+
NOTIFICATION = 9,// 9 - Notification
|
|
584
|
+
PAYABLE_NOTIFICATION = 10
|
|
585
|
+
}
|
|
586
|
+
declare enum AcpJobPhases {
|
|
587
|
+
REQUEST = 0,
|
|
588
|
+
NEGOTIATION = 1,
|
|
589
|
+
TRANSACTION = 2,
|
|
590
|
+
EVALUATION = 3,
|
|
591
|
+
COMPLETED = 4,
|
|
592
|
+
REJECTED = 5,
|
|
593
|
+
EXPIRED = 6
|
|
594
|
+
}
|
|
595
|
+
declare enum FeeType {
|
|
596
|
+
NO_FEE = 0,
|
|
597
|
+
IMMEDIATE_FEE = 1,
|
|
598
|
+
DEFERRED_FEE = 2,
|
|
599
|
+
PERCENTAGE_FEE = 3
|
|
600
|
+
}
|
|
601
|
+
interface OperationPayload {
|
|
602
|
+
data: `0x${string}`;
|
|
603
|
+
contractAddress: Address;
|
|
604
|
+
value?: bigint;
|
|
605
|
+
}
|
|
606
|
+
declare abstract class BaseAcpContractClient {
|
|
607
|
+
agentWalletAddress: Address;
|
|
608
|
+
config: AcpContractConfig;
|
|
609
|
+
contractAddress: Address;
|
|
610
|
+
chain: Chain;
|
|
611
|
+
abi: typeof ACP_ABI | typeof ACP_V2_ABI;
|
|
612
|
+
jobCreatedSignature: string;
|
|
613
|
+
publicClient: ReturnType<typeof createPublicClient>;
|
|
614
|
+
constructor(agentWalletAddress: Address, config?: AcpContractConfig);
|
|
615
|
+
protected validateSessionKeyOnChain(sessionSignerAddress: Address, sessionEntityKeyId: number): Promise<void>;
|
|
616
|
+
abstract handleOperation(operations: OperationPayload[]): Promise<{
|
|
617
|
+
userOpHash: Address;
|
|
618
|
+
txnHash: Address;
|
|
619
|
+
}>;
|
|
620
|
+
abstract getJobId(createJobUserOpHash: Address, clientAddress: Address, providerAddress: Address): Promise<number>;
|
|
621
|
+
get walletAddress(): `0x${string}`;
|
|
622
|
+
createJobWithAccount(accountId: number, evaluatorAddress: Address, budgetBaseUnit: bigint, paymentTokenAddress: Address, expiredAt: Date, isX402Job?: boolean): OperationPayload;
|
|
623
|
+
createJob(providerAddress: Address, evaluatorAddress: Address, expiredAt: Date, paymentTokenAddress: Address, budgetBaseUnit: bigint, metadata: string, isX402Job?: boolean): OperationPayload;
|
|
624
|
+
approveAllowance(amountBaseUnit: bigint, paymentTokenAddress?: Address): OperationPayload;
|
|
625
|
+
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;
|
|
626
|
+
createMemo(jobId: number, content: string, type: MemoType, isSecured: boolean, nextPhase: AcpJobPhases): OperationPayload;
|
|
627
|
+
signMemo(memoId: number, isApproved: boolean, reason?: string): OperationPayload;
|
|
628
|
+
setBudgetWithPaymentToken(jobId: number, budgetBaseUnit: bigint, paymentTokenAddress?: Address): OperationPayload | undefined;
|
|
629
|
+
updateAccountMetadata(accountId: number, metadata: string): OperationPayload;
|
|
630
|
+
wrapEth(amountBaseUnit: bigint): OperationPayload;
|
|
631
|
+
getX402PaymentDetails(jobId: number): Promise<IAcpJobX402PaymentDetails>;
|
|
632
|
+
abstract updateJobX402Nonce(jobId: number, nonce: string): Promise<OffChainJob>;
|
|
633
|
+
abstract generateX402Payment(payableRequest: X402PayableRequest, requirements: X402PayableRequirements): Promise<X402Payment>;
|
|
634
|
+
abstract performX402Request(url: string, version: string, budget?: string, signature?: string): Promise<X402PaymentResponse>;
|
|
635
|
+
submitTransferWithAuthorization(from: Address, to: Address, value: bigint, validAfter: bigint, validBefore: bigint, nonce: string, signature: string): Promise<OperationPayload[]>;
|
|
636
|
+
abstract getAcpVersion(): string;
|
|
542
637
|
}
|
|
543
638
|
|
|
544
639
|
interface IAcpBrowseAgentsOptions {
|
|
@@ -547,6 +642,7 @@ interface IAcpBrowseAgentsOptions {
|
|
|
547
642
|
top_k?: number;
|
|
548
643
|
graduationStatus?: AcpGraduationStatus;
|
|
549
644
|
onlineStatus?: AcpOnlineStatus;
|
|
645
|
+
showHiddenOfferings?: boolean;
|
|
550
646
|
}
|
|
551
647
|
declare class AcpClient {
|
|
552
648
|
private contractClients;
|
|
@@ -557,8 +653,8 @@ declare class AcpClient {
|
|
|
557
653
|
get acpContractClient(): BaseAcpContractClient;
|
|
558
654
|
get acpUrl(): string;
|
|
559
655
|
private defaultOnEvaluate;
|
|
560
|
-
get walletAddress():
|
|
561
|
-
init(): Promise<void>;
|
|
656
|
+
get walletAddress(): `0x${string}`;
|
|
657
|
+
init(skipSocketConnection?: boolean): Promise<void>;
|
|
562
658
|
browseAgents(keyword: string, options: IAcpBrowseAgentsOptions): Promise<{
|
|
563
659
|
id: number;
|
|
564
660
|
name: string;
|
|
@@ -574,7 +670,7 @@ declare class AcpClient {
|
|
|
574
670
|
minsFromLastOnline: number;
|
|
575
671
|
isOnline: boolean;
|
|
576
672
|
} | undefined;
|
|
577
|
-
|
|
673
|
+
resources: {
|
|
578
674
|
name: string;
|
|
579
675
|
description: string;
|
|
580
676
|
url: string;
|
|
@@ -583,21 +679,12 @@ declare class AcpClient {
|
|
|
583
679
|
}[];
|
|
584
680
|
}[]>;
|
|
585
681
|
initiateJob(providerAddress: Address, serviceRequirement: Object | string, fareAmount: FareAmountBase, evaluatorAddress?: Address, expiredAt?: Date): Promise<number>;
|
|
586
|
-
createMemo(jobId: number, content: string, nextPhase: AcpJobPhases): Promise<`0x${string}`>;
|
|
587
|
-
createPayableMemo(jobId: number, content: string, amount: FareAmountBase, recipient: Address, nextPhase: AcpJobPhases, type: MemoType.PAYABLE_REQUEST | MemoType.PAYABLE_TRANSFER_ESCROW, expiredAt: Date): Promise<`0x${string}`>;
|
|
588
|
-
respondJob(jobId: number, memoId: number, accept: boolean, content?: string, reason?: string): Promise<`0x${string}` | undefined>;
|
|
589
|
-
payJob(jobId: number, amountBaseUnit: bigint, memoId: number, reason?: string): Promise<`0x${string}`>;
|
|
590
|
-
requestFunds<T>(jobId: number, transferFareAmount: FareAmountBase, recipient: Address, feeFareAmount: FareAmountBase, feeType: FeeType, reason: GenericPayload<T>, nextPhase: AcpJobPhases, expiredAt: Date): Promise<`0x${string}`>;
|
|
591
|
-
responseFundsRequest(memoId: number, accept: boolean, amountBaseUnit: bigint, reason?: string): Promise<`0x${string}`>;
|
|
592
|
-
transferFunds<T>(jobId: number, transferFareAmount: FareAmountBase, recipient: Address, feeFareAmount: FareAmountBase, feeType: FeeType, reason: GenericPayload<T>, nextPhase: AcpJobPhases, expiredAt: Date): Promise<`0x${string}`>;
|
|
593
|
-
sendMessage<T>(jobId: number, message: GenericPayload<T>, nextPhase: AcpJobPhases): Promise<`0x${string}`>;
|
|
594
|
-
responseFundsTransfer(memoId: number, accept: boolean, reason?: string): Promise<`0x${string}`>;
|
|
595
|
-
rejectJob(jobId: number, reason?: string): Promise<`0x${string}`>;
|
|
596
|
-
deliverJob(jobId: number, deliverable: DeliverablePayload): Promise<`0x${string}`>;
|
|
597
682
|
getActiveJobs(page?: number, pageSize?: number): Promise<AcpJob[]>;
|
|
598
683
|
getPendingMemoJobs(page?: number, pageSize?: number): Promise<AcpJob[]>;
|
|
599
684
|
getCompletedJobs(page?: number, pageSize?: number): Promise<AcpJob[]>;
|
|
600
685
|
getCancelledJobs(page?: number, pageSize?: number): Promise<AcpJob[]>;
|
|
686
|
+
private _fetchJobList;
|
|
687
|
+
private _hydrateJobs;
|
|
601
688
|
getJobById(jobId: number): Promise<AcpJob | undefined>;
|
|
602
689
|
getMemoById(jobId: number, memoId: number): Promise<AcpMemo | undefined>;
|
|
603
690
|
getAgent(walletAddress: Address): Promise<AcpAgent | undefined>;
|
|
@@ -605,12 +692,26 @@ declare class AcpClient {
|
|
|
605
692
|
getByClientAndProvider(clientAddress: Address, providerAddress: Address, acpContractClient?: BaseAcpContractClient): Promise<AcpAccount | null>;
|
|
606
693
|
}
|
|
607
694
|
|
|
695
|
+
declare class AcpX402 {
|
|
696
|
+
private config;
|
|
697
|
+
private sessionKeyClient;
|
|
698
|
+
private publicClient;
|
|
699
|
+
constructor(config: AcpContractConfig, sessionKeyClient: ModularAccountV2Client, publicClient: ReturnType<typeof createPublicClient>);
|
|
700
|
+
signUpdateJobNonceMessage(jobId: number, nonce: string): Promise<`0x${string}`>;
|
|
701
|
+
updateJobNonce(jobId: number, nonce: string): Promise<OffChainJob>;
|
|
702
|
+
generatePayment(payableRequest: X402PayableRequest, requirements: X402PayableRequirements): Promise<X402Payment>;
|
|
703
|
+
performRequest(url: string, version: string, budget?: string, signature?: string): Promise<{
|
|
704
|
+
isPaymentRequired: boolean;
|
|
705
|
+
data: any;
|
|
706
|
+
}>;
|
|
707
|
+
}
|
|
708
|
+
|
|
608
709
|
declare class AcpContractClient extends BaseAcpContractClient {
|
|
609
|
-
protected MAX_RETRIES: number;
|
|
610
710
|
protected PRIORITY_FEE_MULTIPLIER: number;
|
|
611
711
|
protected MAX_FEE_PER_GAS: number;
|
|
612
712
|
protected MAX_PRIORITY_FEE_PER_GAS: number;
|
|
613
713
|
private _sessionKeyClient;
|
|
714
|
+
private _acpX402;
|
|
614
715
|
constructor(agentWalletAddress: Address$1, config?: AcpContractConfig);
|
|
615
716
|
static build(walletPrivateKey: Address$1, sessionEntityKeyId: number, agentWalletAddress: Address$1, config?: AcpContractConfig): Promise<AcpContractClient>;
|
|
616
717
|
init(privateKey: Address$1, sessionEntityKeyId: number): Promise<void>;
|
|
@@ -626,6 +727,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
626
727
|
request?: (parameters: viem.CcipRequestParameters) => Promise<viem__types_utils_ccip.CcipRequestReturnType>;
|
|
627
728
|
} | undefined;
|
|
628
729
|
chain: viem.Chain;
|
|
730
|
+
experimental_blockTag?: viem.BlockTag | undefined;
|
|
629
731
|
key: string;
|
|
630
732
|
name: string;
|
|
631
733
|
pollingInterval: number;
|
|
@@ -639,7 +741,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
639
741
|
ReturnType: _aa_sdk_core.UserOperationEstimateGasResponse;
|
|
640
742
|
}, {
|
|
641
743
|
Method: "eth_getUserOperationReceipt";
|
|
642
|
-
Parameters: [viem.Hash];
|
|
744
|
+
Parameters: [viem.Hash, ("pending" | "latest")?];
|
|
643
745
|
ReturnType: _aa_sdk_core.UserOperationReceipt | null;
|
|
644
746
|
}, {
|
|
645
747
|
Method: "eth_getUserOperationByHash";
|
|
@@ -679,7 +781,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
679
781
|
ReturnType: viem.Quantity;
|
|
680
782
|
}, {
|
|
681
783
|
Method: "eth_call";
|
|
682
|
-
Parameters: [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride];
|
|
784
|
+
Parameters: readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride, blockOverrides: viem.RpcBlockOverrides];
|
|
683
785
|
ReturnType: viem.Hex;
|
|
684
786
|
}, {
|
|
685
787
|
Method: "eth_createAccessList";
|
|
@@ -828,6 +930,10 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
828
930
|
Method: "eth_sendRawTransaction";
|
|
829
931
|
Parameters: [signedTransaction: viem.Hex];
|
|
830
932
|
ReturnType: viem.Hash;
|
|
933
|
+
}, {
|
|
934
|
+
Method: "eth_sendRawTransactionSync";
|
|
935
|
+
Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
|
|
936
|
+
ReturnType: viem.RpcTransactionReceipt;
|
|
831
937
|
}, {
|
|
832
938
|
Method: "eth_simulateV1";
|
|
833
939
|
Parameters: [{
|
|
@@ -886,6 +992,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
886
992
|
[x: `bytes4[${string}]`]: undefined;
|
|
887
993
|
[x: `bytes[${string}]`]: undefined;
|
|
888
994
|
[x: `bytes6[${string}]`]: undefined;
|
|
995
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
889
996
|
[x: `bytes1[${string}]`]: undefined;
|
|
890
997
|
[x: `bytes2[${string}]`]: undefined;
|
|
891
998
|
[x: `bytes3[${string}]`]: undefined;
|
|
@@ -893,7 +1000,6 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
893
1000
|
[x: `bytes7[${string}]`]: undefined;
|
|
894
1001
|
[x: `bytes8[${string}]`]: undefined;
|
|
895
1002
|
[x: `bytes9[${string}]`]: undefined;
|
|
896
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
897
1003
|
[x: `bytes11[${string}]`]: undefined;
|
|
898
1004
|
[x: `bytes12[${string}]`]: undefined;
|
|
899
1005
|
[x: `bytes13[${string}]`]: undefined;
|
|
@@ -988,6 +1094,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
988
1094
|
bytes4?: undefined;
|
|
989
1095
|
bytes?: undefined;
|
|
990
1096
|
bytes6?: undefined;
|
|
1097
|
+
bytes10?: undefined;
|
|
991
1098
|
bytes1?: undefined;
|
|
992
1099
|
bytes2?: undefined;
|
|
993
1100
|
bytes3?: undefined;
|
|
@@ -995,7 +1102,6 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
995
1102
|
bytes7?: undefined;
|
|
996
1103
|
bytes8?: undefined;
|
|
997
1104
|
bytes9?: undefined;
|
|
998
|
-
bytes10?: undefined;
|
|
999
1105
|
bytes11?: undefined;
|
|
1000
1106
|
bytes12?: undefined;
|
|
1001
1107
|
bytes13?: undefined;
|
|
@@ -1085,7 +1191,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
1085
1191
|
estimateUserOperationGas: <TEntryPointVersion extends _aa_sdk_core.EntryPointVersion = keyof _aa_sdk_core.EntryPointRegistryBase<unknown>>(request: _aa_sdk_core.UserOperationRequest<TEntryPointVersion>, entryPoint: Address$1, stateOverride?: viem.StateOverride) => Promise<_aa_sdk_core.UserOperationEstimateGasResponse<TEntryPointVersion>>;
|
|
1086
1192
|
sendRawUserOperation: <TEntryPointVersion extends _aa_sdk_core.EntryPointVersion = keyof _aa_sdk_core.EntryPointRegistryBase<unknown>>(request: _aa_sdk_core.UserOperationRequest<TEntryPointVersion>, entryPoint: Address$1) => Promise<viem.Hash>;
|
|
1087
1193
|
getUserOperationByHash: (hash: viem.Hash) => Promise<_aa_sdk_core.UserOperationResponse | null>;
|
|
1088
|
-
getUserOperationReceipt: (hash: viem.Hash) => Promise<_aa_sdk_core.UserOperationReceipt | null>;
|
|
1194
|
+
getUserOperationReceipt: (hash: viem.Hash, tag?: "pending" | "latest") => Promise<_aa_sdk_core.UserOperationReceipt | null>;
|
|
1089
1195
|
getSupportedEntryPoints: () => Promise<Address$1[]>;
|
|
1090
1196
|
call: (parameters: viem.CallParameters<viem.Chain | undefined>) => Promise<viem.CallReturnType>;
|
|
1091
1197
|
createAccessList: (parameters: viem.CreateAccessListParameters<viem.Chain | undefined>) => Promise<{
|
|
@@ -7914,10 +8020,12 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
7914
8020
|
}, (request["parameters"] extends readonly viem.PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "gas" | "nonce" | "blobVersionedHashes" | "chainId" | "type") extends infer T_13 ? T_13 extends (request["parameters"] extends readonly viem.PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "gas" | "nonce" | "blobVersionedHashes" | "chainId" | "type") ? T_13 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_13 : never : never> & (unknown extends request["kzg"] ? {} : Pick<request, "kzg">))[K]; } : never>;
|
|
7915
8021
|
readContract: <const abi extends viem.Abi | readonly unknown[], functionName extends viem.ContractFunctionName<abi, "pure" | "view">, const args extends viem.ContractFunctionArgs<abi, "pure" | "view", functionName>>(args: viem.ReadContractParameters<abi, functionName, args>) => Promise<viem.ReadContractReturnType<abi, functionName, args>>;
|
|
7916
8022
|
sendRawTransaction: (args: viem.SendRawTransactionParameters) => Promise<viem.SendRawTransactionReturnType>;
|
|
8023
|
+
sendRawTransactionSync: (args: viem.SendRawTransactionSyncParameters) => Promise<viem.TransactionReceipt>;
|
|
7917
8024
|
simulate: <const calls extends readonly unknown[]>(args: viem.SimulateBlocksParameters<calls>) => Promise<viem.SimulateBlocksReturnType<calls>>;
|
|
7918
8025
|
simulateBlocks: <const calls extends readonly unknown[]>(args: viem.SimulateBlocksParameters<calls>) => Promise<viem.SimulateBlocksReturnType<calls>>;
|
|
7919
8026
|
simulateCalls: <const calls extends readonly unknown[]>(args: viem.SimulateCallsParameters<calls>) => Promise<viem.SimulateCallsReturnType<calls>>;
|
|
7920
8027
|
simulateContract: <const abi extends viem.Abi | readonly unknown[], functionName extends viem.ContractFunctionName<abi, "nonpayable" | "payable">, const args_1 extends viem.ContractFunctionArgs<abi, "nonpayable" | "payable", functionName>, chainOverride extends viem.Chain | undefined, accountOverride extends viem.Account | Address$1 | undefined = undefined>(args: viem.SimulateContractParameters<abi, functionName, args_1, viem.Chain | undefined, chainOverride, accountOverride>) => Promise<viem.SimulateContractReturnType<abi, functionName, args_1, viem.Chain | undefined, viem.Account | undefined, chainOverride, accountOverride>>;
|
|
8028
|
+
verifyHash: (args: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>;
|
|
7921
8029
|
verifyMessage: (args: viem.VerifyMessageActionParameters) => Promise<viem.VerifyMessageActionReturnType>;
|
|
7922
8030
|
verifySiweMessage: (args: viem__types_actions_siwe_verifySiweMessage.VerifySiweMessageParameters) => Promise<viem__types_actions_siwe_verifySiweMessage.VerifySiweMessageReturnType>;
|
|
7923
8031
|
verifyTypedData: (args: viem.VerifyTypedDataActionParameters) => Promise<viem.VerifyTypedDataActionReturnType>;
|
|
@@ -7935,6 +8043,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
7935
8043
|
cacheTime?: undefined;
|
|
7936
8044
|
ccipRead?: undefined;
|
|
7937
8045
|
chain?: undefined;
|
|
8046
|
+
experimental_blockTag?: undefined;
|
|
7938
8047
|
key?: undefined;
|
|
7939
8048
|
name?: undefined;
|
|
7940
8049
|
pollingInterval?: undefined;
|
|
@@ -7952,7 +8061,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
7952
8061
|
ReturnType: _aa_sdk_core.UserOperationEstimateGasResponse;
|
|
7953
8062
|
}, {
|
|
7954
8063
|
Method: "eth_getUserOperationReceipt";
|
|
7955
|
-
Parameters: [viem.Hash];
|
|
8064
|
+
Parameters: [viem.Hash, ("pending" | "latest")?];
|
|
7956
8065
|
ReturnType: _aa_sdk_core.UserOperationReceipt | null;
|
|
7957
8066
|
}, {
|
|
7958
8067
|
Method: "eth_getUserOperationByHash";
|
|
@@ -7992,7 +8101,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
7992
8101
|
ReturnType: viem.Quantity;
|
|
7993
8102
|
}, {
|
|
7994
8103
|
Method: "eth_call";
|
|
7995
|
-
Parameters: [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride];
|
|
8104
|
+
Parameters: readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride, blockOverrides: viem.RpcBlockOverrides];
|
|
7996
8105
|
ReturnType: viem.Hex;
|
|
7997
8106
|
}, {
|
|
7998
8107
|
Method: "eth_createAccessList";
|
|
@@ -8141,6 +8250,10 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8141
8250
|
Method: "eth_sendRawTransaction";
|
|
8142
8251
|
Parameters: [signedTransaction: viem.Hex];
|
|
8143
8252
|
ReturnType: viem.Hash;
|
|
8253
|
+
}, {
|
|
8254
|
+
Method: "eth_sendRawTransactionSync";
|
|
8255
|
+
Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
|
|
8256
|
+
ReturnType: viem.RpcTransactionReceipt;
|
|
8144
8257
|
}, {
|
|
8145
8258
|
Method: "eth_simulateV1";
|
|
8146
8259
|
Parameters: [{
|
|
@@ -8196,6 +8309,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8196
8309
|
[x: `bytes4[${string}]`]: undefined;
|
|
8197
8310
|
[x: `bytes[${string}]`]: undefined;
|
|
8198
8311
|
[x: `bytes6[${string}]`]: undefined;
|
|
8312
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
8199
8313
|
[x: `bytes1[${string}]`]: undefined;
|
|
8200
8314
|
[x: `bytes2[${string}]`]: undefined;
|
|
8201
8315
|
[x: `bytes3[${string}]`]: undefined;
|
|
@@ -8203,7 +8317,6 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8203
8317
|
[x: `bytes7[${string}]`]: undefined;
|
|
8204
8318
|
[x: `bytes8[${string}]`]: undefined;
|
|
8205
8319
|
[x: `bytes9[${string}]`]: undefined;
|
|
8206
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
8207
8320
|
[x: `bytes11[${string}]`]: undefined;
|
|
8208
8321
|
[x: `bytes12[${string}]`]: undefined;
|
|
8209
8322
|
[x: `bytes13[${string}]`]: undefined;
|
|
@@ -8298,6 +8411,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8298
8411
|
bytes4?: undefined;
|
|
8299
8412
|
bytes?: undefined;
|
|
8300
8413
|
bytes6?: undefined;
|
|
8414
|
+
bytes10?: undefined;
|
|
8301
8415
|
bytes1?: undefined;
|
|
8302
8416
|
bytes2?: undefined;
|
|
8303
8417
|
bytes3?: undefined;
|
|
@@ -8305,7 +8419,6 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8305
8419
|
bytes7?: undefined;
|
|
8306
8420
|
bytes8?: undefined;
|
|
8307
8421
|
bytes9?: undefined;
|
|
8308
|
-
bytes10?: undefined;
|
|
8309
8422
|
bytes11?: undefined;
|
|
8310
8423
|
bytes12?: undefined;
|
|
8311
8424
|
bytes13?: undefined;
|
|
@@ -8403,7 +8516,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8403
8516
|
ReturnType: _aa_sdk_core.UserOperationEstimateGasResponse;
|
|
8404
8517
|
}, {
|
|
8405
8518
|
Method: "eth_getUserOperationReceipt";
|
|
8406
|
-
Parameters: [viem.Hash];
|
|
8519
|
+
Parameters: [viem.Hash, ("pending" | "latest")?];
|
|
8407
8520
|
ReturnType: _aa_sdk_core.UserOperationReceipt | null;
|
|
8408
8521
|
}, {
|
|
8409
8522
|
Method: "eth_getUserOperationByHash";
|
|
@@ -8443,7 +8556,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8443
8556
|
ReturnType: viem.Quantity;
|
|
8444
8557
|
}, {
|
|
8445
8558
|
Method: "eth_call";
|
|
8446
|
-
Parameters: [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride];
|
|
8559
|
+
Parameters: readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride, blockOverrides: viem.RpcBlockOverrides];
|
|
8447
8560
|
ReturnType: viem.Hex;
|
|
8448
8561
|
}, {
|
|
8449
8562
|
Method: "eth_createAccessList";
|
|
@@ -8592,6 +8705,10 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8592
8705
|
Method: "eth_sendRawTransaction";
|
|
8593
8706
|
Parameters: [signedTransaction: viem.Hex];
|
|
8594
8707
|
ReturnType: viem.Hash;
|
|
8708
|
+
}, {
|
|
8709
|
+
Method: "eth_sendRawTransactionSync";
|
|
8710
|
+
Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
|
|
8711
|
+
ReturnType: viem.RpcTransactionReceipt;
|
|
8595
8712
|
}, {
|
|
8596
8713
|
Method: "eth_simulateV1";
|
|
8597
8714
|
Parameters: [{
|
|
@@ -8647,6 +8764,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8647
8764
|
[x: `bytes4[${string}]`]: undefined;
|
|
8648
8765
|
[x: `bytes[${string}]`]: undefined;
|
|
8649
8766
|
[x: `bytes6[${string}]`]: undefined;
|
|
8767
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
8650
8768
|
[x: `bytes1[${string}]`]: undefined;
|
|
8651
8769
|
[x: `bytes2[${string}]`]: undefined;
|
|
8652
8770
|
[x: `bytes3[${string}]`]: undefined;
|
|
@@ -8654,7 +8772,6 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8654
8772
|
[x: `bytes7[${string}]`]: undefined;
|
|
8655
8773
|
[x: `bytes8[${string}]`]: undefined;
|
|
8656
8774
|
[x: `bytes9[${string}]`]: undefined;
|
|
8657
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
8658
8775
|
[x: `bytes11[${string}]`]: undefined;
|
|
8659
8776
|
[x: `bytes12[${string}]`]: undefined;
|
|
8660
8777
|
[x: `bytes13[${string}]`]: undefined;
|
|
@@ -8749,6 +8866,7 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8749
8866
|
bytes4?: undefined;
|
|
8750
8867
|
bytes?: undefined;
|
|
8751
8868
|
bytes6?: undefined;
|
|
8869
|
+
bytes10?: undefined;
|
|
8752
8870
|
bytes1?: undefined;
|
|
8753
8871
|
bytes2?: undefined;
|
|
8754
8872
|
bytes3?: undefined;
|
|
@@ -8756,7 +8874,6 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8756
8874
|
bytes7?: undefined;
|
|
8757
8875
|
bytes8?: undefined;
|
|
8758
8876
|
bytes9?: undefined;
|
|
8759
|
-
bytes10?: undefined;
|
|
8760
8877
|
bytes11?: undefined;
|
|
8761
8878
|
bytes12?: undefined;
|
|
8762
8879
|
bytes13?: undefined;
|
|
@@ -8846,19 +8963,22 @@ declare class AcpContractClient extends BaseAcpContractClient {
|
|
|
8846
8963
|
getAddress: () => Address$1;
|
|
8847
8964
|
} & _aa_sdk_core.BundlerActions & viem.PublicActions>;
|
|
8848
8965
|
};
|
|
8966
|
+
get acpX402(): AcpX402;
|
|
8849
8967
|
private calculateGasFees;
|
|
8850
|
-
handleOperation(
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
txHash: string;
|
|
8854
|
-
jobId: number;
|
|
8855
|
-
}>;
|
|
8856
|
-
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): Promise<`0x${string}`>;
|
|
8857
|
-
createJobWithAccount(accountId: number, providerAddress: Address$1, evaluatorAddress: Address$1, budgetBaseUnit: bigint, paymentTokenAddress: Address$1, expiredAt: Date): Promise<{
|
|
8858
|
-
txHash: string;
|
|
8859
|
-
jobId: number;
|
|
8968
|
+
handleOperation(operations: OperationPayload[]): Promise<{
|
|
8969
|
+
userOpHash: Address$1;
|
|
8970
|
+
txnHash: Address$1;
|
|
8860
8971
|
}>;
|
|
8861
|
-
|
|
8972
|
+
getJobId(createJobUserOpHash: Address$1, clientAddress: Address$1, providerAddress: Address$1): Promise<number>;
|
|
8973
|
+
createJob(providerAddress: Address$1, evaluatorAddress: Address$1, expireAt: Date, paymentTokenAddress: Address$1, budgetBaseUnit: bigint, metadata: string, isX402Job?: boolean): OperationPayload;
|
|
8974
|
+
setBudgetWithPaymentToken(jobId: number, budgetBaseUnit: bigint, paymentTokenAddress?: Address$1): OperationPayload;
|
|
8975
|
+
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;
|
|
8976
|
+
createJobWithAccount(accountId: number, evaluatorAddress: Address$1, budgetBaseUnit: bigint, paymentTokenAddress: Address$1, expiredAt: Date, isX402Job?: boolean): OperationPayload;
|
|
8977
|
+
updateAccountMetadata(accountId: number, metadata: string): OperationPayload;
|
|
8978
|
+
updateJobX402Nonce(jobId: number, nonce: string): Promise<OffChainJob>;
|
|
8979
|
+
generateX402Payment(payableRequest: X402PayableRequest, requirements: X402PayableRequirements): Promise<X402Payment>;
|
|
8980
|
+
performX402Request(url: string, version: string, budget?: string, signature?: string): Promise<X402PaymentResponse>;
|
|
8981
|
+
getAcpVersion(): string;
|
|
8862
8982
|
}
|
|
8863
8983
|
|
|
8864
8984
|
declare function preparePayload(payload: string | object): string;
|
|
@@ -8871,11 +8991,11 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
8871
8991
|
private jobManagerAddress;
|
|
8872
8992
|
private memoManagerAddress;
|
|
8873
8993
|
private accountManagerAddress;
|
|
8874
|
-
private MAX_RETRIES;
|
|
8875
8994
|
private PRIORITY_FEE_MULTIPLIER;
|
|
8876
8995
|
private MAX_FEE_PER_GAS;
|
|
8877
8996
|
private MAX_PRIORITY_FEE_PER_GAS;
|
|
8878
8997
|
private _sessionKeyClient;
|
|
8998
|
+
private _acpX402;
|
|
8879
8999
|
constructor(jobManagerAddress: Address$1, memoManagerAddress: Address$1, accountManagerAddress: Address$1, agentWalletAddress: Address$1, config?: AcpContractConfig);
|
|
8880
9000
|
static build(walletPrivateKey: Address$1, sessionEntityKeyId: number, agentWalletAddress: Address$1, config?: AcpContractConfig): Promise<AcpContractClientV2>;
|
|
8881
9001
|
init(privateKey: Address$1, sessionEntityKeyId: number): Promise<void>;
|
|
@@ -8891,6 +9011,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
8891
9011
|
request?: (parameters: viem.CcipRequestParameters) => Promise<viem__types_utils_ccip.CcipRequestReturnType>;
|
|
8892
9012
|
} | undefined;
|
|
8893
9013
|
chain: viem.Chain;
|
|
9014
|
+
experimental_blockTag?: viem.BlockTag | undefined;
|
|
8894
9015
|
key: string;
|
|
8895
9016
|
name: string;
|
|
8896
9017
|
pollingInterval: number;
|
|
@@ -8904,7 +9025,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
8904
9025
|
ReturnType: _aa_sdk_core.UserOperationEstimateGasResponse;
|
|
8905
9026
|
}, {
|
|
8906
9027
|
Method: "eth_getUserOperationReceipt";
|
|
8907
|
-
Parameters: [viem.Hash];
|
|
9028
|
+
Parameters: [viem.Hash, ("pending" | "latest")?];
|
|
8908
9029
|
ReturnType: _aa_sdk_core.UserOperationReceipt | null;
|
|
8909
9030
|
}, {
|
|
8910
9031
|
Method: "eth_getUserOperationByHash";
|
|
@@ -8944,7 +9065,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
8944
9065
|
ReturnType: viem.Quantity;
|
|
8945
9066
|
}, {
|
|
8946
9067
|
Method: "eth_call";
|
|
8947
|
-
Parameters: [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride];
|
|
9068
|
+
Parameters: readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride, blockOverrides: viem.RpcBlockOverrides];
|
|
8948
9069
|
ReturnType: viem.Hex;
|
|
8949
9070
|
}, {
|
|
8950
9071
|
Method: "eth_createAccessList";
|
|
@@ -9093,6 +9214,10 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
9093
9214
|
Method: "eth_sendRawTransaction";
|
|
9094
9215
|
Parameters: [signedTransaction: viem.Hex];
|
|
9095
9216
|
ReturnType: viem.Hash;
|
|
9217
|
+
}, {
|
|
9218
|
+
Method: "eth_sendRawTransactionSync";
|
|
9219
|
+
Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
|
|
9220
|
+
ReturnType: viem.RpcTransactionReceipt;
|
|
9096
9221
|
}, {
|
|
9097
9222
|
Method: "eth_simulateV1";
|
|
9098
9223
|
Parameters: [{
|
|
@@ -9151,6 +9276,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
9151
9276
|
[x: `bytes4[${string}]`]: undefined;
|
|
9152
9277
|
[x: `bytes[${string}]`]: undefined;
|
|
9153
9278
|
[x: `bytes6[${string}]`]: undefined;
|
|
9279
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
9154
9280
|
[x: `bytes1[${string}]`]: undefined;
|
|
9155
9281
|
[x: `bytes2[${string}]`]: undefined;
|
|
9156
9282
|
[x: `bytes3[${string}]`]: undefined;
|
|
@@ -9158,7 +9284,6 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
9158
9284
|
[x: `bytes7[${string}]`]: undefined;
|
|
9159
9285
|
[x: `bytes8[${string}]`]: undefined;
|
|
9160
9286
|
[x: `bytes9[${string}]`]: undefined;
|
|
9161
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
9162
9287
|
[x: `bytes11[${string}]`]: undefined;
|
|
9163
9288
|
[x: `bytes12[${string}]`]: undefined;
|
|
9164
9289
|
[x: `bytes13[${string}]`]: undefined;
|
|
@@ -9253,6 +9378,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
9253
9378
|
bytes4?: undefined;
|
|
9254
9379
|
bytes?: undefined;
|
|
9255
9380
|
bytes6?: undefined;
|
|
9381
|
+
bytes10?: undefined;
|
|
9256
9382
|
bytes1?: undefined;
|
|
9257
9383
|
bytes2?: undefined;
|
|
9258
9384
|
bytes3?: undefined;
|
|
@@ -9260,7 +9386,6 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
9260
9386
|
bytes7?: undefined;
|
|
9261
9387
|
bytes8?: undefined;
|
|
9262
9388
|
bytes9?: undefined;
|
|
9263
|
-
bytes10?: undefined;
|
|
9264
9389
|
bytes11?: undefined;
|
|
9265
9390
|
bytes12?: undefined;
|
|
9266
9391
|
bytes13?: undefined;
|
|
@@ -9350,7 +9475,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
9350
9475
|
estimateUserOperationGas: <TEntryPointVersion extends _aa_sdk_core.EntryPointVersion = keyof _aa_sdk_core.EntryPointRegistryBase<unknown>>(request: _aa_sdk_core.UserOperationRequest<TEntryPointVersion>, entryPoint: Address$1, stateOverride?: viem.StateOverride) => Promise<_aa_sdk_core.UserOperationEstimateGasResponse<TEntryPointVersion>>;
|
|
9351
9476
|
sendRawUserOperation: <TEntryPointVersion extends _aa_sdk_core.EntryPointVersion = keyof _aa_sdk_core.EntryPointRegistryBase<unknown>>(request: _aa_sdk_core.UserOperationRequest<TEntryPointVersion>, entryPoint: Address$1) => Promise<viem.Hash>;
|
|
9352
9477
|
getUserOperationByHash: (hash: viem.Hash) => Promise<_aa_sdk_core.UserOperationResponse | null>;
|
|
9353
|
-
getUserOperationReceipt: (hash: viem.Hash) => Promise<_aa_sdk_core.UserOperationReceipt | null>;
|
|
9478
|
+
getUserOperationReceipt: (hash: viem.Hash, tag?: "pending" | "latest") => Promise<_aa_sdk_core.UserOperationReceipt | null>;
|
|
9354
9479
|
getSupportedEntryPoints: () => Promise<Address$1[]>;
|
|
9355
9480
|
call: (parameters: viem.CallParameters<viem.Chain | undefined>) => Promise<viem.CallReturnType>;
|
|
9356
9481
|
createAccessList: (parameters: viem.CreateAccessListParameters<viem.Chain | undefined>) => Promise<{
|
|
@@ -16179,10 +16304,12 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16179
16304
|
}, (request["parameters"] extends readonly viem.PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "gas" | "nonce" | "blobVersionedHashes" | "chainId" | "type") extends infer T_13 ? T_13 extends (request["parameters"] extends readonly viem.PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "gas" | "nonce" | "blobVersionedHashes" | "chainId" | "type") ? T_13 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_13 : never : never> & (unknown extends request["kzg"] ? {} : Pick<request, "kzg">))[K]; } : never>;
|
|
16180
16305
|
readContract: <const abi extends viem.Abi | readonly unknown[], functionName extends viem.ContractFunctionName<abi, "pure" | "view">, const args extends viem.ContractFunctionArgs<abi, "pure" | "view", functionName>>(args: viem.ReadContractParameters<abi, functionName, args>) => Promise<viem.ReadContractReturnType<abi, functionName, args>>;
|
|
16181
16306
|
sendRawTransaction: (args: viem.SendRawTransactionParameters) => Promise<viem.SendRawTransactionReturnType>;
|
|
16307
|
+
sendRawTransactionSync: (args: viem.SendRawTransactionSyncParameters) => Promise<viem.TransactionReceipt>;
|
|
16182
16308
|
simulate: <const calls extends readonly unknown[]>(args: viem.SimulateBlocksParameters<calls>) => Promise<viem.SimulateBlocksReturnType<calls>>;
|
|
16183
16309
|
simulateBlocks: <const calls extends readonly unknown[]>(args: viem.SimulateBlocksParameters<calls>) => Promise<viem.SimulateBlocksReturnType<calls>>;
|
|
16184
16310
|
simulateCalls: <const calls extends readonly unknown[]>(args: viem.SimulateCallsParameters<calls>) => Promise<viem.SimulateCallsReturnType<calls>>;
|
|
16185
16311
|
simulateContract: <const abi extends viem.Abi | readonly unknown[], functionName extends viem.ContractFunctionName<abi, "nonpayable" | "payable">, const args_1 extends viem.ContractFunctionArgs<abi, "nonpayable" | "payable", functionName>, chainOverride extends viem.Chain | undefined, accountOverride extends viem.Account | Address$1 | undefined = undefined>(args: viem.SimulateContractParameters<abi, functionName, args_1, viem.Chain | undefined, chainOverride, accountOverride>) => Promise<viem.SimulateContractReturnType<abi, functionName, args_1, viem.Chain | undefined, viem.Account | undefined, chainOverride, accountOverride>>;
|
|
16312
|
+
verifyHash: (args: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>;
|
|
16186
16313
|
verifyMessage: (args: viem.VerifyMessageActionParameters) => Promise<viem.VerifyMessageActionReturnType>;
|
|
16187
16314
|
verifySiweMessage: (args: viem__types_actions_siwe_verifySiweMessage.VerifySiweMessageParameters) => Promise<viem__types_actions_siwe_verifySiweMessage.VerifySiweMessageReturnType>;
|
|
16188
16315
|
verifyTypedData: (args: viem.VerifyTypedDataActionParameters) => Promise<viem.VerifyTypedDataActionReturnType>;
|
|
@@ -16200,6 +16327,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16200
16327
|
cacheTime?: undefined;
|
|
16201
16328
|
ccipRead?: undefined;
|
|
16202
16329
|
chain?: undefined;
|
|
16330
|
+
experimental_blockTag?: undefined;
|
|
16203
16331
|
key?: undefined;
|
|
16204
16332
|
name?: undefined;
|
|
16205
16333
|
pollingInterval?: undefined;
|
|
@@ -16217,7 +16345,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16217
16345
|
ReturnType: _aa_sdk_core.UserOperationEstimateGasResponse;
|
|
16218
16346
|
}, {
|
|
16219
16347
|
Method: "eth_getUserOperationReceipt";
|
|
16220
|
-
Parameters: [viem.Hash];
|
|
16348
|
+
Parameters: [viem.Hash, ("pending" | "latest")?];
|
|
16221
16349
|
ReturnType: _aa_sdk_core.UserOperationReceipt | null;
|
|
16222
16350
|
}, {
|
|
16223
16351
|
Method: "eth_getUserOperationByHash";
|
|
@@ -16257,7 +16385,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16257
16385
|
ReturnType: viem.Quantity;
|
|
16258
16386
|
}, {
|
|
16259
16387
|
Method: "eth_call";
|
|
16260
|
-
Parameters: [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride];
|
|
16388
|
+
Parameters: readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride, blockOverrides: viem.RpcBlockOverrides];
|
|
16261
16389
|
ReturnType: viem.Hex;
|
|
16262
16390
|
}, {
|
|
16263
16391
|
Method: "eth_createAccessList";
|
|
@@ -16406,6 +16534,10 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16406
16534
|
Method: "eth_sendRawTransaction";
|
|
16407
16535
|
Parameters: [signedTransaction: viem.Hex];
|
|
16408
16536
|
ReturnType: viem.Hash;
|
|
16537
|
+
}, {
|
|
16538
|
+
Method: "eth_sendRawTransactionSync";
|
|
16539
|
+
Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
|
|
16540
|
+
ReturnType: viem.RpcTransactionReceipt;
|
|
16409
16541
|
}, {
|
|
16410
16542
|
Method: "eth_simulateV1";
|
|
16411
16543
|
Parameters: [{
|
|
@@ -16461,6 +16593,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16461
16593
|
[x: `bytes4[${string}]`]: undefined;
|
|
16462
16594
|
[x: `bytes[${string}]`]: undefined;
|
|
16463
16595
|
[x: `bytes6[${string}]`]: undefined;
|
|
16596
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
16464
16597
|
[x: `bytes1[${string}]`]: undefined;
|
|
16465
16598
|
[x: `bytes2[${string}]`]: undefined;
|
|
16466
16599
|
[x: `bytes3[${string}]`]: undefined;
|
|
@@ -16468,7 +16601,6 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16468
16601
|
[x: `bytes7[${string}]`]: undefined;
|
|
16469
16602
|
[x: `bytes8[${string}]`]: undefined;
|
|
16470
16603
|
[x: `bytes9[${string}]`]: undefined;
|
|
16471
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
16472
16604
|
[x: `bytes11[${string}]`]: undefined;
|
|
16473
16605
|
[x: `bytes12[${string}]`]: undefined;
|
|
16474
16606
|
[x: `bytes13[${string}]`]: undefined;
|
|
@@ -16563,6 +16695,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16563
16695
|
bytes4?: undefined;
|
|
16564
16696
|
bytes?: undefined;
|
|
16565
16697
|
bytes6?: undefined;
|
|
16698
|
+
bytes10?: undefined;
|
|
16566
16699
|
bytes1?: undefined;
|
|
16567
16700
|
bytes2?: undefined;
|
|
16568
16701
|
bytes3?: undefined;
|
|
@@ -16570,7 +16703,6 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16570
16703
|
bytes7?: undefined;
|
|
16571
16704
|
bytes8?: undefined;
|
|
16572
16705
|
bytes9?: undefined;
|
|
16573
|
-
bytes10?: undefined;
|
|
16574
16706
|
bytes11?: undefined;
|
|
16575
16707
|
bytes12?: undefined;
|
|
16576
16708
|
bytes13?: undefined;
|
|
@@ -16668,7 +16800,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16668
16800
|
ReturnType: _aa_sdk_core.UserOperationEstimateGasResponse;
|
|
16669
16801
|
}, {
|
|
16670
16802
|
Method: "eth_getUserOperationReceipt";
|
|
16671
|
-
Parameters: [viem.Hash];
|
|
16803
|
+
Parameters: [viem.Hash, ("pending" | "latest")?];
|
|
16672
16804
|
ReturnType: _aa_sdk_core.UserOperationReceipt | null;
|
|
16673
16805
|
}, {
|
|
16674
16806
|
Method: "eth_getUserOperationByHash";
|
|
@@ -16708,7 +16840,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16708
16840
|
ReturnType: viem.Quantity;
|
|
16709
16841
|
}, {
|
|
16710
16842
|
Method: "eth_call";
|
|
16711
|
-
Parameters: [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride];
|
|
16843
|
+
Parameters: readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride] | readonly [transaction: viem.ExactPartial<viem.RpcTransactionRequest>, block: viem.RpcBlockNumber | viem.BlockTag | viem.RpcBlockIdentifier, stateOverrideSet: viem.RpcStateOverride, blockOverrides: viem.RpcBlockOverrides];
|
|
16712
16844
|
ReturnType: viem.Hex;
|
|
16713
16845
|
}, {
|
|
16714
16846
|
Method: "eth_createAccessList";
|
|
@@ -16857,6 +16989,10 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16857
16989
|
Method: "eth_sendRawTransaction";
|
|
16858
16990
|
Parameters: [signedTransaction: viem.Hex];
|
|
16859
16991
|
ReturnType: viem.Hash;
|
|
16992
|
+
}, {
|
|
16993
|
+
Method: "eth_sendRawTransactionSync";
|
|
16994
|
+
Parameters: [signedTransaction: viem.Hex] | [signedTransaction: viem.Hex, timeout: viem.Hex];
|
|
16995
|
+
ReturnType: viem.RpcTransactionReceipt;
|
|
16860
16996
|
}, {
|
|
16861
16997
|
Method: "eth_simulateV1";
|
|
16862
16998
|
Parameters: [{
|
|
@@ -16912,6 +17048,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16912
17048
|
[x: `bytes4[${string}]`]: undefined;
|
|
16913
17049
|
[x: `bytes[${string}]`]: undefined;
|
|
16914
17050
|
[x: `bytes6[${string}]`]: undefined;
|
|
17051
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
16915
17052
|
[x: `bytes1[${string}]`]: undefined;
|
|
16916
17053
|
[x: `bytes2[${string}]`]: undefined;
|
|
16917
17054
|
[x: `bytes3[${string}]`]: undefined;
|
|
@@ -16919,7 +17056,6 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
16919
17056
|
[x: `bytes7[${string}]`]: undefined;
|
|
16920
17057
|
[x: `bytes8[${string}]`]: undefined;
|
|
16921
17058
|
[x: `bytes9[${string}]`]: undefined;
|
|
16922
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
16923
17059
|
[x: `bytes11[${string}]`]: undefined;
|
|
16924
17060
|
[x: `bytes12[${string}]`]: undefined;
|
|
16925
17061
|
[x: `bytes13[${string}]`]: undefined;
|
|
@@ -17014,6 +17150,7 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
17014
17150
|
bytes4?: undefined;
|
|
17015
17151
|
bytes?: undefined;
|
|
17016
17152
|
bytes6?: undefined;
|
|
17153
|
+
bytes10?: undefined;
|
|
17017
17154
|
bytes1?: undefined;
|
|
17018
17155
|
bytes2?: undefined;
|
|
17019
17156
|
bytes3?: undefined;
|
|
@@ -17021,7 +17158,6 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
17021
17158
|
bytes7?: undefined;
|
|
17022
17159
|
bytes8?: undefined;
|
|
17023
17160
|
bytes9?: undefined;
|
|
17024
|
-
bytes10?: undefined;
|
|
17025
17161
|
bytes11?: undefined;
|
|
17026
17162
|
bytes12?: undefined;
|
|
17027
17163
|
bytes13?: undefined;
|
|
@@ -17111,9 +17247,18 @@ declare class AcpContractClientV2 extends BaseAcpContractClient {
|
|
|
17111
17247
|
getAddress: () => Address$1;
|
|
17112
17248
|
} & _aa_sdk_core.BundlerActions & viem.PublicActions>;
|
|
17113
17249
|
};
|
|
17250
|
+
get acpX402(): AcpX402;
|
|
17114
17251
|
private calculateGasFees;
|
|
17115
|
-
handleOperation(
|
|
17116
|
-
|
|
17252
|
+
handleOperation(operations: OperationPayload[]): Promise<{
|
|
17253
|
+
userOpHash: Address$1;
|
|
17254
|
+
txnHash: Address$1;
|
|
17255
|
+
}>;
|
|
17256
|
+
getJobId(createJobUserOpHash: Address$1, clientAddress: Address$1, providerAddress: Address$1): Promise<number>;
|
|
17257
|
+
updateJobX402Nonce(jobId: number, nonce: string): Promise<OffChainJob>;
|
|
17258
|
+
generateX402Payment(payableRequest: X402PayableRequest, requirements: X402PayableRequirements): Promise<X402Payment>;
|
|
17259
|
+
performX402Request(url: string, version: string, budget?: string, signature?: string): Promise<X402PaymentResponse>;
|
|
17260
|
+
getX402PaymentDetails(jobId: number): Promise<IAcpJobX402PaymentDetails>;
|
|
17261
|
+
getAcpVersion(): string;
|
|
17117
17262
|
}
|
|
17118
17263
|
|
|
17119
|
-
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 };
|
|
17264
|
+
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 };
|