Home

Aptos Node API

v1.2.0
Base URL
https://apt.nownodes.io/v1

The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.

Authentication

api-keyAuthapiKey

API Key: api-key in header

General

Accounts

Access to accounts, resources, and modules

Get token balance for an Aptos account

GET
https://apt.nownodes.io/v1/accounts/{address}/balance/{token_type}

Returns the balance of a specific token (e.g. APT) for the given Aptos account address. The response is a raw number in micro-units (e.g. microAPT), which needs to be divided by 1,000,000 to get the APT value.

Parameters

addressstringrequiredpath

The Aptos account address in 0x-prefixed hexadecimal format.

token_typestringrequiredpath

The fully qualified token type. Use 0x1::aptos_coin::AptosCoin for native APT.

Response

200OK

Balance returned successfully (in microAPT)

400Bad Request

Invalid address or token type

404Not Found

Account or token not found

500Internal Server Error

Internal server error

Authorization

api-keyAuthapiKey in header

Get account

GET
https://apt.nownodes.io/v1/accounts/{address}

Return the authentication key and the sequence number for an account address. Optionally, a ledger version can be specified. If the ledger version is not specified in the request, the latest ledger version is used.

Parameters

addressAddress<hex>requiredpath

Address of account with or without a 0x prefix

ledger_versionU64<uint64>query

Ledger version to get state of account

If not provided, it will be the latest version

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get account resources

GET
https://apt.nownodes.io/v1/accounts/{address}/resources

Retrieves all account resources for a given account and a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used.

The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.

Parameters

addressAddress<hex>requiredpath

Address of account with or without a 0x prefix

ledger_versionU64<uint64>query

Ledger version to get state of account

If not provided, it will be the latest version

startStateKeyWrapperquery

Cursor specifying where to start for pagination

This cursor cannot be derived manually client-side. Instead, you must call this endpoint once without this query parameter specified, and then use the cursor returned in the X-Aptos-Cursor header in the response.

limitinteger<uint16>query

Max number of account resources to retrieve

If not provided, defaults to default page size.

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get account modules

GET
https://apt.nownodes.io/v1/accounts/{address}/modules

Retrieves all account modules' bytecode for a given account at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used.

The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.

Parameters

addressAddress<hex>requiredpath

Address of account with or without a 0x prefix

ledger_versionU64<uint64>query

Ledger version to get state of account

If not provided, it will be the latest version

startStateKeyWrapperquery

Cursor specifying where to start for pagination

This cursor cannot be derived manually client-side. Instead, you must call this endpoint once without this query parameter specified, and then use the cursor returned in the X-Aptos-Cursor header in the response.

limitinteger<uint16>query

Max number of account modules to retrieve

If not provided, defaults to default page size.

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get account resource

GET
https://apt.nownodes.io/v1/accounts/{address}/resource/{resource_type}

Retrieves an individual resource from a given account and at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used.

The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.

Parameters

addressAddress<hex>requiredpath

Address of account with or without a 0x prefix

resource_typeMoveStructTagrequiredpath

Name of struct to retrieve e.g. 0x1::account::Account

ledger_versionU64<uint64>query

Ledger version to get state of account

If not provided, it will be the latest version

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get account module

GET
https://apt.nownodes.io/v1/accounts/{address}/module/{module_name}

Retrieves an individual module from a given account and at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used.

The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.

Parameters

addressAddress<hex>requiredpath

Address of account with or without a 0x prefix

module_nameIdentifierWrapperrequiredpath

Name of module to retrieve e.g. coin

ledger_versionU64<uint64>query

Ledger version to get state of account

If not provided, it will be the latest version

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Blocks

Access to blocks

Get blocks by height

GET
https://apt.nownodes.io/v1/blocks/by_height/{block_height}

This endpoint allows you to get the transactions in a block and the corresponding block information.

Transactions are limited by max default transactions size. If not all transactions are present, the user will need to query for the rest of the transactions via the get transactions API.

If the block is pruned, it will return a 410

Parameters

block_heightinteger<uint64>requiredpath

Block height to lookup. Starts at 0

with_transactionsbooleanquery

If set to true, include all transactions in the block

