Smart Contracts API

API for creation and management of smart contracts through Apillon wallets on supported EVM chains.

Enables developers (even without blockchain experience) to deploy, automate, scale, and efficiently manage smart contracts on the blockchain through simple API calls.

Get Contract

Get contract (available for deploy) by UUID

GET /contracts/:uuid

URL Parameters

NameDescriptionRequired
uuidUnique identifier of the contract.true

Possible Errors

CodeDescription
40421001Contract not found.

Response Fields

Contract that can be used to create an instance of deployed contract.

NameTypeDescription
contractUuidstringUnique identifier for the contract.
contractTypenumberType identifier of the contract (described bellow).
chainTypenumberType of blockchain the contract is deployed on.
namestringName of the contract.
descriptionstringDescription of the contract.
contractVersionstringVersion of the contract.
createTimeDateTimeCreation time of the contract.
updateTimeDateTimeUpdate time of the contract.
Contract Types
NameValueDescription
OTHER1Other Contracts
ERC_202ERC-20 Compatible Contracts
ERC_7213ERC-721 Compatible Contracts
ERC_11554ERC-1155 Compatible Contracts
Contract Version

Version of the contract used for deploying.

NameTypeDescription
abiAbi[]ABI details of the contract (described bellow).
methodsMethod[]Methods available in the contract (described bellow).
contractContractMetadata about the contract itself (described bellow).
createTimeDateTimeContract creation time.
updateTimeDateTimeContract last update time.
Contract ABI

ABI for deployable contract.

NameTypeDescription
stateMutabilitystringState mutability of the function.
typestringType of the ABI (constructor/function).
inputsInput[]List of input parameters for the function.
outputsOutput[]List of output parameters for the function.
Contract Method

Methods of deployable contract.

NameTypeDescription
onlyOwnerbooleanWhether the method is owner only.
namestringName of the method.
descriptionstringDescription of the method.
createTimeDateTimeCreation time of the method.
updateTimeDateTimeUpdate time of the method.
curl --location 'https://api.apillon.io/contracts/:uuid' --header 'Authorization: Basic :credentials'
{
  "id": "f419b53c-e71d-4489-8914-bb92bcca5ebc",
  "status": 200,
  "data": {
    "createTime": "2024-07-11T14:06:19.000Z",
    "updateTime": "2024-07-11T14:06:19.000Z",
    "contractUuid": "cc20586e-1468-4316-8366-99c5492c3ed1",
    "contractType": 2,
    "chainType": 2,
    "name": "Generic2 ERC-20",
    "description": "Generic ERC-20 Non Fungible Token",
    "contractVersion": {
      "createTime": "2024-07-11T14:08:09.000Z",
      "updateTime": "2024-07-11T14:08:09.000Z",
      "abi": [
        {
          "stateMutability": "nonpayable",
          "type": "constructor",
          "inputs": [
            {
              "name": "name",
              "internalType": "string",
              "type": "string"
            },
            {
              "name": "symbol",
              "internalType": "string",
              "type": "string"
            }
          ]
        },
        {
          "stateMutability": "view",
          "type": "function",
          "inputs": [
            {
              "name": "account",
              "internalType": "address",
              "type": "address"
            }
          ],
          "name": "balanceOf",
          "outputs": [
            {
              "name": "",
              "internalType": "uint256",
              "type": "uint256"
            }
          ]
        },
        {
          "stateMutability": "nonpayable",
          "type": "function",
          "inputs": [
            {
              "name": "value",
              "internalType": "uint256",
              "type": "uint256"
            }
          ],
          "name": "burn",
          "outputs": []
        },
        ...
      ],
      "methods": [
        {
          "createTime": "2024-07-11T14:09:47.000Z",
          "updateTime": "2024-07-11T14:09:47.000Z",
          "onlyOwner": true,
          "name": "burn",
          "description": "burn"
        },
        ...
      ],
      "contract": null
    }
  }
}

List Contracts

Get a list of all deployable contracts

GET /contracts

Query Parameters

