Docs

Docs

  • Develop
  • Validate
  • Integrate
  • Learn

โ€บREST API

Welcome to Elrond

  • Welcome to Elrond

Technology

  • Architecture Overview
  • Glossary
  • Entities
  • Chronology
  • Secure Proof of Stake
  • Adaptive State Sharding
  • The Elrond WASM VM
  • Cross Shard Transactions

Wallet

  • Web Wallet
  • Maiar Web Wallet Extension
  • Webhooks
  • Ledger

Validators

  • Overview
  • System Requirements
  • Install a Mainnet Node

    • Scripts & User config
    • Installing a Validator Node
    • Optional Configurations
    • How to use the Docker Image

    Install a Testnet Node

    • Scripts & User config
    • Installing & updating
    • Manage your testnet node
    • How to use the Docker Image

    Install a Devnet Node

    • Scripts & User config
    • Installing & updating
    • Manage your devnet node
    • How to use the Docker Image

    Manage your keys

    • Validator Keys
    • Wallet Keys
    • Protecting your keys

    Staking, Unstaking, Unjailing

    • Staking, unstaking and unjailing
    • Staking
    • Unjailing
    • The Staking Smart Contract
  • The Delegation Manager
  • Convert An Existing Validator Into A Staking Pool
  • Merging A Validator Into An Existing Delegation Smart Contract
  • Rating
  • Node redundancy
  • Import DB
  • Node CLI
  • Node Databases
  • Useful Links & Tools
  • FAQs

Developers

    Tutorials

    • Build a dApp in 15 minutes
    • Build a Microservice for your dApp
    • The Crowdfunding Smart Contract (part 1)
    • The Crowdfunding Smart Contract (part 2)
    • The Counter Smart Contract

    Signing Transactions

    • Signing Transactions
    • Tools for signing
    • Signing programmatically

    Gas and Fees

    • Overview
    • EGLD transfers (move balance transactions)
    • System Smart Contracts
    • User-defined Smart Contracts

    Developer reference

    • The Elrond Serialization Format
    • Smart contract annotations
    • Smart contract modules
    • Smart contract to smart contract calls
    • Code Metadata
    • Smart Contract API Functions
    • Rust Testing Framework
    • Rust Testing Framework Functions Reference
    • Rust Smart Contract Debugging
    • Random Numbers in Smart Contracts

    Developers Best Practices

    • Basics
    • BigUint Operations
    • The dynamic allocation problem
    • Multi-values
    • Storage Mappers

    Mandos tests reference

    • Mandos Overview
    • Mandos Structure
    • Mandos Simple Values
    • Mandos Complex Values
    • Embedding Mandos code in Go
  • Constants
  • Built-In Functions
  • Account storage
  • ESDT tokens
  • NFT tokens
  • Setup a Local Testnet
  • Set up a Local Testnet (advanced)
  • Creating Wallets

SDK and Tools

    REST API

    • REST API overview
    • api.elrond.com
    • Gateway overview
    • Addresses
    • Transactions
    • Network
    • Nodes
    • Blocks
    • Virtual Machine
    • Versions and Changelog
  • Proxy
  • Elasticsearch
  • erdpy

    • erdpy
    • Installing erdpy
    • Configuring erdpy
    • erdpy CLI
    • Deriving the Wallet PEM file
    • Sending bulk transactions
    • Writing and running erdpy scripts
    • Smart contract interactions

    erdjs

    • erdjs
    • Cookbook
    • Extending erdjs
    • Writing and testing interactions
    • Migration guides
  • erdgo
  • erdjava
  • erdkotlin
  • erdwalletjs-cli

Integrators

  • EGLD integration guide
  • ESDT tokens integration guide
  • Observing Squad
  • Accounts Management
  • Creating Transactions
  • Querying the Blockchain

Transactions

Send Transactions to the Blockchain and query information about them.

POST Send Transaction

https://gateway.elrond.com/transaction/send

This endpoint allows one to send a signed Transaction to the Blockchain.

Request
Response

Body Parameters

