{
  "title": "AddressTransactionWithTransfers",
  "description": "Transaction with STX transfers for a given address",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "tx",
    "stx_sent",
    "stx_received",
    "stx_transfers"
  ],
  "properties": {
    "tx": {
      "$ref": "../transactions/transaction.schema.json"
    },
    "stx_sent": {
      "type": "string",
      "description": "Total sent from the given address, including the tx fee, in micro-STX as an integer string."
    },
    "stx_received": {
      "type": "string",
      "description": "Total received by the given address in micro-STX as an integer string."
    },
    "stx_transfers": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount transferred in micro-STX as an integer string."
          },
          "sender": {
            "type": "string",
            "description": "Principal that sent STX. This is unspecified if the STX were minted."
          },
          "recipient": {
            "type": "string",
            "description": "Principal that received STX. This is unspecified if the STX were burned."
          }
        }
      }
    },
    "ft_transfers": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amount", "asset_identifier"
        ],
        "properties": {
          "asset_identifier": {
            "type": "string",
            "description": "Fungible Token asset identifier."
          },
          "amount": {
            "type": "string",
            "description": "Amount transferred as an integer string. This balance does not factor in possible SIP-010 decimals."
          },
          "sender": {
            "type": "string",
            "description": "Principal that sent the asset."
          },
          "recipient": {
            "type": "string",
            "description": "Principal that received the asset."
          }
        }
      }
    },
    "nft_transfers": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "asset_identifier", "value"
        ],
        "properties": {
          "asset_identifier": {
            "type": "string",
            "description": "Non Fungible Token asset identifier."
          },
          "value": {
            "type": "object",
            "description": "Non Fungible Token asset value.",
            "additionalProperties": false,
            "required": ["hex", "repr"],
            "properties": {
              "hex": {
                "type": "string"
              },
              "repr": {
                "type": "string"
              }
            }
          },
          "sender": {
            "type": "string",
            "description": "Principal that sent the asset."
          },
          "recipient": {
            "type": "string",
            "description": "Principal that received the asset."
          }
        }
      }
    }
  }
}
