Save contract ABI
Save contract ABI for the tenant
const response: Promise<FireblocksResponse<ContractWithAbiDto>> = fireblocks.deployedContracts.addContractABI(deployedContractsApiAddContractABIRequest);CompletableFuture<ApiResponse<ContractWithAbiDto>> response = fireblocks.deployedContracts().addContractABI(addAbiRequestDto, idempotencyKey);response = fireblocks.deployed_contracts.add_contract_a_b_i(add_abi_request_dto, idempotency_key);curl --request POST \
--url https://api.fireblocks.io/v1/tokenization/contracts/abi \
--header 'Content-Type: application/json' \
--data '
{
"contractAddress": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
"baseAssetId": "ETH",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function",
"name": "mint"
}
],
"name": "MyContract"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
contractAddress: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14',
baseAssetId: 'ETH',
abi: [
{
inputs: [
{internalType: 'address', name: 'to', type: 'address'},
{internalType: 'uint256', name: 'amount', type: 'uint256'}
],
stateMutability: 'nonpayable',
type: 'function',
name: 'mint'
}
],
name: 'MyContract'
})
};
fetch('https://api.fireblocks.io/v1/tokenization/contracts/abi', 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/contracts/abi",
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([
'contractAddress' => '0xfff9976782d46cc05630d1f6ebab18b2324d6b14',
'baseAssetId' => 'ETH',
'abi' => [
[
'inputs' => [
[
'internalType' => 'address',
'name' => 'to',
'type' => 'address'
],
[
'internalType' => 'uint256',
'name' => 'amount',
'type' => 'uint256'
]
],
'stateMutability' => 'nonpayable',
'type' => 'function',
'name' => 'mint'
]
],
'name' => 'MyContract'
]),
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/contracts/abi"
payload := strings.NewReader("{\n \"contractAddress\": \"0xfff9976782d46cc05630d1f6ebab18b2324d6b14\",\n \"baseAssetId\": \"ETH\",\n \"abi\": [\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"amount\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\",\n \"name\": \"mint\"\n }\n ],\n \"name\": \"MyContract\"\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/contracts/abi")
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 \"contractAddress\": \"0xfff9976782d46cc05630d1f6ebab18b2324d6b14\",\n \"baseAssetId\": \"ETH\",\n \"abi\": [\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"amount\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\",\n \"name\": \"mint\"\n }\n ],\n \"name\": \"MyContract\"\n}"
response = http.request(request)
puts response.read_body{
"contractAddress": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
"baseAssetId": "ETH_TEST6",
"name": "WETH9",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function",
"name": "mint"
}
],
"isPublic": true,
"isProxy": true,
"implementation": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14"
}{
"message": "<string>",
"code": 123
}Headers
A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.
Body
The address of deployed contract
"0xfff9976782d46cc05630d1f6ebab18b2324d6b14"
The blockchain base assetId
"ETH"
The ABI of the contract
Show child attributes
Show child attributes
[
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function",
"name": "mint"
}
]
The name of the contract
"MyContract"
Response
Contract ABI created (or updated) for the tenant
The address of the contract
"0xfff9976782d46cc05630d1f6ebab18b2324d6b14"
The blockchain base assetId
"ETH_TEST6"
The name of the contract
"WETH9"
The ABI of the contract
Show child attributes
Show child attributes
[
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function",
"name": "mint"
}
]
Whether the contract ABI is public
true
Whether the contract is a proxy contract
true
The implementation contract address
"0xfff9976782d46cc05630d1f6ebab18b2324d6b14"
Was this page helpful?
const response: Promise<FireblocksResponse<ContractWithAbiDto>> = fireblocks.deployedContracts.addContractABI(deployedContractsApiAddContractABIRequest);CompletableFuture<ApiResponse<ContractWithAbiDto>> response = fireblocks.deployedContracts().addContractABI(addAbiRequestDto, idempotencyKey);response = fireblocks.deployed_contracts.add_contract_a_b_i(add_abi_request_dto, idempotency_key);curl --request POST \
--url https://api.fireblocks.io/v1/tokenization/contracts/abi \
--header 'Content-Type: application/json' \
--data '
{
"contractAddress": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
"baseAssetId": "ETH",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function",
"name": "mint"
}
],
"name": "MyContract"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
contractAddress: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14',
baseAssetId: 'ETH',
abi: [
{
inputs: [
{internalType: 'address', name: 'to', type: 'address'},
{internalType: 'uint256', name: 'amount', type: 'uint256'}
],
stateMutability: 'nonpayable',
type: 'function',
name: 'mint'
}
],
name: 'MyContract'
})
};
fetch('https://api.fireblocks.io/v1/tokenization/contracts/abi', 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/contracts/abi",
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([
'contractAddress' => '0xfff9976782d46cc05630d1f6ebab18b2324d6b14',
'baseAssetId' => 'ETH',
'abi' => [
[
'inputs' => [
[
'internalType' => 'address',
'name' => 'to',
'type' => 'address'
],
[
'internalType' => 'uint256',
'name' => 'amount',
'type' => 'uint256'
]
],
'stateMutability' => 'nonpayable',
'type' => 'function',
'name' => 'mint'
]
],
'name' => 'MyContract'
]),
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/contracts/abi"
payload := strings.NewReader("{\n \"contractAddress\": \"0xfff9976782d46cc05630d1f6ebab18b2324d6b14\",\n \"baseAssetId\": \"ETH\",\n \"abi\": [\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"amount\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\",\n \"name\": \"mint\"\n }\n ],\n \"name\": \"MyContract\"\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/contracts/abi")
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 \"contractAddress\": \"0xfff9976782d46cc05630d1f6ebab18b2324d6b14\",\n \"baseAssetId\": \"ETH\",\n \"abi\": [\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"amount\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\",\n \"name\": \"mint\"\n }\n ],\n \"name\": \"MyContract\"\n}"
response = http.request(request)
puts response.read_body{
"contractAddress": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
"baseAssetId": "ETH_TEST6",
"name": "WETH9",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function",
"name": "mint"
}
],
"isPublic": true,
"isProxy": true,
"implementation": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14"
}{
"message": "<string>",
"code": 123
}