Encode a Transaction
curl --request POST \
--url https://api.adamik.io/api/{chainId}/transaction/encode \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction": {
"data": {
"mode": "deployAccount",
"senderPubKey": "<string>",
"memo": "<string>",
"contractType": "argentx"
}
}
}
'import requests
url = "https://api.adamik.io/api/{chainId}/transaction/encode"
payload = { "transaction": { "data": {
"mode": "deployAccount",
"senderPubKey": "<string>",
"memo": "<string>",
"contractType": "argentx"
} } }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction: {
data: {
mode: 'deployAccount',
senderPubKey: '<string>',
memo: '<string>',
contractType: 'argentx'
}
}
})
};
fetch('https://api.adamik.io/api/{chainId}/transaction/encode', 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.adamik.io/api/{chainId}/transaction/encode",
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([
'transaction' => [
'data' => [
'mode' => 'deployAccount',
'senderPubKey' => '<string>',
'memo' => '<string>',
'contractType' => 'argentx'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.adamik.io/api/{chainId}/transaction/encode"
payload := strings.NewReader("{\n \"transaction\": {\n \"data\": {\n \"mode\": \"deployAccount\",\n \"senderPubKey\": \"<string>\",\n \"memo\": \"<string>\",\n \"contractType\": \"argentx\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.adamik.io/api/{chainId}/transaction/encode")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction\": {\n \"data\": {\n \"mode\": \"deployAccount\",\n \"senderPubKey\": \"<string>\",\n \"memo\": \"<string>\",\n \"contractType\": \"argentx\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adamik.io/api/{chainId}/transaction/encode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction\": {\n \"data\": {\n \"mode\": \"deployAccount\",\n \"senderPubKey\": \"<string>\",\n \"memo\": \"<string>\",\n \"contractType\": \"argentx\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"chainId": "algorand",
"transaction": {
"data": {
"fees": "<string>",
"mode": "deployAccount",
"senderPubKey": "<string>",
"contractType": "argentx",
"gas": "<string>",
"nonce": "<string>",
"memo": "<string>",
"format": "json",
"params": "<unknown>"
},
"encoded": "<string>"
},
"status": {
"errors": [
{
"message": "<string>"
}
],
"warnings": [
{
"message": "<string>"
}
]
}
}Transaction
Encode a Transaction
Encodes transaction data into a format suitable for broadcasting. This function is pivotal for creating transactions that comply with the specific requirements of different blockchains. It also completes the input transaction with computed data, such as fees and max spendable amount, and performs some chain-specific validation checks on the transaction.
POST
/
api
/
{chainId}
/
transaction
/
encode
Encode a Transaction
curl --request POST \
--url https://api.adamik.io/api/{chainId}/transaction/encode \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction": {
"data": {
"mode": "deployAccount",
"senderPubKey": "<string>",
"memo": "<string>",
"contractType": "argentx"
}
}
}
'import requests
url = "https://api.adamik.io/api/{chainId}/transaction/encode"
payload = { "transaction": { "data": {
"mode": "deployAccount",
"senderPubKey": "<string>",
"memo": "<string>",
"contractType": "argentx"
} } }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction: {
data: {
mode: 'deployAccount',
senderPubKey: '<string>',
memo: '<string>',
contractType: 'argentx'
}
}
})
};
fetch('https://api.adamik.io/api/{chainId}/transaction/encode', 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.adamik.io/api/{chainId}/transaction/encode",
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([
'transaction' => [
'data' => [
'mode' => 'deployAccount',
'senderPubKey' => '<string>',
'memo' => '<string>',
'contractType' => 'argentx'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.adamik.io/api/{chainId}/transaction/encode"
payload := strings.NewReader("{\n \"transaction\": {\n \"data\": {\n \"mode\": \"deployAccount\",\n \"senderPubKey\": \"<string>\",\n \"memo\": \"<string>\",\n \"contractType\": \"argentx\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.adamik.io/api/{chainId}/transaction/encode")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction\": {\n \"data\": {\n \"mode\": \"deployAccount\",\n \"senderPubKey\": \"<string>\",\n \"memo\": \"<string>\",\n \"contractType\": \"argentx\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adamik.io/api/{chainId}/transaction/encode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction\": {\n \"data\": {\n \"mode\": \"deployAccount\",\n \"senderPubKey\": \"<string>\",\n \"memo\": \"<string>\",\n \"contractType\": \"argentx\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"chainId": "algorand",
"transaction": {
"data": {
"fees": "<string>",
"mode": "deployAccount",
"senderPubKey": "<string>",
"contractType": "argentx",
"gas": "<string>",
"nonce": "<string>",
"memo": "<string>",
"format": "json",
"params": "<unknown>"
},
"encoded": "<string>"
},
"status": {
"errors": [
{
"message": "<string>"
}
],
"warnings": [
{
"message": "<string>"
}
]
}
}Authorizations
Path Parameters
Available options:
algorand, cosmoshub, cosmoshub-testnet, osmosis, osmosis-testnet, celestia, celestia-testnet, dydx, axelar, ethereum, sepolia, holesky, zksync, zksync-sepolia, injective-evm-testnet, base, base-sepolia, optimism, optimism-sepolia, arbitrum, arbitrum-sepolia, bitcoin, bitcoin-testnet, bitcoin-signet, polygon, polygon-amoy, bsc, bsc-testnet, linea, linea-sepolia, avalanche, avalanche-fuji, gnosis, gnosis-chiado, moonbeam, moonriver, moonbase, fantom, mantle, litecoin, dogecoin, ton, chiliz, chiliz-testnet, injective, akash, band, dymension, kyve, neutron, terra2, stargaze, tron, evmos, irisnet, juno, lum-network, omniflix, sei, medibloc, passage, quasar, seda, sommelier, shentu, stride, chihuahua, bitsong, persistence, comdex, fetch-ai, humans-ai, ki, likecoin, mars-hub, provenance, quicksilver, saga, ux-chain, kava, starknet, babylon, babylon-testnet, monad-testnet, berachain, berachain-artio, cronos, world-chain Body
application/json
Show child attributes
Show child attributes
Response
200 - application/json
Returns the transaction data encoded into a blockchain-specific format, ready for broadcasting.
Available options:
algorand, cosmoshub, cosmoshub-testnet, osmosis, osmosis-testnet, celestia, celestia-testnet, dydx, axelar, ethereum, sepolia, holesky, zksync, zksync-sepolia, injective-evm-testnet, base, base-sepolia, optimism, optimism-sepolia, arbitrum, arbitrum-sepolia, bitcoin, bitcoin-testnet, bitcoin-signet, polygon, polygon-amoy, bsc, bsc-testnet, linea, linea-sepolia, avalanche, avalanche-fuji, gnosis, gnosis-chiado, moonbeam, moonriver, moonbase, fantom, mantle, litecoin, dogecoin, ton, chiliz, chiliz-testnet, injective, akash, band, dymension, kyve, neutron, terra2, stargaze, tron, evmos, irisnet, juno, lum-network, omniflix, sei, medibloc, passage, quasar, seda, sommelier, shentu, stride, chihuahua, bitsong, persistence, comdex, fetch-ai, humans-ai, ki, likecoin, mars-hub, provenance, quicksilver, saga, ux-chain, kava, starknet, babylon, babylon-testnet, monad-testnet, berachain, berachain-artio, cronos, world-chain Show child attributes
Show child attributes
Show child attributes
Show child attributes