All query parameters from listing request, plus:

NameDescriptionRequired
chainTypeThe type of the blockchain chain.false

Possible Errors

CodeDescription
40421001Contract not found.

Response

Response is a list of contracts described under Response Fields above.

curl --location 'https://api.apillon.io/contracts' --header 'Authorization: Basic :credentials'
{
  "id": "b4d24772-be33-4cf4-ba18-a47258fa7152",
  "status": 200,
  "data": {
    "items": [
      {
        "id": 5,
        "createTime": "2024-07-08T09:22:30.000Z",
        "updateTime": "2024-07-08T09:22:30.000Z",
        "contract_uuid": "e0688a37-0b8b-4634-a1e4-bdb894866831",
        "contractType": 3,
        "chainType": 2,
        "name": "Generic ERC-1155",
        "description": "Generic ERC-1155 Non Fungible Token"
      },
      {
        "id": 6,
        "createTime": "2024-07-11T14:06:19.000Z",
        "updateTime": "2024-07-11T14:06:19.000Z",
        "contract_uuid": "cc20586e-1468-4316-8366-99c5492c3ed1",
        "contractType": 2,
        "chainType": 2,
        "name": "Generic ERC-20",
        "description": "Generic ERC-20 Non Fungible Token"
      }
    ],
    "total": 2,
    "page": 1,
    "limit": 20
  }
}

Get Contract ABI

Get the ABI of a deployable contract

GET /contracts/:uuid/abi

URL Parameters

NameDescriptionRequired
uuidUnique identifier of contract.true

Query Parameters

All query parameters from listing request, plus:

NameDescriptionRequired
solidityJsonDetermines format in which to return ABI (default is solidityJson=false).false

Possible Errors

CodeDescription
40421001Contract not found.

Response Fields

Endpoint returns ABI methods as an array.

Array item(s) format depends on value of solidityJson passed as query parameter:

  • Human-readable ABI (solidityJson=false)
  • ABI in Solidity JSON format (solidityJson=true)

Deploy Contract

Deploy an instance of contract

POST /contracts/:uuid/deploy

URL Parameters

NameDescriptionRequired
uuidUnique identifier of contract to deploy.true

Body Parameters

NameTypeDescriptionRequired
namestringName of the contract.true
descriptionstringDescription of the contract.true
chainnumberID of the blockchain.true
constructorArgumentsunknown[]Arguments for the constructor.true

Possible Errors

CodeDescription
40421001Contract not found.
42221001Data not present.
50021003Contract deploy error.
50021016Failed to get contract version.
Response Fields
NameTypeDescription
contractUuidstringUnique identifier for the contract.
contractTypenumberType identifier of the contract (described bellow).
chainTypenumberType of blockchain the contract is deployed on.
namestringName of the contract.
descriptionstringDescription of the contract.
contractVersionContractVersionVersion of the contract (if available).
createTimeDateTimeCreation time of the contract.
updateTimeDateTimeUpdate time of the contract.
curl --location 'https://api.apillon.io/contracts/:uuid/deploy' \
--header 'Authorization: Basic :credentials'
--data-raw '{
    "name": "Test Contract 2",
    "description": "test description",
    "chain": 1287,
    "constructorArguments": ["Test Contract 2", "TC2"],
}'
{
  "id": "71ebc623-48cb-4e8a-b24d-213284c9ef9c",
  "status": 201,
  "data": {
    "status": 5,
    "createTime": "2024-12-03T09:36:50.781Z",
    "updateTime": null,
    "contract_uuid": "7641d513-0990-4ffb-be21-2c5f5220bf5c",
    "project_uuid": "41232f3f-acc0-4d79-b9b5-64e030d30d0b",
    "name": "Test Contract 2",
    "description": "test description",
    "chainType": 2,
    "chain": 1287,
    "version_id": 8,
    "constructorArguments": ["Test Contract","TC","0x4C2A866EB59511a6aD78db5cd4970464666b745a"],
    "contractStatus": 2,
    "contractAddress": "0xe878564779CD04625eE4A02f663014A4C184ed86",
    "deployerAddress": "0x47df8450ee10ede00a9d5508f89d8d4570aa7b99",
    "transactionHash": "0xf6f35bcb35e446be9b29432ef7bdd0300ee459b19656b3972010463ca5537aea",
    "contractVersion": null
  }
}

