@hsuite/smart-engines-sdk 3.0.3 → 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.
@@ -683,6 +683,19 @@ export interface ValidatorInfo {
683
683
  registeredAt: string;
684
684
  messageType?: "validator.join" | "validator.leave" | "validator.update";
685
685
  }
686
+ export interface ClusterEndpointsView {
687
+ clusterId: string;
688
+ gatewayUrl: string;
689
+ harborUrl?: string;
690
+ natsUrl?: string;
691
+ publicIp?: string;
692
+ region?: string;
693
+ }
694
+ export interface ClusterInfo {
695
+ clusterId: string;
696
+ endpoints: ClusterEndpointsView;
697
+ nodeIds: string[];
698
+ }
686
699
  export type AuthChain = "hedera" | "xrpl" | "polkadot" | "stellar" | "solana";
687
700
  export interface AuthenticateResponse {
688
701
  token: string;
@@ -1211,6 +1224,43 @@ declare class SnapshotsClient {
1211
1224
  listByToken(tokenId: string, pagination?: PaginationOptions): Promise<SnapshotListResponse>;
1212
1225
  download(snapshotId: string, format?: SnapshotFormat): Promise<any>;
1213
1226
  }
1227
+ export type HistoricalBalanceChain = "hedera" | "xrpl" | "polkadot";
1228
+ export type HistoricalBalanceQueryParams = {
1229
+ chain: HistoricalBalanceChain;
1230
+ entityId: string;
1231
+ account: string;
1232
+ atTimestamp: number;
1233
+ };
1234
+ export type HistoricalBalanceResult = {
1235
+ chain: HistoricalBalanceChain;
1236
+ entityId: string;
1237
+ account: string;
1238
+ atTimestamp: number;
1239
+ balance: string;
1240
+ source: "archive";
1241
+ };
1242
+ export type HistoricalBalanceClientConfig = {
1243
+ baseUrl: string;
1244
+ authToken?: string;
1245
+ apiKey?: string;
1246
+ timeoutMs?: number;
1247
+ fetchImpl?: typeof fetch;
1248
+ };
1249
+ declare class HistoricalBalanceClient {
1250
+ private readonly baseUrl?;
1251
+ private readonly authToken?;
1252
+ private readonly apiKey?;
1253
+ private readonly timeoutMs;
1254
+ private readonly fetchImpl?;
1255
+ private readonly http?;
1256
+ constructor(config: HistoricalBalanceClientConfig | {
1257
+ http: HttpClient;
1258
+ });
1259
+ static fromHttp(http: HttpClient): HistoricalBalanceClient;
1260
+ getBalance(params: HistoricalBalanceQueryParams): Promise<HistoricalBalanceResult>;
1261
+ private validateParams;
1262
+ private standaloneFetch;
1263
+ }
1214
1264
  export type SettlementPurpose = "subscription" | "deposit" | "fee";
1215
1265
  export type SettlementAsset = {
1216
1266
  symbol: string;
@@ -1252,6 +1302,115 @@ declare class SettlementClient {
1252
1302
  confirmXrpLanded(settlementId: string): Promise<SettlementStatusResponse>;
1253
1303
  getHistory(entityId: string): Promise<SettlementHistoryEntry[]>;
1254
1304
  }
1305
+ export type GovernanceVotingPowerMethod = "token_balance" | "quadratic" | "one_person_one_vote" | "nft_based" | "time_weighted" | "delegated";
1306
+ export type GovernanceProposalStatus = "pending" | "active" | "passed" | "failed" | "executed" | "cancelled" | "expired" | "vetoed";
1307
+ export type GovernanceVoteType = "for" | "against" | "abstain";
1308
+ export interface GovernanceProposalData {
1309
+ proposalId: string;
1310
+ proposer: string;
1311
+ title: string;
1312
+ description: string;
1313
+ actions: unknown[];
1314
+ status: GovernanceProposalStatus;
1315
+ createdAt: string | Date;
1316
+ votingStartsAt: string | Date;
1317
+ votingEndsAt: string | Date;
1318
+ executionDeadline?: string | Date;
1319
+ votes: {
1320
+ for: string;
1321
+ against: string;
1322
+ abstain: string;
1323
+ totalVotingPower: string;
1324
+ };
1325
+ executionResult?: {
1326
+ success: boolean;
1327
+ transactionId?: string;
1328
+ error?: string;
1329
+ };
1330
+ }
1331
+ export interface GovernanceConfig {
1332
+ governanceTokenId: string;
1333
+ decimals?: number;
1334
+ votingPowerMethod?: GovernanceVotingPowerMethod;
1335
+ quorumPercent?: number;
1336
+ approvalThresholdPercent?: number;
1337
+ proposalThreshold: string;
1338
+ votingPeriodMs: number;
1339
+ timeLockMs?: number;
1340
+ maxExecutionDelayMs?: number;
1341
+ votingEligibility?: Record<string, unknown>;
1342
+ proposalEligibility?: Record<string, unknown>;
1343
+ allowDelegation?: boolean;
1344
+ allowVoteChange?: boolean;
1345
+ vetoCouncil?: string[];
1346
+ maxActiveProposalsPerAccount?: number;
1347
+ proposalCooldownMs?: number;
1348
+ wisdomWeightFn?: {
1349
+ registryKey: string;
1350
+ };
1351
+ delegation?: {
1352
+ maxHops?: number;
1353
+ decayPerHop?: number;
1354
+ concentrationAlert?: number;
1355
+ };
1356
+ description?: string;
1357
+ }
1358
+ export interface GovernanceValidationContext {
1359
+ chain?: string;
1360
+ network?: "mainnet" | "testnet";
1361
+ callerAccountId: string;
1362
+ timestamp?: string | Date;
1363
+ action: "create_proposal" | "cast_vote" | "execute_proposal" | "cancel_proposal" | "veto" | "delegate";
1364
+ proposal?: GovernanceProposalData;
1365
+ voteType?: GovernanceVoteType;
1366
+ tokenBalance?: string;
1367
+ votingPower?: string;
1368
+ lastProposalAt?: string | Date;
1369
+ activeProposalCount?: number;
1370
+ delegation?: {
1371
+ delegateTo?: string;
1372
+ delegatedPower?: string;
1373
+ };
1374
+ daoId?: string;
1375
+ totalDaoVotingPower?: string;
1376
+ }
1377
+ export interface GovernanceValidationResult {
1378
+ isValid: boolean;
1379
+ reason?: string;
1380
+ metadata?: Record<string, unknown>;
1381
+ validatedAt?: string;
1382
+ }
1383
+ export interface GovernanceSimulateRequest {
1384
+ config: GovernanceConfig;
1385
+ context: GovernanceValidationContext;
1386
+ }
1387
+ declare class GovernanceClient {
1388
+ private readonly http;
1389
+ constructor(http: HttpClient);
1390
+ simulate(params: GovernanceSimulateRequest): Promise<GovernanceValidationResult>;
1391
+ }
1392
+ export type PersonhoodAttestationMethod = "web-of-trust" | "biometric" | "pop-protocol";
1393
+ export interface PersonhoodProof {
1394
+ attestationMethod: PersonhoodAttestationMethod;
1395
+ payload: unknown;
1396
+ }
1397
+ export interface PersonhoodCert {
1398
+ address: string;
1399
+ issuerId: string;
1400
+ attestationMethod: PersonhoodAttestationMethod;
1401
+ issuedAt: number;
1402
+ expiresAt: number;
1403
+ signature: string;
1404
+ }
1405
+ export interface PersonhoodVerifyParams {
1406
+ candidate: string;
1407
+ proof: PersonhoodProof;
1408
+ }
1409
+ declare class PersonhoodClient {
1410
+ private readonly http;
1411
+ constructor(http: HttpClient);
1412
+ verify(params: PersonhoodVerifyParams): Promise<PersonhoodCert | null>;
1413
+ }
1255
1414
  export interface SmartEngineClientConfig {
1256
1415
  baseUrl: string;
1257
1416
  apiKey?: string;
@@ -1274,6 +1433,28 @@ export interface NetworkConnectionConfig {
1274
1433
  mirrorNodeUrl?: string;
1275
1434
  allowInsecure?: boolean;
1276
1435
  }
1436
+ export interface ClusterConnectionConfig {
1437
+ bootstrap: string[];
1438
+ chain: AuthChain;
1439
+ address: string;
1440
+ publicKey: string;
1441
+ signFn: (challenge: string) => string | Promise<string>;
1442
+ metadata?: {
1443
+ appId?: string;
1444
+ appName?: string;
1445
+ };
1446
+ trustAnchor?: {
1447
+ network: "mainnet" | "testnet" | "previewnet";
1448
+ registryTopicId: string;
1449
+ mirrorNodeUrl?: string;
1450
+ };
1451
+ allowInsecure?: boolean;
1452
+ }
1453
+ export interface ClusterConnectionResult {
1454
+ client: SmartEngineClient;
1455
+ cluster: ClusterInfo;
1456
+ session: AuthenticateResponse;
1457
+ }
1277
1458
  export interface NetworkConnectionResult {
1278
1459
  client: SmartEngineClient;
1279
1460
  validator: ValidatorInfo;
@@ -1290,9 +1471,13 @@ declare class SmartEngineClient {
1290
1471
  readonly ipfs: IPFSClient;
1291
1472
  readonly transactions: TransactionsClient;
1292
1473
  readonly snapshots: SnapshotsClient;
1474
+ readonly historicalBalance: HistoricalBalanceClient;
1293
1475
  readonly settlement: SettlementClient;
1476
+ readonly governance: GovernanceClient;
1477
+ readonly personhood: PersonhoodClient;
1294
1478
  constructor(config: SmartEngineClientConfig);
1295
1479
  static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
1480
+ static connectToCluster(config: ClusterConnectionConfig): Promise<ClusterConnectionResult>;
1296
1481
  getBaseUrl(): string;
1297
1482
  isAuthenticated(): boolean;
1298
1483
  getHttpHealth(): {
@@ -1706,7 +1891,7 @@ declare class SmartGatewayClient {
1706
1891
  getMetrics(refresh?: boolean): Promise<GatewayMetricsResponse>;
1707
1892
  getMetricsSummary(): Promise<GatewayMetricsSummaryResponse>;
1708
1893
  }
1709
- export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging" | "customer-session";
1894
+ export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging";
1710
1895
  export type BaasSupportedChain = "hedera" | "xrpl" | "polkadot" | "solana";
1711
1896
  export type BaasEndpoints = {
1712
1897
  auth: string;