v2

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2022-07-19176455.9 KB
transactions

Create transaction signing message

This API creates transaction signing message for client to create transaction signature.

The success response contains hex-encoded signing message bytes.

To sign the message

  1. Client first needs to HEX decode the message into bytes.
  2. Then sign the bytes to create signature.
post/transactions/signing_message

Request body

senderstring address required

Hex-encoded 16 bytes Aptos account address.

Prefixed with 0x and leading zeros are trimmed.

See doc for more details.

sequence_numberstring uint64 required

Unsigned int64 type value

max_gas_amountstring uint64 required

Unsigned int64 type value

gas_unit_pricestring uint64 required

Unsigned int64 type value

gas_currency_codestring
expiration_timestamp_secsstring uint64 required

Timestamp in seconds, e.g. transaction expiration timestamp.

secondary_signersAddress[]

Example request

{
  "sender": "0xdd",
  "sequence_number": "32425224034",
  "max_gas_amount": "32425224034",
  "gas_unit_price": "32425224034",
  "gas_currency_code": "XDX",
  "expiration_timestamp_secs": "1635447454",
  "payload": {
    "type": "script_function_payload",
    "function": "0x1::payment_scripts::peer_to_peer_with_metadata",
    "type_arguments": [
      "0x1::xdx::XDX"
    ],
    "arguments": [
      "0x1668f6be25668c1a17cd8caf6b8d2f25",
      "2021000000",
      "0x",
      "0x"
    ]
  },
  "secondary_signers": [
    "0xdd"
  ]
}

Response

Returns hex-encoded transaction signing message bytes.

messagestring hex required

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

Different with Address type, hex-encoded bytes should not trim any zeros.

Example response

{
  "message": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1"
}