Get Deployed Contract

Get details of a deployed contract by UUID

GET /contracts/deployed/:uuid

URL Parameters

NameDescriptionRequired
uuidUnique identifier of the deployed contract.true

Possible Errors

CodeDescription
40300000Not allowed to access deployed contract.
40421002Contract not found.

Response Fields

FieldTypeDescription
contractUuidstringUnique identifier of the contract.
projectUuidstringUnique identifier of the project.
namestringName of the contract.
descriptionstringDescription of the contract.
chainTypeChainTypeType of the blockchain chain.
chainEvmChainSpecific EVM-compatible blockchain.
versionIdnumberVersion ID of the contract.
constructorArgumentsunknown[]Arguments used in the constructor of the contract.
contractStatusContractStatusStatus of the contract.
contractAddressstringAddress where the contract is deployed.
deployerAddressstringAddress of the deployer of the contract.
transactionHashstringTransaction hash of the deployment.
contractVersionContractVersionVersion details for deployed contract (details above.
createTimeDateTimeCollection create time.
updateTimeDateTimeCollection last update time.
curl --location 'https://api.apillon.io/contracts/deployed/:uuid' --header 'Authorization: Basic :credentials'
{
  "id": "ec7872ae-0a3d-466e-9b19-7bca8df3dc81",
  "status": 200,
  "data": {
    "status": 5,
    "createTime": "2024-11-13T14:11:43.000Z",
    "updateTime": "2024-11-13T14:15:51.000Z",
    "contractUuid": "e8be60e2-a5d7-4366-92aa-0d3f55c022c4",
    "projectUuid": "c094c483-857f-4b12-bdd4-e3a316719882",
    "name": "Test Contract 2",
    "description": "test description",
    "chainType": 2,
    "chain": 1287,
    "versionId": 8,
    "constructorArguments": "null",
    "contractStatus": 3,
    "contractAddress": "0x32BaCe3FA12F22E90111adbf2A396a7946B1D046",
    "deployerAddress": "0x7ddefb047752a969a0fc2a76665f99e1656bc195",
    "transactionHash": null,
    "contractVersion": {
      "createTime": "2024-11-13T14:04:14.000Z",
      "updateTime": "2024-11-13T14:04:14.000Z",
      "abi": [
        {
          "stateMutability": "nonpayable",
          "type": "constructor",
          "inputs": [
            {
              "name": "uri",
              "internalType": "string",
              "type": "string"
            },
            {
              "name": "adminAddress",
              "internalType": "address",
              "type": "address"
            }
          ]
        },
        {
          "stateMutability": "view",
          "type": "function",
          "inputs": [
            {
              "name": "account",
              "internalType": "address",
              "type": "address"
            },
            {
              "name": "id",
              "internalType": "uint256",
              "type": "uint256"
            }
          ],
          "name": "balanceOf",
          "outputs": [
            {
              "name": "",
              "internalType": "uint256",
              "type": "uint256"
            }
          ]
        },
        {
          "stateMutability": "nonpayable",
          "type": "function",
          "inputs": [
            {
              "name": "account",
              "internalType": "address",
              "type": "address"
            },
            {
              "name": "id",
              "internalType": "uint256",
              "type": "uint256"
            },
            {
              "name": "value",
              "internalType": "uint256",
              "type": "uint256"
            }
          ],
          "name": "burn",
          "outputs": []
        },
        ...
      ],
      "methods": [
        {
          "createTime": "2024-11-13T14:05:06.000Z",
          "updateTime": "2024-11-13T14:05:06.000Z",
          "onlyOwner": true,
          "name": "burn",
          "description": "burn"
        },
        ...
      ],
      "contract": {
        "createTime": "2024-07-08T09:22:30.000Z",
        "updateTime": "2024-07-08T09:22:30.000Z",
        "contractUuid": "e0688a37-0b8b-4634-a1e4-bdb894866831",
        "contractType": 3,
        "chainType": 2,
        "name": "Generic ERC-1155",
        "description": "Generic ERC-1155 Non Fungible Token",
        "contractVersion": null
      }
    }
  }
}
Chain Types
NameValueDescription
SUBSTRATE1Substrate Chain
EVM2Ethereum VM Chain
EVM Chains
NameValueDescription
Astar592Astar Network
Moonbase1287Moonbase Network
Moonbeam1284Moonbeam Network
Contract Statuses
NameValueDescription
CREATED0Contract created
DEPLOY_INITIATED1Deployment initiated
DEPLOYING2Contract deploying
DEPLOYED3Contract deployed
TRANSFERRING4Transferring contract ownership
TRANSFERRED5Contract ownership transferred
FAILED6Deployment failed

Possible Errors

CodeDescription
40300000Not allowed to access deployed contracts.

List Deployed Contracts

Get a list of deployed contracts

Items are paginated and can be filtered and ordered through query parameters.

GET /contracts/deployed

Query Parameters

All query parameters from listing request plus:

NameDescriptionRequired
chainTypeThe type of the blockchain chain.false
contractStatusStatus of the contract.false

Response

Response is a list of items (shorter version) described under Response Fields above.

Item is a shorter version because it is a flat object and it doesn't include nested contractVersion (with abi, methods and contract), instead it exposes some details from this table:

Response Fields
NameTypeDescription
contractVersionnumberUnique identifier of the contract.
contractTypeContractTypeType identifier of the contract (described above).
contractNamestringName of the contract.
contractDescriptionstringDescription of the contract.
curl --location 'https://api.apillon.io/contracts/deployed' --header 'Authorization: Basic :credentials'
{
  "id": "ed374fe6-f912-48f6-b4cb-e0304090d37d",
  "status": 200,
  "data": {
    "items": [
      {
        "id": 22,
        "status": 5,
        "createTime": "2024-10-01T08:27:13.000Z",
        "updateTime": "2024-10-01T08:27:13.000Z",
        "contractUuid": "e4f28996-9a00-46f0-925a-c814becf8a55",
        "projectUuid": "c094c483-857f-4b12-bdd4-e3a316719882",
        "name": "Test Contract 1",
        "description": "description",
        "chainType": 2,
        "chain": 1287,
        "versionId": 5,
        "contractStatus": 2,
        "contractAddress": "0xc74758a5EEeFCeAeF899f2A494854E74C682BFe5",
        "deployerAddress": "0x7ddefb047752a969a0fc2a76665f99e1656bc195",
        "contractVersion": 1,
        "contractType": 3,
        "contractName": "Generic ERC-1155",
        "contractDescription": "Generic ERC-1155 Non Fungible Token"
      },
      {
        "id": 23,
        "status": 5,
        "createTime": "2024-11-13T14:11:43.000Z",
        "updateTime": "2024-11-13T14:15:51.000Z",
        "contractUuid": "e8be60e2-a5d7-4366-92aa-0d3f55c022c4",
        "projectUuid": "c094c483-857f-4b12-bdd4-e3a316719882",
        "name": "Test Contract 2",
        "description": "description",
        "chainType": 2,
        "chain": 1287,
        "versionId": 8,
        "contractStatus": 3,
        "contractAddress": "0x32BaCe3FA12F22E90111adbf2A396a7946B1D046",
        "deployerAddress": "0x7ddefb047752a969a0fc2a76665f99e1656bc195",
        "contractVersion": 2,
        "contractType": 3,
        "contractName": "Generic ERC-1155",
        "contractDescription": "Generic ERC-1155 Non Fungible Token"
      }
    ],
    "total": 22,
    "page": 2,
    "limit": 20
  }
}

Call Deployed Contract

Execute a write function on a deployed contract

POST /contracts/deployed/:uuid/call

URL Parameters

NameDescriptionRequired
uuidUnique identifier of the contract to call.true

Body Parameters

NameTypeDescriptionRequired
methodNamestringMethod that is being called on contract.true
methodArgumentsunknown[]An array of arguments that are passed to the contract method when calling it.true

NOTE: See contract ABI for available methods and arguments required for calling them.

Possible Errors

CodeDescription
40300000Not allowed to access deployed contract.
42221001Data not present.
50021002Contract owner error.
50021004Contract call error.
50021005Contract not deployed.
50021006Contract address missing.

Response

Response contains transaction details.

Response Fields
NameTypeDescription
transactionUuidnumberUnique identifier of the transaction.
addressstringAddress initiating the transaction.
tostringRecipient address of the transaction.
chainChainChain ID where the transaction was executed.
transactionStatusnumberStatus of the transaction.
chainTypeChainTypeType of blockchain network.
transactionHashstringHash of the transaction.
referenceTablestringReference table for the transaction metadata.
referenceIdstringReference identifier for related data.
dataanyAdditional transaction data (if any).
projectUuidstringUnique identifier of the project.

curl --location 'https://api.apillon.io/contracts/deployed/:uuid/call' \
--header 'Authorization: Basic :credentials' \
--data-raw '{
    "methodName": "transferOwnership",
    "methodArguments": ["0x4C2A866EB59511a6aD78db5cd4970464666b745a"]
}'
{
  "id": "31809463-6f6b-4406-9409-f3311b1e8dac",
  "status": 201,
  "data": {
    "id": 729,
    "status": 5,
    "address": "0x7DdEfb047752a969a0fC2A76665f99E1656bc195",
    "to": "0x32BaCe3FA12F22E90111adbf2A396a7946B1D046",
    "chain": 1287,
    "transactionStatus": 1,
    "chainType": 2,
    "transactionHash": "0xbed631198f1c4236b985ed1e22cb966ad6265f05e3b24a4da23c18a4448c2a81",
    "referenceTable": "contract_deploy",
    "referenceId": "e8be60e2-a5d7-4366-92aa-0d3f55c022c4",
    "data": null,
    "projectUuid": "c094c483-857f-4b12-bdd4-e3a316719882"
  }
}

