@hsuite/smart-engines-sdk 3.10.0 → 3.11.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/dist/index.d.ts CHANGED
@@ -1954,14 +1954,19 @@ export declare class ClusterDiscoveryClient {
1954
1954
  private verifyAgainstTrustAnchor;
1955
1955
  private pickRandomIndex;
1956
1956
  }
1957
+ export type HttpCallOptions = {
1958
+ customerToken?: string;
1959
+ headers?: Record<string, string>;
1960
+ };
1957
1961
  export type HttpClient = {
1958
- post<T = any>(path: string, body: unknown): Promise<T>;
1959
- get<T = any>(path: string): Promise<T>;
1960
- put<T = any>(path: string, body: unknown): Promise<T>;
1961
- patch<T = any>(path: string, body: unknown): Promise<T>;
1962
- delete<T = any>(path: string): Promise<T>;
1963
- getText(path: string): Promise<string>;
1964
- upload<T = any>(path: string, file: Blob | Buffer, filename: string, metadata?: Record<string, string>, fieldName?: string): Promise<T>;
1962
+ post<T = any>(path: string, body: unknown, opts?: HttpCallOptions): Promise<T>;
1963
+ get<T = any>(path: string, opts?: HttpCallOptions): Promise<T>;
1964
+ put<T = any>(path: string, body: unknown, opts?: HttpCallOptions): Promise<T>;
1965
+ patch<T = any>(path: string, body: unknown, opts?: HttpCallOptions): Promise<T>;
1966
+ delete<T = any>(path: string, opts?: HttpCallOptions): Promise<T>;
1967
+ getText(path: string, opts?: HttpCallOptions): Promise<string>;
1968
+ getBinary(path: string, opts?: HttpCallOptions): Promise<Uint8Array>;
1969
+ upload<T = any>(path: string, file: Blob | Buffer, filename: string, metadata?: Record<string, string>, fieldName?: string, opts?: HttpCallOptions): Promise<T>;
1965
1970
  setAuthToken(token: string | undefined): void;
1966
1971
  getAuthToken(): string | undefined;
1967
1972
  };
@@ -3874,45 +3879,66 @@ export type AgentWithdrawRequest = {
3874
3879
  amount: string;
3875
3880
  destination: string;
3876
3881
  };
3882
+ export type AgentExecuteRequest = {
3883
+ capability: string;
3884
+ chain?: string;
3885
+ params: Record<string, unknown>;
3886
+ };
3887
+ export type AgentExecuteStepResult = {
3888
+ kind: "onchain" | "offchain";
3889
+ status: string;
3890
+ transactionBytes?: string;
3891
+ ref?: string;
3892
+ detail?: Record<string, unknown>;
3893
+ };
3894
+ export type AgentExecuteResponse = {
3895
+ capability: string;
3896
+ steps: AgentExecuteStepResult[];
3897
+ awaitingApproval?: boolean;
3898
+ pendingOpId?: string;
3899
+ };
3877
3900
  export type AgentPreparedTransactionResponse = PreparedTransactionResponse & {
3878
3901
  success: true;
3879
3902
  };