If not provided, no transactions will be retrieved

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get blocks by version

GET
https://apt.nownodes.io/v1/blocks/by_version/{version}

This endpoint allows you to get the transactions in a block and the corresponding block information given a version in the block.

Transactions are limited by max default transactions size. If not all transactions are present, the user will need to query for the rest of the transactions via the get transactions API.

If the block has been pruned, it will return a 410

Parameters

versioninteger<uint64>requiredpath

Ledger version to lookup block information for.

with_transactionsbooleanquery

If set to true, include all transactions in the block

If not provided, no transactions will be retrieved

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Events

Access to events

Get events by creation number

GET
https://apt.nownodes.io/v1/accounts/{address}/events/{creation_number}

Event types are globally identifiable by an account address and monotonically increasing creation_number, one per event type emitted to the given account. This API returns events corresponding to that that event type.

Parameters

addressAddress<hex>requiredpath

Hex-encoded 32 byte Aptos account, with or without a 0x prefix, for which events are queried. This refers to the account that events were emitted to, not the account hosting the move module that emits that event type.

creation_numberU64<uint64>requiredpath

Creation number corresponding to the event stream originating from the given account.

startU64<uint64>query

Starting sequence number of events.

If unspecified, by default will retrieve the most recent events

limitinteger<uint16>query

Max number of events to retrieve.

If unspecified, defaults to default page size

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get events by event handle

GET
https://apt.nownodes.io/v1/accounts/{address}/events/{event_handle}/{field_name}

This API uses the given account address, eventHandle, and fieldName to build a key that can globally identify an event types. It then uses this key to return events emitted to the given account matching that event type.

Parameters

addressAddress<hex>requiredpath

Hex-encoded 32 byte Aptos account, with or without a 0x prefix, for which events are queried. This refers to the account that events were emitted to, not the account hosting the move module that emits that event type.

event_handleMoveStructTagrequiredpath

Name of struct to lookup event handle e.g. 0x1::account::Account

field_nameIdentifierWrapperrequiredpath

Name of field to lookup event handle e.g. withdraw_events

startU64<uint64>query

Starting sequence number of events.

If unspecified, by default will retrieve the most recent

limitinteger<uint16>query

Max number of events to retrieve.

If unspecified, defaults to default page size

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

General

General information

Show OpenAPI explorer

GET
https://apt.nownodes.io/v1/spec

Provides a UI that you can use to explore the API. You can also retrieve the API directly at /spec.yaml and /spec.json.

Response

200OK

Authorization

api-keyAuthapiKey in header

Check basic node health

GET
https://apt.nownodes.io/v1/-/healthy

By default this endpoint just checks that it can get the latest ledger info and then returns 200.

If the duration_secs param is provided, this endpoint will return a 200 if the following condition is true:

server_latest_ledger_info_timestamp >= server_current_time_timestamp - duration_secs

Parameters

duration_secsinteger<uint32>query

Threshold in seconds that the server can be behind to be considered healthy

If not provided, the healthcheck will always succeed

Response

200OK
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get ledger info

GET
https://apt.nownodes.io/v1/

Get the latest ledger information, including data such as chain ID, role type, ledger versions, epoch, etc.

Response

200OK
400Bad Request
403Forbidden
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Tables

Access to tables

Get table item

POST
https://apt.nownodes.io/v1/tables/{table_handle}/item

Get a table item at a specific ledger version from the table identified by {table_handle} in the path and the "key" (TableItemRequest) provided in the request body.

This is a POST endpoint because the "key" for requesting a specific table item (TableItemRequest) could be quite complex, as each of its fields could themselves be composed of other structs. This makes it impractical to express using query params, meaning GET isn't an option.

The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.

Body

application/json

Table Item request for the GetTableItem API

key_typeMoveTyperequired

String representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: vector<{non-reference MoveTypeId}> - struct: {address}::{module_name}::{struct_name}::<{generic types}>

