Encode a 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
/
transaction
/
encode
curl --request POST \
--url https://api.adamik.io/api/transaction/encode \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"transaction": {
"data": {
"chainId": "bitcoin",
"sender": "<string>",
"recipient": "<string>",
"fees": 123,
"gas": 123,
"nonce": 123,
"memo": "<string>",
"format": "json",
"params": {
"pubKey": "<string>"
},
"useMaxAmount": false,
"mode": "transfer",
"amount": 123
}
}
}'
{
"transaction": {
"data": {
"chainId": "bitcoin",
"sender": "<string>",
"recipient": "<string>",
"useMaxAmount": false,
"fees": "<string>",
"gas": "<string>",
"nonce": "<string>",
"memo": "<string>",
"format": "json",
"params": {
"pubKey": "<string>"
},
"mode": "transfer",
"amount": "<string>"
},
"encoded": "<string>"
},
"status": {
"errors": [],
"warnings": []
}
}
Authorizations
Body
application/json
Transfer chain native coins
Unique adamik identifier of the chain
Available options:
algorand
, ethereum
, sepolia
, holesky
, zksync
, zksync-sepolia
, injective-evm-testnet
, base
, base-sepolia
, optimism
, optimism-sepolia
, arbitrum
, arbitrum-sepolia
, polygon
, polygon-amoy
, bsc
, bsc-testnet
, linea
, linea-sepolia
, avalanche
, avalanche-fuji
, gnosis
, gnosis-chiado
, moonbeam
, moonriver
, moonbase
, fantom
, mantle
, chiliz
, chiliz-testnet
, ton
, tron
, rootstock
, rootstock-testnet
, bitcoin
, bitcoin-testnet
, litecoin
, dogecoin
, bitsong
, chihuahua
, seda
, persistence
, comdex
, humans-ai
, ki
, mars-hub
, provenance
, quicksilver
, saga
, ux-chain
, kava
, sei
, fetch-ai
, cosmoshub
, osmosis
, celestia
, dydx
, axelar
, evmos
, irisnet
, juno
, lum-network
, omniflix
, medibloc
, passage
, quasar
, sommelier
, shentu
, stride
, neutron
, terra2
, akash
, dymension
, band
, stargaze
, kyve
, likecoin
, osmosis-testnet
, celestia-testnet
, cosmoshub-testnet
, injective
Available options:
transfer
Available options:
json
, hex
Response
200
application/json
200 OK - Returns the transaction data encoded into a blockchain-specific format, ready for broadcasting.
Transfer chain native coins
Unique adamik identifier of the chain
Available options:
algorand
, ethereum
, sepolia
, holesky
, zksync
, zksync-sepolia
, injective-evm-testnet
, base
, base-sepolia
, optimism
, optimism-sepolia
, arbitrum
, arbitrum-sepolia
, polygon
, polygon-amoy
, bsc
, bsc-testnet
, linea
, linea-sepolia
, avalanche
, avalanche-fuji
, gnosis
, gnosis-chiado
, moonbeam
, moonriver
, moonbase
, fantom
, mantle
, chiliz
, chiliz-testnet
, ton
, tron
, rootstock
, rootstock-testnet
, bitcoin
, bitcoin-testnet
, litecoin
, dogecoin
, bitsong
, chihuahua
, seda
, persistence
, comdex
, humans-ai
, ki
, mars-hub
, provenance
, quicksilver
, saga
, ux-chain
, kava
, sei
, fetch-ai
, cosmoshub
, osmosis
, celestia
, dydx
, axelar
, evmos
, irisnet
, juno
, lum-network
, omniflix
, medibloc
, passage
, quasar
, sommelier
, shentu
, stride
, neutron
, terra2
, akash
, dymension
, band
, stargaze
, kyve
, likecoin
, osmosis-testnet
, celestia-testnet
, cosmoshub-testnet
, injective
Available options:
transfer
Available options:
json
, hex
Was this page helpful?
curl --request POST \
--url https://api.adamik.io/api/transaction/encode \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"transaction": {
"data": {
"chainId": "bitcoin",
"sender": "<string>",
"recipient": "<string>",
"fees": 123,
"gas": 123,
"nonce": 123,
"memo": "<string>",
"format": "json",
"params": {
"pubKey": "<string>"
},
"useMaxAmount": false,
"mode": "transfer",
"amount": 123
}
}
}'
{
"transaction": {
"data": {
"chainId": "bitcoin",
"sender": "<string>",
"recipient": "<string>",
"useMaxAmount": false,
"fees": "<string>",
"gas": "<string>",
"nonce": "<string>",
"memo": "<string>",
"format": "json",
"params": {
"pubKey": "<string>"
},
"mode": "transfer",
"amount": "<string>"
},
"encoded": "<string>"
},
"status": {
"errors": [],
"warnings": []
}
}