@moonbeam-foundation/sdk 0.12.0 → 0.13.1

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 (155) hide show
  1. package/README.md +79 -18
  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/core/keyed.d.ts +17 -0
  12. package/dist/core/keyed.d.ts.map +1 -0
  13. package/dist/core/keyed.js +36 -0
  14. package/dist/core/keyed.js.map +1 -0
  15. package/dist/cover/index.d.ts +3 -3
  16. package/dist/cover/index.d.ts.map +1 -1
  17. package/dist/cover/index.js +2 -1
  18. package/dist/cover/index.js.map +1 -1
  19. package/dist/devnet/index.d.ts +3 -3
  20. package/dist/devnet/index.d.ts.map +1 -1
  21. package/dist/devnet/index.js +7 -6
  22. package/dist/devnet/index.js.map +1 -1
  23. package/dist/devnet/profile.d.ts +1 -1
  24. package/dist/devnet/profile.d.ts.map +1 -1
  25. package/dist/devnet/profile.js +3 -2
  26. package/dist/devnet/profile.js.map +1 -1
  27. package/dist/economy/index.d.ts +264 -0
  28. package/dist/economy/index.d.ts.map +1 -0
  29. package/dist/economy/index.js +376 -0
  30. package/dist/economy/index.js.map +1 -0
  31. package/dist/erc8183/index.d.ts +1 -1
  32. package/dist/errors/index.d.ts +5 -5
  33. package/dist/errors/index.d.ts.map +1 -1
  34. package/dist/errors/index.js +3 -3
  35. package/dist/jobs/index.d.ts +4 -4
  36. package/dist/jobs/index.d.ts.map +1 -1
  37. package/dist/jobs/index.js +3 -2
  38. package/dist/jobs/index.js.map +1 -1
  39. package/dist/market/cohorts.d.ts +112 -0
  40. package/dist/market/cohorts.d.ts.map +1 -0
  41. package/dist/market/cohorts.js +72 -0
  42. package/dist/market/cohorts.js.map +1 -0
  43. package/dist/market/http.d.ts.map +1 -1
  44. package/dist/market/http.js +2 -1
  45. package/dist/market/http.js.map +1 -1
  46. package/dist/market/index.d.ts +27 -17
  47. package/dist/market/index.d.ts.map +1 -1
  48. package/dist/market/index.js +16 -9
  49. package/dist/market/index.js.map +1 -1
  50. package/dist/market/journey.d.ts +7 -7
  51. package/dist/market/journey.d.ts.map +1 -1
  52. package/dist/market/journey.js +10 -9
  53. package/dist/market/journey.js.map +1 -1
  54. package/dist/market/listed.d.ts +228 -0
  55. package/dist/market/listed.d.ts.map +1 -0
  56. package/dist/market/listed.js +169 -0
  57. package/dist/market/listed.js.map +1 -0
  58. package/dist/market/reads.d.ts +124 -0
  59. package/dist/market/reads.d.ts.map +1 -0
  60. package/dist/market/reads.js +99 -0
  61. package/dist/market/reads.js.map +1 -0
  62. package/dist/market/sale-stops.d.ts +2 -2
  63. package/dist/market/sale-stops.d.ts.map +1 -1
  64. package/dist/market/states-data.d.ts +491 -0
  65. package/dist/market/states-data.d.ts.map +1 -0
  66. package/dist/market/states-data.js +4 -0
  67. package/dist/market/states-data.js.map +1 -0
  68. package/dist/market/states.d.ts +40 -0
  69. package/dist/market/states.d.ts.map +1 -0
  70. package/dist/market/states.js +36 -0
  71. package/dist/market/states.js.map +1 -0
  72. package/dist/market/venues-data.d.ts.map +1 -1
  73. package/dist/market/venues-data.js +808 -40
  74. package/dist/market/venues-data.js.map +1 -1
  75. package/dist/market/venues.d.ts +50 -5
  76. package/dist/market/venues.d.ts.map +1 -1
  77. package/dist/market/venues.js +23 -7
  78. package/dist/market/venues.js.map +1 -1
  79. package/dist/onboard/index.d.ts +215 -33
  80. package/dist/onboard/index.d.ts.map +1 -1
  81. package/dist/onboard/index.js +344 -34
  82. package/dist/onboard/index.js.map +1 -1
  83. package/dist/onboard/send.d.ts +43 -0
  84. package/dist/onboard/send.d.ts.map +1 -0
  85. package/dist/onboard/send.js +65 -0
  86. package/dist/onboard/send.js.map +1 -0
  87. package/dist/playground/cases.d.ts +72 -0
  88. package/dist/playground/cases.d.ts.map +1 -0
  89. package/dist/playground/cases.js +115 -0
  90. package/dist/playground/cases.js.map +1 -0
  91. package/dist/playground/doc.d.ts +2 -0
  92. package/dist/playground/doc.d.ts.map +1 -0
  93. package/dist/playground/doc.js +52 -0
  94. package/dist/playground/doc.js.map +1 -0
  95. package/dist/playground/index.d.ts +172 -0
  96. package/dist/playground/index.d.ts.map +1 -0
  97. package/dist/playground/index.js +246 -0
  98. package/dist/playground/index.js.map +1 -0
  99. package/dist/playground/nets.d.ts +79 -0
  100. package/dist/playground/nets.d.ts.map +1 -0
  101. package/dist/playground/nets.js +147 -0
  102. package/dist/playground/nets.js.map +1 -0
  103. package/dist/playground/ports.d.ts +93 -0
  104. package/dist/playground/ports.d.ts.map +1 -0
  105. package/dist/playground/ports.js +72 -0
  106. package/dist/playground/ports.js.map +1 -0
  107. package/dist/playground/stream.d.ts +106 -0
  108. package/dist/playground/stream.d.ts.map +1 -0
  109. package/dist/playground/stream.js +269 -0
  110. package/dist/playground/stream.js.map +1 -0
  111. package/dist/pools/index.d.ts +18 -7
  112. package/dist/pools/index.d.ts.map +1 -1
  113. package/dist/pools/index.js +31 -9
  114. package/dist/pools/index.js.map +1 -1
  115. package/dist/proof/index.d.ts +5 -5
  116. package/dist/proof/index.d.ts.map +1 -1
  117. package/dist/proof/index.js +3 -2
  118. package/dist/proof/index.js.map +1 -1
  119. package/dist/resale/index.d.ts +13 -13
  120. package/dist/resale/index.d.ts.map +1 -1
  121. package/dist/resale/index.js +20 -19
  122. package/dist/resale/index.js.map +1 -1
  123. package/dist/resale/payment-scheme.d.mts +2 -5
  124. package/dist/resale/payment-scheme.mjs +16 -116
  125. package/dist/resale/payment-scheme.pin.json +1 -2
  126. package/dist/resale/settle-rule.d.ts +3 -3
  127. package/dist/resale/settle-rule.d.ts.map +1 -1
  128. package/dist/resale/settle-rule.js +3 -3
  129. package/dist/resale/settle-rule.js.map +1 -1
  130. package/dist/rpc/index.js +1 -1
  131. package/dist/workflows/index.js +1 -1
  132. package/dist/workflows/steps.d.ts +4 -4
  133. package/dist/workflows/steps.d.ts.map +1 -1
  134. package/dist/workflows/steps.js +4 -4
  135. package/dist/workflows/steps.js.map +1 -1
  136. package/dist/workflows/types.d.ts +1 -1
  137. package/dist/x402/index.d.ts +2 -2
  138. package/dist/x402/index.d.ts.map +1 -1
  139. package/dist/x402/index.js +5 -4
  140. package/dist/x402/index.js.map +1 -1
  141. package/docs/PATHS.md +96 -0
  142. package/docs/REFERENCE.md +52 -19
  143. package/docs/VENUES.md +85 -36
  144. package/docs/WORKFLOWS.md +3 -3
  145. package/docs/io-coverage.md +206 -0
  146. package/docs/playground.md +220 -0
  147. package/examples/24-resell-on-base.mjs +1 -1
  148. package/examples/50-x402-pay-a-wall.mjs +1 -1
  149. package/examples/51-read-a-proof.mjs +2 -2
  150. package/examples/README.md +1 -1
  151. package/examples/data/cross-list.recorded.json +1 -1
  152. package/examples/data/x402-wall-402.json +6 -6
  153. package/package.json +28 -4
  154. package/dist/assurance/assurance-shared.d.ts.map +0 -1
  155. package/dist/assurance/assurance-shared.js.map +0 -1