Copied!
Vector type value examples:
  - `vector<u8>`
  - `vector<vector<u64>>`
  - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>`

Struct type value examples:
  - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>
  - `0x1::account::Account`

Note:
  1. Empty chars should be ignored when comparing 2 struct tag ids.
  2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
value_typeMoveTyperequired

String representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: vector<{non-reference MoveTypeId}> - struct: {address}::{module_name}::{struct_name}::<{generic types}>

Copied!
Vector type value examples:
  - `vector<u8>`
  - `vector<vector<u64>>`
  - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>`

Struct type value examples:
  - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>
  - `0x1::account::Account`

Note:
  1. Empty chars should be ignored when comparing 2 struct tag ids.
  2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
keyanyrequired

The value of the table item's key

Parameters

table_handleAddress<hex>requiredpath

Table handle hex encoded 32-byte string

ledger_versionU64<uint64>query

Ledger version to get state of account

If not provided, it will be the latest version

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get raw table item

POST
https://apt.nownodes.io/v1/tables/{table_handle}/raw_item

Get a table item at a specific ledger version from the table identified by {table_handle} in the path and the "key" (RawTableItemRequest) provided in the request body.

The get_raw_table_item requires only a serialized key comparing to the full move type information comparing to the get_table_item api, and can only return the query in the bcs format.

The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.

Body

application/json

Table Item request for the GetTableItemRaw API

keyHexEncodedBytes<hex>required

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Parameters

table_handleAddress<hex>requiredpath

Table handle hex encoded 32-byte string

ledger_versionU64<uint64>query

Ledger version to get state of account

If not provided, it will be the latest version

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Transactions

Access to transactions

Get transactions

GET
https://apt.nownodes.io/v1/transactions

Retrieve on-chain committed transactions. The page size and start ledger version can be provided to get a specific sequence of transactions.

If the version has been pruned, then a 410 will be returned.

To retrieve a pending transaction, use /transactions/by_hash.

Parameters

startU64<uint64>query

Ledger version to start list of transactions

If not provided, defaults to showing the latest transactions

limitinteger<uint16>query

Max number of transactions to retrieve.

If not provided, defaults to default page size

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Submit transaction

POST
https://apt.nownodes.io/v1/transactions

This endpoint accepts transaction submissions in two formats.

To submit a transaction as JSON, you must submit a SubmitTransactionRequest. To build this request, do the following:

  1. Encode the transaction as BCS. If you are using a language that has native BCS support, make sure of that library. If not, you may take advantage of /transactions/encode_submission. When using this endpoint, make sure you trust the node you're talking to, as it is possible they could manipulate your request.
  2. Sign the encoded transaction and use it to create a TransactionSignature.
  3. Submit the request. Make sure to use the "application/json" Content-Type.

To submit a transaction as BCS, you must submit a SignedTransaction encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs. Make sure to use the application/x.aptos.signed_transaction+bcs Content-Type.

Body

application/json
application/jsonSubmitTransactionRequest

A request to submit a transaction

This requires a transaction and a signature of it

senderAddress<hex>required

A hex encoded 32 byte Aptos account address.

This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.

For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.

sequence_numberU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

max_gas_amountU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

gas_unit_priceU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

expiration_timestamp_secsU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

payloadobject & EntryFunctionPayload | object & ScriptPayload | object & ModuleBundlePayload | object & MultisigPayloadrequired

An enum of the possible transaction payloads

signatureobject & Ed25519Signature | object & MultiEd25519Signature | object & MultiAgentSignature | object & FeePayerSignature | object & object & Ed25519Signature | object & MultiEd25519Signature | object & SingleKeySignature | object & MultiKeySignaturerequired

An enum representing the different transaction signatures available

application/x.aptos.signed_transaction+bcsArray<integer>
Array<integer>

Response

202Accepted
400Bad Request
403Forbidden
404Not Found
413Payload Too Large
500Internal Server Error
503Service Unavailable
507

Authorization

api-keyAuthapiKey in header

Get transaction by hash

GET
https://apt.nownodes.io/v1/transactions/by_hash/{txn_hash}

Look up a transaction by its hash. This is the same hash that is returned by the API when submitting a transaction (see PendingTransaction).

When given a transaction hash, the server first looks for the transaction in storage (on-chain, committed). If no on-chain transaction is found, it looks the transaction up by hash in the mempool (pending, not yet committed).

