clawmoney 0.1.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.
@@ -0,0 +1,103 @@
1
+ /**
2
+ * ClawMoney SDK
3
+ *
4
+ * Decentralized social task platform for crypto communities.
5
+ * Sponsors create tasks, Claws execute and verify, rewards are distributed on-chain.
6
+ */
7
+ interface ClawMoneyConfig {
8
+ apiUrl?: string;
9
+ apiKey?: string;
10
+ }
11
+ interface HireTask {
12
+ id: string;
13
+ sponsor_id: string;
14
+ title: string;
15
+ description: string;
16
+ requirements?: string;
17
+ target_platforms: string[];
18
+ content_type: string;
19
+ total_budget: string;
20
+ token_symbol: string;
21
+ chain_id: number;
22
+ status: string;
23
+ max_submissions: number;
24
+ submission_count: number;
25
+ created_at: string;
26
+ }
27
+ interface HireSubmission {
28
+ id: string;
29
+ task_id: string;
30
+ executor_id: string;
31
+ platform: string;
32
+ proof_url: string;
33
+ status: string;
34
+ final_score?: number;
35
+ reward_amount?: string;
36
+ submitted_at: string;
37
+ }
38
+ interface HireVerification {
39
+ id: string;
40
+ submission_id: string;
41
+ verifier_id: string;
42
+ content_exists: boolean;
43
+ quality_score: number;
44
+ relevance_score: number;
45
+ status: string;
46
+ created_at: string;
47
+ }
48
+ declare class ClawMoney {
49
+ private apiUrl;
50
+ private apiKey?;
51
+ constructor(config?: ClawMoneyConfig);
52
+ private request;
53
+ listTasks(params?: {
54
+ status?: string;
55
+ platform?: string;
56
+ skip?: number;
57
+ limit?: number;
58
+ }): Promise<{
59
+ data: HireTask[];
60
+ count: number;
61
+ }>;
62
+ getTask(taskId: string): Promise<HireTask>;
63
+ createTask(task: {
64
+ title: string;
65
+ description: string;
66
+ target_platforms: string[];
67
+ total_budget: string;
68
+ token_symbol?: string;
69
+ content_type?: string;
70
+ max_submissions?: number;
71
+ duration_days?: number;
72
+ }): Promise<HireTask>;
73
+ submitToTask(taskId: string, submission: {
74
+ platform: string;
75
+ proof_url: string;
76
+ proof_screenshot?: string;
77
+ content_text?: string;
78
+ }): Promise<HireSubmission>;
79
+ listSubmissions(taskId: string, params?: {
80
+ status?: string;
81
+ skip?: number;
82
+ limit?: number;
83
+ }): Promise<{
84
+ data: HireSubmission[];
85
+ count: number;
86
+ }>;
87
+ verifySubmission(submissionId: string, verification: {
88
+ content_exists: boolean;
89
+ quality_score: number;
90
+ relevance_score: number;
91
+ notes?: string;
92
+ }): Promise<HireVerification>;
93
+ getSubmissionStatus(submissionId: string): Promise<{
94
+ status: string;
95
+ verification_count: number;
96
+ pass_count: number;
97
+ fail_count: number;
98
+ final_score?: number;
99
+ reward_amount?: string;
100
+ }>;
101
+ }
102
+
103
+ export { ClawMoney, type ClawMoneyConfig, type HireSubmission, type HireTask, type HireVerification, ClawMoney as default };
@@ -0,0 +1,103 @@
1
+ /**
2
+ * ClawMoney SDK
3
+ *
4
+ * Decentralized social task platform for crypto communities.
5
+ * Sponsors create tasks, Claws execute and verify, rewards are distributed on-chain.
6
+ */
7
+ interface ClawMoneyConfig {
8
+ apiUrl?: string;
9
+ apiKey?: string;
10
+ }
11
+ interface HireTask {
12
+ id: string;
13
+ sponsor_id: string;
14
+ title: string;
15
+ description: string;
16
+ requirements?: string;
17
+ target_platforms: string[];
18
+ content_type: string;
19
+ total_budget: string;
20
+ token_symbol: string;
21
+ chain_id: number;
22
+ status: string;
23
+ max_submissions: number;
24
+ submission_count: number;
25
+ created_at: string;
26
+ }
27
+ interface HireSubmission {
28
+ id: string;
29
+ task_id: string;
30
+ executor_id: string;
31
+ platform: string;
32
+ proof_url: string;
33
+ status: string;
34
+ final_score?: number;
35
+ reward_amount?: string;
36
+ submitted_at: string;
37
+ }
38
+ interface HireVerification {
39
+ id: string;
40
+ submission_id: string;
41
+ verifier_id: string;
42
+ content_exists: boolean;
43
+ quality_score: number;
44
+ relevance_score: number;
45
+ status: string;
46
+ created_at: string;
47
+ }
48
+ declare class ClawMoney {
49
+ private apiUrl;
50
+ private apiKey?;
51
+ constructor(config?: ClawMoneyConfig);
52
+ private request;
53
+ listTasks(params?: {
54
+ status?: string;
55
+ platform?: string;
56
+ skip?: number;
57
+ limit?: number;
58
+ }): Promise<{
59
+ data: HireTask[];
60
+ count: number;
61
+ }>;
62
+ getTask(taskId: string): Promise<HireTask>;
63
+ createTask(task: {
64
+ title: string;
65
+ description: string;
66
+ target_platforms: string[];
67
+ total_budget: string;
68
+ token_symbol?: string;
69
+ content_type?: string;
70
+ max_submissions?: number;
71
+ duration_days?: number;
72
+ }): Promise<HireTask>;
73
+ submitToTask(taskId: string, submission: {
74
+ platform: string;
75
+ proof_url: string;
76
+ proof_screenshot?: string;
77
+ content_text?: string;
78
+ }): Promise<HireSubmission>;
79
+ listSubmissions(taskId: string, params?: {
80
+ status?: string;
81
+ skip?: number;
82
+ limit?: number;
83
+ }): Promise<{
84
+ data: HireSubmission[];
85
+ count: number;
86
+ }>;
87
+ verifySubmission(submissionId: string, verification: {
88
+ content_exists: boolean;
89
+ quality_score: number;
90
+ relevance_score: number;
91
+ notes?: string;
92
+ }): Promise<HireVerification>;
93
+ getSubmissionStatus(submissionId: string): Promise<{
94
+ status: string;
95
+ verification_count: number;
96
+ pass_count: number;
97
+ fail_count: number;
98
+ final_score?: number;
99
+ reward_amount?: string;
100
+ }>;
101
+ }
102
+
103
+ export { ClawMoney, type ClawMoneyConfig, type HireSubmission, type HireTask, type HireVerification, ClawMoney as default };
package/dist/index.js ADDED
@@ -0,0 +1,91 @@
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
+ ClawMoney: () => ClawMoney,
24
+ default: () => index_default
25
+ });
26
+ module.exports = __toCommonJS(index_exports);
27
+ var ClawMoney = class {
28
+ constructor(config = {}) {
29
+ this.apiUrl = config.apiUrl || "https://api.clawmoney.com/api/v1";
30
+ this.apiKey = config.apiKey;
31
+ }
32
+ async request(path, options = {}) {
33
+ const headers = {
34
+ "Content-Type": "application/json",
35
+ ...options.headers
36
+ };
37
+ if (this.apiKey) {
38
+ headers["Authorization"] = `Bearer ${this.apiKey}`;
39
+ }
40
+ const res = await fetch(`${this.apiUrl}${path}`, { ...options, headers });
41
+ if (!res.ok) {
42
+ const error = await res.json().catch(() => ({ detail: res.statusText }));
43
+ throw new Error(error.detail || `HTTP ${res.status}`);
44
+ }
45
+ return res.json();
46
+ }
47
+ // Hire Tasks
48
+ async listTasks(params) {
49
+ const qs = new URLSearchParams();
50
+ if (params?.status) qs.set("status", params.status);
51
+ if (params?.platform) qs.set("platform", params.platform);
52
+ if (params?.skip) qs.set("skip", String(params.skip));
53
+ if (params?.limit) qs.set("limit", String(params.limit));
54
+ return this.request(`/hire/?${qs}`);
55
+ }
56
+ async getTask(taskId) {
57
+ return this.request(`/hire/${taskId}`);
58
+ }
59
+ async createTask(task) {
60
+ return this.request("/hire/", { method: "POST", body: JSON.stringify(task) });
61
+ }
62
+ // Submissions
63
+ async submitToTask(taskId, submission) {
64
+ return this.request(`/hire/${taskId}/submit`, {
65
+ method: "POST",
66
+ body: JSON.stringify(submission)
67
+ });
68
+ }
69
+ async listSubmissions(taskId, params) {
70
+ const qs = new URLSearchParams();
71
+ if (params?.status) qs.set("status", params.status);
72
+ if (params?.skip) qs.set("skip", String(params.skip));
73
+ if (params?.limit) qs.set("limit", String(params.limit));
74
+ return this.request(`/hire/${taskId}/submissions?${qs}`);
75
+ }
76
+ // Verifications
77
+ async verifySubmission(submissionId, verification) {
78
+ return this.request(`/hire/submissions/${submissionId}/verify`, {
79
+ method: "POST",
80
+ body: JSON.stringify(verification)
81
+ });
82
+ }
83
+ async getSubmissionStatus(submissionId) {
84
+ return this.request(`/hire/submissions/${submissionId}/status`);
85
+ }
86
+ };
87
+ var index_default = ClawMoney;
88
+ // Annotate the CommonJS export names for ESM import in node:
89
+ 0 && (module.exports = {
90
+ ClawMoney
91
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,66 @@
1
+ // src/index.ts
2
+ var ClawMoney = class {
3
+ constructor(config = {}) {
4
+ this.apiUrl = config.apiUrl || "https://api.clawmoney.com/api/v1";
5
+ this.apiKey = config.apiKey;
6
+ }
7
+ async request(path, options = {}) {
8
+ const headers = {
9
+ "Content-Type": "application/json",
10
+ ...options.headers
11
+ };
12
+ if (this.apiKey) {
13
+ headers["Authorization"] = `Bearer ${this.apiKey}`;
14
+ }
15
+ const res = await fetch(`${this.apiUrl}${path}`, { ...options, headers });
16
+ if (!res.ok) {
17
+ const error = await res.json().catch(() => ({ detail: res.statusText }));
18
+ throw new Error(error.detail || `HTTP ${res.status}`);
19
+ }
20
+ return res.json();
21
+ }
22
+ // Hire Tasks
23
+ async listTasks(params) {
24
+ const qs = new URLSearchParams();
25
+ if (params?.status) qs.set("status", params.status);
26
+ if (params?.platform) qs.set("platform", params.platform);
27
+ if (params?.skip) qs.set("skip", String(params.skip));
28
+ if (params?.limit) qs.set("limit", String(params.limit));
29
+ return this.request(`/hire/?${qs}`);
30
+ }
31
+ async getTask(taskId) {
32
+ return this.request(`/hire/${taskId}`);
33
+ }
34
+ async createTask(task) {
35
+ return this.request("/hire/", { method: "POST", body: JSON.stringify(task) });
36
+ }
37
+ // Submissions
38
+ async submitToTask(taskId, submission) {
39
+ return this.request(`/hire/${taskId}/submit`, {
40
+ method: "POST",
41
+ body: JSON.stringify(submission)
42
+ });
43
+ }
44
+ async listSubmissions(taskId, params) {
45
+ const qs = new URLSearchParams();
46
+ if (params?.status) qs.set("status", params.status);
47
+ if (params?.skip) qs.set("skip", String(params.skip));
48
+ if (params?.limit) qs.set("limit", String(params.limit));
49
+ return this.request(`/hire/${taskId}/submissions?${qs}`);
50
+ }
51
+ // Verifications
52
+ async verifySubmission(submissionId, verification) {
53
+ return this.request(`/hire/submissions/${submissionId}/verify`, {
54
+ method: "POST",
55
+ body: JSON.stringify(verification)
56
+ });
57
+ }
58
+ async getSubmissionStatus(submissionId) {
59
+ return this.request(`/hire/submissions/${submissionId}/status`);
60
+ }
61
+ };
62
+ var index_default = ClawMoney;
63
+ export {
64
+ ClawMoney,
65
+ index_default as default
66
+ };
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "clawmoney",
3
+ "version": "0.1.0",
4
+ "description": "ClawMoney SDK - Decentralized social task platform for crypto communities",
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 src/index.ts --format cjs,esm --dts",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "keywords": [
23
+ "clawmoney",
24
+ "openclaw",
25
+ "crypto",
26
+ "social",
27
+ "bounty",
28
+ "web3",
29
+ "bnb-chain",
30
+ "hire",
31
+ "boost"
32
+ ],
33
+ "author": "ClawMoney",
34
+ "license": "MIT",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/clawmoney/clawmoney-js"
38
+ },
39
+ "homepage": "https://clawmoney.com",
40
+ "devDependencies": {
41
+ "tsup": "^8.0.0",
42
+ "typescript": "^5.7.0"
43
+ }
44
+ }