Get Deployed Contract ABI

Get the ABI of a deployed contract

GET /contracts/deployed/:uuid/abi

URL Parameters

NameDescriptionRequired
uuidUnique identifier of the deployed contract.true

Query Parameters

All query parameters from listing request, plus:

NameDescriptionRequired
solidityJsonDetermines format in which to return ABI (default is solidityJson=false).false

Possible Errors

CodeDescription
40300000Not allowed to access deployed contract.

Response

Endpoint returns ABI methods as an array.

Array item(s) format depends on value of solidityJson passed as query parameter (human-readable ABI or ABI in Solidity JSON format).


curl --location --request GET 'https://api.apillon.io/contracts/deployed/:uuid/abi' --header 'Authorization: Basic :credentials'
{
  "id": "6742591f-2b72-4887-890f-02f4f9f4cf5f",
  "status": 200,
  "data": [
    "constructor(string uri, address adminAddress)",
    "function balanceOf(address account, uint256 id) view returns (uint256)",
    "function burn(address account, uint256 id, uint256 value)",
    ...
  ]
}

Archive Deployed Contract

Archive a deployed contract

DELETE /contracts/deployed/:uuid

URL Parameters

NameDescriptionRequired
uuidUnique identifier of the deployed contract.true

Possible Errors

CodeDescription
40300000Not allowed to access deployed contract.

