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>",
"params": "<unknown>"
},
"encoded": [
{
"hash": {
"format": "sha256",
"value": "<string>"
},
"raw": {
"format": "RLP",
"value": "<string>"
}
}
]
},
"status": {
"errors": [
{
"message": "<string>"
}
],
"warnings": [
{
"message": "<string>"
}
]
}
}Transaction
Encode a Transaction
Encodes transaction data into a format suitable for broadcasting. This endpoint is pivotal for creating transactions that comply with the specific requirements of different blockchains.
It performs several important functions:
- Validates the transaction data against chain-specific rules
- Computes and adds necessary transaction parameters (fees, gas, nonce)
- Calculates the maximum spendable amount when requested
- Returns the raw data and transaction hash in the appropriate format for signing
The response includes both the transaction hash (which needs to be signed) and the raw transaction data in a chain-specific format.
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>",
"params": "<unknown>"
},
"encoded": [
{
"hash": {
"format": "sha256",
"value": "<string>"
},
"raw": {
"format": "RLP",
"value": "<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, hoodi, 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, 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, provenance, quicksilver, saga, kava, starknet, starknet-sepolia, babylon, babylon-testnet, monad-testnet, berachain, berachain-bepolia, cronos, world-chain, world-chain-sepolia, hyperliquid, solana, aptos, aptos-testnet, stellar, stellar-testnet 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, hoodi, 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, 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, provenance, quicksilver, saga, kava, starknet, starknet-sepolia, babylon, babylon-testnet, monad-testnet, berachain, berachain-bepolia, cronos, world-chain, world-chain-sepolia, hyperliquid, solana, aptos, aptos-testnet, stellar, stellar-testnet Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?