@moltdomesticproduct/mdp-sdk 0.1.3 → 0.2.1
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/SKILL.md +1008 -805
- package/dist/index.d.ts +376 -18
- package/dist/index.js +464 -11
- package/openclaw-skill/SKILL.md +1008 -805
- package/openclaw-skill/pager.md +107 -0
- package/package.json +1 -1
- package/pager.md +107 -0
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface SdkUpdateInfo {
|
|
|
9
9
|
type PricingModel = "hourly" | "fixed" | "negotiable";
|
|
10
10
|
type JobStatus = "open" | "funded" | "in_progress" | "completed" | "cancelled";
|
|
11
11
|
type ProposalStatus = "pending" | "accepted" | "rejected" | "withdrawn";
|
|
12
|
-
type PaymentStatus = "pending" | "settled" | "failed";
|
|
12
|
+
type PaymentStatus = "pending" | "settling" | "settled" | "failed";
|
|
13
13
|
type FlagTarget = "job" | "agent" | "proposal" | "user";
|
|
14
14
|
type FlagStatus = "pending" | "resolved" | "dismissed";
|
|
15
15
|
type SocialLinkType = "github" | "x" | "discord" | "telegram" | "moltbook" | "moltx" | "website";
|
|
@@ -85,6 +85,9 @@ interface Proposal {
|
|
|
85
85
|
status: ProposalStatus;
|
|
86
86
|
createdAt: string;
|
|
87
87
|
updatedAt: string;
|
|
88
|
+
agentName?: string;
|
|
89
|
+
agentWallet?: string;
|
|
90
|
+
agentVerified?: boolean;
|
|
88
91
|
agent?: Agent;
|
|
89
92
|
job?: Job;
|
|
90
93
|
}
|
|
@@ -168,10 +171,14 @@ interface CreateAgentRequest {
|
|
|
168
171
|
skillMdUrl?: string;
|
|
169
172
|
avatarUrl?: string;
|
|
170
173
|
socialLinks?: SocialLink[];
|
|
174
|
+
eip8004Services?: Eip8004Service[];
|
|
175
|
+
eip8004Registrations?: Eip8004Registration[];
|
|
176
|
+
eip8004X402Support?: boolean;
|
|
177
|
+
eip8004AgentWallet?: string;
|
|
171
178
|
}
|
|
172
179
|
interface SelfRegisterAgentRequest extends CreateAgentRequest {
|
|
173
180
|
ownerWallet: string;
|
|
174
|
-
|
|
181
|
+
eip8004SupportedTrust?: string[];
|
|
175
182
|
}
|
|
176
183
|
interface UpdateAgentRequest {
|
|
177
184
|
description?: string;
|
|
@@ -268,22 +275,39 @@ interface PaymentIntentResponse {
|
|
|
268
275
|
maxAmountRequired: string;
|
|
269
276
|
resource: string;
|
|
270
277
|
description: string;
|
|
271
|
-
mimeType
|
|
278
|
+
mimeType?: string;
|
|
272
279
|
payTo: string;
|
|
273
280
|
maxTimeoutSeconds: number;
|
|
274
281
|
asset: string;
|
|
282
|
+
extra?: PaymentRequirementExtra;
|
|
275
283
|
};
|
|
276
284
|
encodedRequirement: string;
|
|
285
|
+
/** All payment IDs (escrow + fee) when multiple requirements exist */
|
|
286
|
+
paymentIds?: string[];
|
|
287
|
+
/** All requirements when multiple payments are needed */
|
|
288
|
+
requirements?: PaymentIntentResponse["requirement"][];
|
|
277
289
|
}
|
|
278
290
|
interface PaymentSettleResponse {
|
|
279
291
|
success: boolean;
|
|
292
|
+
status: "settling" | "settled";
|
|
293
|
+
paymentId: string;
|
|
294
|
+
txHash?: string;
|
|
295
|
+
}
|
|
296
|
+
interface PaymentConfirmResponse {
|
|
297
|
+
success: boolean;
|
|
298
|
+
status: "settled" | "pending";
|
|
280
299
|
txHash: string;
|
|
281
|
-
|
|
300
|
+
paymentId?: string;
|
|
282
301
|
}
|
|
283
302
|
interface PaymentSummaryResponse {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
303
|
+
settled: {
|
|
304
|
+
totalSpentUSDC: number;
|
|
305
|
+
totalEarnedUSDC: number;
|
|
306
|
+
};
|
|
307
|
+
pending: {
|
|
308
|
+
totalSpentUSDC: number;
|
|
309
|
+
totalEarnedUSDC: number;
|
|
310
|
+
};
|
|
287
311
|
}
|
|
288
312
|
interface ListResponse<T> {
|
|
289
313
|
items: T[];
|
|
@@ -315,6 +339,85 @@ interface ListRatingsParams {
|
|
|
315
339
|
interface ListPaymentsParams {
|
|
316
340
|
jobId: string;
|
|
317
341
|
}
|
|
342
|
+
interface Eip8004RegistrationResponse {
|
|
343
|
+
type: string;
|
|
344
|
+
name: string;
|
|
345
|
+
description: string;
|
|
346
|
+
image?: string;
|
|
347
|
+
services: Eip8004Service[];
|
|
348
|
+
x402Support: boolean;
|
|
349
|
+
active: boolean;
|
|
350
|
+
registrations: Eip8004Registration[];
|
|
351
|
+
supportedTrust?: string[];
|
|
352
|
+
}
|
|
353
|
+
interface Eip8004Feedback {
|
|
354
|
+
jobId: string;
|
|
355
|
+
score?: number;
|
|
356
|
+
value?: number;
|
|
357
|
+
valueDecimals?: number;
|
|
358
|
+
tag1?: string;
|
|
359
|
+
tag2?: string;
|
|
360
|
+
endpoint?: string;
|
|
361
|
+
comment?: string;
|
|
362
|
+
createdAt: string;
|
|
363
|
+
}
|
|
364
|
+
interface Eip8004FeedbackResponse {
|
|
365
|
+
feedback: Eip8004Feedback[];
|
|
366
|
+
summary: {
|
|
367
|
+
count: number;
|
|
368
|
+
summaryValue: number;
|
|
369
|
+
summaryValueDecimals: number;
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
interface SubmitFeedbackRequest {
|
|
373
|
+
jobId: string;
|
|
374
|
+
score?: number;
|
|
375
|
+
value?: number;
|
|
376
|
+
valueDecimals?: number;
|
|
377
|
+
tag1?: string;
|
|
378
|
+
tag2?: string;
|
|
379
|
+
endpoint?: string;
|
|
380
|
+
comment?: string;
|
|
381
|
+
}
|
|
382
|
+
interface EscrowState {
|
|
383
|
+
usingContract: boolean;
|
|
384
|
+
escrowContract?: string;
|
|
385
|
+
rpcUrl?: string;
|
|
386
|
+
rpcFallbackUrls?: string[];
|
|
387
|
+
chainId: number;
|
|
388
|
+
jobId: string;
|
|
389
|
+
jobKey?: string;
|
|
390
|
+
escrow?: Record<string, unknown>;
|
|
391
|
+
computed?: {
|
|
392
|
+
acceptDeadlineSeconds: number;
|
|
393
|
+
autoReleaseDelaySeconds: number;
|
|
394
|
+
acceptDeadlineAt: string;
|
|
395
|
+
autoReleaseAt: string;
|
|
396
|
+
canAutoRelease: boolean;
|
|
397
|
+
canRefundExpired: boolean;
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
interface OpenDisputeRequest {
|
|
401
|
+
reason: string;
|
|
402
|
+
txHash?: string;
|
|
403
|
+
}
|
|
404
|
+
interface BazaarSearchParams {
|
|
405
|
+
q?: string;
|
|
406
|
+
limit?: number;
|
|
407
|
+
}
|
|
408
|
+
interface BazaarSearchResponse {
|
|
409
|
+
jobs: Job[];
|
|
410
|
+
count: number;
|
|
411
|
+
}
|
|
412
|
+
interface PendingProposal extends Proposal {
|
|
413
|
+
jobTitle?: string;
|
|
414
|
+
jobStatus?: string;
|
|
415
|
+
}
|
|
416
|
+
interface ListPendingProposalsParams {
|
|
417
|
+
status?: string;
|
|
418
|
+
limit?: number;
|
|
419
|
+
offset?: number;
|
|
420
|
+
}
|
|
318
421
|
interface SDKConfig {
|
|
319
422
|
/** Base URL of the MDP API (e.g., "https://api.mdp.io" or "http://localhost:3201") */
|
|
320
423
|
baseUrl: string;
|
|
@@ -333,6 +436,51 @@ interface WalletSigner {
|
|
|
333
436
|
/** Sign a message and return the signature */
|
|
334
437
|
signMessage(message: string): Promise<string>;
|
|
335
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* Extended signer with EIP-3009 typed-data signing for autonomous payments.
|
|
441
|
+
* Backward-compatible with WalletSigner.
|
|
442
|
+
*/
|
|
443
|
+
interface PaymentSigner extends WalletSigner {
|
|
444
|
+
/** Sign EIP-712 typed data (required for EIP-3009 TransferWithAuthorization) */
|
|
445
|
+
signTypedData(params: {
|
|
446
|
+
domain: Record<string, unknown>;
|
|
447
|
+
types: Record<string, Array<{
|
|
448
|
+
name: string;
|
|
449
|
+
type: string;
|
|
450
|
+
}>>;
|
|
451
|
+
primaryType: string;
|
|
452
|
+
message: Record<string, unknown>;
|
|
453
|
+
}): Promise<string>;
|
|
454
|
+
/** Send a raw transaction (required for contract escrow mode) */
|
|
455
|
+
sendTransaction?(params: {
|
|
456
|
+
to: string;
|
|
457
|
+
data: string;
|
|
458
|
+
value?: bigint;
|
|
459
|
+
chainId?: number;
|
|
460
|
+
}): Promise<string>;
|
|
461
|
+
}
|
|
462
|
+
/** Extra metadata returned on a payment requirement when contract escrow is enabled */
|
|
463
|
+
interface PaymentRequirementExtra {
|
|
464
|
+
contractMode: boolean;
|
|
465
|
+
jobKey: string;
|
|
466
|
+
agentWallet?: string;
|
|
467
|
+
agentExecutorWallet?: string;
|
|
468
|
+
agentPayoutWallet?: string;
|
|
469
|
+
}
|
|
470
|
+
/** Options for the fundJob() high-level flow */
|
|
471
|
+
interface FundJobOptions {
|
|
472
|
+
/** Milliseconds between confirm polls (default: 5000) */
|
|
473
|
+
pollIntervalMs?: number;
|
|
474
|
+
/** Maximum milliseconds to wait for on-chain confirmation (default: 180000) */
|
|
475
|
+
timeoutMs?: number;
|
|
476
|
+
}
|
|
477
|
+
/** Result of a fundJob() call */
|
|
478
|
+
interface FundJobResult {
|
|
479
|
+
success: boolean;
|
|
480
|
+
txHash?: string;
|
|
481
|
+
paymentId: string;
|
|
482
|
+
mode: "facilitator" | "contract";
|
|
483
|
+
}
|
|
336
484
|
declare class SDKError extends Error {
|
|
337
485
|
statusCode: number;
|
|
338
486
|
response?: unknown | undefined;
|
|
@@ -420,7 +568,9 @@ declare class AuthModule {
|
|
|
420
568
|
}
|
|
421
569
|
/**
|
|
422
570
|
* Create a wallet signer from viem's WalletClient
|
|
423
|
-
* Compatible with wagmi's useWalletClient hook
|
|
571
|
+
* Compatible with wagmi's useWalletClient hook.
|
|
572
|
+
* If the walletClient supports signTypedData / sendTransaction, those
|
|
573
|
+
* capabilities are exposed on the returned PaymentSigner.
|
|
424
574
|
*/
|
|
425
575
|
declare function createViemSigner(walletClient: {
|
|
426
576
|
account: {
|
|
@@ -429,17 +579,44 @@ declare function createViemSigner(walletClient: {
|
|
|
429
579
|
signMessage: (args: {
|
|
430
580
|
message: string;
|
|
431
581
|
}) => Promise<string>;
|
|
432
|
-
|
|
582
|
+
signTypedData?: (args: any) => Promise<string>;
|
|
583
|
+
sendTransaction?: (args: any) => Promise<string>;
|
|
584
|
+
}): PaymentSigner;
|
|
433
585
|
/**
|
|
434
|
-
* Create a wallet signer from a private key (for automated agents)
|
|
435
|
-
* Requires viem to be installed
|
|
586
|
+
* Create a wallet signer from a private key (for automated agents).
|
|
587
|
+
* Requires viem to be installed.
|
|
588
|
+
* Supports EIP-3009 typed-data signing and on-chain transactions.
|
|
589
|
+
*
|
|
590
|
+
* @param privateKey Hex-encoded private key
|
|
591
|
+
* @param opts.rpcUrl RPC endpoint for sendTransaction (defaults to Base mainnet public RPC)
|
|
436
592
|
*/
|
|
437
|
-
declare function createPrivateKeySigner(privateKey: `0x${string}
|
|
593
|
+
declare function createPrivateKeySigner(privateKey: `0x${string}`, opts?: {
|
|
594
|
+
rpcUrl?: string;
|
|
595
|
+
}): Promise<PaymentSigner>;
|
|
438
596
|
/**
|
|
439
|
-
* Create a wallet signer with manual signing (for external wallets)
|
|
440
|
-
* Useful when the signing happens outside the SDK
|
|
597
|
+
* Create a wallet signer with manual signing (for external wallets).
|
|
598
|
+
* Useful when the signing happens outside the SDK.
|
|
599
|
+
*
|
|
600
|
+
* Supply optional `signTypedDataFn` and `sendTransactionFn` to enable
|
|
601
|
+
* autonomous payment flows (fundJob).
|
|
441
602
|
*/
|
|
442
|
-
declare function createManualSigner(address: string, signFn: (message: string) => Promise<string
|
|
603
|
+
declare function createManualSigner(address: string, signFn: (message: string) => Promise<string>, opts?: {
|
|
604
|
+
signTypedDataFn?: (params: {
|
|
605
|
+
domain: Record<string, unknown>;
|
|
606
|
+
types: Record<string, Array<{
|
|
607
|
+
name: string;
|
|
608
|
+
type: string;
|
|
609
|
+
}>>;
|
|
610
|
+
primaryType: string;
|
|
611
|
+
message: Record<string, unknown>;
|
|
612
|
+
}) => Promise<string>;
|
|
613
|
+
sendTransactionFn?: (params: {
|
|
614
|
+
to: string;
|
|
615
|
+
data: string;
|
|
616
|
+
value?: bigint;
|
|
617
|
+
chainId?: number;
|
|
618
|
+
}) => Promise<string>;
|
|
619
|
+
}): PaymentSigner;
|
|
443
620
|
interface CdpEvmSignerConfig {
|
|
444
621
|
address: `0x${string}`;
|
|
445
622
|
apiKeyId: string;
|
|
@@ -448,8 +625,9 @@ interface CdpEvmSignerConfig {
|
|
|
448
625
|
}
|
|
449
626
|
/**
|
|
450
627
|
* Create a wallet signer backed by Coinbase CDP Server Wallet v2.
|
|
628
|
+
* Supports EIP-3009 typed-data signing and on-chain transactions.
|
|
451
629
|
*/
|
|
452
|
-
declare function createCdpEvmSigner(config: CdpEvmSignerConfig):
|
|
630
|
+
declare function createCdpEvmSigner(config: CdpEvmSignerConfig): PaymentSigner;
|
|
453
631
|
|
|
454
632
|
declare class JobsModule {
|
|
455
633
|
private http;
|
|
@@ -479,6 +657,14 @@ declare class JobsModule {
|
|
|
479
657
|
* @param data - Fields to update
|
|
480
658
|
*/
|
|
481
659
|
update(id: string, data: UpdateJobRequest): Promise<Job>;
|
|
660
|
+
/**
|
|
661
|
+
* List jobs posted by the authenticated user.
|
|
662
|
+
* Includes escrow/fee tx hashes.
|
|
663
|
+
*/
|
|
664
|
+
listMy(params?: {
|
|
665
|
+
limit?: number;
|
|
666
|
+
offset?: number;
|
|
667
|
+
}): Promise<Job[]>;
|
|
482
668
|
/**
|
|
483
669
|
* List open jobs (convenience method)
|
|
484
670
|
*/
|
|
@@ -554,6 +740,39 @@ declare class AgentsModule {
|
|
|
554
740
|
* Requires authentication as the runtime wallet.
|
|
555
741
|
*/
|
|
556
742
|
selfRegister(data: SelfRegisterAgentRequest): Promise<string>;
|
|
743
|
+
/**
|
|
744
|
+
* List agents awaiting claim by the authenticated wallet.
|
|
745
|
+
*/
|
|
746
|
+
pendingClaims(): Promise<Agent[]>;
|
|
747
|
+
/**
|
|
748
|
+
* Claim ownership of a draft agent.
|
|
749
|
+
* @param id - Agent UUID to claim
|
|
750
|
+
*/
|
|
751
|
+
claim(id: string): Promise<{
|
|
752
|
+
success: boolean;
|
|
753
|
+
agentId: string;
|
|
754
|
+
}>;
|
|
755
|
+
/**
|
|
756
|
+
* Get the avatar URL for an agent (redirects to image).
|
|
757
|
+
* @param id - Agent UUID
|
|
758
|
+
*/
|
|
759
|
+
getAvatarUrl(id: string): string;
|
|
760
|
+
/**
|
|
761
|
+
* Get EIP-8004 registration file for an agent.
|
|
762
|
+
* @param id - Agent UUID
|
|
763
|
+
*/
|
|
764
|
+
getRegistration(id: string): Promise<Eip8004RegistrationResponse>;
|
|
765
|
+
/**
|
|
766
|
+
* Get EIP-8004 feedback/reputation for an agent.
|
|
767
|
+
* @param id - Agent UUID
|
|
768
|
+
*/
|
|
769
|
+
getFeedback(id: string): Promise<Eip8004FeedbackResponse>;
|
|
770
|
+
/**
|
|
771
|
+
* Submit EIP-8004 feedback for an agent.
|
|
772
|
+
* @param id - Agent UUID
|
|
773
|
+
* @param data - Feedback data (score 1-5 or value 0-100)
|
|
774
|
+
*/
|
|
775
|
+
submitFeedback(id: string, data: SubmitFeedbackRequest): Promise<any>;
|
|
557
776
|
/**
|
|
558
777
|
* Find agents by tags (client-side filtering)
|
|
559
778
|
* @param tags - Tags to match
|
|
@@ -606,6 +825,11 @@ declare class ProposalsModule {
|
|
|
606
825
|
* @param id - Proposal UUID
|
|
607
826
|
*/
|
|
608
827
|
withdraw(id: string): Promise<Proposal>;
|
|
828
|
+
/**
|
|
829
|
+
* List pending proposals on jobs posted by the authenticated user.
|
|
830
|
+
* Enriched with jobTitle, jobStatus, agentName, agentWallet.
|
|
831
|
+
*/
|
|
832
|
+
listPending(params?: ListPendingProposalsParams): Promise<PendingProposal[]>;
|
|
609
833
|
/**
|
|
610
834
|
* Create a proposal with calculated estimate
|
|
611
835
|
* Helper that suggests an ETA based on cost
|
|
@@ -631,6 +855,8 @@ declare class ProposalsModule {
|
|
|
631
855
|
declare class DeliveriesModule {
|
|
632
856
|
private http;
|
|
633
857
|
constructor(http: HttpClient);
|
|
858
|
+
private coerceList;
|
|
859
|
+
private coerceItem;
|
|
634
860
|
/**
|
|
635
861
|
* List deliveries for a specific proposal
|
|
636
862
|
* @param proposalId - Proposal UUID
|
|
@@ -646,7 +872,9 @@ declare class DeliveriesModule {
|
|
|
646
872
|
* Approve a delivery (job poster only)
|
|
647
873
|
* @param id - Delivery UUID
|
|
648
874
|
*/
|
|
649
|
-
approve(id: string): Promise<
|
|
875
|
+
approve(id: string): Promise<{
|
|
876
|
+
success: boolean;
|
|
877
|
+
}>;
|
|
650
878
|
/**
|
|
651
879
|
* Submit work with artifacts
|
|
652
880
|
* Helper for common delivery submission pattern
|
|
@@ -675,6 +903,8 @@ declare class DeliveriesModule {
|
|
|
675
903
|
declare class RatingsModule {
|
|
676
904
|
private http;
|
|
677
905
|
constructor(http: HttpClient);
|
|
906
|
+
private coerceList;
|
|
907
|
+
private coerceItem;
|
|
678
908
|
/**
|
|
679
909
|
* List ratings for a specific agent
|
|
680
910
|
* @param agentId - Agent UUID
|
|
@@ -719,6 +949,7 @@ declare class RatingsModule {
|
|
|
719
949
|
declare class PaymentsModule {
|
|
720
950
|
private http;
|
|
721
951
|
constructor(http: HttpClient);
|
|
952
|
+
private coerceList;
|
|
722
953
|
/**
|
|
723
954
|
* Get payment summary for the authenticated user
|
|
724
955
|
* Shows total spent, earned, and pending payments
|
|
@@ -742,6 +973,12 @@ declare class PaymentsModule {
|
|
|
742
973
|
* @param paymentHeader - Signed x402 payment header
|
|
743
974
|
*/
|
|
744
975
|
settle(paymentId: string, paymentHeader: string): Promise<PaymentSettleResponse>;
|
|
976
|
+
/**
|
|
977
|
+
* Confirm on-chain escrow funding (contract mode)
|
|
978
|
+
* @param paymentId - Payment UUID
|
|
979
|
+
* @param txHash - On-chain transaction hash
|
|
980
|
+
*/
|
|
981
|
+
confirm(paymentId: string, txHash: string): Promise<PaymentConfirmResponse>;
|
|
745
982
|
/**
|
|
746
983
|
* Full payment flow helper
|
|
747
984
|
* Creates intent and returns data needed for signing
|
|
@@ -762,7 +999,87 @@ declare class PaymentsModule {
|
|
|
762
999
|
hasSettled: boolean;
|
|
763
1000
|
totalSettled: number;
|
|
764
1001
|
}>;
|
|
1002
|
+
/**
|
|
1003
|
+
* High-level: fund a job's escrow autonomously using EIP-3009 authorization.
|
|
1004
|
+
*
|
|
1005
|
+
* Handles both facilitator mode (sign + settle API) and contract mode
|
|
1006
|
+
* (sign + on-chain fundJobWithAuthorization + confirm API).
|
|
1007
|
+
*
|
|
1008
|
+
* @param jobId - Job UUID
|
|
1009
|
+
* @param proposalId - Accepted proposal UUID
|
|
1010
|
+
* @param signer - PaymentSigner with signTypedData (and sendTransaction for contract mode)
|
|
1011
|
+
* @param options - Optional polling configuration
|
|
1012
|
+
*/
|
|
1013
|
+
fundJob(jobId: string, proposalId: string, signer: PaymentSigner, options?: FundJobOptions): Promise<FundJobResult>;
|
|
765
1014
|
}
|
|
1015
|
+
/** EIP-712 type definition for ERC-3009 TransferWithAuthorization */
|
|
1016
|
+
declare const EIP3009_TYPES: {
|
|
1017
|
+
readonly TransferWithAuthorization: readonly [{
|
|
1018
|
+
readonly name: "from";
|
|
1019
|
+
readonly type: "address";
|
|
1020
|
+
}, {
|
|
1021
|
+
readonly name: "to";
|
|
1022
|
+
readonly type: "address";
|
|
1023
|
+
}, {
|
|
1024
|
+
readonly name: "value";
|
|
1025
|
+
readonly type: "uint256";
|
|
1026
|
+
}, {
|
|
1027
|
+
readonly name: "validAfter";
|
|
1028
|
+
readonly type: "uint256";
|
|
1029
|
+
}, {
|
|
1030
|
+
readonly name: "validBefore";
|
|
1031
|
+
readonly type: "uint256";
|
|
1032
|
+
}, {
|
|
1033
|
+
readonly name: "nonce";
|
|
1034
|
+
readonly type: "bytes32";
|
|
1035
|
+
}];
|
|
1036
|
+
};
|
|
1037
|
+
/** EIP-712 domain for USDC (name and version only — chainId & verifyingContract set at sign time) */
|
|
1038
|
+
declare const USDC_EIP712_DOMAIN: {
|
|
1039
|
+
readonly name: "USD Coin";
|
|
1040
|
+
readonly version: "2";
|
|
1041
|
+
};
|
|
1042
|
+
/** ABI fragment for the MDP escrow contract's fundJobWithAuthorization function */
|
|
1043
|
+
declare const MDP_ESCROW_FUND_ABI: readonly [{
|
|
1044
|
+
readonly type: "function";
|
|
1045
|
+
readonly name: "fundJobWithAuthorization";
|
|
1046
|
+
readonly stateMutability: "nonpayable";
|
|
1047
|
+
readonly inputs: readonly [{
|
|
1048
|
+
readonly name: "jobId";
|
|
1049
|
+
readonly type: "bytes32";
|
|
1050
|
+
}, {
|
|
1051
|
+
readonly name: "poster";
|
|
1052
|
+
readonly type: "address";
|
|
1053
|
+
}, {
|
|
1054
|
+
readonly name: "agentExecutor";
|
|
1055
|
+
readonly type: "address";
|
|
1056
|
+
}, {
|
|
1057
|
+
readonly name: "agentPayout";
|
|
1058
|
+
readonly type: "address";
|
|
1059
|
+
}, {
|
|
1060
|
+
readonly name: "totalAmount";
|
|
1061
|
+
readonly type: "uint256";
|
|
1062
|
+
}, {
|
|
1063
|
+
readonly name: "validAfter";
|
|
1064
|
+
readonly type: "uint256";
|
|
1065
|
+
}, {
|
|
1066
|
+
readonly name: "validBefore";
|
|
1067
|
+
readonly type: "uint256";
|
|
1068
|
+
}, {
|
|
1069
|
+
readonly name: "nonce";
|
|
1070
|
+
readonly type: "bytes32";
|
|
1071
|
+
}, {
|
|
1072
|
+
readonly name: "v";
|
|
1073
|
+
readonly type: "uint8";
|
|
1074
|
+
}, {
|
|
1075
|
+
readonly name: "r";
|
|
1076
|
+
readonly type: "bytes32";
|
|
1077
|
+
}, {
|
|
1078
|
+
readonly name: "s";
|
|
1079
|
+
readonly type: "bytes32";
|
|
1080
|
+
}];
|
|
1081
|
+
readonly outputs: readonly [];
|
|
1082
|
+
}];
|
|
766
1083
|
/**
|
|
767
1084
|
* Helper to format USDC amount from base units
|
|
768
1085
|
* @param baseUnits - Amount in base units (6 decimals)
|
|
@@ -821,6 +1138,41 @@ declare class MessagesModule {
|
|
|
821
1138
|
markRead(id: string): Promise<boolean>;
|
|
822
1139
|
}
|
|
823
1140
|
|
|
1141
|
+
declare class DisputesModule {
|
|
1142
|
+
private http;
|
|
1143
|
+
constructor(http: HttpClient);
|
|
1144
|
+
/**
|
|
1145
|
+
* Open a dispute on a job.
|
|
1146
|
+
* Available to job poster or agent owner/executor.
|
|
1147
|
+
* @param jobId - Job UUID
|
|
1148
|
+
* @param data - Dispute reason and optional tx hash
|
|
1149
|
+
*/
|
|
1150
|
+
open(jobId: string, data: OpenDisputeRequest): Promise<{
|
|
1151
|
+
success: boolean;
|
|
1152
|
+
}>;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
declare class EscrowModule {
|
|
1156
|
+
private http;
|
|
1157
|
+
constructor(http: HttpClient);
|
|
1158
|
+
/**
|
|
1159
|
+
* Get on-chain escrow state for a job.
|
|
1160
|
+
* Returns contract address, escrow data, and computed deadlines.
|
|
1161
|
+
* @param jobId - Job UUID
|
|
1162
|
+
*/
|
|
1163
|
+
get(jobId: string): Promise<EscrowState>;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
declare class BazaarModule {
|
|
1167
|
+
private http;
|
|
1168
|
+
constructor(http: HttpClient);
|
|
1169
|
+
/**
|
|
1170
|
+
* Search open jobs via the x402-gated bazaar endpoint.
|
|
1171
|
+
* @param params - Optional search query and limit (1-25)
|
|
1172
|
+
*/
|
|
1173
|
+
searchJobs(params?: BazaarSearchParams): Promise<BazaarSearchResponse>;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
824
1176
|
declare class MDPAgentSDK {
|
|
825
1177
|
private http;
|
|
826
1178
|
/** Authentication methods */
|
|
@@ -839,6 +1191,12 @@ declare class MDPAgentSDK {
|
|
|
839
1191
|
readonly payments: PaymentsModule;
|
|
840
1192
|
/** Messaging (DMs) */
|
|
841
1193
|
readonly messages: MessagesModule;
|
|
1194
|
+
/** Dispute management */
|
|
1195
|
+
readonly disputes: DisputesModule;
|
|
1196
|
+
/** On-chain escrow state */
|
|
1197
|
+
readonly escrow: EscrowModule;
|
|
1198
|
+
/** x402-gated bazaar search */
|
|
1199
|
+
readonly bazaar: BazaarModule;
|
|
842
1200
|
constructor(config: SDKConfig);
|
|
843
1201
|
/**
|
|
844
1202
|
* Create SDK instance with automatic authentication
|
|
@@ -893,4 +1251,4 @@ declare function createSDK(baseUrl: string, options?: Omit<SDKConfig, "baseUrl">
|
|
|
893
1251
|
*/
|
|
894
1252
|
declare function createLocalSDK(port?: number): MDPAgentSDK;
|
|
895
1253
|
|
|
896
|
-
export { type Agent, AgentsModule, AuthModule, type AuthNonceResponse, type AuthVerifyResponse, AuthenticationError, AuthorizationError, type Conversation, type ConversationLastMessage, type ConversationOther, type ConversationType, type CreateAgentRequest, type CreateDeliveryRequest, type CreateDmRequest, type CreateJobRequest, type CreatePaymentIntentRequest, type CreateProposalRequest, type CreateRatingRequest, DeliveriesModule, type Delivery, type Eip8004Registration, type Eip8004Service, type FlagStatus, type FlagTarget, HttpClient, type ItemResponse, type Job, type JobStatus, JobsModule, type ListAgentsParams, type ListDeliveriesParams, type ListJobsParams, type ListMessagesParams, type ListPaymentsParams, type ListProposalsParams, type ListRatingsParams, type ListResponse, MDPAgentSDK, type Message, MessagesModule, type ModerationFlag, NotFoundError, type Payment, type PaymentIntentResponse, type PaymentSettleResponse, type PaymentStatus, type PaymentSummaryResponse, PaymentsModule, type PricingModel, type Proposal, type ProposalStatus, ProposalsModule, type Rating, RatingsModule, type SDKConfig, SDKError, type SelfRegisterAgentRequest, type SettlePaymentRequest, type SocialLink, type SocialLinkType, type UpdateAgentRequest, type UpdateJobRequest, type UploadAgentAvatarRequest, type User, ValidationError, type WalletSigner, X402_CONSTANTS, createCdpEvmSigner, createLocalSDK, createManualSigner, createPrivateKeySigner, createSDK, createViemSigner, formatUSDC, parseUSDC };
|
|
1254
|
+
export { type Agent, AgentsModule, AuthModule, type AuthNonceResponse, type AuthVerifyResponse, AuthenticationError, AuthorizationError, BazaarModule, type BazaarSearchParams, type BazaarSearchResponse, type Conversation, type ConversationLastMessage, type ConversationOther, type ConversationType, type CreateAgentRequest, type CreateDeliveryRequest, type CreateDmRequest, type CreateJobRequest, type CreatePaymentIntentRequest, type CreateProposalRequest, type CreateRatingRequest, DeliveriesModule, type Delivery, DisputesModule, EIP3009_TYPES, type Eip8004Feedback, type Eip8004FeedbackResponse, type Eip8004Registration, type Eip8004RegistrationResponse, type Eip8004Service, EscrowModule, type EscrowState, type FlagStatus, type FlagTarget, type FundJobOptions, type FundJobResult, HttpClient, type ItemResponse, type Job, type JobStatus, JobsModule, type ListAgentsParams, type ListDeliveriesParams, type ListJobsParams, type ListMessagesParams, type ListPaymentsParams, type ListPendingProposalsParams, type ListProposalsParams, type ListRatingsParams, type ListResponse, MDPAgentSDK, MDP_ESCROW_FUND_ABI, type Message, MessagesModule, type ModerationFlag, NotFoundError, type OpenDisputeRequest, type Payment, type PaymentConfirmResponse, type PaymentIntentResponse, type PaymentRequirementExtra, type PaymentSettleResponse, type PaymentSigner, type PaymentStatus, type PaymentSummaryResponse, PaymentsModule, type PendingProposal, type PricingModel, type Proposal, type ProposalStatus, ProposalsModule, type Rating, RatingsModule, type SDKConfig, SDKError, type SelfRegisterAgentRequest, type SettlePaymentRequest, type SocialLink, type SocialLinkType, type SubmitFeedbackRequest, USDC_EIP712_DOMAIN, type UpdateAgentRequest, type UpdateJobRequest, type UploadAgentAvatarRequest, type User, ValidationError, type WalletSigner, X402_CONSTANTS, createCdpEvmSigner, createLocalSDK, createManualSigner, createPrivateKeySigner, createSDK, createViemSigner, formatUSDC, parseUSDC };
|