Response

Response includes details about archived contract.

Response Fields
NameTypeDescription
createTimeDateTimeCreation time of the contract.
updateTimeDateTimeLast update time of the contract.
contractUuidstringUnique identifier for the contract.
projectUuidstringUnique identifier of the project.
namestringName of the contract.
descriptionstringDescription of the contract.
chainTypenumberType of blockchain network.
chainnumberChain ID where the contract is deployed.
versionIdnumberVersion ID of the contract.
constructorArgumentsunknown[]Arguments used in the contract constructor.
contractStatusnumberStatus of the contract.
contractAddressstringAddress of the deployed contract.
deployerAddressstringAddress of the deployer of the contract.
transactionHashstringTransaction hash of the deployment.

curl --location --request GET 'https://api.apillon.io/contracts/deployed/:uuid/abi' --header 'Authorization: Basic :credentials'
{
  "id": "bafa91eb-20ee-48a1-bfeb-b039113efeeb",
  "status": 200,
  "data": {
    "status": 8,
    "createTime": "2024-11-13T14:11:43.000Z",
    "updateTime": "2024-12-02T16:04:31.000Z",
    "contractUuid": "e8be60e2-a5d7-4366-92aa-0d3f55c022c4",
    "projectUuid": "c094c483-857f-4b12-bdd4-e3a316719882",
    "name": "Test Contract 2",
    "description": "description",
    "chainType": 2,
    "chain": 1287,
    "versionId": 8,
    "constructorArguments": ["test","0x4C2A866EB59511a6aD78db5cd4970464666b745a"],
    "contractStatus": 5,
    "contractAddress": "0x32BaCe3FA12F22E90111adbf2A396a7946B1D046",
    "deployerAddress": "0x7ddefb047752a969a0fc2a76665f99e1656bc195",
    "transactionHash": "0x7fb06e6f8aa4987942d8687f60ca48281097971fd23f674834ce0f348ff1cdde",
    "contractVersion": null
  }
}