package/README.md CHANGED
@@ -22,25 +22,34 @@ and names who signs each.
22
22
 
23
23
  ## Every venue
24
24
 
25
- One table in code, `VENUES` in `./market`. Each step's state is read from the Moonbeam product's market register (2026-11-07).
25
+ One table in code, `VENUES` in `./market`; the table below is generated from it. The operator's listings, and the register's
26
+ proof for each step, are in [docs/VENUES.md](docs/VENUES.md).
26
27
 
27
- | Market | What a seller does there | List | Take a job · settle | SDK calls |
28
+ <!-- venues:moonbeam:start (scripts/gen-readme-venues.mjs) -->
29
+ Read on 2026-11-14. The states are Moonbeam's own listing on each market (`venue.cohorts.moonbeam`).
30
+
31
+ | Market | What a seller does there | Moonbeam: list | Take a job · settle | SDK calls |
28
32
  |---|---|---|---|---|
29
- | x402 (Bazaar, x402scan, Ultravioleta, PayAI) | paid per call in USDC on Base | live | live · live | `publishListing`, `handOver`, `agentSales` |
30
- | Virtuals ACP (ERC-8183 jobs) | an ERC-8183 job: deliver, graded, paid by the contract | not yet | self-test · self-test | `publishListing`, `readJobs`, `jobCalls` |
31
- | Virtuals memo jobs (memo-ACP) | a job moved by memos through the Virtuals router | not yet | not yet · not yet | `publishListing`, `readJobs`, `jobCalls` |
32
- | BitAgent | ERC-8183 jobs on BitAgent's contract | not yet | not yet · not yet | `publishListing`, `readJobs`, `jobCalls` |
33
- | Olas Mech | one paid request, answered on chain | live | not yet · not yet | `readListing` (`export.olas`), `olasRequest` |
34
- | NEAR AI Agent Market | found by category, hired over A2A | partial | not yet · not yet | `readListing` (`export.near`), `handOver` |
35
- | A2A Registry | a directory of agent cards | live | not yet · n/a | `listOn`, `handOver` |
36
- | MCP Registry (+ Glama, PulseMCP) | the official registry of MCP servers | partial | not yet · n/a | `listOn`, `handOver` |
37
- | ERC-8004 | the identity every other market reads | live | n/a · n/a | `listOn`, `register8004Calls` |
38
- | Workflow nodes (npm) | the agent as a node in a workflow builder | live | not yet · n/a | `./workflows` |
39
-
40
- **live** means outside buyers' money ran through it. **self-test** means it ran with Moonbeam on both sides. **n/a** means the
41
- market has no such step. x402 is where the buyers are: 400,545 USD was paid on it in the 7 days read on 2026-11-08 (`markets()`).
42
-
43
- `venues(t, { agent })` folds in what the layer reads now: each market's own status and week of money, and where your agent
33
+ | x402 | Buyers pay per call in USDC on Base; each paid task is handed to your agent and settled through the facilitator. | live | tested · partial | `publishListing`, `handOver`, `agentSales` |
34
+ | Virtuals ACP (ERC-8183 jobs) | A buyer opens an ERC-8183 job with a budget; the provider delivers, the evaluator completes or rejects, the contract pays. | live | tested · tested | `publishListing`, `readJobs`, `jobCalls` |
35
+ | Olas Mech | A requester pays a mech on Base for one request; the mech delivers its answer on chain. | not yet | not yet · not yet | `readListing`, `olasRequest` |
36
+ | NEAR AI Agent Market | Buyers find an agent by category and its own words, and hire it over A2A. | live | partial · partial | `readListing`, `handOver` |
37
+ | A2A Registry | A directory of A2A agent cards; buyers call the agent at its card's endpoint. | live | tested · n/a | `listOn`, `handOver`, `agentSales` |
38
+ | MCP Registry | The official MCP Registry and its mirrors (Glama, PulseMCP); clients call the agent's MCP door. | live | tested · n/a | `listOn`, `handOver`, `agentSales` |
39
+ | ERC-8004 | The identity registry on Base every other market reads: the agent's id, card and endpoint. | live | n/a · n/a | `listOn` |
40
+
41
+ Moonbeam does not list agents on Virtuals memo jobs (memo-ACP), BitAgent or Workflow nodes (npm). They stay in `VENUES` as read-only rows (`moonbeamLists: false`).
42
+
43
+ - **live**: listed and read back on the market (list), or running there for outside money (take, settle).
44
+ - **tested**: Moonbeam ran the whole step end to end itself and keeps the run as an I/O test (`test/io`).
45
+ - **partial**: part of the step runs.
46
+ - **shared**: another cohort's listing stands in. **closed**: the market takes no new agent.
47
+ - **n/a**: the market has no such step.
48
+ <!-- venues:moonbeam:end -->
49
+
50
+ x402 is where the buyers are: 400,545 USD was paid on it in the 7 days read on 2026-11-08 (`markets()`).
51
+
52
+ `venues(t, { agent })` folds in what Moonbeam reads now: each market's own status and week of money, and where your agent
44
53
  stands on the three markets of the list step. Every row also carries the register's words, its read date and the `paid` step.
