@moonbeam-foundation/sdk 0.12.0 → 0.13.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.
Files changed (98) hide show
  1. package/README.md +30 -14
  2. package/bin/moonbeam.mjs +4 -1
  3. package/dist/actors/track-record.d.ts +1 -1
  4. package/dist/actors/track-record.js +1 -1
  5. package/dist/arbitration/index.d.ts +10 -4
  6. package/dist/arbitration/index.d.ts.map +1 -1
  7. package/dist/arbitration/index.js +14 -2
  8. package/dist/arbitration/index.js.map +1 -1
  9. package/dist/assurance/assurance-shared.d.ts +85 -132
  10. package/dist/assurance/assurance-shared.js +46 -90
  11. package/dist/cover/index.d.ts +3 -3
  12. package/dist/cover/index.d.ts.map +1 -1
  13. package/dist/devnet/index.d.ts +3 -3
  14. package/dist/devnet/index.d.ts.map +1 -1
  15. package/dist/devnet/index.js +4 -4
  16. package/dist/devnet/index.js.map +1 -1
  17. package/dist/devnet/profile.d.ts +1 -1
  18. package/dist/devnet/profile.d.ts.map +1 -1
  19. package/dist/erc8183/index.d.ts +1 -1
  20. package/dist/errors/index.d.ts +5 -5
  21. package/dist/errors/index.d.ts.map +1 -1
  22. package/dist/errors/index.js +3 -3
  23. package/dist/jobs/index.d.ts +4 -4
  24. package/dist/jobs/index.d.ts.map +1 -1
  25. package/dist/jobs/index.js +1 -1
  26. package/dist/jobs/index.js.map +1 -1
  27. package/dist/market/cohorts.d.ts +106 -0
  28. package/dist/market/cohorts.d.ts.map +1 -0
  29. package/dist/market/cohorts.js +70 -0
  30. package/dist/market/cohorts.js.map +1 -0
  31. package/dist/market/index.d.ts +24 -17
  32. package/dist/market/index.d.ts.map +1 -1
  33. package/dist/market/index.js +13 -9
  34. package/dist/market/index.js.map +1 -1
  35. package/dist/market/journey.d.ts +7 -7
  36. package/dist/market/journey.d.ts.map +1 -1
  37. package/dist/market/journey.js +7 -7
  38. package/dist/market/journey.js.map +1 -1
  39. package/dist/market/listed.d.ts +228 -0
  40. package/dist/market/listed.d.ts.map +1 -0
  41. package/dist/market/listed.js +168 -0
  42. package/dist/market/listed.js.map +1 -0
  43. package/dist/market/sale-stops.d.ts +2 -2
  44. package/dist/market/sale-stops.d.ts.map +1 -1
  45. package/dist/market/venues-data.d.ts.map +1 -1
  46. package/dist/market/venues-data.js +770 -40
  47. package/dist/market/venues-data.js.map +1 -1
  48. package/dist/market/venues.d.ts +46 -3
  49. package/dist/market/venues.d.ts.map +1 -1
  50. package/dist/market/venues.js +21 -6
  51. package/dist/market/venues.js.map +1 -1
  52. package/dist/onboard/index.d.ts +214 -33
  53. package/dist/onboard/index.d.ts.map +1 -1
  54. package/dist/onboard/index.js +340 -31
  55. package/dist/onboard/index.js.map +1 -1
  56. package/dist/onboard/send.d.ts +43 -0
  57. package/dist/onboard/send.d.ts.map +1 -0
  58. package/dist/onboard/send.js +65 -0
  59. package/dist/onboard/send.js.map +1 -0
  60. package/dist/pools/index.d.ts +18 -7
  61. package/dist/pools/index.d.ts.map +1 -1
  62. package/dist/pools/index.js +31 -9
  63. package/dist/pools/index.js.map +1 -1
  64. package/dist/proof/index.d.ts +5 -5
  65. package/dist/proof/index.d.ts.map +1 -1
  66. package/dist/proof/index.js +1 -1
  67. package/dist/resale/index.d.ts +13 -13
  68. package/dist/resale/index.d.ts.map +1 -1
  69. package/dist/resale/index.js +17 -17
  70. package/dist/resale/index.js.map +1 -1
  71. package/dist/resale/payment-scheme.d.mts +2 -5
  72. package/dist/resale/payment-scheme.mjs +16 -116
  73. package/dist/resale/payment-scheme.pin.json +1 -2
  74. package/dist/resale/settle-rule.d.ts +3 -3
  75. package/dist/resale/settle-rule.d.ts.map +1 -1
  76. package/dist/resale/settle-rule.js +3 -3
  77. package/dist/resale/settle-rule.js.map +1 -1
  78. package/dist/rpc/index.js +1 -1
  79. package/dist/workflows/index.js +1 -1
  80. package/dist/workflows/steps.d.ts +4 -4
  81. package/dist/workflows/steps.d.ts.map +1 -1
  82. package/dist/workflows/steps.js +4 -4
  83. package/dist/workflows/steps.js.map +1 -1
  84. package/dist/workflows/types.d.ts +1 -1
  85. package/dist/x402/index.d.ts +2 -2
  86. package/dist/x402/index.d.ts.map +1 -1
  87. package/dist/x402/index.js +2 -2
  88. package/dist/x402/index.js.map +1 -1
  89. package/docs/REFERENCE.md +52 -19
  90. package/docs/VENUES.md +85 -36
  91. package/docs/WORKFLOWS.md +3 -3
  92. package/examples/24-resell-on-base.mjs +1 -1
  93. package/examples/51-read-a-proof.mjs +2 -2
  94. package/examples/README.md +1 -1
  95. package/examples/data/cross-list.recorded.json +1 -1
  96. package/package.json +3 -1
  97. package/dist/assurance/assurance-shared.d.ts.map +0 -1
  98. package/dist/assurance/assurance-shared.js.map +0 -1