List Contract Transactions

Get a list of transactions for deployed contract

GET /contracts/deployed/:uuid/transactions

URL Parameters

NameDescriptionRequired
uuidUnique identifier of the deployed contract.true

Query Parameters

All query parameters from listing request, plus:

NameDescriptionRequired
transactionTypenumberType of the transaction.
transactionStatusnumberStatus of the transaction.

Possible Errors

CodeDescription
40300000Not allowed to access deployed contract.

Response

Endpoint returns transactions for deployed contract based on filters.

Response Fields
NameTypeDescription
contractUuidstringUUID of the contract.
projectUuidstringUUID of the associated project.
namestringName of the contract.
descriptionstringDescription of the contract.
chainTypenumberType of blockchain chain.
chainnumberID of the blockchain.
versionIdnumberVersion ID of the contract.
constructorArgumentsany[]Arguments for the constructor.
contractStatusnumberStatus of the contract deployment.
contractAddressstringDeployed contract address.
deployerAddressstringAddress of the deployer.
transactionHashstringTransaction hash of deployment.
contractVersionstringVersion of the contract (nullable).
createTimeDatetimeCreation time of the contract.
updateTimeDatetimeLast update time of the contract.

curl --location --request GET 'https://api.apillon.io/contracts/deployed/:uuid/transactions' --header 'Authorization: Basic :credentials'
{
  "id": "bafa91eb-20ee-48a1-bfeb-b039113efeeb",
  "status": 200,
  "data": {
    "status": 8,
    "createTime": "2024-11-13T14:11:43.000Z",
    "updateTime": "2024-12-02T16:04:31.000Z",
    "contractUuid": "e8be60e2-a5d7-4366-92aa-0d3f55c022c4",
    "projectUuid": "c094c483-857f-4b12-bdd4-e3a316719882",
    "name": "Test Contract 2",
    "description": "description",
    "chainType": 2,
    "chain": 1287,
    "versionId": 8,
    "constructorArguments": ["test","0x4C2A866EB59511a6aD78db5cd4970464666b745a"],
    "contractStatus": 5,
    "contractAddress": "0x32BaCe3FA12F22E90111adbf2A396a7946B1D046",
    "deployerAddress": "0x7ddefb047752a969a0fc2a76665f99e1656bc195",
    "transactionHash": "0x7fb06e6f8aa4987942d8687f60ca48281097971fd23f674834ce0f348ff1cdde",
    "contractVersion": null
  }
}