To create a transaction hash by yourself, do the following:

  1. Hash message bytes: "RawTransaction" bytes + BCS bytes of Transaction.
  2. Apply hash algorithm SHA3-256 to the hash message bytes.
  3. Hex-encode the hash bytes with 0x prefix.

Parameters

txn_hashHashValuerequiredpath

Hash of transaction to retrieve

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get transaction by version

GET
https://apt.nownodes.io/v1/transactions/by_version/{txn_version}

Retrieves a transaction by a given version. If the version has been pruned, a 410 will be returned.

Parameters

txn_versionU64<uint64>requiredpath

Version of transaction to retrieve

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Get account transactions

GET
https://apt.nownodes.io/v1/accounts/{address}/transactions

Retrieves on-chain committed transactions from an account. If the start version is too far in the past, a 410 will be returned.

If no start version is given, it will start at version 0.

To retrieve a pending transaction, use /transactions/by_hash.

Parameters

addressAddress<hex>requiredpath

Address of account with or without a 0x prefix

startU64<uint64>query

Account sequence number to start list of transactions

If not provided, defaults to showing the latest transactions

limitinteger<uint16>query

Max number of transactions to retrieve.

If not provided, defaults to default page size

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Submit batch transactions

POST
https://apt.nownodes.io/v1/transactions/batch

This allows you to submit multiple transactions. The response has three outcomes:

  1. All transactions succeed, and it will return a 202
  2. Some transactions succeed, and it will return the failed transactions and a 206
  3. No transactions succeed, and it will also return the failed transactions and a 206

To submit a transaction as JSON, you must submit a SubmitTransactionRequest. To build this request, do the following:

  1. Encode the transaction as BCS. If you are using a language that has native BCS support, make sure to use that library. If not, you may take advantage of /transactions/encode_submission. When using this endpoint, make sure you trust the node you're talking to, as it is possible they could manipulate your request.
  2. Sign the encoded transaction and use it to create a TransactionSignature.
  3. Submit the request. Make sure to use the "application/json" Content-Type.

To submit a transaction as BCS, you must submit a SignedTransaction encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs. Make sure to use the application/x.aptos.signed_transaction+bcs Content-Type.

Body

application/json
application/jsonArray<SubmitTransactionRequest>
Array<SubmitTransactionRequest>
Show child attributes
senderAddress<hex>required

A hex encoded 32 byte Aptos account address.

This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.

For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.

sequence_numberU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

max_gas_amountU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

gas_unit_priceU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

expiration_timestamp_secsU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

payloadobject & EntryFunctionPayload | object & ScriptPayload | object & ModuleBundlePayload | object & MultisigPayloadrequired

An enum of the possible transaction payloads

signatureobject & Ed25519Signature | object & MultiEd25519Signature | object & MultiAgentSignature | object & FeePayerSignature | object & object & Ed25519Signature | object & MultiEd25519Signature | object & SingleKeySignature | object & MultiKeySignaturerequired

An enum representing the different transaction signatures available

application/x.aptos.signed_transaction+bcsArray<integer>
Array<integer>

Response

202Accepted
206Partial Content
400Bad Request
403Forbidden
404Not Found
413Payload Too Large
500Internal Server Error
503Service Unavailable
507

Authorization

api-keyAuthapiKey in header

Simulate transaction

POST
https://apt.nownodes.io/v1/transactions/simulate

The output of the transaction will have the exact transaction outputs and events that running an actual signed transaction would have. However, it will not have the associated state hashes, as they are not updated in storage. This can be used to estimate the maximum gas units for a submitted transaction.

To use this, you must:

  • Create a SignedTransaction with a zero-padded signature.
  • Submit a SubmitTransactionRequest containing a UserTransactionRequest containing that signature.

To use this endpoint with BCS, you must submit a SignedTransaction encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs.

Body

application/json
application/jsonSubmitTransactionRequest

A request to submit a transaction

This requires a transaction and a signature of it

senderAddress<hex>required

A hex encoded 32 byte Aptos account address.

This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.

For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.

sequence_numberU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

max_gas_amountU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

gas_unit_priceU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

expiration_timestamp_secsU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

