@0xobelisk/sui-client 1.0.10 → 1.1.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/dubhe.d.ts +15 -3
- package/dist/index.js +71 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +71 -9
- package/dist/index.mjs.map +1 -1
- package/dist/libs/suiIndexerClient/index.d.ts +14 -2
- package/package.json +1 -1
- package/src/dubhe.ts +36 -0
- package/src/libs/suiIndexerClient/index.ts +56 -6
package/dist/dubhe.d.ts
CHANGED
|
@@ -65,26 +65,38 @@ export declare class Dubhe {
|
|
|
65
65
|
after?: string;
|
|
66
66
|
orderBy?: string[];
|
|
67
67
|
}): Promise<ConnectionResponse<IndexerEvent>>;
|
|
68
|
-
getSchemas({ name, key1, key2, first, after, orderBy, }: {
|
|
68
|
+
getSchemas({ name, key1, key2, is_removed, last_update_checkpoint, last_update_digest, value, first, after, orderBy, }: {
|
|
69
69
|
name?: string;
|
|
70
70
|
key1?: string;
|
|
71
71
|
key2?: string;
|
|
72
|
+
is_removed?: boolean;
|
|
73
|
+
last_update_checkpoint?: string;
|
|
74
|
+
last_update_digest?: string;
|
|
75
|
+
value?: any;
|
|
72
76
|
first?: number;
|
|
73
77
|
after?: string;
|
|
74
78
|
orderBy?: string[];
|
|
75
79
|
}): Promise<ConnectionResponse<IndexerSchema>>;
|
|
76
|
-
getStorage({ name, key1, key2, first, after, orderBy, }: {
|
|
80
|
+
getStorage({ name, key1, key2, is_removed, last_update_checkpoint, last_update_digest, value, first, after, orderBy, }: {
|
|
77
81
|
name?: string;
|
|
78
82
|
key1?: string;
|
|
79
83
|
key2?: string;
|
|
84
|
+
is_removed?: boolean;
|
|
85
|
+
last_update_checkpoint?: string;
|
|
86
|
+
last_update_digest?: string;
|
|
87
|
+
value?: any;
|
|
80
88
|
first?: number;
|
|
81
89
|
after?: string;
|
|
82
90
|
orderBy?: string[];
|
|
83
91
|
}): Promise<StorageResponse<IndexerSchema>>;
|
|
84
|
-
getStorageItem({ name, key1, key2, }: {
|
|
92
|
+
getStorageItem({ name, key1, key2, is_removed, last_update_checkpoint, last_update_digest, value, }: {
|
|
85
93
|
name: string;
|
|
86
94
|
key1?: string;
|
|
87
95
|
key2?: string;
|
|
96
|
+
is_removed?: boolean;
|
|
97
|
+
last_update_checkpoint?: string;
|
|
98
|
+
last_update_digest?: string;
|
|
99
|
+
value?: any;
|
|
88
100
|
}): Promise<StorageItemResponse<IndexerSchema> | undefined>;
|
|
89
101
|
subscribe(names: string[], handleData: (data: any) => void): Promise<WebSocket>;
|
|
90
102
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1148,8 +1148,30 @@ var SuiIndexerClient = class {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
async getSchemas(params) {
|
|
1150
1150
|
const query = `
|
|
1151
|
-
query GetSchemas(
|
|
1152
|
-
|
|
1151
|
+
query GetSchemas(
|
|
1152
|
+
$first: Int,
|
|
1153
|
+
$after: String,
|
|
1154
|
+
$name: String,
|
|
1155
|
+
$key1: String,
|
|
1156
|
+
$key2: String,
|
|
1157
|
+
$is_removed: Boolean,
|
|
1158
|
+
$last_update_checkpoint: String,
|
|
1159
|
+
$last_update_digest: String,
|
|
1160
|
+
$value: JSON,
|
|
1161
|
+
$orderBy: [SchemaOrderField!]
|
|
1162
|
+
) {
|
|
1163
|
+
schemas(
|
|
1164
|
+
first: $first,
|
|
1165
|
+
after: $after,
|
|
1166
|
+
name: $name,
|
|
1167
|
+
key1: $key1,
|
|
1168
|
+
key2: $key2,
|
|
1169
|
+
is_removed: $is_removed,
|
|
1170
|
+
last_update_checkpoint: $last_update_checkpoint,
|
|
1171
|
+
last_update_digest: $last_update_digest,
|
|
1172
|
+
value: $value,
|
|
1173
|
+
orderBy: $orderBy
|
|
1174
|
+
) {
|
|
1153
1175
|
edges {
|
|
1154
1176
|
cursor
|
|
1155
1177
|
node {
|
|
@@ -1206,6 +1228,10 @@ var SuiIndexerClient = class {
|
|
|
1206
1228
|
name,
|
|
1207
1229
|
key1,
|
|
1208
1230
|
key2,
|
|
1231
|
+
is_removed = false,
|
|
1232
|
+
last_update_checkpoint,
|
|
1233
|
+
last_update_digest,
|
|
1234
|
+
value,
|
|
1209
1235
|
first,
|
|
1210
1236
|
after,
|
|
1211
1237
|
orderBy
|
|
@@ -1214,15 +1240,19 @@ var SuiIndexerClient = class {
|
|
|
1214
1240
|
name,
|
|
1215
1241
|
key1,
|
|
1216
1242
|
key2,
|
|
1243
|
+
is_removed,
|
|
1244
|
+
last_update_checkpoint,
|
|
1245
|
+
last_update_digest,
|
|
1246
|
+
value,
|
|
1217
1247
|
first,
|
|
1218
1248
|
after,
|
|
1219
1249
|
orderBy
|
|
1220
1250
|
});
|
|
1221
1251
|
const data = schemas.edges.map((edge) => edge.node);
|
|
1222
|
-
const
|
|
1252
|
+
const result = data.map((item) => parseValue(item.value));
|
|
1223
1253
|
return {
|
|
1224
1254
|
data,
|
|
1225
|
-
value,
|
|
1255
|
+
value: result,
|
|
1226
1256
|
pageInfo: schemas.pageInfo,
|
|
1227
1257
|
totalCount: schemas.totalCount
|
|
1228
1258
|
};
|
|
@@ -1230,22 +1260,30 @@ var SuiIndexerClient = class {
|
|
|
1230
1260
|
async getStorageItem({
|
|
1231
1261
|
name,
|
|
1232
1262
|
key1,
|
|
1233
|
-
key2
|
|
1263
|
+
key2,
|
|
1264
|
+
is_removed,
|
|
1265
|
+
last_update_checkpoint,
|
|
1266
|
+
last_update_digest,
|
|
1267
|
+
value
|
|
1234
1268
|
}) {
|
|
1235
1269
|
const schemas = await this.getSchemas({
|
|
1236
1270
|
name,
|
|
1237
1271
|
key1,
|
|
1238
1272
|
key2,
|
|
1273
|
+
is_removed,
|
|
1274
|
+
last_update_checkpoint,
|
|
1275
|
+
last_update_digest,
|
|
1276
|
+
value,
|
|
1239
1277
|
first: 1
|
|
1240
1278
|
});
|
|
1241
1279
|
const data = schemas.edges[0]?.node;
|
|
1242
1280
|
if (!data) {
|
|
1243
1281
|
return void 0;
|
|
1244
1282
|
}
|
|
1245
|
-
const
|
|
1283
|
+
const result = parseValue(data.value);
|
|
1246
1284
|
return {
|
|
1247
1285
|
data,
|
|
1248
|
-
value
|
|
1286
|
+
value: result
|
|
1249
1287
|
};
|
|
1250
1288
|
}
|
|
1251
1289
|
async subscribe(names, handleData) {
|
|
@@ -2259,6 +2297,10 @@ var Dubhe = class {
|
|
|
2259
2297
|
name,
|
|
2260
2298
|
key1,
|
|
2261
2299
|
key2,
|
|
2300
|
+
is_removed,
|
|
2301
|
+
last_update_checkpoint,
|
|
2302
|
+
last_update_digest,
|
|
2303
|
+
value,
|
|
2262
2304
|
first,
|
|
2263
2305
|
after,
|
|
2264
2306
|
orderBy
|
|
@@ -2267,6 +2309,10 @@ var Dubhe = class {
|
|
|
2267
2309
|
name,
|
|
2268
2310
|
key1,
|
|
2269
2311
|
key2,
|
|
2312
|
+
is_removed,
|
|
2313
|
+
last_update_checkpoint,
|
|
2314
|
+
last_update_digest,
|
|
2315
|
+
value,
|
|
2270
2316
|
first,
|
|
2271
2317
|
after,
|
|
2272
2318
|
orderBy
|
|
@@ -2276,6 +2322,10 @@ var Dubhe = class {
|
|
|
2276
2322
|
name,
|
|
2277
2323
|
key1,
|
|
2278
2324
|
key2,
|
|
2325
|
+
is_removed,
|
|
2326
|
+
last_update_checkpoint,
|
|
2327
|
+
last_update_digest,
|
|
2328
|
+
value,
|
|
2279
2329
|
first,
|
|
2280
2330
|
after,
|
|
2281
2331
|
orderBy
|
|
@@ -2284,6 +2334,10 @@ var Dubhe = class {
|
|
|
2284
2334
|
name,
|
|
2285
2335
|
key1,
|
|
2286
2336
|
key2,
|
|
2337
|
+
is_removed,
|
|
2338
|
+
last_update_checkpoint,
|
|
2339
|
+
last_update_digest,
|
|
2340
|
+
value,
|
|
2287
2341
|
first,
|
|
2288
2342
|
after,
|
|
2289
2343
|
orderBy
|
|
@@ -2292,12 +2346,20 @@ var Dubhe = class {
|
|
|
2292
2346
|
async getStorageItem({
|
|
2293
2347
|
name,
|
|
2294
2348
|
key1,
|
|
2295
|
-
key2
|
|
2349
|
+
key2,
|
|
2350
|
+
is_removed,
|
|
2351
|
+
last_update_checkpoint,
|
|
2352
|
+
last_update_digest,
|
|
2353
|
+
value
|
|
2296
2354
|
}) {
|
|
2297
2355
|
const response = await this.suiIndexerClient.getStorageItem({
|
|
2298
2356
|
name,
|
|
2299
2357
|
key1,
|
|
2300
|
-
key2
|
|
2358
|
+
key2,
|
|
2359
|
+
is_removed,
|
|
2360
|
+
last_update_checkpoint,
|
|
2361
|
+
last_update_digest,
|
|
2362
|
+
value
|
|
2301
2363
|
});
|
|
2302
2364
|
return response;
|
|
2303
2365
|
}
|