@pakt/psilo 0.0.2 → 0.0.4

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.
@@ -0,0 +1,821 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+
3
+ declare class Connector {
4
+ private readonly client;
5
+ constructor(baseURL: string);
6
+ setHeader(key: string, value: string): void;
7
+ removeHeader(key: string): void;
8
+ private handleResponse;
9
+ private handleError;
10
+ get<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
11
+ post<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
12
+ put<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
13
+ patch<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
14
+ delete<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
15
+ }
16
+
17
+ interface StandardResponse<T> {
18
+ success: boolean;
19
+ data: T;
20
+ error?: {
21
+ code: string;
22
+ message: string;
23
+ details?: any;
24
+ };
25
+ }
26
+
27
+ declare enum Status {
28
+ SUCCESS = "success",
29
+ ERROR = "error"
30
+ }
31
+ interface ResponseDto<T> {
32
+ data: T;
33
+ status: Status;
34
+ message?: string;
35
+ code?: number;
36
+ statusCode?: number;
37
+ validation?: Record<string, any>;
38
+ }
39
+ type IAny = any;
40
+ type ErrorWithMessage = {
41
+ message: string[] | object[] | any;
42
+ code?: string;
43
+ };
44
+ declare const ErrorUtils: {
45
+ newTryFail: <T>(f: (() => Promise<T>) | (() => T)) => Promise<T>;
46
+ formatErrorMsg: (message: string) => string;
47
+ toErrorWithMessage: (maybeError: unknown) => ErrorWithMessage;
48
+ isErrorWithMessage(e: unknown): e is ErrorWithMessage;
49
+ };
50
+ declare const parseUrlWithQuery: (url: string, filter: object | any) => string;
51
+
52
+ interface EscrowModuleType {
53
+ create(data: CreateEscrowDto): Promise<ResponseDto<CreateEscrowResponse>>;
54
+ getStatus(chainId: string, escrowAddress: string): Promise<ResponseDto<EscrowStatusResponse>>;
55
+ release(chainId: string, escrowAddress: string, data?: ReleaseDto): Promise<ResponseDto<ReleaseResponse>>;
56
+ updateStatus(data: UpdateEscrowStatusDto): Promise<ResponseDto<PrepareTransactionResponse>>;
57
+ getChains(): Promise<ResponseDto<GetEscrowChainsResponseDto>>;
58
+ getAssets(chainId: string): Promise<ResponseDto<GetEscrowAssetsResponseDto>>;
59
+ }
60
+ interface EscrowWebhookConfigDto {
61
+ webhookUrl: string;
62
+ webHookType: "a2a" | "json";
63
+ }
64
+ interface CreateEscrowDto {
65
+ chainId: string;
66
+ buyer: string;
67
+ seller: string;
68
+ creator?: string;
69
+ title: string;
70
+ description?: string;
71
+ amount: string;
72
+ asset: string;
73
+ expiration?: string;
74
+ releaseType?: string;
75
+ webhookUrls?: EscrowWebhookConfigDto;
76
+ }
77
+ interface CreateEscrowResponse {
78
+ buyerWallet: string;
79
+ sellerWallet: string;
80
+ arbiterWallet: string;
81
+ title: string;
82
+ description: string | null;
83
+ amount: number | string;
84
+ expiration: string;
85
+ releaseType: number | string;
86
+ metadataHash: string;
87
+ chainId: string | null;
88
+ onChain: {
89
+ txHash: string;
90
+ escrowAddress: string;
91
+ approve: {
92
+ to: string;
93
+ data: string;
94
+ value: string;
95
+ } | null;
96
+ deposit: {
97
+ to: string;
98
+ data: string;
99
+ value: string;
100
+ };
101
+ };
102
+ }
103
+ interface EscrowStatusResponse {
104
+ chainId: string;
105
+ escrow: string;
106
+ buyer: string;
107
+ seller: string;
108
+ arbiter: string;
109
+ deposited: boolean;
110
+ released: boolean;
111
+ readyForRelease: boolean;
112
+ buyerReleaseReady: boolean;
113
+ balance: string;
114
+ }
115
+ interface DepositDto {
116
+ from: string;
117
+ }
118
+ interface DepositResponse {
119
+ transactionHash: string;
120
+ blockNumber: number;
121
+ deposited: boolean;
122
+ balance: string;
123
+ }
124
+ interface SignReleaseDto {
125
+ signerAddress: string;
126
+ privateKey?: string;
127
+ }
128
+ interface SignReleaseResponse {
129
+ signature: string;
130
+ messageHash: string;
131
+ signer: string;
132
+ isShardholder: boolean;
133
+ shardRole: string;
134
+ }
135
+ interface ReleaseDto {
136
+ recipient?: string;
137
+ }
138
+ interface ReleaseResponse {
139
+ success: boolean;
140
+ txHash: string;
141
+ escrowAddress: string;
142
+ arbiter: string;
143
+ }
144
+ interface UpdateEscrowStatusDto {
145
+ chainId: string;
146
+ escrow: string;
147
+ address?: string;
148
+ webhookUrl?: string;
149
+ }
150
+ interface PrepareTransactionResponse {
151
+ to: string;
152
+ data: string;
153
+ value: string;
154
+ chainId: string;
155
+ gas: string;
156
+ maxFeePerGas: string;
157
+ maxPriorityFeePerGas: string;
158
+ type: string;
159
+ instructions: string;
160
+ seller?: string;
161
+ buyer?: string;
162
+ nonce?: string;
163
+ }
164
+ interface EscrowNativeCurrencyDto {
165
+ name: string;
166
+ symbol: string;
167
+ decimals: number;
168
+ }
169
+ interface EscrowChainDto {
170
+ chainId: string;
171
+ name: string;
172
+ network: string;
173
+ nativeCurrency: EscrowNativeCurrencyDto;
174
+ }
175
+ interface GetEscrowChainsResponseDto {
176
+ chains: EscrowChainDto[];
177
+ }
178
+ interface EscrowAssetDto {
179
+ address: string;
180
+ symbol: string;
181
+ name: string;
182
+ decimals: number;
183
+ isNative: boolean;
184
+ }
185
+ interface GetEscrowAssetsResponseDto {
186
+ chainId: string;
187
+ assets: EscrowAssetDto[];
188
+ }
189
+
190
+ declare class EscrowService implements EscrowModuleType {
191
+ private id;
192
+ private connector;
193
+ constructor(id: string);
194
+ create(data: CreateEscrowDto): Promise<ResponseDto<CreateEscrowResponse>>;
195
+ getStatus(chainId: string, escrowAddress: string): Promise<ResponseDto<EscrowStatusResponse>>;
196
+ updateStatus(data: UpdateEscrowStatusDto): Promise<ResponseDto<PrepareTransactionResponse>>;
197
+ release(chainId: string, escrowAddress: string, data?: ReleaseDto): Promise<ResponseDto<ReleaseResponse>>;
198
+ getChains(): Promise<ResponseDto<GetEscrowChainsResponseDto>>;
199
+ getAssets(chainId: string): Promise<ResponseDto<GetEscrowAssetsResponseDto>>;
200
+ }
201
+
202
+ interface AuthModuleType {
203
+ register(data: RegisterDto): Promise<ResponseDto<RegisterResponse>>;
204
+ nonce(data: NonceDto): Promise<ResponseDto<NonceResponse>>;
205
+ verify(data: VerifyDto): Promise<ResponseDto<VerifyResponse>>;
206
+ }
207
+ interface NonceDto {
208
+ address: string;
209
+ agentId: string;
210
+ agentRegistry?: string;
211
+ }
212
+ interface NonceResponse {
213
+ nonce: string;
214
+ [key: string]: unknown;
215
+ }
216
+ interface VerifyDto {
217
+ message: string;
218
+ signature: string;
219
+ }
220
+ interface VerifyResponse {
221
+ token: string;
222
+ [key: string]: unknown;
223
+ }
224
+ interface RegisterDto {
225
+ address: string;
226
+ agentId: string;
227
+ agentRegistry?: string;
228
+ chainId?: string;
229
+ name?: string;
230
+ webhookUrl?: string;
231
+ }
232
+ interface RegisterResponse {
233
+ [key: string]: unknown;
234
+ }
235
+ interface PaktWeb3RequestResponse {
236
+ message: string;
237
+ tempToken: string;
238
+ }
239
+ interface PaktWeb3ValidateResponse {
240
+ token?: string;
241
+ token_type?: string;
242
+ expiresIn?: number;
243
+ isVerified?: boolean;
244
+ timeZone?: string | null;
245
+ account?: string;
246
+ tempToken?: string;
247
+ }
248
+ interface PaktWeb3OnboardResponse {
249
+ tempToken: string;
250
+ isVerified: boolean;
251
+ timeZone: string | null;
252
+ }
253
+
254
+ declare class AuthService implements AuthModuleType {
255
+ private id;
256
+ private connector;
257
+ constructor(id: string);
258
+ register(data: RegisterDto): Promise<ResponseDto<RegisterResponse>>;
259
+ nonce(data: NonceDto): Promise<ResponseDto<NonceResponse>>;
260
+ verify(data: VerifyDto): Promise<ResponseDto<VerifyResponse>>;
261
+ paktWeb3Login(privateKey: string): Promise<string>;
262
+ static generateWallet(): {
263
+ privateKey: string;
264
+ address: string;
265
+ };
266
+ private _paktWeb3Request;
267
+ private _paktWeb3Validate;
268
+ private _paktWeb3Onboard;
269
+ }
270
+
271
+ type MessageType = "TEXT" | "MEDIA" | "TEXT_MEDIA";
272
+ interface SendMessagePayload {
273
+ conversationId: string;
274
+ type: MessageType;
275
+ message?: string;
276
+ attachments?: string[];
277
+ }
278
+ interface BroadcastMessage {
279
+ _id: string;
280
+ user: string;
281
+ content?: string;
282
+ conversation: string;
283
+ type: string;
284
+ attachments?: string[];
285
+ seen?: boolean;
286
+ createdAt: string;
287
+ updatedAt: string;
288
+ }
289
+ interface ConversationRecipient {
290
+ _id: string;
291
+ firstName: string;
292
+ lastName: string;
293
+ profileImage?: {
294
+ url: string;
295
+ };
296
+ socket?: {
297
+ status: "ONLINE" | "AWAY" | "OFFLINE";
298
+ };
299
+ }
300
+ interface ConversationMessage {
301
+ _id: string;
302
+ user: string;
303
+ content?: string;
304
+ conversation: string;
305
+ type: string;
306
+ attachments?: {
307
+ url: string;
308
+ }[];
309
+ seen?: boolean;
310
+ createdAt: string;
311
+ }
312
+ interface Conversation {
313
+ _id: string;
314
+ name?: string;
315
+ type: "DIRECT" | "GROUP";
316
+ recipients: ConversationRecipient[];
317
+ messages: ConversationMessage[];
318
+ isPrivate?: boolean;
319
+ updatedAt: string;
320
+ createdAt: string;
321
+ }
322
+ interface FetchedConversation {
323
+ _id: string;
324
+ chats: {
325
+ messages: ConversationMessage[];
326
+ totalMessagesCount: number;
327
+ };
328
+ recipients: ConversationRecipient[];
329
+ createdAt: string;
330
+ updatedAt: string;
331
+ }
332
+ interface UserStatusEvent {
333
+ _id: string;
334
+ firstName: string;
335
+ lastName: string;
336
+ status: "ONLINE" | "AWAY" | "OFFLINE";
337
+ }
338
+ interface JobInviteNotification {
339
+ jobId: string;
340
+ jobTitle: string;
341
+ senderId: string;
342
+ inviteId: string;
343
+ }
344
+ interface WsEnvelope<T> {
345
+ error: boolean;
346
+ statusCode: number;
347
+ message: string;
348
+ data: T;
349
+ }
350
+
351
+ declare class MessagingService {
352
+ private readonly messagingUrl;
353
+ private readonly token;
354
+ private socket;
355
+ constructor(messagingUrl: string, token: string);
356
+ connect(): Promise<void>;
357
+ onBroadcast(handler: (msg: BroadcastMessage) => void): void;
358
+ onUserStatus(handler: (event: UserStatusEvent) => void): void;
359
+ onJobInvite(handler: (invite: JobInviteNotification) => void): void;
360
+ sendMessage(payload: SendMessagePayload): void;
361
+ setTyping(conversationId: string, typing: boolean): void;
362
+ loadConversations(): Promise<Conversation[]>;
363
+ createDirectConversation(recipientId: string): Promise<Conversation>;
364
+ createGroupConversation(recipientIds: string[], name?: string): Promise<Conversation>;
365
+ fetchConversation(conversationId: string): Promise<FetchedConversation>;
366
+ markSeen(conversationId: string): void;
367
+ disconnect(): void;
368
+ get connected(): boolean;
369
+ }
370
+
371
+ interface JobDeliverableDto {
372
+ name: string;
373
+ description?: string;
374
+ }
375
+ interface CreateJobDto {
376
+ title: string;
377
+ description?: string;
378
+ amount?: string;
379
+ currency?: string;
380
+ tags?: string[];
381
+ chainId?: string;
382
+ asset?: string;
383
+ isPrivate?: boolean;
384
+ deliverables?: JobDeliverableDto[];
385
+ }
386
+ type ConfirmTxStep = "onCreate" | "onAccept";
387
+ interface ConfirmTxDto {
388
+ step: ConfirmTxStep;
389
+ txHash: string;
390
+ }
391
+ interface InviteTalentDto {
392
+ inviteeId: string;
393
+ }
394
+ interface PrepareUpdateDto {
395
+ address: string;
396
+ chainId?: string;
397
+ }
398
+ interface ListJobsQuery {
399
+ creator?: string;
400
+ buyer?: string;
401
+ seller?: string;
402
+ chainId?: string;
403
+ page?: number;
404
+ limit?: number;
405
+ }
406
+ interface GetStatsQuery {
407
+ creator?: string;
408
+ startDate?: string;
409
+ endDate?: string;
410
+ }
411
+ interface CreateDeliverablesDto {
412
+ deliverables: JobDeliverableDto[];
413
+ }
414
+ interface ToggleDeliverableProgressDto {
415
+ status: "completed" | "pending";
416
+ }
417
+ interface BulkResetDeliverablesDto {
418
+ deliverableIds: string[];
419
+ }
420
+ interface UpdateJobDto {
421
+ title?: string;
422
+ description?: string;
423
+ amount?: string;
424
+ deliveryDate?: string;
425
+ isPrivate?: boolean;
426
+ tags?: string[];
427
+ meta?: Record<string, any>;
428
+ }
429
+ interface ApplyJobDto {
430
+ coverLetter?: string;
431
+ bid?: number;
432
+ }
433
+ interface CancelJobDto {
434
+ reason: string;
435
+ explanation?: string;
436
+ }
437
+ interface ResolveCancelDto {
438
+ resolution?: string;
439
+ }
440
+ interface ReviewChangeDto {
441
+ reason: string;
442
+ description?: string;
443
+ changes?: Record<string, any>;
444
+ }
445
+ interface CompleteJobDto {
446
+ note?: string;
447
+ }
448
+ interface ReleaseJobPaymentDto {
449
+ }
450
+ interface JobReviewDto {
451
+ receiverId: string;
452
+ rating: number;
453
+ review: string;
454
+ }
455
+ interface PaginationQuery {
456
+ page?: number;
457
+ limit?: number;
458
+ }
459
+ type ListAllInvitesQuery = PaginationQuery;
460
+ type ListApplicationsQuery = PaginationQuery;
461
+ type ListJobInvitesQuery = PaginationQuery;
462
+ interface ApplicationResponse {
463
+ _id: string;
464
+ job: string;
465
+ applicant: any;
466
+ coverLetter: string;
467
+ bid: number;
468
+ status: "pending" | "accepted" | "rejected" | "closed";
469
+ createdAt: string;
470
+ updatedAt: string;
471
+ }
472
+ interface ApplicationListResponse {
473
+ total: number;
474
+ page: number;
475
+ limit: number;
476
+ pages: number;
477
+ data: ApplicationResponse[];
478
+ }
479
+ interface CancelRequestResponse {
480
+ _id: string;
481
+ job: string;
482
+ requestedBy: string;
483
+ reason: string;
484
+ explanation: string;
485
+ status: "pending" | "accepted" | "declined";
486
+ resolution?: string;
487
+ createdAt: string;
488
+ updatedAt: string;
489
+ }
490
+ interface ChangeRequestResponse {
491
+ _id: string;
492
+ job: string;
493
+ requestedBy: string;
494
+ reason: string;
495
+ description: string;
496
+ changes?: Record<string, any>;
497
+ status: "pending" | "accepted" | "declined";
498
+ createdAt: string;
499
+ updatedAt: string;
500
+ }
501
+ interface MakeDepositResponse {
502
+ jobId: string;
503
+ escrowAddress: string;
504
+ chainId: string;
505
+ coinAmount: string;
506
+ tokenDecimal: number;
507
+ coinSymbol: string;
508
+ asset: string;
509
+ onCreate: any | null;
510
+ deposit: any | null;
511
+ approve: any | null;
512
+ }
513
+ interface JobDeliverableResponse {
514
+ _id: string;
515
+ name: string;
516
+ description?: string;
517
+ progress: number;
518
+ meta?: {
519
+ completedAt?: string;
520
+ };
521
+ }
522
+ interface JobInviteResponse {
523
+ inviteeId: string;
524
+ status: "pending" | "accepted" | "declined";
525
+ createdAt: string;
526
+ }
527
+ interface JobResponse {
528
+ _id: string;
529
+ creator: string;
530
+ title: string;
531
+ description: string;
532
+ amount: string;
533
+ currency?: string;
534
+ tags?: string[];
535
+ chainId: string;
536
+ asset: string;
537
+ status: "open" | "filled" | "completed" | "cancelled";
538
+ isPrivate: boolean;
539
+ buyer: string;
540
+ seller?: string;
541
+ sellerId?: string;
542
+ escrowVersion: string;
543
+ escrowChainId: string;
544
+ escrowStatus: string;
545
+ escrowAddress?: string;
546
+ escrowOnCreateTxHash?: string;
547
+ escrowAcceptTxHash?: string;
548
+ invites?: JobInviteResponse[];
549
+ deliverables?: JobDeliverableResponse[];
550
+ createdAt: string;
551
+ updatedAt: string;
552
+ }
553
+ interface JobListResponse {
554
+ total: number;
555
+ page: number;
556
+ limit: number;
557
+ pages: number;
558
+ data: JobResponse[];
559
+ }
560
+ interface JobStatsSummary {
561
+ total: number;
562
+ open: number;
563
+ filled: number;
564
+ completed: number;
565
+ cancelled: number;
566
+ totalValue: number;
567
+ filledValue: number;
568
+ completedValue: number;
569
+ }
570
+ interface JobStatsResponse {
571
+ summary: JobStatsSummary;
572
+ byStatus: {
573
+ status: string;
574
+ count: number;
575
+ totalValue: number;
576
+ }[];
577
+ byChain: {
578
+ chainId: string;
579
+ count: number;
580
+ totalValue: number;
581
+ }[];
582
+ }
583
+ interface JobModuleType {
584
+ create(dto: CreateJobDto): Promise<ResponseDto<{
585
+ job: JobResponse;
586
+ escrowTx: any;
587
+ }>>;
588
+ list(query?: ListJobsQuery): Promise<ResponseDto<JobListResponse>>;
589
+ getStats(query?: GetStatsQuery): Promise<ResponseDto<JobStatsResponse>>;
590
+ getById(id: string): Promise<ResponseDto<{
591
+ job: JobResponse;
592
+ }>>;
593
+ delete(id: string): Promise<ResponseDto<{
594
+ message: string;
595
+ }>>;
596
+ confirmTx(id: string, dto: ConfirmTxDto): Promise<ResponseDto<JobResponse>>;
597
+ getInvites(id: string): Promise<ResponseDto<JobInviteResponse[]>>;
598
+ inviteTalent(id: string, dto: InviteTalentDto): Promise<ResponseDto<JobResponse>>;
599
+ acceptInvite(id: string, inviteId: string): Promise<ResponseDto<{
600
+ job: JobResponse;
601
+ acceptPayload: any;
602
+ }>>;
603
+ declineInvite(id: string, inviteId: string): Promise<ResponseDto<{
604
+ job: JobResponse;
605
+ }>>;
606
+ cancelInvite(id: string, inviteeId: string): Promise<ResponseDto<{
607
+ job: JobResponse;
608
+ }>>;
609
+ getEscrowStatus(id: string): Promise<ResponseDto<{
610
+ job: JobResponse;
611
+ onChain: any;
612
+ }>>;
613
+ prepareUpdate(id: string, dto: PrepareUpdateDto): Promise<ResponseDto<{
614
+ job: JobResponse;
615
+ txPayload: any;
616
+ }>>;
617
+ createDeliverables(id: string, dto: CreateDeliverablesDto): Promise<ResponseDto<{
618
+ deliverables: JobDeliverableResponse[];
619
+ }>>;
620
+ replaceDeliverables(id: string, dto: CreateDeliverablesDto): Promise<ResponseDto<{
621
+ deliverables: JobDeliverableResponse[];
622
+ }>>;
623
+ toggleDeliverableProgress(id: string, deliverableId: string, dto: ToggleDeliverableProgressDto): Promise<ResponseDto<{
624
+ deliverable: JobDeliverableResponse;
625
+ }>>;
626
+ bulkResetDeliverables(id: string, dto: BulkResetDeliverablesDto): Promise<ResponseDto<{
627
+ deliverables: JobDeliverableResponse[];
628
+ }>>;
629
+ update(id: string, dto: UpdateJobDto): Promise<ResponseDto<{
630
+ job: JobResponse;
631
+ }>>;
632
+ listAllInvites(query?: ListAllInvitesQuery): Promise<ResponseDto<JobInviteResponse[]>>;
633
+ makeDeposit(id: string, talentId?: string): Promise<ResponseDto<MakeDepositResponse>>;
634
+ validatePayment(id: string): Promise<ResponseDto<{
635
+ job: JobResponse;
636
+ onChain: any;
637
+ }>>;
638
+ apply(id: string, dto: ApplyJobDto): Promise<ResponseDto<{
639
+ application: ApplicationResponse;
640
+ }>>;
641
+ withdrawApplication(id: string): Promise<ResponseDto<{
642
+ message: string;
643
+ }>>;
644
+ listApplications(id: string, query?: ListApplicationsQuery): Promise<ResponseDto<ApplicationListResponse>>;
645
+ acceptApplication(id: string, appId: string): Promise<ResponseDto<{
646
+ application: ApplicationResponse;
647
+ job: JobResponse;
648
+ }>>;
649
+ rejectApplication(id: string, appId: string): Promise<ResponseDto<{
650
+ application: ApplicationResponse;
651
+ }>>;
652
+ requestCancel(id: string, dto: CancelJobDto): Promise<ResponseDto<{
653
+ cancelRequest: CancelRequestResponse;
654
+ }>>;
655
+ acceptCancel(id: string, dto?: ResolveCancelDto): Promise<ResponseDto<{
656
+ cancelRequest: CancelRequestResponse;
657
+ job: JobResponse;
658
+ }>>;
659
+ declineCancel(id: string, dto?: ResolveCancelDto): Promise<ResponseDto<{
660
+ cancelRequest: CancelRequestResponse;
661
+ job: JobResponse;
662
+ }>>;
663
+ getCancelRequest(id: string): Promise<ResponseDto<{
664
+ cancelRequest: CancelRequestResponse | null;
665
+ }>>;
666
+ requestReviewChange(id: string, dto: ReviewChangeDto): Promise<ResponseDto<{
667
+ changeRequest: ChangeRequestResponse;
668
+ }>>;
669
+ acceptReviewChange(id: string): Promise<ResponseDto<{
670
+ changeRequest: ChangeRequestResponse;
671
+ }>>;
672
+ declineReviewChange(id: string): Promise<ResponseDto<{
673
+ changeRequest: ChangeRequestResponse;
674
+ }>>;
675
+ getReviewChange(id: string): Promise<ResponseDto<{
676
+ changeRequest: ChangeRequestResponse | null;
677
+ }>>;
678
+ completeJob(id: string, dto?: CompleteJobDto): Promise<ResponseDto<{
679
+ job: JobResponse;
680
+ markReadyTxHash: string | null;
681
+ }>>;
682
+ releasePayment(id: string, dto?: ReleaseJobPaymentDto): Promise<ResponseDto<{
683
+ escrowReleaseTxHash: string | null;
684
+ }>>;
685
+ submitReview(id: string, dto: JobReviewDto): Promise<ResponseDto<any>>;
686
+ }
687
+
688
+ declare class JobService implements JobModuleType {
689
+ private id;
690
+ private connector;
691
+ constructor(id: string);
692
+ create(dto: CreateJobDto): Promise<ResponseDto<{
693
+ job: JobResponse;
694
+ escrowTx: any;
695
+ }>>;
696
+ list(query?: ListJobsQuery): Promise<ResponseDto<JobListResponse>>;
697
+ getStats(query?: GetStatsQuery): Promise<ResponseDto<JobStatsResponse>>;
698
+ getById(id: string): Promise<ResponseDto<{
699
+ job: JobResponse;
700
+ }>>;
701
+ delete(id: string): Promise<ResponseDto<{
702
+ message: string;
703
+ }>>;
704
+ confirmTx(id: string, dto: ConfirmTxDto): Promise<ResponseDto<JobResponse>>;
705
+ getInvites(id: string): Promise<ResponseDto<JobInviteResponse[]>>;
706
+ inviteTalent(id: string, dto: InviteTalentDto): Promise<ResponseDto<JobResponse>>;
707
+ acceptInvite(id: string, inviteId: string): Promise<ResponseDto<{
708
+ job: JobResponse;
709
+ acceptPayload: any;
710
+ }>>;
711
+ declineInvite(id: string, inviteId: string): Promise<ResponseDto<{
712
+ job: JobResponse;
713
+ }>>;
714
+ cancelInvite(id: string, inviteeId: string): Promise<ResponseDto<{
715
+ job: JobResponse;
716
+ }>>;
717
+ getEscrowStatus(id: string): Promise<ResponseDto<{
718
+ job: JobResponse;
719
+ onChain: any;
720
+ }>>;
721
+ prepareUpdate(id: string, dto: PrepareUpdateDto): Promise<ResponseDto<{
722
+ job: JobResponse;
723
+ txPayload: any;
724
+ }>>;
725
+ createDeliverables(id: string, dto: CreateDeliverablesDto): Promise<ResponseDto<{
726
+ deliverables: JobDeliverableResponse[];
727
+ }>>;
728
+ replaceDeliverables(id: string, dto: CreateDeliverablesDto): Promise<ResponseDto<{
729
+ deliverables: JobDeliverableResponse[];
730
+ }>>;
731
+ toggleDeliverableProgress(id: string, deliverableId: string, dto: ToggleDeliverableProgressDto): Promise<ResponseDto<{
732
+ deliverable: JobDeliverableResponse;
733
+ }>>;
734
+ bulkResetDeliverables(id: string, dto: BulkResetDeliverablesDto): Promise<ResponseDto<{
735
+ deliverables: JobDeliverableResponse[];
736
+ }>>;
737
+ update(id: string, dto: UpdateJobDto): Promise<ResponseDto<{
738
+ job: JobResponse;
739
+ }>>;
740
+ listAllInvites(query?: ListAllInvitesQuery): Promise<ResponseDto<JobInviteResponse[]>>;
741
+ makeDeposit(id: string, talentId?: string): Promise<ResponseDto<MakeDepositResponse>>;
742
+ validatePayment(id: string): Promise<ResponseDto<{
743
+ job: JobResponse;
744
+ onChain: any;
745
+ }>>;
746
+ apply(id: string, dto: ApplyJobDto): Promise<ResponseDto<{
747
+ application: ApplicationResponse;
748
+ }>>;
749
+ withdrawApplication(id: string): Promise<ResponseDto<{
750
+ message: string;
751
+ }>>;
752
+ listApplications(id: string, query?: ListApplicationsQuery): Promise<ResponseDto<ApplicationListResponse>>;
753
+ acceptApplication(id: string, appId: string): Promise<ResponseDto<{
754
+ application: ApplicationResponse;
755
+ job: JobResponse;
756
+ }>>;
757
+ rejectApplication(id: string, appId: string): Promise<ResponseDto<{
758
+ application: ApplicationResponse;
759
+ }>>;
760
+ requestCancel(id: string, dto: CancelJobDto): Promise<ResponseDto<{
761
+ cancelRequest: CancelRequestResponse;
762
+ }>>;
763
+ acceptCancel(id: string, dto?: ResolveCancelDto): Promise<ResponseDto<{
764
+ cancelRequest: CancelRequestResponse;
765
+ job: JobResponse;
766
+ }>>;
767
+ declineCancel(id: string, dto?: ResolveCancelDto): Promise<ResponseDto<{
768
+ cancelRequest: CancelRequestResponse;
769
+ job: JobResponse;
770
+ }>>;
771
+ getCancelRequest(id: string): Promise<ResponseDto<{
772
+ cancelRequest: CancelRequestResponse | null;
773
+ }>>;
774
+ requestReviewChange(id: string, dto: ReviewChangeDto): Promise<ResponseDto<{
775
+ changeRequest: ChangeRequestResponse;
776
+ }>>;
777
+ acceptReviewChange(id: string): Promise<ResponseDto<{
778
+ changeRequest: ChangeRequestResponse;
779
+ }>>;
780
+ declineReviewChange(id: string): Promise<ResponseDto<{
781
+ changeRequest: ChangeRequestResponse;
782
+ }>>;
783
+ getReviewChange(id: string): Promise<ResponseDto<{
784
+ changeRequest: ChangeRequestResponse | null;
785
+ }>>;
786
+ completeJob(id: string, dto?: CompleteJobDto): Promise<ResponseDto<{
787
+ job: JobResponse;
788
+ markReadyTxHash: string | null;
789
+ }>>;
790
+ releasePayment(id: string, dto?: ReleaseJobPaymentDto): Promise<ResponseDto<{
791
+ escrowReleaseTxHash: string | null;
792
+ }>>;
793
+ submitReview(id: string, dto: JobReviewDto): Promise<ResponseDto<any>>;
794
+ }
795
+
796
+ interface PsiloSDKConfig {
797
+ development?: boolean;
798
+ verbose?: boolean;
799
+ baseUrl?: string;
800
+ messagingUrl?: string;
801
+ token?: string;
802
+ }
803
+ declare class PsiloSDK {
804
+ readonly auth: AuthService;
805
+ readonly escrow: EscrowService;
806
+ readonly connector: Connector;
807
+ readonly messaging: MessagingService;
808
+ readonly job: JobService;
809
+ constructor(id: string);
810
+ static init(config?: PsiloSDKConfig): Promise<PsiloSDK>;
811
+ setAuthorizationHeader(token: string): void;
812
+ private static generateRandomString;
813
+ }
814
+
815
+ declare class SDKError extends Error {
816
+ readonly code?: string;
817
+ readonly details?: any;
818
+ constructor(message: string, code?: string, details?: any);
819
+ }
820
+
821
+ export { ApplicationListResponse, ApplicationResponse, ApplyJobDto, AuthModuleType, AuthService, BroadcastMessage, BulkResetDeliverablesDto, CancelJobDto, CancelRequestResponse, ChangeRequestResponse, CompleteJobDto, ConfirmTxDto, ConfirmTxStep, Connector, Conversation, ConversationMessage, ConversationRecipient, CreateDeliverablesDto, CreateEscrowDto, CreateEscrowResponse, CreateJobDto, DepositDto, DepositResponse, ErrorUtils, EscrowAssetDto, EscrowChainDto, EscrowModuleType, EscrowNativeCurrencyDto, EscrowService, EscrowStatusResponse, EscrowWebhookConfigDto, FetchedConversation, GetEscrowAssetsResponseDto, GetEscrowChainsResponseDto, GetStatsQuery, IAny, InviteTalentDto, JobDeliverableDto, JobDeliverableResponse, JobInviteNotification, JobInviteResponse, JobListResponse, JobModuleType, JobResponse, JobReviewDto, JobService, JobStatsResponse, JobStatsSummary, ListAllInvitesQuery, ListApplicationsQuery, ListJobInvitesQuery, ListJobsQuery, MakeDepositResponse, MessageType, MessagingService, NonceDto, NonceResponse, PaginationQuery, PaktWeb3OnboardResponse, PaktWeb3RequestResponse, PaktWeb3ValidateResponse, PrepareTransactionResponse, PrepareUpdateDto, PsiloSDK, PsiloSDKConfig, RegisterDto, RegisterResponse, ReleaseDto, ReleaseJobPaymentDto, ReleaseResponse, ResolveCancelDto, ResponseDto, ReviewChangeDto, SDKError, SendMessagePayload, SignReleaseDto, SignReleaseResponse, StandardResponse, Status, ToggleDeliverableProgressDto, UpdateEscrowStatusDto, UpdateJobDto, UserStatusEvent, VerifyDto, VerifyResponse, WsEnvelope, parseUrlWithQuery };