Contracts

This module helps you administer your contracts in the blockchain

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

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.

post

Create a new contract draft

Authorizations
Path parameters
companyIdstringRequired
Body
namestringRequiredExample: Contract Example
symbolstringRequiredExample: CE
chainIdstring · enumRequiredDefault: 1Example: 1Possible values:
descriptionobjectOptional
imageobjectOptionalExample: https://dummyimage.com/600x400/fff/000
externalLinkobjectOptionalExample: https://stg.pixway.io
transferWhitelistIdobject · uuidOptional
minterWhitelistIdobject · uuidOptional
Responses
201Success
application/json
post
POST /{companyId}/contracts HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 414

{
  "name": "Contract Example",
  "symbol": "CE",
  "chainId": 1,
  "description": {},
  "image": "https://dummyimage.com/600x400/fff/000",
  "externalLink": "https://stg.pixway.io",
  "participants": [
    {
      "contactId": null,
      "share": 2.5,
      "name": "Participant 1",
      "payee": "0x095358452C33916513a3827a2D086da1aCEd7EE0"
    }
  ],
  "features": [
    "admin:mover",
    "admin:minter",
    "admin:burner",
    "user:burner",
    "user:mover"
  ],
  "transferWhitelistId": {},
  "minterWhitelistId": {}
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "royalty": {},
  "royaltyId": "123e4567-e89b-12d3-a456-426614174000",
  "address": "text",
  "chainId": 1,
  "name": "text",
  "symbol": "text",
  "description": "text",
  "image": "text",
  "externalLink": "text",
  "operators": [
    "text"
  ],
  "roles": [
    []
  ],
  "status": "draft",
  "contractAction": {
    "id": "text",
    "companyId": "text",
    "status": "started",
    "type": "factoryERC721A",
    "chainId": 80001,
    "sender": "text",
    "txHash": "text",
    "txId": "text",
    "metadata": {},
    "request": {},
    "executeAt": "2025-07-04T19:53:41.484Z",
    "deletedAt": "2025-07-04T19:53:41.484Z",
    "createdAt": "2025-07-04T19:53:41.484Z",
    "updatedAt": "2025-07-04T19:53:41.484Z"
  },
  "contractActionId": "text",
  "features": [
    "admin:minter"
  ],
  "deletedAt": "2025-07-04T19:53:41.484Z",
  "createdAt": "2025-07-04T19:53:41.484Z",
  "updatedAt": "2025-07-04T19:53:41.484Z",
  "transferWhitelistId": "123e4567-e89b-12d3-a456-426614174000",
  "minterWhitelistId": "123e4567-e89b-12d3-a456-426614174000",
  "maxSupply": 1
}

Get all contracts from your company

get

Get all contract from a company

