@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
|
@@ -67,6 +67,10 @@ export declare class SuiIndexerClient {
|
|
|
67
67
|
name?: string;
|
|
68
68
|
key1?: string;
|
|
69
69
|
key2?: string;
|
|
70
|
+
is_removed?: boolean;
|
|
71
|
+
last_update_checkpoint?: string;
|
|
72
|
+
last_update_digest?: string;
|
|
73
|
+
value?: any;
|
|
70
74
|
orderBy?: string[];
|
|
71
75
|
}): Promise<ConnectionResponse<IndexerSchema>>;
|
|
72
76
|
getEvents(params?: {
|
|
@@ -76,18 +80,26 @@ export declare class SuiIndexerClient {
|
|
|
76
80
|
checkpoint?: string;
|
|
77
81
|
orderBy?: string[];
|
|
78
82
|
}): Promise<ConnectionResponse<IndexerEvent>>;
|
|
79
|
-
getStorage({ name, key1, key2, first, after, orderBy, }: {
|
|
83
|
+
getStorage({ name, key1, key2, is_removed, last_update_checkpoint, last_update_digest, value, first, after, orderBy, }: {
|
|
80
84
|
name?: string;
|
|
81
85
|
key1?: string;
|
|
82
86
|
key2?: string;
|
|
87
|
+
is_removed?: boolean;
|
|
88
|
+
last_update_checkpoint?: string;
|
|
89
|
+
last_update_digest?: string;
|
|
90
|
+
value?: any;
|
|
83
91
|
first?: number;
|
|
84
92
|
after?: string;
|
|
85
93
|
orderBy?: string[];
|
|
86
94
|
}): Promise<StorageResponse<IndexerSchema>>;
|
|
87
|
-
getStorageItem({ name, key1, key2, }: {
|
|
95
|
+
getStorageItem({ name, key1, key2, is_removed, last_update_checkpoint, last_update_digest, value, }: {
|
|
88
96
|
name: string;
|
|
89
97
|
key1?: string;
|
|
90
98
|
key2?: string;
|
|
99
|
+
is_removed?: boolean;
|
|
100
|
+
last_update_checkpoint?: string;
|
|
101
|
+
last_update_digest?: string;
|
|
102
|
+
value?: any;
|
|
91
103
|
}): Promise<StorageItemResponse<IndexerSchema> | undefined>;
|
|
92
104
|
subscribe(names: string[], handleData: (data: any) => void): Promise<WebSocket>;
|
|
93
105
|
}
|
package/package.json
CHANGED
package/src/dubhe.ts
CHANGED
|
@@ -1144,6 +1144,10 @@ export class Dubhe {
|
|
|
1144
1144
|
name,
|
|
1145
1145
|
key1,
|
|
1146
1146
|
key2,
|
|
1147
|
+
is_removed,
|
|
1148
|
+
last_update_checkpoint,
|
|
1149
|
+
last_update_digest,
|
|
1150
|
+
value,
|
|
1147
1151
|
first,
|
|
1148
1152
|
after,
|
|
1149
1153
|
orderBy,
|
|
@@ -1151,6 +1155,10 @@ export class Dubhe {
|
|
|
1151
1155
|
name?: string;
|
|
1152
1156
|
key1?: string;
|
|
1153
1157
|
key2?: string;
|
|
1158
|
+
is_removed?: boolean;
|
|
1159
|
+
last_update_checkpoint?: string;
|
|
1160
|
+
last_update_digest?: string;
|
|
1161
|
+
value?: any;
|
|
1154
1162
|
first?: number;
|
|
1155
1163
|
after?: string;
|
|
1156
1164
|
orderBy?: string[];
|
|
@@ -1159,6 +1167,10 @@ export class Dubhe {
|
|
|
1159
1167
|
name,
|
|
1160
1168
|
key1,
|
|
1161
1169
|
key2,
|
|
1170
|
+
is_removed,
|
|
1171
|
+
last_update_checkpoint,
|
|
1172
|
+
last_update_digest,
|
|
1173
|
+
value,
|
|
1162
1174
|
first,
|
|
1163
1175
|
after,
|
|
1164
1176
|
orderBy,
|
|
@@ -1169,6 +1181,10 @@ export class Dubhe {
|
|
|
1169
1181
|
name,
|
|
1170
1182
|
key1,
|
|
1171
1183
|
key2,
|
|
1184
|
+
is_removed,
|
|
1185
|
+
last_update_checkpoint,
|
|
1186
|
+
last_update_digest,
|
|
1187
|
+
value,
|
|
1172
1188
|
first,
|
|
1173
1189
|
after,
|
|
1174
1190
|
orderBy,
|
|
@@ -1176,6 +1192,10 @@ export class Dubhe {
|
|
|
1176
1192
|
name?: string;
|
|
1177
1193
|
key1?: string;
|
|
1178
1194
|
key2?: string;
|
|
1195
|
+
is_removed?: boolean;
|
|
1196
|
+
last_update_checkpoint?: string;
|
|
1197
|
+
last_update_digest?: string;
|
|
1198
|
+
value?: any;
|
|
1179
1199
|
first?: number;
|
|
1180
1200
|
after?: string;
|
|
1181
1201
|
orderBy?: string[];
|
|
@@ -1184,6 +1204,10 @@ export class Dubhe {
|
|
|
1184
1204
|
name,
|
|
1185
1205
|
key1,
|
|
1186
1206
|
key2,
|
|
1207
|
+
is_removed,
|
|
1208
|
+
last_update_checkpoint,
|
|
1209
|
+
last_update_digest,
|
|
1210
|
+
value,
|
|
1187
1211
|
first,
|
|
1188
1212
|
after,
|
|
1189
1213
|
orderBy,
|
|
@@ -1194,15 +1218,27 @@ export class Dubhe {
|
|
|
1194
1218
|
name,
|
|
1195
1219
|
key1,
|
|
1196
1220
|
key2,
|
|
1221
|
+
is_removed,
|
|
1222
|
+
last_update_checkpoint,
|
|
1223
|
+
last_update_digest,
|
|
1224
|
+
value,
|
|
1197
1225
|
}: {
|
|
1198
1226
|
name: string;
|
|
1199
1227
|
key1?: string;
|
|
1200
1228
|
key2?: string;
|
|
1229
|
+
is_removed?: boolean;
|
|
1230
|
+
last_update_checkpoint?: string;
|
|
1231
|
+
last_update_digest?: string;
|
|
1232
|
+
value?: any;
|
|
1201
1233
|
}): Promise<StorageItemResponse<IndexerSchema> | undefined> {
|
|
1202
1234
|
const response = await this.suiIndexerClient.getStorageItem({
|
|
1203
1235
|
name,
|
|
1204
1236
|
key1,
|
|
1205
1237
|
key2,
|
|
1238
|
+
is_removed,
|
|
1239
|
+
last_update_checkpoint,
|
|
1240
|
+
last_update_digest,
|
|
1241
|
+
value,
|
|
1206
1242
|
});
|
|
1207
1243
|
return response;
|
|
1208
1244
|
}
|
|
@@ -116,11 +116,37 @@ export class SuiIndexerClient {
|
|
|
116
116
|
name?: string;
|
|
117
117
|
key1?: string;
|
|
118
118
|
key2?: string;
|
|
119
|
+
is_removed?: boolean;
|
|
120
|
+
last_update_checkpoint?: string;
|
|
121
|
+
last_update_digest?: string;
|
|
122
|
+
value?: any;
|
|
119
123
|
orderBy?: string[];
|
|
120
124
|
}): Promise<ConnectionResponse<IndexerSchema>> {
|
|
121
125
|
const query = `
|
|
122
|
-
query GetSchemas(
|
|
123
|
-
|
|
126
|
+
query GetSchemas(
|
|
127
|
+
$first: Int,
|
|
128
|
+
$after: String,
|
|
129
|
+
$name: String,
|
|
130
|
+
$key1: String,
|
|
131
|
+
$key2: String,
|
|
132
|
+
$is_removed: Boolean,
|
|
133
|
+
$last_update_checkpoint: String,
|
|
134
|
+
$last_update_digest: String,
|
|
135
|
+
$value: JSON,
|
|
136
|
+
$orderBy: [SchemaOrderField!]
|
|
137
|
+
) {
|
|
138
|
+
schemas(
|
|
139
|
+
first: $first,
|
|
140
|
+
after: $after,
|
|
141
|
+
name: $name,
|
|
142
|
+
key1: $key1,
|
|
143
|
+
key2: $key2,
|
|
144
|
+
is_removed: $is_removed,
|
|
145
|
+
last_update_checkpoint: $last_update_checkpoint,
|
|
146
|
+
last_update_digest: $last_update_digest,
|
|
147
|
+
value: $value,
|
|
148
|
+
orderBy: $orderBy
|
|
149
|
+
) {
|
|
124
150
|
edges {
|
|
125
151
|
cursor
|
|
126
152
|
node {
|
|
@@ -191,6 +217,10 @@ export class SuiIndexerClient {
|
|
|
191
217
|
name,
|
|
192
218
|
key1,
|
|
193
219
|
key2,
|
|
220
|
+
is_removed = false,
|
|
221
|
+
last_update_checkpoint,
|
|
222
|
+
last_update_digest,
|
|
223
|
+
value,
|
|
194
224
|
first,
|
|
195
225
|
after,
|
|
196
226
|
orderBy,
|
|
@@ -198,6 +228,10 @@ export class SuiIndexerClient {
|
|
|
198
228
|
name?: string;
|
|
199
229
|
key1?: string;
|
|
200
230
|
key2?: string;
|
|
231
|
+
is_removed?: boolean;
|
|
232
|
+
last_update_checkpoint?: string;
|
|
233
|
+
last_update_digest?: string;
|
|
234
|
+
value?: any;
|
|
201
235
|
first?: number;
|
|
202
236
|
after?: string;
|
|
203
237
|
orderBy?: string[];
|
|
@@ -206,15 +240,19 @@ export class SuiIndexerClient {
|
|
|
206
240
|
name,
|
|
207
241
|
key1,
|
|
208
242
|
key2,
|
|
243
|
+
is_removed,
|
|
244
|
+
last_update_checkpoint,
|
|
245
|
+
last_update_digest,
|
|
246
|
+
value,
|
|
209
247
|
first,
|
|
210
248
|
after,
|
|
211
249
|
orderBy,
|
|
212
250
|
});
|
|
213
251
|
const data = schemas.edges.map((edge) => edge.node);
|
|
214
|
-
const
|
|
252
|
+
const result = data.map((item) => parseValue(item.value));
|
|
215
253
|
return {
|
|
216
254
|
data,
|
|
217
|
-
value,
|
|
255
|
+
value: result,
|
|
218
256
|
pageInfo: schemas.pageInfo,
|
|
219
257
|
totalCount: schemas.totalCount,
|
|
220
258
|
};
|
|
@@ -224,25 +262,37 @@ export class SuiIndexerClient {
|
|
|
224
262
|
name,
|
|
225
263
|
key1,
|
|
226
264
|
key2,
|
|
265
|
+
is_removed,
|
|
266
|
+
last_update_checkpoint,
|
|
267
|
+
last_update_digest,
|
|
268
|
+
value,
|
|
227
269
|
}: {
|
|
228
270
|
name: string;
|
|
229
271
|
key1?: string;
|
|
230
272
|
key2?: string;
|
|
273
|
+
is_removed?: boolean;
|
|
274
|
+
last_update_checkpoint?: string;
|
|
275
|
+
last_update_digest?: string;
|
|
276
|
+
value?: any;
|
|
231
277
|
}): Promise<StorageItemResponse<IndexerSchema> | undefined> {
|
|
232
278
|
const schemas = await this.getSchemas({
|
|
233
279
|
name,
|
|
234
280
|
key1,
|
|
235
281
|
key2,
|
|
282
|
+
is_removed,
|
|
283
|
+
last_update_checkpoint,
|
|
284
|
+
last_update_digest,
|
|
285
|
+
value,
|
|
236
286
|
first: 1,
|
|
237
287
|
});
|
|
238
288
|
const data = schemas.edges[0]?.node;
|
|
239
289
|
if (!data) {
|
|
240
290
|
return undefined;
|
|
241
291
|
}
|
|
242
|
-
const
|
|
292
|
+
const result = parseValue(data.value);
|
|
243
293
|
return {
|
|
244
294
|
data,
|
|
245
|
-
value,
|
|
295
|
+
value: result,
|
|
246
296
|
};
|
|
247
297
|
}
|
|
248
298
|
|