> For the complete documentation index, see [llms.txt](https://w3block.gitbook.io/w3block-eng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://w3block.gitbook.io/w3block-eng/dev-docs/api/key-api-services/tokens/contracts.md).

# Contracts

Contracts are what you use to create your tokens inside the blockchain. You can create your own contracts and use them however you like.&#x20;

## Service Methods

### Creating a Draft

Before you do anything you need to create a draft for the contract. You will set all the parameters you will need to publishing the contract.

{% openapi src="<https://api.pixway.io/docs-json>" path="/{companyId}/contracts" method="post" %}
<https://api.pixway.io/docs-json>
{% endopenapi %}

### Get all contracts from your company

{% openapi src="<https://api.pixway.io/docs-json>" path="/{companyId}/contracts" method="get" %}
<https://api.pixway.io/docs-json>
{% endopenapi %}

### Get a contract's details

{% openapi src="<https://api.pixway.io/docs-json>" path="/{companyId}/contracts/{id}" method="get" %}
<https://api.pixway.io/docs-json>
{% endopenapi %}

### Patch a Contract Draft

{% openapi src="<https://api.pixway.io/docs-json>" path="/{companyId}/contracts/{id}" method="patch" %}
<https://api.pixway.io/docs-json>
{% endopenapi %}

### Publishing a Contract

After you have created a draft you can publish the contract. Be careful as you will not be able to change the contract details after publishing it.

{% openapi src="<https://api.pixway.io/docs-json>" path="/{companyId}/contracts/{id}/publish" method="patch" %}
<https://api.pixway.io/docs-json>
{% endopenapi %}

### Estimate gas to publish a contract

{% openapi src="<https://api.pixway.io/docs-json>" path="/{companyId}/contracts/{id}/estimate-gas" method="get" %}
<https://api.pixway.io/docs-json>
{% endopenapi %}

### Grant a wallet a role for your contract

{% openapi src="<https://api.pixway.io/docs-json>" path="/{companyId}/contracts/grant-role" method="patch" %}
<https://api.pixway.io/docs-json>
{% endopenapi %}

### Grant a wallets role in your contract

{% openapi src="<https://api.pixway.io/docs-json>" path="/{companyId}/contracts/has-role" method="patch" %}
<https://api.pixway.io/docs-json>
{% endopenapi %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://w3block.gitbook.io/w3block-eng/dev-docs/api/key-api-services/tokens/contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
