# @mysten/walrus

> Migrate @mysten/walrus to 2.0 with required client parameter and updated API.

## Breaking changes

- **Client required**: `WalrusClient` can no longer be created with just an RPC URL. You must pass a
  Sui client.
- **Network from client**: The `network` parameter has been removed from `walrus()`. The network is
  now inferred from the client.
- **Removed deprecated method**: `WalrusClient.experimental_asClientExtension()` has been removed.
  Use the `walrus()` function instead.

## Updated usage

If you were creating `WalrusClient` directly:

```diff
- import { WalrusClient } from '@mysten/walrus';
+ import { SuiGrpcClient } from '@mysten/sui/grpc'; // or SuiJsonRpcClient, SuiGraphQLClient
+ import { walrus } from '@mysten/walrus';

- const walrusClient = new WalrusClient({
-   suiRpcUrl: 'https://fullnode.testnet.sui.io:443',
-   network: 'testnet',
- });
+ const client = new SuiGrpcClient({
+   baseUrl: 'https://fullnode.testnet.sui.io:443',
+   network: 'testnet',
+ }).$extend(walrus());

- await walrusClient.getBlob(blobId);
+ await client.walrus.getBlob(blobId);
```

If you were passing `network` to `walrus()`, remove it:

```diff
- client.$extend(walrus({ network: 'testnet' }));
+ client.$extend(walrus());
```