@hsuite/smart-engines-sdk 3.2.0 → 3.2.1
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 +1051 -942
- package/dist/index.js +6175 -858
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.d.ts +815 -812
- package/dist/nestjs/index.js +5371 -239
- package/dist/nestjs/index.js.map +1 -1
- package/dist/pqc-verify/index.d.ts +99 -0
- package/dist/pqc-verify/index.js +167 -0
- package/dist/pqc-verify/index.js.map +1 -0
- package/package.json +10 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
import { Wallet } from 'xrpl';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
6
|
export type CircuitState = "closed" | "open" | "half_open";
|
|
@@ -489,7 +490,6 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
|
|
|
489
490
|
validatorTopicId: z.ZodString;
|
|
490
491
|
immutable: z.ZodDefault<z.ZodBoolean>;
|
|
491
492
|
securityMode: z.ZodDefault<z.ZodEnum<[
|
|
492
|
-
"none",
|
|
493
493
|
"partial",
|
|
494
494
|
"full"
|
|
495
495
|
]>>;
|
|
@@ -497,7 +497,7 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
|
|
|
497
497
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
498
498
|
}, "strip", z.ZodTypeAny, {
|
|
499
499
|
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
500
|
-
securityMode: "
|
|
500
|
+
securityMode: "partial" | "full";
|
|
501
501
|
initialBalance: string;
|
|
502
502
|
validatorTimestamp: string;
|
|
503
503
|
validatorTopicId: string;
|
|
@@ -514,7 +514,7 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
|
|
|
514
514
|
validatorTopicId: string;
|
|
515
515
|
publicKey?: string | undefined;
|
|
516
516
|
metadata?: Record<string, any> | undefined;
|
|
517
|
-
securityMode?: "
|
|
517
|
+
securityMode?: "partial" | "full" | undefined;
|
|
518
518
|
appOwnerPublicKey?: string | undefined;
|
|
519
519
|
memo?: string | undefined;
|
|
520
520
|
payerAccountId?: string | undefined;
|
|
@@ -990,7 +990,7 @@ export interface ClusterDiscoveryConfig {
|
|
|
990
990
|
trustAnchor?: ValidatorDiscoveryConfig;
|
|
991
991
|
allowInsecure?: boolean;
|
|
992
992
|
}
|
|
993
|
-
declare class ClusterDiscoveryClient {
|
|
993
|
+
export declare class ClusterDiscoveryClient {
|
|
994
994
|
private readonly bootstrap;
|
|
995
995
|
private readonly cacheTtlMs;
|
|
996
996
|
private readonly fetchTimeoutMs;
|
|
@@ -1070,6 +1070,14 @@ export declare class ValidatorAuthError extends Error {
|
|
|
1070
1070
|
details?: any | undefined;
|
|
1071
1071
|
constructor(message: string, statusCode: number, details?: any | undefined);
|
|
1072
1072
|
}
|
|
1073
|
+
export type Web3Signer = {
|
|
1074
|
+
chain: "xrpl";
|
|
1075
|
+
address: string;
|
|
1076
|
+
publicKey: string;
|
|
1077
|
+
signFn: (challenge: string) => string;
|
|
1078
|
+
wallet: Wallet;
|
|
1079
|
+
};
|
|
1080
|
+
export declare function createXrplWeb3Signer(seed: string): Web3Signer;
|
|
1073
1081
|
interface RetryConfig$1 {
|
|
1074
1082
|
maxRetries: number;
|
|
1075
1083
|
initialDelayMs: number;
|
|
@@ -1409,7 +1417,7 @@ export declare class IPFSClient {
|
|
|
1409
1417
|
getStatus(): Promise<IpfsStatusResponse>;
|
|
1410
1418
|
getStorageUsage(): Promise<IpfsStorageUsageResponse>;
|
|
1411
1419
|
}
|
|
1412
|
-
export type SecurityMode = "
|
|
1420
|
+
export type SecurityMode = "partial" | "full";
|
|
1413
1421
|
export type PreparedTransaction = {
|
|
1414
1422
|
success?: boolean;
|
|
1415
1423
|
transactionBytes: string;
|
|
@@ -1943,886 +1951,1041 @@ export declare function isPersonhoodVerifierNotConfigured(err: unknown): err is
|
|
|
1943
1951
|
error: typeof PERSONHOOD_VERIFIER_NOT_CONFIGURED;
|
|
1944
1952
|
};
|
|
1945
1953
|
};
|
|
1946
|
-
export
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
registryTopicId: string;
|
|
1957
|
-
chain: AuthChain;
|
|
1958
|
-
address: string;
|
|
1959
|
-
publicKey: string;
|
|
1960
|
-
signFn: (challenge: string) => string | Promise<string>;
|
|
1961
|
-
metadata?: {
|
|
1962
|
-
appId?: string;
|
|
1963
|
-
appName?: string;
|
|
1964
|
-
};
|
|
1965
|
-
mirrorNodeUrl?: string;
|
|
1966
|
-
allowInsecure?: boolean;
|
|
1967
|
-
}
|
|
1968
|
-
export interface ClusterConnectionConfig {
|
|
1969
|
-
bootstrap: string[];
|
|
1970
|
-
chain: AuthChain;
|
|
1971
|
-
address: string;
|
|
1972
|
-
publicKey: string;
|
|
1973
|
-
signFn: (challenge: string) => string | Promise<string>;
|
|
1974
|
-
metadata?: {
|
|
1975
|
-
appId?: string;
|
|
1976
|
-
appName?: string;
|
|
1977
|
-
};
|
|
1978
|
-
trustAnchor?: {
|
|
1979
|
-
network: "mainnet" | "testnet" | "previewnet";
|
|
1980
|
-
registryTopicId: string;
|
|
1981
|
-
mirrorNodeUrl?: string;
|
|
1954
|
+
export type AgentStatus = "active" | "paused" | "revoked" | "pending";
|
|
1955
|
+
export type AgentRegisterRequest = {
|
|
1956
|
+
name: string;
|
|
1957
|
+
description?: string;
|
|
1958
|
+
capabilities: string[];
|
|
1959
|
+
rules: AgentRules;
|
|
1960
|
+
fundingConfig?: {
|
|
1961
|
+
chain: string;
|
|
1962
|
+
maxAmount: string;
|
|
1963
|
+
autoFund: boolean;
|
|
1982
1964
|
};
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1965
|
+
};
|
|
1966
|
+
export type AgentRules = {
|
|
1967
|
+
maxTradeAmount?: string;
|
|
1968
|
+
allowedPairs?: string[];
|
|
1969
|
+
allowedChains?: string[];
|
|
1970
|
+
dailyLimit?: string;
|
|
1971
|
+
requireApprovalAbove?: string;
|
|
1972
|
+
customRules?: Record<string, unknown>;
|
|
1973
|
+
};
|
|
1974
|
+
export type AgentRulesValidationResult = {
|
|
1975
|
+
valid: boolean;
|
|
1976
|
+
errors: string[];
|
|
1977
|
+
};
|
|
1978
|
+
export declare function validateAgentRules(rules: AgentRules): AgentRulesValidationResult;
|
|
1979
|
+
export type AgentInfo = {
|
|
1980
|
+
agentId: string;
|
|
1981
|
+
name: string;
|
|
1982
|
+
description?: string;
|
|
1983
|
+
status: AgentStatus;
|
|
1984
|
+
capabilities: string[];
|
|
1985
|
+
rules: AgentRules;
|
|
1986
|
+
owner: string;
|
|
1987
|
+
createdAt: string;
|
|
1988
|
+
lastActiveAt?: string;
|
|
1989
|
+
};
|
|
1990
|
+
export type AgentEvent = {
|
|
1991
|
+
eventId: string;
|
|
1992
|
+
agentId: string;
|
|
1993
|
+
type: string;
|
|
1994
|
+
data: Record<string, unknown>;
|
|
1995
|
+
timestamp: string;
|
|
1996
|
+
};
|
|
1997
|
+
export type AgentBalance = {
|
|
1998
|
+
chain: string;
|
|
1999
|
+
accountId: string;
|
|
2000
|
+
balance: string;
|
|
2001
|
+
symbol: string;
|
|
2002
|
+
};
|
|
2003
|
+
export type AgentOperation = {
|
|
2004
|
+
operationId: string;
|
|
2005
|
+
agentId: string;
|
|
2006
|
+
type: string;
|
|
2007
|
+
amount: string;
|
|
2008
|
+
chain: string;
|
|
2009
|
+
status: "pending" | "approved" | "rejected";
|
|
2010
|
+
createdAt: string;
|
|
2011
|
+
};
|
|
2012
|
+
export type AgentFundRequest = {
|
|
2013
|
+
chain: string;
|
|
2014
|
+
amount: string;
|
|
2015
|
+
source?: string;
|
|
2016
|
+
};
|
|
2017
|
+
export type AgentTradeRequest = {
|
|
2018
|
+
chain: string;
|
|
2019
|
+
pair: string;
|
|
2020
|
+
side: "buy" | "sell";
|
|
2021
|
+
amount: string;
|
|
2022
|
+
price?: string;
|
|
2023
|
+
};
|
|
2024
|
+
export type AgentWithdrawRequest = {
|
|
2025
|
+
chain: string;
|
|
2026
|
+
amount: string;
|
|
2027
|
+
destination: string;
|
|
2028
|
+
};
|
|
2029
|
+
export declare class AgentsClient {
|
|
1998
2030
|
private readonly http;
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
readonly hedera: HederaTransactionsClient;
|
|
2006
|
-
readonly xrpl: XrplTransactionsClient;
|
|
2007
|
-
readonly solana: SolanaTransactionsClient;
|
|
2008
|
-
readonly polkadot: PolkadotTransactionsClient;
|
|
2009
|
-
readonly snapshots: SnapshotsClient;
|
|
2010
|
-
readonly historicalBalance: HistoricalBalanceClient;
|
|
2011
|
-
readonly settlement: SettlementClient;
|
|
2012
|
-
readonly governance: GovernanceClient;
|
|
2013
|
-
readonly personhood: PersonhoodClient;
|
|
2014
|
-
constructor(config: SmartEngineClientConfig);
|
|
2015
|
-
static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
|
|
2016
|
-
static connectToCluster(config: ClusterConnectionConfig): Promise<ClusterConnectionResult>;
|
|
2017
|
-
getBaseUrl(): string;
|
|
2018
|
-
isAuthenticated(): boolean;
|
|
2019
|
-
getHttpHealth(): {
|
|
2020
|
-
breaker: CircuitBreakerSnapshot | null;
|
|
2021
|
-
lastError?: Error;
|
|
2022
|
-
};
|
|
2023
|
-
getHealth(): Promise<{
|
|
2024
|
-
status: string;
|
|
2025
|
-
timestamp: string;
|
|
2026
|
-
chains: any[];
|
|
2031
|
+
constructor(http: HttpClient);
|
|
2032
|
+
register(request: AgentRegisterRequest): Promise<AgentInfo>;
|
|
2033
|
+
get(agentId: string): Promise<AgentInfo>;
|
|
2034
|
+
list(): Promise<{
|
|
2035
|
+
agents: AgentInfo[];
|
|
2036
|
+
total: number;
|
|
2027
2037
|
}>;
|
|
2028
|
-
|
|
2029
|
-
|
|
2038
|
+
fund(agentId: string, request: AgentFundRequest): Promise<{
|
|
2039
|
+
success: boolean;
|
|
2040
|
+
txId?: string;
|
|
2030
2041
|
}>;
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
pauseToken(request: TokenActionRequest): Promise<ActionResult>;
|
|
2042
|
-
unpauseToken(request: TokenActionRequest): Promise<ActionResult>;
|
|
2043
|
-
restrictAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
2044
|
-
unrestrictAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
2045
|
-
enableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
2046
|
-
disableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
2047
|
-
wipeFromAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
2048
|
-
getAllCapabilities(): Promise<any>;
|
|
2049
|
-
getChainCapabilities(chain: ChainType): Promise<any>;
|
|
2050
|
-
getSystemStatus(): Promise<any>;
|
|
2051
|
-
submitMessage(chain: string, topicId: string, message: string): Promise<any>;
|
|
2052
|
-
getClusterHealth(): Promise<{
|
|
2042
|
+
trade(agentId: string, request: AgentTradeRequest): Promise<{
|
|
2043
|
+
success: boolean;
|
|
2044
|
+
txId?: string;
|
|
2045
|
+
}>;
|
|
2046
|
+
withdraw(agentId: string, request: AgentWithdrawRequest): Promise<{
|
|
2047
|
+
success: boolean;
|
|
2048
|
+
txId?: string;
|
|
2049
|
+
}>;
|
|
2050
|
+
pause(agentId: string): Promise<{
|
|
2051
|
+
success: boolean;
|
|
2053
2052
|
status: string;
|
|
2054
|
-
nodes: number;
|
|
2055
|
-
healthy: number;
|
|
2056
|
-
unhealthy: number;
|
|
2057
2053
|
}>;
|
|
2058
|
-
|
|
2054
|
+
resume(agentId: string): Promise<{
|
|
2055
|
+
success: boolean;
|
|
2059
2056
|
status: string;
|
|
2060
|
-
nodeId: string;
|
|
2061
|
-
nodes: Array<{
|
|
2062
|
-
nodeId: string;
|
|
2063
|
-
endpoint: string;
|
|
2064
|
-
status: string;
|
|
2065
|
-
lastSeen?: string;
|
|
2066
|
-
}>;
|
|
2067
|
-
quorum: {
|
|
2068
|
-
required: number;
|
|
2069
|
-
current: number;
|
|
2070
|
-
reached: boolean;
|
|
2071
|
-
};
|
|
2072
2057
|
}>;
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
pending: number;
|
|
2077
|
-
processing: number;
|
|
2078
|
-
completed: number;
|
|
2079
|
-
failed: number;
|
|
2080
|
-
}>;
|
|
2081
|
-
timestamp: string;
|
|
2058
|
+
revoke(agentId: string): Promise<{
|
|
2059
|
+
success: boolean;
|
|
2060
|
+
status: string;
|
|
2082
2061
|
}>;
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
successes: number;
|
|
2088
|
-
lastFailure?: string;
|
|
2089
|
-
nextRetry?: string;
|
|
2090
|
-
}>;
|
|
2091
|
-
timestamp: string;
|
|
2062
|
+
updateRules(agentId: string, rules: Partial<AgentRules>): Promise<AgentInfo>;
|
|
2063
|
+
getEvents(agentId: string): Promise<{
|
|
2064
|
+
events: AgentEvent[];
|
|
2065
|
+
total: number;
|
|
2092
2066
|
}>;
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
message: string;
|
|
2096
|
-
signature: string;
|
|
2097
|
-
publicKey: string;
|
|
2098
|
-
}): Promise<{
|
|
2099
|
-
valid: boolean;
|
|
2100
|
-
chain: ChainType;
|
|
2067
|
+
getBalances(agentId: string): Promise<{
|
|
2068
|
+
balances: AgentBalance[];
|
|
2101
2069
|
}>;
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
}
|
|
2109
|
-
export type
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
total: number;
|
|
2118
|
-
verified: number;
|
|
2119
|
-
};
|
|
2120
|
-
uptime: number;
|
|
2121
|
-
};
|
|
2122
|
-
export type GatewayReadinessResponse = {
|
|
2123
|
-
ready: boolean;
|
|
2124
|
-
checks: Record<string, boolean>;
|
|
2125
|
-
};
|
|
2126
|
-
export type GatewayLivenessResponse = {
|
|
2127
|
-
alive: boolean;
|
|
2128
|
-
timestamp: string;
|
|
2070
|
+
approve(agentId: string, operationId: string): Promise<{
|
|
2071
|
+
success: boolean;
|
|
2072
|
+
}>;
|
|
2073
|
+
reject(agentId: string, operationId: string): Promise<{
|
|
2074
|
+
success: boolean;
|
|
2075
|
+
}>;
|
|
2076
|
+
}
|
|
2077
|
+
export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging";
|
|
2078
|
+
export type BaasSupportedChain = "hedera" | "xrpl" | "polkadot" | "solana";
|
|
2079
|
+
export type BaasEndpoints = {
|
|
2080
|
+
auth: string;
|
|
2081
|
+
database: string;
|
|
2082
|
+
storage: string;
|
|
2083
|
+
functions: string;
|
|
2084
|
+
messaging: string;
|
|
2129
2085
|
};
|
|
2130
|
-
export type
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
avgLatencyMs: number;
|
|
2136
|
-
};
|
|
2137
|
-
hosts: {
|
|
2138
|
-
total: number;
|
|
2139
|
-
healthy: number;
|
|
2140
|
-
unhealthy: number;
|
|
2141
|
-
};
|
|
2142
|
-
bandwidth: {
|
|
2143
|
-
inbound: number;
|
|
2144
|
-
outbound: number;
|
|
2145
|
-
};
|
|
2146
|
-
timestamp: string;
|
|
2086
|
+
export type DeployedAppStatus = "pending" | "deploying" | "active" | "suspended" | "deleted";
|
|
2087
|
+
export type DeployedAppLimits = {
|
|
2088
|
+
storage: string;
|
|
2089
|
+
functions: number;
|
|
2090
|
+
channels: number;
|
|
2147
2091
|
};
|
|
2148
|
-
export type
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2092
|
+
export type DeployedAppUsage = {
|
|
2093
|
+
storage: number;
|
|
2094
|
+
functions: number;
|
|
2095
|
+
channels: number;
|
|
2152
2096
|
};
|
|
2153
|
-
export type
|
|
2097
|
+
export type DeployedApp = {
|
|
2098
|
+
appId: string;
|
|
2154
2099
|
name: string;
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2100
|
+
services: BaasService[];
|
|
2101
|
+
status: DeployedAppStatus;
|
|
2102
|
+
owner: string;
|
|
2103
|
+
endpoints: BaasEndpoints;
|
|
2104
|
+
environment?: Record<string, string>;
|
|
2105
|
+
limits: DeployedAppLimits;
|
|
2106
|
+
usage: DeployedAppUsage;
|
|
2107
|
+
createdAt: string;
|
|
2108
|
+
updatedAt?: string;
|
|
2158
2109
|
};
|
|
2159
|
-
export type
|
|
2160
|
-
|
|
2110
|
+
export type DeployedAppInfo = {
|
|
2111
|
+
appId: string;
|
|
2161
2112
|
name: string;
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
lastSeen: string;
|
|
2167
|
-
registeredAt: string;
|
|
2168
|
-
metadata?: Record<string, unknown>;
|
|
2113
|
+
status: "active" | "inactive" | "deploying" | "error";
|
|
2114
|
+
services: string[];
|
|
2115
|
+
endpoints: BaasEndpoints;
|
|
2116
|
+
createdAt: string;
|
|
2169
2117
|
};
|
|
2170
|
-
export type
|
|
2171
|
-
|
|
2172
|
-
|
|
2118
|
+
export type BaasAuthConfig = {
|
|
2119
|
+
chain: BaasSupportedChain;
|
|
2120
|
+
walletAddress: string;
|
|
2121
|
+
publicKey: string;
|
|
2122
|
+
signFn: (message: string) => string | Promise<string>;
|
|
2173
2123
|
};
|
|
2174
|
-
export type
|
|
2175
|
-
|
|
2176
|
-
|
|
2124
|
+
export type BaasClientConfig = {
|
|
2125
|
+
hostUrl: string;
|
|
2126
|
+
appId?: string;
|
|
2127
|
+
appName?: string;
|
|
2128
|
+
auth?: BaasAuthConfig;
|
|
2129
|
+
services?: BaasService[];
|
|
2177
2130
|
timeout?: number;
|
|
2178
|
-
|
|
2179
|
-
|
|
2131
|
+
allowInsecure?: boolean;
|
|
2132
|
+
http?: ResilientHttpConfig;
|
|
2133
|
+
pathPrefix?: string;
|
|
2180
2134
|
};
|
|
2181
|
-
export type
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
body?: unknown;
|
|
2135
|
+
export type BaasChallengeRequest = {
|
|
2136
|
+
chain: BaasSupportedChain;
|
|
2137
|
+
walletAddress: string;
|
|
2138
|
+
appId: string;
|
|
2139
|
+
metadata?: Record<string, unknown>;
|
|
2187
2140
|
};
|
|
2188
|
-
export type
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2141
|
+
export type BaasChallengeResponse = {
|
|
2142
|
+
challengeId: string;
|
|
2143
|
+
message: string;
|
|
2144
|
+
expiresAt: number;
|
|
2145
|
+
chain?: BaasSupportedChain;
|
|
2146
|
+
walletAddress?: string;
|
|
2147
|
+
appId?: string;
|
|
2194
2148
|
};
|
|
2195
|
-
export type
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
hostStats: Record<string, {
|
|
2200
|
-
requests: number;
|
|
2201
|
-
errors: number;
|
|
2202
|
-
avgLatencyMs: number;
|
|
2203
|
-
}>;
|
|
2149
|
+
export type BaasVerifyRequest = {
|
|
2150
|
+
challengeId: string;
|
|
2151
|
+
signature: string;
|
|
2152
|
+
publicKey?: string;
|
|
2204
2153
|
};
|
|
2205
|
-
export type
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2154
|
+
export type BaasAuthResult = {
|
|
2155
|
+
authenticated?: boolean;
|
|
2156
|
+
walletAddress: string;
|
|
2157
|
+
chain: BaasSupportedChain;
|
|
2158
|
+
appId: string;
|
|
2159
|
+
token: string;
|
|
2160
|
+
expiresAt: number;
|
|
2210
2161
|
};
|
|
2211
|
-
export type
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
dnssecEnabled: boolean;
|
|
2162
|
+
export type BaasSessionInfo = {
|
|
2163
|
+
valid: boolean;
|
|
2164
|
+
walletAddress?: string;
|
|
2165
|
+
chain?: BaasSupportedChain;
|
|
2166
|
+
appId?: string;
|
|
2167
|
+
permissions?: string[];
|
|
2168
|
+
sessionId?: string;
|
|
2169
|
+
expiresAt?: number;
|
|
2170
|
+
error?: string;
|
|
2221
2171
|
};
|
|
2222
|
-
export type
|
|
2223
|
-
|
|
2224
|
-
|
|
2172
|
+
export type BaasDocument = {
|
|
2173
|
+
_id: string;
|
|
2174
|
+
data: Record<string, unknown>;
|
|
2175
|
+
createdAt: number;
|
|
2176
|
+
updatedAt: number;
|
|
2177
|
+
version: number;
|
|
2225
2178
|
};
|
|
2226
|
-
export type
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2179
|
+
export type DbDocument<T = Record<string, unknown>> = {
|
|
2180
|
+
_id: string;
|
|
2181
|
+
data: T;
|
|
2182
|
+
createdAt: number;
|
|
2183
|
+
updatedAt: number;
|
|
2184
|
+
version: number;
|
|
2232
2185
|
};
|
|
2233
|
-
export type
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2186
|
+
export type BaasStateTransition = {
|
|
2187
|
+
transitionId: string;
|
|
2188
|
+
operation: "insert" | "update" | "delete";
|
|
2189
|
+
collection: string;
|
|
2190
|
+
documentId: string;
|
|
2191
|
+
previousHash: string;
|
|
2192
|
+
newHash: string;
|
|
2193
|
+
stateRoot: string;
|
|
2194
|
+
timestamp: number;
|
|
2195
|
+
proof: BaasMerkleProof;
|
|
2238
2196
|
};
|
|
2239
|
-
export type
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
error?: string;
|
|
2197
|
+
export type BaasMerkleProof = {
|
|
2198
|
+
root: string;
|
|
2199
|
+
leaf: string;
|
|
2200
|
+
siblings: string[];
|
|
2201
|
+
path: ("left" | "right")[];
|
|
2245
2202
|
};
|
|
2246
|
-
export type
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
value: string;
|
|
2250
|
-
ttl?: number;
|
|
2251
|
-
priority?: number;
|
|
2203
|
+
export type BaasInsertResult = {
|
|
2204
|
+
document: BaasDocument;
|
|
2205
|
+
stateTransition: BaasStateTransition;
|
|
2252
2206
|
};
|
|
2253
|
-
export type
|
|
2254
|
-
|
|
2255
|
-
|
|
2207
|
+
export type BaasUpdateResult = {
|
|
2208
|
+
document: BaasDocument;
|
|
2209
|
+
stateTransition: BaasStateTransition;
|
|
2256
2210
|
};
|
|
2257
|
-
export type
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
records: Array<{
|
|
2261
|
-
value: string;
|
|
2262
|
-
ttl: number;
|
|
2263
|
-
}>;
|
|
2264
|
-
dnssec: boolean;
|
|
2265
|
-
timestamp: string;
|
|
2211
|
+
export type BaasDeleteResult = {
|
|
2212
|
+
deleted: boolean;
|
|
2213
|
+
stateTransition: BaasStateTransition;
|
|
2266
2214
|
};
|
|
2267
|
-
export type
|
|
2268
|
-
|
|
2269
|
-
|
|
2215
|
+
export type DbComparisonOperator = {
|
|
2216
|
+
$eq?: unknown;
|
|
2217
|
+
$ne?: unknown;
|
|
2218
|
+
$gt?: number;
|
|
2219
|
+
$gte?: number;
|
|
2220
|
+
$lt?: number;
|
|
2221
|
+
$lte?: number;
|
|
2222
|
+
$in?: unknown[];
|
|
2223
|
+
$nin?: unknown[];
|
|
2224
|
+
$exists?: boolean;
|
|
2225
|
+
$regex?: string;
|
|
2270
2226
|
};
|
|
2271
|
-
export type
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2227
|
+
export type DbQuery = Record<string, unknown | DbComparisonOperator>;
|
|
2228
|
+
export type BaasQueryOptions = {
|
|
2229
|
+
limit?: number;
|
|
2230
|
+
skip?: number;
|
|
2231
|
+
sort?: string;
|
|
2232
|
+
projection?: Record<string, 0 | 1>;
|
|
2277
2233
|
};
|
|
2278
|
-
export type
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
createdAt: string;
|
|
2284
|
-
updatedAt: string;
|
|
2234
|
+
export type BaasFindResult = {
|
|
2235
|
+
documents: BaasDocument[];
|
|
2236
|
+
count: number;
|
|
2237
|
+
limit: number;
|
|
2238
|
+
skip: number;
|
|
2285
2239
|
};
|
|
2286
|
-
export type
|
|
2287
|
-
|
|
2288
|
-
|
|
2240
|
+
export type BaasFileMetadata = {
|
|
2241
|
+
filename?: string;
|
|
2242
|
+
mimeType?: string;
|
|
2243
|
+
tags?: Record<string, string>;
|
|
2244
|
+
encrypted?: boolean;
|
|
2289
2245
|
};
|
|
2290
|
-
export type
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
createdAt: string;
|
|
2298
|
-
updatedAt: string;
|
|
2246
|
+
export type BaasUploadResult = {
|
|
2247
|
+
cid: string;
|
|
2248
|
+
size: number;
|
|
2249
|
+
mimeType: string;
|
|
2250
|
+
uploadedAt: string;
|
|
2251
|
+
filename?: string;
|
|
2252
|
+
encrypted?: boolean;
|
|
2299
2253
|
};
|
|
2300
|
-
export type
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2254
|
+
export type BaasFileInfo = {
|
|
2255
|
+
cid: string;
|
|
2256
|
+
filename?: string;
|
|
2257
|
+
size: number;
|
|
2258
|
+
mimeType?: string;
|
|
2259
|
+
uploadedAt: string;
|
|
2260
|
+
lastAccessedAt?: string;
|
|
2261
|
+
tags?: Record<string, string>;
|
|
2307
2262
|
};
|
|
2308
|
-
export type
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
digestType: number;
|
|
2312
|
-
digest: string;
|
|
2263
|
+
export type BaasStorageUsage = {
|
|
2264
|
+
totalSize: number;
|
|
2265
|
+
fileCount: number;
|
|
2313
2266
|
};
|
|
2314
|
-
export
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
}>;
|
|
2321
|
-
getAllHosts(): Promise<HostListResponse>;
|
|
2322
|
-
getVerifiedHosts(): Promise<HostListResponse>;
|
|
2323
|
-
getHost(hostId: string): Promise<HostInfo>;
|
|
2324
|
-
verifyHost(hostId: string): Promise<{
|
|
2325
|
-
verified: boolean;
|
|
2326
|
-
message: string;
|
|
2327
|
-
}>;
|
|
2328
|
-
setRoutingConfig(appId: string, config: RoutingConfig): Promise<RoutingConfig>;
|
|
2329
|
-
getRoutingConfig(appId: string): Promise<RoutingConfig>;
|
|
2330
|
-
proxyRequest(request: ProxyRequest): Promise<ProxyResponse>;
|
|
2331
|
-
getStats(): Promise<RoutingStatsResponse>;
|
|
2332
|
-
mapDomainToApp(domain: string, appId: string): Promise<{
|
|
2333
|
-
success: boolean;
|
|
2334
|
-
domain: string;
|
|
2335
|
-
appId: string;
|
|
2336
|
-
}>;
|
|
2337
|
-
}
|
|
2338
|
-
export declare class DomainsClient {
|
|
2339
|
-
private readonly http;
|
|
2340
|
-
constructor(http: HttpClient);
|
|
2341
|
-
register(request: DomainRegistrationRequest): Promise<DomainInfo>;
|
|
2342
|
-
checkAvailability(domain: string): Promise<DomainAvailabilityResponse>;
|
|
2343
|
-
getInfo(domain: string): Promise<DomainInfo>;
|
|
2344
|
-
list(owner?: string): Promise<DomainListResponse>;
|
|
2345
|
-
generateVerificationToken(domain: string, method: "dns" | "http" | "email"): Promise<VerificationTokenResponse>;
|
|
2346
|
-
verifyOwnership(domain: string, token: string): Promise<VerificationResult>;
|
|
2347
|
-
configureDns(domain: string, records: DnsRecord[]): Promise<{
|
|
2348
|
-
success: boolean;
|
|
2349
|
-
records: DnsRecord[];
|
|
2350
|
-
}>;
|
|
2351
|
-
enableDnssec(domain: string): Promise<{
|
|
2352
|
-
success: boolean;
|
|
2353
|
-
message: string;
|
|
2354
|
-
}>;
|
|
2355
|
-
disableDnssec(domain: string): Promise<{
|
|
2356
|
-
success: boolean;
|
|
2357
|
-
message: string;
|
|
2358
|
-
}>;
|
|
2359
|
-
renew(domain: string, years?: number): Promise<DomainInfo>;
|
|
2360
|
-
transfer(domain: string, request: DomainTransferRequest): Promise<{
|
|
2361
|
-
success: boolean;
|
|
2362
|
-
message: string;
|
|
2363
|
-
}>;
|
|
2364
|
-
approveTransfer(domain: string): Promise<{
|
|
2365
|
-
success: boolean;
|
|
2366
|
-
}>;
|
|
2367
|
-
rejectTransfer(domain: string): Promise<{
|
|
2368
|
-
success: boolean;
|
|
2369
|
-
}>;
|
|
2370
|
-
suspend(domain: string, reason: string): Promise<{
|
|
2371
|
-
success: boolean;
|
|
2372
|
-
}>;
|
|
2373
|
-
unsuspend(domain: string): Promise<{
|
|
2374
|
-
success: boolean;
|
|
2375
|
-
}>;
|
|
2376
|
-
}
|
|
2377
|
-
export declare class DnsClient {
|
|
2378
|
-
private readonly http;
|
|
2379
|
-
constructor(http: HttpClient);
|
|
2380
|
-
resolve(name: string, type?: string, dnssec?: boolean): Promise<DnsResolveResponse>;
|
|
2381
|
-
resolveBatch(queries: DnsBatchQuery[]): Promise<DnsBatchResolveResponse>;
|
|
2382
|
-
listZones(): Promise<DnsZoneListResponse>;
|
|
2383
|
-
getZone(zoneName: string): Promise<DnsZone & {
|
|
2384
|
-
records: DnsRecordInfo[];
|
|
2385
|
-
}>;
|
|
2386
|
-
createZone(request: {
|
|
2387
|
-
zoneName: string;
|
|
2388
|
-
description?: string;
|
|
2389
|
-
}): Promise<DnsZone>;
|
|
2390
|
-
deleteZone(zoneName: string): Promise<{
|
|
2391
|
-
success: boolean;
|
|
2392
|
-
}>;
|
|
2393
|
-
addRecord(zoneName: string, record: DnsRecord): Promise<DnsRecordInfo>;
|
|
2394
|
-
updateRecord(zoneName: string, recordId: string, updates: Partial<DnsRecord>): Promise<DnsRecordInfo>;
|
|
2395
|
-
deleteRecord(zoneName: string, recordId: string): Promise<{
|
|
2396
|
-
success: boolean;
|
|
2397
|
-
}>;
|
|
2398
|
-
generateDnssecKeys(zoneName: string, algorithm?: string): Promise<{
|
|
2399
|
-
keys: DnssecKey[];
|
|
2400
|
-
}>;
|
|
2401
|
-
getDnssecKeys(zoneName: string): Promise<{
|
|
2402
|
-
keys: DnssecKey[];
|
|
2403
|
-
}>;
|
|
2404
|
-
getDsRecord(zoneName: string): Promise<DnssecDsRecord>;
|
|
2405
|
-
clearCache(): Promise<{
|
|
2406
|
-
success: boolean;
|
|
2407
|
-
entriesCleared: number;
|
|
2408
|
-
}>;
|
|
2409
|
-
}
|
|
2410
|
-
export type SmartGatewayClientConfig = {
|
|
2411
|
-
baseUrl: string;
|
|
2412
|
-
apiKey?: string;
|
|
2413
|
-
authToken?: string;
|
|
2414
|
-
timeout?: number;
|
|
2415
|
-
allowInsecure?: boolean;
|
|
2267
|
+
export type BaasFunctionRuntime = "nodejs20" | "python3" | "deno";
|
|
2268
|
+
export type BaasTriggerType = "http" | "schedule" | "event" | "webhook";
|
|
2269
|
+
export type BaasFunctionResources = {
|
|
2270
|
+
memory: string;
|
|
2271
|
+
timeout: number;
|
|
2272
|
+
maxConcurrency?: number;
|
|
2416
2273
|
};
|
|
2417
|
-
export
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
declare function formatHederaAccountId(id: string): string;
|
|
2431
|
-
declare function parseHbar(amount: string): number;
|
|
2432
|
-
declare function hbarToTinybars(hbar: string | number): string;
|
|
2433
|
-
declare function tinybarsToHbar(tinybars: string | number): string;
|
|
2434
|
-
declare function formatHederaTokenId(id: string): string;
|
|
2435
|
-
declare function formatHederaTopicId(id: string): string;
|
|
2436
|
-
declare function validateXRPLAddress(address: string): boolean;
|
|
2437
|
-
declare function formatXRPLAddress(address: string): string;
|
|
2438
|
-
declare function xrpToDrops(xrp: string | number): string;
|
|
2439
|
-
declare function dropsToXrp(drops: string | number): string;
|
|
2440
|
-
declare function parseXRP(amount: string): number;
|
|
2441
|
-
declare function validateCurrencyCode(code: string): boolean;
|
|
2442
|
-
declare function validatePolkadotAddress(address: string): boolean;
|
|
2443
|
-
declare function formatPolkadotAddress(address: string, prefixLength?: number, suffixLength?: number): string;
|
|
2444
|
-
declare function dotToPlanck(dot: number): bigint;
|
|
2445
|
-
declare function planckToDot(planck: bigint): number;
|
|
2446
|
-
declare function formatDot(planck: bigint, decimals?: number): string;
|
|
2447
|
-
declare function parseDotString(dotString: string): bigint;
|
|
2448
|
-
declare function validateSolanaPublicKey(publicKey: string): boolean;
|
|
2449
|
-
declare function formatSolanaAddress(address: string, prefixLength?: number, suffixLength?: number): string;
|
|
2450
|
-
declare function solToLamports(sol: number): bigint;
|
|
2451
|
-
declare function lamportsToSol(lamports: bigint): number;
|
|
2452
|
-
declare function formatSol(lamports: bigint, decimals?: number): string;
|
|
2453
|
-
declare function parseSolString(solString: string): bigint;
|
|
2454
|
-
declare function isTransactionSignature(signature: string): boolean;
|
|
2455
|
-
declare function validateStellarAddress(address: string): boolean;
|
|
2456
|
-
declare function stroopsToXlm(stroops: string | number): string;
|
|
2457
|
-
declare function xlmToStroops(xlm: string | number): string;
|
|
2458
|
-
declare function validateBitcoinAddress(address: string): boolean;
|
|
2459
|
-
declare function satoshisToBtc(satoshis: string | number): string;
|
|
2460
|
-
declare function btcToSatoshis(btc: string | number): string;
|
|
2461
|
-
export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging";
|
|
2462
|
-
export type BaasSupportedChain = "hedera" | "xrpl" | "polkadot" | "solana";
|
|
2463
|
-
export type BaasEndpoints = {
|
|
2464
|
-
auth: string;
|
|
2465
|
-
database: string;
|
|
2466
|
-
storage: string;
|
|
2467
|
-
functions: string;
|
|
2468
|
-
messaging: string;
|
|
2274
|
+
export type BaasFunctionDeployRequest = {
|
|
2275
|
+
name: string;
|
|
2276
|
+
description?: string;
|
|
2277
|
+
runtime: BaasFunctionRuntime;
|
|
2278
|
+
code: string;
|
|
2279
|
+
codeType: "inline" | "ipfs";
|
|
2280
|
+
entryPoint?: string;
|
|
2281
|
+
triggers?: Array<{
|
|
2282
|
+
type: BaasTriggerType;
|
|
2283
|
+
config: Record<string, unknown>;
|
|
2284
|
+
}>;
|
|
2285
|
+
resources?: Partial<BaasFunctionResources>;
|
|
2286
|
+
environment?: Record<string, string>;
|
|
2469
2287
|
};
|
|
2470
|
-
export type
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2288
|
+
export type BaasFunctionDeployResult = {
|
|
2289
|
+
functionId: string;
|
|
2290
|
+
version: number;
|
|
2291
|
+
deployedAt: string;
|
|
2292
|
+
endpoints?: string[];
|
|
2293
|
+
status: "active" | "deploying" | "failed";
|
|
2294
|
+
error?: string;
|
|
2475
2295
|
};
|
|
2476
|
-
export type
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2296
|
+
export type BaasFunctionResult = {
|
|
2297
|
+
requestId: string;
|
|
2298
|
+
functionId: string;
|
|
2299
|
+
status: "success" | "error" | "timeout";
|
|
2300
|
+
result?: unknown;
|
|
2301
|
+
error?: string;
|
|
2302
|
+
logs?: string[];
|
|
2303
|
+
duration: number;
|
|
2304
|
+
memoryUsed?: number;
|
|
2480
2305
|
};
|
|
2481
|
-
export type
|
|
2482
|
-
|
|
2306
|
+
export type BaasFunctionInfo = {
|
|
2307
|
+
functionId: string;
|
|
2483
2308
|
name: string;
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
usage: DeployedAppUsage;
|
|
2491
|
-
createdAt: string;
|
|
2492
|
-
updatedAt?: string;
|
|
2309
|
+
runtime: BaasFunctionRuntime;
|
|
2310
|
+
version: number;
|
|
2311
|
+
status: "active" | "inactive" | "error";
|
|
2312
|
+
deployedAt: string;
|
|
2313
|
+
lastInvokedAt?: string;
|
|
2314
|
+
invocationCount: number;
|
|
2493
2315
|
};
|
|
2494
|
-
export type
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
createdAt: string;
|
|
2316
|
+
export type BaasFunctionLog = {
|
|
2317
|
+
timestamp: string;
|
|
2318
|
+
level: "debug" | "info" | "warn" | "error";
|
|
2319
|
+
message: string;
|
|
2320
|
+
requestId?: string;
|
|
2321
|
+
metadata?: Record<string, unknown>;
|
|
2501
2322
|
};
|
|
2502
|
-
export type
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2323
|
+
export type BaasFunctionLogOptions = {
|
|
2324
|
+
startTime?: string;
|
|
2325
|
+
endTime?: string;
|
|
2326
|
+
limit?: number;
|
|
2327
|
+
level?: "debug" | "info" | "warn" | "error";
|
|
2328
|
+
requestId?: string;
|
|
2507
2329
|
};
|
|
2508
|
-
export type
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2330
|
+
export type BaasMessage = {
|
|
2331
|
+
messageId: string;
|
|
2332
|
+
channel: string;
|
|
2333
|
+
data: Record<string, unknown>;
|
|
2334
|
+
sender?: string;
|
|
2335
|
+
timestamp: string;
|
|
2336
|
+
metadata?: Record<string, unknown>;
|
|
2337
|
+
};
|
|
2338
|
+
export type MessageHandler = (message: BaasMessage) => void | Promise<void>;
|
|
2339
|
+
export type BaasChannelConfig = {
|
|
2340
|
+
name: string;
|
|
2341
|
+
persistent?: boolean;
|
|
2342
|
+
maxHistoryLength?: number;
|
|
2343
|
+
presence?: boolean;
|
|
2344
|
+
authRequired?: boolean;
|
|
2518
2345
|
};
|
|
2519
|
-
export type
|
|
2520
|
-
|
|
2521
|
-
|
|
2346
|
+
export type ChannelSubscription = {
|
|
2347
|
+
subscriptionId: string;
|
|
2348
|
+
channel: string;
|
|
2522
2349
|
appId: string;
|
|
2523
|
-
|
|
2350
|
+
createdAt: string;
|
|
2351
|
+
active: boolean;
|
|
2524
2352
|
};
|
|
2525
|
-
export type
|
|
2526
|
-
|
|
2527
|
-
message: string;
|
|
2528
|
-
expiresAt: number;
|
|
2529
|
-
chain?: BaasSupportedChain;
|
|
2353
|
+
export type BaasPresenceMember = {
|
|
2354
|
+
clientId: string;
|
|
2530
2355
|
walletAddress?: string;
|
|
2531
|
-
|
|
2356
|
+
joinedAt: string;
|
|
2357
|
+
lastSeenAt: string;
|
|
2358
|
+
metadata?: Record<string, unknown>;
|
|
2532
2359
|
};
|
|
2533
|
-
export type
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2360
|
+
export type BaasPresenceInfo = {
|
|
2361
|
+
channel: string;
|
|
2362
|
+
members: BaasPresenceMember[];
|
|
2363
|
+
totalCount: number;
|
|
2537
2364
|
};
|
|
2538
|
-
export type
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
expiresAt: number;
|
|
2365
|
+
export type BaasHistoryOptions = {
|
|
2366
|
+
limit?: number;
|
|
2367
|
+
before?: string;
|
|
2368
|
+
after?: string;
|
|
2369
|
+
startTime?: string;
|
|
2370
|
+
endTime?: string;
|
|
2545
2371
|
};
|
|
2546
|
-
export type
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
appId?: string;
|
|
2551
|
-
permissions?: string[];
|
|
2552
|
-
sessionId?: string;
|
|
2553
|
-
expiresAt?: number;
|
|
2554
|
-
error?: string;
|
|
2372
|
+
export type BaasPublishResult = {
|
|
2373
|
+
messageId: string;
|
|
2374
|
+
channel: string;
|
|
2375
|
+
timestamp: string;
|
|
2555
2376
|
};
|
|
2556
|
-
export type
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2377
|
+
export type BaasInitRequest = {
|
|
2378
|
+
name: string;
|
|
2379
|
+
port: number;
|
|
2380
|
+
services: BaasService[];
|
|
2381
|
+
limits?: {
|
|
2382
|
+
cpu?: string;
|
|
2383
|
+
memory?: string;
|
|
2384
|
+
};
|
|
2562
2385
|
};
|
|
2563
|
-
export type
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2386
|
+
export type BaasInitResponse = {
|
|
2387
|
+
appId: string;
|
|
2388
|
+
registry: {
|
|
2389
|
+
server: string;
|
|
2390
|
+
username: string;
|
|
2391
|
+
password: string;
|
|
2392
|
+
repository: string;
|
|
2393
|
+
};
|
|
2569
2394
|
};
|
|
2570
|
-
export type
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2395
|
+
export type BaasDeployRequest = {
|
|
2396
|
+
tag: string;
|
|
2397
|
+
port?: number;
|
|
2398
|
+
replicas?: number;
|
|
2399
|
+
env?: Record<string, string>;
|
|
2400
|
+
resources?: {
|
|
2401
|
+
cpu?: string;
|
|
2402
|
+
memory?: string;
|
|
2403
|
+
};
|
|
2404
|
+
strategy?: "rolling" | "recreate";
|
|
2580
2405
|
};
|
|
2581
|
-
export type
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
path: ("left" | "right")[];
|
|
2406
|
+
export type BaasDeployResponse = {
|
|
2407
|
+
appId: string;
|
|
2408
|
+
status: string;
|
|
2409
|
+
url: string;
|
|
2586
2410
|
};
|
|
2587
|
-
export type
|
|
2588
|
-
|
|
2589
|
-
|
|
2411
|
+
export type BaasUploadFrontendResponse = {
|
|
2412
|
+
bundleSha256: string;
|
|
2413
|
+
bundleSizeBytes: number;
|
|
2590
2414
|
};
|
|
2591
|
-
export type
|
|
2592
|
-
|
|
2593
|
-
stateTransition: BaasStateTransition;
|
|
2415
|
+
export type BaasRollbackRequest = {
|
|
2416
|
+
toTag: string;
|
|
2594
2417
|
};
|
|
2595
|
-
export type
|
|
2596
|
-
|
|
2597
|
-
|
|
2418
|
+
export type BaasRuntimeStatus = {
|
|
2419
|
+
appId: string;
|
|
2420
|
+
state: "PENDING_SUBSCRIPTION" | "ACTIVE" | "SUSPENDED" | "RETIRED";
|
|
2421
|
+
runtime?: {
|
|
2422
|
+
image: string;
|
|
2423
|
+
runtimeState: "NOT_DEPLOYED" | "DEPLOYING" | "RUNNING" | "FAILED" | "DEGRADED";
|
|
2424
|
+
replicas: number;
|
|
2425
|
+
lastReconciledAt?: string;
|
|
2426
|
+
lastError?: string;
|
|
2427
|
+
};
|
|
2598
2428
|
};
|
|
2599
|
-
export type
|
|
2600
|
-
|
|
2601
|
-
$ne?: unknown;
|
|
2602
|
-
$gt?: number;
|
|
2603
|
-
$gte?: number;
|
|
2604
|
-
$lt?: number;
|
|
2605
|
-
$lte?: number;
|
|
2606
|
-
$in?: unknown[];
|
|
2607
|
-
$nin?: unknown[];
|
|
2608
|
-
$exists?: boolean;
|
|
2609
|
-
$regex?: string;
|
|
2429
|
+
export type BaasAppListResponse = {
|
|
2430
|
+
apps: DeployedAppInfo[];
|
|
2610
2431
|
};
|
|
2611
|
-
export type
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
projection?: Record<string, 0 | 1>;
|
|
2432
|
+
export type BaasErrorResponse = {
|
|
2433
|
+
code: string;
|
|
2434
|
+
message: string;
|
|
2435
|
+
details?: Record<string, unknown>;
|
|
2436
|
+
requestId?: string;
|
|
2617
2437
|
};
|
|
2618
|
-
export type
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2438
|
+
export type BaasErrorDetails = {
|
|
2439
|
+
code?: string;
|
|
2440
|
+
details?: unknown;
|
|
2441
|
+
originalError?: string;
|
|
2442
|
+
};
|
|
2443
|
+
export declare class DeploymentClient {
|
|
2444
|
+
private readonly http;
|
|
2445
|
+
constructor(http: HttpClient);
|
|
2446
|
+
init(request: BaasInitRequest): Promise<BaasInitResponse>;
|
|
2447
|
+
uploadFrontend(appId: string, bundle: Blob | Buffer, filename?: string): Promise<BaasUploadFrontendResponse>;
|
|
2448
|
+
deploy(appId: string, request: BaasDeployRequest): Promise<BaasDeployResponse>;
|
|
2449
|
+
rollback(appId: string, request: BaasRollbackRequest): Promise<BaasDeployResponse>;
|
|
2450
|
+
status(appId: string): Promise<BaasRuntimeStatus>;
|
|
2451
|
+
list(): Promise<BaasAppListResponse>;
|
|
2452
|
+
get(appId: string): Promise<DeployedAppInfo>;
|
|
2453
|
+
update(appId: string, updates: Partial<BaasDeployRequest>): Promise<DeployedAppInfo>;
|
|
2454
|
+
delete(appId: string): Promise<{
|
|
2455
|
+
success: boolean;
|
|
2456
|
+
}>;
|
|
2457
|
+
suspend(appId: string): Promise<{
|
|
2458
|
+
success: boolean;
|
|
2459
|
+
status: string;
|
|
2460
|
+
}>;
|
|
2461
|
+
resume(appId: string): Promise<{
|
|
2462
|
+
success: boolean;
|
|
2463
|
+
status: string;
|
|
2464
|
+
}>;
|
|
2465
|
+
getStats(): Promise<{
|
|
2466
|
+
totalApps: number;
|
|
2467
|
+
activeApps: number;
|
|
2468
|
+
totalOwners: number;
|
|
2469
|
+
}>;
|
|
2470
|
+
}
|
|
2471
|
+
export interface SmartEngineClientConfig {
|
|
2472
|
+
baseUrl: string;
|
|
2473
|
+
apiKey?: string;
|
|
2474
|
+
authToken?: string;
|
|
2475
|
+
timeout?: number;
|
|
2476
|
+
allowInsecure?: boolean;
|
|
2477
|
+
http?: ResilientHttpConfig;
|
|
2478
|
+
}
|
|
2479
|
+
export interface NetworkConnectionConfig {
|
|
2480
|
+
network: "mainnet" | "testnet" | "previewnet";
|
|
2481
|
+
registryTopicId: string;
|
|
2482
|
+
chain: AuthChain;
|
|
2483
|
+
address: string;
|
|
2484
|
+
publicKey: string;
|
|
2485
|
+
signFn: (challenge: string) => string | Promise<string>;
|
|
2486
|
+
metadata?: {
|
|
2487
|
+
appId?: string;
|
|
2488
|
+
appName?: string;
|
|
2489
|
+
};
|
|
2490
|
+
mirrorNodeUrl?: string;
|
|
2491
|
+
allowInsecure?: boolean;
|
|
2492
|
+
}
|
|
2493
|
+
export interface ClusterConnectionConfig {
|
|
2494
|
+
bootstrap: string[];
|
|
2495
|
+
chain: AuthChain;
|
|
2496
|
+
address: string;
|
|
2497
|
+
publicKey: string;
|
|
2498
|
+
signFn: (challenge: string) => string | Promise<string>;
|
|
2499
|
+
metadata?: {
|
|
2500
|
+
appId?: string;
|
|
2501
|
+
appName?: string;
|
|
2502
|
+
};
|
|
2503
|
+
trustAnchor?: {
|
|
2504
|
+
network: "mainnet" | "testnet" | "previewnet";
|
|
2505
|
+
registryTopicId: string;
|
|
2506
|
+
mirrorNodeUrl?: string;
|
|
2507
|
+
};
|
|
2508
|
+
allowInsecure?: boolean;
|
|
2509
|
+
}
|
|
2510
|
+
export interface ClusterConnectionResult {
|
|
2511
|
+
client: SmartEngineClient;
|
|
2512
|
+
cluster: ClusterInfo;
|
|
2513
|
+
session: AuthenticateResponse;
|
|
2514
|
+
}
|
|
2515
|
+
export interface NetworkConnectionResult {
|
|
2516
|
+
client: SmartEngineClient;
|
|
2517
|
+
validator: ValidatorInfo;
|
|
2518
|
+
session: AuthenticateResponse;
|
|
2519
|
+
}
|
|
2520
|
+
export declare class SmartEngineClient {
|
|
2521
|
+
private baseUrl;
|
|
2522
|
+
private allowInsecure;
|
|
2523
|
+
private readonly http;
|
|
2524
|
+
private readonly txHttp;
|
|
2525
|
+
private lastHttpError?;
|
|
2526
|
+
readonly subscription: SubscriptionClient;
|
|
2527
|
+
readonly tss: TSSClient;
|
|
2528
|
+
readonly ipfs: IPFSClient;
|
|
2529
|
+
readonly transactions: TransactionsClient;
|
|
2530
|
+
readonly hedera: HederaTransactionsClient;
|
|
2531
|
+
readonly xrpl: XrplTransactionsClient;
|
|
2532
|
+
readonly solana: SolanaTransactionsClient;
|
|
2533
|
+
readonly polkadot: PolkadotTransactionsClient;
|
|
2534
|
+
readonly snapshots: SnapshotsClient;
|
|
2535
|
+
readonly historicalBalance: HistoricalBalanceClient;
|
|
2536
|
+
readonly settlement: SettlementClient;
|
|
2537
|
+
readonly governance: GovernanceClient;
|
|
2538
|
+
readonly personhood: PersonhoodClient;
|
|
2539
|
+
readonly agents: AgentsClient;
|
|
2540
|
+
readonly deployments: DeploymentClient;
|
|
2541
|
+
constructor(config: SmartEngineClientConfig);
|
|
2542
|
+
static fromEnv(env: Record<string, string | undefined>): SmartEngineClient;
|
|
2543
|
+
static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
|
|
2544
|
+
static connectToCluster(config: ClusterConnectionConfig): Promise<ClusterConnectionResult>;
|
|
2545
|
+
getBaseUrl(): string;
|
|
2546
|
+
isAuthenticated(): boolean;
|
|
2547
|
+
getHttpHealth(): {
|
|
2548
|
+
breaker: CircuitBreakerSnapshot | null;
|
|
2549
|
+
lastError?: Error;
|
|
2550
|
+
};
|
|
2551
|
+
getHealth(): Promise<{
|
|
2552
|
+
status: string;
|
|
2553
|
+
timestamp: string;
|
|
2554
|
+
chains: any[];
|
|
2555
|
+
}>;
|
|
2556
|
+
getSupportedChains(): Promise<{
|
|
2557
|
+
chains: string[];
|
|
2558
|
+
}>;
|
|
2559
|
+
createAccount(request: CreateAccountRequest): Promise<CreateAccountResponse>;
|
|
2560
|
+
getAccountInfo(chain: string, accountId: string): Promise<AccountInfo>;
|
|
2561
|
+
getBalance(chain: string, accountId: string): Promise<AccountBalance>;
|
|
2562
|
+
transfer(request: TransferRequest): Promise<TransferResponse>;
|
|
2563
|
+
getTransaction(chain: string, txId: string): Promise<Transaction>;
|
|
2564
|
+
getTransactionReceipt(chain: string, txId: string): Promise<any>;
|
|
2565
|
+
createToken(request: CreateTokenRequest): Promise<CreateTokenResponse>;
|
|
2566
|
+
mintToken(request: MintTokenRequest): Promise<any>;
|
|
2567
|
+
getTokenInfo(chain: string, tokenId: string): Promise<TokenInfo>;
|
|
2568
|
+
burnToken(request: BurnTokenRequest): Promise<ActionResult>;
|
|
2569
|
+
pauseToken(request: TokenActionRequest): Promise<ActionResult>;
|
|
2570
|
+
unpauseToken(request: TokenActionRequest): Promise<ActionResult>;
|
|
2571
|
+
restrictAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
2572
|
+
unrestrictAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
2573
|
+
enableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
2574
|
+
disableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
2575
|
+
wipeFromAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
2576
|
+
getAllCapabilities(): Promise<any>;
|
|
2577
|
+
getChainCapabilities(chain: ChainType): Promise<any>;
|
|
2578
|
+
getSystemStatus(): Promise<any>;
|
|
2579
|
+
submitMessage(chain: string, topicId: string, message: string): Promise<any>;
|
|
2580
|
+
getClusterHealth(): Promise<{
|
|
2581
|
+
status: string;
|
|
2582
|
+
nodes: number;
|
|
2583
|
+
healthy: number;
|
|
2584
|
+
unhealthy: number;
|
|
2585
|
+
}>;
|
|
2586
|
+
getClusterStatus(): Promise<{
|
|
2587
|
+
status: string;
|
|
2588
|
+
nodeId: string;
|
|
2589
|
+
nodes: Array<{
|
|
2590
|
+
nodeId: string;
|
|
2591
|
+
endpoint: string;
|
|
2592
|
+
status: string;
|
|
2593
|
+
lastSeen?: string;
|
|
2594
|
+
}>;
|
|
2595
|
+
quorum: {
|
|
2596
|
+
required: number;
|
|
2597
|
+
current: number;
|
|
2598
|
+
reached: boolean;
|
|
2599
|
+
};
|
|
2600
|
+
}>;
|
|
2601
|
+
getMetrics(): Promise<string>;
|
|
2602
|
+
getQueueStats(): Promise<{
|
|
2603
|
+
queues: Record<string, {
|
|
2604
|
+
pending: number;
|
|
2605
|
+
processing: number;
|
|
2606
|
+
completed: number;
|
|
2607
|
+
failed: number;
|
|
2608
|
+
}>;
|
|
2609
|
+
timestamp: string;
|
|
2610
|
+
}>;
|
|
2611
|
+
getCircuitBreakerStatus(): Promise<{
|
|
2612
|
+
breakers: Record<string, {
|
|
2613
|
+
state: "closed" | "open" | "half-open";
|
|
2614
|
+
failures: number;
|
|
2615
|
+
successes: number;
|
|
2616
|
+
lastFailure?: string;
|
|
2617
|
+
nextRetry?: string;
|
|
2618
|
+
}>;
|
|
2619
|
+
timestamp: string;
|
|
2620
|
+
}>;
|
|
2621
|
+
verifySignature(request: {
|
|
2622
|
+
chain: ChainType;
|
|
2623
|
+
message: string;
|
|
2624
|
+
signature: string;
|
|
2625
|
+
publicKey: string;
|
|
2626
|
+
}): Promise<{
|
|
2627
|
+
valid: boolean;
|
|
2628
|
+
chain: ChainType;
|
|
2629
|
+
}>;
|
|
2630
|
+
}
|
|
2631
|
+
export type GatewayHealthResponse = {
|
|
2632
|
+
status: "healthy" | "degraded" | "unhealthy";
|
|
2633
|
+
timestamp: string;
|
|
2634
|
+
uptime: number;
|
|
2635
|
+
version: string;
|
|
2623
2636
|
};
|
|
2624
|
-
export type
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2637
|
+
export type GatewayStatusResponse = {
|
|
2638
|
+
status: string;
|
|
2639
|
+
hosts: {
|
|
2640
|
+
total: number;
|
|
2641
|
+
verified: number;
|
|
2642
|
+
active: number;
|
|
2643
|
+
};
|
|
2644
|
+
domains: {
|
|
2645
|
+
total: number;
|
|
2646
|
+
verified: number;
|
|
2647
|
+
};
|
|
2648
|
+
uptime: number;
|
|
2629
2649
|
};
|
|
2630
|
-
export type
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
mimeType: string;
|
|
2634
|
-
uploadedAt: string;
|
|
2635
|
-
filename?: string;
|
|
2636
|
-
encrypted?: boolean;
|
|
2650
|
+
export type GatewayReadinessResponse = {
|
|
2651
|
+
ready: boolean;
|
|
2652
|
+
checks: Record<string, boolean>;
|
|
2637
2653
|
};
|
|
2638
|
-
export type
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
size: number;
|
|
2642
|
-
mimeType?: string;
|
|
2643
|
-
uploadedAt: string;
|
|
2644
|
-
lastAccessedAt?: string;
|
|
2645
|
-
tags?: Record<string, string>;
|
|
2654
|
+
export type GatewayLivenessResponse = {
|
|
2655
|
+
alive: boolean;
|
|
2656
|
+
timestamp: string;
|
|
2646
2657
|
};
|
|
2647
|
-
export type
|
|
2648
|
-
|
|
2649
|
-
|
|
2658
|
+
export type GatewayMetricsResponse = {
|
|
2659
|
+
requests: {
|
|
2660
|
+
total: number;
|
|
2661
|
+
successful: number;
|
|
2662
|
+
failed: number;
|
|
2663
|
+
avgLatencyMs: number;
|
|
2664
|
+
};
|
|
2665
|
+
hosts: {
|
|
2666
|
+
total: number;
|
|
2667
|
+
healthy: number;
|
|
2668
|
+
unhealthy: number;
|
|
2669
|
+
};
|
|
2670
|
+
bandwidth: {
|
|
2671
|
+
inbound: number;
|
|
2672
|
+
outbound: number;
|
|
2673
|
+
};
|
|
2674
|
+
timestamp: string;
|
|
2650
2675
|
};
|
|
2651
|
-
export type
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
timeout: number;
|
|
2656
|
-
maxConcurrency?: number;
|
|
2676
|
+
export type GatewayMetricsSummaryResponse = {
|
|
2677
|
+
summary: Record<string, unknown>;
|
|
2678
|
+
period: string;
|
|
2679
|
+
generatedAt: string;
|
|
2657
2680
|
};
|
|
2658
|
-
export type
|
|
2681
|
+
export type RegisterHostRequest = {
|
|
2659
2682
|
name: string;
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
codeType: "inline" | "ipfs";
|
|
2664
|
-
entryPoint?: string;
|
|
2665
|
-
triggers?: Array<{
|
|
2666
|
-
type: BaasTriggerType;
|
|
2667
|
-
config: Record<string, unknown>;
|
|
2668
|
-
}>;
|
|
2669
|
-
resources?: Partial<BaasFunctionResources>;
|
|
2670
|
-
environment?: Record<string, string>;
|
|
2683
|
+
endpoint: string;
|
|
2684
|
+
capabilities?: string[];
|
|
2685
|
+
metadata?: Record<string, unknown>;
|
|
2671
2686
|
};
|
|
2672
|
-
export type
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2687
|
+
export type HostInfo = {
|
|
2688
|
+
hostId: string;
|
|
2689
|
+
name: string;
|
|
2690
|
+
endpoint: string;
|
|
2691
|
+
status: "active" | "inactive" | "suspended";
|
|
2692
|
+
verified: boolean;
|
|
2693
|
+
capabilities: string[];
|
|
2694
|
+
lastSeen: string;
|
|
2695
|
+
registeredAt: string;
|
|
2696
|
+
metadata?: Record<string, unknown>;
|
|
2679
2697
|
};
|
|
2680
|
-
export type
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
status: "success" | "error" | "timeout";
|
|
2684
|
-
result?: unknown;
|
|
2685
|
-
error?: string;
|
|
2686
|
-
logs?: string[];
|
|
2687
|
-
duration: number;
|
|
2688
|
-
memoryUsed?: number;
|
|
2698
|
+
export type HostListResponse = {
|
|
2699
|
+
hosts: HostInfo[];
|
|
2700
|
+
total: number;
|
|
2689
2701
|
};
|
|
2690
|
-
export type
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
deployedAt: string;
|
|
2697
|
-
lastInvokedAt?: string;
|
|
2698
|
-
invocationCount: number;
|
|
2702
|
+
export type RoutingConfig = {
|
|
2703
|
+
strategy: "round-robin" | "least-connections" | "random" | "weighted";
|
|
2704
|
+
healthCheckInterval?: number;
|
|
2705
|
+
timeout?: number;
|
|
2706
|
+
retries?: number;
|
|
2707
|
+
weights?: Record<string, number>;
|
|
2699
2708
|
};
|
|
2700
|
-
export type
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2709
|
+
export type ProxyRequest = {
|
|
2710
|
+
targetHostId?: string;
|
|
2711
|
+
method: string;
|
|
2712
|
+
path: string;
|
|
2713
|
+
headers?: Record<string, string>;
|
|
2714
|
+
body?: unknown;
|
|
2706
2715
|
};
|
|
2707
|
-
export type
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2716
|
+
export type ProxyResponse = {
|
|
2717
|
+
statusCode: number;
|
|
2718
|
+
headers: Record<string, string>;
|
|
2719
|
+
body: unknown;
|
|
2720
|
+
hostId: string;
|
|
2721
|
+
latencyMs: number;
|
|
2713
2722
|
};
|
|
2714
|
-
export type
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2723
|
+
export type RoutingStatsResponse = {
|
|
2724
|
+
totalRequests: number;
|
|
2725
|
+
successRate: number;
|
|
2726
|
+
avgLatencyMs: number;
|
|
2727
|
+
hostStats: Record<string, {
|
|
2728
|
+
requests: number;
|
|
2729
|
+
errors: number;
|
|
2730
|
+
avgLatencyMs: number;
|
|
2731
|
+
}>;
|
|
2721
2732
|
};
|
|
2722
|
-
export type
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
presence?: boolean;
|
|
2728
|
-
authRequired?: boolean;
|
|
2733
|
+
export type DomainRegistrationRequest = {
|
|
2734
|
+
domain: string;
|
|
2735
|
+
owner: string;
|
|
2736
|
+
registrar?: string;
|
|
2737
|
+
autoRenew?: boolean;
|
|
2729
2738
|
};
|
|
2730
|
-
export type
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2739
|
+
export type DomainInfo = {
|
|
2740
|
+
domain: string;
|
|
2741
|
+
owner: string;
|
|
2742
|
+
status: "active" | "pending" | "suspended" | "expired";
|
|
2743
|
+
verified: boolean;
|
|
2744
|
+
registrar?: string;
|
|
2745
|
+
expiresAt?: string;
|
|
2734
2746
|
createdAt: string;
|
|
2735
|
-
|
|
2747
|
+
dnsConfigured: boolean;
|
|
2748
|
+
dnssecEnabled: boolean;
|
|
2736
2749
|
};
|
|
2737
|
-
export type
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
joinedAt: string;
|
|
2741
|
-
lastSeenAt: string;
|
|
2742
|
-
metadata?: Record<string, unknown>;
|
|
2750
|
+
export type DomainListResponse = {
|
|
2751
|
+
domains: DomainInfo[];
|
|
2752
|
+
total: number;
|
|
2743
2753
|
};
|
|
2744
|
-
export type
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2754
|
+
export type DomainAvailabilityResponse = {
|
|
2755
|
+
domain: string;
|
|
2756
|
+
available: boolean;
|
|
2757
|
+
premium: boolean;
|
|
2758
|
+
price?: string;
|
|
2759
|
+
suggestions?: string[];
|
|
2748
2760
|
};
|
|
2749
|
-
export type
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
endTime?: string;
|
|
2761
|
+
export type VerificationTokenResponse = {
|
|
2762
|
+
token: string;
|
|
2763
|
+
method: "dns" | "http" | "email";
|
|
2764
|
+
instructions: string;
|
|
2765
|
+
expiresAt: string;
|
|
2755
2766
|
};
|
|
2756
|
-
export type
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2767
|
+
export type VerificationResult = {
|
|
2768
|
+
verified: boolean;
|
|
2769
|
+
domain: string;
|
|
2770
|
+
method: string;
|
|
2771
|
+
verifiedAt?: string;
|
|
2772
|
+
error?: string;
|
|
2760
2773
|
};
|
|
2761
|
-
export type
|
|
2774
|
+
export type DnsRecord = {
|
|
2775
|
+
type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SRV" | "CAA";
|
|
2762
2776
|
name: string;
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
cpu?: string;
|
|
2767
|
-
memory?: string;
|
|
2768
|
-
};
|
|
2777
|
+
value: string;
|
|
2778
|
+
ttl?: number;
|
|
2779
|
+
priority?: number;
|
|
2769
2780
|
};
|
|
2770
|
-
export type
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
server: string;
|
|
2774
|
-
username: string;
|
|
2775
|
-
password: string;
|
|
2776
|
-
repository: string;
|
|
2777
|
-
};
|
|
2781
|
+
export type DomainTransferRequest = {
|
|
2782
|
+
authCode: string;
|
|
2783
|
+
newRegistrar?: string;
|
|
2778
2784
|
};
|
|
2779
|
-
export type
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2785
|
+
export type DnsResolveResponse = {
|
|
2786
|
+
name: string;
|
|
2787
|
+
type: string;
|
|
2788
|
+
records: Array<{
|
|
2789
|
+
value: string;
|
|
2790
|
+
ttl: number;
|
|
2791
|
+
}>;
|
|
2792
|
+
dnssec: boolean;
|
|
2793
|
+
timestamp: string;
|
|
2788
2794
|
};
|
|
2789
|
-
export type
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
url: string;
|
|
2795
|
+
export type DnsBatchQuery = {
|
|
2796
|
+
name: string;
|
|
2797
|
+
type?: string;
|
|
2793
2798
|
};
|
|
2794
|
-
export type
|
|
2795
|
-
|
|
2796
|
-
|
|
2799
|
+
export type DnsBatchResolveResponse = {
|
|
2800
|
+
results: DnsResolveResponse[];
|
|
2801
|
+
errors: Array<{
|
|
2802
|
+
query: DnsBatchQuery;
|
|
2803
|
+
error: string;
|
|
2804
|
+
}>;
|
|
2797
2805
|
};
|
|
2798
|
-
export type
|
|
2799
|
-
|
|
2806
|
+
export type DnsZone = {
|
|
2807
|
+
zoneName: string;
|
|
2808
|
+
status: "active" | "pending" | "disabled";
|
|
2809
|
+
records: number;
|
|
2810
|
+
dnssecEnabled: boolean;
|
|
2811
|
+
createdAt: string;
|
|
2812
|
+
updatedAt: string;
|
|
2800
2813
|
};
|
|
2801
|
-
export type
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
runtime?: {
|
|
2805
|
-
image: string;
|
|
2806
|
-
runtimeState: "NOT_DEPLOYED" | "DEPLOYING" | "RUNNING" | "FAILED" | "DEGRADED";
|
|
2807
|
-
replicas: number;
|
|
2808
|
-
lastReconciledAt?: string;
|
|
2809
|
-
lastError?: string;
|
|
2810
|
-
};
|
|
2814
|
+
export type DnsZoneListResponse = {
|
|
2815
|
+
zones: DnsZone[];
|
|
2816
|
+
total: number;
|
|
2811
2817
|
};
|
|
2812
|
-
export type
|
|
2813
|
-
|
|
2818
|
+
export type DnsRecordInfo = {
|
|
2819
|
+
recordId: string;
|
|
2820
|
+
type: string;
|
|
2821
|
+
name: string;
|
|
2822
|
+
value: string;
|
|
2823
|
+
ttl: number;
|
|
2824
|
+
priority?: number;
|
|
2825
|
+
createdAt: string;
|
|
2826
|
+
updatedAt: string;
|
|
2814
2827
|
};
|
|
2815
|
-
export type
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2828
|
+
export type DnssecKey = {
|
|
2829
|
+
keyTag: number;
|
|
2830
|
+
algorithm: string;
|
|
2831
|
+
digestType: string;
|
|
2832
|
+
digest: string;
|
|
2833
|
+
publicKey: string;
|
|
2834
|
+
flags: number;
|
|
2820
2835
|
};
|
|
2821
|
-
export type
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2836
|
+
export type DnssecDsRecord = {
|
|
2837
|
+
keyTag: number;
|
|
2838
|
+
algorithm: number;
|
|
2839
|
+
digestType: number;
|
|
2840
|
+
digest: string;
|
|
2841
|
+
};
|
|
2842
|
+
export declare class RoutingClient {
|
|
2843
|
+
private readonly http;
|
|
2844
|
+
constructor(http: HttpClient);
|
|
2845
|
+
registerHost(request: RegisterHostRequest): Promise<HostInfo>;
|
|
2846
|
+
unregisterHost(hostId: string): Promise<{
|
|
2847
|
+
success: boolean;
|
|
2848
|
+
}>;
|
|
2849
|
+
getAllHosts(): Promise<HostListResponse>;
|
|
2850
|
+
getVerifiedHosts(): Promise<HostListResponse>;
|
|
2851
|
+
getHost(hostId: string): Promise<HostInfo>;
|
|
2852
|
+
verifyHost(hostId: string): Promise<{
|
|
2853
|
+
verified: boolean;
|
|
2854
|
+
message: string;
|
|
2855
|
+
}>;
|
|
2856
|
+
setRoutingConfig(appId: string, config: RoutingConfig): Promise<RoutingConfig>;
|
|
2857
|
+
getRoutingConfig(appId: string): Promise<RoutingConfig>;
|
|
2858
|
+
proxyRequest(request: ProxyRequest): Promise<ProxyResponse>;
|
|
2859
|
+
getStats(): Promise<RoutingStatsResponse>;
|
|
2860
|
+
mapDomainToApp(domain: string, appId: string): Promise<{
|
|
2861
|
+
success: boolean;
|
|
2862
|
+
domain: string;
|
|
2863
|
+
appId: string;
|
|
2864
|
+
}>;
|
|
2865
|
+
}
|
|
2866
|
+
export declare class DomainsClient {
|
|
2867
|
+
private readonly http;
|
|
2868
|
+
constructor(http: HttpClient);
|
|
2869
|
+
register(request: DomainRegistrationRequest): Promise<DomainInfo>;
|
|
2870
|
+
checkAvailability(domain: string): Promise<DomainAvailabilityResponse>;
|
|
2871
|
+
getInfo(domain: string): Promise<DomainInfo>;
|
|
2872
|
+
list(owner?: string): Promise<DomainListResponse>;
|
|
2873
|
+
generateVerificationToken(domain: string, method: "dns" | "http" | "email"): Promise<VerificationTokenResponse>;
|
|
2874
|
+
verifyOwnership(domain: string, token: string): Promise<VerificationResult>;
|
|
2875
|
+
configureDns(domain: string, records: DnsRecord[]): Promise<{
|
|
2876
|
+
success: boolean;
|
|
2877
|
+
records: DnsRecord[];
|
|
2878
|
+
}>;
|
|
2879
|
+
enableDnssec(domain: string): Promise<{
|
|
2880
|
+
success: boolean;
|
|
2881
|
+
message: string;
|
|
2882
|
+
}>;
|
|
2883
|
+
disableDnssec(domain: string): Promise<{
|
|
2884
|
+
success: boolean;
|
|
2885
|
+
message: string;
|
|
2886
|
+
}>;
|
|
2887
|
+
renew(domain: string, years?: number): Promise<DomainInfo>;
|
|
2888
|
+
transfer(domain: string, request: DomainTransferRequest): Promise<{
|
|
2889
|
+
success: boolean;
|
|
2890
|
+
message: string;
|
|
2891
|
+
}>;
|
|
2892
|
+
approveTransfer(domain: string): Promise<{
|
|
2893
|
+
success: boolean;
|
|
2894
|
+
}>;
|
|
2895
|
+
rejectTransfer(domain: string): Promise<{
|
|
2896
|
+
success: boolean;
|
|
2897
|
+
}>;
|
|
2898
|
+
suspend(domain: string, reason: string): Promise<{
|
|
2899
|
+
success: boolean;
|
|
2900
|
+
}>;
|
|
2901
|
+
unsuspend(domain: string): Promise<{
|
|
2902
|
+
success: boolean;
|
|
2903
|
+
}>;
|
|
2904
|
+
}
|
|
2905
|
+
export declare class DnsClient {
|
|
2906
|
+
private readonly http;
|
|
2907
|
+
constructor(http: HttpClient);
|
|
2908
|
+
resolve(name: string, type?: string, dnssec?: boolean): Promise<DnsResolveResponse>;
|
|
2909
|
+
resolveBatch(queries: DnsBatchQuery[]): Promise<DnsBatchResolveResponse>;
|
|
2910
|
+
listZones(): Promise<DnsZoneListResponse>;
|
|
2911
|
+
getZone(zoneName: string): Promise<DnsZone & {
|
|
2912
|
+
records: DnsRecordInfo[];
|
|
2913
|
+
}>;
|
|
2914
|
+
createZone(request: {
|
|
2915
|
+
zoneName: string;
|
|
2916
|
+
description?: string;
|
|
2917
|
+
}): Promise<DnsZone>;
|
|
2918
|
+
deleteZone(zoneName: string): Promise<{
|
|
2919
|
+
success: boolean;
|
|
2920
|
+
}>;
|
|
2921
|
+
addRecord(zoneName: string, record: DnsRecord): Promise<DnsRecordInfo>;
|
|
2922
|
+
updateRecord(zoneName: string, recordId: string, updates: Partial<DnsRecord>): Promise<DnsRecordInfo>;
|
|
2923
|
+
deleteRecord(zoneName: string, recordId: string): Promise<{
|
|
2924
|
+
success: boolean;
|
|
2925
|
+
}>;
|
|
2926
|
+
generateDnssecKeys(zoneName: string, algorithm?: string): Promise<{
|
|
2927
|
+
keys: DnssecKey[];
|
|
2928
|
+
}>;
|
|
2929
|
+
getDnssecKeys(zoneName: string): Promise<{
|
|
2930
|
+
keys: DnssecKey[];
|
|
2931
|
+
}>;
|
|
2932
|
+
getDsRecord(zoneName: string): Promise<DnssecDsRecord>;
|
|
2933
|
+
clearCache(): Promise<{
|
|
2934
|
+
success: boolean;
|
|
2935
|
+
entriesCleared: number;
|
|
2936
|
+
}>;
|
|
2937
|
+
}
|
|
2938
|
+
export type SmartGatewayClientConfig = {
|
|
2939
|
+
baseUrl: string;
|
|
2940
|
+
apiKey?: string;
|
|
2941
|
+
authToken?: string;
|
|
2942
|
+
timeout?: number;
|
|
2943
|
+
allowInsecure?: boolean;
|
|
2825
2944
|
};
|
|
2945
|
+
export declare class SmartGatewayClient {
|
|
2946
|
+
private readonly http;
|
|
2947
|
+
readonly routing: RoutingClient;
|
|
2948
|
+
readonly domains: DomainsClient;
|
|
2949
|
+
readonly dns: DnsClient;
|
|
2950
|
+
constructor(config: SmartGatewayClientConfig);
|
|
2951
|
+
getHealth(): Promise<GatewayHealthResponse>;
|
|
2952
|
+
getStatus(): Promise<GatewayStatusResponse>;
|
|
2953
|
+
getReadiness(): Promise<GatewayReadinessResponse>;
|
|
2954
|
+
getLiveness(): Promise<GatewayLivenessResponse>;
|
|
2955
|
+
getMetrics(refresh?: boolean): Promise<GatewayMetricsResponse>;
|
|
2956
|
+
getMetricsSummary(): Promise<GatewayMetricsSummaryResponse>;
|
|
2957
|
+
}
|
|
2958
|
+
declare function formatHederaAccountId(id: string): string;
|
|
2959
|
+
declare function parseHbar(amount: string): number;
|
|
2960
|
+
declare function hbarToTinybars(hbar: string | number): string;
|
|
2961
|
+
declare function tinybarsToHbar(tinybars: string | number): string;
|
|
2962
|
+
declare function formatHederaTokenId(id: string): string;
|
|
2963
|
+
declare function formatHederaTopicId(id: string): string;
|
|
2964
|
+
declare function validateXRPLAddress(address: string): boolean;
|
|
2965
|
+
declare function formatXRPLAddress(address: string): string;
|
|
2966
|
+
declare function xrpToDrops(xrp: string | number): string;
|
|
2967
|
+
declare function dropsToXrp(drops: string | number): string;
|
|
2968
|
+
declare function parseXRP(amount: string): number;
|
|
2969
|
+
declare function validateCurrencyCode(code: string): boolean;
|
|
2970
|
+
declare function validatePolkadotAddress(address: string): boolean;
|
|
2971
|
+
declare function formatPolkadotAddress(address: string, prefixLength?: number, suffixLength?: number): string;
|
|
2972
|
+
declare function dotToPlanck(dot: number): bigint;
|
|
2973
|
+
declare function planckToDot(planck: bigint): number;
|
|
2974
|
+
declare function formatDot(planck: bigint, decimals?: number): string;
|
|
2975
|
+
declare function parseDotString(dotString: string): bigint;
|
|
2976
|
+
declare function validateSolanaPublicKey(publicKey: string): boolean;
|
|
2977
|
+
declare function formatSolanaAddress(address: string, prefixLength?: number, suffixLength?: number): string;
|
|
2978
|
+
declare function solToLamports(sol: number): bigint;
|
|
2979
|
+
declare function lamportsToSol(lamports: bigint): number;
|
|
2980
|
+
declare function formatSol(lamports: bigint, decimals?: number): string;
|
|
2981
|
+
declare function parseSolString(solString: string): bigint;
|
|
2982
|
+
declare function isTransactionSignature(signature: string): boolean;
|
|
2983
|
+
declare function validateStellarAddress(address: string): boolean;
|
|
2984
|
+
declare function stroopsToXlm(stroops: string | number): string;
|
|
2985
|
+
declare function xlmToStroops(xlm: string | number): string;
|
|
2986
|
+
declare function validateBitcoinAddress(address: string): boolean;
|
|
2987
|
+
declare function satoshisToBtc(satoshis: string | number): string;
|
|
2988
|
+
declare function btcToSatoshis(btc: string | number): string;
|
|
2826
2989
|
export type StateRootResponse = {
|
|
2827
2990
|
appId: string;
|
|
2828
2991
|
stateRoot: string;
|
|
@@ -2948,157 +3111,6 @@ export declare class MessagingClient {
|
|
|
2948
3111
|
getPresence(channel: string): Promise<BaasPresenceInfo>;
|
|
2949
3112
|
getStats(): Promise<any>;
|
|
2950
3113
|
}
|
|
2951
|
-
export declare class DeploymentClient {
|
|
2952
|
-
private readonly http;
|
|
2953
|
-
constructor(http: HttpClient);
|
|
2954
|
-
init(request: BaasInitRequest): Promise<BaasInitResponse>;
|
|
2955
|
-
uploadFrontend(appId: string, bundle: Blob | Buffer, filename?: string): Promise<BaasUploadFrontendResponse>;
|
|
2956
|
-
deploy(appId: string, request: BaasDeployRequest): Promise<BaasDeployResponse>;
|
|
2957
|
-
rollback(appId: string, request: BaasRollbackRequest): Promise<BaasDeployResponse>;
|
|
2958
|
-
status(appId: string): Promise<BaasRuntimeStatus>;
|
|
2959
|
-
list(): Promise<BaasAppListResponse>;
|
|
2960
|
-
get(appId: string): Promise<DeployedAppInfo>;
|
|
2961
|
-
update(appId: string, updates: Partial<BaasDeployRequest>): Promise<DeployedAppInfo>;
|
|
2962
|
-
delete(appId: string): Promise<{
|
|
2963
|
-
success: boolean;
|
|
2964
|
-
}>;
|
|
2965
|
-
suspend(appId: string): Promise<{
|
|
2966
|
-
success: boolean;
|
|
2967
|
-
status: string;
|
|
2968
|
-
}>;
|
|
2969
|
-
resume(appId: string): Promise<{
|
|
2970
|
-
success: boolean;
|
|
2971
|
-
status: string;
|
|
2972
|
-
}>;
|
|
2973
|
-
getStats(): Promise<{
|
|
2974
|
-
totalApps: number;
|
|
2975
|
-
activeApps: number;
|
|
2976
|
-
totalOwners: number;
|
|
2977
|
-
}>;
|
|
2978
|
-
}
|
|
2979
|
-
export type AgentStatus = "active" | "paused" | "revoked" | "pending";
|
|
2980
|
-
export type AgentRegisterRequest = {
|
|
2981
|
-
name: string;
|
|
2982
|
-
description?: string;
|
|
2983
|
-
capabilities: string[];
|
|
2984
|
-
rules: AgentRules;
|
|
2985
|
-
fundingConfig?: {
|
|
2986
|
-
chain: string;
|
|
2987
|
-
maxAmount: string;
|
|
2988
|
-
autoFund: boolean;
|
|
2989
|
-
};
|
|
2990
|
-
};
|
|
2991
|
-
export type AgentRules = {
|
|
2992
|
-
maxTradeAmount?: string;
|
|
2993
|
-
allowedPairs?: string[];
|
|
2994
|
-
allowedChains?: string[];
|
|
2995
|
-
dailyLimit?: string;
|
|
2996
|
-
requireApprovalAbove?: string;
|
|
2997
|
-
customRules?: Record<string, unknown>;
|
|
2998
|
-
};
|
|
2999
|
-
export type AgentRulesValidationResult = {
|
|
3000
|
-
valid: boolean;
|
|
3001
|
-
errors: string[];
|
|
3002
|
-
};
|
|
3003
|
-
export declare function validateAgentRules(rules: AgentRules): AgentRulesValidationResult;
|
|
3004
|
-
export type AgentInfo = {
|
|
3005
|
-
agentId: string;
|
|
3006
|
-
name: string;
|
|
3007
|
-
description?: string;
|
|
3008
|
-
status: AgentStatus;
|
|
3009
|
-
capabilities: string[];
|
|
3010
|
-
rules: AgentRules;
|
|
3011
|
-
owner: string;
|
|
3012
|
-
createdAt: string;
|
|
3013
|
-
lastActiveAt?: string;
|
|
3014
|
-
};
|
|
3015
|
-
export type AgentEvent = {
|
|
3016
|
-
eventId: string;
|
|
3017
|
-
agentId: string;
|
|
3018
|
-
type: string;
|
|
3019
|
-
data: Record<string, unknown>;
|
|
3020
|
-
timestamp: string;
|
|
3021
|
-
};
|
|
3022
|
-
export type AgentBalance = {
|
|
3023
|
-
chain: string;
|
|
3024
|
-
accountId: string;
|
|
3025
|
-
balance: string;
|
|
3026
|
-
symbol: string;
|
|
3027
|
-
};
|
|
3028
|
-
export type AgentOperation = {
|
|
3029
|
-
operationId: string;
|
|
3030
|
-
agentId: string;
|
|
3031
|
-
type: string;
|
|
3032
|
-
amount: string;
|
|
3033
|
-
chain: string;
|
|
3034
|
-
status: "pending" | "approved" | "rejected";
|
|
3035
|
-
createdAt: string;
|
|
3036
|
-
};
|
|
3037
|
-
export type AgentFundRequest = {
|
|
3038
|
-
chain: string;
|
|
3039
|
-
amount: string;
|
|
3040
|
-
source?: string;
|
|
3041
|
-
};
|
|
3042
|
-
export type AgentTradeRequest = {
|
|
3043
|
-
chain: string;
|
|
3044
|
-
pair: string;
|
|
3045
|
-
side: "buy" | "sell";
|
|
3046
|
-
amount: string;
|
|
3047
|
-
price?: string;
|
|
3048
|
-
};
|
|
3049
|
-
export type AgentWithdrawRequest = {
|
|
3050
|
-
chain: string;
|
|
3051
|
-
amount: string;
|
|
3052
|
-
destination: string;
|
|
3053
|
-
};
|
|
3054
|
-
export declare class AgentsClient {
|
|
3055
|
-
private readonly http;
|
|
3056
|
-
constructor(http: HttpClient);
|
|
3057
|
-
register(request: AgentRegisterRequest): Promise<AgentInfo>;
|
|
3058
|
-
get(agentId: string): Promise<AgentInfo>;
|
|
3059
|
-
list(): Promise<{
|
|
3060
|
-
agents: AgentInfo[];
|
|
3061
|
-
total: number;
|
|
3062
|
-
}>;
|
|
3063
|
-
fund(agentId: string, request: AgentFundRequest): Promise<{
|
|
3064
|
-
success: boolean;
|
|
3065
|
-
txId?: string;
|
|
3066
|
-
}>;
|
|
3067
|
-
trade(agentId: string, request: AgentTradeRequest): Promise<{
|
|
3068
|
-
success: boolean;
|
|
3069
|
-
txId?: string;
|
|
3070
|
-
}>;
|
|
3071
|
-
withdraw(agentId: string, request: AgentWithdrawRequest): Promise<{
|
|
3072
|
-
success: boolean;
|
|
3073
|
-
txId?: string;
|
|
3074
|
-
}>;
|
|
3075
|
-
pause(agentId: string): Promise<{
|
|
3076
|
-
success: boolean;
|
|
3077
|
-
status: string;
|
|
3078
|
-
}>;
|
|
3079
|
-
resume(agentId: string): Promise<{
|
|
3080
|
-
success: boolean;
|
|
3081
|
-
status: string;
|
|
3082
|
-
}>;
|
|
3083
|
-
revoke(agentId: string): Promise<{
|
|
3084
|
-
success: boolean;
|
|
3085
|
-
status: string;
|
|
3086
|
-
}>;
|
|
3087
|
-
updateRules(agentId: string, rules: Partial<AgentRules>): Promise<AgentInfo>;
|
|
3088
|
-
getEvents(agentId: string): Promise<{
|
|
3089
|
-
events: AgentEvent[];
|
|
3090
|
-
total: number;
|
|
3091
|
-
}>;
|
|
3092
|
-
getBalances(agentId: string): Promise<{
|
|
3093
|
-
balances: AgentBalance[];
|
|
3094
|
-
}>;
|
|
3095
|
-
approve(agentId: string, operationId: string): Promise<{
|
|
3096
|
-
success: boolean;
|
|
3097
|
-
}>;
|
|
3098
|
-
reject(agentId: string, operationId: string): Promise<{
|
|
3099
|
-
success: boolean;
|
|
3100
|
-
}>;
|
|
3101
|
-
}
|
|
3102
3114
|
export type CustomerSessionChallenge = {
|
|
3103
3115
|
challenge: string;
|
|
3104
3116
|
};
|
|
@@ -3193,6 +3205,99 @@ export declare class BaasError extends Error {
|
|
|
3193
3205
|
readonly details?: BaasErrorDetails | undefined;
|
|
3194
3206
|
constructor(message: string, statusCode: number, details?: BaasErrorDetails | undefined);
|
|
3195
3207
|
}
|
|
3208
|
+
export declare const PqcCertV1Schema: z.ZodObject<{
|
|
3209
|
+
pqcCertVersion: z.ZodLiteral<1>;
|
|
3210
|
+
algorithm: z.ZodLiteral<"ml-dsa-87">;
|
|
3211
|
+
consumer: z.ZodString;
|
|
3212
|
+
contentHash: z.ZodString;
|
|
3213
|
+
payloadHash: z.ZodOptional<z.ZodString>;
|
|
3214
|
+
threshold: z.ZodNumber;
|
|
3215
|
+
signers: z.ZodArray<z.ZodObject<{
|
|
3216
|
+
nodeId: z.ZodString;
|
|
3217
|
+
dilithium5PublicKey: z.ZodString;
|
|
3218
|
+
signature: z.ZodString;
|
|
3219
|
+
}, "strip", z.ZodTypeAny, {
|
|
3220
|
+
nodeId: string;
|
|
3221
|
+
signature: string;
|
|
3222
|
+
dilithium5PublicKey: string;
|
|
3223
|
+
}, {
|
|
3224
|
+
nodeId: string;
|
|
3225
|
+
signature: string;
|
|
3226
|
+
dilithium5PublicKey: string;
|
|
3227
|
+
}>, "atleastone">;
|
|
3228
|
+
ts: z.ZodNumber;
|
|
3229
|
+
topicMessageId: z.ZodOptional<z.ZodString>;
|
|
3230
|
+
}, "strict", z.ZodTypeAny, {
|
|
3231
|
+
threshold: number;
|
|
3232
|
+
signers: [
|
|
3233
|
+
{
|
|
3234
|
+
nodeId: string;
|
|
3235
|
+
signature: string;
|
|
3236
|
+
dilithium5PublicKey: string;
|
|
3237
|
+
},
|
|
3238
|
+
...{
|
|
3239
|
+
nodeId: string;
|
|
3240
|
+
signature: string;
|
|
3241
|
+
dilithium5PublicKey: string;
|
|
3242
|
+
}[]
|
|
3243
|
+
];
|
|
3244
|
+
algorithm: "ml-dsa-87";
|
|
3245
|
+
pqcCertVersion: 1;
|
|
3246
|
+
consumer: string;
|
|
3247
|
+
contentHash: string;
|
|
3248
|
+
ts: number;
|
|
3249
|
+
payloadHash?: string | undefined;
|
|
3250
|
+
topicMessageId?: string | undefined;
|
|
3251
|
+
}, {
|
|
3252
|
+
threshold: number;
|
|
3253
|
+
signers: [
|
|
3254
|
+
{
|
|
3255
|
+
nodeId: string;
|
|
3256
|
+
signature: string;
|
|
3257
|
+
dilithium5PublicKey: string;
|
|
3258
|
+
},
|
|
3259
|
+
...{
|
|
3260
|
+
nodeId: string;
|
|
3261
|
+
signature: string;
|
|
3262
|
+
dilithium5PublicKey: string;
|
|
3263
|
+
}[]
|
|
3264
|
+
];
|
|
3265
|
+
algorithm: "ml-dsa-87";
|
|
3266
|
+
pqcCertVersion: 1;
|
|
3267
|
+
consumer: string;
|
|
3268
|
+
contentHash: string;
|
|
3269
|
+
ts: number;
|
|
3270
|
+
payloadHash?: string | undefined;
|
|
3271
|
+
topicMessageId?: string | undefined;
|
|
3272
|
+
}>;
|
|
3273
|
+
export type PqcCertV1 = z.infer<typeof PqcCertV1Schema>;
|
|
3274
|
+
export type PqcCertV1Signer = PqcCertV1["signers"][number];
|
|
3275
|
+
export declare function parsePqcCert(input: unknown): {
|
|
3276
|
+
ok: true;
|
|
3277
|
+
cert: PqcCertV1;
|
|
3278
|
+
} | {
|
|
3279
|
+
ok: false;
|
|
3280
|
+
error: string;
|
|
3281
|
+
};
|
|
3282
|
+
export type ValidatorRegistrySnapshot = {
|
|
3283
|
+
readonly snapshotTs: number;
|
|
3284
|
+
readonly validators: readonly {
|
|
3285
|
+
readonly nodeId: string;
|
|
3286
|
+
readonly dilithium5PublicKey: string;
|
|
3287
|
+
readonly active: boolean;
|
|
3288
|
+
}[];
|
|
3289
|
+
};
|
|
3290
|
+
export type FetchRegistryOptions = {
|
|
3291
|
+
readonly timeoutMs?: number;
|
|
3292
|
+
};
|
|
3293
|
+
export declare function fetchRegistrySnapshot(smartHostUrl: string, opts?: FetchRegistryOptions): Promise<ValidatorRegistrySnapshot | null>;
|
|
3294
|
+
export type VerifyResult = {
|
|
3295
|
+
readonly valid: boolean;
|
|
3296
|
+
readonly reason?: string;
|
|
3297
|
+
readonly verifiedSignerCount?: number;
|
|
3298
|
+
readonly thresholdMet?: boolean;
|
|
3299
|
+
};
|
|
3300
|
+
export declare function verifyPqcAttestation(cert: unknown, payload: unknown, registrySnapshot?: ValidatorRegistrySnapshot): Promise<VerifyResult>;
|
|
3196
3301
|
|
|
3197
3302
|
declare namespace bitcoin {
|
|
3198
3303
|
export { btcToSatoshis, satoshisToBtc, validateBitcoinAddress };
|
|
@@ -3212,14 +3317,14 @@ declare namespace solana {
|
|
|
3212
3317
|
declare namespace stellar {
|
|
3213
3318
|
export { stroopsToXlm, validateStellarAddress, xlmToStroops };
|
|
3214
3319
|
}
|
|
3215
|
-
declare namespace
|
|
3216
|
-
export {
|
|
3320
|
+
declare namespace pqcVerify {
|
|
3321
|
+
export { FetchRegistryOptions, PqcCertV1, PqcCertV1Schema, PqcCertV1Signer, ValidatorRegistrySnapshot, VerifyResult, fetchRegistrySnapshot, parsePqcCert, verifyPqcAttestation };
|
|
3217
3322
|
}
|
|
3218
3323
|
declare namespace discovery {
|
|
3219
3324
|
export { ClusterDiscoveryClient, ClusterDiscoveryConfig, ClusterEndpointsView, ClusterInfo, MIRROR_NODE_URLS, MirrorNodeClient, MirrorNodeConfig, MirrorNodeError, TopicMessage, TopicMessagesResponse, ValidatorDiscoveryClient, ValidatorDiscoveryConfig, ValidatorInfo, ValidatorMetadata, ValidatorNetworkEndpoints };
|
|
3220
3325
|
}
|
|
3221
3326
|
declare namespace auth {
|
|
3222
|
-
export { AuthChain, AuthenticateRequest, AuthenticateResponse, ChallengeResponse, SecurityConfig, SessionInfo, ValidatorAuthClient, ValidatorAuthConfig, ValidatorAuthError };
|
|
3327
|
+
export { AuthChain, AuthenticateRequest, AuthenticateResponse, ChallengeResponse, SecurityConfig, SessionInfo, ValidatorAuthClient, ValidatorAuthConfig, ValidatorAuthError, Web3Signer, createXrplWeb3Signer };
|
|
3223
3328
|
}
|
|
3224
3329
|
declare namespace chains {
|
|
3225
3330
|
export { bitcoin, hedera, polkadot, solana, stellar, xrpl };
|
|
@@ -3236,6 +3341,9 @@ declare namespace governance {
|
|
|
3236
3341
|
declare namespace personhood {
|
|
3237
3342
|
export { PERSONHOOD_VERIFIER_NOT_CONFIGURED, PersonhoodAttestationMethod, PersonhoodCert, PersonhoodClient, PersonhoodProof, PersonhoodVerifyParams, isPersonhoodVerifierNotConfigured };
|
|
3238
3343
|
}
|
|
3344
|
+
declare namespace baas {
|
|
3345
|
+
export { AgentBalance, AgentEvent, AgentFundRequest, AgentInfo, AgentOperation, AgentRegisterRequest, AgentRules, AgentRulesValidationResult, AgentStatus, AgentTradeRequest, AgentWithdrawRequest, AgentsClient, AuthenticateOptions, BaasAppListResponse, BaasAuthConfig, BaasAuthResult, BaasChallengeRequest, BaasChallengeResponse, BaasChannelConfig, BaasClient, BaasClientConfig, BaasDeleteResult, BaasDeployRequest, BaasDeployResponse, BaasDocument, BaasEndpoints, BaasError, BaasErrorDetails, BaasErrorResponse, BaasFileInfo, BaasFileMetadata, BaasFindResult, BaasFunctionDeployRequest, BaasFunctionDeployResult, BaasFunctionInfo, BaasFunctionLog, BaasFunctionLogOptions, BaasFunctionResources, BaasFunctionResult, BaasFunctionRuntime, BaasHistoryOptions, BaasInitRequest, BaasInitResponse, BaasInsertResult, BaasMerkleProof, BaasMessage, BaasPresenceInfo, BaasPresenceMember, BaasPublishResult, BaasQueryOptions, BaasRollbackRequest, BaasRuntimeStatus, BaasService, BaasSessionInfo, BaasStateTransition, BaasStorageUsage, BaasSupportedChain, BaasTriggerType, BaasUpdateResult, BaasUploadFrontendResponse, BaasUploadResult, BaasVerifyRequest, ChannelSubscription, DatabaseClient, DatabaseStatsResponse, DbComparisonOperator, DbDocument, DbQuery, DeployedApp, DeployedAppInfo, DeployedAppLimits, DeployedAppStatus, DeployedAppUsage, DeploymentClient, DocumentProofResponse, FunctionsClient, MessageHandler, MessagingClient, StateRootResponse, StateTransitionsResponse, StorageClient, validateAgentRules };
|
|
3346
|
+
}
|
|
3239
3347
|
|
|
3240
3348
|
export {
|
|
3241
3349
|
RetryConfig as ResilienceRetryConfig,
|
|
@@ -3246,6 +3354,7 @@ export {
|
|
|
3246
3354
|
discovery,
|
|
3247
3355
|
governance,
|
|
3248
3356
|
personhood,
|
|
3357
|
+
pqcVerify,
|
|
3249
3358
|
settlement,
|
|
3250
3359
|
subscription,
|
|
3251
3360
|
};
|