@hsuite/smart-engines-sdk 3.6.1 → 3.10.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.8.0 — 2026-06-17
4
+
5
+ ### Added
6
+
7
+ - **`BaasClient` now exposes `transactions` (prepare/execute), validator-routed.** The host-routed `BaasClient` gains a `transactions` arm (`TransactionsClient`) so showcase/CLI consumers can drive the sovereignty prepare/execute flow without constructing a separate `SmartEngineClient`. It targets the validator's `/api/transactions/*` routes — a sibling of the `/host` BaaS surface, rooted at the raw gateway/ingress origin (`hostUrl`), NOT under the `pathPrefix`. The prepare endpoints accept an explicit `payerAccountId` (session-less payer) OR carry the web3-auth session token for the JWT-wallet payer path; the token is kept in lock-step with the main client's via `authenticate` / `reauthenticate` / `logout`.
8
+
3
9
  ## 3.6.1 — 2026-06-15
4
10
 
5
11
  ### Fixed
package/README.md CHANGED
@@ -54,7 +54,7 @@ await baas.authenticate({
54
54
  },
55
55
  });
56
56
 
57
- // 4. Initialise a free_testnet smart-app via the four-step deploy flow
57
+ // 4. Initialise a smart-app via the four-step deploy flow
58
58
  // (init → docker push → optional uploadFrontend → deploy). `init` runs
59
59
  // the per-entity DKG ceremony on the cluster and returns the DKG entityId
60
60
  // as `appId`, plus ephemeral push credentials for the cluster's per-tenant
package/dist/index.d.ts CHANGED
@@ -487,6 +487,30 @@ declare const TokenInfoSchema: z.ZodObject<{
487
487
  circulatingSupply?: string | undefined;
488
488
  }>;
489
489
  export type TokenInfo = z.infer<typeof TokenInfoSchema>;
490
+ declare const RuleRefSchema: z.ZodObject<{
491
+ chain: z.ZodEnum<[
492
+ "hedera",
493
+ "xrpl",
494
+ "polkadot",
495
+ "solana",
496
+ "stellar",
497
+ "ethereum",
498
+ "polygon",
499
+ "bitcoin",
500
+ "cardano"
501
+ ]>;
502
+ topicId: z.ZodString;
503
+ consensusTimestamp: z.ZodString;
504
+ }, "strip", z.ZodTypeAny, {
505
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
506
+ topicId: string;
507
+ consensusTimestamp: string;
508
+ }, {
509
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
510
+ topicId: string;
511
+ consensusTimestamp: string;
512
+ }>;
513
+ export type RuleRefInput = z.infer<typeof RuleRefSchema>;
490
514
  declare const CreateAccountRequestSchema: z.ZodObject<{
491
515
  chain: z.ZodEnum<[
492
516
  "hedera",
@@ -511,6 +535,30 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
511
535
  "full"
512
536
  ]>>;
513
537
  appOwnerPublicKey: z.ZodOptional<z.ZodString>;
538
+ ruleRef: z.ZodOptional<z.ZodObject<{
539
+ chain: z.ZodEnum<[
540
+ "hedera",
541
+ "xrpl",
542
+ "polkadot",
543
+ "solana",
544
+ "stellar",
545
+ "ethereum",
546
+ "polygon",
547
+ "bitcoin",
548
+ "cardano"
549
+ ]>;
550
+ topicId: z.ZodString;
551
+ consensusTimestamp: z.ZodString;
552
+ }, "strip", z.ZodTypeAny, {
553
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
554
+ topicId: string;
555
+ consensusTimestamp: string;
556
+ }, {
557
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
558
+ topicId: string;
559
+ consensusTimestamp: string;
560
+ }>>;
561
+ entityType: z.ZodOptional<z.ZodString>;
514
562
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
515
563
  }, "strip", z.ZodTypeAny, {
516
564
  chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
@@ -524,6 +572,12 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
524
572
  appOwnerPublicKey?: string | undefined;
525
573
  memo?: string | undefined;
526
574
  payerAccountId?: string | undefined;
575
+ ruleRef?: {
576
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
577
+ topicId: string;
578
+ consensusTimestamp: string;
579
+ } | undefined;
580
+ entityType?: string | undefined;
527
581
  }, {
528
582
  chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
529
583
  initialBalance: string;
@@ -536,6 +590,12 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
536
590
  memo?: string | undefined;
537
591
  payerAccountId?: string | undefined;
538
592
  immutable?: boolean | undefined;
593
+ ruleRef?: {
594
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
595
+ topicId: string;
596
+ consensusTimestamp: string;
597
+ } | undefined;
598
+ entityType?: string | undefined;
539
599
  }>;
