@stellar-agent/ledger-logger 0.4.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 stellar-agent-bridge contributors
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.
@@ -0,0 +1,113 @@
1
+ import { NetworkName, PaymentRequest } from "@stellar-agent/core";
2
+ export interface EventLogEntry {
3
+ schemaVersion: "stellar-agent.event.v1";
4
+ at: string;
5
+ event: "command_started" | "command_finished" | "policy_decision" | "approval_requested" | "approval_granted" | "approval_denied" | "transaction_built" | "transaction_signed" | "transaction_submitted" | "transaction_confirmed" | "transaction_failed" | "receipt_written" | "error";
6
+ status?: string;
7
+ command?: string;
8
+ profile?: NetworkName;
9
+ requestId?: string;
10
+ message?: string;
11
+ data?: unknown;
12
+ }
13
+ export interface PaymentReceipt {
14
+ schemaVersion: "stellar-agent.receipt.v1";
15
+ id: string;
16
+ createdAt: string;
17
+ command: string;
18
+ profile: NetworkName;
19
+ network: {
20
+ name: NetworkName;
21
+ passphrase: string;
22
+ realFunds: boolean;
23
+ };
24
+ payment?: {
25
+ source: string;
26
+ destination: string;
27
+ asset: string;
28
+ amount: string;
29
+ memo?: string;
30
+ domain?: string;
31
+ url?: string;
32
+ };
33
+ operation?: {
34
+ type: string;
35
+ source?: string;
36
+ account?: string;
37
+ asset?: string;
38
+ amount?: string;
39
+ destination?: string;
40
+ claimant?: string;
41
+ claimants?: string[];
42
+ balanceId?: string;
43
+ limit?: string;
44
+ predicate?: unknown;
45
+ details?: unknown;
46
+ };
47
+ policyDecision: ReceiptPolicyDecision;
48
+ transaction: {
49
+ hash: string;
50
+ ledger?: number;
51
+ successful: boolean;
52
+ feeCharged?: string;
53
+ };
54
+ ledger?: {
55
+ latestLedgerBefore?: number;
56
+ confirmedLedger?: number;
57
+ };
58
+ files?: {
59
+ eventLog?: string;
60
+ };
61
+ redactions: {
62
+ urlQueryParamsRedacted: boolean;
63
+ secretKeysIncluded: false;
64
+ };
65
+ }
66
+ export interface ReceiptPolicyDecision {
67
+ status: "allowed" | "denied" | "requires_approval";
68
+ matchedRules: string[];
69
+ }
70
+ export interface ReceiptInput {
71
+ command: string;
72
+ profile: NetworkName;
73
+ networkPassphrase: string;
74
+ realFunds: boolean;
75
+ payment?: Required<Pick<PaymentRequest, "destination" | "asset" | "amount">> & {
76
+ source: string;
77
+ memo?: string;
78
+ domain?: string;
79
+ url?: string;
80
+ };
81
+ operation?: PaymentReceipt["operation"];
82
+ policyDecision: ReceiptPolicyDecision;
83
+ transaction: PaymentReceipt["transaction"];
84
+ ledger?: PaymentReceipt["ledger"];
85
+ eventLog?: string;
86
+ }
87
+ export interface ReceiptSpendHistory {
88
+ dailyTotal?: string;
89
+ monthlyTotal?: string;
90
+ knownRecipients?: string[];
91
+ knownDomains?: string[];
92
+ unreadable?: boolean;
93
+ }
94
+ export interface ReceiptSpendHistoryOptions {
95
+ profile?: NetworkName;
96
+ asset?: string;
97
+ now?: Date;
98
+ }
99
+ export declare function appendEvent(logPath: string, entry: Omit<EventLogEntry, "schemaVersion" | "at">): Promise<void>;
100
+ export declare function writeReceipt(receiptsDir: string, input: ReceiptInput): Promise<{
101
+ path: string;
102
+ receipt: PaymentReceipt;
103
+ }>;
104
+ export declare function listReceipts(receiptsDir: string): Promise<string[]>;
105
+ export declare function readReceipt(path: string): Promise<PaymentReceipt>;
106
+ export declare function latestReceipt(receiptsDir: string): Promise<{
107
+ path: string;
108
+ receipt: PaymentReceipt;
109
+ } | null>;
110
+ export declare function spendHistoryFromReceipts(receiptsDir: string, options?: ReceiptSpendHistoryOptions): Promise<ReceiptSpendHistory>;
111
+ export declare function verifyReceipt(receipt: PaymentReceipt): true;
112
+ export declare function assertNoSecrets(value: unknown): void;
113
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,cAAc,EAQf,MAAM,qBAAqB,CAAC;AAI7B,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,wBAAwB,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EACD,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,mBAAmB,GACnB,oBAAoB,GACpB,uBAAuB,GACvB,uBAAuB,GACvB,oBAAoB,GACpB,iBAAiB,GACjB,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA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CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpH;AAED,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,CAAC,CAgC/H;AAED,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAezE;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAKvE;AAED,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,GAAG,IAAI,CAAC,CAIlH;AAED,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,mBAAmB,CAAC,CAoC9B;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAe3D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAUpD"}
package/dist/index.js ADDED
@@ -0,0 +1,142 @@
1
+ import { StellarAgentError, formatStroops, makeId, nowIso, parseAmount, redactSensitive, resolvePath } from "@stellar-agent/core";
2
+ import { mkdir, readFile, readdir, stat, writeFile } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+ export async function appendEvent(logPath, entry) {
5
+ const path = resolvePath(logPath);
6
+ await mkdir(join(path, ".."), { recursive: true });
7
+ const event = {
8
+ schemaVersion: "stellar-agent.event.v1",
9
+ at: nowIso(),
10
+ ...redactSensitive(entry)
11
+ };
12
+ assertNoSecrets(event);
13
+ await writeFile(path, `${JSON.stringify(event)}\n`, { flag: "a", mode: 0o600 });
14
+ }
15
+ export async function writeReceipt(receiptsDir, input) {
16
+ const dir = resolvePath(receiptsDir);
17
+ await mkdir(dir, { recursive: true });
18
+ const receipt = {
19
+ schemaVersion: "stellar-agent.receipt.v1",
20
+ id: makeId("rec"),
21
+ createdAt: nowIso(),
22
+ command: input.command,
23
+ profile: input.profile,
24
+ network: {
25
+ name: input.profile,
26
+ passphrase: input.networkPassphrase,
27
+ realFunds: input.realFunds
28
+ },
29
+ ...(input.payment ? { payment: redactSensitive(input.payment) } : {}),
30
+ ...(input.operation ? { operation: redactSensitive(input.operation) } : {}),
31
+ policyDecision: {
32
+ status: input.policyDecision.status,
33
+ matchedRules: input.policyDecision.matchedRules
34
+ },
35
+ transaction: input.transaction,
36
+ ...(input.ledger ? { ledger: input.ledger } : {}),
37
+ ...(input.eventLog ? { files: { eventLog: input.eventLog } } : {}),
38
+ redactions: {
39
+ urlQueryParamsRedacted: true,
40
+ secretKeysIncluded: false
41
+ }
42
+ };
43
+ assertNoSecrets(receipt);
44
+ const path = join(dir, `${receipt.id}.json`);
45
+ await writeFile(path, `${JSON.stringify(receipt, null, 2)}\n`, { mode: 0o600 });
46
+ return { path, receipt };
47
+ }
48
+ export async function listReceipts(receiptsDir) {
49
+ const dir = resolvePath(receiptsDir);
50
+ try {
51
+ const entries = await readdir(dir);
52
+ const receiptPaths = entries
53
+ .filter((entry) => entry.endsWith(".json"))
54
+ .map((entry) => join(dir, entry));
55
+ const withStats = await Promise.all(receiptPaths.map(async (path) => ({ path, mtime: (await stat(path)).mtimeMs })));
56
+ return withStats.sort((a, b) => b.mtime - a.mtime).map((entry) => entry.path);
57
+ }
58
+ catch (error) {
59
+ if (error?.code === "ENOENT")
60
+ return [];
61
+ throw error;
62
+ }
63
+ }
64
+ export async function readReceipt(path) {
65
+ const raw = await readFile(resolvePath(path), "utf8");
66
+ const parsed = JSON.parse(raw);
67
+ verifyReceipt(parsed);
68
+ return parsed;
69
+ }
70
+ export async function latestReceipt(receiptsDir) {
71
+ const [path] = await listReceipts(receiptsDir);
72
+ if (!path)
73
+ return null;
74
+ return { path, receipt: await readReceipt(path) };
75
+ }
76
+ export async function spendHistoryFromReceipts(receiptsDir, options = {}) {
77
+ try {
78
+ const paths = await listReceipts(receiptsDir);
79
+ const now = options.now ?? new Date();
80
+ const dayPrefix = now.toISOString().slice(0, 10);
81
+ const monthPrefix = now.toISOString().slice(0, 7);
82
+ let dailyStroops = 0n;
83
+ let monthlyStroops = 0n;
84
+ const knownRecipients = new Set();
85
+ const knownDomains = new Set();
86
+ for (const path of paths) {
87
+ const receipt = await readReceipt(path);
88
+ if (!receipt.payment || receipt.transaction.successful !== true || receipt.policyDecision.status !== "allowed") {
89
+ continue;
90
+ }
91
+ if (options.profile && receipt.profile !== options.profile)
92
+ continue;
93
+ if (options.asset && receipt.payment.asset.toUpperCase() !== options.asset.toUpperCase())
94
+ continue;
95
+ knownRecipients.add(receipt.payment.destination);
96
+ if (receipt.payment.domain)
97
+ knownDomains.add(receipt.payment.domain);
98
+ const stroops = parseAmount(receipt.payment.amount, receipt.payment.asset).stroops;
99
+ if (receipt.createdAt.startsWith(dayPrefix))
100
+ dailyStroops += stroops;
101
+ if (receipt.createdAt.startsWith(monthPrefix))
102
+ monthlyStroops += stroops;
103
+ }
104
+ return {
105
+ dailyTotal: formatStroops(dailyStroops),
106
+ monthlyTotal: formatStroops(monthlyStroops),
107
+ knownRecipients: Array.from(knownRecipients),
108
+ knownDomains: Array.from(knownDomains)
109
+ };
110
+ }
111
+ catch {
112
+ return { unreadable: true };
113
+ }
114
+ }
115
+ export function verifyReceipt(receipt) {
116
+ if (receipt.schemaVersion !== "stellar-agent.receipt.v1") {
117
+ throw new StellarAgentError({
118
+ code: "CONFIG_INVALID",
119
+ message: "Receipt schema version is not supported."
120
+ });
121
+ }
122
+ if (!receipt.id || !receipt.createdAt || !receipt.transaction?.hash || (!receipt.payment && !receipt.operation)) {
123
+ throw new StellarAgentError({
124
+ code: "CONFIG_INVALID",
125
+ message: "Receipt is missing required fields."
126
+ });
127
+ }
128
+ assertNoSecrets(receipt);
129
+ return true;
130
+ }
131
+ export function assertNoSecrets(value) {
132
+ const serialized = JSON.stringify(value);
133
+ if (/\bS[A-Z2-7]{55}\b/.test(serialized)) {
134
+ throw new StellarAgentError({
135
+ code: "SECRET_KEY_BLOCKED",
136
+ message: "Refusing to write secret material to logs or receipts.",
137
+ hint: "Receipts and event logs must never include secret keys.",
138
+ docs: "docs/security.md#key-handling"
139
+ });
140
+ }
141
+ }
142
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,MAAM,EACN,WAAW,EACX,eAAe,EACf,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAsHjC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAe,EAAE,KAAkD;IACnG,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,MAAM,KAAK,GAAkB;QAC3B,aAAa,EAAE,wBAAwB;QACvC,EAAE,EAAE,MAAM,EAAE;QACZ,GAAG,eAAe,CAAC,KAAK,CAAC;KAC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AoB;YAC1B,OAAO,EAAE,wDAAwD;YACjE,IAAI,EAAE,yDAAyD;YAC/D,IAAI,EAAE,+BAA+B;SACtC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@stellar-agent/ledger-logger",
3
+ "version": "0.4.0",
4
+ "description": "Receipt and JSONL event logging for Stellar Agent Bridge operations.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+ssh://git@github.com/someone-in-texas/Stellar-Agent.git",
10
+ "directory": "packages/ledger-logger"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/someone-in-texas/Stellar-Agent/issues"
14
+ },
15
+ "homepage": "https://github.com/someone-in-texas/Stellar-Agent#readme",
16
+ "engines": {
17
+ "node": ">=22"
18
+ },
19
+ "main": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js"
25
+ }
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "scripts": {
31
+ "build": "tsc -b",
32
+ "test": "vitest run"
33
+ },
34
+ "dependencies": {
35
+ "@stellar-agent/core": "0.4.0"
36
+ }
37
+ }