@mcsherrylabs/evolver-mcp 0.12.0 → 0.14.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/application-signer.d.ts +16 -0
- package/dist/application-signer.d.ts.map +1 -0
- package/dist/application-signer.js +55 -0
- package/dist/application-signer.js.map +1 -0
- package/dist/approved-request.d.ts +30 -0
- package/dist/approved-request.d.ts.map +1 -0
- package/dist/approved-request.js +167 -0
- package/dist/approved-request.js.map +1 -0
- package/dist/attachment-tools.d.ts +3 -0
- package/dist/attachment-tools.d.ts.map +1 -0
- package/dist/attachment-tools.js +32 -0
- package/dist/attachment-tools.js.map +1 -0
- package/dist/attachments.d.ts +41 -0
- package/dist/attachments.d.ts.map +1 -0
- package/dist/attachments.js +458 -0
- package/dist/attachments.js.map +1 -0
- package/dist/content-file-tools.d.ts +3 -0
- package/dist/content-file-tools.d.ts.map +1 -0
- package/dist/content-file-tools.js +67 -0
- package/dist/content-file-tools.js.map +1 -0
- package/dist/content-files.d.ts +32 -0
- package/dist/content-files.d.ts.map +1 -0
- package/dist/content-files.js +79 -0
- package/dist/content-files.js.map +1 -0
- package/dist/content-ranges.d.ts +41 -0
- package/dist/content-ranges.d.ts.map +1 -0
- package/dist/content-ranges.js +75 -0
- package/dist/content-ranges.js.map +1 -0
- package/dist/files.d.ts +60 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +355 -0
- package/dist/files.js.map +1 -0
- package/dist/group-crypto-tools.d.ts +3 -0
- package/dist/group-crypto-tools.d.ts.map +1 -0
- package/dist/group-crypto-tools.js +47 -0
- package/dist/group-crypto-tools.js.map +1 -0
- package/dist/group-crypto.d.ts +24 -0
- package/dist/group-crypto.d.ts.map +1 -0
- package/dist/group-crypto.js +135 -0
- package/dist/group-crypto.js.map +1 -0
- package/dist/group-key-provider.d.ts +30 -0
- package/dist/group-key-provider.d.ts.map +1 -0
- package/dist/group-key-provider.js +72 -0
- package/dist/group-key-provider.js.map +1 -0
- package/dist/group-keys.d.ts +34 -0
- package/dist/group-keys.d.ts.map +1 -0
- package/dist/group-keys.js +88 -0
- package/dist/group-keys.js.map +1 -0
- package/dist/http-profiles.d.ts +47 -0
- package/dist/http-profiles.d.ts.map +1 -0
- package/dist/http-profiles.js +161 -0
- package/dist/http-profiles.js.map +1 -0
- package/dist/human-approval.d.ts +14 -0
- package/dist/human-approval.d.ts.map +1 -0
- package/dist/human-approval.js +34 -0
- package/dist/human-approval.js.map +1 -0
- package/dist/inbox.d.ts +1 -1
- package/dist/inbox.d.ts.map +1 -1
- package/dist/inbox.js +1 -1
- package/dist/inbox.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +94 -41
- package/dist/index.js.map +1 -1
- package/dist/login-profiles.d.ts +25 -0
- package/dist/login-profiles.d.ts.map +1 -0
- package/dist/login-profiles.js +77 -0
- package/dist/login-profiles.js.map +1 -0
- package/dist/login-tools.d.ts +3 -0
- package/dist/login-tools.d.ts.map +1 -0
- package/dist/login-tools.js +27 -0
- package/dist/login-tools.js.map +1 -0
- package/dist/login.d.ts +36 -0
- package/dist/login.d.ts.map +1 -0
- package/dist/login.js +144 -0
- package/dist/login.js.map +1 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.d.ts.map +1 -1
- package/dist/p2p-tools.d.ts +3 -0
- package/dist/p2p-tools.d.ts.map +1 -0
- package/dist/p2p-tools.js +52 -0
- package/dist/p2p-tools.js.map +1 -0
- package/dist/p2p.d.ts +67 -0
- package/dist/p2p.d.ts.map +1 -0
- package/dist/p2p.js +326 -0
- package/dist/p2p.js.map +1 -0
- package/dist/processor.d.ts +1 -1
- package/dist/processor.d.ts.map +1 -1
- package/dist/processor.js +1 -1
- package/dist/processor.js.map +1 -1
- package/dist/proof-attempts.d.ts +19 -0
- package/dist/proof-attempts.d.ts.map +1 -0
- package/dist/proof-attempts.js +30 -0
- package/dist/proof-attempts.js.map +1 -0
- package/dist/signed-http-tools.d.ts +3 -0
- package/dist/signed-http-tools.d.ts.map +1 -0
- package/dist/signed-http-tools.js +33 -0
- package/dist/signed-http-tools.js.map +1 -0
- package/dist/signed-http.d.ts +30 -0
- package/dist/signed-http.d.ts.map +1 -0
- package/dist/signed-http.js +114 -0
- package/dist/signed-http.js.map +1 -0
- package/dist/tools.d.ts +29 -4
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +24 -10
- package/dist/tools.js.map +1 -1
- package/dist/transaction-interchange-tools.d.ts +3 -0
- package/dist/transaction-interchange-tools.d.ts.map +1 -0
- package/dist/transaction-interchange-tools.js +41 -0
- package/dist/transaction-interchange-tools.js.map +1 -0
- package/dist/transaction-interchange.d.ts +141 -0
- package/dist/transaction-interchange.d.ts.map +1 -0
- package/dist/transaction-interchange.js +502 -0
- package/dist/transaction-interchange.js.map +1 -0
- package/dist/transaction-policy.d.ts +32 -0
- package/dist/transaction-policy.d.ts.map +1 -0
- package/dist/transaction-policy.js +89 -0
- package/dist/transaction-policy.js.map +1 -0
- package/package.json +7 -18
- package/dist/amount.d.ts +0 -23
- package/dist/amount.d.ts.map +0 -1
- package/dist/amount.js +0 -53
- package/dist/amount.js.map +0 -1
- package/dist/channel.d.ts +0 -77
- package/dist/channel.d.ts.map +0 -1
- package/dist/channel.js +0 -287
- package/dist/channel.js.map +0 -1
- package/dist/claim.d.ts +0 -48
- package/dist/claim.d.ts.map +0 -1
- package/dist/claim.js +0 -81
- package/dist/claim.js.map +0 -1
- package/dist/content.d.ts +0 -81
- package/dist/content.d.ts.map +0 -1
- package/dist/content.js +0 -215
- package/dist/content.js.map +0 -1
- package/dist/group-ownership.d.ts +0 -78
- package/dist/group-ownership.d.ts.map +0 -1
- package/dist/group-ownership.js +0 -325
- package/dist/group-ownership.js.map +0 -1
- package/dist/group.d.ts +0 -60
- package/dist/group.d.ts.map +0 -1
- package/dist/group.js +0 -204
- package/dist/group.js.map +0 -1
- package/dist/identity.d.ts +0 -87
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js +0 -236
- package/dist/identity.js.map +0 -1
- package/dist/read.d.ts +0 -252
- package/dist/read.d.ts.map +0 -1
- package/dist/read.js +0 -320
- package/dist/read.js.map +0 -1
- package/dist/result.d.ts +0 -110
- package/dist/result.d.ts.map +0 -1
- package/dist/result.js +0 -97
- package/dist/result.js.map +0 -1
- package/dist/signer.d.ts +0 -37
- package/dist/signer.d.ts.map +0 -1
- package/dist/signer.js +0 -76
- package/dist/signer.js.map +0 -1
- package/dist/write.d.ts +0 -208
- package/dist/write.d.ts.map +0 -1
- package/dist/write.js +0 -385
- package/dist/write.js.map +0 -1
package/dist/write.js
DELETED
|
@@ -1,385 +0,0 @@
|
|
|
1
|
-
// Signing and submitting, as two capabilities that never fuse.
|
|
2
|
-
//
|
|
3
|
-
// `signTransfer` produces a transaction that has gone nowhere (SIGN-20: a `txId`, NO submit).
|
|
4
|
-
// `submitSigned` sends one this session already signed, refusing anything else (SUBM-08) and
|
|
5
|
-
// refusing a repeat (SAFE-01). The ledger is pinned (LEDGER.identity) so no caller-chosen ledger
|
|
6
|
-
// ever reaches the signed bytes — a signing tool composes what it signs from named, typed fields
|
|
7
|
-
// and chooses the ledger itself.
|
|
8
|
-
//
|
|
9
|
-
// The two-step contract is STRUCTURAL, not advisory: an in-memory record of what THIS session
|
|
10
|
-
// signed is what `submitSigned` resolves a `txId` against, and what `inspectSigned` (READ-05)
|
|
11
|
-
// answers from. A description telling the model "don't re-sign" competes with chain text the
|
|
12
|
-
// model reads by design, so the guards are here, in code.
|
|
13
|
-
import { LEDGER, buildSignedTx, transferBody, txIdHex, channelBody, hexToBytes, CORE_LEDGER_IDS, RESERVED_LEDGER_PREFIX, } from "@mcsherrylabs/evolver-client";
|
|
14
|
-
// ONE hex decoder, re-exported: the SDK's `hexToBytes` (which refuses non-hex rather than coercing).
|
|
15
|
-
// `signOpaque` and the identity verbs both use it — a second hand-rolled decoder is the bug class.
|
|
16
|
-
export { hexToBytes };
|
|
17
|
-
import { formatAmount, parseAmount } from "./amount.js";
|
|
18
|
-
import { classifySubmit } from "./result.js";
|
|
19
|
-
/** Rounds of life given to a signed transaction.
|
|
20
|
-
*
|
|
21
|
-
* ⚠️ SHORT ON PURPOSE. A signed transaction is a bearer artefact: valid until it expires,
|
|
22
|
-
* submission unauthenticated, no cancel. Nothing here waits on a human between signing and
|
|
23
|
-
* submitting, so a long window buys nothing and leaves a live artefact in a transcript. */
|
|
24
|
-
export const DEFAULT_TTL_OFFSET = 50;
|
|
25
|
-
/** The largest body `signOpaque` will sign, in bytes: the node's HTTP request cap (65536) less
|
|
26
|
-
* room for the transaction envelope. An oversized POST is refused by the listener before the
|
|
27
|
-
* node reads it, unreadably, so the outcome would arrive as `unknown` after submit already marked
|
|
28
|
-
* the id sent — a dead end. Refusing here is free and names the bound. */
|
|
29
|
-
const MAX_BODY_BYTES = 65536 - 1024;
|
|
30
|
-
/** A channel id a caller may write to — NOT a core ledger, NOT the reserved namespace.
|
|
31
|
-
*
|
|
32
|
-
* ⚠️ CASE-INSENSITIVE ON PURPOSE, AND NOT BECAUSE THE NODE IS. The node compares ledger ids
|
|
33
|
-
* exactly, but refusing every casing costs nothing and removes a whole class of bypass that opens
|
|
34
|
-
* the moment anything in the path normalises case. This refusal is the only thing between a
|
|
35
|
-
* caller and the node's own interpreters. This single refusal is EXPORTED so `src/channel.ts`
|
|
36
|
-
* imports and REUSES it verbatim — never re-implements it (single dispatch-safety rule). */
|
|
37
|
-
export function writableChannelId(raw) {
|
|
38
|
-
const id = String(raw ?? "").trim();
|
|
39
|
-
if (id.length === 0)
|
|
40
|
-
return { kind: "partial", what: "channel", cause: "no channel given" };
|
|
41
|
-
const lower = id.toLowerCase();
|
|
42
|
-
if (CORE_LEDGER_IDS.some((c) => c.toLowerCase() === lower))
|
|
43
|
-
return {
|
|
44
|
-
kind: "partial",
|
|
45
|
-
what: "channel",
|
|
46
|
-
cause: `"${id}" is a CORE ledger, not a channel. Writing to it would not be an opaque message — ` +
|
|
47
|
-
`the node parses that ledger's bodies and applies what it finds, so these bytes could be a ` +
|
|
48
|
-
`transfer or key registration signed as this identity. Refused before anything was signed.`,
|
|
49
|
-
};
|
|
50
|
-
if (lower.startsWith(RESERVED_LEDGER_PREFIX))
|
|
51
|
-
return {
|
|
52
|
-
kind: "partial",
|
|
53
|
-
what: "channel",
|
|
54
|
-
cause: `"${id}" is in the reserved "${RESERVED_LEDGER_PREFIX}" namespace, which belongs to the node's own ledgers. A channel lives outside it.`,
|
|
55
|
-
};
|
|
56
|
-
return id;
|
|
57
|
-
}
|
|
58
|
-
// ── session stores ────────────────────────────────────────────────────────────
|
|
59
|
-
//
|
|
60
|
-
// Three maps, two audiences. The RECORD (`signedThisSession`) is intent: what `inspectSigned`
|
|
61
|
-
// answers from. The BYTES (`bytesThisSession`, base64) are the bearer artefact submitted to the
|
|
62
|
-
// chain. They are deliberately separate so the transaction id is the only lookup key and the
|
|
63
|
-
// base64 never reaches a signing or inspection result (~86 KB each otherwise). `alreadySubmitted`
|
|
64
|
-
// is the "never twice" guard.
|
|
65
|
-
const signedThisSession = new Map();
|
|
66
|
-
const alreadySubmitted = new Set();
|
|
67
|
-
const bytesThisSession = new Map();
|
|
68
|
-
/** A transaction id as a lookup key. Ids are lowercase hex, but a model retyping one should not
|
|
69
|
-
* fail on case or a stray space. */
|
|
70
|
-
const asKey = (txId) => String(txId ?? "").trim().toLowerCase();
|
|
71
|
-
/** A caller-supplied id, safe to name in a refusal. Echoing it verbatim gifts an attacker content
|
|
72
|
-
* AND size in the transcript; the id is named only when it LOOKS like one. */
|
|
73
|
-
export const namedInRefusal = (txId) => {
|
|
74
|
-
const k = asKey(txId);
|
|
75
|
-
if (k.length === 0)
|
|
76
|
-
return "(empty)";
|
|
77
|
-
return /^[0-9a-f]{64}$/.test(k) ? k : `(not a transaction id: ${k.length} characters)`;
|
|
78
|
-
};
|
|
79
|
-
/** Everything this session signed, by id. */
|
|
80
|
-
export function recordedById(txId) {
|
|
81
|
-
return signedThisSession.get(asKey(txId));
|
|
82
|
-
}
|
|
83
|
-
/** Record a signed operation into BOTH session stores — the intent record AND the base64 bearer
|
|
84
|
-
* bytes. This is the single record path shared by `signTransfer` and `composeIdentityTx` (via
|
|
85
|
-
* `src/identity.ts`); composing and recording in one call is what keeps inspect/submit from ever
|
|
86
|
-
* seeing a signed transaction whose record is missing. */
|
|
87
|
-
export function recordSigned(signed, bytes) {
|
|
88
|
-
const k = asKey(signed.txId);
|
|
89
|
-
signedThisSession.set(k, signed);
|
|
90
|
-
if (!bytesThisSession.has(k))
|
|
91
|
-
bytesThisSession.set(k, Buffer.from(bytes).toString("base64"));
|
|
92
|
-
}
|
|
93
|
-
/** Record an operation whose envelope carries auths assembled from MORE than this session's signer
|
|
94
|
-
* (the group ownership transfer). Strict where `recordSigned` is lenient: it never replaces or
|
|
95
|
-
* merges an existing id, so a verified multi-auth envelope cannot be shadowed by, or shadow, an
|
|
96
|
-
* earlier record. Returns false (recording nothing) when the id is already known. */
|
|
97
|
-
export function recordAssembledOnce(signed, bytes) {
|
|
98
|
-
const k = asKey(signed.txId);
|
|
99
|
-
if (signedThisSession.has(k) || bytesThisSession.has(k))
|
|
100
|
-
return false;
|
|
101
|
-
signedThisSession.set(k, signed);
|
|
102
|
-
bytesThisSession.set(k, Buffer.from(bytes).toString("base64"));
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
// Prepared-but-unconsented ownership transfers. Bounded so a looping caller cannot grow it.
|
|
106
|
-
export const MAX_PENDING_OWNERSHIP = 16;
|
|
107
|
-
const pendingOwnershipThisSession = new Map();
|
|
108
|
-
/** Remember a prepared transfer. False when the bound is reached or the id is already known. */
|
|
109
|
-
export function recordPendingOwnership(p) {
|
|
110
|
-
const k = asKey(p.txId);
|
|
111
|
-
if (pendingOwnershipThisSession.has(k) || signedThisSession.has(k))
|
|
112
|
-
return false;
|
|
113
|
-
if (pendingOwnershipThisSession.size >= MAX_PENDING_OWNERSHIP)
|
|
114
|
-
return false;
|
|
115
|
-
pendingOwnershipThisSession.set(k, p);
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
export function pendingOwnershipById(txId) {
|
|
119
|
-
return pendingOwnershipThisSession.get(asKey(txId));
|
|
120
|
-
}
|
|
121
|
-
export function dropPendingOwnership(txId) {
|
|
122
|
-
pendingOwnershipThisSession.delete(asKey(txId));
|
|
123
|
-
}
|
|
124
|
-
/** Forget prepared transfers that can no longer be admitted (expiry <= round). They were never
|
|
125
|
-
* signed, so nothing submittable is lost; this keeps the bound from filling with dead entries. */
|
|
126
|
-
export function pruneExpiredPendingOwnership(round) {
|
|
127
|
-
for (const [k, p] of pendingOwnershipThisSession)
|
|
128
|
-
if (p.expiresAtRound <= round)
|
|
129
|
-
pendingOwnershipThisSession.delete(k);
|
|
130
|
-
}
|
|
131
|
-
/** The signed bytes for one recorded transaction, base64. Undefined for anything this session
|
|
132
|
-
* did not sign. */
|
|
133
|
-
export function peekBytes(txId) {
|
|
134
|
-
return bytesThisSession.get(asKey(txId));
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Sign a credit transfer to a `txId` and record it — no network submit (SIGN-20).
|
|
138
|
-
*
|
|
139
|
-
* Reads the chain tip to bound the TTL (the read is mandatory: a transaction's life is relative
|
|
140
|
-
* to the current round, and a guessed round is refused). If the chain is unreachable, signing
|
|
141
|
-
* fails as `unreachable` — but it still does NOT submit.
|
|
142
|
-
*/
|
|
143
|
-
export async function signTransfer(deps, params) {
|
|
144
|
-
const recipient = String(params.recipient ?? "").trim();
|
|
145
|
-
if (recipient.length === 0)
|
|
146
|
-
return { kind: "partial", what: "recipient", cause: "no recipient given" };
|
|
147
|
-
// Validate BEFORE anything touches the chain: a refusal here costs nothing, while a bad amount
|
|
148
|
-
// that reaches the wire becomes a transaction that does the wrong thing.
|
|
149
|
-
const amount = parseAmount(String(params.amount ?? ""));
|
|
150
|
-
if (!amount.ok)
|
|
151
|
-
return { kind: "partial", what: "amount", cause: amount.error };
|
|
152
|
-
let tip;
|
|
153
|
-
try {
|
|
154
|
-
tip = await deps.reads.currentRound();
|
|
155
|
-
}
|
|
156
|
-
catch (e) {
|
|
157
|
-
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
158
|
-
}
|
|
159
|
-
const expiresAtRound = tip + (deps.ttlOffset ?? DEFAULT_TTL_OFFSET);
|
|
160
|
-
const body = transferBody([{ recipient, amount: amount.value }]);
|
|
161
|
-
const bytes = buildSignedTx({
|
|
162
|
-
ledgerId: LEDGER.identity,
|
|
163
|
-
senderNodeId: deps.identity,
|
|
164
|
-
body,
|
|
165
|
-
ttlRound: expiresAtRound,
|
|
166
|
-
signers: [deps.signer],
|
|
167
|
-
});
|
|
168
|
-
const signed = {
|
|
169
|
-
txId: txIdHex(LEDGER.identity, deps.identity, expiresAtRound, body),
|
|
170
|
-
expiresAtRound,
|
|
171
|
-
signedAtRound: tip,
|
|
172
|
-
summary: { sender: deps.identity, recipient, amount: formatAmount(amount.value) },
|
|
173
|
-
};
|
|
174
|
-
signedThisSession.set(asKey(signed.txId), signed);
|
|
175
|
-
bytesThisSession.set(asKey(signed.txId), Buffer.from(bytes).toString("base64"));
|
|
176
|
-
return { kind: "ok", value: signed };
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Sign a write to a channel — the generic escape hatch (SUBM-07). Signs only; a separate
|
|
180
|
-
* `evolver_submit` or `evolver_submit_da` call is what reaches a chain.
|
|
181
|
-
*
|
|
182
|
-
* ⚠️ WHAT THE CALLER IS TRUSTED WITH, AND WHAT IT IS NOT. The caller chooses the bytes and the
|
|
183
|
-
* channel. It does NOT choose the interpreter: `writableChannelId` below refuses every CORE ledger
|
|
184
|
-
* id and the whole reserved `ce.evolver.` namespace, so the bytes reach a ledger the core never
|
|
185
|
-
* parses. That is the whole safety argument — a caller who could name `ce.evolver.ledger.identity`
|
|
186
|
-
* with a crafted body would be handing the node a transfer or key registration signed as this
|
|
187
|
-
* identity. The sign DIGEST was never the weak point; DISPATCH was.
|
|
188
|
-
*
|
|
189
|
-
* ⚠️ NOT THE 157 LOGIN. The `signedRequest` SDK path is a challenge-response login proof that sends
|
|
190
|
-
* its own HTTP and carries no commit interval; it is a DIFFERENT affordance and is not wired here.
|
|
191
|
-
*/
|
|
192
|
-
export async function signOpaque(deps, params) {
|
|
193
|
-
// 1. the channel — the refusal that pays for the caller-chosen-ledger exemption.
|
|
194
|
-
const channel = writableChannelId(params.channel);
|
|
195
|
-
if (typeof channel !== "string")
|
|
196
|
-
return channel;
|
|
197
|
-
// 2. the body, hex. Decoded by a parser that refuses a non-hex / odd-length input rather than
|
|
198
|
-
// silently producing a wrong-length run of bytes.
|
|
199
|
-
let body;
|
|
200
|
-
try {
|
|
201
|
-
body = hexToBytes(String(params.bodyHex ?? "").trim());
|
|
202
|
-
}
|
|
203
|
-
catch (e) {
|
|
204
|
-
return { kind: "partial", what: "bodyHex", cause: e instanceof Error ? e.message : String(e) };
|
|
205
|
-
}
|
|
206
|
-
if (body.length === 0)
|
|
207
|
-
return {
|
|
208
|
-
kind: "partial",
|
|
209
|
-
what: "bodyHex",
|
|
210
|
-
cause: "no body given — a channel write carries the bytes you supply, and an empty one costs the same while conveying nothing",
|
|
211
|
-
};
|
|
212
|
-
if (body.length > MAX_BODY_BYTES)
|
|
213
|
-
return {
|
|
214
|
-
kind: "partial",
|
|
215
|
-
what: "bodyHex",
|
|
216
|
-
cause: `${body.length} bytes is over the ${MAX_BODY_BYTES}-byte limit this verb will sign ` +
|
|
217
|
-
`(the node's HTTP request cap, less the transaction envelope). A larger body is rejected ` +
|
|
218
|
-
`by the listener before the node sees it, unreadably. Split the payload, or put it in ` +
|
|
219
|
-
`content storage and write the digest.`,
|
|
220
|
-
};
|
|
221
|
-
// 3. the chain tip, to bound the life. A guessed expiry round is refused outright.
|
|
222
|
-
let tip;
|
|
223
|
-
try {
|
|
224
|
-
tip = await deps.reads.currentRound();
|
|
225
|
-
}
|
|
226
|
-
catch (e) {
|
|
227
|
-
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
228
|
-
}
|
|
229
|
-
const expiresAtRound = tip + (deps.ttlOffset ?? DEFAULT_TTL_OFFSET);
|
|
230
|
-
const bodyBytes = channelBody(body);
|
|
231
|
-
// This escape hatch grants no toll consent; disclose the same fixed zero it signs.
|
|
232
|
-
const maxToll = 0n;
|
|
233
|
-
const fields = { channel, bodyBytes: body.length, maxToll: maxToll.toString() };
|
|
234
|
-
const bytes = buildSignedTx({
|
|
235
|
-
ledgerId: channel,
|
|
236
|
-
senderNodeId: deps.identity,
|
|
237
|
-
body: bodyBytes,
|
|
238
|
-
ttlRound: expiresAtRound,
|
|
239
|
-
signers: [deps.signer],
|
|
240
|
-
maxToll,
|
|
241
|
-
});
|
|
242
|
-
const signed = {
|
|
243
|
-
txId: txIdHex(channel, deps.identity, expiresAtRound, bodyBytes, maxToll),
|
|
244
|
-
expiresAtRound,
|
|
245
|
-
signedAtRound: tip,
|
|
246
|
-
verb: "opaque",
|
|
247
|
-
fields,
|
|
248
|
-
summary: { sender: deps.identity, ...fields },
|
|
249
|
-
};
|
|
250
|
-
signedThisSession.set(asKey(signed.txId), signed);
|
|
251
|
-
bytesThisSession.set(asKey(signed.txId), Buffer.from(bytes).toString("base64"));
|
|
252
|
-
return { kind: "ok", value: signed };
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Submit a transaction this session signed, by its `txId` (SIGN-19). Never signs, never does
|
|
256
|
-
* network work before the guards clear:
|
|
257
|
-
*
|
|
258
|
-
* Rule 1 (SUBM-08) — only what this session signed: otherwise this agent is a submission relay.
|
|
259
|
-
* Rule 2 (SAFE-01) — never twice: a repeat is a no-op the chain refuses, and re-signing is the
|
|
260
|
-
* loop that pays twice. Here the refusal names "look it up", never re-sign.
|
|
261
|
-
*
|
|
262
|
-
* The `txId` resolves the signed record and the exact stored bytes. Both routes share these guards
|
|
263
|
-
* and mark the id before awaiting the network, including when the result is unknown. DA permits
|
|
264
|
-
* only channel-write intent, never a core-ledger operation or owners-ledger administration.
|
|
265
|
-
*/
|
|
266
|
-
export async function submitSigned(deps, txId, mode = "ordinary") {
|
|
267
|
-
const signed = recordedById(txId);
|
|
268
|
-
if (signed === undefined)
|
|
269
|
-
return {
|
|
270
|
-
kind: "refused",
|
|
271
|
-
reason: "not_signed_here",
|
|
272
|
-
message: `no transaction with id ${namedInRefusal(txId)} was signed by this agent in this ` +
|
|
273
|
-
`session, so nothing will be submitted. Sign it first, and submit the id the signing ` +
|
|
274
|
-
`step returned.`,
|
|
275
|
-
};
|
|
276
|
-
if (alreadySubmitted.has(signed.txId))
|
|
277
|
-
return {
|
|
278
|
-
kind: "refused",
|
|
279
|
-
reason: "already_submitted",
|
|
280
|
-
message: `this transaction (${signed.txId}) has already been submitted in this session. Do NOT ` +
|
|
281
|
-
`sign the payment again — that makes a DIFFERENT transaction that nothing deduplicates, ` +
|
|
282
|
-
`and both may commit. Look it up instead.`,
|
|
283
|
-
txId: signed.txId,
|
|
284
|
-
};
|
|
285
|
-
if (mode === "da") {
|
|
286
|
-
if (!("verb" in signed) || (signed.verb !== "opaque" && signed.verb !== "channel_write"))
|
|
287
|
-
return { kind: "refused", reason: "not_channel_write", txId: signed.txId,
|
|
288
|
-
message: "DA submission accepts only session-signed opaque/channel_write intent. Use evolver_submit for transfers and administration; nothing was sent." };
|
|
289
|
-
const channel = writableChannelId(signed.fields.channel);
|
|
290
|
-
if (typeof channel !== "string")
|
|
291
|
-
return { kind: "refused", reason: "not_channel_write", txId: signed.txId,
|
|
292
|
-
message: "DA submission refuses core/reserved or missing channel targets; nothing was sent." };
|
|
293
|
-
if (!deps.submitTxWithDa)
|
|
294
|
-
return { kind: "refused", reason: "da_not_configured", txId: signed.txId,
|
|
295
|
-
message: "DA gateway submission is not configured; nothing was sent. No ordinary-submit fallback was attempted." };
|
|
296
|
-
}
|
|
297
|
-
const bytes = peekBytes(signed.txId);
|
|
298
|
-
if (bytes === undefined)
|
|
299
|
-
return {
|
|
300
|
-
kind: "refused",
|
|
301
|
-
reason: "not_signed_here",
|
|
302
|
-
message: `this session recorded transaction ${signed.txId} but holds no bytes for it, so there is ` +
|
|
303
|
-
`nothing to submit. Sign it again.`,
|
|
304
|
-
txId: signed.txId,
|
|
305
|
-
};
|
|
306
|
-
alreadySubmitted.add(signed.txId);
|
|
307
|
-
const raw = Uint8Array.from(Buffer.from(bytes, "base64"));
|
|
308
|
-
// Monotonic timestamps bracket exactly ONE SDK call, after all local guards. The DA call
|
|
309
|
-
// includes collection/assembly: elapsed time is not commit-only latency, even when committed.
|
|
310
|
-
const t0 = performance.now();
|
|
311
|
-
let result;
|
|
312
|
-
try {
|
|
313
|
-
result = mode === "da" ? await deps.submitTxWithDa(raw) : await deps.submitTx(raw);
|
|
314
|
-
}
|
|
315
|
-
catch (e) {
|
|
316
|
-
return {
|
|
317
|
-
kind: "unknown",
|
|
318
|
-
why: `the submission could not be completed: ${e instanceof Error ? e.message : String(e)}`,
|
|
319
|
-
txId: signed.txId,
|
|
320
|
-
...(mode === "da" ? { daSubmitDurationMs: Math.round(performance.now() - t0) } : {}),
|
|
321
|
-
submitted: { ...signed.summary, expiresAtRound: signed.expiresAtRound },
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
const durationMs = Math.round(performance.now() - t0);
|
|
325
|
-
const daTiming = mode === "da" ? { daSubmitDurationMs: durationMs } : {};
|
|
326
|
-
let outcome = classifySubmit(result);
|
|
327
|
-
if (mode === "da" && outcome.kind === "unknown") {
|
|
328
|
-
// SDK 0.21.0 parseSubmit drops reason/message on `timeout`, including the node's
|
|
329
|
-
// da_collection_in_progress response. Do not infer which phase is pending from that shape.
|
|
330
|
-
const detail = result.kind === "timeout" ? "the gateway returned a pending/timeout outcome" : outcome.why;
|
|
331
|
-
outcome = { ...outcome, why: `${detail}. DA collection may still be in progress or submission may be uncertain; the SDK does not distinguish these phases. This is not da_unavailable or a final refusal` };
|
|
332
|
-
}
|
|
333
|
-
// An EXACT, FREE version-skew detector. The id is computed independently on both ends over the
|
|
334
|
-
// same fields, so a disagreement is unambiguous evidence the two ends encode differently. A
|
|
335
|
-
// mismatch is `unknown` with NO interval: the wrong id means the commit was never identified, so
|
|
336
|
-
// there is no coherent "time to commit" to report.
|
|
337
|
-
if (outcome.kind === "committed" && outcome.txId && outcome.txId.toLowerCase() !== signed.txId.toLowerCase())
|
|
338
|
-
return {
|
|
339
|
-
kind: "unknown",
|
|
340
|
-
why: `the node computed a different transaction id (${outcome.txId}) than this client did ` +
|
|
341
|
-
`(${signed.txId}). Treat the outcome as unknown and look the transaction up.`,
|
|
342
|
-
txId: signed.txId,
|
|
343
|
-
...daTiming,
|
|
344
|
-
submitted: { ...signed.summary, expiresAtRound: signed.expiresAtRound },
|
|
345
|
-
};
|
|
346
|
-
if (outcome.kind === "committed") {
|
|
347
|
-
return {
|
|
348
|
-
...outcome,
|
|
349
|
-
txId: signed.txId,
|
|
350
|
-
...(mode === "ordinary" ? { commitIntervalMs: durationMs } : daTiming),
|
|
351
|
-
submitted: { ...signed.summary, expiresAtRound: signed.expiresAtRound },
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
// Reconciliation always uses the original signed-intent ID, even when the gateway omits or
|
|
355
|
-
// echoes a different ID. Adding gateway DA auths does not change that intent.
|
|
356
|
-
return { ...outcome, txId: signed.txId, ...daTiming,
|
|
357
|
-
submitted: { ...signed.summary, expiresAtRound: signed.expiresAtRound } };
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Read back what a signed transaction would do (READ-05). Answers from the session RECORD, not
|
|
361
|
-
* by decoding — and not from any other transaction. Contacts no chain.
|
|
362
|
-
*/
|
|
363
|
-
export function inspectSigned(txId) {
|
|
364
|
-
const rec = recordedById(txId);
|
|
365
|
-
if (rec !== undefined)
|
|
366
|
-
return { kind: "ok", value: rec };
|
|
367
|
-
const pending = pendingOwnershipById(txId);
|
|
368
|
-
if (pending !== undefined)
|
|
369
|
-
return { kind: "ok", value: pending };
|
|
370
|
-
return {
|
|
371
|
-
kind: "not_found",
|
|
372
|
-
what: `transaction ${namedInRefusal(txId)} was not signed in this session — this tool contacts no chain; this is not evidence of on-chain absence`,
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
/** Test seam only: forget this session's signing history (all three stores). */
|
|
376
|
-
export function __resetSession() {
|
|
377
|
-
signedThisSession.clear();
|
|
378
|
-
alreadySubmitted.clear();
|
|
379
|
-
bytesThisSession.clear();
|
|
380
|
-
pendingOwnershipThisSession.clear();
|
|
381
|
-
}
|
|
382
|
-
/** The single compose→sign→record helper, re-exported from `src/identity.ts` so every identity verb
|
|
383
|
-
* and any future signing verb shares ONE compose implementation (never two). */
|
|
384
|
-
export { composeIdentityTx as composeAndSign } from "./identity.js";
|
|
385
|
-
//# sourceMappingURL=write.js.map
|
package/dist/write.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,8FAA8F;AAC9F,6FAA6F;AAC7F,iGAAiG;AACjG,iGAAiG;AACjG,iCAAiC;AACjC,EAAE;AACF,8FAA8F;AAC9F,8FAA8F;AAC9F,6FAA6F;AAC7F,0DAA0D;AAE1D,OAAO,EACL,MAAM,EACN,aAAa,EACb,YAAY,EACZ,OAAO,EACP,WAAW,EACX,UAAU,EACV,eAAe,EACf,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AAGtC,qGAAqG;AACrG,mGAAmG;AACnG,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;4FAI4F;AAC5F,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AA+FrC;;;2EAG2E;AAC3E,MAAM,cAAc,GAAG,KAAK,GAAG,IA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