Authorizations
Path parameters
companyIdstringRequired
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 1000
searchstringOptional
sortBystringOptional
orderBystring · enumOptionalDefault: DESCPossible values:
statusstring · enumOptionalPossible values:
contractNamestringOptional
minDatestringOptionalExample: 2022-02-15T10:30:05-03:00
maxDatestringOptionalExample: 2022-02-15T10:30:05-03:00
contactIdstringOptional
participantNamestringOptional
walletAddressesstring[]Optional
Responses
200Success
application/json
get
GET /{companyId}/contracts HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Accept: */*
{
  "meta": {
    "itemCount": 1,
    "totalItems": 1,
    "itemsPerPage": 1,
    "totalPages": 1,
    "currentPage": 1
  },
  "links": {
    "first": "http://example.com?page=1",
    "prev": "http://example.com?page=1",
    "next": "http://example.com?page=2",
    "last": "http://example.com?page=3"
  },
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "companyId": "123e4567-e89b-12d3-a456-426614174000",
      "royalty": {},
      "royaltyId": "123e4567-e89b-12d3-a456-426614174000",
      "address": "text",
      "chainId": 1,
      "name": "text",
      "symbol": "text",
      "description": "text",
      "image": "text",
      "externalLink": "text",
      "operators": [
        "text"
      ],
      "roles": [
        []
      ],
      "status": "draft",
      "contractAction": {
        "id": "text",
        "companyId": "text",
        "status": "started",
        "type": "factoryERC721A",
        "chainId": 80001,
        "sender": "text",
        "txHash": "text",
        "txId": "text",
        "metadata": {},
        "request": {},
        "executeAt": "2025-07-04T19:53:41.484Z",
        "deletedAt": "2025-07-04T19:53:41.484Z",
        "createdAt": "2025-07-04T19:53:41.484Z",
        "updatedAt": "2025-07-04T19:53:41.484Z"
      },
      "contractActionId": "text",
      "features": [
        "admin:minter"
      ],
      "deletedAt": "2025-07-04T19:53:41.484Z",
      "createdAt": "2025-07-04T19:53:41.484Z",
      "updatedAt": "2025-07-04T19:53:41.484Z",
      "transferWhitelistId": "123e4567-e89b-12d3-a456-426614174000",
      "minterWhitelistId": "123e4567-e89b-12d3-a456-426614174000",
      "maxSupply": 1
    }
  ]
}

Get a contract's details

get

Get a contract by id

Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Responses
200Success
application/json
get
GET /{companyId}/contracts/{id} HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "royalty": {},
  "royaltyId": "123e4567-e89b-12d3-a456-426614174000",
  "address": "text",
  "chainId": 1,
  "name": "text",
  "symbol": "text",
  "description": "text",
  "image": "text",
  "externalLink": "text",
  "operators": [
    "text"
  ],
  "roles": [
    []
  ],
  "status": "draft",
  "contractAction": {
    "id": "text",
    "companyId": "text",
    "status": "started",
    "type": "factoryERC721A",
    "chainId": 80001,
    "sender": "text",
    "txHash": "text",
    "txId": "text",
    "metadata": {},
    "request": {},
    "executeAt": "2025-07-04T19:53:41.484Z",
    "deletedAt": "2025-07-04T19:53:41.484Z",
    "createdAt": "2025-07-04T19:53:41.484Z",
    "updatedAt": "2025-07-04T19:53:41.484Z"
  },
  "contractActionId": "text",
  "features": [
    "admin:minter"
  ],
  "deletedAt": "2025-07-04T19:53:41.484Z",
  "createdAt": "2025-07-04T19:53:41.484Z",
  "updatedAt": "2025-07-04T19:53:41.484Z",
  "transferWhitelistId": "123e4567-e89b-12d3-a456-426614174000",
  "minterWhitelistId": "123e4567-e89b-12d3-a456-426614174000",
  "maxSupply": 1
}

Patch a Contract Draft

patch

Update a draft contract by id

Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Body
namestringOptionalExample: Contract Example
symbolstringOptionalExample: CE
chainIdstring · enumOptionalDefault: 1Example: 1Possible values:
descriptionobjectOptional
imageobjectOptionalExample: https://dummyimage.com/600x400/fff/000
externalLinkobjectOptionalExample: https://stg.pixway.io
transferWhitelistIdobject · uuidOptional
minterWhitelistIdobject · uuidOptional
Responses
200Success
application/json
patch
PATCH /{companyId}/contracts/{id} HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 414

{
  "name": "Contract Example",
  "symbol": "CE",
  "chainId": 1,
  "description": {},
  "image": "https://dummyimage.com/600x400/fff/000",
  "externalLink": "https://stg.pixway.io",
  "participants": [
    {
      "contactId": null,
      "share": 2.5,
      "name": "Participant 1",
      "payee": "0x095358452C33916513a3827a2D086da1aCEd7EE0"
    }
  ],
  "features": [
    "admin:mover",
    "admin:minter",
    "admin:burner",
    "user:burner",
    "user:mover"
  ],
  "transferWhitelistId": {},
  "minterWhitelistId": {}
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "royalty": {},
  "royaltyId": "123e4567-e89b-12d3-a456-426614174000",
  "address": "text",
  "chainId": 1,
  "name": "text",
  "symbol": "text",
  "description": "text",
  "image": "text",
  "externalLink": "text",
  "operators": [
    "text"
  ],
  "roles": [
    []
  ],
  "status": "draft",
  "contractAction": {
    "id": "text",
    "companyId": "text",
    "status": "started",
    "type": "factoryERC721A",
    "chainId": 80001,
    "sender": "text",
    "txHash": "text",
    "txId": "text",
    "metadata": {},
    "request": {},
    "executeAt": "2025-07-04T19:53:41.484Z",
    "deletedAt": "2025-07-04T19:53:41.484Z",
    "createdAt": "2025-07-04T19:53:41.484Z",
    "updatedAt": "2025-07-04T19:53:41.484Z"
  },
  "contractActionId": "text",
  "features": [
    "admin:minter"
  ],
  "deletedAt": "2025-07-04T19:53:41.484Z",
  "createdAt": "2025-07-04T19:53:41.484Z",
  "updatedAt": "2025-07-04T19:53:41.484Z",
  "transferWhitelistId": "123e4567-e89b-12d3-a456-426614174000",
  "minterWhitelistId": "123e4567-e89b-12d3-a456-426614174000",
  "maxSupply": 1
}

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.

patch

Publish a contract on the blockchain

Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Responses
204Success
patch
PATCH /{companyId}/contracts/{id}/publish HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Accept: */*

No content

Estimate gas to publish a contract

get

Estimate gas to publish a contract

Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Responses
200Success
application/json
get
GET /{companyId}/contracts/{id}/estimate-gas HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Accept: */*
{
  "totalGas": 1,
  "totalGasPrice": {
    "safe": "text",
    "proposed": "text",
    "fast": "text"
  }
}

Grant a wallet a role for your contract

patch

Grant role by wallet address in an NFT contract

Authorizations
Path parameters
companyIdstringRequired
Body
addressstringRequiredExample: 0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188
chainIdstring · enumRequiredDefault: 1Example: 1Possible values:
rolestring · enumRequiredDefault: moverExample: moverPossible values:
contractAddressstringRequiredExample: 0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188
Responses
204Success
patch
PATCH /{companyId}/contracts/grant-role HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 146

{
  "address": "0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188",
  "chainId": 1,
  "role": "mover",
  "contractAddress": "0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188"
}

No content

Grant a wallets role in your contract

patch

Check address role

Authorizations
Path parameters
companyIdstringRequired
Body
addressstringRequiredExample: 0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188
chainIdstring · enumRequiredDefault: 1Example: 1Possible values:
rolestring · enumRequiredDefault: moverExample: moverPossible values:
contractAddressstringRequiredExample: 0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188
Responses
200Success
application/json
patch
PATCH /{companyId}/contracts/has-role HTTP/1.1
Host: 
x-w3block-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 146

{
  "address": "0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188",
  "chainId": 1,
  "role": "mover",
  "contractAddress": "0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188"
}
{
  "hasRole": true
}

Last updated