-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate v1 smart contract operations
- Loading branch information
juraj.bacovcin
committed
Feb 5, 2024
1 parent
089de95
commit 5518928
Showing
7 changed files
with
264 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
categories/smart_contracts/paths/v1_contract_deploy_post.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.<br/>\nYou can create\ | ||
\ the following types of contracts:\n<ul>\n <li>ERC-20 - Fungible token like USDT</li>\n\ | ||
\ <li>ERC-721 - NFT collection like BAYC</li>\n <li>ERC-1155 - MultiToken NFT\ | ||
\ collection</li>\n</ul>\nYou can find more information about the contracts on our\ | ||
\ <a href=\"https://github.com/tatumio/smart-contract-library\" target=\"_blank\"\ | ||
>GitHub page</a> with steps required for verification.<br/>\nIf you deploy NFT collection\ | ||
\ contract (ERC-721), it is automatically enabled for <a href=\"https://docs.tatum.io/nft-express/what-is-nft-express\"\ | ||
\ target=\"_blank\">NFT Express functionality.</a><br/>\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 |
63 changes: 63 additions & 0 deletions
63
categories/smart_contracts/paths/v1_contract_erc721_mint_post.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.<br/> | ||
NFT will be minted as NFT Express. See more: <a href="https://docs.tatum.io/nft-express/what-is-nft-express" | ||
target="_blank">NFT Express functionality.</a><br/> | ||
' | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |