@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.
- package/README.md +30 -14
- package/bin/moonbeam.mjs +4 -1
- package/dist/actors/track-record.d.ts +1 -1
- package/dist/actors/track-record.js +1 -1
- package/dist/arbitration/index.d.ts +10 -4
- package/dist/arbitration/index.d.ts.map +1 -1
- package/dist/arbitration/index.js +14 -2
- package/dist/arbitration/index.js.map +1 -1
- package/dist/assurance/assurance-shared.d.ts +85 -132
- package/dist/assurance/assurance-shared.js +46 -90
- package/dist/cover/index.d.ts +3 -3
- package/dist/cover/index.d.ts.map +1 -1
- package/dist/devnet/index.d.ts +3 -3
- package/dist/devnet/index.d.ts.map +1 -1
- package/dist/devnet/index.js +4 -4
- package/dist/devnet/index.js.map +1 -1
- package/dist/devnet/profile.d.ts +1 -1
- package/dist/devnet/profile.d.ts.map +1 -1
- package/dist/erc8183/index.d.ts +1 -1
- package/dist/errors/index.d.ts +5 -5
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +3 -3
- package/dist/jobs/index.d.ts +4 -4
- package/dist/jobs/index.d.ts.map +1 -1
- package/dist/jobs/index.js +1 -1
- package/dist/jobs/index.js.map +1 -1
- package/dist/market/cohorts.d.ts +106 -0
- package/dist/market/cohorts.d.ts.map +1 -0
- package/dist/market/cohorts.js +70 -0
- package/dist/market/cohorts.js.map +1 -0
- package/dist/market/index.d.ts +24 -17
- package/dist/market/index.d.ts.map +1 -1
- package/dist/market/index.js +13 -9
- package/dist/market/index.js.map +1 -1
- package/dist/market/journey.d.ts +7 -7
- package/dist/market/journey.d.ts.map +1 -1
- package/dist/market/journey.js +7 -7
- package/dist/market/journey.js.map +1 -1
- package/dist/market/listed.d.ts +228 -0
- package/dist/market/listed.d.ts.map +1 -0
- package/dist/market/listed.js +168 -0
- package/dist/market/listed.js.map +1 -0
- package/dist/market/sale-stops.d.ts +2 -2
- package/dist/market/sale-stops.d.ts.map +1 -1
- package/dist/market/venues-data.d.ts.map +1 -1
- package/dist/market/venues-data.js +770 -40
- package/dist/market/venues-data.js.map +1 -1
- package/dist/market/venues.d.ts +46 -3
- package/dist/market/venues.d.ts.map +1 -1
- package/dist/market/venues.js +21 -6
- package/dist/market/venues.js.map +1 -1
- package/dist/onboard/index.d.ts +214 -33
- package/dist/onboard/index.d.ts.map +1 -1
- package/dist/onboard/index.js +340 -31
- package/dist/onboard/index.js.map +1 -1
- package/dist/onboard/send.d.ts +43 -0
- package/dist/onboard/send.d.ts.map +1 -0
- package/dist/onboard/send.js +65 -0
- package/dist/onboard/send.js.map +1 -0
- package/dist/pools/index.d.ts +18 -7
- package/dist/pools/index.d.ts.map +1 -1
- package/dist/pools/index.js +31 -9
- package/dist/pools/index.js.map +1 -1
- package/dist/proof/index.d.ts +5 -5
- package/dist/proof/index.d.ts.map +1 -1
- package/dist/proof/index.js +1 -1
- package/dist/resale/index.d.ts +13 -13
- package/dist/resale/index.d.ts.map +1 -1
- package/dist/resale/index.js +17 -17
- package/dist/resale/index.js.map +1 -1
- package/dist/resale/payment-scheme.d.mts +2 -5
- package/dist/resale/payment-scheme.mjs +16 -116
- package/dist/resale/payment-scheme.pin.json +1 -2
- package/dist/resale/settle-rule.d.ts +3 -3
- package/dist/resale/settle-rule.d.ts.map +1 -1
- package/dist/resale/settle-rule.js +3 -3
- package/dist/resale/settle-rule.js.map +1 -1
- package/dist/rpc/index.js +1 -1
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/steps.d.ts +4 -4
- package/dist/workflows/steps.d.ts.map +1 -1
- package/dist/workflows/steps.js +4 -4
- package/dist/workflows/steps.js.map +1 -1
- package/dist/workflows/types.d.ts +1 -1
- package/dist/x402/index.d.ts +2 -2
- package/dist/x402/index.d.ts.map +1 -1
- package/dist/x402/index.js +2 -2
- package/dist/x402/index.js.map +1 -1
- package/docs/REFERENCE.md +52 -19
- package/docs/VENUES.md +85 -36
- package/docs/WORKFLOWS.md +3 -3
- package/examples/24-resell-on-base.mjs +1 -1
- package/examples/51-read-a-proof.mjs +2 -2
- package/examples/README.md +1 -1
- package/examples/data/cross-list.recorded.json +1 -1
- package/package.json +3 -1
- package/dist/assurance/assurance-shared.d.ts.map +0 -1
- package/dist/assurance/assurance-shared.js.map +0 -1
package/README.md
CHANGED
|
@@ -22,25 +22,28 @@ and names who signs each.
|
|
|
22
22
|
|
|
23
23
|
## Every venue
|
|
24
24
|
|
|
25
|
-
One table in code, `VENUES` in `./market`.
|
|
25
|
+
One table in code, `VENUES` in `./market`. The columns below are Moonbeam's own listing on each market, `venue.cohorts.moonbeam`,
|
|
26
|
+
read on 2026-11-14 from the markets' own pages and the listing reads. The operator's listings, and the register's proof for each
|
|
27
|
+
step, are in [docs/VENUES.md](docs/VENUES.md).
|
|
26
28
|
|
|
27
|
-
| Market | What a seller does there |
|
|
29
|
+
| Market | What a seller does there | Moonbeam: list | Take a job · settle | SDK calls |
|
|
28
30
|
|---|---|---|---|---|
|
|
29
|
-
| x402 (Bazaar, x402scan, Ultravioleta, PayAI) | paid per call in USDC on Base | live |
|
|
30
|
-
| Virtuals ACP (ERC-8183 jobs) | an ERC-8183 job: deliver, graded, paid by the contract |
|
|
31
|
-
| Virtuals memo jobs (memo-ACP) | a job moved by memos through the Virtuals router |
|
|
31
|
+
| x402 (Bazaar, x402scan, Ultravioleta, PayAI) | paid per call in USDC on Base | live | partial · partial | `publishListing`, `handOver`, `agentSales` |
|
|
32
|
+
| Virtuals ACP (ERC-8183 jobs) | an ERC-8183 job: deliver, graded, paid by the contract | live | partial · partial | `publishListing`, `readJobs`, `jobCalls` |
|
|
33
|
+
| Virtuals memo jobs (memo-ACP) | a job moved by memos through the Virtuals router | closed | closed · closed | `publishListing`, `readJobs`, `jobCalls` |
|
|
32
34
|
| 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 |
|
|
34
|
-
| NEAR AI Agent Market | found by category, hired over A2A |
|
|
35
|
-
| A2A Registry | a directory of agent cards | live |
|
|
36
|
-
| MCP Registry (+ Glama, PulseMCP) | the official registry of MCP servers |
|
|
35
|
+
| Olas Mech | one paid request, answered on chain | not yet | not yet · not yet | `readListing` (`export.olas`), `olasRequest` |
|
|
36
|
+
| NEAR AI Agent Market | found by category, hired over A2A | live | not yet · not yet | `readListing` (`export.near`), `handOver` |
|
|
37
|
+
| A2A Registry | a directory of agent cards | live | partial · n/a | `listOn`, `handOver` |
|
|
38
|
+
| MCP Registry (+ Glama, PulseMCP) | the official registry of MCP servers | live | partial · n/a | `listOn`, `handOver` |
|
|
37
39
|
| 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 |
|
|
40
|
+
| Workflow nodes (npm) | the agent as a node in a workflow builder | not yet | not yet · n/a | `./workflows` |
|
|
39
41
|
|
|
40
|
-
**live
|
|
41
|
-
|
|
42
|
+
**live**: listed and read back on the market (list), or running there (take, settle). **partial**: part of the step runs.
|
|
43
|
+
**shared**: another cohort's listing stands in. **closed**: the market takes no new agent. **n/a**: the market has no such step.
|
|
44
|
+
x402 is where the buyers are: 400,545 USD was paid on it in the 7 days read on 2026-11-08 (`markets()`).
|
|
42
45
|
|
|
43
|
-
`venues(t, { agent })` folds in what
|
|
46
|
+
`venues(t, { agent })` folds in what Moonbeam reads now: each market's own status and week of money, and where your agent
|
|
44
47
|
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
48
|
Detail per venue: [docs/VENUES.md](docs/VENUES.md).
|
|
46
49
|
|
|
@@ -58,9 +61,22 @@ await usage(t); // this month's calls and spe
|
|
|
58
61
|
await planOffers(t); // builder 99, team 199, protocol 299 USDC per 30 days; a 1 USDC top-up
|
|
59
62
|
```
|
|
60
63
|
|
|
61
|
-
`planOffers` reads
|
|
64
|
+
`planOffers` reads Moonbeam's 402 answer, so nothing is minted or paid. `agentSales(t, 'mcp.digest')` reads what an agent's
|
|
62
65
|
class wall sold, by day and buying market, and where each seller share stands.
|
|
63
66
|
|
|
67
|
+
### Where it is listed, and the plan to list it
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { transportFromEnv, journey, list } from '@moonbeam-foundation/sdk/market';
|
|
71
|
+
|
|
72
|
+
const j = await journey(t, '8453:1170141'); // every venue: standing, five LEDs (offer, hire, list, read back, paid), next step
|
|
73
|
+
j.venues['erc8183-base'].leds.list; // { state: 'on', why, evidence: [{ kind, ref, read_at }], moves_when }
|
|
74
|
+
await list(t, { venue: 'erc8183-base', agent: 'moonbeam' }); // the Virtuals ACP listing step by step, its offerings, done
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Both only read. `list` plans: it never asks for a signer, registers or shows an offering, and its `human` item (the one
|
|
78
|
+
approval a person gives in the Moonbeam Studio) is returned, never acted on.
|
|
79
|
+
|
|
64
80
|
## One sale, stop by stop
|
|
65
81
|
|
|
66
82
|
`SALE_STOPS` pairs the Studio's sale tour 1:1 with the SDK: 17 stops, each with exactly one call.
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
3
|
-
router: null;
|
|
4
|
-
says:
|
|
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:
|
|
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
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/arbitration/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAKnG,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,GAAG,IAAiC,GAAG,MAAM,CAItG;AAED,qBAAqB;AACrB,eAAO,MAAM,OAAO;mBAAyB,CAAC;yBAAc,CAAC;wBAAa,CAAC;sBAAW,CAAC;EAAY,CAAC;A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AC,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) =>
|
|
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,
|
|
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,GAAyE,MAAM,CAAC,MAAM,CAAC;IACrH,QAAQ,EAAE,KAAK;IACf,wHAAwH;IACxH,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,mHAAmH;CAC1H,CAAC,CAAC;AAEH;;;;G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