{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hashlock-markets/json-schema/hashlock-markets-signing-material-schema.json",
  "title": "SigningMaterial",
  "description": "What to sign, per chain family; `sign` says which shape it is. `evm-tx`: sign and send each of `txs` in order, from `from` when given. `btc-payment` (fund): pay `amountSats` to `payTo` (and `feeAmountSats` to `feePayTo` when present). `btc-sighash` (claim/refund): sign each of `sighashHexes`, then broadcast `{ psbtBase64, signaturesHex, preimageHex? }`. `solana-tx`: sign `transactionBase64` and broadcast it. `tron-txid`: sign each `transactions[].txID` and broadcast each signed `transaction`.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hashlock-markets-openapi.json#/components/schemas/SigningMaterial",
  "type": "object",
  "required": [
    "chain",
    "family",
    "sign"
  ],
  "properties": {
    "chain": {
      "type": "string"
    },
    "family": {
      "type": "string",
      "enum": [
        "evm",
        "bitcoin",
        "svm",
        "tvm"
      ]
    },
    "sign": {
      "type": "string",
      "enum": [
        "evm-tx",
        "btc-payment",
        "btc-sighash",
        "solana-tx",
        "tron-txid"
      ]
    },
    "note": {
      "type": "string",
      "description": "what to do with it, in words"
    },
    "chainId": {
      "type": "integer",
      "description": "evm-tx"
    },
    "from": {
      "type": "string",
      "description": "evm-tx (fund) and tron-txid: the address that must sign"
    },
    "txs": {
      "type": "array",
      "description": "evm-tx: unsigned transactions (an ERC-20 fund is approve, then createSwap)",
      "items": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "value": {
            "type": "string",
            "description": "hex wei"
          }
        }
      }
    },
    "payTo": {
      "type": "string",
      "description": "btc-payment: the escrow (P2WSH) address"
    },
    "amountSats": {
      "type": [
        "string",
        "integer"
      ],
      "description": "btc-payment: sats still due to the escrow (string); btc-sighash: what the spend pays out after the network fee (integer)"
    },
    "topUp": {
      "type": "boolean",
      "description": "btc-payment: the escrow already holds part of the amount"
    },
    "feePayTo": {
      "type": "string",
      "description": "btc-payment: the protocol fee treasury, when this leg carries the fee"
    },
    "feeAmountSats": {
      "type": "string",
      "description": "btc-payment: the protocol fee in sats"
    },
    "toAddress": {
      "type": "string",
      "description": "btc-sighash: where the spend pays"
    },
    "psbtBase64": {
      "type": "string",
      "description": "btc-sighash"
    },
    "sighashHex": {
      "type": "string",
      "description": "btc-sighash: equals sighashHexes[0]"
    },
    "sighashHexes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "btc-sighash: one per input, same key"
    },
    "feeSats": {
      "type": "integer",
      "description": "btc-sighash: the network fee"
    },
    "preimageHex": {
      "type": "string",
      "description": "btc-sighash, claim: the secret you sent, to pass back on broadcast"
    },
    "timelockUnix": {
      "type": "integer",
      "description": "refund (btc-sighash, solana-tx): the leg timelock"
    },
    "escrow": {
      "type": "string",
      "description": "solana-tx: the escrow account"
    },
    "transactionBase64": {
      "type": "string",
      "description": "solana-tx: the unsigned transaction"
    },
    "blockhash": {
      "type": "string",
      "description": "solana-tx"
    },
    "lastValidBlockHeight": {
      "type": "integer",
      "description": "solana-tx: rebuild once the chain passes it"
    },
    "transactions": {
      "type": "array",
      "description": "tron-txid: unsigned transactions (a TRC-20 fund is approve, then fund)",
      "items": {
        "type": "object",
        "properties": {
          "transaction": {
            "type": "object"
          },
          "txID": {
            "type": "string"
          }
        }
      }
    }
  }
}