Sign message

post

Signs a message using the provided account name and authorization token.

Authorizations
AuthorizationstringRequired
Path parameters
accountNamestringRequired
  • The name of the account to sign the message with.
Header parameters
AuthorizationstringRequired
  • The authorization token for the request.
Body
  • The body of the request containing the message to be signed.
chain_idstringOptional

The ID of the blockchain network.

namestringOptional

The name associated with the message.

datastringRequired

The data to be signed.

encodingstringOptional

The encoding format of the data.

headerbooleanOptional

Indicates if the message includes a header.

signtypebooleanOptional

Indicates if the message includes a signature type.

Responses
200

A promise that resolves to a SignMessageAPIResponse object containing the result of the sign message operation.

application/json
post
/accounts/{accountName}/sign-message
POST /accounts/{accountName}/sign-message HTTP/1.1
Host: beta.usemoon.ai/
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 95

{
  "chain_id": "text",
  "name": "text",
  "data": "text",
  "encoding": "text",
  "header": true,
  "signtype": true
}
200

A promise that resolves to a SignMessageAPIResponse object containing the result of the sign message operation.

{
  "success": true,
  "message": "text",
  "body": {
    "to": "text",
    "data": "text",
    "value": "text",
    "gasLimit": "text",
    "nonce": "text",
    "simulate": true,
    "gas": "text",
    "gasPrice": "text",
    "maxFeePerGas": "text",
    "maxPriorityFeePerGas": "text",
    "chain_id": "text",
    "encoding": "text",
    "type": 1,
    "accessList": [
      {
        "address": "text",
        "storageKeys": [
          "text"
        ]
      }
    ],
    "blobGas": "text",
    "blobGasFeeCap": "text",
    "blobHashes": [
      "text"
    ],
    "dryrun": true,
    "input": "text",
    "EOA": true,
    "contract_address": "text",
    "token_id": "text",
    "token_ids": "text",
    "approved": true,
    "broadcast": true,
    "alwaysIncrementNonce": true,
    "asset": "text",
    "amount": "text",
    "interestRateMode": 1,
    "referralCode": 1,
    "onBehalfOf": "text",
    "receiverAddress": "text",
    "assets": [
      "text"
    ],
    "amounts": [
      "text"
    ],
    "modes": [
      1
    ],
    "params": "text",
    "rateMode": 1,
    "useAsCollateral": true,
    "collateralAsset": "text",
    "debtAsset": "text",
    "user": "text",
    "debtToCover": "text",
    "receiveAToken": true,
    "inputTokens": [
      {
        "tokenAddress": "text",
        "amount": "text"
      }
    ],
    "outputTokens": [
      {
        "tokenAddress": "text",
        "proportion": 1
      }
    ],
    "slippageLimitPercent": 1,
    "minHealthFactor": "text",
    "premiums": [
      "text"
    ],
    "initiator": "text",
    "role": "text",
    "account": "text",
    "initialDeposit": "text",
    "borrowAmount": "text"
  },
  "address": "text",
  "data": {
    "moon_scan_url": "text",
    "transaction_hash": "text",
    "signed_transaction": "text",
    "signed_message": "text",
    "raw_transaction": "text",
    "signature": "text",
    "transaction": {
      "type": 1,
      "chain_id": 1,
      "data": "text",
      "gas": "text",
      "gas_price": "text",
      "gas_tip_cap": "text",
      "gas_fee_cap": "text",
      "value": "text",
      "nonce": 1,
      "from": "text",
      "to": "text",
      "blob_gas": "text",
      "blob_gas_fee_cap": "text",
      "blob_hashes": [
        "text"
      ],
      "v": "text",
      "r": "text",
      "s": "text"
    },
    "userOps": [
      {
        "nonce": "text",
        "data": "text",
        "value": "text",
        "to": "text",
        "from": "text",
        "maxFeePerGas": "text",
        "maxPriorityFeePerGas": "text"
      }
    ],
    "userop_transaction": "text"
  }
}