3880
3903
  export declare class AgentsClient {
3881
3904
  private readonly http;
3882
3905
  constructor(http: HttpClient);
3883
- register(request: AgentRegisterRequest): Promise<AgentInfo>;
3884
- get(agentId: string): Promise<AgentInfo>;
3885
- list(): Promise<{
3906
+ register(request: AgentRegisterRequest, opts?: HttpCallOptions): Promise<AgentInfo>;
3907
+ get(agentId: string, opts?: HttpCallOptions): Promise<AgentInfo>;
3908
+ list(opts?: HttpCallOptions): Promise<{
3886
3909
  agents: AgentInfo[];
3887
3910
  total: number;
3888
3911
  }>;
3889
- fund(agentId: string, request: AgentFundRequest): Promise<AgentPreparedTransactionResponse>;
3890
- trade(agentId: string, request: AgentTradeRequest): Promise<AgentPreparedTransactionResponse>;
3891
- withdraw(agentId: string, request: AgentWithdrawRequest): Promise<AgentPreparedTransactionResponse>;
3892
- pause(agentId: string): Promise<{
3912
+ fund(agentId: string, request: AgentFundRequest, opts?: HttpCallOptions): Promise<AgentPreparedTransactionResponse>;
3913
+ trade(agentId: string, request: AgentTradeRequest, opts?: HttpCallOptions): Promise<AgentPreparedTransactionResponse>;
3914
+ withdraw(agentId: string, request: AgentWithdrawRequest, opts?: HttpCallOptions): Promise<AgentPreparedTransactionResponse>;
3915
+ execute(agentId: string, request: AgentExecuteRequest, opts?: HttpCallOptions): Promise<AgentExecuteResponse & {
3916
+ success: true;
3917
+ }>;
3918
+ pause(agentId: string, opts?: HttpCallOptions): Promise<{
3893
3919
  success: boolean;
3894
3920
  status: string;
3895
3921
  }>;
3896
- resume(agentId: string): Promise<{
3922
+ resume(agentId: string, opts?: HttpCallOptions): Promise<{
3897
3923
  success: boolean;
3898
3924
  status: string;
3899
3925
  }>;
3900
- revoke(agentId: string): Promise<{
3926
+ revoke(agentId: string, opts?: HttpCallOptions): Promise<{
3901
3927
  success: boolean;
3902
3928
  status: string;
3903
3929
  }>;
3904
- updateRules(agentId: string, rules: Partial<AgentRules>): Promise<AgentInfo>;
3905
- getEvents(agentId: string): Promise<{
3930
+ updateRules(agentId: string, rules: Partial<AgentRules>, opts?: HttpCallOptions): Promise<AgentInfo>;
3931
+ getEvents(agentId: string, opts?: HttpCallOptions): Promise<{
3906
3932
  events: AgentEvent[];
3907
3933
  total: number;
3908
3934
  }>;
3909
- getBalances(agentId: string): Promise<{
3935
+ getBalances(agentId: string, opts?: HttpCallOptions): Promise<{
3910
3936
  balances: AgentBalance[];
3911
3937
  }>;
3912
- approve(agentId: string, operationId: string): Promise<{
3938
+ approve(agentId: string, operationId: string, opts?: HttpCallOptions): Promise<{
3913
3939
  success: boolean;
3914
3940
  }>;
3915
- reject(agentId: string, operationId: string): Promise<{
3941
+ reject(agentId: string, operationId: string, opts?: HttpCallOptions): Promise<{
3916
3942
  success: boolean;
3917
3943
  }>;
3918
3944
  }
@@ -4128,6 +4154,13 @@ export type BaasFunctionResources = {
4128
4154
  timeout: number;
4129
4155
  maxConcurrency?: number;
4130
4156
  };
4157
+ export type BaasSignedCode = {
4158
+ code: string;
4159
+ signature: string;
4160
+ publicKey: string;
4161
+ timestamp: string;
4162
+ hash: string;
4163
+ };
4131
4164
  export type BaasFunctionDeployRequest = {
4132
4165
  name: string;
4133
4166
  description?: string;
@@ -4141,6 +4174,15 @@ export type BaasFunctionDeployRequest = {
4141
4174
  }>;
4142
4175
  resources?: Partial<BaasFunctionResources>;
4143
4176
  environment?: Record<string, string>;
4177
+ signedCode?: BaasSignedCode;
4178
+ };
4179
+ export type BaasFunctionEvalRequest = {
4180
+ name?: string;
4181
+ code: string;
4182
+ runtime?: BaasFunctionRuntime;
4183
+ resources?: Partial<BaasFunctionResources>;
4184
+ input?: Record<string, unknown>;
4185
+ signedCode?: BaasSignedCode;
4144
4186
  };
4145
4187
  export type BaasFunctionDeployResult = {
4146
4188
  functionId: string;
@@ -5410,21 +5452,21 @@ export declare class StorageClient {
5410
5452
  private readonly http;
5411
5453
  private readonly getAppId;
5412
5454
  constructor(http: HttpClient, getAppId: () => string);
5413
- upload(file: Blob | Buffer, filename: string, metadata?: Record<string, string>): Promise<BaasUploadResult>;
5414
- download(cid: string): Promise<any>;
5415
- getMetadata(cid: string): Promise<BaasFileMetadata>;
5416
- delete(cid: string): Promise<{
5455
+ upload(file: Blob | Buffer, filename: string, metadata?: Record<string, string>, opts?: HttpCallOptions): Promise<BaasUploadResult>;
5456
+ download(cid: string, opts?: HttpCallOptions): Promise<Uint8Array>;
5457
+ getMetadata(cid: string, opts?: HttpCallOptions): Promise<BaasFileMetadata>;
5458
+ delete(cid: string, opts?: HttpCallOptions): Promise<{
5417
5459
  success: boolean;
5418
5460
  }>;
5419
5461
  listFiles(pagination?: {
5420
5462
  limit?: number;
5421
5463
  offset?: number;
5422
- }): Promise<{
5464
+ }, opts?: HttpCallOptions): Promise<{
5423
5465
  files: BaasFileInfo[];
5424
5466
  total: number;
5425
5467
  }>;
5426
- getUsage(): Promise<BaasStorageUsage>;
5427
- exists(cid: string): Promise<{
5468
+ getUsage(opts?: HttpCallOptions): Promise<BaasStorageUsage>;
5469
+ exists(cid: string, opts?: HttpCallOptions): Promise<{
5428
5470
  exists: boolean;
5429
5471
  cid: string;
5430
5472
  }>;
@@ -5433,57 +5475,59 @@ export declare class FunctionsClient {
5433
5475
  private readonly http;
5434
5476
  private readonly getAppId;
5435
5477
  constructor(http: HttpClient, getAppId: () => string);
5436
- deploy(request: BaasFunctionDeployRequest): Promise<BaasFunctionDeployResult>;
5437
- invoke(functionId: string, payload?: unknown): Promise<BaasFunctionResult>;
5438
- list(): Promise<{
5478
+ signCode(code: string): Promise<BaasSignedCode>;
5479
+ deploy(request: BaasFunctionDeployRequest, opts?: HttpCallOptions): Promise<BaasFunctionDeployResult>;
5480
+ invoke(functionId: string, payload?: unknown, opts?: HttpCallOptions): Promise<BaasFunctionResult>;
5481
+ eval(request: BaasFunctionEvalRequest, opts?: HttpCallOptions): Promise<BaasFunctionResult>;
5482
+ list(opts?: HttpCallOptions): Promise<{
5439
5483
  functions: BaasFunctionInfo[];
5440
5484
  total: number;
5441
5485
  }>;
5442
- get(functionId: string): Promise<BaasFunctionInfo>;
5443
- update(functionId: string, updates: Partial<BaasFunctionDeployRequest>): Promise<BaasFunctionInfo>;
5444
- delete(functionId: string): Promise<{
5486
+ get(functionId: string, opts?: HttpCallOptions): Promise<BaasFunctionInfo>;
5487
+ update(functionId: string, updates: Partial<BaasFunctionDeployRequest>, opts?: HttpCallOptions): Promise<BaasFunctionInfo>;
5488
+ delete(functionId: string, opts?: HttpCallOptions): Promise<{
5445
5489
  success: boolean;
5446
5490
  }>;
5447
- getLogs(functionId: string, options?: BaasFunctionLogOptions): Promise<{
5491
+ getLogs(functionId: string, options?: BaasFunctionLogOptions, opts?: HttpCallOptions): Promise<{
5448
5492
  logs: BaasFunctionLog[];
5449
5493
  total: number;
5450
5494
  }>;
5451
- getStats(): Promise<any>;
5495
+ getStats(opts?: HttpCallOptions): Promise<any>;
5452
5496
  }
5453
5497
  export declare class MessagingClient {
5454
5498
  private readonly http;
5455
5499
  private readonly getAppId;
5456
5500
  constructor(http: HttpClient, getAppId: () => string);
5457
- createChannel(config: BaasChannelConfig): Promise<BaasChannelConfig & {
5501
+ createChannel(config: BaasChannelConfig, opts?: HttpCallOptions): Promise<BaasChannelConfig & {
5458
5502
  channelId: string;
5459
5503
  }>;
5460
- deleteChannel(channelId: string): Promise<{
5504
+ deleteChannel(channelId: string, opts?: HttpCallOptions): Promise<{
5461
5505
  success: boolean;
5462
5506
  }>;
5463
- getChannel(channelId: string): Promise<BaasChannelConfig & {
5507
+ getChannel(channelId: string, opts?: HttpCallOptions): Promise<BaasChannelConfig & {
5464
5508
  channelId: string;
5465
5509
  messageCount: number;
5466
5510
  }>;
5467
- listChannels(): Promise<{
5511
+ listChannels(opts?: HttpCallOptions): Promise<{
5468
5512
  channels: Array<BaasChannelConfig & {
5469
5513
  channelId: string;
5470
5514
  }>;
5471
5515
  total: number;
5472
5516
  }>;
5473
- publish(channel: string, message: Record<string, unknown>, metadata?: Record<string, unknown>): Promise<BaasPublishResult>;
5474
- getHistory(channel: string, options?: BaasHistoryOptions): Promise<{
5517
+ publish(channel: string, message: Record<string, unknown>, metadata?: Record<string, unknown>, opts?: HttpCallOptions): Promise<BaasPublishResult>;
5518
+ getHistory(channel: string, options?: BaasHistoryOptions, opts?: HttpCallOptions): Promise<{
5475
5519
  messages: BaasMessage[];
5476
5520
  total: number;
5477
5521
  hasMore: boolean;
5478
5522
  }>;
5479
- setPresence(channel: string, member: BaasPresenceMember): Promise<{
5523
+ setPresence(channel: string, member: BaasPresenceMember, opts?: HttpCallOptions): Promise<{
5480
5524
  success: boolean;
5481
5525
  }>;
5482
- removePresence(channel: string, clientId: string): Promise<{
5526
+ removePresence(channel: string, clientId: string, opts?: HttpCallOptions): Promise<{
5483
5527
  success: boolean;
5484
5528
  }>;
5485
- getPresence(channel: string): Promise<BaasPresenceInfo>;
5486
- getStats(): Promise<any>;
5529
+ getPresence(channel: string, opts?: HttpCallOptions): Promise<BaasPresenceInfo>;
5530
+ getStats(opts?: HttpCallOptions): Promise<any>;
5487
5531
  }
5488
5532
  export type CustomerSessionChallenge = {
5489
5533
  challenge: string;
@@ -25542,7 +25586,7 @@ declare namespace personhood {
25542
25586
  export { PERSONHOOD_VERIFIER_NOT_CONFIGURED, PersonhoodAttestationMethod, PersonhoodCert, PersonhoodClient, PersonhoodProof, PersonhoodVerifyParams, isPersonhoodVerifierNotConfigured };
25543
25587
  }
25544
25588
  declare namespace baas {
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 };
25589
+ 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, BaasFunctionEvalRequest, BaasFunctionInfo, BaasFunctionLog, BaasFunctionLogOptions, BaasFunctionResources, BaasFunctionResult, BaasFunctionRuntime, BaasHistoryOptions, BaasInitRequest, BaasInitResponse, BaasInsertResult, BaasMerkleProof, BaasMessage, BaasPresenceInfo, BaasPresenceMember, BaasPublishResult, BaasQueryOptions, BaasReissuePushCredentialsResponse, BaasRevokeKekResponse, BaasRollbackRequest, BaasRotateKekResponse, BaasRuntimeStatus, BaasService, BaasSessionInfo, BaasSetWebhookResponse, BaasSignedCode, 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 };
25546
25590
  }
25547
25591
  declare namespace pqcVerify {
25548
25592
  export { FetchRegistryOptions, PqcCertV1, PqcCertV1Schema, PqcCertV1Signer, ValidatorRegistrySnapshot, VerifyResult, fetchRegistrySnapshot, parsePqcCert, verifyPqcAttestation };