@hsuite/smart-engines-sdk 4.2.0 → 5.0.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.
@@ -365,7 +365,7 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
365
365
  } | undefined;
366
366
  entityType?: string | undefined;
367
367
  }>;
368
- export type CreateAccountRequest = z.infer<typeof CreateAccountRequestSchema>;
368
+ export type ValidatorCreateAccountRequest = z.infer<typeof CreateAccountRequestSchema>;
369
369
  declare const CreateAccountResponseSchema: z.ZodObject<{
370
370
  accountId: z.ZodString;
371
371
  publicKey: z.ZodOptional<z.ZodString>;
@@ -604,7 +604,7 @@ declare const CreateTokenRequestSchema: z.ZodObject<{
604
604
  entityType?: string | undefined;
605
605
  treasury?: string | undefined;
606
606
  }>;
607
- export type CreateTokenRequest = z.infer<typeof CreateTokenRequestSchema>;
607
+ export type ValidatorCreateTokenRequest = z.infer<typeof CreateTokenRequestSchema>;
608
608
  declare const CreateTokenResponseSchema: z.ZodObject<{
609
609
  tokenId: z.ZodString;
610
610
  transactionId: z.ZodString;
@@ -3334,531 +3334,489 @@ declare class PersonhoodClient {
3334
3334
  constructor(http: HttpClient);
3335
3335
  verify(params: PersonhoodVerifyParams): Promise<PersonhoodCert | null>;
3336
3336
  }
3337
- export type AgentStatus = "active" | "paused" | "revoked" | "pending";
3338
- export type AgentRegisterRequest = {
3339
- name: string;
3340
- description?: string;
3341
- capabilities: string[];
3342
- rules: AgentRules;
3343
- primaryChain?: string;
3344
- fundingConfig?: {
3345
- chain: string;
3346
- maxAmount: string;
3347
- autoFund: boolean;
3348
- };
3349
- };
3350
- export type AgentRules = {
3351
- maxTradeAmount?: string;
3352
- allowedPairs?: string[];
3353
- allowedChains?: string[];
3354
- dailyLimit?: string;
3355
- requireApprovalAbove?: string;
3356
- customRules?: Record<string, unknown>;
3357
- };
3358
- export type AgentInfo = {
3359
- agentId: string;
3360
- name: string;
3361
- description?: string;
3362
- status: AgentStatus;
3363
- capabilities: string[];
3364
- rules: AgentRules;
3365
- owner: string;
3366
- createdAt: string;
3367
- lastActiveAt?: string;
3368
- agentWallet?: string;
3369
- treasuryAccount?: string;
3370
- entityId?: string;
3371
- };
3372
- export type AgentCertification = {
3373
- agentId: string;
3374
- entityId?: string;
3375
- ownerWallet?: string;
3376
- status?: string;
3377
- agentWallet?: string;
3378
- treasuryAccount?: string;
3379
- primaryChain?: string;
3380
- rulesHash?: string;
3381
- ruleRef?: string;
3382
- blsGroupPublicKey?: string;
3383
- stateHistoryTopicId?: string;
3384
- recentEvents: Array<{
3385
- agentId: string;
3386
- type: string;
3387
- payload: Record<string, unknown>;
3388
- timestamp: string;
3389
- }>;
3390
- recentTxIds: string[];
3391
- };
3392
- export type AgentEvent = {
3393
- eventId: string;
3394
- agentId: string;
3395
- type: string;
3396
- data: Record<string, unknown>;
3337
+ export type GatewayHealthResponse = {
3338
+ status: "ok";
3397
3339
  timestamp: string;
3340
+ uptime: number;
3341
+ version: string;
3342
+ gatewayId: string;
3398
3343
  };
3399
- export type AgentBalance = {
3400
- chain: string;
3401
- accountId: string;
3402
- balance: string;
3403
- symbol: string;
3404
- };
3405
- export type AgentFundRequest = {
3406
- chain: string;
3407
- amount: string;
3408
- source?: string;
3409
- };
3410
- export type AgentTradeRequest = {
3411
- chain: string;
3412
- pair: string;
3413
- side: "buy" | "sell";
3414
- amount: string;
3415
- price?: string;
3416
- };
3417
- export type AgentWithdrawRequest = {
3418
- chain: string;
3419
- amount: string;
3420
- destination: string;
3421
- };
3422
- export type AgentExecuteRequest = {
3423
- capability: string;
3424
- chain?: string;
3425
- params: Record<string, unknown>;
3426
- };
3427
- export type AgentExecuteStepResult = {
3428
- kind: "onchain" | "offchain" | "function";
3344
+ export type GatewayStatusResponse = {
3429
3345
  status: string;
3430
- transactionBytes?: string;
3431
- ref?: string;
3432
- detail?: Record<string, unknown>;
3433
- };
3434
- export type AgentExecuteResponse = {
3435
- capability: string;
3436
- steps: AgentExecuteStepResult[];
3437
- awaitingApproval?: boolean;
3438
- pendingOpId?: string;
3439
- };
3440
- export type AgentPreparedTransactionResponse = PreparedTransactionResponse & {
3441
- success: true;
3442
- };
3443
- export type AgentPendingApprovalResponse = {
3444
- success: true;
3445
- pendingOpId: string;
3446
- agentId: string;
3447
- action: string;
3448
- status: "awaiting_approval";
3449
- description: string;
3450
- };
3451
- declare class AgentsClient {
3452
- private readonly http;
3453
- constructor(http: HttpClient);
3454
- register(request: AgentRegisterRequest, opts?: HttpCallOptions): Promise<AgentInfo>;
3455
- get(agentId: string, opts?: HttpCallOptions): Promise<AgentInfo>;
3456
- list(opts?: HttpCallOptions): Promise<{
3457
- agents: AgentInfo[];
3458
- total: number;
3459
- }>;
3460
- fund(agentId: string, request: AgentFundRequest, opts?: HttpCallOptions): Promise<AgentPreparedTransactionResponse | AgentPendingApprovalResponse>;
3461
- trade(agentId: string, request: AgentTradeRequest, opts?: HttpCallOptions): Promise<AgentPreparedTransactionResponse>;
3462
- withdraw(agentId: string, request: AgentWithdrawRequest, opts?: HttpCallOptions): Promise<AgentPreparedTransactionResponse>;
3463
- execute(agentId: string, request: AgentExecuteRequest, opts?: HttpCallOptions): Promise<AgentExecuteResponse & {
3464
- success: true;
3465
- }>;
3466
- pause(agentId: string, opts?: HttpCallOptions): Promise<{
3467
- success: boolean;
3468
- status: string;
3469
- }>;
3470
- resume(agentId: string, opts?: HttpCallOptions): Promise<{
3471
- success: boolean;
3472
- status: string;
3473
- }>;
3474
- revoke(agentId: string, opts?: HttpCallOptions): Promise<{
3475
- success: boolean;
3476
- status: string;
3477
- }>;
3478
- certification(agentId: string, opts?: HttpCallOptions): Promise<AgentCertification>;
3479
- updateRules(agentId: string, rules: Partial<AgentRules>, opts?: HttpCallOptions): Promise<AgentInfo>;
3480
- getEvents(agentId: string, opts?: HttpCallOptions): Promise<{
3481
- events: AgentEvent[];
3482
- total: number;
3483
- }>;
3484
- getBalances(agentId: string, opts?: HttpCallOptions): Promise<{
3485
- balances: AgentBalance[];
3486
- }>;
3487
- approve(agentId: string, operationId: string, opts?: HttpCallOptions): Promise<{
3488
- success: boolean;
3489
- }>;
3490
- reject(agentId: string, operationId: string, opts?: HttpCallOptions): Promise<{
3491
- success: boolean;
3492
- }>;
3493
- }
3494
- export type BuildAttestation = {
3495
- readonly version: "1";
3496
- readonly appId: string;
3497
- readonly developerWallet: string;
3498
- readonly developerChain: ChainType;
3499
- readonly framework: "ionic" | "nestjs";
3500
- readonly sdkVersion: string;
3501
- readonly imageDigest: string;
3502
- readonly bundleSha256: string;
3503
- readonly cliVersion: string;
3504
- readonly builtAt: number;
3505
- };
3506
- export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging";
3507
- export type BaasSupportedChain = "hedera" | "xrpl" | "polkadot" | "solana";
3508
- export type BaasEndpoints = {
3509
- auth: string;
3510
- database: string;
3511
- storage: string;
3512
- functions: string;
3513
- messaging: string;
3514
- };
3515
- export type DeployedAppInfo = {
3516
- appId: string;
3517
- name: string;
3518
- status: "active" | "inactive" | "deploying" | "error";
3519
- services: string[];
3520
- endpoints: BaasEndpoints;
3521
- createdAt: string;
3522
- };
3523
- export type BaasAuthConfig = {
3524
- chain: BaasSupportedChain;
3525
- walletAddress: string;
3526
- publicKey: string;
3527
- signFn: (message: string) => string | Promise<string>;
3528
- };
3529
- export type BaasClientConfig = {
3530
- hostUrl: string;
3531
- appId?: string;
3532
- appName?: string;
3533
- auth?: BaasAuthConfig;
3534
- services?: BaasService[];
3535
- timeout?: number;
3536
- allowInsecure?: boolean;
3537
- pathPrefix?: string;
3346
+ timestamp: string;
3347
+ uptime: number;
3348
+ gatewayId: string;
3349
+ version: string;
3350
+ mode: {
3351
+ strictVerification: boolean;
3352
+ dnssecEnabled: boolean;
3353
+ routingStrategy: string;
3354
+ };
3355
+ subsystems: {
3356
+ dns: {
3357
+ status: string;
3358
+ cacheEnabled: boolean;
3359
+ cacheSize: number;
3360
+ maxCacheSize: number;
3361
+ cacheUtilization: number;
3362
+ };
3363
+ routing: {
3364
+ status: string;
3365
+ strategy: string;
3366
+ totalHosts: number;
3367
+ verifiedHosts: number;
3368
+ healthyHosts: number;
3369
+ };
3370
+ verification: {
3371
+ status: string;
3372
+ [key: string]: unknown;
3373
+ };
3374
+ };
3538
3375
  };
3539
- export type BaasAuthResult = {
3540
- authenticated?: boolean;
3541
- walletAddress: string;
3542
- chain: BaasSupportedChain;
3543
- appId: string;
3544
- token: string;
3545
- expiresAt: number;
3376
+ export type GatewayReadinessResponse = {
3377
+ status: "ready";
3378
+ timestamp: string;
3379
+ verifiedHostsCount: number;
3380
+ } | {
3381
+ status: "not_ready";
3382
+ timestamp: string;
3383
+ reason: string;
3546
3384
  };
3547
- export type BaasSessionInfo = {
3548
- valid: boolean;
3549
- walletAddress?: string;
3550
- chain?: BaasSupportedChain;
3551
- appId?: string;
3552
- permissions?: string[];
3553
- sessionId?: string;
3554
- expiresAt?: number;
3555
- error?: string;
3385
+ export type GatewayLivenessResponse = {
3386
+ status: "alive";
3387
+ timestamp: string;
3388
+ uptime: number;
3556
3389
  };
3557
- export type BaasDocument = {
3558
- _id: string;
3559
- data: Record<string, unknown>;
3560
- createdAt: number;
3561
- updatedAt: number;
3562
- version: number;
3390
+ export type GatewayMetricsResponse = {
3391
+ timestamp: string;
3392
+ network: {
3393
+ status: "operational" | "degraded" | "down";
3394
+ totalClusters: number;
3395
+ healthyClusters: number;
3396
+ totalValidators: number;
3397
+ activeValidators: number;
3398
+ };
3399
+ gateway: {
3400
+ version: string;
3401
+ uptimeSeconds: number;
3402
+ totalHosts: number;
3403
+ verifiedHosts: number;
3404
+ healthyHosts: number;
3405
+ };
3406
+ chains: {
3407
+ hedera: {
3408
+ connectedNodes: number;
3409
+ totalNodes: number;
3410
+ network: string | null;
3411
+ };
3412
+ xrpl: {
3413
+ connectedNodes: number;
3414
+ totalNodes: number;
3415
+ network: string | null;
3416
+ };
3417
+ };
3418
+ genesis: {
3419
+ status: "pending" | "in_progress" | "completed" | "unknown";
3420
+ completedClusters: number;
3421
+ totalClusters: number;
3422
+ };
3423
+ clusters: ClusterHealth[];
3424
+ cacheTtlSeconds: number;
3425
+ gossipDiscovery?: {
3426
+ enabled: boolean;
3427
+ [key: string]: unknown;
3428
+ };
3563
3429
  };
3564
- export type BaasStateTransition = {
3565
- transitionId: string;
3566
- operation: "insert" | "update" | "delete";
3567
- collection: string;
3568
- documentId: string;
3569
- previousHash: string;
3570
- newHash: string;
3571
- stateRoot: string;
3572
- timestamp: number;
3573
- proof: BaasMerkleProof;
3430
+ export type ClusterHealth = {
3431
+ clusterId: string;
3432
+ clusterName: string;
3433
+ status: "healthy" | "degraded" | "unhealthy" | "unreachable";
3434
+ gateway: {
3435
+ status: "up" | "down";
3436
+ uptimeSeconds: number;
3437
+ };
3438
+ validator: {
3439
+ status: "up" | "down" | "unknown";
3440
+ responseTimeMs: number | null;
3441
+ version: string | null;
3442
+ };
3443
+ host: {
3444
+ status: "up" | "down" | "unknown";
3445
+ responseTimeMs: number | null;
3446
+ };
3447
+ chains: {
3448
+ hedera: {
3449
+ connected: boolean;
3450
+ network: string | null;
3451
+ };
3452
+ xrpl: {
3453
+ connected: boolean;
3454
+ network: string | null;
3455
+ };
3456
+ };
3457
+ genesis: {
3458
+ status: "pending" | "in_progress" | "completed" | "failed" | "unknown";
3459
+ completedChains: string[];
3460
+ };
3461
+ lastChecked: string;
3574
3462
  };
3575
- export type BaasMerkleProof = {
3576
- root: string;
3577
- leaf: string;
3578
- siblings: string[];
3579
- path: ("left" | "right")[];
3463
+ export type GatewayMetricsSummaryResponse = {
3464
+ timestamp: string;
3465
+ status: "operational" | "degraded" | "down";
3466
+ clusters: string;
3467
+ validators: string;
3468
+ hedera: "connected" | "disconnected";
3469
+ xrpl: "connected" | "disconnected";
3470
+ genesis: "pending" | "in_progress" | "completed" | "unknown";
3471
+ version: string;
3580
3472
  };
3581
- export type BaasInsertResult = {
3582
- document: BaasDocument;
3583
- stateTransition: BaasStateTransition;
3473
+ export type ClusterHealthAggregate = {
3474
+ clusterId: string;
3475
+ gateway: {
3476
+ status: "up";
3477
+ uptimeSeconds: number;
3478
+ version: string;
3479
+ gatewayId: string;
3480
+ };
3481
+ validator: {
3482
+ status: "up" | "down";
3483
+ version: string | null;
3484
+ chains: Array<{
3485
+ chain: string;
3486
+ connected: boolean;
3487
+ network?: string;
3488
+ latency?: number;
3489
+ }>;
3490
+ };
3491
+ host: {
3492
+ status: "up" | "down";
3493
+ };
3494
+ genesis: {
3495
+ bootstrap?: {
3496
+ state?: string;
3497
+ };
3498
+ multiChain?: {
3499
+ overall?: string;
3500
+ implementedChains?: {
3501
+ completed?: number;
3502
+ };
3503
+ queueSummary?: unknown;
3504
+ };
3505
+ };
3506
+ lastChecked: string;
3584
3507
  };
3585
- export type BaasUpdateResult = {
3586
- document: BaasDocument;
3587
- stateTransition: BaasStateTransition;
3508
+ export type RegisterHostRequest = {
3509
+ appId: string;
3510
+ address: string;
3511
+ port: number;
3512
+ weight?: number;
3513
+ region?: string;
3514
+ metadata?: Record<string, string>;
3588
3515
  };
3589
- export type BaasDeleteResult = {
3590
- deleted: boolean;
3591
- stateTransition: BaasStateTransition;
3516
+ export type HostInfo = {
3517
+ id: string;
3518
+ address: string;
3519
+ port: number;
3520
+ weight?: number;
3521
+ region?: string;
3522
+ verified: boolean;
3523
+ verifiedAt?: string;
3524
+ verificationExpires?: string;
3525
+ attestationScore?: number;
3526
+ healthStatus?: "healthy" | "unhealthy" | "unknown";
3527
+ lastHealthCheck?: string;
3528
+ responseTime?: number;
3529
+ activeConnections?: number;
3530
+ successfulChecks?: number;
3531
+ failedChecks?: number;
3532
+ registeredAt: string;
3592
3533
  };
3593
- export type BaasQueryOptions = {
3594
- limit?: number;
3595
- skip?: number;
3596
- sort?: string;
3597
- projection?: Record<string, 0 | 1>;
3534
+ export type RegisterHostResponse = {
3535
+ success: boolean;
3536
+ host: {
3537
+ id: string;
3538
+ address: string;
3539
+ port: number;
3540
+ verified: boolean;
3541
+ healthStatus?: string;
3542
+ registeredAt: string;
3543
+ };
3544
+ message: string;
3598
3545
  };
3599
- export type BaasFindResult = {
3600
- documents: BaasDocument[];
3546
+ export type HostListResponse = {
3601
3547
  count: number;
3602
- limit: number;
3603
- skip: number;
3604
- };
3605
- export type BaasFileMetadata = {
3606
- filename?: string;
3607
- mimeType?: string;
3608
- tags?: Record<string, string>;
3609
- encrypted?: boolean;
3610
- };
3611
- export type BaasUploadResult = {
3612
- cid: string;
3613
- size: number;
3614
- mimeType: string;
3615
- uploadedAt: string;
3616
- filename?: string;
3617
- encrypted?: boolean;
3548
+ hosts: HostInfo[];
3618
3549
  };
3619
- export type BaasFileInfo = {
3620
- cid: string;
3621
- filename?: string;
3622
- size: number;
3623
- mimeType?: string;
3624
- uploadedAt: string;
3625
- lastAccessedAt?: string;
3626
- tags?: Record<string, string>;
3550
+ export type RoutingConfig = {
3551
+ hosts?: string[];
3552
+ loadBalancing?: "round-robin" | "weighted" | "least-connections" | "random" | "ip-hash";
3553
+ redundantExecution?: boolean;
3554
+ minHosts?: number;
3555
+ healthCheckInterval?: number;
3556
+ healthCheckPath?: string;
3627
3557
  };
3628
- export type BaasStorageUsage = {
3629
- totalSize: number;
3630
- fileCount: number;
3558
+ export type ProxyRequest = {
3559
+ host: string;
3560
+ path: string;
3561
+ method: string;
3562
+ headers?: Record<string, string>;
3563
+ body?: unknown;
3631
3564
  };
3632
- export type BaasFunctionRuntime = "nodejs20" | "python3" | "deno";
3633
- export type BaasTriggerType = "http" | "schedule" | "event" | "webhook";
3634
- export type BaasFunctionResources = {
3635
- memory: string;
3636
- timeout: number;
3637
- maxConcurrency?: number;
3565
+ export type ProxyResponse = {
3566
+ success: boolean;
3567
+ data: unknown;
3568
+ meta: {
3569
+ hostId: string;
3570
+ responseTime: number;
3571
+ routingStrategy: string;
3572
+ };
3638
3573
  };
3639
- export type BaasSignedCode = {
3640
- code: string;
3641
- signature: string;
3642
- publicKey: string;
3574
+ export type RoutingStatsResponse = {
3643
3575
  timestamp: string;
3644
- hash: string;
3645
- };
3646
- export type BaasFunctionDeployRequest = {
3647
- name: string;
3648
- description?: string;
3649
- runtime: BaasFunctionRuntime;
3650
- code: string;
3651
- codeType: "inline" | "ipfs";
3652
- entryPoint?: string;
3653
- triggers?: Array<{
3654
- type: BaasTriggerType;
3655
- config: Record<string, unknown>;
3656
- }>;
3657
- resources?: Partial<BaasFunctionResources>;
3658
- environment?: Record<string, string>;
3659
- signedCode?: BaasSignedCode;
3660
- };
3661
- export type BaasFunctionEvalRequest = {
3662
- name?: string;
3663
- code: string;
3664
- runtime?: BaasFunctionRuntime;
3665
- resources?: Partial<BaasFunctionResources>;
3666
- input?: Record<string, unknown>;
3667
- signedCode?: BaasSignedCode;
3668
- };
3669
- export type BaasFunctionDeployResult = {
3670
- functionId: string;
3671
- version: number;
3672
- deployedAt: string;
3673
- endpoints?: string[];
3674
- status: "active" | "deploying" | "failed";
3675
- error?: string;
3676
- };
3677
- export type BaasFunctionResult = {
3678
- requestId: string;
3679
- functionId: string;
3680
- status: "success" | "error" | "timeout";
3681
- result?: unknown;
3682
- error?: string;
3683
- logs?: string[];
3684
- duration: number;
3685
- memoryUsed?: number;
3686
- };
3687
- export type BaasFunctionInfo = {
3688
- functionId: string;
3689
- name: string;
3690
- runtime: BaasFunctionRuntime;
3691
- version: number;
3692
- status: "active" | "inactive" | "error";
3693
- deployedAt: string;
3694
- lastInvokedAt?: string;
3695
- invocationCount: number;
3696
- };
3697
- export type BaasFunctionCode = {
3698
- functionId: string;
3699
- code: string | null;
3700
- codeHash?: string;
3576
+ strictMode: boolean;
3577
+ defaultStrategy: string;
3578
+ hosts: Record<string, unknown>;
3579
+ verification: Record<string, unknown>;
3701
3580
  };
3702
- export type BaasFunctionLog = {
3703
- timestamp: string;
3704
- level: "debug" | "info" | "warn" | "error";
3581
+ export type MapDomainToAppResponse = {
3582
+ domain: string;
3583
+ appId: string;
3705
3584
  message: string;
3706
- requestId?: string;
3707
- metadata?: Record<string, unknown>;
3708
- };
3709
- export type BaasFunctionLogOptions = {
3710
- startTime?: string;
3711
- endTime?: string;
3712
- limit?: number;
3713
- level?: "debug" | "info" | "warn" | "error";
3714
- requestId?: string;
3715
3585
  };
3716
- export type BaasMessage = {
3717
- messageId: string;
3718
- channel: string;
3719
- data: Record<string, unknown>;
3720
- sender?: string;
3721
- timestamp: string;
3722
- metadata?: Record<string, unknown>;
3586
+ export type DomainRegistrationRequest = {
3587
+ domain: string;
3588
+ owner: string;
3589
+ registrar?: string;
3590
+ autoRenew?: boolean;
3723
3591
  };
3724
- export type BaasChannelConfig = {
3725
- name: string;
3726
- persistent?: boolean;
3727
- maxHistoryLength?: number;
3728
- presence?: boolean;
3729
- authRequired?: boolean;
3592
+ export type DomainInfo = {
3593
+ domain: string;
3594
+ owner: string;
3595
+ status: "active" | "pending" | "suspended" | "expired";
3596
+ verified: boolean;
3597
+ registrar?: string;
3598
+ expiresAt?: string;
3599
+ createdAt: string;
3600
+ dnsConfigured: boolean;
3601
+ dnssecEnabled: boolean;
3730
3602
  };
3731
- export type BaasPresenceMember = {
3732
- clientId: string;
3733
- walletAddress?: string;
3734
- joinedAt: string;
3735
- lastSeenAt: string;
3736
- metadata?: Record<string, unknown>;
3603
+ export type DomainListResponse = {
3604
+ domains: DomainInfo[];
3605
+ total: number;
3737
3606
  };
3738
- export type BaasPresenceInfo = {
3739
- channel: string;
3740
- members: BaasPresenceMember[];
3741
- totalCount: number;
3607
+ export type DomainAvailabilityResponse = {
3608
+ domain: string;
3609
+ available: boolean;
3610
+ premium: boolean;
3611
+ price?: string;
3612
+ suggestions?: string[];
3742
3613
  };
3743
- export type BaasHistoryOptions = {
3744
- limit?: number;
3745
- before?: string;
3746
- after?: string;
3747
- startTime?: string;
3748
- endTime?: string;
3614
+ export type VerificationMethod = "dns-txt" | "dns-cname" | "http-file" | "email";
3615
+ export type VerificationTokenResponse = {
3616
+ domain: string;
3617
+ method: VerificationMethod;
3618
+ token: string;
3619
+ instructions: string;
3749
3620
  };
3750
- export type BaasPublishResult = {
3751
- messageId: string;
3752
- channel: string;
3753
- timestamp: string;
3621
+ export type VerificationResult = {
3622
+ domain: string;
3623
+ verified: boolean;
3624
+ message: string;
3754
3625
  };
3755
- export type BaasInitRequest = {
3626
+ export type DnsRecordType = "A" | "AAAA" | "CNAME" | "TXT" | "MX" | "NS" | "SOA" | "SRV" | "CAA" | "DNSKEY" | "DS" | "RRSIG" | "NSEC" | "NSEC3";
3627
+ export type DnsRecord = {
3628
+ type: DnsRecordType;
3756
3629
  name: string;
3757
- port: number;
3758
- services: BaasService[];
3759
- limits?: {
3760
- cpu?: string;
3761
- memory?: string;
3762
- };
3763
- };
3764
- export type BaasInitResponse = {
3765
- appId: string;
3766
- registry: {
3767
- server: string;
3768
- username: string;
3769
- password: string;
3770
- repository: string;
3771
- };
3630
+ value: string;
3631
+ ttl?: number;
3632
+ priority?: number;
3772
3633
  };
3773
- export type BaasReissuePushCredentialsResponse = BaasInitResponse;
3774
- export type BaasDeployRequest = {
3775
- tag: string;
3776
- port?: number;
3777
- replicas?: number;
3778
- degree?: number;
3779
- env?: Record<string, string>;
3780
- resources?: {
3781
- cpu?: string;
3782
- memory?: string;
3783
- };
3784
- strategy?: "rolling" | "recreate";
3785
- attestation?: {
3786
- payload: BuildAttestation;
3787
- signature: string;
3788
- };
3634
+ export type DomainTransferRequest = {
3635
+ authCode: string;
3636
+ newRegistrar?: string;
3789
3637
  };
3790
- export type BaasDeployResponse = {
3791
- appId: string;
3792
- status: string;
3793
- url: string;
3638
+ export type DnsResolveResponse = {
3639
+ name: string;
3640
+ type: string;
3641
+ records: Array<{
3642
+ value: string;
3643
+ ttl: number;
3644
+ }>;
3645
+ dnssec: boolean;
3646
+ timestamp: string;
3794
3647
  };
3795
- export type BaasUploadFrontendResponse = {
3796
- bundleSha256: string;
3797
- bundleSizeBytes: number;
3648
+ export type DnsBatchQuery = {
3649
+ name: string;
3650
+ type?: string;
3798
3651
  };
3799
- export type BaasRollbackRequest = {
3800
- toTag: string;
3652
+ export type DnsBatchResolveResponse = {
3653
+ results: DnsResolveResponse[];
3654
+ errors: Array<{
3655
+ query: DnsBatchQuery;
3656
+ error: string;
3657
+ }>;
3801
3658
  };
3802
- export type BaasRuntimeStatus = {
3803
- appId: string;
3804
- state: "PENDING_SUBSCRIPTION" | "ACTIVE" | "SUSPENDED" | "RETIRED";
3805
- runtime?: {
3806
- image: string;
3807
- runtimeState: "NOT_DEPLOYED" | "DEPLOYING" | "RUNNING" | "FAILED" | "DEGRADED";
3808
- replicas: number;
3809
- lastReconciledAt?: string;
3810
- lastError?: string;
3811
- };
3659
+ export type DnsZone = {
3660
+ zoneName: string;
3661
+ status: "active" | "pending" | "disabled";
3662
+ records: number;
3663
+ dnssecEnabled: boolean;
3664
+ createdAt: string;
3665
+ updatedAt: string;
3812
3666
  };
3813
- export type BaasAppListResponse = {
3814
- apps: DeployedAppInfo[];
3667
+ export type DnsZoneListResponse = {
3668
+ zones: DnsZone[];
3669
+ total: number;
3815
3670
  };
3816
- export type BaasSetWebhookResponse = {
3817
- appId: string;
3818
- webhookUrl: string;
3819
- webhookSecret: string;
3671
+ export type DnsRecordInfo = {
3672
+ recordId: string;
3673
+ type: string;
3674
+ name: string;
3675
+ value: string;
3676
+ ttl: number;
3677
+ priority?: number;
3678
+ createdAt: string;
3679
+ updatedAt: string;
3820
3680
  };
3821
- export type BaasRotateKekResponse = {
3822
- success: boolean;
3823
- newKekVersion: number;
3681
+ export type DnssecKey = {
3682
+ keyTag: number;
3683
+ algorithm: string;
3684
+ digestType: string;
3685
+ digest: string;
3686
+ publicKey: string;
3687
+ flags: number;
3824
3688
  };
3825
- export type BaasRevokeKekResponse = {
3826
- success: boolean;
3827
- revokedKekVersions: number[];
3689
+ export type DnssecDsRecord = {
3690
+ keyTag: number;
3691
+ algorithm: number;
3692
+ digestType: number;
3693
+ digest: string;
3828
3694
  };
3829
- declare class DeploymentClient {
3695
+ declare class RoutingClient {
3830
3696
  private readonly http;
3831
3697
  constructor(http: HttpClient);
3832
- init(request: BaasInitRequest): Promise<BaasInitResponse>;
3833
- pushCredentials(appId: string): Promise<BaasInitResponse>;
3834
- reissuePushCredentials(appId: string): Promise<BaasReissuePushCredentialsResponse>;
3835
- uploadFrontend(appId: string, bundle: Blob | Buffer, filename?: string): Promise<BaasUploadFrontendResponse>;
3836
- deploy(appId: string, request: BaasDeployRequest): Promise<BaasDeployResponse>;
3837
- rollback(appId: string, request: BaasRollbackRequest): Promise<BaasDeployResponse>;
3838
- status(appId: string): Promise<BaasRuntimeStatus>;
3839
- list(): Promise<BaasAppListResponse>;
3840
- get(appId: string): Promise<DeployedAppInfo>;
3841
- update(appId: string, updates: Partial<BaasDeployRequest>): Promise<DeployedAppInfo>;
3842
- delete(appId: string): Promise<{
3698
+ registerHost(request: RegisterHostRequest): Promise<RegisterHostResponse>;
3699
+ unregisterHost(hostId: string): Promise<{
3700
+ success: boolean;
3701
+ message: string;
3702
+ }>;
3703
+ getAllHosts(): Promise<HostListResponse>;
3704
+ getVerifiedHosts(): Promise<HostListResponse>;
3705
+ getHost(hostId: string): Promise<HostInfo>;
3706
+ verifyHost(hostId: string): Promise<{
3707
+ success: boolean;
3708
+ hostId: string;
3709
+ verified: boolean;
3710
+ attestationScore?: number;
3711
+ message: string;
3712
+ }>;
3713
+ setRoutingConfig(appId: string, config: RoutingConfig): Promise<{
3714
+ success: boolean;
3715
+ appId: string;
3716
+ message: string;
3717
+ }>;
3718
+ getRoutingConfig(appId: string): Promise<RoutingConfig>;
3719
+ proxyRequest(request: ProxyRequest): Promise<ProxyResponse>;
3720
+ getStats(): Promise<RoutingStatsResponse>;
3721
+ mapDomainToApp(domain: string, appId: string): Promise<MapDomainToAppResponse>;
3722
+ }
3723
+ declare class DomainsClient {
3724
+ private readonly http;
3725
+ constructor(http: HttpClient);
3726
+ register(request: DomainRegistrationRequest): Promise<DomainInfo>;
3727
+ checkAvailability(domain: string): Promise<DomainAvailabilityResponse>;
3728
+ getInfo(domain: string): Promise<DomainInfo>;
3729
+ list(owner?: string): Promise<DomainListResponse>;
3730
+ generateVerificationToken(domain: string, method: VerificationMethod): Promise<VerificationTokenResponse>;
3731
+ verifyOwnership(domain: string, token: string): Promise<VerificationResult>;
3732
+ configureDns(domain: string, records: DnsRecord[]): Promise<{
3733
+ success: boolean;
3734
+ records: DnsRecord[];
3735
+ }>;
3736
+ enableDnssec(domain: string): Promise<{
3737
+ success: boolean;
3738
+ message: string;
3739
+ }>;
3740
+ disableDnssec(domain: string): Promise<{
3741
+ success: boolean;
3742
+ message: string;
3743
+ }>;
3744
+ renew(domain: string, years?: number): Promise<DomainInfo>;
3745
+ transfer(domain: string, request: DomainTransferRequest): Promise<{
3746
+ success: boolean;
3747
+ message: string;
3748
+ }>;
3749
+ approveTransfer(domain: string): Promise<{
3750
+ success: boolean;
3751
+ }>;
3752
+ rejectTransfer(domain: string): Promise<{
3753
+ success: boolean;
3754
+ }>;
3755
+ suspend(domain: string, reason: string): Promise<{
3756
+ success: boolean;
3757
+ }>;
3758
+ unsuspend(domain: string): Promise<{
3759
+ success: boolean;
3760
+ }>;
3761
+ }
3762
+ declare class DnsClient {
3763
+ private readonly http;
3764
+ constructor(http: HttpClient);
3765
+ resolve(name: string, type?: string, dnssec?: boolean): Promise<DnsResolveResponse>;
3766
+ resolveBatch(queries: DnsBatchQuery[]): Promise<DnsBatchResolveResponse>;
3767
+ listZones(): Promise<DnsZoneListResponse>;
3768
+ getZone(zoneName: string): Promise<DnsZone & {
3769
+ records: DnsRecordInfo[];
3770
+ }>;
3771
+ createZone(request: {
3772
+ zoneName: string;
3773
+ description?: string;
3774
+ }): Promise<DnsZone>;
3775
+ deleteZone(zoneName: string): Promise<{
3843
3776
  success: boolean;
3844
3777
  }>;
3845
- suspend(appId: string): Promise<{
3778
+ addRecord(zoneName: string, record: DnsRecord): Promise<DnsRecordInfo>;
3779
+ updateRecord(zoneName: string, recordId: string, updates: Partial<DnsRecord>): Promise<DnsRecordInfo>;
3780
+ deleteRecord(zoneName: string, recordId: string): Promise<{
3846
3781
  success: boolean;
3847
- status: string;
3848
3782
  }>;
3849
- resume(appId: string): Promise<{
3850
- success: boolean;
3851
- status: string;
3783
+ generateDnssecKeys(zoneName: string, algorithm?: string): Promise<{
3784
+ keys: DnssecKey[];
3852
3785
  }>;
3853
- getStats(): Promise<{
3854
- totalApps: number;
3855
- activeApps: number;
3856
- totalOwners: number;
3786
+ getDnssecKeys(zoneName: string): Promise<{
3787
+ keys: DnssecKey[];
3857
3788
  }>;
3858
- setWebhook(appId: string, webhookUrl: string): Promise<BaasSetWebhookResponse>;
3859
- getMetrics(appId: string): Promise<string>;
3860
- rotateKek(appId: string): Promise<BaasRotateKekResponse>;
3861
- revokeKek(appId: string, version: number): Promise<BaasRevokeKekResponse>;
3789
+ getDsRecord(zoneName: string): Promise<DnssecDsRecord>;
3790
+ clearCache(): Promise<{
3791
+ success: boolean;
3792
+ entriesCleared: number;
3793
+ }>;
3794
+ }
3795
+ declare class HealthClient {
3796
+ private readonly http;
3797
+ constructor(http: HttpClient);
3798
+ getCluster(): Promise<ClusterHealthAggregate>;
3799
+ }
3800
+ export type SmartGatewayClientConfig = {
3801
+ baseUrl: string;
3802
+ apiKey?: string;
3803
+ authToken?: string;
3804
+ timeout?: number;
3805
+ allowInsecure?: boolean;
3806
+ };
3807
+ declare class SmartGatewayClient {
3808
+ private readonly http;
3809
+ readonly routing: RoutingClient;
3810
+ readonly domains: DomainsClient;
3811
+ readonly dns: DnsClient;
3812
+ readonly health: HealthClient;
3813
+ constructor(config: SmartGatewayClientConfig);
3814
+ getHealth(): Promise<GatewayHealthResponse>;
3815
+ getStatus(): Promise<GatewayStatusResponse>;
3816
+ getReadiness(): Promise<GatewayReadinessResponse>;
3817
+ getLiveness(): Promise<GatewayLivenessResponse>;
3818
+ getMetrics(refresh?: boolean): Promise<GatewayMetricsResponse>;
3819
+ getMetricsSummary(): Promise<GatewayMetricsSummaryResponse>;
3862
3820
  }
3863
3821
  export type BridgeChain = "hedera" | "xrpl" | "polkadot" | "solana" | "stellar";
3864
3822
  export type BridgeMode = "rekey" | "lock-wallet";
@@ -4155,634 +4113,341 @@ declare class OperatorClient {
4155
4113
  getBalance(chain: OperatorChain, accountId: string): Promise<OperatorBalanceResponse>;
4156
4114
  getTopup(chain: OperatorChain, accountId: string): Promise<OperatorTopUpResponse>;
4157
4115
  }
4158
- export interface SmartEngineClientConfig {
4159
- validatorBaseUrl: string;
4160
- apiKey?: string;
4161
- authToken?: string;
4162
- timeout?: number;
4163
- allowInsecure?: boolean;
4164
- }
4165
- export interface NetworkConnectionConfig {
4166
- network: "mainnet" | "testnet" | "previewnet";
4167
- registryTopicId: string;
4168
- chain: AuthChain;
4169
- address: string;
4170
- publicKey: string;
4171
- signFn: (challenge: string) => string | Promise<string>;
4172
- metadata?: {
4173
- appId?: string;
4174
- appName?: string;
4175
- };
4176
- mirrorNodeUrl?: string;
4177
- allowInsecure?: boolean;
4178
- }
4179
- export interface NetworkConnectionResult {
4180
- client: SmartEngineClient;
4181
- validator: ValidatorInfo;
4182
- session: AuthenticateResponse;
4183
- }
4184
- declare class SmartEngineClient {
4185
- private baseUrl;
4186
- private allowInsecure;
4187
- private readonly http;
4188
- private readonly txHttp;
4189
- private lastHttpError?;
4190
- readonly subscription: SubscriptionClient;
4191
- readonly faucet: FaucetClient;
4192
- readonly tss: TSSClient;
4193
- readonly ipfs: IPFSClient;
4194
- readonly transactions: TransactionsClient;
4195
- readonly hedera: HederaTransactionsClient;
4196
- readonly xrpl: XrplTransactionsClient;
4197
- readonly solana: SolanaTransactionsClient;
4198
- readonly polkadot: PolkadotTransactionsClient;
4199
- readonly snapshots: SnapshotsClient;
4200
- readonly historicalBalance: HistoricalBalanceClient;
4201
- readonly settlement: SettlementClient;
4202
- readonly governance: GovernanceClient;
4203
- readonly dao: DaoClient;
4204
- readonly personhood: PersonhoodClient;
4205
- readonly agents: AgentsClient;
4206
- readonly deployments: DeploymentClient;
4207
- readonly bridge: BridgeClient;
4208
- readonly resources: ResourcesClient;
4209
- readonly envelope: EnvelopeClient;
4210
- readonly tokens: TokensClient;
4211
- readonly operator: OperatorClient;
4212
- readonly discovery: DiscoveryClient;
4213
- constructor(config: SmartEngineClientConfig);
4214
- static fromEnv(env: Record<string, string | undefined>): SmartEngineClient;
4215
- static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
4216
- getBaseUrl(): string;
4217
- isAuthenticated(): boolean;
4218
- getHttpHealth(): {
4219
- breaker: CircuitBreakerSnapshot | null;
4220
- lastError?: Error;
4221
- };
4222
- getHealth(): Promise<{
4223
- status: string;
4224
- timestamp: string;
4225
- chains: any[];
4226
- }>;
4227
- getSupportedChains(): Promise<{
4228
- chains: string[];
4229
- }>;
4230
- createAccount(request: CreateAccountRequest): Promise<CreateAccountResponse>;
4231
- getAccountInfo(chain: string, accountId: string): Promise<AccountInfo>;
4232
- getBalance(chain: string, accountId: string): Promise<AccountBalance>;
4233
- transfer(request: TransferRequest): Promise<TransferResponse>;
4234
- getTransaction(chain: string, txId: string): Promise<Transaction>;
4235
- getTransactionReceipt(chain: string, txId: string): Promise<any>;
4236
- createToken(request: CreateTokenRequest): Promise<CreateTokenResponse>;
4237
- mintToken(request: MintTokenRequest): Promise<any>;
4238
- getTokenInfo(chain: string, tokenId: string): Promise<TokenInfo>;
4239
- burnToken(request: BurnTokenRequest): Promise<ActionResult>;
4240
- pauseToken(request: TokenActionRequest): Promise<ActionResult>;
4241
- unpauseToken(request: TokenActionRequest): Promise<ActionResult>;
4242
- restrictAccount(request: TokenActionRequest): Promise<ActionResult>;
4243
- unrestrictAccount(request: TokenActionRequest): Promise<ActionResult>;
4244
- enableCompliance(request: TokenActionRequest): Promise<ActionResult>;
4245
- disableCompliance(request: TokenActionRequest): Promise<ActionResult>;
4246
- wipeFromAccount(request: TokenActionRequest): Promise<ActionResult>;
4247
- getAllCapabilities(): Promise<any>;
4248
- getChainCapabilities(chain: ChainType): Promise<any>;
4249
- getSystemStatus(): Promise<any>;
4250
- submitMessage(chain: string, topicId: string, message: string): Promise<any>;
4251
- getClusterHealth(): Promise<{
4252
- status: string;
4253
- nodes: number;
4254
- healthy: number;
4255
- unhealthy: number;
4256
- }>;
4257
- getClusterStatus(): Promise<{
4258
- status: string;
4259
- nodeId: string;
4260
- nodes: Array<{
4261
- nodeId: string;
4262
- endpoint: string;
4263
- status: string;
4264
- lastSeen?: string;
4265
- }>;
4266
- quorum: {
4267
- required: number;
4268
- current: number;
4269
- reached: boolean;
4270
- };
4271
- }>;
4272
- getMetrics(): Promise<string>;
4273
- getQueueStats(): Promise<{
4274
- queues: Record<string, {
4275
- pending: number;
4276
- processing: number;
4277
- completed: number;
4278
- failed: number;
4279
- }>;
4280
- timestamp: string;
4281
- }>;
4282
- getCircuitBreakerStatus(): Promise<{
4283
- breakers: Record<string, {
4284
- state: "closed" | "open" | "half-open";
4285
- failures: number;
4286
- successes: number;
4287
- lastFailure?: string;
4288
- nextRetry?: string;
4289
- }>;
4290
- timestamp: string;
4291
- }>;
4292
- verifySignature(request: {
4293
- chain: ChainType;
4294
- message: string;
4295
- signature: string;
4296
- publicKey: string;
4297
- }): Promise<{
4298
- valid: boolean;
4299
- chain: ChainType;
4300
- }>;
4301
- }
4302
- export type GatewayHealthResponse = {
4303
- status: "ok";
4304
- timestamp: string;
4305
- uptime: number;
4306
- version: string;
4307
- gatewayId: string;
4116
+ export type BuildAttestation = {
4117
+ readonly version: "1";
4118
+ readonly appId: string;
4119
+ readonly developerWallet: string;
4120
+ readonly developerChain: ChainType;
4121
+ readonly framework: "ionic" | "nestjs";
4122
+ readonly sdkVersion: string;
4123
+ readonly imageDigest: string;
4124
+ readonly bundleSha256: string;
4125
+ readonly cliVersion: string;
4126
+ readonly builtAt: number;
4308
4127
  };
4309
- export type GatewayStatusResponse = {
4310
- status: string;
4311
- timestamp: string;
4312
- uptime: number;
4313
- gatewayId: string;
4314
- version: string;
4315
- mode: {
4316
- strictVerification: boolean;
4317
- dnssecEnabled: boolean;
4318
- routingStrategy: string;
4319
- };
4320
- subsystems: {
4321
- dns: {
4322
- status: string;
4323
- cacheEnabled: boolean;
4324
- cacheSize: number;
4325
- maxCacheSize: number;
4326
- cacheUtilization: number;
4327
- };
4328
- routing: {
4329
- status: string;
4330
- strategy: string;
4331
- totalHosts: number;
4332
- verifiedHosts: number;
4333
- healthyHosts: number;
4334
- };
4335
- verification: {
4336
- status: string;
4337
- [key: string]: unknown;
4338
- };
4339
- };
4128
+ export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging";
4129
+ export type BaasSupportedChain = "hedera" | "xrpl" | "polkadot" | "solana";
4130
+ export type BaasEndpoints = {
4131
+ auth: string;
4132
+ database: string;
4133
+ storage: string;
4134
+ functions: string;
4135
+ messaging: string;
4136
+ };
4137
+ export type DeployedAppInfo = {
4138
+ appId: string;
4139
+ name: string;
4140
+ status: "active" | "inactive" | "deploying" | "error";
4141
+ services: string[];
4142
+ endpoints: BaasEndpoints;
4143
+ createdAt: string;
4340
4144
  };
4341
- export type GatewayReadinessResponse = {
4342
- status: "ready";
4343
- timestamp: string;
4344
- verifiedHostsCount: number;
4345
- } | {
4346
- status: "not_ready";
4347
- timestamp: string;
4348
- reason: string;
4145
+ export type BaasAuthConfig = {
4146
+ chain: BaasSupportedChain;
4147
+ walletAddress: string;
4148
+ publicKey: string;
4149
+ signFn: (message: string) => string | Promise<string>;
4349
4150
  };
4350
- export type GatewayLivenessResponse = {
4351
- status: "alive";
4352
- timestamp: string;
4353
- uptime: number;
4151
+ export type BaasClientConfig = {
4152
+ hostUrl: string;
4153
+ appId?: string;
4154
+ appName?: string;
4155
+ auth?: BaasAuthConfig;
4156
+ services?: BaasService[];
4157
+ timeout?: number;
4158
+ allowInsecure?: boolean;
4159
+ pathPrefix?: string;
4354
4160
  };
4355
- export type GatewayMetricsResponse = {
4356
- timestamp: string;
4357
- network: {
4358
- status: "operational" | "degraded" | "down";
4359
- totalClusters: number;
4360
- healthyClusters: number;
4361
- totalValidators: number;
4362
- activeValidators: number;
4363
- };
4364
- gateway: {
4365
- version: string;
4366
- uptimeSeconds: number;
4367
- totalHosts: number;
4368
- verifiedHosts: number;
4369
- healthyHosts: number;
4370
- };
4371
- chains: {
4372
- hedera: {
4373
- connectedNodes: number;
4374
- totalNodes: number;
4375
- network: string | null;
4376
- };
4377
- xrpl: {
4378
- connectedNodes: number;
4379
- totalNodes: number;
4380
- network: string | null;
4381
- };
4382
- };
4383
- genesis: {
4384
- status: "pending" | "in_progress" | "completed" | "unknown";
4385
- completedClusters: number;
4386
- totalClusters: number;
4387
- };
4388
- clusters: ClusterHealth[];
4389
- cacheTtlSeconds: number;
4390
- gossipDiscovery?: {
4391
- enabled: boolean;
4392
- [key: string]: unknown;
4393
- };
4161
+ export type BaasAuthResult = {
4162
+ authenticated?: boolean;
4163
+ walletAddress: string;
4164
+ chain: BaasSupportedChain;
4165
+ appId: string;
4166
+ token: string;
4167
+ expiresAt: number;
4394
4168
  };
4395
- export type ClusterHealth = {
4396
- clusterId: string;
4397
- clusterName: string;
4398
- status: "healthy" | "degraded" | "unhealthy" | "unreachable";
4399
- gateway: {
4400
- status: "up" | "down";
4401
- uptimeSeconds: number;
4402
- };
4403
- validator: {
4404
- status: "up" | "down" | "unknown";
4405
- responseTimeMs: number | null;
4406
- version: string | null;
4407
- };
4408
- host: {
4409
- status: "up" | "down" | "unknown";
4410
- responseTimeMs: number | null;
4411
- };
4412
- chains: {
4413
- hedera: {
4414
- connected: boolean;
4415
- network: string | null;
4416
- };
4417
- xrpl: {
4418
- connected: boolean;
4419
- network: string | null;
4420
- };
4421
- };
4422
- genesis: {
4423
- status: "pending" | "in_progress" | "completed" | "failed" | "unknown";
4424
- completedChains: string[];
4425
- };
4426
- lastChecked: string;
4169
+ export type BaasSessionInfo = {
4170
+ valid: boolean;
4171
+ walletAddress?: string;
4172
+ chain?: BaasSupportedChain;
4173
+ appId?: string;
4174
+ permissions?: string[];
4175
+ sessionId?: string;
4176
+ expiresAt?: number;
4177
+ error?: string;
4427
4178
  };
4428
- export type GatewayMetricsSummaryResponse = {
4429
- timestamp: string;
4430
- status: "operational" | "degraded" | "down";
4431
- clusters: string;
4432
- validators: string;
4433
- hedera: "connected" | "disconnected";
4434
- xrpl: "connected" | "disconnected";
4435
- genesis: "pending" | "in_progress" | "completed" | "unknown";
4436
- version: string;
4179
+ export type BaasDocument = {
4180
+ _id: string;
4181
+ data: Record<string, unknown>;
4182
+ createdAt: number;
4183
+ updatedAt: number;
4184
+ version: number;
4437
4185
  };
4438
- export type ClusterHealthAggregate = {
4439
- clusterId: string;
4440
- gateway: {
4441
- status: "up";
4442
- uptimeSeconds: number;
4443
- version: string;
4444
- gatewayId: string;
4445
- };
4446
- validator: {
4447
- status: "up" | "down";
4448
- version: string | null;
4449
- chains: Array<{
4450
- chain: string;
4451
- connected: boolean;
4452
- network?: string;
4453
- latency?: number;
4454
- }>;
4455
- };
4456
- host: {
4457
- status: "up" | "down";
4458
- };
4459
- genesis: {
4460
- bootstrap?: {
4461
- state?: string;
4462
- };
4463
- multiChain?: {
4464
- overall?: string;
4465
- implementedChains?: {
4466
- completed?: number;
4467
- };
4468
- queueSummary?: unknown;
4469
- };
4470
- };
4471
- lastChecked: string;
4186
+ export type BaasStateTransition = {
4187
+ transitionId: string;
4188
+ operation: "insert" | "update" | "delete";
4189
+ collection: string;
4190
+ documentId: string;
4191
+ previousHash: string;
4192
+ newHash: string;
4193
+ stateRoot: string;
4194
+ timestamp: number;
4195
+ proof: BaasMerkleProof;
4472
4196
  };
4473
- export type RegisterHostRequest = {
4474
- appId: string;
4475
- address: string;
4476
- port: number;
4477
- weight?: number;
4478
- region?: string;
4479
- metadata?: Record<string, string>;
4197
+ export type BaasMerkleProof = {
4198
+ root: string;
4199
+ leaf: string;
4200
+ siblings: string[];
4201
+ path: ("left" | "right")[];
4480
4202
  };
4481
- export type HostInfo = {
4482
- id: string;
4483
- address: string;
4484
- port: number;
4485
- weight?: number;
4486
- region?: string;
4487
- verified: boolean;
4488
- verifiedAt?: string;
4489
- verificationExpires?: string;
4490
- attestationScore?: number;
4491
- healthStatus?: "healthy" | "unhealthy" | "unknown";
4492
- lastHealthCheck?: string;
4493
- responseTime?: number;
4494
- activeConnections?: number;
4495
- successfulChecks?: number;
4496
- failedChecks?: number;
4497
- registeredAt: string;
4203
+ export type BaasInsertResult = {
4204
+ document: BaasDocument;
4205
+ stateTransition: BaasStateTransition;
4498
4206
  };
4499
- export type RegisterHostResponse = {
4500
- success: boolean;
4501
- host: {
4502
- id: string;
4503
- address: string;
4504
- port: number;
4505
- verified: boolean;
4506
- healthStatus?: string;
4507
- registeredAt: string;
4508
- };
4509
- message: string;
4207
+ export type BaasUpdateResult = {
4208
+ document: BaasDocument;
4209
+ stateTransition: BaasStateTransition;
4510
4210
  };
4511
- export type HostListResponse = {
4211
+ export type BaasDeleteResult = {
4212
+ deleted: boolean;
4213
+ stateTransition: BaasStateTransition;
4214
+ };
4215
+ export type BaasQueryOptions = {
4216
+ limit?: number;
4217
+ skip?: number;
4218
+ sort?: string;
4219
+ projection?: Record<string, 0 | 1>;
4220
+ };
4221
+ export type BaasFindResult = {
4222
+ documents: BaasDocument[];
4512
4223
  count: number;
4513
- hosts: HostInfo[];
4224
+ limit: number;
4225
+ skip: number;
4514
4226
  };
4515
- export type RoutingConfig = {
4516
- hosts?: string[];
4517
- loadBalancing?: "round-robin" | "weighted" | "least-connections" | "random" | "ip-hash";
4518
- redundantExecution?: boolean;
4519
- minHosts?: number;
4520
- healthCheckInterval?: number;
4521
- healthCheckPath?: string;
4227
+ export type BaasFileMetadata = {
4228
+ filename?: string;
4229
+ mimeType?: string;
4230
+ tags?: Record<string, string>;
4231
+ encrypted?: boolean;
4232
+ };
4233
+ export type BaasUploadResult = {
4234
+ cid: string;
4235
+ size: number;
4236
+ mimeType: string;
4237
+ uploadedAt: string;
4238
+ filename?: string;
4239
+ encrypted?: boolean;
4522
4240
  };
4523
- export type ProxyRequest = {
4524
- host: string;
4525
- path: string;
4526
- method: string;
4527
- headers?: Record<string, string>;
4528
- body?: unknown;
4241
+ export type BaasFileInfo = {
4242
+ cid: string;
4243
+ filename?: string;
4244
+ size: number;
4245
+ mimeType?: string;
4246
+ uploadedAt: string;
4247
+ lastAccessedAt?: string;
4248
+ tags?: Record<string, string>;
4529
4249
  };
4530
- export type ProxyResponse = {
4531
- success: boolean;
4532
- data: unknown;
4533
- meta: {
4534
- hostId: string;
4535
- responseTime: number;
4536
- routingStrategy: string;
4537
- };
4250
+ export type BaasStorageUsage = {
4251
+ totalSize: number;
4252
+ fileCount: number;
4538
4253
  };
4539
- export type RoutingStatsResponse = {
4254
+ export type BaasFunctionRuntime = "nodejs20" | "python3" | "deno";
4255
+ export type BaasTriggerType = "http" | "schedule" | "event" | "webhook";
4256
+ export type BaasFunctionResources = {
4257
+ memory: string;
4258
+ timeout: number;
4259
+ maxConcurrency?: number;
4260
+ };
4261
+ export type BaasSignedCode = {
4262
+ code: string;
4263
+ signature: string;
4264
+ publicKey: string;
4540
4265
  timestamp: string;
4541
- strictMode: boolean;
4542
- defaultStrategy: string;
4543
- hosts: Record<string, unknown>;
4544
- verification: Record<string, unknown>;
4266
+ hash: string;
4545
4267
  };
4546
- export type MapDomainToAppResponse = {
4547
- domain: string;
4548
- appId: string;
4549
- message: string;
4268
+ export type BaasFunctionDeployRequest = {
4269
+ name: string;
4270
+ description?: string;
4271
+ runtime: BaasFunctionRuntime;
4272
+ code: string;
4273
+ codeType: "inline" | "ipfs";
4274
+ entryPoint?: string;
4275
+ triggers?: Array<{
4276
+ type: BaasTriggerType;
4277
+ config: Record<string, unknown>;
4278
+ }>;
4279
+ resources?: Partial<BaasFunctionResources>;
4280
+ environment?: Record<string, string>;
4281
+ signedCode?: BaasSignedCode;
4550
4282
  };
4551
- export type DomainRegistrationRequest = {
4552
- domain: string;
4553
- owner: string;
4554
- registrar?: string;
4555
- autoRenew?: boolean;
4283
+ export type BaasFunctionEvalRequest = {
4284
+ name?: string;
4285
+ code: string;
4286
+ runtime?: BaasFunctionRuntime;
4287
+ resources?: Partial<BaasFunctionResources>;
4288
+ input?: Record<string, unknown>;
4289
+ signedCode?: BaasSignedCode;
4556
4290
  };
4557
- export type DomainInfo = {
4558
- domain: string;
4559
- owner: string;
4560
- status: "active" | "pending" | "suspended" | "expired";
4561
- verified: boolean;
4562
- registrar?: string;
4563
- expiresAt?: string;
4564
- createdAt: string;
4565
- dnsConfigured: boolean;
4566
- dnssecEnabled: boolean;
4291
+ export type BaasFunctionDeployResult = {
4292
+ functionId: string;
4293
+ version: number;
4294
+ deployedAt: string;
4295
+ endpoints?: string[];
4296
+ status: "active" | "deploying" | "failed";
4297
+ error?: string;
4567
4298
  };
4568
- export type DomainListResponse = {
4569
- domains: DomainInfo[];
4570
- total: number;
4299
+ export type BaasFunctionResult = {
4300
+ requestId: string;
4301
+ functionId: string;
4302
+ status: "success" | "error" | "timeout";
4303
+ result?: unknown;
4304
+ error?: string;
4305
+ logs?: string[];
4306
+ duration: number;
4307
+ memoryUsed?: number;
4571
4308
  };
4572
- export type DomainAvailabilityResponse = {
4573
- domain: string;
4574
- available: boolean;
4575
- premium: boolean;
4576
- price?: string;
4577
- suggestions?: string[];
4309
+ export type BaasFunctionInfo = {
4310
+ functionId: string;
4311
+ name: string;
4312
+ runtime: BaasFunctionRuntime;
4313
+ version: number;
4314
+ status: "active" | "inactive" | "error";
4315
+ deployedAt: string;
4316
+ lastInvokedAt?: string;
4317
+ invocationCount: number;
4578
4318
  };
4579
- export type VerificationMethod = "dns-txt" | "dns-cname" | "http-file" | "email";
4580
- export type VerificationTokenResponse = {
4581
- domain: string;
4582
- method: VerificationMethod;
4583
- token: string;
4584
- instructions: string;
4319
+ export type BaasFunctionCode = {
4320
+ functionId: string;
4321
+ code: string | null;
4322
+ codeHash?: string;
4585
4323
  };
4586
- export type VerificationResult = {
4587
- domain: string;
4588
- verified: boolean;
4324
+ export type BaasFunctionLog = {
4325
+ timestamp: string;
4326
+ level: "debug" | "info" | "warn" | "error";
4589
4327
  message: string;
4328
+ requestId?: string;
4329
+ metadata?: Record<string, unknown>;
4590
4330
  };
4591
- export type DnsRecordType = "A" | "AAAA" | "CNAME" | "TXT" | "MX" | "NS" | "SOA" | "SRV" | "CAA" | "DNSKEY" | "DS" | "RRSIG" | "NSEC" | "NSEC3";
4592
- export type DnsRecord = {
4593
- type: DnsRecordType;
4594
- name: string;
4595
- value: string;
4596
- ttl?: number;
4597
- priority?: number;
4331
+ export type BaasFunctionLogOptions = {
4332
+ startTime?: string;
4333
+ endTime?: string;
4334
+ limit?: number;
4335
+ level?: "debug" | "info" | "warn" | "error";
4336
+ requestId?: string;
4598
4337
  };
4599
- export type DomainTransferRequest = {
4600
- authCode: string;
4601
- newRegistrar?: string;
4338
+ export type BaasMessage = {
4339
+ messageId: string;
4340
+ channel: string;
4341
+ data: Record<string, unknown>;
4342
+ sender?: string;
4343
+ timestamp: string;
4344
+ metadata?: Record<string, unknown>;
4602
4345
  };
4603
- export type DnsResolveResponse = {
4346
+ export type BaasChannelConfig = {
4604
4347
  name: string;
4605
- type: string;
4606
- records: Array<{
4607
- value: string;
4608
- ttl: number;
4609
- }>;
4610
- dnssec: boolean;
4348
+ persistent?: boolean;
4349
+ maxHistoryLength?: number;
4350
+ presence?: boolean;
4351
+ authRequired?: boolean;
4352
+ };
4353
+ export type BaasPresenceMember = {
4354
+ clientId: string;
4355
+ walletAddress?: string;
4356
+ joinedAt: string;
4357
+ lastSeenAt: string;
4358
+ metadata?: Record<string, unknown>;
4359
+ };
4360
+ export type BaasPresenceInfo = {
4361
+ channel: string;
4362
+ members: BaasPresenceMember[];
4363
+ totalCount: number;
4364
+ };
4365
+ export type BaasHistoryOptions = {
4366
+ limit?: number;
4367
+ before?: string;
4368
+ after?: string;
4369
+ startTime?: string;
4370
+ endTime?: string;
4371
+ };
4372
+ export type BaasPublishResult = {
4373
+ messageId: string;
4374
+ channel: string;
4611
4375
  timestamp: string;
4612
4376
  };
4613
- export type DnsBatchQuery = {
4377
+ export type BaasInitRequest = {
4614
4378
  name: string;
4615
- type?: string;
4379
+ port: number;
4380
+ services: BaasService[];
4381
+ limits?: {
4382
+ cpu?: string;
4383
+ memory?: string;
4384
+ };
4616
4385
  };
4617
- export type DnsBatchResolveResponse = {
4618
- results: DnsResolveResponse[];
4619
- errors: Array<{
4620
- query: DnsBatchQuery;
4621
- error: string;
4622
- }>;
4386
+ export type BaasInitResponse = {
4387
+ appId: string;
4388
+ registry: {
4389
+ server: string;
4390
+ username: string;
4391
+ password: string;
4392
+ repository: string;
4393
+ };
4623
4394
  };
4624
- export type DnsZone = {
4625
- zoneName: string;
4626
- status: "active" | "pending" | "disabled";
4627
- records: number;
4628
- dnssecEnabled: boolean;
4629
- createdAt: string;
4630
- updatedAt: string;
4395
+ export type BaasReissuePushCredentialsResponse = BaasInitResponse;
4396
+ export type BaasDeployRequest = {
4397
+ tag: string;
4398
+ port?: number;
4399
+ replicas?: number;
4400
+ degree?: number;
4401
+ env?: Record<string, string>;
4402
+ resources?: {
4403
+ cpu?: string;
4404
+ memory?: string;
4405
+ };
4406
+ strategy?: "rolling" | "recreate";
4407
+ attestation?: {
4408
+ payload: BuildAttestation;
4409
+ signature: string;
4410
+ };
4631
4411
  };
4632
- export type DnsZoneListResponse = {
4633
- zones: DnsZone[];
4634
- total: number;
4412
+ export type BaasDeployResponse = {
4413
+ appId: string;
4414
+ status: string;
4415
+ url: string;
4416
+ };
4417
+ export type BaasUploadFrontendResponse = {
4418
+ bundleSha256: string;
4419
+ bundleSizeBytes: number;
4420
+ };
4421
+ export type BaasRollbackRequest = {
4422
+ toTag: string;
4423
+ };
4424
+ export type BaasRuntimeStatus = {
4425
+ appId: string;
4426
+ state: "PENDING_SUBSCRIPTION" | "ACTIVE" | "SUSPENDED" | "RETIRED";
4427
+ runtime?: {
4428
+ image: string;
4429
+ runtimeState: "NOT_DEPLOYED" | "DEPLOYING" | "RUNNING" | "FAILED" | "DEGRADED";
4430
+ replicas: number;
4431
+ lastReconciledAt?: string;
4432
+ lastError?: string;
4433
+ };
4635
4434
  };
4636
- export type DnsRecordInfo = {
4637
- recordId: string;
4638
- type: string;
4639
- name: string;
4640
- value: string;
4641
- ttl: number;
4642
- priority?: number;
4643
- createdAt: string;
4644
- updatedAt: string;
4435
+ export type BaasAppListResponse = {
4436
+ apps: DeployedAppInfo[];
4645
4437
  };
4646
- export type DnssecKey = {
4647
- keyTag: number;
4648
- algorithm: string;
4649
- digestType: string;
4650
- digest: string;
4651
- publicKey: string;
4652
- flags: number;
4438
+ export type BaasSetWebhookResponse = {
4439
+ appId: string;
4440
+ webhookUrl: string;
4441
+ webhookSecret: string;
4653
4442
  };
4654
- export type DnssecDsRecord = {
4655
- keyTag: number;
4656
- algorithm: number;
4657
- digestType: number;
4658
- digest: string;
4443
+ export type BaasRotateKekResponse = {
4444
+ success: boolean;
4445
+ newKekVersion: number;
4659
4446
  };
4660
- declare class RoutingClient {
4661
- private readonly http;
4662
- constructor(http: HttpClient);
4663
- registerHost(request: RegisterHostRequest): Promise<RegisterHostResponse>;
4664
- unregisterHost(hostId: string): Promise<{
4665
- success: boolean;
4666
- message: string;
4667
- }>;
4668
- getAllHosts(): Promise<HostListResponse>;
4669
- getVerifiedHosts(): Promise<HostListResponse>;
4670
- getHost(hostId: string): Promise<HostInfo>;
4671
- verifyHost(hostId: string): Promise<{
4672
- success: boolean;
4673
- hostId: string;
4674
- verified: boolean;
4675
- attestationScore?: number;
4676
- message: string;
4677
- }>;
4678
- setRoutingConfig(appId: string, config: RoutingConfig): Promise<{
4679
- success: boolean;
4680
- appId: string;
4681
- message: string;
4682
- }>;
4683
- getRoutingConfig(appId: string): Promise<RoutingConfig>;
4684
- proxyRequest(request: ProxyRequest): Promise<ProxyResponse>;
4685
- getStats(): Promise<RoutingStatsResponse>;
4686
- mapDomainToApp(domain: string, appId: string): Promise<MapDomainToAppResponse>;
4687
- }
4688
- declare class DomainsClient {
4689
- private readonly http;
4690
- constructor(http: HttpClient);
4691
- register(request: DomainRegistrationRequest): Promise<DomainInfo>;
4692
- checkAvailability(domain: string): Promise<DomainAvailabilityResponse>;
4693
- getInfo(domain: string): Promise<DomainInfo>;
4694
- list(owner?: string): Promise<DomainListResponse>;
4695
- generateVerificationToken(domain: string, method: VerificationMethod): Promise<VerificationTokenResponse>;
4696
- verifyOwnership(domain: string, token: string): Promise<VerificationResult>;
4697
- configureDns(domain: string, records: DnsRecord[]): Promise<{
4698
- success: boolean;
4699
- records: DnsRecord[];
4700
- }>;
4701
- enableDnssec(domain: string): Promise<{
4702
- success: boolean;
4703
- message: string;
4704
- }>;
4705
- disableDnssec(domain: string): Promise<{
4706
- success: boolean;
4707
- message: string;
4708
- }>;
4709
- renew(domain: string, years?: number): Promise<DomainInfo>;
4710
- transfer(domain: string, request: DomainTransferRequest): Promise<{
4711
- success: boolean;
4712
- message: string;
4713
- }>;
4714
- approveTransfer(domain: string): Promise<{
4715
- success: boolean;
4716
- }>;
4717
- rejectTransfer(domain: string): Promise<{
4718
- success: boolean;
4719
- }>;
4720
- suspend(domain: string, reason: string): Promise<{
4721
- success: boolean;
4722
- }>;
4723
- unsuspend(domain: string): Promise<{
4724
- success: boolean;
4725
- }>;
4726
- }
4727
- declare class DnsClient {
4728
- private readonly http;
4729
- constructor(http: HttpClient);
4730
- resolve(name: string, type?: string, dnssec?: boolean): Promise<DnsResolveResponse>;
4731
- resolveBatch(queries: DnsBatchQuery[]): Promise<DnsBatchResolveResponse>;
4732
- listZones(): Promise<DnsZoneListResponse>;
4733
- getZone(zoneName: string): Promise<DnsZone & {
4734
- records: DnsRecordInfo[];
4735
- }>;
4736
- createZone(request: {
4737
- zoneName: string;
4738
- description?: string;
4739
- }): Promise<DnsZone>;
4740
- deleteZone(zoneName: string): Promise<{
4741
- success: boolean;
4742
- }>;
4743
- addRecord(zoneName: string, record: DnsRecord): Promise<DnsRecordInfo>;
4744
- updateRecord(zoneName: string, recordId: string, updates: Partial<DnsRecord>): Promise<DnsRecordInfo>;
4745
- deleteRecord(zoneName: string, recordId: string): Promise<{
4746
- success: boolean;
4747
- }>;
4748
- generateDnssecKeys(zoneName: string, algorithm?: string): Promise<{
4749
- keys: DnssecKey[];
4750
- }>;
4751
- getDnssecKeys(zoneName: string): Promise<{
4752
- keys: DnssecKey[];
4753
- }>;
4754
- getDsRecord(zoneName: string): Promise<DnssecDsRecord>;
4755
- clearCache(): Promise<{
4756
- success: boolean;
4757
- entriesCleared: number;
4758
- }>;
4759
- }
4760
- declare class HealthClient {
4761
- private readonly http;
4762
- constructor(http: HttpClient);
4763
- getCluster(): Promise<ClusterHealthAggregate>;
4764
- }
4765
- export type SmartGatewayClientConfig = {
4766
- baseUrl: string;
4767
- apiKey?: string;
4768
- authToken?: string;
4769
- timeout?: number;
4770
- allowInsecure?: boolean;
4447
+ export type BaasRevokeKekResponse = {
4448
+ success: boolean;
4449
+ revokedKekVersions: number[];
4771
4450
  };
4772
- declare class SmartGatewayClient {
4773
- private readonly http;
4774
- readonly routing: RoutingClient;
4775
- readonly domains: DomainsClient;
4776
- readonly dns: DnsClient;
4777
- readonly health: HealthClient;
4778
- constructor(config: SmartGatewayClientConfig);
4779
- getHealth(): Promise<GatewayHealthResponse>;
4780
- getStatus(): Promise<GatewayStatusResponse>;
4781
- getReadiness(): Promise<GatewayReadinessResponse>;
4782
- getLiveness(): Promise<GatewayLivenessResponse>;
4783
- getMetrics(refresh?: boolean): Promise<GatewayMetricsResponse>;
4784
- getMetricsSummary(): Promise<GatewayMetricsSummaryResponse>;
4785
- }
4786
4451
  export type StateRootResponse = {
4787
4452
  appId: string;
4788
4453
  stateRoot: string;
@@ -4922,6 +4587,40 @@ declare class MessagingClient {
4922
4587
  getPresence(channel: string, opts?: HttpCallOptions): Promise<BaasPresenceInfo>;
4923
4588
  getStats(opts?: HttpCallOptions): Promise<any>;
4924
4589
  }
4590
+ declare class DeploymentClient {
4591
+ private readonly http;
4592
+ constructor(http: HttpClient);
4593
+ init(request: BaasInitRequest): Promise<BaasInitResponse>;
4594
+ pushCredentials(appId: string): Promise<BaasInitResponse>;
4595
+ reissuePushCredentials(appId: string): Promise<BaasReissuePushCredentialsResponse>;
4596
+ uploadFrontend(appId: string, bundle: Blob | Buffer, filename?: string): Promise<BaasUploadFrontendResponse>;
4597
+ deploy(appId: string, request: BaasDeployRequest): Promise<BaasDeployResponse>;
4598
+ rollback(appId: string, request: BaasRollbackRequest): Promise<BaasDeployResponse>;
4599
+ status(appId: string): Promise<BaasRuntimeStatus>;
4600
+ list(): Promise<BaasAppListResponse>;
4601
+ get(appId: string): Promise<DeployedAppInfo>;
4602
+ update(appId: string, updates: Partial<BaasDeployRequest>): Promise<DeployedAppInfo>;
4603
+ delete(appId: string): Promise<{
4604
+ success: boolean;
4605
+ }>;
4606
+ suspend(appId: string): Promise<{
4607
+ success: boolean;
4608
+ status: string;
4609
+ }>;
4610
+ resume(appId: string): Promise<{
4611
+ success: boolean;
4612
+ status: string;
4613
+ }>;
4614
+ getStats(): Promise<{
4615
+ totalApps: number;
4616
+ activeApps: number;
4617
+ totalOwners: number;
4618
+ }>;
4619
+ setWebhook(appId: string, webhookUrl: string): Promise<BaasSetWebhookResponse>;
4620
+ getMetrics(appId: string): Promise<string>;
4621
+ rotateKek(appId: string): Promise<BaasRotateKekResponse>;
4622
+ revokeKek(appId: string, version: number): Promise<BaasRevokeKekResponse>;
4623
+ }
4925
4624
  export type CustomerSessionChallenge = {
4926
4625
  challenge: string;
4927
4626
  };
@@ -12323,18 +12022,205 @@ export type DeprecateRuleResponse = {
12323
12022
  deprecated: true;
12324
12023
  consensusTimestamp: string;
12325
12024
  };
12326
- export declare class RulesClient {
12025
+ export interface IRulesClient {
12026
+ publish(rule: ValidatorRules): Promise<PublishRuleResponse>;
12027
+ get(consensusTimestamp: string): Promise<PublishedRule>;
12028
+ listByOwner(filter?: ListRulesFilter): Promise<ListRulesResponse>;
12029
+ simulate(params: SimulateRuleRequest): Promise<ValidationResult>;
12030
+ getVersionHistory(consensusTimestamp: string): Promise<VersionHistoryResponse>;
12031
+ deprecate(consensusTimestamp: string): Promise<DeprecateRuleResponse>;
12032
+ }
12033
+ export declare class RulesClient implements IRulesClient {
12034
+ private readonly http;
12035
+ constructor(http: HttpClient);
12036
+ publish(rule: ValidatorRules): Promise<PublishRuleResponse>;
12037
+ get(consensusTimestamp: string): Promise<PublishedRule>;
12038
+ listByOwner(filter?: ListRulesFilter): Promise<ListRulesResponse>;
12039
+ simulate(params: SimulateRuleRequest): Promise<ValidationResult>;
12040
+ getVersionHistory(consensusTimestamp: string): Promise<VersionHistoryResponse>;
12041
+ deprecate(consensusTimestamp: string): Promise<DeprecateRuleResponse>;
12042
+ }
12043
+ export interface IEntitiesClient {
12044
+ prepareCreateToken(req: Omit<CreateTokenRequest, "fundWith">): Promise<PreparedEntityCreation>;
12045
+ executeCreateToken(req: {
12046
+ entityId: string;
12047
+ chain: ChainType;
12048
+ securityMode?: EntitySecurityMode;
12049
+ createTxId?: string;
12050
+ signedFundingBlob?: string;
12051
+ }): Promise<EntityCreationResult>;
12052
+ createToken(req: CreateTokenRequest): Promise<EntityCreationResult>;
12053
+ prepareCreateAccount(req: Omit<CreateAccountRequest, "fundWith">): Promise<PreparedEntityCreation>;
12054
+ executeCreateAccount(req: {
12055
+ entityId: string;
12056
+ chain: ChainType;
12057
+ securityMode?: EntitySecurityMode;
12058
+ signedFundingBlob?: string;
12059
+ createTxId?: string;
12060
+ }): Promise<EntityCreationResult>;
12061
+ createAccount(req: CreateAccountRequest): Promise<EntityCreationResult>;
12062
+ prepareCreateTopic(req: Omit<CreateTopicRequest, "fundWith">): Promise<PreparedEntityCreation>;
12063
+ executeCreateTopic(req: {
12064
+ entityId: string;
12065
+ chain: ChainType;
12066
+ createTxId: string;
12067
+ securityMode?: EntitySecurityMode;
12068
+ }): Promise<EntityCreationResult>;
12069
+ createTopic(req: CreateTopicRequest): Promise<EntityCreationResult>;
12070
+ createAgent(req: CreateAgentRequest): Promise<EntityCreationResult>;
12071
+ prepareCreateAgent(req: Omit<CreateAgentRequest, "fundWith">): Promise<PreparedEntityCreation>;
12072
+ executeCreateAgent(req: {
12073
+ entityId: string;
12074
+ chain: ChainType;
12075
+ securityMode?: EntitySecurityMode;
12076
+ signedFundingBlob?: string;
12077
+ createTxId?: string;
12078
+ }): Promise<EntityCreationResult>;
12079
+ launchpad(req: LaunchpadEntityRequest): Promise<LaunchpadEntityResult>;
12080
+ get(entityId: string): Promise<EntityInfo>;
12081
+ listByOwner(filter?: ListEntitiesFilter): Promise<ListEntitiesResponse>;
12082
+ transfer(entityId: string, body: TransferEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12083
+ withdraw(entityId: string, body: WithdrawEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12084
+ mint(entityId: string, body: MintEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12085
+ burn(entityId: string, body: BurnEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12086
+ compliance(entityId: string, body: ComplianceEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12087
+ trustline(entityId: string, body: TrustlineEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12088
+ }
12089
+ export declare class EntitiesClient implements IEntitiesClient {
12327
12090
  private readonly http;
12328
12091
  constructor(http: HttpClient);
12329
- publish(rule: ValidatorRules): Promise<PublishRuleResponse>;
12330
- get(consensusTimestamp: string): Promise<PublishedRule>;
12331
- listByOwner(filter?: ListRulesFilter): Promise<ListRulesResponse>;
12332
- simulate(params: SimulateRuleRequest): Promise<ValidationResult>;
12333
- getVersionHistory(consensusTimestamp: string): Promise<VersionHistoryResponse>;
12334
- deprecate(consensusTimestamp: string): Promise<DeprecateRuleResponse>;
12092
+ private static readonly PAYER_FUNDED_TOKEN_CHAINS;
12093
+ prepareCreateToken(req: Omit<CreateTokenRequest, "fundWith">): Promise<PreparedEntityCreation>;
12094
+ executeCreateToken(req: {
12095
+ entityId: string;
12096
+ chain: ChainType;
12097
+ securityMode?: EntitySecurityMode;
12098
+ createTxId?: string;
12099
+ signedFundingBlob?: string;
12100
+ }): Promise<EntityCreationResult>;
12101
+ createToken(req: CreateTokenRequest): Promise<EntityCreationResult>;
12102
+ prepareCreateAccount(req: Omit<CreateAccountRequest, "fundWith">): Promise<PreparedEntityCreation>;
12103
+ executeCreateAccount(req: {
12104
+ entityId: string;
12105
+ chain: ChainType;
12106
+ securityMode?: EntitySecurityMode;
12107
+ signedFundingBlob?: string;
12108
+ createTxId?: string;
12109
+ }): Promise<EntityCreationResult>;
12110
+ private static readonly PAYER_FUNDED_CREATE_CHAINS;
12111
+ private static readonly FUNDING_BLOB_RELAY_CHAINS;
12112
+ createAccount(req: CreateAccountRequest): Promise<EntityCreationResult>;
12113
+ prepareCreateTopic(req: Omit<CreateTopicRequest, "fundWith">): Promise<PreparedEntityCreation>;
12114
+ executeCreateTopic(req: {
12115
+ entityId: string;
12116
+ chain: ChainType;
12117
+ createTxId: string;
12118
+ securityMode?: EntitySecurityMode;
12119
+ }): Promise<EntityCreationResult>;
12120
+ createTopic(req: CreateTopicRequest): Promise<EntityCreationResult>;
12121
+ createAgent(req: CreateAgentRequest): Promise<EntityCreationResult>;
12122
+ prepareCreateAgent(req: Omit<CreateAgentRequest, "fundWith">): Promise<PreparedEntityCreation>;
12123
+ executeCreateAgent(req: {
12124
+ entityId: string;
12125
+ chain: ChainType;
12126
+ securityMode?: EntitySecurityMode;
12127
+ signedFundingBlob?: string;
12128
+ createTxId?: string;
12129
+ }): Promise<EntityCreationResult>;
12130
+ launchpad(req: LaunchpadEntityRequest): Promise<LaunchpadEntityResult>;
12131
+ get(entityId: string): Promise<EntityInfo>;
12132
+ listByOwner(filter?: ListEntitiesFilter): Promise<ListEntitiesResponse>;
12133
+ transfer(entityId: string, body: TransferEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12134
+ withdraw(entityId: string, body: WithdrawEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12135
+ mint(entityId: string, body: MintEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12136
+ burn(entityId: string, body: BurnEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12137
+ compliance(entityId: string, body: ComplianceEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12138
+ trustline(entityId: string, body: TrustlineEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12139
+ }
12140
+ export type AuthenticateOptions = {
12141
+ chain: BaasSupportedChain;
12142
+ walletAddress: string;
12143
+ publicKey: string;
12144
+ signFn: (message: string) => string | Promise<string>;
12145
+ };
12146
+ export interface BaasConnectToClusterShared {
12147
+ appId?: string;
12148
+ appName?: string;
12149
+ timeout?: number;
12150
+ allowInsecure?: boolean;
12151
+ pathPrefix?: string;
12152
+ trustAnchor?: {
12153
+ network: "mainnet" | "testnet" | "previewnet";
12154
+ registryTopicId: string;
12155
+ mirrorNodeUrl?: string;
12156
+ };
12157
+ }
12158
+ export type BaasConnectToClusterConfig = ({
12159
+ network: NetworkName;
12160
+ bootstrap?: never;
12161
+ } & BaasConnectToClusterShared) | ({
12162
+ bootstrap: string[];
12163
+ network?: never;
12164
+ } & BaasConnectToClusterShared);
12165
+ export interface IBaasClient {
12166
+ readonly db: DatabaseClient;
12167
+ readonly storage: StorageClient;
12168
+ readonly functions: FunctionsClient;
12169
+ readonly messaging: MessagingClient;
12170
+ readonly deployment: DeploymentClient;
12171
+ readonly agents: AgentsClient;
12172
+ readonly customerSession: CustomerSessionClient;
12173
+ readonly rules: RulesClient;
12174
+ readonly entities: EntitiesClient;
12175
+ authenticate(options: AuthenticateOptions): Promise<BaasAuthResult>;
12176
+ validateSession(): Promise<BaasSessionInfo>;
12177
+ logout(): Promise<void>;
12178
+ isAuthenticated(): boolean;
12179
+ getAppId(): string | undefined;
12180
+ setAppId(appId: string): void;
12181
+ getHostUrl(): string;
12182
+ getHttpHealth(): {
12183
+ breaker: CircuitBreakerSnapshot | null;
12184
+ lastError?: Error;
12185
+ };
12186
+ }
12187
+ declare class BaasClient implements IBaasClient {
12188
+ private readonly hostUrl;
12189
+ private readonly pathPrefix;
12190
+ private appId;
12191
+ private readonly timeout;
12192
+ private readonly allowInsecure;
12193
+ private readonly http;
12194
+ private lastHttpError?;
12195
+ private authContext?;
12196
+ readonly db: DatabaseClient;
12197
+ readonly storage: StorageClient;
12198
+ readonly functions: FunctionsClient;
12199
+ readonly messaging: MessagingClient;
12200
+ readonly deployment: DeploymentClient;
12201
+ readonly agents: AgentsClient;
12202
+ readonly customerSession: CustomerSessionClient;
12203
+ readonly rules: RulesClient;
12204
+ readonly entities: EntitiesClient;
12205
+ constructor(config: BaasClientConfig);
12206
+ static connectToCluster(config: BaasConnectToClusterConfig): Promise<BaasClient>;
12207
+ setAppId(appId: string): void;
12208
+ isAuthenticated(): boolean;
12209
+ getAppId(): string | undefined;
12210
+ getHostUrl(): string;
12211
+ getHttpHealth(): {
12212
+ breaker: CircuitBreakerSnapshot | null;
12213
+ lastError?: Error;
12214
+ };
12215
+ private requireAppId;
12216
+ authenticate(options: AuthenticateOptions): Promise<BaasAuthResult>;
12217
+ private reauthenticate;
12218
+ validateSession(): Promise<BaasSessionInfo>;
12219
+ logout(): Promise<void>;
12220
+ private requireAuth;
12335
12221
  }
12336
12222
  type EntityType$1 = "token" | "account" | "topic" | "agent";
12337
- type CreateTokenRequest$1 = {
12223
+ export type CreateTokenRequest = {
12338
12224
  chain: ChainType;
12339
12225
  name: string;
12340
12226
  symbol: string;
@@ -12360,7 +12246,7 @@ export type FundWith = (prepared: PreparedTransaction[], ctx: {
12360
12246
  }) => Promise<{
12361
12247
  signedFundingBlob?: string;
12362
12248
  } | void>;
12363
- type CreateAccountRequest$1 = {
12249
+ export type CreateAccountRequest = {
12364
12250
  chain: ChainType;
12365
12251
  ruleRef: RuleRef;
12366
12252
  initialBalance?: string;
@@ -12393,16 +12279,20 @@ export type EntityCreationResult = {
12393
12279
  ruleRef: RuleRef;
12394
12280
  chainAccounts: Record<string, string>;
12395
12281
  transactionId?: string;
12396
- agentId?: string;
12282
+ agentId: string;
12397
12283
  status?: string;
12398
12284
  };
12399
12285
  export type EntityInfo = {
12400
12286
  entityId: string;
12287
+ type: EntityType$1;
12401
12288
  entityType: EntityType$1;
12289
+ owner: string;
12402
12290
  ownerWallet: string;
12291
+ chain: ChainType;
12403
12292
  ruleRef: RuleRef;
12404
12293
  chainAccounts: Record<string, string>;
12405
12294
  createdAt: string;
12295
+ agentId: string;
12406
12296
  };
12407
12297
  export type ListEntitiesFilter = {
12408
12298
  type?: EntityType$1;
@@ -12489,116 +12379,307 @@ export type PreparedEntityTransactionResult = {
12489
12379
  expiresAt?: string;
12490
12380
  metadata?: Record<string, unknown>;
12491
12381
  };
12492
- export declare class EntitiesClient {
12493
- private readonly http;
12494
- constructor(http: HttpClient);
12495
- private static readonly PAYER_FUNDED_TOKEN_CHAINS;
12496
- prepareCreateToken(req: Omit<CreateTokenRequest$1, "fundWith">): Promise<PreparedEntityCreation>;
12497
- executeCreateToken(req: {
12498
- entityId: string;
12499
- chain: ChainType;
12500
- securityMode?: EntitySecurityMode;
12501
- createTxId?: string;
12502
- signedFundingBlob?: string;
12503
- }): Promise<EntityCreationResult>;
12504
- createToken(req: CreateTokenRequest$1): Promise<EntityCreationResult>;
12505
- prepareCreateAccount(req: Omit<CreateAccountRequest$1, "fundWith">): Promise<PreparedEntityCreation>;
12506
- executeCreateAccount(req: {
12507
- entityId: string;
12508
- chain: ChainType;
12509
- securityMode?: EntitySecurityMode;
12510
- signedFundingBlob?: string;
12511
- createTxId?: string;
12512
- }): Promise<EntityCreationResult>;
12513
- private static readonly PAYER_FUNDED_CREATE_CHAINS;
12514
- private static readonly FUNDING_BLOB_RELAY_CHAINS;
12515
- createAccount(req: CreateAccountRequest$1): Promise<EntityCreationResult>;
12516
- prepareCreateTopic(req: Omit<CreateTopicRequest, "fundWith">): Promise<PreparedEntityCreation>;
12517
- executeCreateTopic(req: {
12518
- entityId: string;
12519
- chain: ChainType;
12520
- createTxId: string;
12521
- securityMode?: EntitySecurityMode;
12522
- }): Promise<EntityCreationResult>;
12523
- createTopic(req: CreateTopicRequest): Promise<EntityCreationResult>;
12524
- createAgent(req: CreateAgentRequest): Promise<EntityCreationResult>;
12525
- prepareCreateAgent(req: Omit<CreateAgentRequest, "fundWith">): Promise<PreparedEntityCreation>;
12526
- executeCreateAgent(req: {
12527
- entityId: string;
12528
- chain: ChainType;
12529
- securityMode?: EntitySecurityMode;
12530
- signedFundingBlob?: string;
12531
- createTxId?: string;
12532
- }): Promise<EntityCreationResult>;
12533
- launchpad(req: LaunchpadEntityRequest): Promise<LaunchpadEntityResult>;
12534
- get(entityId: string): Promise<EntityInfo>;
12535
- listByOwner(filter?: ListEntitiesFilter): Promise<ListEntitiesResponse>;
12536
- transfer(entityId: string, body: TransferEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12537
- withdraw(entityId: string, body: WithdrawEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12538
- mint(entityId: string, body: MintEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12539
- burn(entityId: string, body: BurnEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12540
- compliance(entityId: string, body: ComplianceEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12541
- trustline(entityId: string, body: TrustlineEntityRequest, opts?: HttpCallOptions): Promise<PreparedEntityTransactionResult>;
12542
- }
12543
- export type AuthenticateOptions = {
12544
- chain: BaasSupportedChain;
12545
- walletAddress: string;
12546
- publicKey: string;
12547
- signFn: (message: string) => string | Promise<string>;
12382
+ export type AgentStatus = "active" | "paused" | "revoked" | "pending";
12383
+ export type AgentRegisterRequest = {
12384
+ name: string;
12385
+ description?: string;
12386
+ capabilities: string[];
12387
+ rules: AgentRules;
12388
+ primaryChain?: string;
12389
+ securityMode?: EntitySecurityMode;
12390
+ fundingConfig?: {
12391
+ chain: string;
12392
+ maxAmount: string;
12393
+ autoFund: boolean;
12394
+ };
12395
+ };
12396
+ export type AgentRules = {
12397
+ maxTradeAmount?: string;
12398
+ allowedPairs?: string[];
12399
+ allowedChains?: string[];
12400
+ dailyLimit?: string;
12401
+ requireApprovalAbove?: string;
12402
+ customRules?: Record<string, unknown>;
12403
+ };
12404
+ export type AgentInfo = {
12405
+ agentId: string;
12406
+ name: string;
12407
+ description?: string;
12408
+ status: AgentStatus;
12409
+ capabilities: string[];
12410
+ rules: AgentRules;
12411
+ owner: string;
12412
+ createdAt: string;
12413
+ lastActiveAt?: string;
12414
+ agentWallet?: string;
12415
+ treasuryAccount?: string;
12416
+ entityId?: string;
12417
+ };
12418
+ export type AgentCertification = {
12419
+ agentId: string;
12420
+ entityId?: string;
12421
+ ownerWallet?: string;
12422
+ status?: string;
12423
+ agentWallet?: string;
12424
+ treasuryAccount?: string;
12425
+ primaryChain?: string;
12426
+ rulesHash?: string;
12427
+ ruleRef?: string;
12428
+ blsGroupPublicKey?: string;
12429
+ stateHistoryTopicId?: string;
12430
+ recentEvents: Array<{
12431
+ agentId: string;
12432
+ type: string;
12433
+ payload: Record<string, unknown>;
12434
+ timestamp: string;
12435
+ }>;
12436
+ recentTxIds: string[];
12437
+ };
12438
+ export type AgentEvent = {
12439
+ eventId: string;
12440
+ agentId: string;
12441
+ type: string;
12442
+ data: Record<string, unknown>;
12443
+ timestamp: string;
12444
+ };
12445
+ export type AgentBalance = {
12446
+ chain: string;
12447
+ accountId: string;
12448
+ balance: string;
12449
+ symbol: string;
12450
+ };
12451
+ export type AgentFundRequest = {
12452
+ chain: string;
12453
+ amount: string;
12454
+ source?: string;
12548
12455
  };
12549
- export interface BaasConnectToClusterShared {
12550
- appId?: string;
12551
- appName?: string;
12456
+ export type AgentTradeRequest = {
12457
+ chain: string;
12458
+ pair: string;
12459
+ side: "buy" | "sell";
12460
+ amount: string;
12461
+ price?: string;
12462
+ };
12463
+ export type AgentWithdrawRequest = {
12464
+ chain: string;
12465
+ amount: string;
12466
+ destination: string;
12467
+ };
12468
+ export type AgentExecuteRequest = {
12469
+ capability: string;
12470
+ chain?: string;
12471
+ params: Record<string, unknown>;
12472
+ };
12473
+ export type AgentExecuteStepResult = {
12474
+ kind: "onchain" | "offchain" | "function";
12475
+ status: string;
12476
+ transactionBytes?: string;
12477
+ ref?: string;
12478
+ detail?: Record<string, unknown>;
12479
+ };
12480
+ export type AgentExecuteResponse = {
12481
+ capability: string;
12482
+ steps: AgentExecuteStepResult[];
12483
+ awaitingApproval?: boolean;
12484
+ pendingOpId?: string;
12485
+ };
12486
+ export type AgentPreparedTransactionResponse = PreparedTransactionResponse & {
12487
+ success: true;
12488
+ };
12489
+ export type AgentPendingApprovalResponse = {
12490
+ success: true;
12491
+ pendingOpId: string;
12492
+ agentId: string;
12493
+ action: string;
12494
+ status: "awaiting_approval";
12495
+ description: string;
12496
+ };
12497
+ declare class AgentsClient {
12498
+ private readonly http;
12499
+ constructor(http: HttpClient);
12500
+ register(request: AgentRegisterRequest, opts?: HttpCallOptions): Promise<AgentInfo>;
12501
+ get(agentId: string, opts?: HttpCallOptions): Promise<AgentInfo>;
12502
+ list(opts?: HttpCallOptions): Promise<{
12503
+ agents: AgentInfo[];
12504
+ total: number;
12505
+ }>;
12506
+ fund(agentId: string, request: AgentFundRequest, opts?: HttpCallOptions): Promise<AgentPreparedTransactionResponse | AgentPendingApprovalResponse>;
12507
+ trade(agentId: string, request: AgentTradeRequest, opts?: HttpCallOptions): Promise<AgentPreparedTransactionResponse>;
12508
+ withdraw(agentId: string, request: AgentWithdrawRequest, opts?: HttpCallOptions): Promise<AgentPreparedTransactionResponse>;
12509
+ execute(agentId: string, request: AgentExecuteRequest, opts?: HttpCallOptions): Promise<AgentExecuteResponse & {
12510
+ success: true;
12511
+ }>;
12512
+ pause(agentId: string, opts?: HttpCallOptions): Promise<{
12513
+ success: boolean;
12514
+ status: string;
12515
+ }>;
12516
+ resume(agentId: string, opts?: HttpCallOptions): Promise<{
12517
+ success: boolean;
12518
+ status: string;
12519
+ }>;
12520
+ revoke(agentId: string, opts?: HttpCallOptions): Promise<{
12521
+ success: boolean;
12522
+ status: string;
12523
+ }>;
12524
+ certification(agentId: string, opts?: HttpCallOptions): Promise<AgentCertification>;
12525
+ updateRules(agentId: string, rules: Partial<AgentRules>, opts?: HttpCallOptions): Promise<AgentInfo>;
12526
+ getEvents(agentId: string, opts?: HttpCallOptions): Promise<{
12527
+ events: AgentEvent[];
12528
+ total: number;
12529
+ }>;
12530
+ getBalances(agentId: string, opts?: HttpCallOptions): Promise<{
12531
+ balances: AgentBalance[];
12532
+ }>;
12533
+ approve(agentId: string, operationId: string, opts?: HttpCallOptions): Promise<{
12534
+ success: boolean;
12535
+ }>;
12536
+ reject(agentId: string, operationId: string, opts?: HttpCallOptions): Promise<{
12537
+ success: boolean;
12538
+ }>;
12539
+ }
12540
+ export interface SmartEngineClientConfig {
12541
+ validatorBaseUrl: string;
12542
+ apiKey?: string;
12543
+ authToken?: string;
12552
12544
  timeout?: number;
12553
12545
  allowInsecure?: boolean;
12554
- pathPrefix?: string;
12555
- trustAnchor?: {
12556
- network: "mainnet" | "testnet" | "previewnet";
12557
- registryTopicId: string;
12558
- mirrorNodeUrl?: string;
12546
+ }
12547
+ export interface NetworkConnectionConfig {
12548
+ network: "mainnet" | "testnet" | "previewnet";
12549
+ registryTopicId: string;
12550
+ chain: AuthChain;
12551
+ address: string;
12552
+ publicKey: string;
12553
+ signFn: (challenge: string) => string | Promise<string>;
12554
+ metadata?: {
12555
+ appId?: string;
12556
+ appName?: string;
12559
12557
  };
12558
+ mirrorNodeUrl?: string;
12559
+ allowInsecure?: boolean;
12560
12560
  }
12561
- export type BaasConnectToClusterConfig = ({
12562
- network: NetworkName;
12563
- bootstrap?: never;
12564
- } & BaasConnectToClusterShared) | ({
12565
- bootstrap: string[];
12566
- network?: never;
12567
- } & BaasConnectToClusterShared);
12568
- declare class BaasClient {
12569
- private readonly hostUrl;
12570
- private readonly pathPrefix;
12571
- private appId;
12572
- private readonly timeout;
12573
- private readonly allowInsecure;
12561
+ export interface NetworkConnectionResult {
12562
+ client: SmartEngineClient;
12563
+ validator: ValidatorInfo;
12564
+ session: AuthenticateResponse;
12565
+ }
12566
+ declare class SmartEngineClient {
12567
+ private baseUrl;
12568
+ private allowInsecure;
12574
12569
  private readonly http;
12570
+ private readonly txHttp;
12575
12571
  private lastHttpError?;
12576
- private authContext?;
12577
- readonly db: DatabaseClient;
12578
- readonly storage: StorageClient;
12579
- readonly functions: FunctionsClient;
12580
- readonly messaging: MessagingClient;
12581
- readonly deployment: DeploymentClient;
12572
+ readonly subscription: SubscriptionClient;
12573
+ readonly faucet: FaucetClient;
12574
+ readonly tss: TSSClient;
12575
+ readonly ipfs: IPFSClient;
12576
+ readonly transactions: TransactionsClient;
12577
+ readonly hedera: HederaTransactionsClient;
12578
+ readonly xrpl: XrplTransactionsClient;
12579
+ readonly solana: SolanaTransactionsClient;
12580
+ readonly polkadot: PolkadotTransactionsClient;
12581
+ readonly snapshots: SnapshotsClient;
12582
+ readonly historicalBalance: HistoricalBalanceClient;
12583
+ readonly settlement: SettlementClient;
12584
+ readonly governance: GovernanceClient;
12585
+ readonly dao: DaoClient;
12586
+ readonly personhood: PersonhoodClient;
12582
12587
  readonly agents: AgentsClient;
12583
- readonly customerSession: CustomerSessionClient;
12584
- readonly rules: RulesClient;
12585
- readonly entities: EntitiesClient;
12586
- constructor(config: BaasClientConfig);
12587
- static connectToCluster(config: BaasConnectToClusterConfig): Promise<BaasClient>;
12588
- setAppId(appId: string): void;
12588
+ readonly deployments: DeploymentClient;
12589
+ readonly bridge: BridgeClient;
12590
+ readonly resources: ResourcesClient;
12591
+ readonly envelope: EnvelopeClient;
12592
+ readonly tokens: TokensClient;
12593
+ readonly operator: OperatorClient;
12594
+ readonly discovery: DiscoveryClient;
12595
+ constructor(config: SmartEngineClientConfig);
12596
+ static fromEnv(env: Record<string, string | undefined>): SmartEngineClient;
12597
+ static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
12598
+ getBaseUrl(): string;
12589
12599
  isAuthenticated(): boolean;
12590
- getAppId(): string | undefined;
12591
- getHostUrl(): string;
12592
12600
  getHttpHealth(): {
12593
12601
  breaker: CircuitBreakerSnapshot | null;
12594
12602
  lastError?: Error;
12595
12603
  };
12596
- private requireAppId;
12597
- authenticate(options: AuthenticateOptions): Promise<BaasAuthResult>;
12598
- private reauthenticate;
12599
- validateSession(): Promise<BaasSessionInfo>;
12600
- logout(): Promise<void>;
12601
- private requireAuth;
12604
+ getHealth(): Promise<{
12605
+ status: string;
12606
+ timestamp: string;
12607
+ chains: any[];
12608
+ }>;
12609
+ getSupportedChains(): Promise<{
12610
+ chains: string[];
12611
+ }>;
12612
+ createAccount(request: ValidatorCreateAccountRequest): Promise<CreateAccountResponse>;
12613
+ getAccountInfo(chain: string, accountId: string): Promise<AccountInfo>;
12614
+ getBalance(chain: string, accountId: string): Promise<AccountBalance>;
12615
+ transfer(request: TransferRequest): Promise<TransferResponse>;
12616
+ getTransaction(chain: string, txId: string): Promise<Transaction>;
12617
+ getTransactionReceipt(chain: string, txId: string): Promise<any>;
12618
+ createToken(request: ValidatorCreateTokenRequest): Promise<CreateTokenResponse>;
12619
+ mintToken(request: MintTokenRequest): Promise<any>;
12620
+ getTokenInfo(chain: string, tokenId: string): Promise<TokenInfo>;
12621
+ burnToken(request: BurnTokenRequest): Promise<ActionResult>;
12622
+ pauseToken(request: TokenActionRequest): Promise<ActionResult>;
12623
+ unpauseToken(request: TokenActionRequest): Promise<ActionResult>;
12624
+ restrictAccount(request: TokenActionRequest): Promise<ActionResult>;
12625
+ unrestrictAccount(request: TokenActionRequest): Promise<ActionResult>;
12626
+ enableCompliance(request: TokenActionRequest): Promise<ActionResult>;
12627
+ disableCompliance(request: TokenActionRequest): Promise<ActionResult>;
12628
+ wipeFromAccount(request: TokenActionRequest): Promise<ActionResult>;
12629
+ getAllCapabilities(): Promise<any>;
12630
+ getChainCapabilities(chain: ChainType): Promise<any>;
12631
+ getSystemStatus(): Promise<any>;
12632
+ submitMessage(chain: string, topicId: string, message: string): Promise<any>;
12633
+ getClusterHealth(): Promise<{
12634
+ status: string;
12635
+ nodes: number;
12636
+ healthy: number;
12637
+ unhealthy: number;
12638
+ }>;
12639
+ getClusterStatus(): Promise<{
12640
+ status: string;
12641
+ nodeId: string;
12642
+ nodes: Array<{
12643
+ nodeId: string;
12644
+ endpoint: string;
12645
+ status: string;
12646
+ lastSeen?: string;
12647
+ }>;
12648
+ quorum: {
12649
+ required: number;
12650
+ current: number;
12651
+ reached: boolean;
12652
+ };
12653
+ }>;
12654
+ getMetrics(): Promise<string>;
12655
+ getQueueStats(): Promise<{
12656
+ queues: Record<string, {
12657
+ pending: number;
12658
+ processing: number;
12659
+ completed: number;
12660
+ failed: number;
12661
+ }>;
12662
+ timestamp: string;
12663
+ }>;
12664
+ getCircuitBreakerStatus(): Promise<{
12665
+ breakers: Record<string, {
12666
+ state: "closed" | "open" | "half-open";
12667
+ failures: number;
12668
+ successes: number;
12669
+ lastFailure?: string;
12670
+ nextRetry?: string;
12671
+ }>;
12672
+ timestamp: string;
12673
+ }>;
12674
+ verifySignature(request: {
12675
+ chain: ChainType;
12676
+ message: string;
12677
+ signature: string;
12678
+ publicKey: string;
12679
+ }): Promise<{
12680
+ valid: boolean;
12681
+ chain: ChainType;
12682
+ }>;
12602
12683
  }
12603
12684
  export interface SmartEngineServiceConfig extends SmartEngineClientConfig {
12604
12685
  testConnection?: boolean;