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