@usesigil/kit 0.10.0 → 0.12.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 +230 -17
- package/dist/agent-errors.d.ts +3 -3
- package/dist/agent-errors.d.ts.map +1 -1
- package/dist/agent-errors.js +44 -8
- package/dist/agent-errors.js.map +1 -1
- package/dist/create-vault.d.ts.map +1 -1
- package/dist/create-vault.js +7 -11
- package/dist/create-vault.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 +7 -1
- 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 +1 -1
- package/dist/errors/public.d.ts.map +1 -1
- package/dist/errors/public.js +1 -1
- package/dist/errors/public.js.map +1 -1
- package/dist/generated/accounts/sessionAuthority.d.ts +24 -0
- package/dist/generated/accounts/sessionAuthority.d.ts.map +1 -1
- package/dist/generated/accounts/sessionAuthority.js +12 -2
- package/dist/generated/accounts/sessionAuthority.js.map +1 -1
- package/dist/generated/errors/sigil.d.ts +11 -7
- package/dist/generated/errors/sigil.d.ts.map +1 -1
- package/dist/generated/errors/sigil.js +13 -7
- package/dist/generated/errors/sigil.js.map +1 -1
- package/dist/generated/types/constraintEntry.d.ts +10 -0
- package/dist/generated/types/constraintEntry.d.ts.map +1 -1
- package/dist/generated/types/constraintEntry.js.map +1 -1
- package/dist/generated/types/constraintEntryZC.d.ts +27 -0
- package/dist/generated/types/constraintEntryZC.d.ts.map +1 -1
- package/dist/generated/types/constraintEntryZC.js +4 -2
- package/dist/generated/types/constraintEntryZC.js.map +1 -1
- package/dist/generated/types/constraintsChangeApplied.d.ts +11 -3
- package/dist/generated/types/constraintsChangeApplied.d.ts.map +1 -1
- package/dist/generated/types/constraintsChangeApplied.js +9 -3
- package/dist/generated/types/constraintsChangeApplied.js.map +1 -1
- package/dist/generated/types/constraintsChangeQueued.d.ts +11 -3
- package/dist/generated/types/constraintsChangeQueued.d.ts.map +1 -1
- package/dist/generated/types/constraintsChangeQueued.js +9 -3
- package/dist/generated/types/constraintsChangeQueued.js.map +1 -1
- package/dist/generated/types/discriminatorFormat.d.ts +8 -0
- package/dist/generated/types/discriminatorFormat.d.ts.map +1 -1
- package/dist/generated/types/discriminatorFormat.js +8 -0
- package/dist/generated/types/discriminatorFormat.js.map +1 -1
- package/dist/generated/types/instructionConstraintsCreated.d.ts +11 -3
- package/dist/generated/types/instructionConstraintsCreated.d.ts.map +1 -1
- package/dist/generated/types/instructionConstraintsCreated.js +9 -3
- package/dist/generated/types/instructionConstraintsCreated.js.map +1 -1
- package/dist/generated/types/postAssertionEntry.d.ts +6 -0
- package/dist/generated/types/postAssertionEntry.d.ts.map +1 -1
- package/dist/generated/types/postAssertionEntry.js +6 -0
- package/dist/generated/types/postAssertionEntry.js.map +1 -1
- package/dist/generated/types/postAssertionEntryZC.d.ts +22 -6
- package/dist/generated/types/postAssertionEntryZC.d.ts.map +1 -1
- package/dist/generated/types/postAssertionEntryZC.js +6 -2
- package/dist/generated/types/postAssertionEntryZC.js.map +1 -1
- 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 +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +155 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +130 -0
- package/dist/plugin.js.map +1 -0
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.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 +84 -31
- package/dist/seal.d.ts.map +1 -1
- package/dist/seal.js +194 -29
- package/dist/seal.js.map +1 -1
- package/dist/sigil.d.ts +187 -0
- package/dist/sigil.d.ts.map +1 -0
- package/dist/sigil.js +207 -0
- package/dist/sigil.js.map +1 -0
- package/dist/state-resolver.d.ts.map +1 -1
- package/dist/state-resolver.js +3 -3
- package/dist/state-resolver.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/package.json +16 -2
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SigilPolicyPlugin — consumer-supplied policy checks that run inside
|
|
3
|
+
* the `seal()` pre-flight.
|
|
4
|
+
*
|
|
5
|
+
* Plugins are the **rejection surface** of the SDK — distinct from
|
|
6
|
+
* `SealHooks`, which are observe-only. A plugin's `check()` returns
|
|
7
|
+
* either `{ allow: true }` or `{ allow: false, reason, code? }`; the
|
|
8
|
+
* first rejection short-circuits and `seal()` throws
|
|
9
|
+
* `SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED)`.
|
|
10
|
+
*
|
|
11
|
+
* Run order inside `seal()`:
|
|
12
|
+
* 1. Parameter validation (basic shape checks)
|
|
13
|
+
* 2. `hooks.onBeforeBuild` — may abort cleanly via `{ skipSeal: true }`
|
|
14
|
+
* 3. `resolveVaultState` — fetches AgentVault + PolicyConfig + SpendTracker + Overlay
|
|
15
|
+
* 4. Vault-active + agent-registered + agent-not-paused gates
|
|
16
|
+
* 5. **Plugin checks** — first `{ allow: false }` throws. Plugins see
|
|
17
|
+
* the resolved on-chain state via `PluginContext.state`. NOTE: the
|
|
18
|
+
* zero-capability check runs AFTER plugins (step 7), so a plugin
|
|
19
|
+
* MAY observe `state.capabilityTier === 0`; plugins relying on a
|
|
20
|
+
* non-zero capability must assert it themselves before allowing.
|
|
21
|
+
* 6. Amount/protocol/constraint checks (spending gates, allowlist, max)
|
|
22
|
+
* 7. Agent-capability zero-check + transaction assembly
|
|
23
|
+
* 8. `hooks.onBeforeSign` — final observe-only point before return
|
|
24
|
+
*
|
|
25
|
+
* Plugins run AFTER state resolution by design — 2 of 3 real plugin
|
|
26
|
+
* categories (rate limiting, compliance) need state input. Consumers who
|
|
27
|
+
* want stateless early-exit use `onBeforeBuild` with
|
|
28
|
+
* `{ skipSeal: true, reason }` — that path runs before any RPC.
|
|
29
|
+
*
|
|
30
|
+
* Plugins MUST NOT perform their own RPC calls — they receive the
|
|
31
|
+
* pre-resolved state as context. Async plugin `check()` is supported
|
|
32
|
+
* for cases where the plugin delegates to an external service
|
|
33
|
+
* (feature-flag servers, compliance APIs) but the plugin runner will
|
|
34
|
+
* log a warning if any plugin takes >1s.
|
|
35
|
+
*
|
|
36
|
+
* Consumer-supplied logger + hooks still fire around plugin execution
|
|
37
|
+
* (a rejecting plugin triggers `onError` before the throw propagates).
|
|
38
|
+
*/
|
|
39
|
+
import { SigilSdkDomainError } from "./errors/sdk.js";
|
|
40
|
+
import { SIGIL_ERROR__SDK__PLUGIN_REJECTED, SIGIL_ERROR__SDK__INVALID_CONFIG, } from "./errors/codes.js";
|
|
41
|
+
import { getSigilModuleLogger } from "./logger.js";
|
|
42
|
+
// ─── Plugin runner ──────────────────────────────────────────────────────────
|
|
43
|
+
/**
|
|
44
|
+
* Run every plugin's `check()` in registration order. Returns on the
|
|
45
|
+
* first rejection with a `SigilSdkDomainError`; otherwise returns
|
|
46
|
+
* successfully. Plugins that take >1 second log a warning via the
|
|
47
|
+
* module logger.
|
|
48
|
+
*
|
|
49
|
+
* Throws:
|
|
50
|
+
* - `SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED)` on first
|
|
51
|
+
* plugin that returns `{ allow: false }` OR throws.
|
|
52
|
+
*
|
|
53
|
+
* @internal — consumers invoke this via `seal()` / `SigilClient`.
|
|
54
|
+
*/
|
|
55
|
+
export async function runPlugins(plugins, ctx) {
|
|
56
|
+
if (!plugins || plugins.length === 0)
|
|
57
|
+
return;
|
|
58
|
+
for (const plugin of plugins) {
|
|
59
|
+
const start = Date.now();
|
|
60
|
+
let result;
|
|
61
|
+
try {
|
|
62
|
+
result = await plugin.check(ctx);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
const message = err instanceof Error ? err.message : String(err ?? "unknown");
|
|
66
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED, `Plugin "${plugin.name}" threw during check(): ${message}`, {
|
|
67
|
+
cause: err,
|
|
68
|
+
context: {
|
|
69
|
+
plugin: plugin.name,
|
|
70
|
+
reason: message,
|
|
71
|
+
correlationId: ctx.correlationId,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const elapsedMs = Date.now() - start;
|
|
76
|
+
if (elapsedMs > 1000) {
|
|
77
|
+
getSigilModuleLogger().warn(`[SigilPolicyPlugin] "${plugin.name}" took ${elapsedMs}ms — plugin checks should be fast`, { plugin: plugin.name, elapsedMs });
|
|
78
|
+
}
|
|
79
|
+
if (!result.allow) {
|
|
80
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED, `Plugin "${plugin.name}" rejected the operation: ${result.reason}`, {
|
|
81
|
+
context: {
|
|
82
|
+
plugin: plugin.name,
|
|
83
|
+
reason: result.reason,
|
|
84
|
+
code: result.code,
|
|
85
|
+
metadata: result.metadata,
|
|
86
|
+
correlationId: ctx.correlationId,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// ─── Plugin list validation ─────────────────────────────────────────────────
|
|
93
|
+
/**
|
|
94
|
+
* Validate a plugin list at client-construction time. Rejects:
|
|
95
|
+
* - Non-array input
|
|
96
|
+
* - Duplicate plugin names
|
|
97
|
+
* - Plugins without `name` or `check`
|
|
98
|
+
*
|
|
99
|
+
* Called by `createSigilClient` / `Sigil.quickstart` / `Sigil.fromVault`
|
|
100
|
+
* when `config.plugins` is present.
|
|
101
|
+
*/
|
|
102
|
+
export function validatePluginList(plugins) {
|
|
103
|
+
if (!Array.isArray(plugins)) {
|
|
104
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `SigilClientConfig.plugins must be an array of SigilPolicyPlugin (received ${typeof plugins})`, { context: { field: "plugins", expected: "SigilPolicyPlugin[]" } });
|
|
105
|
+
}
|
|
106
|
+
const names = new Set();
|
|
107
|
+
for (let i = 0; i < plugins.length; i++) {
|
|
108
|
+
const p = plugins[i];
|
|
109
|
+
if (!p || typeof p !== "object") {
|
|
110
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `Plugin at index ${i} is not an object (received ${typeof p})`, { context: { field: `plugins[${i}]`, expected: "object" } });
|
|
111
|
+
}
|
|
112
|
+
const pluginObj = p;
|
|
113
|
+
if (typeof pluginObj.name !== "string" || pluginObj.name.length === 0) {
|
|
114
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `Plugin at index ${i} is missing a non-empty string "name"`, { context: { field: `plugins[${i}].name`, expected: "string" } });
|
|
115
|
+
}
|
|
116
|
+
if (typeof pluginObj.check !== "function") {
|
|
117
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `Plugin "${pluginObj.name}" is missing a check() function`, {
|
|
118
|
+
context: {
|
|
119
|
+
field: `plugins[${pluginObj.name}].check`,
|
|
120
|
+
expected: "function",
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (names.has(pluginObj.name)) {
|
|
125
|
+
throw new SigilSdkDomainError(SIGIL_ERROR__SDK__INVALID_CONFIG, `Duplicate plugin name "${pluginObj.name}" — plugin names must be unique per client`, { context: { field: "plugins[].name", expected: "unique" } });
|
|
126
|
+
}
|
|
127
|
+
names.add(pluginObj.name);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA0GnD,+EAA+E;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAiD,EACjD,GAAkB;IAElB,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE7C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,IAAI,MAAoB,CAAC;QACzB,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GACX,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,SAAS,CAAC,CAAC;YAChE,MAAM,IAAI,mBAAmB,CAC3B,iCAAiC,EACjC,WAAW,MAAM,CAAC,IAAI,2BAA2B,OAAO,EAAE,EAC1D;gBACE,KAAK,EAAE,GAAG;gBACV,OAAO,EAAE;oBACP,MAAM,EAAE,MAAM,CAAC,IAAI;oBACnB,MAAM,EAAE,OAAO;oBACf,aAAa,EAAE,GAAG,CAAC,aAAa;iBACjC;aACF,CACF,CAA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,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
package/dist/presets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAyBpD,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,mBAAmB,EAAE,YAAY,CAAC;IAClC,qDAAqD;IACrD,qBAAqB,EAAE,YAAY,CAAC;IACpC,oCAAoC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAID,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;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AAI,CAAC,CAAC;IACpC,OAAO;QACL,gBAAgB,EAAE,SAAS,CAAC,gBAAgB,IAAI,MAAM,CAAC,gBAAgB;QACvE,gBAAgB,EAAE,SAAS,CAAC,gBAAgB,IAAI,MAAM,CAAC,gBAAgB;QACvE,mBAAmB,EACjB,SAAS,CAAC,mBAAmB,IAAI,MAAM,CAAC,mBAAmB;KAC9D,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAA0B;IAKpE,IAAI,MAAM,CAAC,gBAAgB,KAAK,IAAI,IAAI,MAAM,CAAC,mBAAmB,KAAK,IAAI,EAAE,CAAC;QAC5E,MAAM,IAAI,KAAK,CACb,6DAA6D;YAC3D,gEAAgE;YAChE,4DAA4D;YAC5D,4DAA4D;YAC5D,0BAA0B,CAC7B,CAAC;IACJ,CAAC;IACD,OAAO;QACL,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;KAChD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @usesigil/kit/react — React hooks for Sigil vault state.
|
|
3
|
+
*
|
|
4
|
+
* Four TanStack Query wrappers around `SigilVault` methods:
|
|
5
|
+
* - `useVaultBudget(vault)` — useQuery wrapping vault.budget()
|
|
6
|
+
* - `useVaultState(vault)` — useQuery wrapping the agent-side
|
|
7
|
+
* state-resolver primitive
|
|
8
|
+
* - `useOverview(vault, opts?)` — useQuery wrapping vault.overview()
|
|
9
|
+
* (owner-only; throws if called on an agent-only handle)
|
|
10
|
+
* - `useExecute(vault)` — useMutation wrapping vault.execute()
|
|
11
|
+
*
|
|
12
|
+
* Peer dependencies are **optional**: React and `@tanstack/react-query`
|
|
13
|
+
* are declared as peer deps in `package.json` under `peerDependenciesMeta`
|
|
14
|
+
* with `optional: true`. Consumers who don't use React never install them
|
|
15
|
+
* and never see a warning. Consumers who do import this subpath must
|
|
16
|
+
* install both.
|
|
17
|
+
*
|
|
18
|
+
* Query keys: every query key is namespaced under `"sigil"` so a
|
|
19
|
+
* consumer's existing TanStack cache never collides with SDK keys.
|
|
20
|
+
* Keys are derived from `vault.address` so multi-vault apps share keys
|
|
21
|
+
* per-vault without manual namespacing.
|
|
22
|
+
*
|
|
23
|
+
* Cache invalidation: the SDK does NOT call `queryClient.invalidateQueries`
|
|
24
|
+
* on its own. After an `execute()` mutation, the consumer decides which
|
|
25
|
+
* queries to refetch — typically `useExecute` is wrapped with a custom
|
|
26
|
+
* `onSuccess` that invalidates the specific vault keys.
|
|
27
|
+
*/
|
|
28
|
+
import type { SigilVault } from "../vault-handle.js";
|
|
29
|
+
import type { GetOverviewOptions } from "../dashboard/types.js";
|
|
30
|
+
/**
|
|
31
|
+
* Build a stable query key for a vault-bound query. Namespaced under
|
|
32
|
+
* `"sigil"` so the keys never collide with consumer app keys.
|
|
33
|
+
*/
|
|
34
|
+
export declare function sigilQueryKey(vault: SigilVault, sub: "state" | "budget" | "overview"): readonly unknown[];
|
|
35
|
+
/**
|
|
36
|
+
* `useVaultBudget(vault)` — read the vault's current rolling-24h
|
|
37
|
+
* budget via TanStack Query. Cheap call — re-runs as often as the
|
|
38
|
+
* query's `staleTime` allows (TQ default: 0ms).
|
|
39
|
+
*
|
|
40
|
+
* Returns the raw TQ `UseQueryResult<ResolvedBudget>` so consumers
|
|
41
|
+
* can read `.data`, `.isLoading`, `.error`, etc.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useVaultBudget(vault: SigilVault): any;
|
|
44
|
+
/**
|
|
45
|
+
* `useVaultState(vault)` — alias for `useVaultBudget` today; kept as
|
|
46
|
+
* a separate hook so Sprint 3 can swap in a richer state resolver
|
|
47
|
+
* without changing the consumer call shape.
|
|
48
|
+
*/
|
|
49
|
+
export declare function useVaultState(vault: SigilVault): any;
|
|
50
|
+
/**
|
|
51
|
+
* `useOverview(vault, opts?)` — read the full `OverviewData` via
|
|
52
|
+
* `OwnerClient.getOverview()`. Requires an owner signer on the
|
|
53
|
+
* handle — the query throws `SIGIL_ERROR__SDK__OWNER_REQUIRED` when
|
|
54
|
+
* called on an agent-only handle. TanStack surfaces the throw via
|
|
55
|
+
* `result.error`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function useOverview(vault: SigilVault, opts?: GetOverviewOptions): any;
|
|
58
|
+
/**
|
|
59
|
+
* `useExecute(vault)` — TanStack mutation wrapping `vault.execute`.
|
|
60
|
+
* Usage:
|
|
61
|
+
* const { mutate, mutateAsync, isPending } = useExecute(vault);
|
|
62
|
+
* mutate({ instructions: [...], opts: { tokenMint, amount, ... } });
|
|
63
|
+
*
|
|
64
|
+
* Consumer is responsible for `queryClient.invalidateQueries` on
|
|
65
|
+
* success — the SDK does not force a refetch of any specific keys,
|
|
66
|
+
* so the consumer's cache hygiene stays under their control.
|
|
67
|
+
*/
|
|
68
|
+
export declare function useExecute(vault: SigilVault): any;
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA6BH,OAAO,KAAK,EAAE,UAAU,EAA4B,MAAM,oBAAoB,CAAC;AAI/E,OAAO,KAAK,EAAgB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI9E;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,GACnC,SAAS,OAAO,EAAE,CAEpB;AAID;;;;;;;GAOG;AAEH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAMrD;AAED;;;;GAIG;AAEH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAMpD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,UAAU,EACjB,IAAI,CAAC,EAAE,kBAAkB,GAExB,GAAG,CAML;AAED;;;;;;;;;GASG;AAEH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAUjD"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @usesigil/kit/react — React hooks for Sigil vault state.
|
|
3
|
+
*
|
|
4
|
+
* Four TanStack Query wrappers around `SigilVault` methods:
|
|
5
|
+
* - `useVaultBudget(vault)` — useQuery wrapping vault.budget()
|
|
6
|
+
* - `useVaultState(vault)` — useQuery wrapping the agent-side
|
|
7
|
+
* state-resolver primitive
|
|
8
|
+
* - `useOverview(vault, opts?)` — useQuery wrapping vault.overview()
|
|
9
|
+
* (owner-only; throws if called on an agent-only handle)
|
|
10
|
+
* - `useExecute(vault)` — useMutation wrapping vault.execute()
|
|
11
|
+
*
|
|
12
|
+
* Peer dependencies are **optional**: React and `@tanstack/react-query`
|
|
13
|
+
* are declared as peer deps in `package.json` under `peerDependenciesMeta`
|
|
14
|
+
* with `optional: true`. Consumers who don't use React never install them
|
|
15
|
+
* and never see a warning. Consumers who do import this subpath must
|
|
16
|
+
* install both.
|
|
17
|
+
*
|
|
18
|
+
* Query keys: every query key is namespaced under `"sigil"` so a
|
|
19
|
+
* consumer's existing TanStack cache never collides with SDK keys.
|
|
20
|
+
* Keys are derived from `vault.address` so multi-vault apps share keys
|
|
21
|
+
* per-vault without manual namespacing.
|
|
22
|
+
*
|
|
23
|
+
* Cache invalidation: the SDK does NOT call `queryClient.invalidateQueries`
|
|
24
|
+
* on its own. After an `execute()` mutation, the consumer decides which
|
|
25
|
+
* queries to refetch — typically `useExecute` is wrapped with a custom
|
|
26
|
+
* `onSuccess` that invalidates the specific vault keys.
|
|
27
|
+
*/
|
|
28
|
+
// ─── Peer-dep shim ──────────────────────────────────────────────────────────
|
|
29
|
+
//
|
|
30
|
+
// We can't `import { useQuery }` statically because doing so would make
|
|
31
|
+
// `@tanstack/react-query` a hard dependency at module-load time — a
|
|
32
|
+
// consumer who uses `@usesigil/kit` without touching `/react` would
|
|
33
|
+
// see a resolution error on every kit import. Instead, this subpath
|
|
34
|
+
// imports TanStack lazily via `require()` at the use site, inside the
|
|
35
|
+
// hook body. Each hook calls a one-time dynamic import that throws a
|
|
36
|
+
// clear error if the peer dep isn't installed.
|
|
37
|
+
function requireTanstack() {
|
|
38
|
+
try {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
40
|
+
return require("@tanstack/react-query");
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
throw new Error("@usesigil/kit/react requires `@tanstack/react-query` as a peer dependency. " +
|
|
44
|
+
"Install it via `npm install @tanstack/react-query react` and retry.");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// ─── Query-key helpers ──────────────────────────────────────────────────────
|
|
48
|
+
/**
|
|
49
|
+
* Build a stable query key for a vault-bound query. Namespaced under
|
|
50
|
+
* `"sigil"` so the keys never collide with consumer app keys.
|
|
51
|
+
*/
|
|
52
|
+
export function sigilQueryKey(vault, sub) {
|
|
53
|
+
return ["sigil", vault.address, sub];
|
|
54
|
+
}
|
|
55
|
+
// ─── Hooks ──────────────────────────────────────────────────────────────────
|
|
56
|
+
/**
|
|
57
|
+
* `useVaultBudget(vault)` — read the vault's current rolling-24h
|
|
58
|
+
* budget via TanStack Query. Cheap call — re-runs as often as the
|
|
59
|
+
* query's `staleTime` allows (TQ default: 0ms).
|
|
60
|
+
*
|
|
61
|
+
* Returns the raw TQ `UseQueryResult<ResolvedBudget>` so consumers
|
|
62
|
+
* can read `.data`, `.isLoading`, `.error`, etc.
|
|
63
|
+
*/
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
65
|
+
export function useVaultBudget(vault) {
|
|
66
|
+
const { useQuery } = requireTanstack();
|
|
67
|
+
return useQuery({
|
|
68
|
+
queryKey: sigilQueryKey(vault, "budget"),
|
|
69
|
+
queryFn: () => vault.budget(),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* `useVaultState(vault)` — alias for `useVaultBudget` today; kept as
|
|
74
|
+
* a separate hook so Sprint 3 can swap in a richer state resolver
|
|
75
|
+
* without changing the consumer call shape.
|
|
76
|
+
*/
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
|
+
export function useVaultState(vault) {
|
|
79
|
+
const { useQuery } = requireTanstack();
|
|
80
|
+
return useQuery({
|
|
81
|
+
queryKey: sigilQueryKey(vault, "state"),
|
|
82
|
+
queryFn: () => vault.budget(),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* `useOverview(vault, opts?)` — read the full `OverviewData` via
|
|
87
|
+
* `OwnerClient.getOverview()`. Requires an owner signer on the
|
|
88
|
+
* handle — the query throws `SIGIL_ERROR__SDK__OWNER_REQUIRED` when
|
|
89
|
+
* called on an agent-only handle. TanStack surfaces the throw via
|
|
90
|
+
* `result.error`.
|
|
91
|
+
*/
|
|
92
|
+
export function useOverview(vault, opts) {
|
|
93
|
+
const { useQuery } = requireTanstack();
|
|
94
|
+
return useQuery({
|
|
95
|
+
queryKey: [...sigilQueryKey(vault, "overview"), opts ?? null],
|
|
96
|
+
queryFn: () => vault.overview(opts),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* `useExecute(vault)` — TanStack mutation wrapping `vault.execute`.
|
|
101
|
+
* Usage:
|
|
102
|
+
* const { mutate, mutateAsync, isPending } = useExecute(vault);
|
|
103
|
+
* mutate({ instructions: [...], opts: { tokenMint, amount, ... } });
|
|
104
|
+
*
|
|
105
|
+
* Consumer is responsible for `queryClient.invalidateQueries` on
|
|
106
|
+
* success — the SDK does not force a refetch of any specific keys,
|
|
107
|
+
* so the consumer's cache hygiene stays under their control.
|
|
108
|
+
*/
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
|
+
export function useExecute(vault) {
|
|
111
|
+
const { useMutation } = requireTanstack();
|
|
112
|
+
return useMutation({
|
|
113
|
+
mutationFn: async (args) => {
|
|
114
|
+
return vault.execute(args.instructions, args.opts);
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH,+EAA+E;AAC/E,EAAE;AACF,wEAAwE;AACxE,oEAAoE;AACpE,oEAAoE;AACpE,oEAAoE;AACpE,sEAAsE;AACtE,qEAAqE;AACrE,+CAA+C;AAE/C,SAAS,eAAe;IACtB,IAAI,CAAC;QACH,iEAAiE;QACjE,OAAO,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,6EAA6E;YAC3E,qEAAqE,CACxE,CAAC;IACJ,CAAC;AACH,CAAC;AAUD,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAiB,EACjB,GAAoC;IAEpC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,CAAU,CAAC;AAChD,CAAC;AAED,+EAA+E;AAE/E;;;;;;;GAOG;AACH,8DAA8D;AAC9D,MAAM,UAAU,cAAc,CAAC,KAAiB;IAC9C,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,CAAC;IACvC,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC;QACxC,OAAO,EAAE,GAA4B,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE;KACvD,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,KAAiB;IAC7C,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,CAAC;IACvC,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC;QACvC,OAAO,EAAE,GAA4B,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE;KACvD,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,KAAiB,EACjB,IAAyB;IAGzB,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,CAAC;IACvC,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,IAAI,IAAI,IAAI,CAAU;QACtE,OAAO,EAAE,GAA0B,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;KAC3D,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,8DAA8D;AAC9D,MAAM,UAAU,UAAU,CAAC,KAAiB;IAC1C,MAAM,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAAC;IAC1C,OAAO,WAAW,CAAC;QACjB,UAAU,EAAE,KAAK,EAAE,IAGlB,EAA0B,EAAE;YAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/seal.d.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { Address, AddressesByLookupTableAddress, Instruction, Rpc, SolanaRpcApi, TransactionSigner } from "./kit-adapter.js";
|
|
17
17
|
import { compileTransaction } from "./kit-adapter.js";
|
|
18
|
+
import { type SigilPolicyPlugin } from "./plugin.js";
|
|
18
19
|
import { type ResolvedVaultState, type ResolvedVaultStateForOwner, type ResolvedBudget } from "./state-resolver.js";
|
|
19
20
|
import { type Blockhash, type SendAndConfirmOptions } from "./rpc-helpers.js";
|
|
20
21
|
import { type AgentError } from "./agent-errors.js";
|
|
@@ -79,6 +80,33 @@ export interface SealParams {
|
|
|
79
80
|
maxCacheAgeMs?: number;
|
|
80
81
|
/** Additional agent ATA → vault ATA replacements for multi-token DeFi routes. */
|
|
81
82
|
additionalAtaReplacements?: Map<Address, Address>;
|
|
83
|
+
/**
|
|
84
|
+
* Sprint 2 (B3): optional lifecycle hooks. Observe-only except
|
|
85
|
+
* `onBeforeBuild` which may return `{ skipSeal: true, reason }` to
|
|
86
|
+
* cleanly abort before any RPC. Hook throws are caught and logged
|
|
87
|
+
* via `getSigilModuleLogger().warn` — they do NOT propagate.
|
|
88
|
+
*/
|
|
89
|
+
hooks?: import("./hooks.js").SealHooks;
|
|
90
|
+
/**
|
|
91
|
+
* Sprint 2 (B3): stable correlation ID. When omitted, `seal()`
|
|
92
|
+
* generates one via `newCorrelationId()` at the top of the call.
|
|
93
|
+
*/
|
|
94
|
+
correlationId?: string;
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
*
|
|
98
|
+
* Sprint 2 (B4): policy plugins threaded from `SigilClientConfig.plugins`
|
|
99
|
+
* via `clientSeal`. Bare-seal callers SHOULD NOT pass plugins here —
|
|
100
|
+
* plugins are client-level configuration that already goes through
|
|
101
|
+
* `validatePluginList()` at client construction. Direct use of this
|
|
102
|
+
* field bypasses that validation.
|
|
103
|
+
*
|
|
104
|
+
* Not exposed on `ClientSealOpts` (by design — prevents per-call
|
|
105
|
+
* plugin override). Only `clientSeal` injects this field after the
|
|
106
|
+
* `...opts` spread so per-call callers cannot override the set of
|
|
107
|
+
* client-level plugins for a single seal invocation.
|
|
108
|
+
*/
|
|
109
|
+
plugins?: readonly SigilPolicyPlugin[];
|
|
82
110
|
}
|
|
83
111
|
export interface SealResult {
|
|
84
112
|
ok: true;
|
|
@@ -156,6 +184,19 @@ export interface SigilClientConfig {
|
|
|
156
184
|
* injected logger so the bypass is observable in audit trails.
|
|
157
185
|
*/
|
|
158
186
|
skipGenesisAssertion?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Sprint 2 (B3): client-level seal hooks. Fire on every `seal()` +
|
|
189
|
+
* `executeAndConfirm()` call. Compose with per-call hooks
|
|
190
|
+
* (`ClientSealOpts.hooks`) via `composeHooks(clientHooks, perCall)`
|
|
191
|
+
* — client hooks run first.
|
|
192
|
+
*/
|
|
193
|
+
hooks?: import("./hooks.js").SealHooks;
|
|
194
|
+
/**
|
|
195
|
+
* Sprint 2 (B4): policy plugins. Run in registration order inside
|
|
196
|
+
* `seal()` pre-flight after `resolveVaultState`; first rejection
|
|
197
|
+
* throws `SigilSdkDomainError(SIGIL_ERROR__SDK__PLUGIN_REJECTED)`.
|
|
198
|
+
*/
|
|
199
|
+
plugins?: readonly import("./plugin.js").SigilPolicyPlugin[];
|
|
159
200
|
}
|
|
160
201
|
/**
|
|
161
202
|
* Options for `client.seal()`.
|
|
@@ -176,6 +217,16 @@ export interface ClientSealOpts {
|
|
|
176
217
|
cachedState?: ResolvedVaultState;
|
|
177
218
|
maxCacheAgeMs?: number;
|
|
178
219
|
additionalAtaReplacements?: Map<Address, Address>;
|
|
220
|
+
/**
|
|
221
|
+
* Sprint 2 (B3): per-call hooks. Compose with client-level hooks
|
|
222
|
+
* (`SigilClientConfig.hooks`) — client hooks run first, then per-call.
|
|
223
|
+
*/
|
|
224
|
+
hooks?: import("./hooks.js").SealHooks;
|
|
225
|
+
/**
|
|
226
|
+
* Sprint 2 (B3): stable correlation ID for trace correlation.
|
|
227
|
+
* Defaults to a fresh `newCorrelationId()` if omitted.
|
|
228
|
+
*/
|
|
229
|
+
correlationId?: string;
|
|
179
230
|
}
|
|
180
231
|
export interface ExecuteResult {
|
|
181
232
|
signature: string;
|
|
@@ -237,29 +288,30 @@ export interface SigilClientApi {
|
|
|
237
288
|
* ```
|
|
238
289
|
*/
|
|
239
290
|
export declare function createSigilClient(config: SigilClientConfig): SigilClientApi;
|
|
291
|
+
/**
|
|
292
|
+
* Async factory: run the genesis-hash assertion + delegate to
|
|
293
|
+
* {@link createSigilClient}. Returns the factory's `SigilClientApi`
|
|
294
|
+
* (which properly wires plugins, hooks, and caches) — NOT the
|
|
295
|
+
* deprecated `SigilClient` class (which does not wire plugins/hooks).
|
|
296
|
+
*
|
|
297
|
+
* This is what `Sigil.quickstart()` / `Sigil.fromVault()` use under
|
|
298
|
+
* the hood to get both:
|
|
299
|
+
* - genesis-hash cluster safety (previously only on the class path)
|
|
300
|
+
* - working plugin + hook wiring (only on the factory path)
|
|
301
|
+
*
|
|
302
|
+
* @param config - Full client config. All fields (plugins, hooks,
|
|
303
|
+
* logger) are forwarded to the factory after the assertion passes.
|
|
304
|
+
* @throws `SigilRpcError` if `getGenesisHash()` fails after retries.
|
|
305
|
+
* @throws `SigilSdkDomainError(INVALID_CONFIG)` if the cluster hash
|
|
306
|
+
* does not match `config.network`.
|
|
307
|
+
*/
|
|
308
|
+
export declare function createSigilClientAsync(config: SigilClientConfig): Promise<SigilClientApi>;
|
|
240
309
|
/** Canonical devnet genesis hash — Solana cluster identifier. */
|
|
241
310
|
export declare const SOLANA_DEVNET_GENESIS_HASH = "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG";
|
|
242
311
|
/** Canonical mainnet-beta genesis hash — Solana cluster identifier. */
|
|
243
312
|
export declare const SOLANA_MAINNET_GENESIS_HASH = "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d";
|
|
244
313
|
/** @internal — exposed for test resets only. */
|
|
245
314
|
export declare function _resetGenesisHashCache(): void;
|
|
246
|
-
/**
|
|
247
|
-
* @deprecated Use `createSigilClient(config)` or the async factory
|
|
248
|
-
* `SigilClient.create(config)` instead. This class will be removed at
|
|
249
|
-
* v1.0. The factory returns the same API surface as a plain object with
|
|
250
|
-
* closure-bound methods — no `this` binding issues, tree-shakeable, and
|
|
251
|
-
* aligned with the viem/Kit functional pattern.
|
|
252
|
-
*
|
|
253
|
-
* Migration:
|
|
254
|
-
* ```ts
|
|
255
|
-
* // Before:
|
|
256
|
-
* const client = new SigilClient({ rpc, vault, agent, network });
|
|
257
|
-
* // After (factory):
|
|
258
|
-
* const client = createSigilClient({ rpc, vault, agent, network });
|
|
259
|
-
* // After (async with genesis assertion):
|
|
260
|
-
* const client = await SigilClient.create({ rpc, vault, agent, network });
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
263
315
|
export declare class SigilClient {
|
|
264
316
|
private readonly blockhashCacheInstance;
|
|
265
317
|
private readonly altCacheInstance;
|
|
@@ -269,23 +321,24 @@ export declare class SigilClient {
|
|
|
269
321
|
readonly agent: TransactionSigner;
|
|
270
322
|
readonly network: "devnet" | "mainnet";
|
|
271
323
|
/**
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
324
|
+
* Private constructor — Sprint 2 carryover.
|
|
325
|
+
*
|
|
326
|
+
* Sprint 1 deprecated `new SigilClient(config)` in favor of the
|
|
327
|
+
* async factory `SigilClient.create(config)` which runs the
|
|
328
|
+
* genesis-hash assertion. Sprint 2 completes the migration by
|
|
329
|
+
* making the constructor `private`: external callers now get a TS
|
|
330
|
+
* compile error, and the runtime guard below throws on JS consumers
|
|
331
|
+
* that cast through `any` to bypass the compile-time check.
|
|
277
332
|
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
333
|
+
* The class remains exported so:
|
|
334
|
+
* - `SigilClient.create()` static factory still works.
|
|
335
|
+
* - `instanceof SigilClient` checks in tests still resolve.
|
|
336
|
+
* - The type `SigilClient` is still a first-class position.
|
|
282
337
|
*
|
|
283
|
-
* @
|
|
284
|
-
* `SigilClient.create()`
|
|
285
|
-
* (the async factory IS the recommended path; warning there would
|
|
286
|
-
* be misleading log spam). Not part of the public API.
|
|
338
|
+
* @internal — construction token is a module-private symbol only
|
|
339
|
+
* `SigilClient.create()` holds a reference to.
|
|
287
340
|
*/
|
|
288
|
-
constructor(
|
|
341
|
+
private constructor();
|
|
289
342
|
/**
|
|
290
343
|
* Async factory — constructs a `SigilClient` and asserts the RPC's
|
|
291
344
|
* genesis hash matches the configured `network`. Preferred entry
|
package/dist/seal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seal.d.ts","sourceRoot":"","sources":["../src/seal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,OAAO,EACP,6BAA6B,EAC7B,WAAW,EACX,GAAG,EACH,YAAY,EACZ,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAe,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"seal.d.ts","sourceRoot":"","sources":["../src/seal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,OAAO,EACP,6BAA6B,EAC7B,WAAW,EACX,GAAG,EACH,YAAY,EACZ,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAe,MAAM,kBAAkB,CAAC;AAQnE,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAMrB,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAE/B,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAC;AAmB1B,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEvE,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,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