diff --git a/categories/smart_contracts/openapi.yml b/categories/smart_contracts/openapi.yml index 6eccb72..a2413f7 100644 --- a/categories/smart_contracts/openapi.yml +++ b/categories/smart_contracts/openapi.yml @@ -101,6 +101,12 @@ tags: servers: - url: https://api.tatum.io paths: + /v1/contract/deploy: + post: + $ref: categories/smart_contracts/paths/v1_contract_deploy_post.yml + /v1/contract/erc721/mint: + post: + $ref: categories/smart_contracts/paths/v1_contract_erc721_mint_post.yml /v3/gas-pump: post: $ref: categories/smart_contracts/paths/v3_gas-pump_post.yml diff --git a/categories/smart_contracts/paths/v1_contract_deploy_post.yml b/categories/smart_contracts/paths/v1_contract_deploy_post.yml new file mode 100644 index 0000000..4c351d1 --- /dev/null +++ b/categories/smart_contracts/paths/v1_contract_deploy_post.yml @@ -0,0 +1,67 @@ +description: "This operation is used to create a new smart contract on the blockchain.\ + \ The operation is asynchronous and returns a transaction hash. The transaction\ + \ hash can be used to query the status of the transaction.
\nYou can create\ + \ the following types of contracts:\n\nYou can find more information about the contracts on our\ + \ GitHub page with steps required for verification.
\nIf you deploy NFT collection\ + \ contract (ERC-721), it is automatically enabled for NFT Express functionality.
\n" +operationId: deployContract +requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/migrated.yml#/components/schemas/DeployErc20Contract' + - $ref: '../../../components/migrated.yml#/components/schemas/DeployErc721Contract' + - $ref: '../../../components/migrated.yml#/components/schemas/DeployErc1155Contract' + required: true +responses: + '200': + content: + application/json: + schema: + $ref: '../../../components/migrated.yml#/components/schemas/TransactionHash' + description: OK + '400': + content: + application/json: + schema: + $ref: '../../../components/migrated.yml#/components/schemas/Error400' + description: Bad Request. Validation failed for the given object in the HTTP Body + or Request parameters. + '401': + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/migrated.yml#/components/schemas/Error401NotActive' + - $ref: '../../../components/migrated.yml#/components/schemas/Error401Invalid' + description: Unauthorized. Not valid or inactive subscription key present in the + HTTP Header. + '403': + description: Forbidden. The request is authenticated, but it is not possible to + required perform operation due to logical error or invalid permissions. + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/migrated.yml#/components/schemas/Error403PlanNotSupported' + - $ref: '../../../components/migrated.yml#/components/schemas/Error403ChainNotSupported' + - $ref: '../../../components/migrated.yml#/components/schemas/Error403MainnetNotSupported' + - $ref: '../../../components/migrated.yml#/components/schemas/Error403LimitExceeded' + '500': + content: + application/json: + schema: + $ref: '../../../components/migrated.yml#/components/schemas/Error500' + description: Internal server error. There was an error on the server while processing + the request. +security: +- X-API-Key: [] +x-codeSamples: [] +summary: Deploy smart contract +tags: +- Smart Contract interactions diff --git a/categories/smart_contracts/paths/v1_contract_erc721_mint_post.yml b/categories/smart_contracts/paths/v1_contract_erc721_mint_post.yml new file mode 100644 index 0000000..1973765 --- /dev/null +++ b/categories/smart_contracts/paths/v1_contract_erc721_mint_post.yml @@ -0,0 +1,63 @@ +description: 'This operation is used to mint NFT on existing NFT collection on the + blockchain. The operation is asynchronous and returns a transaction hash. The transaction + hash can be used to query the status of the transaction.
+ + NFT will be minted as NFT Express. See more: NFT Express functionality.
+ + ' +operationId: mintErc721 +requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/migrated.yml#/components/schemas/EvmErc721Mint' + required: true +responses: + '200': + content: + application/json: + schema: + $ref: '../../../components/migrated.yml#/components/schemas/TransactionHash' + description: OK + '400': + content: + application/json: + schema: + $ref: '../../../components/migrated.yml#/components/schemas/Error400' + description: Bad Request. Validation failed for the given object in the HTTP Body + or Request parameters. + '401': + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/migrated.yml#/components/schemas/Error401NotActive' + - $ref: '../../../components/migrated.yml#/components/schemas/Error401Invalid' + description: Unauthorized. Not valid or inactive subscription key present in the + HTTP Header. + '403': + description: Forbidden. The request is authenticated, but it is not possible to + required perform operation due to logical error or invalid permissions. + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/migrated.yml#/components/schemas/Error403PlanNotSupported' + - $ref: '../../../components/migrated.yml#/components/schemas/Error403ChainNotSupported' + - $ref: '../../../components/migrated.yml#/components/schemas/Error403MainnetNotSupported' + - $ref: '../../../components/migrated.yml#/components/schemas/Error403LimitExceeded' + '500': + content: + application/json: + schema: + $ref: '../../../components/migrated.yml#/components/schemas/Error500' + description: Internal server error. There was an error on the server while processing + the request. +security: +- X-API-Key: [] +x-codeSamples: [] +summary: Mint NFT +tags: +- Smart Contract interactions diff --git a/components/schemas/CreateContractAddressLogEventSubscription.yml b/components/schemas/CreateContractAddressLogEventSubscription.yml new file mode 100644 index 0000000..ba69f72 --- /dev/null +++ b/components/schemas/CreateContractAddressLogEventSubscription.yml @@ -0,0 +1,47 @@ +type: object +required: +- type +- attr +properties: + type: + type: string + description: Type of the subscription. + example: CONTRACT_ADDRESS_LOG_EVENT + attr: + type: object + description: Additional attributes based on the subscription type. + required: + - chain + - address + - url + properties: + address: + description: Blockchain address to watch. + example: FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ + maxLength: 128 + minLength: 13 + type: string + chain: + description: Blockchain of the address. + example: SOL + type: string + enum: + - ETH + - MATIC + - CELO + - KLAY + - BSC + - TEZOS + url: + type: string + description: URL of the endpoint, where HTTP POST request will be sent, when + transaction is detected on the address. + example: https://dashboard.tatum.io/webhook-handler + maxLength: 500 + event: + type: string + description: Event to watch. In case of EVM chains it is usually a hash of + the event signature. In case of Tezos it is a name of the event and max + length is not enforced. + example: 1.0038928713678618e+77 + maxLength: 66 diff --git a/components/schemas/DeployAbstractContract.yml b/components/schemas/DeployAbstractContract.yml new file mode 100644 index 0000000..adbdc8f --- /dev/null +++ b/components/schemas/DeployAbstractContract.yml @@ -0,0 +1,26 @@ +type: object +required: +- chain +- owner +properties: + chain: + type: string + enum: + - bsc-mainnet + - bsc-testnet + - ethereum-mainnet + - ethereum-sepolia + - polygon-mainnet + - polygon-mumbai + - celo-mainnet + - celo-alfajores + description: The blockchain network where the contract will be deployed. + owner: + type: string + pattern: ^0x[a-fA-F0-9]{40}$ + description: The address of the owner of the contract. + minter: + type: string + pattern: ^0x[a-fA-F0-9]{40}$ + description: The address of the minter of the contract. If not provided, the owner + will be the minter. diff --git a/components/schemas/DeployErc1155Contract.yml b/components/schemas/DeployErc1155Contract.yml new file mode 100644 index 0000000..6d7f9c4 --- /dev/null +++ b/components/schemas/DeployErc1155Contract.yml @@ -0,0 +1,16 @@ +allOf: +- $ref: '../../../components/migrated.yml#/components/schemas/DeployAbstractContract' +- type: object + required: + - contractType + properties: + contractType: + type: string + enum: + - multitoken + description: The type of contract to deploy. + baseURI: + type: string + maxLength: 500 + description: The base URI for the ERC1155 token metadata. If not provided, the + token will not have any base URI prefixed. diff --git a/components/schemas/DeployErc20Contract.yml b/components/schemas/DeployErc20Contract.yml new file mode 100644 index 0000000..12d0ea6 --- /dev/null +++ b/components/schemas/DeployErc20Contract.yml @@ -0,0 +1,41 @@ +allOf: +- $ref: '../../../components/migrated.yml#/components/schemas/DeployAbstractContract' +- type: object + required: + - name + - symbol + - contractType + - initialSupply + - initialHolder + properties: + name: + type: string + maxLength: 255 + description: The name of the ERC20 token. + symbol: + type: string + maxLength: 255 + description: The symbol of the ERC20 token. + contractType: + type: string + enum: + - fungible + description: The type of contract to deploy. + initialSupply: + type: string + description: The initial supply of the ERC20 token. + initialHolder: + type: string + pattern: ^0x[a-fA-F0-9]{40}$ + description: The address that will hold the initial supply of the token. + decimals: + type: integer + minimum: 0 + maximum: 30 + description: The number of decimals the ERC20 token will have. If not provided, + the default value is 18. + pauser: + type: string + pattern: ^0x[a-fA-F0-9]{40}$ + description: The address that can pause the token contract. If not provided, + the pauser is the owner. diff --git a/components/schemas/DeployErc721Contract.yml b/components/schemas/DeployErc721Contract.yml new file mode 100644 index 0000000..ef2f0a5 --- /dev/null +++ b/components/schemas/DeployErc721Contract.yml @@ -0,0 +1,26 @@ +allOf: +- $ref: '../../../components/migrated.yml#/components/schemas/DeployAbstractContract' +- type: object + required: + - name + - symbol + - contractType + properties: + name: + type: string + maxLength: 255 + description: The name of the ERC721 token. + symbol: + type: string + maxLength: 255 + description: The symbol of the ERC721 token. + contractType: + type: string + enum: + - nft + description: The type of contract to deploy. + baseURI: + type: string + maxLength: 500 + description: The base URI for the ERC721 token metadata. If not provided, the + token will not have any base URI prefixed. diff --git a/components/schemas/Error403ChainNotSupported.yml b/components/schemas/Error403ChainNotSupported.yml new file mode 100644 index 0000000..0d80270 --- /dev/null +++ b/components/schemas/Error403ChainNotSupported.yml @@ -0,0 +1,17 @@ +properties: + errorCode: + description: chain.not.supported + example: chain.not.supported + type: string + message: + description: Chain ${chain} is not supported for this operation. + example: Chain ${chain} is not supported for this operation. + type: string + statusCode: + description: '403' + example: 403 + type: number +required: +- errorCode +- message +- statusCode diff --git a/components/schemas/Error403LimitExceeded.yml b/components/schemas/Error403LimitExceeded.yml new file mode 100644 index 0000000..5d5fe83 --- /dev/null +++ b/components/schemas/Error403LimitExceeded.yml @@ -0,0 +1,19 @@ +properties: + errorCode: + description: limit.exceeded + example: limit.exceeded + type: string + message: + description: Your plan limit is exceeded, you can't perform this operation more + then ${limit}x. You can upgrade at https://dashboard.tatum.com. + example: Your plan limit is exceeded, you can't perform this operation more then + ${limit}x. You can upgrade at https://dashboard.tatum.com. + type: string + statusCode: + description: '403' + example: 403 + type: number +required: +- errorCode +- message +- statusCode diff --git a/components/schemas/Error403MainnetNotSupported.yml b/components/schemas/Error403MainnetNotSupported.yml new file mode 100644 index 0000000..97fc021 --- /dev/null +++ b/components/schemas/Error403MainnetNotSupported.yml @@ -0,0 +1,19 @@ +properties: + errorCode: + description: mainnet.not.supported + example: mainnet.not.supported + type: string + message: + description: Mainnet is not supported for this operation for your plan. You can + upgrade at https://dashboard.tatum.com. + example: Mainnet is not supported for this operation for your plan. You can upgrade + at https://dashboard.tatum.com. + type: string + statusCode: + description: '403' + example: 403 + type: number +required: +- errorCode +- message +- statusCode diff --git a/components/schemas/Error403PlanNotSupported.yml b/components/schemas/Error403PlanNotSupported.yml new file mode 100644 index 0000000..4e95452 --- /dev/null +++ b/components/schemas/Error403PlanNotSupported.yml @@ -0,0 +1,19 @@ +properties: + errorCode: + description: product.not.supported + example: product.not.supported + type: string + message: + description: Your plan is not supported to perform this operation. You can subscribe + at https://dashboard.tatum.com. + example: Your plan is not supported to perform this operation. You can subscribe + at https://dashboard.tatum.com. + type: string + statusCode: + description: '403' + example: 403 + type: number +required: +- errorCode +- message +- statusCode diff --git a/components/schemas/EvmErc721Mint.yml b/components/schemas/EvmErc721Mint.yml new file mode 100644 index 0000000..9473490 --- /dev/null +++ b/components/schemas/EvmErc721Mint.yml @@ -0,0 +1,45 @@ +type: object +properties: + chain: + type: string + enum: + - bsc-mainnet + - bsc-testnet + - ethereum-mainnet + - ethereum-sepolia + - polygon-mainnet + - polygon-mumbai + - celo-mainnet + - celo-alfajores + - one-mainnet-s0 + - one-testnet-s0 + - kcs-mainnet + - kcs-testnet + description: The blockchain network where to mint NFT. + to: + type: string + pattern: ^0x[a-fA-F0-9]{40}$ + description: The address of the NFT receiver. + url: + type: string + pattern: ipfs://[a-f0-9]{60} + description: The URL pointing to the NFT metadata; for more information, see EIP-721 + tokenId: + type: string + pattern: ^[0-9]+$ + description: Token Id of NFT to be minted + contractAddress: + type: string + pattern: ^0x[a-fA-F0-9]{40}$ + description: Smart contract address of the NFT collection + minter: + type: string + pattern: ^0x[a-fA-F0-9]{40}$ + description: The address of the minter of the contract. If not provided, the owner + will be the minter. +required: +- chain +- to +- url +- tokenId +- contractAddress diff --git a/components/schemas/Utxo.yml b/components/schemas/Utxo.yml new file mode 100644 index 0000000..b645d65 --- /dev/null +++ b/components/schemas/Utxo.yml @@ -0,0 +1,31 @@ +type: object +required: +- chain +- address +- txHash +- index +- value +- valueAsString +properties: + chain: + $ref: '../../../components/migrated.yml#/components/schemas/ChainUtxoEnum' + address: + type: string + description: Address of the UTXO + example: bc1qmfp2r68cde646jv5ns7x2qvah8v5qtfw8gznj2 + txHash: + type: string + description: Hash of the transaction this UTXO is present in + example: '0x1b5b3e8a671434bf5d0d38e3e52dcafac484441a48bfae4a3f71e5b0b3093d8e' + index: + type: number + description: Index of the UTXO in the transaction + example: 0 + value: + type: number + description: Value of the UTXO, in BTC, LTC or DOGE. + example: 0.0001 + valueAsString: + type: string + description: String representation of the value of the UTXO, in BTC, LTC or DOGE. + example: '0.0001'