POSTEncode submission

This API accepts unsigned transaction information in JSON format and converts it to BCS (Binary Canonical Serialization) format. You can use the converted result to sign the transaction and then submit it via the Submit Transaction API.

That is, this endpoint enables you to submit transaction requests to the API even in languages that do not have BCS-supporting libraries. You do not need to use this endpoint when using an SDK that supports BCS, such as the official Rust, TypeScript, or Python SDK.

To sign a transaction using this endpoint's response:

  • Decode the hex-encoded string from the response into bytes.
  • Sign the decoded bytes.
  • Convert the signed bytes to Ed25519 signature format and use it to create the final transaction signature.
Request Body
senderstringrequired

A field representing the address of the account that sent the transaction. When expressed as a string, it is displayed as a 64-character hexadecimal string, and may be abbreviated by omitting leading zeros and adding 0x.

sequence_numberstringrequired

A field representing the transaction occurrence order. Represents a 64-bit unsigned integer as a string.

max_gas_amountstringrequired

A field representing the maximum amount of gas to use when the transaction occurs. Represents a 64-bit unsigned integer as a string.

gas_unit_pricestringrequired

A field representing the gas price to use when the transaction occurs. Represents a 64-bit unsigned integer as a string.

expiration_timestamp_secsstringrequired

A field representing the transaction expiration time. Represents a 64-bit unsigned integer as a string.

payloadoneOfrequired

A field representing the payload to use when the transaction occurs.

typestring (enum)required

The type of the payload

functionstringrequired

String representation of the Entry Function identifier defined on-chain.

type_argumentsstring[]required

Field representing the generic type arguments of the Entry function.

argumentsoneOf[]required

Field representing the arguments of the Entry function.

arguments[0]string
arguments[1]string
replay_protection_noncestringrequired

A field representing the nonce used to prevent transaction replay attacks. Represents a 64-bit unsigned integer as a string.

signatureoneOfrequired

A field representing the transaction signature. One of Ed25519, MultiEd25519, MultiAgent, FeePayer, Account, or NoAccount can be selected.

typestring (enum)required

The type of the signature

public_keystringrequired

All byte (Vec) data is expressed as a hex-encoded string starting with 0x, with two hex digits per byte. Unlike the Address type, HexEncodedBytes does not omit any zeros.

signaturestringrequired

All byte (Vec) data is expressed as a hex-encoded string starting with 0x, with two hex digits per byte. Unlike the Address type, HexEncodedBytes does not omit any zeros.

Responses
Headers
X-APTOS-BLOCK-HEIGHTintegerrequired

Current block height of the chain

예: 0

X-APTOS-CHAIN-IDintegerrequired

Chain ID of the current chain

예: 0

X-APTOS-EPOCHintegerrequired

Current epoch of the chain

예: 0

X-APTOS-LEDGER-OLDEST-VERSIONintegerrequired

Oldest unpruned ledger version of the chain

예: 0

X-APTOS-LEDGER-TIMESTAMPUSECintegerrequired

Current timestamp of the chain

예: 0

X-APTOS-LEDGER-VERSIONintegerrequired

Current ledger version of the chain

예: 0

X-APTOS-OLDEST-BLOCK-HEIGHTintegerrequired

Oldest unpruned block height of the chain

예: 0

X-APTOS-CURSORstring

Cursor for the next page

예: string

X-APTOS-GAS-USEDinteger

Amount of gas actually used for transaction execution

예: 0

X-API-KEY
RequestCU13
cURL
curl -X POST "https://aptos-mainnet.nodit.io/v1/transactions/encode_submission" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1",
  "sequence_number": "32",
  "max_gas_amount": "2000",
  "gas_unit_price": "100",
  "expiration_timestamp_secs": "1759305600",
  "payload": {
    "type": "entry_function_payload",
    "function": "0x1::aptos_account::transfer",
    "type_arguments": [],
    "arguments": [
      "0xb8726fd47889b2f7b004e1f47c1a784a18527eb01c5818c992c8ae4330dec831",
      "1000000"
    ]
  }
}'
Response
Header · 200
{
  "X-APTOS-BLOCK-HEIGHT": 0,
  "X-APTOS-CHAIN-ID": 0,
  "X-APTOS-EPOCH": 0,
  "X-APTOS-LEDGER-OLDEST-VERSION": 0,
  "X-APTOS-LEDGER-TIMESTAMPUSEC": 0,
  "X-APTOS-LEDGER-VERSION": 0,
  "X-APTOS-OLDEST-BLOCK-HEIGHT": 0,
  "X-APTOS-CURSOR": "string",
  "X-APTOS-GAS-USED": 0
}
Body · 200
"0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1"