@hsuite/smart-engines-sdk 3.4.1 → 3.5.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 +59 -0
- package/README.md +124 -27
- package/dist/index.d.ts +67 -53
- package/dist/index.js +454 -457
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.d.ts +4 -43
- package/dist/nestjs/index.js +438 -442
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.5.0 — 2026-06-01
|
|
4
|
+
|
|
5
|
+
**100% prod-ready arc.** Final cleanup pass after the 3.4.x publication. Closes every finding from two rounds of adversarial verification: legacy/dead-API code removed, BaaS dual-transport collapsed onto the shared HttpClient, path-traversal exposure closed via `encodePathParam` repo-wide, typed signer surfaces narrowed off `any`, test coverage taken from 62% → 90% statements / 49% → 81% branches / 64% → 85% functions / 63% → 91% lines, README + compodoc shipped, and one phantom test spec (615 lines that never imported the class it claimed to test) replaced with 43 real tests.
|
|
6
|
+
|
|
7
|
+
Shipped as 4 parallel PRs (#1032 docs/compodoc, #1033 legacy cleanup, #1034 arch+security, #1036 test coverage).
|
|
8
|
+
|
|
9
|
+
### Breaking changes (typed-surface only; runtime preserved)
|
|
10
|
+
|
|
11
|
+
- **`BaasClientConfig.http` removed.** Field was typed as `ResilientHttpConfig` and accepted "for backward compatibility / future resilience layer integration" but was never wired at runtime — public users passing it got silently ignored. Removing the inert type closes the discrepancy. Callers passing `new BaasClient({ http: {} })` now get a TS2353 excess-property error; runtime behaviour unchanged. (#1033)
|
|
12
|
+
- **`SmartEngineClientConfig.http` removed.** Same pattern as above. (#1033)
|
|
13
|
+
- **`TokensClient.getDetails(chain, tokenId)` deleted.** Method was shadowed at the Nest route layer (`ValidatorController` won registration order vs `TokenMigrationController`) and never reached its declared handler. JSDoc itself said "prefer `client.getTokenInfo(...)` instead". Shipping a public method for a 404-shadowed endpoint = dead-on-arrival. (#1033)
|
|
14
|
+
- **`HederaTransactionsClient` constructor now requires `tssHttp`.** The previous `tssHttp ?? http` fallback was dead in this repo (single call site always passed both args). External callers passing one arg now get "Expected 2 arguments, but got 1". (#1033)
|
|
15
|
+
- **`signChallengeXRPL(wallet: XrplSigner)` narrowed**, was `wallet: any`. `XrplSigner.sign(message: string): string | { signedTransaction: string }`. Callers passing a hand-rolled `{ sign: () => Uint8Array }` no longer compile — the runtime never handled Uint8Array. (#1034)
|
|
16
|
+
- **`signChallengeHedera(privateKey: HederaSigner)` narrowed**, was `privateKey: any`. Structural type matches `@hashgraph/sdk`'s PrivateKey shape without importing the peer dep. (#1034)
|
|
17
|
+
|
|
18
|
+
### Security
|
|
19
|
+
|
|
20
|
+
- **Path-traversal exposure closed**: replaced raw `encodeURIComponent` with the `%2F`-stripping `encodePathParam` helper across ~135 sites (collection IDs, document IDs, agent IDs, function IDs, DAO IDs, etc.). Regression test in `__tests__/path-traversal.spec.ts` feeds `'../../../etc/passwd'` style inputs and asserts the resulting URL stays sandboxed. (#1034)
|
|
21
|
+
|
|
22
|
+
### Refactor
|
|
23
|
+
|
|
24
|
+
- **`BaasClient` dual transport collapsed.** Top-level `BaasClient.<method>` calls (e.g., `authenticate`) used a private fetch-based `request/get/post` infra; sub-clients used the shared `HttpClient`. Now everything goes through the shared client. Auth token state moved from `this.authToken` onto `HttpClient` via the new typed `setAuthToken/getAuthToken` accessors. Every `(this.http as any).authToken` peek across the SDK removed. (#1034)
|
|
25
|
+
- **`connectToCluster` bootstrap-resolution DRY'd.** ~25 lines of identical scaffolding between `SmartEngineClient.connectToCluster` and `BaasClient.connectToCluster` extracted to `discovery/resolve-cluster.ts`'s `resolveClusterEndpoint`. (#1034)
|
|
26
|
+
- `StorageClient.getFile` `@deprecated` JSDoc now pins removal to **4.0.0**. Forwards to `download(cid)` until then. (#1033)
|
|
27
|
+
- `SupportedChain` alias inlined to direct `ChainType` use. (#1033)
|
|
28
|
+
- `ValidatorDiscoveryClient` JSDoc no longer calls itself "legacy" — it's the intentional HCS-direct discovery fallback. (#1033)
|
|
29
|
+
|
|
30
|
+
### Tests
|
|
31
|
+
|
|
32
|
+
- **Phantom `validator-auth.spec.ts` replaced**: the original 615 lines tested `new URL(...)` against the stdlib and never imported `ValidatorAuthClient`. Production was at 2.97% line coverage. Replaced with 43 real tests covering every public method + `ValidatorAuthError` + every failure path. (#1036)
|
|
33
|
+
- Added specs for `chains/{hedera,polkadot,solana,xrpl}.ts` (0% → 100%), `discovery/{mirror-node,validator-discovery}` (11-18% → 95%+), `nestjs/smart-engine.service` (30% → 100%), `_vendor/{retry,rate-limiter,errors-and-breaker,network-types}` (9-55% → 100%), gateway sub-clients, residual `client.ts` token/cluster/monitoring branches. (#1036)
|
|
34
|
+
- `jest.config.js` `**/index.ts` blanket exclusion replaced with a narrow allowlist of true barrel files — sub-client implementations in `index.ts` now count toward coverage. (#1036)
|
|
35
|
+
|
|
36
|
+
**Coverage gate (CLAUDE.md ≥80% bar):**
|
|
37
|
+
|
|
38
|
+
| Axis | 3.4.1 | 3.5.0 |
|
|
39
|
+
|------|-------|-------|
|
|
40
|
+
| Statements | 62.17% | **89.95%** |
|
|
41
|
+
| Branches | 49.51% | **81.33%** |
|
|
42
|
+
| Functions | 64.12% | **85.10%** |
|
|
43
|
+
| Lines | 62.63% | **91.39%** |
|
|
44
|
+
|
|
45
|
+
Test count: 637 → **1037** (+400).
|
|
46
|
+
|
|
47
|
+
### Docs
|
|
48
|
+
|
|
49
|
+
- **README rewritten** for the 3.4.x+ surface: leads with `BaasClient.connectToCluster({ network: 'testnet' })` as the canonical entrypoint, sub-clients table enumerates every public field on `SmartEngineClient` + `BaasClient`, bundle section refreshed off the actual 3.5.0 figures. Stale 3.0.0 / 3.2.0 references gone. (#1032)
|
|
50
|
+
- **Compodoc wired**: `yarn workspace @hsuite/smart-engines-sdk docs` now generates `dist/docs/` against the repo-root `.compodocrc.json`. (#1032)
|
|
51
|
+
- **Stale `hsuite-smart-engines-sdk-3.2.0.tgz` deleted** from the package source. (#1032)
|
|
52
|
+
- Package-level `@example` in `src/index.ts` rewritten to lead with `connectToCluster`. (#1032)
|
|
53
|
+
- `@example` blocks added to `BridgeClient` / `EnvelopeClient` / `OperatorClient` / `ResourcesClient` / `HederaTssClient` / `DiscoveryClient`. (#1032)
|
|
54
|
+
|
|
55
|
+
### Verified
|
|
56
|
+
|
|
57
|
+
- `yarn jest`: 67 suites, 1037 passing + 1 skipped = 1038 total, 0 failures.
|
|
58
|
+
- `yarn build:tsc`: clean.
|
|
59
|
+
- `yarn build`: all 6 subpath dist artifacts produced cleanly.
|
|
60
|
+
- `yarn workspace @hsuite/smart-engines-sdk docs`: compodoc generates `dist/docs/` cleanly.
|
|
61
|
+
|
|
3
62
|
## 3.4.1 — 2026-06-01
|
|
4
63
|
|
|
5
64
|
**Patch release** restoring 3 subpath exports that the 3.4.0 publish dropped despite being present in source:
|
package/README.md
CHANGED
|
@@ -21,9 +21,14 @@ npm install zod # peer (likely transitive in your app already)
|
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
-
## Quick start —
|
|
24
|
+
## Quick start — `connectToCluster`
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
`connectToCluster` is the canonical entrypoint: it auto-discovers an active
|
|
27
|
+
cluster via the service registry, picks one at random, runs Web3 auth, and
|
|
28
|
+
hands back a wired client. Zero hand-rolled URLs, zero validator pinning,
|
|
29
|
+
permissionless cluster join/leave is invisible to the SDK caller.
|
|
30
|
+
|
|
31
|
+
### BaaS (smart-app primary path)
|
|
27
32
|
|
|
28
33
|
```ts
|
|
29
34
|
import { BaasClient } from '@hsuite/smart-engines-sdk';
|
|
@@ -33,15 +38,12 @@ import { sign as xrplSign } from 'ripple-keypairs';
|
|
|
33
38
|
// 1. Your XRPL wallet (real production: load XRPL_SEED from env / secret store)
|
|
34
39
|
const wallet = Wallet.fromSeed(process.env.XRPL_SEED!);
|
|
35
40
|
|
|
36
|
-
// 2.
|
|
37
|
-
const baas =
|
|
38
|
-
|
|
39
|
-
appId: 'pending', // will be replaced after register()
|
|
40
|
-
pathPrefix: '/host', // gateway routes /host/* → smart-host
|
|
41
|
+
// 2. Connect to the network (zero-config — testnet | mainnet)
|
|
42
|
+
const baas = await BaasClient.connectToCluster({
|
|
43
|
+
network: 'testnet',
|
|
41
44
|
});
|
|
42
45
|
|
|
43
|
-
// 3.
|
|
44
|
-
// Cluster verifies with ripple-keypairs.verify(messageHex.toUpperCase(), signature, publicKey)
|
|
46
|
+
// 3. Web3 auth (challenge-response over the discovered cluster's gateway)
|
|
45
47
|
await baas.authenticate({
|
|
46
48
|
chain: 'xrpl',
|
|
47
49
|
walletAddress: wallet.address,
|
|
@@ -72,6 +74,24 @@ baas.setAppId(init.appId);
|
|
|
72
74
|
// (deploy) await baas.deployment.deploy(init.appId, { tag: 'v1', replicas: 1 });
|
|
73
75
|
```
|
|
74
76
|
|
|
77
|
+
### SmartEngineClient (direct chain operations)
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { SmartEngineClient } from '@hsuite/smart-engines-sdk';
|
|
81
|
+
|
|
82
|
+
const { client, cluster, session } = await SmartEngineClient.connectToCluster({
|
|
83
|
+
network: 'testnet', // resolves canonical gateway entrypoint
|
|
84
|
+
chain: 'xrpl',
|
|
85
|
+
address: wallet.address,
|
|
86
|
+
publicKey: wallet.publicKey,
|
|
87
|
+
signFn: (challenge) => /* sign the challenge */ '',
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// All sub-clients are wired against the discovered cluster
|
|
91
|
+
await client.tss.signMPC({ chain: 'hedera', entityId: '...', transactionBytes: '0x...' });
|
|
92
|
+
await client.ipfs.upload(file, 'document.pdf');
|
|
93
|
+
```
|
|
94
|
+
|
|
75
95
|
**Why XRPL?** Per the Smart Engines V3 architecture, XRPL is canonical for
|
|
76
96
|
smart-app authentication and registration. The cluster's validator/host pods
|
|
77
97
|
pay their own HCS fees from pod-local operator accounts; smart-apps never
|
|
@@ -81,22 +101,90 @@ from the dev wallet used to authenticate.
|
|
|
81
101
|
|
|
82
102
|
**Faster bootstrap?** Use the [`@hsuite/smart-engines-cli`](https://www.npmjs.com/package/@hsuite/smart-engines-cli) — `hsuite init` generates a fresh XRPL wallet + funds it via the testnet faucet + writes `.env.local`, then `hsuite subscribe` registers the smart-app in one command.
|
|
83
103
|
|
|
104
|
+
### Manual override — pin a host directly
|
|
105
|
+
|
|
106
|
+
If you need to point the SDK at a specific gateway / host (private deployment,
|
|
107
|
+
local k3d cluster, conformance harness), bypass discovery and pass a URL:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { BaasClient, SmartEngineClient } from '@hsuite/smart-engines-sdk';
|
|
111
|
+
|
|
112
|
+
const baas = new BaasClient({
|
|
113
|
+
hostUrl: 'https://v3-testnet-gateway.hsuite.network',
|
|
114
|
+
appId: 'pending',
|
|
115
|
+
pathPrefix: '/host', // gateway routes /host/* → smart-host
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const client = new SmartEngineClient({
|
|
119
|
+
baseUrl: 'https://v3-testnet-gateway.hsuite.network',
|
|
120
|
+
authToken: '<jwt-from-validator-auth-verify>',
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
You can also pass `bootstrap: string[]` to `connectToCluster` for explicit
|
|
125
|
+
seed lists (private deployments).
|
|
126
|
+
|
|
84
127
|
---
|
|
85
128
|
|
|
86
129
|
## Available clients
|
|
87
130
|
|
|
131
|
+
The root `SmartEngineClient` exposes every sub-client below — each maps 1:1
|
|
132
|
+
to a server-side controller. `BaasClient` mirrors the host/BaaS surface.
|
|
133
|
+
|
|
134
|
+
### Top-level clients
|
|
135
|
+
|
|
88
136
|
| Client | Purpose |
|
|
89
137
|
|---|---|
|
|
90
|
-
| `BaasClient` | Authentication + database + storage + functions + messaging + deployment + agents |
|
|
91
|
-
| `
|
|
92
|
-
| `baas.entities.*` | Create canonical token / account / topic / agent entities (plus launchpad mega-helper), each bound to a published `ruleRef` |
|
|
93
|
-
| `SmartEngineClient` | Chain operations: account create, token create / mint / burn / freeze / wipe, transfers, HCS topics, TSS, IPFS |
|
|
138
|
+
| `BaasClient` | Authentication + database + storage + functions + messaging + deployment + agents + rules + entities |
|
|
139
|
+
| `SmartEngineClient` | Chain operations + every typed sub-client below |
|
|
94
140
|
| `SmartGatewayClient` | Gateway operations: routing, domains, DNS |
|
|
95
141
|
| `ValidatorAuthClient` | Standalone Web3 challenge-response auth (lower-level than `BaasClient.authenticate`) |
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
142
|
+
| `ClusterDiscoveryClient` | Bootstrap-seed → active-cluster discovery (powers `connectToCluster`) |
|
|
143
|
+
| `ValidatorDiscoveryClient` | HCS-registry-based validator discovery (legacy `connectToNetwork` path) |
|
|
98
144
|
| `MirrorNodeClient` | Hedera mirror-node helper (when your app does Hedera-side queries) |
|
|
99
145
|
|
|
146
|
+
### `client.*` sub-clients on `SmartEngineClient`
|
|
147
|
+
|
|
148
|
+
| Field | Purpose |
|
|
149
|
+
|---|---|
|
|
150
|
+
| `client.subscription` | Application subscription management |
|
|
151
|
+
| `client.tss` | Threshold Signature Scheme — chain-agnostic MPC operations |
|
|
152
|
+
| `client.ipfs` | IPFS decentralized file storage |
|
|
153
|
+
| `client.transactions` | Chain-agnostic prepare-sign-submit (transaction sovereignty) |
|
|
154
|
+
| `client.hedera` | Hedera-specific transaction preparation (HCS topics, KYC, wipe) |
|
|
155
|
+
| `client.hedera.tss` | Hedera TSS immediate-execute (cluster signs + submits in one call) |
|
|
156
|
+
| `client.xrpl` | XRPL-specific transaction preparation (trust lines) |
|
|
157
|
+
| `client.solana` | Solana-specific transaction preparation (close-account) |
|
|
158
|
+
| `client.polkadot` | Polkadot-specific transaction preparation (asset setTeam/setMetadata) |
|
|
159
|
+
| `client.snapshots` | Token holder snapshot generation and retrieval |
|
|
160
|
+
| `client.historicalBalance` | Historical balance archive reads |
|
|
161
|
+
| `client.settlement` | Cross-chain settlement operations |
|
|
162
|
+
| `client.governance` | Governance proposal dry-run (simulate-only) |
|
|
163
|
+
| `client.dao` | DAO governance — DAOs, proposals, votes, treasury, members, dashboard |
|
|
164
|
+
| `client.personhood` | Personhood verification (HPP one-human-one-member) |
|
|
165
|
+
| `client.agents` | BaaS smart-agent lifecycle (register/fund/trade/withdraw/pause/resume/revoke) |
|
|
166
|
+
| `client.deployments` | BaaS smart-app deployment lifecycle (init/uploadFrontend/deploy/rollback/status) |
|
|
167
|
+
| `client.bridge` | Universal Token Bridge — port/return/claim across chains |
|
|
168
|
+
| `client.resources` | Network + per-app resource consumption (summary, history, ledger, nodes) |
|
|
169
|
+
| `client.envelope` | AES-256-GCM envelope encrypt/decrypt under the TSS-backed master KEK |
|
|
170
|
+
| `client.tokens` | Token migration — move existing tokens to TSS-controlled keys |
|
|
171
|
+
| `client.operator` | Operator account funding helpers (balance + top-up guidance) |
|
|
172
|
+
| `client.discovery` | Discovery — cluster registry + `client.discovery.platformImages` manifests |
|
|
173
|
+
|
|
174
|
+
### `baas.*` sub-clients on `BaasClient`
|
|
175
|
+
|
|
176
|
+
| Field | Purpose |
|
|
177
|
+
|---|---|
|
|
178
|
+
| `baas.db` | Trustless database with state proofs and Merkle verification |
|
|
179
|
+
| `baas.storage` | Decentralized file storage |
|
|
180
|
+
| `baas.functions` | Serverless function deployment and invocation |
|
|
181
|
+
| `baas.messaging` | Real-time pub/sub messaging with channels, history, presence |
|
|
182
|
+
| `baas.deployment` | App deployment lifecycle (init/uploadFrontend/deploy/rollback/...) |
|
|
183
|
+
| `baas.agents` | Autonomous smart-agent management |
|
|
184
|
+
| `baas.customerSession` | Customer→smart-app session bridge (TokenGate Face B) |
|
|
185
|
+
| `baas.rules` | Publish / get / list / simulate / deprecate canonical `ValidatorRules` documents on HCS |
|
|
186
|
+
| `baas.entities` | Create canonical token / account / topic / agent entities (plus launchpad mega-helper), each bound to a published `ruleRef` |
|
|
187
|
+
|
|
100
188
|
All clients accept the same `pathPrefix: '/host'` option when consumed via
|
|
101
189
|
the cluster gateway. Set `pathPrefix: ''` for direct host access.
|
|
102
190
|
|
|
@@ -268,15 +356,18 @@ await baas.deployment.rollback(init.appId, { toTag: 'v0' });
|
|
|
268
356
|
## Chain operations via `SmartEngineClient`
|
|
269
357
|
|
|
270
358
|
For direct chain operations independent of BaaS — e.g., a custodial backend
|
|
271
|
-
that creates accounts and tokens on behalf of users
|
|
359
|
+
that creates accounts and tokens on behalf of users — use the methods on the
|
|
360
|
+
`SmartEngineClient` returned by `connectToCluster`:
|
|
272
361
|
|
|
273
362
|
```ts
|
|
274
363
|
import { SmartEngineClient } from '@hsuite/smart-engines-sdk';
|
|
275
364
|
|
|
276
|
-
const client =
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
365
|
+
const { client } = await SmartEngineClient.connectToCluster({
|
|
366
|
+
network: 'testnet',
|
|
367
|
+
chain: 'xrpl',
|
|
368
|
+
address: wallet.address,
|
|
369
|
+
publicKey: wallet.publicKey,
|
|
370
|
+
signFn: async (challenge) => /* sign challenge */ '',
|
|
280
371
|
});
|
|
281
372
|
|
|
282
373
|
// Create an account on any supported chain
|
|
@@ -405,17 +496,23 @@ try {
|
|
|
405
496
|
|
|
406
497
|
## Bundle
|
|
407
498
|
|
|
408
|
-
The SDK
|
|
409
|
-
vendored in
|
|
499
|
+
The SDK ships as a single CJS bundle with workspace-only primitives
|
|
500
|
+
vendored in, plus subpath exports for the optional NestJS integration and
|
|
501
|
+
the customer-facing PQC verifiers. Build artifacts live under `dist/`:
|
|
410
502
|
|
|
411
503
|
```
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
504
|
+
dist/index.{js,d.ts} — main bundle + types
|
|
505
|
+
dist/nestjs/index.{js,d.ts} — NestJS integration (optional)
|
|
506
|
+
dist/pqc-verify/index.{js,d.ts} — PQC attestation verifier
|
|
507
|
+
dist/pqc-verify-envelope/index.{js,d.ts} — PQC envelope verifier
|
|
508
|
+
dist/ipfs-access-key/index.{js,d.ts} — IPFS access-key helper
|
|
509
|
+
dist/k8s-secret-reader/index.{js,d.ts} — k8s secret reader (NestJS)
|
|
417
510
|
```
|
|
418
511
|
|
|
512
|
+
The PQC and k8s-secret-reader entries are subpath exports — import from
|
|
513
|
+
`@hsuite/smart-engines-sdk/pqc-verify` etc. so callers that don't need
|
|
514
|
+
`@noble/post-quantum` (~120 KB compressed) don't pull it in.
|
|
515
|
+
|
|
419
516
|
---
|
|
420
517
|
|
|
421
518
|
## License
|
package/dist/index.d.ts
CHANGED
|
@@ -1866,6 +1866,8 @@ export type HttpClient = {
|
|
|
1866
1866
|
delete<T = any>(path: string): Promise<T>;
|
|
1867
1867
|
getText(path: string): Promise<string>;
|
|
1868
1868
|
upload<T = any>(path: string, file: Blob | Buffer, filename: string, metadata?: Record<string, string>, fieldName?: string): Promise<T>;
|
|
1869
|
+
setAuthToken(token: string | undefined): void;
|
|
1870
|
+
getAuthToken(): string | undefined;
|
|
1869
1871
|
};
|
|
1870
1872
|
export type HttpClientConfig = {
|
|
1871
1873
|
baseUrl: string;
|
|
@@ -1958,10 +1960,49 @@ export declare class PlatformImagesClient {
|
|
|
1958
1960
|
}>;
|
|
1959
1961
|
verify(imageName: string, version: string, digest: string): Promise<DiscoveryVerifyResult>;
|
|
1960
1962
|
}
|
|
1963
|
+
export type NetworkName = "testnet" | "mainnet";
|
|
1964
|
+
export interface NetworkPreset {
|
|
1965
|
+
readonly bootstrap: readonly string[];
|
|
1966
|
+
}
|
|
1967
|
+
export declare const KNOWN_NETWORKS: Readonly<Record<NetworkName, NetworkPreset>>;
|
|
1968
|
+
export declare function resolveNetwork(name: NetworkName): NetworkPreset;
|
|
1969
|
+
export declare function isKnownNetwork(name: string): name is NetworkName;
|
|
1970
|
+
export type ResolveClusterSeed = {
|
|
1971
|
+
bootstrap?: string[];
|
|
1972
|
+
network?: NetworkName;
|
|
1973
|
+
};
|
|
1974
|
+
export type ResolveClusterTrustAnchor = {
|
|
1975
|
+
network: "mainnet" | "testnet" | "previewnet";
|
|
1976
|
+
registryTopicId: string;
|
|
1977
|
+
mirrorNodeUrl?: string;
|
|
1978
|
+
};
|
|
1979
|
+
export type ResolveClusterConfig = ResolveClusterSeed & {
|
|
1980
|
+
allowInsecure?: boolean;
|
|
1981
|
+
trustAnchor?: ResolveClusterTrustAnchor;
|
|
1982
|
+
};
|
|
1983
|
+
export type ResolveClusterFailure = "no-seeds" | "no-clusters";
|
|
1984
|
+
export type ResolveClusterResult = {
|
|
1985
|
+
ok: true;
|
|
1986
|
+
cluster: ClusterInfo;
|
|
1987
|
+
} | {
|
|
1988
|
+
ok: false;
|
|
1989
|
+
reason: ResolveClusterFailure;
|
|
1990
|
+
};
|
|
1991
|
+
declare function resolveClusterEndpoint(config: ResolveClusterConfig): Promise<ResolveClusterResult>;
|
|
1961
1992
|
export type AuthChain = "hedera" | "xrpl" | "polkadot" | "stellar" | "solana";
|
|
1962
1993
|
export interface SecurityConfig {
|
|
1963
1994
|
allowInsecure?: boolean;
|
|
1964
1995
|
}
|
|
1996
|
+
export type HederaSigner = {
|
|
1997
|
+
sign(message: Uint8Array): Uint8Array | Buffer | {
|
|
1998
|
+
toBytes(): Uint8Array;
|
|
1999
|
+
};
|
|
2000
|
+
};
|
|
2001
|
+
export type XrplSigner = {
|
|
2002
|
+
sign(message: string): string | {
|
|
2003
|
+
signedTransaction: string;
|
|
2004
|
+
};
|
|
2005
|
+
};
|
|
1965
2006
|
export interface ChallengeResponse {
|
|
1966
2007
|
success: boolean;
|
|
1967
2008
|
challenge: string;
|
|
@@ -2009,8 +2050,8 @@ export declare class ValidatorAuthClient {
|
|
|
2009
2050
|
requestChallenge(validatorUrl: string, chain: AuthChain, address: string): Promise<ChallengeResponse>;
|
|
2010
2051
|
authenticate(validatorUrl: string, request: AuthenticateRequest): Promise<AuthenticateResponse>;
|
|
2011
2052
|
getSession(validatorUrl: string, token: string): Promise<SessionInfo>;
|
|
2012
|
-
signChallengeHedera(challenge: string, privateKey:
|
|
2013
|
-
signChallengeXRPL(challenge: string, wallet:
|
|
2053
|
+
signChallengeHedera(challenge: string, privateKey: HederaSigner): string;
|
|
2054
|
+
signChallengeXRPL(challenge: string, wallet: XrplSigner): string;
|
|
2014
2055
|
authenticateWithSigner(validatorUrl: string, chain: AuthChain, address: string, publicKey: string, signFn: (challenge: string) => string | Promise<string>, metadata?: AuthenticateRequest["metadata"]): Promise<AuthenticateResponse>;
|
|
2015
2056
|
}
|
|
2016
2057
|
export declare class ValidatorAuthError extends Error {
|
|
@@ -2026,33 +2067,6 @@ export type Web3Signer = {
|
|
|
2026
2067
|
wallet: Wallet;
|
|
2027
2068
|
};
|
|
2028
2069
|
export declare function createXrplWeb3Signer(seed: string): Web3Signer;
|
|
2029
|
-
interface RetryConfig$1 {
|
|
2030
|
-
maxRetries: number;
|
|
2031
|
-
initialDelayMs: number;
|
|
2032
|
-
maxDelayMs: number;
|
|
2033
|
-
backoffMultiplier: number;
|
|
2034
|
-
jitterFactor?: number;
|
|
2035
|
-
}
|
|
2036
|
-
export declare const DEFAULT_RETRY_CONFIG: RetryConfig$1;
|
|
2037
|
-
export interface ResilientHttpConfig {
|
|
2038
|
-
timeoutMs?: number;
|
|
2039
|
-
retry?: Partial<RetryConfig$1>;
|
|
2040
|
-
circuitBreaker?: Partial<CircuitBreakerConfig> | false;
|
|
2041
|
-
onRetry?: (attempt: number, delay: number, status?: number) => void;
|
|
2042
|
-
onCircuitBreakerStateChange?: (state: "closed" | "open" | "half_open") => void;
|
|
2043
|
-
}
|
|
2044
|
-
export declare function resilientFetch(url: string, init?: RequestInit, config?: ResilientHttpConfig): Promise<Response>;
|
|
2045
|
-
export declare function createResilientFetchWithBreaker(config?: ResilientHttpConfig): {
|
|
2046
|
-
fetch: (url: string, init?: RequestInit) => Promise<Response>;
|
|
2047
|
-
getCircuitBreakerSnapshot: () => CircuitBreakerSnapshot | null;
|
|
2048
|
-
};
|
|
2049
|
-
export type NetworkName = "testnet" | "mainnet";
|
|
2050
|
-
export interface NetworkPreset {
|
|
2051
|
-
readonly bootstrap: readonly string[];
|
|
2052
|
-
}
|
|
2053
|
-
export declare const KNOWN_NETWORKS: Readonly<Record<NetworkName, NetworkPreset>>;
|
|
2054
|
-
export declare function resolveNetwork(name: NetworkName): NetworkPreset;
|
|
2055
|
-
export declare function isKnownNetwork(name: string): name is NetworkName;
|
|
2056
2070
|
export type SubscriptionTierName = "free_testnet" | "starter" | "professional" | "enterprise";
|
|
2057
2071
|
export type SubscriptionStatus = "pending_deposit" | "deposit_confirmed" | "active" | "expired" | "cancelled";
|
|
2058
2072
|
export type DepositWalletStatus = "pending" | "locked" | "expired" | "slashed" | "released";
|
|
@@ -2890,7 +2904,7 @@ export type PrepareTokenWipeRequest = {
|
|
|
2890
2904
|
export declare class HederaTransactionsClient {
|
|
2891
2905
|
private readonly http;
|
|
2892
2906
|
readonly tss: HederaTssClient;
|
|
2893
|
-
constructor(http: HttpClient, tssHttp
|
|
2907
|
+
constructor(http: HttpClient, tssHttp: HttpClient);
|
|
2894
2908
|
prepareTopicCreate(request: PrepareTopicCreateRequest): Promise<PreparedTransaction>;
|
|
2895
2909
|
prepareTopicMessage(request: PrepareTopicMessageRequest): Promise<PreparedTransaction>;
|
|
2896
2910
|
prepareTokenComplianceEnable(request: PrepareTokenComplianceEnableRequest): Promise<PreparedTransaction>;
|
|
@@ -3809,7 +3823,6 @@ export type BaasClientConfig = {
|
|
|
3809
3823
|
services?: BaasService[];
|
|
3810
3824
|
timeout?: number;
|
|
3811
3825
|
allowInsecure?: boolean;
|
|
3812
|
-
http?: ResilientHttpConfig;
|
|
3813
3826
|
pathPrefix?: string;
|
|
3814
3827
|
};
|
|
3815
3828
|
export type BaasChallengeRequest = {
|
|
@@ -4423,18 +4436,6 @@ export type TokenMigrationsForTokenResponse = {
|
|
|
4423
4436
|
migrations: TokenMigrationStatus[];
|
|
4424
4437
|
count: number;
|
|
4425
4438
|
};
|
|
4426
|
-
export type TokenDetailsResponse = {
|
|
4427
|
-
chain: string;
|
|
4428
|
-
tokenId: string;
|
|
4429
|
-
name?: string;
|
|
4430
|
-
symbol?: string;
|
|
4431
|
-
totalSupply?: string;
|
|
4432
|
-
adminKey?: string | null;
|
|
4433
|
-
supplyKey?: string | null;
|
|
4434
|
-
tssControlled?: boolean;
|
|
4435
|
-
entityId?: string;
|
|
4436
|
-
message?: string;
|
|
4437
|
-
};
|
|
4438
4439
|
export declare class TokensClient {
|
|
4439
4440
|
private readonly http;
|
|
4440
4441
|
constructor(http: HttpClient);
|
|
@@ -4444,7 +4445,6 @@ export declare class TokensClient {
|
|
|
4444
4445
|
error: string;
|
|
4445
4446
|
}>;
|
|
4446
4447
|
getMigrationsForToken(tokenId: string): Promise<TokenMigrationsForTokenResponse>;
|
|
4447
|
-
getDetails(chain: string, tokenId: string): Promise<TokenDetailsResponse>;
|
|
4448
4448
|
}
|
|
4449
4449
|
export type OperatorChain = "hedera";
|
|
4450
4450
|
export type OperatorTokenBalance = {
|
|
@@ -4479,7 +4479,6 @@ export interface SmartEngineClientConfig {
|
|
|
4479
4479
|
authToken?: string;
|
|
4480
4480
|
timeout?: number;
|
|
4481
4481
|
allowInsecure?: boolean;
|
|
4482
|
-
http?: ResilientHttpConfig;
|
|
4483
4482
|
}
|
|
4484
4483
|
export interface NetworkConnectionConfig {
|
|
4485
4484
|
network: "mainnet" | "testnet" | "previewnet";
|
|
@@ -5131,6 +5130,26 @@ export declare class SmartGatewayClient {
|
|
|
5131
5130
|
getMetrics(refresh?: boolean): Promise<GatewayMetricsResponse>;
|
|
5132
5131
|
getMetricsSummary(): Promise<GatewayMetricsSummaryResponse>;
|
|
5133
5132
|
}
|
|
5133
|
+
interface RetryConfig$1 {
|
|
5134
|
+
maxRetries: number;
|
|
5135
|
+
initialDelayMs: number;
|
|
5136
|
+
maxDelayMs: number;
|
|
5137
|
+
backoffMultiplier: number;
|
|
5138
|
+
jitterFactor?: number;
|
|
5139
|
+
}
|
|
5140
|
+
export declare const DEFAULT_RETRY_CONFIG: RetryConfig$1;
|
|
5141
|
+
export interface ResilientHttpConfig {
|
|
5142
|
+
timeoutMs?: number;
|
|
5143
|
+
retry?: Partial<RetryConfig$1>;
|
|
5144
|
+
circuitBreaker?: Partial<CircuitBreakerConfig> | false;
|
|
5145
|
+
onRetry?: (attempt: number, delay: number, status?: number) => void;
|
|
5146
|
+
onCircuitBreakerStateChange?: (state: "closed" | "open" | "half_open") => void;
|
|
5147
|
+
}
|
|
5148
|
+
export declare function resilientFetch(url: string, init?: RequestInit, config?: ResilientHttpConfig): Promise<Response>;
|
|
5149
|
+
export declare function createResilientFetchWithBreaker(config?: ResilientHttpConfig): {
|
|
5150
|
+
fetch: (url: string, init?: RequestInit) => Promise<Response>;
|
|
5151
|
+
getCircuitBreakerSnapshot: () => CircuitBreakerSnapshot | null;
|
|
5152
|
+
};
|
|
5134
5153
|
declare function formatHederaAccountId(id: string): string;
|
|
5135
5154
|
declare function parseHbar(amount: string): number;
|
|
5136
5155
|
declare function hbarToTinybars(hbar: string | number): string;
|
|
@@ -25072,7 +25091,6 @@ export declare class BaasClient {
|
|
|
25072
25091
|
private appId;
|
|
25073
25092
|
private readonly timeout;
|
|
25074
25093
|
private readonly allowInsecure;
|
|
25075
|
-
private authToken;
|
|
25076
25094
|
private readonly http;
|
|
25077
25095
|
private lastHttpError?;
|
|
25078
25096
|
readonly db: DatabaseClient;
|
|
@@ -25099,10 +25117,6 @@ export declare class BaasClient {
|
|
|
25099
25117
|
validateSession(): Promise<BaasSessionInfo>;
|
|
25100
25118
|
logout(): Promise<void>;
|
|
25101
25119
|
private requireAuth;
|
|
25102
|
-
private getHeaders;
|
|
25103
|
-
private post;
|
|
25104
|
-
private get;
|
|
25105
|
-
private request;
|
|
25106
25120
|
}
|
|
25107
25121
|
export declare class BaasError extends Error {
|
|
25108
25122
|
readonly statusCode: number;
|
|
@@ -25261,10 +25275,10 @@ declare namespace pqcVerifyEnvelope {
|
|
|
25261
25275
|
export { EnvelopeVerificationResult, EnvelopeVersionLiteral, KYBER_MIN_TIMESTAMP_MS, SchemaValidationResult, VerificationDetails, VerifyEnvelopeOptions, validateEnvelopeSchema, verifyPqcEnvelope };
|
|
25262
25276
|
}
|
|
25263
25277
|
declare namespace discovery {
|
|
25264
|
-
export { ClusterDiscoveryClient, ClusterDiscoveryConfig, ClusterEndpointsView, ClusterInfo, DiscoveryClient, DiscoveryClusterEndpoints, DiscoveryClusterRecord, DiscoveryNodeRecord, DiscoveryPlatformImageEnvelope, DiscoveryPlatformImageManifest, DiscoveryVerifyResult, MIRROR_NODE_URLS, MirrorNodeClient, MirrorNodeConfig, MirrorNodeError, PlatformImagesClient, TopicMessage, TopicMessagesResponse, ValidatorDiscoveryClient, ValidatorDiscoveryConfig, ValidatorInfo, ValidatorMetadata, ValidatorNetworkEndpoints };
|
|
25278
|
+
export { ClusterDiscoveryClient, ClusterDiscoveryConfig, ClusterEndpointsView, ClusterInfo, DiscoveryClient, DiscoveryClusterEndpoints, DiscoveryClusterRecord, DiscoveryNodeRecord, DiscoveryPlatformImageEnvelope, DiscoveryPlatformImageManifest, DiscoveryVerifyResult, MIRROR_NODE_URLS, MirrorNodeClient, MirrorNodeConfig, MirrorNodeError, PlatformImagesClient, ResolveClusterConfig, ResolveClusterFailure, ResolveClusterResult, ResolveClusterSeed, ResolveClusterTrustAnchor, TopicMessage, TopicMessagesResponse, ValidatorDiscoveryClient, ValidatorDiscoveryConfig, ValidatorInfo, ValidatorMetadata, ValidatorNetworkEndpoints, resolveClusterEndpoint };
|
|
25265
25279
|
}
|
|
25266
25280
|
declare namespace auth {
|
|
25267
|
-
export { AuthChain, AuthenticateRequest, AuthenticateResponse, ChallengeResponse, SecurityConfig, SessionInfo, ValidatorAuthClient, ValidatorAuthConfig, ValidatorAuthError, Web3Signer, createXrplWeb3Signer };
|
|
25281
|
+
export { AuthChain, AuthenticateRequest, AuthenticateResponse, ChallengeResponse, HederaSigner, SecurityConfig, SessionInfo, ValidatorAuthClient, ValidatorAuthConfig, ValidatorAuthError, Web3Signer, XrplSigner, createXrplWeb3Signer };
|
|
25268
25282
|
}
|
|
25269
25283
|
declare namespace chains {
|
|
25270
25284
|
export { bitcoin, hedera, polkadot, solana, stellar, xrpl };
|
|
@@ -25282,7 +25296,7 @@ declare namespace envelope {
|
|
|
25282
25296
|
export { DecryptRequest, DecryptResponse, EncryptRequest, EncryptResponse, EncryptedEnvelope, EnvelopeClient };
|
|
25283
25297
|
}
|
|
25284
25298
|
declare namespace tokens {
|
|
25285
|
-
export { ListMigrationsResponse,
|
|
25299
|
+
export { ListMigrationsResponse, TokenMigrationChain, TokenMigrationRequest, TokenMigrationResponse, TokenMigrationStatus, TokenMigrationStatusValue, TokenMigrationsForTokenResponse, TokensClient };
|
|
25286
25300
|
}
|
|
25287
25301
|
declare namespace operator {
|
|
25288
25302
|
export { OperatorBalanceResponse, OperatorChain, OperatorClient, OperatorTokenBalance, OperatorTopUpResponse };
|