@tasknet-protocol/shared 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +266 -0
- package/dist/index.d.ts +266 -0
- package/dist/index.js +158 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +117 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +33 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
declare const STATUS: {
|
|
2
|
+
readonly POSTED: 0;
|
|
3
|
+
readonly RESERVED: 1;
|
|
4
|
+
readonly ACCEPTED: 2;
|
|
5
|
+
readonly IN_PROGRESS: 3;
|
|
6
|
+
readonly SUBMITTED: 4;
|
|
7
|
+
readonly VERIFIED: 5;
|
|
8
|
+
readonly SETTLED: 6;
|
|
9
|
+
readonly CANCELLED: 7;
|
|
10
|
+
readonly EXPIRED: 8;
|
|
11
|
+
readonly FAILED: 9;
|
|
12
|
+
};
|
|
13
|
+
type TaskStatus = (typeof STATUS)[keyof typeof STATUS];
|
|
14
|
+
declare const STATUS_LABELS: Record<TaskStatus, string>;
|
|
15
|
+
declare const VERIFICATION: {
|
|
16
|
+
readonly DETERMINISTIC: 0;
|
|
17
|
+
readonly REQUESTER_CONFIRM: 1;
|
|
18
|
+
readonly TIME_BOUND: 2;
|
|
19
|
+
};
|
|
20
|
+
type VerificationType = (typeof VERIFICATION)[keyof typeof VERIFICATION];
|
|
21
|
+
declare const VERIFICATION_LABELS: Record<VerificationType, string>;
|
|
22
|
+
declare const CLAIM: {
|
|
23
|
+
readonly PENDING: 0;
|
|
24
|
+
readonly X_VERIFIED: 1;
|
|
25
|
+
readonly MOLTBOOK_VERIFIED: 2;
|
|
26
|
+
readonly GITHUB_VERIFIED: 3;
|
|
27
|
+
readonly WALLET_SIGNED: 4;
|
|
28
|
+
};
|
|
29
|
+
type ClaimType = (typeof CLAIM)[keyof typeof CLAIM];
|
|
30
|
+
declare const CLAIM_LABELS: Record<ClaimType, string>;
|
|
31
|
+
declare const PRIORITY: {
|
|
32
|
+
readonly STANDARD: 0;
|
|
33
|
+
readonly PRIORITY: 1;
|
|
34
|
+
readonly URGENT: 2;
|
|
35
|
+
};
|
|
36
|
+
type PriorityTier = (typeof PRIORITY)[keyof typeof PRIORITY];
|
|
37
|
+
declare const PRIORITY_LABELS: Record<PriorityTier, string>;
|
|
38
|
+
declare const PROTOCOL: {
|
|
39
|
+
readonly FEE_BPS: 200;
|
|
40
|
+
readonly MIN_FEE_BPS: 50;
|
|
41
|
+
readonly MAX_FEE_BPS: 500;
|
|
42
|
+
readonly BPS_DENOMINATOR: 10000;
|
|
43
|
+
readonly RESERVATION_DURATION_MS: 60000;
|
|
44
|
+
readonly FEE_CHANGE_TIMELOCK_MS: 604800000;
|
|
45
|
+
};
|
|
46
|
+
declare const MULTIPLIERS: {
|
|
47
|
+
readonly STANDARD: 10000;
|
|
48
|
+
readonly PRIORITY: 15000;
|
|
49
|
+
readonly URGENT: 25000;
|
|
50
|
+
};
|
|
51
|
+
declare const BADGE_TIER: {
|
|
52
|
+
readonly BRONZE: 0;
|
|
53
|
+
readonly SILVER: 1;
|
|
54
|
+
readonly GOLD: 2;
|
|
55
|
+
};
|
|
56
|
+
type BadgeTier = (typeof BADGE_TIER)[keyof typeof BADGE_TIER];
|
|
57
|
+
declare const USDC_DECIMALS = 6;
|
|
58
|
+
declare const API_VERSION = "0.2.0";
|
|
59
|
+
declare const NETWORKS: {
|
|
60
|
+
readonly MAINNET: "mainnet";
|
|
61
|
+
readonly TESTNET: "testnet";
|
|
62
|
+
readonly DEVNET: "devnet";
|
|
63
|
+
readonly LOCALNET: "localnet";
|
|
64
|
+
};
|
|
65
|
+
type Network = (typeof NETWORKS)[keyof typeof NETWORKS];
|
|
66
|
+
declare const FULLNODE_URLS: Record<Network, string>;
|
|
67
|
+
|
|
68
|
+
interface Agent {
|
|
69
|
+
id: string;
|
|
70
|
+
owner: string;
|
|
71
|
+
metadataUri?: string;
|
|
72
|
+
createdAt: bigint;
|
|
73
|
+
}
|
|
74
|
+
interface AgentStats {
|
|
75
|
+
agentId: string;
|
|
76
|
+
workerTasksCompleted: number;
|
|
77
|
+
workerTasksFailed: number;
|
|
78
|
+
workerTasksExpired: number;
|
|
79
|
+
workerTotalEarnedUsdc: bigint;
|
|
80
|
+
workerAvgCompletionSecs?: number;
|
|
81
|
+
requesterTasksPosted: number;
|
|
82
|
+
requesterTasksSettled: number;
|
|
83
|
+
requesterTasksCancelled: number;
|
|
84
|
+
requesterTasksRejected: number;
|
|
85
|
+
requesterTotalSpentUsdc: bigint;
|
|
86
|
+
completionRate?: number;
|
|
87
|
+
onTimeRate?: number;
|
|
88
|
+
rejectionRate?: number;
|
|
89
|
+
repeatEngagementRate?: number;
|
|
90
|
+
uniqueCounterparties: number;
|
|
91
|
+
flaggedForAbuse: boolean;
|
|
92
|
+
}
|
|
93
|
+
interface Skill {
|
|
94
|
+
id: string;
|
|
95
|
+
agentId: string;
|
|
96
|
+
name: string;
|
|
97
|
+
version: string;
|
|
98
|
+
inputSchemaHash?: string;
|
|
99
|
+
outputSchemaHash?: string;
|
|
100
|
+
verificationType: VerificationType;
|
|
101
|
+
basePriceUsdc: bigint;
|
|
102
|
+
workerBondUsdc: bigint;
|
|
103
|
+
timeoutSeconds: number;
|
|
104
|
+
priorityMultipliers: [number, number, number];
|
|
105
|
+
metadataUri?: string;
|
|
106
|
+
publishedAt: bigint;
|
|
107
|
+
deprecated: boolean;
|
|
108
|
+
}
|
|
109
|
+
interface SkillMetadata {
|
|
110
|
+
name: string;
|
|
111
|
+
description: string;
|
|
112
|
+
inputSchema?: object;
|
|
113
|
+
outputSchema?: object;
|
|
114
|
+
tags?: string[];
|
|
115
|
+
examples?: {
|
|
116
|
+
input: object;
|
|
117
|
+
output: object;
|
|
118
|
+
}[];
|
|
119
|
+
}
|
|
120
|
+
interface Task {
|
|
121
|
+
id: string;
|
|
122
|
+
requesterAgent: string;
|
|
123
|
+
workerAgent?: string;
|
|
124
|
+
skillId: string;
|
|
125
|
+
skillVersion: string;
|
|
126
|
+
inputPayloadRef: string;
|
|
127
|
+
expectedOutputHash?: string;
|
|
128
|
+
outputRef?: string;
|
|
129
|
+
outputHash?: string;
|
|
130
|
+
paymentAmountUsdc: bigint;
|
|
131
|
+
workerBondAmount: bigint;
|
|
132
|
+
priorityTier: PriorityTier;
|
|
133
|
+
verificationType: VerificationType;
|
|
134
|
+
status: TaskStatus;
|
|
135
|
+
createdAt: bigint;
|
|
136
|
+
reservedAt?: bigint;
|
|
137
|
+
reservedBy?: string;
|
|
138
|
+
acceptedAt?: bigint;
|
|
139
|
+
submittedAt?: bigint;
|
|
140
|
+
verifiedAt?: bigint;
|
|
141
|
+
settledAt?: bigint;
|
|
142
|
+
expiresAt: bigint;
|
|
143
|
+
}
|
|
144
|
+
interface TaskInput {
|
|
145
|
+
skillId: string;
|
|
146
|
+
payload: object;
|
|
147
|
+
expectedOutputHash?: string;
|
|
148
|
+
priorityTier?: PriorityTier;
|
|
149
|
+
timeoutSeconds?: number;
|
|
150
|
+
}
|
|
151
|
+
interface TaskOutput {
|
|
152
|
+
taskId: string;
|
|
153
|
+
payload: object;
|
|
154
|
+
outputHash?: string;
|
|
155
|
+
}
|
|
156
|
+
interface Claim {
|
|
157
|
+
id: string;
|
|
158
|
+
agentId: string;
|
|
159
|
+
verificationCode: string;
|
|
160
|
+
claimedBy?: string;
|
|
161
|
+
claimType: ClaimType;
|
|
162
|
+
createdAt: bigint;
|
|
163
|
+
verifiedAt?: bigint;
|
|
164
|
+
status: number;
|
|
165
|
+
}
|
|
166
|
+
interface Badge {
|
|
167
|
+
id: string;
|
|
168
|
+
agentId: string;
|
|
169
|
+
badgeType: string;
|
|
170
|
+
tier: BadgeTier;
|
|
171
|
+
earnedAt: bigint;
|
|
172
|
+
metadata?: object;
|
|
173
|
+
}
|
|
174
|
+
interface SkillCertification {
|
|
175
|
+
id: string;
|
|
176
|
+
skillId: string;
|
|
177
|
+
skillVersion: string;
|
|
178
|
+
certifierAgent: string;
|
|
179
|
+
certificationType: string;
|
|
180
|
+
testResultsRef?: string;
|
|
181
|
+
certifiedAt: bigint;
|
|
182
|
+
expiresAt?: bigint;
|
|
183
|
+
revoked: boolean;
|
|
184
|
+
revokedAt?: bigint;
|
|
185
|
+
}
|
|
186
|
+
interface TaskTemplate {
|
|
187
|
+
id: string;
|
|
188
|
+
creatorAgent: string;
|
|
189
|
+
name: string;
|
|
190
|
+
skillId: string;
|
|
191
|
+
skillVersion: string;
|
|
192
|
+
defaultPaymentUsdc: bigint;
|
|
193
|
+
defaultTimeoutSeconds: number;
|
|
194
|
+
defaultPriorityTier: PriorityTier;
|
|
195
|
+
inputSchema?: object;
|
|
196
|
+
metadataUri?: string;
|
|
197
|
+
isPublic: boolean;
|
|
198
|
+
deprecated: boolean;
|
|
199
|
+
createdAt: bigint;
|
|
200
|
+
usageCount: number;
|
|
201
|
+
}
|
|
202
|
+
interface CompositeStep {
|
|
203
|
+
skillId: string;
|
|
204
|
+
skillVersion: string;
|
|
205
|
+
inputSchemaHash: string;
|
|
206
|
+
outputSchemaHash: string;
|
|
207
|
+
paymentAmount: bigint;
|
|
208
|
+
workerBondRequired: bigint;
|
|
209
|
+
priorityTier: PriorityTier;
|
|
210
|
+
timeoutSeconds: number;
|
|
211
|
+
metadataUri: string;
|
|
212
|
+
completed: boolean;
|
|
213
|
+
taskId?: string;
|
|
214
|
+
}
|
|
215
|
+
interface Composite {
|
|
216
|
+
id: string;
|
|
217
|
+
requesterAgent: string;
|
|
218
|
+
name: string;
|
|
219
|
+
description: string;
|
|
220
|
+
steps: CompositeStep[];
|
|
221
|
+
currentStep: number;
|
|
222
|
+
createdAt: bigint;
|
|
223
|
+
completedAt?: bigint;
|
|
224
|
+
cancelledAt?: bigint;
|
|
225
|
+
status: number;
|
|
226
|
+
}
|
|
227
|
+
interface PaginatedResponse<T> {
|
|
228
|
+
data: T[];
|
|
229
|
+
pagination: {
|
|
230
|
+
page: number;
|
|
231
|
+
limit: number;
|
|
232
|
+
total: number;
|
|
233
|
+
pages: number;
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
interface ApiError {
|
|
237
|
+
error: string;
|
|
238
|
+
code?: string;
|
|
239
|
+
details?: object;
|
|
240
|
+
}
|
|
241
|
+
interface TaskEvent {
|
|
242
|
+
id: number;
|
|
243
|
+
taskId: string;
|
|
244
|
+
eventType: string;
|
|
245
|
+
eventData: object;
|
|
246
|
+
txDigest: string;
|
|
247
|
+
timestampMs: bigint;
|
|
248
|
+
}
|
|
249
|
+
interface Webhook {
|
|
250
|
+
id: string;
|
|
251
|
+
agentId: string;
|
|
252
|
+
url: string;
|
|
253
|
+
events: string[];
|
|
254
|
+
filters: object;
|
|
255
|
+
secret: string;
|
|
256
|
+
active: boolean;
|
|
257
|
+
createdAt: Date;
|
|
258
|
+
}
|
|
259
|
+
interface WebhookPayload {
|
|
260
|
+
event: string;
|
|
261
|
+
timestamp: number;
|
|
262
|
+
data: object;
|
|
263
|
+
signature: string;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export { API_VERSION, type Agent, type AgentStats, type ApiError, BADGE_TIER, type Badge, type BadgeTier, CLAIM, CLAIM_LABELS, type Claim, type ClaimType, type Composite, type CompositeStep, FULLNODE_URLS, MULTIPLIERS, NETWORKS, type Network, PRIORITY, PRIORITY_LABELS, PROTOCOL, type PaginatedResponse, type PriorityTier, STATUS, STATUS_LABELS, type Skill, type SkillCertification, type SkillMetadata, type Task, type TaskEvent, type TaskInput, type TaskOutput, type TaskStatus, type TaskTemplate, USDC_DECIMALS, VERIFICATION, VERIFICATION_LABELS, type VerificationType, type Webhook, type WebhookPayload };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
declare const STATUS: {
|
|
2
|
+
readonly POSTED: 0;
|
|
3
|
+
readonly RESERVED: 1;
|
|
4
|
+
readonly ACCEPTED: 2;
|
|
5
|
+
readonly IN_PROGRESS: 3;
|
|
6
|
+
readonly SUBMITTED: 4;
|
|
7
|
+
readonly VERIFIED: 5;
|
|
8
|
+
readonly SETTLED: 6;
|
|
9
|
+
readonly CANCELLED: 7;
|
|
10
|
+
readonly EXPIRED: 8;
|
|
11
|
+
readonly FAILED: 9;
|
|
12
|
+
};
|
|
13
|
+
type TaskStatus = (typeof STATUS)[keyof typeof STATUS];
|
|
14
|
+
declare const STATUS_LABELS: Record<TaskStatus, string>;
|
|
15
|
+
declare const VERIFICATION: {
|
|
16
|
+
readonly DETERMINISTIC: 0;
|
|
17
|
+
readonly REQUESTER_CONFIRM: 1;
|
|
18
|
+
readonly TIME_BOUND: 2;
|
|
19
|
+
};
|
|
20
|
+
type VerificationType = (typeof VERIFICATION)[keyof typeof VERIFICATION];
|
|
21
|
+
declare const VERIFICATION_LABELS: Record<VerificationType, string>;
|
|
22
|
+
declare const CLAIM: {
|
|
23
|
+
readonly PENDING: 0;
|
|
24
|
+
readonly X_VERIFIED: 1;
|
|
25
|
+
readonly MOLTBOOK_VERIFIED: 2;
|
|
26
|
+
readonly GITHUB_VERIFIED: 3;
|
|
27
|
+
readonly WALLET_SIGNED: 4;
|
|
28
|
+
};
|
|
29
|
+
type ClaimType = (typeof CLAIM)[keyof typeof CLAIM];
|
|
30
|
+
declare const CLAIM_LABELS: Record<ClaimType, string>;
|
|
31
|
+
declare const PRIORITY: {
|
|
32
|
+
readonly STANDARD: 0;
|
|
33
|
+
readonly PRIORITY: 1;
|
|
34
|
+
readonly URGENT: 2;
|
|
35
|
+
};
|
|
36
|
+
type PriorityTier = (typeof PRIORITY)[keyof typeof PRIORITY];
|
|
37
|
+
declare const PRIORITY_LABELS: Record<PriorityTier, string>;
|
|
38
|
+
declare const PROTOCOL: {
|
|
39
|
+
readonly FEE_BPS: 200;
|
|
40
|
+
readonly MIN_FEE_BPS: 50;
|
|
41
|
+
readonly MAX_FEE_BPS: 500;
|
|
42
|
+
readonly BPS_DENOMINATOR: 10000;
|
|
43
|
+
readonly RESERVATION_DURATION_MS: 60000;
|
|
44
|
+
readonly FEE_CHANGE_TIMELOCK_MS: 604800000;
|
|
45
|
+
};
|
|
46
|
+
declare const MULTIPLIERS: {
|
|
47
|
+
readonly STANDARD: 10000;
|
|
48
|
+
readonly PRIORITY: 15000;
|
|
49
|
+
readonly URGENT: 25000;
|
|
50
|
+
};
|
|
51
|
+
declare const BADGE_TIER: {
|
|
52
|
+
readonly BRONZE: 0;
|
|
53
|
+
readonly SILVER: 1;
|
|
54
|
+
readonly GOLD: 2;
|
|
55
|
+
};
|
|
56
|
+
type BadgeTier = (typeof BADGE_TIER)[keyof typeof BADGE_TIER];
|
|
57
|
+
declare const USDC_DECIMALS = 6;
|
|
58
|
+
declare const API_VERSION = "0.2.0";
|
|
59
|
+
declare const NETWORKS: {
|
|
60
|
+
readonly MAINNET: "mainnet";
|
|
61
|
+
readonly TESTNET: "testnet";
|
|
62
|
+
readonly DEVNET: "devnet";
|
|
63
|
+
readonly LOCALNET: "localnet";
|
|
64
|
+
};
|
|
65
|
+
type Network = (typeof NETWORKS)[keyof typeof NETWORKS];
|
|
66
|
+
declare const FULLNODE_URLS: Record<Network, string>;
|
|
67
|
+
|
|
68
|
+
interface Agent {
|
|
69
|
+
id: string;
|
|
70
|
+
owner: string;
|
|
71
|
+
metadataUri?: string;
|
|
72
|
+
createdAt: bigint;
|
|
73
|
+
}
|
|
74
|
+
interface AgentStats {
|
|
75
|
+
agentId: string;
|
|
76
|
+
workerTasksCompleted: number;
|
|
77
|
+
workerTasksFailed: number;
|
|
78
|
+
workerTasksExpired: number;
|
|
79
|
+
workerTotalEarnedUsdc: bigint;
|
|
80
|
+
workerAvgCompletionSecs?: number;
|
|
81
|
+
requesterTasksPosted: number;
|
|
82
|
+
requesterTasksSettled: number;
|
|
83
|
+
requesterTasksCancelled: number;
|
|
84
|
+
requesterTasksRejected: number;
|
|
85
|
+
requesterTotalSpentUsdc: bigint;
|
|
86
|
+
completionRate?: number;
|
|
87
|
+
onTimeRate?: number;
|
|
88
|
+
rejectionRate?: number;
|
|
89
|
+
repeatEngagementRate?: number;
|
|
90
|
+
uniqueCounterparties: number;
|
|
91
|
+
flaggedForAbuse: boolean;
|
|
92
|
+
}
|
|
93
|
+
interface Skill {
|
|
94
|
+
id: string;
|
|
95
|
+
agentId: string;
|
|
96
|
+
name: string;
|
|
97
|
+
version: string;
|
|
98
|
+
inputSchemaHash?: string;
|
|
99
|
+
outputSchemaHash?: string;
|
|
100
|
+
verificationType: VerificationType;
|
|
101
|
+
basePriceUsdc: bigint;
|
|
102
|
+
workerBondUsdc: bigint;
|
|
103
|
+
timeoutSeconds: number;
|
|
104
|
+
priorityMultipliers: [number, number, number];
|
|
105
|
+
metadataUri?: string;
|
|
106
|
+
publishedAt: bigint;
|
|
107
|
+
deprecated: boolean;
|
|
108
|
+
}
|
|
109
|
+
interface SkillMetadata {
|
|
110
|
+
name: string;
|
|
111
|
+
description: string;
|
|
112
|
+
inputSchema?: object;
|
|
113
|
+
outputSchema?: object;
|
|
114
|
+
tags?: string[];
|
|
115
|
+
examples?: {
|
|
116
|
+
input: object;
|
|
117
|
+
output: object;
|
|
118
|
+
}[];
|
|
119
|
+
}
|
|
120
|
+
interface Task {
|
|
121
|
+
id: string;
|
|
122
|
+
requesterAgent: string;
|
|
123
|
+
workerAgent?: string;
|
|
124
|
+
skillId: string;
|
|
125
|
+
skillVersion: string;
|
|
126
|
+
inputPayloadRef: string;
|
|
127
|
+
expectedOutputHash?: string;
|
|
128
|
+
outputRef?: string;
|
|
129
|
+
outputHash?: string;
|
|
130
|
+
paymentAmountUsdc: bigint;
|
|
131
|
+
workerBondAmount: bigint;
|
|
132
|
+
priorityTier: PriorityTier;
|
|
133
|
+
verificationType: VerificationType;
|
|
134
|
+
status: TaskStatus;
|
|
135
|
+
createdAt: bigint;
|
|
136
|
+
reservedAt?: bigint;
|
|
137
|
+
reservedBy?: string;
|
|
138
|
+
acceptedAt?: bigint;
|
|
139
|
+
submittedAt?: bigint;
|
|
140
|
+
verifiedAt?: bigint;
|
|
141
|
+
settledAt?: bigint;
|
|
142
|
+
expiresAt: bigint;
|
|
143
|
+
}
|
|
144
|
+
interface TaskInput {
|
|
145
|
+
skillId: string;
|
|
146
|
+
payload: object;
|
|
147
|
+
expectedOutputHash?: string;
|
|
148
|
+
priorityTier?: PriorityTier;
|
|
149
|
+
timeoutSeconds?: number;
|
|
150
|
+
}
|
|
151
|
+
interface TaskOutput {
|
|
152
|
+
taskId: string;
|
|
153
|
+
payload: object;
|
|
154
|
+
outputHash?: string;
|
|
155
|
+
}
|
|
156
|
+
interface Claim {
|
|
157
|
+
id: string;
|
|
158
|
+
agentId: string;
|
|
159
|
+
verificationCode: string;
|
|
160
|
+
claimedBy?: string;
|
|
161
|
+
claimType: ClaimType;
|
|
162
|
+
createdAt: bigint;
|
|
163
|
+
verifiedAt?: bigint;
|
|
164
|
+
status: number;
|
|
165
|
+
}
|
|
166
|
+
interface Badge {
|
|
167
|
+
id: string;
|
|
168
|
+
agentId: string;
|
|
169
|
+
badgeType: string;
|
|
170
|
+
tier: BadgeTier;
|
|
171
|
+
earnedAt: bigint;
|
|
172
|
+
metadata?: object;
|
|
173
|
+
}
|
|
174
|
+
interface SkillCertification {
|
|
175
|
+
id: string;
|
|
176
|
+
skillId: string;
|
|
177
|
+
skillVersion: string;
|
|
178
|
+
certifierAgent: string;
|
|
179
|
+
certificationType: string;
|
|
180
|
+
testResultsRef?: string;
|
|
181
|
+
certifiedAt: bigint;
|
|
182
|
+
expiresAt?: bigint;
|
|
183
|
+
revoked: boolean;
|
|
184
|
+
revokedAt?: bigint;
|
|
185
|
+
}
|
|
186
|
+
interface TaskTemplate {
|
|
187
|
+
id: string;
|
|
188
|
+
creatorAgent: string;
|
|
189
|
+
name: string;
|
|
190
|
+
skillId: string;
|
|
191
|
+
skillVersion: string;
|
|
192
|
+
defaultPaymentUsdc: bigint;
|
|
193
|
+
defaultTimeoutSeconds: number;
|
|
194
|
+
defaultPriorityTier: PriorityTier;
|
|
195
|
+
inputSchema?: object;
|
|
196
|
+
metadataUri?: string;
|
|
197
|
+
isPublic: boolean;
|
|
198
|
+
deprecated: boolean;
|
|
199
|
+
createdAt: bigint;
|
|
200
|
+
usageCount: number;
|
|
201
|
+
}
|
|
202
|
+
interface CompositeStep {
|
|
203
|
+
skillId: string;
|
|
204
|
+
skillVersion: string;
|
|
205
|
+
inputSchemaHash: string;
|
|
206
|
+
outputSchemaHash: string;
|
|
207
|
+
paymentAmount: bigint;
|
|
208
|
+
workerBondRequired: bigint;
|
|
209
|
+
priorityTier: PriorityTier;
|
|
210
|
+
timeoutSeconds: number;
|
|
211
|
+
metadataUri: string;
|
|
212
|
+
completed: boolean;
|
|
213
|
+
taskId?: string;
|
|
214
|
+
}
|
|
215
|
+
interface Composite {
|
|
216
|
+
id: string;
|
|
217
|
+
requesterAgent: string;
|
|
218
|
+
name: string;
|
|
219
|
+
description: string;
|
|
220
|
+
steps: CompositeStep[];
|
|
221
|
+
currentStep: number;
|
|
222
|
+
createdAt: bigint;
|
|
223
|
+
completedAt?: bigint;
|
|
224
|
+
cancelledAt?: bigint;
|
|
225
|
+
status: number;
|
|
226
|
+
}
|
|
227
|
+
interface PaginatedResponse<T> {
|
|
228
|
+
data: T[];
|
|
229
|
+
pagination: {
|
|
230
|
+
page: number;
|
|
231
|
+
limit: number;
|
|
232
|
+
total: number;
|
|
233
|
+
pages: number;
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
interface ApiError {
|
|
237
|
+
error: string;
|
|
238
|
+
code?: string;
|
|
239
|
+
details?: object;
|
|
240
|
+
}
|
|
241
|
+
interface TaskEvent {
|
|
242
|
+
id: number;
|
|
243
|
+
taskId: string;
|
|
244
|
+
eventType: string;
|
|
245
|
+
eventData: object;
|
|
246
|
+
txDigest: string;
|
|
247
|
+
timestampMs: bigint;
|
|
248
|
+
}
|
|
249
|
+
interface Webhook {
|
|
250
|
+
id: string;
|
|
251
|
+
agentId: string;
|
|
252
|
+
url: string;
|
|
253
|
+
events: string[];
|
|
254
|
+
filters: object;
|
|
255
|
+
secret: string;
|
|
256
|
+
active: boolean;
|
|
257
|
+
createdAt: Date;
|
|
258
|
+
}
|
|
259
|
+
interface WebhookPayload {
|
|
260
|
+
event: string;
|
|
261
|
+
timestamp: number;
|
|
262
|
+
data: object;
|
|
263
|
+
signature: string;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export { API_VERSION, type Agent, type AgentStats, type ApiError, BADGE_TIER, type Badge, type BadgeTier, CLAIM, CLAIM_LABELS, type Claim, type ClaimType, type Composite, type CompositeStep, FULLNODE_URLS, MULTIPLIERS, NETWORKS, type Network, PRIORITY, PRIORITY_LABELS, PROTOCOL, type PaginatedResponse, type PriorityTier, STATUS, STATUS_LABELS, type Skill, type SkillCertification, type SkillMetadata, type Task, type TaskEvent, type TaskInput, type TaskOutput, type TaskStatus, type TaskTemplate, USDC_DECIMALS, VERIFICATION, VERIFICATION_LABELS, type VerificationType, type Webhook, type WebhookPayload };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
API_VERSION: () => API_VERSION,
|
|
24
|
+
BADGE_TIER: () => BADGE_TIER,
|
|
25
|
+
CLAIM: () => CLAIM,
|
|
26
|
+
CLAIM_LABELS: () => CLAIM_LABELS,
|
|
27
|
+
FULLNODE_URLS: () => FULLNODE_URLS,
|
|
28
|
+
MULTIPLIERS: () => MULTIPLIERS,
|
|
29
|
+
NETWORKS: () => NETWORKS,
|
|
30
|
+
PRIORITY: () => PRIORITY,
|
|
31
|
+
PRIORITY_LABELS: () => PRIORITY_LABELS,
|
|
32
|
+
PROTOCOL: () => PROTOCOL,
|
|
33
|
+
STATUS: () => STATUS,
|
|
34
|
+
STATUS_LABELS: () => STATUS_LABELS,
|
|
35
|
+
USDC_DECIMALS: () => USDC_DECIMALS,
|
|
36
|
+
VERIFICATION: () => VERIFICATION,
|
|
37
|
+
VERIFICATION_LABELS: () => VERIFICATION_LABELS
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(index_exports);
|
|
40
|
+
|
|
41
|
+
// src/constants.ts
|
|
42
|
+
var STATUS = {
|
|
43
|
+
POSTED: 0,
|
|
44
|
+
RESERVED: 1,
|
|
45
|
+
ACCEPTED: 2,
|
|
46
|
+
IN_PROGRESS: 3,
|
|
47
|
+
SUBMITTED: 4,
|
|
48
|
+
VERIFIED: 5,
|
|
49
|
+
SETTLED: 6,
|
|
50
|
+
CANCELLED: 7,
|
|
51
|
+
EXPIRED: 8,
|
|
52
|
+
FAILED: 9
|
|
53
|
+
};
|
|
54
|
+
var STATUS_LABELS = {
|
|
55
|
+
[STATUS.POSTED]: "Posted",
|
|
56
|
+
[STATUS.RESERVED]: "Reserved",
|
|
57
|
+
[STATUS.ACCEPTED]: "Accepted",
|
|
58
|
+
[STATUS.IN_PROGRESS]: "InProgress",
|
|
59
|
+
[STATUS.SUBMITTED]: "Submitted",
|
|
60
|
+
[STATUS.VERIFIED]: "Verified",
|
|
61
|
+
[STATUS.SETTLED]: "Settled",
|
|
62
|
+
[STATUS.CANCELLED]: "Cancelled",
|
|
63
|
+
[STATUS.EXPIRED]: "Expired",
|
|
64
|
+
[STATUS.FAILED]: "Failed"
|
|
65
|
+
};
|
|
66
|
+
var VERIFICATION = {
|
|
67
|
+
DETERMINISTIC: 0,
|
|
68
|
+
REQUESTER_CONFIRM: 1,
|
|
69
|
+
TIME_BOUND: 2
|
|
70
|
+
};
|
|
71
|
+
var VERIFICATION_LABELS = {
|
|
72
|
+
[VERIFICATION.DETERMINISTIC]: "Deterministic",
|
|
73
|
+
[VERIFICATION.REQUESTER_CONFIRM]: "RequesterConfirm",
|
|
74
|
+
[VERIFICATION.TIME_BOUND]: "TimeBoundCompletion"
|
|
75
|
+
};
|
|
76
|
+
var CLAIM = {
|
|
77
|
+
PENDING: 0,
|
|
78
|
+
X_VERIFIED: 1,
|
|
79
|
+
MOLTBOOK_VERIFIED: 2,
|
|
80
|
+
GITHUB_VERIFIED: 3,
|
|
81
|
+
WALLET_SIGNED: 4
|
|
82
|
+
};
|
|
83
|
+
var CLAIM_LABELS = {
|
|
84
|
+
[CLAIM.PENDING]: "Pending",
|
|
85
|
+
[CLAIM.X_VERIFIED]: "X",
|
|
86
|
+
[CLAIM.MOLTBOOK_VERIFIED]: "Moltbook",
|
|
87
|
+
[CLAIM.GITHUB_VERIFIED]: "GitHub",
|
|
88
|
+
[CLAIM.WALLET_SIGNED]: "WalletSigned"
|
|
89
|
+
};
|
|
90
|
+
var PRIORITY = {
|
|
91
|
+
STANDARD: 0,
|
|
92
|
+
PRIORITY: 1,
|
|
93
|
+
URGENT: 2
|
|
94
|
+
};
|
|
95
|
+
var PRIORITY_LABELS = {
|
|
96
|
+
[PRIORITY.STANDARD]: "Standard",
|
|
97
|
+
[PRIORITY.PRIORITY]: "Priority",
|
|
98
|
+
[PRIORITY.URGENT]: "Urgent"
|
|
99
|
+
};
|
|
100
|
+
var PROTOCOL = {
|
|
101
|
+
FEE_BPS: 200,
|
|
102
|
+
// 2%
|
|
103
|
+
MIN_FEE_BPS: 50,
|
|
104
|
+
// 0.5%
|
|
105
|
+
MAX_FEE_BPS: 500,
|
|
106
|
+
// 5%
|
|
107
|
+
BPS_DENOMINATOR: 1e4,
|
|
108
|
+
RESERVATION_DURATION_MS: 6e4,
|
|
109
|
+
// 60 seconds
|
|
110
|
+
FEE_CHANGE_TIMELOCK_MS: 6048e5
|
|
111
|
+
// 7 days
|
|
112
|
+
};
|
|
113
|
+
var MULTIPLIERS = {
|
|
114
|
+
STANDARD: 1e4,
|
|
115
|
+
// 1.0x
|
|
116
|
+
PRIORITY: 15e3,
|
|
117
|
+
// 1.5x
|
|
118
|
+
URGENT: 25e3
|
|
119
|
+
// 2.5x
|
|
120
|
+
};
|
|
121
|
+
var BADGE_TIER = {
|
|
122
|
+
BRONZE: 0,
|
|
123
|
+
SILVER: 1,
|
|
124
|
+
GOLD: 2
|
|
125
|
+
};
|
|
126
|
+
var USDC_DECIMALS = 6;
|
|
127
|
+
var API_VERSION = "0.2.0";
|
|
128
|
+
var NETWORKS = {
|
|
129
|
+
MAINNET: "mainnet",
|
|
130
|
+
TESTNET: "testnet",
|
|
131
|
+
DEVNET: "devnet",
|
|
132
|
+
LOCALNET: "localnet"
|
|
133
|
+
};
|
|
134
|
+
var FULLNODE_URLS = {
|
|
135
|
+
mainnet: "https://fullnode.mainnet.sui.io:443",
|
|
136
|
+
testnet: "https://fullnode.testnet.sui.io:443",
|
|
137
|
+
devnet: "https://fullnode.devnet.sui.io:443",
|
|
138
|
+
localnet: "http://127.0.0.1:9000"
|
|
139
|
+
};
|
|
140
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
141
|
+
0 && (module.exports = {
|
|
142
|
+
API_VERSION,
|
|
143
|
+
BADGE_TIER,
|
|
144
|
+
CLAIM,
|
|
145
|
+
CLAIM_LABELS,
|
|
146
|
+
FULLNODE_URLS,
|
|
147
|
+
MULTIPLIERS,
|
|
148
|
+
NETWORKS,
|
|
149
|
+
PRIORITY,
|
|
150
|
+
PRIORITY_LABELS,
|
|
151
|
+
PROTOCOL,
|
|
152
|
+
STATUS,
|
|
153
|
+
STATUS_LABELS,
|
|
154
|
+
USDC_DECIMALS,
|
|
155
|
+
VERIFICATION,
|
|
156
|
+
VERIFICATION_LABELS
|
|
157
|
+
});
|
|
158
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/constants.ts"],"sourcesContent":["// Constants\nexport * from \"./constants\";\n\n// Types\nexport * from \"./types\";\n","// TaskNet Protocol Constants\n// These match the on-chain Move constants\n\n// === Status Codes ===\nexport const STATUS = {\n POSTED: 0,\n RESERVED: 1,\n ACCEPTED: 2,\n IN_PROGRESS: 3,\n SUBMITTED: 4,\n VERIFIED: 5,\n SETTLED: 6,\n CANCELLED: 7,\n EXPIRED: 8,\n FAILED: 9,\n} as const;\n\nexport type TaskStatus = (typeof STATUS)[keyof typeof STATUS];\n\nexport const STATUS_LABELS: Record<TaskStatus, string> = {\n [STATUS.POSTED]: \"Posted\",\n [STATUS.RESERVED]: \"Reserved\",\n [STATUS.ACCEPTED]: \"Accepted\",\n [STATUS.IN_PROGRESS]: \"InProgress\",\n [STATUS.SUBMITTED]: \"Submitted\",\n [STATUS.VERIFIED]: \"Verified\",\n [STATUS.SETTLED]: \"Settled\",\n [STATUS.CANCELLED]: \"Cancelled\",\n [STATUS.EXPIRED]: \"Expired\",\n [STATUS.FAILED]: \"Failed\",\n};\n\n// === Verification Types ===\nexport const VERIFICATION = {\n DETERMINISTIC: 0,\n REQUESTER_CONFIRM: 1,\n TIME_BOUND: 2,\n} as const;\n\nexport type VerificationType = (typeof VERIFICATION)[keyof typeof VERIFICATION];\n\nexport const VERIFICATION_LABELS: Record<VerificationType, string> = {\n [VERIFICATION.DETERMINISTIC]: \"Deterministic\",\n [VERIFICATION.REQUESTER_CONFIRM]: \"RequesterConfirm\",\n [VERIFICATION.TIME_BOUND]: \"TimeBoundCompletion\",\n};\n\n// === Claim Types ===\nexport const CLAIM = {\n PENDING: 0,\n X_VERIFIED: 1,\n MOLTBOOK_VERIFIED: 2,\n GITHUB_VERIFIED: 3,\n WALLET_SIGNED: 4,\n} as const;\n\nexport type ClaimType = (typeof CLAIM)[keyof typeof CLAIM];\n\nexport const CLAIM_LABELS: Record<ClaimType, string> = {\n [CLAIM.PENDING]: \"Pending\",\n [CLAIM.X_VERIFIED]: \"X\",\n [CLAIM.MOLTBOOK_VERIFIED]: \"Moltbook\",\n [CLAIM.GITHUB_VERIFIED]: \"GitHub\",\n [CLAIM.WALLET_SIGNED]: \"WalletSigned\",\n};\n\n// === Priority Tiers ===\nexport const PRIORITY = {\n STANDARD: 0,\n PRIORITY: 1,\n URGENT: 2,\n} as const;\n\nexport type PriorityTier = (typeof PRIORITY)[keyof typeof PRIORITY];\n\nexport const PRIORITY_LABELS: Record<PriorityTier, string> = {\n [PRIORITY.STANDARD]: \"Standard\",\n [PRIORITY.PRIORITY]: \"Priority\",\n [PRIORITY.URGENT]: \"Urgent\",\n};\n\n// === Protocol Constants ===\nexport const PROTOCOL = {\n FEE_BPS: 200, // 2%\n MIN_FEE_BPS: 50, // 0.5%\n MAX_FEE_BPS: 500, // 5%\n BPS_DENOMINATOR: 10_000,\n RESERVATION_DURATION_MS: 60_000, // 60 seconds\n FEE_CHANGE_TIMELOCK_MS: 604_800_000, // 7 days\n} as const;\n\n// === Priority Multipliers (default) ===\nexport const MULTIPLIERS = {\n STANDARD: 10_000, // 1.0x\n PRIORITY: 15_000, // 1.5x\n URGENT: 25_000, // 2.5x\n} as const;\n\n// === Badge Tiers ===\nexport const BADGE_TIER = {\n BRONZE: 0,\n SILVER: 1,\n GOLD: 2,\n} as const;\n\nexport type BadgeTier = (typeof BADGE_TIER)[keyof typeof BADGE_TIER];\n\n// === USDC ===\nexport const USDC_DECIMALS = 6;\n\n// === API ===\nexport const API_VERSION = \"0.2.0\";\n\n// === Networks ===\nexport const NETWORKS = {\n MAINNET: \"mainnet\",\n TESTNET: \"testnet\",\n DEVNET: \"devnet\",\n LOCALNET: \"localnet\",\n} as const;\n\nexport type Network = (typeof NETWORKS)[keyof typeof NETWORKS];\n\nexport const FULLNODE_URLS: Record<Network, string> = {\n mainnet: \"https://fullnode.mainnet.sui.io:443\",\n testnet: \"https://fullnode.testnet.sui.io:443\",\n devnet: \"https://fullnode.devnet.sui.io:443\",\n localnet: \"http://127.0.0.1:9000\",\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,SAAS;AAAA,EACpB,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,aAAa;AAAA,EACb,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AACV;AAIO,IAAM,gBAA4C;AAAA,EACvD,CAAC,OAAO,MAAM,GAAG;AAAA,EACjB,CAAC,OAAO,QAAQ,GAAG;AAAA,EACnB,CAAC,OAAO,QAAQ,GAAG;AAAA,EACnB,CAAC,OAAO,WAAW,GAAG;AAAA,EACtB,CAAC,OAAO,SAAS,GAAG;AAAA,EACpB,CAAC,OAAO,QAAQ,GAAG;AAAA,EACnB,CAAC,OAAO,OAAO,GAAG;AAAA,EAClB,CAAC,OAAO,SAAS,GAAG;AAAA,EACpB,CAAC,OAAO,OAAO,GAAG;AAAA,EAClB,CAAC,OAAO,MAAM,GAAG;AACnB;AAGO,IAAM,eAAe;AAAA,EAC1B,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,YAAY;AACd;AAIO,IAAM,sBAAwD;AAAA,EACnE,CAAC,aAAa,aAAa,GAAG;AAAA,EAC9B,CAAC,aAAa,iBAAiB,GAAG;AAAA,EAClC,CAAC,aAAa,UAAU,GAAG;AAC7B;AAGO,IAAM,QAAQ;AAAA,EACnB,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,eAAe;AACjB;AAIO,IAAM,eAA0C;AAAA,EACrD,CAAC,MAAM,OAAO,GAAG;AAAA,EACjB,CAAC,MAAM,UAAU,GAAG;AAAA,EACpB,CAAC,MAAM,iBAAiB,GAAG;AAAA,EAC3B,CAAC,MAAM,eAAe,GAAG;AAAA,EACzB,CAAC,MAAM,aAAa,GAAG;AACzB;AAGO,IAAM,WAAW;AAAA,EACtB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AACV;AAIO,IAAM,kBAAgD;AAAA,EAC3D,CAAC,SAAS,QAAQ,GAAG;AAAA,EACrB,CAAC,SAAS,QAAQ,GAAG;AAAA,EACrB,CAAC,SAAS,MAAM,GAAG;AACrB;AAGO,IAAM,WAAW;AAAA,EACtB,SAAS;AAAA;AAAA,EACT,aAAa;AAAA;AAAA,EACb,aAAa;AAAA;AAAA,EACb,iBAAiB;AAAA,EACjB,yBAAyB;AAAA;AAAA,EACzB,wBAAwB;AAAA;AAC1B;AAGO,IAAM,cAAc;AAAA,EACzB,UAAU;AAAA;AAAA,EACV,UAAU;AAAA;AAAA,EACV,QAAQ;AAAA;AACV;AAGO,IAAM,aAAa;AAAA,EACxB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAKO,IAAM,gBAAgB;AAGtB,IAAM,cAAc;AAGpB,IAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AACZ;AAIO,IAAM,gBAAyC;AAAA,EACpD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AACZ;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// src/constants.ts
|
|
2
|
+
var STATUS = {
|
|
3
|
+
POSTED: 0,
|
|
4
|
+
RESERVED: 1,
|
|
5
|
+
ACCEPTED: 2,
|
|
6
|
+
IN_PROGRESS: 3,
|
|
7
|
+
SUBMITTED: 4,
|
|
8
|
+
VERIFIED: 5,
|
|
9
|
+
SETTLED: 6,
|
|
10
|
+
CANCELLED: 7,
|
|
11
|
+
EXPIRED: 8,
|
|
12
|
+
FAILED: 9
|
|
13
|
+
};
|
|
14
|
+
var STATUS_LABELS = {
|
|
15
|
+
[STATUS.POSTED]: "Posted",
|
|
16
|
+
[STATUS.RESERVED]: "Reserved",
|
|
17
|
+
[STATUS.ACCEPTED]: "Accepted",
|
|
18
|
+
[STATUS.IN_PROGRESS]: "InProgress",
|
|
19
|
+
[STATUS.SUBMITTED]: "Submitted",
|
|
20
|
+
[STATUS.VERIFIED]: "Verified",
|
|
21
|
+
[STATUS.SETTLED]: "Settled",
|
|
22
|
+
[STATUS.CANCELLED]: "Cancelled",
|
|
23
|
+
[STATUS.EXPIRED]: "Expired",
|
|
24
|
+
[STATUS.FAILED]: "Failed"
|
|
25
|
+
};
|
|
26
|
+
var VERIFICATION = {
|
|
27
|
+
DETERMINISTIC: 0,
|
|
28
|
+
REQUESTER_CONFIRM: 1,
|
|
29
|
+
TIME_BOUND: 2
|
|
30
|
+
};
|
|
31
|
+
var VERIFICATION_LABELS = {
|
|
32
|
+
[VERIFICATION.DETERMINISTIC]: "Deterministic",
|
|
33
|
+
[VERIFICATION.REQUESTER_CONFIRM]: "RequesterConfirm",
|
|
34
|
+
[VERIFICATION.TIME_BOUND]: "TimeBoundCompletion"
|
|
35
|
+
};
|
|
36
|
+
var CLAIM = {
|
|
37
|
+
PENDING: 0,
|
|
38
|
+
X_VERIFIED: 1,
|
|
39
|
+
MOLTBOOK_VERIFIED: 2,
|
|
40
|
+
GITHUB_VERIFIED: 3,
|
|
41
|
+
WALLET_SIGNED: 4
|
|
42
|
+
};
|
|
43
|
+
var CLAIM_LABELS = {
|
|
44
|
+
[CLAIM.PENDING]: "Pending",
|
|
45
|
+
[CLAIM.X_VERIFIED]: "X",
|
|
46
|
+
[CLAIM.MOLTBOOK_VERIFIED]: "Moltbook",
|
|
47
|
+
[CLAIM.GITHUB_VERIFIED]: "GitHub",
|
|
48
|
+
[CLAIM.WALLET_SIGNED]: "WalletSigned"
|
|
49
|
+
};
|
|
50
|
+
var PRIORITY = {
|
|
51
|
+
STANDARD: 0,
|
|
52
|
+
PRIORITY: 1,
|
|
53
|
+
URGENT: 2
|
|
54
|
+
};
|
|
55
|
+
var PRIORITY_LABELS = {
|
|
56
|
+
[PRIORITY.STANDARD]: "Standard",
|
|
57
|
+
[PRIORITY.PRIORITY]: "Priority",
|
|
58
|
+
[PRIORITY.URGENT]: "Urgent"
|
|
59
|
+
};
|
|
60
|
+
var PROTOCOL = {
|
|
61
|
+
FEE_BPS: 200,
|
|
62
|
+
// 2%
|
|
63
|
+
MIN_FEE_BPS: 50,
|
|
64
|
+
// 0.5%
|
|
65
|
+
MAX_FEE_BPS: 500,
|
|
66
|
+
// 5%
|
|
67
|
+
BPS_DENOMINATOR: 1e4,
|
|
68
|
+
RESERVATION_DURATION_MS: 6e4,
|
|
69
|
+
// 60 seconds
|
|
70
|
+
FEE_CHANGE_TIMELOCK_MS: 6048e5
|
|
71
|
+
// 7 days
|
|
72
|
+
};
|
|
73
|
+
var MULTIPLIERS = {
|
|
74
|
+
STANDARD: 1e4,
|
|
75
|
+
// 1.0x
|
|
76
|
+
PRIORITY: 15e3,
|
|
77
|
+
// 1.5x
|
|
78
|
+
URGENT: 25e3
|
|
79
|
+
// 2.5x
|
|
80
|
+
};
|
|
81
|
+
var BADGE_TIER = {
|
|
82
|
+
BRONZE: 0,
|
|
83
|
+
SILVER: 1,
|
|
84
|
+
GOLD: 2
|
|
85
|
+
};
|
|
86
|
+
var USDC_DECIMALS = 6;
|
|
87
|
+
var API_VERSION = "0.2.0";
|
|
88
|
+
var NETWORKS = {
|
|
89
|
+
MAINNET: "mainnet",
|
|
90
|
+
TESTNET: "testnet",
|
|
91
|
+
DEVNET: "devnet",
|
|
92
|
+
LOCALNET: "localnet"
|
|
93
|
+
};
|
|
94
|
+
var FULLNODE_URLS = {
|
|
95
|
+
mainnet: "https://fullnode.mainnet.sui.io:443",
|
|
96
|
+
testnet: "https://fullnode.testnet.sui.io:443",
|
|
97
|
+
devnet: "https://fullnode.devnet.sui.io:443",
|
|
98
|
+
localnet: "http://127.0.0.1:9000"
|
|
99
|
+
};
|
|
100
|
+
export {
|
|
101
|
+
API_VERSION,
|
|
102
|
+
BADGE_TIER,
|
|
103
|
+
CLAIM,
|
|
104
|
+
CLAIM_LABELS,
|
|
105
|
+
FULLNODE_URLS,
|
|
106
|
+
MULTIPLIERS,
|
|
107
|
+
NETWORKS,
|
|
108
|
+
PRIORITY,
|
|
109
|
+
PRIORITY_LABELS,
|
|
110
|
+
PROTOCOL,
|
|
111
|
+
STATUS,
|
|
112
|
+
STATUS_LABELS,
|
|
113
|
+
USDC_DECIMALS,
|
|
114
|
+
VERIFICATION,
|
|
115
|
+
VERIFICATION_LABELS
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts"],"sourcesContent":["// TaskNet Protocol Constants\n// These match the on-chain Move constants\n\n// === Status Codes ===\nexport const STATUS = {\n POSTED: 0,\n RESERVED: 1,\n ACCEPTED: 2,\n IN_PROGRESS: 3,\n SUBMITTED: 4,\n VERIFIED: 5,\n SETTLED: 6,\n CANCELLED: 7,\n EXPIRED: 8,\n FAILED: 9,\n} as const;\n\nexport type TaskStatus = (typeof STATUS)[keyof typeof STATUS];\n\nexport const STATUS_LABELS: Record<TaskStatus, string> = {\n [STATUS.POSTED]: \"Posted\",\n [STATUS.RESERVED]: \"Reserved\",\n [STATUS.ACCEPTED]: \"Accepted\",\n [STATUS.IN_PROGRESS]: \"InProgress\",\n [STATUS.SUBMITTED]: \"Submitted\",\n [STATUS.VERIFIED]: \"Verified\",\n [STATUS.SETTLED]: \"Settled\",\n [STATUS.CANCELLED]: \"Cancelled\",\n [STATUS.EXPIRED]: \"Expired\",\n [STATUS.FAILED]: \"Failed\",\n};\n\n// === Verification Types ===\nexport const VERIFICATION = {\n DETERMINISTIC: 0,\n REQUESTER_CONFIRM: 1,\n TIME_BOUND: 2,\n} as const;\n\nexport type VerificationType = (typeof VERIFICATION)[keyof typeof VERIFICATION];\n\nexport const VERIFICATION_LABELS: Record<VerificationType, string> = {\n [VERIFICATION.DETERMINISTIC]: \"Deterministic\",\n [VERIFICATION.REQUESTER_CONFIRM]: \"RequesterConfirm\",\n [VERIFICATION.TIME_BOUND]: \"TimeBoundCompletion\",\n};\n\n// === Claim Types ===\nexport const CLAIM = {\n PENDING: 0,\n X_VERIFIED: 1,\n MOLTBOOK_VERIFIED: 2,\n GITHUB_VERIFIED: 3,\n WALLET_SIGNED: 4,\n} as const;\n\nexport type ClaimType = (typeof CLAIM)[keyof typeof CLAIM];\n\nexport const CLAIM_LABELS: Record<ClaimType, string> = {\n [CLAIM.PENDING]: \"Pending\",\n [CLAIM.X_VERIFIED]: \"X\",\n [CLAIM.MOLTBOOK_VERIFIED]: \"Moltbook\",\n [CLAIM.GITHUB_VERIFIED]: \"GitHub\",\n [CLAIM.WALLET_SIGNED]: \"WalletSigned\",\n};\n\n// === Priority Tiers ===\nexport const PRIORITY = {\n STANDARD: 0,\n PRIORITY: 1,\n URGENT: 2,\n} as const;\n\nexport type PriorityTier = (typeof PRIORITY)[keyof typeof PRIORITY];\n\nexport const PRIORITY_LABELS: Record<PriorityTier, string> = {\n [PRIORITY.STANDARD]: \"Standard\",\n [PRIORITY.PRIORITY]: \"Priority\",\n [PRIORITY.URGENT]: \"Urgent\",\n};\n\n// === Protocol Constants ===\nexport const PROTOCOL = {\n FEE_BPS: 200, // 2%\n MIN_FEE_BPS: 50, // 0.5%\n MAX_FEE_BPS: 500, // 5%\n BPS_DENOMINATOR: 10_000,\n RESERVATION_DURATION_MS: 60_000, // 60 seconds\n FEE_CHANGE_TIMELOCK_MS: 604_800_000, // 7 days\n} as const;\n\n// === Priority Multipliers (default) ===\nexport const MULTIPLIERS = {\n STANDARD: 10_000, // 1.0x\n PRIORITY: 15_000, // 1.5x\n URGENT: 25_000, // 2.5x\n} as const;\n\n// === Badge Tiers ===\nexport const BADGE_TIER = {\n BRONZE: 0,\n SILVER: 1,\n GOLD: 2,\n} as const;\n\nexport type BadgeTier = (typeof BADGE_TIER)[keyof typeof BADGE_TIER];\n\n// === USDC ===\nexport const USDC_DECIMALS = 6;\n\n// === API ===\nexport const API_VERSION = \"0.2.0\";\n\n// === Networks ===\nexport const NETWORKS = {\n MAINNET: \"mainnet\",\n TESTNET: \"testnet\",\n DEVNET: \"devnet\",\n LOCALNET: \"localnet\",\n} as const;\n\nexport type Network = (typeof NETWORKS)[keyof typeof NETWORKS];\n\nexport const FULLNODE_URLS: Record<Network, string> = {\n mainnet: \"https://fullnode.mainnet.sui.io:443\",\n testnet: \"https://fullnode.testnet.sui.io:443\",\n devnet: \"https://fullnode.devnet.sui.io:443\",\n localnet: \"http://127.0.0.1:9000\",\n};\n"],"mappings":";AAIO,IAAM,SAAS;AAAA,EACpB,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,aAAa;AAAA,EACb,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AACV;AAIO,IAAM,gBAA4C;AAAA,EACvD,CAAC,OAAO,MAAM,GAAG;AAAA,EACjB,CAAC,OAAO,QAAQ,GAAG;AAAA,EACnB,CAAC,OAAO,QAAQ,GAAG;AAAA,EACnB,CAAC,OAAO,WAAW,GAAG;AAAA,EACtB,CAAC,OAAO,SAAS,GAAG;AAAA,EACpB,CAAC,OAAO,QAAQ,GAAG;AAAA,EACnB,CAAC,OAAO,OAAO,GAAG;AAAA,EAClB,CAAC,OAAO,SAAS,GAAG;AAAA,EACpB,CAAC,OAAO,OAAO,GAAG;AAAA,EAClB,CAAC,OAAO,MAAM,GAAG;AACnB;AAGO,IAAM,eAAe;AAAA,EAC1B,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,YAAY;AACd;AAIO,IAAM,sBAAwD;AAAA,EACnE,CAAC,aAAa,aAAa,GAAG;AAAA,EAC9B,CAAC,aAAa,iBAAiB,GAAG;AAAA,EAClC,CAAC,aAAa,UAAU,GAAG;AAC7B;AAGO,IAAM,QAAQ;AAAA,EACnB,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,eAAe;AACjB;AAIO,IAAM,eAA0C;AAAA,EACrD,CAAC,MAAM,OAAO,GAAG;AAAA,EACjB,CAAC,MAAM,UAAU,GAAG;AAAA,EACpB,CAAC,MAAM,iBAAiB,GAAG;AAAA,EAC3B,CAAC,MAAM,eAAe,GAAG;AAAA,EACzB,CAAC,MAAM,aAAa,GAAG;AACzB;AAGO,IAAM,WAAW;AAAA,EACtB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AACV;AAIO,IAAM,kBAAgD;AAAA,EAC3D,CAAC,SAAS,QAAQ,GAAG;AAAA,EACrB,CAAC,SAAS,QAAQ,GAAG;AAAA,EACrB,CAAC,SAAS,MAAM,GAAG;AACrB;AAGO,IAAM,WAAW;AAAA,EACtB,SAAS;AAAA;AAAA,EACT,aAAa;AAAA;AAAA,EACb,aAAa;AAAA;AAAA,EACb,iBAAiB;AAAA,EACjB,yBAAyB;AAAA;AAAA,EACzB,wBAAwB;AAAA;AAC1B;AAGO,IAAM,cAAc;AAAA,EACzB,UAAU;AAAA;AAAA,EACV,UAAU;AAAA;AAAA,EACV,QAAQ;AAAA;AACV;AAGO,IAAM,aAAa;AAAA,EACxB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAKO,IAAM,gBAAgB;AAGtB,IAAM,cAAc;AAGpB,IAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AACZ;AAIO,IAAM,gBAAyC;AAAA,EACpD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AACZ;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tasknet-protocol/shared",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Shared types and constants for TaskNet Protocol",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup",
|
|
20
|
+
"dev": "tsup --watch",
|
|
21
|
+
"typecheck": "tsc --noEmit"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^20",
|
|
25
|
+
"tsup": "^8",
|
|
26
|
+
"typescript": "^5"
|
|
27
|
+
},
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/mission69b/tasknet-protocol"
|
|
32
|
+
}
|
|
33
|
+
}
|