ParamRequiredTypeDescription
versionREQUIREDnumberThe Version of the Transaction (e.g. 1).
chainIDREQUIREDstringThe Chain identifier.
nonceREQUIREDnumberThe Nonce of the Sender.
valueREQUIREDstringThe Value to transfer (can be zero).
senderREQUIREDstringThe Address (bech32) of the Sender.
receiverREQUIREDstringThe Address (bech32) of the Receiver.
gasPriceREQUIREDnumberThe desired Gas Price (per Gas Unit).
gasLimitREQUIREDnumberThe maximum amount of Gas Units to consume.
dataOPTIONALstringThe message (data) of the Transaction.
signatureREQUIREDstringThe Signature (hex-encoded) of the Transaction.

๐ŸŸข 200: OK

Transaction sent with success. A Transaction Hash is returned.

{
"txHash": "6c41c71946b5b428c2cfb560e3ea425f8a00345de4bb2eb1b784387790914277"
}

๐Ÿ”ด 400: Bad request

Invalid Transaction signature.

{
"error": "transaction generation failed: ed25519: invalid signature"
}
warning

For Nodes (Observers or Validators with the HTTP API enabled), this endpoint only accepts transactions whose sender is in the Node's Shard.

Here's an example of a request:

POST https://gateway.elrond.com/transaction/send HTTP/1.1
Content-Type: application/json

{
    "version": 1,
    "chainId": "v1.0.141",
    "nonce": 42,
    "value": "100000000000000000",
    "receiver": "erd1cux02zersde0l7hhklzhywcxk4u9n4py5tdxyx7vrvhnza2r4gmq4vw35r",
    "sender": "erd1njqj2zggfup4nl83x0nfgqjkjserm7mjyxdx5vzkm8k0gkh40ezqtfz9lg",
    "gasPrice": 1000000000,
    "gasLimit": 70000,
    "data": "food for cats",
    "signature": "93207c579bf57be03add632b0e1624a73576eeda8a1687e0fa286f03eb1a17ffb125ccdb008a264c402f074a360442c7a034e237679322f62268b614e926d10f"
}

POST Send Multiple Transactions

https://gateway.elrond.com/transaction/send-multiple

This endpoint allows one to send a bulk of Transactions to the Blockchain.

Request
Response

Body Parameters

ParamRequiredTypeDescription
versionREQUIREDnumberThe Version of the Transaction (e.g. 1).
chainIDREQUIREDstringThe Chain identifier.
nonceREQUIREDnumberThe Nonce, for each Transaction.
valueREQUIREDstringThe Value, for each Transaction.
senderREQUIREDstringThe Address of the Sender, for each Transaction.
receiverREQUIREDstringThe Address of the Receiver, for each Transaction.
gasPriceREQUIREDnumberThe Gas Price, for each Transaction.
gasLimitREQUIREDnumberThe Gas Limit, for each Transaction.
dataOPTIONALstringThe message (data), for each Transaction.
signatureREQUIREDstringThe Signature, for each Transaction.

๐ŸŸข 200: OK

A bulk of Transactions were successfully sent.

{
"numOfSentTxs": 2,
"txsHashes": {
"0": "6c41c71946b5b428c2cfb560e3ea425f8a00345de4bb2eb1b784387790914277",
"1": "fa8195bae93d4609a6fc5972a7a6176feece39a6c4821acae2276701aee12fb0"
}
}
warning

For Nodes (Observers or Validators with the HTTP API enabled), this endpoint only accepts transactions whose sender is in the Node's Shard.

Here's an example of a request:

POST https://gateway.elrond.com/transaction/send-multiple HTTP/1.1
Content-Type: application/json

