@forgezero/runtime 0.1.8 → 0.1.9
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 +959 -224
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -91,12 +91,25 @@ bun add @forgezero/runtime
|
|
|
91
91
|
<a id="forgezero-runtime-query"></a>
|
|
92
92
|
## @forgezero/runtime/query
|
|
93
93
|
|
|
94
|
-
Provider-neutral typed function contracts: decode untrusted input, run with caller-supplied services or storage, and strictly validate the result without coupling business logic to ForgeZero or ArangoDB.
|
|
94
|
+
Provider-neutral typed function contracts: decode untrusted input, run with caller-supplied services or storage, and strictly validate the result without coupling business logic to ForgeZero or ArangoDB. This entry exposes 3 named value exports and 8 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
95
95
|
|
|
96
96
|
```text
|
|
97
|
-
import {
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
import {
|
|
98
|
+
QueryContractError,
|
|
99
|
+
defineQuery,
|
|
100
|
+
implementQuery,
|
|
101
|
+
} from '@forgezero/runtime/query';
|
|
102
|
+
|
|
103
|
+
import type {
|
|
104
|
+
QueryCodec,
|
|
105
|
+
QueryContract,
|
|
106
|
+
QueryDecode,
|
|
107
|
+
QueryExecution,
|
|
108
|
+
QueryImplementation,
|
|
109
|
+
QueryInput,
|
|
110
|
+
QueryIssue,
|
|
111
|
+
QueryOutput,
|
|
112
|
+
} from '@forgezero/runtime/query';
|
|
100
113
|
```
|
|
101
114
|
|
|
102
115
|
## @forgezero/runtime/query — Define and implement a typed query
|
|
@@ -104,8 +117,15 @@ import type { QueryIssue, QueryOutput } from '@forgezero/runtime/query';
|
|
|
104
117
|
Decode untrusted input and validate output around injected storage/services rather than embedding a database query in the route adapter.
|
|
105
118
|
|
|
106
119
|
```text
|
|
107
|
-
import {
|
|
108
|
-
|
|
120
|
+
import {
|
|
121
|
+
defineQuery,
|
|
122
|
+
implementQuery,
|
|
123
|
+
} from '@forgezero/runtime/query';
|
|
124
|
+
import {
|
|
125
|
+
T,
|
|
126
|
+
type Static,
|
|
127
|
+
typeboxQueryCodec,
|
|
128
|
+
} from '@forgezero/runtime/schema/typebox';
|
|
109
129
|
|
|
110
130
|
const OrderKey = T.Object({ orderKey: T.String({ minLength: 1 }) });
|
|
111
131
|
const Order = T.Object({ orderKey: T.String(), total: T.String() });
|
|
@@ -128,214 +148,519 @@ const order = await runFindOrder.execute(stores, { orderKey: 'ord_123' });
|
|
|
128
148
|
<a id="forgezero-runtime-jobs"></a>
|
|
129
149
|
## @forgezero/runtime/jobs
|
|
130
150
|
|
|
131
|
-
Background work that never overlaps itself, advances a cursor only on success, and can be paused and inspected.
|
|
132
|
-
|
|
133
|
-
```text
|
|
134
|
-
import {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
151
|
+
Background work that never overlaps itself, advances a cursor only on success, and can be paused and inspected. This entry exposes 9 named value exports and 14 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
152
|
+
|
|
153
|
+
```text
|
|
154
|
+
import {
|
|
155
|
+
VERSION,
|
|
156
|
+
createScheduler,
|
|
157
|
+
cursorJob,
|
|
158
|
+
defineJob,
|
|
159
|
+
everyMs,
|
|
160
|
+
memoryLock,
|
|
161
|
+
nextWallClockAt,
|
|
162
|
+
storeLock,
|
|
163
|
+
systemClock,
|
|
164
|
+
} from '@forgezero/runtime/jobs';
|
|
165
|
+
|
|
166
|
+
import type {
|
|
167
|
+
Clock,
|
|
168
|
+
CursorBatch,
|
|
169
|
+
CursorJobSpec,
|
|
170
|
+
CursorStore,
|
|
171
|
+
JobContext,
|
|
172
|
+
JobLock,
|
|
173
|
+
JobReport,
|
|
174
|
+
JobResult,
|
|
175
|
+
JobSpec,
|
|
176
|
+
Lease,
|
|
177
|
+
LockStore,
|
|
178
|
+
Scheduler,
|
|
179
|
+
SchedulerOptions,
|
|
180
|
+
WallClockSchedule,
|
|
181
|
+
} from '@forgezero/runtime/jobs';
|
|
139
182
|
```
|
|
140
183
|
|
|
141
184
|
<a id="forgezero-runtime-queue"></a>
|
|
142
185
|
## @forgezero/runtime/queue
|
|
143
186
|
|
|
144
|
-
Memory-only keyed work queue — awaited results, parallel across keys and strictly sequential within one; clustered callers atomically claim ownership in their own business store before submitting.
|
|
187
|
+
Memory-only keyed work queue — awaited results, parallel across keys and strictly sequential within one; clustered callers atomically claim ownership in their own business store before submitting. This entry exposes 5 named value exports and 6 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
145
188
|
|
|
146
189
|
```text
|
|
147
|
-
import {
|
|
148
|
-
|
|
190
|
+
import {
|
|
191
|
+
QueueKeyStoppedError,
|
|
192
|
+
QueueStoppedError,
|
|
193
|
+
TaskCancelledError,
|
|
194
|
+
createQueue,
|
|
195
|
+
queueWidthFor,
|
|
196
|
+
} from '@forgezero/runtime/queue';
|
|
197
|
+
|
|
198
|
+
import type {
|
|
199
|
+
DrainReport,
|
|
200
|
+
Queue,
|
|
201
|
+
QueueOptions,
|
|
202
|
+
QueueResourcePolicy,
|
|
203
|
+
QueueTask,
|
|
204
|
+
RetryPolicy,
|
|
205
|
+
} from '@forgezero/runtime/queue';
|
|
149
206
|
```
|
|
150
207
|
|
|
151
208
|
<a id="forgezero-runtime-outbox"></a>
|
|
152
209
|
## @forgezero/runtime/outbox
|
|
153
210
|
|
|
154
|
-
Write the event with the record, deliver it after, in order per key with backoff and a dead-letter queue.
|
|
155
|
-
|
|
156
|
-
```text
|
|
157
|
-
import {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
211
|
+
Write the event with the record, deliver it after, in order per key with backoff and a dead-letter queue. This entry exposes 8 named value exports and 10 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
212
|
+
|
|
213
|
+
```text
|
|
214
|
+
import {
|
|
215
|
+
DEFAULT_POLICY,
|
|
216
|
+
EVENT_STATES,
|
|
217
|
+
OutboxError,
|
|
218
|
+
VERSION,
|
|
219
|
+
backoffMs,
|
|
220
|
+
createOutbox,
|
|
221
|
+
memoryStore,
|
|
222
|
+
outboxJob,
|
|
223
|
+
} from '@forgezero/runtime/outbox';
|
|
224
|
+
|
|
225
|
+
import type {
|
|
226
|
+
DeliveryPolicy,
|
|
227
|
+
DeliveryResult,
|
|
228
|
+
DrainReport,
|
|
229
|
+
EventState,
|
|
230
|
+
Outbox,
|
|
231
|
+
OutboxEvent,
|
|
232
|
+
OutboxOptions,
|
|
233
|
+
OutboxStore,
|
|
234
|
+
PublishInput,
|
|
235
|
+
Transport,
|
|
236
|
+
} from '@forgezero/runtime/outbox';
|
|
161
237
|
```
|
|
162
238
|
|
|
163
239
|
<a id="forgezero-runtime-audit"></a>
|
|
164
240
|
## @forgezero/runtime/audit
|
|
165
241
|
|
|
166
|
-
Append-only records chained by hash, with a verifier that names the first altered entry.
|
|
167
|
-
|
|
168
|
-
```text
|
|
169
|
-
import {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
242
|
+
Append-only records chained by hash, with a verifier that names the first altered entry. This entry exposes 12 named value exports and 10 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
243
|
+
|
|
244
|
+
```text
|
|
245
|
+
import {
|
|
246
|
+
AuditChainError,
|
|
247
|
+
GENESIS_DIGEST,
|
|
248
|
+
VERSION,
|
|
249
|
+
appendRecord,
|
|
250
|
+
canonicalise,
|
|
251
|
+
createAuditChain,
|
|
252
|
+
exportRange,
|
|
253
|
+
hashDigester,
|
|
254
|
+
memoryStore,
|
|
255
|
+
sealedDigester,
|
|
256
|
+
verifyChain,
|
|
257
|
+
verifyExport,
|
|
258
|
+
} from '@forgezero/runtime/audit';
|
|
259
|
+
|
|
260
|
+
import type {
|
|
261
|
+
AppendOptions,
|
|
262
|
+
AuditChain,
|
|
263
|
+
AuditChainOptions,
|
|
264
|
+
AuditEntry,
|
|
265
|
+
AuditExport,
|
|
266
|
+
AuditRecord,
|
|
267
|
+
AuditStore,
|
|
268
|
+
ChainVerdict,
|
|
269
|
+
Digester,
|
|
270
|
+
EffectAuditRecord,
|
|
271
|
+
} from '@forgezero/runtime/audit';
|
|
173
272
|
```
|
|
174
273
|
|
|
175
274
|
<a id="forgezero-runtime-backup"></a>
|
|
176
275
|
## @forgezero/runtime/backup
|
|
177
276
|
|
|
178
|
-
Encrypted, chunked, verified snapshots to object storage — and the restore that reads them back.
|
|
179
|
-
|
|
180
|
-
```text
|
|
181
|
-
import {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
277
|
+
Encrypted, chunked, verified snapshots to object storage — and the restore that reads them back. This entry exposes 11 named value exports and 10 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
278
|
+
|
|
279
|
+
```text
|
|
280
|
+
import {
|
|
281
|
+
BackupError,
|
|
282
|
+
DEFAULT_RETENTION,
|
|
283
|
+
SNAPSHOT_FORMAT,
|
|
284
|
+
VERSION,
|
|
285
|
+
backupJob,
|
|
286
|
+
listSnapshots,
|
|
287
|
+
prune,
|
|
288
|
+
restore,
|
|
289
|
+
selectForDeletion,
|
|
290
|
+
snapshot,
|
|
291
|
+
verifySnapshot,
|
|
292
|
+
} from '@forgezero/runtime/backup';
|
|
293
|
+
|
|
294
|
+
import type {
|
|
295
|
+
ChunkRecord,
|
|
296
|
+
ObjectStore,
|
|
297
|
+
RestoreOptions,
|
|
298
|
+
RestoreReport,
|
|
299
|
+
RetentionPolicy,
|
|
300
|
+
RowSink,
|
|
301
|
+
RowSource,
|
|
302
|
+
SnapshotManifest,
|
|
303
|
+
SnapshotOptions,
|
|
304
|
+
VerifyReport,
|
|
305
|
+
} from '@forgezero/runtime/backup';
|
|
185
306
|
```
|
|
186
307
|
|
|
187
308
|
<a id="forgezero-runtime-notify"></a>
|
|
188
309
|
## @forgezero/runtime/notify
|
|
189
310
|
|
|
190
|
-
Render a named template to text and HTML, escaped per part, refusing to send with a blank where a value should be.
|
|
191
|
-
|
|
192
|
-
```text
|
|
193
|
-
import {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
311
|
+
Render a named template to text and HTML, escaped per part, refusing to send with a blank where a value should be. This entry exposes 12 named value exports and 7 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
312
|
+
|
|
313
|
+
```text
|
|
314
|
+
import {
|
|
315
|
+
CHANNELS,
|
|
316
|
+
NotifyError,
|
|
317
|
+
VERSION,
|
|
318
|
+
assertHeaderSafe,
|
|
319
|
+
button,
|
|
320
|
+
codeBlock,
|
|
321
|
+
createNotifier,
|
|
322
|
+
defineTemplate,
|
|
323
|
+
escapeHtml,
|
|
324
|
+
layout,
|
|
325
|
+
preview,
|
|
326
|
+
render,
|
|
327
|
+
} from '@forgezero/runtime/notify';
|
|
328
|
+
|
|
329
|
+
import type {
|
|
330
|
+
Channel,
|
|
331
|
+
Notification,
|
|
332
|
+
Notifier,
|
|
333
|
+
NotifierOptions,
|
|
334
|
+
Rendered,
|
|
335
|
+
TemplateSpec,
|
|
336
|
+
Transport,
|
|
337
|
+
} from '@forgezero/runtime/notify';
|
|
197
338
|
```
|
|
198
339
|
|
|
199
340
|
<a id="forgezero-runtime-notify-templates"></a>
|
|
200
341
|
## @forgezero/runtime/notify/templates
|
|
201
342
|
|
|
202
|
-
The six transactional messages ForgeZero sends.
|
|
343
|
+
The six transactional messages ForgeZero sends. This entry exposes 8 named value exports and 1 named type export. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
203
344
|
|
|
204
345
|
```text
|
|
205
|
-
import {
|
|
206
|
-
|
|
207
|
-
|
|
346
|
+
import {
|
|
347
|
+
TEMPLATES,
|
|
348
|
+
ceremonyProposed,
|
|
349
|
+
custodianEnrolment,
|
|
350
|
+
escapeHtml,
|
|
351
|
+
invitation,
|
|
352
|
+
newDevice,
|
|
353
|
+
signInCode,
|
|
354
|
+
vaultLocked,
|
|
355
|
+
} from '@forgezero/runtime/notify/templates';
|
|
356
|
+
|
|
357
|
+
import type {
|
|
358
|
+
TemplateKey,
|
|
359
|
+
} from '@forgezero/runtime/notify/templates';
|
|
208
360
|
```
|
|
209
361
|
|
|
210
362
|
<a id="forgezero-runtime-calendar"></a>
|
|
211
363
|
## @forgezero/runtime/calendar
|
|
212
364
|
|
|
213
|
-
Billing periods computed from an anchor, working days, holidays and due dates.
|
|
214
|
-
|
|
215
|
-
```text
|
|
216
|
-
import {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
365
|
+
Billing periods computed from an anchor, working days, holidays and due dates. This entry exposes 15 named value exports and 4 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
366
|
+
|
|
367
|
+
```text
|
|
368
|
+
import {
|
|
369
|
+
CalendarError,
|
|
370
|
+
DAY_MS,
|
|
371
|
+
DEFAULT_WORKING_DAYS,
|
|
372
|
+
closedPeriods,
|
|
373
|
+
dayOfWeek,
|
|
374
|
+
daysOverdue,
|
|
375
|
+
fromDay,
|
|
376
|
+
isOverdue,
|
|
377
|
+
isWorkingDay,
|
|
378
|
+
nextWorkingDay,
|
|
379
|
+
periodAt,
|
|
380
|
+
periodIndexOn,
|
|
381
|
+
periodOn,
|
|
382
|
+
toDay,
|
|
383
|
+
workingDaysBetween,
|
|
384
|
+
} from '@forgezero/runtime/calendar';
|
|
385
|
+
|
|
386
|
+
import type {
|
|
387
|
+
BillingSchedule,
|
|
388
|
+
Calendar,
|
|
389
|
+
IsoDate,
|
|
390
|
+
Period,
|
|
391
|
+
} from '@forgezero/runtime/calendar';
|
|
220
392
|
```
|
|
221
393
|
|
|
222
394
|
<a id="forgezero-runtime-compliance"></a>
|
|
223
395
|
## @forgezero/runtime/compliance
|
|
224
396
|
|
|
225
|
-
Screening as a decision record — tiers, rules and lists, failing closed when a list is unreachable.
|
|
226
|
-
|
|
227
|
-
```text
|
|
228
|
-
import {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
397
|
+
Screening as a decision record — tiers, rules and lists, failing closed when a list is unreachable. This entry exposes 11 named value exports and 10 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
398
|
+
|
|
399
|
+
```text
|
|
400
|
+
import {
|
|
401
|
+
ComplianceError,
|
|
402
|
+
RISK_LEVELS,
|
|
403
|
+
VERIFICATION_TIERS,
|
|
404
|
+
combineLists,
|
|
405
|
+
countryRule,
|
|
406
|
+
newCounterpartyRule,
|
|
407
|
+
screen,
|
|
408
|
+
screeningStage,
|
|
409
|
+
staticList,
|
|
410
|
+
tierLimitRule,
|
|
411
|
+
unavailableList,
|
|
412
|
+
} from '@forgezero/runtime/compliance';
|
|
413
|
+
|
|
414
|
+
import type {
|
|
415
|
+
ListEntry,
|
|
416
|
+
RiskLevel,
|
|
417
|
+
Rule,
|
|
418
|
+
RuleHit,
|
|
419
|
+
ScreenOptions,
|
|
420
|
+
ScreeningList,
|
|
421
|
+
StageOptions,
|
|
422
|
+
Subject,
|
|
423
|
+
Verdict,
|
|
424
|
+
VerificationTier,
|
|
425
|
+
} from '@forgezero/runtime/compliance';
|
|
232
426
|
```
|
|
233
427
|
|
|
234
428
|
<a id="forgezero-runtime-totp"></a>
|
|
235
429
|
## @forgezero/runtime/totp
|
|
236
430
|
|
|
237
|
-
RFC 6238 TOTP on the existing HMAC — base32, an asymmetric window, and replay left to the caller.
|
|
431
|
+
RFC 6238 TOTP on the existing HMAC — base32, an asymmetric window, and replay left to the caller. This entry exposes 13 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
238
432
|
|
|
239
433
|
```text
|
|
240
|
-
import {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
434
|
+
import {
|
|
435
|
+
DEFAULT_DIGITS,
|
|
436
|
+
DEFAULT_STEP_SECONDS,
|
|
437
|
+
TotpError,
|
|
438
|
+
assertCode,
|
|
439
|
+
codeAt,
|
|
440
|
+
codeFor,
|
|
441
|
+
counterAt,
|
|
442
|
+
enrolmentUri,
|
|
443
|
+
fromBase32,
|
|
444
|
+
generateSecret,
|
|
445
|
+
secondsRemaining,
|
|
446
|
+
toBase32,
|
|
447
|
+
verifyCode,
|
|
448
|
+
} from '@forgezero/runtime/totp';
|
|
449
|
+
|
|
450
|
+
import type {
|
|
451
|
+
TotpOptions,
|
|
452
|
+
VerifyOptions,
|
|
453
|
+
VerifyResult,
|
|
454
|
+
} from '@forgezero/runtime/totp';
|
|
244
455
|
```
|
|
245
456
|
|
|
246
457
|
<a id="forgezero-runtime-passkey"></a>
|
|
247
458
|
## @forgezero/runtime/passkey
|
|
248
459
|
|
|
249
|
-
Passkeys for sites that are not us. A vault-held credential is as unphishable as one in a security chip provided the RP ID check never slips — `evil-example.com` ends with `example.com` and is a different site.
|
|
460
|
+
Passkeys for sites that are not us. A vault-held credential is as unphishable as one in a security chip provided the RP ID check never slips — `evil-example.com` ends with `example.com` and is a different site. This entry exposes 11 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
250
461
|
|
|
251
462
|
```text
|
|
252
|
-
import {
|
|
253
|
-
|
|
254
|
-
|
|
463
|
+
import {
|
|
464
|
+
FLAG_BE,
|
|
465
|
+
FLAG_BS,
|
|
466
|
+
FLAG_UP,
|
|
467
|
+
FLAG_UV,
|
|
468
|
+
PasskeyError,
|
|
469
|
+
assertPasskey,
|
|
470
|
+
authenticatorData,
|
|
471
|
+
credentialIdFor,
|
|
472
|
+
passkeysFor,
|
|
473
|
+
rpIdMatches,
|
|
474
|
+
verifyAssertion,
|
|
475
|
+
} from '@forgezero/runtime/passkey';
|
|
476
|
+
|
|
477
|
+
import type {
|
|
478
|
+
Assertion,
|
|
479
|
+
AssertionRequest,
|
|
480
|
+
StoredPasskey,
|
|
481
|
+
} from '@forgezero/runtime/passkey';
|
|
255
482
|
```
|
|
256
483
|
|
|
257
484
|
<a id="forgezero-runtime-phrase"></a>
|
|
258
485
|
## @forgezero/runtime/phrase
|
|
259
486
|
|
|
260
|
-
BIP-39 recovery phrases, and the salted verifier that proves one without being able to reconstruct it.
|
|
487
|
+
BIP-39 recovery phrases, and the salted verifier that proves one without being able to reconstruct it. This entry exposes 7 named value exports and 0 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
261
488
|
|
|
262
489
|
```text
|
|
263
|
-
import {
|
|
264
|
-
|
|
490
|
+
import {
|
|
491
|
+
PHRASE_SALT_BYTES,
|
|
492
|
+
PHRASE_WORDS,
|
|
493
|
+
generatePhrase,
|
|
494
|
+
newSalt,
|
|
495
|
+
phraseToKey,
|
|
496
|
+
phraseVerifier,
|
|
497
|
+
validatePhrase,
|
|
498
|
+
} from '@forgezero/runtime/phrase';
|
|
265
499
|
```
|
|
266
500
|
|
|
267
501
|
<a id="forgezero-runtime-snp"></a>
|
|
268
502
|
## @forgezero/runtime/snp
|
|
269
503
|
|
|
270
|
-
Parse an AMD SEV-SNP attestation report at the firmware ABI offsets, and compare a TCB component by component so a microcode bump cannot mask a firmware downgrade.
|
|
504
|
+
Parse an AMD SEV-SNP attestation report at the firmware ABI offsets, and compare a TCB component by component so a microcode bump cannot mask a firmware downgrade. This entry exposes 5 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
271
505
|
|
|
272
506
|
```text
|
|
273
|
-
import {
|
|
274
|
-
|
|
507
|
+
import {
|
|
508
|
+
REPORT_BYTES,
|
|
509
|
+
SnpError,
|
|
510
|
+
bindsNonce,
|
|
511
|
+
parseSnpReport,
|
|
512
|
+
tcbAtLeast,
|
|
513
|
+
} from '@forgezero/runtime/snp';
|
|
514
|
+
|
|
515
|
+
import type {
|
|
516
|
+
GuestPolicy,
|
|
517
|
+
SnpReport,
|
|
518
|
+
TcbVersion,
|
|
519
|
+
} from '@forgezero/runtime/snp';
|
|
275
520
|
```
|
|
276
521
|
|
|
277
522
|
<a id="forgezero-runtime-importers"></a>
|
|
278
523
|
## @forgezero/runtime/importers
|
|
279
524
|
|
|
280
|
-
Read secrets out of a .env, a CSV, or a Bitwarden or 1Password export — skipping what cannot be understood rather than guessing, and never putting a value in an error.
|
|
525
|
+
Read secrets out of a .env, a CSV, or a Bitwarden or 1Password export — skipping what cannot be understood rather than guessing, and never putting a value in an error. This entry exposes 7 named value exports and 4 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
281
526
|
|
|
282
527
|
```text
|
|
283
|
-
import {
|
|
284
|
-
|
|
285
|
-
|
|
528
|
+
import {
|
|
529
|
+
IMPORT_FORMATS,
|
|
530
|
+
normaliseName,
|
|
531
|
+
parseBitwarden,
|
|
532
|
+
parseCsv,
|
|
533
|
+
parseEnv,
|
|
534
|
+
parseImport,
|
|
535
|
+
parseOnePassword,
|
|
536
|
+
} from '@forgezero/runtime/importers';
|
|
537
|
+
|
|
538
|
+
import type {
|
|
539
|
+
ImportFormat,
|
|
540
|
+
ImportResult,
|
|
541
|
+
ImportedSecret,
|
|
542
|
+
Skipped,
|
|
543
|
+
} from '@forgezero/runtime/importers';
|
|
286
544
|
```
|
|
287
545
|
|
|
288
546
|
<a id="forgezero-runtime-openssh"></a>
|
|
289
547
|
## @forgezero/runtime/openssh
|
|
290
548
|
|
|
291
|
-
OpenSSH wire encoding, so a derived ed25519 key becomes a line that pastes into authorized_keys.
|
|
549
|
+
OpenSSH wire encoding, so a derived ed25519 key becomes a line that pastes into authorized_keys. This entry exposes 6 named value exports and 0 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
292
550
|
|
|
293
551
|
```text
|
|
294
|
-
import {
|
|
552
|
+
import {
|
|
553
|
+
OpenSshError,
|
|
554
|
+
authorizedKey,
|
|
555
|
+
fingerprint,
|
|
556
|
+
parseAuthorizedKey,
|
|
557
|
+
publicKeyBlob,
|
|
558
|
+
signatureBlob,
|
|
559
|
+
} from '@forgezero/runtime/openssh';
|
|
295
560
|
```
|
|
296
561
|
|
|
297
562
|
<a id="forgezero-runtime-ssh-cert"></a>
|
|
298
563
|
## @forgezero/runtime/ssh-cert
|
|
299
564
|
|
|
300
|
-
OpenSSH certificates, so access expires instead of having to be hunted down. Takes a signing FUNCTION rather than a secret key, which is what lets the CA live in a vault that never hands it out.
|
|
565
|
+
OpenSSH certificates, so access expires instead of having to be hunted down. Takes a signing FUNCTION rather than a secret key, which is what lets the CA live in a vault that never hands it out. This entry exposes 9 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
301
566
|
|
|
302
567
|
```text
|
|
303
|
-
import {
|
|
304
|
-
|
|
305
|
-
|
|
568
|
+
import {
|
|
569
|
+
CERT_TYPE_HOST,
|
|
570
|
+
CERT_TYPE_USER,
|
|
571
|
+
DEFAULT_EXTENSIONS,
|
|
572
|
+
SshCertError,
|
|
573
|
+
caFingerprint,
|
|
574
|
+
caFromSecretKey,
|
|
575
|
+
caPublicKeyLine,
|
|
576
|
+
isCurrentlyValid,
|
|
577
|
+
signCertificate,
|
|
578
|
+
} from '@forgezero/runtime/ssh-cert';
|
|
579
|
+
|
|
580
|
+
import type {
|
|
581
|
+
CertificateAuthority,
|
|
582
|
+
CertificateRequest,
|
|
583
|
+
} from '@forgezero/runtime/ssh-cert';
|
|
306
584
|
```
|
|
307
585
|
|
|
308
586
|
<a id="forgezero-runtime-slip10"></a>
|
|
309
587
|
## @forgezero/runtime/slip10
|
|
310
588
|
|
|
311
|
-
SLIP-0010 derivation for ed25519, hardened-only — BIP-32 does not work on this curve and produces halves that do not correspond.
|
|
589
|
+
SLIP-0010 derivation for ed25519, hardened-only — BIP-32 does not work on this curve and produces halves that do not correspond. This entry exposes 5 named value exports and 1 named type export. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
312
590
|
|
|
313
591
|
```text
|
|
314
|
-
import {
|
|
315
|
-
|
|
592
|
+
import {
|
|
593
|
+
HARDENED_OFFSET,
|
|
594
|
+
Slip10Error,
|
|
595
|
+
deriveChild,
|
|
596
|
+
derivePath,
|
|
597
|
+
masterFromSeed,
|
|
598
|
+
} from '@forgezero/runtime/slip10';
|
|
599
|
+
|
|
600
|
+
import type {
|
|
601
|
+
Slip10Node,
|
|
602
|
+
} from '@forgezero/runtime/slip10';
|
|
316
603
|
```
|
|
317
604
|
|
|
318
605
|
<a id="forgezero-runtime-identity"></a>
|
|
319
606
|
## @forgezero/runtime/identity
|
|
320
607
|
|
|
321
|
-
Hybrid Ed25519 + ML-DSA-65 request signing. One canonical string, so the compute agent that signs inside a guest and the API that verifies cannot drift — which two implementations of it certainly would.
|
|
322
|
-
|
|
323
|
-
```text
|
|
324
|
-
import {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
608
|
+
Hybrid Ed25519 + ML-DSA-65 request signing. One canonical string, so the compute agent that signs inside a guest and the API that verifies cannot drift — which two implementations of it certainly would. This entry exposes 16 named value exports and 6 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
609
|
+
|
|
610
|
+
```text
|
|
611
|
+
import {
|
|
612
|
+
CLOCK_SKEW_SECONDS,
|
|
613
|
+
REQUEST_SIGNATURE_SUITE,
|
|
614
|
+
RESPONSE_KEY_HEADER,
|
|
615
|
+
RESPONSE_SEALING_SUITE,
|
|
616
|
+
canonicalString,
|
|
617
|
+
decodeSignatureHeader,
|
|
618
|
+
deriveKeysFromSeed,
|
|
619
|
+
derivePublicKeysFromSeed,
|
|
620
|
+
encodeSignatureHeader,
|
|
621
|
+
generateNodeKeys,
|
|
622
|
+
generateResponseRecipient,
|
|
623
|
+
openResponse,
|
|
624
|
+
sealResponse,
|
|
625
|
+
signRequest,
|
|
626
|
+
validResponsePublicKey,
|
|
627
|
+
verifyRequest,
|
|
628
|
+
} from '@forgezero/runtime/identity';
|
|
629
|
+
|
|
630
|
+
import type {
|
|
631
|
+
NodeKeyPair,
|
|
632
|
+
NodePublicKeys,
|
|
633
|
+
ResponseRecipient,
|
|
634
|
+
SealedResponse,
|
|
635
|
+
SignedEnvelope,
|
|
636
|
+
VerifyFailure,
|
|
637
|
+
} from '@forgezero/runtime/identity';
|
|
328
638
|
```
|
|
329
639
|
|
|
330
640
|
<a id="forgezero-runtime-schema"></a>
|
|
331
641
|
## @forgezero/runtime/schema
|
|
332
642
|
|
|
333
|
-
Validate against JSON Schema, restrict what a caller may declare, and describe a schema as a form.
|
|
643
|
+
Validate against JSON Schema, restrict what a caller may declare, and describe a schema as a form. This entry exposes 8 named value exports and 5 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
334
644
|
|
|
335
645
|
```text
|
|
336
|
-
import {
|
|
337
|
-
|
|
338
|
-
|
|
646
|
+
import {
|
|
647
|
+
DEFAULT_RESTRICTIONS,
|
|
648
|
+
SCHEMA_VERSION,
|
|
649
|
+
SchemaError,
|
|
650
|
+
VERSION,
|
|
651
|
+
describeJsonSchema,
|
|
652
|
+
readableFields,
|
|
653
|
+
restrictJsonSchema,
|
|
654
|
+
writeOnlyPaths,
|
|
655
|
+
} from '@forgezero/runtime/schema';
|
|
656
|
+
|
|
657
|
+
import type {
|
|
658
|
+
FieldKind,
|
|
659
|
+
FormField,
|
|
660
|
+
Restrictions,
|
|
661
|
+
SchemaValidator,
|
|
662
|
+
ValidationResult,
|
|
663
|
+
} from '@forgezero/runtime/schema';
|
|
339
664
|
```
|
|
340
665
|
|
|
341
666
|
## @forgezero/runtime/schema — Restrict an untrusted JSON Schema before storing it
|
|
@@ -343,7 +668,11 @@ import type { FieldKind, FormField, Restrictions, SchemaValidator, ValidationRes
|
|
|
343
668
|
Tenant-supplied schemas are data, not executable code. Restriction rejects references, remote identifiers, unsupported keywords, excessive depth/size, and arrays without a bounded maxItems. Form metadata is derived from the accepted schema; write-only fields remain identifiable for secret handling.
|
|
344
669
|
|
|
345
670
|
```text
|
|
346
|
-
import {
|
|
671
|
+
import {
|
|
672
|
+
restrictJsonSchema,
|
|
673
|
+
describeJsonSchema,
|
|
674
|
+
writeOnlyPaths,
|
|
675
|
+
} from '@forgezero/runtime/schema';
|
|
347
676
|
|
|
348
677
|
const schema = restrictJsonSchema({
|
|
349
678
|
type: 'object', additionalProperties: false,
|
|
@@ -360,11 +689,20 @@ const secretFields = writeOnlyPaths(fields);
|
|
|
360
689
|
<a id="forgezero-runtime-schema-typebox"></a>
|
|
361
690
|
## @forgezero/runtime/schema/typebox
|
|
362
691
|
|
|
363
|
-
The TypeBox validator behind that interface.
|
|
692
|
+
The TypeBox validator behind that interface. This entry exposes 4 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
364
693
|
|
|
365
694
|
```text
|
|
366
|
-
import {
|
|
367
|
-
|
|
695
|
+
import {
|
|
696
|
+
T,
|
|
697
|
+
parse,
|
|
698
|
+
typebox,
|
|
699
|
+
typeboxQueryCodec,
|
|
700
|
+
} from '@forgezero/runtime/schema/typebox';
|
|
701
|
+
|
|
702
|
+
import type {
|
|
703
|
+
Static,
|
|
704
|
+
TSchema,
|
|
705
|
+
} from '@forgezero/runtime/schema/typebox';
|
|
368
706
|
```
|
|
369
707
|
|
|
370
708
|
## @forgezero/runtime/schema/typebox — One TypeBox shape for runtime validation and static types
|
|
@@ -372,7 +710,12 @@ import type { Static, TSchema } from '@forgezero/runtime/schema/typebox';
|
|
|
372
710
|
TypeBox is an optional peer. Its schema is JSON Schema, so the same restriction and form layer applies. The query codec validates both untrusted input and returned output; malformed values fail instead of being coerced.
|
|
373
711
|
|
|
374
712
|
```text
|
|
375
|
-
import {
|
|
713
|
+
import {
|
|
714
|
+
T,
|
|
715
|
+
type Static,
|
|
716
|
+
parse,
|
|
717
|
+
typeboxQueryCodec,
|
|
718
|
+
} from '@forgezero/runtime/schema/typebox';
|
|
376
719
|
|
|
377
720
|
const User = T.Object({
|
|
378
721
|
userKey: T.String({ minLength: 1 }),
|
|
@@ -386,260 +729,631 @@ const codec = typeboxQueryCodec(User);
|
|
|
386
729
|
<a id="forgezero-runtime-finance-discounts"></a>
|
|
387
730
|
## @forgezero/runtime/finance/discounts
|
|
388
731
|
|
|
389
|
-
Promotions as arithmetic over integer minor units. They never stack — one winner — and a percentage rounds down, because rounding a discount up gives away a unit of currency per invoice forever.
|
|
732
|
+
Promotions as arithmetic over integer minor units. They never stack — one winner — and a percentage rounds down, because rounding a discount up gives away a unit of currency per invoice forever. This entry exposes 7 named value exports and 4 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
390
733
|
|
|
391
734
|
```text
|
|
392
|
-
import {
|
|
393
|
-
|
|
394
|
-
|
|
735
|
+
import {
|
|
736
|
+
DiscountError,
|
|
737
|
+
assertCode,
|
|
738
|
+
assertWindow,
|
|
739
|
+
bestDiscount,
|
|
740
|
+
discountFor,
|
|
741
|
+
ineligibility,
|
|
742
|
+
normaliseCode,
|
|
743
|
+
} from '@forgezero/runtime/finance/discounts';
|
|
744
|
+
|
|
745
|
+
import type {
|
|
746
|
+
AppliedDiscount,
|
|
747
|
+
DiscountKind,
|
|
748
|
+
Ineligibility,
|
|
749
|
+
Promotion,
|
|
750
|
+
} from '@forgezero/runtime/finance/discounts';
|
|
395
751
|
```
|
|
396
752
|
|
|
397
753
|
<a id="forgezero-runtime-finance-money"></a>
|
|
398
754
|
## @forgezero/runtime/finance/money
|
|
399
755
|
|
|
400
|
-
Exact amounts in minor units with the asset attached, so two currencies cannot be added.
|
|
401
|
-
|
|
402
|
-
```text
|
|
403
|
-
import {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
756
|
+
Exact amounts in minor units with the asset attached, so two currencies cannot be added. This entry exposes 22 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
757
|
+
|
|
758
|
+
```text
|
|
759
|
+
import {
|
|
760
|
+
ASSETS,
|
|
761
|
+
MoneyError,
|
|
762
|
+
ROUNDING,
|
|
763
|
+
VERSION,
|
|
764
|
+
abs,
|
|
765
|
+
add,
|
|
766
|
+
allocate,
|
|
767
|
+
assetSpec,
|
|
768
|
+
compare,
|
|
769
|
+
convert,
|
|
770
|
+
defineAsset,
|
|
771
|
+
equals,
|
|
772
|
+
formatAmount,
|
|
773
|
+
isNegative,
|
|
774
|
+
isZero,
|
|
775
|
+
money,
|
|
776
|
+
mulRate,
|
|
777
|
+
negate,
|
|
778
|
+
parseAmount,
|
|
779
|
+
subtract,
|
|
780
|
+
toStep,
|
|
781
|
+
zero,
|
|
782
|
+
} from '@forgezero/runtime/finance/money';
|
|
783
|
+
|
|
784
|
+
import type {
|
|
785
|
+
AssetSpec,
|
|
786
|
+
Money,
|
|
787
|
+
Rounding,
|
|
788
|
+
} from '@forgezero/runtime/finance/money';
|
|
408
789
|
```
|
|
409
790
|
|
|
410
791
|
<a id="forgezero-runtime-finance-venues"></a>
|
|
411
792
|
## @forgezero/runtime/finance/venues
|
|
412
793
|
|
|
413
|
-
Trading venues, market types and symbols as data — spot, margin and futures behind one order model.
|
|
414
|
-
|
|
415
|
-
```text
|
|
416
|
-
import {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
794
|
+
Trading venues, market types and symbols as data — spot, margin and futures behind one order model. This entry exposes 14 named value exports and 10 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
795
|
+
|
|
796
|
+
```text
|
|
797
|
+
import {
|
|
798
|
+
MARKET_TYPES,
|
|
799
|
+
ORDER_SIDES,
|
|
800
|
+
ORDER_TYPES,
|
|
801
|
+
TIME_IN_FORCE,
|
|
802
|
+
VENUES,
|
|
803
|
+
VERSION,
|
|
804
|
+
VenueError,
|
|
805
|
+
notionalOf,
|
|
806
|
+
parseSymbol,
|
|
807
|
+
submitOrder,
|
|
808
|
+
symbolOf,
|
|
809
|
+
validateOrder,
|
|
810
|
+
venue,
|
|
811
|
+
venuesFor,
|
|
812
|
+
} from '@forgezero/runtime/finance/venues';
|
|
813
|
+
|
|
814
|
+
import type {
|
|
815
|
+
MarketSpec,
|
|
816
|
+
MarketType,
|
|
817
|
+
OrderRequest,
|
|
818
|
+
OrderResult,
|
|
819
|
+
OrderSide,
|
|
820
|
+
OrderStatus,
|
|
821
|
+
OrderType,
|
|
822
|
+
TimeInForce,
|
|
823
|
+
VenueAdapter,
|
|
824
|
+
VenueSpec,
|
|
825
|
+
} from '@forgezero/runtime/finance/venues';
|
|
421
826
|
```
|
|
422
827
|
|
|
423
828
|
<a id="forgezero-runtime-finance-ledger"></a>
|
|
424
829
|
## @forgezero/runtime/finance/ledger
|
|
425
830
|
|
|
426
|
-
Double-entry postings and derived balances. A hold is a posting, not a lock — the queue does the ordering.
|
|
427
|
-
|
|
428
|
-
```text
|
|
429
|
-
import {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
831
|
+
Double-entry postings and derived balances. A hold is a posting, not a lock — the queue does the ordering. This entry exposes 21 named value exports and 6 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
832
|
+
|
|
833
|
+
```text
|
|
834
|
+
import {
|
|
835
|
+
ACCOUNT_KINDS,
|
|
836
|
+
BUCKETS,
|
|
837
|
+
LedgerError,
|
|
838
|
+
MAX_LEDGER_ENTRIES,
|
|
839
|
+
VERSION,
|
|
840
|
+
accountId,
|
|
841
|
+
assertAvailable,
|
|
842
|
+
assertBalanced,
|
|
843
|
+
availableOf,
|
|
844
|
+
balanceOf,
|
|
845
|
+
balancesFrom,
|
|
846
|
+
captureHold,
|
|
847
|
+
heldOf,
|
|
848
|
+
parseAccount,
|
|
849
|
+
placeHold,
|
|
850
|
+
queueKeyFor,
|
|
851
|
+
releaseHold,
|
|
852
|
+
statement,
|
|
853
|
+
totalOf,
|
|
854
|
+
transfer,
|
|
855
|
+
trialBalance,
|
|
856
|
+
} from '@forgezero/runtime/finance/ledger';
|
|
857
|
+
|
|
858
|
+
import type {
|
|
859
|
+
AccountKind,
|
|
860
|
+
AccountRef,
|
|
861
|
+
Bucket,
|
|
862
|
+
Entry,
|
|
863
|
+
Transaction,
|
|
864
|
+
TrialBalance,
|
|
865
|
+
} from '@forgezero/runtime/finance/ledger';
|
|
434
866
|
```
|
|
435
867
|
|
|
436
868
|
<a id="forgezero-runtime-finance-commission"></a>
|
|
437
869
|
## @forgezero/runtime/finance/commission
|
|
438
870
|
|
|
439
|
-
Profit net of flows, a high-water mark, the tier split and the referral share of our income.
|
|
871
|
+
Profit net of flows, a high-water mark, the tier split and the referral share of our income. This entry exposes 9 named value exports and 6 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
440
872
|
|
|
441
873
|
```text
|
|
442
|
-
import {
|
|
443
|
-
|
|
444
|
-
|
|
874
|
+
import {
|
|
875
|
+
CommissionError,
|
|
876
|
+
allocate,
|
|
877
|
+
chargeableProfit,
|
|
878
|
+
commissionTransaction,
|
|
879
|
+
nextHighWaterMark,
|
|
880
|
+
periodProfit,
|
|
881
|
+
projectPrepay,
|
|
882
|
+
splitCommission,
|
|
883
|
+
splitReferrals,
|
|
884
|
+
} from '@forgezero/runtime/finance/commission';
|
|
885
|
+
|
|
886
|
+
import type {
|
|
887
|
+
CommissionInput,
|
|
888
|
+
CommissionSplit,
|
|
889
|
+
PeriodPerformance,
|
|
890
|
+
Prepay,
|
|
891
|
+
PrepayInput,
|
|
892
|
+
ReferralShare,
|
|
893
|
+
} from '@forgezero/runtime/finance/commission';
|
|
445
894
|
```
|
|
446
895
|
|
|
447
896
|
<a id="forgezero-runtime-finance-rates"></a>
|
|
448
897
|
## @forgezero/runtime/finance/rates
|
|
449
898
|
|
|
450
|
-
What an asset is worth in USD, and how old that answer is. A peg never ages; a quote always does.
|
|
451
|
-
|
|
452
|
-
```text
|
|
453
|
-
import {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
899
|
+
What an asset is worth in USD, and how old that answer is. A peg never ages; a quote always does. This entry exposes 11 named value exports and 7 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
900
|
+
|
|
901
|
+
```text
|
|
902
|
+
import {
|
|
903
|
+
BASE_ASSET,
|
|
904
|
+
RATE_SOURCES,
|
|
905
|
+
RateError,
|
|
906
|
+
assertRate,
|
|
907
|
+
createRateTable,
|
|
908
|
+
describeRate,
|
|
909
|
+
isRegistered,
|
|
910
|
+
peg,
|
|
911
|
+
rateRefreshJob,
|
|
912
|
+
refreshRates,
|
|
913
|
+
registerAsset,
|
|
914
|
+
} from '@forgezero/runtime/finance/rates';
|
|
915
|
+
|
|
916
|
+
import type {
|
|
917
|
+
AssetEntry,
|
|
918
|
+
AssetRate,
|
|
919
|
+
RateFetcher,
|
|
920
|
+
RateSource,
|
|
921
|
+
RateTable,
|
|
922
|
+
RateTableOptions,
|
|
923
|
+
RefreshReport,
|
|
924
|
+
} from '@forgezero/runtime/finance/rates';
|
|
457
925
|
```
|
|
458
926
|
|
|
459
927
|
<a id="forgezero-runtime-finance-transfers"></a>
|
|
460
928
|
## @forgezero/runtime/finance/transfers
|
|
461
929
|
|
|
462
|
-
Deposits and withdrawals as ordered pipelines, with screening reserved at position zero.
|
|
930
|
+
Deposits and withdrawals as ordered pipelines, with screening reserved at position zero. This entry exposes 9 named value exports and 6 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
463
931
|
|
|
464
932
|
```text
|
|
465
|
-
import {
|
|
466
|
-
|
|
467
|
-
|
|
933
|
+
import {
|
|
934
|
+
DIRECTIONS,
|
|
935
|
+
PipelineError,
|
|
936
|
+
SCREENING_ORDER,
|
|
937
|
+
approvalStage,
|
|
938
|
+
balanceStage,
|
|
939
|
+
createTransferPipeline,
|
|
940
|
+
limitsStage,
|
|
941
|
+
notFrozenStage,
|
|
942
|
+
screeningStage,
|
|
943
|
+
} from '@forgezero/runtime/finance/transfers';
|
|
944
|
+
|
|
945
|
+
import type {
|
|
946
|
+
Direction,
|
|
947
|
+
PipelineResult,
|
|
948
|
+
Stage,
|
|
949
|
+
StageOutcome,
|
|
950
|
+
Transfer,
|
|
951
|
+
TransferPipeline,
|
|
952
|
+
} from '@forgezero/runtime/finance/transfers';
|
|
468
953
|
```
|
|
469
954
|
|
|
470
955
|
<a id="forgezero-runtime-finance-chain"></a>
|
|
471
956
|
## @forgezero/runtime/finance/chain
|
|
472
957
|
|
|
473
|
-
Which chains exist, their confirmation depth by value band, assets and explorers — as data an admin edits.
|
|
958
|
+
Which chains exist, their confirmation depth by value band, assets and explorers — as data an admin edits. This entry exposes 9 named value exports and 5 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
474
959
|
|
|
475
960
|
```text
|
|
476
|
-
import {
|
|
477
|
-
|
|
478
|
-
|
|
961
|
+
import {
|
|
962
|
+
ADDRESS_SCHEMES,
|
|
963
|
+
ChainError,
|
|
964
|
+
SEED_CHAINS,
|
|
965
|
+
SEED_CHAIN_ASSETS,
|
|
966
|
+
assertChain,
|
|
967
|
+
confirmationsFor,
|
|
968
|
+
createChainRegistry,
|
|
969
|
+
estimatedSeconds,
|
|
970
|
+
validateAddress,
|
|
971
|
+
} from '@forgezero/runtime/finance/chain';
|
|
972
|
+
|
|
973
|
+
import type {
|
|
974
|
+
AddressScheme,
|
|
975
|
+
ChainAsset,
|
|
976
|
+
ChainRegistry,
|
|
977
|
+
ChainSpec,
|
|
978
|
+
ConfirmationBand,
|
|
979
|
+
} from '@forgezero/runtime/finance/chain';
|
|
479
980
|
```
|
|
480
981
|
|
|
481
982
|
<a id="forgezero-runtime-finance-custody"></a>
|
|
482
983
|
## @forgezero/runtime/finance/custody
|
|
483
984
|
|
|
484
|
-
Derive CREATE2 deposit addresses and EIP-712 custody digests — arithmetic over a seed and a salt, needing no credential and no node.
|
|
985
|
+
Derive CREATE2 deposit addresses and EIP-712 custody digests — arithmetic over a seed and a salt, needing no credential and no node. This entry exposes 8 named value exports and 0 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
485
986
|
|
|
486
987
|
```text
|
|
487
|
-
import {
|
|
488
|
-
|
|
988
|
+
import {
|
|
989
|
+
CustodyError,
|
|
990
|
+
VERSION,
|
|
991
|
+
depositAddress,
|
|
992
|
+
domainSeparator,
|
|
993
|
+
orderSignatures,
|
|
994
|
+
saltFor,
|
|
995
|
+
toChecksumAddress,
|
|
996
|
+
withdrawDigest,
|
|
997
|
+
} from '@forgezero/runtime/finance/custody';
|
|
489
998
|
```
|
|
490
999
|
|
|
491
1000
|
<a id="forgezero-runtime-finance-derive"></a>
|
|
492
1001
|
## @forgezero/runtime/finance/derive
|
|
493
1002
|
|
|
494
|
-
Declare a field ForgeZero generates rather than the tenant supplying: BIP-44 path arithmetic, and the choice of who is capable of generating the key.
|
|
1003
|
+
Declare a field ForgeZero generates rather than the tenant supplying: BIP-44 path arithmetic, and the choice of who is capable of generating the key. This entry exposes 11 named value exports and 4 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
495
1004
|
|
|
496
1005
|
```text
|
|
497
|
-
import {
|
|
498
|
-
|
|
499
|
-
|
|
1006
|
+
import {
|
|
1007
|
+
CUSTODY,
|
|
1008
|
+
DERIVE_KEYWORD,
|
|
1009
|
+
DeriveError,
|
|
1010
|
+
SCHEMES,
|
|
1011
|
+
assertDeriveSpec,
|
|
1012
|
+
custodyOf,
|
|
1013
|
+
deriveSpecOf,
|
|
1014
|
+
derivedFields,
|
|
1015
|
+
derivedPaths,
|
|
1016
|
+
pathFor,
|
|
1017
|
+
suppliedPaths,
|
|
1018
|
+
} from '@forgezero/runtime/finance/derive';
|
|
1019
|
+
|
|
1020
|
+
import type {
|
|
1021
|
+
Custody,
|
|
1022
|
+
DeriveSpec,
|
|
1023
|
+
DerivedField,
|
|
1024
|
+
Scheme,
|
|
1025
|
+
} from '@forgezero/runtime/finance/derive';
|
|
500
1026
|
```
|
|
501
1027
|
|
|
502
1028
|
<a id="forgezero-runtime-finance-tax"></a>
|
|
503
1029
|
## @forgezero/runtime/finance/tax
|
|
504
1030
|
|
|
505
|
-
Which jurisdiction may tax a sale, who accounts for it, and the three ways to be zero that report differently. Rates are data.
|
|
1031
|
+
Which jurisdiction may tax a sale, who accounts for it, and the three ways to be zero that report differently. Rates are data. This entry exposes 9 named value exports and 6 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
506
1032
|
|
|
507
1033
|
```text
|
|
508
|
-
import {
|
|
509
|
-
|
|
510
|
-
|
|
1034
|
+
import {
|
|
1035
|
+
TREATMENTS,
|
|
1036
|
+
TaxError,
|
|
1037
|
+
applyTax,
|
|
1038
|
+
assertTaxRate,
|
|
1039
|
+
decideTax,
|
|
1040
|
+
describeTax,
|
|
1041
|
+
parseRate,
|
|
1042
|
+
percent,
|
|
1043
|
+
totalWithTax,
|
|
1044
|
+
} from '@forgezero/runtime/finance/tax';
|
|
1045
|
+
|
|
1046
|
+
import type {
|
|
1047
|
+
Customer,
|
|
1048
|
+
Supplier,
|
|
1049
|
+
TaxAmounts,
|
|
1050
|
+
TaxDecision,
|
|
1051
|
+
TaxRate,
|
|
1052
|
+
Treatment,
|
|
1053
|
+
} from '@forgezero/runtime/finance/tax';
|
|
511
1054
|
```
|
|
512
1055
|
|
|
513
1056
|
<a id="forgezero-runtime-finance-storage"></a>
|
|
514
1057
|
## @forgezero/runtime/finance/storage
|
|
515
1058
|
|
|
516
|
-
Write an amount so it is both exact and sortable: an authoritative string, and a number that is only an index.
|
|
1059
|
+
Write an amount so it is both exact and sortable: an authoritative string, and a number that is only an index. This entry exposes 8 named value exports and 1 named type export. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
517
1060
|
|
|
518
1061
|
```text
|
|
519
|
-
import {
|
|
520
|
-
|
|
521
|
-
|
|
1062
|
+
import {
|
|
1063
|
+
SORT_FIELD,
|
|
1064
|
+
fromStored,
|
|
1065
|
+
rangeBounds,
|
|
1066
|
+
sortExact,
|
|
1067
|
+
sortKey,
|
|
1068
|
+
storeAmount,
|
|
1069
|
+
toStored,
|
|
1070
|
+
withinRange,
|
|
1071
|
+
} from '@forgezero/runtime/finance/storage';
|
|
1072
|
+
|
|
1073
|
+
import type {
|
|
1074
|
+
StoredMoney,
|
|
1075
|
+
} from '@forgezero/runtime/finance/storage';
|
|
522
1076
|
```
|
|
523
1077
|
|
|
524
1078
|
<a id="forgezero-runtime-realtime"></a>
|
|
525
1079
|
## @forgezero/runtime/realtime
|
|
526
1080
|
|
|
527
|
-
Provider-neutral realtime audience, shard, event and delivery contracts.
|
|
528
|
-
|
|
529
|
-
```text
|
|
530
|
-
import {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
1081
|
+
Provider-neutral realtime audience, shard, event and delivery contracts. This entry exposes 15 named value exports and 5 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
1082
|
+
|
|
1083
|
+
```text
|
|
1084
|
+
import {
|
|
1085
|
+
REALTIME_MAX_BATCH_BYTES,
|
|
1086
|
+
REALTIME_MAX_EVENTS,
|
|
1087
|
+
REALTIME_MAX_EVENT_BYTES,
|
|
1088
|
+
REALTIME_MAX_SHARDS_PER_TOPIC,
|
|
1089
|
+
REALTIME_MAX_SOCKETS_PER_SHARD,
|
|
1090
|
+
canReceiveRealtimeAudience,
|
|
1091
|
+
issueRealtimeSubscriptionTicket,
|
|
1092
|
+
realtimeBatchBytes,
|
|
1093
|
+
realtimeHmac,
|
|
1094
|
+
realtimeShardKey,
|
|
1095
|
+
validateRealtimeAudience,
|
|
1096
|
+
validateRealtimeBatch,
|
|
1097
|
+
validateRealtimeSubscriptionTicket,
|
|
1098
|
+
verifyRealtimeHmac,
|
|
1099
|
+
verifyRealtimeSubscriptionToken,
|
|
1100
|
+
} from '@forgezero/runtime/realtime';
|
|
1101
|
+
|
|
1102
|
+
import type {
|
|
1103
|
+
RealtimeAudience,
|
|
1104
|
+
RealtimeBatch,
|
|
1105
|
+
RealtimeEvent,
|
|
1106
|
+
RealtimePrincipalKind,
|
|
1107
|
+
RealtimeSubscriptionTicket,
|
|
1108
|
+
} from '@forgezero/runtime/realtime';
|
|
534
1109
|
```
|
|
535
1110
|
|
|
536
1111
|
<a id="forgezero-runtime-passkey-hybrid"></a>
|
|
537
1112
|
## @forgezero/runtime/passkey-hybrid
|
|
538
1113
|
|
|
539
|
-
Versioned WebAuthn PRF plus ML-DSA companion proof construction and verification.
|
|
1114
|
+
Versioned WebAuthn PRF plus ML-DSA companion proof construction and verification. This entry exposes 8 named value exports and 4 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
540
1115
|
|
|
541
1116
|
```text
|
|
542
|
-
import {
|
|
543
|
-
|
|
544
|
-
|
|
1117
|
+
import {
|
|
1118
|
+
PASSKEY_HYBRID_SUITE,
|
|
1119
|
+
PASSKEY_HYBRID_VERSION,
|
|
1120
|
+
PASSKEY_ML_DSA_PUBLIC_KEY_BYTES,
|
|
1121
|
+
PASSKEY_ML_DSA_SIGNATURE_BYTES,
|
|
1122
|
+
PASSKEY_PRF_SALT,
|
|
1123
|
+
createPasskeyHybridProof,
|
|
1124
|
+
passkeyHybridMessage,
|
|
1125
|
+
verifyPasskeyHybridProof,
|
|
1126
|
+
} from '@forgezero/runtime/passkey-hybrid';
|
|
1127
|
+
|
|
1128
|
+
import type {
|
|
1129
|
+
PasskeyHybridBinding,
|
|
1130
|
+
PasskeyHybridProof,
|
|
1131
|
+
PasskeyHybridPurpose,
|
|
1132
|
+
PasskeyHybridRegistrationProof,
|
|
1133
|
+
} from '@forgezero/runtime/passkey-hybrid';
|
|
545
1134
|
```
|
|
546
1135
|
|
|
547
1136
|
<a id="forgezero-runtime-otpauth"></a>
|
|
548
1137
|
## @forgezero/runtime/otpauth
|
|
549
1138
|
|
|
550
|
-
Parse and render otpauth URIs without binding enrolment to a UI framework.
|
|
1139
|
+
Parse and render otpauth URIs without binding enrolment to a UI framework. This entry exposes 4 named value exports and 1 named type export. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
551
1140
|
|
|
552
1141
|
```text
|
|
553
|
-
import {
|
|
554
|
-
|
|
1142
|
+
import {
|
|
1143
|
+
formatOtpAuth,
|
|
1144
|
+
fromManualSecret,
|
|
1145
|
+
newOtpAuth,
|
|
1146
|
+
parseOtpAuth,
|
|
1147
|
+
} from '@forgezero/runtime/otpauth';
|
|
1148
|
+
|
|
1149
|
+
import type {
|
|
1150
|
+
OtpAuth,
|
|
1151
|
+
} from '@forgezero/runtime/otpauth';
|
|
555
1152
|
```
|
|
556
1153
|
|
|
557
1154
|
<a id="forgezero-runtime-pipeline"></a>
|
|
558
1155
|
## @forgezero/runtime/pipeline
|
|
559
1156
|
|
|
560
|
-
Typed ordered application-pipeline execution with explicit evidence.
|
|
1157
|
+
Typed ordered application-pipeline execution with explicit evidence. This entry exposes 6 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
561
1158
|
|
|
562
1159
|
```text
|
|
563
|
-
import {
|
|
564
|
-
|
|
1160
|
+
import {
|
|
1161
|
+
GIT_PROVIDERS,
|
|
1162
|
+
PipelineError,
|
|
1163
|
+
parsePush,
|
|
1164
|
+
shouldDeploy,
|
|
1165
|
+
verifyWebhook,
|
|
1166
|
+
webhookPath,
|
|
1167
|
+
} from '@forgezero/runtime/pipeline';
|
|
1168
|
+
|
|
1169
|
+
import type {
|
|
1170
|
+
DeployTrigger,
|
|
1171
|
+
GitProvider,
|
|
1172
|
+
PushEvent,
|
|
1173
|
+
} from '@forgezero/runtime/pipeline';
|
|
565
1174
|
```
|
|
566
1175
|
|
|
567
1176
|
<a id="forgezero-runtime-finance-chain-addresses"></a>
|
|
568
1177
|
## @forgezero/runtime/finance/chain-addresses
|
|
569
1178
|
|
|
570
|
-
Chain-address derivation records and validation independent of a node provider.
|
|
1179
|
+
Chain-address derivation records and validation independent of a node provider. This entry exposes 10 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
571
1180
|
|
|
572
1181
|
```text
|
|
573
|
-
import {
|
|
574
|
-
|
|
575
|
-
|
|
1182
|
+
import {
|
|
1183
|
+
AddressError,
|
|
1184
|
+
COUNTERFACTUAL_SCHEMES,
|
|
1185
|
+
assertDerivationMatches,
|
|
1186
|
+
create2Address,
|
|
1187
|
+
depositAddressBook,
|
|
1188
|
+
depositSaltFor,
|
|
1189
|
+
deriveDepositAddress,
|
|
1190
|
+
ownerOfAddress,
|
|
1191
|
+
toChecksumAddress,
|
|
1192
|
+
validateAddress,
|
|
1193
|
+
} from '@forgezero/runtime/finance/chain-addresses';
|
|
1194
|
+
|
|
1195
|
+
import type {
|
|
1196
|
+
AddressScheme,
|
|
1197
|
+
ChainDeployment,
|
|
1198
|
+
} from '@forgezero/runtime/finance/chain-addresses';
|
|
576
1199
|
```
|
|
577
1200
|
|
|
578
1201
|
<a id="forgezero-runtime-finance-chain-deposits"></a>
|
|
579
1202
|
## @forgezero/runtime/finance/chain-deposits
|
|
580
1203
|
|
|
581
|
-
Provider-neutral deposit observation, confirmation and credit transitions.
|
|
1204
|
+
Provider-neutral deposit observation, confirmation and credit transitions. This entry exposes 8 named value exports and 5 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
582
1205
|
|
|
583
1206
|
```text
|
|
584
|
-
import {
|
|
585
|
-
|
|
586
|
-
|
|
1207
|
+
import {
|
|
1208
|
+
DepositError,
|
|
1209
|
+
creditDeposit,
|
|
1210
|
+
cursorFrom,
|
|
1211
|
+
depositReference,
|
|
1212
|
+
describeScan,
|
|
1213
|
+
isConfirmed,
|
|
1214
|
+
rescanRange,
|
|
1215
|
+
scanOnce,
|
|
1216
|
+
} from '@forgezero/runtime/finance/chain-deposits';
|
|
1217
|
+
|
|
1218
|
+
import type {
|
|
1219
|
+
ChainReader,
|
|
1220
|
+
ChainTransfer,
|
|
1221
|
+
DepositCursor,
|
|
1222
|
+
ScanContext,
|
|
1223
|
+
ScanReport,
|
|
1224
|
+
} from '@forgezero/runtime/finance/chain-deposits';
|
|
587
1225
|
```
|
|
588
1226
|
|
|
589
1227
|
<a id="forgezero-runtime-finance-chain-withdrawals"></a>
|
|
590
1228
|
## @forgezero/runtime/finance/chain-withdrawals
|
|
591
1229
|
|
|
592
|
-
Provider-neutral withdrawal approval, broadcast and finality transitions.
|
|
593
|
-
|
|
594
|
-
```text
|
|
595
|
-
import {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
1230
|
+
Provider-neutral withdrawal approval, broadcast and finality transitions. This entry exposes 14 named value exports and 5 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
1231
|
+
|
|
1232
|
+
```text
|
|
1233
|
+
import {
|
|
1234
|
+
WITHDRAWAL_STATES,
|
|
1235
|
+
WithdrawalError,
|
|
1236
|
+
approveWithdrawal,
|
|
1237
|
+
broadcastKeyFor,
|
|
1238
|
+
canTransition,
|
|
1239
|
+
confirmWithdrawal,
|
|
1240
|
+
describeSweep,
|
|
1241
|
+
holdReference,
|
|
1242
|
+
markFailed,
|
|
1243
|
+
processOnce,
|
|
1244
|
+
refundFailed,
|
|
1245
|
+
rejectWithdrawal,
|
|
1246
|
+
requestWithdrawal,
|
|
1247
|
+
sweepForPayout,
|
|
1248
|
+
} from '@forgezero/runtime/finance/chain-withdrawals';
|
|
1249
|
+
|
|
1250
|
+
import type {
|
|
1251
|
+
Broadcaster,
|
|
1252
|
+
SweepCandidate,
|
|
1253
|
+
SweepPlan,
|
|
1254
|
+
Withdrawal,
|
|
1255
|
+
WithdrawalState,
|
|
1256
|
+
} from '@forgezero/runtime/finance/chain-withdrawals';
|
|
599
1257
|
```
|
|
600
1258
|
|
|
601
1259
|
<a id="forgezero-runtime-finance-chain-reconcile"></a>
|
|
602
1260
|
## @forgezero/runtime/finance/chain-reconcile
|
|
603
1261
|
|
|
604
|
-
Deterministic reconciliation between chain observations and durable transfer state.
|
|
1262
|
+
Deterministic reconciliation between chain observations and durable transfer state. This entry exposes 5 named value exports and 5 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
605
1263
|
|
|
606
1264
|
```text
|
|
607
|
-
import {
|
|
608
|
-
|
|
1265
|
+
import {
|
|
1266
|
+
DISCREPANCY_KINDS,
|
|
1267
|
+
ReconcileError,
|
|
1268
|
+
reconcileOnce,
|
|
1269
|
+
reconcileReport,
|
|
1270
|
+
shortfallUsd,
|
|
1271
|
+
} from '@forgezero/runtime/finance/chain-reconcile';
|
|
1272
|
+
|
|
1273
|
+
import type {
|
|
1274
|
+
Discrepancy,
|
|
1275
|
+
DiscrepancyKind,
|
|
1276
|
+
LedgerLiability,
|
|
1277
|
+
OnChainHolding,
|
|
1278
|
+
ReconcileReport,
|
|
1279
|
+
} from '@forgezero/runtime/finance/chain-reconcile';
|
|
609
1280
|
```
|
|
610
1281
|
|
|
611
1282
|
<a id="forgezero-runtime-finance-market"></a>
|
|
612
1283
|
## @forgezero/runtime/finance/market
|
|
613
1284
|
|
|
614
|
-
Market order, fill and quote contracts independent of any exchange adapter.
|
|
1285
|
+
Market order, fill and quote contracts independent of any exchange adapter. This entry exposes 8 named value exports and 7 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
615
1286
|
|
|
616
1287
|
```text
|
|
617
|
-
import {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
1288
|
+
import {
|
|
1289
|
+
MarketError,
|
|
1290
|
+
createFeed,
|
|
1291
|
+
disagreementOf,
|
|
1292
|
+
isStale,
|
|
1293
|
+
lastPrice,
|
|
1294
|
+
limitFor,
|
|
1295
|
+
stalenessOf,
|
|
1296
|
+
subscribe,
|
|
1297
|
+
} from '@forgezero/runtime/finance/market';
|
|
1298
|
+
|
|
1299
|
+
import type {
|
|
1300
|
+
Feed,
|
|
1301
|
+
FeedEvent,
|
|
1302
|
+
FeedOptions,
|
|
1303
|
+
PriceResult,
|
|
1304
|
+
Quote,
|
|
1305
|
+
StalenessPolicy,
|
|
1306
|
+
VenueSource,
|
|
1307
|
+
} from '@forgezero/runtime/finance/market';
|
|
621
1308
|
```
|
|
622
1309
|
|
|
623
1310
|
<a id="forgezero-runtime-custody-share"></a>
|
|
624
1311
|
## @forgezero/runtime/custody-share
|
|
625
1312
|
|
|
626
|
-
Threshold-share parsing, validation and reconstruction.
|
|
1313
|
+
Threshold-share parsing, validation and reconstruction. This entry exposes 13 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
627
1314
|
|
|
628
1315
|
```text
|
|
629
|
-
import {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
1316
|
+
import {
|
|
1317
|
+
PROBE_BYTES,
|
|
1318
|
+
factorWrapAad,
|
|
1319
|
+
joinProbeAndShare,
|
|
1320
|
+
openFactorEnvelope,
|
|
1321
|
+
openSealedToFactor,
|
|
1322
|
+
openShareWithPasskey,
|
|
1323
|
+
openShareWithPhrase,
|
|
1324
|
+
passkeyWrappingKey,
|
|
1325
|
+
phraseWrappingKey,
|
|
1326
|
+
sealShare,
|
|
1327
|
+
shareIndexOf,
|
|
1328
|
+
splitProbeAndShare,
|
|
1329
|
+
wrappingKeysFor,
|
|
1330
|
+
} from '@forgezero/runtime/custody-share';
|
|
1331
|
+
|
|
1332
|
+
import type {
|
|
1333
|
+
SealedShare,
|
|
1334
|
+
WrappingKeys,
|
|
1335
|
+
} from '@forgezero/runtime/custody-share';
|
|
633
1336
|
```
|
|
634
1337
|
|
|
635
1338
|
<a id="forgezero-runtime-custody-crypto"></a>
|
|
636
1339
|
## @forgezero/runtime/custody-crypto
|
|
637
1340
|
|
|
638
|
-
Hybrid ML-KEM-768 plus X25519 custody-share sealing and opening.
|
|
1341
|
+
Hybrid ML-KEM-768 plus X25519 custody-share sealing and opening. This entry exposes 6 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
639
1342
|
|
|
640
1343
|
```text
|
|
641
|
-
import {
|
|
642
|
-
|
|
1344
|
+
import {
|
|
1345
|
+
deriveKey,
|
|
1346
|
+
openFromKey,
|
|
1347
|
+
openWithKey,
|
|
1348
|
+
sealToKey,
|
|
1349
|
+
sealWithKey,
|
|
1350
|
+
wrappingKeyPair,
|
|
1351
|
+
} from '@forgezero/runtime/custody-crypto';
|
|
1352
|
+
|
|
1353
|
+
import type {
|
|
1354
|
+
CipherBox,
|
|
1355
|
+
SealedToKey,
|
|
1356
|
+
} from '@forgezero/runtime/custody-crypto';
|
|
643
1357
|
```
|
|
644
1358
|
|
|
645
1359
|
## 1. Install, then import a subpath
|
|
@@ -649,8 +1363,12 @@ There is no root export, and that is deliberate. `import from "@forgezero/runtim
|
|
|
649
1363
|
```text
|
|
650
1364
|
bun add @forgezero/runtime
|
|
651
1365
|
|
|
652
|
-
import {
|
|
653
|
-
|
|
1366
|
+
import {
|
|
1367
|
+
parseAmount,
|
|
1368
|
+
} from '@forgezero/runtime/finance/money';
|
|
1369
|
+
import {
|
|
1370
|
+
createScheduler,
|
|
1371
|
+
} from '@forgezero/runtime/jobs';
|
|
654
1372
|
|
|
655
1373
|
// This throws. It is supposed to.
|
|
656
1374
|
// import { anything } from '@forgezero/runtime';
|
|
@@ -711,8 +1429,15 @@ bun add @sinclair/typebox
|
|
|
711
1429
|
An amount is minor units as a bigint with its asset attached, so two currencies cannot be added by accident and a rounding mode is always stated. A database needs a second thing the bigint cannot give it — an ORDER BY that works — so `finance/storage` writes both: the authoritative string, and a lossy double used for sorting and range filters only. One ETH is 10^18 minor units and a signed 64-bit column overflows at about nine ETH, which is why the exact value is never the sortable one.
|
|
712
1430
|
|
|
713
1431
|
```text
|
|
714
|
-
import {
|
|
715
|
-
|
|
1432
|
+
import {
|
|
1433
|
+
parseAmount,
|
|
1434
|
+
mulRate,
|
|
1435
|
+
formatAmount,
|
|
1436
|
+
} from '@forgezero/runtime/finance/money';
|
|
1437
|
+
import {
|
|
1438
|
+
toStored,
|
|
1439
|
+
rangeBounds,
|
|
1440
|
+
} from '@forgezero/runtime/finance/storage';
|
|
716
1441
|
|
|
717
1442
|
const fee = mulRate(parseAmount('1250.00', 'USD'), '0.015', 'down');
|
|
718
1443
|
formatAmount(fee); // '18.75' — never 18.749999999
|
|
@@ -741,7 +1466,11 @@ node_modules/@forgezero/runtime/contracts/src/
|
|
|
741
1466
|
The lock and the cursor store are interfaces, so this runs against a database, Redis, or nothing at all in a test.
|
|
742
1467
|
|
|
743
1468
|
```text
|
|
744
|
-
import {
|
|
1469
|
+
import {
|
|
1470
|
+
createScheduler,
|
|
1471
|
+
defineJob,
|
|
1472
|
+
cursorJob,
|
|
1473
|
+
} from '@forgezero/runtime/jobs';
|
|
745
1474
|
```
|
|
746
1475
|
|
|
747
1476
|
## Never setInterval
|
|
@@ -811,7 +1540,10 @@ scheduler.status();
|
|
|
811
1540
|
TypeBox is a peer dependency and optional. A project on Zod pulls none of it, because the interface is what the other packages depend on.
|
|
812
1541
|
|
|
813
1542
|
```text
|
|
814
|
-
import {
|
|
1543
|
+
import {
|
|
1544
|
+
validate,
|
|
1545
|
+
describeForm,
|
|
1546
|
+
} from '@forgezero/runtime/schema';
|
|
815
1547
|
|
|
816
1548
|
// only if you validate with TypeBox
|
|
817
1549
|
bun add @sinclair/typebox
|
|
@@ -822,7 +1554,10 @@ bun add @sinclair/typebox
|
|
|
822
1554
|
Query strings are entirely strings, so values are converted before checking — otherwise ?port=587 fails a schema expecting a number on a perfectly well-formed request.
|
|
823
1555
|
|
|
824
1556
|
```text
|
|
825
|
-
import {
|
|
1557
|
+
import {
|
|
1558
|
+
typebox,
|
|
1559
|
+
T,
|
|
1560
|
+
} from '@forgezero/runtime/schema/typebox';
|
|
826
1561
|
|
|
827
1562
|
const Config = T.Object(
|
|
828
1563
|
{ host: T.String(), port: T.Integer() },
|