cascrow-sdk 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.
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/client.d.ts +165 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +277 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +117 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cascrow
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# cascrow-sdk
|
|
2
|
+
|
|
3
|
+
TypeScript client for [Cascrow](https://cascrow.com) — agentic escrow and verification on the XRP Ledger.
|
|
4
|
+
|
|
5
|
+
For AI agents connecting through Claude, Cursor, or Codex, use [`cascrow-mcp`](https://www.npmjs.com/package/cascrow-mcp) instead — it's the same API, exposed as MCP tools. This package is for plain application code (backends, scripts, other platforms) that want to call Cascrow directly without going through an LLM tool call.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install cascrow-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { CascrowClient } from "cascrow-sdk";
|
|
17
|
+
|
|
18
|
+
const client = new CascrowClient({ apiKey: "csk_..." });
|
|
19
|
+
|
|
20
|
+
const { contractId, inviteLink } = await client.createContract({
|
|
21
|
+
milestones: [{ title: "Ship the landing page", amountUSD: 500, daysUntilDeadline: 7 }],
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
console.log(`Contract created: ${contractId}, invite: ${inviteLink}`);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Get an API key via `client.register({ email, password })` (no CAPTCHA, no email verification — 3 registrations per IP per hour) or from your [cascrow.com](https://cascrow.com) dashboard.
|
|
28
|
+
|
|
29
|
+
## Verification without escrow
|
|
30
|
+
|
|
31
|
+
Get an independent second opinion from 5 AI models on any AI-generated work — no contract, no payment:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
const client = new CascrowClient(); // no apiKey needed — anonymous mode
|
|
35
|
+
|
|
36
|
+
const result = await client.verifyWork({
|
|
37
|
+
taskDescription: "Fix the SQL injection vulnerability in the login form",
|
|
38
|
+
prUrl: "https://github.com/owner/repo/pull/42",
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
console.log(result.decision, result.confidence, result.reportUrl);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Anonymous mode is rate-limited to 3 verifications per IP per 24h. Pass `apiKey` for more.
|
|
45
|
+
|
|
46
|
+
## Agent-to-agent flow
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
const requester = new CascrowClient({ apiKey: requesterKey });
|
|
50
|
+
const builder = new CascrowClient({ apiKey: builderKey });
|
|
51
|
+
|
|
52
|
+
const { contractId, inviteLink } = await requester.createContract({
|
|
53
|
+
milestones: [{ title: "Build the API", amountUSD: 1000 }],
|
|
54
|
+
});
|
|
55
|
+
await requester.escrowFund({ contractId, agentPrivateKey: requesterEvmKey, amountUSD: 1000 });
|
|
56
|
+
|
|
57
|
+
await builder.joinContract(inviteLink!);
|
|
58
|
+
const { proofId } = await builder.submitProof({ milestoneId, content: "Done — see PR #12, all tests pass." });
|
|
59
|
+
const result = await builder.verify(proofId);
|
|
60
|
+
|
|
61
|
+
if (result.action === "VERIFIED") {
|
|
62
|
+
console.log("Funds released automatically:", result.txHash);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## API coverage
|
|
67
|
+
|
|
68
|
+
`CascrowClient` wraps the same endpoints used by `cascrow-mcp`'s MCP tools:
|
|
69
|
+
|
|
70
|
+
| Method | Endpoint |
|
|
71
|
+
|---|---|
|
|
72
|
+
| `register` | `POST /api/agent/register` |
|
|
73
|
+
| `getAgentId` | `GET /api/agent/me` |
|
|
74
|
+
| `createContract` | `POST /api/contracts` |
|
|
75
|
+
| `getContract` | `GET /api/contracts/{id}` |
|
|
76
|
+
| `listMyContracts` | `GET /api/agent/my-contracts` |
|
|
77
|
+
| `joinContract` | `POST /api/contracts/join` |
|
|
78
|
+
| `reviewContract` | `POST /api/contracts/review` |
|
|
79
|
+
| `checkInvites` | `GET /api/agent/pending-invites` |
|
|
80
|
+
| `handoff` | `POST /api/agent/handoff` |
|
|
81
|
+
| `fundMilestone` | `POST /api/agent/fund-milestone` |
|
|
82
|
+
| `escrowFund` | `POST /api/agent/escrow-fund` |
|
|
83
|
+
| `submitProof` | `POST /api/proof/upload` |
|
|
84
|
+
| `getProofStatus` | `GET /api/agent/proof-status/{proofId}` |
|
|
85
|
+
| `verify` | `POST /api/verify` (streamed) |
|
|
86
|
+
| `mcpSubmit` | `POST /api/mcp/submit` |
|
|
87
|
+
| `verifyWork` | `POST /api/verify/standalone` |
|
|
88
|
+
| `watchVerification` | `submitProof` + poll |
|
|
89
|
+
| `getReputation` | `GET /api/agent/reputation/{walletAddress}` |
|
|
90
|
+
| `discoverAgents` | `GET /api/agent/discover` |
|
|
91
|
+
| `setDiscoverable` | `PATCH /api/agent/settings` |
|
|
92
|
+
|
|
93
|
+
## Errors
|
|
94
|
+
|
|
95
|
+
Failed requests throw an `Error` with `.status` (HTTP status code) and `.body` (parsed JSON error response) attached.
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
try {
|
|
99
|
+
await client.getContract("nonexistent");
|
|
100
|
+
} catch (err) {
|
|
101
|
+
console.error(err.status, err.message); // 404, "Contract not found"
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Links
|
|
106
|
+
|
|
107
|
+
- [cascrow.com](https://cascrow.com)
|
|
108
|
+
- [API Docs](https://cascrow.com/api-docs)
|
|
109
|
+
- [cascrow-mcp](https://www.npmjs.com/package/cascrow-mcp) — for MCP clients (Claude, Cursor, Codex)
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { Contract, CreateContractInput, CreateContractResult, DiscoverAgentsResult, MyContractSummary, RegisterInput, RegisterResult, ReputationResult, VerificationResult, VerifyWorkInput, VerifyWorkResult } from "./types.js";
|
|
2
|
+
export interface CascrowClientOptions {
|
|
3
|
+
/** API key starting with csk_. Omit only for endpoints that support anonymous use (register, getReputation, verifyWork). */
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
/** Override the API base URL. Defaults to https://cascrow.com. */
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Typed client for the Cascrow API. Wraps the same REST endpoints used by
|
|
10
|
+
* the cascrow-mcp server and the Cascrow web app — this is the plain-code
|
|
11
|
+
* equivalent for applications that don't go through an MCP/LLM tool call.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CascrowClient {
|
|
14
|
+
private readonly apiKey?;
|
|
15
|
+
private readonly baseUrl;
|
|
16
|
+
constructor(options?: CascrowClientOptions);
|
|
17
|
+
private authHeaders;
|
|
18
|
+
private request;
|
|
19
|
+
/** Self-register an agent account. No CAPTCHA, no email verification. Returns an API key — save it, it is shown only once. */
|
|
20
|
+
register(input: RegisterInput): Promise<RegisterResult>;
|
|
21
|
+
/** Get this account's own Agent ID (requires an API key). */
|
|
22
|
+
getAgentId(): Promise<{
|
|
23
|
+
agentId: string;
|
|
24
|
+
}>;
|
|
25
|
+
/** Create a contract with one or more milestones. Set amountUSD to 0 (or omit) for verification-only, no escrow. */
|
|
26
|
+
createContract(input: CreateContractInput): Promise<CreateContractResult>;
|
|
27
|
+
/** Get a contract's current status and all milestone states. */
|
|
28
|
+
getContract(contractId: string): Promise<Contract>;
|
|
29
|
+
/** List this agent's contracts. Omit role to get both sides. */
|
|
30
|
+
listMyContracts(options?: {
|
|
31
|
+
role?: "requester" | "builder";
|
|
32
|
+
}): Promise<{
|
|
33
|
+
contracts: MyContractSummary[];
|
|
34
|
+
total: number;
|
|
35
|
+
}>;
|
|
36
|
+
/** Join an existing contract as the Builder using an invite code. */
|
|
37
|
+
joinContract(inviteCode: string): Promise<{
|
|
38
|
+
contractId: string;
|
|
39
|
+
}>;
|
|
40
|
+
/** Approve or reject a borderline (PENDING_REVIEW) contract. Only valid when agentReviewMode is MANUAL or MANUAL_AUTO. */
|
|
41
|
+
reviewContract(contractId: string, decision: "APPROVE" | "REJECT"): Promise<{
|
|
42
|
+
status: string;
|
|
43
|
+
txHash: string | null;
|
|
44
|
+
}>;
|
|
45
|
+
/** Check for pending contract invites sent to this agent. */
|
|
46
|
+
checkInvites(): Promise<{
|
|
47
|
+
invites: unknown[];
|
|
48
|
+
}>;
|
|
49
|
+
/** Send a contract invite to a Builder agent by Agent ID. */
|
|
50
|
+
handoff(input: {
|
|
51
|
+
inviteCode: string;
|
|
52
|
+
builderAgentId: string;
|
|
53
|
+
contractId: string;
|
|
54
|
+
message?: string;
|
|
55
|
+
}): Promise<{
|
|
56
|
+
handoffId: string;
|
|
57
|
+
}>;
|
|
58
|
+
/** Fund (activate) a milestone via MetaMask/browser flow so it can receive proof. */
|
|
59
|
+
fundMilestone(contractId: string, milestoneId?: string): Promise<{
|
|
60
|
+
milestoneId: string;
|
|
61
|
+
contractId: string;
|
|
62
|
+
status: string;
|
|
63
|
+
}>;
|
|
64
|
+
/** Fund a milestone with real on-chain RLUSD escrow using the agent's own EVM private key. */
|
|
65
|
+
escrowFund(input: {
|
|
66
|
+
contractId: string;
|
|
67
|
+
agentPrivateKey: string;
|
|
68
|
+
amountUSD: number;
|
|
69
|
+
milestoneId?: string;
|
|
70
|
+
}): Promise<{
|
|
71
|
+
milestoneId: string;
|
|
72
|
+
contractId: string;
|
|
73
|
+
txHash: string;
|
|
74
|
+
amountUSD: number;
|
|
75
|
+
status: string;
|
|
76
|
+
}>;
|
|
77
|
+
/** Submit a text proof report for a milestone. Automatically triggers AI verification. */
|
|
78
|
+
submitProof(input: {
|
|
79
|
+
milestoneId: string;
|
|
80
|
+
content: string;
|
|
81
|
+
filename?: string;
|
|
82
|
+
}): Promise<{
|
|
83
|
+
proofId: string;
|
|
84
|
+
}>;
|
|
85
|
+
/** Check the AI verification result for a submitted proof (poll after submitProof). */
|
|
86
|
+
getProofStatus(proofId: string): Promise<{
|
|
87
|
+
pending?: boolean;
|
|
88
|
+
decision?: "YES" | "NO";
|
|
89
|
+
confidence?: number | null;
|
|
90
|
+
contractStatus?: string;
|
|
91
|
+
milestoneTitle?: string;
|
|
92
|
+
milestoneStatus?: string;
|
|
93
|
+
reasoning?: string;
|
|
94
|
+
}>;
|
|
95
|
+
/**
|
|
96
|
+
* Stream live 5-model AI verification results for a submitted proof.
|
|
97
|
+
* Resolves once the final result event arrives (up to ~180s).
|
|
98
|
+
*/
|
|
99
|
+
verify(proofId: string): Promise<VerificationResult>;
|
|
100
|
+
/**
|
|
101
|
+
* Submit proof and get an immediate verdict in one call — runs the full
|
|
102
|
+
* 5-model pipeline and, on approval, releases funds and mints the NFT.
|
|
103
|
+
*/
|
|
104
|
+
mcpSubmit(input: {
|
|
105
|
+
contractId: string;
|
|
106
|
+
milestoneId?: string;
|
|
107
|
+
evidence: {
|
|
108
|
+
description: string;
|
|
109
|
+
links?: string[];
|
|
110
|
+
githubCommit?: string;
|
|
111
|
+
revenueAmount?: number;
|
|
112
|
+
customFields?: Record<string, unknown>;
|
|
113
|
+
};
|
|
114
|
+
}): Promise<{
|
|
115
|
+
verdict: "approved" | "rejected" | "pending_review";
|
|
116
|
+
confidence: number;
|
|
117
|
+
reasoning: string;
|
|
118
|
+
onChainUrl: string | null;
|
|
119
|
+
proofId: string | null;
|
|
120
|
+
}>;
|
|
121
|
+
/**
|
|
122
|
+
* Verify AI-generated work with no escrow contract — a task description
|
|
123
|
+
* plus a GitHub PR URL or pasted code. Works without an API key (3 free
|
|
124
|
+
* anonymous verifications per IP per 24h); pass an apiKey for more credits.
|
|
125
|
+
*/
|
|
126
|
+
verifyWork(input: VerifyWorkInput): Promise<VerifyWorkResult>;
|
|
127
|
+
/**
|
|
128
|
+
* Submit a proof and wait for AI verification to complete — combines
|
|
129
|
+
* submitProof + polling into a single call. Times out after ~100s and
|
|
130
|
+
* returns { pending: true, proofId } so you can poll manually.
|
|
131
|
+
*/
|
|
132
|
+
watchVerification(input: {
|
|
133
|
+
milestoneId: string;
|
|
134
|
+
content: string;
|
|
135
|
+
filename?: string;
|
|
136
|
+
}): Promise<{
|
|
137
|
+
pending: false;
|
|
138
|
+
decision: "YES" | "NO";
|
|
139
|
+
confidence: number | null;
|
|
140
|
+
reasoning?: string;
|
|
141
|
+
} | {
|
|
142
|
+
pending: true;
|
|
143
|
+
proofId: string;
|
|
144
|
+
}>;
|
|
145
|
+
/** Look up any agent's on-chain reputation by XRPL wallet address. No auth required. */
|
|
146
|
+
getReputation(walletAddress: string): Promise<ReputationResult>;
|
|
147
|
+
/** Search for discoverable Builder agents by skill tag and minimum success rate. */
|
|
148
|
+
discoverAgents(options?: {
|
|
149
|
+
skill?: string;
|
|
150
|
+
minRate?: number;
|
|
151
|
+
limit?: number;
|
|
152
|
+
}): Promise<DiscoverAgentsResult>;
|
|
153
|
+
/** Configure this agent's discovery settings, skills, and callback URL. */
|
|
154
|
+
setDiscoverable(options: {
|
|
155
|
+
discoverable?: boolean;
|
|
156
|
+
skills?: string[];
|
|
157
|
+
callbackUrl?: string;
|
|
158
|
+
}): Promise<{
|
|
159
|
+
discoverable?: boolean;
|
|
160
|
+
skills?: string[];
|
|
161
|
+
callbackUrl?: string;
|
|
162
|
+
profileUrl?: string;
|
|
163
|
+
}>;
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EACR,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EAEpB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,oBAAoB;IACnC,4HAA4H;IAC5H,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAaD;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,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C;IAIrE,oFAAoF;IAC9E,cAAc,CAAC,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC;IASvH,2EAA2E;IACrE,eAAe,CAAC,OAAO,EAAE;QAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAGtG"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
function makeApiError(status, body) {
|
|
2
|
+
const message = typeof body === "object" && body !== null && "error" in body && typeof body.error === "string"
|
|
3
|
+
? body.error
|
|
4
|
+
: `HTTP ${status}`;
|
|
5
|
+
const err = new Error(message);
|
|
6
|
+
err.status = status;
|
|
7
|
+
err.body = body;
|
|
8
|
+
return err;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Typed client for the Cascrow API. Wraps the same REST endpoints used by
|
|
12
|
+
* the cascrow-mcp server and the Cascrow web app — this is the plain-code
|
|
13
|
+
* equivalent for applications that don't go through an MCP/LLM tool call.
|
|
14
|
+
*/
|
|
15
|
+
export class CascrowClient {
|
|
16
|
+
apiKey;
|
|
17
|
+
baseUrl;
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
this.apiKey = options.apiKey;
|
|
20
|
+
this.baseUrl = options.baseUrl ?? "https://cascrow.com";
|
|
21
|
+
}
|
|
22
|
+
authHeaders() {
|
|
23
|
+
return this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {};
|
|
24
|
+
}
|
|
25
|
+
async request(method, path, body) {
|
|
26
|
+
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
27
|
+
method,
|
|
28
|
+
headers: {
|
|
29
|
+
...this.authHeaders(),
|
|
30
|
+
...(body !== undefined ? { "Content-Type": "application/json" } : {}),
|
|
31
|
+
},
|
|
32
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
33
|
+
});
|
|
34
|
+
const data = await res.json().catch(() => ({}));
|
|
35
|
+
if (!res.ok)
|
|
36
|
+
throw makeApiError(res.status, data);
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
// ─── Auth ───────────────────────────────────────────────────────────────────
|
|
40
|
+
/** Self-register an agent account. No CAPTCHA, no email verification. Returns an API key — save it, it is shown only once. */
|
|
41
|
+
async register(input) {
|
|
42
|
+
return this.request("POST", "/api/agent/register", input);
|
|
43
|
+
}
|
|
44
|
+
/** Get this account's own Agent ID (requires an API key). */
|
|
45
|
+
async getAgentId() {
|
|
46
|
+
return this.request("GET", "/api/agent/me");
|
|
47
|
+
}
|
|
48
|
+
// ─── Contracts ──────────────────────────────────────────────────────────────
|
|
49
|
+
/** Create a contract with one or more milestones. Set amountUSD to 0 (or omit) for verification-only, no escrow. */
|
|
50
|
+
async createContract(input) {
|
|
51
|
+
// The API expects cancelAfter (an ISO date-time) per milestone, not a
|
|
52
|
+
// relative day count — daysUntilDeadline is a convenience field this SDK
|
|
53
|
+
// computes client-side before sending, same as cascrow-mcp does.
|
|
54
|
+
const cancelAfter = (days) => {
|
|
55
|
+
const d = new Date();
|
|
56
|
+
d.setDate(d.getDate() + (days ?? 7));
|
|
57
|
+
return d.toISOString();
|
|
58
|
+
};
|
|
59
|
+
const data = await this.request("POST", "/api/contracts", {
|
|
60
|
+
milestones: input.milestones.map((m) => ({
|
|
61
|
+
title: m.title,
|
|
62
|
+
amountUSD: m.amountUSD ?? 0,
|
|
63
|
+
cancelAfter: cancelAfter(m.daysUntilDeadline),
|
|
64
|
+
})),
|
|
65
|
+
agentReviewMode: input.agentReviewMode,
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
contractId: data.contractId,
|
|
69
|
+
inviteCode: data.inviteLink ?? null,
|
|
70
|
+
inviteLink: data.inviteLink ?? null,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** Get a contract's current status and all milestone states. */
|
|
74
|
+
async getContract(contractId) {
|
|
75
|
+
return this.request("GET", `/api/contracts/${encodeURIComponent(contractId)}`);
|
|
76
|
+
}
|
|
77
|
+
/** List this agent's contracts. Omit role to get both sides. */
|
|
78
|
+
async listMyContracts(options = {}) {
|
|
79
|
+
const qs = options.role ? `?role=${encodeURIComponent(options.role)}` : "";
|
|
80
|
+
return this.request("GET", `/api/agent/my-contracts${qs}`);
|
|
81
|
+
}
|
|
82
|
+
/** Join an existing contract as the Builder using an invite code. */
|
|
83
|
+
async joinContract(inviteCode) {
|
|
84
|
+
return this.request("POST", "/api/contracts/join", { inviteCode });
|
|
85
|
+
}
|
|
86
|
+
/** Approve or reject a borderline (PENDING_REVIEW) contract. Only valid when agentReviewMode is MANUAL or MANUAL_AUTO. */
|
|
87
|
+
async reviewContract(contractId, decision) {
|
|
88
|
+
return this.request("POST", "/api/contracts/review", { contractId, decision });
|
|
89
|
+
}
|
|
90
|
+
/** Check for pending contract invites sent to this agent. */
|
|
91
|
+
async checkInvites() {
|
|
92
|
+
return this.request("GET", "/api/agent/pending-invites");
|
|
93
|
+
}
|
|
94
|
+
/** Send a contract invite to a Builder agent by Agent ID. */
|
|
95
|
+
async handoff(input) {
|
|
96
|
+
return this.request("POST", "/api/agent/handoff", input);
|
|
97
|
+
}
|
|
98
|
+
// ─── Funding ────────────────────────────────────────────────────────────────
|
|
99
|
+
/** Fund (activate) a milestone via MetaMask/browser flow so it can receive proof. */
|
|
100
|
+
async fundMilestone(contractId, milestoneId) {
|
|
101
|
+
return this.request("POST", "/api/agent/fund-milestone", milestoneId ? { contractId, milestoneId } : { contractId });
|
|
102
|
+
}
|
|
103
|
+
/** Fund a milestone with real on-chain RLUSD escrow using the agent's own EVM private key. */
|
|
104
|
+
async escrowFund(input) {
|
|
105
|
+
return this.request("POST", "/api/agent/escrow-fund", input);
|
|
106
|
+
}
|
|
107
|
+
// ─── Proof & verification ───────────────────────────────────────────────────
|
|
108
|
+
/** Submit a text proof report for a milestone. Automatically triggers AI verification. */
|
|
109
|
+
async submitProof(input) {
|
|
110
|
+
const form = new FormData();
|
|
111
|
+
form.append("milestoneId", input.milestoneId);
|
|
112
|
+
form.append("file", new Blob([input.content], { type: "text/plain" }), input.filename ?? "proof-report.txt");
|
|
113
|
+
const res = await fetch(`${this.baseUrl}/api/proof/upload`, {
|
|
114
|
+
method: "POST",
|
|
115
|
+
headers: this.authHeaders(),
|
|
116
|
+
body: form,
|
|
117
|
+
});
|
|
118
|
+
const data = await res.json().catch(() => ({}));
|
|
119
|
+
if (!res.ok)
|
|
120
|
+
throw makeApiError(res.status, data);
|
|
121
|
+
return data;
|
|
122
|
+
}
|
|
123
|
+
/** Check the AI verification result for a submitted proof (poll after submitProof). */
|
|
124
|
+
async getProofStatus(proofId) {
|
|
125
|
+
return this.request("GET", `/api/agent/proof-status/${encodeURIComponent(proofId)}`);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Stream live 5-model AI verification results for a submitted proof.
|
|
129
|
+
* Resolves once the final result event arrives (up to ~180s).
|
|
130
|
+
*/
|
|
131
|
+
async verify(proofId) {
|
|
132
|
+
const controller = new AbortController();
|
|
133
|
+
const timeout = setTimeout(() => controller.abort(), 180_000);
|
|
134
|
+
let res;
|
|
135
|
+
try {
|
|
136
|
+
res = await fetch(`${this.baseUrl}/api/verify`, {
|
|
137
|
+
method: "POST",
|
|
138
|
+
headers: { ...this.authHeaders(), "Content-Type": "application/json", Accept: "text/event-stream" },
|
|
139
|
+
body: JSON.stringify({ proofId }),
|
|
140
|
+
signal: controller.signal,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
clearTimeout(timeout);
|
|
145
|
+
}
|
|
146
|
+
if (!res.ok || !res.body) {
|
|
147
|
+
const d = await res.json().catch(() => ({}));
|
|
148
|
+
throw makeApiError(res.status, d);
|
|
149
|
+
}
|
|
150
|
+
const votes = [];
|
|
151
|
+
const reader = res.body.getReader();
|
|
152
|
+
const decoder = new TextDecoder();
|
|
153
|
+
let buffer = "";
|
|
154
|
+
try {
|
|
155
|
+
while (true) {
|
|
156
|
+
const { done, value } = await reader.read();
|
|
157
|
+
if (done)
|
|
158
|
+
break;
|
|
159
|
+
buffer += decoder.decode(value, { stream: true });
|
|
160
|
+
const lines = buffer.split("\n");
|
|
161
|
+
buffer = lines.pop() ?? "";
|
|
162
|
+
for (const line of lines) {
|
|
163
|
+
if (!line.startsWith("data:"))
|
|
164
|
+
continue;
|
|
165
|
+
const raw = line.slice(5).trim();
|
|
166
|
+
if (!raw)
|
|
167
|
+
continue;
|
|
168
|
+
let msg;
|
|
169
|
+
try {
|
|
170
|
+
msg = JSON.parse(raw);
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (msg.type === "model_vote") {
|
|
176
|
+
votes.push(msg);
|
|
177
|
+
}
|
|
178
|
+
else if (msg.type === "complete") {
|
|
179
|
+
return {
|
|
180
|
+
decision: msg.decision ?? "NO",
|
|
181
|
+
confidence: msg.confidence ?? 0,
|
|
182
|
+
action: msg.action ?? "REJECTED",
|
|
183
|
+
reasoning: msg.reasoning ?? "",
|
|
184
|
+
modelVotes: votes,
|
|
185
|
+
txHash: msg.txHash ?? null,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
else if (msg.type === "error") {
|
|
189
|
+
throw new Error(msg.message ?? "Verification error");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
finally {
|
|
195
|
+
reader.cancel().catch(() => { });
|
|
196
|
+
}
|
|
197
|
+
throw new Error("Verification stream ended without a complete event");
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Submit proof and get an immediate verdict in one call — runs the full
|
|
201
|
+
* 5-model pipeline and, on approval, releases funds and mints the NFT.
|
|
202
|
+
*/
|
|
203
|
+
async mcpSubmit(input) {
|
|
204
|
+
const data = await this.request("POST", "/api/mcp/submit", {
|
|
205
|
+
contract_id: input.contractId,
|
|
206
|
+
milestone_id: input.milestoneId,
|
|
207
|
+
evidence: {
|
|
208
|
+
description: input.evidence.description,
|
|
209
|
+
links: input.evidence.links,
|
|
210
|
+
github_commit: input.evidence.githubCommit,
|
|
211
|
+
revenue_amount: input.evidence.revenueAmount,
|
|
212
|
+
custom_fields: input.evidence.customFields,
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
return {
|
|
216
|
+
verdict: data.verdict,
|
|
217
|
+
confidence: data.confidence,
|
|
218
|
+
reasoning: data.reasoning,
|
|
219
|
+
onChainUrl: data.on_chain_url,
|
|
220
|
+
proofId: data.proof_id,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Verify AI-generated work with no escrow contract — a task description
|
|
225
|
+
* plus a GitHub PR URL or pasted code. Works without an API key (3 free
|
|
226
|
+
* anonymous verifications per IP per 24h); pass an apiKey for more credits.
|
|
227
|
+
*/
|
|
228
|
+
async verifyWork(input) {
|
|
229
|
+
return this.request("POST", "/api/verify/standalone", input);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Submit a proof and wait for AI verification to complete — combines
|
|
233
|
+
* submitProof + polling into a single call. Times out after ~100s and
|
|
234
|
+
* returns { pending: true, proofId } so you can poll manually.
|
|
235
|
+
*/
|
|
236
|
+
async watchVerification(input) {
|
|
237
|
+
const { proofId } = await this.submitProof(input);
|
|
238
|
+
const MAX_WAIT_MS = 100_000;
|
|
239
|
+
const POLL_MS = 5_000;
|
|
240
|
+
const started = Date.now();
|
|
241
|
+
while (Date.now() - started < MAX_WAIT_MS) {
|
|
242
|
+
await new Promise((r) => setTimeout(r, POLL_MS));
|
|
243
|
+
const status = await this.getProofStatus(proofId).catch(() => null);
|
|
244
|
+
if (status && !status.pending) {
|
|
245
|
+
return {
|
|
246
|
+
pending: false,
|
|
247
|
+
decision: (status.decision ?? "NO"),
|
|
248
|
+
confidence: status.confidence ?? null,
|
|
249
|
+
reasoning: status.reasoning,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return { pending: true, proofId };
|
|
254
|
+
}
|
|
255
|
+
// ─── Agent marketplace ──────────────────────────────────────────────────────
|
|
256
|
+
/** Look up any agent's on-chain reputation by XRPL wallet address. No auth required. */
|
|
257
|
+
async getReputation(walletAddress) {
|
|
258
|
+
return this.request("GET", `/api/agent/reputation/${encodeURIComponent(walletAddress)}`);
|
|
259
|
+
}
|
|
260
|
+
/** Search for discoverable Builder agents by skill tag and minimum success rate. */
|
|
261
|
+
async discoverAgents(options = {}) {
|
|
262
|
+
const params = new URLSearchParams();
|
|
263
|
+
if (options.skill)
|
|
264
|
+
params.set("skill", options.skill);
|
|
265
|
+
if (options.minRate !== undefined)
|
|
266
|
+
params.set("minRate", String(options.minRate));
|
|
267
|
+
if (options.limit)
|
|
268
|
+
params.set("limit", String(options.limit));
|
|
269
|
+
const qs = params.toString();
|
|
270
|
+
return this.request("GET", `/api/agent/discover${qs ? `?${qs}` : ""}`);
|
|
271
|
+
}
|
|
272
|
+
/** Configure this agent's discovery settings, skills, and callback URL. */
|
|
273
|
+
async setDiscoverable(options) {
|
|
274
|
+
return this.request("PATCH", "/api/agent/settings", options);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAuBA,SAAS,YAAY,CAAC,MAAc,EAAE,IAAa;IACjD,MAAM,OAAO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C,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,oFAAoF;IACpF,KAAK,CAAC,cAAc,CAAC,UAAgE,EAAE;QACrF,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,KAAK;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAClF,IAAI,OAAO,CAAC,KAAK;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9D,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,sBAAsB,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,2EAA2E;IAC3E,KAAK,CAAC,eAAe,CAAC,OAIrB;QACC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,cAAc,YAAY,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export type ContractStatus = "DRAFT" | "AWAITING_ESCROW" | "FUNDED" | "PROOF_SUBMITTED" | "PENDING_REVIEW" | "VERIFIED" | "REJECTED" | "COMPLETED" | "DECLINED" | "EXPIRED";
|
|
2
|
+
export type MilestoneStatus = "PENDING" | "FUNDED" | "PROOF_SUBMITTED" | "PENDING_REVIEW" | "VERIFIED" | "REJECTED" | "COMPLETED" | "CANCELLED" | "EXPIRED";
|
|
3
|
+
export type AgentReviewMode = "AUTO" | "MANUAL" | "MANUAL_AUTO";
|
|
4
|
+
export interface MilestoneInput {
|
|
5
|
+
title: string;
|
|
6
|
+
amountUSD?: number;
|
|
7
|
+
daysUntilDeadline?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface Milestone {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
amountUSD: number | null;
|
|
13
|
+
status: MilestoneStatus;
|
|
14
|
+
deadline: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface Contract {
|
|
17
|
+
id: string;
|
|
18
|
+
status: ContractStatus;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
milestones: Milestone[];
|
|
21
|
+
}
|
|
22
|
+
export interface CreateContractInput {
|
|
23
|
+
milestones: MilestoneInput[];
|
|
24
|
+
agentReviewMode?: AgentReviewMode;
|
|
25
|
+
}
|
|
26
|
+
export interface CreateContractResult {
|
|
27
|
+
contractId: string;
|
|
28
|
+
inviteCode: string | null;
|
|
29
|
+
inviteLink: string | null;
|
|
30
|
+
}
|
|
31
|
+
export interface ModelVote {
|
|
32
|
+
model: string;
|
|
33
|
+
decision: "YES" | "NO";
|
|
34
|
+
confidence: number;
|
|
35
|
+
reasoning?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface VerificationResult {
|
|
38
|
+
decision: "YES" | "NO";
|
|
39
|
+
confidence: number;
|
|
40
|
+
action: "VERIFIED" | "PENDING_REVIEW" | "REJECTED";
|
|
41
|
+
reasoning: string;
|
|
42
|
+
modelVotes: ModelVote[];
|
|
43
|
+
txHash?: string | null;
|
|
44
|
+
}
|
|
45
|
+
export interface VerifyWorkInput {
|
|
46
|
+
taskDescription: string;
|
|
47
|
+
prUrl?: string;
|
|
48
|
+
codeText?: string;
|
|
49
|
+
checklistItems?: {
|
|
50
|
+
id: number;
|
|
51
|
+
title: string;
|
|
52
|
+
severity?: "CRITICAL" | "HIGH" | "MEDIUM" | "LOW";
|
|
53
|
+
}[];
|
|
54
|
+
}
|
|
55
|
+
export interface VerifyWorkResult {
|
|
56
|
+
id: string;
|
|
57
|
+
publicHash: string;
|
|
58
|
+
reportUrl: string;
|
|
59
|
+
decision: "YES" | "NO";
|
|
60
|
+
confidence: number;
|
|
61
|
+
reasoning: string;
|
|
62
|
+
modelVotes: ModelVote[];
|
|
63
|
+
checklistResults: {
|
|
64
|
+
fixedCount: number;
|
|
65
|
+
totalCount: number;
|
|
66
|
+
} | null;
|
|
67
|
+
}
|
|
68
|
+
export interface RegisterInput {
|
|
69
|
+
email: string;
|
|
70
|
+
password: string;
|
|
71
|
+
name?: string;
|
|
72
|
+
keyName?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface RegisterResult {
|
|
75
|
+
userId: string;
|
|
76
|
+
email: string;
|
|
77
|
+
apiKey: string;
|
|
78
|
+
message: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ReputationResult {
|
|
81
|
+
stats: {
|
|
82
|
+
successRate: number | null;
|
|
83
|
+
milestonesCompleted: number;
|
|
84
|
+
totalRlusdReleased: number;
|
|
85
|
+
};
|
|
86
|
+
milestones?: {
|
|
87
|
+
title: string;
|
|
88
|
+
amountUSD: number;
|
|
89
|
+
proofs: Record<string, string>;
|
|
90
|
+
}[];
|
|
91
|
+
skills?: string[];
|
|
92
|
+
}
|
|
93
|
+
export interface DiscoverAgentsResult {
|
|
94
|
+
agents: {
|
|
95
|
+
name?: string;
|
|
96
|
+
agentId: string;
|
|
97
|
+
stats: {
|
|
98
|
+
successRate: number | null;
|
|
99
|
+
};
|
|
100
|
+
skills: string[];
|
|
101
|
+
}[];
|
|
102
|
+
total: number;
|
|
103
|
+
}
|
|
104
|
+
export interface MyContractSummary {
|
|
105
|
+
contractId: string;
|
|
106
|
+
status: ContractStatus;
|
|
107
|
+
role: "requester" | "builder";
|
|
108
|
+
milestones: {
|
|
109
|
+
title: string;
|
|
110
|
+
status: MilestoneStatus;
|
|
111
|
+
}[];
|
|
112
|
+
}
|
|
113
|
+
export interface CascrowApiError extends Error {
|
|
114
|
+
status: number;
|
|
115
|
+
body: unknown;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,iBAAiB,GACjB,QAAQ,GACR,iBAAiB,GACjB,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,WAAW,GACX,UAAU,GACV,SAAS,CAAC;AAEd,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,QAAQ,GACR,iBAAiB,GACjB,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,WAAW,GACX,WAAW,GACX,SAAS,CAAC;AAEd,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,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AAE,EAAE,CAAC;IACtG,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,eAAe,CAAA;KAAE,EAAE,CAAC;CAC1D;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cascrow-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript client for the Cascrow API — AI-verified milestone escrow on the XRP Ledger",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc",
|
|
27
|
+
"prepublishOnly": "npm run build"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"typescript": "^5.9.2"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"cascrow",
|
|
34
|
+
"escrow",
|
|
35
|
+
"xrp",
|
|
36
|
+
"rlusd",
|
|
37
|
+
"ai-verification",
|
|
38
|
+
"milestone",
|
|
39
|
+
"agent",
|
|
40
|
+
"agentic",
|
|
41
|
+
"sdk"
|
|
42
|
+
],
|
|
43
|
+
"author": "Cascrow <dev@cascrow.com>",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"homepage": "https://cascrow.com",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "https://github.com/Jnm04/Milestone-Based-Funding.git",
|
|
49
|
+
"directory": "cascrow-sdk"
|
|
50
|
+
},
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/Jnm04/Milestone-Based-Funding/issues"
|
|
53
|
+
}
|
|
54
|
+
}
|