@0xobelisk/sui-client 1.1.5 → 1.1.7

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.mjs CHANGED
@@ -1089,6 +1089,11 @@ var parseValue = (value) => {
1089
1089
  };
1090
1090
 
1091
1091
  // src/libs/suiIndexerClient/index.ts
1092
+ var SubscriptionKind = /* @__PURE__ */ ((SubscriptionKind2) => {
1093
+ SubscriptionKind2["Event"] = "event";
1094
+ SubscriptionKind2["Schema"] = "schema";
1095
+ return SubscriptionKind2;
1096
+ })(SubscriptionKind || {});
1092
1097
  var SuiIndexerClient = class {
1093
1098
  constructor(http) {
1094
1099
  this.http = http;
@@ -1098,14 +1103,15 @@ var SuiIndexerClient = class {
1098
1103
  }
1099
1104
  async getTransactions(params) {
1100
1105
  const query = `
1101
- query GetTransactions($first: Int, $after: String, $checkpoint: Int, $orderBy: [TransactionOrderField!]) {
1102
- transactions(first: $first, after: $after, checkpoint: $checkpoint, orderBy: $orderBy) {
1106
+ query GetTransactions($first: Int, $after: String, $sender: String, $digest: String, $checkpoint: Int, $orderBy: [TransactionOrderField!]) {
1107
+ transactions(first: $first, after: $after, sender: $sender, digest: $digest, checkpoint: $checkpoint, orderBy: $orderBy) {
1103
1108
  edges {
1104
1109
  cursor
1105
1110
  node {
1106
1111
  id
1107
1112
  checkpoint
1108
1113
  digest
1114
+ sender
1109
1115
  created_at
1110
1116
  }
1111
1117
  }
@@ -1174,8 +1180,8 @@ var SuiIndexerClient = class {
1174
1180
  }
1175
1181
  async getEvents(params) {
1176
1182
  const query = `
1177
- query GetEvents($first: Int, $after: String, $name: String, $checkpoint: String, $orderBy: [EventOrderField!]) {
1178
- events(first: $first, after: $after, name: $name, checkpoint: $checkpoint, orderBy: $orderBy) {
1183
+ query GetEvents($first: Int, $after: String, $name: String, $sender: String, $digest: String, $checkpoint: String, $orderBy: [EventOrderField!]) {
1184
+ events(first: $first, after: $after, name: $name, sender: $sender, digest: $digest, checkpoint: $checkpoint, orderBy: $orderBy) {
1179
1185
  edges {
1180
1186
  cursor
1181
1187
  node {
@@ -1183,6 +1189,7 @@ var SuiIndexerClient = class {
1183
1189
  checkpoint
1184
1190
  digest
1185
1191
  name
1192
+ sender
1186
1193
  value
1187
1194
  created_at
1188
1195
  }
@@ -1260,8 +1267,8 @@ var SuiIndexerClient = class {
1260
1267
  value: result
1261
1268
  };
1262
1269
  }
1263
- async subscribe(names, handleData) {
1264
- return this.http.subscribe(names, handleData);
1270
+ async subscribe(types, handleData) {
1271
+ return this.http.subscribe(types, handleData);
1265
1272
  }
1266
1273
  };
1267
1274
 
@@ -1399,14 +1406,11 @@ var Http = class {
1399
1406
  );
1400
1407
  }
1401
1408
  }
1402
- async subscribe(names, handleData) {
1409
+ async subscribe(types, handleData) {
1403
1410
  const ws = createWebSocketClient(this.wsEndpoint);
1404
1411
  ws.onopen = () => {
1405
1412
  console.log("Connected to the WebSocket server");
1406
- const subscribeMessage = JSON.stringify({
1407
- type: "subscribe",
1408
- names
1409
- });
1413
+ const subscribeMessage = JSON.stringify(types);
1410
1414
  ws.send(subscribeMessage);
1411
1415
  };
1412
1416
  ws.onmessage = (event) => {
@@ -2254,11 +2258,17 @@ var Dubhe = class {
2254
2258
  async getTransactions({
2255
2259
  first,
2256
2260
  after,
2261
+ sender,
2262
+ digest,
2263
+ checkpoint,
2257
2264
  orderBy
2258
2265
  }) {
2259
2266
  return await this.suiIndexerClient.getTransactions({
2260
2267
  first,
2261
2268
  after,
2269
+ sender,
2270
+ digest,
2271
+ checkpoint,
2262
2272
  orderBy
2263
2273
  });
2264
2274
  }
@@ -2266,6 +2276,8 @@ var Dubhe = class {
2266
2276
  first,
2267
2277
  after,
2268
2278
  name,
2279
+ sender,
2280
+ digest,
2269
2281
  checkpoint,
2270
2282
  orderBy
2271
2283
  }) {
@@ -2273,6 +2285,8 @@ var Dubhe = class {
2273
2285
  first,
2274
2286
  after,
2275
2287
  name,
2288
+ sender,
2289
+ digest,
2276
2290
  checkpoint,
2277
2291
  orderBy
2278
2292
  });
@@ -2347,8 +2361,8 @@ var Dubhe = class {
2347
2361
  });
2348
2362
  return response;
2349
2363
  }
2350
- async subscribe(names, handleData) {
2351
- return this.suiIndexerClient.subscribe(names, handleData);
2364
+ async subscribe(types, handleData) {
2365
+ return this.suiIndexerClient.subscribe(types, handleData);
2352
2366
  }
2353
2367
  /**
2354
2368
  * else:
@@ -2747,9 +2761,7 @@ async function loadMetadata(networkType, packageId, fullnodeUrls) {
2747
2761
  fullnodeUrls = fullnodeUrls || [getFullnodeUrl(networkType)];
2748
2762
  const suiInteractor = new SuiInteractor(fullnodeUrls);
2749
2763
  if (packageId !== void 0) {
2750
- const jsonData = await suiInteractor.getNormalizedMoveModulesByPackage(
2751
- packageId
2752
- );
2764
+ const jsonData = await suiInteractor.getNormalizedMoveModulesByPackage(packageId);
2753
2765
  return jsonData;
2754
2766
  } else {
2755
2767
  console.error("please set your package id.");
@@ -2759,6 +2771,7 @@ export {
2759
2771
  BcsType2 as BcsType,
2760
2772
  Dubhe,
2761
2773
  MultiSigClient,
2774
+ SubscriptionKind,
2762
2775
  SuiAccountManager,
2763
2776
  SuiContractFactory,
2764
2777
  SuiTx,