45
54
  Detail per venue: [docs/VENUES.md](docs/VENUES.md).
46
55
 
@@ -58,9 +67,22 @@ await usage(t); // this month's calls and spe
58
67
  await planOffers(t); // builder 99, team 199, protocol 299 USDC per 30 days; a 1 USDC top-up
59
68
  ```
60
69
 
61
- `planOffers` reads the layer's 402 answer, so nothing is minted or paid. `agentSales(t, 'mcp.digest')` reads what an agent's
70
+ `planOffers` reads Moonbeam's 402 answer, so nothing is minted or paid. `agentSales(t, 'mcp.digest')` reads what an agent's
62
71
  class wall sold, by day and buying market, and where each seller share stands.
63
72
 
73
+ ### Where it is listed, and the plan to list it
74
+
75
+ ```ts
76
+ import { transportFromEnv, journey, list } from '@moonbeam-foundation/sdk/market';
77
+
78
+ const j = await journey(t, '8453:1170141'); // every venue: standing, five LEDs (offer, hire, list, read back, paid), next step
79
+ j.venues['erc8183-base'].leds.list; // { state: 'on', why, evidence: [{ kind, ref, read_at }], moves_when }
80
+ await list(t, { venue: 'erc8183-base', agent: 'moonbeam' }); // the Virtuals ACP listing step by step, its offerings, done
81
+ ```
82
+
83
+ Both only read. `list` plans: it never asks for a signer, registers or shows an offering, and its `human` item (the one
84
+ approval a person gives in the Moonbeam Studio) is returned, never acted on.
85
+
64
86
  ## One sale, stop by stop
65
87
 
66
88
  `SALE_STOPS` pairs the Studio's sale tour 1:1 with the SDK: 17 stops, each with exactly one call.
@@ -79,6 +101,10 @@ class wall sold, by day and buying market, and where each seller share stands.
79
101
 
80
102
  Each stop also names its Studio command, its layer route and what it needs (offline, the free rate, or your key).
81
103
 
104
+ `STATES` is the sale's state table: every state a sale can be in (32: the main line, the held and the ended ones), each with
105
+ its step, label, light and the one read that shows it, and `MOVES` the legal moves between them. `readState(t, 'paid', params)`
106
+ fills the route's placeholders from `params` and reads that state; it only reads. The table is generated, never typed.
107
+
82
108
  ## Price a cross-listed sale
83
109
 
84
110
  ```ts
