# Treasury Pays for Minting (TS/JS + Fetch)

This example requires several utility and configuration files. Create the following files in the same directory as your main script.

{% hint style="info" %}
**Need to create wallets?**

You can use the [Anvil Wallet CLI](https://dev.ada-anvil.io/developer-tools/wallet-cli) to generate the required wallet JSON files for these examples.
{% endhint %}

{% @github-files/github-code-block title="utils/constant.ts" url="<https://github.com/Cardano-Forge/anvil-api-examples/blob/main/utils/constant.ts>" %}

You will also need the shared utility functions, which you can find in the [`utils/shared.ts`](https://github.com/Cardano-Forge/anvil-api-examples/blob/main/utils/shared.ts) file in the examples repository.

This example uses the [Wallet Endpoints](https://dev.ada-anvil.io/developer-tools/wallet-endpoints) to fetch UTXOs from the treasury wallet.

Now, you can run the main script:

{% @github-files/github-code-block url="<https://github.com/Cardano-Forge/anvil-api-examples/blob/main/documentation-references/cip68-treasury-pays.ts>" %}

{% hint style="success" %}
**Learn More**

For a step-by-step explanation, see the [Mint a CIP-68 NFT Guide](https://dev.ada-anvil.io/guides/nft-and-ft/mint-nft-cip-68).
{% endhint %}