payloadobject & EntryFunctionPayload | object & ScriptPayload | object & ModuleBundlePayload | object & MultisigPayloadrequired

An enum of the possible transaction payloads

signatureobject & Ed25519Signature | object & MultiEd25519Signature | object & MultiAgentSignature | object & FeePayerSignature | object & object & Ed25519Signature | object & MultiEd25519Signature | object & SingleKeySignature | object & MultiKeySignaturerequired

An enum representing the different transaction signatures available

application/x.aptos.signed_transaction+bcsArray<integer>
Array<integer>

Parameters

estimate_max_gas_amountbooleanquery

If set to true, the max gas value in the transaction will be ignored and the maximum possible gas will be used

estimate_gas_unit_pricebooleanquery

If set to true, the gas unit price in the transaction will be ignored and the estimated value will be used

estimate_prioritized_gas_unit_pricebooleanquery

If set to true, the transaction will use a higher price than the original estimate.

Response

200OK
400Bad Request
403Forbidden
404Not Found
413Payload Too Large
500Internal Server Error
503Service Unavailable
507

Authorization

api-keyAuthapiKey in header

Encode submission

POST
https://apt.nownodes.io/v1/transactions/encode_submission

This endpoint accepts an EncodeSubmissionRequest, which internally is a UserTransactionRequestInner (and optionally secondary signers) encoded as JSON, validates the request format, and then returns that request encoded in BCS. The client can then use this to create a transaction signature to be used in a SubmitTransactionRequest, which it then passes to the /transactions POST endpoint.

To be clear, this endpoint makes it possible to submit transaction requests to the API from languages that do not have library support for BCS. If you are using an SDK that has BCS support, such as the official Rust, TypeScript, or Python SDKs, you do not need to use this endpoint.

To sign a message using the response from this endpoint:

  • Decode the hex encoded string in the response to bytes.
  • Sign the bytes to create the signature.
  • Use that as the signature field in something like Ed25519Signature, which you then use to build a TransactionSignature.

Body

application/json

Request to encode a submission

senderAddress<hex>required

A hex encoded 32 byte Aptos account address.

This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.

For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.

sequence_numberU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

max_gas_amountU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

gas_unit_priceU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

expiration_timestamp_secsU64<uint64>required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

payloadobject & EntryFunctionPayload | object & ScriptPayload | object & ModuleBundlePayload | object & MultisigPayloadrequired

An enum of the possible transaction payloads

secondary_signersArray<Address>

Secondary signer accounts of the request for Multi-agent

Response

200OK
400Bad Request
403Forbidden
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

Estimate gas price

GET
https://apt.nownodes.io/v1/estimate_gas_price

Gives an estimate of the gas unit price required to get a transaction on chain in a reasonable amount of time. The gas unit price is the amount that each transaction commits to pay for each unit of gas consumed in executing the transaction. The estimate is based on recent history: it gives the minimum gas that would have been required to get into recent blocks, for blocks that were full. (When blocks are not full, the estimate will match the minimum gas unit price.)

The estimation is given in three values: de-prioritized (low), regular, and prioritized (aggressive). Using a more aggressive value increases the likelihood that the transaction will make it into the next block; more aggressive values are computed with a larger history and higher percentile statistics. More details are in AIP-34.

Response

200OK
400Bad Request
403Forbidden
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header

View

View functions,

Execute view function of a module

POST
https://apt.nownodes.io/v1/view

Execute the Move function with the given parameters and return its execution result.

The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.

Body

application/json
application/jsonViewRequest

View request for the Move View Function API

functionEntryFunctionIdrequired

Entry function id is string representation of a entry function defined on-chain.

Format: {address}::{module name}::{function name}

Both module name and function name are case-sensitive.

type_argumentsArray<MoveType>required

Type arguments of the function

argumentsArray<any>required

Arguments of the function

application/x.aptos.view_function+bcsArray<integer>
Array<integer>

Parameters

ledger_versionU64<uint64>query

Ledger version to get state of account

If not provided, it will be the latest version

Response

200OK
400Bad Request
403Forbidden
404Not Found
410Gone
500Internal Server Error
503Service Unavailable

Authorization

api-keyAuthapiKey in header