Skip to main content

Web3 core

Abstract​

Thanks to Core API, a developer who is starting his way in blockchain and has already seen some Solidity, can make calls to smart contracts simply by knowing the name of the function and its parameters. Vottun deploys the smart contract to the platform and, from there, allows you to deploy it to any of the supported protocols and interact with it using this simple API Rest.

The API provides the developer with seveall calls, but there are 3 of them to interact with the smart contract in any way:

  1. Deploy Smart Contract: Allows to deploy a smart contract on the selected blockchain.
  2. Send Transaction: Makes a call to the smart contract in which there is a change of contract status (mint, transfer...).
  3. Query Smart Contract Information: Performs a call to the smart contract in which there is no change of state of the smart contract (balanceOf, ownerOf...).

All calls to be made to core api require some knowledge of the smart contract we will be working with. In all the calls we will have a field inside the json called params that must include the parameters required by the function we will call. In the case of deploy, depending on how the constructor has been implemented, these parameters will have to be passed in the same order. In the case of the rest of the functions, in addition, the name of the function as implemented in the smart contract must be passed and, subsequently, the parameters, following the same rules as the deploy.

Endpoints​

Deploy Smart Contract​

Thanks to this endpoint you can deploy a smart contract on the blockchain of your choice. The smart contract must be previously uploaded to the platform as its identifier must be informed in the contractSpecsId field. Its execution will return the address of the contract and the hash transaction.

The call to be executed is:

POST https://api.vottun.tech/core/v1/evm/contract/deploy

Request

The request must include a json body with the following fields:

nametyperequireddescriptionexample
contractSpecsIdintyesContract Specs ID. Is the id of the contract deployed in the Core Platform3
myReferencestringnocustomer reference. It is used to retrieve information about the request if a problem occurs during the request. It is better to use different one for each request but if it is repeated there will not raise any errorREF0008A5F
senderstringyessender address. It will be the contract owner.0xA9I99DF..7EB3CD
blockchainNetworkintyesThe chain id1
gasLimitintnothe maximum amount of work you estimate a validator will do for the transaction. It this field is not set, the platform will estimate the gas in background before sending the transaction.4000000
useGasEstimationboolnoif this field is set to false, the platform will not check gas estimation with the chain. By default is set to truefalse
gasPriceintnothe gas price to use in the transaction measured in GWEI. If it is not informed, it is requested to the chain. Required to accelerate a transaction25000
priorityFeefloatnoThe priority fee (tip) measured in GWEI incentivizes validators to include a transaction in the block.0.1
nonceintnoThe nonce to use in this transaction. If it is not informed, it is requested to the chain. Required to accelerate a transaction47
aliasstringnoA name for the smart contract deployed, for your use to recognize easily the contract. If it is not informed, the contract address is used.NFT Cartoons
params[]anyyesIt is an array with all the parameters required for the smart contract constructor. The order is important["Vottun NFT","VTNFT"]

Example

{
"contractSpecsId":20,
"sender":"0xfFc2780b3f4C..09427D04bEc41C60A",
"blockchainNetwork": 1,
"gasLimit": 4000000,
"alias": "By Core",
"params": [
"Token Name",
"Symbol",
1000000000000000000000000000,
"0xfFc2780b3f4C..407409427D04bEc41C60A"
]
}

Response

It will return a json with the following fields (the transaction is not still confirmed):

nametypedescriptionexample
contractAddressstringThe contract Address0x62F0E381Cd7f3e856176abb2b9cB7Eb02856C511
txHashstringThe transaction Hash0x72f9f35c4fe92b6580..6db6719e903

Example

{
"contractAddress": "0x62F0E381Cd7f3e..b2b9cB7Eb02856C511",
"txHash": "0x72f9f35c4fe92b658..c5608c31df06807fc9f5e7243e6db6719e903"
}

Http status

resulthttp status
The smart contract transaction has been inserted succesfully201
The request does not include the correct information as per format or content or the gas limit informed is under the one estimated by the blockchain400
The customer is not authorized401
There is an error with any of the vottun dependencies or with the customer (in this case contact with Vottun)503

Send Transaction​

This endpoint allows us to call any public function implemented in the smart contract and change its state. As discussed in the abstract, you need to know both the name of the function and its parameters in the right order.

