Skip to content

Commit

Permalink
minor fixes to docs (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan authored Jun 13, 2024
1 parent 724f1c0 commit c78ddc0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/pages/protocol-sdk/collect/mint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ a function `mint()`. The type of item to mint is determined by the `mintType` pa
can be set to either `1155`, `721`, or `premint`. Depending on the `mintType` additional parameters
must be passed.

```ts twoslash
import { useChainId, usePublicClient } from '@zoralabs/protocol-sdk';
```tsx twoslash
import { useChainId, usePublicClient, useWriteContract } from '@zoralabs/protocol-sdk';
import { createCollectorClient } from "@zoralabs/protocol-sdk";
import { zora } from "viem/chains";

const chainId = useChainId();
const publicClient = usePublicClient();

// set to the chain you want to interact with
const collectorClient = createCollectorClient({ chainId, publicClient });

const prepared = await collectorClient.mint({
const { parameters } = await collectorClient.mint({
// collection address to mint
tokenContract: "0x1234567890123456789012345678901234567890",
// quantity of tokens to mint
Expand All @@ -27,6 +26,11 @@ const prepared = await collectorClient.mint({
// ^|
});


const { writeContract } = useWriteContract();

// clicking the button writes the mint transaction to the network
<button onClick={() => writeContract(parameters)}>Create</button>
```

### Mint Premints
Expand Down

0 comments on commit c78ddc0

Please sign in to comment.