@@ -1,21 +1,3 @@
1
- /**
2
- * @taifoon/assurance: the assurance product's core. _ASSURANCE_CORE_v1_
3
- *
4
- * ONE file with NO imports, pure and browser-safe, so a project that cannot install this package (the site, the SDKs)
5
- * carries a byte-identical copy and pins its hash (scripts/sync.mjs). What is in it:
6
- *
7
- * machine the coordination state machine, generated from schemas/transitions.json: every state, every transition
8
- * with its trigger and actor per lane, every timeout, ending and exclusion, the source vocabularies, the money
9
- * effects, the external-cover policy machine, and the revenue hooks of schemas/phase-map.json.
10
- * next next(state, event, ctx): one step of a job, from a named transition, a source event or the clock.
11
- * endings endingOf(job): how a job ended, the verdict it writes into the seller's record, and what external cover
12
- * does with it; whoCanEnd(state): who may end each held state, and when.
13
- * the job the venue-neutral assured job: price, deposit, cover, evaluator, deadlines, terms.
14
- * flows quote, buy, settle, claim, composed from an Economy the caller passes in (jev-wilson's economy); this file
15
- * computes no premium, leg or compensation itself: it picks, checks and refuses.
16
- *
17
- * Nothing here reads a network, signs or holds a key. Amounts are bigint smallest units.
18
- */
19
1
  export declare const MACHINE: {
20
2
  readonly version: "coordination.transitions.v1";
21
3
  readonly initial: "Open";
@@ -1320,7 +1302,7 @@ export type Transition = {
1320
1302
  } | null;
1321
1303
  by: Partial<Record<Lane, Trigger>>;
1322
1304
  };
1323
- /** the hook contract generation a hook-lane job runs on (Moonbeam's live hook is V3; Taifoon's lines are V4, V5 next) */
1305
+
1324
1306
  export type HookVersion = 'V1' | 'V2' | 'V3' | 'V4' | 'V5';