If the smart contract has not been deployed by Vottun platform, then the ABI of the contract must be uploaded to the platform and get the contractSpecsId identifier to be used instead of the smart contract address.

The call to be executed is:

POST https://api.vottun.tech/core/v1/evm/transact/mutable

Request

The request must include a json body with the following fields:

nametyperequireddescriptionexample
contractAddressstringyesIt is the contract on which the transaction is to be executed.0xCC8b33F895F..6a4FfcFfD3C729Fd
myReferencestringnocustomer reference. It is used to retrieve information about the request if a problem occurs during the request. It is better to use different one for each request but if it is repeated there will not raise any errorREF0008A5F
contractSpecsIdintnoContract Specs ID. If the transaction mast be executed on an external smart contract (not deployed by Vottun Platform), you need to inform this field in order to set what ABI must the execution use.3
senderstringyessender address. The addres that will send the transaction0xfFc2780b3f4C..D04bEc41C60A
blockchainNetworkintyesThe chain id1
valueintnoamount of native token to transfer from sender to recipient (denominated in WEI)1849367
gasLimitintnothe maximum amount of work you estimate a validator will do for the transaction250000
useGasEstimationboolnoif this field is set to false, the platform will not check gas estimation with the chain. By default is set to truefalse
gasPriceintnothe gas price to use in the transaction measured in GWEI. If it is not informed, it is requested to the chain. Required to accelerate a transaction25000
priorityFeefloatnoThe priority fee (tip) measured in GWEI incentivizes validators to include a transaction in the block.0.1
nonceintnoThe nonce to use in this transaction. If it is not informed, it is requested to the chain. Required to accelerate a transaction47
methodstringyesthe smart contract function name written as it appears at the ABI file. That means, the name has to be the same that the one in the smart contract code."transfer"
params[]anyyesIt is an array with all the parameters required for the smart contract constructor. The order is important["Vottun NFT","VTNFT"]

Example

{
"contractAddress": "0xCC8b33F895F..0f0F6a4FfcFfD3C729Fd",
"sender": "0xfFc2780b3f4C..07409427D04bEc41C60A",
"blockchainNetwork": 1,
"gasLimit": 250000,
"method": "transfer",
"params": [
"0x05447f753a75c16..56d18558b81DcF6B78",
100000000000000
]
}

Response

The mutable transaction request will return a json with the following information:

nametypedescriptionexample
txHashstringThe transaction Hash0xb3ba0828ac232..63ddfef73b5d6860a82a6
nonceintthe transaction number from the account27

Example

{
"txHash": "0xb3ba0828ac232c48b69bb3..63ddfef73b5d6860a82a6",
"nonce": 27
}

Http status

resulthttp status
The transaction has been inserted succesfully201
The request does not include the correct information as per format or content or the gas limit informed is under the one estimated by the blockchain400
The customer is not authorized401
There is an error with any of the vottun dependencies or with the customer (in this case contact with Vottun)503

Query Smart Contract information​

This endpoint allows us to call any public function implemented in the smart contract aht not changes its state, only view functions. As discussed in the abstract, you need to know both the name of the function and its parameters in the right order.

If the smart contract has not been deployed by Vottun platform, then the ABI of the contract must be uploaded to the platform and get the contractSpecsId identifier to be used instead of the smart contract address.

The call to be executed is:

GET|POST https://api.vottun.tech/core/v1/evm/transact/view

Request

The request must include a json body with the following fields:

nametyperequireddescriptionexample
contractAddressstringyesIt is the contract on which the transaction is to be executed.0xCC8b33F895F..6a4FfcFfD3C729Fd
contractSpecsIdintnoContract Specs ID. If the transaction mast be executed on an external smart contract (not deployed by Vottun Platform), you need to inform this field in order to set what ABI must the execution use.3
blockchainNetworkintyesThe chain id1
methodstringyesthe smart contract function name written as it appears at the ABI file. That means, the name has to be the same that the one in the smart contract code."transfer"
params[]anyyesIt is an array with all the parameters required for the smart contract constructor. The order is important["Vottun NFT","VTNFT"]

Example

{
"contractAddress":"0x0A212363e559D..BA20e5A3Aa0C",
"blockchainNetwork":43113,
"method": "carModelByPlate",
"params": [
"0000AAA"
]
}

