@0xobelisk/sui-client 1.1.0 → 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/index.mjs
CHANGED
|
@@ -1122,8 +1122,30 @@ var SuiIndexerClient = class {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
async getSchemas(params) {
|
|
1124
1124
|
const query = `
|
|
1125
|
-
query GetSchemas(
|
|
1126
|
-
|
|
1125
|
+
query GetSchemas(
|
|
1126
|
+
$first: Int,
|
|
1127
|
+
$after: String,
|
|
1128
|
+
$name: String,
|
|
1129
|
+
$key1: String,
|
|
1130
|
+
$key2: String,
|
|
1131
|
+
$is_removed: Boolean,
|
|
1132
|
+
$last_update_checkpoint: String,
|
|
1133
|
+
$last_update_digest: String,
|
|
1134
|
+
$value: JSON,
|
|
1135
|
+
$orderBy: [SchemaOrderField!]
|
|
1136
|
+
) {
|
|
1137
|
+
schemas(
|
|
1138
|
+
first: $first,
|
|
1139
|
+
after: $after,
|
|
1140
|
+
name: $name,
|
|
1141
|
+
key1: $key1,
|
|
1142
|
+
key2: $key2,
|
|
1143
|
+
is_removed: $is_removed,
|
|
1144
|
+
last_update_checkpoint: $last_update_checkpoint,
|
|
1145
|
+
last_update_digest: $last_update_digest,
|
|
1146
|
+
value: $value,
|
|
1147
|
+
orderBy: $orderBy
|
|
1148
|
+
) {
|
|
1127
1149
|
edges {
|
|
1128
1150
|
cursor
|
|
1129
1151
|
node {
|
|
@@ -1180,6 +1202,10 @@ var SuiIndexerClient = class {
|
|
|
1180
1202
|
name,
|
|
1181
1203
|
key1,
|
|
1182
1204
|
key2,
|
|
1205
|
+
is_removed = false,
|
|
1206
|
+
last_update_checkpoint,
|
|
1207
|
+
last_update_digest,
|
|
1208
|
+
value,
|
|
1183
1209
|
first,
|
|
1184
1210
|
after,
|
|
1185
1211
|
orderBy
|
|
@@ -1188,15 +1214,19 @@ var SuiIndexerClient = class {
|
|
|
1188
1214
|
name,
|
|
1189
1215
|
key1,
|
|
1190
1216
|
key2,
|
|
1217
|
+
is_removed,
|
|
1218
|
+
last_update_checkpoint,
|
|
1219
|
+
last_update_digest,
|
|
1220
|
+
value,
|
|
1191
1221
|
first,
|
|
1192
1222
|
after,
|
|
1193
1223
|
orderBy
|
|
1194
1224
|
});
|
|
1195
1225
|
const data = schemas.edges.map((edge) => edge.node);
|
|
1196
|
-
const
|
|
1226
|
+
const result = data.map((item) => parseValue(item.value));
|
|
1197
1227
|
return {
|
|
1198
1228
|
data,
|
|
1199
|
-
value,
|
|
1229
|
+
value: result,
|
|
1200
1230
|
pageInfo: schemas.pageInfo,
|
|
1201
1231
|
totalCount: schemas.totalCount
|
|
1202
1232
|
};
|
|
@@ -1204,22 +1234,30 @@ var SuiIndexerClient = class {
|
|
|
1204
1234
|
async getStorageItem({
|
|
1205
1235
|
name,
|
|
1206
1236
|
key1,
|
|
1207
|
-
key2
|
|
1237
|
+
key2,
|
|
1238
|
+
is_removed,
|
|
1239
|
+
last_update_checkpoint,
|
|
1240
|
+
last_update_digest,
|
|
1241
|
+
value
|
|
1208
1242
|
}) {
|
|
1209
1243
|
const schemas = await this.getSchemas({
|
|
1210
1244
|
name,
|
|
1211
1245
|
key1,
|
|
1212
1246
|
key2,
|
|
1247
|
+
is_removed,
|
|
1248
|
+
last_update_checkpoint,
|
|
1249
|
+
last_update_digest,
|
|
1250
|
+
value,
|
|
1213
1251
|
first: 1
|
|
1214
1252
|
});
|
|
1215
1253
|
const data = schemas.edges[0]?.node;
|
|
1216
1254
|
if (!data) {
|
|
1217
1255
|
return void 0;
|
|
1218
1256
|
}
|
|
1219
|
-
const
|
|
1257
|
+
const result = parseValue(data.value);
|
|
1220
1258
|
return {
|
|
1221
1259
|
data,
|
|
1222
|
-
value
|
|
1260
|
+
value: result
|
|
1223
1261
|
};
|
|
1224
1262
|
}
|
|
1225
1263
|
async subscribe(names, handleData) {
|
|
@@ -2233,6 +2271,10 @@ var Dubhe = class {
|
|
|
2233
2271
|
name,
|
|
2234
2272
|
key1,
|
|
2235
2273
|
key2,
|
|
2274
|
+
is_removed,
|
|
2275
|
+
last_update_checkpoint,
|
|
2276
|
+
last_update_digest,
|
|
2277
|
+
value,
|
|
2236
2278
|
first,
|
|
2237
2279
|
after,
|
|
2238
2280
|
orderBy
|
|
@@ -2241,6 +2283,10 @@ var Dubhe = class {
|
|
|
2241
2283
|
name,
|
|
2242
2284
|
key1,
|
|
2243
2285
|
key2,
|
|
2286
|
+
is_removed,
|
|
2287
|
+
last_update_checkpoint,
|
|
2288
|
+
last_update_digest,
|
|
2289
|
+
value,
|
|
2244
2290
|
first,
|
|
2245
2291
|
after,
|
|
2246
2292
|
orderBy
|
|
@@ -2250,6 +2296,10 @@ var Dubhe = class {
|
|
|
2250
2296
|
name,
|
|
2251
2297
|
key1,
|
|
2252
2298
|
key2,
|
|
2299
|
+
is_removed,
|
|
2300
|
+
last_update_checkpoint,
|
|
2301
|
+
last_update_digest,
|
|
2302
|
+
value,
|
|
2253
2303
|
first,
|
|
2254
2304
|
after,
|
|
2255
2305
|
orderBy
|
|
@@ -2258,6 +2308,10 @@ var Dubhe = class {
|
|
|
2258
2308
|
name,
|
|
2259
2309
|
key1,
|
|
2260
2310
|
key2,
|
|
2311
|
+
is_removed,
|
|
2312
|
+
last_update_checkpoint,
|
|
2313
|
+
last_update_digest,
|
|
2314
|
+
value,
|
|
2261
2315
|
first,
|
|
2262
2316
|
after,
|
|
2263
2317
|
orderBy
|
|
@@ -2266,12 +2320,20 @@ var Dubhe = class {
|
|
|
2266
2320
|
async getStorageItem({
|
|
2267
2321
|
name,
|
|
2268
2322
|
key1,
|
|
2269
|
-
key2
|
|
2323
|
+
key2,
|
|
2324
|
+
is_removed,
|
|
2325
|
+
last_update_checkpoint,
|
|
2326
|
+
last_update_digest,
|
|
2327
|
+
value
|
|
2270
2328
|
}) {
|
|
2271
2329
|
const response = await this.suiIndexerClient.getStorageItem({
|
|
2272
2330
|
name,
|
|
2273
2331
|
key1,
|
|
2274
|
-
key2
|
|
2332
|
+
key2,
|
|
2333
|
+
is_removed,
|
|
2334
|
+
last_update_checkpoint,
|
|
2335
|
+
last_update_digest,
|
|
2336
|
+
value
|
|
2275
2337
|
});
|
|
2276
2338
|
return response;
|
|
2277
2339
|
}
|