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.
Create a new contract draft
Contract Example
CE
1
Example: 1
Possible values: https://dummyimage.com/600x400/fff/000
https://stg.pixway.io
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 all contract from a company
1
1000
DESC
Possible values: 2022-02-15T10:30:05-03:00
2022-02-15T10:30:05-03:00
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 a contract by id
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
Update a draft contract by id
Contract Example
CE
1
Example: 1
Possible values: https://dummyimage.com/600x400/fff/000
https://stg.pixway.io
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.
Publish a contract on the blockchain
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
Estimate gas to publish a contract
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
Grant role by wallet address in an NFT contract
0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188
1
Example: 1
Possible values: mover
Example: mover
Possible values: 0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188
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
Check address role
0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188
1
Example: 1
Possible values: mover
Example: mover
Possible values: 0xDAA50a02340cBcFA1a6F4c02765430Ffe411b188
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