The Computing Contracts API provides functionality for managing computing contracts, including creation, listing, encryption, ownership transfer, and assigning content identifiers (CIDs) to NFTs.
A response is an instance of the newly created contract.
curl--location--request POST "https://api.apillon.io/computing/contracts"\--header"Authorization: Basic :credentials"\--header"Content-Type: application/json"\
--data-raw "{
\"name\": \"My Computing Contract\",
\"description\": \"This contract is used for encrypting files associated with NFTs.\",
\"bucket_uuid\": \"def456...\",
\"contractType\": 1,
\"contractData\": {
\"nftContractAddress\": \"0x123456789abcdef0123456789abcdef0123456789\",
\"nftChainRpcUrl\": \"https://rpc.api.moonbeam.network/\",
\"restrictToOwner\": false
}
}"
{"id":"0ac0bb74-5d78-4116-9e4f-1c3e8e92f032","status":201,"data":{"createTime":"2024-02-20T13:59:06.290Z","updateTime":"2024-02-20T13:59:06.289Z","contractUuid":"defa1296-99f4-40de-8470-a2e8497e15ad","bucketUuid":"bf5940dc-673e-46bf-9207-e280c00d4f6b","name":"My Computing Contract","description":"This contract is used for encrypting files associated with NFTs.","contractType":1,"contractStatus":1,"contractAddress":null,"deployerAddress":"44h63RRAv5PPjFJVp11uSa6v...","transactionHash":null,"data":{"nftContractAddress":"0xB601A99a1D1...","nftChainRpcUrl":"https://rpc.api.moonbeam.network/","restrictToOwner":false,"ipfsGatewayUrl":"https://ipfs.web3approved.com/ipfs","clusterId":"0x0000000000000000000000000000000000000000000000000000000000000001"}}}
A list of computing contracts that match the query parameters. Each entry in the list contains details about the contract.
curl--location--request GET "https://api.apillon.io/computing/contracts?project_uuid=abc123&contract_uuid=def456&contractStatus=1"\--header"Authorization: Basic :credentials"
{"id":"14cf1522-bfa2-4190-972a-918992102ec2","status":200,"data":{"items":[{"createTime":"2024-02-20T13:58:45.000Z","updateTime":"2024-02-20T14:01:07.000Z","contractUuid":"defa1296-99f4-40de-8470-a2e8497e15ad","projectUuid":"4e913623-247b-4000-b650-8272430a3970","bucketUuid":"bf5940dc-673e-46bf-9207-e280c00d4f6b","name":"My Computing Contract","description":"This contract is used for encrypting files associated with NFTs.","contractType":1,"contractStatus":3,"contractAbiId":1,"contractAddress":"0xbdec1edc9b45a3...","deployerAddress":"44h63RRAv5PPjFJVp11uSa6v...",}],"total":1,"page":1,"limit":20}}
Based on your request to generate a table for the response fields that matches the structure seen in the bucket API documentation, here is how you can format the response fields for the "Get Computing Contract" section:
Field
Type
Description
contractUuid
string
The unique identifier of the computing contract.
bucketUuid
string
The UUID of the bucket associated with this computing contract, where encrypted files are stored.
name
string
The name of the computing contract.
description
string
A description of what the computing contract is used for.
contractType
number
The type of computing contract. For example, 1 could represent SCHRODINGER.
contractStatus
number
The current status of the computing contract. Possible values: 0 (created), 1 (deploy initiated), 2 (deploying), 3 (deployed), 4 (transferring), 5 (transferred), 6 (failed)
contractAddress
string
The blockchain address of the computing contract. This can be null if not yet deployed.
deployerAddress
string
The address of the entity that deployed the computing contract.
transactionHash
string
The transaction hash of the contract deployment. This can be null if not yet deployed.
data
object
An object containing additional data related to the computing contract.
data.nftContractAddress
string
The contract address of the NFT collection used for file decryption.
data.nftChainRpcUrl
string
The RPC URL of the blockchain where the NFT contract resides.
data.restrictToOwner
boolean
Indicates if only the owner can encrypt and decrypt files via the contract.
data.ipfsGatewayUrl
string
The URL of the IPFS gateway used by the computing contract.
data.clusterId
string
An identifier for the cluster used by the computing contract.
curl--location--request GET "https://api.apillon.io/computing/contracts/defa1296-99f4-40de-8470-a2e8497e15ad"\--header"Authorization: Basic :credentials"
{"status":200,"data":{"createTime":"2024-02-20T13:58:45.000Z","updateTime":"2024-02-20T14:01:07.000Z","contractUuid":"defa1296-99f4-40de-8470-a2e8497e15ad","bucketUuid":"bf5940dc-673e-46bf-9207-e280c00d4f6b","name":"My Computing Contract","description":"This contract is used for encrypting files associated with NFTs.","contractType":1,"contractStatus":3,"contractAddress":"0xbdec1edc9b45a31e1ebd38b1d1e464bbbddeb4fcd2687a39928029306039e48a","deployerAddress":"44h63RRAv5PPjFJVp11uSa6v52wRLmW7S5fiMWAyp3tNLh82","transactionHash":"0x4ea088f466eb08dc27d9d079cba1c5a35aeb1b5ff342b73bd456b9625dcd7093","data":{"clusterId":"0x0000000000000000000000000000000000000000000000000000000000000001","ipfsGatewayUrl":"https://ipfs.web3approved.com/ipfs","nftChainRpcUrl":"https://rpc.api.moonbeam.network/","restrictToOwner":false,"nftContractAddress":"0xB601A99a1D1804c13780F9e53d661d8bEe6D3bF0"}}}
The wallet address which initated the transaction.
transactionType
number
The type of transaction. Possible values: 1 (deploy contract), 2 (transfer contract ownership), 3 (deposit to contract cluster), 4 (assign cid to nft)
transactionStatus
number
The current status of the transaction. Possible values: 1 (pending), 2 (confirmed), 3 (failed), 4 (error), 5 (worker success), 6 (worker failed)
transactionStatusMessage
string
A message providing more details about the transaction status.
transactionHash
string
The hash of the transaction on the blockchain.
curl--location--request GET "https://api.apillon.io/computing/contracts/defa1296-99f4-40de-8470-a2e8497e15ad/transactions"\--header"Authorization: Basic :credentials"
Assign a content identifier (CID) to an NFT within a computing contract. The given token ID represents the NFT which will be used to decrypt the content which is stored as the given CID on IPFS.