@@ -98,6 +124,41 @@ Each node of a Studio workflow has one class (knowledge, check, transform, conne
98
124
  `@moonbeam-foundation/sdk/workflows` holds the seven workflows as data, and [docs/WORKFLOWS.md](docs/WORKFLOWS.md) draws them
99
125
  with each node's last run.
100
126
 
127
+ ## Try a covered job on the devnet, then on Base
128
+
129
+ `@moonbeam-foundation/sdk/playground` is one switch between the Moonbeam devnet and Base. Each cover case (delivered and
130
+ accepted, auto-complete, no-show, a rejection, a cheat, a withdrawn or lapsed offer, a protocol fee sweep, a pool round trip) is
131
+ one plan with the same steps on both networks; only the signers, the chain id and the addresses you pass differ.
132
+
133
+ ```ts
134
+ import { playground, fakePorts } from '@moonbeam-foundation/sdk/playground';
135
+
136
+ const pg = playground({ net: 'devnet', placement }); // Base: also allowMainnet, a budget and two green devnet runs
137
+ const plan = pg.plan('no-show', { market: 'erc8183-base', quote, salt, parties, deadline }); // pure: steps, legs, lights
138
+ const run = await pg.run('no-show', { market: 'erc8183-base', quote, salt, deadline }, fakePorts());
139
+ ```
140
+
141
+ Moonbeam's own steps (the evaluator, the arbitrator, the keeper, the payout) are sign requests on the coord pipe, never a key.
142
+ [docs/playground.md](docs/playground.md) has who signs each role per network, every case's steps, and the gaps.
143
+
144
+ ## Coord I/O coverage, every market and stage
145
+
146
+ Every market Moonbeam lists on, every stage of a sale (listed, bought, delivered, settled, paid) and both directions (read,
147
+ write) is one cell of `test/io/coverage.json`. Each cell holds coord operations with a recorded fixture (a public read, the devnet
148
+ ledger, or a request and answer built only from coord's declared fields), or a named gap: `needs_key`, `needs_payment`,
149
+ `needs_owner_arm`, `no_devnet_twin` or `not_in_coord`. `test/io/replay.test.ts` feeds every fixture through the SDK function
150
+ that makes or reads that call; the gap count may only go down. The table per market is [docs/io-coverage.md](docs/io-coverage.md).
151
+
152
+ When coord ships, check the matrix against its new catalogue (a coord checkout at the new sha):
153
+
154
+ ```bash
155
+ npm run io:check -- --coord ../coord
156
+ ```
157
+
158
+ It rewrites `test/io/coverage.json` and `docs/io-coverage.md`, and fails when a coord operation tagged to a kept market has no
159
+ cell, an operation the map names is gone, or a fixture's request or answer no longer matches coord's declared shape. Place a new
160
+ operation in `test/io/op-map.json`, then record its fixture with `npm run io:record -- --coord ../coord --only <call>`.
161
+
101
162
  ## Your key
102
163
 
103
164
  Markets, sellers, the sale's reads and agent cards read without a key, on a shared free rate. Listing, checking, handing over
package/bin/moonbeam.mjs CHANGED
@@ -19,9 +19,12 @@ if (cmd === 'workflows') {
19
19
  if (cmd === 'venues') {
20
20
  const { VENUES, VENUES_READ_ON, SALE_STOPS } = await import('../dist/market/index.js');
21
21
  const cell = (s) => `${s.state}${s.call ? ` ${s.call}` : ''}`.padEnd(32);
22
- console.log(`every venue, as the register read it on ${VENUES_READ_ON}`);
22
+ console.log(`every venue: the register's proof for the operator's own listings, read on ${VENUES_READ_ON} (Moonbeam's own: below)`);
23
23
  console.log(`${'venue'.padEnd(30)}${'list'.padEnd(32)}${'take a job'.padEnd(32)}${'settle'.padEnd(32)}paid`);
24
24
  for (const v of VENUES) console.log(`${v.name.padEnd(30)}${cell(v.list)}${cell(v.take)}${cell(v.settle)}${v.paid.state}${v.paid.call ? ` ${v.paid.call}` : ''}`);
25
+ // _VENUE_TRUTH_v1_: each cohort's own list · take · settle
26
+ console.log('\neach cohort its own listing: list · take · settle');
27
+ for (const v of VENUES) console.log(`${v.name.padEnd(30)}${['moonbeam', 'operator'].map((c) => { const x = v.cohorts[c]; return `${c}: ${x.list.state} · ${x.take.state} · ${x.settle.state}`.padEnd(44); }).join('')}`);
25
28
  console.log('\none sale, stop by stop');
26
29
  for (const s of SALE_STOPS) console.log(`${String(s.order).padStart(2)} ${s.label.padEnd(20)} ${s.call.padEnd(26)} ${s.route ?? 'offline'}`);
27
30
  process.exit(0);
@@ -46,7 +46,7 @@ export declare const MIN_JOBS_FOR_A_RECORD = 20;
46
46
  */
47
47
  export declare const WILSON_Z = 1.959963984540054;
48
48
  /**
49
- * The 95 % Wilson score interval on k events in n trials: @taifoon/jev-wilson's `wilson`, the same arithmetic as
49
+ * The 95 % Wilson score interval on k events in n trials: the grading package's `wilson`, the same arithmetic as
50
50
  * /v1/pools/quote. [0, 1] when n is 0. Kept as a name for the studio's folds and the onboard module.
51
51
  */
52
52
  export declare function wilsonScore(k: number, n: number, z?: number): [number, number];
@@ -11,7 +11,7 @@ export const MIN_JOBS_FOR_A_RECORD = 20;
11
11
  */
12
12
  export const WILSON_Z = Z;
13
13
  /**
14
- * The 95 % Wilson score interval on k events in n trials: @taifoon/jev-wilson's `wilson`, the same arithmetic as
14
+ * The 95 % Wilson score interval on k events in n trials: the grading package's `wilson`, the same arithmetic as
15
15
  * /v1/pools/quote. [0, 1] when n is 0. Kept as a name for the studio's folds and the onboard module.
16
16
  */
17
17
  export function wilsonScore(k, n, z = WILSON_Z) {
@@ -1,8 +1,14 @@
1
1
  export declare const ARBITRATION_ON_BASE: Readonly<{
2
- deployed: false;
3
- router: null;
4
- says: "The ArbitratorRouter is not deployed on Base and the hook names no arbitrator: no dispute can be ruled there yet.";
2
+ deployed: boolean;
3
+ router: string | null;
4
+ says: string;
5
5
  }>;
6
+ /**
7
+ * The router a call or a signature may name. Once a router is pinned (`pinned`, by default ARBITRATION_ON_BASE.router), any
8
+ * other address is refused, so a caller cannot be pointed at a contract that is not the appointed arbitrator. Until one is
9
+ * pinned (today) the caller's address is used as given, for a fork or a test network; nothing on Base can be ruled yet.
10
+ */
11
+ export declare function checkRouter(router: string, pinned?: string | null): string;
6
12
  /** Router.Verdict */
7
13
  export declare const VERDICT: Readonly<{
8
14
  readonly None: 0;
@@ -57,7 +63,7 @@ export declare function secondGraderTypedData(router: string, v: SignedVerdict):
57
63
  name: string;
58
64
  version: string;
59
65
  chainId: 8453;
60
- verifyingContract: `0x${string}`;
66
+ verifyingContract: string;
61
67
  };
62
68
  types: {
63
69
  Verdict: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/arbitration/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,mBAAmB;;;;EAI9B,CAAC;AAEH,qBAAqB;AACrB,eAAO,MAAM,OAAO;mBAAyB,CAAC;yBAAc,CAAC;wBAAa,CAAC;sBAAW,CAAC;EAAY,CAAC;AACpG,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,OAAO,OAAO,EAAE,MAAM,CAAC,CAAC;AAChE,kBAAkB;AAClB,eAAO,MAAM,IAAI;mBAAyB,CAAC;mBAAQ,CAAC;2BAAgB,CAAC;sBAAW,CAAC;EAAY,CAAC;AAC9F,0EAA0E;AAC1E,eAAO,MAAM,cAAc,uEAAuE,CAAC;AAEnG,eAAO,MAAM,iBAAiB;4BACb,8BAA8B;oCACtB,gIAAgI;6BACvI,4DAA4D;yBAChE,2BAA2B;+BACrB,iCAAiC;oBAC5C,sBAAsB;4BACd,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EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,OAAO,IAAI,CAAC;IAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAG3H,kDAAkD;AAClD,wBAAgB,eAAe,CAAC,GAAG,EAAE;IAAE,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,GAAG,IAAI,CAQpG;AAED,+GAA+G;AAC/G,wBAAgB,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG;IAAE,YAAY,EAAE,SAAS,GAAG,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAItG"}
@@ -14,9 +14,22 @@ import { encodeFunction, encodeParams, decodeStatic, topicOf } from '../abi/inde
14
14
  import { keccakHex, hexToBytes, utf8, isAddress } from '../onboard/index.js';
15
15
  export const ARBITRATION_ON_BASE = Object.freeze({
16
16
  deployed: false,
17
+ /** the router this SDK pins on Base: set in the release that follows its deployment and appointment; until then null */
17
18
  router: null,
18
19
  says: 'The ArbitratorRouter is not deployed on Base and the hook names no arbitrator: no dispute can be ruled there yet.',
19
20
  });
21
+ /**
22
+ * The router a call or a signature may name. Once a router is pinned (`pinned`, by default ARBITRATION_ON_BASE.router), any
23
+ * other address is refused, so a caller cannot be pointed at a contract that is not the appointed arbitrator. Until one is
24
+ * pinned (today) the caller's address is used as given, for a fork or a test network; nothing on Base can be ruled yet.
25
+ */
26
+ export function checkRouter(router, pinned = ARBITRATION_ON_BASE.router) {
27
+ if (!isAddress(router))
28
+ throw new Error(`router ${router} is not an address (${ARBITRATION_ON_BASE.says})`);
29
+ if (pinned !== null && router.toLowerCase() !== pinned.toLowerCase())
30
+ throw new Error(`router ${router} is not the pinned ArbitratorRouter on Base (${pinned})`);
31
+ return router;
32
+ }
20
33
  /** Router.Verdict */
21
34
  export const VERDICT = Object.freeze({ None: 0, SellerWins: 1, BuyerWins: 2, Cheated: 3 });
22
35
  /** Router.Tier */
@@ -38,8 +51,7 @@ export const ROUTER_EVENTS = Object.freeze({
38
51
  Resolved: 'Resolved(bytes32 indexed jobId, uint8 indexed tier, uint8 verdict, uint256 loss, address by)',
39
52
  });
40
53
  const B32 = /^0x[0-9a-fA-F]{64}$/;
41
- const need = (router) => { if (!isAddress(router))
42
- throw new Error(`router ${router} is not an address (${ARBITRATION_ON_BASE.says})`); return router; };
54
+ const need = (router) => checkRouter(router);
43
55
  const jid = (j) => { if (!B32.test(j))
44
56
  throw new RangeError('a job id is bytes32'); return j; };
45
57
  const call = (router, fn, args, who) => ({ chainId: 8453, to: need(router), data: encodeFunction(ROUTER_SIGNATURES[fn], args), value: '0', fn: `ArbitratorRouter.${fn}`, who });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/arbitration/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,QAAQ,EAAE,KAAc;IACxB,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,mHAAmH;CAC1H,CAAC,CAAC;AAEH,qBAAqB;AACrB,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAW,CAAC,CAAC;AAEpG,kBAAkB;AAClB,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MA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