Response

The response will return a json with an array with the values that solidity function returns.

Example

In this case, the carModelByPlate, returns an array with only a value that contains the model of the vehicle that has that plate number assigned.

[
"Berlingo"
]

Http status

resulthttp status
Information request is successful200
The request does not include the correct information as per format or content400
The customer is not authorized401

Get Available Blockchain Networks​

This endpoint allows you to request the available list of blockchain networks (chains). If your plan is the free one, you will receive only the Tesnet Ones

The call to be executed is:

GET https://api.vottun.tech/core/v1/evm/info/chains

Path Params

This request does not require path params

Query Params

this request does not require query params

Response

The call will return one array with mainnet and another array with testnet networks with the following information:

nametypedescriptionexample
idintthe id of EVM networks1
namestringthe name of the networkPolygon Mainnet
symbolstringthe short name of the native token of the networkETH
isMainnetbooleana flag for indentificate if the network is mainet or testnetfalse
explorerstringthe url of the site where you can look for all the transactions of the networkhttps://etherscan.io
testnetFaucetstringthe url of the site where you can obtain tokens for testinghttps://faucet.avax-test.network
typeIdintthe internal indentificator of the blockchain type1
typeNamestringthe interal name of the nework typeEVM

Example

{
"mainnetNetworks": [
{
"id": 1,
"name": "Ethereum Mainnet",
"symbol": "ETH",
"isMainnet": true,
"explorer": "https://etherscan.io",
"testnetFaucet": null,
"typeId": 1,
"typeName": "EVM"
}, ...
],
"testnetNetworks": [
{
"id": 43113,
"name": "Avalanche Fuji",
"symbol": "AVAX",
"isMainnet": false,
"explorer": "https://testnet.snowtrace.io/",
"testnetFaucet": "https://faucet.avax-test.network/",
"typeId": 1,
"typeName": "EVM"
}, ...

]
}

Http status

resulthttp status
Information request is successful200
The request does not include the correct information as per format or content400
The customer is not authorized401

Get Available Contract Specs​

The smart contract of your application is the most important part to consider when developing decentralized solutions. It is where the rules to interact with the network you have selected are written. Some of these contracts are Ethereum standards, such ERC-721 or ERC-1155 for NFTs or ERC-20 for cryptocurrencies. But in the case you are an advanced developer it is possible to develop and deploy your own contract. Currently using the Vottun Blockchain API it is only possible to deploy standard contracts but in the future it will be possible to deploy any type of contract.

This endpoint allows you to request the available list of contract specifications. Those are the available contracts in the platform. With this endpoint you will receive the shared contracts (everyone can use them) and your owned smart contracts (in premium plans uploading your implemented smart contracts)

The call to be executed is:

GET https://api.vottun.tech/core/v1/evm/info/specs

Path Params

This request does not require path params

Query Params

this request does not require query params

Response

The call will return one array all the contract types that the Vottun Blockchain Platform supports:

nametypedescriptionexample
idintThe internal id of the contract2
namestringThe name of the contractNFT721Audited
descriptionstringThe contract descriptionThis smart contract goal is to create a...
ownedbooleanIf this flag is ture, then the smart contract belongs to youfalse
sharedbooleanIf the contract is shared and can be used by everybody, this flag is set to truetrue
auditedbooleanIf the contract is audited this flag is set to true. If the contract is not audited it can pose various risks and potential problems. Use it in mainnet networks at your own risk.false

Example

{
[
{
"id": 2,
"name": "Nfv2MetadData",
"description": "",
"owned": false,
"shared": true,
"audited": false
},
{
"id": 4,
"name": "VottunPoapNoWallet",
"description": "",
"owned": false,
"shared": true,
"audited": false
},...
]
}

Http status

resulthttp status
Information request is successful200
The request does not include the correct information as per format or content400
The customer is not authorized401

Query Address to Know if it is an Smart Contract​

(Added on April 9th, 2024)

This endpoint allows you to interrogate the blockchain for an address and find out if it represents a smart contract.

This call can be used, for example, when we receive a transaction from a transfer but we do not know if it is native or from an ERC20 token. If we execute this call with the address we receive in the "to" we will know if it represents a Smart Contract, which would indicate that it is an ERC20 or not, which would indicate a possible native transfer.