[
    {
        "nonce": 42,
        "value": "100000000000000000",
        "receiver": "erd1cux02zersde0l7hhklzhywcxk4u9n4py5tdxyx7vrvhnza2r4gmq4vw35r",
        "sender": "erd1njqj2zggfup4nl83x0nfgqjkjserm7mjyxdx5vzkm8k0gkh40ezqtfz9lg",
        "gasPrice": 1000000000,
        "gasLimit": 70000,
        "data": "food for cats",
        "chainId": "v1.0.141",
        "version": 1,
        "signature": "93207c579bf57be03add632b0e1624a73576eeda8a1687e0fa286f03eb1a17ffb125ccdb008a264c402f074a360442c7a034e237679322f62268b614e926d10f"
    },
    {
        "nonce": 43,
        "value": "100000000000000000",
        "receiver": "erd1cux02zersde0l7hhklzhywcxk4u9n4py5tdxyx7vrvhnza2r4gmq4vw35r",
        "sender": "erd1rhp4q3qlydyrrjt7dgpfzxk8n4f7yrat4wc6hmkmcnmj0vgc543s8h7hyl",
        "gasPrice": 1000000000,
        "gasLimit": 70000,
        "data": "bus tickets",
        "chainID": "v1.0.141",
        "version": 1,
        "signature": "01535fd1d40d98b7178ccfd1729b3f526ee4542482eb9f591d83433f9df97ce7b91db07298b1d14308e020bba80dbe4bba8617a96dd7743f91ee4b03d7f43e00"
    }
]

POST Simulate Transaction

Nodes and observers

https://gateway.elrond.com/transaction/simulate

This endpoint allows one to send a signed Transaction to the Blockchain in order to simulate its execution. This can be useful in order to check if the transaction will be successfully executed before actually sending it. It receives the same request as the /transaction/send endpoint.

Move balance successful transaction simulation

Request
Response

Body Parameters

ParamRequiredTypeDescription
versionREQUIREDnumberThe Version of the Transaction (e.g. 1).
chainIDREQUIREDstringThe Chain identifier.
nonceREQUIREDnumberThe Nonce of the Sender.
valueREQUIREDstringThe Value to transfer (can be zero).
senderREQUIREDstringThe Address (bech32) of the Sender.
receiverREQUIREDstringThe Address (bech32) of the Receiver.
gasPriceREQUIREDnumberThe desired Gas Price (per Gas Unit).
gasLimitREQUIREDnumberThe maximum amount of Gas Units to consume.
dataOPTIONALstringThe message (data) of the Transaction.
signatureREQUIREDstringThe Signature (hex-encoded) of the Transaction.

A full response contains the fields above: SimulationResults

FieldTypeDescription
statusstringsuccess, fail ...
failReasonstringthe error message
scResults[]ApiSmartContractResultan array of smart contract results (if any)
receipts[]ApiReceiptan array of the receipts (if any)
hashstringthe hash of the transaction

โ• Note that fields that are empty won't be included in the response. This can be seen in the examples below


๐ŸŸข 200: OK

Transaction would be successful.

{
"status": "success",
"hash": "bb24ccaa2da8cddd6a3a8eb162e6ff62ad4f6e1914d9aa0cacde6772246ca2dd"
}

๐ŸŸข 200: Simulation was successful, but the transaction wouldn't be executed.

Invalid Transaction signature.

{
"status": "fail",
"failReason": "higher nonce in transaction",
"hash": "bb24ccaa2da8cddd6a3a8eb162e6ff62ad4f6e1914d9aa0cacde6772246ca2dd"
}

๐Ÿ”ด 400: Bad request

{
"error": "transaction generation failed: invalid chain ID"
}

Proxy

On the Proxy side, if the transaction to simulate is a cross-shard one, then the response format will contain two elements called senderShard and receiverShard which are of type SimulationResults explained above.

Example response for cross-shard transactions:

{
 "receiverShard": {
  "status": "success",
  "hash": "bb24ccaa2da8cddd6a3a8eb162e6ff62ad4f6e1914d9aa0cacde6772246ca2dd"
 },
 "senderShard": {
  "status": "success",
  "hash": "bb24ccaa2da8cddd6a3a8eb162e6ff62ad4f6e1914d9aa0cacde6772246ca2dd"
 }
}

POST Estimate Cost of Transaction

https://gateway.elrond.com/transaction/cost

This endpoint allows one to estimate the cost of a transaction.

Request
Response

Body Parameters

