@hsuite/smart-engines-sdk 3.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.
- package/CHANGELOG.md +20 -0
- package/README.md +373 -0
- package/dist/index.d.ts +2881 -0
- package/dist/index.js +4350 -0
- package/dist/index.js.map +1 -0
- package/dist/nestjs/index.d.ts +2341 -0
- package/dist/nestjs/index.js +3338 -0
- package/dist/nestjs/index.js.map +1 -0
- package/package.json +63 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2881 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import { DynamicModule, OnModuleDestroy, OnModuleInit, Type } from '@nestjs/common';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
export type CircuitState = "closed" | "open" | "half_open";
|
|
7
|
+
export interface CircuitBreakerConfig {
|
|
8
|
+
failureThreshold: number;
|
|
9
|
+
rollingWindowMs: number;
|
|
10
|
+
cooldownMs: number;
|
|
11
|
+
failureFilter?: string[];
|
|
12
|
+
name?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const DEFAULT_CIRCUIT_BREAKER_CONFIG: CircuitBreakerConfig;
|
|
15
|
+
export interface CircuitBreakerSnapshot {
|
|
16
|
+
state: CircuitState;
|
|
17
|
+
failureCount: number;
|
|
18
|
+
successCount: number;
|
|
19
|
+
lastFailureAt?: number;
|
|
20
|
+
openedAt?: number;
|
|
21
|
+
nextProbeAt?: number;
|
|
22
|
+
}
|
|
23
|
+
export declare class CircuitBreakerOpenError extends Error {
|
|
24
|
+
readonly nextProbeAt: number;
|
|
25
|
+
readonly code = "CIRCUIT_BREAKER_OPEN";
|
|
26
|
+
constructor(name: string, nextProbeAt: number);
|
|
27
|
+
}
|
|
28
|
+
export declare class CircuitBreaker {
|
|
29
|
+
private state;
|
|
30
|
+
private failureTimestamps;
|
|
31
|
+
private successCount;
|
|
32
|
+
private openedAt?;
|
|
33
|
+
private readonly config;
|
|
34
|
+
constructor(config?: Partial<CircuitBreakerConfig>);
|
|
35
|
+
execute<T>(operation: () => Promise<T>): Promise<T>;
|
|
36
|
+
canExecute(): boolean;
|
|
37
|
+
getState(): CircuitState;
|
|
38
|
+
snapshot(): CircuitBreakerSnapshot;
|
|
39
|
+
reset(): void;
|
|
40
|
+
private evaluateState;
|
|
41
|
+
private nextProbeTime;
|
|
42
|
+
private pruneOldFailures;
|
|
43
|
+
private recordSuccess;
|
|
44
|
+
private recordFailure;
|
|
45
|
+
private shouldCountFailure;
|
|
46
|
+
}
|
|
47
|
+
interface RetryConfig {
|
|
48
|
+
maxRetries: number;
|
|
49
|
+
initialDelayMs: number;
|
|
50
|
+
maxDelayMs: number;
|
|
51
|
+
backoffMultiplier: number;
|
|
52
|
+
jitterFactor?: number;
|
|
53
|
+
retryableErrors?: string[];
|
|
54
|
+
}
|
|
55
|
+
export interface ResilienceConfig {
|
|
56
|
+
rateLimit?: {
|
|
57
|
+
maxTokens: number;
|
|
58
|
+
refillRatePerSecond: number;
|
|
59
|
+
};
|
|
60
|
+
circuitBreaker?: Partial<CircuitBreakerConfig>;
|
|
61
|
+
readRetry?: Partial<RetryConfig>;
|
|
62
|
+
writeRetry?: Partial<RetryConfig>;
|
|
63
|
+
logRetries?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface IRateLimiterConfig {
|
|
66
|
+
readonly maxRequests: number;
|
|
67
|
+
readonly windowMs: number;
|
|
68
|
+
}
|
|
69
|
+
export interface IRateLimiter {
|
|
70
|
+
isAllowed(key: string): boolean;
|
|
71
|
+
reset(key: string): void;
|
|
72
|
+
clear(): void;
|
|
73
|
+
cleanup(): void;
|
|
74
|
+
}
|
|
75
|
+
export declare class RateLimiter implements IRateLimiter {
|
|
76
|
+
private readonly logger;
|
|
77
|
+
private readonly limits;
|
|
78
|
+
private readonly config;
|
|
79
|
+
constructor(config?: Partial<IRateLimiterConfig>);
|
|
80
|
+
isAllowed(key: string): boolean;
|
|
81
|
+
reset(key: string): void;
|
|
82
|
+
clear(): void;
|
|
83
|
+
cleanup(): void;
|
|
84
|
+
getCount(key: string): number;
|
|
85
|
+
getRemaining(key: string): number;
|
|
86
|
+
getConfig(): Readonly<IRateLimiterConfig>;
|
|
87
|
+
}
|
|
88
|
+
export declare const ErrorCode: {
|
|
89
|
+
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
90
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
91
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
92
|
+
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
93
|
+
readonly FORBIDDEN: "FORBIDDEN";
|
|
94
|
+
readonly RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED";
|
|
95
|
+
readonly PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
|
|
96
|
+
readonly CHAIN_NOT_SUPPORTED: "CHAIN_NOT_SUPPORTED";
|
|
97
|
+
readonly CHAIN_CONNECTION_ERROR: "CHAIN_CONNECTION_ERROR";
|
|
98
|
+
readonly CHAIN_TIMEOUT: "CHAIN_TIMEOUT";
|
|
99
|
+
readonly TRANSACTION_FAILED: "TRANSACTION_FAILED";
|
|
100
|
+
readonly TRANSACTION_TIMEOUT: "TRANSACTION_TIMEOUT";
|
|
101
|
+
readonly INSUFFICIENT_BALANCE: "INSUFFICIENT_BALANCE";
|
|
102
|
+
readonly INVALID_TRANSACTION: "INVALID_TRANSACTION";
|
|
103
|
+
readonly ACCOUNT_NOT_FOUND: "ACCOUNT_NOT_FOUND";
|
|
104
|
+
readonly ACCOUNT_CREATION_FAILED: "ACCOUNT_CREATION_FAILED";
|
|
105
|
+
readonly INVALID_ACCOUNT_ID: "INVALID_ACCOUNT_ID";
|
|
106
|
+
readonly WALLET_NOT_FOUND: "WALLET_NOT_FOUND";
|
|
107
|
+
readonly WALLET_ENCRYPTION_ERROR: "WALLET_ENCRYPTION_ERROR";
|
|
108
|
+
readonly WALLET_DECRYPTION_ERROR: "WALLET_DECRYPTION_ERROR";
|
|
109
|
+
readonly INVALID_PRIVATE_KEY: "INVALID_PRIVATE_KEY";
|
|
110
|
+
readonly TOKEN_NOT_FOUND: "TOKEN_NOT_FOUND";
|
|
111
|
+
readonly TOKEN_CREATION_FAILED: "TOKEN_CREATION_FAILED";
|
|
112
|
+
readonly INSUFFICIENT_TOKEN_BALANCE: "INSUFFICIENT_TOKEN_BALANCE";
|
|
113
|
+
readonly TRUST_LINE_REQUIRED: "TRUST_LINE_REQUIRED";
|
|
114
|
+
readonly TOKEN_NOT_ASSOCIATED: "TOKEN_NOT_ASSOCIATED";
|
|
115
|
+
readonly TOKEN_PAUSED: "TOKEN_PAUSED";
|
|
116
|
+
readonly ACCOUNT_FROZEN: "ACCOUNT_FROZEN";
|
|
117
|
+
readonly KYC_NOT_GRANTED: "KYC_NOT_GRANTED";
|
|
118
|
+
readonly INVALID_SIGNATURE: "INVALID_SIGNATURE";
|
|
119
|
+
readonly NONCE_MISMATCH: "NONCE_MISMATCH";
|
|
120
|
+
readonly CONTRACT_REVERT: "CONTRACT_REVERT";
|
|
121
|
+
readonly CONTRACT_NOT_FOUND: "CONTRACT_NOT_FOUND";
|
|
122
|
+
readonly GAS_ERROR: "GAS_ERROR";
|
|
123
|
+
readonly DATABASE_ERROR: "DATABASE_ERROR";
|
|
124
|
+
readonly CACHE_ERROR: "CACHE_ERROR";
|
|
125
|
+
readonly EVENT_BUS_ERROR: "EVENT_BUS_ERROR";
|
|
126
|
+
readonly EXTERNAL_SERVICE_ERROR: "EXTERNAL_SERVICE_ERROR";
|
|
127
|
+
};
|
|
128
|
+
export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
129
|
+
export interface ErrorContext {
|
|
130
|
+
[key: string]: any;
|
|
131
|
+
}
|
|
132
|
+
export declare class SmartEngineError extends Error {
|
|
133
|
+
readonly code: ErrorCode;
|
|
134
|
+
readonly statusCode: number;
|
|
135
|
+
readonly context?: ErrorContext | undefined;
|
|
136
|
+
readonly isRetryable: boolean;
|
|
137
|
+
constructor(message: string, code: ErrorCode, statusCode?: number, context?: ErrorContext | undefined, isRetryable?: boolean);
|
|
138
|
+
toJSON(): {
|
|
139
|
+
error: {
|
|
140
|
+
name: string;
|
|
141
|
+
message: string;
|
|
142
|
+
code: ErrorCode;
|
|
143
|
+
statusCode: number;
|
|
144
|
+
context: ErrorContext | undefined;
|
|
145
|
+
isRetryable: boolean;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export declare class UnsupportedCapabilityError extends SmartEngineError {
|
|
150
|
+
readonly chain: string;
|
|
151
|
+
readonly capability: string;
|
|
152
|
+
readonly alternatives?: string[] | undefined;
|
|
153
|
+
constructor(chain: string, capability: string, alternatives?: string[] | undefined);
|
|
154
|
+
}
|
|
155
|
+
export declare class CapabilityNotEnabledError extends SmartEngineError {
|
|
156
|
+
readonly tokenId: string;
|
|
157
|
+
readonly capability: string;
|
|
158
|
+
constructor(tokenId: string, capability: string);
|
|
159
|
+
}
|
|
160
|
+
export declare class CapabilityValidationError extends SmartEngineError {
|
|
161
|
+
readonly capabilities: string[];
|
|
162
|
+
readonly chain: string;
|
|
163
|
+
constructor(message: string, capabilities: string[], chain: string);
|
|
164
|
+
}
|
|
165
|
+
declare const ChainTypeSchema: z.ZodEnum<[
|
|
166
|
+
"hedera",
|
|
167
|
+
"xrpl",
|
|
168
|
+
"polkadot",
|
|
169
|
+
"solana",
|
|
170
|
+
"stellar",
|
|
171
|
+
"ethereum",
|
|
172
|
+
"polygon",
|
|
173
|
+
"bitcoin",
|
|
174
|
+
"cardano"
|
|
175
|
+
]>;
|
|
176
|
+
export type ChainType = z.infer<typeof ChainTypeSchema>;
|
|
177
|
+
declare const NetworkTypeSchema: z.ZodEnum<[
|
|
178
|
+
"mainnet",
|
|
179
|
+
"testnet",
|
|
180
|
+
"devnet",
|
|
181
|
+
"local"
|
|
182
|
+
]>;
|
|
183
|
+
export type NetworkType = z.infer<typeof NetworkTypeSchema>;
|
|
184
|
+
declare const TokenCapabilitiesSchema: z.ZodObject<{
|
|
185
|
+
pausable: z.ZodDefault<z.ZodBoolean>;
|
|
186
|
+
restrictable: z.ZodDefault<z.ZodBoolean>;
|
|
187
|
+
compliant: z.ZodDefault<z.ZodBoolean>;
|
|
188
|
+
wipeable: z.ZodDefault<z.ZodBoolean>;
|
|
189
|
+
mintable: z.ZodDefault<z.ZodBoolean>;
|
|
190
|
+
burnable: z.ZodDefault<z.ZodBoolean>;
|
|
191
|
+
transferable: z.ZodDefault<z.ZodBoolean>;
|
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
|
193
|
+
pausable: boolean;
|
|
194
|
+
restrictable: boolean;
|
|
195
|
+
compliant: boolean;
|
|
196
|
+
wipeable: boolean;
|
|
197
|
+
mintable: boolean;
|
|
198
|
+
burnable: boolean;
|
|
199
|
+
transferable: boolean;
|
|
200
|
+
}, {
|
|
201
|
+
pausable?: boolean | undefined;
|
|
202
|
+
restrictable?: boolean | undefined;
|
|
203
|
+
compliant?: boolean | undefined;
|
|
204
|
+
wipeable?: boolean | undefined;
|
|
205
|
+
mintable?: boolean | undefined;
|
|
206
|
+
burnable?: boolean | undefined;
|
|
207
|
+
transferable?: boolean | undefined;
|
|
208
|
+
}>;
|
|
209
|
+
export type TokenCapabilities = z.infer<typeof TokenCapabilitiesSchema>;
|
|
210
|
+
declare const AccountInfoSchema: z.ZodObject<{
|
|
211
|
+
accountId: z.ZodString;
|
|
212
|
+
balance: z.ZodString;
|
|
213
|
+
chain: z.ZodEnum<[
|
|
214
|
+
"hedera",
|
|
215
|
+
"xrpl",
|
|
216
|
+
"polkadot",
|
|
217
|
+
"solana",
|
|
218
|
+
"stellar",
|
|
219
|
+
"ethereum",
|
|
220
|
+
"polygon",
|
|
221
|
+
"bitcoin",
|
|
222
|
+
"cardano"
|
|
223
|
+
]>;
|
|
224
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
225
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
226
|
+
createdAt: z.ZodOptional<z.ZodDate>;
|
|
227
|
+
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
228
|
+
}, "strip", z.ZodTypeAny, {
|
|
229
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
230
|
+
accountId: string;
|
|
231
|
+
balance: string;
|
|
232
|
+
publicKey?: string | undefined;
|
|
233
|
+
metadata?: Record<string, any> | undefined;
|
|
234
|
+
createdAt?: Date | undefined;
|
|
235
|
+
updatedAt?: Date | undefined;
|
|
236
|
+
}, {
|
|
237
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
238
|
+
accountId: string;
|
|
239
|
+
balance: string;
|
|
240
|
+
publicKey?: string | undefined;
|
|
241
|
+
metadata?: Record<string, any> | undefined;
|
|
242
|
+
createdAt?: Date | undefined;
|
|
243
|
+
updatedAt?: Date | undefined;
|
|
244
|
+
}>;
|
|
245
|
+
export type AccountInfo = z.infer<typeof AccountInfoSchema>;
|
|
246
|
+
declare const AccountBalanceSchema: z.ZodObject<{
|
|
247
|
+
accountId: z.ZodString;
|
|
248
|
+
chain: z.ZodEnum<[
|
|
249
|
+
"hedera",
|
|
250
|
+
"xrpl",
|
|
251
|
+
"polkadot",
|
|
252
|
+
"solana",
|
|
253
|
+
"stellar",
|
|
254
|
+
"ethereum",
|
|
255
|
+
"polygon",
|
|
256
|
+
"bitcoin",
|
|
257
|
+
"cardano"
|
|
258
|
+
]>;
|
|
259
|
+
nativeBalance: z.ZodString;
|
|
260
|
+
tokens: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
261
|
+
tokenId: z.ZodString;
|
|
262
|
+
balance: z.ZodString;
|
|
263
|
+
decimals: z.ZodNumber;
|
|
264
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
265
|
+
}, "strip", z.ZodTypeAny, {
|
|
266
|
+
tokenId: string;
|
|
267
|
+
decimals: number;
|
|
268
|
+
balance: string;
|
|
269
|
+
symbol?: string | undefined;
|
|
270
|
+
}, {
|
|
271
|
+
tokenId: string;
|
|
272
|
+
decimals: number;
|
|
273
|
+
balance: string;
|
|
274
|
+
symbol?: string | undefined;
|
|
275
|
+
}>, "many">>;
|
|
276
|
+
timestamp: z.ZodDate;
|
|
277
|
+
}, "strip", z.ZodTypeAny, {
|
|
278
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
279
|
+
accountId: string;
|
|
280
|
+
nativeBalance: string;
|
|
281
|
+
timestamp: Date;
|
|
282
|
+
tokens?: {
|
|
283
|
+
tokenId: string;
|
|
284
|
+
decimals: number;
|
|
285
|
+
balance: string;
|
|
286
|
+
symbol?: string | undefined;
|
|
287
|
+
}[] | undefined;
|
|
288
|
+
}, {
|
|
289
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
290
|
+
accountId: string;
|
|
291
|
+
nativeBalance: string;
|
|
292
|
+
timestamp: Date;
|
|
293
|
+
tokens?: {
|
|
294
|
+
tokenId: string;
|
|
295
|
+
decimals: number;
|
|
296
|
+
balance: string;
|
|
297
|
+
symbol?: string | undefined;
|
|
298
|
+
}[] | undefined;
|
|
299
|
+
}>;
|
|
300
|
+
export type AccountBalance = z.infer<typeof AccountBalanceSchema>;
|
|
301
|
+
declare const TransactionSchema: z.ZodObject<{
|
|
302
|
+
id: z.ZodString;
|
|
303
|
+
chain: z.ZodEnum<[
|
|
304
|
+
"hedera",
|
|
305
|
+
"xrpl",
|
|
306
|
+
"polkadot",
|
|
307
|
+
"solana",
|
|
308
|
+
"stellar",
|
|
309
|
+
"ethereum",
|
|
310
|
+
"polygon",
|
|
311
|
+
"bitcoin",
|
|
312
|
+
"cardano"
|
|
313
|
+
]>;
|
|
314
|
+
type: z.ZodEnum<[
|
|
315
|
+
"transfer",
|
|
316
|
+
"token_transfer",
|
|
317
|
+
"account_create",
|
|
318
|
+
"token_create",
|
|
319
|
+
"token_mint",
|
|
320
|
+
"token_burn",
|
|
321
|
+
"contract_call",
|
|
322
|
+
"contract_create",
|
|
323
|
+
"topic_message",
|
|
324
|
+
"other"
|
|
325
|
+
]>;
|
|
326
|
+
status: z.ZodEnum<[
|
|
327
|
+
"pending",
|
|
328
|
+
"success",
|
|
329
|
+
"failed",
|
|
330
|
+
"expired"
|
|
331
|
+
]>;
|
|
332
|
+
timestamp: z.ZodDate;
|
|
333
|
+
from: z.ZodString;
|
|
334
|
+
to: z.ZodOptional<z.ZodString>;
|
|
335
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
336
|
+
fee: z.ZodString;
|
|
337
|
+
memo: z.ZodOptional<z.ZodString>;
|
|
338
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
339
|
+
}, "strip", z.ZodTypeAny, {
|
|
340
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
341
|
+
type: "transfer" | "token_transfer" | "account_create" | "token_create" | "token_mint" | "token_burn" | "contract_call" | "contract_create" | "topic_message" | "other";
|
|
342
|
+
status: "success" | "pending" | "failed" | "expired";
|
|
343
|
+
timestamp: Date;
|
|
344
|
+
id: string;
|
|
345
|
+
from: string;
|
|
346
|
+
fee: string;
|
|
347
|
+
metadata?: Record<string, any> | undefined;
|
|
348
|
+
to?: string | undefined;
|
|
349
|
+
amount?: string | undefined;
|
|
350
|
+
memo?: string | undefined;
|
|
351
|
+
}, {
|
|
352
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
353
|
+
type: "transfer" | "token_transfer" | "account_create" | "token_create" | "token_mint" | "token_burn" | "contract_call" | "contract_create" | "topic_message" | "other";
|
|
354
|
+
status: "success" | "pending" | "failed" | "expired";
|
|
355
|
+
timestamp: Date;
|
|
356
|
+
id: string;
|
|
357
|
+
from: string;
|
|
358
|
+
fee: string;
|
|
359
|
+
metadata?: Record<string, any> | undefined;
|
|
360
|
+
to?: string | undefined;
|
|
361
|
+
amount?: string | undefined;
|
|
362
|
+
memo?: string | undefined;
|
|
363
|
+
}>;
|
|
364
|
+
export type Transaction = z.infer<typeof TransactionSchema>;
|
|
365
|
+
declare const TokenSchema: z.ZodObject<{
|
|
366
|
+
tokenId: z.ZodString;
|
|
367
|
+
chain: z.ZodEnum<[
|
|
368
|
+
"hedera",
|
|
369
|
+
"xrpl",
|
|
370
|
+
"polkadot",
|
|
371
|
+
"solana",
|
|
372
|
+
"stellar",
|
|
373
|
+
"ethereum",
|
|
374
|
+
"polygon",
|
|
375
|
+
"bitcoin",
|
|
376
|
+
"cardano"
|
|
377
|
+
]>;
|
|
378
|
+
name: z.ZodString;
|
|
379
|
+
symbol: z.ZodString;
|
|
380
|
+
decimals: z.ZodNumber;
|
|
381
|
+
totalSupply: z.ZodString;
|
|
382
|
+
type: z.ZodEnum<[
|
|
383
|
+
"fungible",
|
|
384
|
+
"nft",
|
|
385
|
+
"semi_fungible"
|
|
386
|
+
]>;
|
|
387
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
388
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
389
|
+
createdAt: z.ZodOptional<z.ZodDate>;
|
|
390
|
+
}, "strip", z.ZodTypeAny, {
|
|
391
|
+
symbol: string;
|
|
392
|
+
name: string;
|
|
393
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
394
|
+
tokenId: string;
|
|
395
|
+
type: "fungible" | "nft" | "semi_fungible";
|
|
396
|
+
decimals: number;
|
|
397
|
+
totalSupply: string;
|
|
398
|
+
metadata?: Record<string, any> | undefined;
|
|
399
|
+
createdAt?: Date | undefined;
|
|
400
|
+
creator?: string | undefined;
|
|
401
|
+
}, {
|
|
402
|
+
symbol: string;
|
|
403
|
+
name: string;
|
|
404
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
405
|
+
tokenId: string;
|
|
406
|
+
type: "fungible" | "nft" | "semi_fungible";
|
|
407
|
+
decimals: number;
|
|
408
|
+
totalSupply: string;
|
|
409
|
+
metadata?: Record<string, any> | undefined;
|
|
410
|
+
createdAt?: Date | undefined;
|
|
411
|
+
creator?: string | undefined;
|
|
412
|
+
}>;
|
|
413
|
+
export type Token = z.infer<typeof TokenSchema>;
|
|
414
|
+
declare const TokenInfoSchema: z.ZodObject<{
|
|
415
|
+
tokenId: z.ZodString;
|
|
416
|
+
chain: z.ZodEnum<[
|
|
417
|
+
"hedera",
|
|
418
|
+
"xrpl",
|
|
419
|
+
"polkadot",
|
|
420
|
+
"solana",
|
|
421
|
+
"stellar",
|
|
422
|
+
"ethereum",
|
|
423
|
+
"polygon",
|
|
424
|
+
"bitcoin",
|
|
425
|
+
"cardano"
|
|
426
|
+
]>;
|
|
427
|
+
name: z.ZodString;
|
|
428
|
+
symbol: z.ZodString;
|
|
429
|
+
decimals: z.ZodNumber;
|
|
430
|
+
totalSupply: z.ZodString;
|
|
431
|
+
type: z.ZodEnum<[
|
|
432
|
+
"fungible",
|
|
433
|
+
"nft",
|
|
434
|
+
"semi_fungible"
|
|
435
|
+
]>;
|
|
436
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
437
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
438
|
+
createdAt: z.ZodOptional<z.ZodDate>;
|
|
439
|
+
} & {
|
|
440
|
+
holders: z.ZodOptional<z.ZodNumber>;
|
|
441
|
+
transferCount: z.ZodOptional<z.ZodNumber>;
|
|
442
|
+
circulatingSupply: z.ZodOptional<z.ZodString>;
|
|
443
|
+
}, "strip", z.ZodTypeAny, {
|
|
444
|
+
symbol: string;
|
|
445
|
+
name: string;
|
|
446
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
447
|
+
tokenId: string;
|
|
448
|
+
type: "fungible" | "nft" | "semi_fungible";
|
|
449
|
+
decimals: number;
|
|
450
|
+
totalSupply: string;
|
|
451
|
+
metadata?: Record<string, any> | undefined;
|
|
452
|
+
createdAt?: Date | undefined;
|
|
453
|
+
creator?: string | undefined;
|
|
454
|
+
holders?: number | undefined;
|
|
455
|
+
transferCount?: number | undefined;
|
|
456
|
+
circulatingSupply?: string | undefined;
|
|
457
|
+
}, {
|
|
458
|
+
symbol: string;
|
|
459
|
+
name: string;
|
|
460
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
461
|
+
tokenId: string;
|
|
462
|
+
type: "fungible" | "nft" | "semi_fungible";
|
|
463
|
+
decimals: number;
|
|
464
|
+
totalSupply: string;
|
|
465
|
+
metadata?: Record<string, any> | undefined;
|
|
466
|
+
createdAt?: Date | undefined;
|
|
467
|
+
creator?: string | undefined;
|
|
468
|
+
holders?: number | undefined;
|
|
469
|
+
transferCount?: number | undefined;
|
|
470
|
+
circulatingSupply?: string | undefined;
|
|
471
|
+
}>;
|
|
472
|
+
export type TokenInfo = z.infer<typeof TokenInfoSchema>;
|
|
473
|
+
declare const CreateAccountRequestSchema: z.ZodObject<{
|
|
474
|
+
chain: z.ZodEnum<[
|
|
475
|
+
"hedera",
|
|
476
|
+
"xrpl",
|
|
477
|
+
"polkadot",
|
|
478
|
+
"solana",
|
|
479
|
+
"stellar",
|
|
480
|
+
"ethereum",
|
|
481
|
+
"polygon",
|
|
482
|
+
"bitcoin",
|
|
483
|
+
"cardano"
|
|
484
|
+
]>;
|
|
485
|
+
initialBalance: z.ZodString;
|
|
486
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
487
|
+
memo: z.ZodOptional<z.ZodString>;
|
|
488
|
+
payerAccountId: z.ZodOptional<z.ZodString>;
|
|
489
|
+
validatorTimestamp: z.ZodString;
|
|
490
|
+
validatorTopicId: z.ZodString;
|
|
491
|
+
immutable: z.ZodDefault<z.ZodBoolean>;
|
|
492
|
+
securityMode: z.ZodDefault<z.ZodEnum<[
|
|
493
|
+
"none",
|
|
494
|
+
"partial",
|
|
495
|
+
"full"
|
|
496
|
+
]>>;
|
|
497
|
+
appOwnerPublicKey: z.ZodOptional<z.ZodString>;
|
|
498
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
499
|
+
}, "strip", z.ZodTypeAny, {
|
|
500
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
501
|
+
securityMode: "none" | "partial" | "full";
|
|
502
|
+
initialBalance: string;
|
|
503
|
+
validatorTimestamp: string;
|
|
504
|
+
validatorTopicId: string;
|
|
505
|
+
immutable: boolean;
|
|
506
|
+
publicKey?: string | undefined;
|
|
507
|
+
metadata?: Record<string, any> | undefined;
|
|
508
|
+
appOwnerPublicKey?: string | undefined;
|
|
509
|
+
memo?: string | undefined;
|
|
510
|
+
payerAccountId?: string | undefined;
|
|
511
|
+
}, {
|
|
512
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
513
|
+
initialBalance: string;
|
|
514
|
+
validatorTimestamp: string;
|
|
515
|
+
validatorTopicId: string;
|
|
516
|
+
publicKey?: string | undefined;
|
|
517
|
+
metadata?: Record<string, any> | undefined;
|
|
518
|
+
securityMode?: "none" | "partial" | "full" | undefined;
|
|
519
|
+
appOwnerPublicKey?: string | undefined;
|
|
520
|
+
memo?: string | undefined;
|
|
521
|
+
payerAccountId?: string | undefined;
|
|
522
|
+
immutable?: boolean | undefined;
|
|
523
|
+
}>;
|
|
524
|
+
export type CreateAccountRequest = z.infer<typeof CreateAccountRequestSchema>;
|
|
525
|
+
declare const CreateAccountResponseSchema: z.ZodObject<{
|
|
526
|
+
accountId: z.ZodString;
|
|
527
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
528
|
+
privateKey: z.ZodOptional<z.ZodString>;
|
|
529
|
+
transactionId: z.ZodString;
|
|
530
|
+
chain: z.ZodEnum<[
|
|
531
|
+
"hedera",
|
|
532
|
+
"xrpl",
|
|
533
|
+
"polkadot",
|
|
534
|
+
"solana",
|
|
535
|
+
"stellar",
|
|
536
|
+
"ethereum",
|
|
537
|
+
"polygon",
|
|
538
|
+
"bitcoin",
|
|
539
|
+
"cardano"
|
|
540
|
+
]>;
|
|
541
|
+
timestamp: z.ZodOptional<z.ZodDate>;
|
|
542
|
+
}, "strip", z.ZodTypeAny, {
|
|
543
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
544
|
+
accountId: string;
|
|
545
|
+
transactionId: string;
|
|
546
|
+
publicKey?: string | undefined;
|
|
547
|
+
timestamp?: Date | undefined;
|
|
548
|
+
privateKey?: string | undefined;
|
|
549
|
+
}, {
|
|
550
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
551
|
+
accountId: string;
|
|
552
|
+
transactionId: string;
|
|
553
|
+
publicKey?: string | undefined;
|
|
554
|
+
timestamp?: Date | undefined;
|
|
555
|
+
privateKey?: string | undefined;
|
|
556
|
+
}>;
|
|
557
|
+
export type CreateAccountResponse = z.infer<typeof CreateAccountResponseSchema>;
|
|
558
|
+
declare const TransferRequestSchema: z.ZodObject<{
|
|
559
|
+
chain: z.ZodEnum<[
|
|
560
|
+
"hedera",
|
|
561
|
+
"xrpl",
|
|
562
|
+
"polkadot",
|
|
563
|
+
"solana",
|
|
564
|
+
"stellar",
|
|
565
|
+
"ethereum",
|
|
566
|
+
"polygon",
|
|
567
|
+
"bitcoin",
|
|
568
|
+
"cardano"
|
|
569
|
+
]>;
|
|
570
|
+
from: z.ZodString;
|
|
571
|
+
to: z.ZodString;
|
|
572
|
+
amount: z.ZodString;
|
|
573
|
+
tokenId: z.ZodOptional<z.ZodString>;
|
|
574
|
+
memo: z.ZodOptional<z.ZodString>;
|
|
575
|
+
payerAccountId: z.ZodOptional<z.ZodString>;
|
|
576
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
577
|
+
}, "strip", z.ZodTypeAny, {
|
|
578
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
579
|
+
from: string;
|
|
580
|
+
to: string;
|
|
581
|
+
amount: string;
|
|
582
|
+
tokenId?: string | undefined;
|
|
583
|
+
metadata?: Record<string, any> | undefined;
|
|
584
|
+
memo?: string | undefined;
|
|
585
|
+
payerAccountId?: string | undefined;
|
|
586
|
+
}, {
|
|
587
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
588
|
+
from: string;
|
|
589
|
+
to: string;
|
|
590
|
+
amount: string;
|
|
591
|
+
tokenId?: string | undefined;
|
|
592
|
+
metadata?: Record<string, any> | undefined;
|
|
593
|
+
memo?: string | undefined;
|
|
594
|
+
payerAccountId?: string | undefined;
|
|
595
|
+
}>;
|
|
596
|
+
export type TransferRequest = z.infer<typeof TransferRequestSchema>;
|
|
597
|
+
declare const TransferResponseSchema: z.ZodObject<{
|
|
598
|
+
transactionId: z.ZodString;
|
|
599
|
+
status: z.ZodEnum<[
|
|
600
|
+
"pending",
|
|
601
|
+
"success",
|
|
602
|
+
"failed"
|
|
603
|
+
]>;
|
|
604
|
+
chain: z.ZodEnum<[
|
|
605
|
+
"hedera",
|
|
606
|
+
"xrpl",
|
|
607
|
+
"polkadot",
|
|
608
|
+
"solana",
|
|
609
|
+
"stellar",
|
|
610
|
+
"ethereum",
|
|
611
|
+
"polygon",
|
|
612
|
+
"bitcoin",
|
|
613
|
+
"cardano"
|
|
614
|
+
]>;
|
|
615
|
+
fee: z.ZodOptional<z.ZodString>;
|
|
616
|
+
timestamp: z.ZodOptional<z.ZodDate>;
|
|
617
|
+
}, "strip", z.ZodTypeAny, {
|
|
618
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
619
|
+
status: "success" | "pending" | "failed";
|
|
620
|
+
transactionId: string;
|
|
621
|
+
timestamp?: Date | undefined;
|
|
622
|
+
fee?: string | undefined;
|
|
623
|
+
}, {
|
|
624
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
625
|
+
status: "success" | "pending" | "failed";
|
|
626
|
+
transactionId: string;
|
|
627
|
+
timestamp?: Date | undefined;
|
|
628
|
+
fee?: string | undefined;
|
|
629
|
+
}>;
|
|
630
|
+
export type TransferResponse = z.infer<typeof TransferResponseSchema>;
|
|
631
|
+
declare const CreateTokenRequestSchema: z.ZodObject<{
|
|
632
|
+
chain: z.ZodEnum<[
|
|
633
|
+
"hedera",
|
|
634
|
+
"xrpl",
|
|
635
|
+
"polkadot",
|
|
636
|
+
"solana",
|
|
637
|
+
"stellar",
|
|
638
|
+
"ethereum",
|
|
639
|
+
"polygon",
|
|
640
|
+
"bitcoin",
|
|
641
|
+
"cardano"
|
|
642
|
+
]>;
|
|
643
|
+
name: z.ZodString;
|
|
644
|
+
symbol: z.ZodString;
|
|
645
|
+
decimals: z.ZodNumber;
|
|
646
|
+
initialSupply: z.ZodString;
|
|
647
|
+
type: z.ZodEnum<[
|
|
648
|
+
"fungible",
|
|
649
|
+
"nft"
|
|
650
|
+
]>;
|
|
651
|
+
treasury: z.ZodOptional<z.ZodString>;
|
|
652
|
+
capabilities: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
653
|
+
pausable: z.ZodDefault<z.ZodBoolean>;
|
|
654
|
+
restrictable: z.ZodDefault<z.ZodBoolean>;
|
|
655
|
+
compliant: z.ZodDefault<z.ZodBoolean>;
|
|
656
|
+
wipeable: z.ZodDefault<z.ZodBoolean>;
|
|
657
|
+
mintable: z.ZodDefault<z.ZodBoolean>;
|
|
658
|
+
burnable: z.ZodDefault<z.ZodBoolean>;
|
|
659
|
+
transferable: z.ZodDefault<z.ZodBoolean>;
|
|
660
|
+
}, "strip", z.ZodTypeAny, {
|
|
661
|
+
pausable: boolean;
|
|
662
|
+
restrictable: boolean;
|
|
663
|
+
compliant: boolean;
|
|
664
|
+
wipeable: boolean;
|
|
665
|
+
mintable: boolean;
|
|
666
|
+
burnable: boolean;
|
|
667
|
+
transferable: boolean;
|
|
668
|
+
}, {
|
|
669
|
+
pausable?: boolean | undefined;
|
|
670
|
+
restrictable?: boolean | undefined;
|
|
671
|
+
compliant?: boolean | undefined;
|
|
672
|
+
wipeable?: boolean | undefined;
|
|
673
|
+
mintable?: boolean | undefined;
|
|
674
|
+
burnable?: boolean | undefined;
|
|
675
|
+
transferable?: boolean | undefined;
|
|
676
|
+
}>>>;
|
|
677
|
+
validatorTimestamp: z.ZodString;
|
|
678
|
+
validatorTopicId: z.ZodString;
|
|
679
|
+
immutable: z.ZodDefault<z.ZodBoolean>;
|
|
680
|
+
payerAccountId: z.ZodOptional<z.ZodString>;
|
|
681
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
682
|
+
}, "strip", z.ZodTypeAny, {
|
|
683
|
+
symbol: string;
|
|
684
|
+
name: string;
|
|
685
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
686
|
+
capabilities: {
|
|
687
|
+
pausable: boolean;
|
|
688
|
+
restrictable: boolean;
|
|
689
|
+
compliant: boolean;
|
|
690
|
+
wipeable: boolean;
|
|
691
|
+
mintable: boolean;
|
|
692
|
+
burnable: boolean;
|
|
693
|
+
transferable: boolean;
|
|
694
|
+
};
|
|
695
|
+
type: "fungible" | "nft";
|
|
696
|
+
decimals: number;
|
|
697
|
+
validatorTimestamp: string;
|
|
698
|
+
validatorTopicId: string;
|
|
699
|
+
immutable: boolean;
|
|
700
|
+
initialSupply: string;
|
|
701
|
+
metadata?: Record<string, any> | undefined;
|
|
702
|
+
payerAccountId?: string | undefined;
|
|
703
|
+
treasury?: string | undefined;
|
|
704
|
+
}, {
|
|
705
|
+
symbol: string;
|
|
706
|
+
name: string;
|
|
707
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
708
|
+
type: "fungible" | "nft";
|
|
709
|
+
decimals: number;
|
|
710
|
+
validatorTimestamp: string;
|
|
711
|
+
validatorTopicId: string;
|
|
712
|
+
initialSupply: string;
|
|
713
|
+
capabilities?: {
|
|
714
|
+
pausable?: boolean | undefined;
|
|
715
|
+
restrictable?: boolean | undefined;
|
|
716
|
+
compliant?: boolean | undefined;
|
|
717
|
+
wipeable?: boolean | undefined;
|
|
718
|
+
mintable?: boolean | undefined;
|
|
719
|
+
burnable?: boolean | undefined;
|
|
720
|
+
transferable?: boolean | undefined;
|
|
721
|
+
} | undefined;
|
|
722
|
+
metadata?: Record<string, any> | undefined;
|
|
723
|
+
payerAccountId?: string | undefined;
|
|
724
|
+
immutable?: boolean | undefined;
|
|
725
|
+
treasury?: string | undefined;
|
|
726
|
+
}>;
|
|
727
|
+
export type CreateTokenRequest = z.infer<typeof CreateTokenRequestSchema>;
|
|
728
|
+
declare const CreateTokenResponseSchema: z.ZodObject<{
|
|
729
|
+
tokenId: z.ZodString;
|
|
730
|
+
transactionId: z.ZodString;
|
|
731
|
+
chain: z.ZodEnum<[
|
|
732
|
+
"hedera",
|
|
733
|
+
"xrpl",
|
|
734
|
+
"polkadot",
|
|
735
|
+
"solana",
|
|
736
|
+
"stellar",
|
|
737
|
+
"ethereum",
|
|
738
|
+
"polygon",
|
|
739
|
+
"bitcoin",
|
|
740
|
+
"cardano"
|
|
741
|
+
]>;
|
|
742
|
+
timestamp: z.ZodOptional<z.ZodDate>;
|
|
743
|
+
}, "strip", z.ZodTypeAny, {
|
|
744
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
745
|
+
tokenId: string;
|
|
746
|
+
transactionId: string;
|
|
747
|
+
timestamp?: Date | undefined;
|
|
748
|
+
}, {
|
|
749
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
750
|
+
tokenId: string;
|
|
751
|
+
transactionId: string;
|
|
752
|
+
timestamp?: Date | undefined;
|
|
753
|
+
}>;
|
|
754
|
+
export type CreateTokenResponse = z.infer<typeof CreateTokenResponseSchema>;
|
|
755
|
+
declare const MintTokenRequestSchema: z.ZodObject<{
|
|
756
|
+
chain: z.ZodEnum<[
|
|
757
|
+
"hedera",
|
|
758
|
+
"xrpl",
|
|
759
|
+
"polkadot",
|
|
760
|
+
"solana",
|
|
761
|
+
"stellar",
|
|
762
|
+
"ethereum",
|
|
763
|
+
"polygon",
|
|
764
|
+
"bitcoin",
|
|
765
|
+
"cardano"
|
|
766
|
+
]>;
|
|
767
|
+
tokenId: z.ZodString;
|
|
768
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
769
|
+
recipient: z.ZodOptional<z.ZodString>;
|
|
770
|
+
nftMetadata: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
771
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
772
|
+
payerAccountId: z.ZodOptional<z.ZodString>;
|
|
773
|
+
}, "strip", z.ZodTypeAny, {
|
|
774
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
775
|
+
tokenId: string;
|
|
776
|
+
metadata?: Record<string, any> | undefined;
|
|
777
|
+
amount?: string | undefined;
|
|
778
|
+
payerAccountId?: string | undefined;
|
|
779
|
+
recipient?: string | undefined;
|
|
780
|
+
nftMetadata?: string[] | undefined;
|
|
781
|
+
}, {
|
|
782
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
783
|
+
tokenId: string;
|
|
784
|
+
metadata?: Record<string, any> | undefined;
|
|
785
|
+
amount?: string | undefined;
|
|
786
|
+
payerAccountId?: string | undefined;
|
|
787
|
+
recipient?: string | undefined;
|
|
788
|
+
nftMetadata?: string[] | undefined;
|
|
789
|
+
}>;
|
|
790
|
+
export type MintTokenRequest = z.infer<typeof MintTokenRequestSchema>;
|
|
791
|
+
declare const BurnTokenRequestSchema: z.ZodObject<{
|
|
792
|
+
chain: z.ZodEnum<[
|
|
793
|
+
"hedera",
|
|
794
|
+
"xrpl",
|
|
795
|
+
"polkadot",
|
|
796
|
+
"solana",
|
|
797
|
+
"stellar",
|
|
798
|
+
"ethereum",
|
|
799
|
+
"polygon",
|
|
800
|
+
"bitcoin",
|
|
801
|
+
"cardano"
|
|
802
|
+
]>;
|
|
803
|
+
tokenId: z.ZodString;
|
|
804
|
+
amount: z.ZodString;
|
|
805
|
+
payerAccountId: z.ZodOptional<z.ZodString>;
|
|
806
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
807
|
+
}, "strip", z.ZodTypeAny, {
|
|
808
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
809
|
+
tokenId: string;
|
|
810
|
+
amount: string;
|
|
811
|
+
metadata?: Record<string, any> | undefined;
|
|
812
|
+
payerAccountId?: string | undefined;
|
|
813
|
+
}, {
|
|
814
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
815
|
+
tokenId: string;
|
|
816
|
+
amount: string;
|
|
817
|
+
metadata?: Record<string, any> | undefined;
|
|
818
|
+
payerAccountId?: string | undefined;
|
|
819
|
+
}>;
|
|
820
|
+
export type BurnTokenRequest = z.infer<typeof BurnTokenRequestSchema>;
|
|
821
|
+
declare const TokenActionRequestSchema: z.ZodObject<{
|
|
822
|
+
chain: z.ZodEnum<[
|
|
823
|
+
"hedera",
|
|
824
|
+
"xrpl",
|
|
825
|
+
"polkadot",
|
|
826
|
+
"solana",
|
|
827
|
+
"stellar",
|
|
828
|
+
"ethereum",
|
|
829
|
+
"polygon",
|
|
830
|
+
"bitcoin",
|
|
831
|
+
"cardano"
|
|
832
|
+
]>;
|
|
833
|
+
tokenId: z.ZodString;
|
|
834
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
835
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
836
|
+
payerAccountId: z.ZodOptional<z.ZodString>;
|
|
837
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
838
|
+
}, "strip", z.ZodTypeAny, {
|
|
839
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
840
|
+
tokenId: string;
|
|
841
|
+
accountId?: string | undefined;
|
|
842
|
+
metadata?: Record<string, any> | undefined;
|
|
843
|
+
amount?: string | undefined;
|
|
844
|
+
payerAccountId?: string | undefined;
|
|
845
|
+
}, {
|
|
846
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
847
|
+
tokenId: string;
|
|
848
|
+
accountId?: string | undefined;
|
|
849
|
+
metadata?: Record<string, any> | undefined;
|
|
850
|
+
amount?: string | undefined;
|
|
851
|
+
payerAccountId?: string | undefined;
|
|
852
|
+
}>;
|
|
853
|
+
export type TokenActionRequest = z.infer<typeof TokenActionRequestSchema>;
|
|
854
|
+
declare const ActionResultSchema: z.ZodObject<{
|
|
855
|
+
success: z.ZodBoolean;
|
|
856
|
+
transactionId: z.ZodString;
|
|
857
|
+
chain: z.ZodEnum<[
|
|
858
|
+
"hedera",
|
|
859
|
+
"xrpl",
|
|
860
|
+
"polkadot",
|
|
861
|
+
"solana",
|
|
862
|
+
"stellar",
|
|
863
|
+
"ethereum",
|
|
864
|
+
"polygon",
|
|
865
|
+
"bitcoin",
|
|
866
|
+
"cardano"
|
|
867
|
+
]>;
|
|
868
|
+
chainOperation: z.ZodString;
|
|
869
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
870
|
+
timestamp: z.ZodOptional<z.ZodDate>;
|
|
871
|
+
}, "strip", z.ZodTypeAny, {
|
|
872
|
+
success: boolean;
|
|
873
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
874
|
+
transactionId: string;
|
|
875
|
+
chainOperation: string;
|
|
876
|
+
timestamp?: Date | undefined;
|
|
877
|
+
notes?: string[] | undefined;
|
|
878
|
+
}, {
|
|
879
|
+
success: boolean;
|
|
880
|
+
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
881
|
+
transactionId: string;
|
|
882
|
+
chainOperation: string;
|
|
883
|
+
timestamp?: Date | undefined;
|
|
884
|
+
notes?: string[] | undefined;
|
|
885
|
+
}>;
|
|
886
|
+
export type ActionResult = z.infer<typeof ActionResultSchema>;
|
|
887
|
+
export interface ValidatorNetworkEndpoints {
|
|
888
|
+
apiEndpoint: string;
|
|
889
|
+
natsEndpoint?: string;
|
|
890
|
+
publicIp?: string;
|
|
891
|
+
natsPort?: number;
|
|
892
|
+
}
|
|
893
|
+
export interface ValidatorMetadata {
|
|
894
|
+
description?: string;
|
|
895
|
+
version?: string;
|
|
896
|
+
tags?: string[];
|
|
897
|
+
author?: string;
|
|
898
|
+
}
|
|
899
|
+
export interface ValidatorInfo {
|
|
900
|
+
validatorTimestamp: string;
|
|
901
|
+
nodeId: string;
|
|
902
|
+
type: "consensus" | "tokens" | "accounts" | "network";
|
|
903
|
+
networkEndpoints?: ValidatorNetworkEndpoints;
|
|
904
|
+
publicKey?: string;
|
|
905
|
+
membershipNftSerial?: number;
|
|
906
|
+
capabilities?: string[];
|
|
907
|
+
metadata: ValidatorMetadata;
|
|
908
|
+
registeredAt: string;
|
|
909
|
+
messageType?: "validator.join" | "validator.leave" | "validator.update";
|
|
910
|
+
}
|
|
911
|
+
export interface ValidatorDiscoveryConfig {
|
|
912
|
+
network: "mainnet" | "testnet" | "previewnet";
|
|
913
|
+
registryTopicId: string;
|
|
914
|
+
cacheTtlMs?: number;
|
|
915
|
+
mirrorNodeUrl?: string;
|
|
916
|
+
allowInsecure?: boolean;
|
|
917
|
+
}
|
|
918
|
+
export declare class ValidatorDiscoveryClient {
|
|
919
|
+
private readonly mirrorNode;
|
|
920
|
+
private readonly registryTopicId;
|
|
921
|
+
private readonly cacheTtlMs;
|
|
922
|
+
private cache;
|
|
923
|
+
constructor(config: ValidatorDiscoveryConfig);
|
|
924
|
+
getValidators(forceRefresh?: boolean): Promise<ValidatorInfo[]>;
|
|
925
|
+
getValidatorsWithEndpoints(forceRefresh?: boolean): Promise<ValidatorInfo[]>;
|
|
926
|
+
getRandomValidator(forceRefresh?: boolean): Promise<ValidatorInfo | null>;
|
|
927
|
+
getRandomValidatorUrl(forceRefresh?: boolean): Promise<string | null>;
|
|
928
|
+
getValidatorByNodeId(nodeId: string, forceRefresh?: boolean): Promise<ValidatorInfo | null>;
|
|
929
|
+
getValidatorsByCapability(capability: string, forceRefresh?: boolean): Promise<ValidatorInfo[]>;
|
|
930
|
+
clearCache(): void;
|
|
931
|
+
private isCacheValid;
|
|
932
|
+
}
|
|
933
|
+
export interface MirrorNodeConfig {
|
|
934
|
+
baseUrl: string;
|
|
935
|
+
timeout?: number;
|
|
936
|
+
allowInsecure?: boolean;
|
|
937
|
+
}
|
|
938
|
+
export interface TopicMessage {
|
|
939
|
+
consensus_timestamp: string;
|
|
940
|
+
message: string;
|
|
941
|
+
payer_account_id: string;
|
|
942
|
+
running_hash: string;
|
|
943
|
+
running_hash_version: number;
|
|
944
|
+
sequence_number: number;
|
|
945
|
+
topic_id: string;
|
|
946
|
+
}
|
|
947
|
+
export interface TopicMessagesResponse {
|
|
948
|
+
messages: TopicMessage[];
|
|
949
|
+
links: {
|
|
950
|
+
next?: string;
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
export declare const MIRROR_NODE_URLS: Record<string, string>;
|
|
954
|
+
export declare class MirrorNodeClient {
|
|
955
|
+
private readonly baseUrl;
|
|
956
|
+
private readonly timeout;
|
|
957
|
+
private readonly allowInsecure;
|
|
958
|
+
constructor(config: MirrorNodeConfig);
|
|
959
|
+
static forNetwork(network: "mainnet" | "testnet" | "previewnet"): MirrorNodeClient;
|
|
960
|
+
getTopicMessages(topicId: string, options?: {
|
|
961
|
+
limit?: number;
|
|
962
|
+
order?: "asc" | "desc";
|
|
963
|
+
timestampStart?: string;
|
|
964
|
+
timestampEnd?: string;
|
|
965
|
+
sequenceNumberStart?: number;
|
|
966
|
+
}): Promise<TopicMessage[]>;
|
|
967
|
+
getAllTopicMessages(topicId: string, maxMessages?: number): Promise<TopicMessage[]>;
|
|
968
|
+
static decodeMessage(base64Message: string): string;
|
|
969
|
+
}
|
|
970
|
+
export declare class MirrorNodeError extends Error {
|
|
971
|
+
statusCode: number;
|
|
972
|
+
constructor(message: string, statusCode: number);
|
|
973
|
+
}
|
|
974
|
+
export type AuthChain = "hedera" | "xrpl" | "polkadot" | "stellar" | "solana";
|
|
975
|
+
export interface SecurityConfig {
|
|
976
|
+
allowInsecure?: boolean;
|
|
977
|
+
}
|
|
978
|
+
export interface ChallengeResponse {
|
|
979
|
+
success: boolean;
|
|
980
|
+
challenge: string;
|
|
981
|
+
message: string;
|
|
982
|
+
expiresIn: string;
|
|
983
|
+
}
|
|
984
|
+
export interface AuthenticateRequest {
|
|
985
|
+
chain: AuthChain;
|
|
986
|
+
address: string;
|
|
987
|
+
publicKey: string;
|
|
988
|
+
signature: string;
|
|
989
|
+
challenge: string;
|
|
990
|
+
metadata?: {
|
|
991
|
+
nodeId?: string;
|
|
992
|
+
endpoint?: string;
|
|
993
|
+
capabilities?: string[];
|
|
994
|
+
appId?: string;
|
|
995
|
+
appName?: string;
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
export interface AuthenticateResponse {
|
|
999
|
+
token: string;
|
|
1000
|
+
sessionId: string;
|
|
1001
|
+
validatorId: string;
|
|
1002
|
+
expiresAt: string;
|
|
1003
|
+
message: string;
|
|
1004
|
+
}
|
|
1005
|
+
export interface SessionInfo {
|
|
1006
|
+
sessionId: string;
|
|
1007
|
+
validatorId: string;
|
|
1008
|
+
address: string;
|
|
1009
|
+
chain: AuthChain;
|
|
1010
|
+
createdAt: string;
|
|
1011
|
+
expiresAt: string;
|
|
1012
|
+
isValid: boolean;
|
|
1013
|
+
}
|
|
1014
|
+
export interface ValidatorAuthConfig {
|
|
1015
|
+
timeout?: number;
|
|
1016
|
+
security?: SecurityConfig;
|
|
1017
|
+
}
|
|
1018
|
+
export declare class ValidatorAuthClient {
|
|
1019
|
+
private readonly timeout;
|
|
1020
|
+
private readonly allowInsecure;
|
|
1021
|
+
constructor(config?: ValidatorAuthConfig);
|
|
1022
|
+
requestChallenge(validatorUrl: string, chain: AuthChain, address: string): Promise<ChallengeResponse>;
|
|
1023
|
+
authenticate(validatorUrl: string, request: AuthenticateRequest): Promise<AuthenticateResponse>;
|
|
1024
|
+
getSession(validatorUrl: string, token: string): Promise<SessionInfo>;
|
|
1025
|
+
signChallengeHedera(challenge: string, privateKey: any): string;
|
|
1026
|
+
signChallengeXRPL(challenge: string, wallet: any): string;
|
|
1027
|
+
authenticateWithSigner(validatorUrl: string, chain: AuthChain, address: string, publicKey: string, signFn: (challenge: string) => string | Promise<string>, metadata?: AuthenticateRequest["metadata"]): Promise<AuthenticateResponse>;
|
|
1028
|
+
}
|
|
1029
|
+
export declare class ValidatorAuthError extends Error {
|
|
1030
|
+
statusCode: number;
|
|
1031
|
+
details?: any | undefined;
|
|
1032
|
+
constructor(message: string, statusCode: number, details?: any | undefined);
|
|
1033
|
+
}
|
|
1034
|
+
interface RetryConfig$1 {
|
|
1035
|
+
maxRetries: number;
|
|
1036
|
+
initialDelayMs: number;
|
|
1037
|
+
maxDelayMs: number;
|
|
1038
|
+
backoffMultiplier: number;
|
|
1039
|
+
jitterFactor?: number;
|
|
1040
|
+
}
|
|
1041
|
+
export declare const DEFAULT_RETRY_CONFIG: RetryConfig$1;
|
|
1042
|
+
export interface ResilientHttpConfig {
|
|
1043
|
+
timeoutMs?: number;
|
|
1044
|
+
retry?: Partial<RetryConfig$1>;
|
|
1045
|
+
circuitBreaker?: Partial<CircuitBreakerConfig> | false;
|
|
1046
|
+
onRetry?: (attempt: number, delay: number, status?: number) => void;
|
|
1047
|
+
onCircuitBreakerStateChange?: (state: "closed" | "open" | "half_open") => void;
|
|
1048
|
+
}
|
|
1049
|
+
export declare function resilientFetch(url: string, init?: RequestInit, config?: ResilientHttpConfig): Promise<Response>;
|
|
1050
|
+
export declare function createResilientFetchWithBreaker(config?: ResilientHttpConfig): {
|
|
1051
|
+
fetch: (url: string, init?: RequestInit) => Promise<Response>;
|
|
1052
|
+
getCircuitBreakerSnapshot: () => CircuitBreakerSnapshot | null;
|
|
1053
|
+
};
|
|
1054
|
+
export type HttpClient = {
|
|
1055
|
+
post<T = any>(path: string, body: unknown): Promise<T>;
|
|
1056
|
+
get<T = any>(path: string): Promise<T>;
|
|
1057
|
+
put<T = any>(path: string, body: unknown): Promise<T>;
|
|
1058
|
+
delete<T = any>(path: string): Promise<T>;
|
|
1059
|
+
upload<T = any>(path: string, file: Blob | Buffer, filename: string, metadata?: Record<string, string>): Promise<T>;
|
|
1060
|
+
};
|
|
1061
|
+
export type HttpClientConfig = {
|
|
1062
|
+
baseUrl: string;
|
|
1063
|
+
authToken?: string;
|
|
1064
|
+
apiKey?: string;
|
|
1065
|
+
timeout?: number;
|
|
1066
|
+
};
|
|
1067
|
+
export declare class SdkHttpError extends Error {
|
|
1068
|
+
readonly statusCode: number;
|
|
1069
|
+
readonly details?: any | undefined;
|
|
1070
|
+
constructor(message: string, statusCode: number, details?: any | undefined);
|
|
1071
|
+
}
|
|
1072
|
+
export declare function createHttpClient(config: HttpClientConfig): HttpClient;
|
|
1073
|
+
export declare function encodePathParam(param: string): string;
|
|
1074
|
+
export type SubscriptionTierName = "free_testnet" | "starter" | "professional" | "enterprise";
|
|
1075
|
+
export type SubscriptionStatus = "pending_deposit" | "deposit_confirmed" | "active" | "expired" | "cancelled";
|
|
1076
|
+
export type DepositWalletStatus = "pending" | "locked" | "expired" | "slashed" | "released";
|
|
1077
|
+
export type SubscriptionTierInfo = {
|
|
1078
|
+
name: SubscriptionTierName;
|
|
1079
|
+
displayName: string;
|
|
1080
|
+
description: string;
|
|
1081
|
+
priceUsd: number;
|
|
1082
|
+
depositAmount: string;
|
|
1083
|
+
apiCallsPerDay: number;
|
|
1084
|
+
supportedNetworks: ("hedera" | "xrpl")[];
|
|
1085
|
+
features: string[];
|
|
1086
|
+
};
|
|
1087
|
+
export type SubscriptionRequest = {
|
|
1088
|
+
appId: string;
|
|
1089
|
+
appName: string;
|
|
1090
|
+
developerAccountId: string;
|
|
1091
|
+
chain: "hedera" | "xrpl";
|
|
1092
|
+
selectedTier: SubscriptionTierName;
|
|
1093
|
+
selectedNetworks: ("hedera" | "xrpl")[];
|
|
1094
|
+
logoUrl?: string;
|
|
1095
|
+
appDescription?: string;
|
|
1096
|
+
metadata?: Record<string, unknown>;
|
|
1097
|
+
};
|
|
1098
|
+
export type SubscriptionResponse = {
|
|
1099
|
+
success: boolean;
|
|
1100
|
+
subscriptionId?: string;
|
|
1101
|
+
status?: SubscriptionStatus;
|
|
1102
|
+
depositInstructions?: {
|
|
1103
|
+
walletAddress: string;
|
|
1104
|
+
tokenId: string;
|
|
1105
|
+
amount: string;
|
|
1106
|
+
chain: string;
|
|
1107
|
+
};
|
|
1108
|
+
message: string;
|
|
1109
|
+
};
|
|
1110
|
+
export type SubscriptionStatusResponse = {
|
|
1111
|
+
appId: string;
|
|
1112
|
+
hasSubscription: boolean;
|
|
1113
|
+
subscriptionId?: string;
|
|
1114
|
+
appName?: string;
|
|
1115
|
+
status: SubscriptionStatus | "not_found";
|
|
1116
|
+
depositWallet?: {
|
|
1117
|
+
walletAddress: string;
|
|
1118
|
+
chain: string;
|
|
1119
|
+
depositAmount: string;
|
|
1120
|
+
actualDepositAmount?: string;
|
|
1121
|
+
status: DepositWalletStatus;
|
|
1122
|
+
lockedUntil?: string;
|
|
1123
|
+
};
|
|
1124
|
+
subscriptionNftSerial?: number;
|
|
1125
|
+
expiresAt?: string;
|
|
1126
|
+
remainingBalance?: string;
|
|
1127
|
+
createdAt?: string;
|
|
1128
|
+
tier?: SubscriptionTierName;
|
|
1129
|
+
selectedNetworks?: string[];
|
|
1130
|
+
apiCallsToday?: number;
|
|
1131
|
+
apiCallsLimit?: number;
|
|
1132
|
+
};
|
|
1133
|
+
export type MintNftResponse = {
|
|
1134
|
+
success: boolean;
|
|
1135
|
+
subscriptionId?: string;
|
|
1136
|
+
appId?: string;
|
|
1137
|
+
expiresAt?: string;
|
|
1138
|
+
message: string;
|
|
1139
|
+
};
|
|
1140
|
+
export type SubscriptionRenewalRequest = {
|
|
1141
|
+
appId: string;
|
|
1142
|
+
additionalDays?: number;
|
|
1143
|
+
};
|
|
1144
|
+
export type SubscriptionRenewalResponse = {
|
|
1145
|
+
success: boolean;
|
|
1146
|
+
appId: string;
|
|
1147
|
+
status?: string;
|
|
1148
|
+
newExpiresAt?: string;
|
|
1149
|
+
message: string;
|
|
1150
|
+
};
|
|
1151
|
+
export type SubscriptionConfig = {
|
|
1152
|
+
subscriptionDepositAmount: string;
|
|
1153
|
+
lockDurationDays: number;
|
|
1154
|
+
renewalWindowDays: number;
|
|
1155
|
+
hsuiteTokenIds: Record<string, string>;
|
|
1156
|
+
availableTiers: SubscriptionTierInfo[];
|
|
1157
|
+
};
|
|
1158
|
+
export type SubscriptionListResponse = {
|
|
1159
|
+
count: number;
|
|
1160
|
+
subscriptions: Array<{
|
|
1161
|
+
subscriptionId: string;
|
|
1162
|
+
appId: string;
|
|
1163
|
+
appName: string;
|
|
1164
|
+
status: SubscriptionStatus;
|
|
1165
|
+
expiresAt?: string;
|
|
1166
|
+
createdAt: string;
|
|
1167
|
+
}>;
|
|
1168
|
+
};
|
|
1169
|
+
export type BalanceResponse = {
|
|
1170
|
+
appId: string;
|
|
1171
|
+
subscriptionId: string;
|
|
1172
|
+
status: SubscriptionStatus;
|
|
1173
|
+
remainingBalance: string;
|
|
1174
|
+
expiresAt?: string;
|
|
1175
|
+
};
|
|
1176
|
+
export declare class SubscriptionClient {
|
|
1177
|
+
private readonly http;
|
|
1178
|
+
constructor(http: HttpClient);
|
|
1179
|
+
request(request: SubscriptionRequest): Promise<SubscriptionResponse>;
|
|
1180
|
+
getStatus(appId: string): Promise<SubscriptionStatusResponse>;
|
|
1181
|
+
mintNft(appId: string): Promise<MintNftResponse>;
|
|
1182
|
+
renew(request: SubscriptionRenewalRequest): Promise<SubscriptionRenewalResponse>;
|
|
1183
|
+
getTiers(): Promise<SubscriptionTierInfo[]>;
|
|
1184
|
+
getConfig(): Promise<SubscriptionConfig>;
|
|
1185
|
+
list(): Promise<SubscriptionListResponse>;
|
|
1186
|
+
listByStatus(status: SubscriptionStatus): Promise<SubscriptionListResponse>;
|
|
1187
|
+
getBalance(appId: string): Promise<BalanceResponse>;
|
|
1188
|
+
}
|
|
1189
|
+
export type EntityType = "account" | "token" | "topic";
|
|
1190
|
+
export type EntityCreationOptions = {
|
|
1191
|
+
entityType: EntityType;
|
|
1192
|
+
chain?: ChainType;
|
|
1193
|
+
activeNodes: string[];
|
|
1194
|
+
threshold?: number;
|
|
1195
|
+
metadata?: Record<string, unknown>;
|
|
1196
|
+
};
|
|
1197
|
+
export type EntityCreationResponse = {
|
|
1198
|
+
success: boolean;
|
|
1199
|
+
entityId: string;
|
|
1200
|
+
publicKeys: string[];
|
|
1201
|
+
signerIndices: number[];
|
|
1202
|
+
threshold: number;
|
|
1203
|
+
ceremonyIds: string[];
|
|
1204
|
+
};
|
|
1205
|
+
export type ReshareRequest = {
|
|
1206
|
+
entityId?: string;
|
|
1207
|
+
entityIds?: string[];
|
|
1208
|
+
oldParticipants: string[];
|
|
1209
|
+
newParticipants: string[];
|
|
1210
|
+
};
|
|
1211
|
+
export type ReshareResponse = {
|
|
1212
|
+
success: boolean;
|
|
1213
|
+
message: string;
|
|
1214
|
+
oldParticipants: string[];
|
|
1215
|
+
newParticipants: string[];
|
|
1216
|
+
note: string;
|
|
1217
|
+
};
|
|
1218
|
+
export type EntityDetails = {
|
|
1219
|
+
success: boolean;
|
|
1220
|
+
payload?: unknown;
|
|
1221
|
+
signerIndices?: number[];
|
|
1222
|
+
validators?: string[];
|
|
1223
|
+
publicKeys?: string[];
|
|
1224
|
+
error?: string;
|
|
1225
|
+
};
|
|
1226
|
+
export type MPCSigningRequest = {
|
|
1227
|
+
chain?: ChainType;
|
|
1228
|
+
entityId: string;
|
|
1229
|
+
transactionBytes: string;
|
|
1230
|
+
requiredSigners?: number;
|
|
1231
|
+
};
|
|
1232
|
+
export type MPCSigningResponse = {
|
|
1233
|
+
success: boolean;
|
|
1234
|
+
signedTransactionBytes: string;
|
|
1235
|
+
};
|
|
1236
|
+
export type ValidatorListResponse = {
|
|
1237
|
+
success: boolean;
|
|
1238
|
+
count: number;
|
|
1239
|
+
validators: Record<string, string>;
|
|
1240
|
+
};
|
|
1241
|
+
export type TSSStats = {
|
|
1242
|
+
success: boolean;
|
|
1243
|
+
totalClusters: number;
|
|
1244
|
+
clustersWithShares: number;
|
|
1245
|
+
averageThreshold: number;
|
|
1246
|
+
averageParticipants: number;
|
|
1247
|
+
activeSigningSessions: number;
|
|
1248
|
+
activeRecoveries: number;
|
|
1249
|
+
natsConnected: boolean;
|
|
1250
|
+
};
|
|
1251
|
+
export type EntityListResponse = {
|
|
1252
|
+
success: boolean;
|
|
1253
|
+
entities: string[];
|
|
1254
|
+
count: number;
|
|
1255
|
+
};
|
|
1256
|
+
export type TSSHealthResponse = {
|
|
1257
|
+
status: "healthy" | "unhealthy";
|
|
1258
|
+
tss?: string;
|
|
1259
|
+
clusters?: number;
|
|
1260
|
+
activeSessions?: number;
|
|
1261
|
+
error?: string;
|
|
1262
|
+
};
|
|
1263
|
+
export type CeremonyListResponse = {
|
|
1264
|
+
enabled: boolean;
|
|
1265
|
+
message?: string;
|
|
1266
|
+
activeTransactions?: number;
|
|
1267
|
+
collecting?: number;
|
|
1268
|
+
ready?: number;
|
|
1269
|
+
expired?: number;
|
|
1270
|
+
failed?: number;
|
|
1271
|
+
};
|
|
1272
|
+
export type MultiSigStatusResponse = {
|
|
1273
|
+
enabled: boolean;
|
|
1274
|
+
message?: string;
|
|
1275
|
+
status?: string;
|
|
1276
|
+
approvals?: number;
|
|
1277
|
+
threshold?: number;
|
|
1278
|
+
participants?: string[];
|
|
1279
|
+
};
|
|
1280
|
+
export declare class TSSClient {
|
|
1281
|
+
private readonly http;
|
|
1282
|
+
constructor(http: HttpClient);
|
|
1283
|
+
createEntity(options: EntityCreationOptions): Promise<EntityCreationResponse>;
|
|
1284
|
+
reshareCluster(request: ReshareRequest): Promise<ReshareResponse>;
|
|
1285
|
+
getEntity(entityId: string): Promise<EntityDetails>;
|
|
1286
|
+
signMPC(request: MPCSigningRequest): Promise<MPCSigningResponse>;
|
|
1287
|
+
getValidators(): Promise<ValidatorListResponse>;
|
|
1288
|
+
announceKey(): Promise<{
|
|
1289
|
+
success: boolean;
|
|
1290
|
+
message: string;
|
|
1291
|
+
}>;
|
|
1292
|
+
getStats(): Promise<TSSStats>;
|
|
1293
|
+
listEntities(): Promise<EntityListResponse>;
|
|
1294
|
+
getHealth(): Promise<TSSHealthResponse>;
|
|
1295
|
+
listCeremonies(): Promise<CeremonyListResponse>;
|
|
1296
|
+
getMultiSigStatus(txId: string): Promise<MultiSigStatusResponse>;
|
|
1297
|
+
}
|
|
1298
|
+
export type PinStatus = "pinned" | "unpinned" | "pinning" | "failed";
|
|
1299
|
+
export type IpfsFileMetadata = {
|
|
1300
|
+
cid: string;
|
|
1301
|
+
owner?: string;
|
|
1302
|
+
appId?: string;
|
|
1303
|
+
size: number;
|
|
1304
|
+
filename?: string;
|
|
1305
|
+
mimeType?: string;
|
|
1306
|
+
metadata?: Record<string, unknown>;
|
|
1307
|
+
createdAt: string;
|
|
1308
|
+
lastAccessedAt?: string;
|
|
1309
|
+
url?: string;
|
|
1310
|
+
gateway?: string;
|
|
1311
|
+
};
|
|
1312
|
+
export type IpfsUploadResult = {
|
|
1313
|
+
cid: string;
|
|
1314
|
+
size: number;
|
|
1315
|
+
cost: string | number;
|
|
1316
|
+
remainingBalance: string;
|
|
1317
|
+
filename: string;
|
|
1318
|
+
mimeType: string;
|
|
1319
|
+
gateway: string;
|
|
1320
|
+
url: string;
|
|
1321
|
+
};
|
|
1322
|
+
export type IpfsPinResult = {
|
|
1323
|
+
success: boolean;
|
|
1324
|
+
cid: string;
|
|
1325
|
+
size?: number;
|
|
1326
|
+
cost?: string | number;
|
|
1327
|
+
remainingBalance?: string;
|
|
1328
|
+
alreadyPinned?: boolean;
|
|
1329
|
+
gateway?: string;
|
|
1330
|
+
url?: string;
|
|
1331
|
+
};
|
|
1332
|
+
export type IpfsPinListResponse = {
|
|
1333
|
+
pins: IpfsFileMetadata[];
|
|
1334
|
+
total: number;
|
|
1335
|
+
page: number;
|
|
1336
|
+
limit: number;
|
|
1337
|
+
totalPages: number;
|
|
1338
|
+
};
|
|
1339
|
+
export type IpfsStatusResponse = {
|
|
1340
|
+
healthy: boolean;
|
|
1341
|
+
nodeConnected: boolean;
|
|
1342
|
+
gatewayReachable: boolean;
|
|
1343
|
+
peerId?: string;
|
|
1344
|
+
connectedPeers?: number;
|
|
1345
|
+
repoSize?: number;
|
|
1346
|
+
pinnedCount?: number;
|
|
1347
|
+
error?: string;
|
|
1348
|
+
};
|
|
1349
|
+
export type IpfsStorageUsageResponse = {
|
|
1350
|
+
totalSize: number;
|
|
1351
|
+
totalSizeFormatted: string;
|
|
1352
|
+
pinCount: number;
|
|
1353
|
+
};
|
|
1354
|
+
export declare class IPFSClient {
|
|
1355
|
+
private readonly http;
|
|
1356
|
+
constructor(http: HttpClient);
|
|
1357
|
+
upload(file: Blob | Buffer, filename: string, metadata?: Record<string, string>): Promise<IpfsUploadResult>;
|
|
1358
|
+
pin(cid: string): Promise<IpfsPinResult>;
|
|
1359
|
+
unpin(cid: string): Promise<IpfsPinResult>;
|
|
1360
|
+
getFile(cid: string): Promise<any>;
|
|
1361
|
+
getContent(cid: string): Promise<any>;
|
|
1362
|
+
getMetadata(cid: string): Promise<IpfsFileMetadata>;
|
|
1363
|
+
listPins(): Promise<IpfsPinListResponse>;
|
|
1364
|
+
getStatus(): Promise<IpfsStatusResponse>;
|
|
1365
|
+
getStorageUsage(): Promise<IpfsStorageUsageResponse>;
|
|
1366
|
+
}
|
|
1367
|
+
export type PreparedTransaction = {
|
|
1368
|
+
success?: boolean;
|
|
1369
|
+
transactionBytes: string;
|
|
1370
|
+
transactionId: string;
|
|
1371
|
+
chain: ChainType;
|
|
1372
|
+
expiresAt?: string | Date;
|
|
1373
|
+
metadata?: Record<string, unknown>;
|
|
1374
|
+
validatorSignatures?: unknown[];
|
|
1375
|
+
payerAccountId?: string;
|
|
1376
|
+
estimatedFee?: string;
|
|
1377
|
+
requiredSignatures?: number;
|
|
1378
|
+
readyToSubmit?: boolean;
|
|
1379
|
+
};
|
|
1380
|
+
export type PrepareTransferRequest = {
|
|
1381
|
+
chain: ChainType;
|
|
1382
|
+
payerAccountId: string;
|
|
1383
|
+
from: string;
|
|
1384
|
+
to: string;
|
|
1385
|
+
amount: string;
|
|
1386
|
+
tokenId?: string;
|
|
1387
|
+
entityId?: string;
|
|
1388
|
+
memo?: string;
|
|
1389
|
+
};
|
|
1390
|
+
export type PrepareNftMintRequest = {
|
|
1391
|
+
chain: ChainType;
|
|
1392
|
+
payerAccountId: string;
|
|
1393
|
+
tokenId: string;
|
|
1394
|
+
metadata: string | string[];
|
|
1395
|
+
entityId?: string;
|
|
1396
|
+
};
|
|
1397
|
+
export type PrepareNftBurnRequest = {
|
|
1398
|
+
chain: ChainType;
|
|
1399
|
+
payerAccountId: string;
|
|
1400
|
+
tokenId: string;
|
|
1401
|
+
serialNumber: number;
|
|
1402
|
+
entityId?: string;
|
|
1403
|
+
};
|
|
1404
|
+
export type PrepareNftTransferRequest = {
|
|
1405
|
+
chain: ChainType;
|
|
1406
|
+
payerAccountId: string;
|
|
1407
|
+
tokenId: string;
|
|
1408
|
+
serialNumber: number;
|
|
1409
|
+
fromAccountId: string;
|
|
1410
|
+
toAccountId: string;
|
|
1411
|
+
entityId?: string;
|
|
1412
|
+
};
|
|
1413
|
+
export type PrepareTokenCreateRequest = {
|
|
1414
|
+
chain: "hedera";
|
|
1415
|
+
payerAccountId: string;
|
|
1416
|
+
name: string;
|
|
1417
|
+
symbol: string;
|
|
1418
|
+
decimals: number;
|
|
1419
|
+
initialSupply: string;
|
|
1420
|
+
treasuryAccountId: string;
|
|
1421
|
+
entityId: string;
|
|
1422
|
+
memo?: string;
|
|
1423
|
+
tokenType?: "FUNGIBLE_COMMON" | "NON_FUNGIBLE_UNIQUE";
|
|
1424
|
+
supplyKey?: string;
|
|
1425
|
+
adminKey?: string;
|
|
1426
|
+
pauseKey?: string;
|
|
1427
|
+
freezeKey?: string;
|
|
1428
|
+
kycKey?: string;
|
|
1429
|
+
wipeKey?: string;
|
|
1430
|
+
};
|
|
1431
|
+
export type PrepareTokenMintRequest = {
|
|
1432
|
+
chain: ChainType;
|
|
1433
|
+
payerAccountId: string;
|
|
1434
|
+
tokenId: string;
|
|
1435
|
+
amount: string;
|
|
1436
|
+
recipientAccountId?: string;
|
|
1437
|
+
entityId?: string;
|
|
1438
|
+
};
|
|
1439
|
+
export type PrepareTokenBurnRequest = {
|
|
1440
|
+
chain: "hedera";
|
|
1441
|
+
payerAccountId: string;
|
|
1442
|
+
tokenId: string;
|
|
1443
|
+
amount: string;
|
|
1444
|
+
entityId: string;
|
|
1445
|
+
};
|
|
1446
|
+
export type PrepareTokenAssociationRequest = {
|
|
1447
|
+
chain: "hedera";
|
|
1448
|
+
payerAccountId: string;
|
|
1449
|
+
accountId: string;
|
|
1450
|
+
tokenIds: string[];
|
|
1451
|
+
entityId: string;
|
|
1452
|
+
};
|
|
1453
|
+
export type PrepareTopicCreateRequest = {
|
|
1454
|
+
chain: "hedera";
|
|
1455
|
+
payerAccountId: string;
|
|
1456
|
+
memo?: string;
|
|
1457
|
+
adminKeyRequired?: boolean;
|
|
1458
|
+
submitKeyRequired?: boolean;
|
|
1459
|
+
entityId: string;
|
|
1460
|
+
};
|
|
1461
|
+
export type PrepareTopicMessageRequest = {
|
|
1462
|
+
chain: "hedera";
|
|
1463
|
+
payerAccountId: string;
|
|
1464
|
+
topicId: string;
|
|
1465
|
+
message: string | Record<string, unknown>;
|
|
1466
|
+
entityId: string;
|
|
1467
|
+
};
|
|
1468
|
+
export type PrepareTokenPauseRequest = {
|
|
1469
|
+
chain: "hedera";
|
|
1470
|
+
payerAccountId: string;
|
|
1471
|
+
tokenId: string;
|
|
1472
|
+
entityId: string;
|
|
1473
|
+
memo?: string;
|
|
1474
|
+
};
|
|
1475
|
+
export type PrepareTokenUnpauseRequest = PrepareTokenPauseRequest;
|
|
1476
|
+
export type PrepareTokenRestrictRequest = {
|
|
1477
|
+
chain: "hedera";
|
|
1478
|
+
payerAccountId: string;
|
|
1479
|
+
tokenId: string;
|
|
1480
|
+
accountId: string;
|
|
1481
|
+
entityId: string;
|
|
1482
|
+
memo?: string;
|
|
1483
|
+
};
|
|
1484
|
+
export type PrepareTokenUnrestrictRequest = PrepareTokenRestrictRequest;
|
|
1485
|
+
export type PrepareTokenComplianceEnableRequest = PrepareTokenRestrictRequest;
|
|
1486
|
+
export type PrepareTokenComplianceDisableRequest = PrepareTokenRestrictRequest;
|
|
1487
|
+
export type PrepareTokenWipeRequest = {
|
|
1488
|
+
chain: "hedera";
|
|
1489
|
+
payerAccountId: string;
|
|
1490
|
+
tokenId: string;
|
|
1491
|
+
accountId: string;
|
|
1492
|
+
amount: string;
|
|
1493
|
+
entityId: string;
|
|
1494
|
+
memo?: string;
|
|
1495
|
+
};
|
|
1496
|
+
export type PrepareTrustLineRequest = {
|
|
1497
|
+
chain: "xrpl";
|
|
1498
|
+
accountAddress: string;
|
|
1499
|
+
currency: string;
|
|
1500
|
+
issuerAddress: string;
|
|
1501
|
+
limit?: string;
|
|
1502
|
+
entityId: string;
|
|
1503
|
+
};
|
|
1504
|
+
export type TransactionInfoResponse = {
|
|
1505
|
+
model?: string;
|
|
1506
|
+
description?: string;
|
|
1507
|
+
principles?: string[];
|
|
1508
|
+
supportedChains: string[];
|
|
1509
|
+
responseFormat?: Record<string, string>;
|
|
1510
|
+
};
|
|
1511
|
+
export declare class TransactionsClient {
|
|
1512
|
+
private readonly http;
|
|
1513
|
+
constructor(http: HttpClient);
|
|
1514
|
+
getInfo(): Promise<TransactionInfoResponse>;
|
|
1515
|
+
prepareTransfer(request: PrepareTransferRequest): Promise<PreparedTransaction>;
|
|
1516
|
+
prepareNftMint(request: PrepareNftMintRequest): Promise<PreparedTransaction>;
|
|
1517
|
+
prepareNftBurn(request: PrepareNftBurnRequest): Promise<PreparedTransaction>;
|
|
1518
|
+
prepareNftTransfer(request: PrepareNftTransferRequest): Promise<PreparedTransaction>;
|
|
1519
|
+
prepareTokenCreate(request: PrepareTokenCreateRequest): Promise<PreparedTransaction>;
|
|
1520
|
+
prepareTokenMint(request: PrepareTokenMintRequest): Promise<PreparedTransaction>;
|
|
1521
|
+
prepareTokenBurn(request: PrepareTokenBurnRequest): Promise<PreparedTransaction>;
|
|
1522
|
+
prepareTokenAssociation(request: PrepareTokenAssociationRequest): Promise<PreparedTransaction>;
|
|
1523
|
+
prepareTokenPause(request: PrepareTokenPauseRequest): Promise<PreparedTransaction>;
|
|
1524
|
+
prepareTokenUnpause(request: PrepareTokenUnpauseRequest): Promise<PreparedTransaction>;
|
|
1525
|
+
prepareTokenRestrict(request: PrepareTokenRestrictRequest): Promise<PreparedTransaction>;
|
|
1526
|
+
prepareTokenUnrestrict(request: PrepareTokenUnrestrictRequest): Promise<PreparedTransaction>;
|
|
1527
|
+
prepareTokenComplianceEnable(request: PrepareTokenComplianceEnableRequest): Promise<PreparedTransaction>;
|
|
1528
|
+
prepareTokenComplianceDisable(request: PrepareTokenComplianceDisableRequest): Promise<PreparedTransaction>;
|
|
1529
|
+
prepareTokenWipe(request: PrepareTokenWipeRequest): Promise<PreparedTransaction>;
|
|
1530
|
+
prepareTopicCreate(request: PrepareTopicCreateRequest): Promise<PreparedTransaction>;
|
|
1531
|
+
prepareTopicMessage(request: PrepareTopicMessageRequest): Promise<PreparedTransaction>;
|
|
1532
|
+
prepareTrustLine(request: PrepareTrustLineRequest): Promise<PreparedTransaction>;
|
|
1533
|
+
}
|
|
1534
|
+
export type SnapshotStatus = "pending" | "generating" | "completed" | "failed";
|
|
1535
|
+
export type SnapshotFormat = "json" | "csv";
|
|
1536
|
+
export type SnapshotInfo = {
|
|
1537
|
+
snapshotId: string;
|
|
1538
|
+
tokenId: string;
|
|
1539
|
+
chain: string;
|
|
1540
|
+
status: SnapshotStatus;
|
|
1541
|
+
holdersCount?: number;
|
|
1542
|
+
totalBalance?: string;
|
|
1543
|
+
createdAt: string;
|
|
1544
|
+
completedAt?: string;
|
|
1545
|
+
error?: string;
|
|
1546
|
+
};
|
|
1547
|
+
export type SnapshotGenerateOptions = {
|
|
1548
|
+
includeZeroBalance?: boolean;
|
|
1549
|
+
minBalance?: string;
|
|
1550
|
+
format?: SnapshotFormat;
|
|
1551
|
+
};
|
|
1552
|
+
export type SnapshotListResponse = {
|
|
1553
|
+
snapshots: SnapshotInfo[];
|
|
1554
|
+
total: number;
|
|
1555
|
+
page: number;
|
|
1556
|
+
limit: number;
|
|
1557
|
+
};
|
|
1558
|
+
export type SnapshotGenerateResponse = {
|
|
1559
|
+
success: boolean;
|
|
1560
|
+
snapshotId: string;
|
|
1561
|
+
status: SnapshotStatus;
|
|
1562
|
+
message: string;
|
|
1563
|
+
};
|
|
1564
|
+
export type PaginationOptions = {
|
|
1565
|
+
page?: number;
|
|
1566
|
+
limit?: number;
|
|
1567
|
+
};
|
|
1568
|
+
export declare class SnapshotsClient {
|
|
1569
|
+
private readonly http;
|
|
1570
|
+
constructor(http: HttpClient);
|
|
1571
|
+
generate(tokenId: string, options?: SnapshotGenerateOptions): Promise<SnapshotGenerateResponse>;
|
|
1572
|
+
get(snapshotId: string): Promise<SnapshotInfo>;
|
|
1573
|
+
listByToken(tokenId: string, pagination?: PaginationOptions): Promise<SnapshotListResponse>;
|
|
1574
|
+
download(snapshotId: string, format?: SnapshotFormat): Promise<any>;
|
|
1575
|
+
}
|
|
1576
|
+
export type SettlementPurpose = "subscription" | "deposit" | "fee";
|
|
1577
|
+
export type SettlementAsset = {
|
|
1578
|
+
symbol: string;
|
|
1579
|
+
tokenId: string;
|
|
1580
|
+
decimals: number;
|
|
1581
|
+
isNative: boolean;
|
|
1582
|
+
};
|
|
1583
|
+
export type SettlementInitiateRequest = {
|
|
1584
|
+
sourceChain: string;
|
|
1585
|
+
sourceAsset: SettlementAsset;
|
|
1586
|
+
sourceAmount: string;
|
|
1587
|
+
sourceTxId: string;
|
|
1588
|
+
purpose: SettlementPurpose;
|
|
1589
|
+
entityId: string;
|
|
1590
|
+
};
|
|
1591
|
+
export type SettlementStatusResponse = {
|
|
1592
|
+
settlementId: string;
|
|
1593
|
+
step: string;
|
|
1594
|
+
sourceChain: string;
|
|
1595
|
+
sourceAmount: string;
|
|
1596
|
+
purpose: SettlementPurpose;
|
|
1597
|
+
entityId: string;
|
|
1598
|
+
exchangeStatus?: string;
|
|
1599
|
+
xrpAmount?: string;
|
|
1600
|
+
hsuiteAmount?: string;
|
|
1601
|
+
};
|
|
1602
|
+
export type SettlementHistoryEntry = {
|
|
1603
|
+
settlementId: string;
|
|
1604
|
+
status: string;
|
|
1605
|
+
hsuiteAmount: string;
|
|
1606
|
+
durationMs: number;
|
|
1607
|
+
createdAt: string;
|
|
1608
|
+
};
|
|
1609
|
+
export declare class SettlementClient {
|
|
1610
|
+
private readonly http;
|
|
1611
|
+
constructor(http: HttpClient);
|
|
1612
|
+
initiate(request: SettlementInitiateRequest): Promise<SettlementStatusResponse>;
|
|
1613
|
+
getStatus(settlementId: string): Promise<SettlementStatusResponse>;
|
|
1614
|
+
confirmXrpLanded(settlementId: string): Promise<SettlementStatusResponse>;
|
|
1615
|
+
getHistory(entityId: string): Promise<SettlementHistoryEntry[]>;
|
|
1616
|
+
}
|
|
1617
|
+
export interface SmartEngineClientConfig {
|
|
1618
|
+
baseUrl: string;
|
|
1619
|
+
apiKey?: string;
|
|
1620
|
+
authToken?: string;
|
|
1621
|
+
timeout?: number;
|
|
1622
|
+
allowInsecure?: boolean;
|
|
1623
|
+
http?: ResilientHttpConfig;
|
|
1624
|
+
}
|
|
1625
|
+
export interface NetworkConnectionConfig {
|
|
1626
|
+
network: "mainnet" | "testnet" | "previewnet";
|
|
1627
|
+
registryTopicId: string;
|
|
1628
|
+
chain: AuthChain;
|
|
1629
|
+
address: string;
|
|
1630
|
+
publicKey: string;
|
|
1631
|
+
signFn: (challenge: string) => string | Promise<string>;
|
|
1632
|
+
metadata?: {
|
|
1633
|
+
appId?: string;
|
|
1634
|
+
appName?: string;
|
|
1635
|
+
};
|
|
1636
|
+
mirrorNodeUrl?: string;
|
|
1637
|
+
allowInsecure?: boolean;
|
|
1638
|
+
}
|
|
1639
|
+
export interface NetworkConnectionResult {
|
|
1640
|
+
client: SmartEngineClient;
|
|
1641
|
+
validator: ValidatorInfo;
|
|
1642
|
+
session: AuthenticateResponse;
|
|
1643
|
+
}
|
|
1644
|
+
export declare class SmartEngineClient {
|
|
1645
|
+
private baseUrl;
|
|
1646
|
+
private allowInsecure;
|
|
1647
|
+
private readonly http;
|
|
1648
|
+
private readonly txHttp;
|
|
1649
|
+
private lastHttpError?;
|
|
1650
|
+
readonly subscription: SubscriptionClient;
|
|
1651
|
+
readonly tss: TSSClient;
|
|
1652
|
+
readonly ipfs: IPFSClient;
|
|
1653
|
+
readonly transactions: TransactionsClient;
|
|
1654
|
+
readonly snapshots: SnapshotsClient;
|
|
1655
|
+
readonly settlement: SettlementClient;
|
|
1656
|
+
constructor(config: SmartEngineClientConfig);
|
|
1657
|
+
static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
|
|
1658
|
+
getBaseUrl(): string;
|
|
1659
|
+
isAuthenticated(): boolean;
|
|
1660
|
+
getHttpHealth(): {
|
|
1661
|
+
breaker: CircuitBreakerSnapshot | null;
|
|
1662
|
+
lastError?: Error;
|
|
1663
|
+
};
|
|
1664
|
+
getHealth(): Promise<{
|
|
1665
|
+
status: string;
|
|
1666
|
+
timestamp: string;
|
|
1667
|
+
chains: any[];
|
|
1668
|
+
}>;
|
|
1669
|
+
getSupportedChains(): Promise<{
|
|
1670
|
+
chains: string[];
|
|
1671
|
+
}>;
|
|
1672
|
+
createAccount(request: CreateAccountRequest): Promise<CreateAccountResponse>;
|
|
1673
|
+
getAccountInfo(chain: string, accountId: string): Promise<AccountInfo>;
|
|
1674
|
+
getBalance(chain: string, accountId: string): Promise<AccountBalance>;
|
|
1675
|
+
transfer(request: TransferRequest): Promise<TransferResponse>;
|
|
1676
|
+
getTransaction(chain: string, txId: string): Promise<Transaction>;
|
|
1677
|
+
getTransactionReceipt(chain: string, txId: string): Promise<any>;
|
|
1678
|
+
createToken(request: CreateTokenRequest): Promise<CreateTokenResponse>;
|
|
1679
|
+
mintToken(request: MintTokenRequest): Promise<any>;
|
|
1680
|
+
getTokenInfo(chain: string, tokenId: string): Promise<TokenInfo>;
|
|
1681
|
+
burnToken(request: BurnTokenRequest): Promise<ActionResult>;
|
|
1682
|
+
pauseToken(request: TokenActionRequest): Promise<ActionResult>;
|
|
1683
|
+
unpauseToken(request: TokenActionRequest): Promise<ActionResult>;
|
|
1684
|
+
restrictAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
1685
|
+
unrestrictAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
1686
|
+
enableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
1687
|
+
disableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
1688
|
+
wipeFromAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
1689
|
+
getAllCapabilities(): Promise<any>;
|
|
1690
|
+
getChainCapabilities(chain: ChainType): Promise<any>;
|
|
1691
|
+
getSystemStatus(): Promise<any>;
|
|
1692
|
+
submitMessage(chain: string, topicId: string, message: string): Promise<any>;
|
|
1693
|
+
getClusterHealth(): Promise<{
|
|
1694
|
+
status: string;
|
|
1695
|
+
nodes: number;
|
|
1696
|
+
healthy: number;
|
|
1697
|
+
unhealthy: number;
|
|
1698
|
+
}>;
|
|
1699
|
+
getClusterStatus(): Promise<{
|
|
1700
|
+
status: string;
|
|
1701
|
+
nodeId: string;
|
|
1702
|
+
nodes: Array<{
|
|
1703
|
+
nodeId: string;
|
|
1704
|
+
endpoint: string;
|
|
1705
|
+
status: string;
|
|
1706
|
+
lastSeen?: string;
|
|
1707
|
+
}>;
|
|
1708
|
+
quorum: {
|
|
1709
|
+
required: number;
|
|
1710
|
+
current: number;
|
|
1711
|
+
reached: boolean;
|
|
1712
|
+
};
|
|
1713
|
+
}>;
|
|
1714
|
+
getMetrics(): Promise<string>;
|
|
1715
|
+
getQueueStats(): Promise<{
|
|
1716
|
+
queues: Record<string, {
|
|
1717
|
+
pending: number;
|
|
1718
|
+
processing: number;
|
|
1719
|
+
completed: number;
|
|
1720
|
+
failed: number;
|
|
1721
|
+
}>;
|
|
1722
|
+
timestamp: string;
|
|
1723
|
+
}>;
|
|
1724
|
+
getCircuitBreakerStatus(): Promise<{
|
|
1725
|
+
breakers: Record<string, {
|
|
1726
|
+
state: "closed" | "open" | "half-open";
|
|
1727
|
+
failures: number;
|
|
1728
|
+
successes: number;
|
|
1729
|
+
lastFailure?: string;
|
|
1730
|
+
nextRetry?: string;
|
|
1731
|
+
}>;
|
|
1732
|
+
timestamp: string;
|
|
1733
|
+
}>;
|
|
1734
|
+
verifySignature(request: {
|
|
1735
|
+
chain: ChainType;
|
|
1736
|
+
message: string;
|
|
1737
|
+
signature: string;
|
|
1738
|
+
publicKey: string;
|
|
1739
|
+
}): Promise<{
|
|
1740
|
+
valid: boolean;
|
|
1741
|
+
chain: ChainType;
|
|
1742
|
+
}>;
|
|
1743
|
+
}
|
|
1744
|
+
export type GatewayHealthResponse = {
|
|
1745
|
+
status: "healthy" | "degraded" | "unhealthy";
|
|
1746
|
+
timestamp: string;
|
|
1747
|
+
uptime: number;
|
|
1748
|
+
version: string;
|
|
1749
|
+
};
|
|
1750
|
+
export type GatewayStatusResponse = {
|
|
1751
|
+
status: string;
|
|
1752
|
+
hosts: {
|
|
1753
|
+
total: number;
|
|
1754
|
+
verified: number;
|
|
1755
|
+
active: number;
|
|
1756
|
+
};
|
|
1757
|
+
domains: {
|
|
1758
|
+
total: number;
|
|
1759
|
+
verified: number;
|
|
1760
|
+
};
|
|
1761
|
+
uptime: number;
|
|
1762
|
+
};
|
|
1763
|
+
export type GatewayReadinessResponse = {
|
|
1764
|
+
ready: boolean;
|
|
1765
|
+
checks: Record<string, boolean>;
|
|
1766
|
+
};
|
|
1767
|
+
export type GatewayLivenessResponse = {
|
|
1768
|
+
alive: boolean;
|
|
1769
|
+
timestamp: string;
|
|
1770
|
+
};
|
|
1771
|
+
export type GatewayMetricsResponse = {
|
|
1772
|
+
requests: {
|
|
1773
|
+
total: number;
|
|
1774
|
+
successful: number;
|
|
1775
|
+
failed: number;
|
|
1776
|
+
avgLatencyMs: number;
|
|
1777
|
+
};
|
|
1778
|
+
hosts: {
|
|
1779
|
+
total: number;
|
|
1780
|
+
healthy: number;
|
|
1781
|
+
unhealthy: number;
|
|
1782
|
+
};
|
|
1783
|
+
bandwidth: {
|
|
1784
|
+
inbound: number;
|
|
1785
|
+
outbound: number;
|
|
1786
|
+
};
|
|
1787
|
+
timestamp: string;
|
|
1788
|
+
};
|
|
1789
|
+
export type GatewayMetricsSummaryResponse = {
|
|
1790
|
+
summary: Record<string, unknown>;
|
|
1791
|
+
period: string;
|
|
1792
|
+
generatedAt: string;
|
|
1793
|
+
};
|
|
1794
|
+
export type RegisterHostRequest = {
|
|
1795
|
+
name: string;
|
|
1796
|
+
endpoint: string;
|
|
1797
|
+
capabilities?: string[];
|
|
1798
|
+
metadata?: Record<string, unknown>;
|
|
1799
|
+
};
|
|
1800
|
+
export type HostInfo = {
|
|
1801
|
+
hostId: string;
|
|
1802
|
+
name: string;
|
|
1803
|
+
endpoint: string;
|
|
1804
|
+
status: "active" | "inactive" | "suspended";
|
|
1805
|
+
verified: boolean;
|
|
1806
|
+
capabilities: string[];
|
|
1807
|
+
lastSeen: string;
|
|
1808
|
+
registeredAt: string;
|
|
1809
|
+
metadata?: Record<string, unknown>;
|
|
1810
|
+
};
|
|
1811
|
+
export type HostListResponse = {
|
|
1812
|
+
hosts: HostInfo[];
|
|
1813
|
+
total: number;
|
|
1814
|
+
};
|
|
1815
|
+
export type RoutingConfig = {
|
|
1816
|
+
strategy: "round-robin" | "least-connections" | "random" | "weighted";
|
|
1817
|
+
healthCheckInterval?: number;
|
|
1818
|
+
timeout?: number;
|
|
1819
|
+
retries?: number;
|
|
1820
|
+
weights?: Record<string, number>;
|
|
1821
|
+
};
|
|
1822
|
+
export type ProxyRequest = {
|
|
1823
|
+
targetHostId?: string;
|
|
1824
|
+
method: string;
|
|
1825
|
+
path: string;
|
|
1826
|
+
headers?: Record<string, string>;
|
|
1827
|
+
body?: unknown;
|
|
1828
|
+
};
|
|
1829
|
+
export type ProxyResponse = {
|
|
1830
|
+
statusCode: number;
|
|
1831
|
+
headers: Record<string, string>;
|
|
1832
|
+
body: unknown;
|
|
1833
|
+
hostId: string;
|
|
1834
|
+
latencyMs: number;
|
|
1835
|
+
};
|
|
1836
|
+
export type RoutingStatsResponse = {
|
|
1837
|
+
totalRequests: number;
|
|
1838
|
+
successRate: number;
|
|
1839
|
+
avgLatencyMs: number;
|
|
1840
|
+
hostStats: Record<string, {
|
|
1841
|
+
requests: number;
|
|
1842
|
+
errors: number;
|
|
1843
|
+
avgLatencyMs: number;
|
|
1844
|
+
}>;
|
|
1845
|
+
};
|
|
1846
|
+
export type DomainRegistrationRequest = {
|
|
1847
|
+
domain: string;
|
|
1848
|
+
owner: string;
|
|
1849
|
+
registrar?: string;
|
|
1850
|
+
autoRenew?: boolean;
|
|
1851
|
+
};
|
|
1852
|
+
export type DomainInfo = {
|
|
1853
|
+
domain: string;
|
|
1854
|
+
owner: string;
|
|
1855
|
+
status: "active" | "pending" | "suspended" | "expired";
|
|
1856
|
+
verified: boolean;
|
|
1857
|
+
registrar?: string;
|
|
1858
|
+
expiresAt?: string;
|
|
1859
|
+
createdAt: string;
|
|
1860
|
+
dnsConfigured: boolean;
|
|
1861
|
+
dnssecEnabled: boolean;
|
|
1862
|
+
};
|
|
1863
|
+
export type DomainListResponse = {
|
|
1864
|
+
domains: DomainInfo[];
|
|
1865
|
+
total: number;
|
|
1866
|
+
};
|
|
1867
|
+
export type DomainAvailabilityResponse = {
|
|
1868
|
+
domain: string;
|
|
1869
|
+
available: boolean;
|
|
1870
|
+
premium: boolean;
|
|
1871
|
+
price?: string;
|
|
1872
|
+
suggestions?: string[];
|
|
1873
|
+
};
|
|
1874
|
+
export type VerificationTokenResponse = {
|
|
1875
|
+
token: string;
|
|
1876
|
+
method: "dns" | "http" | "email";
|
|
1877
|
+
instructions: string;
|
|
1878
|
+
expiresAt: string;
|
|
1879
|
+
};
|
|
1880
|
+
export type VerificationResult = {
|
|
1881
|
+
verified: boolean;
|
|
1882
|
+
domain: string;
|
|
1883
|
+
method: string;
|
|
1884
|
+
verifiedAt?: string;
|
|
1885
|
+
error?: string;
|
|
1886
|
+
};
|
|
1887
|
+
export type DnsRecord = {
|
|
1888
|
+
type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SRV" | "CAA";
|
|
1889
|
+
name: string;
|
|
1890
|
+
value: string;
|
|
1891
|
+
ttl?: number;
|
|
1892
|
+
priority?: number;
|
|
1893
|
+
};
|
|
1894
|
+
export type DomainTransferRequest = {
|
|
1895
|
+
authCode: string;
|
|
1896
|
+
newRegistrar?: string;
|
|
1897
|
+
};
|
|
1898
|
+
export type DnsResolveResponse = {
|
|
1899
|
+
name: string;
|
|
1900
|
+
type: string;
|
|
1901
|
+
records: Array<{
|
|
1902
|
+
value: string;
|
|
1903
|
+
ttl: number;
|
|
1904
|
+
}>;
|
|
1905
|
+
dnssec: boolean;
|
|
1906
|
+
timestamp: string;
|
|
1907
|
+
};
|
|
1908
|
+
export type DnsBatchQuery = {
|
|
1909
|
+
name: string;
|
|
1910
|
+
type?: string;
|
|
1911
|
+
};
|
|
1912
|
+
export type DnsBatchResolveResponse = {
|
|
1913
|
+
results: DnsResolveResponse[];
|
|
1914
|
+
errors: Array<{
|
|
1915
|
+
query: DnsBatchQuery;
|
|
1916
|
+
error: string;
|
|
1917
|
+
}>;
|
|
1918
|
+
};
|
|
1919
|
+
export type DnsZone = {
|
|
1920
|
+
zoneName: string;
|
|
1921
|
+
status: "active" | "pending" | "disabled";
|
|
1922
|
+
records: number;
|
|
1923
|
+
dnssecEnabled: boolean;
|
|
1924
|
+
createdAt: string;
|
|
1925
|
+
updatedAt: string;
|
|
1926
|
+
};
|
|
1927
|
+
export type DnsZoneListResponse = {
|
|
1928
|
+
zones: DnsZone[];
|
|
1929
|
+
total: number;
|
|
1930
|
+
};
|
|
1931
|
+
export type DnsRecordInfo = {
|
|
1932
|
+
recordId: string;
|
|
1933
|
+
type: string;
|
|
1934
|
+
name: string;
|
|
1935
|
+
value: string;
|
|
1936
|
+
ttl: number;
|
|
1937
|
+
priority?: number;
|
|
1938
|
+
createdAt: string;
|
|
1939
|
+
updatedAt: string;
|
|
1940
|
+
};
|
|
1941
|
+
export type DnssecKey = {
|
|
1942
|
+
keyTag: number;
|
|
1943
|
+
algorithm: string;
|
|
1944
|
+
digestType: string;
|
|
1945
|
+
digest: string;
|
|
1946
|
+
publicKey: string;
|
|
1947
|
+
flags: number;
|
|
1948
|
+
};
|
|
1949
|
+
export type DnssecDsRecord = {
|
|
1950
|
+
keyTag: number;
|
|
1951
|
+
algorithm: number;
|
|
1952
|
+
digestType: number;
|
|
1953
|
+
digest: string;
|
|
1954
|
+
};
|
|
1955
|
+
export declare class RoutingClient {
|
|
1956
|
+
private readonly http;
|
|
1957
|
+
constructor(http: HttpClient);
|
|
1958
|
+
registerHost(request: RegisterHostRequest): Promise<HostInfo>;
|
|
1959
|
+
unregisterHost(hostId: string): Promise<{
|
|
1960
|
+
success: boolean;
|
|
1961
|
+
}>;
|
|
1962
|
+
getAllHosts(): Promise<HostListResponse>;
|
|
1963
|
+
getVerifiedHosts(): Promise<HostListResponse>;
|
|
1964
|
+
getHost(hostId: string): Promise<HostInfo>;
|
|
1965
|
+
verifyHost(hostId: string): Promise<{
|
|
1966
|
+
verified: boolean;
|
|
1967
|
+
message: string;
|
|
1968
|
+
}>;
|
|
1969
|
+
setRoutingConfig(appId: string, config: RoutingConfig): Promise<RoutingConfig>;
|
|
1970
|
+
getRoutingConfig(appId: string): Promise<RoutingConfig>;
|
|
1971
|
+
proxyRequest(request: ProxyRequest): Promise<ProxyResponse>;
|
|
1972
|
+
getStats(): Promise<RoutingStatsResponse>;
|
|
1973
|
+
mapDomainToApp(domain: string, appId: string): Promise<{
|
|
1974
|
+
success: boolean;
|
|
1975
|
+
domain: string;
|
|
1976
|
+
appId: string;
|
|
1977
|
+
}>;
|
|
1978
|
+
}
|
|
1979
|
+
export declare class DomainsClient {
|
|
1980
|
+
private readonly http;
|
|
1981
|
+
constructor(http: HttpClient);
|
|
1982
|
+
register(request: DomainRegistrationRequest): Promise<DomainInfo>;
|
|
1983
|
+
checkAvailability(domain: string): Promise<DomainAvailabilityResponse>;
|
|
1984
|
+
getInfo(domain: string): Promise<DomainInfo>;
|
|
1985
|
+
list(owner?: string): Promise<DomainListResponse>;
|
|
1986
|
+
generateVerificationToken(domain: string, method: "dns" | "http" | "email"): Promise<VerificationTokenResponse>;
|
|
1987
|
+
verifyOwnership(domain: string, token: string): Promise<VerificationResult>;
|
|
1988
|
+
configureDns(domain: string, records: DnsRecord[]): Promise<{
|
|
1989
|
+
success: boolean;
|
|
1990
|
+
records: DnsRecord[];
|
|
1991
|
+
}>;
|
|
1992
|
+
enableDnssec(domain: string): Promise<{
|
|
1993
|
+
success: boolean;
|
|
1994
|
+
message: string;
|
|
1995
|
+
}>;
|
|
1996
|
+
disableDnssec(domain: string): Promise<{
|
|
1997
|
+
success: boolean;
|
|
1998
|
+
message: string;
|
|
1999
|
+
}>;
|
|
2000
|
+
renew(domain: string, years?: number): Promise<DomainInfo>;
|
|
2001
|
+
transfer(domain: string, request: DomainTransferRequest): Promise<{
|
|
2002
|
+
success: boolean;
|
|
2003
|
+
message: string;
|
|
2004
|
+
}>;
|
|
2005
|
+
approveTransfer(domain: string): Promise<{
|
|
2006
|
+
success: boolean;
|
|
2007
|
+
}>;
|
|
2008
|
+
rejectTransfer(domain: string): Promise<{
|
|
2009
|
+
success: boolean;
|
|
2010
|
+
}>;
|
|
2011
|
+
suspend(domain: string, reason: string): Promise<{
|
|
2012
|
+
success: boolean;
|
|
2013
|
+
}>;
|
|
2014
|
+
unsuspend(domain: string): Promise<{
|
|
2015
|
+
success: boolean;
|
|
2016
|
+
}>;
|
|
2017
|
+
}
|
|
2018
|
+
export declare class DnsClient {
|
|
2019
|
+
private readonly http;
|
|
2020
|
+
constructor(http: HttpClient);
|
|
2021
|
+
resolve(name: string, type?: string, dnssec?: boolean): Promise<DnsResolveResponse>;
|
|
2022
|
+
resolveBatch(queries: DnsBatchQuery[]): Promise<DnsBatchResolveResponse>;
|
|
2023
|
+
listZones(): Promise<DnsZoneListResponse>;
|
|
2024
|
+
getZone(zoneName: string): Promise<DnsZone & {
|
|
2025
|
+
records: DnsRecordInfo[];
|
|
2026
|
+
}>;
|
|
2027
|
+
createZone(request: {
|
|
2028
|
+
zoneName: string;
|
|
2029
|
+
description?: string;
|
|
2030
|
+
}): Promise<DnsZone>;
|
|
2031
|
+
deleteZone(zoneName: string): Promise<{
|
|
2032
|
+
success: boolean;
|
|
2033
|
+
}>;
|
|
2034
|
+
addRecord(zoneName: string, record: DnsRecord): Promise<DnsRecordInfo>;
|
|
2035
|
+
updateRecord(zoneName: string, recordId: string, updates: Partial<DnsRecord>): Promise<DnsRecordInfo>;
|
|
2036
|
+
deleteRecord(zoneName: string, recordId: string): Promise<{
|
|
2037
|
+
success: boolean;
|
|
2038
|
+
}>;
|
|
2039
|
+
generateDnssecKeys(zoneName: string, algorithm?: string): Promise<{
|
|
2040
|
+
keys: DnssecKey[];
|
|
2041
|
+
}>;
|
|
2042
|
+
getDnssecKeys(zoneName: string): Promise<{
|
|
2043
|
+
keys: DnssecKey[];
|
|
2044
|
+
}>;
|
|
2045
|
+
getDsRecord(zoneName: string): Promise<DnssecDsRecord>;
|
|
2046
|
+
clearCache(): Promise<{
|
|
2047
|
+
success: boolean;
|
|
2048
|
+
entriesCleared: number;
|
|
2049
|
+
}>;
|
|
2050
|
+
}
|
|
2051
|
+
export type SmartGatewayClientConfig = {
|
|
2052
|
+
baseUrl: string;
|
|
2053
|
+
apiKey?: string;
|
|
2054
|
+
authToken?: string;
|
|
2055
|
+
timeout?: number;
|
|
2056
|
+
allowInsecure?: boolean;
|
|
2057
|
+
};
|
|
2058
|
+
export declare class SmartGatewayClient {
|
|
2059
|
+
private readonly http;
|
|
2060
|
+
readonly routing: RoutingClient;
|
|
2061
|
+
readonly domains: DomainsClient;
|
|
2062
|
+
readonly dns: DnsClient;
|
|
2063
|
+
constructor(config: SmartGatewayClientConfig);
|
|
2064
|
+
getHealth(): Promise<GatewayHealthResponse>;
|
|
2065
|
+
getStatus(): Promise<GatewayStatusResponse>;
|
|
2066
|
+
getReadiness(): Promise<GatewayReadinessResponse>;
|
|
2067
|
+
getLiveness(): Promise<GatewayLivenessResponse>;
|
|
2068
|
+
getMetrics(refresh?: boolean): Promise<GatewayMetricsResponse>;
|
|
2069
|
+
getMetricsSummary(): Promise<GatewayMetricsSummaryResponse>;
|
|
2070
|
+
}
|
|
2071
|
+
declare function formatHederaAccountId(id: string): string;
|
|
2072
|
+
declare function parseHbar(amount: string): number;
|
|
2073
|
+
declare function hbarToTinybars(hbar: string | number): string;
|
|
2074
|
+
declare function tinybarsToHbar(tinybars: string | number): string;
|
|
2075
|
+
declare function formatHederaTokenId(id: string): string;
|
|
2076
|
+
declare function formatHederaTopicId(id: string): string;
|
|
2077
|
+
declare function validateXRPLAddress(address: string): boolean;
|
|
2078
|
+
declare function formatXRPLAddress(address: string): string;
|
|
2079
|
+
declare function xrpToDrops(xrp: string | number): string;
|
|
2080
|
+
declare function dropsToXrp(drops: string | number): string;
|
|
2081
|
+
declare function parseXRP(amount: string): number;
|
|
2082
|
+
declare function validateCurrencyCode(code: string): boolean;
|
|
2083
|
+
declare function validatePolkadotAddress(address: string): boolean;
|
|
2084
|
+
declare function formatPolkadotAddress(address: string, prefixLength?: number, suffixLength?: number): string;
|
|
2085
|
+
declare function dotToPlanck(dot: number): bigint;
|
|
2086
|
+
declare function planckToDot(planck: bigint): number;
|
|
2087
|
+
declare function formatDot(planck: bigint, decimals?: number): string;
|
|
2088
|
+
declare function parseDotString(dotString: string): bigint;
|
|
2089
|
+
declare function validateSolanaPublicKey(publicKey: string): boolean;
|
|
2090
|
+
declare function formatSolanaAddress(address: string, prefixLength?: number, suffixLength?: number): string;
|
|
2091
|
+
declare function solToLamports(sol: number): bigint;
|
|
2092
|
+
declare function lamportsToSol(lamports: bigint): number;
|
|
2093
|
+
declare function formatSol(lamports: bigint, decimals?: number): string;
|
|
2094
|
+
declare function parseSolString(solString: string): bigint;
|
|
2095
|
+
declare function isTransactionSignature(signature: string): boolean;
|
|
2096
|
+
declare function validateStellarAddress(address: string): boolean;
|
|
2097
|
+
declare function stroopsToXlm(stroops: string | number): string;
|
|
2098
|
+
declare function xlmToStroops(xlm: string | number): string;
|
|
2099
|
+
declare function validateBitcoinAddress(address: string): boolean;
|
|
2100
|
+
declare function satoshisToBtc(satoshis: string | number): string;
|
|
2101
|
+
declare function btcToSatoshis(btc: string | number): string;
|
|
2102
|
+
export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging";
|
|
2103
|
+
export type BaasSupportedChain = "hedera" | "xrpl" | "polkadot" | "solana";
|
|
2104
|
+
export type BaasEndpoints = {
|
|
2105
|
+
auth: string;
|
|
2106
|
+
database: string;
|
|
2107
|
+
storage: string;
|
|
2108
|
+
functions: string;
|
|
2109
|
+
messaging: string;
|
|
2110
|
+
};
|
|
2111
|
+
export type DeployedAppStatus = "pending" | "deploying" | "active" | "suspended" | "deleted";
|
|
2112
|
+
export type DeployedAppLimits = {
|
|
2113
|
+
storage: string;
|
|
2114
|
+
functions: number;
|
|
2115
|
+
channels: number;
|
|
2116
|
+
};
|
|
2117
|
+
export type DeployedAppUsage = {
|
|
2118
|
+
storage: number;
|
|
2119
|
+
functions: number;
|
|
2120
|
+
channels: number;
|
|
2121
|
+
};
|
|
2122
|
+
export type DeployedApp = {
|
|
2123
|
+
appId: string;
|
|
2124
|
+
name: string;
|
|
2125
|
+
services: BaasService[];
|
|
2126
|
+
status: DeployedAppStatus;
|
|
2127
|
+
owner: string;
|
|
2128
|
+
endpoints: BaasEndpoints;
|
|
2129
|
+
environment?: Record<string, string>;
|
|
2130
|
+
limits: DeployedAppLimits;
|
|
2131
|
+
usage: DeployedAppUsage;
|
|
2132
|
+
createdAt: string;
|
|
2133
|
+
updatedAt?: string;
|
|
2134
|
+
};
|
|
2135
|
+
export type DeployedAppInfo = {
|
|
2136
|
+
appId: string;
|
|
2137
|
+
name: string;
|
|
2138
|
+
status: "active" | "inactive" | "deploying" | "error";
|
|
2139
|
+
services: string[];
|
|
2140
|
+
endpoints: BaasEndpoints;
|
|
2141
|
+
createdAt: string;
|
|
2142
|
+
};
|
|
2143
|
+
export type BaasAuthConfig = {
|
|
2144
|
+
chain: BaasSupportedChain;
|
|
2145
|
+
walletAddress: string;
|
|
2146
|
+
publicKey: string;
|
|
2147
|
+
signFn: (message: string) => string | Promise<string>;
|
|
2148
|
+
};
|
|
2149
|
+
export type BaasClientConfig = {
|
|
2150
|
+
hostUrl: string;
|
|
2151
|
+
appId?: string;
|
|
2152
|
+
appName?: string;
|
|
2153
|
+
auth?: BaasAuthConfig;
|
|
2154
|
+
services?: BaasService[];
|
|
2155
|
+
timeout?: number;
|
|
2156
|
+
allowInsecure?: boolean;
|
|
2157
|
+
http?: ResilientHttpConfig;
|
|
2158
|
+
pathPrefix?: string;
|
|
2159
|
+
};
|
|
2160
|
+
export type BaasChallengeRequest = {
|
|
2161
|
+
chain: BaasSupportedChain;
|
|
2162
|
+
walletAddress: string;
|
|
2163
|
+
appId: string;
|
|
2164
|
+
metadata?: Record<string, unknown>;
|
|
2165
|
+
};
|
|
2166
|
+
export type BaasChallengeResponse = {
|
|
2167
|
+
challengeId: string;
|
|
2168
|
+
message: string;
|
|
2169
|
+
expiresAt: number;
|
|
2170
|
+
chain?: BaasSupportedChain;
|
|
2171
|
+
walletAddress?: string;
|
|
2172
|
+
appId?: string;
|
|
2173
|
+
};
|
|
2174
|
+
export type BaasVerifyRequest = {
|
|
2175
|
+
challengeId: string;
|
|
2176
|
+
signature: string;
|
|
2177
|
+
publicKey?: string;
|
|
2178
|
+
};
|
|
2179
|
+
export type BaasAuthResult = {
|
|
2180
|
+
authenticated?: boolean;
|
|
2181
|
+
walletAddress: string;
|
|
2182
|
+
chain: BaasSupportedChain;
|
|
2183
|
+
appId: string;
|
|
2184
|
+
token: string;
|
|
2185
|
+
expiresAt: number;
|
|
2186
|
+
};
|
|
2187
|
+
export type BaasSessionInfo = {
|
|
2188
|
+
valid: boolean;
|
|
2189
|
+
walletAddress?: string;
|
|
2190
|
+
chain?: BaasSupportedChain;
|
|
2191
|
+
appId?: string;
|
|
2192
|
+
permissions?: string[];
|
|
2193
|
+
sessionId?: string;
|
|
2194
|
+
expiresAt?: number;
|
|
2195
|
+
error?: string;
|
|
2196
|
+
};
|
|
2197
|
+
export type BaasRegisterRequest = {
|
|
2198
|
+
name: string;
|
|
2199
|
+
services: BaasService[];
|
|
2200
|
+
environment?: Record<string, string>;
|
|
2201
|
+
limits?: {
|
|
2202
|
+
storage?: string;
|
|
2203
|
+
functions?: number;
|
|
2204
|
+
channels?: number;
|
|
2205
|
+
};
|
|
2206
|
+
};
|
|
2207
|
+
export type BaasRegisterResponse = {
|
|
2208
|
+
appId: string;
|
|
2209
|
+
name: string;
|
|
2210
|
+
status: DeployedAppStatus;
|
|
2211
|
+
services: string[];
|
|
2212
|
+
endpoints: BaasEndpoints;
|
|
2213
|
+
createdAt: string;
|
|
2214
|
+
};
|
|
2215
|
+
export type BaasDocument = {
|
|
2216
|
+
_id: string;
|
|
2217
|
+
data: Record<string, unknown>;
|
|
2218
|
+
createdAt: number;
|
|
2219
|
+
updatedAt: number;
|
|
2220
|
+
version: number;
|
|
2221
|
+
};
|
|
2222
|
+
export type DbDocument<T = Record<string, unknown>> = {
|
|
2223
|
+
_id: string;
|
|
2224
|
+
data: T;
|
|
2225
|
+
createdAt: number;
|
|
2226
|
+
updatedAt: number;
|
|
2227
|
+
version: number;
|
|
2228
|
+
};
|
|
2229
|
+
export type BaasStateTransition = {
|
|
2230
|
+
transitionId: string;
|
|
2231
|
+
operation: "insert" | "update" | "delete";
|
|
2232
|
+
collection: string;
|
|
2233
|
+
documentId: string;
|
|
2234
|
+
previousHash: string;
|
|
2235
|
+
newHash: string;
|
|
2236
|
+
stateRoot: string;
|
|
2237
|
+
timestamp: number;
|
|
2238
|
+
proof: BaasMerkleProof;
|
|
2239
|
+
};
|
|
2240
|
+
export type BaasMerkleProof = {
|
|
2241
|
+
root: string;
|
|
2242
|
+
leaf: string;
|
|
2243
|
+
siblings: string[];
|
|
2244
|
+
path: ("left" | "right")[];
|
|
2245
|
+
};
|
|
2246
|
+
export type BaasInsertResult = {
|
|
2247
|
+
document: BaasDocument;
|
|
2248
|
+
stateTransition: BaasStateTransition;
|
|
2249
|
+
};
|
|
2250
|
+
export type BaasUpdateResult = {
|
|
2251
|
+
document: BaasDocument;
|
|
2252
|
+
stateTransition: BaasStateTransition;
|
|
2253
|
+
};
|
|
2254
|
+
export type BaasDeleteResult = {
|
|
2255
|
+
deleted: boolean;
|
|
2256
|
+
stateTransition: BaasStateTransition;
|
|
2257
|
+
};
|
|
2258
|
+
export type DbComparisonOperator = {
|
|
2259
|
+
$eq?: unknown;
|
|
2260
|
+
$ne?: unknown;
|
|
2261
|
+
$gt?: number;
|
|
2262
|
+
$gte?: number;
|
|
2263
|
+
$lt?: number;
|
|
2264
|
+
$lte?: number;
|
|
2265
|
+
$in?: unknown[];
|
|
2266
|
+
$nin?: unknown[];
|
|
2267
|
+
$exists?: boolean;
|
|
2268
|
+
$regex?: string;
|
|
2269
|
+
};
|
|
2270
|
+
export type DbQuery = Record<string, unknown | DbComparisonOperator>;
|
|
2271
|
+
export type BaasQueryOptions = {
|
|
2272
|
+
limit?: number;
|
|
2273
|
+
skip?: number;
|
|
2274
|
+
sort?: string;
|
|
2275
|
+
projection?: Record<string, 0 | 1>;
|
|
2276
|
+
};
|
|
2277
|
+
export type BaasFindResult = {
|
|
2278
|
+
documents: BaasDocument[];
|
|
2279
|
+
count: number;
|
|
2280
|
+
limit: number;
|
|
2281
|
+
skip: number;
|
|
2282
|
+
};
|
|
2283
|
+
export type BaasFileMetadata = {
|
|
2284
|
+
filename?: string;
|
|
2285
|
+
mimeType?: string;
|
|
2286
|
+
tags?: Record<string, string>;
|
|
2287
|
+
encrypted?: boolean;
|
|
2288
|
+
};
|
|
2289
|
+
export type BaasUploadResult = {
|
|
2290
|
+
cid: string;
|
|
2291
|
+
size: number;
|
|
2292
|
+
mimeType: string;
|
|
2293
|
+
uploadedAt: string;
|
|
2294
|
+
filename?: string;
|
|
2295
|
+
encrypted?: boolean;
|
|
2296
|
+
};
|
|
2297
|
+
export type BaasFileInfo = {
|
|
2298
|
+
cid: string;
|
|
2299
|
+
filename?: string;
|
|
2300
|
+
size: number;
|
|
2301
|
+
mimeType?: string;
|
|
2302
|
+
uploadedAt: string;
|
|
2303
|
+
lastAccessedAt?: string;
|
|
2304
|
+
tags?: Record<string, string>;
|
|
2305
|
+
};
|
|
2306
|
+
export type BaasStorageUsage = {
|
|
2307
|
+
totalSize: number;
|
|
2308
|
+
fileCount: number;
|
|
2309
|
+
};
|
|
2310
|
+
export type BaasFunctionRuntime = "nodejs20" | "python3" | "deno";
|
|
2311
|
+
export type BaasTriggerType = "http" | "schedule" | "event" | "webhook";
|
|
2312
|
+
export type BaasFunctionResources = {
|
|
2313
|
+
memory: string;
|
|
2314
|
+
timeout: number;
|
|
2315
|
+
maxConcurrency?: number;
|
|
2316
|
+
};
|
|
2317
|
+
export type BaasFunctionDeployRequest = {
|
|
2318
|
+
name: string;
|
|
2319
|
+
description?: string;
|
|
2320
|
+
runtime: BaasFunctionRuntime;
|
|
2321
|
+
code: string;
|
|
2322
|
+
codeType: "inline" | "ipfs";
|
|
2323
|
+
entryPoint?: string;
|
|
2324
|
+
triggers?: Array<{
|
|
2325
|
+
type: BaasTriggerType;
|
|
2326
|
+
config: Record<string, unknown>;
|
|
2327
|
+
}>;
|
|
2328
|
+
resources?: Partial<BaasFunctionResources>;
|
|
2329
|
+
environment?: Record<string, string>;
|
|
2330
|
+
};
|
|
2331
|
+
export type BaasFunctionDeployResult = {
|
|
2332
|
+
functionId: string;
|
|
2333
|
+
version: number;
|
|
2334
|
+
deployedAt: string;
|
|
2335
|
+
endpoints?: string[];
|
|
2336
|
+
status: "active" | "deploying" | "failed";
|
|
2337
|
+
error?: string;
|
|
2338
|
+
};
|
|
2339
|
+
export type BaasFunctionResult = {
|
|
2340
|
+
requestId: string;
|
|
2341
|
+
functionId: string;
|
|
2342
|
+
status: "success" | "error" | "timeout";
|
|
2343
|
+
result?: unknown;
|
|
2344
|
+
error?: string;
|
|
2345
|
+
logs?: string[];
|
|
2346
|
+
duration: number;
|
|
2347
|
+
memoryUsed?: number;
|
|
2348
|
+
};
|
|
2349
|
+
export type BaasFunctionInfo = {
|
|
2350
|
+
functionId: string;
|
|
2351
|
+
name: string;
|
|
2352
|
+
runtime: BaasFunctionRuntime;
|
|
2353
|
+
version: number;
|
|
2354
|
+
status: "active" | "inactive" | "error";
|
|
2355
|
+
deployedAt: string;
|
|
2356
|
+
lastInvokedAt?: string;
|
|
2357
|
+
invocationCount: number;
|
|
2358
|
+
};
|
|
2359
|
+
export type BaasFunctionLog = {
|
|
2360
|
+
timestamp: string;
|
|
2361
|
+
level: "debug" | "info" | "warn" | "error";
|
|
2362
|
+
message: string;
|
|
2363
|
+
requestId?: string;
|
|
2364
|
+
metadata?: Record<string, unknown>;
|
|
2365
|
+
};
|
|
2366
|
+
export type BaasFunctionLogOptions = {
|
|
2367
|
+
startTime?: string;
|
|
2368
|
+
endTime?: string;
|
|
2369
|
+
limit?: number;
|
|
2370
|
+
level?: "debug" | "info" | "warn" | "error";
|
|
2371
|
+
requestId?: string;
|
|
2372
|
+
};
|
|
2373
|
+
export type BaasMessage = {
|
|
2374
|
+
messageId: string;
|
|
2375
|
+
channel: string;
|
|
2376
|
+
data: Record<string, unknown>;
|
|
2377
|
+
sender?: string;
|
|
2378
|
+
timestamp: string;
|
|
2379
|
+
metadata?: Record<string, unknown>;
|
|
2380
|
+
};
|
|
2381
|
+
export type MessageHandler = (message: BaasMessage) => void | Promise<void>;
|
|
2382
|
+
export type BaasChannelConfig = {
|
|
2383
|
+
name: string;
|
|
2384
|
+
persistent?: boolean;
|
|
2385
|
+
maxHistoryLength?: number;
|
|
2386
|
+
presence?: boolean;
|
|
2387
|
+
authRequired?: boolean;
|
|
2388
|
+
};
|
|
2389
|
+
export type ChannelSubscription = {
|
|
2390
|
+
subscriptionId: string;
|
|
2391
|
+
channel: string;
|
|
2392
|
+
appId: string;
|
|
2393
|
+
createdAt: string;
|
|
2394
|
+
active: boolean;
|
|
2395
|
+
};
|
|
2396
|
+
export type BaasPresenceMember = {
|
|
2397
|
+
clientId: string;
|
|
2398
|
+
walletAddress?: string;
|
|
2399
|
+
joinedAt: string;
|
|
2400
|
+
lastSeenAt: string;
|
|
2401
|
+
metadata?: Record<string, unknown>;
|
|
2402
|
+
};
|
|
2403
|
+
export type BaasPresenceInfo = {
|
|
2404
|
+
channel: string;
|
|
2405
|
+
members: BaasPresenceMember[];
|
|
2406
|
+
totalCount: number;
|
|
2407
|
+
};
|
|
2408
|
+
export type BaasHistoryOptions = {
|
|
2409
|
+
limit?: number;
|
|
2410
|
+
before?: string;
|
|
2411
|
+
after?: string;
|
|
2412
|
+
startTime?: string;
|
|
2413
|
+
endTime?: string;
|
|
2414
|
+
};
|
|
2415
|
+
export type BaasPublishResult = {
|
|
2416
|
+
messageId: string;
|
|
2417
|
+
channel: string;
|
|
2418
|
+
timestamp: string;
|
|
2419
|
+
};
|
|
2420
|
+
export type BaasDeployRequest = {
|
|
2421
|
+
name: string;
|
|
2422
|
+
services: BaasService[];
|
|
2423
|
+
config?: Record<string, unknown>;
|
|
2424
|
+
};
|
|
2425
|
+
export type BaasDeployResult = {
|
|
2426
|
+
appId: string;
|
|
2427
|
+
name: string;
|
|
2428
|
+
status: "active" | "deploying" | "error";
|
|
2429
|
+
services: string[];
|
|
2430
|
+
endpoints: BaasEndpoints;
|
|
2431
|
+
createdAt: string;
|
|
2432
|
+
};
|
|
2433
|
+
export type BaasAppListResponse = {
|
|
2434
|
+
apps: DeployedAppInfo[];
|
|
2435
|
+
};
|
|
2436
|
+
export type BaasErrorResponse = {
|
|
2437
|
+
code: string;
|
|
2438
|
+
message: string;
|
|
2439
|
+
details?: Record<string, unknown>;
|
|
2440
|
+
requestId?: string;
|
|
2441
|
+
};
|
|
2442
|
+
export type BaasErrorDetails = {
|
|
2443
|
+
code?: string;
|
|
2444
|
+
details?: unknown;
|
|
2445
|
+
originalError?: string;
|
|
2446
|
+
};
|
|
2447
|
+
export type StateRootResponse = {
|
|
2448
|
+
appId: string;
|
|
2449
|
+
stateRoot: string;
|
|
2450
|
+
blockHeight: number;
|
|
2451
|
+
timestamp: string;
|
|
2452
|
+
};
|
|
2453
|
+
export type DocumentProofResponse = {
|
|
2454
|
+
documentId: string;
|
|
2455
|
+
exists: boolean;
|
|
2456
|
+
proof: BaasMerkleProof;
|
|
2457
|
+
stateRoot: string;
|
|
2458
|
+
};
|
|
2459
|
+
export type StateTransitionsResponse = {
|
|
2460
|
+
transitions: BaasStateTransition[];
|
|
2461
|
+
total: number;
|
|
2462
|
+
fromBlock: number;
|
|
2463
|
+
toBlock: number;
|
|
2464
|
+
};
|
|
2465
|
+
export type DatabaseStatsResponse = {
|
|
2466
|
+
collections: number;
|
|
2467
|
+
documents: number;
|
|
2468
|
+
storageSize: number;
|
|
2469
|
+
stateRoot: string;
|
|
2470
|
+
blockHeight: number;
|
|
2471
|
+
};
|
|
2472
|
+
export declare class DatabaseClient {
|
|
2473
|
+
private readonly http;
|
|
2474
|
+
private readonly getAppId;
|
|
2475
|
+
constructor(http: HttpClient, getAppId: () => string);
|
|
2476
|
+
insert(collection: string, document: Record<string, unknown>): Promise<BaasInsertResult>;
|
|
2477
|
+
find(collection: string, query?: Record<string, unknown>, options?: BaasQueryOptions): Promise<BaasFindResult>;
|
|
2478
|
+
update(collection: string, documentId: string, updates: Record<string, unknown>): Promise<BaasUpdateResult>;
|
|
2479
|
+
delete(collection: string, documentId: string): Promise<BaasDeleteResult>;
|
|
2480
|
+
listCollections(): Promise<{
|
|
2481
|
+
collections: string[];
|
|
2482
|
+
}>;
|
|
2483
|
+
getStateRoot(): Promise<StateRootResponse>;
|
|
2484
|
+
getDocumentProof(documentId: string): Promise<DocumentProofResponse>;
|
|
2485
|
+
getStateTransitions(options?: {
|
|
2486
|
+
fromBlock?: number;
|
|
2487
|
+
toBlock?: number;
|
|
2488
|
+
limit?: number;
|
|
2489
|
+
}): Promise<StateTransitionsResponse>;
|
|
2490
|
+
getDbStats(): Promise<DatabaseStatsResponse>;
|
|
2491
|
+
}
|
|
2492
|
+
export declare class StorageClient {
|
|
2493
|
+
private readonly http;
|
|
2494
|
+
private readonly getAppId;
|
|
2495
|
+
constructor(http: HttpClient, getAppId: () => string);
|
|
2496
|
+
upload(file: Blob | Buffer, filename: string, metadata?: Record<string, string>): Promise<BaasUploadResult>;
|
|
2497
|
+
download(cid: string): Promise<any>;
|
|
2498
|
+
getMetadata(cid: string): Promise<BaasFileMetadata>;
|
|
2499
|
+
delete(cid: string): Promise<{
|
|
2500
|
+
success: boolean;
|
|
2501
|
+
}>;
|
|
2502
|
+
getFile(cid: string): Promise<BaasFileInfo>;
|
|
2503
|
+
listFiles(pagination?: {
|
|
2504
|
+
limit?: number;
|
|
2505
|
+
skip?: number;
|
|
2506
|
+
}): Promise<{
|
|
2507
|
+
files: BaasFileInfo[];
|
|
2508
|
+
total: number;
|
|
2509
|
+
}>;
|
|
2510
|
+
getUsage(): Promise<BaasStorageUsage>;
|
|
2511
|
+
exists(cid: string): Promise<{
|
|
2512
|
+
exists: boolean;
|
|
2513
|
+
cid: string;
|
|
2514
|
+
}>;
|
|
2515
|
+
}
|
|
2516
|
+
export declare class FunctionsClient {
|
|
2517
|
+
private readonly http;
|
|
2518
|
+
private readonly getAppId;
|
|
2519
|
+
constructor(http: HttpClient, getAppId: () => string);
|
|
2520
|
+
deploy(request: BaasFunctionDeployRequest): Promise<BaasFunctionDeployResult>;
|
|
2521
|
+
invoke(functionId: string, payload?: unknown): Promise<BaasFunctionResult>;
|
|
2522
|
+
list(): Promise<{
|
|
2523
|
+
functions: BaasFunctionInfo[];
|
|
2524
|
+
total: number;
|
|
2525
|
+
}>;
|
|
2526
|
+
get(functionId: string): Promise<BaasFunctionInfo>;
|
|
2527
|
+
update(functionId: string, updates: Partial<BaasFunctionDeployRequest>): Promise<BaasFunctionInfo>;
|
|
2528
|
+
delete(functionId: string): Promise<{
|
|
2529
|
+
success: boolean;
|
|
2530
|
+
}>;
|
|
2531
|
+
getLogs(functionId: string, options?: BaasFunctionLogOptions): Promise<{
|
|
2532
|
+
logs: BaasFunctionLog[];
|
|
2533
|
+
total: number;
|
|
2534
|
+
}>;
|
|
2535
|
+
getStats(): Promise<any>;
|
|
2536
|
+
}
|
|
2537
|
+
export declare class MessagingClient {
|
|
2538
|
+
private readonly http;
|
|
2539
|
+
private readonly getAppId;
|
|
2540
|
+
constructor(http: HttpClient, getAppId: () => string);
|
|
2541
|
+
createChannel(config: BaasChannelConfig): Promise<BaasChannelConfig & {
|
|
2542
|
+
channelId: string;
|
|
2543
|
+
}>;
|
|
2544
|
+
deleteChannel(channelId: string): Promise<{
|
|
2545
|
+
success: boolean;
|
|
2546
|
+
}>;
|
|
2547
|
+
getChannel(channelId: string): Promise<BaasChannelConfig & {
|
|
2548
|
+
channelId: string;
|
|
2549
|
+
messageCount: number;
|
|
2550
|
+
}>;
|
|
2551
|
+
listChannels(): Promise<{
|
|
2552
|
+
channels: Array<BaasChannelConfig & {
|
|
2553
|
+
channelId: string;
|
|
2554
|
+
}>;
|
|
2555
|
+
total: number;
|
|
2556
|
+
}>;
|
|
2557
|
+
publish(channel: string, message: Record<string, unknown>, metadata?: Record<string, unknown>): Promise<BaasPublishResult>;
|
|
2558
|
+
getHistory(channel: string, options?: BaasHistoryOptions): Promise<{
|
|
2559
|
+
messages: BaasMessage[];
|
|
2560
|
+
total: number;
|
|
2561
|
+
hasMore: boolean;
|
|
2562
|
+
}>;
|
|
2563
|
+
setPresence(member: BaasPresenceMember): Promise<{
|
|
2564
|
+
success: boolean;
|
|
2565
|
+
}>;
|
|
2566
|
+
removePresence(memberId: string): Promise<{
|
|
2567
|
+
success: boolean;
|
|
2568
|
+
}>;
|
|
2569
|
+
getPresence(channel: string): Promise<BaasPresenceInfo>;
|
|
2570
|
+
getStats(): Promise<any>;
|
|
2571
|
+
}
|
|
2572
|
+
export declare class DeploymentClient {
|
|
2573
|
+
private readonly http;
|
|
2574
|
+
constructor(http: HttpClient);
|
|
2575
|
+
create(request: BaasDeployRequest): Promise<BaasDeployResult>;
|
|
2576
|
+
list(): Promise<BaasAppListResponse>;
|
|
2577
|
+
get(appId: string): Promise<DeployedAppInfo>;
|
|
2578
|
+
update(appId: string, updates: Partial<BaasDeployRequest>): Promise<DeployedAppInfo>;
|
|
2579
|
+
delete(appId: string): Promise<{
|
|
2580
|
+
success: boolean;
|
|
2581
|
+
}>;
|
|
2582
|
+
suspend(appId: string): Promise<{
|
|
2583
|
+
success: boolean;
|
|
2584
|
+
status: string;
|
|
2585
|
+
}>;
|
|
2586
|
+
resume(appId: string): Promise<{
|
|
2587
|
+
success: boolean;
|
|
2588
|
+
status: string;
|
|
2589
|
+
}>;
|
|
2590
|
+
getStats(): Promise<any>;
|
|
2591
|
+
}
|
|
2592
|
+
export type AgentStatus = "active" | "paused" | "revoked" | "pending";
|
|
2593
|
+
export type AgentRegisterRequest = {
|
|
2594
|
+
name: string;
|
|
2595
|
+
description?: string;
|
|
2596
|
+
capabilities: string[];
|
|
2597
|
+
rules: AgentRules;
|
|
2598
|
+
fundingConfig?: {
|
|
2599
|
+
chain: string;
|
|
2600
|
+
maxAmount: string;
|
|
2601
|
+
autoFund: boolean;
|
|
2602
|
+
};
|
|
2603
|
+
};
|
|
2604
|
+
export type AgentRules = {
|
|
2605
|
+
maxTradeAmount?: string;
|
|
2606
|
+
allowedPairs?: string[];
|
|
2607
|
+
allowedChains?: string[];
|
|
2608
|
+
dailyLimit?: string;
|
|
2609
|
+
requireApprovalAbove?: string;
|
|
2610
|
+
customRules?: Record<string, unknown>;
|
|
2611
|
+
};
|
|
2612
|
+
export type AgentRulesValidationResult = {
|
|
2613
|
+
valid: boolean;
|
|
2614
|
+
errors: string[];
|
|
2615
|
+
};
|
|
2616
|
+
export declare function validateAgentRules(rules: AgentRules): AgentRulesValidationResult;
|
|
2617
|
+
export type AgentInfo = {
|
|
2618
|
+
agentId: string;
|
|
2619
|
+
name: string;
|
|
2620
|
+
description?: string;
|
|
2621
|
+
status: AgentStatus;
|
|
2622
|
+
capabilities: string[];
|
|
2623
|
+
rules: AgentRules;
|
|
2624
|
+
owner: string;
|
|
2625
|
+
createdAt: string;
|
|
2626
|
+
lastActiveAt?: string;
|
|
2627
|
+
};
|
|
2628
|
+
export type AgentEvent = {
|
|
2629
|
+
eventId: string;
|
|
2630
|
+
agentId: string;
|
|
2631
|
+
type: string;
|
|
2632
|
+
data: Record<string, unknown>;
|
|
2633
|
+
timestamp: string;
|
|
2634
|
+
};
|
|
2635
|
+
export type AgentBalance = {
|
|
2636
|
+
chain: string;
|
|
2637
|
+
accountId: string;
|
|
2638
|
+
balance: string;
|
|
2639
|
+
symbol: string;
|
|
2640
|
+
};
|
|
2641
|
+
export type AgentOperation = {
|
|
2642
|
+
operationId: string;
|
|
2643
|
+
agentId: string;
|
|
2644
|
+
type: string;
|
|
2645
|
+
amount: string;
|
|
2646
|
+
chain: string;
|
|
2647
|
+
status: "pending" | "approved" | "rejected";
|
|
2648
|
+
createdAt: string;
|
|
2649
|
+
};
|
|
2650
|
+
export type AgentFundRequest = {
|
|
2651
|
+
chain: string;
|
|
2652
|
+
amount: string;
|
|
2653
|
+
source?: string;
|
|
2654
|
+
};
|
|
2655
|
+
export type AgentTradeRequest = {
|
|
2656
|
+
chain: string;
|
|
2657
|
+
pair: string;
|
|
2658
|
+
side: "buy" | "sell";
|
|
2659
|
+
amount: string;
|
|
2660
|
+
price?: string;
|
|
2661
|
+
};
|
|
2662
|
+
export type AgentWithdrawRequest = {
|
|
2663
|
+
chain: string;
|
|
2664
|
+
amount: string;
|
|
2665
|
+
destination: string;
|
|
2666
|
+
};
|
|
2667
|
+
export declare class AgentsClient {
|
|
2668
|
+
private readonly http;
|
|
2669
|
+
constructor(http: HttpClient);
|
|
2670
|
+
register(request: AgentRegisterRequest): Promise<AgentInfo>;
|
|
2671
|
+
get(agentId: string): Promise<AgentInfo>;
|
|
2672
|
+
list(): Promise<{
|
|
2673
|
+
agents: AgentInfo[];
|
|
2674
|
+
total: number;
|
|
2675
|
+
}>;
|
|
2676
|
+
fund(agentId: string, request: AgentFundRequest): Promise<{
|
|
2677
|
+
success: boolean;
|
|
2678
|
+
txId?: string;
|
|
2679
|
+
}>;
|
|
2680
|
+
trade(agentId: string, request: AgentTradeRequest): Promise<{
|
|
2681
|
+
success: boolean;
|
|
2682
|
+
txId?: string;
|
|
2683
|
+
}>;
|
|
2684
|
+
withdraw(agentId: string, request: AgentWithdrawRequest): Promise<{
|
|
2685
|
+
success: boolean;
|
|
2686
|
+
txId?: string;
|
|
2687
|
+
}>;
|
|
2688
|
+
pause(agentId: string): Promise<{
|
|
2689
|
+
success: boolean;
|
|
2690
|
+
status: string;
|
|
2691
|
+
}>;
|
|
2692
|
+
resume(agentId: string): Promise<{
|
|
2693
|
+
success: boolean;
|
|
2694
|
+
status: string;
|
|
2695
|
+
}>;
|
|
2696
|
+
revoke(agentId: string): Promise<{
|
|
2697
|
+
success: boolean;
|
|
2698
|
+
status: string;
|
|
2699
|
+
}>;
|
|
2700
|
+
updateRules(agentId: string, rules: Partial<AgentRules>): Promise<AgentInfo>;
|
|
2701
|
+
getEvents(agentId: string): Promise<{
|
|
2702
|
+
events: AgentEvent[];
|
|
2703
|
+
total: number;
|
|
2704
|
+
}>;
|
|
2705
|
+
getBalances(agentId: string): Promise<{
|
|
2706
|
+
balances: AgentBalance[];
|
|
2707
|
+
}>;
|
|
2708
|
+
approve(agentId: string, operationId: string): Promise<{
|
|
2709
|
+
success: boolean;
|
|
2710
|
+
}>;
|
|
2711
|
+
reject(agentId: string, operationId: string): Promise<{
|
|
2712
|
+
success: boolean;
|
|
2713
|
+
}>;
|
|
2714
|
+
}
|
|
2715
|
+
export type AuthenticateOptions = {
|
|
2716
|
+
chain: BaasSupportedChain;
|
|
2717
|
+
walletAddress: string;
|
|
2718
|
+
publicKey: string;
|
|
2719
|
+
signFn: (message: string) => string | Promise<string>;
|
|
2720
|
+
};
|
|
2721
|
+
export declare class BaasClient {
|
|
2722
|
+
private readonly hostUrl;
|
|
2723
|
+
private readonly pathPrefix;
|
|
2724
|
+
private appId;
|
|
2725
|
+
private readonly timeout;
|
|
2726
|
+
private readonly allowInsecure;
|
|
2727
|
+
private authToken;
|
|
2728
|
+
private readonly http;
|
|
2729
|
+
private lastHttpError?;
|
|
2730
|
+
readonly db: DatabaseClient;
|
|
2731
|
+
readonly storage: StorageClient;
|
|
2732
|
+
readonly functions: FunctionsClient;
|
|
2733
|
+
readonly messaging: MessagingClient;
|
|
2734
|
+
readonly deployment: DeploymentClient;
|
|
2735
|
+
readonly agents: AgentsClient;
|
|
2736
|
+
constructor(config: BaasClientConfig);
|
|
2737
|
+
setAppId(appId: string): void;
|
|
2738
|
+
isAuthenticated(): boolean;
|
|
2739
|
+
getAppId(): string | undefined;
|
|
2740
|
+
getHttpHealth(): {
|
|
2741
|
+
breaker: CircuitBreakerSnapshot | null;
|
|
2742
|
+
lastError?: Error;
|
|
2743
|
+
};
|
|
2744
|
+
private requireAppId;
|
|
2745
|
+
authenticate(options: AuthenticateOptions): Promise<BaasAuthResult>;
|
|
2746
|
+
validateSession(): Promise<BaasSessionInfo>;
|
|
2747
|
+
logout(): Promise<void>;
|
|
2748
|
+
register(request: BaasRegisterRequest): Promise<BaasRegisterResponse>;
|
|
2749
|
+
private requireAuth;
|
|
2750
|
+
private getHeaders;
|
|
2751
|
+
private post;
|
|
2752
|
+
private get;
|
|
2753
|
+
private request;
|
|
2754
|
+
}
|
|
2755
|
+
export declare class BaasError extends Error {
|
|
2756
|
+
readonly statusCode: number;
|
|
2757
|
+
readonly details?: BaasErrorDetails | undefined;
|
|
2758
|
+
constructor(message: string, statusCode: number, details?: BaasErrorDetails | undefined);
|
|
2759
|
+
}
|
|
2760
|
+
export interface SmartEngineServiceConfig extends SmartEngineClientConfig {
|
|
2761
|
+
testConnection?: boolean;
|
|
2762
|
+
autoReconnect?: boolean;
|
|
2763
|
+
reconnectInterval?: number;
|
|
2764
|
+
maxReconnectAttempts?: number;
|
|
2765
|
+
}
|
|
2766
|
+
export declare const SMART_ENGINE_CONFIG = "SMART_ENGINE_CONFIG";
|
|
2767
|
+
interface BaasClient$1 {
|
|
2768
|
+
readonly client: SmartEngineClient;
|
|
2769
|
+
isHealthy(): Promise<boolean>;
|
|
2770
|
+
getBaseUrl(): string;
|
|
2771
|
+
}
|
|
2772
|
+
export declare class SmartEngineService implements OnModuleInit, OnModuleDestroy {
|
|
2773
|
+
private readonly config?;
|
|
2774
|
+
private readonly logger;
|
|
2775
|
+
private client;
|
|
2776
|
+
private baasClient;
|
|
2777
|
+
private connected;
|
|
2778
|
+
private reconnectTimer;
|
|
2779
|
+
private reconnectAttempts;
|
|
2780
|
+
constructor(config?: SmartEngineServiceConfig | undefined);
|
|
2781
|
+
onModuleInit(): Promise<void>;
|
|
2782
|
+
onModuleDestroy(): Promise<void>;
|
|
2783
|
+
initialize(config: SmartEngineServiceConfig): Promise<void>;
|
|
2784
|
+
shutdown(): Promise<void>;
|
|
2785
|
+
getClient(): SmartEngineClient;
|
|
2786
|
+
getBaasClient(): BaasClient$1;
|
|
2787
|
+
isConnected(): boolean;
|
|
2788
|
+
testConnection(): Promise<boolean>;
|
|
2789
|
+
getStatus(): {
|
|
2790
|
+
connected: boolean;
|
|
2791
|
+
baseUrl: string | null;
|
|
2792
|
+
authenticated: boolean;
|
|
2793
|
+
reconnectAttempts: number;
|
|
2794
|
+
};
|
|
2795
|
+
createGatewayClient(config: {
|
|
2796
|
+
baseUrl: string;
|
|
2797
|
+
apiKey?: string;
|
|
2798
|
+
authToken?: string;
|
|
2799
|
+
timeout?: number;
|
|
2800
|
+
allowInsecure?: boolean;
|
|
2801
|
+
}): SmartGatewayClient;
|
|
2802
|
+
createHostClient(config: {
|
|
2803
|
+
hostUrl: string;
|
|
2804
|
+
appId?: string;
|
|
2805
|
+
timeout?: number;
|
|
2806
|
+
allowInsecure?: boolean;
|
|
2807
|
+
}): BaasClient;
|
|
2808
|
+
private createBaasClient;
|
|
2809
|
+
private scheduleReconnect;
|
|
2810
|
+
}
|
|
2811
|
+
export interface SmartEngineModuleAsyncOptions {
|
|
2812
|
+
imports?: any[];
|
|
2813
|
+
useFactory?: (...args: any[]) => Promise<SmartEngineServiceConfig> | SmartEngineServiceConfig;
|
|
2814
|
+
inject?: any[];
|
|
2815
|
+
useClass?: Type<SmartEngineOptionsFactory>;
|
|
2816
|
+
useExisting?: Type<SmartEngineOptionsFactory>;
|
|
2817
|
+
isGlobal?: boolean;
|
|
2818
|
+
}
|
|
2819
|
+
export interface SmartEngineOptionsFactory {
|
|
2820
|
+
createSmartEngineOptions(): Promise<SmartEngineServiceConfig> | SmartEngineServiceConfig;
|
|
2821
|
+
}
|
|
2822
|
+
export declare class SmartEngineModule {
|
|
2823
|
+
static forRoot(config: SmartEngineServiceConfig, isGlobal?: boolean): DynamicModule;
|
|
2824
|
+
static forRootAsync(options: SmartEngineModuleAsyncOptions): DynamicModule;
|
|
2825
|
+
private static createAsyncProviders;
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
declare namespace nestjs {
|
|
2829
|
+
export { BaasClient$1 as BaasClient, SMART_ENGINE_CONFIG, SmartEngineModule, SmartEngineModuleAsyncOptions, SmartEngineOptionsFactory, SmartEngineService, SmartEngineServiceConfig };
|
|
2830
|
+
}
|
|
2831
|
+
declare namespace bitcoin {
|
|
2832
|
+
export { btcToSatoshis, satoshisToBtc, validateBitcoinAddress };
|
|
2833
|
+
}
|
|
2834
|
+
declare namespace hedera {
|
|
2835
|
+
export { formatHederaAccountId, formatHederaTokenId, formatHederaTopicId, hbarToTinybars, parseHbar, tinybarsToHbar };
|
|
2836
|
+
}
|
|
2837
|
+
declare namespace xrpl {
|
|
2838
|
+
export { dropsToXrp, formatXRPLAddress, parseXRP, validateCurrencyCode, validateXRPLAddress, xrpToDrops };
|
|
2839
|
+
}
|
|
2840
|
+
declare namespace polkadot {
|
|
2841
|
+
export { dotToPlanck, formatDot, formatPolkadotAddress, parseDotString, planckToDot, validatePolkadotAddress };
|
|
2842
|
+
}
|
|
2843
|
+
declare namespace solana {
|
|
2844
|
+
export { formatSol, formatSolanaAddress, isTransactionSignature, lamportsToSol, parseSolString, solToLamports, validateSolanaPublicKey };
|
|
2845
|
+
}
|
|
2846
|
+
declare namespace stellar {
|
|
2847
|
+
export { stroopsToXlm, validateStellarAddress, xlmToStroops };
|
|
2848
|
+
}
|
|
2849
|
+
declare namespace discovery {
|
|
2850
|
+
export { MIRROR_NODE_URLS, MirrorNodeClient, MirrorNodeConfig, MirrorNodeError, TopicMessage, TopicMessagesResponse, ValidatorDiscoveryClient, ValidatorDiscoveryConfig, ValidatorInfo, ValidatorMetadata, ValidatorNetworkEndpoints };
|
|
2851
|
+
}
|
|
2852
|
+
declare namespace auth {
|
|
2853
|
+
export { AuthChain, AuthenticateRequest, AuthenticateResponse, ChallengeResponse, SecurityConfig, SessionInfo, ValidatorAuthClient, ValidatorAuthConfig, ValidatorAuthError };
|
|
2854
|
+
}
|
|
2855
|
+
declare namespace chains {
|
|
2856
|
+
export { bitcoin, hedera, polkadot, solana, stellar, xrpl };
|
|
2857
|
+
}
|
|
2858
|
+
declare namespace subscription {
|
|
2859
|
+
export { BalanceResponse, DepositWalletStatus, MintNftResponse, SubscriptionClient, SubscriptionConfig, SubscriptionListResponse, SubscriptionRenewalRequest, SubscriptionRenewalResponse, SubscriptionRequest, SubscriptionResponse, SubscriptionStatus, SubscriptionStatusResponse, SubscriptionTierInfo, SubscriptionTierName };
|
|
2860
|
+
}
|
|
2861
|
+
declare namespace settlement {
|
|
2862
|
+
export { SettlementAsset, SettlementClient, SettlementHistoryEntry, SettlementInitiateRequest, SettlementPurpose, SettlementStatusResponse };
|
|
2863
|
+
}
|
|
2864
|
+
declare namespace baas {
|
|
2865
|
+
export { AgentBalance, AgentEvent, AgentFundRequest, AgentInfo, AgentOperation, AgentRegisterRequest, AgentRules, AgentRulesValidationResult, AgentStatus, AgentTradeRequest, AgentWithdrawRequest, AgentsClient, AuthenticateOptions, BaasAppListResponse, BaasAuthConfig, BaasAuthResult, BaasChallengeRequest, BaasChallengeResponse, BaasChannelConfig, BaasClient, BaasClientConfig, BaasDeleteResult, BaasDeployRequest, BaasDeployResult, BaasDocument, BaasEndpoints, BaasError, BaasErrorDetails, BaasErrorResponse, BaasFileInfo, BaasFileMetadata, BaasFindResult, BaasFunctionDeployRequest, BaasFunctionDeployResult, BaasFunctionInfo, BaasFunctionLog, BaasFunctionLogOptions, BaasFunctionResources, BaasFunctionResult, BaasFunctionRuntime, BaasHistoryOptions, BaasInsertResult, BaasMerkleProof, BaasMessage, BaasPresenceInfo, BaasPresenceMember, BaasPublishResult, BaasQueryOptions, BaasRegisterRequest, BaasRegisterResponse, BaasService, BaasSessionInfo, BaasStateTransition, BaasStorageUsage, BaasSupportedChain, BaasTriggerType, BaasUpdateResult, BaasUploadResult, BaasVerifyRequest, ChannelSubscription, DatabaseClient, DatabaseStatsResponse, DbComparisonOperator, DbDocument, DbQuery, DeployedApp, DeployedAppInfo, DeployedAppLimits, DeployedAppStatus, DeployedAppUsage, DeploymentClient, DocumentProofResponse, FunctionsClient, MessageHandler, MessagingClient, StateRootResponse, StateTransitionsResponse, StorageClient, validateAgentRules };
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2868
|
+
export {
|
|
2869
|
+
BaasClient$1 as NestJsBaasClient,
|
|
2870
|
+
RetryConfig as ResilienceRetryConfig,
|
|
2871
|
+
RetryConfig$1 as RetryConfig,
|
|
2872
|
+
auth,
|
|
2873
|
+
baas,
|
|
2874
|
+
chains,
|
|
2875
|
+
discovery,
|
|
2876
|
+
nestjs,
|
|
2877
|
+
settlement,
|
|
2878
|
+
subscription,
|
|
2879
|
+
};
|
|
2880
|
+
|
|
2881
|
+
export {};
|