The call to be executed is:

GET https://api.vottun.tech/core/v1/evm/info/address/{address}/iscontract?network=<networkId>

Path Params

nametyperequireddescriptionexample
addressstringyesThe address we wish to query.0xCC8b33F895F..6a4FfcFfD3C729Fd

Query Params

nametyperequireddescriptionexample
networkintyesIt identifies the blockchain network where address exists.1

Response

The call will return the following json object:

nametypedescriptionexample
isContractboolIf the answer is true, then the address represents an smart contracttrue

Example

{
"isContract": true
}

Http status

resulthttp status
Information request is successful200
The request does not include the correct information as per format or content400
The customer is not authorized401

Get Transaction Information​

(Updated on April 9th, 2024)

This endpoint allows to query a transaction information from the blockchain. That means, get all the information about the status of the transaction, the function invoked in the smart contract, the value, the gas as well as other information you can see at the json at response example

The call to be executed is:

GET https://api.vottun.tech/core/v1/evm/info/transaction/{txHash}?network=<networkId>

Path Params

nametyperequireddescriptionexample
txHashstringyesThe transaction Hash0x72f9f35c4fe92b6580..6db6719e903

Query Params

nametyperequireddescriptionexample
networkintyesIt identifies the blockchain network where the transaction was inserted.1
contractSpecsIdintnoContract Specs ID. Is the id of the contract compatible with the transaction contract. If this field is informed the input data and logs will be decoded if possible20

Response

The call will return the following json object with the blockchain transaction information.

nametypedescriptionexample
networkintThe network identifier (chain id)1
transaction.hashstringThe hash of the transaction"0xcc4ebabe3c579..d27bea06b4e0"
transaction.valueintThe value of the transaction0
transaction.gasintThe gas limit for the transaction250000
transaction.gasPriceintThe gas price for the transaction25000000000
transaction.gasTipCapintThe gas tip cap for the transaction25000000000
transaction.nonceintThe nonce of the transaction65
transaction.fromstringThe sender's address."0xfFc2780b3f4C2b..09427D04bEc41C60A"
transaction.tostringThe recipient's address."0x8936fD0B578fA7..56AbBF2c7AF9F3952"
transaction.pendingboolWhether the transaction is pendingfalse
transaction.inputData.functionstringThe function called in the transaction"transfer(address recipient, uint256 amount)"
transaction.inputData.functionIdstringThe function ID"0xa9059cbb"
transaction.inputData.inputs[]interfaceInputs for the function["0xbaacadb05b97a..12ad7ede01", 1000000000000000000]
receipt.hashstringThe hash of the receipt"0xcc4ebaf59f4..9bd27be4013a06b4e0"
receipt.blockHashstringThe block hash of the receipt"0x840f4910b5e6f..435b79e8cea52382c8"
receipt.gasPriceintThe gas price for the transaction25000000000
receipt.gasUsedintThe gas used by the transaction34441
receipt.cumulativeGasUsedintThe cumulative gas used by the transaction34441
receipt.tokenId
deprecated
intThe token IDnull
receipt.from
deprecated
stringThe sender's address""
receipt.to
deprecated
stringThe recipient's address""
receipt.blockTimestringThe block time of the receipt"2023-08-31T14:54:51Z"
receipt.statusintThe status of the transaction1
receipt.logs
new
arrayAn array of transaction logsSee below
receipt.logs.address
new
stringThe receiving party of the transaction (could be an smart contract)"0x8936fD0B578fA7..56AbBF2c7AF9F3952"
receipt.logs.name
new
stringThe event name"Transfer"
receipt.logs.topics
new
arrayAn array of log record topicsSee below
receipt.logs.topics.name
new
stringThe topic name if it can be decoded"from"
receipt.logs.topics.value
new
stringThe topic value in hex encoding"from"
receipt.logs.data
new
arrayAn array of log record topicsSee below
receipt.logs.data.name
new
stringThe data name if it can be decoded"value"
receipt.logs.data.value
new
stringThe data value in hex encoding"from"
receipt.errorMessagestringError message"An error was thrown deploying contract. insufficient funds for gas * price + value"
errorboolIndicates if there was an errortrue
errorInfo.codestringError code"ERROR_INSUFICIENT_FUNDS"
errorInfo.messagestringError message"Insuficient funds"