ParamRequiredTypeDescription
versionREQUIREDnumberThe Version of the Transaction (e.g. 1).
chainIDREQUIREDstringThe Chain identifier.
valueREQUIREDstringThe Value to transfer.
senderREQUIREDstringTThe Address of the Sender.
receiverREQUIREDstringThe Address of the Receiver.
dataOPTIONALstringThe message (data) of the Transaction.

๐ŸŸข 200: OK

The cost is estimated successfully.

{
"txGasUnits": "77000"
}
tip

This endpoint returns the cost on the transaction in gas units. The returned value can be used to fill in gasLimit field of the transaction.

Here's an example of a request:

POST https://gateway.elrond.com/transaction/cost HTTP/1.1
Content-Type: application/json

{
    "value": "100000",
    "sender": "erd1l453hd0gt5gzdp7czpuall8ggt2dcv5zwmfdf3sd3lguxseux2fsmsgldz",
    "receiver": "erd188nydpkagtpwvfklkl2tn0w6g40zdxkwfgwpjqc2a2m2n7ne9g8q2t22sr",
    "data": "this is an example",
    "chainID": "v1.0.141",
    "version": 1
}

GET Get Transaction

https://gateway.elrond.com/transaction/:txHash

This endpoint allows one to query the details of a Transaction.

Request
Response
Example with results

Path Parameters

ParamRequiredTypeDescription
txHashREQUIREDstringThe hash (identifier) of the Transaction.

Query Parameters

ParamRequiredTypeDescription
senderOPTIONALstringThe Address of the sender - a hint to optimize the request.
withResultsOPTIONALboolBoolean parameter to specify if smart contract results and other details should be returned.

๐ŸŸข 200: OK

Transaction details retrieved successfully.

{
"transaction": {
"type": "normal",
"nonce": 3,
"round": 186580,
"epoch": 12,
"value": "1000000000000000000",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 70000,
"data": "Zm9yIHRlc3Rz",
"signature": "1047...",
"sourceShard": 2,
"destinationShard": 1,
"blockNonce": 186535,
"miniblockHash": "e927...",
"blockHash": "50a1...",
"status": "executed"
}
}

Request URL:

https://gateway.elrond.com/transaction/:txHash?withResults=true

Response:

The response can contain additional fields such as smartContractResults, or receipt

"transaction": {
"type": "normal",
"nonce": 3,
"round": 186580,
"epoch": 12,
"value": "1000000000000000000",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 70000,
"data": "Zm9yIHRlc3Rz",
"signature": "1047...",
"sourceShard": 2,
"destinationShard": 1,
"blockNonce": 186535,
"miniblockHash": "e927...",
"blockHash": "50a1...",
"status": "executed",
"receipt": {
"value": 100,
"sender": "erd1...",
"data": "...",
"txHash": "b37..."
},
"smartContractResults": [
{
"hash": "...",
"nonce": 5,
"value": 1000,
"receiver": "erd1...",
"sender": "erd1...",
"data": "@6f6b",
"prevTxHash": "3638...",
"originalTxHash": "3638...",
"gasLimit": 0,
"gasPrice": 1000000000,
"callType": 0
}
]
}
important

The optional query parameter sender is only applicable to requests against the Proxy (not against the Observer Nodes).

GET Get Transaction Status

https://gateway.elrond.com/transaction/:txHash/status

This endpoint allows one to query the Status of a Transaction.

Request
Response

Path Parameters

ParamRequiredTypeDescription
txHashREQUIREDstringThe hash (identifier) of the Transaction.

Query Parameters

ParamRequiredTypeDescription
senderOPTIONALstringThe Address of the sender - a hint to optimize the request.

๐ŸŸข 200: OK

Transaction status retrieved successfully.

{
"status": "executed"
}
important

The optional query parameter sender is only applicable to requests against the Proxy (not against the Observer Nodes).

โ† AddressesNetwork โ†’
  • POST Send Transaction
  • POST Send Multiple Transactions
  • POST Simulate Transaction
  • POST Estimate Cost of Transaction
  • GET Get Transaction
  • GET Get Transaction Status
Made withby the Elrond team.
GithubChat
Main siteWalletExplorerBridgeDocsGrowthMaiarMaiar Exchange