1325
1307
  export type Ctx = {
1326
1308
  lane: Lane;
@@ -1381,17 +1363,17 @@ export declare const ENDINGS: readonly [{
1381
1363
  export declare const isState: (s: unknown) => s is State;
1382
1364
  export declare const isTerminal: (s: State) => boolean;
1383
1365
  export declare const holdsFunds: (s: State) => boolean;
1384
- /** a lane and the lane it continues as (a handshake continues as a hook job once funded) */
1366
+
1385
1367
  export declare function lanesOf(lane: Lane): Lane[];
1386
- /** whether a transition runs where this job runs: V4 transitions need a V4+ hook, the V1 defect only a V1 hook */
1368
+
1387
1369
  export declare function runsOn(t: Transition, ctx: Ctx): boolean;
1388
- /** the trigger of a transition on this lane (or the lane it continues as), or null when the lane does not walk it */
1370
+
1389
1371
  export declare function triggerOf(t: Transition, lane: Lane): Trigger | null;
1390
- /** every transition out of a state that this lane walks here */
1372
+
1391
1373
  export declare const exits: (from: State, ctx: Ctx) => Transition[];
1392
- /** the states a lane can reach from the initial state, breadth first */
1374
+
1393
1375
  export declare function reachable(ctx: Ctx): State[];
1394
- /** the job's deadlines in unix seconds; a missing one never fires */
1376
+
1395
1377
  export type Clock = {
1396
1378
  expiredAt?: number;
1397
1379
  deadline?: number;
@@ -1399,18 +1381,11 @@ export type Clock = {
1399
1381
  disputeDeadline?: number;
1400
1382
  arbitrationDeadline?: number;
1401
1383
  };
1402
- /** the clock fields a timeout's `after` names (transitions.json wording: "expiredAt | hook deadline", "submittedAt + reviewWindow …") */
1384
+
1403
1385
  export declare function clockKeys(after: string): (keyof Clock)[];
1404
- /** when a timed transition becomes possible on this clock: the earliest deadline it names that is set, or null */
1386
+
1405
1387
  export declare function dueAt(t: Transition, clock: Clock): number | null;
1406
- /**
1407
- * What happened to a job:
1408
- * transition a named transition (what a plan or a contract call says it does)
1409
- * event an event a venue emitted, in transitions.json's vocabulary (JobFunded, RejectProposed …); an effect that
1410
- * decides no state (Refunded, EvaluatorFeePaid) leaves the state as it is
1411
- * state a source that reports the state itself (memo-ACP's phase, the hook's State enum, a handshake state)
1412
- * tick time passed: the default timeout transition whose deadline came first fires
1413
- */
1388
+
1414
1389
  export type AssuranceEvent = {
1415
1390
  kind: 'transition';
1416
1391
  id: TransitionId;
@@ -1439,13 +1414,13 @@ export type Next = {
1439
1414
  error: string;
1440
1415
  };
1441
1416
  export declare function next(state: State, ev: AssuranceEvent, ctx: Ctx): Next;
1442
- /** source vocabularies → machine states (transitions.json maps) */
1417
+
1443
1418
  export declare const stateOf: {
1444
- /** the hook's State enum: None Funded Submitted Completed Expired Rejected Cheated, then V4 Open RejectPending Disputed */
1419
+
1445
1420
  hook: (n: number) => State | null;
1446
- /** memo-ACP JobManager phase 0..6 */
1421
+
1447
1422
  memoPhase: (n: number) => State | null;
1448
- /** a handshake state; OFFERED with a held delivery is Delivered */
1423
+
1449
1424
  handshake: (s: string, delivered?: boolean) => State | null;
1450
1425
  };
1451
1426
  export type PathStep = {
@@ -1453,7 +1428,7 @@ export type PathStep = {
1453
1428
  to: State;
1454
1429
  transition: TransitionId;
1455
1430
  };
1456
- /** fold events from a start state; stops at the first refusal and says where */
1431
+
1457
1432
  export declare function run(events: AssuranceEvent[], ctx: Ctx, start?: State): {
1458
1433
  ok: true;
1459
1434
  state: State;
@@ -1473,21 +1448,21 @@ export type Exit = {
1473
1448
  after: string | null;
1474
1449
  isDefault: boolean;
1475
1450
  };
1476
- /** every way out of a state on this lane: who acts, and the deadline a timed exit waits for */
1451
+
1477
1452
  export declare function whoCanEnd(state: State, ctx: Ctx): Exit[];
1478
- /** no lockout: a held state has an exit nobody can block (a timeout, or a call anyone may send) */
1453
+
1479
1454
  export declare function unblockable(state: State, ctx: Ctx): Exit | null;
1480
1455
  export type Token = {
1481
1456
  symbol: string;
1482
1457
  decimals: number;
1483
1458
  };
1484
- /** where the layer attaches assurance to a venue's job */
1459
+
1485
1460
  export type Attachment = 'hook' | 'external-cover' | 'none';
1486
1461
  export type Compensation = {
1487
1462
  noShow: bigint;
1488
1463
  rejection: bigint;
1489
1464
  };
1490
- /** the terms a buyer and seller agree before any money moves; every number comes from the Economy (jev-wilson) */
1465
+
1491
1466
  export type Terms = {
1492
1467
  token: Token;
1493
1468
  price: bigint;
@@ -1513,14 +1488,14 @@ export type AssuredJob = {
1513
1488
  clock: Clock;
1514
1489
  state: State;
1515
1490
  path: PathStep[];
1516
- /** the venue paid something (budget > 0): an unpaid job is excluded from every record */
1491
+
1517
1492
  paid?: boolean;
1518
- /** an arbitrator's finding against the delivery (a grade is not a finding) */
1493
+
1519
1494
  finding?: string | null;
1520
1495
  };
1521
- /** the job reached the seller's delivery (a JobSubmitted, or a later state that needs one) */
1496
+
1522
1497
  export declare const deliveredOf: (job: Pick<AssuredJob, 'path' | 'state'>) => boolean;
1523
- /** money was held at some point (the job was funded) */
1498
+
1524
1499
  export declare const fundedOf: (job: Pick<AssuredJob, 'path' | 'state'>) => boolean;
1525
1500
  export type Ending = {
1526
1501
  id: EndingId;
@@ -1530,9 +1505,9 @@ export type Ending = {
1530
1505
  jevCase: boolean;
1531
1506
  excluded: string | null;
1532
1507
  };
1533
- /** how a job ended and the verdict it writes into the seller's record (transitions.json endings + exclusions) */
1508
+
1534
1509
  export declare function endingOf(job: Pick<AssuredJob, 'path' | 'state' | 'ctx' | 'paid'>): Ending;
1535
- /** what external cover does with an ending (transitions.json external_cover.endings): the policy's ending code */
1510
+
1536
1511
  export declare function coverEndingOf(ending: EndingId, o: {
1537
1512
  price: bigint;
1538
1513
  refunded: bigint;
@@ -1546,7 +1521,7 @@ export declare function coverEndingOf(ending: EndingId, o: {
1546
1521
  pays: boolean;
1547
1522
  premium: string;
1548
1523
  };
1549
- /** the seller's settled record (correct and incorrect endings that count in n) */
1524
+
1550
1525
  export type SellerRecord = {
1551
1526
  correct: number;
1552
1527
  incorrect: number;
@@ -1560,7 +1535,7 @@ export type EconomyInput = {
1560
1535
  cover?: bigint;
1561
1536
  attachment: Attachment;
1562
1537
  };
1563
- /** where the money of one ending goes; the sum equals what the job held */
1538
+
1564
1539
  export type Legs = {
1565
1540
  buyer: bigint;
1566
1541
  seller: bigint;
@@ -1568,7 +1543,7 @@ export type Legs = {
1568
1543
  layer: bigint;
1569
1544
  evaluator: bigint;
1570
1545
  };
1571
- /** the money endings a quote prices (a pool's loss on a cheat is bounded by the cover, the deposit pays first) */
1546
+
1572
1547
  export type MoneyEnding = 'completed' | 'auto_completed' | 'rejected' | 'no_show' | 'expired_delivered' | 'unaccepted' | 'cheated';
1573
1548
  export type EconomyQuote = {
1574
1549
  insurable: boolean;
@@ -1580,22 +1555,22 @@ export type EconomyQuote = {
1580
1555
  deposit: bigint;
1581
1556
  cover: bigint;
1582
1557
  compensation: Compensation;
1583
- /** per money ending, who receives what (the hook's own arithmetic, from the same module) */
1558
+
1584
1559
  legs: Partial<Record<MoneyEnding, Legs>>;
1585
1560
  };
1586
- /** jev-wilson's economy (quoteEconomy), or a stand-in in tests: the only place any of these numbers is computed */
1561
+
1587
1562
  export type Economy = (i: EconomyInput) => EconomyQuote;
1588
1563
  export type Refused = {
1589
1564
  ok: false;
1590
1565
  why: string[];
1591
1566
  };
1592
- /** quote: the economy's terms, checked against the rules the contracts enforce; refusal over a term the chain would revert */
1567
+
1593
1568
  export declare function quote(i: EconomyInput, economy: Economy): {
1594
1569
  ok: true;
1595
1570
  terms: Terms;
1596
1571
  quote: EconomyQuote;
1597
1572
  } | Refused;
1598
- /** buy: an assured job at its first held state, with the terms committed (no money moves here: the plan does) */
1573
+
1599
1574
  export declare function buy(job: Omit<AssuredJob, 'state' | 'path' | 'terms'>, terms: Terms, opts?: {
1600
1575
  open?: boolean;
1601
1576
  }): {
@@ -1603,16 +1578,16 @@ export declare function buy(job: Omit<AssuredJob, 'state' | 'path' | 'terms'>, t
1603
1578
  job: AssuredJob;
1604
1579
  transition: TransitionId;
1605
1580
  } | Refused;
1606
- /** the money ending of a terminal job: which legs of the quote apply */
1581
+
1607
1582
  export declare function moneyEndingOf(job: Pick<AssuredJob, 'path' | 'state' | 'ctx'>): MoneyEnding | null;
1608
- /** settle: who receives what at this job's ending, from the committed quote; refused while the job is still open */
1583
+
1609
1584
  export declare function settle(job: AssuredJob, q: EconomyQuote): {
1610
1585
  ok: true;
1611
1586
  ending: Ending;
1612
1587
  money: MoneyEnding;
1613
1588
  legs: Legs;
1614
1589
  } | Refused;
1615
- /** claim: what each party may take out once the job settled (non-zero legs only) */
1590
+
1616
1591
  export declare function claim(job: AssuredJob, q: EconomyQuote): {
1617
1592
  ok: true;
1618
1593
  claims: {
@@ -1620,7 +1595,7 @@ export declare function claim(job: AssuredJob, q: EconomyQuote): {
1620
1595
  amount: bigint;
1621
1596
  }[];
1622
1597
  } | Refused;
1623
- /** the revenue hooks (phase-map) a venue's assurance earns through, with their phase and gate */
1598
+
1624
1599
  export declare const revenueOf: (hooks: readonly RevenueHook[]) => ({
1625
1600
  readonly hook: "grades_pay_to_key";
1626
1601
  readonly phase: 1;
@@ -1667,33 +1642,14 @@ export declare const revenueOf: (hooks: readonly RevenueHook[]) => ({
1667
1642
  readonly lane: "an enterprise partner's bond and its members' hires";
1668
1643
  readonly gate: null;
1669
1644
  })[];
1670
- /**
1671
- * attest: the attested mark, the on-chain attestation and the stamp of one step (a grade, an assurance settle, a resale
1672
- * step), as UNSIGNED calls aimed at a default network chosen by profile. _ATTEST_BY_DEFAULT_v1_
1673
- *
1674
- * ONE file with NO imports, pure and browser-safe, like assurance.ts: @taifoon/jev, @taifoon/assurance (and through its
1675
- * sync, taifoon-sdk and moonbeam-sdk) carry a byte-identical copy and pin its hash. The addresses come from the address
1676
- * registry (packages/addresses) through scripts/gen-attest.mjs; nothing below the generated block names an address.
1677
- *
1678
- * mark what is attested, offline: the step's kind, the subject ids (decision log + stamp registry) and the
1679
- * digest = keccak256 of the canonical JSON body (or the digest the caller already has, e.g. Jev's).
1680
- * attestation JevDecisionLog.record(subject, kind, digest, confidenceBps, model, uri) on every target network, after
1681
- * JevAnswerLog.record(...) when the step carries Jev's answers.
1682
- * stamp GradeStampRegistry.stamp(subject, digest, verdict, mode, model, uri) when the step has a verdict.
1683
- *
1684
- * Recording is ON by default (the owner's rule of 2026-10-14): profile taifoon → the Taifoon devnet 36927 and the Taifoon
1685
- * mainnet 3692781 (GRID); profile moonbeam → Base 8453. Any network can be named instead; `networks: 'none'` opts out
1686
- * (the mark is still returned). A contract the registry does not have on a target network is listed in `missing`, with
1687
- * no call: nothing is faked. Nothing here signs or sends; the caller signs the calls.
1688
- */
1689
- /** The attestation contracts on every chain the address registry has one on (superseded deploys left out). */
1645
+
1690
1646
  export declare const ATTEST_TARGETS: Readonly<Record<number, {
1691
1647
  name: string;
1692
1648
  decisionLog: string | null;
1693
1649
  answerLog: string | null;
1694
1650
  stampRegistry: string | null;
1695
1651
  }>>;
1696
- /** The default networks per profile. Taifoon: its devnet and its mainnet (GRID). Moonbeam: Base only. */
1652
+
1697
1653
  export declare const ATTEST_PROFILES: {
1698
1654
  readonly taifoon: readonly [36927, 3692781];
1699
1655
  readonly moonbeam: readonly [8453];
@@ -1713,30 +1669,30 @@ export type AttestMissing = {
1713
1669
  contract: 'JevDecisionLog' | 'JevAnswerLog' | 'GradeStampRegistry';
1714
1670
  why: string;
1715
1671
  };
1716
- /** the REF verdict vocabulary of GradeStampRegistry: 1 delivered as specified · 2 with defects · 3 not delivered · 4 cannot determine */
1672
+
1717
1673
  export type StampVerdict = 1 | 2 | 3 | 4;
1718
1674
  export type AttestInput = {
1719
- /** the step: 'grade', 'assurance.settle', 'resale.<hop>' … (the decision log's kind is keccak256 of it) */
1675
+
1720
1676
  kind: string;
1721
- /** the job the step is about, on its own chain and contract */
1677
+
1722
1678
  subject: {
1723
1679
  chainId: number;
1724
1680
  contract: string;
1725
1681
  jobId: string | number | bigint;
1726
1682
  };
1727
- /** the canonical body of the step; its keccak256 is the digest unless `digest` is given */
1683
+
1728
1684
  body?: unknown | undefined;
1729
1685
  digest?: AttestHex | undefined;
1730
- /** 0..10000; default 10000 (a deterministic step) */
1686
+
1731
1687
  confidenceBps?: number | undefined;
1732
- /** ≤ 64 bytes, e.g. 'jev-1.13.0' or 'det:assurance-settle-v1' */
1688
+
1733
1689
  model: string;
1734
- /** ≤ 512 bytes; default urn:taifoon:<kind>:<digest> */
1690
+
1735
1691
  uri?: string | undefined;
1736
- /** a stamp is built when there is a verdict; mode 1 deterministic (default) · 2 calibrated */
1692
+
1737
1693
  verdict?: StampVerdict | null | undefined;
1738
1694
  mode?: 1 | 2 | undefined;
1739
- /** Jev's answer record digests: adds JevAnswerLog.record */
1695
+
1740
1696
  answers?: {
1741
1697
  useCase: string;
1742
1698
  inputDigest: AttestHex;
@@ -1745,11 +1701,11 @@ export type AttestInput = {
1745
1701
  } | undefined;
1746
1702
  };
1747
1703
  export type AttestOptions = {
1748
- /** picks the default networks; default 'taifoon' */
1704
+
1749
1705
  profile?: AttestProfile | undefined;
1750
- /** overrides the profile: chain ids, or 'none' to opt out of recording (the mark is still returned) */
1706
+
1751
1707
  networks?: readonly number[] | 'none' | undefined;
1752
- /** extra or replacement contracts per chain (e.g. a fork's deploy, or a network the registry does not list) */
1708
+
1753
1709
  targets?: Readonly<Record<number, Partial<{
1754
1710
  name: string;
1755
1711
  decisionLog: string | null;
@@ -1769,41 +1725,40 @@ export type Attested = {
1769
1725
  model: string;
1770
1726
  uri: string;
1771
1727
  };
1772
- /** false only when the caller opted out */
1728
+
1773
1729
  recorded: boolean;
1774
1730
  networks: number[];
1775
1731
  calls: AttestCall[];
1776
1732
  missing: AttestMissing[];
1777
- /** ready: every target contract exists · partial: some are missing · missing: none exist · none: opted out */
1733
+
1778
1734
  status: 'ready' | 'partial' | 'missing' | 'none';
1779
1735
  };
1780
1736
  export declare function attestKeccak(input: Uint8Array | string): AttestHex;
1781
1737
  export declare const DECISION_LOG_RECORD_SIG = "record(bytes32,bytes32,bytes32,uint16,string,string)";
1782
1738
  export declare const ANSWER_LOG_RECORD_SIG = "record(bytes32,bytes32,bytes32,bytes32,bytes32,string,string)";
1783
1739
  export declare const STAMP_SIG = "stamp(bytes32,bytes32,uint8,uint8,string,string)";
1784
- /** canonical JSON: sorted keys, bigint as a decimal string, no whitespace (the digest's preimage) */
1740
+
1785
1741
  export declare function attestCanonical(v: unknown): string;
1786
- /** JevDecisionLog.subjectOf(chainId, at, ref) = keccak256(abi.encode("taifoon.decision.subject.v1", chainId, at, ref)) */
1742
+
1787
1743
  export declare const decisionSubjectOf: (chainId: number, at: string, ref: string | number | bigint) => AttestHex;
1788
- /** GradeStampRegistry.subjectOf(chainId, jobContract, jobId) = keccak256(abi.encode("taifoon.stamp.subject.v1", …)) */
1744
+
1789
1745
  export declare const stampSubjectOf: (chainId: number, jobContract: string, jobId: string | number | bigint) => AttestHex;
1790
- /** the stamp verdict of a settled ending, from the seller-record verdict the machine writes (endingOf): correct → 1;
1791
- * a Jev case (rejected or expired after delivery) → 4, it takes a grade to say more; incorrect → 3; excluded → no stamp */
1746
+
1792
1747
  export declare function stampVerdictOfEnding(e: {
1793
1748
  verdict: string;
1794
1749
  jevCase: boolean;
1795
1750
  excluded: string | null;
1796
1751
  }): StampVerdict | null;
1797
- /** the mark, the attestation calls and the stamp call of one step, on the profile's networks (or the ones named) */
1752
+
1798
1753
  export declare function attest(input: AttestInput, opts?: AttestOptions): Attested;
1799
1754
  export type SettleAttestOptions = AttestOptions & {
1800
- /** the contract the job lives on (the hook, the venue's escrow): with chainId and jobId it names the subject */
1755
+
1801
1756
  contract: string;
1802
- /** ≤ 64 bytes; default det:assurance-settle-v1 */
1757
+
1803
1758
  model?: string | undefined;
1804
1759
  uri?: string | undefined;
1805
1760
  };
1806
- /** the canonical body a settle attests: the job, its ending and the legs (bigint amounts as decimal strings) */
1761
+
1807
1762
  export declare const settleBodyOf: (job: AssuredJob, contract: string, s: {
1808
1763
  ending: Ending;
1809
1764
  money: MoneyEnding;
@@ -1819,7 +1774,7 @@ export declare const settleBodyOf: (job: AssuredJob, contract: string, s: {
1819
1774
  money: MoneyEnding;
1820
1775
  legs: Legs;
1821
1776
  };
1822
- /** settle() and the attestation of its result; refused exactly when settle() refuses */
1777
+
1823
1778
  export declare function settleAttested(job: AssuredJob, q: EconomyQuote, opts: SettleAttestOptions): {
1824
1779
  ok: true;
1825
1780
  ending: Ending;
@@ -1827,16 +1782,16 @@ export declare function settleAttested(job: AssuredJob, q: EconomyQuote, opts: S
1827
1782
  legs: Legs;
1828
1783
  attest: Attested;
1829
1784
  } | Refused;
1830
- /** a contract by its address-registry entry */
1785
+
1831
1786
  export type Ref = {
1832
1787
  system: string;
1833
1788
  chain: number;
1834
1789
  name: string;
1835
1790
  };
1836
- /** what Taifoon can put on a venue's job */
1791
+
1837
1792
  export type Attach = 'hook-cover' | 'external-cover' | 'evaluator-seat' | 'grade' | 'proof';
1838
1793
  export type VenueId = 'taifoon-hook' | 'moonbeam' | 'virtuals-acp' | 'memo-acp' | 'bitagent' | 'erc8183' | 'x402' | 'olas-mech';
1839
- /** a trail as the venue (or the observatory's index of it) reports it: an event name, or a state carrier */
1794
+
1840
1795
  export type NativeStep = {
1841
1796
  name: string;
1842
1797
  phase?: number;
@@ -1848,20 +1803,20 @@ export type VenueAdapter = {
1848
1803
  id: VenueId;
1849
1804
  name: string;
1850
1805
  status: 'live' | 'devnet' | 'observed' | 'prepared' | 'read-only';
1851
- /** the machine lane and hook version a job here walks; null for a venue that is observed, not walked (Olas Mech) */
1806
+
1852
1807
  ctx: Ctx | null;
1853
1808
  observedLane?: string;
1854
- /** `line`: an asset line of the venue on that chain (ASSET_LINES), when the chain's row is one line, not the venue's default asset */
1809
+
1855
1810
  chains: {
1856
1811
  chainId: number;
1857
1812
  escrow: Ref | null;
1858
1813
  status: 'live' | 'devnet' | 'prepared' | 'read-only';
1859
1814
  line?: AssetLineId;
1860
1815
  }[];
1861
- /** the venue's payment system in plain words */
1816
+
1862
1817
  payment: string;
1863
1818
  asset: string;
1864
- /** where the buyer's money sits in each held state (every held state the lane reaches) */
1819
+
1865
1820
  moneyAt: Partial<Record<State, string>>;
1866
1821
  refund: {
1867
1822
  rule: 'hook' | 'claim' | 'claim-if-deployed' | 'none';
@@ -1871,54 +1826,52 @@ export type VenueAdapter = {
1871
1826
  kind: Attach;
1872
1827
  how: string;
1873
1828
  }[];
1874
- /** the phase-map revenue hooks this venue's assurance earns through */
1829
+
1875
1830
  revenue: {
1876
1831
  hook: RevenueHook;
1877
1832
  how: string;
1878
1833
  }[];
1879
- /** the read the layer already runs for this venue: no second index */
1834
+
1880
1835
  observe: {
1881
1836
  index: string;
1882
1837
  adapter: string;
1883
1838
  reads: string[];
1884
1839
  };
1885
- /** external cover's own id for the venue, when it sells policies there */
1840
+
1886
1841
  coverVenue: 'erc8183' | 'bitagent' | 'memo-acp' | 'olas-mech' | 'x402' | null;
1887
- /** may the public build money calls through us here (Moonbeam: no, pilot only) */
1842
+
1888
1843
  publicWrites: boolean;
1889
- /** what an integration needs that does not exist yet, or waits on a decision */
1844
+
1890
1845
  needs: string[];
1891
1846
  };
1892
- /** _GRID_LINE_v1_: one asset per job (V4: no oracle on the money path). An asset line is one hook instance whose job asset is
1893
- * that asset, with pools in that asset; a pool covers only jobs in its own asset. Every line walks the hook lane. */
1847
+
1894
1848
  export type AssetLineId = 'grid';
1895
1849
  export type AssetLine = {
1896
1850
  id: AssetLineId;
1897
- /** what a person reads */ name: string;
1851
+ name: string;
1898
1852
  chainId: number;
1899
1853
  asset: {
1900
1854
  symbol: string;
1901
1855
  decimals: number;
1902
1856
  pegUsd: number | null;
1903
1857
  };
1904
- /** 'prepared': the terms and the quote exist; buying waits on `opens` */ status: 'live' | 'prepared';
1905
- /** the one plain sentence shown instead of a buy action while the line is prepared */ opens: string | null;
1906
- /** the promise, in plain words */ promise: string;
1907
- /** what the line never does */ never: string;
1908
- /** jev-wilson's calibration of the line (judge/wilson calibration/<id>.json) and the hook bounds its quotes pass */
1858
+ status: 'live' | 'prepared';
1859
+ opens: string | null;
1860
+ promise: string;
1861
+ never: string;
1862
+
1909
1863
  economy: {
1910
1864
  calibration: string;
1911
1865
  maxPremiumBps: number;
1912
1866
  minBackersAprBps: number;
1913
1867
  };
1914
- /** the phase-map revenue hook the layer's leg lands in */ revenue: RevenueHook;
1915
- /** what the line needs that does not exist yet */ needs: string[];
1868
+ revenue: RevenueHook;
1869
+ needs: string[];
1916
1870
  };
1917
- /** the venue's trail as machine events: event names pass through; phases, hook states and handshake states become states */
1871
+
1918
1872
  export declare function eventsOf(trail: NativeStep[]): AssuranceEvent[];
1919
- /** the revenue hooks of phase-map, by name (a typo fails the adapter test) */
1873
+
1920
1874
  export declare const knownHook: (h: string) => boolean;
1921
1875
  export declare const moonbeamVenue: VenueAdapter;
1922
- /** the venues of this profile (moonbeam) */
1876
+
1923
1877
  export declare const VENUES: Partial<Record<VenueId, VenueAdapter>>;
1924
- //# sourceMappingURL=assurance-shared.d.ts.map