@hsuite/smart-engines-sdk 3.0.2 → 3.1.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 +28 -0
- package/README.md +43 -12
- package/dist/index.d.ts +348 -34
- package/dist/index.js +642 -20
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.d.ts +292 -33
- package/dist/nestjs/index.js +598 -20
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.2.1 — 2026-05-16
|
|
4
|
+
|
|
5
|
+
**Documentation-only fix.** No runtime behavior change.
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- `DeploymentClient.init` JSDoc and `BaasInitResponse` type docs no longer
|
|
9
|
+
describe the registry as DOCR. The runtime arc routes pushes through a
|
|
10
|
+
per-tenant Harbor project (`hsuite-customers-<appId>`), and the credentials
|
|
11
|
+
returned in `registry.{server, username, password, repository}` are an
|
|
12
|
+
ephemeral project-scoped robot account whose secret is single-use and not
|
|
13
|
+
persisted server-side. README example aligned with the same wording.
|
|
14
|
+
|
|
15
|
+
## 3.2.0 — undocumented (PR-A → PR-I, 2026-05-12 → 2026-05-13)
|
|
16
|
+
|
|
17
|
+
Smart-app runtime arc surface — added `DeploymentClient` with the full
|
|
18
|
+
init → push → uploadFrontend → deploy flow plus lifecycle (suspend/
|
|
19
|
+
resume/update/rollback/delete) and ownership-gated metrics. See PRs
|
|
20
|
+
#516 (PR-A), #523 (PR-C), and #530 (PR-H) for details.
|
|
21
|
+
|
|
22
|
+
## 3.1.0 — undocumented (2026-05-12)
|
|
23
|
+
|
|
24
|
+
Added `CustomerSessionClient` for NFT-gated customer→smart-app auth (PR #496).
|
|
25
|
+
|
|
26
|
+
## 3.0.2 — undocumented (2026-05-12)
|
|
27
|
+
|
|
28
|
+
Dropped `nestjs` re-exports from the root entry to keep tree-shaking clean for
|
|
29
|
+
non-Nest consumers (PR #494).
|
|
30
|
+
|
|
3
31
|
## 3.0.0 — 2026-05-11
|
|
4
32
|
|
|
5
33
|
**First publishable release.**
|
package/README.md
CHANGED
|
@@ -52,14 +52,24 @@ await baas.authenticate({
|
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
// 4.
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
// 4. Initialise a free_testnet smart-app via the four-step deploy flow
|
|
56
|
+
// (init → docker push → optional uploadFrontend → deploy). `init` runs
|
|
57
|
+
// the per-entity DKG ceremony on the cluster and returns the DKG entityId
|
|
58
|
+
// as `appId`, plus ephemeral push credentials for the cluster's per-tenant
|
|
59
|
+
// Harbor project (single-use secret — not persisted server-side).
|
|
60
|
+
const init = await baas.deployment.init({
|
|
61
|
+
name: 'my-smart-app',
|
|
62
|
+
port: 3000,
|
|
58
63
|
services: ['database', 'storage', 'messaging', 'functions'],
|
|
59
64
|
});
|
|
60
65
|
|
|
61
|
-
console.log(`
|
|
62
|
-
|
|
66
|
+
console.log(`Allocated smart-app ${init.appId}`);
|
|
67
|
+
console.log(`Push to: ${init.registry.server}/${init.registry.repository}:<tag>`);
|
|
68
|
+
baas.setAppId(init.appId);
|
|
69
|
+
|
|
70
|
+
// (out-of-band) docker login + docker push <init.registry.server>/<init.registry.repository>:v1
|
|
71
|
+
// (optional) await baas.deployment.uploadFrontend(init.appId, await fs.readFile('./bundle.tar.gz'));
|
|
72
|
+
// (deploy) await baas.deployment.deploy(init.appId, { tag: 'v1', replicas: 1 });
|
|
63
73
|
```
|
|
64
74
|
|
|
65
75
|
**Why XRPL?** Per the Smart Engines V3 architecture, XRPL is canonical for
|
|
@@ -166,19 +176,40 @@ await baas.agents.resume(agent.agentId);
|
|
|
166
176
|
const events = await baas.agents.getEvents(agent.agentId);
|
|
167
177
|
```
|
|
168
178
|
|
|
169
|
-
### Deployment
|
|
179
|
+
### Deployment (runtime orchestration — spec §6.1)
|
|
180
|
+
|
|
181
|
+
The four-step deploy flow: **init → docker push → (optional) uploadFrontend → deploy**.
|
|
170
182
|
|
|
171
183
|
```ts
|
|
172
|
-
|
|
173
|
-
|
|
184
|
+
// 1. init — allocate appId via DKG + receive ephemeral Harbor push credentials
|
|
185
|
+
const init = await baas.deployment.init({
|
|
186
|
+
name: 'my-smart-app',
|
|
187
|
+
port: 3000,
|
|
174
188
|
services: ['database', 'storage', 'messaging'],
|
|
175
|
-
config: { /* app-specific */ },
|
|
176
189
|
});
|
|
177
190
|
|
|
191
|
+
// 2. docker push — out-of-band, using the ephemeral creds returned above
|
|
192
|
+
// docker login -u <init.registry.username> -p <init.registry.password> <init.registry.server>
|
|
193
|
+
// docker push <init.registry.server>/<init.registry.repository>:v1
|
|
194
|
+
|
|
195
|
+
// 3. uploadFrontend — optional SPA tarball (content-addressed, mounted read-only)
|
|
196
|
+
await baas.deployment.uploadFrontend(init.appId, await fs.readFile('./bundle.tar.gz'));
|
|
197
|
+
|
|
198
|
+
// 4. deploy — reconcile to k8s
|
|
199
|
+
const deployed = await baas.deployment.deploy(init.appId, {
|
|
200
|
+
tag: 'v1',
|
|
201
|
+
replicas: 1,
|
|
202
|
+
env: { NODE_ENV: 'production' },
|
|
203
|
+
});
|
|
204
|
+
console.log(`live at ${deployed.url}`);
|
|
205
|
+
|
|
206
|
+
// Lifecycle + listing
|
|
178
207
|
const apps = await baas.deployment.list();
|
|
179
|
-
const info = await baas.deployment.get(appId);
|
|
180
|
-
await baas.deployment.
|
|
181
|
-
await baas.deployment.
|
|
208
|
+
const info = await baas.deployment.get(init.appId);
|
|
209
|
+
const status = await baas.deployment.status(init.appId);
|
|
210
|
+
await baas.deployment.suspend(init.appId);
|
|
211
|
+
await baas.deployment.resume(init.appId);
|
|
212
|
+
await baas.deployment.rollback(init.appId, { toTag: 'v0' });
|
|
182
213
|
```
|
|
183
214
|
|
|
184
215
|
---
|
package/dist/index.d.ts
CHANGED
|
@@ -970,6 +970,46 @@ export declare class MirrorNodeError extends Error {
|
|
|
970
970
|
statusCode: number;
|
|
971
971
|
constructor(message: string, statusCode: number);
|
|
972
972
|
}
|
|
973
|
+
export interface ClusterEndpointsView {
|
|
974
|
+
clusterId: string;
|
|
975
|
+
gatewayUrl: string;
|
|
976
|
+
harborUrl?: string;
|
|
977
|
+
natsUrl?: string;
|
|
978
|
+
publicIp?: string;
|
|
979
|
+
region?: string;
|
|
980
|
+
}
|
|
981
|
+
export interface ClusterInfo {
|
|
982
|
+
clusterId: string;
|
|
983
|
+
endpoints: ClusterEndpointsView;
|
|
984
|
+
nodeIds: string[];
|
|
985
|
+
}
|
|
986
|
+
export interface ClusterDiscoveryConfig {
|
|
987
|
+
bootstrap: string[];
|
|
988
|
+
cacheTtlMs?: number;
|
|
989
|
+
fetchTimeoutMs?: number;
|
|
990
|
+
trustAnchor?: ValidatorDiscoveryConfig;
|
|
991
|
+
allowInsecure?: boolean;
|
|
992
|
+
}
|
|
993
|
+
declare class ClusterDiscoveryClient {
|
|
994
|
+
private readonly bootstrap;
|
|
995
|
+
private readonly cacheTtlMs;
|
|
996
|
+
private readonly fetchTimeoutMs;
|
|
997
|
+
private readonly allowInsecure;
|
|
998
|
+
private readonly trustAnchorClient;
|
|
999
|
+
private cache;
|
|
1000
|
+
constructor(config: ClusterDiscoveryConfig);
|
|
1001
|
+
getClusters(forceRefresh?: boolean): Promise<ClusterInfo[]>;
|
|
1002
|
+
getRandomCluster(forceRefresh?: boolean): Promise<ClusterInfo | null>;
|
|
1003
|
+
getRandomGatewayUrl(forceRefresh?: boolean): Promise<string | null>;
|
|
1004
|
+
getClusterById(clusterId: string, forceRefresh?: boolean): Promise<ClusterInfo | null>;
|
|
1005
|
+
clearCache(): void;
|
|
1006
|
+
private isCacheValid;
|
|
1007
|
+
private fetchFromFirstAvailableSeed;
|
|
1008
|
+
private fetchClustersFromSeed;
|
|
1009
|
+
private normalizeClusterEntry;
|
|
1010
|
+
private verifyAgainstTrustAnchor;
|
|
1011
|
+
private pickRandomIndex;
|
|
1012
|
+
}
|
|
973
1013
|
export type AuthChain = "hedera" | "xrpl" | "polkadot" | "stellar" | "solana";
|
|
974
1014
|
export interface SecurityConfig {
|
|
975
1015
|
allowInsecure?: boolean;
|
|
@@ -1055,7 +1095,7 @@ export type HttpClient = {
|
|
|
1055
1095
|
get<T = any>(path: string): Promise<T>;
|
|
1056
1096
|
put<T = any>(path: string, body: unknown): Promise<T>;
|
|
1057
1097
|
delete<T = any>(path: string): Promise<T>;
|
|
1058
|
-
upload<T = any>(path: string, file: Blob | Buffer, filename: string, metadata?: Record<string, string
|
|
1098
|
+
upload<T = any>(path: string, file: Blob | Buffer, filename: string, metadata?: Record<string, string>, fieldName?: string): Promise<T>;
|
|
1059
1099
|
};
|
|
1060
1100
|
export type HttpClientConfig = {
|
|
1061
1101
|
baseUrl: string;
|
|
@@ -1070,6 +1110,14 @@ export declare class SdkHttpError extends Error {
|
|
|
1070
1110
|
}
|
|
1071
1111
|
export declare function createHttpClient(config: HttpClientConfig): HttpClient;
|
|
1072
1112
|
export declare function encodePathParam(param: string): string;
|
|
1113
|
+
export interface RuleRejectedDetails {
|
|
1114
|
+
error: "rule_rejected";
|
|
1115
|
+
reason: string;
|
|
1116
|
+
ruleAtoms: string[];
|
|
1117
|
+
}
|
|
1118
|
+
export declare function isRuleRejected(err: unknown): err is SdkHttpError & {
|
|
1119
|
+
details: RuleRejectedDetails;
|
|
1120
|
+
};
|
|
1073
1121
|
export type SubscriptionTierName = "free_testnet" | "starter" | "professional" | "enterprise";
|
|
1074
1122
|
export type SubscriptionStatus = "pending_deposit" | "deposit_confirmed" | "active" | "expired" | "cancelled";
|
|
1075
1123
|
export type DepositWalletStatus = "pending" | "locked" | "expired" | "slashed" | "released";
|
|
@@ -1197,7 +1245,6 @@ export type EntityCreationResponse = {
|
|
|
1197
1245
|
success: boolean;
|
|
1198
1246
|
entityId: string;
|
|
1199
1247
|
publicKeys: string[];
|
|
1200
|
-
signerIndices: number[];
|
|
1201
1248
|
threshold: number;
|
|
1202
1249
|
ceremonyIds: string[];
|
|
1203
1250
|
};
|
|
@@ -1217,7 +1264,6 @@ export type ReshareResponse = {
|
|
|
1217
1264
|
export type EntityDetails = {
|
|
1218
1265
|
success: boolean;
|
|
1219
1266
|
payload?: unknown;
|
|
1220
|
-
signerIndices?: number[];
|
|
1221
1267
|
validators?: string[];
|
|
1222
1268
|
publicKeys?: string[];
|
|
1223
1269
|
error?: string;
|
|
@@ -1572,6 +1618,48 @@ export declare class SnapshotsClient {
|
|
|
1572
1618
|
listByToken(tokenId: string, pagination?: PaginationOptions): Promise<SnapshotListResponse>;
|
|
1573
1619
|
download(snapshotId: string, format?: SnapshotFormat): Promise<any>;
|
|
1574
1620
|
}
|
|
1621
|
+
export type HistoricalBalanceChain = "hedera" | "xrpl" | "polkadot";
|
|
1622
|
+
export type HistoricalBalanceQueryParams = {
|
|
1623
|
+
chain: HistoricalBalanceChain;
|
|
1624
|
+
entityId: string;
|
|
1625
|
+
account: string;
|
|
1626
|
+
atTimestamp: number;
|
|
1627
|
+
};
|
|
1628
|
+
export type HistoricalBalanceResult = {
|
|
1629
|
+
chain: HistoricalBalanceChain;
|
|
1630
|
+
entityId: string;
|
|
1631
|
+
account: string;
|
|
1632
|
+
atTimestamp: number;
|
|
1633
|
+
balance: string;
|
|
1634
|
+
source: "archive";
|
|
1635
|
+
};
|
|
1636
|
+
export type HistoricalBalanceClientConfig = {
|
|
1637
|
+
baseUrl: string;
|
|
1638
|
+
authToken?: string;
|
|
1639
|
+
apiKey?: string;
|
|
1640
|
+
timeoutMs?: number;
|
|
1641
|
+
fetchImpl?: typeof fetch;
|
|
1642
|
+
};
|
|
1643
|
+
export declare class HistoricalBalanceClientError extends Error {
|
|
1644
|
+
readonly statusCode: number;
|
|
1645
|
+
readonly details?: unknown | undefined;
|
|
1646
|
+
constructor(message: string, statusCode: number, details?: unknown | undefined);
|
|
1647
|
+
}
|
|
1648
|
+
export declare class HistoricalBalanceClient {
|
|
1649
|
+
private readonly baseUrl?;
|
|
1650
|
+
private readonly authToken?;
|
|
1651
|
+
private readonly apiKey?;
|
|
1652
|
+
private readonly timeoutMs;
|
|
1653
|
+
private readonly fetchImpl?;
|
|
1654
|
+
private readonly http?;
|
|
1655
|
+
constructor(config: HistoricalBalanceClientConfig | {
|
|
1656
|
+
http: HttpClient;
|
|
1657
|
+
});
|
|
1658
|
+
static fromHttp(http: HttpClient): HistoricalBalanceClient;
|
|
1659
|
+
getBalance(params: HistoricalBalanceQueryParams): Promise<HistoricalBalanceResult>;
|
|
1660
|
+
private validateParams;
|
|
1661
|
+
private standaloneFetch;
|
|
1662
|
+
}
|
|
1575
1663
|
export type SettlementPurpose = "subscription" | "deposit" | "fee";
|
|
1576
1664
|
export type SettlementAsset = {
|
|
1577
1665
|
symbol: string;
|
|
@@ -1613,6 +1701,121 @@ export declare class SettlementClient {
|
|
|
1613
1701
|
confirmXrpLanded(settlementId: string): Promise<SettlementStatusResponse>;
|
|
1614
1702
|
getHistory(entityId: string): Promise<SettlementHistoryEntry[]>;
|
|
1615
1703
|
}
|
|
1704
|
+
export type GovernanceVotingPowerMethod = "token_balance" | "quadratic" | "one_person_one_vote" | "nft_based" | "time_weighted" | "delegated";
|
|
1705
|
+
export type GovernanceProposalStatus = "pending" | "active" | "passed" | "failed" | "executed" | "cancelled" | "expired" | "vetoed";
|
|
1706
|
+
export type GovernanceVoteType = "for" | "against" | "abstain";
|
|
1707
|
+
export interface GovernanceProposalData {
|
|
1708
|
+
proposalId: string;
|
|
1709
|
+
proposer: string;
|
|
1710
|
+
title: string;
|
|
1711
|
+
description: string;
|
|
1712
|
+
actions: unknown[];
|
|
1713
|
+
status: GovernanceProposalStatus;
|
|
1714
|
+
createdAt: string | Date;
|
|
1715
|
+
votingStartsAt: string | Date;
|
|
1716
|
+
votingEndsAt: string | Date;
|
|
1717
|
+
executionDeadline?: string | Date;
|
|
1718
|
+
votes: {
|
|
1719
|
+
for: string;
|
|
1720
|
+
against: string;
|
|
1721
|
+
abstain: string;
|
|
1722
|
+
totalVotingPower: string;
|
|
1723
|
+
};
|
|
1724
|
+
executionResult?: {
|
|
1725
|
+
success: boolean;
|
|
1726
|
+
transactionId?: string;
|
|
1727
|
+
error?: string;
|
|
1728
|
+
};
|
|
1729
|
+
}
|
|
1730
|
+
export interface GovernanceConfig {
|
|
1731
|
+
governanceTokenId: string;
|
|
1732
|
+
decimals?: number;
|
|
1733
|
+
votingPowerMethod?: GovernanceVotingPowerMethod;
|
|
1734
|
+
quorumPercent?: number;
|
|
1735
|
+
approvalThresholdPercent?: number;
|
|
1736
|
+
proposalThreshold: string;
|
|
1737
|
+
votingPeriodMs: number;
|
|
1738
|
+
timeLockMs?: number;
|
|
1739
|
+
maxExecutionDelayMs?: number;
|
|
1740
|
+
votingEligibility?: Record<string, unknown>;
|
|
1741
|
+
proposalEligibility?: Record<string, unknown>;
|
|
1742
|
+
allowDelegation?: boolean;
|
|
1743
|
+
allowVoteChange?: boolean;
|
|
1744
|
+
vetoCouncil?: string[];
|
|
1745
|
+
maxActiveProposalsPerAccount?: number;
|
|
1746
|
+
proposalCooldownMs?: number;
|
|
1747
|
+
wisdomWeightFn?: {
|
|
1748
|
+
registryKey: string;
|
|
1749
|
+
};
|
|
1750
|
+
delegation?: {
|
|
1751
|
+
maxHops?: number;
|
|
1752
|
+
decayPerHop?: number;
|
|
1753
|
+
concentrationAlert?: number;
|
|
1754
|
+
};
|
|
1755
|
+
description?: string;
|
|
1756
|
+
}
|
|
1757
|
+
export interface GovernanceValidationContext {
|
|
1758
|
+
chain?: string;
|
|
1759
|
+
network?: "mainnet" | "testnet";
|
|
1760
|
+
callerAccountId: string;
|
|
1761
|
+
timestamp?: string | Date;
|
|
1762
|
+
action: "create_proposal" | "cast_vote" | "execute_proposal" | "cancel_proposal" | "veto" | "delegate";
|
|
1763
|
+
proposal?: GovernanceProposalData;
|
|
1764
|
+
voteType?: GovernanceVoteType;
|
|
1765
|
+
tokenBalance?: string;
|
|
1766
|
+
votingPower?: string;
|
|
1767
|
+
lastProposalAt?: string | Date;
|
|
1768
|
+
activeProposalCount?: number;
|
|
1769
|
+
delegation?: {
|
|
1770
|
+
delegateTo?: string;
|
|
1771
|
+
delegatedPower?: string;
|
|
1772
|
+
};
|
|
1773
|
+
daoId?: string;
|
|
1774
|
+
totalDaoVotingPower?: string;
|
|
1775
|
+
}
|
|
1776
|
+
export interface GovernanceValidationResult {
|
|
1777
|
+
isValid: boolean;
|
|
1778
|
+
reason?: string;
|
|
1779
|
+
metadata?: Record<string, unknown>;
|
|
1780
|
+
validatedAt?: string;
|
|
1781
|
+
}
|
|
1782
|
+
export interface GovernanceSimulateRequest {
|
|
1783
|
+
config: GovernanceConfig;
|
|
1784
|
+
context: GovernanceValidationContext;
|
|
1785
|
+
}
|
|
1786
|
+
export declare class GovernanceClient {
|
|
1787
|
+
private readonly http;
|
|
1788
|
+
constructor(http: HttpClient);
|
|
1789
|
+
simulate(params: GovernanceSimulateRequest): Promise<GovernanceValidationResult>;
|
|
1790
|
+
}
|
|
1791
|
+
export type PersonhoodAttestationMethod = "web-of-trust" | "biometric" | "pop-protocol";
|
|
1792
|
+
export interface PersonhoodProof {
|
|
1793
|
+
attestationMethod: PersonhoodAttestationMethod;
|
|
1794
|
+
payload: unknown;
|
|
1795
|
+
}
|
|
1796
|
+
export interface PersonhoodCert {
|
|
1797
|
+
address: string;
|
|
1798
|
+
issuerId: string;
|
|
1799
|
+
attestationMethod: PersonhoodAttestationMethod;
|
|
1800
|
+
issuedAt: number;
|
|
1801
|
+
expiresAt: number;
|
|
1802
|
+
signature: string;
|
|
1803
|
+
}
|
|
1804
|
+
export interface PersonhoodVerifyParams {
|
|
1805
|
+
candidate: string;
|
|
1806
|
+
proof: PersonhoodProof;
|
|
1807
|
+
}
|
|
1808
|
+
export declare const PERSONHOOD_VERIFIER_NOT_CONFIGURED: "personhood_verifier_not_configured";
|
|
1809
|
+
export declare class PersonhoodClient {
|
|
1810
|
+
private readonly http;
|
|
1811
|
+
constructor(http: HttpClient);
|
|
1812
|
+
verify(params: PersonhoodVerifyParams): Promise<PersonhoodCert | null>;
|
|
1813
|
+
}
|
|
1814
|
+
export declare function isPersonhoodVerifierNotConfigured(err: unknown): err is SdkHttpError & {
|
|
1815
|
+
details: {
|
|
1816
|
+
error: typeof PERSONHOOD_VERIFIER_NOT_CONFIGURED;
|
|
1817
|
+
};
|
|
1818
|
+
};
|
|
1616
1819
|
export interface SmartEngineClientConfig {
|
|
1617
1820
|
baseUrl: string;
|
|
1618
1821
|
apiKey?: string;
|
|
@@ -1635,6 +1838,28 @@ export interface NetworkConnectionConfig {
|
|
|
1635
1838
|
mirrorNodeUrl?: string;
|
|
1636
1839
|
allowInsecure?: boolean;
|
|
1637
1840
|
}
|
|
1841
|
+
export interface ClusterConnectionConfig {
|
|
1842
|
+
bootstrap: string[];
|
|
1843
|
+
chain: AuthChain;
|
|
1844
|
+
address: string;
|
|
1845
|
+
publicKey: string;
|
|
1846
|
+
signFn: (challenge: string) => string | Promise<string>;
|
|
1847
|
+
metadata?: {
|
|
1848
|
+
appId?: string;
|
|
1849
|
+
appName?: string;
|
|
1850
|
+
};
|
|
1851
|
+
trustAnchor?: {
|
|
1852
|
+
network: "mainnet" | "testnet" | "previewnet";
|
|
1853
|
+
registryTopicId: string;
|
|
1854
|
+
mirrorNodeUrl?: string;
|
|
1855
|
+
};
|
|
1856
|
+
allowInsecure?: boolean;
|
|
1857
|
+
}
|
|
1858
|
+
export interface ClusterConnectionResult {
|
|
1859
|
+
client: SmartEngineClient;
|
|
1860
|
+
cluster: ClusterInfo;
|
|
1861
|
+
session: AuthenticateResponse;
|
|
1862
|
+
}
|
|
1638
1863
|
export interface NetworkConnectionResult {
|
|
1639
1864
|
client: SmartEngineClient;
|
|
1640
1865
|
validator: ValidatorInfo;
|
|
@@ -1651,9 +1876,13 @@ export declare class SmartEngineClient {
|
|
|
1651
1876
|
readonly ipfs: IPFSClient;
|
|
1652
1877
|
readonly transactions: TransactionsClient;
|
|
1653
1878
|
readonly snapshots: SnapshotsClient;
|
|
1879
|
+
readonly historicalBalance: HistoricalBalanceClient;
|
|
1654
1880
|
readonly settlement: SettlementClient;
|
|
1881
|
+
readonly governance: GovernanceClient;
|
|
1882
|
+
readonly personhood: PersonhoodClient;
|
|
1655
1883
|
constructor(config: SmartEngineClientConfig);
|
|
1656
1884
|
static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
|
|
1885
|
+
static connectToCluster(config: ClusterConnectionConfig): Promise<ClusterConnectionResult>;
|
|
1657
1886
|
getBaseUrl(): string;
|
|
1658
1887
|
isAuthenticated(): boolean;
|
|
1659
1888
|
getHttpHealth(): {
|
|
@@ -2193,24 +2422,6 @@ export type BaasSessionInfo = {
|
|
|
2193
2422
|
expiresAt?: number;
|
|
2194
2423
|
error?: string;
|
|
2195
2424
|
};
|
|
2196
|
-
export type BaasRegisterRequest = {
|
|
2197
|
-
name: string;
|
|
2198
|
-
services: BaasService[];
|
|
2199
|
-
environment?: Record<string, string>;
|
|
2200
|
-
limits?: {
|
|
2201
|
-
storage?: string;
|
|
2202
|
-
functions?: number;
|
|
2203
|
-
channels?: number;
|
|
2204
|
-
};
|
|
2205
|
-
};
|
|
2206
|
-
export type BaasRegisterResponse = {
|
|
2207
|
-
appId: string;
|
|
2208
|
-
name: string;
|
|
2209
|
-
status: DeployedAppStatus;
|
|
2210
|
-
services: string[];
|
|
2211
|
-
endpoints: BaasEndpoints;
|
|
2212
|
-
createdAt: string;
|
|
2213
|
-
};
|
|
2214
2425
|
export type BaasDocument = {
|
|
2215
2426
|
_id: string;
|
|
2216
2427
|
data: Record<string, unknown>;
|
|
@@ -2416,18 +2627,56 @@ export type BaasPublishResult = {
|
|
|
2416
2627
|
channel: string;
|
|
2417
2628
|
timestamp: string;
|
|
2418
2629
|
};
|
|
2419
|
-
export type
|
|
2630
|
+
export type BaasInitRequest = {
|
|
2420
2631
|
name: string;
|
|
2632
|
+
port: number;
|
|
2421
2633
|
services: BaasService[];
|
|
2422
|
-
|
|
2634
|
+
limits?: {
|
|
2635
|
+
cpu?: string;
|
|
2636
|
+
memory?: string;
|
|
2637
|
+
};
|
|
2423
2638
|
};
|
|
2424
|
-
export type
|
|
2639
|
+
export type BaasInitResponse = {
|
|
2425
2640
|
appId: string;
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2641
|
+
registry: {
|
|
2642
|
+
server: string;
|
|
2643
|
+
username: string;
|
|
2644
|
+
password: string;
|
|
2645
|
+
repository: string;
|
|
2646
|
+
};
|
|
2647
|
+
};
|
|
2648
|
+
export type BaasDeployRequest = {
|
|
2649
|
+
tag: string;
|
|
2650
|
+
replicas?: number;
|
|
2651
|
+
env?: Record<string, string>;
|
|
2652
|
+
resources?: {
|
|
2653
|
+
cpu?: string;
|
|
2654
|
+
memory?: string;
|
|
2655
|
+
};
|
|
2656
|
+
strategy?: "rolling" | "recreate";
|
|
2657
|
+
};
|
|
2658
|
+
export type BaasDeployResponse = {
|
|
2659
|
+
appId: string;
|
|
2660
|
+
status: string;
|
|
2661
|
+
url: string;
|
|
2662
|
+
};
|
|
2663
|
+
export type BaasUploadFrontendResponse = {
|
|
2664
|
+
bundleSha256: string;
|
|
2665
|
+
bundleSizeBytes: number;
|
|
2666
|
+
};
|
|
2667
|
+
export type BaasRollbackRequest = {
|
|
2668
|
+
toTag: string;
|
|
2669
|
+
};
|
|
2670
|
+
export type BaasRuntimeStatus = {
|
|
2671
|
+
appId: string;
|
|
2672
|
+
state: "PENDING_SUBSCRIPTION" | "ACTIVE" | "SUSPENDED" | "RETIRED";
|
|
2673
|
+
runtime?: {
|
|
2674
|
+
image: string;
|
|
2675
|
+
runtimeState: "NOT_DEPLOYED" | "DEPLOYING" | "RUNNING" | "FAILED" | "DEGRADED";
|
|
2676
|
+
replicas: number;
|
|
2677
|
+
lastReconciledAt?: string;
|
|
2678
|
+
lastError?: string;
|
|
2679
|
+
};
|
|
2431
2680
|
};
|
|
2432
2681
|
export type BaasAppListResponse = {
|
|
2433
2682
|
apps: DeployedAppInfo[];
|
|
@@ -2571,7 +2820,11 @@ export declare class MessagingClient {
|
|
|
2571
2820
|
export declare class DeploymentClient {
|
|
2572
2821
|
private readonly http;
|
|
2573
2822
|
constructor(http: HttpClient);
|
|
2574
|
-
|
|
2823
|
+
init(request: BaasInitRequest): Promise<BaasInitResponse>;
|
|
2824
|
+
uploadFrontend(appId: string, bundle: Blob | Buffer, filename?: string): Promise<BaasUploadFrontendResponse>;
|
|
2825
|
+
deploy(appId: string, request: BaasDeployRequest): Promise<BaasDeployResponse>;
|
|
2826
|
+
rollback(appId: string, request: BaasRollbackRequest): Promise<BaasDeployResponse>;
|
|
2827
|
+
status(appId: string): Promise<BaasRuntimeStatus>;
|
|
2575
2828
|
list(): Promise<BaasAppListResponse>;
|
|
2576
2829
|
get(appId: string): Promise<DeployedAppInfo>;
|
|
2577
2830
|
update(appId: string, updates: Partial<BaasDeployRequest>): Promise<DeployedAppInfo>;
|
|
@@ -2586,7 +2839,11 @@ export declare class DeploymentClient {
|
|
|
2586
2839
|
success: boolean;
|
|
2587
2840
|
status: string;
|
|
2588
2841
|
}>;
|
|
2589
|
-
getStats(): Promise<
|
|
2842
|
+
getStats(): Promise<{
|
|
2843
|
+
totalApps: number;
|
|
2844
|
+
activeApps: number;
|
|
2845
|
+
totalOwners: number;
|
|
2846
|
+
}>;
|
|
2590
2847
|
}
|
|
2591
2848
|
export type AgentStatus = "active" | "paused" | "revoked" | "pending";
|
|
2592
2849
|
export type AgentRegisterRequest = {
|
|
@@ -2711,6 +2968,55 @@ export declare class AgentsClient {
|
|
|
2711
2968
|
success: boolean;
|
|
2712
2969
|
}>;
|
|
2713
2970
|
}
|
|
2971
|
+
export type CustomerSessionChallenge = {
|
|
2972
|
+
challenge: string;
|
|
2973
|
+
};
|
|
2974
|
+
export type CustomerSessionVerifyRequest = {
|
|
2975
|
+
appId: string;
|
|
2976
|
+
chain: string;
|
|
2977
|
+
address: string;
|
|
2978
|
+
publicKey?: string;
|
|
2979
|
+
signature: string;
|
|
2980
|
+
challenge: string;
|
|
2981
|
+
};
|
|
2982
|
+
export type CustomerSessionToken = {
|
|
2983
|
+
token: string;
|
|
2984
|
+
sessionId: string;
|
|
2985
|
+
validatorId: string;
|
|
2986
|
+
expiresAt: string;
|
|
2987
|
+
sessionSecret: string;
|
|
2988
|
+
};
|
|
2989
|
+
export type CustomerSessionInfo = {
|
|
2990
|
+
sessionId: string;
|
|
2991
|
+
appId: string;
|
|
2992
|
+
customerChain: string;
|
|
2993
|
+
customerAddress: string;
|
|
2994
|
+
subscriptionContext?: {
|
|
2995
|
+
nftSerial: number;
|
|
2996
|
+
tier: "free_testnet" | "starter" | "professional" | "enterprise";
|
|
2997
|
+
expiresAt: string;
|
|
2998
|
+
allowedAutomations?: string[];
|
|
2999
|
+
};
|
|
3000
|
+
createdAt: string;
|
|
3001
|
+
expiresAt: string;
|
|
3002
|
+
lastActivityAt: string;
|
|
3003
|
+
};
|
|
3004
|
+
export declare class CustomerSessionClient {
|
|
3005
|
+
private readonly baseUrl;
|
|
3006
|
+
private readonly timeoutMs;
|
|
3007
|
+
constructor(baseUrl: string, timeoutMs?: number);
|
|
3008
|
+
challenge(input: {
|
|
3009
|
+
chain: string;
|
|
3010
|
+
address: string;
|
|
3011
|
+
}): Promise<CustomerSessionChallenge>;
|
|
3012
|
+
verify(req: CustomerSessionVerifyRequest): Promise<CustomerSessionToken>;
|
|
3013
|
+
validate(bearer: string): Promise<CustomerSessionInfo>;
|
|
3014
|
+
end(bearer: string): Promise<{
|
|
3015
|
+
revoked: boolean;
|
|
3016
|
+
sessionId: string;
|
|
3017
|
+
}>;
|
|
3018
|
+
private fetch;
|
|
3019
|
+
}
|
|
2714
3020
|
export type AuthenticateOptions = {
|
|
2715
3021
|
chain: BaasSupportedChain;
|
|
2716
3022
|
walletAddress: string;
|
|
@@ -2732,6 +3038,7 @@ export declare class BaasClient {
|
|
|
2732
3038
|
readonly messaging: MessagingClient;
|
|
2733
3039
|
readonly deployment: DeploymentClient;
|
|
2734
3040
|
readonly agents: AgentsClient;
|
|
3041
|
+
readonly customerSession: CustomerSessionClient;
|
|
2735
3042
|
constructor(config: BaasClientConfig);
|
|
2736
3043
|
setAppId(appId: string): void;
|
|
2737
3044
|
isAuthenticated(): boolean;
|
|
@@ -2744,7 +3051,6 @@ export declare class BaasClient {
|
|
|
2744
3051
|
authenticate(options: AuthenticateOptions): Promise<BaasAuthResult>;
|
|
2745
3052
|
validateSession(): Promise<BaasSessionInfo>;
|
|
2746
3053
|
logout(): Promise<void>;
|
|
2747
|
-
register(request: BaasRegisterRequest): Promise<BaasRegisterResponse>;
|
|
2748
3054
|
private requireAuth;
|
|
2749
3055
|
private getHeaders;
|
|
2750
3056
|
private post;
|
|
@@ -2776,10 +3082,10 @@ declare namespace stellar {
|
|
|
2776
3082
|
export { stroopsToXlm, validateStellarAddress, xlmToStroops };
|
|
2777
3083
|
}
|
|
2778
3084
|
declare namespace baas {
|
|
2779
|
-
export { AgentBalance, AgentEvent, AgentFundRequest, AgentInfo, AgentOperation, AgentRegisterRequest, AgentRules, AgentRulesValidationResult, AgentStatus, AgentTradeRequest, AgentWithdrawRequest, AgentsClient, AuthenticateOptions, BaasAppListResponse, BaasAuthConfig, BaasAuthResult, BaasChallengeRequest, BaasChallengeResponse, BaasChannelConfig, BaasClient, BaasClientConfig, BaasDeleteResult, BaasDeployRequest,
|
|
3085
|
+
export { AgentBalance, AgentEvent, AgentFundRequest, AgentInfo, AgentOperation, AgentRegisterRequest, AgentRules, AgentRulesValidationResult, AgentStatus, AgentTradeRequest, AgentWithdrawRequest, AgentsClient, AuthenticateOptions, BaasAppListResponse, BaasAuthConfig, BaasAuthResult, BaasChallengeRequest, BaasChallengeResponse, BaasChannelConfig, BaasClient, BaasClientConfig, BaasDeleteResult, BaasDeployRequest, BaasDeployResponse, BaasDocument, BaasEndpoints, BaasError, BaasErrorDetails, BaasErrorResponse, BaasFileInfo, BaasFileMetadata, BaasFindResult, BaasFunctionDeployRequest, BaasFunctionDeployResult, BaasFunctionInfo, BaasFunctionLog, BaasFunctionLogOptions, BaasFunctionResources, BaasFunctionResult, BaasFunctionRuntime, BaasHistoryOptions, BaasInitRequest, BaasInitResponse, BaasInsertResult, BaasMerkleProof, BaasMessage, BaasPresenceInfo, BaasPresenceMember, BaasPublishResult, BaasQueryOptions, BaasRollbackRequest, BaasRuntimeStatus, BaasService, BaasSessionInfo, BaasStateTransition, BaasStorageUsage, BaasSupportedChain, BaasTriggerType, BaasUpdateResult, BaasUploadFrontendResponse, BaasUploadResult, BaasVerifyRequest, ChannelSubscription, DatabaseClient, DatabaseStatsResponse, DbComparisonOperator, DbDocument, DbQuery, DeployedApp, DeployedAppInfo, DeployedAppLimits, DeployedAppStatus, DeployedAppUsage, DeploymentClient, DocumentProofResponse, FunctionsClient, MessageHandler, MessagingClient, StateRootResponse, StateTransitionsResponse, StorageClient, validateAgentRules };
|
|
2780
3086
|
}
|
|
2781
3087
|
declare namespace discovery {
|
|
2782
|
-
export { MIRROR_NODE_URLS, MirrorNodeClient, MirrorNodeConfig, MirrorNodeError, TopicMessage, TopicMessagesResponse, ValidatorDiscoveryClient, ValidatorDiscoveryConfig, ValidatorInfo, ValidatorMetadata, ValidatorNetworkEndpoints };
|
|
3088
|
+
export { ClusterDiscoveryClient, ClusterDiscoveryConfig, ClusterEndpointsView, ClusterInfo, MIRROR_NODE_URLS, MirrorNodeClient, MirrorNodeConfig, MirrorNodeError, TopicMessage, TopicMessagesResponse, ValidatorDiscoveryClient, ValidatorDiscoveryConfig, ValidatorInfo, ValidatorMetadata, ValidatorNetworkEndpoints };
|
|
2783
3089
|
}
|
|
2784
3090
|
declare namespace auth {
|
|
2785
3091
|
export { AuthChain, AuthenticateRequest, AuthenticateResponse, ChallengeResponse, SecurityConfig, SessionInfo, ValidatorAuthClient, ValidatorAuthConfig, ValidatorAuthError };
|
|
@@ -2793,6 +3099,12 @@ declare namespace subscription {
|
|
|
2793
3099
|
declare namespace settlement {
|
|
2794
3100
|
export { SettlementAsset, SettlementClient, SettlementHistoryEntry, SettlementInitiateRequest, SettlementPurpose, SettlementStatusResponse };
|
|
2795
3101
|
}
|
|
3102
|
+
declare namespace governance {
|
|
3103
|
+
export { GovernanceClient, GovernanceConfig, GovernanceProposalData, GovernanceProposalStatus, GovernanceSimulateRequest, GovernanceValidationContext, GovernanceValidationResult, GovernanceVoteType, GovernanceVotingPowerMethod };
|
|
3104
|
+
}
|
|
3105
|
+
declare namespace personhood {
|
|
3106
|
+
export { PERSONHOOD_VERIFIER_NOT_CONFIGURED, PersonhoodAttestationMethod, PersonhoodCert, PersonhoodClient, PersonhoodProof, PersonhoodVerifyParams, isPersonhoodVerifierNotConfigured };
|
|
3107
|
+
}
|
|
2796
3108
|
|
|
2797
3109
|
export {
|
|
2798
3110
|
RetryConfig as ResilienceRetryConfig,
|
|
@@ -2801,6 +3113,8 @@ export {
|
|
|
2801
3113
|
baas,
|
|
2802
3114
|
chains,
|
|
2803
3115
|
discovery,
|
|
3116
|
+
governance,
|
|
3117
|
+
personhood,
|
|
2804
3118
|
settlement,
|
|
2805
3119
|
subscription,
|
|
2806
3120
|
};
|