@usesigil/kit 0.8.1 → 0.11.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/README.md +350 -164
- package/dist/alt-config.d.ts +4 -2
- package/dist/alt-config.d.ts.map +1 -1
- package/dist/alt-config.js +4 -2
- package/dist/alt-config.js.map +1 -1
- package/dist/alt-loader.d.ts.map +1 -1
- package/dist/alt-loader.js +2 -1
- package/dist/alt-loader.js.map +1 -1
- package/dist/balance-tracker.d.ts.map +1 -1
- package/dist/balance-tracker.js +2 -1
- package/dist/balance-tracker.js.map +1 -1
- package/dist/create-vault.d.ts +40 -3
- package/dist/create-vault.d.ts.map +1 -1
- package/dist/create-vault.js +52 -18
- package/dist/create-vault.js.map +1 -1
- package/dist/dashboard/discover.d.ts.map +1 -1
- package/dist/dashboard/discover.js +2 -1
- package/dist/dashboard/discover.js.map +1 -1
- package/dist/dashboard/from-json.d.ts +1 -0
- package/dist/dashboard/from-json.d.ts.map +1 -1
- package/dist/dashboard/from-json.js +3 -1
- package/dist/dashboard/from-json.js.map +1 -1
- package/dist/dashboard/mutations.d.ts.map +1 -1
- package/dist/dashboard/mutations.js +2 -1
- package/dist/dashboard/mutations.js.map +1 -1
- package/dist/dashboard/reads.d.ts.map +1 -1
- package/dist/dashboard/reads.js +5 -4
- package/dist/dashboard/reads.js.map +1 -1
- package/dist/errors/codes.d.ts +8 -2
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/errors/codes.js +6 -0
- package/dist/errors/codes.js.map +1 -1
- package/dist/errors/context.d.ts +17 -1
- package/dist/errors/context.d.ts.map +1 -1
- package/dist/errors/public.d.ts +24 -0
- package/dist/errors/public.d.ts.map +1 -0
- package/dist/errors/public.js +30 -0
- package/dist/errors/public.js.map +1 -0
- package/dist/errors/walk.d.ts.map +1 -1
- package/dist/errors/walk.js +2 -1
- package/dist/errors/walk.js.map +1 -1
- package/dist/helpers/ata.d.ts +73 -0
- package/dist/helpers/ata.d.ts.map +1 -0
- package/dist/helpers/ata.js +107 -0
- package/dist/helpers/ata.js.map +1 -0
- package/dist/helpers/parse-usd.d.ts +43 -0
- package/dist/helpers/parse-usd.d.ts.map +1 -0
- package/dist/helpers/parse-usd.js +81 -0
- package/dist/helpers/parse-usd.js.map +1 -0
- package/dist/helpers/validate-cap-aggregate.d.ts +41 -0
- package/dist/helpers/validate-cap-aggregate.d.ts.map +1 -0
- package/dist/helpers/validate-cap-aggregate.js +61 -0
- package/dist/helpers/validate-cap-aggregate.js.map +1 -0
- package/dist/hooks.d.ts +114 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +118 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -17
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +77 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +153 -0
- package/dist/logger.js.map +1 -0
- package/dist/plugin.d.ts +110 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +119 -0
- package/dist/plugin.js.map +1 -0
- package/dist/presets.d.ts +73 -6
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +75 -6
- package/dist/presets.js.map +1 -1
- package/dist/priority-fees.d.ts.map +1 -1
- package/dist/priority-fees.js +3 -2
- package/dist/priority-fees.js.map +1 -1
- package/dist/react/index.d.ts +69 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +118 -0
- package/dist/react/index.js.map +1 -0
- package/dist/seal.d.ts +113 -15
- package/dist/seal.d.ts.map +1 -1
- package/dist/seal.js +269 -10
- package/dist/seal.js.map +1 -1
- package/dist/shield.d.ts.map +1 -1
- package/dist/shield.js +8 -7
- package/dist/shield.js.map +1 -1
- package/dist/sigil.d.ts +187 -0
- package/dist/sigil.d.ts.map +1 -0
- package/dist/sigil.js +194 -0
- package/dist/sigil.js.map +1 -0
- package/dist/tee/verify.d.ts.map +1 -1
- package/dist/tee/verify.js +6 -5
- package/dist/tee/verify.js.map +1 -1
- package/dist/transaction-executor.d.ts.map +1 -1
- package/dist/transaction-executor.js +3 -2
- package/dist/transaction-executor.js.map +1 -1
- package/dist/types.d.ts +3 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +45 -106
- package/dist/types.js.map +1 -1
- package/dist/vault-handle.d.ts +123 -0
- package/dist/vault-handle.d.ts.map +1 -0
- package/dist/vault-handle.js +136 -0
- package/dist/vault-handle.js.map +1 -0
- package/dist/x402/shielded-fetch.d.ts.map +1 -1
- package/dist/x402/shielded-fetch.js +7 -4
- package/dist/x402/shielded-fetch.js.map +1 -1
- package/package.json +21 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* parseUsd — strict USD-string parser that returns 6-decimal base units.
|
|
3
|
+
*
|
|
4
|
+
* Rationale: consumers frequently need to express dollar amounts ("$500",
|
|
5
|
+
* "$0.01") in UI surfaces, CLIs, and config files. Parsing those strings
|
|
6
|
+
* with `parseFloat` or `Number(...)` introduces floating-point rounding
|
|
7
|
+
* errors that compound into cap-enforcement bugs on-chain. This helper
|
|
8
|
+
* uses a strict regex and BigInt arithmetic only — no floating-point path
|
|
9
|
+
* exists at any step.
|
|
10
|
+
*
|
|
11
|
+
* Grammar (regex `^\$(0|[1-9]\d{0,14})(\.\d{1,6})?$`):
|
|
12
|
+
* - Leading literal `$` is required
|
|
13
|
+
* - Whole part: `0` alone, OR a 1-15 digit number with no leading zero
|
|
14
|
+
* (`$01` / `$007` are rejected as typos; `$0` / `$0.5` are valid)
|
|
15
|
+
* - 15 digits max × 10^6 scale = 10^21, well within BigInt range
|
|
16
|
+
* - Optional fractional part: `.` + 1–6 digits (matches USD_DECIMALS = 6)
|
|
17
|
+
* - No thousands separators, no exponent notation, no sign, no whitespace
|
|
18
|
+
*
|
|
19
|
+
* Output: bigint in 6-decimal USD base units (`$1 → 1_000_000n`).
|
|
20
|
+
*
|
|
21
|
+
* Errors: throws `SigilSdkDomainError` with code
|
|
22
|
+
* `SIGIL_ERROR__SDK__INVALID_AMOUNT` for any malformed input. The error
|
|
23
|
+
* `.context` carries the original input string to aid debugging.
|
|
24
|
+
*
|
|
25
|
+
* Examples:
|
|
26
|
+
* parseUsd("$0") // → 0n
|
|
27
|
+
* parseUsd("$0.01") // → 10_000n
|
|
28
|
+
* parseUsd("$1") // → 1_000_000n
|
|
29
|
+
* parseUsd("$1.5") // → 1_500_000n
|
|
30
|
+
* parseUsd("$100.000001") // → 100_000_001n
|
|
31
|
+
* parseUsd("$999999999999999")// → 999_999_999_999_999_000_000n
|
|
32
|
+
* parseUsd("1.0") // throws — missing "$"
|
|
33
|
+
* parseUsd("$1,000") // throws — commas not allowed
|
|
34
|
+
* parseUsd("$1e3") // throws — exponent not allowed
|
|
35
|
+
* parseUsd("$1.1234567") // throws — > 6 decimals
|
|
36
|
+
* parseUsd("$-1") // throws — negative not allowed
|
|
37
|
+
*
|
|
38
|
+
* @param input USD-denominated string, including literal leading "$"
|
|
39
|
+
* @returns `bigint` in 6-decimal base units (USD_DECIMALS = 6)
|
|
40
|
+
* @throws {SigilSdkDomainError} code SIGIL_ERROR__SDK__INVALID_AMOUNT
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseUsd(input: string): bigint;
|
|
43
|
+
//# sourceMappingURL=parse-usd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-usd.d.ts","sourceRoot":"","sources":["../../src/helpers/parse-usd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAmBH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoC9C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* parseUsd — strict USD-string parser that returns 6-decimal base units.
|
|
3
|
+
*
|
|
4
|
+
* Rationale: consumers frequently need to express dollar amounts ("$500",
|
|
5
|
+
* "$0.01") in UI surfaces, CLIs, and config files. Parsing those strings
|
|
6
|
+
* with `parseFloat` or `Number(...)` introduces floating-point rounding
|
|
7
|
+
* errors that compound into cap-enforcement bugs on-chain. This helper
|
|
8
|
+
* uses a strict regex and BigInt arithmetic only — no floating-point path
|
|
9
|
+
* exists at any step.
|
|
10
|
+
*
|
|
11
|
+
* Grammar (regex `^\$(0|[1-9]\d{0,14})(\.\d{1,6})?$`):
|
|
12
|
+
* - Leading literal `$` is required
|
|
13
|
+
* - Whole part: `0` alone, OR a 1-15 digit number with no leading zero
|
|
14
|
+
* (`$01` / `$007` are rejected as typos; `$0` / `$0.5` are valid)
|
|
15
|
+
* - 15 digits max × 10^6 scale = 10^21, well within BigInt range
|
|
16
|
+
* - Optional fractional part: `.` + 1–6 digits (matches USD_DECIMALS = 6)
|
|
17
|
+
* - No thousands separators, no exponent notation, no sign, no whitespace
|
|
18
|
+
*
|
|
19
|
+
* Output: bigint in 6-decimal USD base units (`$1 → 1_000_000n`).
|
|
20
|
+
*
|
|
21
|
+
* Errors: throws `SigilSdkDomainError` with code
|
|
22
|
+
* `SIGIL_ERROR__SDK__INVALID_AMOUNT` for any malformed input. The error
|
|
23
|
+
* `.context` carries the original input string to aid debugging.
|
|
24
|
+
*
|
|
25
|
+
* Examples:
|
|
26
|
+
* parseUsd("$0") // → 0n
|
|
27
|
+
* parseUsd("$0.01") // → 10_000n
|
|
28
|
+
* parseUsd("$1") // → 1_000_000n
|
|
29
|
+
* parseUsd("$1.5") // → 1_500_000n
|
|
30
|
+
* parseUsd("$100.000001") // → 100_000_001n
|
|
31
|
+
* parseUsd("$999999999999999")// → 999_999_999_999_999_000_000n
|
|
32
|
+
* parseUsd("1.0") // throws — missing "$"
|
|
33
|
+
* parseUsd("$1,000") // throws — commas not allowed
|
|
34
|
+
* parseUsd("$1e3") // throws — exponent not allowed
|
|
35
|
+
* parseUsd("$1.1234567") // throws — > 6 decimals
|
|
36
|
+
* parseUsd("$-1") // throws — negative not allowed
|
|
37
|
+
*
|
|
38
|
+
* @param input USD-denominated string, including literal leading "$"
|
|
39
|
+
* @returns `bigint` in 6-decimal base units (USD_DECIMALS = 6)
|
|
40
|
+
* @throws {SigilSdkDomainError} code SIGIL_ERROR__SDK__INVALID_AMOUNT
|
|
41
|
+
*/
|
|
42
|
+
import { SigilSdkDomainError } from "../errors/sdk.js";
|
|
43
|
+
import { SIGIL_ERROR__SDK__INVALID_AMOUNT } from "../errors/codes.js";
|
|
44
|
+
// USD_DECIMALS = 6 — hardcoded here to keep parse-usd.ts dependency-free
|
|
45
|
+
// from the larger types barrel. Must stay in sync with
|
|
46
|
+
// programs/sigil/src/state/mod.rs:224 and sdk/kit/src/types.ts USD_DECIMALS.
|
|
47
|
+
const USD_DECIMALS = 6;
|
|
48
|
+
const USD_BASE = 1000000n; // 10 ** USD_DECIMALS
|
|
49
|
+
// Strict format:
|
|
50
|
+
// - Leading literal `$`
|
|
51
|
+
// - Whole part: either "0" OR a 1-15 digit number that doesn't start with 0.
|
|
52
|
+
// Prevents `$00`, `$01`, `$007` from silently parsing — those are almost
|
|
53
|
+
// always typos, never intentional amounts.
|
|
54
|
+
// - Optional `.` + 1–6 decimal digits (capture group 2 includes the dot)
|
|
55
|
+
const USD_REGEX = /^\$(0|[1-9]\d{0,14})(\.\d{1,6})?$/;
|
|
56
|
+
export function parseUsd(input) {
|
|
57
|
+
if (typeof input !== "string") {
|
|
58
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_AMOUNT, `parseUsd expected a string, received ${typeof input}`, { context: { input: String(input) } });
|
|
59
|
+
}
|
|
60
|
+
const match = input.match(USD_REGEX);
|
|
61
|
+
if (match === null) {
|
|
62
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_AMOUNT, `Invalid USD amount: "${input}". ` +
|
|
63
|
+
`Expected format "$<whole>[.<fraction>]" — ` +
|
|
64
|
+
`up to 15 whole digits, up to ${USD_DECIMALS} fractional digits, ` +
|
|
65
|
+
`no commas, no exponent, no sign, no whitespace.`, { context: { input } });
|
|
66
|
+
}
|
|
67
|
+
const [, whole, fractionPart] = match;
|
|
68
|
+
// `whole` is guaranteed non-empty (regex `\d{1,15}`).
|
|
69
|
+
const wholeBig = BigInt(whole);
|
|
70
|
+
let result = wholeBig * USD_BASE;
|
|
71
|
+
if (fractionPart !== undefined) {
|
|
72
|
+
// fractionPart includes the leading dot: ".5", ".000001"
|
|
73
|
+
const fractionDigits = fractionPart.slice(1);
|
|
74
|
+
// Pad fractionDigits to exactly USD_DECIMALS digits (right-pad with 0).
|
|
75
|
+
// "5" → "500000"; "000001" → "000001"
|
|
76
|
+
const padded = fractionDigits.padEnd(USD_DECIMALS, "0");
|
|
77
|
+
result += BigInt(padded);
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=parse-usd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-usd.js","sourceRoot":"","sources":["../../src/helpers/parse-usd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAEtE,yEAAyE;AACzE,uDAAuD;AACvD,6EAA6E;AAC7E,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,QAAQ,GAAG,QAAU,CAAC,CAAC,qBAAqB;AAElD,iBAAiB;AACjB,0BAA0B;AAC1B,+EAA+E;AAC/E,6EAA6E;AAC7E,+CAA+C;AAC/C,2EAA2E;AAC3E,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAEtD,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,mBAAmB,CAC3B,gCAAgC,EAChC,wCAAwC,OAAO,KAAK,EAAE,EACtD,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAW,EAAE,CAC/C,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,mBAAmB,CAC3B,gCAAgC,EAChC,wBAAwB,KAAK,KAAK;YAChC,4CAA4C;YAC5C,gCAAgC,YAAY,sBAAsB;YAClE,iDAAiD,EACnD,EAAE,OAAO,EAAE,EAAE,KAAK,EAAW,EAAE,CAChC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC;IACtC,sDAAsD;IACtD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAM,CAAC,CAAC;IAChC,IAAI,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAEjC,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,yDAAyD;QACzD,MAAM,cAAc,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7C,wEAAwE;QACxE,sCAAsC;QACtC,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;QACxD,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* validateAgentCapAggregate — enforce sum of agent per-agent caps ≤ vault
|
|
3
|
+
* daily cap.
|
|
4
|
+
*
|
|
5
|
+
* Rationale: D12 closes Pentester finding F3 ("$100/agent × 10 agents =
|
|
6
|
+
* $1,000 rolling — vault daily cap $500"). The on-chain program enforces
|
|
7
|
+
* the vault-wide cap and the per-agent cap as separate checks, but both
|
|
8
|
+
* are satisfied simultaneously when the sum of per-agent caps exceeds
|
|
9
|
+
* the vault cap — any single agent inside its own limit can still
|
|
10
|
+
* contribute to a combined burn above the vault ceiling. Blocking this
|
|
11
|
+
* in the SDK before any of `createVault`, `registerAgent`, or
|
|
12
|
+
* `queueAgentPermissionsUpdate` sends the instruction keeps the UX
|
|
13
|
+
* honest: the consumer sees the problem during setup, not at cap time.
|
|
14
|
+
*
|
|
15
|
+
* Called at two entry points:
|
|
16
|
+
* 1. `createVault` (A8) with `existingAgentCaps: []` — validates the
|
|
17
|
+
* initial agent's cap against the new vault's daily cap.
|
|
18
|
+
* 2. `addAgent` / `queueAgentPermissionsUpdate` (Sprint 2) with
|
|
19
|
+
* `existingAgentCaps` populated from the current vault state.
|
|
20
|
+
*
|
|
21
|
+
* A cap of `0n` means the agent is Observer-class and has no spending
|
|
22
|
+
* budget of its own — it contributes zero to the aggregate and is
|
|
23
|
+
* always valid regardless of the existing caps' sum.
|
|
24
|
+
*
|
|
25
|
+
* @throws {SigilSdkDomainError} SIGIL_ERROR__SDK__CAP_EXCEEDED when
|
|
26
|
+
* `sum(existingAgentCaps) + newAgentCap > vaultDailyCap`.
|
|
27
|
+
*/
|
|
28
|
+
export interface ValidateAgentCapAggregateParams {
|
|
29
|
+
/** Vault-wide daily spending cap in USD base units (6-decimal). */
|
|
30
|
+
vaultDailyCap: bigint;
|
|
31
|
+
/**
|
|
32
|
+
* Per-agent caps for every agent already registered on the vault.
|
|
33
|
+
* Empty on first agent (fresh `createVault`); populated from
|
|
34
|
+
* resolved vault state on subsequent `addAgent` calls.
|
|
35
|
+
*/
|
|
36
|
+
existingAgentCaps: readonly bigint[];
|
|
37
|
+
/** Per-agent cap for the agent being added or updated. */
|
|
38
|
+
newAgentCap: bigint;
|
|
39
|
+
}
|
|
40
|
+
export declare function validateAgentCapAggregate(params: ValidateAgentCapAggregateParams): void;
|
|
41
|
+
//# sourceMappingURL=validate-cap-aggregate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-cap-aggregate.d.ts","sourceRoot":"","sources":["../../src/helpers/validate-cap-aggregate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH,MAAM,WAAW,+BAA+B;IAC9C,mEAAmE;IACnE,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,+BAA+B,GACtC,IAAI,CA4CN"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* validateAgentCapAggregate — enforce sum of agent per-agent caps ≤ vault
|
|
3
|
+
* daily cap.
|
|
4
|
+
*
|
|
5
|
+
* Rationale: D12 closes Pentester finding F3 ("$100/agent × 10 agents =
|
|
6
|
+
* $1,000 rolling — vault daily cap $500"). The on-chain program enforces
|
|
7
|
+
* the vault-wide cap and the per-agent cap as separate checks, but both
|
|
8
|
+
* are satisfied simultaneously when the sum of per-agent caps exceeds
|
|
9
|
+
* the vault cap — any single agent inside its own limit can still
|
|
10
|
+
* contribute to a combined burn above the vault ceiling. Blocking this
|
|
11
|
+
* in the SDK before any of `createVault`, `registerAgent`, or
|
|
12
|
+
* `queueAgentPermissionsUpdate` sends the instruction keeps the UX
|
|
13
|
+
* honest: the consumer sees the problem during setup, not at cap time.
|
|
14
|
+
*
|
|
15
|
+
* Called at two entry points:
|
|
16
|
+
* 1. `createVault` (A8) with `existingAgentCaps: []` — validates the
|
|
17
|
+
* initial agent's cap against the new vault's daily cap.
|
|
18
|
+
* 2. `addAgent` / `queueAgentPermissionsUpdate` (Sprint 2) with
|
|
19
|
+
* `existingAgentCaps` populated from the current vault state.
|
|
20
|
+
*
|
|
21
|
+
* A cap of `0n` means the agent is Observer-class and has no spending
|
|
22
|
+
* budget of its own — it contributes zero to the aggregate and is
|
|
23
|
+
* always valid regardless of the existing caps' sum.
|
|
24
|
+
*
|
|
25
|
+
* @throws {SigilSdkDomainError} SIGIL_ERROR__SDK__CAP_EXCEEDED when
|
|
26
|
+
* `sum(existingAgentCaps) + newAgentCap > vaultDailyCap`.
|
|
27
|
+
*/
|
|
28
|
+
import { SigilSdkDomainError } from "../errors/sdk.js";
|
|
29
|
+
import { SIGIL_ERROR__SDK__CAP_EXCEEDED } from "../errors/codes.js";
|
|
30
|
+
export function validateAgentCapAggregate(params) {
|
|
31
|
+
const { vaultDailyCap, existingAgentCaps, newAgentCap } = params;
|
|
32
|
+
// Reject negative inputs early — bigint doesn't prevent them, but
|
|
33
|
+
// every cap on the system is a magnitude value.
|
|
34
|
+
if (vaultDailyCap < 0n || newAgentCap < 0n) {
|
|
35
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__CAP_EXCEEDED, `validateAgentCapAggregate received negative input — ` +
|
|
36
|
+
`vaultDailyCap=${vaultDailyCap}, newAgentCap=${newAgentCap}. ` +
|
|
37
|
+
`Caps are unsigned magnitudes.`, { context: { vaultDailyCap, newAgentCap } });
|
|
38
|
+
}
|
|
39
|
+
for (const c of existingAgentCaps) {
|
|
40
|
+
if (c < 0n) {
|
|
41
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__CAP_EXCEEDED, `validateAgentCapAggregate received a negative existingAgentCap (${c}).`, { context: { existingAgentCaps: [...existingAgentCaps] } });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
let sum = newAgentCap;
|
|
45
|
+
for (const cap of existingAgentCaps)
|
|
46
|
+
sum += cap;
|
|
47
|
+
if (sum > vaultDailyCap) {
|
|
48
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__CAP_EXCEEDED, `Aggregate per-agent cap (${sum} in 6-decimal USD base units) ` +
|
|
49
|
+
`exceeds vault daily cap (${vaultDailyCap}). Sum of all agents' ` +
|
|
50
|
+
`spendingLimitUsd must be ≤ dailySpendingCapUsd to prevent ` +
|
|
51
|
+
`concurrent-burn attacks where each agent stays within its own ` +
|
|
52
|
+
`limit but the combined outflow breaches the vault's ceiling.`, {
|
|
53
|
+
context: {
|
|
54
|
+
vaultCap: vaultDailyCap,
|
|
55
|
+
sum,
|
|
56
|
+
agents: [...existingAgentCaps, newAgentCap],
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=validate-cap-aggregate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-cap-aggregate.js","sourceRoot":"","sources":["../../src/helpers/validate-cap-aggregate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAepE,MAAM,UAAU,yBAAyB,CACvC,MAAuC;IAEvC,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAEjE,kEAAkE;IAClE,gDAAgD;IAChD,IAAI,aAAa,GAAG,EAAE,IAAI,WAAW,GAAG,EAAE,EAAE,CAAC;QAC3C,MAAM,IAAI,mBAAmB,CAC3B,8BAA8B,EAC9B,sDAAsD;YACpD,iBAAiB,aAAa,iBAAiB,WAAW,IAAI;YAC9D,+BAA+B,EACjC,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,WAAW,EAAW,EAAE,CACrD,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,iBAAiB,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACX,MAAM,IAAI,mBAAmB,CAC3B,8BAA8B,EAC9B,mEAAmE,CAAC,IAAI,EACxE,EAAE,OAAO,EAAE,EAAE,iBAAiB,EAAE,CAAC,GAAG,iBAAiB,CAAC,EAAW,EAAE,CACpE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,GAAG,GAAG,WAAW,CAAC;IACtB,KAAK,MAAM,GAAG,IAAI,iBAAiB;QAAE,GAAG,IAAI,GAAG,CAAC;IAEhD,IAAI,GAAG,GAAG,aAAa,EAAE,CAAC;QACxB,MAAM,IAAI,mBAAmB,CAC3B,8BAA8B,EAC9B,4BAA4B,GAAG,gCAAgC;YAC7D,4BAA4B,aAAa,wBAAwB;YACjE,4DAA4D;YAC5D,gEAAgE;YAChE,8DAA8D,EAChE;YACE,OAAO,EAAE;gBACP,QAAQ,EAAE,aAAa;gBACvB,GAAG;gBACH,MAAM,EAAE,CAAC,GAAG,iBAAiB,EAAE,WAAW,CAAC;aACnC;SACX,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SealHooks — pluggable lifecycle observability for `seal()` and
|
|
3
|
+
* `SigilClient.executeAndConfirm()`.
|
|
4
|
+
*
|
|
5
|
+
* Rationale: Sprint 1's `SigilClientConfig.onError` was a single post-
|
|
6
|
+
* send telemetry callback — useful but narrow. Consumers building agent
|
|
7
|
+
* frameworks need correlation IDs, pre-build rewrites, and per-stage
|
|
8
|
+
* spans for distributed tracing. `SealHooks` is the observe-only
|
|
9
|
+
* superset that handles those cases without compromising `seal()`'s
|
|
10
|
+
* atomicity guarantee.
|
|
11
|
+
*
|
|
12
|
+
* Semantics:
|
|
13
|
+
* - All hooks are **observe-only** by default. A hook that throws is
|
|
14
|
+
* caught, logged via `getSigilModuleLogger().warn`, and swallowed;
|
|
15
|
+
* `seal()` continues.
|
|
16
|
+
* - `onBeforeBuild` is the only hook that may abort. Returning
|
|
17
|
+
* `{ skipSeal: true, reason }` throws
|
|
18
|
+
* `SigilSdkDomainError(SIGIL_ERROR__SDK__HOOK_ABORTED)` before any
|
|
19
|
+
* RPC round-trip. Use for consent flows, feature flags, dry-run
|
|
20
|
+
* mode.
|
|
21
|
+
* - `onFinalize` fires **only** on success (from
|
|
22
|
+
* `executeAndConfirm`). Standalone `seal()` callers don't see it —
|
|
23
|
+
* they have the result in hand.
|
|
24
|
+
*/
|
|
25
|
+
import type { Address } from "./kit-adapter.js";
|
|
26
|
+
/**
|
|
27
|
+
* Per-seal-invocation context passed to every hook. Populated once at
|
|
28
|
+
* the top of `seal()` so every stage sees the same `correlationId`.
|
|
29
|
+
*/
|
|
30
|
+
export interface SealHookContext {
|
|
31
|
+
readonly vault: Address;
|
|
32
|
+
readonly agent: Address;
|
|
33
|
+
readonly tokenMint: Address;
|
|
34
|
+
readonly amount: bigint;
|
|
35
|
+
readonly network: "devnet" | "mainnet";
|
|
36
|
+
/** Stable per-seal-invocation ID (UUIDv4-like) for trace correlation. */
|
|
37
|
+
readonly correlationId: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The `skipSeal` signal from `onBeforeBuild`. Returning this causes
|
|
41
|
+
* `seal()` to throw `SigilSdkDomainError(SIGIL_ERROR__SDK__HOOK_ABORTED)`
|
|
42
|
+
* before any RPC round-trip. Use for consent flows or dry-run mode.
|
|
43
|
+
*/
|
|
44
|
+
export type SealHookAbort = {
|
|
45
|
+
readonly skipSeal: true;
|
|
46
|
+
readonly reason: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Result type for `onBeforeBuild` — either `void`/`undefined` (continue)
|
|
50
|
+
* or `SealHookAbort` (stop).
|
|
51
|
+
*/
|
|
52
|
+
export type OnBeforeBuildResult = void | SealHookAbort;
|
|
53
|
+
export interface SealHooks {
|
|
54
|
+
/**
|
|
55
|
+
* Fires before any RPC call, after parameter validation but before
|
|
56
|
+
* `resolveVaultState`. The hook may return `{ skipSeal: true, reason }`
|
|
57
|
+
* to cleanly abort. The `params` argument is shallow-readonly — do
|
|
58
|
+
* NOT mutate, use return value for abort.
|
|
59
|
+
*/
|
|
60
|
+
onBeforeBuild?(ctx: SealHookContext, params: Readonly<unknown>): OnBeforeBuildResult | Promise<OnBeforeBuildResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Fires after the composed transaction is built and size-checked,
|
|
63
|
+
* before any signing. Observe-only — the `tx` argument is the
|
|
64
|
+
* compiled transaction; mutations have no effect on the signed
|
|
65
|
+
* transaction seal() ultimately submits.
|
|
66
|
+
*/
|
|
67
|
+
onBeforeSign?(ctx: SealHookContext, tx: Readonly<unknown>): void | Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Fires after `sendTransaction` resolves with a signature but
|
|
70
|
+
* potentially before confirmation. Use for starting distributed
|
|
71
|
+
* traces that the `onFinalize` hook closes.
|
|
72
|
+
*/
|
|
73
|
+
onAfterSend?(ctx: SealHookContext, signature: string): void | Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Fires in every error path inside `seal()` and
|
|
76
|
+
* `executeAndConfirm()`. Observe-only — the error is always rethrown
|
|
77
|
+
* after the hook runs.
|
|
78
|
+
*/
|
|
79
|
+
onError?(ctx: SealHookContext, err: Error): void | Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Fires on the success path of `executeAndConfirm()` only, after
|
|
82
|
+
* confirmation. Standalone `seal()` callers do not see this hook
|
|
83
|
+
* (the result is returned synchronously from `seal()` itself).
|
|
84
|
+
*/
|
|
85
|
+
onFinalize?(ctx: SealHookContext, result: Readonly<{
|
|
86
|
+
signature: string;
|
|
87
|
+
}>): void | Promise<void>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Compose two `SealHooks` objects — each stage runs `outer[stage]`
|
|
91
|
+
* first, then `inner[stage]`. Throws from either hook are caught by
|
|
92
|
+
* `invokeHook` and do NOT propagate. Used to merge client-level hooks
|
|
93
|
+
* (from `SigilClientConfig.hooks`) with per-call hooks
|
|
94
|
+
* (from `ClientSealOpts.hooks` / `SealParams.hooks`).
|
|
95
|
+
*/
|
|
96
|
+
export declare function composeHooks(outer?: SealHooks, inner?: SealHooks): SealHooks | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Safely invoke a hook by name with arbitrary args. Swallows throws
|
|
99
|
+
* and logs them via `getSigilModuleLogger().warn` so consumer hooks
|
|
100
|
+
* can't corrupt `seal()`'s atomic-transaction guarantee. Returns
|
|
101
|
+
* whatever the hook returned (for `onBeforeBuild`'s `skipSeal` path);
|
|
102
|
+
* returns `undefined` if the hook threw.
|
|
103
|
+
*
|
|
104
|
+
* @internal — used by `seal.ts` and `SigilVault.execute`.
|
|
105
|
+
*/
|
|
106
|
+
export declare function invokeHook<K extends keyof SealHooks>(hooks: SealHooks | undefined, key: K, ...args: any[]): Promise<any>;
|
|
107
|
+
/**
|
|
108
|
+
* Generate a short correlation ID for a single `seal()` invocation.
|
|
109
|
+
* Not cryptographically strong — just unique enough for log grepping.
|
|
110
|
+
* Prefers `crypto.randomUUID()` when available; falls back to a
|
|
111
|
+
* timestamp + random counter in older Node versions.
|
|
112
|
+
*/
|
|
113
|
+
export declare function newCorrelationId(): string;
|
|
114
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;IACvC,yEAAyE;IACzE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAID;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;I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AAE,GAEb,OAAO,CAAC,GAAG,CAAC,CAiBd;AAID;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CASzC"}
|
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SealHooks — pluggable lifecycle observability for `seal()` and
|
|
3
|
+
* `SigilClient.executeAndConfirm()`.
|
|
4
|
+
*
|
|
5
|
+
* Rationale: Sprint 1's `SigilClientConfig.onError` was a single post-
|
|
6
|
+
* send telemetry callback — useful but narrow. Consumers building agent
|
|
7
|
+
* frameworks need correlation IDs, pre-build rewrites, and per-stage
|
|
8
|
+
* spans for distributed tracing. `SealHooks` is the observe-only
|
|
9
|
+
* superset that handles those cases without compromising `seal()`'s
|
|
10
|
+
* atomicity guarantee.
|
|
11
|
+
*
|
|
12
|
+
* Semantics:
|
|
13
|
+
* - All hooks are **observe-only** by default. A hook that throws is
|
|
14
|
+
* caught, logged via `getSigilModuleLogger().warn`, and swallowed;
|
|
15
|
+
* `seal()` continues.
|
|
16
|
+
* - `onBeforeBuild` is the only hook that may abort. Returning
|
|
17
|
+
* `{ skipSeal: true, reason }` throws
|
|
18
|
+
* `SigilSdkDomainError(SIGIL_ERROR__SDK__HOOK_ABORTED)` before any
|
|
19
|
+
* RPC round-trip. Use for consent flows, feature flags, dry-run
|
|
20
|
+
* mode.
|
|
21
|
+
* - `onFinalize` fires **only** on success (from
|
|
22
|
+
* `executeAndConfirm`). Standalone `seal()` callers don't see it —
|
|
23
|
+
* they have the result in hand.
|
|
24
|
+
*/
|
|
25
|
+
import { getSigilModuleLogger } from "./logger.js";
|
|
26
|
+
// ─── Compose ────────────────────────────────────────────────────────────────
|
|
27
|
+
/**
|
|
28
|
+
* Compose two `SealHooks` objects — each stage runs `outer[stage]`
|
|
29
|
+
* first, then `inner[stage]`. Throws from either hook are caught by
|
|
30
|
+
* `invokeHook` and do NOT propagate. Used to merge client-level hooks
|
|
31
|
+
* (from `SigilClientConfig.hooks`) with per-call hooks
|
|
32
|
+
* (from `ClientSealOpts.hooks` / `SealParams.hooks`).
|
|
33
|
+
*/
|
|
34
|
+
export function composeHooks(outer, inner) {
|
|
35
|
+
if (!outer && !inner)
|
|
36
|
+
return undefined;
|
|
37
|
+
if (!outer)
|
|
38
|
+
return inner;
|
|
39
|
+
if (!inner)
|
|
40
|
+
return outer;
|
|
41
|
+
return {
|
|
42
|
+
async onBeforeBuild(ctx, params) {
|
|
43
|
+
const outerResult = await outer.onBeforeBuild?.(ctx, params);
|
|
44
|
+
if (outerResult && outerResult.skipSeal)
|
|
45
|
+
return outerResult;
|
|
46
|
+
const innerResult = await inner.onBeforeBuild?.(ctx, params);
|
|
47
|
+
if (innerResult && innerResult.skipSeal)
|
|
48
|
+
return innerResult;
|
|
49
|
+
},
|
|
50
|
+
async onBeforeSign(ctx, tx) {
|
|
51
|
+
await outer.onBeforeSign?.(ctx, tx);
|
|
52
|
+
await inner.onBeforeSign?.(ctx, tx);
|
|
53
|
+
},
|
|
54
|
+
async onAfterSend(ctx, sig) {
|
|
55
|
+
await outer.onAfterSend?.(ctx, sig);
|
|
56
|
+
await inner.onAfterSend?.(ctx, sig);
|
|
57
|
+
},
|
|
58
|
+
async onError(ctx, err) {
|
|
59
|
+
await outer.onError?.(ctx, err);
|
|
60
|
+
await inner.onError?.(ctx, err);
|
|
61
|
+
},
|
|
62
|
+
async onFinalize(ctx, result) {
|
|
63
|
+
await outer.onFinalize?.(ctx, result);
|
|
64
|
+
await inner.onFinalize?.(ctx, result);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
// ─── invokeHook — safe-call with error swallow + logger route ──────────────
|
|
69
|
+
/**
|
|
70
|
+
* Safely invoke a hook by name with arbitrary args. Swallows throws
|
|
71
|
+
* and logs them via `getSigilModuleLogger().warn` so consumer hooks
|
|
72
|
+
* can't corrupt `seal()`'s atomic-transaction guarantee. Returns
|
|
73
|
+
* whatever the hook returned (for `onBeforeBuild`'s `skipSeal` path);
|
|
74
|
+
* returns `undefined` if the hook threw.
|
|
75
|
+
*
|
|
76
|
+
* @internal — used by `seal.ts` and `SigilVault.execute`.
|
|
77
|
+
*/
|
|
78
|
+
export async function invokeHook(hooks, key,
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
|
+
...args
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
+
) {
|
|
83
|
+
if (!hooks)
|
|
84
|
+
return undefined;
|
|
85
|
+
const fn = hooks[key];
|
|
86
|
+
if (!fn)
|
|
87
|
+
return undefined;
|
|
88
|
+
try {
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
90
|
+
return await fn.apply(hooks, args);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
getSigilModuleLogger().warn(`[SealHooks] ${String(key)} threw — swallowed to preserve seal() atomicity`, {
|
|
94
|
+
hook: String(key),
|
|
95
|
+
error: err instanceof Error ? err.message : String(err),
|
|
96
|
+
});
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// ─── correlationId helper ───────────────────────────────────────────────────
|
|
101
|
+
/**
|
|
102
|
+
* Generate a short correlation ID for a single `seal()` invocation.
|
|
103
|
+
* Not cryptographically strong — just unique enough for log grepping.
|
|
104
|
+
* Prefers `crypto.randomUUID()` when available; falls back to a
|
|
105
|
+
* timestamp + random counter in older Node versions.
|
|
106
|
+
*/
|
|
107
|
+
export function newCorrelationId() {
|
|
108
|
+
// crypto is available in Node 14.17+ and all modern browsers.
|
|
109
|
+
const g = globalThis;
|
|
110
|
+
if (g.crypto?.randomUUID)
|
|
111
|
+
return g.crypto.randomUUID();
|
|
112
|
+
// Fallback: timestamp + 8 hex chars of random.
|
|
113
|
+
const rand = Math.floor(Math.random() * 0xffffffff)
|
|
114
|
+
.toString(16)
|
|
115
|
+
.padStart(8, "0");
|
|
116
|
+
return `seal-${Date.now().toString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CAAC;AACH,CAAC;AAED,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB;IAC9B,8DAA8D;IAC9D,MAAM,CAAC,GAAG,UAAwD,CAAC;IACnE,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU;QAAE,OAAO,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IACvD,+CAA+C;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC;SAChD,QAAQ,CAAC,EAAE,CAAC;SACZ,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACpB,OAAO,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;AACnD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./generated/index.js";
|
|
1
|
+
export * from "./generated/accounts/index.js";
|
|
2
2
|
export { SIGIL_PROGRAM_ADDRESS, FEE_RATE_DENOMINATOR, PROTOCOL_FEE_RATE, MAX_DEVELOPER_FEE_RATE, PROTOCOL_TREASURY, USD_DECIMALS, type UsdBaseUnits, type CapabilityTier, type Slot, usd, capability, slot, MAX_AGENTS_PER_VAULT, MAX_ALLOWED_PROTOCOLS, FULL_CAPABILITY, FULL_PERMISSIONS, MAX_ESCROW_DURATION, TOKEN_PROGRAM_ADDRESS, TOKEN_2022_PROGRAM_ADDRESS, ATA_PROGRAM_ADDRESS, COMPUTE_BUDGET_PROGRAM_ADDRESS, SYSTEM_PROGRAM_ADDRESS, SUPPORTED_PROTOCOLS, type ProtocolMeta, MAX_SLIPPAGE_BPS, EPOCH_DURATION, NUM_EPOCHS, PROTOCOL_MODE_ALL, PROTOCOL_MODE_ALLOWLIST, PROTOCOL_MODE_DENYLIST, USDC_MINT_DEVNET, USDC_MINT_MAINNET, USDT_MINT_DEVNET, USDT_MINT_MAINNET, JUPITER_PROGRAM_ADDRESS, RECOGNIZED_DEFI_PROGRAMS, isStablecoinMint, parseActionType, isSpendingAction, getPositionEffect, validateNetwork, normalizeNetwork, toInstruction, OVERLAY_EPOCH_DURATION, OVERLAY_NUM_EPOCHS, ROLLING_WINDOW_SECONDS, U64_MAX, } from "./types.js";
|
|
3
3
|
export type { Network, NetworkInput, PositionEffect } from "./types.js";
|
|
4
4
|
export { resolveVaultState, resolveVaultStateForOwner, resolveVaultBudget, getRolling24hUsd, getAgentRolling24hUsd, getProtocolSpend, getSpendingHistory, bytesToAddress, findVaultsByOwner, findEscrowsByVault, findSessionsByVault, getPendingPolicyForVault, getPendingConstraintsForVault, } from "./state-resolver.js";
|
|
@@ -56,10 +56,23 @@ export { seal, createSigilClient,
|
|
|
56
56
|
SigilClient, replaceAgentAtas, } from "./seal.js";
|
|
57
57
|
export type { SigilClientApi } from "./seal.js";
|
|
58
58
|
export type { SealParams, SealResult, SigilClientConfig, ClientSealOpts, ExecuteResult, } from "./seal.js";
|
|
59
|
+
export { Sigil } from "./sigil.js";
|
|
60
|
+
export type { SigilQuickstartOptions, SigilQuickstartResult, FundedOutcome, FromVaultOptions, } from "./sigil.js";
|
|
61
|
+
export { SigilVault } from "./vault-handle.js";
|
|
62
|
+
export type { SigilVaultExecuteOptions, SigilVaultInternalState, TxOpts as SigilVaultTxOpts, TxResult as SigilVaultTxResult, } from "./vault-handle.js";
|
|
63
|
+
export { composeHooks, invokeHook, newCorrelationId } from "./hooks.js";
|
|
64
|
+
export type { SealHooks, SealHookContext, SealHookAbort, OnBeforeBuildResult, } from "./hooks.js";
|
|
65
|
+
export { runPlugins, validatePluginList } from "./plugin.js";
|
|
66
|
+
export type { SigilPolicyPlugin, PluginContext, PluginResult, PluginAllow, PluginReject, } from "./plugin.js";
|
|
59
67
|
export { createVault, createAndSendVault } from "./create-vault.js";
|
|
60
68
|
export type { CreateVaultOptions, CreateVaultResult, CreateAndSendVaultOptions, CreateAndSendVaultResult, } from "./create-vault.js";
|
|
61
|
-
export { VAULT_PRESETS, getPreset, listPresets, presetToCreateVaultFields, } from "./presets.js";
|
|
62
|
-
export type { VaultPreset, PresetName } from "./presets.js";
|
|
69
|
+
export { VAULT_PRESETS, getPreset, listPresets, presetToCreateVaultFields, SAFETY_PRESETS, applySafetyPreset, requireResolvedSafetyPreset, } from "./presets.js";
|
|
70
|
+
export type { VaultPreset, PresetName, SafetyPresetFields, SafetyPresetName, } from "./presets.js";
|
|
71
|
+
export { parseUsd } from "./helpers/parse-usd.js";
|
|
72
|
+
export { initializeVaultAtas, type InitializeVaultAtasParams, } from "./helpers/ata.js";
|
|
73
|
+
export { validateAgentCapAggregate, type ValidateAgentCapAggregateParams, } from "./helpers/validate-cap-aggregate.js";
|
|
74
|
+
export { NOOP_LOGGER, createConsoleLogger, resolveLogger, setSigilModuleLogger, getSigilModuleLogger, type SigilLogger, } from "./logger.js";
|
|
75
|
+
export { SOLANA_DEVNET_GENESIS_HASH, SOLANA_MAINNET_GENESIS_HASH, } from "./seal.js";
|
|
63
76
|
export { buildOwnerTransaction } from "./owner-transaction.js";
|
|
64
77
|
export type { BuildOwnerTransactionParams, OwnerTransactionResult, } from "./owner-transaction.js";
|
|
65
78
|
export { mapPoliciesToVaultParams, findNextVaultId, inscribe, withVault, } from "./inscribe.js";
|
|
@@ -76,7 +89,7 @@ export { ShieldConfigError } from "./core/index.js";
|
|
|
76
89
|
export { evaluatePolicy, enforcePolicy, recordTransaction, } from "./core/index.js";
|
|
77
90
|
export { KNOWN_PROTOCOLS, KNOWN_TOKENS, SYSTEM_PROGRAMS, getTokenInfo, getProtocolName, isKnownProtocol, isSystemProgram, } from "./core/index.js";
|
|
78
91
|
export type { ShieldStorage, SpendEntry, TxEntry } from "./core/index.js";
|
|
79
|
-
export { SigilError as SigilKitError, SigilShieldError, SigilTeeError, SigilX402Error, SigilComposeError, SigilSdkDomainError, SigilRpcError, SIGIL_KIT_VERSION, walk as walkSigilCause, type SigilErrorParameters, type SigilErrorCode, type SigilShieldErrorCode, type SigilTeeErrorCode, type SigilComposeErrorCode, type SigilX402ErrorCode, type SigilSdkErrorCode, type SigilRpcErrorCode, type SigilProgramErrorCode, type SigilErrorContext,
|
|
92
|
+
export { SigilError as SigilKitError, SigilShieldError, SigilTeeError, SigilX402Error, SigilComposeError, SigilSdkDomainError, SigilRpcError, SIGIL_KIT_VERSION, walk as walkSigilCause, type SigilErrorParameters, type SigilErrorCode, type SigilShieldErrorCode, type SigilTeeErrorCode, type SigilComposeErrorCode, type SigilX402ErrorCode, type SigilSdkErrorCode, type SigilRpcErrorCode, type SigilProgramErrorCode, type SigilErrorContext, } from "./errors/index.js";
|
|
80
93
|
/** Per-module discriminated union of x402 errors (viem ErrorType pattern). */
|
|
81
94
|
export type X402ErrorType = import("./x402/errors.js").X402ParseError | import("./x402/errors.js").X402PaymentError | import("./x402/errors.js").X402UnsupportedError | import("./x402/errors.js").X402DestinationBlockedError | import("./x402/errors.js").X402ReplayError;
|
|
82
95
|
/** Per-module discriminated union of TEE errors. */
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,cAAc,+BAA+B,CAAC;AAW9C,OAAO,EAEL,qBAAqB,EAErB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EAEjB,YAAY,EAEZ,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,GAAG,EACH,UAAU,EACV,IAAI,EAEJ,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAEhB,mBAAmB,EAEnB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,8BAA8B,EAC9B,sBAAsB,EAEtB,mBAAmB,EACnB,KAAK,YAA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