@mysten/docs 0.1.45 → 0.1.47
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/codegen/index.md +307 -25
- package/dist/llms-index.md +6 -5
- package/dist/sui/bcs.md +2 -2
- package/dist/sui/clients/core.md +150 -710
- package/dist/sui/clients/executing.md +113 -0
- package/dist/sui/clients/graphql.md +80 -70
- package/dist/sui/clients/grpc.md +223 -208
- package/dist/sui/clients/index.md +56 -67
- package/dist/sui/clients/querying.md +539 -0
- package/dist/sui/llms-index.md +6 -5
- package/dist/sui/migrations/sui-2.0/json-rpc-migration.md +3 -1
- package/dist/sui/transactions/signing-and-execution.md +8 -28
- package/package.json +21 -21
- package/dist/sui/clients/json-rpc.md +0 -243
package/dist/codegen/index.md
CHANGED
|
@@ -67,15 +67,16 @@ This generates TypeScript code in your configured output directory (for example,
|
|
|
67
67
|
|
|
68
68
|
The `SuiCodegenConfig` type supports the following options:
|
|
69
69
|
|
|
70
|
-
| Option | Type | Default
|
|
71
|
-
| ------------------------------ | ---------------------- |
|
|
72
|
-
| `output` | `string` | -
|
|
73
|
-
| `packages` | `PackageConfig[]` | -
|
|
74
|
-
| `prune` | `boolean` | `true`
|
|
75
|
-
| `generateSummaries` | `boolean` | `true`
|
|
76
|
-
| `generate` | `GenerateOptions` | -
|
|
77
|
-
| `importExtension` | `'.js' \| '.ts' \| ''` | `'.js'`
|
|
78
|
-
| `includePhantomTypeParameters` | `boolean` | `false`
|
|
70
|
+
| Option | Type | Default | Description |
|
|
71
|
+
| ------------------------------ | ---------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
72
|
+
| `output` | `string` | - | The directory where codegen writes generated code |
|
|
73
|
+
| `packages` | `PackageConfig[]` | - | Array of Move packages to generate code for |
|
|
74
|
+
| `prune` | `boolean` | `true` | When enabled, only generates code for the main package and omits dependency modules (dependency types referenced by included types are still generated under `deps/`) |
|
|
75
|
+
| `generateSummaries` | `boolean` | `true` | Automatically run `sui move summary` before generating code. Creates a `package_summaries` directory in your Move package which can be added to `.gitignore` |
|
|
76
|
+
| `generate` | `GenerateOptions` | - | Default [generate options](#the-generate-option) (types, functions) for all packages |
|
|
77
|
+
| `importExtension` | `'.js' \| '.ts' \| ''` | `'.js'` | File extension used in generated import statements |
|
|
78
|
+
| `includePhantomTypeParameters` | `boolean` | `false` | Include [phantom type parameters](#phantom-types) as function arguments in generated BCS types |
|
|
79
|
+
| `fullnodeUrls` | network URL map | Sui public fullnodes | Override the Mainnet or Testnet fullnode used to fetch onchain package summaries |
|
|
79
80
|
|
|
80
81
|
### Package configuration
|
|
81
82
|
|
|
@@ -84,12 +85,14 @@ local (from source) or onchain (fetched from a network).
|
|
|
84
85
|
|
|
85
86
|
#### Local packages
|
|
86
87
|
|
|
87
|
-
| Option
|
|
88
|
-
|
|
|
89
|
-
| `package`
|
|
90
|
-
| `path`
|
|
91
|
-
| `packageName`
|
|
92
|
-
| `generate`
|
|
88
|
+
| Option | Type | Required | Description |
|
|
89
|
+
| ----------------- | ------------------------ | -------- | ------------------------------------------------------------------------------------------------ |
|
|
90
|
+
| `package` | `string` | yes | Package identifier (for example, `@local-pkg/my-package`) |
|
|
91
|
+
| `path` | `string` | yes | Path to the Move package directory |
|
|
92
|
+
| `packageName` | `string` | no | Custom name for generated code directory |
|
|
93
|
+
| `generate` | `PackageGenerateOptions` | no | Control what gets generated from this package |
|
|
94
|
+
| `configArguments` | `ConfigArguments` | no | Map this package's function parameters to a [runtime config object](#the-configarguments-option) |
|
|
95
|
+
| `bcsOverrides` | `BcsOverrides` | no | Replace generated BCS types with [custom types](#the-bcsoverrides-option) |
|
|
93
96
|
|
|
94
97
|
```typescript
|
|
95
98
|
{
|
|
@@ -103,12 +106,15 @@ local (from source) or onchain (fetched from a network).
|
|
|
103
106
|
For packages already deployed onchain, generate code directly from a package ID or MVR name without
|
|
104
107
|
needing local source code:
|
|
105
108
|
|
|
106
|
-
| Option
|
|
107
|
-
|
|
|
108
|
-
| `package`
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
109
|
+
| Option | Type | Required | Description |
|
|
110
|
+
| ----------------- | ------------------------ | -------- | ------------------------------------------------------------------------------------------------ |
|
|
111
|
+
| `package` | `string` | yes | Package ID or name emitted into generated code |
|
|
112
|
+
| `sourcePackageId` | `string` | no | Package ID to fetch when generating an unpublished package name |
|
|
113
|
+
| `packageName` | `string` | yes | Name for the generated code directory |
|
|
114
|
+
| `network` | `'mainnet' \| 'testnet'` | yes | Network to resolve and fetch the package from |
|
|
115
|
+
| `generate` | `PackageGenerateOptions` | no | Control what gets generated from this package |
|
|
116
|
+
| `configArguments` | `ConfigArguments` | no | Map this package's function parameters to a [runtime config object](#the-configarguments-option) |
|
|
117
|
+
| `bcsOverrides` | `BcsOverrides` | no | Replace generated BCS types with [custom types](#the-bcsoverrides-option) |
|
|
112
118
|
|
|
113
119
|
```typescript
|
|
114
120
|
{
|
|
@@ -267,6 +273,271 @@ src/contracts/
|
|
|
267
273
|
|
|
268
274
|
Set `prune: false` to generate all dependency modules with their full types and functions.
|
|
269
275
|
|
|
276
|
+
## The `configArguments` option
|
|
277
|
+
|
|
278
|
+
SDKs built on generated bindings often spend a lot of wrapper code passing values from a per-network
|
|
279
|
+
config object (package IDs, registry or treasury object IDs, pool addresses) into generated function
|
|
280
|
+
calls. The `configArguments` option moves that mapping into codegen: declare which Move types (or
|
|
281
|
+
package addresses) come from a config object, and the generated functions accept that config object
|
|
282
|
+
directly.
|
|
283
|
+
|
|
284
|
+
`configArguments` is set on a package entry and maps config keys to matchers. Matchers reference
|
|
285
|
+
types as `module::Type`, optionally qualified with a package identifier from the `packages` config
|
|
286
|
+
or an address:
|
|
287
|
+
|
|
288
|
+
```typescript
|
|
289
|
+
const config: SuiCodegenConfig = {
|
|
290
|
+
output: './src/contracts',
|
|
291
|
+
packages: [
|
|
292
|
+
{
|
|
293
|
+
package: '@myapp/core',
|
|
294
|
+
path: './move/core',
|
|
295
|
+
configArguments: {
|
|
296
|
+
// Every parameter of this type resolves from `config.registry`
|
|
297
|
+
registry: { type: 'registry::Registry' },
|
|
298
|
+
// Generic type: matches every instantiation, config value must be a resolver function
|
|
299
|
+
pool: { type: 'pool::Pool' },
|
|
300
|
+
// Instantiated generic: only matches this exact instantiation
|
|
301
|
+
suiPool: { type: 'pool::Pool<0x2::sui::SUI>' },
|
|
302
|
+
// Function matcher: configures a single function's parameter
|
|
303
|
+
adminCap: { function: 'admin::set_fees', parameterName: 'cap' },
|
|
304
|
+
// Package entry: adds a config key that overrides the package address used for calls
|
|
305
|
+
corePackageId: { package: '@myapp/core' },
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
package: '@myapp/vaults',
|
|
310
|
+
path: './move/vaults',
|
|
311
|
+
configArguments: {
|
|
312
|
+
// Types from other packages are referenced by their package identifier
|
|
313
|
+
vaultPool: { type: '@myapp/core::pool::Pool' },
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
],
|
|
317
|
+
};
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Matcher rules:
|
|
321
|
+
|
|
322
|
+
- A bare `module::Type` refers to a type from the package the config is declared on.
|
|
323
|
+
- Types from other packages in the run use their package identifier (for example,
|
|
324
|
+
`@myapp/core::pool::Pool`) and must be dependencies of the declaring package.
|
|
325
|
+
- Types can also be referenced by an explicit address (for example, `0x2::sui::SUI`). Addresses
|
|
326
|
+
aren't validated, so only use addresses that are valid on every network your generated code
|
|
327
|
+
targets.
|
|
328
|
+
- Partially instantiated generics like `Pool<T>` are not supported. Use an uninstantiated matcher
|
|
329
|
+
with a resolver function instead.
|
|
330
|
+
- Function matchers can target a parameter by `parameterName` or `parameterIndex`. Both can be
|
|
331
|
+
omitted when the function has a single argument.
|
|
332
|
+
- A key can declare an array of matchers. If they span multiple types, the config value must be a
|
|
333
|
+
resolver function.
|
|
334
|
+
- Invalid matchers fail at generation time, and keys that never match any generated parameter
|
|
335
|
+
produce a warning.
|
|
336
|
+
|
|
337
|
+
### Generated output
|
|
338
|
+
|
|
339
|
+
For each function with matched parameters, the generated options gain an optional `config` property
|
|
340
|
+
typed with the keys that function uses. Matched parameters become optional in `arguments`, and an
|
|
341
|
+
explicitly passed argument always takes precedence over the config value:
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
|
|
345
|
+
package?: string;
|
|
346
|
+
arguments: BorrowArguments; // `pool` is optional here
|
|
347
|
+
config?: {
|
|
348
|
+
pool: (ctx: ConfigResolverContext) => string | TransactionObjectArgument;
|
|
349
|
+
corePackageId?: string;
|
|
350
|
+
};
|
|
351
|
+
typeArguments: [string];
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const packageAddress = options.package ?? options.config?.corePackageId ?? '@myapp/core';
|
|
355
|
+
// ...
|
|
356
|
+
pool: options.arguments?.pool ?? options.config?.pool?.({ ... }),
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
Keys bound to a single concrete type accept a plain value (an object ID or a transaction argument).
|
|
361
|
+
Keys that match a generic type, or multiple types, must be resolver functions, because a single ID
|
|
362
|
+
can't be correct for every instantiation. A resolver can also return a transaction callback
|
|
363
|
+
(`(ctx) => (tx) => ...`) to build the argument dynamically. Resolvers receive the matched
|
|
364
|
+
parameter's own type arguments plus call-site metadata:
|
|
365
|
+
|
|
366
|
+
```typescript
|
|
367
|
+
|
|
368
|
+
typeArguments: string[]; // canonical for concrete instantiations; as-provided for generic positions
|
|
369
|
+
packageAddress: string;
|
|
370
|
+
moduleName: string;
|
|
371
|
+
functionName: string;
|
|
372
|
+
parameterName?: string; // Move parameter name, when the summary includes names
|
|
373
|
+
parameterIndex: number; // position in the generated function's arguments
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
This makes resolvers reusable across functions that use the type in different positions:
|
|
378
|
+
|
|
379
|
+
```typescript
|
|
380
|
+
const myConfig = {
|
|
381
|
+
registry: '0x123...',
|
|
382
|
+
pool: (ctx: ConfigResolverContext) => poolsByCoinType[ctx.typeArguments[0]],
|
|
383
|
+
suiPool: '0x456...',
|
|
384
|
+
adminCap: '0x789...',
|
|
385
|
+
corePackageId: '0xabc...',
|
|
386
|
+
} satisfies CoreConfig;
|
|
387
|
+
|
|
388
|
+
tx.add(
|
|
389
|
+
borrow({
|
|
390
|
+
arguments: { amount: 100n },
|
|
391
|
+
config: myConfig,
|
|
392
|
+
typeArguments: ['0x2::sui::SUI'],
|
|
393
|
+
}),
|
|
394
|
+
);
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Each package's output also includes a `config-arguments.ts` file with an interface covering the
|
|
398
|
+
package's config keys, named after the package's `packageName` (for example, `packageName: 'core'`
|
|
399
|
+
produces `CoreConfig`). Use it with `satisfies` when defining your config object, as shown above. An
|
|
400
|
+
SDK spanning multiple packages can check one shared config object against the intersection of the
|
|
401
|
+
per-package interfaces:
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
const myConfig = { ... } satisfies CoreConfig & MarginConfig;
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Name refinement
|
|
408
|
+
|
|
409
|
+
When a signature has two parameters of the same matched type (for example, `base_pool` and
|
|
410
|
+
`quote_pool`, both `Pool<T>`), a bare type matcher matches both: the key's config value must then be
|
|
411
|
+
a resolver function, which receives each parameter's own context. To give each parameter its own
|
|
412
|
+
config key instead, refine the matchers with the Move parameter names:
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
configArguments: {
|
|
416
|
+
basePool: { type: 'pool::Pool', parameterName: 'base_pool' },
|
|
417
|
+
quotePool: { type: 'pool::Pool', parameterName: 'quote_pool' },
|
|
418
|
+
},
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
Parameter names are only available in summaries generated from local packages. For onchain packages
|
|
422
|
+
without parameter names, use function matchers with `parameterIndex` to target individual
|
|
423
|
+
parameters.
|
|
424
|
+
|
|
425
|
+
### Package address precedence
|
|
426
|
+
|
|
427
|
+
For package entries, the address used for a generated call is resolved in this order:
|
|
428
|
+
|
|
429
|
+
1. An explicit `options.package` argument
|
|
430
|
+
2. The config key declared by the package entry (for example, `config.corePackageId`)
|
|
431
|
+
3. The generated default (the package's MVR name or address)
|
|
432
|
+
|
|
433
|
+
On networks where the package's MVR name doesn't resolve, supply the deployed package ID through the
|
|
434
|
+
config object. Package entries only apply to the main package's generated modules, and for packages
|
|
435
|
+
generated without an MVR name or address `package` remains required.
|
|
436
|
+
|
|
437
|
+
## The `bcsOverrides` option
|
|
438
|
+
|
|
439
|
+
Generated BCS types mirror the raw Move layout, but the raw layout is often not the shape an SDK
|
|
440
|
+
wants to expose: a `u64` field might be a 1e9 fixed-point price, or a struct like
|
|
441
|
+
`i64::I64 { magnitude: u64, is_negative: bool }` is really a signed integer. The `bcsOverrides`
|
|
442
|
+
option replaces generated BCS types with custom ones — typically built with
|
|
443
|
+
[`transform`](/bcs#transforms) — so parsed values come out in the shape you want and inputs accept
|
|
444
|
+
it.
|
|
445
|
+
|
|
446
|
+
`bcsOverrides` is set on a package entry as an array. Every entry names the Move `type` it replaces
|
|
447
|
+
and the `source` module the replacement is imported from, and can optionally narrow the entry to
|
|
448
|
+
specific `fields`:
|
|
449
|
+
|
|
450
|
+
```typescript
|
|
451
|
+
const config: SuiCodegenConfig = {
|
|
452
|
+
output: './src/contracts',
|
|
453
|
+
packages: [
|
|
454
|
+
{
|
|
455
|
+
package: '@local-pkg/deepbook_predict',
|
|
456
|
+
path: './move/deepbook_predict',
|
|
457
|
+
bcsOverrides: [
|
|
458
|
+
// Replace a datatype's generated declaration: every generated layout that
|
|
459
|
+
// references it uses the custom type. Imports `I64` from the source module.
|
|
460
|
+
{ type: 'fixed_math::i64::I64', source: './src/bcs/i64.ts' },
|
|
461
|
+
|
|
462
|
+
// `fields` narrows an entry to the field sites matching a glob. Entries are tried
|
|
463
|
+
// in declaration order and the first match wins, so narrow entries go first.
|
|
464
|
+
{ type: 'u64', fields: 'order::*.*_price', source: './src/bcs/units.ts#Price9' },
|
|
465
|
+
|
|
466
|
+
// A type with no generated declaration is replaced wherever it is rendered —
|
|
467
|
+
// here, every remaining `u64` parses to a bigint instead of a decimal string.
|
|
468
|
+
{ type: 'u64', source: './src/bcs/integers.ts#U64' },
|
|
469
|
+
|
|
470
|
+
// A whole-type match wins over its elements, so this replaces the vector itself
|
|
471
|
+
// rather than letting the `u64` rule apply to its items.
|
|
472
|
+
{ type: 'vector<u64>', source: './src/bcs/units.ts#Payouts' },
|
|
473
|
+
],
|
|
474
|
+
},
|
|
475
|
+
],
|
|
476
|
+
};
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
The replacement module exports plain BCS types:
|
|
480
|
+
|
|
481
|
+
```typescript
|
|
482
|
+
// ./src/bcs/units.ts
|
|
483
|
+
|
|
484
|
+
/** 1e9 fixed-point u64 exposed as a decimal number. */
|
|
485
|
+
const Price9 = bcs.u64().transform({
|
|
486
|
+
input: (value: number) => BigInt(Math.round(value * 1e9)).toString(),
|
|
487
|
+
output: (raw) => Number(raw) / 1e9,
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
The custom type's inferred input and output types flow through the generated code, so
|
|
493
|
+
`Node.parse(bytes).levels` is a `number[]` and `Node.serialize` accepts one.
|
|
494
|
+
|
|
495
|
+
Entry rules:
|
|
496
|
+
|
|
497
|
+
- `type` uses the same package scoping as `configArguments` matchers (bare `module::Type` for the
|
|
498
|
+
declaring package, package identifiers, explicit addresses), and additionally accepts
|
|
499
|
+
named-address labels from the package's summaries (for example, `fixed_math::i64::I64`) so entries
|
|
500
|
+
can target dependency packages that are not codegen-run entries.
|
|
501
|
+
- A datatype entry written without type arguments or `fields` replaces the type's generated
|
|
502
|
+
**declaration**: the module exports the custom type under the Move type's name, and every use
|
|
503
|
+
picks it up because uses already reference the declaration. For a generic type the source must
|
|
504
|
+
export a function `(...typeParameters: BcsType<any>[]) => BcsType<any>` mirroring the generated
|
|
505
|
+
call convention.
|
|
506
|
+
- Every other entry replaces the type **wherever it is rendered**. That covers types with no
|
|
507
|
+
declaration to replace (primitives, `vector`, and the stdlib types generated layouts serialize
|
|
508
|
+
inline — `String`, `Option`, `ID`/`UID`), a single instantiation of a generic
|
|
509
|
+
(`pool::Pool<0x2::sui::SUI>`), and any entry narrowed with `fields`.
|
|
510
|
+
- Replacement applies at **any depth**, because the type renderer consults overrides as it recurses.
|
|
511
|
+
An override on `u64` also replaces the `u64` inside `vector<u64>` and `Option<u64>`. A whole-type
|
|
512
|
+
match wins over its elements, so an entry for `vector<u64>` replaces the vector rather than its
|
|
513
|
+
items.
|
|
514
|
+
- `fields` restricts an entry to the field sites matching one glob, where `*` matches any run of
|
|
515
|
+
characters. Sites are written `module::Type.field`, or `module::Type.variant.field` for enum
|
|
516
|
+
variant fields (positional fields are named `pos0`, `pos1`, …). A glob that names no module —
|
|
517
|
+
`Order.*_price` — is matched against the `Type.field` suffix, so it applies in every module. An
|
|
518
|
+
entry with `fields` never replaces a declaration, since a declaration exists once for every use.
|
|
519
|
+
- At each use site, matching entries are tried in **declaration order and the first match wins**. An
|
|
520
|
+
unrestricted datatype declaration remains the fallback for sites not matched by an earlier
|
|
521
|
+
field-restricted entry. There is no specificity scoring, so put narrow entries before broad ones.
|
|
522
|
+
- `source` is an import specifier, optionally suffixed with `#ExportName`. Relative specifiers
|
|
523
|
+
resolve against the config file's directory and are rewritten into relative imports from each
|
|
524
|
+
generated file, with their extension replaced by the configured `importExtension` (so a
|
|
525
|
+
`./src/bcs/units.ts` source is imported as `units.js` by default); bare package specifiers are
|
|
526
|
+
emitted as-is. Without a fragment, datatype entries import the Move type's name; entries whose
|
|
527
|
+
`type` is a primitive or `vector` must include one.
|
|
528
|
+
- Replacement modules must be self-contained: a module whose export replaces a declaration can't
|
|
529
|
+
import generated modules that reference the replaced type, because that would create a circular
|
|
530
|
+
import. Declare the raw layout inline when building a transform.
|
|
531
|
+
- A replacement built with `.transform()` is a plain `BcsType`, so a type replaced that way loses
|
|
532
|
+
the `MoveStruct` helpers (`typeTag()`, `resolveTypeTag()`, `get()`, `getMany()`). Extend
|
|
533
|
+
`MoveStruct` instead if the replaced type needs them.
|
|
534
|
+
- An entry that matches nothing is not an error. A shared set of overrides can be applied to several
|
|
535
|
+
packages even when only some of them have fields of a given type.
|
|
536
|
+
|
|
537
|
+
Overrides only affect generated BCS layouts (parsing and serializing structs, enums, and events,
|
|
538
|
+
including `MoveStruct.get()`). Generated transaction-building functions serialize their arguments
|
|
539
|
+
from Move type tags at runtime, so pure function arguments are unaffected.
|
|
540
|
+
|
|
270
541
|
## Phantom types
|
|
271
542
|
|
|
272
543
|
In Move, phantom type parameters are type parameters that only appear at the type level and don't
|
|
@@ -370,8 +641,8 @@ async function readCounter(client: ClientWithCoreApi, id: string) {
|
|
|
370
641
|
```
|
|
371
642
|
|
|
372
643
|
> **Warning:** Always use `content`, not `objectBcs`, when parsing with generated types. The `objectBcs` field
|
|
373
|
-
> contains a full object envelope with additional metadata that
|
|
374
|
-
> [
|
|
644
|
+
> contains a full object envelope with additional metadata that causes parsing to fail. See
|
|
645
|
+
> [Querying data](/sui/clients/querying#objectbcs) for details.
|
|
375
646
|
|
|
376
647
|
### Getting type tags
|
|
377
648
|
|
|
@@ -440,11 +711,15 @@ const balanceType = await Balance.resolveTypeTag({
|
|
|
440
711
|
|
|
441
712
|
### Using with MVR (Move Version Registry)
|
|
442
713
|
|
|
443
|
-
If your package is registered on MVR, the generated code works without additional configuration.
|
|
714
|
+
If your package is registered on MVR, the generated code works without additional configuration. The
|
|
715
|
+
configured name is preserved in generated function targets and type tags. At runtime MVR resolves
|
|
716
|
+
function packages and type origins independently for the client's network.
|
|
444
717
|
|
|
445
718
|
### Local packages
|
|
446
719
|
|
|
447
|
-
For local packages using `@local-pkg/*` identifiers, configure
|
|
720
|
+
For local packages using `@local-pkg/*` identifiers, configure package overrides for Move calls and
|
|
721
|
+
first-level type overrides for each local type used as a transaction type argument or resolved for a
|
|
722
|
+
query:
|
|
448
723
|
|
|
449
724
|
```typescript
|
|
450
725
|
|
|
@@ -456,6 +731,9 @@ const client = new SuiGrpcClient({
|
|
|
456
731
|
packages: {
|
|
457
732
|
'@local-pkg/counter': '0xYOUR_PACKAGE_ID',
|
|
458
733
|
},
|
|
734
|
+
types: {
|
|
735
|
+
'@local-pkg/counter::counter::Counter': '0xTYPE_ORIGIN::counter::Counter',
|
|
736
|
+
},
|
|
459
737
|
},
|
|
460
738
|
},
|
|
461
739
|
});
|
|
@@ -474,6 +752,7 @@ const GRPC_URLS = {
|
|
|
474
752
|
const PACKAGE_IDS = {
|
|
475
753
|
testnet: {
|
|
476
754
|
counter: '0xYOUR_PACKAGE_ID',
|
|
755
|
+
counterType: '0xTYPE_ORIGIN::counter::Counter',
|
|
477
756
|
},
|
|
478
757
|
};
|
|
479
758
|
|
|
@@ -488,6 +767,9 @@ const dAppKit = createDAppKit({
|
|
|
488
767
|
packages: {
|
|
489
768
|
'@local-pkg/counter': PACKAGE_IDS[network].counter,
|
|
490
769
|
},
|
|
770
|
+
types: {
|
|
771
|
+
'@local-pkg/counter::counter::Counter': PACKAGE_IDS[network].counterType,
|
|
772
|
+
},
|
|
491
773
|
},
|
|
492
774
|
},
|
|
493
775
|
});
|
package/dist/llms-index.md
CHANGED
|
@@ -94,11 +94,12 @@
|
|
|
94
94
|
|
|
95
95
|
- [Sui TypeScript SDK](./sui.md): TypeScript SDK for building on the Sui blockchain
|
|
96
96
|
- [LLM Documentation](./sui/llm-docs.md): Give AI agents access to Sui SDK documentation in your project.
|
|
97
|
-
- [Sui Clients](./sui/clients.md): Choose
|
|
98
|
-
- [
|
|
99
|
-
- [
|
|
100
|
-
- [
|
|
101
|
-
- [
|
|
97
|
+
- [Sui Clients](./sui/clients.md): Choose between SuiGrpcClient and SuiGraphQLClient and understand their shared API
|
|
98
|
+
- [Querying Data](./sui/clients/querying.md): Read objects, coins, balances, dynamic fields, and history with any Sui client
|
|
99
|
+
- [Executing Transactions](./sui/clients/executing.md): Simulate, execute, and wait for transactions with any Sui client
|
|
100
|
+
- [SuiGrpcClient](./sui/clients/grpc.md): Connect to Sui over gRPC, with native service clients and real-time subscriptions
|
|
101
|
+
- [SuiGraphQLClient](./sui/clients/graphql.md): Connect to Sui over GraphQL and write type-safe custom queries
|
|
102
|
+
- [Core API](./sui/clients/core.md): The transport-agnostic client contract that SDKs and libraries build against
|
|
102
103
|
- [Building Transactions](./sui/transactions/basics.md): Construct programmable transaction blocks with the Transaction API
|
|
103
104
|
- [Signing and Execution](./sui/transactions/signing-and-execution.md): Sign transactions and execute them on the Sui network
|
|
104
105
|
- [Coins and Balances](./sui/transactions/coins-and-balances.md): Work with coin objects and address balances in transactions
|
package/dist/sui/bcs.md
CHANGED
|
@@ -112,8 +112,8 @@ const serialized = bcs.Object.serialize({
|
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
> **Warning:** Do not pass `objectBcs` bytes to a Move struct parser. It contains wrapping metadata that will
|
|
115
|
-
> cause parsing to fail. Use `content` for parsing Move struct fields
|
|
116
|
-
>
|
|
115
|
+
> cause parsing to fail. Use `content` for parsing Move struct fields, as described under
|
|
116
|
+
> [objectBcs](/sui/clients/querying#objectbcs).
|
|
117
117
|
|
|
118
118
|
## Working with transaction effects
|
|
119
119
|
|