Example

{
"network": 43113,
"transaction": {
"hash": "0xcc4ebaf53ff0be3c579f44..1c8ba39bd27be4015123a06b4e0",
"value": 0,
"gas": 250000,
"gasPrice": 25000000000,
"gasTipCap": 25000000000,
"nonce": 65,
"from": "0xfFc2780b3f4..427D04bEc41C60A",
"to": "0x8936fD0B578f..F2c7AF9F3952",
"pending": false,
"inputData": {
"function": "transfer(address recipient, uint256 amount)",
"functionId": "0xa9059cbb",
"inputs": [
"0xbaacadb05b97a..a0812a05bead7ede01",
1000000000000000000
]
}
},
"receipt": {
"hash": "0xcc4ebaf53ff0be3c579f445..8ba39bd27be4015123a06b4e0",
"blockHash": "0x840f47401cbbea9910b5e6..9193c435b79e89ecea52382c8",
"gasPrice": 25000000000,
"gasUsed": 34441,
"cumulativeGasUsed": 34441,
"tokenId": null,
"from": "",
"to": "",
"blockTime": "2023-08-31T14:54:51Z",
"status": 1,
"errorMessage": ""
},
"error": false,
"errorInfo": {
"code": "",
"message": ""
}
}

Http status

resulthttp status
Information request is successful200
The request does not include the correct information as per format or content400
The customer is not authorized401

Get Transaction Status​

This endpoint allows to query a transaction status from API platform. Returns information from database in order to check if the transaction has finished or is in other state.

The call to be executed is:

GET https://api.vottun.tech/core/v1/evm/info/transaction/{txHash}/status?network=<networkId>

Path Params

nametyperequireddescriptionexample
txHashstringyesThe transaction Hash0x72f9f35c4fe92b6580..6db6719e903

Query Params

nametyperequireddescriptionexample
networkintyesIt identifies the blockchain network where the transaction was inserted.1

Response

The call will return one array all the contract types that the Vottun Blockchain Platform supports:

nametypedescriptionexample
idstringThe unique identifier"162194aa-0351-4979-bcf7-a4f98f1eb468"
txHashstringThe transaction hash"0x7bc51b04eca..48a9f6b85543c"
blockchainNetworkintThe blockchain network identifier97
statusstringThe status of the transaction (inserted, processing, confirmed, error, evmError)"confirmed"
errorboolIndicates if there was an errornull
creationTimestampintTimestamp of creation (Unix milliseconds)1694024542000
confirmationTimestampintTimestamp of confirmation (Unix milliseconds)1694024565000

For status field these are the possible values:

  • ìnserted: The transaction has been inserted in the blockchain but is still pending
  • processing: Our platform is checking if the transaction has been processed and confirmed. The transaction will remain with this status until it is confirmed.
  • confirmed: The transaction has been confirmed succesfully.
  • error: An off-chain error has raised. This should be an error that raises before sending the transaction to the blockchain.
  • evmError: An on-chain error has raised. The transaction has been sent to the blockchain and an error has raised.

Example

{
"id": "162194aa-0351-4979-bcf7-a4f98f1eb468",
"txHash": "0x7bc51b04eca06b8b8ca..ada60d9809148a9f6b85543c",
"blockchainNetwork": 97,
"status": "confirmed",
"error": null,
"creationTimestamp": 1694024542000,
"confirmationTimestamp": 1694024565000
}

Http status

resulthttp status
Information request is successful200
The request does not include the correct information as per format or content400
The customer is not authorized401

Get Transaction Status by Reference​

This endpoint allows to query a transaction status from API platform using the customer reference. Returns information from database in order to check if the transaction has finished or is in other state. It is useful if the Deploy Contract or Send Transaction requests end without any response.

The call to be executed is:

GET https://api.vottun.tech/core/v1/evm/info/transaction/reference/{reference}

Path Params

nametyperequireddescriptionexample
referencestringyesThe Customer reference added to Deploy Contract and Send Transaction requestsAny Alphanumeric value of maximum length 128 characters

Query Params

this request does not require query params

Response

The call will return one a json including the reference and an array of all the transactions that meet the reference. If the reference does not exist, returns the reference with an empty array:

