cascrow-sdk 0.4.0 → 0.8.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/CHANGELOG.md +35 -0
- package/README.md +48 -12
- package/dist/client.d.ts +177 -64
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +191 -46
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/signature.d.ts +52 -0
- package/dist/signature.d.ts.map +1 -0
- package/dist/signature.js +50 -0
- package/dist/signature.js.map +1 -0
- package/dist/types.d.ts +159 -14
- package/dist/types.d.ts.map +1 -1
- package/dist/v3.d.ts +130 -0
- package/dist/v3.d.ts.map +1 -0
- package/dist/v3.js +107 -0
- package/dist/v3.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../src/signature.ts"],"names":[],"mappings":"AAoCA,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAC9D,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAEjD,KAAK,UAAU,MAAM;IACnB,MAAM,CAAC,GAAI,UAAkC,CAAC,MAAM,CAAC;IACrD,IAAI,CAAC,EAAE,MAAM;QAAE,OAAO,CAAC,CAAC,MAAM,CAAC;IAC/B,MAAM,IAAI,GAAG,aAAa,CAAC;IAC3B,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,CAA2B,CAAC;IAC3D,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACpG,OAAO,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC;AAC9B,CAAC;AAED,SAAS,K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I,EAAE,CAAC,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC,UAAU,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;AAC1G,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ export interface MilestoneChecklistItemInput {
|
|
|
11
11
|
export interface MilestoneInput {
|
|
12
12
|
/** Short title — printed on the public certificate. Put acceptance criteria in `verificationCriteria`. */
|
|
13
13
|
title: string;
|
|
14
|
+
/**
|
|
15
|
+
* 0 or absent: a verification-only milestone — active by itself once the builder
|
|
16
|
+
* has joined, no money moves. Above 0: a MilestoneEscrowV3 milestone in native
|
|
17
|
+
* XRP — the payer offers terms (`client.v3.offer`), the builder accepts with their
|
|
18
|
+
* own key, and the payer funds it from their own machine with `cascrow-signer`.
|
|
19
|
+
*/
|
|
14
20
|
amountUSD?: number;
|
|
15
21
|
daysUntilDeadline?: number;
|
|
16
22
|
/**
|
|
@@ -41,11 +47,34 @@ export interface Contract {
|
|
|
41
47
|
export interface CreateContractInput {
|
|
42
48
|
milestones: MilestoneInput[];
|
|
43
49
|
agentReviewMode?: AgentReviewMode;
|
|
50
|
+
/**
|
|
51
|
+
* Your review window in days, 2–30 (server default 14). Below 7 only when both
|
|
52
|
+
* parties registered as businesses — otherwise refused with
|
|
53
|
+
* `REVIEW_WINDOW_NEEDS_BUSINESS`. The builder sees it before joining.
|
|
54
|
+
*/
|
|
55
|
+
reviewWindowDays?: number;
|
|
56
|
+
/**
|
|
57
|
+
* The panel decides alone: a YES above 85 % completes, anything else is a
|
|
58
|
+
* rejection the builder can resubmit against — no review by you. Defaults to
|
|
59
|
+
* `agentReviewMode === "AUTO"`; contradicting it is refused (`REVIEW_MODE_CONFLICT`).
|
|
60
|
+
*/
|
|
61
|
+
panelDecidesAlone?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** The review terms as the server stored them — what the builder sees before joining. */
|
|
64
|
+
export interface ReviewTerms {
|
|
65
|
+
reviewWindowDays: number | null;
|
|
66
|
+
reviewWindowHours: number;
|
|
67
|
+
panelDecidesAlone: boolean;
|
|
68
|
+
bothPartiesBusiness: boolean | null;
|
|
69
|
+
en: string[];
|
|
70
|
+
de: string[];
|
|
44
71
|
}
|
|
45
72
|
export interface CreateContractResult {
|
|
46
73
|
contractId: string;
|
|
47
74
|
inviteCode: string | null;
|
|
48
75
|
inviteLink: string | null;
|
|
76
|
+
/** Absent on a server older than 2026-10-20. */
|
|
77
|
+
reviewTerms?: ReviewTerms | null;
|
|
49
78
|
}
|
|
50
79
|
export interface ModelVote {
|
|
51
80
|
model: string;
|
|
@@ -63,10 +92,11 @@ export interface VerificationResult {
|
|
|
63
92
|
* `verdictToStatus` returns — but the verification stream writes two more as
|
|
64
93
|
* literals, deliberately overriding it, and they are the ones that matter most:
|
|
65
94
|
*
|
|
66
|
-
* - `COMPLETED` — the
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
95
|
+
* - `COMPLETED` — the milestone is complete. Since cascrow Phase 6 this is a
|
|
96
|
+
* verification-only milestone, which held no money: nothing was paid out.
|
|
97
|
+
* `alreadyReleased` is true when a concurrent request completed it first.
|
|
98
|
+
* **This is the success case**, and with the old union a consumer switching
|
|
99
|
+
* exhaustively had no arm for it.
|
|
70
100
|
* - `SUPERSEDED` — this verification changed nothing. Either another proof on
|
|
71
101
|
* the same milestone was decided first, or — when `settledAs` is set — the
|
|
72
102
|
* milestone was closed (e.g. `EXPIRED`: the funder cancelled, or the deadline
|
|
@@ -77,17 +107,35 @@ export interface VerificationResult {
|
|
|
77
107
|
* error is the whole point. Before it, the cast below silently produced a value
|
|
78
108
|
* outside the declared type and nothing anywhere said so.
|
|
79
109
|
*
|
|
80
|
-
* `VERIFIED` alone does NOT mean the
|
|
81
|
-
* `
|
|
110
|
+
* `VERIFIED` alone does NOT mean the milestone completed — a verification-only
|
|
111
|
+
* milestone that completes arrives as `COMPLETED`.
|
|
112
|
+
*
|
|
113
|
+
* `NOT_COMPLETABLE_WITHOUT_ESCROW`: the panel approved, but the milestone carries an
|
|
114
|
+
* amount without a MilestoneEscrowV3 escrow (the previous escrow system is removed),
|
|
115
|
+
* so nothing completed it and NO money moved. cascrow has opened a case; contact
|
|
116
|
+
* support and do not resubmit — the next verdict meets the same row. `error` and
|
|
117
|
+
* `remedy` carry the server's sentence.
|
|
118
|
+
*
|
|
119
|
+
* `V3_RECOMMENDATION`: a MilestoneEscrowV3 milestone. The panel's verdict is a
|
|
120
|
+
* recommendation and moves NO money — the payee claims on chain, the payer
|
|
121
|
+
* releases or objects (`manifestHash` is the claim's proofHash).
|
|
82
122
|
*/
|
|
83
|
-
action: "VERIFIED" | "PENDING_REVIEW" | "REJECTED" | "COMPLETED" | "SUPERSEDED";
|
|
84
|
-
/**
|
|
85
|
-
|
|
123
|
+
action: "VERIFIED" | "PENDING_REVIEW" | "REJECTED" | "COMPLETED" | "SUPERSEDED" | "V3_RECOMMENDATION" | "NOT_COMPLETABLE_WITHOUT_ESCROW";
|
|
124
|
+
/** With `NOT_COMPLETABLE_WITHOUT_ESCROW`: what happened, and who can act. */
|
|
125
|
+
error?: string;
|
|
126
|
+
remedy?: string;
|
|
127
|
+
/** With `V3_RECOMMENDATION`: the sealed submission's manifest hash. */
|
|
128
|
+
manifestHash?: string | null;
|
|
86
129
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
130
|
+
* With `V3_RECOMMENDATION`: the SUBMISSION's verdict — YES only when every file in
|
|
131
|
+
* it has a definite AI yes. `decision` is the panel on this one file and is not
|
|
132
|
+
* what a claim is judged by.
|
|
89
133
|
*/
|
|
90
|
-
|
|
134
|
+
submissionVerdict?: "YES" | "NO" | "PENDING";
|
|
135
|
+
/** With `V3_RECOMMENDATION`: true exactly when `submissionVerdict` is YES. */
|
|
136
|
+
claimReady?: boolean;
|
|
137
|
+
/** Set when `action` is `COMPLETED` because another request had already completed it. */
|
|
138
|
+
alreadyReleased?: boolean;
|
|
91
139
|
/** Approved, payout REFUSED by the sanctions gate. No funds moved. */
|
|
92
140
|
complianceBlocked?: boolean;
|
|
93
141
|
/** The panel never reached a verdict (too few models answered). Not a judgement. */
|
|
@@ -146,16 +194,42 @@ export interface RegisterResult {
|
|
|
146
194
|
email: string;
|
|
147
195
|
apiKey: string;
|
|
148
196
|
message: string;
|
|
197
|
+
/**
|
|
198
|
+
* Always `null` since cascrow Phase 5: no wallet is generated at registration.
|
|
199
|
+
* Link your own with GET /api/user/wallet/challenge?address=<your wallet> → sign the
|
|
200
|
+
* Sign-In with Ethereum message → POST /api/user/wallet (or `npx cascrow-signer link`).
|
|
201
|
+
*/
|
|
202
|
+
wallet?: null;
|
|
203
|
+
/** What an account without a wallet cannot do yet, and how to link one. */
|
|
204
|
+
walletNote?: string;
|
|
149
205
|
}
|
|
150
206
|
export interface ReputationResult {
|
|
151
|
-
|
|
207
|
+
/**
|
|
208
|
+
* `null` when the builder has not consented to publishing their track-record
|
|
209
|
+
* figures (since 2026-10-20) — `milestones` then holds what they published one
|
|
210
|
+
* by one. The server answers 404 when nothing at all is public, exactly as for
|
|
211
|
+
* an unknown address. Never read `null` as "no track record".
|
|
212
|
+
*/
|
|
213
|
+
stats: null | {
|
|
152
214
|
/** completed / (completed + failed). Null when there is no track record yet. */
|
|
153
215
|
successRate: number | null;
|
|
154
216
|
milestonesCompleted: number;
|
|
155
217
|
/** Funded milestones that ran out the clock. Not the same as a rejected proof. */
|
|
156
218
|
milestonesFailed: number;
|
|
157
|
-
/**
|
|
219
|
+
/**
|
|
220
|
+
* @deprecated since 0.7.0 — the retired v2 (RLUSD) escrow only; kept with the same
|
|
221
|
+
* value until the next major. Read `totalReleasedUsd`.
|
|
222
|
+
* Fixed-point string, not a number — parse before doing arithmetic.
|
|
223
|
+
*/
|
|
158
224
|
totalRlusdReleased: string;
|
|
225
|
+
/**
|
|
226
|
+
* The value released to this builder, in USD, over every escrow version: v2 at
|
|
227
|
+
* face value, a MilestoneEscrowV3 escrow at the XRP/USD rate frozen when its terms
|
|
228
|
+
* were offered. Fixed-point string. Absent on a server that predates it.
|
|
229
|
+
*/
|
|
230
|
+
totalReleasedUsd?: string;
|
|
231
|
+
/** The native XRP released to this builder by MilestoneEscrowV3 escrows, as a decimal string. */
|
|
232
|
+
totalXrpReleased?: string;
|
|
159
233
|
};
|
|
160
234
|
/**
|
|
161
235
|
* The milestone records this builder has PUBLISHED — not every completed
|
|
@@ -248,6 +322,43 @@ export interface ReviewQueueResult {
|
|
|
248
322
|
/** Unbounded; `contracts` above is capped. */
|
|
249
323
|
total: number;
|
|
250
324
|
truncated: boolean;
|
|
325
|
+
/**
|
|
326
|
+
* MilestoneEscrowV3 claims you, as payer, can still object to — they are NOT
|
|
327
|
+
* decided through this queue. `null` means they could not be counted, never 0.
|
|
328
|
+
* List them with {@link CascrowClient.v3Claims}.
|
|
329
|
+
*/
|
|
330
|
+
v3ClaimsPending?: number | null;
|
|
331
|
+
/** Where the V3 claims are listed. */
|
|
332
|
+
v3Claims?: string;
|
|
333
|
+
}
|
|
334
|
+
/** One MilestoneEscrowV3 claim that releases your escrow unless YOUR wallet objects in time. */
|
|
335
|
+
export interface V3OpenClaim {
|
|
336
|
+
escrowId: string;
|
|
337
|
+
chainId: number;
|
|
338
|
+
/** The escrow contract to call `object(escrowId)` on. */
|
|
339
|
+
escrowContract: string;
|
|
340
|
+
contractId: string;
|
|
341
|
+
milestoneId: string;
|
|
342
|
+
/** Written by the counterparty, marked as such. */
|
|
343
|
+
milestoneTitle: string;
|
|
344
|
+
claimIndex: number;
|
|
345
|
+
proofHash: string | null;
|
|
346
|
+
/** A second escrow under the same terms — a second payment you can still stop. */
|
|
347
|
+
secondFunding: boolean;
|
|
348
|
+
/** The indexer holds this projection back; verify on chain. */
|
|
349
|
+
held: boolean;
|
|
350
|
+
onChainAction: "object";
|
|
351
|
+
/** Null for a held escrow whose claim state the index cannot show — read it on chain. */
|
|
352
|
+
objectionDeadline: string | null;
|
|
353
|
+
/** False once the window (minus a 60 s margin) has closed; null when unknown (held). */
|
|
354
|
+
objectable: boolean | null;
|
|
355
|
+
}
|
|
356
|
+
export interface V3ClaimsResult {
|
|
357
|
+
claims: V3OpenClaim[];
|
|
358
|
+
/** More claims exist than are listed (oldest first). */
|
|
359
|
+
truncated: boolean;
|
|
360
|
+
asOf: string;
|
|
361
|
+
indexedThroughBlock: Record<string, string>;
|
|
251
362
|
}
|
|
252
363
|
export interface CascrowApiError extends Error {
|
|
253
364
|
status: number;
|
|
@@ -260,6 +371,8 @@ export interface CascrowApiError extends Error {
|
|
|
260
371
|
code?: string | null;
|
|
261
372
|
/** How long the server asked you to wait (Retry-After header, else `retry_after_seconds`). */
|
|
262
373
|
retryAfterSeconds?: number | null;
|
|
374
|
+
/** For a MilestoneEscrowV3 refusal code: who can act, and how (also appended to the message). */
|
|
375
|
+
hint?: string;
|
|
263
376
|
/** On a 409 VERIFICATION_IN_PROGRESS: `"running"` (call `waitForProof`) or `"orphaned"` (the run died). */
|
|
264
377
|
phase?: string;
|
|
265
378
|
/** On a 409 VERIFICATION_IN_PROGRESS: where to poll for the verdict. */
|
|
@@ -267,4 +380,36 @@ export interface CascrowApiError extends Error {
|
|
|
267
380
|
/** On a 409 VERIFICATION_IN_PROGRESS with phase `"running"`: roughly when the verdict is due. */
|
|
268
381
|
expectedDoneInSeconds?: number;
|
|
269
382
|
}
|
|
383
|
+
/** `requestHumanReview()`'s answer: a new request, or the one already open on that milestone. */
|
|
384
|
+
export type HumanReviewRequestResult = {
|
|
385
|
+
status: "OPEN";
|
|
386
|
+
requestId: string;
|
|
387
|
+
dueAt: string;
|
|
388
|
+
}
|
|
389
|
+
/** A request on this milestone is already open: nothing to do but wait for its decision by `dueAt`. */
|
|
390
|
+
| {
|
|
391
|
+
status: "ALREADY_OPEN";
|
|
392
|
+
requestId?: undefined;
|
|
393
|
+
dueAt: string | null;
|
|
394
|
+
};
|
|
395
|
+
/** One human-review request on a contract, as `humanReviews()` returns it. */
|
|
396
|
+
export interface HumanReviewEntry {
|
|
397
|
+
id: string;
|
|
398
|
+
milestoneId: string | null;
|
|
399
|
+
/** `PARTY_REQUEST` (a party asked) or `REVIEW_LAPSED` (the funder's review window lapsed without a closing condition). */
|
|
400
|
+
source: "PARTY_REQUEST" | "REVIEW_LAPSED";
|
|
401
|
+
requesterRole: "investor" | "startup" | "system";
|
|
402
|
+
status: "OPEN" | "DECIDED" | "CLOSED";
|
|
403
|
+
dueAt: string;
|
|
404
|
+
createdAt: string;
|
|
405
|
+
decidedAt: string | null;
|
|
406
|
+
/** e.g. COMPLETED, REJECTED, COMPLETION_REVOKED, UPHELD, STATEMENT, CLOSED_FUNDER_DECIDED, WITHDRAWN, SUPERSEDED. */
|
|
407
|
+
outcome: string | null;
|
|
408
|
+
/** The reviewer's statement to both parties. */
|
|
409
|
+
decisionNote: string | null;
|
|
410
|
+
/** True on a request you filed. */
|
|
411
|
+
mine: boolean;
|
|
412
|
+
/** Your own words — only on a request you filed, null otherwise. */
|
|
413
|
+
reason: string | null;
|
|
414
|
+
}
|
|
270
415
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +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,QAA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AChC;AAID,iGAAiG;AACjG,MAAM,MAAM,wBAAwB,GAChC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AACtD,uGAAuG;GACrG;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAE5E,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,0HAA0H;IAC1H,MAAM,EAAE,eAAe,GAAG,eAAe,CAAC;IAC1C,aAAa,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,qHAAqH;IACrH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gDAAgD;IAChD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mCAAmC;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,oEAAoE;IACpE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
|
package/dist/v3.d.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MilestoneEscrowV3, remote half: what cascrow prepares and reads for a party.
|
|
3
|
+
*
|
|
4
|
+
* Nothing in this SDK signs, holds a key or talks to a chain — cascrow never
|
|
5
|
+
* signs, sends or relays a transaction for a party (rule I9), and the SDK's main
|
|
6
|
+
* entry stays free of any keystore or file access. Signing happens in the
|
|
7
|
+
* separate `cascrow-signer` package (pinned below), which checks every prepared
|
|
8
|
+
* transaction against its own pinned chain and contract before it signs.
|
|
9
|
+
*/
|
|
10
|
+
export declare const V3_CLIENT_TEXT: {
|
|
11
|
+
readonly signerPin: "cascrow-signer@0.2.0";
|
|
12
|
+
readonly remoteTools: readonly ["cascrow_v3_offer", "cascrow_v3_acceptance_get", "cascrow_v3_acceptance_submit", "cascrow_v3_prepare", "cascrow_v3_report_tx", "cascrow_v3_attestation", "cascrow_v3_claims"];
|
|
13
|
+
readonly codeHints: {
|
|
14
|
+
readonly V3_DISABLED: "MilestoneEscrowV3 is switched off for NEW money right now (offers, acceptances, funding). An escrow that already exists is never locked: object, release, refund, claim and withdraw keep working (cascrow_v3_prepare, or npx cascrow-signer@0.2.0 without cascrow at all).";
|
|
15
|
+
readonly RATE_UNAVAILABLE: "cascrow could not get a consistent XRP/USD rate from its two sources, so no offer can be priced. Nothing was created; retry in a minute.";
|
|
16
|
+
readonly SCREENING_UNAVAILABLE: "cascrow could not complete the sanctions screening this new-escrow step needs (offer, acceptance or funding), so nothing was created or prepared. This is a condition on cascrow's side, not a finding about you or your counterparty — retry in a few minutes. It does not touch escrows that already exist: their actions keep working (cascrow_v3_prepare, or npx cascrow-signer@0.2.0).";
|
|
17
|
+
readonly V3_NOT_OFFERED: "The payer has not offered MilestoneEscrowV3 terms for this milestone yet — only the payer can (cascrow_v3_offer). The payer has been notified.";
|
|
18
|
+
readonly OFFER_EXISTS: "An open offer already exists for this milestone and stays valid until it expires. Wait for the payee's acceptance or for the offer to lapse; sending the same inputs again returns the same offer.";
|
|
19
|
+
readonly V3_OFFER_OPEN: "An open MilestoneEscrowV3 offer, or a signed acceptance that is not funded yet, is bound to this milestone or wallet, so it cannot change now. Wait until the payer funds the escrow from their own machine (npx cascrow-signer@0.2.0 fund --milestone <milestoneId>) or the offer or acceptance lapses.";
|
|
20
|
+
readonly ATTESTATION_PENDING: "The AI panel has not finished on this claim. Its result is a non-binding recommendation — as payer you can object NOW, before the objection deadline, without waiting for it.";
|
|
21
|
+
readonly CLAIM_PROOF_UNKNOWN: "This claim's proofHash matches no evidence submitted to cascrow, so there is no AI recommendation for it. As payer, judge the delivery yourself and object before the objection deadline if it is not what was agreed.";
|
|
22
|
+
readonly V3_ESCROW: "This milestone is held in a MilestoneEscrowV3 escrow: only its payer, payee or arbiter moves that money, on chain, with their own key. Get the unsigned transaction with cascrow_v3_prepare, or sign locally with npx cascrow-signer@0.2.0.";
|
|
23
|
+
readonly V2_ESCROW_PRESENT: "This milestone or its contract still carries data of the retired v2 (RLUSD) escrow, so it cannot become a MilestoneEscrowV3 escrow. Nothing was changed; contact support.";
|
|
24
|
+
readonly INVALID_SIGNATURE: "The acceptance signature does not verify for your linked wallet over these exact terms (EIP-712, low-s, from an ordinary account). Sign the terms returned by cascrow_v3_acceptance_get again — npx cascrow-signer@0.2.0 accept does it and checks them first.";
|
|
25
|
+
readonly V3_INDEX_STALE: "cascrow's index of the chain is behind. Read the escrow from the chain directly (npx cascrow-signer@0.2.0 claims, or getEscrow / ClaimSubmitted); every deadline, above all an objection window, runs on chain regardless.";
|
|
26
|
+
readonly ACCEPTANCE_LAPSED: "The acceptance expired without funding, so the milestone is closed — this is not a failure of either party. A new attempt is a new milestone.";
|
|
27
|
+
readonly NOT_COMPLETABLE_WITHOUT_ESCROW: "The work was approved, but this milestone carries an amount without a MilestoneEscrowV3 escrow, and the previous escrow system has been removed — nothing can complete or pay it, so it was left as it was and NO money moved. cascrow has opened a case for it; contact support@cascrow.com with the contract ID. Do not resubmit: your evidence is recorded.";
|
|
28
|
+
readonly RELEASE_HOLD_REMOVED: "releaseHoldHours was removed with the previous escrow system; send the contract without it. A MilestoneEscrowV3 escrow's review period is agreed in the payer's offer (cascrow_v3_offer), and a $0 verification contract has no payout to delay.";
|
|
29
|
+
readonly AMOUNT_VIA_MILESTONES: "This draft has milestones, and their amounts are the contract's amount — it cannot be set on the contract. Nothing was changed. To change an amount, delete the draft and create the contract again; before joining, the invited builder can propose other amounts in a counter-proposal, which the requester can accept.";
|
|
30
|
+
readonly DEADLINE_VIA_MILESTONES: "This draft has milestones, and their deadlines are the ones enforced — a contract-level deadline changes nothing, so it is refused. Nothing was changed. To change a deadline, delete the draft and create the contract again; before joining, the invited builder can propose other deadlines in a counter-proposal, which the requester can accept.";
|
|
31
|
+
readonly MIXED_AMOUNTS: "A contract is either verification-only (every milestone $0) or escrowed (every milestone above $0), never both. Nothing was created or changed. Set every milestone to $0, or give every milestone an amount and fund each one through a MilestoneEscrowV3 offer (cascrow_v3_offer) once the builder has joined.";
|
|
32
|
+
};
|
|
33
|
+
readonly joined: {
|
|
34
|
+
readonly active: "Joined as Builder. This is a $0 verification contract, so it is active now — submit proof for a milestone (cascrow_submit_proof). No money is held or moved.";
|
|
35
|
+
readonly awaitingOffer: "Joined as Builder. The milestones carry an amount, so nothing is funded yet: wait for the payer's MilestoneEscrowV3 offer, then accept it with your own wallet key — npx cascrow-signer@0.2.0 accept --milestone <milestoneId>, or on the contract page. cascrow never signs for you. Submit proof once the payer has funded the milestone.";
|
|
36
|
+
readonly unknown: "Joined as Builder. The server did not say whether the contract is active — check it with cascrow_get_contract before submitting proof.";
|
|
37
|
+
};
|
|
38
|
+
readonly payeeHints: {
|
|
39
|
+
readonly CLAIM_PROOF_UNKNOWN: "This manifest is not a sealed submission of this milestone, so cascrow will not confirm it and nothing was signed. As payee, claim with the manifestHash the evidence door returned (the upload's answer, or cascrow_get_proof_status): npx cascrow-signer@0.2.0 submit-claim --milestone <milestoneId> --proof-hash <manifestHash>.";
|
|
40
|
+
};
|
|
41
|
+
readonly fundRemoved: "cascrow_fund_milestone was removed (and with it fundMilestone in cascrow-sdk and `cascrow fund`). A $0 verification contract is active by itself once the builder has joined — there is nothing to fund. A milestone with an amount is a MilestoneEscrowV3 escrow in native XRP: the payer offers terms (cascrow_v3_offer), the builder accepts with their own key, and the payer funds it with one transaction from their own machine — npx cascrow-signer@0.2.0 fund --milestone <milestoneId>. cascrow never signs or sends for you.";
|
|
42
|
+
readonly recommendation: "🧭 AI RECOMMENDATION {verdict} for this MilestoneEscrowV3 submission ({confidence}% confidence on this file) — this verdict moves NO money. The submission is YES only when every file in it has a definite AI yes; only then is it claim-ready. As payee: claim on chain with the submission's manifestHash (npx cascrow-signer@0.2.0 submit-claim --milestone <milestoneId> --proof-hash <manifestHash>). As payer: release, or object before the objection deadline.";
|
|
43
|
+
readonly noArbiterVeto: "No arbiter is named. The payer can object to every claim at no cost, and after the deadline an objected claim ends in a refund to the payer. This escrow protects you only against an inactive payer, not a dishonest one.";
|
|
44
|
+
readonly reportTxOnlyHash: "cascrow_v3_report_tx takes a transaction HASH (0x + 64 hex characters) and nothing else. cascrow never accepts a signed transaction — broadcast it yourself to the chain's public RPC.";
|
|
45
|
+
};
|
|
46
|
+
/** The version of the local signer this SDK's docs and hints point to. */
|
|
47
|
+
export declare const CASCROW_SIGNER_PIN: "cascrow-signer@0.2.0";
|
|
48
|
+
/**
|
|
49
|
+
* What a V3 refusal code means for the caller, or null for a code that is not a V3
|
|
50
|
+
* one. Role-aware (post-review H9): `CLAIM_PROOF_UNKNOWN` without `objectionDeadline`
|
|
51
|
+
* in the body comes from `prepare?action=submitClaim` and reaches the PAYEE; with it,
|
|
52
|
+
* the claim is live and the remedy is the payer's objection.
|
|
53
|
+
*/
|
|
54
|
+
export declare function v3HintFor(code: string | null | undefined, body?: unknown): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* The sentence for a `joinContract` answer: `activated: true` — a $0 contract, active
|
|
57
|
+
* now; `false` — a money contract waiting for the payer's MilestoneEscrowV3 offer, which
|
|
58
|
+
* the builder accepts with their own key; anything else — the server did not say.
|
|
59
|
+
*/
|
|
60
|
+
export declare function joinedLine(body: unknown): string;
|
|
61
|
+
/** The fields of a V3 refusal body its recipient acts on, as one line, or "" (post-review G5). */
|
|
62
|
+
export declare function v3RefusalDetail(body: unknown): string;
|
|
63
|
+
export type V3Action = "fund" | "submitClaim" | "claim" | "release" | "object" | "refund" | "extendDeadline" | "returnFunds" | "withdraw";
|
|
64
|
+
/**
|
|
65
|
+
* An UNSIGNED transaction from `GET /api/escrow/v3/prepare`. Before signing, rebuild
|
|
66
|
+
* `data` from the contract ABI and check `to` and `chainId` against YOUR OWN
|
|
67
|
+
* configuration — never against this object (cascrow-signer does both).
|
|
68
|
+
*/
|
|
69
|
+
export interface V3PreparedTx {
|
|
70
|
+
chainId: number;
|
|
71
|
+
to: string;
|
|
72
|
+
/** Wei, as a decimal string. Non-zero only for `fund`. */
|
|
73
|
+
value: string;
|
|
74
|
+
data: string;
|
|
75
|
+
call: {
|
|
76
|
+
fn: string;
|
|
77
|
+
args: unknown[];
|
|
78
|
+
};
|
|
79
|
+
escrowId: string;
|
|
80
|
+
action: V3Action;
|
|
81
|
+
role: string;
|
|
82
|
+
expect: {
|
|
83
|
+
phase: string;
|
|
84
|
+
from: string;
|
|
85
|
+
};
|
|
86
|
+
deadline?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface V3OfferInput {
|
|
89
|
+
milestoneId: string;
|
|
90
|
+
/** Your objection window after each claim, seconds (at least 3600; 24 h only with watcherDeclared). */
|
|
91
|
+
reviewPeriodSec: number;
|
|
92
|
+
/** true only if you run a watcher that objects in time. */
|
|
93
|
+
watcherDeclared: boolean;
|
|
94
|
+
arbiter?: string;
|
|
95
|
+
arbitrationPeriodSec?: number;
|
|
96
|
+
}
|
|
97
|
+
export interface V3AcceptanceData {
|
|
98
|
+
offerId: string;
|
|
99
|
+
escrowId: string;
|
|
100
|
+
payer: string;
|
|
101
|
+
ref: string;
|
|
102
|
+
salt: string;
|
|
103
|
+
amountWei: string;
|
|
104
|
+
acceptBy: string;
|
|
105
|
+
offerExpiresAt?: string;
|
|
106
|
+
rate?: {
|
|
107
|
+
usdPerXrp: string;
|
|
108
|
+
sources: unknown[];
|
|
109
|
+
at: string;
|
|
110
|
+
};
|
|
111
|
+
typedData: {
|
|
112
|
+
domain: Record<string, unknown>;
|
|
113
|
+
types: Record<string, {
|
|
114
|
+
name: string;
|
|
115
|
+
type: string;
|
|
116
|
+
}[]>;
|
|
117
|
+
primaryType: string;
|
|
118
|
+
message: Record<string, unknown>;
|
|
119
|
+
};
|
|
120
|
+
[k: string]: unknown;
|
|
121
|
+
}
|
|
122
|
+
export interface V3Attestation {
|
|
123
|
+
attestation: Record<string, unknown>;
|
|
124
|
+
signature: string;
|
|
125
|
+
signer: string;
|
|
126
|
+
domain: Record<string, unknown>;
|
|
127
|
+
[k: string]: unknown;
|
|
128
|
+
}
|
|
129
|
+
export declare const TX_HASH_RE: RegExp;
|
|
130
|
+
//# sourceMappingURL=v3.d.ts.map
|
package/dist/v3.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3.d.ts","sourceRoot":"","sources":["../src/v3.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CjB,CAAC;AAGX,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,wBAA2B,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOxF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAKhD;AAED,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CASrD;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,gBAAgB,GAAG,aAAa,GAAG,UAAU,CAAC;AAE1I;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAA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EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAC/J,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,QAAwB,CAAC"}
|
package/dist/v3.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MilestoneEscrowV3, remote half: what cascrow prepares and reads for a party.
|
|
3
|
+
*
|
|
4
|
+
* Nothing in this SDK signs, holds a key or talks to a chain — cascrow never
|
|
5
|
+
* signs, sends or relays a transaction for a party (rule I9), and the SDK's main
|
|
6
|
+
* entry stays free of any keystore or file access. Signing happens in the
|
|
7
|
+
* separate `cascrow-signer` package (pinned below), which checks every prepared
|
|
8
|
+
* transaction against its own pinned chain and contract before it signs.
|
|
9
|
+
*/
|
|
10
|
+
// What every cascrow client says about MilestoneEscrowV3 — a JSON copy of
|
|
11
|
+
// V3_CLIENT_TEXT in src/lib/v3-client-text.ts (this package cannot import the
|
|
12
|
+
// app). v3-client-text-parity.test.ts holds the copy equal to the owner.
|
|
13
|
+
// BEGIN v3-client-text
|
|
14
|
+
export const V3_CLIENT_TEXT = {
|
|
15
|
+
"signerPin": "cascrow-signer@0.2.0",
|
|
16
|
+
"remoteTools": [
|
|
17
|
+
"cascrow_v3_offer",
|
|
18
|
+
"cascrow_v3_acceptance_get",
|
|
19
|
+
"cascrow_v3_acceptance_submit",
|
|
20
|
+
"cascrow_v3_prepare",
|
|
21
|
+
"cascrow_v3_report_tx",
|
|
22
|
+
"cascrow_v3_attestation",
|
|
23
|
+
"cascrow_v3_claims"
|
|
24
|
+
],
|
|
25
|
+
"codeHints": {
|
|
26
|
+
"V3_DISABLED": "MilestoneEscrowV3 is switched off for NEW money right now (offers, acceptances, funding). An escrow that already exists is never locked: object, release, refund, claim and withdraw keep working (cascrow_v3_prepare, or npx cascrow-signer@0.2.0 without cascrow at all).",
|
|
27
|
+
"RATE_UNAVAILABLE": "cascrow could not get a consistent XRP/USD rate from its two sources, so no offer can be priced. Nothing was created; retry in a minute.",
|
|
28
|
+
"SCREENING_UNAVAILABLE": "cascrow could not complete the sanctions screening this new-escrow step needs (offer, acceptance or funding), so nothing was created or prepared. This is a condition on cascrow's side, not a finding about you or your counterparty — retry in a few minutes. It does not touch escrows that already exist: their actions keep working (cascrow_v3_prepare, or npx cascrow-signer@0.2.0).",
|
|
29
|
+
"V3_NOT_OFFERED": "The payer has not offered MilestoneEscrowV3 terms for this milestone yet — only the payer can (cascrow_v3_offer). The payer has been notified.",
|
|
30
|
+
"OFFER_EXISTS": "An open offer already exists for this milestone and stays valid until it expires. Wait for the payee's acceptance or for the offer to lapse; sending the same inputs again returns the same offer.",
|
|
31
|
+
"V3_OFFER_OPEN": "An open MilestoneEscrowV3 offer, or a signed acceptance that is not funded yet, is bound to this milestone or wallet, so it cannot change now. Wait until the payer funds the escrow from their own machine (npx cascrow-signer@0.2.0 fund --milestone <milestoneId>) or the offer or acceptance lapses.",
|
|
32
|
+
"ATTESTATION_PENDING": "The AI panel has not finished on this claim. Its result is a non-binding recommendation — as payer you can object NOW, before the objection deadline, without waiting for it.",
|
|
33
|
+
"CLAIM_PROOF_UNKNOWN": "This claim's proofHash matches no evidence submitted to cascrow, so there is no AI recommendation for it. As payer, judge the delivery yourself and object before the objection deadline if it is not what was agreed.",
|
|
34
|
+
"V3_ESCROW": "This milestone is held in a MilestoneEscrowV3 escrow: only its payer, payee or arbiter moves that money, on chain, with their own key. Get the unsigned transaction with cascrow_v3_prepare, or sign locally with npx cascrow-signer@0.2.0.",
|
|
35
|
+
"V2_ESCROW_PRESENT": "This milestone or its contract still carries data of the retired v2 (RLUSD) escrow, so it cannot become a MilestoneEscrowV3 escrow. Nothing was changed; contact support.",
|
|
36
|
+
"INVALID_SIGNATURE": "The acceptance signature does not verify for your linked wallet over these exact terms (EIP-712, low-s, from an ordinary account). Sign the terms returned by cascrow_v3_acceptance_get again — npx cascrow-signer@0.2.0 accept does it and checks them first.",
|
|
37
|
+
"V3_INDEX_STALE": "cascrow's index of the chain is behind. Read the escrow from the chain directly (npx cascrow-signer@0.2.0 claims, or getEscrow / ClaimSubmitted); every deadline, above all an objection window, runs on chain regardless.",
|
|
38
|
+
"ACCEPTANCE_LAPSED": "The acceptance expired without funding, so the milestone is closed — this is not a failure of either party. A new attempt is a new milestone.",
|
|
39
|
+
"NOT_COMPLETABLE_WITHOUT_ESCROW": "The work was approved, but this milestone carries an amount without a MilestoneEscrowV3 escrow, and the previous escrow system has been removed — nothing can complete or pay it, so it was left as it was and NO money moved. cascrow has opened a case for it; contact support@cascrow.com with the contract ID. Do not resubmit: your evidence is recorded.",
|
|
40
|
+
"RELEASE_HOLD_REMOVED": "releaseHoldHours was removed with the previous escrow system; send the contract without it. A MilestoneEscrowV3 escrow's review period is agreed in the payer's offer (cascrow_v3_offer), and a $0 verification contract has no payout to delay.",
|
|
41
|
+
"AMOUNT_VIA_MILESTONES": "This draft has milestones, and their amounts are the contract's amount — it cannot be set on the contract. Nothing was changed. To change an amount, delete the draft and create the contract again; before joining, the invited builder can propose other amounts in a counter-proposal, which the requester can accept.",
|
|
42
|
+
"DEADLINE_VIA_MILESTONES": "This draft has milestones, and their deadlines are the ones enforced — a contract-level deadline changes nothing, so it is refused. Nothing was changed. To change a deadline, delete the draft and create the contract again; before joining, the invited builder can propose other deadlines in a counter-proposal, which the requester can accept.",
|
|
43
|
+
"MIXED_AMOUNTS": "A contract is either verification-only (every milestone $0) or escrowed (every milestone above $0), never both. Nothing was created or changed. Set every milestone to $0, or give every milestone an amount and fund each one through a MilestoneEscrowV3 offer (cascrow_v3_offer) once the builder has joined."
|
|
44
|
+
},
|
|
45
|
+
"joined": {
|
|
46
|
+
"active": "Joined as Builder. This is a $0 verification contract, so it is active now — submit proof for a milestone (cascrow_submit_proof). No money is held or moved.",
|
|
47
|
+
"awaitingOffer": "Joined as Builder. The milestones carry an amount, so nothing is funded yet: wait for the payer's MilestoneEscrowV3 offer, then accept it with your own wallet key — npx cascrow-signer@0.2.0 accept --milestone <milestoneId>, or on the contract page. cascrow never signs for you. Submit proof once the payer has funded the milestone.",
|
|
48
|
+
"unknown": "Joined as Builder. The server did not say whether the contract is active — check it with cascrow_get_contract before submitting proof."
|
|
49
|
+
},
|
|
50
|
+
"payeeHints": {
|
|
51
|
+
"CLAIM_PROOF_UNKNOWN": "This manifest is not a sealed submission of this milestone, so cascrow will not confirm it and nothing was signed. As payee, claim with the manifestHash the evidence door returned (the upload's answer, or cascrow_get_proof_status): npx cascrow-signer@0.2.0 submit-claim --milestone <milestoneId> --proof-hash <manifestHash>."
|
|
52
|
+
},
|
|
53
|
+
"fundRemoved": "cascrow_fund_milestone was removed (and with it fundMilestone in cascrow-sdk and `cascrow fund`). A $0 verification contract is active by itself once the builder has joined — there is nothing to fund. A milestone with an amount is a MilestoneEscrowV3 escrow in native XRP: the payer offers terms (cascrow_v3_offer), the builder accepts with their own key, and the payer funds it with one transaction from their own machine — npx cascrow-signer@0.2.0 fund --milestone <milestoneId>. cascrow never signs or sends for you.",
|
|
54
|
+
"recommendation": "🧭 AI RECOMMENDATION {verdict} for this MilestoneEscrowV3 submission ({confidence}% confidence on this file) — this verdict moves NO money. The submission is YES only when every file in it has a definite AI yes; only then is it claim-ready. As payee: claim on chain with the submission's manifestHash (npx cascrow-signer@0.2.0 submit-claim --milestone <milestoneId> --proof-hash <manifestHash>). As payer: release, or object before the objection deadline.",
|
|
55
|
+
"noArbiterVeto": "No arbiter is named. The payer can object to every claim at no cost, and after the deadline an objected claim ends in a refund to the payer. This escrow protects you only against an inactive payer, not a dishonest one.",
|
|
56
|
+
"reportTxOnlyHash": "cascrow_v3_report_tx takes a transaction HASH (0x + 64 hex characters) and nothing else. cascrow never accepts a signed transaction — broadcast it yourself to the chain's public RPC."
|
|
57
|
+
};
|
|
58
|
+
// END v3-client-text
|
|
59
|
+
/** The version of the local signer this SDK's docs and hints point to. */
|
|
60
|
+
export const CASCROW_SIGNER_PIN = V3_CLIENT_TEXT.signerPin;
|
|
61
|
+
/**
|
|
62
|
+
* What a V3 refusal code means for the caller, or null for a code that is not a V3
|
|
63
|
+
* one. Role-aware (post-review H9): `CLAIM_PROOF_UNKNOWN` without `objectionDeadline`
|
|
64
|
+
* in the body comes from `prepare?action=submitClaim` and reaches the PAYEE; with it,
|
|
65
|
+
* the claim is live and the remedy is the payer's objection.
|
|
66
|
+
*/
|
|
67
|
+
export function v3HintFor(code, body) {
|
|
68
|
+
if (!code)
|
|
69
|
+
return null;
|
|
70
|
+
const b = body && typeof body === "object" ? body : null;
|
|
71
|
+
const liveClaim = !!b && typeof b.objectionDeadline === "string";
|
|
72
|
+
const payee = V3_CLIENT_TEXT.payeeHints[code];
|
|
73
|
+
if (payee && b && !liveClaim)
|
|
74
|
+
return payee;
|
|
75
|
+
return V3_CLIENT_TEXT.codeHints[code] ?? null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The sentence for a `joinContract` answer: `activated: true` — a $0 contract, active
|
|
79
|
+
* now; `false` — a money contract waiting for the payer's MilestoneEscrowV3 offer, which
|
|
80
|
+
* the builder accepts with their own key; anything else — the server did not say.
|
|
81
|
+
*/
|
|
82
|
+
export function joinedLine(body) {
|
|
83
|
+
const activated = body && typeof body === "object" ? body.activated : undefined;
|
|
84
|
+
if (activated === true)
|
|
85
|
+
return V3_CLIENT_TEXT.joined.active;
|
|
86
|
+
if (activated === false)
|
|
87
|
+
return V3_CLIENT_TEXT.joined.awaitingOffer;
|
|
88
|
+
return V3_CLIENT_TEXT.joined.unknown;
|
|
89
|
+
}
|
|
90
|
+
/** The fields of a V3 refusal body its recipient acts on, as one line, or "" (post-review G5). */
|
|
91
|
+
export function v3RefusalDetail(body) {
|
|
92
|
+
if (!body || typeof body !== "object")
|
|
93
|
+
return "";
|
|
94
|
+
const b = body;
|
|
95
|
+
const out = [];
|
|
96
|
+
if (typeof b.remedy === "string" && b.remedy)
|
|
97
|
+
out.push(b.remedy);
|
|
98
|
+
if (Array.isArray(b.allowed))
|
|
99
|
+
out.push(`Allowed now: ${b.allowed.length ? b.allowed.map(String).join(", ") : "nothing"}.`);
|
|
100
|
+
if (typeof b.objectionDeadline === "string" && b.objectionDeadline)
|
|
101
|
+
out.push(`Objection deadline: ${b.objectionDeadline}.`);
|
|
102
|
+
if (typeof b.offerExpiresAt === "string" && b.offerExpiresAt)
|
|
103
|
+
out.push(`Open offer expires: ${b.offerExpiresAt}.`);
|
|
104
|
+
return out.join(" ");
|
|
105
|
+
}
|
|
106
|
+
export const TX_HASH_RE = /^0x[0-9a-fA-F]{64}$/;
|
|
107
|
+
//# sourceMappingURL=v3.js.map
|
package/dist/v3.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3.js","sourceRoot":"","sources":["../src/v3.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,0EAA0E;AAC1E,8EAA8E;AAC9E,yEAAyE;AACzE,uBAAuB;AACvB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,WAAW,EAAE,sBAAsB;IACnC,aAAa,EAAE;QACb,kBAAkB;QAClB,2BAA2B;QAC3B,8BAA8B;QAC9B,oBAAoB;QACpB,sBAAsB;QACtB,wBAAwB;QACxB,mBAAmB;KACpB;IACD,WAAW,EAAE;QACX,aAAa,EAAE,6QAA6Q;QAC5R,kBAAkB,EAAE,0IAA0I;QAC9J,uBAAuB,EAAE,6XAA6X;QACtZ,gBAAgB,EAAE,gJAAgJ;QAClK,cAAc,EAAE,oMAAoM;QACpN,eAAe,EAAE,0SAA0S;QAC3T,qBAAqB,EAAE,+KAA+K;Q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,CAAC,CAAC,cAAc;QAAE,GAAG,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,cAAc,GAAG,CAAC,CAAC;IACnH,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAuDD,MAAM,CAAC,MAAM,UAAU,GAAG,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cascrow-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "TypeScript client for the Cascrow API — trust infrastructure for the agent economy: AI verification, on-chain reputation, and milestone escrow
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "TypeScript client for the Cascrow API — trust infrastructure for the agent economy: AI verification, on-chain reputation, and non-custodial milestone escrow (MilestoneEscrowV3, native XRP)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|