<?php

/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

$keyregex = "/[a-z0-9]{64}/";

$APIS = [
    "ping" => [
        "load" => "ping.php",
        "insecure" => true,
        "vars" => [
        ]
    ],
    "signup" => [
        "load" => "addaccount.php",
        "insecure" => true,
        "vars" => [
            "username" => "string",
            "password" => "string",
            "accttype" => "/(giver|receiver)/"
        ]
    ],
    "getkey" => [
        "load" => "getkey.php",
        "insecure" => true,
        "vars" => [
            "OR user" => [
                "username" => "/[a-zA-Z0-9]+/",
                "email" => "/.+/",
                "phone" => "/[0-9]{10,}/"
            ],
            "OR pass" => [
                "password (optional)" => "string",
                "pin (optional)" => "/[0-9]{4,10}"
            ]
        ]
    ],
    "checkkey" => [
        "load" => "checkkey.php",
        "vars" => [
            "key" => $keyregex
        ]
    ],
    "checkbalance" => [
        "load" => "balance.php",
        "vars" => [
            "key" => $keyregex
        ]
    ],
    "sendmoney" => [
        "load" => "send.php",
        "vars" => [
            "key" => $keyregex,
            "to" => "/[0-9a-z]+/",
            "amount" => "/[0-9]{1,4}(\.[0-9]{2})?/"
        ]
    ],
    "getprofile" => [
        "load" => "profile.php",
        "vars" => [
            "key" => $keyregex,
            "id (optional)" => "/[0-9a-z]+/"
        ]
    ]
];