nametypedescriptionexample
referencestringThe unique reference"CustRef00001A"
infoarrayAn array of Transaction Status meeting the referenceSee below
info.idstringThe unique identifier"162194aa-0351-4979-bcf7-a4f98f1eb468"
info.txHashstringThe transaction hash"0x7bc51b04eca..48a9f6b85543c"
info.blockchainNetworkintThe blockchain network identifier97
info.statusstringThe status of the transaction (inserted, processing, confirmed, error, evmError)"confirmed"
info.errorboolIndicates if there was an errornull
info.creationTimestampintTimestamp of creation (Unix milliseconds)1694024542000
cinfo.onfirmationTimestampintTimestamp of confirmation (Unix milliseconds)1694024565000

For info.status field these are the possible values:

  • ìnserted: The transaction has been inserted in the blockchain but is still pending
  • processing: Our platform is checking if the transaction has been processed and confirmed. The transaction will remain with this status until it is confirmed.
  • confirmed: The transaction has been confirmed succesfully.
  • error: An off-chain error has raised. This should be an error that raises before sending the transaction to the blockchain.
  • evmError: An on-chain error has raised. The transaction has been sent to the blockchain and an error has raised.

Example

{
"reference": "CustRef00001A",
"info": [
{
"id": "481846d9-31a0-48c4-a0ba-753b44a45b59",
"txHash": "0xab0456aec6fe6856bf34091433048bfb3dfebe23ff9791fb7beaed6da82d9f11",
"blockchainNetwork": 43113,
"status": "confirmed",
"error": null,
"creationTimestamp": 1695990398000
},
{
"id": "481846d9-31a0-48c4-a0ba-72cb44a45b59",
"txHash": "0xab0456aec6fe6856ba45091433048bfb3dfebe23ff9791fb7beaed6da82d9f11",
"blockchainNetwork": 43113,
"status": "evmError",
"error": "Insuficient funds",
"creationTimestamp": 1695990395000
}
]
}

Http status

resulthttp status
Information request is successful200
The request does not include the correct information as per format or content400
The customer is not authorized401

Get Gas Price​

This endpoint allows to you to get the current gas price for the blockchain network. The price is returned in GWEIs (10-9 ETH)

The call to be executed is:

GET https://api.vottun.tech/core/v1/evm/network/gasprice?network=<networkId>

Path Params

This request does not require path params

Query Params

nametyperequireddescriptionexample
networkintyesIt identifies the blockchain for which you want to know the gas price.1

Example

GET https://api.vottun.tech/core/v1/evm/network/gasprice?network=97

Response

It will return a json with the following fields:

nametypedescriptionexample
gasPriceGweiintthe gas price in GWEIs 1,000,000,000 Weis90.8

Example

{
"gasPriceGwei": 90.8
}

Http status

resulthttp status
Information request is successful200
The request does not include the correct information as per format or content400
The customer is not authorized401

Balance of Native Crypto​

This endpoint allows you to request the balance of native crypto for a given account. Native crypto is the crypto that we use on each blockchain to pay for the gas from operations.

The call to be executed is:

GET https://api.vottun.tech/core/v1/evm/chain/{account}/balance?network=<networkId>

Path Params

nametyperequireddescriptionexample
accountstringyesIt identifies the account to get the balance0xA9I99DF..7EB3CD

Query Params

nametyperequireddescriptionexample
networkintyesIt identifies the blockchain for which you want to know the account balance.1

Example

GET https://api.vottun.tech/core/v1/evm/chain/0xA9I99DF..7EB3CD/balance?network=43113

Response

It will return a json with the following fields:

nametypedescriptionexample
balanceintThe native crypto account balance at the given chain48.71336216034074

Example

{
"balance": 48.71336216034074
}

Http status

resulthttp status
Information request is successful200
The request does not include the correct information as per format or content400
The customer is not authorized401

Estimate gas for smart contract deployment​

Thanks to this endpoint, you can estimate the gas required to deploy a smart contract on the blockchain of your choice. The smart contract must first be uploaded to the platform, as its identifier must be provided in the contractSpecsId field. Its execution will return the address of the contract and the hash transaction. The call to be executed is:

GET|POST https://api.vottun.tech/core/v1/evm/contract/deploy/estimategas

Request

The request must include a json body with the following fields:

nametyperequireddescriptionexample
contractSpecsIdintyesContract Specs ID. Is the id of the contract deployed in the Core Platform3
senderstringyessender address. It will be the contract owner.0xA9I99DF..7EB3CD
blockchainNetworkintyesThe chain id1
params[]anyyesIt is an array with all the parameters required for the smart contract constructor. The order is important["Vottun NFT","VTNFT"]

Example

{
"contractSpecsId":20,
"sender":"0xfFc2780b3f4C..09427D04bEc41C60A",
"blockchainNetwork": 1,
"params": [
"Token Name",
"Symbol",
1000000000000000000000000000,
"0xfFc2780b3f4C..407409427D04bEc41C60A"
]
}

Response

It will return a json with the following fields (the transaction is not still confirmed):

nametypedescriptionexample
estimatedGasintthe estimated gas for the transaction845034

Example

{
"estimatedGas": 845034
}

Http status

resulthttp status
Gas estimation request was successful200
Gas estimation failed, see error message400
The customer is not authorized401
There is an error with any of the vottun dependencies or with the customer (in this case contact with Vottun)503

Estimate gas to send transaction​

This endpoint allows us to estimate the required gas to call any public function implemented in the smart contract that changes its state. As discussed in the abstract, you need to know both the name of the function and its parameters in the right order.

The call to be executed is:

GET|POST https://api.vottun.tech/core/v1/evm/transact/mutable/estimategas

Request

The request must include a json body with the following fields:

nametyperequireddescriptionexample
contractAddressstringyesIt is the contract on which the transaction is to be executed.0xCC8b33F895F..6a4FfcFfD3C729Fd
senderstringyessender address. The addres that will send the transaction0xfFc2780b3f4C..D04bEc41C60A
blockchainNetworkintyesThe chain id1
valueintnoamount of native token to transfer from sender to recipient (denominated in WEI)1849367
methodstringyesthe smart contract function name written as it appears at the ABI file. That means, the name has to be the same that the one in the smart contract code."transfer"
params[]anyyesIt is an array with all the parameters required for the smart contract constructor. The order is important["Vottun NFT","VTNFT"]

Example

{
"contractAddress":"0x79E392dbb...093f01b8f35671677",
"sender":"0xD73bE155a68...09297746A23a08",
"blockchainNetwork":31,
"value": 10000000,
"method": "transfer",
"params": [
"0xBAacAdb05...0812A05BEad7ede01",
100000000000000000000
]
}

Response

It will return a json with the following fields (the transaction is not still confirmed):

nametypedescriptionexample
estimatedGasintthe estimated gas for the transaction23256

Example

{
"estimatedGas": 23256
}

Http status

resulthttp status
Gas estimation request was successful200
Gas estimation failed, see error message400
The customer is not authorized401
There is an error with any of the vottun dependencies or with the customer (in this case contact with Vottun)503

Estimate gas for native crypto transfer​

This endpoint allows you to estimate the required gas to transfer native assets (ETH, MATIC...)

The sending account must have sufficient funds to complete the transfer. If this is not the case, an insufficient funds error will be returned and the transfer will not be estimated.

The call that must be performed is:

GET|POST https://api.vottun.tech/core/v1/evm/chain/transfer/estimategas

Request

The request must include a json body with the following fields:

nametyperequireddescriptionexample
senderstringyessender address. The addres that transfers the native assets.0xfFc2780..D04bEc41C60A
recipientstringyesThis field is the account to which the native assets are transferred.0xfE463ce3..1332A8994a
blockchainNetworkintyesThe chain id1
valueintyesamount of native assets to transfer from sender to recipient (denominated in WEI)1849367

Example

{
"sender": "0xD73bE155a683...E09297746A23a08",
"recipient": "0xBAacAdb05...A05BEad7ede01",
"blockchainNetwork": 31,
"value": 100000
}

Response

It will return a json with the following fields (the transaction is not still confirmed):

nametypedescriptionexample
estimatedGasintthe estimated gas for the transaction23256

Example

{
"estimatedGas": 23256
}

Http status

resulthttp status
Gas estimation request was successful200
Gas estimation failed, see error message400
The customer is not authorized401
There is an error with any of the vottun dependencies or with the customer (in this case contact with Vottun)503