Deploy contract
Deploy a new contract by contract template id. If you wish to deploy a token (ERC20, ERC721 etc), and create asset please use POST /tokenization
POST
/
tokenization
/
templates
/
{contractTemplateId}
/
deploy
TypeScript
const response: Promise<FireblocksResponse<ContractDeployResponse>> = fireblocks.contractTemplates.deployContract(contractTemplatesApiDeployContractRequest);CompletableFuture<ApiResponse<ContractDeployResponse>> response = fireblocks.contractTemplates().deployContract(contractDeployRequest, contractTemplateId, idempotencyKey);response = fireblocks.contract_templates.deploy_contract(contract_deploy_request, contract_template_id, idempotency_key);curl --request POST \
--url https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy \
--header 'Content-Type: application/json' \
--data '
{
"assetId": "ETH_TEST5",
"vaultAccountId": "0",
"constructorParameters": [
{
"internalType": "string",
"name": "name_",
"type": "string",
"value": "TokenName"
},
{
"internalType": "string",
"name": "symbol_",
"type": "string",
"value": "TokenSymbol"
}
],
"useGasless": false,
"fee": "2000",
"feeLevel": "MEDIUM"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
assetId: 'ETH_TEST5',
vaultAccountId: '0',
constructorParameters: [
{internalType: 'string', name: 'name_', type: 'string', value: 'TokenName'},
{internalType: 'string', name: 'symbol_', type: 'string', value: 'TokenSymbol'}
],
useGasless: false,
fee: '2000',
feeLevel: 'MEDIUM'
})
};
fetch('https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assetId' => 'ETH_TEST5',
'vaultAccountId' => '0',
'constructorParameters' => [
[
'internalType' => 'string',
'name' => 'name_',
'type' => 'string',
'value' => 'TokenName'
],
[
'internalType' => 'string',
'name' => 'symbol_',
'type' => 'string',
'value' => 'TokenSymbol'
]
],
'useGasless' => false,
'fee' => '2000',
'feeLevel' => 'MEDIUM'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy"
payload := strings.NewReader("{\n \"assetId\": \"ETH_TEST5\",\n \"vaultAccountId\": \"0\",\n \"constructorParameters\": [\n {\n \"internalType\": \"string\",\n \"name\": \"name_\",\n \"type\": \"string\",\n \"value\": \"TokenName\"\n },\n {\n \"internalType\": \"string\",\n \"name\": \"symbol_\",\n \"type\": \"string\",\n \"value\": \"TokenSymbol\"\n }\n ],\n \"useGasless\": false,\n \"fee\": \"2000\",\n \"feeLevel\": \"MEDIUM\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"assetId\": \"ETH_TEST5\",\n \"vaultAccountId\": \"0\",\n \"constructorParameters\": [\n {\n \"internalType\": \"string\",\n \"name\": \"name_\",\n \"type\": \"string\",\n \"value\": \"TokenName\"\n },\n {\n \"internalType\": \"string\",\n \"name\": \"symbol_\",\n \"type\": \"string\",\n \"value\": \"TokenSymbol\"\n }\n ],\n \"useGasless\": false,\n \"fee\": \"2000\",\n \"feeLevel\": \"MEDIUM\"\n}"
response = http.request(request)
puts response.read_body{
"txId": "b70701f4-d7b1-4795-a8ee-b09cdb5b850d"
}{
"message": "Contract does not exist",
"code": 404
}{
"message": "<string>",
"code": 123
}Headers
Body
application/json
Was this page helpful?
⌘I
TypeScript
const response: Promise<FireblocksResponse<ContractDeployResponse>> = fireblocks.contractTemplates.deployContract(contractTemplatesApiDeployContractRequest);CompletableFuture<ApiResponse<ContractDeployResponse>> response = fireblocks.contractTemplates().deployContract(contractDeployRequest, contractTemplateId, idempotencyKey);response = fireblocks.contract_templates.deploy_contract(contract_deploy_request, contract_template_id, idempotency_key);curl --request POST \
--url https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy \
--header 'Content-Type: application/json' \
--data '
{
"assetId": "ETH_TEST5",
"vaultAccountId": "0",
"constructorParameters": [
{
"internalType": "string",
"name": "name_",
"type": "string",
"value": "TokenName"
},
{
"internalType": "string",
"name": "symbol_",
"type": "string",
"value": "TokenSymbol"
}
],
"useGasless": false,
"fee": "2000",
"feeLevel": "MEDIUM"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
assetId: 'ETH_TEST5',
vaultAccountId: '0',
constructorParameters: [
{internalType: 'string', name: 'name_', type: 'string', value: 'TokenName'},
{internalType: 'string', name: 'symbol_', type: 'string', value: 'TokenSymbol'}
],
useGasless: false,
fee: '2000',
feeLevel: 'MEDIUM'
})
};
fetch('https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assetId' => 'ETH_TEST5',
'vaultAccountId' => '0',
'constructorParameters' => [
[
'internalType' => 'string',
'name' => 'name_',
'type' => 'string',
'value' => 'TokenName'
],
[
'internalType' => 'string',
'name' => 'symbol_',
'type' => 'string',
'value' => 'TokenSymbol'
]
],
'useGasless' => false,
'fee' => '2000',
'feeLevel' => 'MEDIUM'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy"
payload := strings.NewReader("{\n \"assetId\": \"ETH_TEST5\",\n \"vaultAccountId\": \"0\",\n \"constructorParameters\": [\n {\n \"internalType\": \"string\",\n \"name\": \"name_\",\n \"type\": \"string\",\n \"value\": \"TokenName\"\n },\n {\n \"internalType\": \"string\",\n \"name\": \"symbol_\",\n \"type\": \"string\",\n \"value\": \"TokenSymbol\"\n }\n ],\n \"useGasless\": false,\n \"fee\": \"2000\",\n \"feeLevel\": \"MEDIUM\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/tokenization/templates/{contractTemplateId}/deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"assetId\": \"ETH_TEST5\",\n \"vaultAccountId\": \"0\",\n \"constructorParameters\": [\n {\n \"internalType\": \"string\",\n \"name\": \"name_\",\n \"type\": \"string\",\n \"value\": \"TokenName\"\n },\n {\n \"internalType\": \"string\",\n \"name\": \"symbol_\",\n \"type\": \"string\",\n \"value\": \"TokenSymbol\"\n }\n ],\n \"useGasless\": false,\n \"fee\": \"2000\",\n \"feeLevel\": \"MEDIUM\"\n}"
response = http.request(request)
puts response.read_body{
"txId": "b70701f4-d7b1-4795-a8ee-b09cdb5b850d"
}{
"message": "Contract does not exist",
"code": 404
}{
"message": "<string>",
"code": 123
}