540
600
  export type CreateAccountRequest = z.infer<typeof CreateAccountRequestSchema>;
541
601
  declare const CreateAccountResponseSchema: z.ZodObject<{
@@ -694,6 +754,30 @@ declare const CreateTokenRequestSchema: z.ZodObject<{
694
754
  validatorTopicId: z.ZodString;
695
755
  immutable: z.ZodDefault<z.ZodBoolean>;
696
756
  payerAccountId: z.ZodOptional<z.ZodString>;
757
+ ruleRef: z.ZodOptional<z.ZodObject<{
758
+ chain: z.ZodEnum<[
759
+ "hedera",
760
+ "xrpl",
761
+ "polkadot",
762
+ "solana",
763
+ "stellar",
764
+ "ethereum",
765
+ "polygon",
766
+ "bitcoin",
767
+ "cardano"
768
+ ]>;
769
+ topicId: z.ZodString;
770
+ consensusTimestamp: z.ZodString;
771
+ }, "strip", z.ZodTypeAny, {
772
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
773
+ topicId: string;
774
+ consensusTimestamp: string;
775
+ }, {
776
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
777
+ topicId: string;
778
+ consensusTimestamp: string;
779
+ }>>;
780
+ entityType: z.ZodOptional<z.ZodString>;
697
781
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
698
782
  }, "strip", z.ZodTypeAny, {
699
783
  symbol: string;
@@ -716,6 +800,12 @@ declare const CreateTokenRequestSchema: z.ZodObject<{
716
800
  initialSupply: string;
717
801
  metadata?: Record<string, any> | undefined;
718
802
  payerAccountId?: string | undefined;
803
+ ruleRef?: {
804
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
805
+ topicId: string;
806
+ consensusTimestamp: string;
807
+ } | undefined;
808
+ entityType?: string | undefined;
719
809
  treasury?: string | undefined;
720
810
  }, {
721
811
  symbol: string;
@@ -738,6 +828,12 @@ declare const CreateTokenRequestSchema: z.ZodObject<{
738
828
  metadata?: Record<string, any> | undefined;
739
829
  payerAccountId?: string | undefined;
740
830
  immutable?: boolean | undefined;
831
+ ruleRef?: {
832
+ chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
833
+ topicId: string;
834
+ consensusTimestamp: string;
835
+ } | undefined;
836
+ entityType?: string | undefined;
741
837
  treasury?: string | undefined;
742
838
  }>;
743
839
  export type CreateTokenRequest = z.infer<typeof CreateTokenRequestSchema>;
@@ -2068,7 +2164,7 @@ export type Web3Signer = {
2068
2164
  wallet: Wallet;
2069
2165
  };
2070
2166
  export declare function createXrplWeb3Signer(seed: string): Web3Signer;
2071
- export type SubscriptionTierName = "free_testnet" | "starter" | "professional" | "enterprise";
2167
+ export type SubscriptionTierName = "builder" | "growth" | "scale" | "enterprise";
2072
2168
  export type SubscriptionStatus = "pending_deposit" | "deposit_confirmed" | "active" | "expired" | "cancelled";
2073
2169
  export type DepositWalletStatus = "pending" | "locked" | "expired" | "slashed" | "released";
2074
2170
  export type SubscriptionTierInfo = {
@@ -2591,6 +2687,8 @@ export type PrepareTransferRequest = {
2591
2687
  securityMode?: SecurityMode;
2592
2688
  appOwnerPublicKey?: string;
2593
2689
  ss58Format?: number;
2690
+ ruleRef?: RuleRefInput;
2691
+ entityType?: string;
2594
2692
  };
2595
2693
  export type PrepareNftMintRequest = {
2596
2694
  chain: ChainType;
@@ -3818,6 +3916,22 @@ export declare class AgentsClient {
3818
3916
  success: boolean;
3819
3917
  }>;
3820
3918
  }
3919
+ export type BuildAttestation = {
3920
+ readonly version: "1";
3921
+ readonly appId: string;
3922
+ readonly developerWallet: string;
3923
+ readonly developerChain: ChainType;
3924
+ readonly framework: "ionic" | "nestjs";
3925
+ readonly sdkVersion: string;
3926
+ readonly imageDigest: string;
3927
+ readonly bundleSha256: string;
3928
+ readonly cliVersion: string;
3929
+ readonly builtAt: number;
3930
+ };
3931
+ export declare function canonicalizeAttestation(att: BuildAttestation): string;
3932
+ export declare function computeAttestationHash(att: BuildAttestation): string;
3933
+ export declare function signAttestation(att: BuildAttestation, xrplSeed: string): string;
3934
+ export declare function verifyAttestation(att: BuildAttestation, signature: string, walletAddress: string): boolean;
3821
3935
  export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging";
3822
3936
  export type BaasSupportedChain = "hedera" | "xrpl" | "polkadot" | "solana";
3823
3937
  export type BaasEndpoints = {
@@ -4135,6 +4249,7 @@ export type BaasInitResponse = {
4135
4249
  repository: string;
4136
4250
  };
4137
4251
  };
4252
+ export type BaasReissuePushCredentialsResponse = BaasInitResponse;
4138
4253
  export type BaasDeployRequest = {
4139
4254
  tag: string;
4140
4255
  port?: number;
@@ -4146,6 +4261,10 @@ export type BaasDeployRequest = {
4146
4261
  memory?: string;
4147
4262
  };
4148
4263
  strategy?: "rolling" | "recreate";
4264
+ attestation?: {
4265
+ payload: BuildAttestation;
4266
+ signature: string;
4267
+ };
4149
4268
  };
4150
4269
  export type BaasDeployResponse = {
4151
4270
  appId: string;
@@ -4201,6 +4320,8 @@ export declare class DeploymentClient {
4201
4320
  private readonly http;
4202
4321
  constructor(http: HttpClient);
4203
4322
  init(request: BaasInitRequest): Promise<BaasInitResponse>;
4323
+ pushCredentials(appId: string): Promise<BaasInitResponse>;
4324
+ reissuePushCredentials(appId: string): Promise<BaasReissuePushCredentialsResponse>;
4204
4325
  uploadFrontend(appId: string, bundle: Blob | Buffer, filename?: string): Promise<BaasUploadFrontendResponse>;
4205
4326
  deploy(appId: string, request: BaasDeployRequest): Promise<BaasDeployResponse>;
4206
4327
  rollback(appId: string, request: BaasRollbackRequest): Promise<BaasDeployResponse>;
@@ -5389,7 +5510,7 @@ export type CustomerSessionInfo = {
5389
5510
  customerAddress: string;
5390
5511
  subscriptionContext?: {
5391
5512
  nftSerial: number;
5392
- tier: "free_testnet" | "starter" | "professional" | "enterprise";
5513
+ tier: "builder" | "growth" | "scale" | "enterprise";
5393
5514
  expiresAt: string;
5394
5515
  allowedAutomations?: string[];
5395
5516
  };
@@ -25033,17 +25154,40 @@ type CreateTokenRequest$1 = {
25033
25154
  initialSupply?: string;
25034
25155
  ruleRef: RuleRef;
25035
25156
  memo?: string;
25157
+ securityMode?: EntitySecurityMode;
25158
+ payerAccountId?: string;
25159
+ fundWith?: FundWith;
25036
25160
  };
25161
+ export type EntitySecurityMode = "partial" | "full";
25162
+ export type PreparedEntityCreation = {
25163
+ entityId: string;
25164
+ chain: ChainType;
25165
+ address: string;
25166
+ reserveRequirement: string;
25167
+ prepared: PreparedTransaction[];
25168
+ };
25169
+ export type FundWith = (prepared: PreparedTransaction[], ctx: {
25170
+ address: string;
25171
+ reserveRequirement: string;
25172
+ }) => Promise<{
25173
+ signedFundingBlob?: string;
25174
+ } | void>;
25037
25175
  type CreateAccountRequest$1 = {
25038
25176
  chain: ChainType;
25039
25177
  ruleRef: RuleRef;
25040
25178
  initialBalance?: string;
25041
25179
  publicKey?: string;
25180
+ securityMode?: EntitySecurityMode;
25181
+ payerAccountId?: string;
25182
+ fundWith?: FundWith;
25042
25183
  };
25043
25184
  export type CreateTopicRequest = {
25044
25185
  chain: ChainType;
25045
25186
  ruleRef: RuleRef;
25046
25187
  memo?: string;
25188
+ securityMode?: EntitySecurityMode;
25189
+ payerAccountId?: string;
25190
+ fundWith?: FundWith;
25047
25191
  };
25048
25192
  export type CreateAgentRequest = {
25049
25193
  primaryChain: ChainType;
@@ -25103,8 +25247,34 @@ export type LaunchpadEntityResult = {
25103
25247
  export declare class EntitiesClient {
25104
25248
  private readonly http;
25105
25249
  constructor(http: HttpClient);
25250
+ private static readonly PAYER_FUNDED_TOKEN_CHAINS;
25251
+ prepareCreateToken(req: Omit<CreateTokenRequest$1, "fundWith">): Promise<PreparedEntityCreation>;
25252
+ executeCreateToken(req: {
25253
+ entityId: string;
25254
+ chain: ChainType;
25255
+ securityMode?: EntitySecurityMode;
25256
+ createTxId?: string;
25257
+ signedFundingBlob?: string;
25258
+ }): Promise<EntityCreationResult>;
25106
25259
  createToken(req: CreateTokenRequest$1): Promise<EntityCreationResult>;
25260
+ prepareCreateAccount(req: Omit<CreateAccountRequest$1, "fundWith">): Promise<PreparedEntityCreation>;
25261
+ executeCreateAccount(req: {
25262
+ entityId: string;
25263
+ chain: ChainType;
25264
+ securityMode?: EntitySecurityMode;
25265
+ signedFundingBlob?: string;
25266
+ createTxId?: string;
25267
+ }): Promise<EntityCreationResult>;
25268
+ private static readonly PAYER_FUNDED_CREATE_CHAINS;
25269
+ private static readonly FUNDING_BLOB_RELAY_CHAINS;
25107
25270
  createAccount(req: CreateAccountRequest$1): Promise<EntityCreationResult>;
25271
+ prepareCreateTopic(req: Omit<CreateTopicRequest, "fundWith">): Promise<PreparedEntityCreation>;
25272
+ executeCreateTopic(req: {
25273
+ entityId: string;
25274
+ chain: ChainType;
25275
+ createTxId: string;
25276
+ securityMode?: EntitySecurityMode;
25277
+ }): Promise<EntityCreationResult>;
25108
25278
  createTopic(req: CreateTopicRequest): Promise<EntityCreationResult>;
25109
25279
  createAgent(req: CreateAgentRequest): Promise<EntityCreationResult>;
25110
25280
  launchpad(req: LaunchpadEntityRequest): Promise<LaunchpadEntityResult>;
@@ -25143,6 +25313,7 @@ export declare class BaasClient {
25143
25313
  private readonly timeout;
25144
25314
  private readonly allowInsecure;
25145
25315
  private readonly http;
25316
+ private readonly txHttp;
25146
25317
  private lastHttpError?;
25147
25318
  private authContext?;
25148
25319
  readonly db: DatabaseClient;
@@ -25154,6 +25325,7 @@ export declare class BaasClient {
25154
25325
  readonly customerSession: CustomerSessionClient;
25155
25326
  readonly rules: RulesClient;
25156
25327
  readonly entities: EntitiesClient;
25328
+ readonly transactions: TransactionsClient;
25157
25329
  constructor(config: BaasClientConfig);
25158
25330
  static connectToCluster(config: BaasConnectToClusterConfig): Promise<BaasClient>;
25159
25331
  setAppId(appId: string): void;
@@ -25370,7 +25542,7 @@ declare namespace personhood {
25370
25542
  export { PERSONHOOD_VERIFIER_NOT_CONFIGURED, PersonhoodAttestationMethod, PersonhoodCert, PersonhoodClient, PersonhoodProof, PersonhoodVerifyParams, isPersonhoodVerifierNotConfigured };
25371
25543
  }
25372
25544
  declare namespace baas {
25373
- export { AgentBalance, AgentEvent, AgentFundRequest, AgentInfo, AgentOperation, AgentRegisterRequest, AgentRules, AgentRulesValidationResult, AgentStatus, AgentTradeRequest, AgentWithdrawRequest, AgentsClient, AuthenticateOptions, BaasAppListResponse, BaasAuthConfig, BaasAuthResult, BaasChallengeRequest, BaasChallengeResponse, BaasChannelConfig, BaasClient, BaasClientConfig, BaasConnectToClusterConfig, 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, BaasRevokeKekResponse, BaasRollbackRequest, BaasRotateKekResponse, BaasRuntimeStatus, BaasService, BaasSessionInfo, BaasSetWebhookResponse, BaasStateTransition, BaasStorageUsage, BaasSupportedChain, BaasTriggerType, BaasUpdateResult, BaasUploadFrontendResponse, BaasUploadResult, BaasVerifyRequest, ChannelSubscription, CreateAccountRequest$1 as BaasCreateAccountRequest, CreateAgentRequest, CreateTokenRequest$1 as CreateTokenRequest, CreateTopicRequest, DatabaseClient, DatabaseStatsResponse, DbComparisonOperator, DbDocument, DbQuery, DeployedApp, DeployedAppInfo, DeployedAppLimits, DeployedAppStatus, DeployedAppUsage, DeploymentClient, DeprecateRuleResponse, DocumentProofResponse, EntitiesClient, EntityCreationResult, EntityInfo, EntityType$1 as BaasEntityType, FunctionsClient, LaunchpadEntityRequest, LaunchpadEntityResult, ListEntitiesFilter, ListEntitiesResponse, ListRulesFilter, ListRulesResponse, MessageHandler, MessagingClient, PublishRuleResponse, RulesClient, SimulateRuleRequest, StateRootResponse, StateTransitionsResponse, StorageClient, ValidationResult, VersionHistoryResponse, validateAgentRules };
25545
+ export { AgentBalance, AgentEvent, AgentFundRequest, AgentInfo, AgentOperation, AgentRegisterRequest, AgentRules, AgentRulesValidationResult, AgentStatus, AgentTradeRequest, AgentWithdrawRequest, AgentsClient, AuthenticateOptions, BaasAppListResponse, BaasAuthConfig, BaasAuthResult, BaasChallengeRequest, BaasChallengeResponse, BaasChannelConfig, BaasClient, BaasClientConfig, BaasConnectToClusterConfig, 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, BaasReissuePushCredentialsResponse, BaasRevokeKekResponse, BaasRollbackRequest, BaasRotateKekResponse, BaasRuntimeStatus, BaasService, BaasSessionInfo, BaasSetWebhookResponse, BaasStateTransition, BaasStorageUsage, BaasSupportedChain, BaasTriggerType, BaasUpdateResult, BaasUploadFrontendResponse, BaasUploadResult, BaasVerifyRequest, ChannelSubscription, CreateAccountRequest$1 as BaasCreateAccountRequest, CreateAgentRequest, CreateTokenRequest$1 as CreateTokenRequest, CreateTopicRequest, DatabaseClient, DatabaseStatsResponse, DbComparisonOperator, DbDocument, DbQuery, DeployedApp, DeployedAppInfo, DeployedAppLimits, DeployedAppStatus, DeployedAppUsage, DeploymentClient, DeprecateRuleResponse, DocumentProofResponse, EntitiesClient, EntityCreationResult, EntityInfo, EntitySecurityMode, EntityType$1 as BaasEntityType, FunctionsClient, FundWith, LaunchpadEntityRequest, LaunchpadEntityResult, ListEntitiesFilter, ListEntitiesResponse, ListRulesFilter, ListRulesResponse, MessageHandler, MessagingClient, PreparedEntityCreation, PublishRuleResponse, RulesClient, SimulateRuleRequest, StateRootResponse, StateTransitionsResponse, StorageClient, ValidationResult, VersionHistoryResponse, validateAgentRules };
25374
25546
  }
25375
25547
  declare namespace pqcVerify {
25376
25548
  export { FetchRegistryOptions, PqcCertV1, PqcCertV1Schema, PqcCertV1Signer, ValidatorRegistrySnapshot, VerifyResult, fetchRegistrySnapshot, parsePqcCert, verifyPqcAttestation };