def get_account_idx_for_deploy(accounts: int, deploy_idx: int) -> int:
    """Returns account index to use for a particular transfer.
    
    :param accounts: Number of accounts within batch.
    :param deploy_idx: Index of deploy within batch.
    :returns: Ordinal index of account used to dispatch deploy.

    """
    return deploy_idx if accounts == 0 else \
           deploy_idx % accounts or accounts