Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/bcs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ available in both Browser and NodeJS environments in a type-safe way.`
To install, add the [`@mysten/bcs`](https://www.npmjs.com/package/@mysten/bcs) package to your
project:

```sh npm2yarn
```npm
npm i @mysten/bcs
```

Expand Down
2 changes: 1 addition & 1 deletion packages/dapp-kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ See https://sdk.mystenlabs.com/sui for full documentation

To use the Sui dApp Kit in your project, run the following command in your project root:

```sh npm2yarn
```npm
npm i --save @mysten/dapp-kit @mysten/sui @tanstack/react-query
```

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/bcs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ available in both Browser and NodeJS environments in a type-safe way.`
To install, add the [`@mysten/bcs`](https://www.npmjs.com/package/@mysten/bcs) package to your
project:

```sh npm2yarn
```npm
npm i @mysten/bcs
```

Expand Down
4 changes: 2 additions & 2 deletions packages/docs/content/codegen/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This package is currently in development and might have breaking changes.

Install the codegen package as a dev dependency:

```sh npm2yarn
```npm
npm install -D @mysten/codegen
```

Expand Down Expand Up @@ -467,5 +467,5 @@ const dAppKit = createDAppKit({
already configured
- [Sui Move documentation](https://docs.sui.io/concepts/sui-move-concepts)
- [BCS documentation](/bcs)
- [Transaction building](/sui/transaction-building/basics)
- [Transaction building](/sui/transactions/basics)
- [dApp Kit](/dapp-kit)
2 changes: 1 addition & 1 deletion packages/docs/content/dapp-kit/dapp-kit-instance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const dAppKit = createDAppKit({
<Callout type="info">
If you use the React bindings, there are two ways to ensure type safety with hooks:

1. [Register the global dAppKit type](./getting-started/react#1-create-a-dapp-kit-instance) once, and all hooks will be properly typed
1. [Register the global dAppKit type](./getting-started/react#step-1-create-a-dapp-kit-instance) once, and all hooks will be properly typed
2. Pass the dAppKit instance explicitly to each hook: `useWalletConnection({ dAppKit })`

</Callout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ built in.

## Quick start

```sh npm2yarn
```npm
npm create @mysten/dapp
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rendering (SSR).

## Installation

```sh npm2yarn
```npm
npm i @mysten/dapp-kit-react @mysten/sui
```

Expand Down
4 changes: 2 additions & 2 deletions packages/docs/content/dapp-kit/getting-started/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This guide walks you through integrating dApp Kit into a React application.

The fastest way to get started is using our CLI tool:

```sh npm2yarn
```npm
npm create @mysten/dapp
```

Expand All @@ -32,7 +32,7 @@ See the [create-dapp guide](/dapp-kit/getting-started/create-dapp) for more deta

## Manual installation

```sh npm2yarn
```npm
npm i @mysten/dapp-kit-react @mysten/sui
```

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/dapp-kit/getting-started/vue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ direct store access.

## Installation

```sh npm2yarn
```npm
npm i @mysten/dapp-kit-core @mysten/sui @nanostores/vue
```

Expand Down
4 changes: 2 additions & 2 deletions packages/docs/content/dapp-kit/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ Choose the installation method based on your framework:

### For React applications

```sh npm2yarn
```npm
npm i @mysten/dapp-kit-react @mysten/sui
```

### Vanilla JavaScript and other frameworks

```sh npm2yarn
```npm
npm i @mysten/dapp-kit-core @mysten/sui
```

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/dapp-kit/legacy/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Some of the core features of the dApp Kit include:

To use the Sui dApp Kit in your project, run the following command in your project root:

```sh npm2yarn
```npm
npm i --save @mysten/dapp-kit @mysten/sui @tanstack/react-query
```

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/kiosk/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data, build transactions to interact, and extend Kiosk to support custom rules.

## Installation

```sh npm2yarn
```npm
npm i @mysten/kiosk
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords: [kiosk management, place, list, delist, withdraw, take, KioskTransacti

The kiosk extension (`client.kiosk`) helps in managing a kiosk.

You need to follow the steps explained in the [Kiosk Transaction section](#kiosk-transaction) to
You need to follow the steps explained in the [Kiosk Transaction section](./kiosk-transaction) to
create a `KioskTransaction`.

## Available functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ keywords: [kiosk purchase, transfer policy, rules resolution, buying, Sui, Kiosk

One of the base functionalities of the SDK is a seamless purchasing flow, allowing for ease of rules
resolving (hiding away the calls). The SDK supports all four rules by default, and works for
`TESTNET` and `MAINNET`. To support other networks,
[follow the instructions in the Introduction](../introduction#using-kioskclient-on-devnet-or-localnet).
`TESTNET` and `MAINNET`. For other networks, see the
[kiosk extension setup section](../introduction) of the introduction.

## How to purchase

Expand Down
17 changes: 11 additions & 6 deletions packages/docs/content/sui/bcs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ the following pre-defined schemes:
- `SharedObjectRef`
- `StructTag`
- `SuiObjectRef`
- `Transaction`
- `TransactionData`
- `TransactionDataV1`
- `TransactionExpiration`
Expand Down Expand Up @@ -100,12 +99,18 @@ object response, so you typically only need `content`.
```typescript
import { bcs } from '@mysten/sui/bcs';

// Parse a full object envelope (from objectBcs include option)
const envelope = bcs.Object.parse(object.objectBcs);
console.log('Owner:', envelope.owner);
console.log('Inner struct bytes:', envelope.data.Move.contents);
// Parse a BCS-encoded object
const { objects } = await grpcClient.getObjects({
objectIds: [objectId],
include: { objectBcs: true },
});

const parsed = bcs.Object.parse(objects[0].objectBcs);
console.log('Owner:', parsed.owner);
console.log('Previous Transaction:', parsed.previousTransaction);
console.log('Storage Rebate:', parsed.storageRebate);

// Serialize a full object envelope
// Serialize an object
const serialized = bcs.Object.serialize({
data: {
Move: {
Expand Down
19 changes: 10 additions & 9 deletions packages/docs/content/sui/clients/core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,14 @@ The `display` field is `null` when the object's type has no registered Display t
Get the balance of a specific coin type for an owner.

```typescript
const balance = await client.core.getBalance({
const { balance } = await client.core.getBalance({
owner: '0xabc...',
coinType: '0x2::sui::SUI', // Optional, defaults to SUI
});

console.log(balance.totalBalance); // Total balance as bigint
console.log(balance.coinObjectCount); // Number of coin objects
console.log(balance.balance); // Total balance (coin objects + address balance)
console.log(balance.coinBalance); // Balance from coin objects only
console.log(balance.addressBalance); // Balance from address balance only
```

### `listBalances`
Expand All @@ -216,7 +217,7 @@ const { balances } = await client.core.listBalances({
});

for (const balance of balances) {
console.log(balance.coinType, balance.totalBalance);
console.log(balance.coinType, balance.balance);
}
```

Expand All @@ -231,7 +232,7 @@ const result = await client.core.listCoins({
limit: 10,
});

for (const coin of result.coins) {
for (const coin of result.objects) {
console.log(coin.objectId, coin.balance);
}
```
Expand Down Expand Up @@ -475,7 +476,7 @@ console.log(referenceGasPrice); // bigint
Get the current system state including epoch information.

```typescript
const systemState = await client.core.getCurrentSystemState();
const { systemState } = await client.core.getCurrentSystemState();
console.log(systemState.epoch);
console.log(systemState.systemStateVersion);
```
Expand All @@ -499,7 +500,7 @@ Get information about a Move function.
const { function: fn } = await client.core.getMoveFunction({
packageId: '0x2',
moduleName: 'coin',
name: 'transfer',
name: 'value',
});

console.log(fn.name);
Expand Down Expand Up @@ -588,7 +589,7 @@ function processObject(obj: SuiClientTypes.Object<{ content: true }>) {
async function fetchBalance(
client: ClientWithCoreApi,
owner: string,
): Promise<SuiClientTypes.CoinBalance> {
): Promise<SuiClientTypes.Balance> {
const { balance } = await client.core.getBalance({ owner });
return balance;
}
Expand All @@ -606,7 +607,7 @@ const options: SuiClientTypes.GetObjectOptions<{ content: true }> = {
| ---------------------- | ------------------------------------------- |
| `Object<Include>` | Fetched object with optional included data |
| `Coin` | Coin object with balance |
| `CoinBalance` | Balance summary for a coin type |
| `Balance` | Balance summary for a coin type |
| `CoinMetadata` | Metadata for a coin type |
| `Transaction<Include>` | Executed transaction with optional data |
| `TransactionResult` | Success or failure result from execution |
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/sui/clients/grpc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const { response: fields } = await grpcClient.stateService.listDynamicFields({
const { response } = await grpcClient.movePackageService.getFunction({
packageId: '0x2',
moduleName: 'coin',
name: 'transfer',
name: 'value',
});
```

Expand Down
31 changes: 0 additions & 31 deletions packages/docs/content/sui/faucet.mdx

This file was deleted.

Loading
Loading