@ixo/openhands-sdk 0.1.0 → 0.3.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 +3 -4
- package/dist/cjs/chain/entityShape.d.ts +208 -0
- package/dist/cjs/chain/entityShape.d.ts.map +1 -0
- package/dist/cjs/chain/entityShape.js +201 -0
- package/dist/cjs/chain/entityShape.js.map +1 -0
- package/dist/cjs/chain/env.d.ts +73 -6
- package/dist/cjs/chain/env.d.ts.map +1 -1
- package/dist/cjs/chain/env.js +156 -14
- package/dist/cjs/chain/env.js.map +1 -1
- package/dist/cjs/config.d.ts +29 -3
- package/dist/cjs/config.d.ts.map +1 -1
- package/dist/cjs/config.js +7 -2
- package/dist/cjs/config.js.map +1 -1
- package/dist/cjs/data/agent.d.ts.map +1 -1
- package/dist/cjs/data/agent.js +5 -4
- package/dist/cjs/data/agent.js.map +1 -1
- package/dist/cjs/data/install.d.ts +36 -7
- package/dist/cjs/data/install.d.ts.map +1 -1
- package/dist/cjs/data/install.js +54 -13
- package/dist/cjs/data/install.js.map +1 -1
- package/dist/cjs/data/queue.d.ts.map +1 -1
- package/dist/cjs/data/queue.js +3 -2
- package/dist/cjs/data/queue.js.map +1 -1
- package/dist/cjs/data/receipt.d.ts.map +1 -1
- package/dist/cjs/data/receipt.js +6 -2
- package/dist/cjs/data/receipt.js.map +1 -1
- package/dist/cjs/data/threads.d.ts.map +1 -1
- package/dist/cjs/data/threads.js +8 -3
- package/dist/cjs/data/threads.js.map +1 -1
- package/dist/cjs/geo/geohash.d.ts +14 -0
- package/dist/cjs/geo/geohash.d.ts.map +1 -0
- package/dist/cjs/geo/geohash.js +64 -0
- package/dist/cjs/geo/geohash.js.map +1 -0
- package/dist/cjs/rubric/marketPlan.d.ts +144 -0
- package/dist/cjs/rubric/marketPlan.d.ts.map +1 -0
- package/dist/cjs/rubric/marketPlan.js +319 -0
- package/dist/cjs/rubric/marketPlan.js.map +1 -0
- package/dist/cjs/rubric/observation.d.ts +53 -0
- package/dist/cjs/rubric/observation.d.ts.map +1 -0
- package/dist/cjs/rubric/observation.js +38 -0
- package/dist/cjs/rubric/observation.js.map +1 -0
- package/dist/cjs/rubric/pingLink.d.ts +45 -0
- package/dist/cjs/rubric/pingLink.d.ts.map +1 -0
- package/dist/cjs/rubric/pingLink.js +74 -0
- package/dist/cjs/rubric/pingLink.js.map +1 -0
- package/dist/cjs/rubric/pingMatch.d.ts +73 -0
- package/dist/cjs/rubric/pingMatch.d.ts.map +1 -0
- package/dist/cjs/rubric/pingMatch.js +65 -0
- package/dist/cjs/rubric/pingMatch.js.map +1 -0
- package/dist/cjs/rubric/terms.d.ts +8 -0
- package/dist/cjs/rubric/terms.d.ts.map +1 -1
- package/dist/cjs/rubric/terms.js +2 -0
- package/dist/cjs/rubric/terms.js.map +1 -1
- package/dist/esm/chain/entityShape.d.ts +208 -0
- package/dist/esm/chain/entityShape.d.ts.map +1 -0
- package/dist/esm/chain/entityShape.js +184 -0
- package/dist/esm/chain/entityShape.js.map +1 -0
- package/dist/esm/chain/env.d.ts +73 -6
- package/dist/esm/chain/env.d.ts.map +1 -1
- package/dist/esm/chain/env.js +146 -12
- package/dist/esm/chain/env.js.map +1 -1
- package/dist/esm/config.d.ts +29 -3
- package/dist/esm/config.d.ts.map +1 -1
- package/dist/esm/config.js +7 -3
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/data/agent.d.ts.map +1 -1
- package/dist/esm/data/agent.js +5 -4
- package/dist/esm/data/agent.js.map +1 -1
- package/dist/esm/data/install.d.ts +36 -7
- package/dist/esm/data/install.d.ts.map +1 -1
- package/dist/esm/data/install.js +52 -12
- package/dist/esm/data/install.js.map +1 -1
- package/dist/esm/data/queue.d.ts.map +1 -1
- package/dist/esm/data/queue.js +3 -2
- package/dist/esm/data/queue.js.map +1 -1
- package/dist/esm/data/receipt.d.ts.map +1 -1
- package/dist/esm/data/receipt.js +6 -2
- package/dist/esm/data/receipt.js.map +1 -1
- package/dist/esm/data/threads.d.ts.map +1 -1
- package/dist/esm/data/threads.js +8 -3
- package/dist/esm/data/threads.js.map +1 -1
- package/dist/esm/geo/geohash.d.ts +14 -0
- package/dist/esm/geo/geohash.d.ts.map +1 -0
- package/dist/esm/geo/geohash.js +60 -0
- package/dist/esm/geo/geohash.js.map +1 -0
- package/dist/esm/rubric/marketPlan.d.ts +144 -0
- package/dist/esm/rubric/marketPlan.d.ts.map +1 -0
- package/dist/esm/rubric/marketPlan.js +305 -0
- package/dist/esm/rubric/marketPlan.js.map +1 -0
- package/dist/esm/rubric/observation.d.ts +53 -0
- package/dist/esm/rubric/observation.d.ts.map +1 -0
- package/dist/esm/rubric/observation.js +33 -0
- package/dist/esm/rubric/observation.js.map +1 -0
- package/dist/esm/rubric/pingLink.d.ts +45 -0
- package/dist/esm/rubric/pingLink.d.ts.map +1 -0
- package/dist/esm/rubric/pingLink.js +69 -0
- package/dist/esm/rubric/pingLink.js.map +1 -0
- package/dist/esm/rubric/pingMatch.d.ts +73 -0
- package/dist/esm/rubric/pingMatch.d.ts.map +1 -0
- package/dist/esm/rubric/pingMatch.js +60 -0
- package/dist/esm/rubric/pingMatch.js.map +1 -0
- package/dist/esm/rubric/terms.d.ts +8 -0
- package/dist/esm/rubric/terms.d.ts.map +1 -1
- package/dist/esm/rubric/terms.js +2 -0
- package/dist/esm/rubric/terms.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape of every entity Openhands mints, as plain data (W2 of the IXO
|
|
3
|
+
* alignment plan). Pure functions, no chain client, no `node:` builtin, so the
|
|
4
|
+
* `chain` barrel stays isomorphic and the same builders serve the browser's
|
|
5
|
+
* poster, the worker, the MCP and every script. The caller wraps the result
|
|
6
|
+
* in `MsgCreateEntity.fromPartial` / `LinkedResource.fromPartial`.
|
|
7
|
+
*
|
|
8
|
+
* What "the IXO shape" is (verified on chain and in the portal's own
|
|
9
|
+
* `createEntity.ts`, 2026-10-09):
|
|
10
|
+
*
|
|
11
|
+
* - `context` is `[{ixo: https://w3id.org/ixo/context/v1}, {class: <protocol DID>}]`;
|
|
12
|
+
* the class is the `protocol/...` the entity is created from.
|
|
13
|
+
* - `service` carries `#matrix` (type `MatrixHomeServer` — what the portal and
|
|
14
|
+
* the evals-engine match on) and, while the claim lane still serves public
|
|
15
|
+
* CIDs, `#ipfs`. Never `#cellnode`.
|
|
16
|
+
* - `linkedResource` carries `#pro` (type `Settings`, description `Profile`)
|
|
17
|
+
* and `#dmn` (type `domainCard`) on every entity; `#done`, `#rub`, `#vct`
|
|
18
|
+
* where the kind calls for them. `serviceEndpoint` is where the bytes are,
|
|
19
|
+
* `proof` their content address.
|
|
20
|
+
* - `linkedEntity` links a deed to its claim protocol (`verifiableClaim`) and
|
|
21
|
+
* a campaign ask to its campaign protocol (`partOf`). No link to any DAO.
|
|
22
|
+
*/
|
|
23
|
+
export const IXO_CONTEXT_URL = "https://w3id.org/ixo/context/v1";
|
|
24
|
+
/** A DID of the entity module's shape, `did:ixo:entity:<32 hex>`. */
|
|
25
|
+
export const isEntityDid = (value) => typeof value === "string" && /^did:ixo:entity:[0-9a-f]{32}$/.test(value);
|
|
26
|
+
/** The JSON-LD context every classed entity carries: the ixo vocabulary and the class it was created from. */
|
|
27
|
+
export function classContext(classDid) {
|
|
28
|
+
if (!isEntityDid(classDid))
|
|
29
|
+
throw new Error(`a class must be an entity DID, got ${JSON.stringify(classDid)}`);
|
|
30
|
+
return [
|
|
31
|
+
{ key: "ixo", val: IXO_CONTEXT_URL },
|
|
32
|
+
{ key: "class", val: classDid }
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
/** `{id}#matrix`, the type readers match on (`MatrixHomeServer`), the homeserver without a trailing slash. */
|
|
36
|
+
export const matrixService = (homeserver) => ({ id: "{id}#matrix", type: "MatrixHomeServer", serviceEndpoint: homeserver.replace(/\/+$/, "") });
|
|
37
|
+
/** `{id}#ipfs` — kept only while claim bodies and attachments are served as public CIDs. */
|
|
38
|
+
export const ipfsGatewayService = (gatewayUrl) => ({ id: "{id}#ipfs", type: "Ipfs", serviceEndpoint: `${gatewayUrl.replace(/\/+$/, "")}/ipfs/` });
|
|
39
|
+
const resource = (fragment, type, description, mediaType, doc) => {
|
|
40
|
+
if (!doc.url?.trim() || !doc.proof?.trim())
|
|
41
|
+
throw new Error(`#${fragment} needs both a url and a proof`);
|
|
42
|
+
return { id: `{id}#${fragment}`, type, description, mediaType, serviceEndpoint: doc.url.trim(), proof: doc.proof.trim(), encrypted: "false", right: "" };
|
|
43
|
+
};
|
|
44
|
+
/** `#pro` — blocksync surfaces it as `settings.Profile`; Trace, the portal and `data/profiles.ts` read the name from it. */
|
|
45
|
+
export const profileResource = (doc) => resource("pro", "Settings", "Profile", "application/ld+json", doc);
|
|
46
|
+
/** `#dmn` — the domain card; the indexer finds it by this type. */
|
|
47
|
+
export const domainCardResource = (doc) => resource("dmn", "domainCard", "Domain card", "application/ld+json", doc);
|
|
48
|
+
/** `#done` — the ask's terms; readers match the type, not the fragment. */
|
|
49
|
+
export const doneMeansResource = (doc) => resource("done", "DoneMeans", "What would count as done, published before the work", "application/json", doc);
|
|
50
|
+
/** `#rub` — the evals-engine rubric; the engine matches `type === "rubric"` at an id ending `#rub`, and the proof is its hex sha256. */
|
|
51
|
+
export const rubricResource = (doc) => resource("rub", "rubric", "The same terms, in the evals-engine's rubric format", "application/ld+json", doc);
|
|
52
|
+
/** `#vct` — the claim form a rubric binds to; the engine finds it by id suffix on the collection's protocol. */
|
|
53
|
+
export const claimFormResource = (doc) => resource("vct", "surveyTemplate", "The claim form this protocol's rubrics are bound to", "application/ld+json", doc);
|
|
54
|
+
/** A deed → the `protocol/verifiableClaim` its collections point at. */
|
|
55
|
+
export const verifiableClaimLink = (protocolDid) => {
|
|
56
|
+
if (!isEntityDid(protocolDid))
|
|
57
|
+
throw new Error(`verifiableClaim link needs an entity DID, got ${JSON.stringify(protocolDid)}`);
|
|
58
|
+
return { id: protocolDid, type: "protocol/verifiableClaim", relationship: "verifiableClaim", service: "" };
|
|
59
|
+
};
|
|
60
|
+
/** A campaign ask → its campaign `protocol/deed`. Never a DAO: the only `partOf` this estate writes. */
|
|
61
|
+
export const campaignLink = (campaignProtocolDid) => {
|
|
62
|
+
if (!isEntityDid(campaignProtocolDid))
|
|
63
|
+
throw new Error(`partOf link needs an entity DID, got ${JSON.stringify(campaignProtocolDid)}`);
|
|
64
|
+
return { id: campaignProtocolDid, type: "protocol/deed", relationship: "partOf", service: "" };
|
|
65
|
+
};
|
|
66
|
+
/** The `#pro` document, exactly the shape the portal writes (`createEntity.ts`) and every reader expects (`type: "profile"`, `name`). */
|
|
67
|
+
export function buildProfile(input) {
|
|
68
|
+
const name = input.name.trim();
|
|
69
|
+
if (!name)
|
|
70
|
+
throw new Error("a profile needs a name");
|
|
71
|
+
return {
|
|
72
|
+
"@context": { ixo: "https://w3id.org/ixo/ns/protocol/", "@id": "@type", type: "@type", "@protected": true },
|
|
73
|
+
id: "ixo:entity#profile",
|
|
74
|
+
type: "profile",
|
|
75
|
+
orgName: (input.orgName ?? "Openhands").trim(),
|
|
76
|
+
name,
|
|
77
|
+
image: input.image ?? "",
|
|
78
|
+
logo: input.logo ?? "",
|
|
79
|
+
brand: (input.brand ?? "Openhands").trim(),
|
|
80
|
+
location: (input.location ?? "Global").trim(),
|
|
81
|
+
description: (input.description ?? "").trim(),
|
|
82
|
+
attributes: [],
|
|
83
|
+
metrics: []
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const CARD_CONTEXT = [
|
|
87
|
+
"https://www.w3.org/ns/credentials/v2",
|
|
88
|
+
"https://w3id.org/ixo/context/v1",
|
|
89
|
+
{
|
|
90
|
+
attribute: "https://w3id.org/ixo/attributes/v1/",
|
|
91
|
+
schema: "https://schema.org/",
|
|
92
|
+
ixo: "https://w3id.org/ixo/vocab/v1",
|
|
93
|
+
prov: "http://www.w3.org/ns/prov#",
|
|
94
|
+
proj: "https://linked.data.gov.au/def/project#",
|
|
95
|
+
xsd: "http://www.w3.org/2001/XMLSchema#",
|
|
96
|
+
id: "@id",
|
|
97
|
+
type: "@type",
|
|
98
|
+
"@protected": true
|
|
99
|
+
}
|
|
100
|
+
];
|
|
101
|
+
const imageObject = (url) => ({ type: "schema:ImageObject", id: url, contentUrl: url });
|
|
102
|
+
/**
|
|
103
|
+
* The `#dmn` document: a Verifiable Credential of type `ixo:DomainCard` per
|
|
104
|
+
* `ixoworld/domainCards` (`schemas/ixo-domain-card-1.json`). Unsigned here —
|
|
105
|
+
* the indexer and the portal never verify a proof; a signer can add one.
|
|
106
|
+
*/
|
|
107
|
+
export function buildDomainCard(input) {
|
|
108
|
+
if (!isEntityDid(input.did))
|
|
109
|
+
throw new Error(`a domain card needs the entity's DID, got ${JSON.stringify(input.did)}`);
|
|
110
|
+
const name = input.name.trim();
|
|
111
|
+
if (!name)
|
|
112
|
+
throw new Error("a domain card needs a name");
|
|
113
|
+
const subject = {
|
|
114
|
+
id: input.did,
|
|
115
|
+
type: [input.type],
|
|
116
|
+
name,
|
|
117
|
+
description: input.description.trim()
|
|
118
|
+
};
|
|
119
|
+
if (input.url)
|
|
120
|
+
subject.url = input.url;
|
|
121
|
+
if (input.logo)
|
|
122
|
+
subject.logo = { ...imageObject(input.logo), "schema:additionalProperty": [
|
|
123
|
+
{ type: "schema:PropertyValue", name: "logoLight", value: imageObject(input.logo) },
|
|
124
|
+
{ type: "schema:PropertyValue", name: "logoDark", value: imageObject(input.logo) }
|
|
125
|
+
] };
|
|
126
|
+
if (input.image?.length)
|
|
127
|
+
subject.image = input.image.map(imageObject);
|
|
128
|
+
if (input.keywords?.length)
|
|
129
|
+
subject.keywords = input.keywords;
|
|
130
|
+
if (input.geo)
|
|
131
|
+
subject.geoCoordinates = { latitude: String(input.geo.latitude), longitude: String(input.geo.longitude) };
|
|
132
|
+
if (input.relatedDocument)
|
|
133
|
+
subject.relatedDocument = { type: "schema:CreativeWork", id: input.relatedDocument };
|
|
134
|
+
if (input.relationships?.length)
|
|
135
|
+
subject.relationships = input.relationships;
|
|
136
|
+
return {
|
|
137
|
+
"@context": CARD_CONTEXT,
|
|
138
|
+
id: `${input.did}#dmn`,
|
|
139
|
+
type: ["VerifiableCredential", "ixo:DomainCard"],
|
|
140
|
+
issuer: { id: input.issuer ?? input.did },
|
|
141
|
+
validFrom: input.validFrom ?? new Date().toISOString().slice(0, 19) + "Z",
|
|
142
|
+
credentialSchema: { id: "https://w3id.org/ixo/protocol/schema/v1#domainCard", type: "JsonSchema" },
|
|
143
|
+
credentialSubject: subject
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
const HUNDRED_YEARS_MS = 100 * 365 * 24 * 3600 * 1000;
|
|
147
|
+
/**
|
|
148
|
+
* The `MsgCreateEntity` body, minus the proto wrapping. Refuses the shapes
|
|
149
|
+
* the plan retired: a `dao` ask, an empty context, a cellnode service, a
|
|
150
|
+
* relayer that is not an entity DID.
|
|
151
|
+
*/
|
|
152
|
+
export function buildEntityMessage(input) {
|
|
153
|
+
if (!isEntityDid(input.relayerNode))
|
|
154
|
+
throw new Error(`relayerNode must be an entity DID, got ${JSON.stringify(input.relayerNode)}`);
|
|
155
|
+
if (input.services.some((service) => service.type === "Cellnode" || /#cellnode$/.test(service.id)))
|
|
156
|
+
throw new Error("no #cellnode service: documents live on Matrix media (rule of 2026-10-09)");
|
|
157
|
+
if (!input.services.some((service) => service.type === "MatrixHomeServer"))
|
|
158
|
+
throw new Error("every entity declares its Matrix homeserver as a MatrixHomeServer service");
|
|
159
|
+
if (!input.resources.some((item) => item.id === "{id}#pro"))
|
|
160
|
+
throw new Error("every entity carries a #pro profile — it is the only name Trace reads");
|
|
161
|
+
const ids = input.resources.map((item) => item.id);
|
|
162
|
+
const duplicate = ids.find((id, index) => ids.indexOf(id) !== index);
|
|
163
|
+
if (duplicate)
|
|
164
|
+
throw new Error(`linked resource ${duplicate} appears twice`);
|
|
165
|
+
return {
|
|
166
|
+
entityType: input.kind,
|
|
167
|
+
entityStatus: 0,
|
|
168
|
+
context: classContext(input.classDid),
|
|
169
|
+
verification: input.verification,
|
|
170
|
+
controller: [input.ownerDid],
|
|
171
|
+
ownerAddress: input.ownerAddress,
|
|
172
|
+
ownerDid: input.ownerDid,
|
|
173
|
+
relayerNode: input.relayerNode,
|
|
174
|
+
alsoKnownAs: (input.alsoKnownAs ?? "").slice(0, 140),
|
|
175
|
+
service: input.services,
|
|
176
|
+
linkedResource: input.resources,
|
|
177
|
+
linkedEntity: input.linkedEntities ?? [],
|
|
178
|
+
accordedRight: [],
|
|
179
|
+
linkedClaim: [],
|
|
180
|
+
startDate: input.startDate,
|
|
181
|
+
endDate: input.endDate ?? new Date(input.startDate.getTime() + HUNDRED_YEARS_MS)
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=entityShape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityShape.js","sourceRoot":"","sources":["../../../src/chain/entityShape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,iCAAiC,CAAC;AAEjE,qEAAqE;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AASzI,8GAA8G;AAC9G,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC9G,OAAO;QACL,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,eAAe,EAAE;QACpC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE;KAChC,CAAC;AACJ,CAAC;A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KAAK,CAAC,QAAQ,CAAC;QACrC,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,UAAU,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC5B,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,WAAW,EAAE,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;QACpD,OAAO,EAAE,KAAK,CAAC,QAAQ;QACvB,cAAc,EAAE,KAAK,CAAC,SAAS;QAC/B,YAAY,EAAE,KAAK,CAAC,cAAc,IAAI,EAAE;QACxC,aAAa,EAAE,EAAe;QAC9B,WAAW,EAAE,EAAe;QAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,gBAAgB,CAAC;KACjF,CAAC;AACJ,CAAC"}
|
package/dist/esm/chain/env.d.ts
CHANGED
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
import { type Network, network } from "../network.ts";
|
|
2
2
|
export { network };
|
|
3
|
+
/**
|
|
4
|
+
* The relayer nodes Openhands may name. Two, by decision (2026-10-13):
|
|
5
|
+
* Qi.Space is the launch relayer and the default; Yoma is the secondary. No
|
|
6
|
+
* other node is offered — the per-network "whatever the index happened to
|
|
7
|
+
* use" defaults that stood here before (Impacts DAO on testnet, and the WRONG
|
|
8
|
+
* Impacts DAO on mainnet, which every deployment had to override) are gone.
|
|
9
|
+
*
|
|
10
|
+
* Why it matters: a portal lists an entity only when its `relayerNode` is
|
|
11
|
+
* the portal's own DAO and `entityVerified` is true, and
|
|
12
|
+
* `MsgUpdateEntityVerified` must be signed by a key with `authentication` on
|
|
13
|
+
* that node's IID. So the relayer decides who can see an ask and who can
|
|
14
|
+
* verify it. The chain itself only checks that the DID has an IID document,
|
|
15
|
+
* which is why a wrong value was accepted silently for a year.
|
|
16
|
+
*/
|
|
17
|
+
export declare const RELAYER_NAMES: readonly ["qi-space", "yoma"];
|
|
18
|
+
export type RelayerName = (typeof RELAYER_NAMES)[number];
|
|
19
|
+
/** What `relayerChoice()` answers: a named node, or a DID the deployment set by hand. */
|
|
20
|
+
export type RelayerChoice = RelayerName | "custom";
|
|
3
21
|
/** The chain endpoints each network uses when nothing overrides them. The only copy of this table. */
|
|
4
22
|
export interface ChainEndpoints {
|
|
5
23
|
rpcUrl: string;
|
|
6
24
|
restUrl: string;
|
|
7
25
|
graphqlUrl: string;
|
|
8
|
-
relayerNodeDid: string;
|
|
9
26
|
faucetUrl: string | null;
|
|
27
|
+
/** The relayer nodes by name; `null` where that operator has no node on this network. */
|
|
28
|
+
relayers: Readonly<Record<RelayerName, string | null>>;
|
|
29
|
+
/** Which of `relayers` is used when neither `configure()` nor the environment chooses (not consulted on mainnet, see `relayerNode()`). */
|
|
30
|
+
defaultRelayer: RelayerName;
|
|
31
|
+
/** The default relayer's DID — what `relayerNode()` answers when nothing overrides it. */
|
|
32
|
+
relayerNodeDid: string;
|
|
33
|
+
/** The `protocol/deed` root an ask deed is classed under (chain-verified, 2026-10-09). */
|
|
34
|
+
deedClassDid: string;
|
|
35
|
+
/** The `protocol/verifiableClaim` class a claim protocol is classed under; `null` where unconfirmed (devnet). */
|
|
36
|
+
verifiableClaimClassDid: string | null;
|
|
37
|
+
/** The Matrix homeserver whose media repo holds every linked document (`#dmn`, `#pro`, `#done`, `#rub`, `#vct`). */
|
|
38
|
+
matrixHomeserver: string;
|
|
10
39
|
}
|
|
11
40
|
export declare const chainEndpointsFor: (net: Network) => Readonly<ChainEndpoints>;
|
|
41
|
+
/** The DID of a named relayer on a network, or `null` when that operator has no node there. */
|
|
42
|
+
export declare const relayerNodeFor: (net: Network, name: RelayerName) => string | null;
|
|
43
|
+
/** `true` for the two names this SDK offers; anything else (including `""`) is not a relayer name. */
|
|
44
|
+
export declare const isRelayerName: (value: unknown) => value is RelayerName;
|
|
12
45
|
/**
|
|
13
46
|
* Where we talk to the chain.
|
|
14
47
|
*
|
|
@@ -41,10 +74,44 @@ export declare const faucetUrl: () => string | null;
|
|
|
41
74
|
*/
|
|
42
75
|
export declare const graphqlUrl: () => string;
|
|
43
76
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
|
|
77
|
+
* Which relayer this deployment posts under: the configured name, else
|
|
78
|
+
* `"custom"` when a DID was set by hand, else the network's default
|
|
79
|
+
* (`qi-space` everywhere).
|
|
80
|
+
*/
|
|
81
|
+
export declare function relayerChoice(): RelayerChoice;
|
|
82
|
+
/**
|
|
83
|
+
* The relayer node every entity we mint names — or `null` when this
|
|
84
|
+
* deployment has not said which, on a network where it must.
|
|
85
|
+
*
|
|
86
|
+
* Order: `configure({ relayerNodeDid })` / `NEXT_PUBLIC_RELAYER_NODE_DID`
|
|
87
|
+
* (an explicit DID always wins; it is the deployment's own choice), then
|
|
88
|
+
* `configure({ relayer })` / `NEXT_PUBLIC_RELAYER` (a name from the table),
|
|
89
|
+
* then the network's default. **Mainnet has no default**: real entities on
|
|
90
|
+
* the wrong node are invisible to every portal and unverifiable by the keys
|
|
91
|
+
* we hold, so an unconfigured mainnet answers `null` here and `relayerNode()`
|
|
92
|
+
* throws before anything is signed. A named relayer without a node on this
|
|
93
|
+
* network is `null` too.
|
|
94
|
+
*/
|
|
95
|
+
export declare function relayerNodeIfConfigured(): string | null;
|
|
96
|
+
/**
|
|
97
|
+
* The relayer node to put on a `MsgCreateEntity`. Throws, naming the setting
|
|
98
|
+
* to fix, when `relayerNodeIfConfigured()` has no answer — the message is
|
|
99
|
+
* meant to be read by whoever deploys, before a single signature.
|
|
100
|
+
*/
|
|
101
|
+
export declare function relayerNode(): string;
|
|
102
|
+
/** The `protocol/deed` class a new ask deed is created under. `NEXT_PUBLIC_DEED_CLASS_DID` overrides the network's. */
|
|
103
|
+
export declare const deedClassDid: () => string;
|
|
104
|
+
/** The `protocol/verifiableClaim` class, or `null` where the network's is unconfirmed (devnet) and nothing overrides it. */
|
|
105
|
+
export declare const verifiableClaimClassDidIfConfigured: () => string | null;
|
|
106
|
+
/** The `protocol/verifiableClaim` class a new claim protocol is created under. Throws where the network's is unconfirmed and nothing overrides it. */
|
|
107
|
+
export declare function verifiableClaimClassDid(): string;
|
|
108
|
+
/**
|
|
109
|
+
* The Matrix homeserver whose media repo holds every linked document:
|
|
110
|
+
* `configure({ matrixHomeserver })`, then `NEXT_PUBLIC_MATRIX_HOMESERVER`, then
|
|
111
|
+
* the network's. No trailing slash. Never the Worker's `MATRIX_HOMESERVER`
|
|
112
|
+
* binding: a `MATRIX_*` read marks a module server-only, and this one is
|
|
113
|
+
* reachable from every public barrel (barrels.test.ts). A Worker that wants
|
|
114
|
+
* its binding honoured passes it through `configure()`.
|
|
48
115
|
*/
|
|
49
|
-
export declare const
|
|
116
|
+
export declare const matrixHomeserver: () => string;
|
|
50
117
|
//# sourceMappingURL=env.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/chain/env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOtD,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,sGAAsG;AACtG,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/chain/env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOtD,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB;;;;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eAAO,MAAM,SAAS,QAAO,MAAM,GAAG,IAGrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAO,MAGuG,CAAC;AAoBtI;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,aAAa,CAK7C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAQvD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAUpC;AAID,uHAAuH;AACvH,eAAO,MAAM,YAAY,QAAO,MAC8G,CAAC;AAE/I,4HAA4H;AAC5H,eAAO,MAAM,mCAAmC,QAAO,MAAM,GAAG,IACkG,CAAC;AAEnK,sJAAsJ;AACtJ,wBAAgB,uBAAuB,IAAI,MAAM,CAIhD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,QAAO,MAC2I,CAAC"}
|
package/dist/esm/chain/env.js
CHANGED
|
@@ -6,31 +6,78 @@ import { firstSet, hasEnv } from "../envRead.js";
|
|
|
6
6
|
below reads `configure()` first, then its own environment variable, then
|
|
7
7
|
this network's row of the table, at call time. */
|
|
8
8
|
export { network };
|
|
9
|
+
/**
|
|
10
|
+
* The relayer nodes Openhands may name. Two, by decision (2026-10-13):
|
|
11
|
+
* Qi.Space is the launch relayer and the default; Yoma is the secondary. No
|
|
12
|
+
* other node is offered — the per-network "whatever the index happened to
|
|
13
|
+
* use" defaults that stood here before (Impacts DAO on testnet, and the WRONG
|
|
14
|
+
* Impacts DAO on mainnet, which every deployment had to override) are gone.
|
|
15
|
+
*
|
|
16
|
+
* Why it matters: a portal lists an entity only when its `relayerNode` is
|
|
17
|
+
* the portal's own DAO and `entityVerified` is true, and
|
|
18
|
+
* `MsgUpdateEntityVerified` must be signed by a key with `authentication` on
|
|
19
|
+
* that node's IID. So the relayer decides who can see an ask and who can
|
|
20
|
+
* verify it. The chain itself only checks that the DID has an IID document,
|
|
21
|
+
* which is why a wrong value was accepted silently for a year.
|
|
22
|
+
*/
|
|
23
|
+
export const RELAYER_NAMES = ["qi-space", "yoma"];
|
|
24
|
+
/* Read off blocksync on 2026-10-09 and 2026-10-13 (all three networks): each
|
|
25
|
+
node's DID, type `dao`, its `entityVerified`, and the keys that hold
|
|
26
|
+
`authentication` on it. The testnet Qi.Space node was minted on 2026-10-13
|
|
27
|
+
for exactly this table. See IXO-ALIGNMENT-PLAN.md §2.1 (design-partners). */
|
|
28
|
+
const QI_SPACE = {
|
|
29
|
+
devnet: "did:ixo:entity:3d875e6db1f6a725579ff3c37a77dc1b",
|
|
30
|
+
testnet: "did:ixo:entity:5e59f98989c33e9b3d2a0c1d55991060",
|
|
31
|
+
mainnet: "did:ixo:entity:47d9c64891e77cb8e588d33b83ab3042"
|
|
32
|
+
};
|
|
33
|
+
const YOMA = {
|
|
34
|
+
devnet: "did:ixo:entity:50a7d92f449ab5752f63c64521adb3cc",
|
|
35
|
+
testnet: "did:ixo:entity:3700e507b54ba7092d3f1c4873af26ab",
|
|
36
|
+
mainnet: "did:ixo:entity:5884e9e2c624cb8a38bde74225215ee8"
|
|
37
|
+
};
|
|
9
38
|
const ENDPOINTS = {
|
|
10
39
|
devnet: {
|
|
11
40
|
rpcUrl: "https://devnet.ixo.earth/rpc/",
|
|
12
41
|
restUrl: "https://devnet.ixo.earth/rest",
|
|
13
42
|
graphqlUrl: "https://devnet-blocksync-graphql.ixo.earth/graphql",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
43
|
+
faucetUrl: "https://faucet.devnet.ixo.earth",
|
|
44
|
+
relayers: { "qi-space": QI_SPACE.devnet, yoma: YOMA.devnet },
|
|
45
|
+
defaultRelayer: "qi-space",
|
|
46
|
+
relayerNodeDid: QI_SPACE.devnet,
|
|
47
|
+
deedClassDid: "did:ixo:entity:ef2b04b2093d0e258c5e8fc8459805dc",
|
|
48
|
+
verifiableClaimClassDid: null,
|
|
49
|
+
matrixHomeserver: "https://devmx.ixo.earth"
|
|
17
50
|
},
|
|
18
51
|
testnet: {
|
|
19
52
|
rpcUrl: "https://testnet.ixo.earth/rpc/",
|
|
20
53
|
restUrl: "https://testnet.ixo.earth/rest",
|
|
21
54
|
graphqlUrl: "https://testnet-blocksync-graphql.ixo.earth/graphql",
|
|
22
|
-
|
|
23
|
-
|
|
55
|
+
faucetUrl: "https://faucet.testnet.ixo.earth",
|
|
56
|
+
relayers: { "qi-space": QI_SPACE.testnet, yoma: YOMA.testnet },
|
|
57
|
+
defaultRelayer: "qi-space",
|
|
58
|
+
relayerNodeDid: QI_SPACE.testnet,
|
|
59
|
+
deedClassDid: "did:ixo:entity:3f51fe4ea8670876b88c03712d503b43",
|
|
60
|
+
verifiableClaimClassDid: "did:ixo:entity:6112c527c614119115b78919e2673bcd",
|
|
61
|
+
matrixHomeserver: "https://testmx.ixo.earth"
|
|
24
62
|
},
|
|
25
63
|
mainnet: {
|
|
26
64
|
rpcUrl: "https://impacthub.ixo.world/rpc/",
|
|
27
65
|
restUrl: "https://impacthub.ixo.world/rest",
|
|
28
66
|
graphqlUrl: "https://blocksync-graphql.ixo.earth/graphql",
|
|
29
|
-
|
|
30
|
-
|
|
67
|
+
faucetUrl: null,
|
|
68
|
+
relayers: { "qi-space": QI_SPACE.mainnet, yoma: YOMA.mainnet },
|
|
69
|
+
defaultRelayer: "qi-space",
|
|
70
|
+
relayerNodeDid: QI_SPACE.mainnet,
|
|
71
|
+
deedClassDid: "did:ixo:entity:4a3d4a4597774b93b1a14d1e614f9e38",
|
|
72
|
+
verifiableClaimClassDid: "did:ixo:entity:004a597633a1012a6c785209ae0b627d",
|
|
73
|
+
matrixHomeserver: "https://mx.ixo.earth"
|
|
31
74
|
}
|
|
32
75
|
};
|
|
33
76
|
export const chainEndpointsFor = (net) => ENDPOINTS[net];
|
|
77
|
+
/** The DID of a named relayer on a network, or `null` when that operator has no node there. */
|
|
78
|
+
export const relayerNodeFor = (net, name) => ENDPOINTS[net].relayers[name];
|
|
79
|
+
/** `true` for the two names this SDK offers; anything else (including `""`) is not a relayer name. */
|
|
80
|
+
export const isRelayerName = (value) => typeof value === "string" && RELAYER_NAMES.includes(value);
|
|
34
81
|
/**
|
|
35
82
|
* Where we talk to the chain.
|
|
36
83
|
*
|
|
@@ -73,11 +120,98 @@ export const graphqlUrl = () =>
|
|
|
73
120
|
/* The data layer's `gql()` has no default and refuses to guess; the chain
|
|
74
121
|
layer always fell back to the network's own index. Both kept. */
|
|
75
122
|
(givenConfig().graphqlUrl ?? (hasEnv() ? process.env.NEXT_PUBLIC_GRAPHQL_URL : undefined) ?? "") || ENDPOINTS[network()].graphqlUrl;
|
|
123
|
+
/* ── the relayer ─────────────────────────────────────────────────────────── */
|
|
124
|
+
/** `configure({ relayerNodeDid })` or `NEXT_PUBLIC_RELAYER_NODE_DID`: a DID set by hand, else undefined. */
|
|
125
|
+
const explicitRelayerDid = () => givenConfig().relayerNodeDid ?? (hasEnv() ? firstSet(process.env.NEXT_PUBLIC_RELAYER_NODE_DID) : undefined);
|
|
126
|
+
/** `configure({ relayer })` or `NEXT_PUBLIC_RELAYER`: a relayer NAME chosen by the deployment, else undefined. Throws on a name this SDK does not offer. */
|
|
127
|
+
function explicitRelayerName() {
|
|
128
|
+
const given = givenConfig().relayer;
|
|
129
|
+
if (given !== undefined) {
|
|
130
|
+
if (!isRelayerName(given))
|
|
131
|
+
throw new Error(`configure({ relayer }) is ${JSON.stringify(given)}; it must be one of ${RELAYER_NAMES.join(", ")}`);
|
|
132
|
+
return given;
|
|
133
|
+
}
|
|
134
|
+
const raw = hasEnv() ? firstSet(process.env.NEXT_PUBLIC_RELAYER) : undefined;
|
|
135
|
+
if (raw === undefined)
|
|
136
|
+
return undefined;
|
|
137
|
+
if (!isRelayerName(raw))
|
|
138
|
+
throw new Error(`NEXT_PUBLIC_RELAYER is ${JSON.stringify(raw)}; it must be one of ${RELAYER_NAMES.join(", ")} (or unset for the network's default)`);
|
|
139
|
+
return raw;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Which relayer this deployment posts under: the configured name, else
|
|
143
|
+
* `"custom"` when a DID was set by hand, else the network's default
|
|
144
|
+
* (`qi-space` everywhere).
|
|
145
|
+
*/
|
|
146
|
+
export function relayerChoice() {
|
|
147
|
+
const name = explicitRelayerName();
|
|
148
|
+
if (name)
|
|
149
|
+
return name;
|
|
150
|
+
if (explicitRelayerDid())
|
|
151
|
+
return "custom";
|
|
152
|
+
return ENDPOINTS[network()].defaultRelayer;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The relayer node every entity we mint names — or `null` when this
|
|
156
|
+
* deployment has not said which, on a network where it must.
|
|
157
|
+
*
|
|
158
|
+
* Order: `configure({ relayerNodeDid })` / `NEXT_PUBLIC_RELAYER_NODE_DID`
|
|
159
|
+
* (an explicit DID always wins; it is the deployment's own choice), then
|
|
160
|
+
* `configure({ relayer })` / `NEXT_PUBLIC_RELAYER` (a name from the table),
|
|
161
|
+
* then the network's default. **Mainnet has no default**: real entities on
|
|
162
|
+
* the wrong node are invisible to every portal and unverifiable by the keys
|
|
163
|
+
* we hold, so an unconfigured mainnet answers `null` here and `relayerNode()`
|
|
164
|
+
* throws before anything is signed. A named relayer without a node on this
|
|
165
|
+
* network is `null` too.
|
|
166
|
+
*/
|
|
167
|
+
export function relayerNodeIfConfigured() {
|
|
168
|
+
const did = explicitRelayerDid();
|
|
169
|
+
if (did)
|
|
170
|
+
return did;
|
|
171
|
+
const name = explicitRelayerName();
|
|
172
|
+
const net = network();
|
|
173
|
+
if (name)
|
|
174
|
+
return ENDPOINTS[net].relayers[name];
|
|
175
|
+
if (net === "mainnet")
|
|
176
|
+
return null;
|
|
177
|
+
return ENDPOINTS[net].relayerNodeDid;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The relayer node to put on a `MsgCreateEntity`. Throws, naming the setting
|
|
181
|
+
* to fix, when `relayerNodeIfConfigured()` has no answer — the message is
|
|
182
|
+
* meant to be read by whoever deploys, before a single signature.
|
|
183
|
+
*/
|
|
184
|
+
export function relayerNode() {
|
|
185
|
+
const did = relayerNodeIfConfigured();
|
|
186
|
+
if (did)
|
|
187
|
+
return did;
|
|
188
|
+
const net = network();
|
|
189
|
+
const name = explicitRelayerName();
|
|
190
|
+
if (name) {
|
|
191
|
+
const other = RELAYER_NAMES.filter((candidate) => candidate !== name && ENDPOINTS[net].relayers[candidate]);
|
|
192
|
+
throw new Error(`${name} has no relayer node on ${net}; set NEXT_PUBLIC_RELAYER to ${other.join(" or ") || "a relayer with a node here"}, or NEXT_PUBLIC_RELAYER_NODE_DID to a DID, before posting`);
|
|
193
|
+
}
|
|
194
|
+
throw new Error("no relayer configured for mainnet: set NEXT_PUBLIC_RELAYER=qi-space (or yoma), or NEXT_PUBLIC_RELAYER_NODE_DID — there is no mainnet default on purpose");
|
|
195
|
+
}
|
|
196
|
+
/* ── the classes and the document store ──────────────────────────────────── */
|
|
197
|
+
/** The `protocol/deed` class a new ask deed is created under. `NEXT_PUBLIC_DEED_CLASS_DID` overrides the network's. */
|
|
198
|
+
export const deedClassDid = () => givenConfig().deedClassDid ?? (hasEnv() ? firstSet(process.env.NEXT_PUBLIC_DEED_CLASS_DID) : undefined) ?? ENDPOINTS[network()].deedClassDid;
|
|
199
|
+
/** The `protocol/verifiableClaim` class, or `null` where the network's is unconfirmed (devnet) and nothing overrides it. */
|
|
200
|
+
export const verifiableClaimClassDidIfConfigured = () => givenConfig().verifiableClaimClassDid ?? (hasEnv() ? firstSet(process.env.NEXT_PUBLIC_VC_CLASS_DID) : undefined) ?? ENDPOINTS[network()].verifiableClaimClassDid;
|
|
201
|
+
/** The `protocol/verifiableClaim` class a new claim protocol is created under. Throws where the network's is unconfirmed and nothing overrides it. */
|
|
202
|
+
export function verifiableClaimClassDid() {
|
|
203
|
+
const did = verifiableClaimClassDidIfConfigured();
|
|
204
|
+
if (!did)
|
|
205
|
+
throw new Error(`the protocol/verifiableClaim class on ${network()} is not confirmed; set NEXT_PUBLIC_VC_CLASS_DID`);
|
|
206
|
+
return did;
|
|
207
|
+
}
|
|
76
208
|
/**
|
|
77
|
-
* The
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
209
|
+
* The Matrix homeserver whose media repo holds every linked document:
|
|
210
|
+
* `configure({ matrixHomeserver })`, then `NEXT_PUBLIC_MATRIX_HOMESERVER`, then
|
|
211
|
+
* the network's. No trailing slash. Never the Worker's `MATRIX_HOMESERVER`
|
|
212
|
+
* binding: a `MATRIX_*` read marks a module server-only, and this one is
|
|
213
|
+
* reachable from every public barrel (barrels.test.ts). A Worker that wants
|
|
214
|
+
* its binding honoured passes it through `configure()`.
|
|
81
215
|
*/
|
|
82
|
-
export const
|
|
216
|
+
export const matrixHomeserver = () => (givenConfig().matrixHomeserver ?? (hasEnv() ? firstSet(process.env.NEXT_PUBLIC_MATRIX_HOMESERVER) : undefined) ?? ENDPOINTS[network()].matrixHomeserver).replace(/\/+$/, "");
|
|
83
217
|
//# sourceMappingURL=env.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../src/chain/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAgB,OAAO,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjD;;;oDAGoD;AACpD,OAAO,EAAE,OAAO,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../src/chain/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAgB,OAAO,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjD;;;oDAGoD;AACpD,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB;;;;;;;;;;;;;GAaG;AACH,MAAM,CA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BAAwB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,uBAAuB,CAAC;AAEnK,sJAAsJ;AACtJ,MAAM,UAAU,uBAAuB;IACrC,MAAM,GAAG,GAAG,mCAAmC,EAAE,CAAC;IAClD,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,OAAO,EAAE,iDAAiD,CAAC,CAAC;IAC/H,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAW,EAAE,CAC3C,CAAC,WAAW,EAAE,CAAC,gBAAgB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC"}
|
package/dist/esm/config.d.ts
CHANGED
|
@@ -27,11 +27,12 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { chainNetwork, type Network, NETWORKS } from "./network.ts";
|
|
29
29
|
import { strictBase } from "./envRead.ts";
|
|
30
|
+
import { RELAYER_NAMES, type RelayerChoice, type RelayerName } from "./chain/env.ts";
|
|
30
31
|
import { DEFAULT_IPFS_GATEWAY_URL } from "./data/docUrls.ts";
|
|
31
32
|
import { DEFAULT_RATES_URL } from "./data/rates.ts";
|
|
32
33
|
import { DEFAULT_ORACLE_RECEIPT_HOSTS, parseHosts } from "./data/accept.ts";
|
|
33
34
|
import { DEFAULT_CHECK_REWARD_BASE } from "./campaign/funding.ts";
|
|
34
|
-
export { chainNetwork, NETWORKS, type Network, strictBase, parseHosts, DEFAULT_IPFS_GATEWAY_URL, DEFAULT_RATES_URL, DEFAULT_ORACLE_RECEIPT_HOSTS, DEFAULT_CHECK_REWARD_BASE };
|
|
35
|
+
export { chainNetwork, NETWORKS, type Network, RELAYER_NAMES, type RelayerName, type RelayerChoice, strictBase, parseHosts, DEFAULT_IPFS_GATEWAY_URL, DEFAULT_RATES_URL, DEFAULT_ORACLE_RECEIPT_HOSTS, DEFAULT_CHECK_REWARD_BASE };
|
|
35
36
|
export type AskDenom = "uixo" | "upay";
|
|
36
37
|
export interface OpenhandsConfig {
|
|
37
38
|
/** `NEXT_PUBLIC_CHAIN_NETWORK`; unset/empty → testnet; any other value throws. */
|
|
@@ -67,8 +68,25 @@ export interface OpenhandsConfig {
|
|
|
67
68
|
granterAddress: string;
|
|
68
69
|
/** `NEXT_PUBLIC_GRANTER_BOT_URL` || "" — the guest funnel's gate. */
|
|
69
70
|
granterBotUrl: string;
|
|
70
|
-
/**
|
|
71
|
-
|
|
71
|
+
/**
|
|
72
|
+
* `NEXT_PUBLIC_RELAYER` (`qi-space` | `yoma`), else `"custom"` when
|
|
73
|
+
* `NEXT_PUBLIC_RELAYER_NODE_DID` names a node by hand, else the network's
|
|
74
|
+
* default (`qi-space`). A name this SDK does not offer throws.
|
|
75
|
+
*/
|
|
76
|
+
relayer: RelayerChoice;
|
|
77
|
+
/**
|
|
78
|
+
* `NEXT_PUBLIC_RELAYER_NODE_DID` (an explicit DID wins), else the node
|
|
79
|
+
* `relayer` names on this network, else the network's default. `null` on
|
|
80
|
+
* mainnet when nothing chose — there is no mainnet default on purpose, and
|
|
81
|
+
* `chain/env` `relayerNode()` throws instead of minting on the wrong node.
|
|
82
|
+
*/
|
|
83
|
+
relayerNodeDid: string | null;
|
|
84
|
+
/** `NEXT_PUBLIC_DEED_CLASS_DID` || per-network: the `protocol/deed` class an ask deed is created under. */
|
|
85
|
+
deedClassDid: string;
|
|
86
|
+
/** `NEXT_PUBLIC_VC_CLASS_DID` || per-network: the `protocol/verifiableClaim` class a claim protocol is created under; `null` where unconfirmed (devnet). */
|
|
87
|
+
verifiableClaimClassDid: string | null;
|
|
88
|
+
/** `NEXT_PUBLIC_MATRIX_HOMESERVER` || per-network; no trailing slash. Where every linked document is uploaded. A Worker's `MATRIX_HOMESERVER` binding is passed through `configure()`, never read here (barrels.test.ts). */
|
|
89
|
+
matrixHomeserver: string;
|
|
72
90
|
/** `NEXT_PUBLIC_AUTHN_RP_ID` || undefined (the browser's own hostname). */
|
|
73
91
|
authnRpId: string | undefined;
|
|
74
92
|
/** `NEXT_PUBLIC_ASK_DENOM` === "upay" ? "upay" : "uixo". */
|
|
@@ -98,7 +116,15 @@ export interface NetworkDefaults {
|
|
|
98
116
|
restUrl: string;
|
|
99
117
|
graphqlUrl: string;
|
|
100
118
|
vfsUrl: string;
|
|
119
|
+
/** The two relayer nodes on this network by name (`null` where an operator has none). */
|
|
120
|
+
relayers: Readonly<Record<RelayerName, string | null>>;
|
|
121
|
+
/** The name used when nothing chooses (not consulted on mainnet). */
|
|
122
|
+
defaultRelayer: RelayerName;
|
|
123
|
+
/** The default relayer's DID. */
|
|
101
124
|
relayerNodeDid: string;
|
|
125
|
+
deedClassDid: string;
|
|
126
|
+
verifiableClaimClassDid: string | null;
|
|
127
|
+
matrixHomeserver: string;
|
|
102
128
|
faucetUrl: string | null;
|
|
103
129
|
}
|
|
104
130
|
/** The endpoints a network uses when nothing overrides them. */
|
package/dist/esm/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,YAAY,EAAE,KAAK,OAAO,EAAW,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,YAAY,EAAE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AAC;IAC5B,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CAAC,eAAe,CAAC,CAEnE;AAKD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAQjE;AAED,qFAAqF;AACrF,wBAAgB,WAAW,IAAI,IAAI,CAGlC;AAED,iHAAiH;AACjH,wBAAgB,MAAM,IAAI,QAAQ,CAAC,eAAe,CAAC,CAqClD"}
|
package/dist/esm/config.js
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
import { givenConfig, givenVersion, setGivenConfig } from "./given.js";
|
|
29
29
|
import { chainNetwork, network, NETWORKS } from "./network.js";
|
|
30
30
|
import { strictBase } from "./envRead.js";
|
|
31
|
-
import { chainEndpointsFor, faucetUrl,
|
|
31
|
+
import { chainEndpointsFor, deedClassDid, faucetUrl, matrixHomeserver, relayerChoice, relayerNodeIfConfigured, RELAYER_NAMES, restUrl, rpcUrl, rpId, verifiableClaimClassDidIfConfigured } from "./chain/env.js";
|
|
32
32
|
import { askDenom } from "./chain/money.js";
|
|
33
33
|
import { granterBotUrl } from "./chain/guest.js";
|
|
34
34
|
import { oracleUrl } from "./chain/oracle.js";
|
|
@@ -44,7 +44,7 @@ import { campaignReadBudgetMs, campaignSince, campaignWalkTtlMs } from "./campai
|
|
|
44
44
|
import { checkRewardBase, DEFAULT_CHECK_REWARD_BASE } from "./campaign/funding.js";
|
|
45
45
|
import { checkerAiUpay, checkerBaseUpay, checkerPhotoUpay } from "./rubric/leg.js";
|
|
46
46
|
/* Re-exported so this module's long-standing names keep working. */
|
|
47
|
-
export { chainNetwork, NETWORKS, strictBase, parseHosts, DEFAULT_IPFS_GATEWAY_URL, DEFAULT_RATES_URL, DEFAULT_ORACLE_RECEIPT_HOSTS, DEFAULT_CHECK_REWARD_BASE };
|
|
47
|
+
export { chainNetwork, NETWORKS, RELAYER_NAMES, strictBase, parseHosts, DEFAULT_IPFS_GATEWAY_URL, DEFAULT_RATES_URL, DEFAULT_ORACLE_RECEIPT_HOSTS, DEFAULT_CHECK_REWARD_BASE };
|
|
48
48
|
/** The endpoints a network uses when nothing overrides them. */
|
|
49
49
|
export function defaultsFor(net) {
|
|
50
50
|
return { ...chainEndpointsFor(net), vfsUrl: vfsUrlFor(net) };
|
|
@@ -95,7 +95,11 @@ export function config() {
|
|
|
95
95
|
campaignFoldUrl: campaignFoldUrl(),
|
|
96
96
|
granterAddress: granterAddress(),
|
|
97
97
|
granterBotUrl: granterBotUrl(),
|
|
98
|
-
|
|
98
|
+
relayer: relayerChoice(),
|
|
99
|
+
relayerNodeDid: relayerNodeIfConfigured(),
|
|
100
|
+
deedClassDid: deedClassDid(),
|
|
101
|
+
verifiableClaimClassDid: verifiableClaimClassDidIfConfigured(),
|
|
102
|
+
matrixHomeserver: matrixHomeserver(),
|
|
99
103
|
authnRpId: rpId(),
|
|
100
104
|
askDenom: askDenom(),
|
|
101
105
|
basePath: basePath(),
|