@ixo/editor 5.26.0 → 5.27.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/dist/{chunk-5AC7MHLH.mjs → chunk-MP7Q5F3L.mjs} +1349 -844
- package/dist/{chunk-5AC7MHLH.mjs.map → chunk-MP7Q5F3L.mjs.map} +1 -1
- package/dist/{chunk-RIDIYR53.mjs → chunk-W5M4NLHK.mjs} +199 -1
- package/dist/chunk-W5M4NLHK.mjs.map +1 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/mantine/index.mjs +2 -2
- package/dist/{store-tdIRq7y0.d.ts → store-CiuZEEsv.d.ts} +104 -0
- package/package.json +1 -1
- package/dist/chunk-RIDIYR53.mjs.map +0 -1
|
@@ -260,6 +260,15 @@ function buildServicesFromHandlers(handlers) {
|
|
|
260
260
|
updateOracleDomain: handlers.updateOracleDomain || (async () => {
|
|
261
261
|
throw new Error("updateOracleDomain handler not configured");
|
|
262
262
|
})
|
|
263
|
+
} : void 0,
|
|
264
|
+
// Carbon credit batch service (IXO-2675). The consumer exposes a
|
|
265
|
+
// fully-formed `handlers.carbon` service group (loadBatches + harvest +
|
|
266
|
+
// retire); wire each method straight through. The harvest/retire calls are
|
|
267
|
+
// user-signed inside the consumer handler — we only forward here.
|
|
268
|
+
carbon: handlers?.carbon?.loadBatches && handlers?.carbon?.harvest && handlers?.carbon?.retire ? {
|
|
269
|
+
loadBatches: async (params) => handlers.carbon.loadBatches(params),
|
|
270
|
+
harvest: async (params) => handlers.carbon.harvest(params),
|
|
271
|
+
retire: async (params) => handlers.carbon.retire(params)
|
|
263
272
|
} : void 0
|
|
264
273
|
};
|
|
265
274
|
}
|
|
@@ -5236,6 +5245,134 @@ registerAction({
|
|
|
5236
5245
|
}
|
|
5237
5246
|
});
|
|
5238
5247
|
|
|
5248
|
+
// src/core/lib/actionRegistry/actions/carbon/schemas.ts
|
|
5249
|
+
var HARVESTABLE_ITEM_SCHEMA = [
|
|
5250
|
+
{ path: "id", displayName: "Batch ID", type: "string" },
|
|
5251
|
+
{ path: "entityDid", displayName: "Entity DID", type: "string" },
|
|
5252
|
+
{ path: "adminAddress", displayName: "Admin Address", type: "string" },
|
|
5253
|
+
{ path: "claimable", displayName: "Claimable", type: "number" },
|
|
5254
|
+
{ path: "alsoKnownAs", displayName: "Entity Name", type: "string" }
|
|
5255
|
+
];
|
|
5256
|
+
var RETIREABLE_ITEM_SCHEMA = [
|
|
5257
|
+
{ path: "id", displayName: "Batch ID", type: "string" },
|
|
5258
|
+
{ path: "amount", displayName: "Amount", type: "number" },
|
|
5259
|
+
{ path: "entityDid", displayName: "Entity DID", type: "string" },
|
|
5260
|
+
{ path: "alsoKnownAs", displayName: "Entity Name", type: "string" }
|
|
5261
|
+
];
|
|
5262
|
+
var CARBON_LOAD_OUTPUT = [
|
|
5263
|
+
{ path: "harvestableBatches", displayName: "Harvestable Batches", type: "array", itemSchema: HARVESTABLE_ITEM_SCHEMA, description: "Batches with claimable credits" },
|
|
5264
|
+
{ path: "retireableBatches", displayName: "Retireable Batches", type: "array", itemSchema: RETIREABLE_ITEM_SCHEMA, description: "Batches with credits available to retire" },
|
|
5265
|
+
{ path: "totalClaimable", displayName: "Total Claimable", type: "number", description: "Sum of all claimable credits" },
|
|
5266
|
+
{ path: "totalAvailable", displayName: "Total Available", type: "number", description: "Sum of all retireable credits" },
|
|
5267
|
+
{ path: "totalRetired", displayName: "Total Retired", type: "number", description: "Sum of all retired credits" }
|
|
5268
|
+
];
|
|
5269
|
+
var CARBON_HARVEST_OUTPUT = [
|
|
5270
|
+
{ path: "transactionHash", displayName: "Transaction Hash", type: "string", description: "The harvest transaction hash" },
|
|
5271
|
+
{
|
|
5272
|
+
path: "harvestedBatchIds",
|
|
5273
|
+
displayName: "Harvested Batch IDs",
|
|
5274
|
+
type: "array",
|
|
5275
|
+
itemSchema: [{ path: "", displayName: "Batch ID", type: "string" }],
|
|
5276
|
+
description: "Ids of the harvested batches"
|
|
5277
|
+
},
|
|
5278
|
+
{ path: "harvestedAmount", displayName: "Harvested Amount", type: "number", description: "Total credits harvested into the wallet" }
|
|
5279
|
+
];
|
|
5280
|
+
var CARBON_RETIRE_OUTPUT = [
|
|
5281
|
+
{ path: "transactionHash", displayName: "Transaction Hash", type: "string", description: "The retire transaction hash" },
|
|
5282
|
+
{
|
|
5283
|
+
path: "retiredBatchIds",
|
|
5284
|
+
displayName: "Retired Batch IDs",
|
|
5285
|
+
type: "array",
|
|
5286
|
+
itemSchema: [{ path: "", displayName: "Batch ID", type: "string" }],
|
|
5287
|
+
description: "Ids of the retired batches"
|
|
5288
|
+
},
|
|
5289
|
+
{ path: "retiredAmount", displayName: "Retired Amount", type: "number", description: "Total credits permanently retired" },
|
|
5290
|
+
{ path: "jurisdiction", displayName: "Jurisdiction", type: "string", description: "Jurisdiction recorded on the retirement" }
|
|
5291
|
+
];
|
|
5292
|
+
|
|
5293
|
+
// src/core/lib/actionRegistry/actions/carbon/loadBatches.ts
|
|
5294
|
+
registerAction({
|
|
5295
|
+
type: "qi/carbon.loadBatches",
|
|
5296
|
+
can: "carbon/load",
|
|
5297
|
+
sideEffect: false,
|
|
5298
|
+
defaultRequiresConfirmation: false,
|
|
5299
|
+
outputSchema: CARBON_LOAD_OUTPUT,
|
|
5300
|
+
run: async (inputs, ctx) => {
|
|
5301
|
+
if (!ctx.services.carbon?.loadBatches) {
|
|
5302
|
+
throw new Error("carbon.loadBatches handler not available");
|
|
5303
|
+
}
|
|
5304
|
+
if (!inputs.ownerAddress) throw new Error("ownerAddress is required");
|
|
5305
|
+
const result = await ctx.services.carbon.loadBatches({
|
|
5306
|
+
ownerAddress: inputs.ownerAddress
|
|
5307
|
+
});
|
|
5308
|
+
return { output: result };
|
|
5309
|
+
}
|
|
5310
|
+
});
|
|
5311
|
+
|
|
5312
|
+
// src/core/lib/actionRegistry/actions/carbon/harvest.ts
|
|
5313
|
+
registerAction({
|
|
5314
|
+
type: "qi/carbon.harvest",
|
|
5315
|
+
can: "carbon/harvest",
|
|
5316
|
+
sideEffect: true,
|
|
5317
|
+
defaultRequiresConfirmation: true,
|
|
5318
|
+
outputSchema: CARBON_HARVEST_OUTPUT,
|
|
5319
|
+
run: async (inputs, ctx) => {
|
|
5320
|
+
if (!ctx.services.carbon?.harvest) {
|
|
5321
|
+
throw new Error("carbon.harvest handler not available");
|
|
5322
|
+
}
|
|
5323
|
+
if (!inputs.ownerAddress) throw new Error("ownerAddress is required");
|
|
5324
|
+
const tokens = Array.isArray(inputs.tokens) ? inputs.tokens : [];
|
|
5325
|
+
if (tokens.length === 0) throw new Error("No batches selected to harvest");
|
|
5326
|
+
for (const t of tokens) {
|
|
5327
|
+
if (!t.id) throw new Error("Each harvest token requires an id");
|
|
5328
|
+
if (!t.entityDid) throw new Error(`Batch ${t.id} is missing entityDid (cannot construct harvest)`);
|
|
5329
|
+
if (!t.adminAddress) throw new Error(`Batch ${t.id} is missing adminAddress (cannot construct harvest)`);
|
|
5330
|
+
if (!(Number(t.claimable) > 0)) throw new Error(`Batch ${t.id} has no claimable amount`);
|
|
5331
|
+
}
|
|
5332
|
+
const result = await ctx.services.carbon.harvest({
|
|
5333
|
+
ownerAddress: inputs.ownerAddress,
|
|
5334
|
+
tokens: tokens.map((t) => ({ id: t.id, entityDid: t.entityDid, adminAddress: t.adminAddress, claimable: Number(t.claimable) }))
|
|
5335
|
+
});
|
|
5336
|
+
if (!result?.transactionHash) {
|
|
5337
|
+
throw new Error("carbon.harvest returned no transaction hash. Check the [carbon:harvest] handler logs.");
|
|
5338
|
+
}
|
|
5339
|
+
return { output: result };
|
|
5340
|
+
}
|
|
5341
|
+
});
|
|
5342
|
+
|
|
5343
|
+
// src/core/lib/actionRegistry/actions/carbon/retire.ts
|
|
5344
|
+
registerAction({
|
|
5345
|
+
type: "qi/carbon.retire",
|
|
5346
|
+
can: "carbon/retire",
|
|
5347
|
+
sideEffect: true,
|
|
5348
|
+
defaultRequiresConfirmation: true,
|
|
5349
|
+
outputSchema: CARBON_RETIRE_OUTPUT,
|
|
5350
|
+
run: async (inputs, ctx) => {
|
|
5351
|
+
if (!ctx.services.carbon?.retire) {
|
|
5352
|
+
throw new Error("carbon.retire handler not available");
|
|
5353
|
+
}
|
|
5354
|
+
if (!inputs.owner) throw new Error("owner is required");
|
|
5355
|
+
const tokens = Array.isArray(inputs.tokens) ? inputs.tokens : [];
|
|
5356
|
+
if (tokens.length === 0) throw new Error("No batches selected to retire");
|
|
5357
|
+
for (const t of tokens) {
|
|
5358
|
+
if (!t.id) throw new Error("Each retire token requires an id");
|
|
5359
|
+
if (!(Number(t.amount) > 0)) throw new Error(`Batch ${t.id} has no amount to retire`);
|
|
5360
|
+
}
|
|
5361
|
+
const reason = inputs.reason || "offset";
|
|
5362
|
+
const jurisdiction = inputs.jurisdiction || "Global";
|
|
5363
|
+
const result = await ctx.services.carbon.retire({
|
|
5364
|
+
owner: inputs.owner,
|
|
5365
|
+
reason,
|
|
5366
|
+
jurisdiction,
|
|
5367
|
+
tokens: tokens.map((t) => ({ id: t.id, amount: Number(t.amount) }))
|
|
5368
|
+
});
|
|
5369
|
+
if (!result?.transactionHash) {
|
|
5370
|
+
throw new Error("carbon.retire returned no transaction hash. Check the [carbon:retire] handler logs.");
|
|
5371
|
+
}
|
|
5372
|
+
return { output: { ...result, jurisdiction } };
|
|
5373
|
+
}
|
|
5374
|
+
});
|
|
5375
|
+
|
|
5239
5376
|
// src/core/lib/actionRegistry/actions/calendar/eventCreate.types.ts
|
|
5240
5377
|
var EMPTY = {
|
|
5241
5378
|
connection: null,
|
|
@@ -6909,6 +7046,67 @@ registerDiffResolver(COLLECTION_USERS_ACTION_TYPE, {
|
|
|
6909
7046
|
}
|
|
6910
7047
|
});
|
|
6911
7048
|
|
|
7049
|
+
// src/core/lib/actionRegistry/actions/carbon/harvest.diff.ts
|
|
7050
|
+
registerDiffResolver("qi/carbon.harvest", {
|
|
7051
|
+
resolver: async (inputs, _ctx) => {
|
|
7052
|
+
const selected = Array.isArray(inputs.selectedBatches) ? inputs.selectedBatches : [];
|
|
7053
|
+
if (selected.length === 0) return [];
|
|
7054
|
+
const rows = selected.map((b) => {
|
|
7055
|
+
const claimable = Number(b?.claimable) || 0;
|
|
7056
|
+
return {
|
|
7057
|
+
key: `batch-${b?.id}`,
|
|
7058
|
+
label: b?.alsoKnownAs || b?.id || "Batch",
|
|
7059
|
+
before: 0,
|
|
7060
|
+
after: claimable,
|
|
7061
|
+
changeType: "increase",
|
|
7062
|
+
unit: "CARBON"
|
|
7063
|
+
};
|
|
7064
|
+
});
|
|
7065
|
+
const total = selected.reduce((s, b) => s + (Number(b?.claimable) || 0), 0);
|
|
7066
|
+
rows.push({
|
|
7067
|
+
key: "total",
|
|
7068
|
+
label: "Total harvested to wallet",
|
|
7069
|
+
before: 0,
|
|
7070
|
+
after: total,
|
|
7071
|
+
changeType: "increase",
|
|
7072
|
+
unit: "CARBON",
|
|
7073
|
+
severity: "info"
|
|
7074
|
+
});
|
|
7075
|
+
return rows;
|
|
7076
|
+
}
|
|
7077
|
+
});
|
|
7078
|
+
|
|
7079
|
+
// src/core/lib/actionRegistry/actions/carbon/retire.diff.ts
|
|
7080
|
+
registerDiffResolver("qi/carbon.retire", {
|
|
7081
|
+
resolver: async (inputs, _ctx) => {
|
|
7082
|
+
const selected = Array.isArray(inputs.selectedBatches) ? inputs.selectedBatches : [];
|
|
7083
|
+
if (selected.length === 0) return [];
|
|
7084
|
+
const rows = selected.map((b) => {
|
|
7085
|
+
const amount = Number(b?.amount) || 0;
|
|
7086
|
+
return {
|
|
7087
|
+
key: `batch-${b?.id}`,
|
|
7088
|
+
label: b?.alsoKnownAs || b?.id || "Batch",
|
|
7089
|
+
before: amount,
|
|
7090
|
+
after: 0,
|
|
7091
|
+
changeType: "decrease",
|
|
7092
|
+
unit: "CARBON",
|
|
7093
|
+
severity: "warning"
|
|
7094
|
+
};
|
|
7095
|
+
});
|
|
7096
|
+
const total = selected.reduce((s, b) => s + (Number(b?.amount) || 0), 0);
|
|
7097
|
+
rows.push({
|
|
7098
|
+
key: "total",
|
|
7099
|
+
label: "Total retired (permanent, irreversible)",
|
|
7100
|
+
before: total,
|
|
7101
|
+
after: 0,
|
|
7102
|
+
changeType: "decrease",
|
|
7103
|
+
unit: "CARBON",
|
|
7104
|
+
severity: "critical"
|
|
7105
|
+
});
|
|
7106
|
+
return rows;
|
|
7107
|
+
}
|
|
7108
|
+
});
|
|
7109
|
+
|
|
6912
7110
|
// src/core/services/ucanService.ts
|
|
6913
7111
|
import {
|
|
6914
7112
|
createDelegation as ucanCreateDelegation,
|
|
@@ -11530,4 +11728,4 @@ export {
|
|
|
11530
11728
|
executeQueuedFlowAgentCoreCommands,
|
|
11531
11729
|
FlowAgentService
|
|
11532
11730
|
};
|
|
11533
|
-
//# sourceMappingURL=chunk-
|
|
11731
|
+
//# sourceMappingURL=chunk-W5M4NLHK.mjs.map
|