@0xobelisk/sui-client 1.2.0-pre.15 → 1.2.0-pre.16
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 +5 -1
- package/dist/index.js +51 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -7
- package/dist/index.mjs.map +1 -1
- package/dist/libs/suiIndexerClient/index.d.ts +10 -1
- package/package.json +1 -1
- package/src/dubhe.ts +12 -0
- package/src/libs/suiIndexerClient/index.ts +50 -4
package/dist/dubhe.d.ts
CHANGED
|
@@ -58,13 +58,17 @@ export declare class Dubhe {
|
|
|
58
58
|
params: any[];
|
|
59
59
|
customModuleName?: string;
|
|
60
60
|
}): Promise<any[] | undefined>;
|
|
61
|
-
getTransactions({ first, after, sender, digest, checkpoint, orderBy, }: {
|
|
61
|
+
getTransactions({ first, after, sender, digest, checkpoint, packageId, module, functionName, orderBy, showEvent, }: {
|
|
62
62
|
first?: number;
|
|
63
63
|
after?: string;
|
|
64
64
|
sender?: string;
|
|
65
65
|
digest?: string;
|
|
66
66
|
checkpoint?: number;
|
|
67
|
+
packageId?: string;
|
|
68
|
+
module?: string;
|
|
69
|
+
functionName?: string[];
|
|
67
70
|
orderBy?: string[];
|
|
71
|
+
showEvent?: boolean;
|
|
68
72
|
}): Promise<ConnectionResponse<IndexerTransaction>>;
|
|
69
73
|
getTransaction(digest: string): Promise<IndexerTransaction | undefined>;
|
|
70
74
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1130,8 +1130,30 @@ var SuiIndexerClient = class {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
async getTransactions(params) {
|
|
1132
1132
|
const query = `
|
|
1133
|
-
query GetTransactions(
|
|
1134
|
-
|
|
1133
|
+
query GetTransactions(
|
|
1134
|
+
$first: Int,
|
|
1135
|
+
$after: String,
|
|
1136
|
+
$sender: String,
|
|
1137
|
+
$digest: String,
|
|
1138
|
+
$checkpoint: Int,
|
|
1139
|
+
$packageId: String,
|
|
1140
|
+
$module: String,
|
|
1141
|
+
$functionName: [String!],
|
|
1142
|
+
$orderBy: [TransactionOrderField!],
|
|
1143
|
+
$showEvent: Boolean!
|
|
1144
|
+
) {
|
|
1145
|
+
transactions(
|
|
1146
|
+
first: $first,
|
|
1147
|
+
after: $after,
|
|
1148
|
+
sender: $sender,
|
|
1149
|
+
digest: $digest,
|
|
1150
|
+
checkpoint: $checkpoint,
|
|
1151
|
+
packageId: $packageId,
|
|
1152
|
+
module: $module,
|
|
1153
|
+
functionName: $functionName,
|
|
1154
|
+
orderBy: $orderBy,
|
|
1155
|
+
showEvent: $showEvent
|
|
1156
|
+
) {
|
|
1135
1157
|
edges {
|
|
1136
1158
|
cursor
|
|
1137
1159
|
node {
|
|
@@ -1139,7 +1161,20 @@ var SuiIndexerClient = class {
|
|
|
1139
1161
|
checkpoint
|
|
1140
1162
|
digest
|
|
1141
1163
|
sender
|
|
1164
|
+
package
|
|
1165
|
+
module
|
|
1166
|
+
function
|
|
1167
|
+
arguments
|
|
1142
1168
|
created_at
|
|
1169
|
+
events @include(if: $showEvent) {
|
|
1170
|
+
id
|
|
1171
|
+
checkpoint
|
|
1172
|
+
digest
|
|
1173
|
+
name
|
|
1174
|
+
sender
|
|
1175
|
+
value
|
|
1176
|
+
created_at
|
|
1177
|
+
}
|
|
1143
1178
|
}
|
|
1144
1179
|
}
|
|
1145
1180
|
pageInfo {
|
|
@@ -1150,13 +1185,14 @@ var SuiIndexerClient = class {
|
|
|
1150
1185
|
}
|
|
1151
1186
|
}
|
|
1152
1187
|
`;
|
|
1153
|
-
const response = await this.fetchGraphql(query, params);
|
|
1188
|
+
const response = await this.fetchGraphql(query, { ...params, showEvent: params?.showEvent ?? false });
|
|
1154
1189
|
return response.transactions;
|
|
1155
1190
|
}
|
|
1156
|
-
async getTransaction(digest) {
|
|
1191
|
+
async getTransaction(digest, showEvent) {
|
|
1157
1192
|
const response = await this.getTransactions({
|
|
1158
1193
|
first: 1,
|
|
1159
|
-
digest
|
|
1194
|
+
digest,
|
|
1195
|
+
showEvent
|
|
1160
1196
|
});
|
|
1161
1197
|
return response.edges[0]?.node;
|
|
1162
1198
|
}
|
|
@@ -2309,7 +2345,11 @@ var Dubhe = class {
|
|
|
2309
2345
|
sender,
|
|
2310
2346
|
digest,
|
|
2311
2347
|
checkpoint,
|
|
2312
|
-
|
|
2348
|
+
packageId,
|
|
2349
|
+
module: module2,
|
|
2350
|
+
functionName,
|
|
2351
|
+
orderBy,
|
|
2352
|
+
showEvent
|
|
2313
2353
|
}) {
|
|
2314
2354
|
return await this.suiIndexerClient.getTransactions({
|
|
2315
2355
|
first,
|
|
@@ -2317,7 +2357,11 @@ var Dubhe = class {
|
|
|
2317
2357
|
sender,
|
|
2318
2358
|
digest,
|
|
2319
2359
|
checkpoint,
|
|
2320
|
-
|
|
2360
|
+
packageId,
|
|
2361
|
+
module: module2,
|
|
2362
|
+
functionName,
|
|
2363
|
+
orderBy,
|
|
2364
|
+
showEvent
|
|
2321
2365
|
});
|
|
2322
2366
|
}
|
|
2323
2367
|
async getTransaction(digest) {
|