@hsuite/smart-engines-sdk 3.3.0 → 3.4.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/CHANGELOG.md +75 -0
- package/dist/index.d.ts +2635 -408
- package/dist/index.js +1605 -262
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.d.ts +2266 -106
- package/dist/nestjs/index.js +1053 -56
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.4.0 — 2026-05-31
|
|
4
|
+
|
|
5
|
+
**Production-readiness arc.** Closes the audit gap identified after 3.3.0 shipped: ~55 of ~110 third-party-facing server endpoints were wrapped; this release brings coverage to ~95/110 (the remaining ~15 are intentionally internal — operator / DKG ceremony / harbor admin). SDK test suite grew from 477 → 637 (+160 tests).
|
|
6
|
+
|
|
7
|
+
Shipped as 7 stacked PRs (#995, #997, #998, #999, #1000, #1002, #1003).
|
|
8
|
+
|
|
9
|
+
### Breaking changes
|
|
10
|
+
|
|
11
|
+
- **`baas.messaging.setPresence` / `getPresence` / `removePresence`** — signatures now take `channel` as the first argument. The previous appId-scoped paths returned 404 server-side, so behaviourally the breakage is `404 → works`.
|
|
12
|
+
- **`baas.storage.listFiles`** — pagination option renamed `skip` → `offset` to match the server query-string. The previous `skip` value was silently dropped.
|
|
13
|
+
- **`baas.storage.getFile`** — `@deprecated`, now forwards to `download`. The previous endpoint never resolved server-side.
|
|
14
|
+
- **Gateway response types realigned** — `HealthResponse`, `GatewayStatusResponse`, `GatewayReadinessResponse`, `GatewayMetricsResponse`, `HostInfo`, `RegisterHostRequest`, `VerificationMethod`, `DnsRecordType` all rewritten to match what `apps/smart-gateway` actually returns. Compile-time errors surface latent caller bugs; previous types were fabricated.
|
|
15
|
+
- **`baas.agents.fund` / `trade` / `withdraw`** — return type changed from `{ success; txId? }` to `PreparedTransactionResponse` envelope (sovereignty flow). Callers can now reach the prepared transaction bytes; previously unreachable through the declared type.
|
|
16
|
+
- **`tss.signMPC`** — `chain` parameter restricted to literal `'hedera'`. Other chains were never wired server-side and silently 404'd.
|
|
17
|
+
- **`Rules.module.agent`** — removed. Server retired `AgentOrganism` in Arc 6 Phase 6.5; SDK module factory was silently no-op'ing on the cluster.
|
|
18
|
+
|
|
19
|
+
### Fixed — BaaS endpoint paths that 404'd in production (PR #995)
|
|
20
|
+
|
|
21
|
+
`apps/smart-host` requires `:appId` in every BaaS path; the SDK omitted it on 9 methods plus used the wrong verb on one:
|
|
22
|
+
|
|
23
|
+
- `storage.download` / `getMetadata` / `exists` / `getUsage` — all now correctly prefixed with `:appId`.
|
|
24
|
+
- `functions.invoke` / `get` / `update` / `delete` / `getLogs` / `list` — same fix.
|
|
25
|
+
- `messaging.setPresence` / `getPresence` / `removePresence` — channel-scoped per server.
|
|
26
|
+
- `agents.updateRules` — verb corrected `PUT` → `PATCH`.
|
|
27
|
+
- `db.listCollections` — path corrected to `/collections`.
|
|
28
|
+
- `db.createCollection` / `dropCollection` — new wrappers for endpoints that lacked SDK methods.
|
|
29
|
+
|
|
30
|
+
Regression spec `libs/smartengine-sdk/src/baas/endpoint-paths.spec.ts` pins every fixed URL + verb.
|
|
31
|
+
|
|
32
|
+
Plumbing: `HttpClient` gained a `patch` method (previously missing) to unblock all PATCH-based endpoints across the SDK.
|
|
33
|
+
|
|
34
|
+
### Added — `client.dao` (PR #998)
|
|
35
|
+
|
|
36
|
+
Full typed wrapper over the ~30 endpoints registered by `apps/smart-validator/src/dao/dao.controller.ts`. The largest single missing surface from the audit.
|
|
37
|
+
|
|
38
|
+
- **Lifecycle** — `create`, `list`, `get`, `getWithProposals`.
|
|
39
|
+
- **Proposals** — `listProposals`, `createProposal`, `prepareProposal`, `signProposal`, `prepareVote`, `submitVote`, `vote`, `execute`, plus `getVotes` / `getResults` / `getVoteCounts` / `getVoterRecord`.
|
|
40
|
+
- **Treasury** — `getTreasury`, `getTreasuryHistory`.
|
|
41
|
+
- **Members** — `listMembers`, `addMember`, `removeMember`, `claimMemberNft`, `getMemberNft`.
|
|
42
|
+
- **`client.dao.dashboard`** — per-user rollups (`getStats`, `getActiveProposals`, `getVoteHistory`, `getActivity`, `getPendingActions`, `getImpact`).
|
|
43
|
+
|
|
44
|
+
### Added — Hedera TSS + Async TSS + NFT prepare paths (PR #999)
|
|
45
|
+
|
|
46
|
+
- **`client.hedera.tss`** — six TSS-signed immediate-execute endpoints (cluster signs + submits in one round-trip): `createAccount`, `updateMemo`, `createTopic`, `submitMessage`, `createToken`, `mintToken`.
|
|
47
|
+
- **`client.tss`** — async workflow: `createEntityAsync`, `reshareClusterAsync`, `getJob(jobId)`, `signForApp(appId, ...)`.
|
|
48
|
+
- **`client.transactions`** — four NFT prepare paths for Polkadot pallet-nfts + Solana Metaplex: `prepareNftCollectionCreate`, `prepareNftSetMetadata`, `prepareNftCollectionSetMetadata`, `prepareNftCollectionLock`.
|
|
49
|
+
- **`client.xrpl`** — `prepareAccountSetup` (two-step `SignerListSet` + `DisableMaster` for XRPL sovereignty).
|
|
50
|
+
|
|
51
|
+
### Added — Six new sub-clients (PR #1000)
|
|
52
|
+
|
|
53
|
+
- **`client.bridge`** — 8 cross-chain bridge endpoints (`create`, `list`, `get`, `port`, `return`, `getStatus`, `getSupply`, `listClaims`).
|
|
54
|
+
- **`client.resources`** — quota / consumption / nodes: 8 endpoints (`getSummary`, `getConsumption`, `getHistory`, `getLedger`, `getStatus`, `getBreakdown`, `listNodes`, `getNode`).
|
|
55
|
+
- **`client.envelope`** — `encrypt` / `decrypt` (third-party crypto utility).
|
|
56
|
+
- **`client.tokens`** — token-migration: `migrate`, `listMigrations`, `getMigration`, `getMigrationsForToken`, `getDetails`. The last collides with `client.getTokenInfo` at Nest route registration; documented as a known limitation.
|
|
57
|
+
- **`client.operator`** — read-only operator-funding: `getBalance`, `getTopup`.
|
|
58
|
+
- **`client.subscription`** — extended with `downgrade`, `upgrade`, `cancelTierChange`, `getActiveFor`, `getUsage`, `getUsageStatus`, `getBilling`, `mintCustomer`.
|
|
59
|
+
|
|
60
|
+
### Added — Rules-engine parity (PR #1002)
|
|
61
|
+
|
|
62
|
+
- **8 canonical server-mirror templates** field-for-field with `libs/validator-rules-builder/src/templates`: `Rules.template.utilityToken`, `daoGovernedToken`, `soulboundNft`, `subscriptionNft`, `membershipNft`, `managedAccount`, `systemTopic`, `appTopic`. Sits alongside the existing higher-altitude composers (`fairLaunch`, `tradingAgent`, etc.) so devs pick altitude.
|
|
63
|
+
- **12 fluent builder methods** on `BaseRuleBuilder`: `withLimits`, `withRateLimiter`, `withSnapshot`, `withCooldown`, `withApprovalThreshold` (canonical atoms now first-class on token/account/topic); molecule shortcuts `withSwap`, `withAirdrop`, `withVesting`, `withStreaming`, `withGovernanceModule`; plus Phase-6.6 AI atoms `withMaxTradesPerWindow` and `withRequireStructuredOutput` on `AgentRulesBuilder`.
|
|
64
|
+
- **`baas.rules.simulate(req)`** confirmed present and tested against `POST /api/rules/simulate`.
|
|
65
|
+
|
|
66
|
+
**Server-side follow-up required**: the 12 new molecule module types (`swap`, `airdrop`, `vesting`, `streaming`, `governance`, `max-trades-per-window`, `require-structured-output`, etc.) will **fail-closed** at the cluster until `libs/rules-engine/src/modules/builtin-modules.ts` registers them. Today only `launchpad / dex / dao / staking-pool` are registered.
|
|
67
|
+
|
|
68
|
+
### Added — Discovery extras + Deployment KEK / webhook / metrics (PR #1003)
|
|
69
|
+
|
|
70
|
+
- **`client.discovery`** — `listAllClusters` (full set, not just active), `getClusterByNode(nodeId)`, plus `client.discovery.platformImages` sub-namespace: `list`, `listEnvelopes`, `get`, `getVersion`, `verify`.
|
|
71
|
+
- **`baas.deployment`** — `setWebhook(appId, url)` (returns per-tenant HMAC secret), `getMetrics(appId)` (Prometheus text/plain — `HttpClient.getText` plumbing added to bypass JSON.parse), `rotateKek(appId)`, `revokeKek(appId, version)` (ADR-011 Phase 6 KEK rotation surface).
|
|
72
|
+
|
|
73
|
+
### Verified
|
|
74
|
+
|
|
75
|
+
- `yarn jest`: 637 passing + 1 skipped = 638 total (was 477 in 3.3.0).
|
|
76
|
+
- `yarn build:tsc`: clean (`tsc --skipLibCheck --declaration`).
|
|
77
|
+
|
|
3
78
|
## 3.3.0 — 2026-05-29
|
|
4
79
|
|
|
5
80
|
**Smart-App Rules SDK arc.** Adds a complete canonical-rule authoring surface
|