{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/makememoneynomistakes-ai/json-schema/makememoneynomistakes-ai-payment-history-schema.json",
  "title": "PaymentHistory",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/makememoneynomistakes-ai-openapi.json#/components/schemas/PaymentHistory",
  "type": "object",
  "required": [
    "batch_id",
    "window",
    "target_agents",
    "agents",
    "items",
    "next_cursor",
    "score_eligible"
  ],
  "properties": {
    "batch_id": {
      "type": "string"
    },
    "published_at": {
      "type": "string"
    },
    "version": {
      "type": "integer",
      "const": 1
    },
    "window": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "from_block": {
          "type": "integer"
        },
        "to_block": {
          "type": "integer"
        },
        "finalized_block_hash": {
          "type": "string"
        }
      }
    },
    "source_read_at": {
      "type": "string"
    },
    "directory_snapshot_id": {
      "type": "integer"
    },
    "chain_id": {
      "type": "integer",
      "const": 8453
    },
    "asset": {
      "type": "string"
    },
    "decimals": {
      "type": "integer",
      "const": 6
    },
    "target_agents": {
      "type": "integer"
    },
    "wallets": {
      "type": "integer"
    },
    "transfers": {
      "type": "integer"
    },
    "transactions": {
      "type": "integer"
    },
    "eip3009_compatible": {
      "type": "integer"
    },
    "self_transfers": {
      "type": "integer"
    },
    "shared_wallet_transfers": {
      "type": "integer"
    },
    "amount_atomic": {
      "type": "string"
    },
    "amount_usdc": {
      "type": "string"
    },
    "score_eligible": {
      "type": "boolean",
      "const": false
    },
    "note": {
      "type": "string"
    },
    "agent": {
      "type": [
        "string",
        "null"
      ]
    },
    "agents": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "agent_ref",
          "wallets",
          "transfers"
        ],
        "properties": {
          "agent_ref": {
            "type": "string"
          },
          "hosts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "link_checked_at": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "wallets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string"
                },
                "agent_refs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "transfers": {
            "type": "integer"
          },
          "eip3009_compatible": {
            "type": "integer"
          },
          "self_transfers": {
            "type": "integer"
          },
          "amount_atomic": {
            "type": "string"
          },
          "amount_usdc": {
            "type": "string"
          }
        }
      }
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PaymentTransfer"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "$defs": {
    "PaymentTransfer": {
      "type": "object",
      "required": [
        "id",
        "chain_id",
        "asset",
        "from",
        "to",
        "amount_atomic",
        "amount_usdc",
        "block",
        "block_hash",
        "ts",
        "tx",
        "log_index",
        "agent_refs",
        "classification",
        "authorization_nonce",
        "self_transfer",
        "score_eligible",
        "explorer"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "chain_id": {
          "type": "integer",
          "const": 8453
        },
        "asset": {
          "type": "string"
        },
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "amount_atomic": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "amount_usdc": {
          "type": "string"
        },
        "block": {
          "type": "integer"
        },
        "block_hash": {
          "type": "string"
        },
        "ts": {
          "type": "string"
        },
        "tx": {
          "type": "string"
        },
        "log_index": {
          "type": "integer"
        },
        "agent_refs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "classification": {
          "type": "string",
          "enum": [
            "eip3009_compatible",
            "usdc_transfer_only"
          ]
        },
        "authorization_nonce": {
          "type": [
            "string",
            "null"
          ]
        },
        "self_transfer": {
          "type": "boolean"
        },
        "score_eligible": {
          "type": "boolean",
          "const": false
        },
        "explorer": {
          "type": "string"
        }
      }
    }
  }
}