@mysten/docs 0.1.40 → 0.1.43
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/sui/clients/core.md +115 -1
- package/dist/sui/clients/grpc.md +68 -0
- package/dist/sui/migrations/sui-2.0/json-rpc-migration.md +104 -101
- package/package.json +23 -23
package/dist/sui/clients/core.md
CHANGED
|
@@ -439,6 +439,115 @@ const finalResult = await client.core.waitForTransaction({
|
|
|
439
439
|
});
|
|
440
440
|
```
|
|
441
441
|
|
|
442
|
+
## Query methods
|
|
443
|
+
|
|
444
|
+
Query methods return pages of transactions or events. They expose the same filters, pagination, and
|
|
445
|
+
results on every transport, and share a common set of options. A few transport-specific caveats
|
|
446
|
+
(page-size caps, gRPC scan-limited pages, generic event types and missing event checkpoints on the
|
|
447
|
+
deprecated JSON-RPC transport, and GraphQL's per-transaction event limit) are documented on the
|
|
448
|
+
corresponding option and response types in `SuiClientTypes`.
|
|
449
|
+
|
|
450
|
+
| Option | Type | Description |
|
|
451
|
+
| -------- | ---------------------------------- | ----------------------------------------------------- |
|
|
452
|
+
| `filter` | `TransactionFilter \| EventFilter` | Filter to apply (transactions and events) |
|
|
453
|
+
| `limit` | `number` | Maximum number of items to return (defaults to 50) |
|
|
454
|
+
| `after` | `string \| null` | Return items strictly after this cursor (ascending) |
|
|
455
|
+
| `before` | `string \| null` | Return items strictly before this cursor (descending) |
|
|
456
|
+
| `order` | `'ascending' \| 'descending'` | Order of results (defaults to `ascending`) |
|
|
457
|
+
|
|
458
|
+
A filter specifies exactly one predicate. MVR names in `function` and `eventType` predicates are
|
|
459
|
+
resolved automatically.
|
|
460
|
+
|
|
461
|
+
`after` and `before` are exclusive ledger-position bounds, and each page reports the positions of
|
|
462
|
+
its first and last items as `startCursor` and `endCursor`. You can provide at most one bound per
|
|
463
|
+
query, and the bound implies the traversal direction (`after` reads ascending, `before` reads
|
|
464
|
+
descending), so a feed of recent activity can page in both directions from any point:
|
|
465
|
+
|
|
466
|
+
```typescript
|
|
467
|
+
// Fetch the most recent transactions
|
|
468
|
+
const latest = await client.core.listTransactions({
|
|
469
|
+
filter: { sender: '0xabc...' },
|
|
470
|
+
order: 'descending',
|
|
471
|
+
limit: 10,
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
// Load older transactions
|
|
475
|
+
const older = await client.core.listTransactions({
|
|
476
|
+
filter: { sender: '0xabc...' },
|
|
477
|
+
before: latest.endCursor,
|
|
478
|
+
limit: 10,
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
// Poll for transactions executed since
|
|
482
|
+
const newer = await client.core.listTransactions({
|
|
483
|
+
filter: { sender: '0xabc...' },
|
|
484
|
+
after: latest.startCursor,
|
|
485
|
+
});
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
> **Note:** Richer filtering (combined predicates, additional predicates like affected addresses and objects,
|
|
489
|
+
> and checkpoint ranges on transaction and event queries) is available through the [raw gRPC ledger
|
|
490
|
+
> service](/sui/clients/grpc#ledger-service) and [raw GraphQL queries](/sui/clients/graphql).
|
|
491
|
+
|
|
492
|
+
### `listTransactions`
|
|
493
|
+
|
|
494
|
+
Query transactions matching a filter. Results support the same `include` options as
|
|
495
|
+
[`getTransaction`](#gettransaction).
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
const result = await client.core.listTransactions({
|
|
499
|
+
filter: { function: '0x2::coin::transfer' },
|
|
500
|
+
limit: 10,
|
|
501
|
+
include: { effects: true },
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
for (const tx of result.transactions) {
|
|
505
|
+
const transaction = tx.Transaction ?? tx.FailedTransaction;
|
|
506
|
+
console.log(transaction.digest, tx.$kind);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// Paginate
|
|
510
|
+
if (result.hasNextPage) {
|
|
511
|
+
const nextPage = await client.core.listTransactions({
|
|
512
|
+
filter: { function: '0x2::coin::transfer' },
|
|
513
|
+
after: result.endCursor,
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
Transaction filters support one of the following predicates:
|
|
519
|
+
|
|
520
|
+
| Predicate | Description |
|
|
521
|
+
| ---------- | --------------------------------------------------------------------------- |
|
|
522
|
+
| `sender` | Transactions sent by an address |
|
|
523
|
+
| `function` | Transactions calling a Move function (`pkg`, `pkg::mod`, or `pkg::mod::fn`) |
|
|
524
|
+
|
|
525
|
+
### `listEvents`
|
|
526
|
+
|
|
527
|
+
Query events matching a filter. Each event includes its position in the ledger (`transactionDigest`
|
|
528
|
+
and `eventIndex`, plus `checkpoint` on transports that can provide it; `checkpoint` is `null` on
|
|
529
|
+
JSON-RPC).
|
|
530
|
+
|
|
531
|
+
```typescript
|
|
532
|
+
const result = await client.core.listEvents({
|
|
533
|
+
filter: { eventType: '0x2::coin::CoinCreated' },
|
|
534
|
+
order: 'descending',
|
|
535
|
+
limit: 10,
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
for (const event of result.events) {
|
|
539
|
+
console.log(event.eventType, event.transactionDigest, event.json);
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Event filters support one of the following predicates:
|
|
544
|
+
|
|
545
|
+
| Predicate | Description |
|
|
546
|
+
| ------------ | --------------------------------------------------------------------------------- |
|
|
547
|
+
| `sender` | Events from transactions sent by an address |
|
|
548
|
+
| `emitModule` | Events emitted by a module (`pkg::mod`) |
|
|
549
|
+
| `eventType` | Events with types defined in a module (`pkg::mod`) or a fully qualified type name |
|
|
550
|
+
|
|
442
551
|
## System methods
|
|
443
552
|
|
|
444
553
|
### `getReferenceGasPrice`
|
|
@@ -591,6 +700,9 @@ const options: SuiClientTypes.GetObjectOptions<{ content: true }> = {
|
|
|
591
700
|
| `TransactionResult` | Success or failure result from execution |
|
|
592
701
|
| `TransactionEffects` | Detailed effects from transaction execution |
|
|
593
702
|
| `Event` | Emitted event from a transaction |
|
|
703
|
+
| `EventEntry` | Queried event with its ledger position |
|
|
704
|
+
| `TransactionFilter` | Filter for transaction queries |
|
|
705
|
+
| `EventFilter` | Filter for event queries |
|
|
594
706
|
| `ObjectOwner` | Union of all owner types |
|
|
595
707
|
| `ExecutionStatus` | Success/failure status with error details |
|
|
596
708
|
| `DynamicFieldName` | Name identifier for dynamic fields |
|
|
@@ -620,4 +732,6 @@ const options: SuiClientTypes.GetObjectOptions<{ content: true }> = {
|
|
|
620
732
|
| `SimulateTransactionOptions` | Options for `simulateTransaction` |
|
|
621
733
|
| `SignAndExecuteTransactionOptions` | Options for `signAndExecuteTransaction` |
|
|
622
734
|
| `GetTransactionOptions` | Options for `getTransaction` |
|
|
623
|
-
| `WaitForTransactionOptions` | Options for `waitForTransaction` |
|
|
735
|
+
| `WaitForTransactionOptions` | Options for `waitForTransaction` |
|
|
736
|
+
| `ListTransactionsOptions` | Options for `listTransactions` |
|
|
737
|
+
| `ListEventsOptions` | Options for `listEvents` |
|
package/dist/sui/clients/grpc.md
CHANGED
|
@@ -157,6 +157,74 @@ const { response } = await grpcClient.ledgerService.getTransaction({
|
|
|
157
157
|
const { response: epochInfo } = await grpcClient.ledgerService.getEpoch({});
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
+
The ledger service also provides streaming `listCheckpoints`, `listTransactions`, and `listEvents`
|
|
161
|
+
RPCs. For most use cases, prefer the corresponding
|
|
162
|
+
[core API query methods](/sui/clients/core#query-methods) (`listTransactions` and `listEvents`),
|
|
163
|
+
which handle pagination and filter construction for you. The raw RPCs additionally support DNF
|
|
164
|
+
filters (combined, negated, and additional predicates like `affected_address` and `package_write`)
|
|
165
|
+
and checkpoint range bounds that the core API does not expose:
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
// Transactions that affected an address but were not sent by it:
|
|
169
|
+
const stream = grpcClient.ledgerService.listTransactions({
|
|
170
|
+
filter: {
|
|
171
|
+
terms: [
|
|
172
|
+
{
|
|
173
|
+
literals: [
|
|
174
|
+
{
|
|
175
|
+
negated: false,
|
|
176
|
+
predicate: {
|
|
177
|
+
oneofKind: 'affectedAddress',
|
|
178
|
+
affectedAddress: { address: '0xabc...' },
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
negated: true,
|
|
183
|
+
predicate: { oneofKind: 'sender', sender: { address: '0xabc...' } },
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
readMask: { paths: ['digest'] },
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
for await (const frame of stream.responses) {
|
|
193
|
+
if (frame.transaction) {
|
|
194
|
+
console.log(frame.transaction.digest);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Subscription service
|
|
200
|
+
|
|
201
|
+
Subscribe to filtered, real-time streams of checkpoints, transactions, or events. Streams begin at
|
|
202
|
+
the current tip of the chain:
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
const stream = grpcClient.subscriptionService.subscribeTransactions({
|
|
206
|
+
filter: {
|
|
207
|
+
terms: [
|
|
208
|
+
{
|
|
209
|
+
literals: [
|
|
210
|
+
{
|
|
211
|
+
negated: false,
|
|
212
|
+
predicate: { oneofKind: 'sender', sender: { address: '0xabc...' } },
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
readMask: { paths: ['digest', 'effects.status'] },
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
for await (const frame of stream.responses) {
|
|
222
|
+
if (frame.transaction) {
|
|
223
|
+
console.log(frame.transaction.digest);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
160
228
|
### State service
|
|
161
229
|
|
|
162
230
|
```typescript
|
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
This guide covers migrating from `SuiJsonRpcClient` to the new client APIs. The JSON-RPC API is
|
|
6
6
|
being deprecated in favor of `SuiGrpcClient` and `SuiGraphQLClient`.
|
|
7
7
|
|
|
8
|
-
> **Note:**
|
|
9
|
-
>
|
|
8
|
+
> **Note:** Use `SuiGrpcClient` for most operations, including filtering transactions and events with the core
|
|
9
|
+
> query API. `SuiGraphQLClient` remains useful for complex queries that aren't covered by the core
|
|
10
|
+
> API.
|
|
10
11
|
|
|
11
12
|
## Choosing a client
|
|
12
13
|
|
|
13
|
-
| Client | Best For
|
|
14
|
-
| ------------------ |
|
|
15
|
-
| `SuiGrpcClient` | Most operations, SDK integrations, real-time data
|
|
16
|
-
| `SuiGraphQLClient` | Complex queries
|
|
14
|
+
| Client | Best For |
|
|
15
|
+
| ------------------ | -------------------------------------------------------------------- |
|
|
16
|
+
| `SuiGrpcClient` | Most operations, SDK integrations, queries, real-time data |
|
|
17
|
+
| `SuiGraphQLClient` | Complex queries not covered by the core API, like historical objects |
|
|
17
18
|
|
|
18
19
|
## Quick migration to gRPC
|
|
19
20
|
|
|
@@ -58,6 +59,58 @@ These JSON-RPC methods have direct replacements in the core API:
|
|
|
58
59
|
| `dryRunTransactionBlock` | `simulateTransaction` |
|
|
59
60
|
| `getNormalizedMoveFunction` | `getMoveFunction` |
|
|
60
61
|
| `getMoveFunctionArgTypes` | `getMoveFunction` |
|
|
62
|
+
| `queryTransactionBlocks` | `listTransactions` |
|
|
63
|
+
| `queryEvents` | `listEvents` |
|
|
64
|
+
|
|
65
|
+
> **Note:** The query methods (`listTransactions` and `listEvents`) behave identically on every client,
|
|
66
|
+
> including `SuiJsonRpcClient`. See [Core API query methods](/sui/clients/core#query-methods) for
|
|
67
|
+
> details.
|
|
68
|
+
|
|
69
|
+
### Example: Migrating queryTransactionBlocks
|
|
70
|
+
|
|
71
|
+
```diff
|
|
72
|
+
- const result = await jsonRpcClient.queryTransactionBlocks({
|
|
73
|
+
- filter: { FromAddress: '0xabc...' },
|
|
74
|
+
- options: { showEffects: true },
|
|
75
|
+
- limit: 10,
|
|
76
|
+
- });
|
|
77
|
+
- const digests = result.data.map((tx) => tx.digest);
|
|
78
|
+
+ const result = await client.core.listTransactions({
|
|
79
|
+
+ filter: { sender: '0xabc...' },
|
|
80
|
+
+ include: { effects: true },
|
|
81
|
+
+ limit: 10,
|
|
82
|
+
+ });
|
|
83
|
+
+ const digests = result.transactions.map(
|
|
84
|
+
+ (tx) => (tx.Transaction ?? tx.FailedTransaction).digest,
|
|
85
|
+
+ );
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The core API filters map to the JSON-RPC `TransactionFilter` variants:
|
|
89
|
+
|
|
90
|
+
| JSON-RPC filter | Core API filter predicate |
|
|
91
|
+
| -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
92
|
+
| `FromAddress` | `sender` |
|
|
93
|
+
| `MoveFunction` | `function` |
|
|
94
|
+
| `ToAddress` / `FromOrToAddress` / `ChangedObject` / `AffectedObject` | No core equivalent. Use raw [gRPC](/sui/clients/grpc#ledger-service) or [GraphQL](/sui/clients/graphql) queries |
|
|
95
|
+
|
|
96
|
+
### Example: Migrating queryEvents
|
|
97
|
+
|
|
98
|
+
```diff
|
|
99
|
+
- const result = await jsonRpcClient.queryEvents({
|
|
100
|
+
- query: { MoveEventType: '0x2::coin::CoinCreated' },
|
|
101
|
+
- limit: 10,
|
|
102
|
+
- order: 'descending',
|
|
103
|
+
- });
|
|
104
|
+
+ const result = await client.core.listEvents({
|
|
105
|
+
+ filter: { eventType: '0x2::coin::CoinCreated' },
|
|
106
|
+
+ limit: 10,
|
|
107
|
+
+ order: 'descending',
|
|
108
|
+
+ });
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The JSON-RPC `EventFilter` variants map to `sender`, `emitModule` (replaces `MoveModule` /
|
|
112
|
+
`MoveEventModule`), and `eventType` (replaces `MoveEventType`). Each returned event includes its
|
|
113
|
+
ledger position (`checkpoint`, `transactionDigest`, and `eventIndex`).
|
|
61
114
|
|
|
62
115
|
### Example: Migrating devInspectTransactionBlock
|
|
63
116
|
|
|
@@ -95,6 +148,7 @@ These JSON-RPC methods can be replaced by calling gRPC service clients directly:
|
|
|
95
148
|
| JSON-RPC Method | gRPC Service Replacement |
|
|
96
149
|
| ----------------------------------- | ---------------------------------------------------------------- |
|
|
97
150
|
| `getCheckpoint` | `ledgerService.getCheckpoint` |
|
|
151
|
+
| `getCheckpoints` | `ledgerService.listCheckpoints` |
|
|
98
152
|
| `getLatestCheckpointSequenceNumber` | `ledgerService.getServiceInfo` (read `checkpointHeight`) |
|
|
99
153
|
| `getCurrentEpoch` | `ledgerService.getEpoch` (omit `epoch` for the current) |
|
|
100
154
|
| `getLatestSuiSystemState` | `ledgerService.getEpoch` with `system_state` in the read mask |
|
|
@@ -108,10 +162,10 @@ These JSON-RPC methods can be replaced by calling gRPC service clients directly:
|
|
|
108
162
|
| `resolveNameServiceAddress` | `nameService.lookupName` |
|
|
109
163
|
| `resolveNameServiceNames` | `nameService.reverseLookupName` |
|
|
110
164
|
|
|
111
|
-
> **Warning:** `
|
|
112
|
-
> `
|
|
113
|
-
>
|
|
114
|
-
>
|
|
165
|
+
> **Warning:** `getEpochs` (paginated listing) has no gRPC equivalent. Use the `epochs` GraphQL query instead.
|
|
166
|
+
> `getValidatorsApy` also has no replacement: there is no canonical definition of validator APY, so
|
|
167
|
+
> it must be computed client-side from validator exchange rates (see [Validator APY](#validator-apy)
|
|
168
|
+
> below).
|
|
115
169
|
|
|
116
170
|
### Example: using gRPC service clients
|
|
117
171
|
|
|
@@ -167,16 +221,53 @@ const { response: address } = await client.nameService.lookupName({
|
|
|
167
221
|
});
|
|
168
222
|
```
|
|
169
223
|
|
|
224
|
+
## Methods replaced by gRPC subscriptions
|
|
225
|
+
|
|
226
|
+
Replace the deprecated JSON-RPC websocket subscriptions with the gRPC `subscriptionService`, which
|
|
227
|
+
provides filtered, real-time streams:
|
|
228
|
+
|
|
229
|
+
| JSON-RPC Method | gRPC Service Replacement |
|
|
230
|
+
| ---------------------- | ------------------------------------------- |
|
|
231
|
+
| `subscribeTransaction` | `subscriptionService.subscribeTransactions` |
|
|
232
|
+
| `subscribeEvent` | `subscriptionService.subscribeEvents` |
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
const stream = client.subscriptionService.subscribeEvents({
|
|
236
|
+
filter: {
|
|
237
|
+
terms: [
|
|
238
|
+
{
|
|
239
|
+
literals: [
|
|
240
|
+
{
|
|
241
|
+
negated: false,
|
|
242
|
+
predicate: {
|
|
243
|
+
oneofKind: 'eventType',
|
|
244
|
+
eventType: { eventType: '0x2::coin::CoinCreated' },
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
readMask: { paths: ['event_type', 'contents', 'json', 'checkpoint', 'transaction_digest'] },
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
for await (const frame of stream.responses) {
|
|
255
|
+
if (frame.event) {
|
|
256
|
+
console.log(frame.event.eventType, frame.event.json);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Subscriptions always begin at the current tip of the chain. To recover events you missed between
|
|
262
|
+
subscriptions, replay the gap with `client.core.listEvents` using the same filter.
|
|
263
|
+
|
|
170
264
|
## Methods requiring GraphQL
|
|
171
265
|
|
|
172
266
|
Some JSON-RPC methods don't have gRPC equivalents and require using `SuiGraphQLClient` instead:
|
|
173
267
|
|
|
174
268
|
| JSON-RPC Method | GraphQL Alternative |
|
|
175
269
|
| --------------------------- | --------------------------------------------------------- |
|
|
176
|
-
| `queryTransactionBlocks` | `transactions` query |
|
|
177
270
|
| `multiGetTransactionBlocks` | `multiGetTransactionEffects` query |
|
|
178
|
-
| `queryEvents` | `events` query |
|
|
179
|
-
| `getCheckpoints` | `checkpoints` query |
|
|
180
271
|
| `getEpochs` | `epochs` query |
|
|
181
272
|
| `getCoinMetadata` | `coinMetadata` query (or gRPC `stateService.getCoinInfo`) |
|
|
182
273
|
| `getTotalSupply` | `coinMetadata` query (or gRPC `stateService.getCoinInfo`) |
|
|
@@ -197,94 +288,6 @@ const graphqlClient = new SuiGraphQLClient({
|
|
|
197
288
|
});
|
|
198
289
|
```
|
|
199
290
|
|
|
200
|
-
### Querying transactions
|
|
201
|
-
|
|
202
|
-
Replace `queryTransactionBlocks` with a GraphQL query:
|
|
203
|
-
|
|
204
|
-
```typescript
|
|
205
|
-
const result = await graphqlClient.query({
|
|
206
|
-
query: `
|
|
207
|
-
query QueryTransactions($sender: SuiAddress, $first: Int, $after: String) {
|
|
208
|
-
transactions(
|
|
209
|
-
first: $first
|
|
210
|
-
after: $after
|
|
211
|
-
filter: { sentAddress: $sender }
|
|
212
|
-
) {
|
|
213
|
-
pageInfo {
|
|
214
|
-
hasNextPage
|
|
215
|
-
endCursor
|
|
216
|
-
}
|
|
217
|
-
nodes {
|
|
218
|
-
digest
|
|
219
|
-
effects {
|
|
220
|
-
status
|
|
221
|
-
epoch { epochId }
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
`,
|
|
227
|
-
variables: {
|
|
228
|
-
sender: '0xabc...',
|
|
229
|
-
first: 10,
|
|
230
|
-
},
|
|
231
|
-
});
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
**Available transaction filters:**
|
|
235
|
-
|
|
236
|
-
- `sentAddress`: Filter by sender address
|
|
237
|
-
- `affectedAddress`: Filter by any address involved in the transaction
|
|
238
|
-
- `affectedObject`: Filter by object ID that was affected
|
|
239
|
-
- `function`: Filter by Move function called (for example, `0x2::coin::transfer`)
|
|
240
|
-
- `kind`: Filter by transaction kind (`SYSTEM` or `PROGRAMMABLE`)
|
|
241
|
-
- `atCheckpoint` / `beforeCheckpoint` / `afterCheckpoint` - Filter by checkpoint
|
|
242
|
-
|
|
243
|
-
### Querying events
|
|
244
|
-
|
|
245
|
-
Replace `queryEvents` with a GraphQL query:
|
|
246
|
-
|
|
247
|
-
```typescript
|
|
248
|
-
const result = await graphqlClient.query({
|
|
249
|
-
query: `
|
|
250
|
-
query QueryEvents($type: String, $first: Int, $after: String) {
|
|
251
|
-
events(
|
|
252
|
-
first: $first
|
|
253
|
-
after: $after
|
|
254
|
-
filter: { type: $type }
|
|
255
|
-
) {
|
|
256
|
-
pageInfo {
|
|
257
|
-
hasNextPage
|
|
258
|
-
endCursor
|
|
259
|
-
}
|
|
260
|
-
nodes {
|
|
261
|
-
transactionModule {
|
|
262
|
-
package { address }
|
|
263
|
-
name
|
|
264
|
-
}
|
|
265
|
-
sender { address }
|
|
266
|
-
contents {
|
|
267
|
-
type { repr }
|
|
268
|
-
bcs
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
`,
|
|
274
|
-
variables: {
|
|
275
|
-
type: '0x2::coin::CoinCreated',
|
|
276
|
-
first: 10,
|
|
277
|
-
},
|
|
278
|
-
});
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
**Available event filters:**
|
|
282
|
-
|
|
283
|
-
- `type`: Filter by event type (package, package::module, or full type)
|
|
284
|
-
- `module`: Filter by emitting module
|
|
285
|
-
- `sender`: Filter by transaction sender
|
|
286
|
-
- `atCheckpoint` / `beforeCheckpoint` / `afterCheckpoint`: Filter by checkpoint
|
|
287
|
-
|
|
288
291
|
### Fetching multiple transactions
|
|
289
292
|
|
|
290
293
|
Replace `multiGetTransactionBlocks` with a GraphQL query:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mysten/docs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.43",
|
|
4
4
|
"description": "LLM-friendly documentation for the Sui TypeScript SDK ecosystem",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -25,31 +25,31 @@
|
|
|
25
25
|
"fumadocs-mdx": "15.0.12",
|
|
26
26
|
"fumadocs-typescript": "^5.2.6",
|
|
27
27
|
"fumadocs-ui": "16.10.2",
|
|
28
|
-
"next": "^16.2.
|
|
28
|
+
"next": "^16.2.12",
|
|
29
29
|
"react": "^19.2.7",
|
|
30
30
|
"react-dom": "^19.2.7",
|
|
31
|
-
"@mysten/aws-kms-signer": "0.3.
|
|
31
|
+
"@mysten/aws-kms-signer": "0.3.9",
|
|
32
32
|
"@mysten/bcs": "2.1.0",
|
|
33
|
-
"@mysten/dapp-kit": "1.
|
|
34
|
-
"@mysten/dapp-kit
|
|
35
|
-
"@mysten/dapp-kit-react": "2.1.
|
|
36
|
-
"@mysten/enoki": "1.
|
|
37
|
-
"@mysten/deepbook-v3": "1.
|
|
38
|
-
"@mysten/
|
|
39
|
-
"@mysten/gcp-kms-signer": "0.2.
|
|
40
|
-
"@mysten/
|
|
41
|
-
"@mysten/
|
|
42
|
-
"@mysten/seal": "1.3.
|
|
43
|
-
"@mysten/signers": "1.1.
|
|
44
|
-
"@mysten/slush-wallet": "1.1.
|
|
45
|
-
"@mysten/
|
|
46
|
-
"@mysten/
|
|
47
|
-
"@mysten/
|
|
48
|
-
"@mysten/payment-kit": "0.2.9",
|
|
49
|
-
"@mysten/walrus": "1.2.9",
|
|
50
|
-
"@mysten/webcrypto-signer": "0.2.9",
|
|
33
|
+
"@mysten/dapp-kit-core": "1.6.12",
|
|
34
|
+
"@mysten/dapp-kit": "1.1.12",
|
|
35
|
+
"@mysten/dapp-kit-react": "2.1.14",
|
|
36
|
+
"@mysten/enoki-connect": "1.1.12",
|
|
37
|
+
"@mysten/deepbook-v3": "1.6.2",
|
|
38
|
+
"@mysten/kiosk": "1.3.12",
|
|
39
|
+
"@mysten/gcp-kms-signer": "0.2.12",
|
|
40
|
+
"@mysten/ledger-signer": "0.2.12",
|
|
41
|
+
"@mysten/enoki": "1.2.10",
|
|
42
|
+
"@mysten/seal": "1.3.7",
|
|
43
|
+
"@mysten/signers": "1.1.12",
|
|
44
|
+
"@mysten/slush-wallet": "1.1.12",
|
|
45
|
+
"@mysten/payment-kit": "0.2.12",
|
|
46
|
+
"@mysten/sui": "2.23.1",
|
|
47
|
+
"@mysten/suins": "1.2.12",
|
|
51
48
|
"@mysten/utils": "0.4.0",
|
|
52
|
-
"@mysten/
|
|
49
|
+
"@mysten/wallet-standard": "0.21.12",
|
|
50
|
+
"@mysten/webcrypto-signer": "0.2.12",
|
|
51
|
+
"@mysten/zksend": "1.2.12",
|
|
52
|
+
"@mysten/walrus": "1.2.12"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@tailwindcss/postcss": "^4.3.1",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@types/node": "^25.9.3",
|
|
58
58
|
"@types/react": "^19.2.17",
|
|
59
59
|
"@types/react-dom": "^19.2.3",
|
|
60
|
-
"postcss": "
|
|
60
|
+
"postcss": "^8.5.23",
|
|
61
61
|
"tailwindcss": "^4.3.1",
|
|
62
62
|
"typedoc": "^0.28.19",
|
|
63
63
|
"typedoc-plugin-mermaid": "^1.12.0",
|