def parse_script_type(t):
    """ Parses a script type obtained from a query to blockcyper's API.

    :param t: script type to be parsed.
    :type t: str
    :return: The parsed script type.
    :rtype: str
    """
    if t == 'pay-to-multi-pubkey-hash':
        r = 'P2MS'
    elif t == 'pay-to-pubkey':
        r = 'P2PK'
    elif t == 'pay-to-pubkey-hash':
        r = 'P2PKH'
    elif t == 'pay-to-script-hash':
        r = 'P2PSH'
    else:
        r = 'unknown'
    return r
