@hsuite/smart-engines-sdk 3.1.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1249 -1009
- package/dist/index.js +6243 -892
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.d.ts +1005 -871
- package/dist/nestjs/index.js +5479 -317
- package/dist/nestjs/index.js.map +1 -1
- package/dist/pqc-verify/index.d.ts +99 -0
- package/dist/pqc-verify/index.js +167 -0
- package/dist/pqc-verify/index.js.map +1 -0
- package/package.json +10 -3
package/dist/nestjs/index.d.ts
CHANGED
|
@@ -265,7 +265,6 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
|
|
|
265
265
|
validatorTopicId: z.ZodString;
|
|
266
266
|
immutable: z.ZodDefault<z.ZodBoolean>;
|
|
267
267
|
securityMode: z.ZodDefault<z.ZodEnum<[
|
|
268
|
-
"none",
|
|
269
268
|
"partial",
|
|
270
269
|
"full"
|
|
271
270
|
]>>;
|
|
@@ -273,7 +272,7 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
|
|
|
273
272
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
274
273
|
}, "strip", z.ZodTypeAny, {
|
|
275
274
|
chain: "hedera" | "xrpl" | "polkadot" | "solana" | "stellar" | "ethereum" | "polygon" | "bitcoin" | "cardano";
|
|
276
|
-
securityMode: "
|
|
275
|
+
securityMode: "partial" | "full";
|
|
277
276
|
initialBalance: string;
|
|
278
277
|
validatorTimestamp: string;
|
|
279
278
|
validatorTopicId: string;
|
|
@@ -290,7 +289,7 @@ declare const CreateAccountRequestSchema: z.ZodObject<{
|
|
|
290
289
|
validatorTopicId: string;
|
|
291
290
|
publicKey?: string | undefined;
|
|
292
291
|
metadata?: Record<string, any> | undefined;
|
|
293
|
-
securityMode?: "
|
|
292
|
+
securityMode?: "partial" | "full" | undefined;
|
|
294
293
|
appOwnerPublicKey?: string | undefined;
|
|
295
294
|
memo?: string | undefined;
|
|
296
295
|
payerAccountId?: string | undefined;
|
|
@@ -1015,6 +1014,7 @@ declare class IPFSClient {
|
|
|
1015
1014
|
getStatus(): Promise<IpfsStatusResponse>;
|
|
1016
1015
|
getStorageUsage(): Promise<IpfsStorageUsageResponse>;
|
|
1017
1016
|
}
|
|
1017
|
+
export type SecurityMode = "partial" | "full";
|
|
1018
1018
|
export type PreparedTransaction = {
|
|
1019
1019
|
success?: boolean;
|
|
1020
1020
|
transactionBytes: string;
|
|
@@ -1030,135 +1030,267 @@ export type PreparedTransaction = {
|
|
|
1030
1030
|
};
|
|
1031
1031
|
export type PrepareTransferRequest = {
|
|
1032
1032
|
chain: ChainType;
|
|
1033
|
-
payerAccountId
|
|
1033
|
+
payerAccountId?: string;
|
|
1034
1034
|
from: string;
|
|
1035
1035
|
to: string;
|
|
1036
1036
|
amount: string;
|
|
1037
1037
|
tokenId?: string;
|
|
1038
1038
|
entityId?: string;
|
|
1039
1039
|
memo?: string;
|
|
1040
|
+
securityMode?: SecurityMode;
|
|
1041
|
+
appOwnerPublicKey?: string;
|
|
1042
|
+
ss58Format?: number;
|
|
1040
1043
|
};
|
|
1041
1044
|
export type PrepareNftMintRequest = {
|
|
1042
1045
|
chain: ChainType;
|
|
1043
|
-
payerAccountId
|
|
1044
|
-
tokenId
|
|
1045
|
-
metadata
|
|
1046
|
+
payerAccountId?: string;
|
|
1047
|
+
tokenId?: string;
|
|
1048
|
+
metadata?: string | string[];
|
|
1046
1049
|
entityId?: string;
|
|
1050
|
+
securityMode?: SecurityMode;
|
|
1051
|
+
appOwnerPublicKey?: string;
|
|
1052
|
+
ss58Format?: number;
|
|
1053
|
+
collection?: number;
|
|
1054
|
+
item?: number;
|
|
1055
|
+
mintTo?: string;
|
|
1056
|
+
witnessData?: unknown;
|
|
1057
|
+
recipient?: string;
|
|
1058
|
+
collectionMint?: string;
|
|
1059
|
+
name?: string;
|
|
1060
|
+
symbol?: string;
|
|
1061
|
+
uri?: string;
|
|
1062
|
+
sellerFeeBasisPoints?: number;
|
|
1063
|
+
mintAuthority?: string;
|
|
1047
1064
|
};
|
|
1048
1065
|
export type PrepareNftBurnRequest = {
|
|
1049
1066
|
chain: ChainType;
|
|
1050
|
-
payerAccountId
|
|
1051
|
-
tokenId
|
|
1052
|
-
serialNumber
|
|
1067
|
+
payerAccountId?: string;
|
|
1068
|
+
tokenId?: string;
|
|
1069
|
+
serialNumber?: number;
|
|
1053
1070
|
entityId?: string;
|
|
1071
|
+
securityMode?: SecurityMode;
|
|
1072
|
+
appOwnerPublicKey?: string;
|
|
1073
|
+
ss58Format?: number;
|
|
1074
|
+
collection?: number;
|
|
1075
|
+
item?: number;
|
|
1076
|
+
mint?: string;
|
|
1077
|
+
owner?: string;
|
|
1054
1078
|
};
|
|
1055
1079
|
export type PrepareNftTransferRequest = {
|
|
1056
1080
|
chain: ChainType;
|
|
1057
|
-
payerAccountId
|
|
1058
|
-
tokenId
|
|
1059
|
-
serialNumber
|
|
1060
|
-
fromAccountId
|
|
1061
|
-
toAccountId
|
|
1081
|
+
payerAccountId?: string;
|
|
1082
|
+
tokenId?: string;
|
|
1083
|
+
serialNumber?: number;
|
|
1084
|
+
fromAccountId?: string;
|
|
1085
|
+
toAccountId?: string;
|
|
1062
1086
|
entityId?: string;
|
|
1087
|
+
securityMode?: SecurityMode;
|
|
1088
|
+
appOwnerPublicKey?: string;
|
|
1089
|
+
ss58Format?: number;
|
|
1090
|
+
collection?: number;
|
|
1091
|
+
item?: number;
|
|
1092
|
+
dest?: string;
|
|
1093
|
+
mint?: string;
|
|
1094
|
+
fromOwner?: string;
|
|
1095
|
+
toOwner?: string;
|
|
1063
1096
|
};
|
|
1064
1097
|
export type PrepareTokenCreateRequest = {
|
|
1065
|
-
chain:
|
|
1066
|
-
payerAccountId
|
|
1067
|
-
name
|
|
1068
|
-
symbol
|
|
1069
|
-
decimals
|
|
1070
|
-
initialSupply
|
|
1071
|
-
treasuryAccountId
|
|
1072
|
-
entityId
|
|
1098
|
+
chain: ChainType;
|
|
1099
|
+
payerAccountId?: string;
|
|
1100
|
+
name?: string;
|
|
1101
|
+
symbol?: string;
|
|
1102
|
+
decimals?: number;
|
|
1103
|
+
initialSupply?: string;
|
|
1104
|
+
treasuryAccountId?: string;
|
|
1105
|
+
entityId?: string;
|
|
1073
1106
|
memo?: string;
|
|
1074
1107
|
tokenType?: "FUNGIBLE_COMMON" | "NON_FUNGIBLE_UNIQUE";
|
|
1108
|
+
securityMode?: SecurityMode;
|
|
1109
|
+
appOwnerPublicKey?: string;
|
|
1075
1110
|
supplyKey?: string;
|
|
1076
1111
|
adminKey?: string;
|
|
1077
1112
|
pauseKey?: string;
|
|
1078
1113
|
freezeKey?: string;
|
|
1079
1114
|
kycKey?: string;
|
|
1080
1115
|
wipeKey?: string;
|
|
1116
|
+
mintAuthority?: string;
|
|
1117
|
+
assetId?: number;
|
|
1118
|
+
admin?: string;
|
|
1119
|
+
minBalance?: string;
|
|
1120
|
+
assetName?: string;
|
|
1121
|
+
noneOwnerVkeyHex?: string;
|
|
1122
|
+
initialRecipient?: string;
|
|
1081
1123
|
};
|
|
1082
1124
|
export type PrepareTokenMintRequest = {
|
|
1083
1125
|
chain: ChainType;
|
|
1084
|
-
payerAccountId
|
|
1085
|
-
tokenId
|
|
1126
|
+
payerAccountId?: string;
|
|
1127
|
+
tokenId?: string;
|
|
1086
1128
|
amount: string;
|
|
1087
1129
|
recipientAccountId?: string;
|
|
1088
1130
|
entityId?: string;
|
|
1131
|
+
securityMode?: SecurityMode;
|
|
1132
|
+
appOwnerPublicKey?: string;
|
|
1133
|
+
assetId?: number;
|
|
1134
|
+
beneficiary?: string;
|
|
1135
|
+
appOwnerVkeyHex?: string;
|
|
1136
|
+
noneOwnerVkeyHex?: string;
|
|
1137
|
+
destination?: string;
|
|
1089
1138
|
};
|
|
1090
1139
|
export type PrepareTokenBurnRequest = {
|
|
1091
|
-
chain:
|
|
1092
|
-
payerAccountId
|
|
1093
|
-
tokenId
|
|
1140
|
+
chain: ChainType;
|
|
1141
|
+
payerAccountId?: string;
|
|
1142
|
+
tokenId?: string;
|
|
1094
1143
|
amount: string;
|
|
1095
|
-
entityId
|
|
1144
|
+
entityId?: string;
|
|
1145
|
+
securityMode?: SecurityMode;
|
|
1146
|
+
appOwnerPublicKey?: string;
|
|
1147
|
+
assetId?: number;
|
|
1148
|
+
who?: string;
|
|
1149
|
+
appOwnerVkeyHex?: string;
|
|
1150
|
+
noneOwnerVkeyHex?: string;
|
|
1151
|
+
source?: string;
|
|
1096
1152
|
};
|
|
1097
|
-
export type
|
|
1098
|
-
chain:
|
|
1099
|
-
payerAccountId
|
|
1153
|
+
export type PrepareTokenAssociateRequest = {
|
|
1154
|
+
chain: ChainType;
|
|
1155
|
+
payerAccountId?: string;
|
|
1100
1156
|
accountId: string;
|
|
1101
1157
|
tokenIds: string[];
|
|
1102
|
-
entityId
|
|
1158
|
+
entityId?: string;
|
|
1159
|
+
owner?: string;
|
|
1160
|
+
};
|
|
1161
|
+
export type PrepareTokenPauseRequest = {
|
|
1162
|
+
chain: ChainType;
|
|
1163
|
+
payerAccountId?: string;
|
|
1164
|
+
tokenId?: string;
|
|
1165
|
+
assetId?: number;
|
|
1166
|
+
entityId?: string;
|
|
1167
|
+
securityMode?: SecurityMode;
|
|
1168
|
+
appOwnerPublicKey?: string;
|
|
1169
|
+
ss58Format?: number;
|
|
1170
|
+
currentAuthority?: string;
|
|
1171
|
+
newMintAuthority?: string | null;
|
|
1172
|
+
memo?: string;
|
|
1173
|
+
};
|
|
1174
|
+
export type PrepareTokenUnpauseRequest = PrepareTokenPauseRequest;
|
|
1175
|
+
export type PrepareTokenRestrictRequest = {
|
|
1176
|
+
chain: ChainType;
|
|
1177
|
+
payerAccountId?: string;
|
|
1178
|
+
tokenId?: string;
|
|
1179
|
+
accountId?: string;
|
|
1180
|
+
entityId?: string;
|
|
1181
|
+
securityMode?: SecurityMode;
|
|
1182
|
+
appOwnerPublicKey?: string;
|
|
1183
|
+
ss58Format?: number;
|
|
1184
|
+
assetId?: number;
|
|
1185
|
+
who?: string;
|
|
1186
|
+
account?: string;
|
|
1187
|
+
freezeAuthority?: string;
|
|
1188
|
+
memo?: string;
|
|
1189
|
+
};
|
|
1190
|
+
export type PrepareTokenUnrestrictRequest = PrepareTokenRestrictRequest;
|
|
1191
|
+
export type TransactionInfoResponse = {
|
|
1192
|
+
model?: string;
|
|
1193
|
+
description?: string;
|
|
1194
|
+
principles?: string[];
|
|
1195
|
+
supportedChains: string[];
|
|
1196
|
+
responseFormat?: Record<string, string>;
|
|
1103
1197
|
};
|
|
1104
1198
|
export type PrepareTopicCreateRequest = {
|
|
1105
|
-
|
|
1106
|
-
payerAccountId: string;
|
|
1199
|
+
payerAccountId?: string;
|
|
1107
1200
|
memo?: string;
|
|
1108
1201
|
adminKeyRequired?: boolean;
|
|
1109
1202
|
submitKeyRequired?: boolean;
|
|
1110
1203
|
entityId: string;
|
|
1111
1204
|
};
|
|
1112
1205
|
export type PrepareTopicMessageRequest = {
|
|
1113
|
-
|
|
1114
|
-
payerAccountId: string;
|
|
1206
|
+
payerAccountId?: string;
|
|
1115
1207
|
topicId: string;
|
|
1116
1208
|
message: string | Record<string, unknown>;
|
|
1117
1209
|
entityId: string;
|
|
1118
1210
|
};
|
|
1119
|
-
export type
|
|
1120
|
-
|
|
1121
|
-
payerAccountId: string;
|
|
1122
|
-
tokenId: string;
|
|
1123
|
-
entityId: string;
|
|
1124
|
-
memo?: string;
|
|
1125
|
-
};
|
|
1126
|
-
export type PrepareTokenUnpauseRequest = PrepareTokenPauseRequest;
|
|
1127
|
-
export type PrepareTokenRestrictRequest = {
|
|
1128
|
-
chain: "hedera";
|
|
1129
|
-
payerAccountId: string;
|
|
1211
|
+
export type PrepareTokenComplianceEnableRequest = {
|
|
1212
|
+
payerAccountId?: string;
|
|
1130
1213
|
tokenId: string;
|
|
1131
1214
|
accountId: string;
|
|
1132
1215
|
entityId: string;
|
|
1216
|
+
securityMode?: SecurityMode;
|
|
1217
|
+
appOwnerPublicKey?: string;
|
|
1133
1218
|
memo?: string;
|
|
1134
1219
|
};
|
|
1135
|
-
export type
|
|
1136
|
-
export type PrepareTokenComplianceEnableRequest = PrepareTokenRestrictRequest;
|
|
1137
|
-
export type PrepareTokenComplianceDisableRequest = PrepareTokenRestrictRequest;
|
|
1220
|
+
export type PrepareTokenComplianceDisableRequest = PrepareTokenComplianceEnableRequest;
|
|
1138
1221
|
export type PrepareTokenWipeRequest = {
|
|
1139
|
-
|
|
1140
|
-
payerAccountId: string;
|
|
1222
|
+
payerAccountId?: string;
|
|
1141
1223
|
tokenId: string;
|
|
1142
1224
|
accountId: string;
|
|
1143
1225
|
amount: string;
|
|
1144
1226
|
entityId: string;
|
|
1145
1227
|
memo?: string;
|
|
1146
1228
|
};
|
|
1229
|
+
declare class HederaTransactionsClient {
|
|
1230
|
+
private readonly http;
|
|
1231
|
+
constructor(http: HttpClient);
|
|
1232
|
+
prepareTopicCreate(request: PrepareTopicCreateRequest): Promise<PreparedTransaction>;
|
|
1233
|
+
prepareTopicMessage(request: PrepareTopicMessageRequest): Promise<PreparedTransaction>;
|
|
1234
|
+
prepareTokenComplianceEnable(request: PrepareTokenComplianceEnableRequest): Promise<PreparedTransaction>;
|
|
1235
|
+
prepareTokenComplianceDisable(request: PrepareTokenComplianceDisableRequest): Promise<PreparedTransaction>;
|
|
1236
|
+
prepareTokenWipe(request: PrepareTokenWipeRequest): Promise<PreparedTransaction>;
|
|
1237
|
+
}
|
|
1147
1238
|
export type PrepareTrustLineRequest = {
|
|
1148
|
-
|
|
1149
|
-
|
|
1239
|
+
accountAddress?: string;
|
|
1240
|
+
payerAccountId?: string;
|
|
1150
1241
|
currency: string;
|
|
1151
1242
|
issuerAddress: string;
|
|
1152
1243
|
limit?: string;
|
|
1153
1244
|
entityId: string;
|
|
1154
1245
|
};
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1246
|
+
declare class XrplTransactionsClient {
|
|
1247
|
+
private readonly http;
|
|
1248
|
+
constructor(http: HttpClient);
|
|
1249
|
+
prepareTrustLine(request: PrepareTrustLineRequest): Promise<PreparedTransaction>;
|
|
1250
|
+
}
|
|
1251
|
+
export type PrepareTokenCloseAccountRequest = {
|
|
1252
|
+
payerAccountId?: string;
|
|
1253
|
+
account: string;
|
|
1254
|
+
destination: string;
|
|
1255
|
+
owner?: string;
|
|
1256
|
+
entityId?: string;
|
|
1257
|
+
securityMode?: SecurityMode;
|
|
1258
|
+
appOwnerPublicKey?: string;
|
|
1259
|
+
memo?: string;
|
|
1260
|
+
};
|
|
1261
|
+
declare class SolanaTransactionsClient {
|
|
1262
|
+
private readonly http;
|
|
1263
|
+
constructor(http: HttpClient);
|
|
1264
|
+
prepareTokenCloseAccount(request: PrepareTokenCloseAccountRequest): Promise<PreparedTransaction>;
|
|
1265
|
+
}
|
|
1266
|
+
export type PrepareAssetSetTeamRequest = {
|
|
1267
|
+
payerAccountId?: string;
|
|
1268
|
+
assetId: number;
|
|
1269
|
+
issuer: string;
|
|
1270
|
+
admin: string;
|
|
1271
|
+
freezer: string;
|
|
1272
|
+
entityId?: string;
|
|
1273
|
+
securityMode?: SecurityMode;
|
|
1274
|
+
appOwnerPublicKey?: string;
|
|
1275
|
+
ss58Format?: number;
|
|
1161
1276
|
};
|
|
1277
|
+
export type PrepareAssetSetMetadataRequest = {
|
|
1278
|
+
payerAccountId?: string;
|
|
1279
|
+
assetId: number;
|
|
1280
|
+
name: string;
|
|
1281
|
+
symbol: string;
|
|
1282
|
+
decimals: number;
|
|
1283
|
+
entityId?: string;
|
|
1284
|
+
securityMode?: SecurityMode;
|
|
1285
|
+
appOwnerPublicKey?: string;
|
|
1286
|
+
ss58Format?: number;
|
|
1287
|
+
};
|
|
1288
|
+
declare class PolkadotTransactionsClient {
|
|
1289
|
+
private readonly http;
|
|
1290
|
+
constructor(http: HttpClient);
|
|
1291
|
+
prepareAssetSetTeam(request: PrepareAssetSetTeamRequest): Promise<PreparedTransaction>;
|
|
1292
|
+
prepareAssetSetMetadata(request: PrepareAssetSetMetadataRequest): Promise<PreparedTransaction>;
|
|
1293
|
+
}
|
|
1162
1294
|
declare class TransactionsClient {
|
|
1163
1295
|
private readonly http;
|
|
1164
1296
|
constructor(http: HttpClient);
|
|
@@ -1170,17 +1302,11 @@ declare class TransactionsClient {
|
|
|
1170
1302
|
prepareTokenCreate(request: PrepareTokenCreateRequest): Promise<PreparedTransaction>;
|
|
1171
1303
|
prepareTokenMint(request: PrepareTokenMintRequest): Promise<PreparedTransaction>;
|
|
1172
1304
|
prepareTokenBurn(request: PrepareTokenBurnRequest): Promise<PreparedTransaction>;
|
|
1173
|
-
|
|
1305
|
+
prepareTokenAssociate(request: PrepareTokenAssociateRequest): Promise<PreparedTransaction>;
|
|
1174
1306
|
prepareTokenPause(request: PrepareTokenPauseRequest): Promise<PreparedTransaction>;
|
|
1175
1307
|
prepareTokenUnpause(request: PrepareTokenUnpauseRequest): Promise<PreparedTransaction>;
|
|
1176
1308
|
prepareTokenRestrict(request: PrepareTokenRestrictRequest): Promise<PreparedTransaction>;
|
|
1177
1309
|
prepareTokenUnrestrict(request: PrepareTokenUnrestrictRequest): Promise<PreparedTransaction>;
|
|
1178
|
-
prepareTokenComplianceEnable(request: PrepareTokenComplianceEnableRequest): Promise<PreparedTransaction>;
|
|
1179
|
-
prepareTokenComplianceDisable(request: PrepareTokenComplianceDisableRequest): Promise<PreparedTransaction>;
|
|
1180
|
-
prepareTokenWipe(request: PrepareTokenWipeRequest): Promise<PreparedTransaction>;
|
|
1181
|
-
prepareTopicCreate(request: PrepareTopicCreateRequest): Promise<PreparedTransaction>;
|
|
1182
|
-
prepareTopicMessage(request: PrepareTopicMessageRequest): Promise<PreparedTransaction>;
|
|
1183
|
-
prepareTrustLine(request: PrepareTrustLineRequest): Promise<PreparedTransaction>;
|
|
1184
1310
|
}
|
|
1185
1311
|
export type SnapshotStatus = "pending" | "generating" | "completed" | "failed";
|
|
1186
1312
|
export type SnapshotFormat = "json" | "csv";
|
|
@@ -1411,769 +1537,914 @@ declare class PersonhoodClient {
|
|
|
1411
1537
|
constructor(http: HttpClient);
|
|
1412
1538
|
verify(params: PersonhoodVerifyParams): Promise<PersonhoodCert | null>;
|
|
1413
1539
|
}
|
|
1414
|
-
export
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
registryTopicId: string;
|
|
1425
|
-
chain: AuthChain;
|
|
1426
|
-
address: string;
|
|
1427
|
-
publicKey: string;
|
|
1428
|
-
signFn: (challenge: string) => string | Promise<string>;
|
|
1429
|
-
metadata?: {
|
|
1430
|
-
appId?: string;
|
|
1431
|
-
appName?: string;
|
|
1432
|
-
};
|
|
1433
|
-
mirrorNodeUrl?: string;
|
|
1434
|
-
allowInsecure?: boolean;
|
|
1435
|
-
}
|
|
1436
|
-
export interface ClusterConnectionConfig {
|
|
1437
|
-
bootstrap: string[];
|
|
1438
|
-
chain: AuthChain;
|
|
1439
|
-
address: string;
|
|
1440
|
-
publicKey: string;
|
|
1441
|
-
signFn: (challenge: string) => string | Promise<string>;
|
|
1442
|
-
metadata?: {
|
|
1443
|
-
appId?: string;
|
|
1444
|
-
appName?: string;
|
|
1445
|
-
};
|
|
1446
|
-
trustAnchor?: {
|
|
1447
|
-
network: "mainnet" | "testnet" | "previewnet";
|
|
1448
|
-
registryTopicId: string;
|
|
1449
|
-
mirrorNodeUrl?: string;
|
|
1540
|
+
export type AgentStatus = "active" | "paused" | "revoked" | "pending";
|
|
1541
|
+
export type AgentRegisterRequest = {
|
|
1542
|
+
name: string;
|
|
1543
|
+
description?: string;
|
|
1544
|
+
capabilities: string[];
|
|
1545
|
+
rules: AgentRules;
|
|
1546
|
+
fundingConfig?: {
|
|
1547
|
+
chain: string;
|
|
1548
|
+
maxAmount: string;
|
|
1549
|
+
autoFund: boolean;
|
|
1450
1550
|
};
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1551
|
+
};
|
|
1552
|
+
export type AgentRules = {
|
|
1553
|
+
maxTradeAmount?: string;
|
|
1554
|
+
allowedPairs?: string[];
|
|
1555
|
+
allowedChains?: string[];
|
|
1556
|
+
dailyLimit?: string;
|
|
1557
|
+
requireApprovalAbove?: string;
|
|
1558
|
+
customRules?: Record<string, unknown>;
|
|
1559
|
+
};
|
|
1560
|
+
export type AgentInfo = {
|
|
1561
|
+
agentId: string;
|
|
1562
|
+
name: string;
|
|
1563
|
+
description?: string;
|
|
1564
|
+
status: AgentStatus;
|
|
1565
|
+
capabilities: string[];
|
|
1566
|
+
rules: AgentRules;
|
|
1567
|
+
owner: string;
|
|
1568
|
+
createdAt: string;
|
|
1569
|
+
lastActiveAt?: string;
|
|
1570
|
+
};
|
|
1571
|
+
export type AgentEvent = {
|
|
1572
|
+
eventId: string;
|
|
1573
|
+
agentId: string;
|
|
1574
|
+
type: string;
|
|
1575
|
+
data: Record<string, unknown>;
|
|
1576
|
+
timestamp: string;
|
|
1577
|
+
};
|
|
1578
|
+
export type AgentBalance = {
|
|
1579
|
+
chain: string;
|
|
1580
|
+
accountId: string;
|
|
1581
|
+
balance: string;
|
|
1582
|
+
symbol: string;
|
|
1583
|
+
};
|
|
1584
|
+
export type AgentFundRequest = {
|
|
1585
|
+
chain: string;
|
|
1586
|
+
amount: string;
|
|
1587
|
+
source?: string;
|
|
1588
|
+
};
|
|
1589
|
+
export type AgentTradeRequest = {
|
|
1590
|
+
chain: string;
|
|
1591
|
+
pair: string;
|
|
1592
|
+
side: "buy" | "sell";
|
|
1593
|
+
amount: string;
|
|
1594
|
+
price?: string;
|
|
1595
|
+
};
|
|
1596
|
+
export type AgentWithdrawRequest = {
|
|
1597
|
+
chain: string;
|
|
1598
|
+
amount: string;
|
|
1599
|
+
destination: string;
|
|
1600
|
+
};
|
|
1601
|
+
declare class AgentsClient {
|
|
1466
1602
|
private readonly http;
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
readonly snapshots: SnapshotsClient;
|
|
1474
|
-
readonly historicalBalance: HistoricalBalanceClient;
|
|
1475
|
-
readonly settlement: SettlementClient;
|
|
1476
|
-
readonly governance: GovernanceClient;
|
|
1477
|
-
readonly personhood: PersonhoodClient;
|
|
1478
|
-
constructor(config: SmartEngineClientConfig);
|
|
1479
|
-
static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
|
|
1480
|
-
static connectToCluster(config: ClusterConnectionConfig): Promise<ClusterConnectionResult>;
|
|
1481
|
-
getBaseUrl(): string;
|
|
1482
|
-
isAuthenticated(): boolean;
|
|
1483
|
-
getHttpHealth(): {
|
|
1484
|
-
breaker: CircuitBreakerSnapshot | null;
|
|
1485
|
-
lastError?: Error;
|
|
1486
|
-
};
|
|
1487
|
-
getHealth(): Promise<{
|
|
1488
|
-
status: string;
|
|
1489
|
-
timestamp: string;
|
|
1490
|
-
chains: any[];
|
|
1491
|
-
}>;
|
|
1492
|
-
getSupportedChains(): Promise<{
|
|
1493
|
-
chains: string[];
|
|
1603
|
+
constructor(http: HttpClient);
|
|
1604
|
+
register(request: AgentRegisterRequest): Promise<AgentInfo>;
|
|
1605
|
+
get(agentId: string): Promise<AgentInfo>;
|
|
1606
|
+
list(): Promise<{
|
|
1607
|
+
agents: AgentInfo[];
|
|
1608
|
+
total: number;
|
|
1494
1609
|
}>;
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
enableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
1510
|
-
disableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
1511
|
-
wipeFromAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
1512
|
-
getAllCapabilities(): Promise<any>;
|
|
1513
|
-
getChainCapabilities(chain: ChainType): Promise<any>;
|
|
1514
|
-
getSystemStatus(): Promise<any>;
|
|
1515
|
-
submitMessage(chain: string, topicId: string, message: string): Promise<any>;
|
|
1516
|
-
getClusterHealth(): Promise<{
|
|
1610
|
+
fund(agentId: string, request: AgentFundRequest): Promise<{
|
|
1611
|
+
success: boolean;
|
|
1612
|
+
txId?: string;
|
|
1613
|
+
}>;
|
|
1614
|
+
trade(agentId: string, request: AgentTradeRequest): Promise<{
|
|
1615
|
+
success: boolean;
|
|
1616
|
+
txId?: string;
|
|
1617
|
+
}>;
|
|
1618
|
+
withdraw(agentId: string, request: AgentWithdrawRequest): Promise<{
|
|
1619
|
+
success: boolean;
|
|
1620
|
+
txId?: string;
|
|
1621
|
+
}>;
|
|
1622
|
+
pause(agentId: string): Promise<{
|
|
1623
|
+
success: boolean;
|
|
1517
1624
|
status: string;
|
|
1518
|
-
nodes: number;
|
|
1519
|
-
healthy: number;
|
|
1520
|
-
unhealthy: number;
|
|
1521
1625
|
}>;
|
|
1522
|
-
|
|
1626
|
+
resume(agentId: string): Promise<{
|
|
1627
|
+
success: boolean;
|
|
1523
1628
|
status: string;
|
|
1524
|
-
nodeId: string;
|
|
1525
|
-
nodes: Array<{
|
|
1526
|
-
nodeId: string;
|
|
1527
|
-
endpoint: string;
|
|
1528
|
-
status: string;
|
|
1529
|
-
lastSeen?: string;
|
|
1530
|
-
}>;
|
|
1531
|
-
quorum: {
|
|
1532
|
-
required: number;
|
|
1533
|
-
current: number;
|
|
1534
|
-
reached: boolean;
|
|
1535
|
-
};
|
|
1536
1629
|
}>;
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
pending: number;
|
|
1541
|
-
processing: number;
|
|
1542
|
-
completed: number;
|
|
1543
|
-
failed: number;
|
|
1544
|
-
}>;
|
|
1545
|
-
timestamp: string;
|
|
1630
|
+
revoke(agentId: string): Promise<{
|
|
1631
|
+
success: boolean;
|
|
1632
|
+
status: string;
|
|
1546
1633
|
}>;
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
successes: number;
|
|
1552
|
-
lastFailure?: string;
|
|
1553
|
-
nextRetry?: string;
|
|
1554
|
-
}>;
|
|
1555
|
-
timestamp: string;
|
|
1634
|
+
updateRules(agentId: string, rules: Partial<AgentRules>): Promise<AgentInfo>;
|
|
1635
|
+
getEvents(agentId: string): Promise<{
|
|
1636
|
+
events: AgentEvent[];
|
|
1637
|
+
total: number;
|
|
1556
1638
|
}>;
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1639
|
+
getBalances(agentId: string): Promise<{
|
|
1640
|
+
balances: AgentBalance[];
|
|
1641
|
+
}>;
|
|
1642
|
+
approve(agentId: string, operationId: string): Promise<{
|
|
1643
|
+
success: boolean;
|
|
1644
|
+
}>;
|
|
1645
|
+
reject(agentId: string, operationId: string): Promise<{
|
|
1646
|
+
success: boolean;
|
|
1565
1647
|
}>;
|
|
1566
1648
|
}
|
|
1567
|
-
export type
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1649
|
+
export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging";
|
|
1650
|
+
export type BaasSupportedChain = "hedera" | "xrpl" | "polkadot" | "solana";
|
|
1651
|
+
export type BaasEndpoints = {
|
|
1652
|
+
auth: string;
|
|
1653
|
+
database: string;
|
|
1654
|
+
storage: string;
|
|
1655
|
+
functions: string;
|
|
1656
|
+
messaging: string;
|
|
1572
1657
|
};
|
|
1573
|
-
export type
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
domains: {
|
|
1581
|
-
total: number;
|
|
1582
|
-
verified: number;
|
|
1583
|
-
};
|
|
1584
|
-
uptime: number;
|
|
1658
|
+
export type DeployedAppInfo = {
|
|
1659
|
+
appId: string;
|
|
1660
|
+
name: string;
|
|
1661
|
+
status: "active" | "inactive" | "deploying" | "error";
|
|
1662
|
+
services: string[];
|
|
1663
|
+
endpoints: BaasEndpoints;
|
|
1664
|
+
createdAt: string;
|
|
1585
1665
|
};
|
|
1586
|
-
export type
|
|
1587
|
-
|
|
1588
|
-
|
|
1666
|
+
export type BaasAuthConfig = {
|
|
1667
|
+
chain: BaasSupportedChain;
|
|
1668
|
+
walletAddress: string;
|
|
1669
|
+
publicKey: string;
|
|
1670
|
+
signFn: (message: string) => string | Promise<string>;
|
|
1589
1671
|
};
|
|
1590
|
-
export type
|
|
1591
|
-
|
|
1592
|
-
|
|
1672
|
+
export type BaasClientConfig = {
|
|
1673
|
+
hostUrl: string;
|
|
1674
|
+
appId?: string;
|
|
1675
|
+
appName?: string;
|
|
1676
|
+
auth?: BaasAuthConfig;
|
|
1677
|
+
services?: BaasService[];
|
|
1678
|
+
timeout?: number;
|
|
1679
|
+
allowInsecure?: boolean;
|
|
1680
|
+
http?: ResilientHttpConfig;
|
|
1681
|
+
pathPrefix?: string;
|
|
1593
1682
|
};
|
|
1594
|
-
export type
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
hosts: {
|
|
1602
|
-
total: number;
|
|
1603
|
-
healthy: number;
|
|
1604
|
-
unhealthy: number;
|
|
1605
|
-
};
|
|
1606
|
-
bandwidth: {
|
|
1607
|
-
inbound: number;
|
|
1608
|
-
outbound: number;
|
|
1609
|
-
};
|
|
1610
|
-
timestamp: string;
|
|
1683
|
+
export type BaasAuthResult = {
|
|
1684
|
+
authenticated?: boolean;
|
|
1685
|
+
walletAddress: string;
|
|
1686
|
+
chain: BaasSupportedChain;
|
|
1687
|
+
appId: string;
|
|
1688
|
+
token: string;
|
|
1689
|
+
expiresAt: number;
|
|
1611
1690
|
};
|
|
1612
|
-
export type
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1691
|
+
export type BaasSessionInfo = {
|
|
1692
|
+
valid: boolean;
|
|
1693
|
+
walletAddress?: string;
|
|
1694
|
+
chain?: BaasSupportedChain;
|
|
1695
|
+
appId?: string;
|
|
1696
|
+
permissions?: string[];
|
|
1697
|
+
sessionId?: string;
|
|
1698
|
+
expiresAt?: number;
|
|
1699
|
+
error?: string;
|
|
1616
1700
|
};
|
|
1617
|
-
export type
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1701
|
+
export type BaasDocument = {
|
|
1702
|
+
_id: string;
|
|
1703
|
+
data: Record<string, unknown>;
|
|
1704
|
+
createdAt: number;
|
|
1705
|
+
updatedAt: number;
|
|
1706
|
+
version: number;
|
|
1622
1707
|
};
|
|
1623
|
-
export type
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1708
|
+
export type BaasStateTransition = {
|
|
1709
|
+
transitionId: string;
|
|
1710
|
+
operation: "insert" | "update" | "delete";
|
|
1711
|
+
collection: string;
|
|
1712
|
+
documentId: string;
|
|
1713
|
+
previousHash: string;
|
|
1714
|
+
newHash: string;
|
|
1715
|
+
stateRoot: string;
|
|
1716
|
+
timestamp: number;
|
|
1717
|
+
proof: BaasMerkleProof;
|
|
1633
1718
|
};
|
|
1634
|
-
export type
|
|
1635
|
-
|
|
1636
|
-
|
|
1719
|
+
export type BaasMerkleProof = {
|
|
1720
|
+
root: string;
|
|
1721
|
+
leaf: string;
|
|
1722
|
+
siblings: string[];
|
|
1723
|
+
path: ("left" | "right")[];
|
|
1637
1724
|
};
|
|
1638
|
-
export type
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
timeout?: number;
|
|
1642
|
-
retries?: number;
|
|
1643
|
-
weights?: Record<string, number>;
|
|
1725
|
+
export type BaasInsertResult = {
|
|
1726
|
+
document: BaasDocument;
|
|
1727
|
+
stateTransition: BaasStateTransition;
|
|
1644
1728
|
};
|
|
1645
|
-
export type
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
path: string;
|
|
1649
|
-
headers?: Record<string, string>;
|
|
1650
|
-
body?: unknown;
|
|
1729
|
+
export type BaasUpdateResult = {
|
|
1730
|
+
document: BaasDocument;
|
|
1731
|
+
stateTransition: BaasStateTransition;
|
|
1651
1732
|
};
|
|
1652
|
-
export type
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
body: unknown;
|
|
1656
|
-
hostId: string;
|
|
1657
|
-
latencyMs: number;
|
|
1733
|
+
export type BaasDeleteResult = {
|
|
1734
|
+
deleted: boolean;
|
|
1735
|
+
stateTransition: BaasStateTransition;
|
|
1658
1736
|
};
|
|
1659
|
-
export type
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
requests: number;
|
|
1665
|
-
errors: number;
|
|
1666
|
-
avgLatencyMs: number;
|
|
1667
|
-
}>;
|
|
1737
|
+
export type BaasQueryOptions = {
|
|
1738
|
+
limit?: number;
|
|
1739
|
+
skip?: number;
|
|
1740
|
+
sort?: string;
|
|
1741
|
+
projection?: Record<string, 0 | 1>;
|
|
1668
1742
|
};
|
|
1669
|
-
export type
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1743
|
+
export type BaasFindResult = {
|
|
1744
|
+
documents: BaasDocument[];
|
|
1745
|
+
count: number;
|
|
1746
|
+
limit: number;
|
|
1747
|
+
skip: number;
|
|
1674
1748
|
};
|
|
1675
|
-
export type
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
registrar?: string;
|
|
1681
|
-
expiresAt?: string;
|
|
1682
|
-
createdAt: string;
|
|
1683
|
-
dnsConfigured: boolean;
|
|
1684
|
-
dnssecEnabled: boolean;
|
|
1749
|
+
export type BaasFileMetadata = {
|
|
1750
|
+
filename?: string;
|
|
1751
|
+
mimeType?: string;
|
|
1752
|
+
tags?: Record<string, string>;
|
|
1753
|
+
encrypted?: boolean;
|
|
1685
1754
|
};
|
|
1686
|
-
export type
|
|
1687
|
-
|
|
1688
|
-
|
|
1755
|
+
export type BaasUploadResult = {
|
|
1756
|
+
cid: string;
|
|
1757
|
+
size: number;
|
|
1758
|
+
mimeType: string;
|
|
1759
|
+
uploadedAt: string;
|
|
1760
|
+
filename?: string;
|
|
1761
|
+
encrypted?: boolean;
|
|
1689
1762
|
};
|
|
1690
|
-
export type
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1763
|
+
export type BaasFileInfo = {
|
|
1764
|
+
cid: string;
|
|
1765
|
+
filename?: string;
|
|
1766
|
+
size: number;
|
|
1767
|
+
mimeType?: string;
|
|
1768
|
+
uploadedAt: string;
|
|
1769
|
+
lastAccessedAt?: string;
|
|
1770
|
+
tags?: Record<string, string>;
|
|
1696
1771
|
};
|
|
1697
|
-
export type
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
instructions: string;
|
|
1701
|
-
expiresAt: string;
|
|
1772
|
+
export type BaasStorageUsage = {
|
|
1773
|
+
totalSize: number;
|
|
1774
|
+
fileCount: number;
|
|
1702
1775
|
};
|
|
1703
|
-
export type
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1776
|
+
export type BaasFunctionRuntime = "nodejs20" | "python3" | "deno";
|
|
1777
|
+
export type BaasTriggerType = "http" | "schedule" | "event" | "webhook";
|
|
1778
|
+
export type BaasFunctionResources = {
|
|
1779
|
+
memory: string;
|
|
1780
|
+
timeout: number;
|
|
1781
|
+
maxConcurrency?: number;
|
|
1709
1782
|
};
|
|
1710
|
-
export type
|
|
1711
|
-
type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SRV" | "CAA";
|
|
1783
|
+
export type BaasFunctionDeployRequest = {
|
|
1712
1784
|
name: string;
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1785
|
+
description?: string;
|
|
1786
|
+
runtime: BaasFunctionRuntime;
|
|
1787
|
+
code: string;
|
|
1788
|
+
codeType: "inline" | "ipfs";
|
|
1789
|
+
entryPoint?: string;
|
|
1790
|
+
triggers?: Array<{
|
|
1791
|
+
type: BaasTriggerType;
|
|
1792
|
+
config: Record<string, unknown>;
|
|
1793
|
+
}>;
|
|
1794
|
+
resources?: Partial<BaasFunctionResources>;
|
|
1795
|
+
environment?: Record<string, string>;
|
|
1716
1796
|
};
|
|
1717
|
-
export type
|
|
1718
|
-
|
|
1719
|
-
|
|
1797
|
+
export type BaasFunctionDeployResult = {
|
|
1798
|
+
functionId: string;
|
|
1799
|
+
version: number;
|
|
1800
|
+
deployedAt: string;
|
|
1801
|
+
endpoints?: string[];
|
|
1802
|
+
status: "active" | "deploying" | "failed";
|
|
1803
|
+
error?: string;
|
|
1720
1804
|
};
|
|
1721
|
-
export type
|
|
1805
|
+
export type BaasFunctionResult = {
|
|
1806
|
+
requestId: string;
|
|
1807
|
+
functionId: string;
|
|
1808
|
+
status: "success" | "error" | "timeout";
|
|
1809
|
+
result?: unknown;
|
|
1810
|
+
error?: string;
|
|
1811
|
+
logs?: string[];
|
|
1812
|
+
duration: number;
|
|
1813
|
+
memoryUsed?: number;
|
|
1814
|
+
};
|
|
1815
|
+
export type BaasFunctionInfo = {
|
|
1816
|
+
functionId: string;
|
|
1722
1817
|
name: string;
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1818
|
+
runtime: BaasFunctionRuntime;
|
|
1819
|
+
version: number;
|
|
1820
|
+
status: "active" | "inactive" | "error";
|
|
1821
|
+
deployedAt: string;
|
|
1822
|
+
lastInvokedAt?: string;
|
|
1823
|
+
invocationCount: number;
|
|
1824
|
+
};
|
|
1825
|
+
export type BaasFunctionLog = {
|
|
1826
|
+
timestamp: string;
|
|
1827
|
+
level: "debug" | "info" | "warn" | "error";
|
|
1828
|
+
message: string;
|
|
1829
|
+
requestId?: string;
|
|
1830
|
+
metadata?: Record<string, unknown>;
|
|
1831
|
+
};
|
|
1832
|
+
export type BaasFunctionLogOptions = {
|
|
1833
|
+
startTime?: string;
|
|
1834
|
+
endTime?: string;
|
|
1835
|
+
limit?: number;
|
|
1836
|
+
level?: "debug" | "info" | "warn" | "error";
|
|
1837
|
+
requestId?: string;
|
|
1838
|
+
};
|
|
1839
|
+
export type BaasMessage = {
|
|
1840
|
+
messageId: string;
|
|
1841
|
+
channel: string;
|
|
1842
|
+
data: Record<string, unknown>;
|
|
1843
|
+
sender?: string;
|
|
1729
1844
|
timestamp: string;
|
|
1845
|
+
metadata?: Record<string, unknown>;
|
|
1730
1846
|
};
|
|
1731
|
-
export type
|
|
1847
|
+
export type BaasChannelConfig = {
|
|
1732
1848
|
name: string;
|
|
1733
|
-
|
|
1849
|
+
persistent?: boolean;
|
|
1850
|
+
maxHistoryLength?: number;
|
|
1851
|
+
presence?: boolean;
|
|
1852
|
+
authRequired?: boolean;
|
|
1734
1853
|
};
|
|
1735
|
-
export type
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1854
|
+
export type BaasPresenceMember = {
|
|
1855
|
+
clientId: string;
|
|
1856
|
+
walletAddress?: string;
|
|
1857
|
+
joinedAt: string;
|
|
1858
|
+
lastSeenAt: string;
|
|
1859
|
+
metadata?: Record<string, unknown>;
|
|
1741
1860
|
};
|
|
1742
|
-
export type
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
dnssecEnabled: boolean;
|
|
1747
|
-
createdAt: string;
|
|
1748
|
-
updatedAt: string;
|
|
1861
|
+
export type BaasPresenceInfo = {
|
|
1862
|
+
channel: string;
|
|
1863
|
+
members: BaasPresenceMember[];
|
|
1864
|
+
totalCount: number;
|
|
1749
1865
|
};
|
|
1750
|
-
export type
|
|
1751
|
-
|
|
1752
|
-
|
|
1866
|
+
export type BaasHistoryOptions = {
|
|
1867
|
+
limit?: number;
|
|
1868
|
+
before?: string;
|
|
1869
|
+
after?: string;
|
|
1870
|
+
startTime?: string;
|
|
1871
|
+
endTime?: string;
|
|
1753
1872
|
};
|
|
1754
|
-
export type
|
|
1755
|
-
|
|
1756
|
-
|
|
1873
|
+
export type BaasPublishResult = {
|
|
1874
|
+
messageId: string;
|
|
1875
|
+
channel: string;
|
|
1876
|
+
timestamp: string;
|
|
1877
|
+
};
|
|
1878
|
+
export type BaasInitRequest = {
|
|
1757
1879
|
name: string;
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1880
|
+
port: number;
|
|
1881
|
+
services: BaasService[];
|
|
1882
|
+
limits?: {
|
|
1883
|
+
cpu?: string;
|
|
1884
|
+
memory?: string;
|
|
1885
|
+
};
|
|
1763
1886
|
};
|
|
1764
|
-
export type
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1887
|
+
export type BaasInitResponse = {
|
|
1888
|
+
appId: string;
|
|
1889
|
+
registry: {
|
|
1890
|
+
server: string;
|
|
1891
|
+
username: string;
|
|
1892
|
+
password: string;
|
|
1893
|
+
repository: string;
|
|
1894
|
+
};
|
|
1771
1895
|
};
|
|
1772
|
-
export type
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1896
|
+
export type BaasDeployRequest = {
|
|
1897
|
+
tag: string;
|
|
1898
|
+
port?: number;
|
|
1899
|
+
replicas?: number;
|
|
1900
|
+
env?: Record<string, string>;
|
|
1901
|
+
resources?: {
|
|
1902
|
+
cpu?: string;
|
|
1903
|
+
memory?: string;
|
|
1904
|
+
};
|
|
1905
|
+
strategy?: "rolling" | "recreate";
|
|
1777
1906
|
};
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1907
|
+
export type BaasDeployResponse = {
|
|
1908
|
+
appId: string;
|
|
1909
|
+
status: string;
|
|
1910
|
+
url: string;
|
|
1911
|
+
};
|
|
1912
|
+
export type BaasUploadFrontendResponse = {
|
|
1913
|
+
bundleSha256: string;
|
|
1914
|
+
bundleSizeBytes: number;
|
|
1915
|
+
};
|
|
1916
|
+
export type BaasRollbackRequest = {
|
|
1917
|
+
toTag: string;
|
|
1918
|
+
};
|
|
1919
|
+
export type BaasRuntimeStatus = {
|
|
1920
|
+
appId: string;
|
|
1921
|
+
state: "PENDING_SUBSCRIPTION" | "ACTIVE" | "SUSPENDED" | "RETIRED";
|
|
1922
|
+
runtime?: {
|
|
1923
|
+
image: string;
|
|
1924
|
+
runtimeState: "NOT_DEPLOYED" | "DEPLOYING" | "RUNNING" | "FAILED" | "DEGRADED";
|
|
1925
|
+
replicas: number;
|
|
1926
|
+
lastReconciledAt?: string;
|
|
1927
|
+
lastError?: string;
|
|
1928
|
+
};
|
|
1929
|
+
};
|
|
1930
|
+
export type BaasAppListResponse = {
|
|
1931
|
+
apps: DeployedAppInfo[];
|
|
1932
|
+
};
|
|
1933
|
+
declare class DeploymentClient {
|
|
1803
1934
|
private readonly http;
|
|
1804
1935
|
constructor(http: HttpClient);
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
}>;
|
|
1815
|
-
enableDnssec(domain: string): Promise<{
|
|
1816
|
-
success: boolean;
|
|
1817
|
-
message: string;
|
|
1818
|
-
}>;
|
|
1819
|
-
disableDnssec(domain: string): Promise<{
|
|
1820
|
-
success: boolean;
|
|
1821
|
-
message: string;
|
|
1822
|
-
}>;
|
|
1823
|
-
renew(domain: string, years?: number): Promise<DomainInfo>;
|
|
1824
|
-
transfer(domain: string, request: DomainTransferRequest): Promise<{
|
|
1825
|
-
success: boolean;
|
|
1826
|
-
message: string;
|
|
1827
|
-
}>;
|
|
1828
|
-
approveTransfer(domain: string): Promise<{
|
|
1829
|
-
success: boolean;
|
|
1830
|
-
}>;
|
|
1831
|
-
rejectTransfer(domain: string): Promise<{
|
|
1832
|
-
success: boolean;
|
|
1833
|
-
}>;
|
|
1834
|
-
suspend(domain: string, reason: string): Promise<{
|
|
1835
|
-
success: boolean;
|
|
1836
|
-
}>;
|
|
1837
|
-
unsuspend(domain: string): Promise<{
|
|
1936
|
+
init(request: BaasInitRequest): Promise<BaasInitResponse>;
|
|
1937
|
+
uploadFrontend(appId: string, bundle: Blob | Buffer, filename?: string): Promise<BaasUploadFrontendResponse>;
|
|
1938
|
+
deploy(appId: string, request: BaasDeployRequest): Promise<BaasDeployResponse>;
|
|
1939
|
+
rollback(appId: string, request: BaasRollbackRequest): Promise<BaasDeployResponse>;
|
|
1940
|
+
status(appId: string): Promise<BaasRuntimeStatus>;
|
|
1941
|
+
list(): Promise<BaasAppListResponse>;
|
|
1942
|
+
get(appId: string): Promise<DeployedAppInfo>;
|
|
1943
|
+
update(appId: string, updates: Partial<BaasDeployRequest>): Promise<DeployedAppInfo>;
|
|
1944
|
+
delete(appId: string): Promise<{
|
|
1838
1945
|
success: boolean;
|
|
1839
1946
|
}>;
|
|
1840
|
-
|
|
1841
|
-
declare class DnsClient {
|
|
1842
|
-
private readonly http;
|
|
1843
|
-
constructor(http: HttpClient);
|
|
1844
|
-
resolve(name: string, type?: string, dnssec?: boolean): Promise<DnsResolveResponse>;
|
|
1845
|
-
resolveBatch(queries: DnsBatchQuery[]): Promise<DnsBatchResolveResponse>;
|
|
1846
|
-
listZones(): Promise<DnsZoneListResponse>;
|
|
1847
|
-
getZone(zoneName: string): Promise<DnsZone & {
|
|
1848
|
-
records: DnsRecordInfo[];
|
|
1849
|
-
}>;
|
|
1850
|
-
createZone(request: {
|
|
1851
|
-
zoneName: string;
|
|
1852
|
-
description?: string;
|
|
1853
|
-
}): Promise<DnsZone>;
|
|
1854
|
-
deleteZone(zoneName: string): Promise<{
|
|
1947
|
+
suspend(appId: string): Promise<{
|
|
1855
1948
|
success: boolean;
|
|
1949
|
+
status: string;
|
|
1856
1950
|
}>;
|
|
1857
|
-
|
|
1858
|
-
updateRecord(zoneName: string, recordId: string, updates: Partial<DnsRecord>): Promise<DnsRecordInfo>;
|
|
1859
|
-
deleteRecord(zoneName: string, recordId: string): Promise<{
|
|
1951
|
+
resume(appId: string): Promise<{
|
|
1860
1952
|
success: boolean;
|
|
1953
|
+
status: string;
|
|
1861
1954
|
}>;
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
keys: DnssecKey[];
|
|
1867
|
-
}>;
|
|
1868
|
-
getDsRecord(zoneName: string): Promise<DnssecDsRecord>;
|
|
1869
|
-
clearCache(): Promise<{
|
|
1870
|
-
success: boolean;
|
|
1871
|
-
entriesCleared: number;
|
|
1955
|
+
getStats(): Promise<{
|
|
1956
|
+
totalApps: number;
|
|
1957
|
+
activeApps: number;
|
|
1958
|
+
totalOwners: number;
|
|
1872
1959
|
}>;
|
|
1873
1960
|
}
|
|
1874
|
-
export
|
|
1961
|
+
export interface SmartEngineClientConfig {
|
|
1875
1962
|
baseUrl: string;
|
|
1876
1963
|
apiKey?: string;
|
|
1877
1964
|
authToken?: string;
|
|
1878
1965
|
timeout?: number;
|
|
1879
1966
|
allowInsecure?: boolean;
|
|
1880
|
-
|
|
1881
|
-
declare class SmartGatewayClient {
|
|
1882
|
-
private readonly http;
|
|
1883
|
-
readonly routing: RoutingClient;
|
|
1884
|
-
readonly domains: DomainsClient;
|
|
1885
|
-
readonly dns: DnsClient;
|
|
1886
|
-
constructor(config: SmartGatewayClientConfig);
|
|
1887
|
-
getHealth(): Promise<GatewayHealthResponse>;
|
|
1888
|
-
getStatus(): Promise<GatewayStatusResponse>;
|
|
1889
|
-
getReadiness(): Promise<GatewayReadinessResponse>;
|
|
1890
|
-
getLiveness(): Promise<GatewayLivenessResponse>;
|
|
1891
|
-
getMetrics(refresh?: boolean): Promise<GatewayMetricsResponse>;
|
|
1892
|
-
getMetricsSummary(): Promise<GatewayMetricsSummaryResponse>;
|
|
1967
|
+
http?: ResilientHttpConfig;
|
|
1893
1968
|
}
|
|
1894
|
-
export
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
storage: string;
|
|
1900
|
-
functions: string;
|
|
1901
|
-
messaging: string;
|
|
1902
|
-
};
|
|
1903
|
-
export type DeployedAppInfo = {
|
|
1904
|
-
appId: string;
|
|
1905
|
-
name: string;
|
|
1906
|
-
status: "active" | "inactive" | "deploying" | "error";
|
|
1907
|
-
services: string[];
|
|
1908
|
-
endpoints: BaasEndpoints;
|
|
1909
|
-
createdAt: string;
|
|
1910
|
-
};
|
|
1911
|
-
export type BaasAuthConfig = {
|
|
1912
|
-
chain: BaasSupportedChain;
|
|
1913
|
-
walletAddress: string;
|
|
1969
|
+
export interface NetworkConnectionConfig {
|
|
1970
|
+
network: "mainnet" | "testnet" | "previewnet";
|
|
1971
|
+
registryTopicId: string;
|
|
1972
|
+
chain: AuthChain;
|
|
1973
|
+
address: string;
|
|
1914
1974
|
publicKey: string;
|
|
1915
|
-
signFn: (
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
auth?: BaasAuthConfig;
|
|
1922
|
-
services?: BaasService[];
|
|
1923
|
-
timeout?: number;
|
|
1975
|
+
signFn: (challenge: string) => string | Promise<string>;
|
|
1976
|
+
metadata?: {
|
|
1977
|
+
appId?: string;
|
|
1978
|
+
appName?: string;
|
|
1979
|
+
};
|
|
1980
|
+
mirrorNodeUrl?: string;
|
|
1924
1981
|
allowInsecure?: boolean;
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
};
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1982
|
+
}
|
|
1983
|
+
export interface ClusterConnectionConfig {
|
|
1984
|
+
bootstrap: string[];
|
|
1985
|
+
chain: AuthChain;
|
|
1986
|
+
address: string;
|
|
1987
|
+
publicKey: string;
|
|
1988
|
+
signFn: (challenge: string) => string | Promise<string>;
|
|
1989
|
+
metadata?: {
|
|
1990
|
+
appId?: string;
|
|
1991
|
+
appName?: string;
|
|
1992
|
+
};
|
|
1993
|
+
trustAnchor?: {
|
|
1994
|
+
network: "mainnet" | "testnet" | "previewnet";
|
|
1995
|
+
registryTopicId: string;
|
|
1996
|
+
mirrorNodeUrl?: string;
|
|
1997
|
+
};
|
|
1998
|
+
allowInsecure?: boolean;
|
|
1999
|
+
}
|
|
2000
|
+
export interface ClusterConnectionResult {
|
|
2001
|
+
client: SmartEngineClient;
|
|
2002
|
+
cluster: ClusterInfo;
|
|
2003
|
+
session: AuthenticateResponse;
|
|
2004
|
+
}
|
|
2005
|
+
export interface NetworkConnectionResult {
|
|
2006
|
+
client: SmartEngineClient;
|
|
2007
|
+
validator: ValidatorInfo;
|
|
2008
|
+
session: AuthenticateResponse;
|
|
2009
|
+
}
|
|
2010
|
+
declare class SmartEngineClient {
|
|
2011
|
+
private baseUrl;
|
|
2012
|
+
private allowInsecure;
|
|
2013
|
+
private readonly http;
|
|
2014
|
+
private readonly txHttp;
|
|
2015
|
+
private lastHttpError?;
|
|
2016
|
+
readonly subscription: SubscriptionClient;
|
|
2017
|
+
readonly tss: TSSClient;
|
|
2018
|
+
readonly ipfs: IPFSClient;
|
|
2019
|
+
readonly transactions: TransactionsClient;
|
|
2020
|
+
readonly hedera: HederaTransactionsClient;
|
|
2021
|
+
readonly xrpl: XrplTransactionsClient;
|
|
2022
|
+
readonly solana: SolanaTransactionsClient;
|
|
2023
|
+
readonly polkadot: PolkadotTransactionsClient;
|
|
2024
|
+
readonly snapshots: SnapshotsClient;
|
|
2025
|
+
readonly historicalBalance: HistoricalBalanceClient;
|
|
2026
|
+
readonly settlement: SettlementClient;
|
|
2027
|
+
readonly governance: GovernanceClient;
|
|
2028
|
+
readonly personhood: PersonhoodClient;
|
|
2029
|
+
readonly agents: AgentsClient;
|
|
2030
|
+
readonly deployments: DeploymentClient;
|
|
2031
|
+
constructor(config: SmartEngineClientConfig);
|
|
2032
|
+
static fromEnv(env: Record<string, string | undefined>): SmartEngineClient;
|
|
2033
|
+
static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
|
|
2034
|
+
static connectToCluster(config: ClusterConnectionConfig): Promise<ClusterConnectionResult>;
|
|
2035
|
+
getBaseUrl(): string;
|
|
2036
|
+
isAuthenticated(): boolean;
|
|
2037
|
+
getHttpHealth(): {
|
|
2038
|
+
breaker: CircuitBreakerSnapshot | null;
|
|
2039
|
+
lastError?: Error;
|
|
2040
|
+
};
|
|
2041
|
+
getHealth(): Promise<{
|
|
2042
|
+
status: string;
|
|
2043
|
+
timestamp: string;
|
|
2044
|
+
chains: any[];
|
|
2045
|
+
}>;
|
|
2046
|
+
getSupportedChains(): Promise<{
|
|
2047
|
+
chains: string[];
|
|
2048
|
+
}>;
|
|
2049
|
+
createAccount(request: CreateAccountRequest): Promise<CreateAccountResponse>;
|
|
2050
|
+
getAccountInfo(chain: string, accountId: string): Promise<AccountInfo>;
|
|
2051
|
+
getBalance(chain: string, accountId: string): Promise<AccountBalance>;
|
|
2052
|
+
transfer(request: TransferRequest): Promise<TransferResponse>;
|
|
2053
|
+
getTransaction(chain: string, txId: string): Promise<Transaction>;
|
|
2054
|
+
getTransactionReceipt(chain: string, txId: string): Promise<any>;
|
|
2055
|
+
createToken(request: CreateTokenRequest): Promise<CreateTokenResponse>;
|
|
2056
|
+
mintToken(request: MintTokenRequest): Promise<any>;
|
|
2057
|
+
getTokenInfo(chain: string, tokenId: string): Promise<TokenInfo>;
|
|
2058
|
+
burnToken(request: BurnTokenRequest): Promise<ActionResult>;
|
|
2059
|
+
pauseToken(request: TokenActionRequest): Promise<ActionResult>;
|
|
2060
|
+
unpauseToken(request: TokenActionRequest): Promise<ActionResult>;
|
|
2061
|
+
restrictAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
2062
|
+
unrestrictAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
2063
|
+
enableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
2064
|
+
disableCompliance(request: TokenActionRequest): Promise<ActionResult>;
|
|
2065
|
+
wipeFromAccount(request: TokenActionRequest): Promise<ActionResult>;
|
|
2066
|
+
getAllCapabilities(): Promise<any>;
|
|
2067
|
+
getChainCapabilities(chain: ChainType): Promise<any>;
|
|
2068
|
+
getSystemStatus(): Promise<any>;
|
|
2069
|
+
submitMessage(chain: string, topicId: string, message: string): Promise<any>;
|
|
2070
|
+
getClusterHealth(): Promise<{
|
|
2071
|
+
status: string;
|
|
2072
|
+
nodes: number;
|
|
2073
|
+
healthy: number;
|
|
2074
|
+
unhealthy: number;
|
|
2075
|
+
}>;
|
|
2076
|
+
getClusterStatus(): Promise<{
|
|
2077
|
+
status: string;
|
|
2078
|
+
nodeId: string;
|
|
2079
|
+
nodes: Array<{
|
|
2080
|
+
nodeId: string;
|
|
2081
|
+
endpoint: string;
|
|
2082
|
+
status: string;
|
|
2083
|
+
lastSeen?: string;
|
|
2084
|
+
}>;
|
|
2085
|
+
quorum: {
|
|
2086
|
+
required: number;
|
|
2087
|
+
current: number;
|
|
2088
|
+
reached: boolean;
|
|
2089
|
+
};
|
|
2090
|
+
}>;
|
|
2091
|
+
getMetrics(): Promise<string>;
|
|
2092
|
+
getQueueStats(): Promise<{
|
|
2093
|
+
queues: Record<string, {
|
|
2094
|
+
pending: number;
|
|
2095
|
+
processing: number;
|
|
2096
|
+
completed: number;
|
|
2097
|
+
failed: number;
|
|
2098
|
+
}>;
|
|
2099
|
+
timestamp: string;
|
|
2100
|
+
}>;
|
|
2101
|
+
getCircuitBreakerStatus(): Promise<{
|
|
2102
|
+
breakers: Record<string, {
|
|
2103
|
+
state: "closed" | "open" | "half-open";
|
|
2104
|
+
failures: number;
|
|
2105
|
+
successes: number;
|
|
2106
|
+
lastFailure?: string;
|
|
2107
|
+
nextRetry?: string;
|
|
2108
|
+
}>;
|
|
2109
|
+
timestamp: string;
|
|
2110
|
+
}>;
|
|
2111
|
+
verifySignature(request: {
|
|
2112
|
+
chain: ChainType;
|
|
2113
|
+
message: string;
|
|
2114
|
+
signature: string;
|
|
2115
|
+
publicKey: string;
|
|
2116
|
+
}): Promise<{
|
|
2117
|
+
valid: boolean;
|
|
2118
|
+
chain: ChainType;
|
|
2119
|
+
}>;
|
|
2120
|
+
}
|
|
2121
|
+
export type GatewayHealthResponse = {
|
|
2122
|
+
status: "healthy" | "degraded" | "unhealthy";
|
|
2123
|
+
timestamp: string;
|
|
2124
|
+
uptime: number;
|
|
2125
|
+
version: string;
|
|
1963
2126
|
};
|
|
1964
|
-
export type
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
2127
|
+
export type GatewayStatusResponse = {
|
|
2128
|
+
status: string;
|
|
2129
|
+
hosts: {
|
|
2130
|
+
total: number;
|
|
2131
|
+
verified: number;
|
|
2132
|
+
active: number;
|
|
2133
|
+
};
|
|
2134
|
+
domains: {
|
|
2135
|
+
total: number;
|
|
2136
|
+
verified: number;
|
|
2137
|
+
};
|
|
2138
|
+
uptime: number;
|
|
1969
2139
|
};
|
|
1970
|
-
export type
|
|
1971
|
-
|
|
1972
|
-
|
|
2140
|
+
export type GatewayReadinessResponse = {
|
|
2141
|
+
ready: boolean;
|
|
2142
|
+
checks: Record<string, boolean>;
|
|
1973
2143
|
};
|
|
1974
|
-
export type
|
|
1975
|
-
|
|
1976
|
-
|
|
2144
|
+
export type GatewayLivenessResponse = {
|
|
2145
|
+
alive: boolean;
|
|
2146
|
+
timestamp: string;
|
|
1977
2147
|
};
|
|
1978
|
-
export type
|
|
1979
|
-
|
|
1980
|
-
|
|
2148
|
+
export type GatewayMetricsResponse = {
|
|
2149
|
+
requests: {
|
|
2150
|
+
total: number;
|
|
2151
|
+
successful: number;
|
|
2152
|
+
failed: number;
|
|
2153
|
+
avgLatencyMs: number;
|
|
2154
|
+
};
|
|
2155
|
+
hosts: {
|
|
2156
|
+
total: number;
|
|
2157
|
+
healthy: number;
|
|
2158
|
+
unhealthy: number;
|
|
2159
|
+
};
|
|
2160
|
+
bandwidth: {
|
|
2161
|
+
inbound: number;
|
|
2162
|
+
outbound: number;
|
|
2163
|
+
};
|
|
2164
|
+
timestamp: string;
|
|
1981
2165
|
};
|
|
1982
|
-
export type
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
projection?: Record<string, 0 | 1>;
|
|
2166
|
+
export type GatewayMetricsSummaryResponse = {
|
|
2167
|
+
summary: Record<string, unknown>;
|
|
2168
|
+
period: string;
|
|
2169
|
+
generatedAt: string;
|
|
1987
2170
|
};
|
|
1988
|
-
export type
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
2171
|
+
export type RegisterHostRequest = {
|
|
2172
|
+
name: string;
|
|
2173
|
+
endpoint: string;
|
|
2174
|
+
capabilities?: string[];
|
|
2175
|
+
metadata?: Record<string, unknown>;
|
|
1993
2176
|
};
|
|
1994
|
-
export type
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2177
|
+
export type HostInfo = {
|
|
2178
|
+
hostId: string;
|
|
2179
|
+
name: string;
|
|
2180
|
+
endpoint: string;
|
|
2181
|
+
status: "active" | "inactive" | "suspended";
|
|
2182
|
+
verified: boolean;
|
|
2183
|
+
capabilities: string[];
|
|
2184
|
+
lastSeen: string;
|
|
2185
|
+
registeredAt: string;
|
|
2186
|
+
metadata?: Record<string, unknown>;
|
|
1999
2187
|
};
|
|
2000
|
-
export type
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
mimeType: string;
|
|
2004
|
-
uploadedAt: string;
|
|
2005
|
-
filename?: string;
|
|
2006
|
-
encrypted?: boolean;
|
|
2188
|
+
export type HostListResponse = {
|
|
2189
|
+
hosts: HostInfo[];
|
|
2190
|
+
total: number;
|
|
2007
2191
|
};
|
|
2008
|
-
export type
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
lastAccessedAt?: string;
|
|
2015
|
-
tags?: Record<string, string>;
|
|
2192
|
+
export type RoutingConfig = {
|
|
2193
|
+
strategy: "round-robin" | "least-connections" | "random" | "weighted";
|
|
2194
|
+
healthCheckInterval?: number;
|
|
2195
|
+
timeout?: number;
|
|
2196
|
+
retries?: number;
|
|
2197
|
+
weights?: Record<string, number>;
|
|
2016
2198
|
};
|
|
2017
|
-
export type
|
|
2018
|
-
|
|
2019
|
-
|
|
2199
|
+
export type ProxyRequest = {
|
|
2200
|
+
targetHostId?: string;
|
|
2201
|
+
method: string;
|
|
2202
|
+
path: string;
|
|
2203
|
+
headers?: Record<string, string>;
|
|
2204
|
+
body?: unknown;
|
|
2020
2205
|
};
|
|
2021
|
-
export type
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2206
|
+
export type ProxyResponse = {
|
|
2207
|
+
statusCode: number;
|
|
2208
|
+
headers: Record<string, string>;
|
|
2209
|
+
body: unknown;
|
|
2210
|
+
hostId: string;
|
|
2211
|
+
latencyMs: number;
|
|
2027
2212
|
};
|
|
2028
|
-
export type
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
type: BaasTriggerType;
|
|
2037
|
-
config: Record<string, unknown>;
|
|
2213
|
+
export type RoutingStatsResponse = {
|
|
2214
|
+
totalRequests: number;
|
|
2215
|
+
successRate: number;
|
|
2216
|
+
avgLatencyMs: number;
|
|
2217
|
+
hostStats: Record<string, {
|
|
2218
|
+
requests: number;
|
|
2219
|
+
errors: number;
|
|
2220
|
+
avgLatencyMs: number;
|
|
2038
2221
|
}>;
|
|
2039
|
-
resources?: Partial<BaasFunctionResources>;
|
|
2040
|
-
environment?: Record<string, string>;
|
|
2041
2222
|
};
|
|
2042
|
-
export type
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
status: "active" | "deploying" | "failed";
|
|
2048
|
-
error?: string;
|
|
2223
|
+
export type DomainRegistrationRequest = {
|
|
2224
|
+
domain: string;
|
|
2225
|
+
owner: string;
|
|
2226
|
+
registrar?: string;
|
|
2227
|
+
autoRenew?: boolean;
|
|
2049
2228
|
};
|
|
2050
|
-
export type
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
status: "
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2229
|
+
export type DomainInfo = {
|
|
2230
|
+
domain: string;
|
|
2231
|
+
owner: string;
|
|
2232
|
+
status: "active" | "pending" | "suspended" | "expired";
|
|
2233
|
+
verified: boolean;
|
|
2234
|
+
registrar?: string;
|
|
2235
|
+
expiresAt?: string;
|
|
2236
|
+
createdAt: string;
|
|
2237
|
+
dnsConfigured: boolean;
|
|
2238
|
+
dnssecEnabled: boolean;
|
|
2059
2239
|
};
|
|
2060
|
-
export type
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
runtime: BaasFunctionRuntime;
|
|
2064
|
-
version: number;
|
|
2065
|
-
status: "active" | "inactive" | "error";
|
|
2066
|
-
deployedAt: string;
|
|
2067
|
-
lastInvokedAt?: string;
|
|
2068
|
-
invocationCount: number;
|
|
2240
|
+
export type DomainListResponse = {
|
|
2241
|
+
domains: DomainInfo[];
|
|
2242
|
+
total: number;
|
|
2069
2243
|
};
|
|
2070
|
-
export type
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2244
|
+
export type DomainAvailabilityResponse = {
|
|
2245
|
+
domain: string;
|
|
2246
|
+
available: boolean;
|
|
2247
|
+
premium: boolean;
|
|
2248
|
+
price?: string;
|
|
2249
|
+
suggestions?: string[];
|
|
2076
2250
|
};
|
|
2077
|
-
export type
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
requestId?: string;
|
|
2251
|
+
export type VerificationTokenResponse = {
|
|
2252
|
+
token: string;
|
|
2253
|
+
method: "dns" | "http" | "email";
|
|
2254
|
+
instructions: string;
|
|
2255
|
+
expiresAt: string;
|
|
2083
2256
|
};
|
|
2084
|
-
export type
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
metadata?: Record<string, unknown>;
|
|
2257
|
+
export type VerificationResult = {
|
|
2258
|
+
verified: boolean;
|
|
2259
|
+
domain: string;
|
|
2260
|
+
method: string;
|
|
2261
|
+
verifiedAt?: string;
|
|
2262
|
+
error?: string;
|
|
2091
2263
|
};
|
|
2092
|
-
export type
|
|
2264
|
+
export type DnsRecord = {
|
|
2265
|
+
type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SRV" | "CAA";
|
|
2093
2266
|
name: string;
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
authRequired?: boolean;
|
|
2098
|
-
};
|
|
2099
|
-
export type BaasPresenceMember = {
|
|
2100
|
-
clientId: string;
|
|
2101
|
-
walletAddress?: string;
|
|
2102
|
-
joinedAt: string;
|
|
2103
|
-
lastSeenAt: string;
|
|
2104
|
-
metadata?: Record<string, unknown>;
|
|
2105
|
-
};
|
|
2106
|
-
export type BaasPresenceInfo = {
|
|
2107
|
-
channel: string;
|
|
2108
|
-
members: BaasPresenceMember[];
|
|
2109
|
-
totalCount: number;
|
|
2267
|
+
value: string;
|
|
2268
|
+
ttl?: number;
|
|
2269
|
+
priority?: number;
|
|
2110
2270
|
};
|
|
2111
|
-
export type
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
after?: string;
|
|
2115
|
-
startTime?: string;
|
|
2116
|
-
endTime?: string;
|
|
2271
|
+
export type DomainTransferRequest = {
|
|
2272
|
+
authCode: string;
|
|
2273
|
+
newRegistrar?: string;
|
|
2117
2274
|
};
|
|
2118
|
-
export type
|
|
2119
|
-
|
|
2120
|
-
|
|
2275
|
+
export type DnsResolveResponse = {
|
|
2276
|
+
name: string;
|
|
2277
|
+
type: string;
|
|
2278
|
+
records: Array<{
|
|
2279
|
+
value: string;
|
|
2280
|
+
ttl: number;
|
|
2281
|
+
}>;
|
|
2282
|
+
dnssec: boolean;
|
|
2121
2283
|
timestamp: string;
|
|
2122
2284
|
};
|
|
2123
|
-
export type
|
|
2285
|
+
export type DnsBatchQuery = {
|
|
2124
2286
|
name: string;
|
|
2125
|
-
|
|
2126
|
-
services: BaasService[];
|
|
2127
|
-
limits?: {
|
|
2128
|
-
cpu?: string;
|
|
2129
|
-
memory?: string;
|
|
2130
|
-
};
|
|
2287
|
+
type?: string;
|
|
2131
2288
|
};
|
|
2132
|
-
export type
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
repository: string;
|
|
2139
|
-
};
|
|
2289
|
+
export type DnsBatchResolveResponse = {
|
|
2290
|
+
results: DnsResolveResponse[];
|
|
2291
|
+
errors: Array<{
|
|
2292
|
+
query: DnsBatchQuery;
|
|
2293
|
+
error: string;
|
|
2294
|
+
}>;
|
|
2140
2295
|
};
|
|
2141
|
-
export type
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
};
|
|
2149
|
-
strategy?: "rolling" | "recreate";
|
|
2296
|
+
export type DnsZone = {
|
|
2297
|
+
zoneName: string;
|
|
2298
|
+
status: "active" | "pending" | "disabled";
|
|
2299
|
+
records: number;
|
|
2300
|
+
dnssecEnabled: boolean;
|
|
2301
|
+
createdAt: string;
|
|
2302
|
+
updatedAt: string;
|
|
2150
2303
|
};
|
|
2151
|
-
export type
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
url: string;
|
|
2304
|
+
export type DnsZoneListResponse = {
|
|
2305
|
+
zones: DnsZone[];
|
|
2306
|
+
total: number;
|
|
2155
2307
|
};
|
|
2156
|
-
export type
|
|
2157
|
-
|
|
2158
|
-
|
|
2308
|
+
export type DnsRecordInfo = {
|
|
2309
|
+
recordId: string;
|
|
2310
|
+
type: string;
|
|
2311
|
+
name: string;
|
|
2312
|
+
value: string;
|
|
2313
|
+
ttl: number;
|
|
2314
|
+
priority?: number;
|
|
2315
|
+
createdAt: string;
|
|
2316
|
+
updatedAt: string;
|
|
2159
2317
|
};
|
|
2160
|
-
export type
|
|
2161
|
-
|
|
2318
|
+
export type DnssecKey = {
|
|
2319
|
+
keyTag: number;
|
|
2320
|
+
algorithm: string;
|
|
2321
|
+
digestType: string;
|
|
2322
|
+
digest: string;
|
|
2323
|
+
publicKey: string;
|
|
2324
|
+
flags: number;
|
|
2162
2325
|
};
|
|
2163
|
-
export type
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
runtimeState: "NOT_DEPLOYED" | "DEPLOYING" | "RUNNING" | "FAILED" | "DEGRADED";
|
|
2169
|
-
replicas: number;
|
|
2170
|
-
lastReconciledAt?: string;
|
|
2171
|
-
lastError?: string;
|
|
2172
|
-
};
|
|
2326
|
+
export type DnssecDsRecord = {
|
|
2327
|
+
keyTag: number;
|
|
2328
|
+
algorithm: number;
|
|
2329
|
+
digestType: number;
|
|
2330
|
+
digest: string;
|
|
2173
2331
|
};
|
|
2174
|
-
|
|
2175
|
-
|
|
2332
|
+
declare class RoutingClient {
|
|
2333
|
+
private readonly http;
|
|
2334
|
+
constructor(http: HttpClient);
|
|
2335
|
+
registerHost(request: RegisterHostRequest): Promise<HostInfo>;
|
|
2336
|
+
unregisterHost(hostId: string): Promise<{
|
|
2337
|
+
success: boolean;
|
|
2338
|
+
}>;
|
|
2339
|
+
getAllHosts(): Promise<HostListResponse>;
|
|
2340
|
+
getVerifiedHosts(): Promise<HostListResponse>;
|
|
2341
|
+
getHost(hostId: string): Promise<HostInfo>;
|
|
2342
|
+
verifyHost(hostId: string): Promise<{
|
|
2343
|
+
verified: boolean;
|
|
2344
|
+
message: string;
|
|
2345
|
+
}>;
|
|
2346
|
+
setRoutingConfig(appId: string, config: RoutingConfig): Promise<RoutingConfig>;
|
|
2347
|
+
getRoutingConfig(appId: string): Promise<RoutingConfig>;
|
|
2348
|
+
proxyRequest(request: ProxyRequest): Promise<ProxyResponse>;
|
|
2349
|
+
getStats(): Promise<RoutingStatsResponse>;
|
|
2350
|
+
mapDomainToApp(domain: string, appId: string): Promise<{
|
|
2351
|
+
success: boolean;
|
|
2352
|
+
domain: string;
|
|
2353
|
+
appId: string;
|
|
2354
|
+
}>;
|
|
2355
|
+
}
|
|
2356
|
+
declare class DomainsClient {
|
|
2357
|
+
private readonly http;
|
|
2358
|
+
constructor(http: HttpClient);
|
|
2359
|
+
register(request: DomainRegistrationRequest): Promise<DomainInfo>;
|
|
2360
|
+
checkAvailability(domain: string): Promise<DomainAvailabilityResponse>;
|
|
2361
|
+
getInfo(domain: string): Promise<DomainInfo>;
|
|
2362
|
+
list(owner?: string): Promise<DomainListResponse>;
|
|
2363
|
+
generateVerificationToken(domain: string, method: "dns" | "http" | "email"): Promise<VerificationTokenResponse>;
|
|
2364
|
+
verifyOwnership(domain: string, token: string): Promise<VerificationResult>;
|
|
2365
|
+
configureDns(domain: string, records: DnsRecord[]): Promise<{
|
|
2366
|
+
success: boolean;
|
|
2367
|
+
records: DnsRecord[];
|
|
2368
|
+
}>;
|
|
2369
|
+
enableDnssec(domain: string): Promise<{
|
|
2370
|
+
success: boolean;
|
|
2371
|
+
message: string;
|
|
2372
|
+
}>;
|
|
2373
|
+
disableDnssec(domain: string): Promise<{
|
|
2374
|
+
success: boolean;
|
|
2375
|
+
message: string;
|
|
2376
|
+
}>;
|
|
2377
|
+
renew(domain: string, years?: number): Promise<DomainInfo>;
|
|
2378
|
+
transfer(domain: string, request: DomainTransferRequest): Promise<{
|
|
2379
|
+
success: boolean;
|
|
2380
|
+
message: string;
|
|
2381
|
+
}>;
|
|
2382
|
+
approveTransfer(domain: string): Promise<{
|
|
2383
|
+
success: boolean;
|
|
2384
|
+
}>;
|
|
2385
|
+
rejectTransfer(domain: string): Promise<{
|
|
2386
|
+
success: boolean;
|
|
2387
|
+
}>;
|
|
2388
|
+
suspend(domain: string, reason: string): Promise<{
|
|
2389
|
+
success: boolean;
|
|
2390
|
+
}>;
|
|
2391
|
+
unsuspend(domain: string): Promise<{
|
|
2392
|
+
success: boolean;
|
|
2393
|
+
}>;
|
|
2394
|
+
}
|
|
2395
|
+
declare class DnsClient {
|
|
2396
|
+
private readonly http;
|
|
2397
|
+
constructor(http: HttpClient);
|
|
2398
|
+
resolve(name: string, type?: string, dnssec?: boolean): Promise<DnsResolveResponse>;
|
|
2399
|
+
resolveBatch(queries: DnsBatchQuery[]): Promise<DnsBatchResolveResponse>;
|
|
2400
|
+
listZones(): Promise<DnsZoneListResponse>;
|
|
2401
|
+
getZone(zoneName: string): Promise<DnsZone & {
|
|
2402
|
+
records: DnsRecordInfo[];
|
|
2403
|
+
}>;
|
|
2404
|
+
createZone(request: {
|
|
2405
|
+
zoneName: string;
|
|
2406
|
+
description?: string;
|
|
2407
|
+
}): Promise<DnsZone>;
|
|
2408
|
+
deleteZone(zoneName: string): Promise<{
|
|
2409
|
+
success: boolean;
|
|
2410
|
+
}>;
|
|
2411
|
+
addRecord(zoneName: string, record: DnsRecord): Promise<DnsRecordInfo>;
|
|
2412
|
+
updateRecord(zoneName: string, recordId: string, updates: Partial<DnsRecord>): Promise<DnsRecordInfo>;
|
|
2413
|
+
deleteRecord(zoneName: string, recordId: string): Promise<{
|
|
2414
|
+
success: boolean;
|
|
2415
|
+
}>;
|
|
2416
|
+
generateDnssecKeys(zoneName: string, algorithm?: string): Promise<{
|
|
2417
|
+
keys: DnssecKey[];
|
|
2418
|
+
}>;
|
|
2419
|
+
getDnssecKeys(zoneName: string): Promise<{
|
|
2420
|
+
keys: DnssecKey[];
|
|
2421
|
+
}>;
|
|
2422
|
+
getDsRecord(zoneName: string): Promise<DnssecDsRecord>;
|
|
2423
|
+
clearCache(): Promise<{
|
|
2424
|
+
success: boolean;
|
|
2425
|
+
entriesCleared: number;
|
|
2426
|
+
}>;
|
|
2427
|
+
}
|
|
2428
|
+
export type SmartGatewayClientConfig = {
|
|
2429
|
+
baseUrl: string;
|
|
2430
|
+
apiKey?: string;
|
|
2431
|
+
authToken?: string;
|
|
2432
|
+
timeout?: number;
|
|
2433
|
+
allowInsecure?: boolean;
|
|
2176
2434
|
};
|
|
2435
|
+
declare class SmartGatewayClient {
|
|
2436
|
+
private readonly http;
|
|
2437
|
+
readonly routing: RoutingClient;
|
|
2438
|
+
readonly domains: DomainsClient;
|
|
2439
|
+
readonly dns: DnsClient;
|
|
2440
|
+
constructor(config: SmartGatewayClientConfig);
|
|
2441
|
+
getHealth(): Promise<GatewayHealthResponse>;
|
|
2442
|
+
getStatus(): Promise<GatewayStatusResponse>;
|
|
2443
|
+
getReadiness(): Promise<GatewayReadinessResponse>;
|
|
2444
|
+
getLiveness(): Promise<GatewayLivenessResponse>;
|
|
2445
|
+
getMetrics(refresh?: boolean): Promise<GatewayMetricsResponse>;
|
|
2446
|
+
getMetricsSummary(): Promise<GatewayMetricsSummaryResponse>;
|
|
2447
|
+
}
|
|
2177
2448
|
export type StateRootResponse = {
|
|
2178
2449
|
appId: string;
|
|
2179
2450
|
stateRoot: string;
|
|
@@ -2299,143 +2570,6 @@ declare class MessagingClient {
|
|
|
2299
2570
|
getPresence(channel: string): Promise<BaasPresenceInfo>;
|
|
2300
2571
|
getStats(): Promise<any>;
|
|
2301
2572
|
}
|
|
2302
|
-
declare class DeploymentClient {
|
|
2303
|
-
private readonly http;
|
|
2304
|
-
constructor(http: HttpClient);
|
|
2305
|
-
init(request: BaasInitRequest): Promise<BaasInitResponse>;
|
|
2306
|
-
uploadFrontend(appId: string, bundle: Blob | Buffer, filename?: string): Promise<BaasUploadFrontendResponse>;
|
|
2307
|
-
deploy(appId: string, request: BaasDeployRequest): Promise<BaasDeployResponse>;
|
|
2308
|
-
rollback(appId: string, request: BaasRollbackRequest): Promise<BaasDeployResponse>;
|
|
2309
|
-
status(appId: string): Promise<BaasRuntimeStatus>;
|
|
2310
|
-
list(): Promise<BaasAppListResponse>;
|
|
2311
|
-
get(appId: string): Promise<DeployedAppInfo>;
|
|
2312
|
-
update(appId: string, updates: Partial<BaasDeployRequest>): Promise<DeployedAppInfo>;
|
|
2313
|
-
delete(appId: string): Promise<{
|
|
2314
|
-
success: boolean;
|
|
2315
|
-
}>;
|
|
2316
|
-
suspend(appId: string): Promise<{
|
|
2317
|
-
success: boolean;
|
|
2318
|
-
status: string;
|
|
2319
|
-
}>;
|
|
2320
|
-
resume(appId: string): Promise<{
|
|
2321
|
-
success: boolean;
|
|
2322
|
-
status: string;
|
|
2323
|
-
}>;
|
|
2324
|
-
getStats(): Promise<{
|
|
2325
|
-
totalApps: number;
|
|
2326
|
-
activeApps: number;
|
|
2327
|
-
totalOwners: number;
|
|
2328
|
-
}>;
|
|
2329
|
-
}
|
|
2330
|
-
export type AgentStatus = "active" | "paused" | "revoked" | "pending";
|
|
2331
|
-
export type AgentRegisterRequest = {
|
|
2332
|
-
name: string;
|
|
2333
|
-
description?: string;
|
|
2334
|
-
capabilities: string[];
|
|
2335
|
-
rules: AgentRules;
|
|
2336
|
-
fundingConfig?: {
|
|
2337
|
-
chain: string;
|
|
2338
|
-
maxAmount: string;
|
|
2339
|
-
autoFund: boolean;
|
|
2340
|
-
};
|
|
2341
|
-
};
|
|
2342
|
-
export type AgentRules = {
|
|
2343
|
-
maxTradeAmount?: string;
|
|
2344
|
-
allowedPairs?: string[];
|
|
2345
|
-
allowedChains?: string[];
|
|
2346
|
-
dailyLimit?: string;
|
|
2347
|
-
requireApprovalAbove?: string;
|
|
2348
|
-
customRules?: Record<string, unknown>;
|
|
2349
|
-
};
|
|
2350
|
-
export type AgentInfo = {
|
|
2351
|
-
agentId: string;
|
|
2352
|
-
name: string;
|
|
2353
|
-
description?: string;
|
|
2354
|
-
status: AgentStatus;
|
|
2355
|
-
capabilities: string[];
|
|
2356
|
-
rules: AgentRules;
|
|
2357
|
-
owner: string;
|
|
2358
|
-
createdAt: string;
|
|
2359
|
-
lastActiveAt?: string;
|
|
2360
|
-
};
|
|
2361
|
-
export type AgentEvent = {
|
|
2362
|
-
eventId: string;
|
|
2363
|
-
agentId: string;
|
|
2364
|
-
type: string;
|
|
2365
|
-
data: Record<string, unknown>;
|
|
2366
|
-
timestamp: string;
|
|
2367
|
-
};
|
|
2368
|
-
export type AgentBalance = {
|
|
2369
|
-
chain: string;
|
|
2370
|
-
accountId: string;
|
|
2371
|
-
balance: string;
|
|
2372
|
-
symbol: string;
|
|
2373
|
-
};
|
|
2374
|
-
export type AgentFundRequest = {
|
|
2375
|
-
chain: string;
|
|
2376
|
-
amount: string;
|
|
2377
|
-
source?: string;
|
|
2378
|
-
};
|
|
2379
|
-
export type AgentTradeRequest = {
|
|
2380
|
-
chain: string;
|
|
2381
|
-
pair: string;
|
|
2382
|
-
side: "buy" | "sell";
|
|
2383
|
-
amount: string;
|
|
2384
|
-
price?: string;
|
|
2385
|
-
};
|
|
2386
|
-
export type AgentWithdrawRequest = {
|
|
2387
|
-
chain: string;
|
|
2388
|
-
amount: string;
|
|
2389
|
-
destination: string;
|
|
2390
|
-
};
|
|
2391
|
-
declare class AgentsClient {
|
|
2392
|
-
private readonly http;
|
|
2393
|
-
constructor(http: HttpClient);
|
|
2394
|
-
register(request: AgentRegisterRequest): Promise<AgentInfo>;
|
|
2395
|
-
get(agentId: string): Promise<AgentInfo>;
|
|
2396
|
-
list(): Promise<{
|
|
2397
|
-
agents: AgentInfo[];
|
|
2398
|
-
total: number;
|
|
2399
|
-
}>;
|
|
2400
|
-
fund(agentId: string, request: AgentFundRequest): Promise<{
|
|
2401
|
-
success: boolean;
|
|
2402
|
-
txId?: string;
|
|
2403
|
-
}>;
|
|
2404
|
-
trade(agentId: string, request: AgentTradeRequest): Promise<{
|
|
2405
|
-
success: boolean;
|
|
2406
|
-
txId?: string;
|
|
2407
|
-
}>;
|
|
2408
|
-
withdraw(agentId: string, request: AgentWithdrawRequest): Promise<{
|
|
2409
|
-
success: boolean;
|
|
2410
|
-
txId?: string;
|
|
2411
|
-
}>;
|
|
2412
|
-
pause(agentId: string): Promise<{
|
|
2413
|
-
success: boolean;
|
|
2414
|
-
status: string;
|
|
2415
|
-
}>;
|
|
2416
|
-
resume(agentId: string): Promise<{
|
|
2417
|
-
success: boolean;
|
|
2418
|
-
status: string;
|
|
2419
|
-
}>;
|
|
2420
|
-
revoke(agentId: string): Promise<{
|
|
2421
|
-
success: boolean;
|
|
2422
|
-
status: string;
|
|
2423
|
-
}>;
|
|
2424
|
-
updateRules(agentId: string, rules: Partial<AgentRules>): Promise<AgentInfo>;
|
|
2425
|
-
getEvents(agentId: string): Promise<{
|
|
2426
|
-
events: AgentEvent[];
|
|
2427
|
-
total: number;
|
|
2428
|
-
}>;
|
|
2429
|
-
getBalances(agentId: string): Promise<{
|
|
2430
|
-
balances: AgentBalance[];
|
|
2431
|
-
}>;
|
|
2432
|
-
approve(agentId: string, operationId: string): Promise<{
|
|
2433
|
-
success: boolean;
|
|
2434
|
-
}>;
|
|
2435
|
-
reject(agentId: string, operationId: string): Promise<{
|
|
2436
|
-
success: boolean;
|
|
2437
|
-
}>;
|
|
2438
|
-
}
|
|
2439
2573
|
export type CustomerSessionChallenge = {
|
|
2440
2574
|
challenge: string;
|
|
2441
2575
|
};
|