@t2000/sdk 5.18.0 → 5.19.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/index.cjs CHANGED
@@ -2034,6 +2034,23 @@ async function listModels(opts) {
2034
2034
  }));
2035
2035
  }
2036
2036
  var RECEIPT_ANCHORED_SUFFIX = "::anchor::ReceiptAnchored";
2037
+ function normalizeClaims(claims) {
2038
+ if (!claims) {
2039
+ return [];
2040
+ }
2041
+ if (Array.isArray(claims)) {
2042
+ return claims.filter((c) => c.name).map((c) => ({
2043
+ name: c.name,
2044
+ status: c.status ?? "unknown",
2045
+ source: c.source
2046
+ }));
2047
+ }
2048
+ return Object.entries(claims).map(([name, v]) => ({
2049
+ name,
2050
+ status: v?.status ?? "unknown",
2051
+ source: v?.source
2052
+ }));
2053
+ }
2037
2054
  function fullnodeUrl(network) {
2038
2055
  return network === "testnet" ? "https://fullnode.testnet.sui.io" : "https://fullnode.mainnet.sui.io";
2039
2056
  }
@@ -2127,6 +2144,7 @@ async function verifyReceipt(receiptId, opts = {}) {
2127
2144
  });
2128
2145
  const upstreamEv = receipt.event_log.find((e) => e.type === "upstream.verified");
2129
2146
  const upstreamOk = upstreamEv?.result === "verified";
2147
+ const claims = normalizeClaims(upstreamEv?.claims);
2130
2148
  checks.push({
2131
2149
  name: "Confidential upstream",
2132
2150
  status: upstreamEv ? upstreamOk ? "pass" : "fail" : "skip",
@@ -2228,8 +2246,11 @@ async function verifyReceipt(receiptId, opts = {}) {
2228
2246
  workloadId,
2229
2247
  upstream: upstreamEv ? {
2230
2248
  provider: upstreamEv.provider ?? upstreamEv.upstream_name,
2249
+ modelId: upstreamEv.model_id,
2231
2250
  result: upstreamEv.result,
2232
- tcbStatus: upstreamEv.tcb_status
2251
+ tcbStatus: upstreamEv.tcb_status,
2252
+ sessionId: upstreamEv.session_id,
2253
+ claims: claims.length > 0 ? claims : void 0
2233
2254
  } : void 0,
2234
2255
  anchor
2235
2256
  };